@expo/html-elements 0.12.2 → 0.12.4

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 (149) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/build/css/createSafeStyledView.native.d.ts +1 -1
  3. package/build/css/createSafeStyledView.native.d.ts.map +1 -1
  4. package/build/elements/Anchor.d.ts +2 -2
  5. package/build/elements/Anchor.d.ts.map +1 -1
  6. package/build/elements/Headings.d.ts.map +1 -1
  7. package/build/elements/Layout.d.ts.map +1 -1
  8. package/build/elements/Lists.d.ts +2 -2
  9. package/build/elements/Lists.d.ts.map +1 -1
  10. package/build/elements/Rules.d.ts +2 -2
  11. package/build/elements/Rules.d.ts.map +1 -1
  12. package/build/elements/Rules.web.d.ts +1 -2
  13. package/build/elements/Rules.web.d.ts.map +1 -1
  14. package/build/elements/Table.d.ts +9 -9
  15. package/build/elements/Table.d.ts.map +1 -1
  16. package/build/elements/Table.web.d.ts.map +1 -1
  17. package/build/elements/Text.d.ts +15 -15
  18. package/build/elements/Text.d.ts.map +1 -1
  19. package/build/primitives/RNWView.d.ts +4 -2
  20. package/build/primitives/RNWView.d.ts.map +1 -1
  21. package/build/primitives/createDevView.d.ts +1 -1
  22. package/build/primitives/createDevView.d.ts.map +1 -1
  23. package/jest-setup.js +1 -0
  24. package/package.json +13 -7
  25. package/{build/Elements.js → src/Elements.tsx} +0 -1
  26. package/src/css/__tests__/__snapshots__/createSafeStyledView.test.native.tsx.snap.android +31 -0
  27. package/src/css/__tests__/__snapshots__/createSafeStyledView.test.native.tsx.snap.ios +31 -0
  28. package/src/css/__tests__/createSafeStyledView.test.native.tsx +54 -0
  29. package/src/css/createSafeStyledView.native.tsx +12 -0
  30. package/src/css/createSafeStyledView.tsx +4 -0
  31. package/src/css/filterStyles.ts +92 -0
  32. package/src/css/units.ts +11 -0
  33. package/src/elements/Anchor.tsx +27 -0
  34. package/src/elements/Headings.tsx +81 -0
  35. package/src/elements/Layout.tsx +72 -0
  36. package/src/elements/Lists.tsx +45 -0
  37. package/src/elements/Rules.tsx +18 -0
  38. package/src/elements/Rules.web.tsx +7 -0
  39. package/src/elements/Table.tsx +59 -0
  40. package/src/elements/Table.web.tsx +38 -0
  41. package/src/elements/Text.tsx +111 -0
  42. package/src/elements/Text.types.ts +21 -0
  43. package/src/elements/__tests__/Anchor.test.ios.tsx +10 -0
  44. package/src/elements/__tests__/Anchor.test.web.tsx +11 -0
  45. package/src/elements/__tests__/Headings.test.ios.tsx +13 -0
  46. package/src/elements/__tests__/Layout.test.ios.tsx +40 -0
  47. package/src/elements/__tests__/Layout.test.web.tsx +50 -0
  48. package/src/elements/__tests__/Lists.test.native.tsx +17 -0
  49. package/src/elements/__tests__/Lists.test.web.tsx +41 -0
  50. package/src/elements/__tests__/Rules.test.native.tsx +10 -0
  51. package/src/elements/__tests__/Rules.test.web.tsx +8 -0
  52. package/src/elements/__tests__/Table.test.ios.tsx +45 -0
  53. package/src/elements/__tests__/Table.test.web.tsx +49 -0
  54. package/src/elements/__tests__/Text.test.ios.tsx +102 -0
  55. package/src/elements/__tests__/__snapshots__/Anchor-test.tsx.snap.android +8 -0
  56. package/src/elements/__tests__/__snapshots__/Anchor-test.tsx.snap.ios +8 -0
  57. package/src/elements/__tests__/__snapshots__/Anchor-test.tsx.snap.web +12 -0
  58. package/src/elements/__tests__/__snapshots__/Anchor.test.ios.tsx.snap.ios +8 -0
  59. package/src/elements/__tests__/__snapshots__/Anchor.test.tsx.snap.android +8 -0
  60. package/src/elements/__tests__/__snapshots__/Anchor.test.tsx.snap.ios +8 -0
  61. package/src/elements/__tests__/__snapshots__/Anchor.test.tsx.snap.web +12 -0
  62. package/src/elements/__tests__/__snapshots__/Headings-test.tsx.snap.android +79 -0
  63. package/src/elements/__tests__/__snapshots__/Headings-test.tsx.snap.ios +79 -0
  64. package/src/elements/__tests__/__snapshots__/Headings-test.tsx.snap.web +61 -0
  65. package/src/elements/__tests__/__snapshots__/Headings.test.ios.tsx.snap.ios +79 -0
  66. package/src/elements/__tests__/__snapshots__/Layout-test.tsx.snap.android +23 -0
  67. package/src/elements/__tests__/__snapshots__/Layout-test.tsx.snap.ios +23 -0
  68. package/src/elements/__tests__/__snapshots__/Layout-test.tsx.snap.web +64 -0
  69. package/src/elements/__tests__/__snapshots__/Layout.test.ios.tsx.snap.ios +23 -0
  70. package/src/elements/__tests__/__snapshots__/Layout.test.tsx.snap.android +23 -0
  71. package/src/elements/__tests__/__snapshots__/Layout.test.tsx.snap.ios +23 -0
  72. package/src/elements/__tests__/__snapshots__/Layout.test.tsx.snap.web +64 -0
  73. package/src/elements/__tests__/__snapshots__/Lists-test.tsx.snap.android +14 -0
  74. package/src/elements/__tests__/__snapshots__/Lists-test.tsx.snap.ios +14 -0
  75. package/src/elements/__tests__/__snapshots__/Lists-test.tsx.snap.web +34 -0
  76. package/src/elements/__tests__/__snapshots__/Lists.test.native.tsx.snap.android +14 -0
  77. package/src/elements/__tests__/__snapshots__/Lists.test.native.tsx.snap.ios +14 -0
  78. package/src/elements/__tests__/__snapshots__/Rules-test.tsx.snap.android +15 -0
  79. package/src/elements/__tests__/__snapshots__/Rules-test.tsx.snap.ios +15 -0
  80. package/src/elements/__tests__/__snapshots__/Rules-test.tsx.snap.web +7 -0
  81. package/src/elements/__tests__/__snapshots__/Rules.test.native.tsx.snap.android +15 -0
  82. package/src/elements/__tests__/__snapshots__/Rules.test.native.tsx.snap.ios +15 -0
  83. package/src/elements/__tests__/__snapshots__/Table-test.tsx.snap.android +60 -0
  84. package/src/elements/__tests__/__snapshots__/Table-test.tsx.snap.ios +60 -0
  85. package/src/elements/__tests__/__snapshots__/Table-test.tsx.snap.web +71 -0
  86. package/src/elements/__tests__/__snapshots__/Table.test.ios.tsx.snap.ios +60 -0
  87. package/src/elements/__tests__/__snapshots__/Table.test.tsx.snap.android +60 -0
  88. package/src/elements/__tests__/__snapshots__/Table.test.tsx.snap.ios +60 -0
  89. package/src/elements/__tests__/__snapshots__/Table.test.tsx.snap.web +71 -0
  90. package/src/elements/__tests__/__snapshots__/Text-test.tsx.snap.android +174 -0
  91. package/src/elements/__tests__/__snapshots__/Text-test.tsx.snap.ios +174 -0
  92. package/src/elements/__tests__/__snapshots__/Text-test.tsx.snap.web +149 -0
  93. package/src/elements/__tests__/__snapshots__/Text.test.ios.tsx.snap.ios +174 -0
  94. package/src/primitives/Image.tsx +30 -0
  95. package/src/primitives/RNWView.tsx +178 -0
  96. package/src/primitives/Table.ts +14 -0
  97. package/src/primitives/Text.tsx +68 -0
  98. package/src/primitives/View.tsx +145 -0
  99. package/src/primitives/__tests__/__snapshots__/createDevView.test.ios.tsx.snap.ios +35 -0
  100. package/src/primitives/__tests__/__snapshots__/createDevView.test.tsx.snap.android +35 -0
  101. package/src/primitives/__tests__/__snapshots__/createDevView.test.tsx.snap.ios +35 -0
  102. package/src/primitives/__tests__/__snapshots__/createDevView.test.tsx.snap.web +30 -0
  103. package/src/primitives/__tests__/__snapshots__/createDevView.test.web.tsx.snap.web +27 -0
  104. package/src/primitives/__tests__/createDevView.test.tsx +53 -0
  105. package/src/primitives/createDevView.tsx +48 -0
  106. package/src/ts-declarations/process.d.ts +7 -0
  107. package/src/ts-declarations/react-native-web.d.ts +1016 -0
  108. package/tsconfig.json +2 -2
  109. package/build/Elements.js.map +0 -1
  110. package/build/css/createSafeStyledView.js +0 -5
  111. package/build/css/createSafeStyledView.js.map +0 -1
  112. package/build/css/createSafeStyledView.native.js +0 -10
  113. package/build/css/createSafeStyledView.native.js.map +0 -1
  114. package/build/css/filterStyles.js +0 -83
  115. package/build/css/filterStyles.js.map +0 -1
  116. package/build/css/units.js +0 -12
  117. package/build/css/units.js.map +0 -1
  118. package/build/elements/Anchor.js +0 -25
  119. package/build/elements/Anchor.js.map +0 -1
  120. package/build/elements/Headings.js +0 -78
  121. package/build/elements/Headings.js.map +0 -1
  122. package/build/elements/Layout.js +0 -46
  123. package/build/elements/Layout.js.map +0 -1
  124. package/build/elements/Lists.js +0 -33
  125. package/build/elements/Lists.js.map +0 -1
  126. package/build/elements/Rules.js +0 -16
  127. package/build/elements/Rules.js.map +0 -1
  128. package/build/elements/Rules.web.js +0 -6
  129. package/build/elements/Rules.web.js.map +0 -1
  130. package/build/elements/Table.js +0 -50
  131. package/build/elements/Table.js.map +0 -1
  132. package/build/elements/Table.web.js +0 -27
  133. package/build/elements/Table.web.js.map +0 -1
  134. package/build/elements/Text.js +0 -92
  135. package/build/elements/Text.js.map +0 -1
  136. package/build/elements/Text.types.js +0 -2
  137. package/build/elements/Text.types.js.map +0 -1
  138. package/build/primitives/Image.js +0 -5
  139. package/build/primitives/Image.js.map +0 -1
  140. package/build/primitives/RNWView.js +0 -122
  141. package/build/primitives/RNWView.js.map +0 -1
  142. package/build/primitives/Table.js +0 -3
  143. package/build/primitives/Table.js.map +0 -1
  144. package/build/primitives/Text.js +0 -5
  145. package/build/primitives/Text.js.map +0 -1
  146. package/build/primitives/View.js +0 -10
  147. package/build/primitives/View.js.map +0 -1
  148. package/build/primitives/createDevView.js +0 -43
  149. package/build/primitives/createDevView.js.map +0 -1
