@draftbit/core 46.7.3 → 46.7.5

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 (174) hide show
  1. package/lib/commonjs/components/Accordion/AccordionItem.js +4 -23
  2. package/lib/commonjs/components/AnimatedCircularProgress.js +1 -12
  3. package/lib/commonjs/components/AvatarEdit.js +4 -15
  4. package/lib/commonjs/components/Button.js +12 -35
  5. package/lib/commonjs/components/Checkbox/Checkbox.js +4 -22
  6. package/lib/commonjs/components/Container.js +4 -15
  7. package/lib/commonjs/components/DeprecatedButton.js +3 -20
  8. package/lib/commonjs/components/DeprecatedCardWrapper.js +1 -15
  9. package/lib/commonjs/components/Elevation.js +14 -2
  10. package/lib/commonjs/components/IconButton.js +4 -2
  11. package/lib/commonjs/components/Image.js +2 -17
  12. package/lib/commonjs/components/NumberInput.js +1 -1
  13. package/lib/commonjs/components/Picker/Picker.js +4 -9
  14. package/lib/commonjs/components/Portal/PortalHost.js +15 -44
  15. package/lib/commonjs/components/Portal/PortalManager.js +8 -34
  16. package/lib/commonjs/components/Pressable.js +2 -2
  17. package/lib/commonjs/components/ProgressBar.js +7 -37
  18. package/lib/commonjs/components/Slider.js +4 -21
  19. package/lib/commonjs/components/Surface.js +2 -14
  20. package/lib/commonjs/components/TextField.js +28 -76
  21. package/lib/commonjs/components/Touchable.js +4 -17
  22. package/lib/commonjs/constants.js +1 -1
  23. package/lib/commonjs/hooks.js +2 -1
  24. package/lib/commonjs/index.js +0 -56
  25. package/lib/commonjs/mappings/Button.js +2 -2
  26. package/lib/commonjs/mappings/FlashList.js +28 -0
  27. package/lib/commonjs/mappings/FlatList.js +14 -0
  28. package/lib/commonjs/mappings/IconButton.js +4 -6
  29. package/lib/commonjs/mappings/MapView.js +3 -1
  30. package/lib/commonjs/mappings/ScrollView.js +7 -1
  31. package/lib/commonjs/mappings/Touchable.js +9 -2
  32. package/lib/commonjs/styles/overlay.js +1 -3
  33. package/lib/commonjs/utilities.js +2 -1
  34. package/lib/module/components/Button.js +12 -35
  35. package/lib/module/components/Checkbox/CheckboxGroupRow.js +5 -24
  36. package/lib/module/components/Checkbox/context.js +1 -1
  37. package/lib/module/components/CircleImage.js +1 -16
  38. package/lib/module/components/DeprecatedCardWrapper.js +1 -18
  39. package/lib/module/components/Divider.js +1 -18
  40. package/lib/module/components/Elevation.js +2 -14
  41. package/lib/module/components/FieldSearchBarFull.js +2 -1
  42. package/lib/module/components/FormRow.js +2 -17
  43. package/lib/module/components/IconButton.js +4 -2
  44. package/lib/module/components/Image.js +2 -18
  45. package/lib/module/components/Layout.js +21 -42
  46. package/lib/module/components/NumberInput.js +4 -13
  47. package/lib/module/components/Picker/PickerComponent.ios.js +11 -36
  48. package/lib/module/components/Portal/PortalConsumer.js +7 -22
  49. package/lib/module/components/Pressable.js +2 -2
  50. package/lib/module/components/RadioButton/RadioButton.js +1 -13
  51. package/lib/module/components/RadioButton/RadioButtonGroup.js +2 -16
  52. package/lib/module/components/RadioButton/RadioButtonRow.js +5 -24
  53. package/lib/module/components/Slider.js +4 -21
  54. package/lib/module/components/StepIndicator.js +18 -58
  55. package/lib/module/components/TextField.js +28 -78
  56. package/lib/module/components/ToggleButton.js +2 -16
  57. package/lib/module/components/Touchable.js +4 -17
  58. package/lib/module/constants.js +2 -1
  59. package/lib/module/index.js +0 -8
  60. package/lib/module/mappings/Button.js +2 -2
  61. package/lib/module/mappings/FieldSearchBarFull.js +1 -4
  62. package/lib/module/mappings/FlashList.js +29 -1
  63. package/lib/module/mappings/FlatList.js +15 -1
  64. package/lib/module/mappings/IconButton.js +5 -7
  65. package/lib/module/mappings/MapView.js +3 -1
  66. package/lib/module/mappings/ScrollView.js +8 -2
  67. package/lib/module/mappings/Touchable.js +10 -3
  68. package/lib/module/styles/overlay.js +3 -1
  69. package/lib/module/utilities.js +2 -1
  70. package/lib/typescript/src/components/IconButton.d.ts +2 -0
  71. package/lib/typescript/src/components/IconButton.d.ts.map +1 -1
  72. package/lib/typescript/src/components/Pressable.d.ts.map +1 -1
  73. package/lib/typescript/src/components/Touchable.d.ts.map +1 -1
  74. package/lib/typescript/src/index.d.ts +0 -8
  75. package/lib/typescript/src/index.d.ts.map +1 -1
  76. package/lib/typescript/src/mappings/FlashList.d.ts +60 -0
  77. package/lib/typescript/src/mappings/FlashList.d.ts.map +1 -1
  78. package/lib/typescript/src/mappings/FlatList.d.ts +30 -0
  79. package/lib/typescript/src/mappings/FlatList.d.ts.map +1 -1
  80. package/lib/typescript/src/mappings/IconButton.d.ts +20 -10
  81. package/lib/typescript/src/mappings/IconButton.d.ts.map +1 -1
  82. package/lib/typescript/src/mappings/MapView.d.ts +2 -0
  83. package/lib/typescript/src/mappings/MapView.d.ts.map +1 -1
  84. package/lib/typescript/src/mappings/ScrollView.d.ts +21 -0
  85. package/lib/typescript/src/mappings/ScrollView.d.ts.map +1 -1
  86. package/lib/typescript/src/mappings/Touchable.d.ts +20 -0
  87. package/lib/typescript/src/mappings/Touchable.d.ts.map +1 -1
  88. package/package.json +3 -3
  89. package/src/components/Button.js +1 -1
  90. package/src/components/Button.tsx +2 -2
  91. package/src/components/IconButton.js +2 -2
  92. package/src/components/IconButton.tsx +6 -2
  93. package/src/components/NumberInput.js +1 -1
  94. package/src/components/NumberInput.tsx +1 -1
  95. package/src/components/Pressable.js +1 -1
  96. package/src/components/Pressable.tsx +2 -2
  97. package/src/components/Touchable.js +1 -1
  98. package/src/components/Touchable.tsx +2 -2
  99. package/src/index.js +0 -8
  100. package/src/index.tsx +0 -8
  101. package/src/mappings/Button.js +2 -2
  102. package/src/mappings/Button.ts +2 -2
  103. package/src/mappings/FlashList.js +29 -1
  104. package/src/mappings/FlashList.ts +33 -0
  105. package/src/mappings/FlatList.js +15 -1
  106. package/src/mappings/FlatList.ts +17 -0
  107. package/src/mappings/IconButton.js +5 -7
  108. package/src/mappings/IconButton.ts +5 -7
  109. package/src/mappings/MapView.js +2 -0
  110. package/src/mappings/MapView.ts +2 -0
  111. package/src/mappings/ScrollView.js +8 -2
  112. package/src/mappings/ScrollView.ts +10 -1
  113. package/src/mappings/Touchable.js +10 -3
  114. package/src/mappings/Touchable.ts +12 -2
  115. package/lib/commonjs/components/CardBlock.js +0 -115
  116. package/lib/commonjs/components/CardContainer.js +0 -138
  117. package/lib/commonjs/components/CardContainerRating.js +0 -133
  118. package/lib/commonjs/components/CardContainerShortImage.js +0 -84
  119. package/lib/commonjs/components/CardInline.js +0 -91
  120. package/lib/commonjs/components/Carousel.js +0 -130
  121. package/lib/commonjs/components/Header.js +0 -82
  122. package/lib/commonjs/components/HeaderLarge.js +0 -38
  123. package/lib/commonjs/components/HeaderMedium.js +0 -38
  124. package/lib/commonjs/components/HeaderOverline.js +0 -39
  125. package/lib/module/components/CardBlock.js +0 -108
  126. package/lib/module/components/CardContainer.js +0 -121
  127. package/lib/module/components/CardContainerRating.js +0 -135
  128. package/lib/module/components/CardContainerShortImage.js +0 -90
  129. package/lib/module/components/CardInline.js +0 -82
  130. package/lib/module/components/Carousel.js +0 -120
  131. package/lib/module/components/Header.js +0 -72
  132. package/lib/module/components/HeaderLarge.js +0 -28
  133. package/lib/module/components/HeaderMedium.js +0 -28
  134. package/lib/module/components/HeaderOverline.js +0 -29
  135. package/lib/typescript/src/components/CardBlock.d.ts +0 -21
  136. package/lib/typescript/src/components/CardBlock.d.ts.map +0 -1
  137. package/lib/typescript/src/components/CardContainer.d.ts +0 -23
  138. package/lib/typescript/src/components/CardContainer.d.ts.map +0 -1
  139. package/lib/typescript/src/components/CardContainerRating.d.ts +0 -24
  140. package/lib/typescript/src/components/CardContainerRating.d.ts.map +0 -1
  141. package/lib/typescript/src/components/CardContainerShortImage.d.ts +0 -19
  142. package/lib/typescript/src/components/CardContainerShortImage.d.ts.map +0 -1
  143. package/lib/typescript/src/components/CardInline.d.ts +0 -20
  144. package/lib/typescript/src/components/CardInline.d.ts.map +0 -1
  145. package/lib/typescript/src/components/Carousel.d.ts +0 -15
  146. package/lib/typescript/src/components/Carousel.d.ts.map +0 -1
  147. package/lib/typescript/src/components/Header.d.ts +0 -20
  148. package/lib/typescript/src/components/Header.d.ts.map +0 -1
  149. package/lib/typescript/src/components/HeaderLarge.d.ts +0 -17
  150. package/lib/typescript/src/components/HeaderLarge.d.ts.map +0 -1
  151. package/lib/typescript/src/components/HeaderMedium.d.ts +0 -17
  152. package/lib/typescript/src/components/HeaderMedium.d.ts.map +0 -1
  153. package/lib/typescript/src/components/HeaderOverline.d.ts +0 -17
  154. package/lib/typescript/src/components/HeaderOverline.d.ts.map +0 -1
  155. package/src/components/CardBlock.js +0 -54
  156. package/src/components/CardBlock.tsx +0 -127
  157. package/src/components/CardContainer.js +0 -69
  158. package/src/components/CardContainer.tsx +0 -165
  159. package/src/components/CardContainerRating.js +0 -79
  160. package/src/components/CardContainerRating.tsx +0 -175
  161. package/src/components/CardContainerShortImage.js +0 -33
  162. package/src/components/CardContainerShortImage.tsx +0 -101
  163. package/src/components/CardInline.js +0 -36
  164. package/src/components/CardInline.tsx +0 -93
  165. package/src/components/Carousel.js +0 -68
  166. package/src/components/Carousel.tsx +0 -134
  167. package/src/components/Header.js +0 -44
  168. package/src/components/Header.tsx +0 -105
  169. package/src/components/HeaderLarge.js +0 -7
  170. package/src/components/HeaderLarge.tsx +0 -40
  171. package/src/components/HeaderMedium.js +0 -7
  172. package/src/components/HeaderMedium.tsx +0 -41
  173. package/src/components/HeaderOverline.js +0 -7
  174. package/src/components/HeaderOverline.tsx +0 -42