package/tsconfig.json CHANGED
@@ -1,8 +1,8 @@
1
- // @generated by expo-module-scripts
2
1
  {
3
2
  "extends": "expo-module-scripts/tsconfig.base",
4
3
  "compilerOptions": {
5
- "outDir": "./build"
4
+ "outDir": "./build",
5
+ "emitDeclarationOnly": true
6
6
  },
7
7
  "include": ["./src"],
8
8
  "exclude": ["**/__mocks__/*", "**/__tests__/*", "**/__rsc_tests__/*"]
@@ -1 +0,0 @@
1
- {"version":3,"file":"Elements.js","sourceRoot":"","sources":["../src/Elements.tsx"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC","sourcesContent":["export * from './elements/Headings';\nexport * from './elements/Anchor';\nexport * from './elements/Layout';\nexport * from './elements/Text';\nexport * from './elements/Rules';\nexport * from './elements/Table';\nexport * from './elements/Lists';\n"]}
@@ -1,5 +0,0 @@
1
- export function createSafeStyledView(View) {
2
- // Do nothing by default
3
- return View;
4
- }
5
- //# sourceMappingURL=createSafeStyledView.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createSafeStyledView.js","sourceRoot":"","sources":["../../src/css/createSafeStyledView.tsx"],"names":[],"mappings":"AAAA,MAAM,UAAU,oBAAoB,CAAQ,IAAW;IACrD,wBAAwB;IACxB,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["export function createSafeStyledView<TView>(View: TView) {\n // Do nothing by default\n return View;\n}\n"]}
@@ -1,10 +0,0 @@
1
- import React, { useMemo } from 'react';
2
- import { filterStyles } from './filterStyles';
3
- export function createSafeStyledView(View) {
4
- return React.forwardRef(({ style, ...props }, forwardedRef) => {
5
- // Filter and apply `center` prop.
6
- const finalStyle = useMemo(() => filterStyles(style), [style]);
7
- return <View ref={forwardedRef} style={finalStyle} {...props}/>;
8
- });
9
- }
10
- //# sourceMappingURL=createSafeStyledView.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createSafeStyledView.native.js","sourceRoot":"","sources":["../../src/css/createSafeStyledView.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,UAAU,oBAAoB,CAAyC,IAAW;IACtF,OAAO,KAAK,CAAC,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAO,EAAE,YAA8B,EAAE,EAAE;QACnF,kCAAkC;QAClC,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;QAE/D,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;IACnE,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import React, { useMemo } from 'react';\n\nimport { filterStyles } from './filterStyles';\n\nexport function createSafeStyledView<TView extends React.ComponentType<any>>(View: TView) {\n return React.forwardRef(({ style, ...props }: any, forwardedRef: React.Ref<TView>) => {\n // Filter and apply `center` prop.\n const finalStyle = useMemo(() => filterStyles(style), [style]);\n\n return <View ref={forwardedRef} style={finalStyle} {...props} />;\n });\n}\n"]}
@@ -1,83 +0,0 @@
1
- import { StyleSheet } from 'react-native';
2
- // Remove the unsupported web styles from the style object
3
- // to prevent crashing.
4
- const WEB_STYLES = [
5
- 'backdropFilter',
6
- 'animationDelay',
7
- 'animationDirection',
8
- 'animationDuration',
9
- 'animationFillMode',
10
- 'animationName',
11
- 'animationIterationCount',
12
- 'animationPlayState',
13
- 'animationTimingFunction',
14
- 'backgroundAttachment',
15
- 'backgroundBlendMode',
16
- 'backgroundClip',
17
- 'backgroundImage',
18
- 'backgroundOrigin',
19
- 'backgroundPosition',
20
- 'backgroundRepeat',
21
- 'backgroundSize',
22
- 'boxShadow',
23
- 'boxSizing',
24
- 'clip',
25
- 'cursor',
26
- 'filter',
27
- 'gridAutoColumns',
28
- 'gridAutoFlow',
29
- 'gridAutoRows',
30
- 'gridColumnEnd',
31
- 'gridColumnGap',
32
- 'gridColumnStart',
33
- 'gridRowEnd',
34
- 'gridRowGap',
35
- 'gridRowStart',
36
- 'gridTemplateColumns',
37
- 'gridTemplateRows',
38
- 'gridTemplateAreas',
39
- 'outline',
40
- 'outlineColor',
41
- 'overflowX',
42
- 'overflowY',
43
- 'overscrollBehavior',
44
- 'overscrollBehaviorX',
45
- 'overscrollBehaviorY',
46
- 'perspective',
47
- 'perspectiveOrigin',
48
- 'touchAction',
49
- 'transformOrigin',
50
- 'transitionDelay',
51
- 'transitionDuration',
52
- 'transitionProperty',
53
- 'transitionTimingFunction',
54
- 'userSelect',
55
- 'willChange',
56
- ];
57
- export function filterStyles(styleProp) {
58
- if (!styleProp) {
59
- return styleProp;
60
- }
61
- const style = StyleSheet.flatten(styleProp);
62
- const filteredStyle = Object.fromEntries(Object.entries(style).filter(([k]) => !WEB_STYLES.includes(k)));
63
- return processNativeStyles(filteredStyle);
64
- }
65
- function processNativeStyles(style) {
66
- if (!style)
67
- return style;
68
- if (style.visibility) {
69
- if (style.visibility === 'hidden') {
70
- // style.display = "none";
71
- style.opacity = 0;
72
- }
73
- delete style.visibility;
74
- }
75
- if (style.position) {
76
- if (!['absolute', 'relative'].includes(style.position)) {
77
- console.warn(`Unsupported position: '${style.position}'`);
78
- style.position = 'relative';
79
- }
80
- }
81
- return style;
82
- }
83
- //# sourceMappingURL=filterStyles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"filterStyles.js","sourceRoot":"","sources":["../../src/css/filterStyles.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1D,0DAA0D;AAC1D,uBAAuB;AACvB,MAAM,UAAU,GAAG;IACjB,gBAAgB;IAChB,gBAAgB;IAChB,oBAAoB;IACpB,mBAAmB;IACnB,mBAAmB;IACnB,eAAe;IACf,yBAAyB;IACzB,oBAAoB;IACpB,yBAAyB;IACzB,sBAAsB;IACtB,qBAAqB;IACrB,gBAAgB;IAChB,iBAAiB;IACjB,kBAAkB;IAClB,oBAAoB;IACpB,kBAAkB;IAClB,gBAAgB;IAChB,WAAW;IACX,WAAW;IACX,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,iBAAiB;IACjB,cAAc;IACd,cAAc;IACd,eAAe;IACf,eAAe;IACf,iBAAiB;IACjB,YAAY;IACZ,YAAY;IACZ,cAAc;IACd,qBAAqB;IACrB,kBAAkB;IAClB,mBAAmB;IACnB,SAAS;IACT,cAAc;IACd,WAAW;IACX,WAAW;IAC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AC;AACf,CAAC","sourcesContent":["import type { CSSProperties } from 'react';\nimport { type StyleProp, StyleSheet } from 'react-native';\n\n// Remove the unsupported web styles from the style object\n// to prevent crashing.\nconst WEB_STYLES = [\n 'backdropFilter',\n 'animationDelay',\n 'animationDirection',\n 'animationDuration',\n 'animationFillMode',\n 'animationName',\n 'animationIterationCount',\n 'animationPlayState',\n 'animationTimingFunction',\n 'backgroundAttachment',\n 'backgroundBlendMode',\n 'backgroundClip',\n 'backgroundImage',\n 'backgroundOrigin',\n 'backgroundPosition',\n 'backgroundRepeat',\n 'backgroundSize',\n 'boxShadow',\n 'boxSizing',\n 'clip',\n 'cursor',\n 'filter',\n 'gridAutoColumns',\n 'gridAutoFlow',\n 'gridAutoRows',\n 'gridColumnEnd',\n 'gridColumnGap',\n 'gridColumnStart',\n 'gridRowEnd',\n 'gridRowGap',\n 'gridRowStart',\n 'gridTemplateColumns',\n 'gridTemplateRows',\n 'gridTemplateAreas',\n 'outline',\n 'outlineColor',\n 'overflowX',\n 'overflowY',\n 'overscrollBehavior',\n 'overscrollBehaviorX',\n 'overscrollBehaviorY',\n 'perspective',\n 'perspectiveOrigin',\n 'touchAction',\n 'transformOrigin',\n 'transitionDelay',\n 'transitionDuration',\n 'transitionProperty',\n 'transitionTimingFunction',\n 'userSelect',\n 'willChange',\n];\n\nexport function filterStyles(styleProp: StyleProp<any>) {\n if (!styleProp) {\n return styleProp;\n }\n const style = StyleSheet.flatten(styleProp);\n\n const filteredStyle = Object.fromEntries(\n Object.entries(style).filter(([k]) => !WEB_STYLES.includes(k))\n );\n\n return processNativeStyles(filteredStyle);\n}\n\nfunction processNativeStyles(style: CSSProperties) {\n if (!style) return style;\n\n if (style.visibility) {\n if (style.visibility === 'hidden') {\n // style.display = \"none\";\n style.opacity = 0;\n }\n delete style.visibility;\n }\n\n if (style.position) {\n if (!['absolute', 'relative'].includes(style.position)) {\n console.warn(`Unsupported position: '${style.position}'`);\n style.position = 'relative';\n }\n }\n\n return style;\n}\n"]}
@@ -1,12 +0,0 @@
1
- import { PixelRatio, Platform } from 'react-native';
2
- export function rem(value) {
3
- if (Platform.OS === 'web')
4
- return `${value}rem`;
5
- return PixelRatio.getFontScale() * 16 * value;
6
- }
7
- export function em(value) {
8
- if (Platform.OS === 'web')
9
- return `${value}em`;
10
- return rem(value);
11
- }
12
- //# sourceMappingURL=units.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"units.js","sourceRoot":"","sources":["../../src/css/units.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEpD,MAAM,UAAU,GAAG,CAAC,KAAa;IAC/B,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK;QAAE,OAAO,GAAG,KAAK,KAAK,CAAC;IAChD,OAAO,UAAU,CAAC,YAAY,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,EAAE,CAAC,KAAa;IAC9B,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK;QAAE,OAAO,GAAG,KAAK,IAAI,CAAC;IAC/C,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC;AACpB,CAAC","sourcesContent":["import { PixelRatio, Platform } from 'react-native';\n\nexport function rem(value: number): number | string {\n if (Platform.OS === 'web') return `${value}rem`;\n return PixelRatio.getFontScale() * 16 * value;\n}\n\nexport function em(value: number): number | string {\n if (Platform.OS === 'web') return `${value}em`;\n return rem(value);\n}\n"]}
@@ -1,25 +0,0 @@
1
- import React, { forwardRef } from 'react';
2
- import { Linking, Platform } from 'react-native';
3
- import Text from '../primitives/Text';
4
- export const A = forwardRef(({ href, target, download, rel, ...props }, ref) => {
5
- const nativeProps = Platform.select({
6
- web: {
7
- href,
8
- hrefAttrs: {
9
- target,
10
- download,
11
- rel,
12
- },
13
- },
14
- default: {
15
- onPress: (event) => {
16
- props.onPress && props.onPress(event);
17
- if (Platform.OS !== 'web' && href !== undefined) {
18
- Linking.openURL(href);
19
- }
20
- },
21
- },
22
- });
23
- return <Text role="link" {...props} {...nativeProps} ref={ref}/>;
24
- });
25
- //# sourceMappingURL=Anchor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Anchor.js","sourceRoot":"","sources":["../../src/elements/Anchor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,UAAU,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGjD,OAAO,IAAI,MAAM,oBAAoB,CAAC;AAEtC,MAAM,CAAC,MAAM,CAAC,GAAG,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,KAAK,EAAa,EAAE,GAAG,EAAE,EAAE;IACxF,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAY;QAC7C,GAAG,EAAE;YACH,IAAI;YACJ,SAAS,EAAE;gBACT,MAAM;gBACN,QAAQ;gBACR,GAAG;aACJ;SACF;QACD,OAAO,EAAE;YACP,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;gBACjB,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;gBACtC,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;oBAChD,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;gBACxB,CAAC;YACH,CAAC;SACF;KACF,CAAC,CAAC;IACH,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAG,CAAC;AACpE,CAAC,CAA6B,CAAC","sourcesContent":["import React, { ComponentType, forwardRef } from 'react';\nimport { Linking, Platform } from 'react-native';\n\nimport { LinkProps } from './Text.types';\nimport Text from '../primitives/Text';\n\nexport const A = forwardRef(({ href, target, download, rel, ...props }: LinkProps, ref) => {\n const nativeProps = Platform.select<LinkProps>({\n web: {\n href,\n hrefAttrs: {\n target,\n download,\n rel,\n },\n },\n default: {\n onPress: (event) => {\n props.onPress && props.onPress(event);\n if (Platform.OS !== 'web' && href !== undefined) {\n Linking.openURL(href);\n }\n },\n },\n });\n return <Text role=\"link\" {...props} {...nativeProps} ref={ref} />;\n}) as ComponentType<LinkProps>;\n"]}
@@ -1,78 +0,0 @@
1
- import React, { forwardRef } from 'react';
2
- import { Platform, StyleSheet } from 'react-native';
3
- import { em } from '../css/units';
4
- import Text from '../primitives/Text';
5
- function createHeadingComponent(level) {
6
- const nativeProps = Platform.select({
7
- web: {
8
- 'aria-level': level,
9
- role: 'header',
10
- },
11
- default: {
12
- accessibilityRole: 'header',
13
- },
14
- });
15
- return forwardRef((props, ref) => {
16
- return (<Text {...nativeProps} {...props} style={[styles[`h${level}`], props.style]} ref={ref}/>);
17
- });
18
- }
19
- export const H1 = createHeadingComponent(1);
20
- export const H2 = createHeadingComponent(2);
21
- export const H3 = createHeadingComponent(3);
22
- export const H4 = createHeadingComponent(4);
23
- export const H5 = createHeadingComponent(5);
24
- export const H6 = createHeadingComponent(6);
25
- if (__DEV__) {
26
- H1.displayName = 'H1';
27
- H2.displayName = 'H2';
28
- H3.displayName = 'H3';
29
- H4.displayName = 'H4';
30
- H5.displayName = 'H5';
31
- H6.displayName = 'H6';
32
- }
33
- // Default web styles: http://trac.webkit.org/browser/trunk/Source/WebCore/css/html.css
34
- const styles = StyleSheet.create({
35
- h1: {
36
- // @ts-ignore
37
- fontSize: em(2),
38
- // @ts-ignore
39
- marginVertical: em(0.67),
40
- fontWeight: 'bold',
41
- },
42
- h2: {
43
- // @ts-ignore
44
- fontSize: em(1.5),
45
- // @ts-ignore
46
- marginVertical: em(0.83),
47
- fontWeight: 'bold',
48
- },
49
- h3: {
50
- // @ts-ignore
51
- fontSize: em(1.17),
52
- // @ts-ignore
53
- marginVertical: em(1),
54
- fontWeight: 'bold',
55
- },
56
- h4: {
57
- // @ts-ignore
58
- fontSize: em(1),
59
- // @ts-ignore
60
- marginVertical: em(1.33),
61
- fontWeight: 'bold',
62
- },
63
- h5: {
64
- // @ts-ignore
65
- fontSize: em(0.83),
66
- // @ts-ignore
67
- marginVertical: em(1.67),
68
- fontWeight: 'bold',
69
- },
70
- h6: {
71
- // @ts-ignore
72
- fontSize: em(0.67),
73
- // @ts-ignore
74
- marginVertical: em(2.33),
75
- fontWeight: 'bold',
76
- },
77
- });
78
- //# sourceMappingURL=Headings.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Headings.js","sourceRoot":"","sources":["../../src/elements/Headings.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,UAAU,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,IAAmB,MAAM,oBAAoB,CAAC;AAIrD,SAAS,sBAAsB,CAAC,KAAmB;IACjD,MAAM,WAAW,GAAQ,QAAQ,CAAC,MAAM,CAAC;QACvC,GAAG,EAAE;YACH,YAAY,EAAE,KAAK;YACnB,IAAI,EAAE,QAAQ;SACf;QACD,OAAO,EAAE;YACP,iBAAiB,EAAE,QAAQ;SAC5B;KACF,CAAC,CAAC;IACH,OAAO,UAAU,CAAC,CAAC,KAAgB,EAAE,GAAG,EAAE,EAAE;QAC1C,OAAO,CACL,CAAC,IAAI,CAAC,IAAI,WAAW,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAG,CAC1F,CAAC;IACJ,CAAC,CAA6B,CAAC;AACjC,CAAC;AAED,MAAM,CAA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AE;QACF,aAAa;QACb,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;QACf,aAAa;QACb,cAAc,EAAE,EAAE,CAAC,IAAI,CAAC;QACxB,UAAU,EAAE,MAAM;KACnB;IACD,EAAE,EAAE;QACF,aAAa;QACb,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC;QAClB,aAAa;QACb,cAAc,EAAE,EAAE,CAAC,IAAI,CAAC;QACxB,UAAU,EAAE,MAAM;KACnB;IACD,EAAE,EAAE;QACF,aAAa;QACb,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC;QAClB,aAAa;QACb,cAAc,EAAE,EAAE,CAAC,IAAI,CAAC;QACxB,UAAU,EAAE,MAAM;KACnB;CACF,CAAC,CAAC","sourcesContent":["import React, { ComponentType, forwardRef } from 'react';\nimport { Platform, StyleSheet } from 'react-native';\n\nimport { em } from '../css/units';\nimport Text, { TextProps } from '../primitives/Text';\n\ntype HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;\n\nfunction createHeadingComponent(level: HeadingLevel): ComponentType<TextProps> {\n const nativeProps: any = Platform.select({\n web: {\n 'aria-level': level,\n role: 'header',\n },\n default: {\n accessibilityRole: 'header',\n },\n });\n return forwardRef((props: TextProps, ref) => {\n return (\n <Text {...nativeProps} {...props} style={[styles[`h${level}`], props.style]} ref={ref} />\n );\n }) as ComponentType<TextProps>;\n}\n\nexport const H1 = createHeadingComponent(1);\nexport const H2 = createHeadingComponent(2);\nexport const H3 = createHeadingComponent(3);\nexport const H4 = createHeadingComponent(4);\nexport const H5 = createHeadingComponent(5);\nexport const H6 = createHeadingComponent(6);\n\nif (__DEV__) {\n H1.displayName = 'H1';\n H2.displayName = 'H2';\n H3.displayName = 'H3';\n H4.displayName = 'H4';\n H5.displayName = 'H5';\n H6.displayName = 'H6';\n}\n\n// Default web styles: http://trac.webkit.org/browser/trunk/Source/WebCore/css/html.css\nconst styles = StyleSheet.create({\n h1: {\n // @ts-ignore\n fontSize: em(2),\n // @ts-ignore\n marginVertical: em(0.67),\n fontWeight: 'bold',\n },\n h2: {\n // @ts-ignore\n fontSize: em(1.5),\n // @ts-ignore\n marginVertical: em(0.83),\n fontWeight: 'bold',\n },\n h3: {\n // @ts-ignore\n fontSize: em(1.17),\n // @ts-ignore\n marginVertical: em(1),\n fontWeight: 'bold',\n },\n h4: {\n // @ts-ignore\n fontSize: em(1),\n // @ts-ignore\n marginVertical: em(1.33),\n fontWeight: 'bold',\n },\n h5: {\n // @ts-ignore\n fontSize: em(0.83),\n // @ts-ignore\n marginVertical: em(1.67),\n fontWeight: 'bold',\n },\n h6: {\n // @ts-ignore\n fontSize: em(0.67),\n // @ts-ignore\n marginVertical: em(2.33),\n fontWeight: 'bold',\n },\n});\n"]}
@@ -1,46 +0,0 @@
1
- import React, { forwardRef } from 'react';
2
- import { Platform } from 'react-native';
3
- import View from '../primitives/View';
4
- function createView(nativeProps = {}) {
5
- return forwardRef((props, ref) => {
6
- return <View {...nativeProps} {...props} ref={ref}/>;
7
- });
8
- }
9
- export const Div = createView();
10
- export const Nav = createView(Platform.select({
11
- web: {
12
- role: 'navigation',
13
- },
14
- }));
15
- export const Footer = createView(Platform.select({
16
- web: {
17
- role: 'contentinfo',
18
- },
19
- }));
20
- export const Aside = createView(Platform.select({
21
- web: {
22
- role: 'complementary',
23
- },
24
- }));
25
- export const Header = createView(Platform.select({
26
- web: {
27
- role: 'banner',
28
- },
29
- default: {
30
- accessibilityRole: 'header',
31
- },
32
- }));
33
- export const Main = createView(Platform.select({
34
- web: {
35
- role: 'main',
36
- },
37
- }));
38
- export const Article = createView(Platform.select({
39
- web: {
40
- role: 'article',
41
- },
42
- }));
43
- export const Section = createView({
44
- role: 'summary', // region?
45
- });
46
- //# sourceMappingURL=Layout.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Layout.js","sourceRoot":"","sources":["../../src/elements/Layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,UAAU,EAAE,MAAM,OAAO,CA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;IACd,GAAG,EAAE;QACH,IAAI,EAAE,SAAS;KAChB;CACF,CAAC,CACH,CAAC;AACF,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAAC;IAChC,IAAI,EAAE,SAAS,EAAE,UAAU;CAC5B,CAAC,CAAC","sourcesContent":["import React, { ComponentType, forwardRef } from 'react';\nimport { Platform } from 'react-native';\n\nimport View, { ViewProps } from '../primitives/View';\n\nfunction createView(nativeProps: ViewProps = {}): ComponentType<ViewProps> {\n return forwardRef((props: ViewProps, ref) => {\n return <View {...nativeProps} {...props} ref={ref} />;\n }) as ComponentType<ViewProps>;\n}\n\nexport const Div = createView();\n\nexport const Nav = createView(\n Platform.select({\n web: {\n role: 'navigation',\n },\n })\n);\nexport const Footer = createView(\n Platform.select({\n web: {\n role: 'contentinfo',\n },\n })\n);\nexport const Aside = createView(\n Platform.select({\n web: {\n role: 'complementary',\n },\n })\n);\nexport const Header = createView(\n Platform.select({\n web: {\n role: 'banner',\n },\n default: {\n accessibilityRole: 'header',\n },\n })\n);\nexport const Main = createView(\n Platform.select({\n web: {\n role: 'main',\n },\n })\n);\nexport const Article = createView(\n Platform.select({\n web: {\n role: 'article',\n },\n })\n);\nexport const Section = createView({\n role: 'summary', // region?\n});\n"]}
@@ -1,33 +0,0 @@
1
- import React, { forwardRef } from 'react';
2
- import { Platform } from 'react-native';
3
- import Text from '../primitives/Text';
4
- import View from '../primitives/View';
5
- function createView(nativeProps = {}) {
6
- return forwardRef((props, ref) => {
7
- return <View {...nativeProps} {...props} ref={ref}/>;
8
- });
9
- }
10
- export const UL = createView(Platform.select({
11
- web: {
12
- role: 'list',
13
- },
14
- }));
15
- function isTextProps(props) {
16
- // Treat <li></li> as a Text element.
17
- return typeof props.children === 'string';
18
- }
19
- export const LI = forwardRef((props, ref) => {
20
- if (isTextProps(props)) {
21
- const role = Platform.select({
22
- web: 'listitem',
23
- default: props.role,
24
- });
25
- return <Text {...props} role={role} ref={ref}/>;
26
- }
27
- const role = Platform.select({
28
- web: 'listitem',
29
- default: props.role,
30
- });
31
- return <View {...props} role={role} ref={ref}/>;
32
- });
33
- //# sourceMappingURL=Lists.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Lists.js","sourceRoot":"","sources":["../../src/elements/Lists.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,UAAU,EAAqB,MAAM,OAAO,CAAC;AAC5E,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,IAAmB,MAAM,oBAAoB,CAAC;AACrD,OAAO,IAAmB,MAAM,oBAAoB,CAAC;AAErD,SAAS,UAAU,CAAC,cAAyB,EAAE;IAC7C,OAAO,UAAU,CAAC,CAAC,KAAgB,EAAE,GAAG,EAAE,EAAE;QAC1C,OAAO,CAAC,IAAI,CAAC,IAAI,WAAW,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAG,CAAC;IACxD,CAAC,CAA6B,CAAC;AACjC,CAAC;AAED,MAAM,CAAC,MAAM,EAAE,GAAG,UAAU,CAC1B,QAAQ,CAAC,MAAM,CAAC;IACd,GAAG,EAAE;QACH,IAAI,EAAE,MAAM;KACb;CACF,CAAC,CACH,CAAC;AAEF,SAAS,WAAW,CAAC,KAAU;IAC7B,qCAAqC;IACrC,OAAO,OAAO,KAAK,CAAC,QAAQ,KAAK,QAAQ,CAAC;AAC5C,CAAC;AAID,MAAM,CAAC,MAAM,EAAE,GAAG,UAAU,CAAC,CAAC,KAAiC,EAAE,GAAQ,EAAE,EAAE;IAC3E,IAAI,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,GAAoB,QAAQ,CAAC,MAAM,CAAC;YAC5C,GAAG,EAAE,UAAU;YACf,OAAO,EAAE,KAAK,CAAC,IAAI;SACpB,CAAC,CAAC;QACH,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAG,CAAC;IACnD,CAAC;IACD,MAAM,IAAI,GAAoB,QAAQ,CAAC,MAAM,CAAC;QAC5C,GAAG,EAAE,UAAU;QACf,OAAO,EAAE,KAAK,CAAC,IAAI;KACpB,CAAC,CAAC;IACH,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAG,CAAC;AACnD,CAAC,CAA2B,CAAC","sourcesContent":["import React, { ComponentType, forwardRef, PropsWithChildren } from 'react';\nimport { Platform } from 'react-native';\n\nimport Text, { TextProps } from '../primitives/Text';\nimport View, { ViewProps } from '../primitives/View';\n\nfunction createView(nativeProps: ViewProps = {}): ComponentType<ViewProps> {\n return forwardRef((props: ViewProps, ref) => {\n return <View {...nativeProps} {...props} ref={ref} />;\n }) as ComponentType<ViewProps>;\n}\n\nexport const UL = createView(\n Platform.select({\n web: {\n role: 'list',\n },\n })\n);\n\nfunction isTextProps(props: any): props is TextProps {\n // Treat <li></li> as a Text element.\n return typeof props.children === 'string';\n}\n\ntype LIProps = TextProps | ViewProps;\n\nexport const LI = forwardRef((props: PropsWithChildren<LIProps>, ref: any) => {\n if (isTextProps(props)) {\n const role: LIProps['role'] = Platform.select({\n web: 'listitem',\n default: props.role,\n });\n return <Text {...props} role={role} ref={ref} />;\n }\n const role: LIProps['role'] = Platform.select({\n web: 'listitem',\n default: props.role,\n });\n return <View {...props} role={role} ref={ref} />;\n}) as ComponentType<LIProps>;\n"]}
@@ -1,16 +0,0 @@
1
- import React, { forwardRef } from 'react';
2
- import { StyleSheet } from 'react-native';
3
- import View from '../primitives/View';
4
- export const HR = forwardRef((props, ref) => {
5
- return <View {...props} style={[styles.hr, props.style]} ref={ref}/>;
6
- });
7
- const styles = StyleSheet.create({
8
- hr: {
9
- borderTopWidth: StyleSheet.hairlineWidth,
10
- borderBottomWidth: StyleSheet.hairlineWidth,
11
- borderTopColor: '#9A9A9A',
12
- borderBottomColor: '#EEEEEE',
13
- marginVertical: 8,
14
- },
15
- });
16
- //# sourceMappingURL=Rules.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Rules.js","sourceRoot":"","sources":["../../src/elements/Rules.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,UAAU,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,IAAmB,MAAM,oBAAoB,CAAC;AAErD,MAAM,CAAC,MAAM,EAAE,GAAG,UAAU,CAAC,CAAC,KAAgB,EAAE,GAAG,EAAE,EAAE;IACrD,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAG,CAAC;AACxE,CAAC,CAA6B,CAAC;AAE/B,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,EAAE,EAAE;QACF,cAAc,EAAE,UAAU,CAAC,aAAa;QACxC,iBAAiB,EAAE,UAAU,CAAC,aAAa;QAC3C,cAAc,EAAE,SAAS;QACzB,iBAAiB,EAAE,SAAS;QAC5B,cAAc,EAAE,CAAC;KAClB;CACF,CAAC,CAAC","sourcesContent":["import React, { ComponentType, forwardRef } from 'react';\nimport { StyleSheet } from 'react-native';\n\nimport View, { ViewProps } from '../primitives/View';\n\nexport const HR = forwardRef((props: ViewProps, ref) => {\n return <View {...props} style={[styles.hr, props.style]} ref={ref} />;\n}) as ComponentType<ViewProps>;\n\nconst styles = StyleSheet.create({\n hr: {\n borderTopWidth: StyleSheet.hairlineWidth,\n borderBottomWidth: StyleSheet.hairlineWidth,\n borderTopColor: '#9A9A9A',\n borderBottomColor: '#EEEEEE',\n marginVertical: 8,\n },\n});\n"]}
@@ -1,6 +0,0 @@
1
- import { forwardRef } from 'react';
2
- import createElement from 'react-native-web/dist/exports/createElement';
3
- export const HR = forwardRef((props, ref) => {
4
- return createElement('hr', { ...props, ref });
5
- });
6
- //# sourceMappingURL=Rules.web.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Rules.web.js","sourceRoot":"","sources":["../../src/elements/Rules.web.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,UAAU,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,aAAa,MAAM,6CAA6C,CAAC;AAIxE,MAAM,CAAC,MAAM,EAAE,GAAG,UAAU,CAAC,CAAC,KAAgB,EAAE,GAAG,EAAE,EAAE;IACrD,OAAO,aAAa,CAAC,IAAI,EAAE,EAAE,GAAG,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;AAChD,CAAC,CAA6B,CAAC","sourcesContent":["import { ComponentType, forwardRef } from 'react';\nimport createElement from 'react-native-web/dist/exports/createElement';\n\nimport { ViewProps } from '../primitives/View';\n\nexport const HR = forwardRef((props: ViewProps, ref) => {\n return createElement('hr', { ...props, ref });\n}) as ComponentType<ViewProps>;\n"]}
@@ -1,50 +0,0 @@
1
- import React, { forwardRef } from 'react';
2
- import { StyleSheet } from 'react-native';
3
- import { em } from '../css/units';
4
- import { TableText } from '../primitives/Table';
5
- import Text from '../primitives/Text';
6
- import View from '../primitives/View';
7
- export const Table = forwardRef((props, ref) => {
8
- return <View {...props} ref={ref}/>;
9
- });
10
- export const THead = forwardRef((props, ref) => {
11
- return <View {...props} ref={ref}/>;
12
- });
13
- export const TBody = forwardRef((props, ref) => {
14
- return <View {...props} ref={ref}/>;
15
- });
16
- export const TFoot = forwardRef((props, ref) => {
17
- return <View {...props} ref={ref}/>;
18
- });
19
- export const TH = forwardRef((props, ref) => {
20
- return <TableText {...props} style={[styles.th, props.style]} ref={ref}/>;
21
- });
22
- export const TR = forwardRef((props, ref) => {
23
- return <View {...props} style={[styles.tr, props.style]} ref={ref}/>;
24
- });
25
- export const TD = forwardRef((props, ref) => {
26
- return <TableText {...props} style={[styles.td, props.style]} ref={ref}/>;
27
- });
28
- export const Caption = forwardRef((props, ref) => {
29
- return <Text {...props} style={[styles.caption, props.style]} ref={ref}/>;
30
- });
31
- const styles = StyleSheet.create({
32
- caption: {
33
- textAlign: 'center',
34
- fontSize: em(1),
35
- },
36
- th: {
37
- textAlign: 'center',
38
- fontWeight: 'bold',
39
- flex: 1,
40
- fontSize: em(1),
41
- },
42
- tr: {
43
- flexDirection: 'row',
44
- },
45
- td: {
46
- flex: 1,
47
- fontSize: em(1),
48
- },
49
- });
50
- //# sourceMappingURL=Table.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Table.js","sourceRoot":"","sources":["../../src/elements/Table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,UAAU,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,SAAS,EAAkB,MAAM,qBAAqB,CAAC;AAChE,OAAO,IAAmB,MAAM,oBAAoB,CAAC;AACrD,OAAO,IAAmB,MAAM,oBAAoB,CAAC;AAErD,MAAM,CAAC,MAAM,KAAK,GAAG,UAAU,CAAC,CAAC,KAAgB,EAAE,GAAG,EAAE,EAAE;IACxD,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAG,CAAC;AACvC,CAAC,CAA6B,CAAC;AAE/B,MAAM,CAAC,MAAM,KAAK,GAAG,UAAU,CAAC,CAAC,KAAgB,EAAE,GAAG,EAAE,EAAE;IACxD,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAG,CAAC;AACvC,CAAC,CAA6B,CAAC;AAE/B,MAAM,CAAC,MAAM,KAAK,GAAG,UAAU,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AC7E,CAAC,CAAkC,CAAC;AAEpC,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAAC,CAAC,KAAgB,EAAE,GAAQ,EAAE,EAAE;IAC/D,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAG,CAAC;AAC7E,CAAC,CAA6B,CAAC;AAE/B,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,OAAO,EAAE;QACP,SAAS,EAAE,QAAQ;QACnB,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAW;KAC1B;IACD,EAAE,EAAE;QACF,SAAS,EAAE,QAAQ;QACnB,UAAU,EAAE,MAAM;QAClB,IAAI,EAAE,CAAC;QACP,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAW;KAC1B;IACD,EAAE,EAAE;QACF,aAAa,EAAE,KAAK;KACrB;IACD,EAAE,EAAE;QACF,IAAI,EAAE,CAAC;QACP,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAW;KAC1B;CACF,CAAC,CAAC","sourcesContent":["import React, { ComponentType, forwardRef } from 'react';\nimport { StyleSheet } from 'react-native';\n\nimport { em } from '../css/units';\nimport { TableText, TableTextProps } from '../primitives/Table';\nimport Text, { TextProps } from '../primitives/Text';\nimport View, { ViewProps } from '../primitives/View';\n\nexport const Table = forwardRef((props: ViewProps, ref) => {\n return <View {...props} ref={ref} />;\n}) as ComponentType<ViewProps>;\n\nexport const THead = forwardRef((props: ViewProps, ref) => {\n return <View {...props} ref={ref} />;\n}) as ComponentType<ViewProps>;\n\nexport const TBody = forwardRef((props: ViewProps, ref) => {\n return <View {...props} ref={ref} />;\n}) as ComponentType<ViewProps>;\n\nexport const TFoot = forwardRef((props: ViewProps, ref) => {\n return <View {...props} ref={ref} />;\n}) as ComponentType<ViewProps>;\n\nexport const TH = forwardRef((props: TableTextProps, ref: any) => {\n return <TableText {...props} style={[styles.th, props.style]} ref={ref} />;\n}) as ComponentType<TableTextProps>;\n\nexport const TR = forwardRef((props: ViewProps, ref) => {\n return <View {...props} style={[styles.tr, props.style]} ref={ref} />;\n}) as ComponentType<ViewProps>;\n\nexport const TD = forwardRef((props: TableTextProps, ref: any) => {\n return <TableText {...props} style={[styles.td, props.style]} ref={ref} />;\n}) as ComponentType<TableTextProps>;\n\nexport const Caption = forwardRef((props: TextProps, ref: any) => {\n return <Text {...props} style={[styles.caption, props.style]} ref={ref} />;\n}) as ComponentType<TextProps>;\n\nconst styles = StyleSheet.create({\n caption: {\n textAlign: 'center',\n fontSize: em(1) as number,\n },\n th: {\n textAlign: 'center',\n fontWeight: 'bold',\n flex: 1,\n fontSize: em(1) as number,\n },\n tr: {\n flexDirection: 'row',\n },\n td: {\n flex: 1,\n fontSize: em(1) as number,\n },\n});\n"]}
@@ -1,27 +0,0 @@
1
- import React, { forwardRef } from 'react';
2
- import View from '../primitives/RNWView';
3
- function createView(nativeProps) {
4
- return forwardRef((props, ref) => {
5
- // @ts-expect-error - View and ViewProps have no properties in common
6
- return <View {...nativeProps} {...props} ref={ref}/>;
7
- });
8
- }
9
- export const Table = createView({ __element: 'table' });
10
- export const THead = createView({ __element: 'thead' });
11
- export const TBody = createView({ __element: 'tbody' });
12
- export const TFoot = createView({ __element: 'tfoot' });
13
- export const TH = createView({ __element: 'th' });
14
- export const TR = createView({ __element: 'tr' });
15
- export const TD = createView({ __element: 'td' });
16
- export const Caption = createView({ __element: 'caption' });
17
- if (__DEV__) {
18
- Table.displayName = 'Table';
19
- THead.displayName = 'THead';
20
- TBody.displayName = 'TBody';
21
- TFoot.displayName = 'TFoot';
22
- TH.displayName = 'TH';
23
- TR.displayName = 'TR';
24
- TD.displayName = 'TD';
25
- Caption.displayName = 'Caption';
26
- }
27
- //# sourceMappingURL=Table.web.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Table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AAC,WAAW,GAAG,OAAO,CAAC;IAC5B,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC;IAC5B,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC;IAC5B,EAAE,CAAC,WAAW,GAAG,IAAI,CAAC;IACtB,EAAE,CAAC,WAAW,GAAG,IAAI,CAAC;IACtB,EAAE,CAAC,WAAW,GAAG,IAAI,CAAC;IACtB,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;AAClC,CAAC","sourcesContent":["import React, { ComponentType, forwardRef } from 'react';\n\nimport View from '../primitives/RNWView';\nimport { ViewProps } from '../primitives/View';\n\nfunction createView(nativeProps: ViewProps & { __element: string }): ComponentType<ViewProps> {\n return forwardRef((props: ViewProps, ref) => {\n // @ts-expect-error - View and ViewProps have no properties in common\n return <View {...nativeProps} {...props} ref={ref} />;\n }) as ComponentType<ViewProps>;\n}\n\nexport const Table = createView({ __element: 'table' });\n\nexport const THead = createView({ __element: 'thead' });\n\nexport const TBody = createView({ __element: 'tbody' });\n\nexport const TFoot = createView({ __element: 'tfoot' });\n\nexport const TH = createView({ __element: 'th' });\n\nexport const TR = createView({ __element: 'tr' });\n\nexport const TD = createView({ __element: 'td' });\n\nexport const Caption = createView({ __element: 'caption' });\n\nif (__DEV__) {\n Table.displayName = 'Table';\n THead.displayName = 'THead';\n TBody.displayName = 'TBody';\n TFoot.displayName = 'TFoot';\n TH.displayName = 'TH';\n TR.displayName = 'TR';\n TD.displayName = 'TD';\n Caption.displayName = 'Caption';\n}\n"]}
@@ -1,92 +0,0 @@
1
- import React, { forwardRef } from 'react';
2
- import { StyleSheet, Platform } from 'react-native';
3
- import { em } from '../css/units';
4
- import Text from '../primitives/Text';
5
- import View from '../primitives/View';
6
- export const P = forwardRef(({ style, ...props }, ref) => {
7
- return <Text {...props} style={[styles.p, style]} ref={ref}/>;
8
- });
9
- export const B = forwardRef(({ style, ...props }, ref) => {
10
- return <Text {...props} style={[styles.b, style]} ref={ref}/>;
11
- });
12
- export const S = forwardRef(({ style, ...props }, ref) => {
13
- return <Text {...props} style={[styles.s, style]} ref={ref}/>;
14
- });
15
- export const I = forwardRef(({ style, ...props }, ref) => {
16
- return <Text {...props} style={[styles.i, style]} ref={ref}/>;
17
- });
18
- export const Q = forwardRef(({ children, cite, style, ...props }, ref) => {
19
- return (<Text {...props} style={[styles.q, style]} ref={ref}>
20
- "{children}"
21
- </Text>);
22
- });
23
- export const BlockQuote = forwardRef(({ style, cite, ...props }, ref) => {
24
- return <View {...props} style={[styles.blockQuote, style]} ref={ref}/>;
25
- });
26
- export const BR = forwardRef(({ style, ...props }, ref) => {
27
- return <Text {...props} style={[styles.br, style]} ref={ref}/>;
28
- });
29
- export const Mark = forwardRef(({ style, ...props }, ref) => {
30
- return <Text {...props} style={[styles.mark, style]} ref={ref}/>;
31
- });
32
- export const Code = forwardRef(({ style, ...props }, ref) => {
33
- return <Text {...props} style={[styles.code, style]} ref={ref}/>;
34
- });
35
- function isTextProps(props) {
36
- return typeof props.children === 'string';
37
- }
38
- export const Pre = forwardRef((props, ref) => {
39
- if (isTextProps(props)) {
40
- return <Text {...props} style={[styles.code, styles.pre, props.style]} ref={ref}/>;
41
- }
42
- return <View {...props} style={[styles.pre, props.style]} ref={ref}/>;
43
- });
44
- // Extract dateTime to prevent passing it to the native Text element
45
- export const Time = forwardRef(({ dateTime, ...props }, ref) => {
46
- return <Text {...props} ref={ref}/>;
47
- });
48
- export const Strong = B;
49
- export const Del = S;
50
- export const EM = I;
51
- export const Span = Text;
52
- const styles = StyleSheet.create({
53
- p: {
54
- // @ts-ignore
55
- marginVertical: em(1),
56
- },
57
- b: {
58
- fontWeight: 'bold',
59
- },
60
- q: {
61
- fontStyle: 'italic',
62
- },
63
- code: {
64
- fontFamily: Platform.select({ default: 'Courier', ios: 'Courier New', android: 'monospace' }),
65
- fontWeight: '500',
66
- },
67
- pre: {
68
- // @ts-ignore
69
- marginVertical: em(1),
70
- },
71
- blockQuote: {
72
- // @ts-ignore
73
- marginVertical: em(1),
74
- },
75
- br: {
76
- width: 0,
77
- // @ts-ignore
78
- height: em(0.5),
79
- },
80
- s: {
81
- textDecorationLine: 'line-through',
82
- textDecorationStyle: 'solid',
83
- },
84
- mark: {
85
- backgroundColor: 'yellow',
86
- color: 'black',
87
- },
88
- i: {
89
- fontStyle: 'italic',
90
- },
91
- });
92
- //# sourceMappingURL=Text.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Text.js","sourceRoot":"","sources":["../../src/elements/Text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,UAAU,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGpD,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,IAAmB,MAAM,oBAAoB,CAAC;AACrD,OAAO,IAAmB,MAAM,oBAAoB,CAAC;AAErD,MAAM,CAAC,MAAM,CAAC,GAAG,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAa,EAAE,GAAG,EAAE,EAAE;IAClE,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAG,CAAC;AACjE,CAAC,CAA6B,CAAC;AAE/B,MAAM,CAAC,MAAM,CAAC,GAAG,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAa,EAAE,GAAG,EAAE,EAAE;IAClE,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAG,CAAC;AACjE,CAAC,CAA6B,CAAC;AAE/B,MAAM,CAAC,MAAM,CAAC,GAAG,UAAU,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,EAAE,KAAK;KAClB;IACD,GAAG,EAAE;QACH,aAAa;QACb,cAAc,EAAE,EAAE,CAAC,CAAC,CAAC;KACtB;IACD,UAAU,EAAE;QACV,aAAa;QACb,cAAc,EAAE,EAAE,CAAC,CAAC,CAAC;KACtB;IACD,EAAE,EAAE;QACF,KAAK,EAAE,CAAC;QACR,aAAa;QACb,MAAM,EAAE,EAAE,CAAC,GAAG,CAAC;KAChB;IACD,CAAC,EAAE;QACD,kBAAkB,EAAE,cAAc;QAClC,mBAAmB,EAAE,OAAO;KAC7B;IACD,IAAI,EAAE;QACJ,eAAe,EAAE,QAAQ;QACzB,KAAK,EAAE,OAAO;KACf;IACD,CAAC,EAAE;QACD,SAAS,EAAE,QAAQ;KACpB;CACF,CAAC,CAAC","sourcesContent":["import React, { ComponentType, forwardRef } from 'react';\nimport { StyleSheet, Platform } from 'react-native';\n\nimport { BlockQuoteProps, QuoteProps, TimeProps } from './Text.types';\nimport { em } from '../css/units';\nimport Text, { TextProps } from '../primitives/Text';\nimport View, { ViewProps } from '../primitives/View';\n\nexport const P = forwardRef(({ style, ...props }: TextProps, ref) => {\n return <Text {...props} style={[styles.p, style]} ref={ref} />;\n}) as ComponentType<TextProps>;\n\nexport const B = forwardRef(({ style, ...props }: TextProps, ref) => {\n return <Text {...props} style={[styles.b, style]} ref={ref} />;\n}) as ComponentType<TextProps>;\n\nexport const S = forwardRef(({ style, ...props }: TextProps, ref) => {\n return <Text {...props} style={[styles.s, style]} ref={ref} />;\n}) as ComponentType<TextProps>;\n\nexport const I = forwardRef(({ style, ...props }: TextProps, ref) => {\n return <Text {...props} style={[styles.i, style]} ref={ref} />;\n}) as ComponentType<TextProps>;\n\nexport const Q = forwardRef(({ children, cite, style, ...props }: QuoteProps, ref) => {\n return (\n <Text {...props} style={[styles.q, style]} ref={ref}>\n \"{children}\"\n </Text>\n );\n}) as ComponentType<QuoteProps>;\n\nexport const BlockQuote = forwardRef(({ style, cite, ...props }: BlockQuoteProps, ref) => {\n return <View {...props} style={[styles.blockQuote, style]} ref={ref} />;\n}) as ComponentType<BlockQuoteProps>;\n\nexport const BR = forwardRef(({ style, ...props }: TextProps, ref) => {\n return <Text {...props} style={[styles.br, style]} ref={ref} />;\n}) as ComponentType<TextProps>;\n\nexport const Mark = forwardRef(({ style, ...props }: TextProps, ref) => {\n return <Text {...props} style={[styles.mark, style]} ref={ref} />;\n}) as ComponentType<TextProps>;\n\nexport const Code = forwardRef(({ style, ...props }: TextProps, ref) => {\n return <Text {...props} style={[styles.code, style]} ref={ref} />;\n}) as ComponentType<TextProps>;\n\nfunction isTextProps(props: any): props is TextProps {\n return typeof props.children === 'string';\n}\n\ntype PreProps = TextProps | ViewProps;\n\nexport const Pre = forwardRef((props: PreProps, ref: any) => {\n if (isTextProps(props)) {\n return <Text {...props} style={[styles.code, styles.pre, props.style]} ref={ref} />;\n }\n return <View {...props} style={[styles.pre, props.style]} ref={ref} />;\n}) as ComponentType<PreProps>;\n\n// Extract dateTime to prevent passing it to the native Text element\nexport const Time = forwardRef(({ dateTime, ...props }: TimeProps, ref) => {\n return <Text {...props} ref={ref} />;\n}) as ComponentType<TimeProps>;\n\nexport const Strong = B;\nexport const Del = S;\nexport const EM = I;\nexport const Span = Text;\n\nconst styles = StyleSheet.create({\n p: {\n // @ts-ignore\n marginVertical: em(1),\n },\n b: {\n fontWeight: 'bold',\n },\n q: {\n fontStyle: 'italic',\n },\n code: {\n fontFamily: Platform.select({ default: 'Courier', ios: 'Courier New', android: 'monospace' }),\n fontWeight: '500',\n },\n pre: {\n // @ts-ignore\n marginVertical: em(1),\n },\n blockQuote: {\n // @ts-ignore\n marginVertical: em(1),\n },\n br: {\n width: 0,\n // @ts-ignore\n height: em(0.5),\n },\n s: {\n textDecorationLine: 'line-through',\n textDecorationStyle: 'solid',\n },\n mark: {\n backgroundColor: 'yellow',\n color: 'black',\n },\n i: {\n fontStyle: 'italic',\n },\n});\n"]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=Text.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Text.types.js","sourceRoot":"","sources":["../../src/elements/Text.types.ts"],"names":[],"mappings":"","sourcesContent":["import { TextProps } from '../primitives/Text';\nimport { ViewProps } from '../primitives/View';\n\nexport type QuoteProps = React.PropsWithChildren<TextProps & { cite?: string }>;\n\nexport type BlockQuoteProps = React.PropsWithChildren<ViewProps & { cite?: string }>;\n\nexport type TimeProps = React.PropsWithChildren<TextProps & { dateTime?: string }>;\n\nexport type LinkProps = React.PropsWithChildren<\n TextProps & {\n /** @platform web */\n href?: string;\n /** @platform web */\n target?: string;\n /** @platform web */\n rel?: string;\n /** @platform web */\n download?: boolean | string;\n }\n>;\n"]}