@@ -1,130 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var React = _interopRequireWildcard(require("react"));
8
- var _theming = require("../theming");
9
- var _reactNative = require("react-native");
10
- var _Image = _interopRequireDefault(require("./Image"));
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
14
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
15
- const screenWidth = _reactNative.Dimensions.get("window").width;
16
- function Pager(_ref) {
17
- let {
18
- color,
19
- index,
20
- length
21
- } = _ref;
22
- return /*#__PURE__*/React.createElement(_reactNative.View, {
23
- style: styles.pager
24
- }, Array.from({
25
- length
26
- }).map((_, i) => {
27
- const current = index === i;
28
- const opacity = current ? 1 : 0.5;
29
- const size = current ? 10 : 8;
30
- return /*#__PURE__*/React.createElement(_reactNative.View, {
31
- key: i,
32
- style: [styles.bullet, {
33
- backgroundColor: color,
34
- opacity,
35
- width: size,
36
- height: size
37
- }]
38
- });
39
- }));
40
- }
41
- function Carousel(_ref2) {
42
- var _data$length;
43
- let {
44
- data,
45
- children,
46
- dotColor = "strong",
47
- style,
48
- ...rest
49
- } = _ref2;
50
- const [index, setIndex] = React.useState(0);
51
- const length = React.Children.count(children);
52
- const itemsLength = ((_data$length = data === null || data === void 0 ? void 0 : data.length) !== null && _data$length !== void 0 ? _data$length : 0) + length;
53
- const slides = Array.isArray(data) ? data : [];
54
- const {
55
- width,
56
- height
57
- } = _reactNative.StyleSheet.flatten(style || {});
58
- const slideWidth = width || screenWidth;
59
- const slideHeight = height || 250;
60
- return /*#__PURE__*/React.createElement(_reactNative.View, _extends({
61
- style: [styles.container, style]
62
- }, rest), /*#__PURE__*/React.createElement(_reactNative.ScrollView, {
63
- pagingEnabled: true,
64
- horizontal: true,
65
- decelerationRate: "fast",
66
- scrollEventThrottle: 200,
67
- showsHorizontalScrollIndicator: false,
68
- onScroll: _ref3 => {
69
- let {
70
- nativeEvent
71
- } = _ref3;
72
- const layoutWidth = nativeEvent.layoutMeasurement.width;
73
- const offset = nativeEvent.contentOffset.x;
74
- const currentIndex = Math.ceil(offset / layoutWidth);
75
- setIndex(currentIndex);
76
- }
77
- }, slides.length > 0 ? slides.map((item, i) => {
78
- return /*#__PURE__*/React.createElement(_Image.default, {
79
- key: i,
80
- resizeMode: "cover",
81
- source: typeof item === "string" ? {
82
- uri: item
83
- } : item,
84
- style: [{
85
- width: slideWidth,
86
- height: slideHeight
87
- }]
88
- });
89
- }) : null, React.Children.map(children, child => {
90
- var _child$props;
91
- const s = (child === null || child === void 0 ? void 0 : (_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.style) || {};
92
- return /*#__PURE__*/React.createElement(_reactNative.View, {
93
- style: {
94
- width: slideWidth
95
- }
96
- }, /*#__PURE__*/React.cloneElement(child, {
97
- style: {
98
- ...s,
99
- width: slideWidth
100
- }
101
- }));
102
- })), /*#__PURE__*/React.createElement(Pager, {
103
- color: dotColor,
104
- index: index,
105
- length: itemsLength
106
- }));
107
- }
108
- const styles = _reactNative.StyleSheet.create({
109
- container: {
110
- backgroundColor: "#eee"
111
- },
112
- pager: {
113
- position: "absolute",
114
- bottom: 12,
115
- left: 0,
116
- right: 0,
117
- flexDirection: "row",
118
- justifyContent: "center",
119
- alignItems: "center"
120
- },
121
- bullet: {
122
- marginHorizontal: 2,
123
- width: 10,
124
- height: 10,
125
- borderRadius: 20,
126
- backgroundColor: "#000"
127
- }
128
- });
129
- var _default = (0, _theming.withTheme)(Carousel);
130
- exports.default = _default;
@@ -1,82 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var React = _interopRequireWildcard(require("react"));
8
- var _reactNative = require("react-native");
9
- var _theming = require("../theming");
10
- var _Divider = _interopRequireDefault(require("./Divider"));
11
- var _Touchable = _interopRequireDefault(require("./Touchable"));
12
- var _Config = _interopRequireDefault(require("./Config"));
13
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
16
- const Header = _ref => {
17
- let {
18
- Icon,
19
- titleTypeStyle,
20
- titleColor,
21
- title,
22
- buttonText,
23
- dividerTopMargin,
24
- icon,
25
- onPress,
26
- style,
27
- theme: {
28
- colors,
29
- typography
30
- }
31
- } = _ref;
32
- return /*#__PURE__*/React.createElement(_reactNative.View, {
33
- style: [styles.container, style]
34
- }, /*#__PURE__*/React.createElement(_reactNative.View, {
35
- style: styles.topContainer
36
- }, /*#__PURE__*/React.createElement(_reactNative.Text, {
37
- style: [titleTypeStyle, {
38
- color: titleColor,
39
- flex: 1
40
- }],
41
- numberOfLines: 1
42
- }, title), onPress && /*#__PURE__*/React.createElement(_Touchable.default, {
43
- style: {
44
- alignSelf: "center",
45
- marginLeft: 12
46
- },
47
- onPress: onPress
48
- }, /*#__PURE__*/React.createElement(_reactNative.View, {
49
- style: styles.buttonContainer
50
- }, /*#__PURE__*/React.createElement(_reactNative.Text, {
51
- style: [typography.subtitle2, {
52
- color: colors.light,
53
- marginRight: 8
54
- }],
55
- numberOfLines: 1
56
- }, buttonText), /*#__PURE__*/React.createElement(Icon, {
57
- name: icon,
58
- size: _Config.default.headerIconSize,
59
- color: colors.light
60
- })))), /*#__PURE__*/React.createElement(_Divider.default, {
61
- style: {
62
- marginTop: dividerTopMargin || 16
63
- }
64
- }));
65
- };
66
- const styles = _reactNative.StyleSheet.create({
67
- container: {
68
- alignSelf: "stretch"
69
- },
70
- topContainer: {
71
- flexDirection: "row",
72
- justifyContent: "space-between",
73
- alignItems: "center"
74
- },
75
- buttonContainer: {
76
- flexDirection: "row",
77
- justifyContent: "center",
78
- alignItems: "center"
79
- }
80
- });
81
- var _default = (0, _theming.withTheme)(Header);
82
- exports.default = _default;
@@ -1,38 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var React = _interopRequireWildcard(require("react"));
8
- var _theming = require("../theming");
9
- var _Header = _interopRequireDefault(require("./Header"));
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
12
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
13
- const HeaderLarge = _ref => {
14
- let {
15
- Icon,
16
- title,
17
- buttonText,
18
- icon,
19
- onPress = () => {},
20
- style,
21
- theme: {
22
- colors,
23
- typography
24
- }
25
- } = _ref;
26
- return /*#__PURE__*/React.createElement(_Header.default, {
27
- Icon: Icon,
28
- titleTypeStyle: typography.headline4,
29
- titleColor: colors.strong,
30
- title: title,
31
- buttonText: buttonText,
32
- icon: icon,
33
- onPress: onPress,
34
- style: style
35
- });
36
- };
37
- var _default = (0, _theming.withTheme)(HeaderLarge);
38
- exports.default = _default;
@@ -1,38 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var React = _interopRequireWildcard(require("react"));
8
- var _theming = require("../theming");
9
- var _Header = _interopRequireDefault(require("./Header"));
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
12
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
13
- const HeaderMedium = _ref => {
14
- let {
15
- Icon,
16
- title,
17
- buttonText,
18
- icon,
19
- onPress = () => {},
20
- style,
21
- theme: {
22
- colors,
23
- typography
24
- }
25
- } = _ref;
26
- return /*#__PURE__*/React.createElement(_Header.default, {
27
- Icon: Icon,
28
- titleTypeStyle: typography.headline6,
29
- titleColor: colors.strong,
30
- title: title,
31
- buttonText: buttonText,
32
- icon: icon,
33
- onPress: onPress,
34
- style: style
35
- });
36
- };
37
- var _default = (0, _theming.withTheme)(HeaderMedium);
38
- exports.default = _default;
@@ -1,39 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var React = _interopRequireWildcard(require("react"));
8
- var _theming = require("../theming");
9
- var _Header = _interopRequireDefault(require("./Header"));
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
12
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
13
- const HeaderOverline = _ref => {
14
- let {
15
- Icon,
16
- title,
17
- buttonText,
18
- icon,
19
- onPress = () => {},
20
- style,
21
- theme: {
22
- colors,
23
- typography
24
- }
25
- } = _ref;
26
- return /*#__PURE__*/React.createElement(_Header.default, {
27
- Icon: Icon,
28
- titleTypeStyle: typography.overline,
29
- titleColor: colors.light,
30
- title: title && title.toUpperCase(),
31
- buttonText: buttonText,
32
- icon: icon,
33
- dividerTopMargin: 12,
34
- onPress: onPress,
35
- style: style
36
- });
37
- };
38
- var _default = (0, _theming.withTheme)(HeaderOverline);
39
- exports.default = _default;
@@ -1,108 +0,0 @@
1
- import React from "react";
2
- import { View, Text } from "react-native";
3
- import Image from "./Image";
4
- import Card from "./DeprecatedCardWrapper";
5
- import Elevation from "./Elevation";
6
- import { withTheme } from "../theming";
7
- import Config from "./Config";
8
- const CardBlock = _ref => {
9
- let {
10
- image = Config.cardImageUrl,
11
- title,
12
- leftDescription,
13
- rightDescription,
14
- titleCentered,
15
- aspectRatio = 1.5,
16
- elevation = 2,
17
- numColumns = 3,
18
- theme: {
19
- colors,
20
- roundness,
21
- typography
22
- },
23
- style,
24
- onPress,
25
- ...rest
26
- } = _ref;
27
- let titleJustification;
28
- let titleStyle;
29
- if (titleCentered && !leftDescription && !rightDescription) {
30
- titleJustification = "center";
31
- } else {
32
- titleJustification = "space-between";
33
- }
34
- if (numColumns === 1) {
35
- titleStyle = typography.button;
36
- } else if (numColumns === 2) {
37
- titleStyle = typography.headline6;
38
- } else {
39
- titleStyle = typography.headline5;
40
- }
41
- const rightDescriptionStyles = [typography.subtitle2, {
42
- color: colors.light
43
- }];
44
- return /*#__PURE__*/React.createElement(Card, {
45
- style: style,
46
- onPress: onPress,
47
- numColumns: numColumns,
48
- ...rest
49
- }, /*#__PURE__*/React.createElement(View, {
50
- style: {
51
- backgroundColor: colors.background
52
- }
53
- }, /*#__PURE__*/React.createElement(Elevation, {
54
- style: {
55
- elevation,
56
- borderRadius: roundness
57
- }
58
- }, /*#__PURE__*/React.createElement(Image, {
59
- style: {
60
- borderRadius: roundness,
61
- aspectRatio
62
- },
63
- source: typeof image === "string" ? {
64
- uri: image
65
- } : image,
66
- resizeMode: "cover"
67
- })), title ? /*#__PURE__*/React.createElement(View, {
68
- style: {
69
- flexDirection: "row",
70
- alignItems: "center",
71
- justifyContent: titleJustification,
72
- marginTop: numColumns === 3 ? 16 : 12
73
- }
74
- }, /*#__PURE__*/React.createElement(Text, {
75
- numberOfLines: 1,
76
- style: [titleStyle, {
77
- color: colors.strong
78
- }]
79
- }, title), !leftDescription && rightDescription ? /*#__PURE__*/React.createElement(Text, {
80
- style: rightDescriptionStyles
81
- }, rightDescription) : null) : null, leftDescription ? /*#__PURE__*/React.createElement(View, {
82
- style: {
83
- flexDirection: "row",
84
- justifyContent: "space-between",
85
- alignItems: "center",
86
- marginTop: numColumns === 3 ? 4 : 4 / 2
87
- }
88
- }, /*#__PURE__*/React.createElement(Text, {
89
- numberOfLines: 1,
90
- style: [typography.body2, {
91
- color: colors.medium
92
- }]
93
- }, leftDescription), rightDescription ? /*#__PURE__*/React.createElement(Text, {
94
- numberOfLines: 1,
95
- style: rightDescriptionStyles
96
- }, rightDescription) : null) : null));
97
- };
98
- export default withTheme(CardBlock);PURE__*/React.createElement(Text, {
99
- numberOfLines: 1,
100
- style: [typography.body2, {
101
- color: colors.medium
102
- }]
103
- }, leftDescription), rightDescription ? /*#__PURE__*/React.createElement(Text, {
104
- numberOfLines: 1,
105
- style: rightDescriptionStyles
106
- }, rightDescription) : null) : null));
107
- };
108
- export default withTheme(CardBlock);
@@ -1,121 +0,0 @@
1
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
- import React from "react";
3
- import { View, Text } from "react-native";
4
- import color from "color";
5
- import Image from "./Image";
6
- import Card from "./DeprecatedCardWrapper";
7
- import Elevation from "./Elevation";
8
- import { withTheme } from "../theming";
9
- import Config from "./Config";
10
- const ICON_CONTAINER_SIZE = Config.cardIconSize * 2;
11
- const ICON_CONTAINER_PADDING = Config.cardIconSize / 2 - 1;
12
- const CardContainer = _ref => {
13
- let {
14
- Icon,
15
- icon,
16
- image = Config.cardImageUrl,
17
- title,
18
- leftDescription,
19
- rightDescription,
20
- textCentered,
21
- aspectRatio = 1.5,
22
- elevation = 2,
23
- numColumns = 3,
24
- theme: {
25
- colors,
26
- roundness,
27
- typography
28
- },
29
- style,
30
- onPress,
31
- ...rest
32
- } = _ref;
33
- let textJustification;
34
- let titleStyle;
35
- if (textCentered && !rightDescription) {
36
- textJustification = "center";
37
- } else {
38
- textJustification = "space-between";
39
- }
40
- switch (numColumns) {
41
- case 2:
42
- titleStyle = typography.headline6;
43
- break;
44
- case 3:
45
- titleStyle = typography.headline5;
46
- break;
47
- }
48
- return /*#__PURE__*/React.createElement(Card, _extends({
49
- style: style,
50
- onPress: onPress,
51
- numColumns: numColumns
52
- }, rest), /*#__PURE__*/React.createElement(Elevation, {
53
- style: {
54
- elevation,
55
- borderRadius: roundness
56
- }
57
- }, /*#__PURE__*/React.createElement(View, {
58
- style: {
59
- borderRadius: roundness,
60
- overflow: "hidden",
61
- backgroundColor: colors.surface
62
- }
63
- }, /*#__PURE__*/React.createElement(Image, {
64
- style: {
65
- aspectRatio
66
- },
67
- source: typeof image === "string" ? {
68
- uri: image
69
- } : image,
70
- resizeMode: "cover"
71
- }), /*#__PURE__*/React.createElement(View, {
72
- style: {
73
- padding: numColumns === 1 ? 8 : 16
74
- }
75
- }, title ? /*#__PURE__*/React.createElement(View, {
76
- style: {
77
- flexDirection: "row",
78
- alignItems: "center",
79
- justifyContent: textJustification
80
- }
81
- }, /*#__PURE__*/React.createElement(Text, {
82
- numberOfLines: 1,
83
- style: [titleStyle, {
84
- color: colors.strong
85
- }]
86
- }, title)) : null, leftDescription ? /*#__PURE__*/React.createElement(View, {
87
- style: {
88
- flexDirection: "row",
89
- justifyContent: textJustification,
90
- alignItems: "center",
91
- marginTop: numColumns === 3 ? 4 : 4 / 2
92
- }
93
- }, /*#__PURE__*/React.createElement(Text, {
94
- numberOfLines: 1,
95
- style: [typography.body2, {
96
- color: colors.medium
97
- }]
98
- }, leftDescription), rightDescription ? /*#__PURE__*/React.createElement(Text, {
99
- numberOfLines: 1,
100
- style: [typography.subtitle2, {
101
- color: colors.light
102
- }]
103
- }, rightDescription) : null) : null), icon ? /*#__PURE__*/React.createElement(Elevation, {
104
- style: {
105
- elevation: Config.cardIconElevation,
106
- position: "absolute",
107
- top: 12,
108
- right: 12,
109
- width: ICON_CONTAINER_SIZE,
110
- height: ICON_CONTAINER_SIZE,
111
- padding: ICON_CONTAINER_PADDING,
112
- borderRadius: ICON_CONTAINER_SIZE,
113
- backgroundColor: color(colors.strong).alpha(Config.cardIconBackgroundOpacity).rgb().string()
114
- }
115
- }, /*#__PURE__*/React.createElement(Icon, {
116
- name: icon,
117
- size: Config.cardIconSize,
118
- color: colors.surface
119
- })) : null)));
120
- };
121
- export default withTheme(CardContainer);
@@ -1,135 +0,0 @@
1
- import React from "react";
2
- import { View, Text } from "react-native";
3
- import color from "color";
4
- import Image from "./Image";
5
- import Card from "./DeprecatedCardWrapper";
6
- import Elevation from "./Elevation";
7
- import StarRating from "./StarRating";
8
- import { withTheme } from "../theming";
9
- import Config from "./Config";
10
- const ICON_CONTAINER_SIZE = Config.cardIconSize * 2;
11
- const ICON_CONTAINER_PADDING = Config.cardIconSize / 2 - 1;
12
- const CardContainerRating = _ref => {
13
- let {
14
- Icon,
15
- icon,
16
- image = Config.cardImageUrl,
17
- title,
18
- leftDescription,
19
- rightDescription,
20
- rating,
21
- aspectRatio = 1.5,
22
- elevation = 2,
23
- numColumns = 3,
24
- theme: {
25
- colors,
26
- roundness,
27
- typography
28
- },
29
- style,
30
- onPress,
31
- ...rest
32
- } = _ref;
33
- let titleStyle, rightDescriptionStyle;
34
- switch (numColumns) {
35
- case 2:
36
- titleStyle = typography.headline6;
37
- rightDescriptionStyle = typography.body2;
38
- break;
39
- case 3:
40
- titleStyle = typography.headline5;
41
- rightDescriptionStyle = typography.caption;
42
- break;
43
- }
44
- return /*#__PURE__*/React.createElement(Card, {
45
- style: style,
46
- onPress: onPress,
47
- numColumns: numColumns,
48
- ...rest
49
- }, /*#__PURE__*/React.createElement(Elevation, {
50
- style: {
51
- elevation,
52
- borderRadius: roundness
53
- }
54
- }, /*#__PURE__*/React.createElement(View, {
55
- style: {
56
- borderRadius: roundness,
57
- overflow: "hidden",
58
- backgroundColor: colors.background
59
- //background color is needed for bug on android 9 - https://github.com/facebook/react-native/issues/25093
60
- }
61
- }, /*#__PURE__*/React.createElement(Image, {
62
- style: {
63
- aspectRatio
64
- },
65
- source: typeof image === "string" ? {
66
- uri: image
67
- } : image,
68
- resizeMode: "cover"
69
- }), /*#__PURE__*/React.createElement(View, {
70
- style: {
71
- padding: numColumns === 1 ? 8 : 16
72
- }
73
- }, title ? /*#__PURE__*/React.createElement(View, {
74
- style: {
75
- flexDirection: "row",
76
- alignItems: "center",
77
- justifyContent: "space-between"
78
- }
79
- }, /*#__PURE__*/React.createElement(Text, {
80
- numberOfLines: 1,
81
- style: [titleStyle, {
82
- color: colors.strong
83
- }]
84
- }, title)) : null, leftDescription ? /*#__PURE__*/React.createElement(Text, {
85
- numberOfLines: 1,
86
- style: [typography.body2, {
87
- color: colors.medium,
88
- marginTop: numColumns === 3 ? 4 : 4 / 2
89
- }]
90
- }, leftDescription) : null, /*#__PURE__*/React.createElement(View, {
91
- style: {
92
- flexDirection: "row",
93
- justifyContent: "space-between",
94
- alignItems: "center",
95
- marginTop: numColumns === 3 ? 16 : 12
96
- }
97
- }, /*#__PURE__*/React.createElement(StarRating, {
98
- Icon: Icon,
99
- starSize: numColumns === 1 ? 10 : 16,
100
- rating: rating
101
- }), /*#__PURE__*/React.createElement(Text, {
102
- style: [rightDescriptionStyle, {
103
- color: colors.medium,
104
- marginLeft: 8
105
- }],
106
- numberOfLines: 1
107
- }, rightDescription))), icon ? /*#__PURE__*/React.createElement(Elevation, {
108
- style: {
109
- elevation: Config.cardIconElevation,
110
- position: "absolute",
111
- top: 12,
112
- right: 12,
113
- width: ICON_CONTAINER_SIZE,
114
- height: ICON_CONTAINER_SIZE,
115
- padding: ICON_CONTAINER_PADDING,
116
- borderRadius: ICON_CONTAINER_SIZE,
117
- backgroundColor: color(colors.strong).alpha(Config.cardIconBackgroundOpacity).rgb().string()
118
- }
119
- }, /*#__PURE__*/React.createElement(Icon, {
120
- name: icon,
121
- size: Config.cardIconSize,
122
- color: colors.surface
123
- })) : null)));
124
- };
125
- export default withTheme(CardContainerRating);ER_PADDING,
126
- borderRadius: ICON_CONTAINER_SIZE,
127
- backgroundColor: color(colors.strong).alpha(Config.cardIconBackgroundOpacity).rgb().string()
128
- }
129
- }, /*#__PURE__*/React.createElement(Icon, {
130
- name: icon,
131
- size: Config.cardIconSize,
132
- color: colors.surface
133
- })) : null)));
134
- };
135
- export default withTheme(CardContainerRating);