@draftbit/core 46.7.2-9358f4.2 → 46.7.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 (241) hide show
  1. package/lib/commonjs/components/Justification.js +1 -5
  2. package/lib/commonjs/components/ResizeMode.js +1 -5
  3. package/lib/commonjs/index.js +0 -56
  4. package/lib/commonjs/utilities.js +2 -1
  5. package/lib/module/components/Justification.js +0 -1
  6. package/lib/module/components/ResizeMode.js +0 -1
  7. package/lib/module/index.js +0 -8
  8. package/lib/typescript/src/index.d.ts +0 -8
  9. package/lib/typescript/src/index.d.ts.map +1 -1
  10. package/package.json +3 -3
  11. package/src/index.tsx +0 -8
  12. package/lib/commonjs/components/CardBlock.js +0 -106
  13. package/lib/commonjs/components/CardContainer.js +0 -138
  14. package/lib/commonjs/components/CardContainerRating.js +0 -133
  15. package/lib/commonjs/components/CardContainerShortImage.js +0 -84
  16. package/lib/commonjs/components/CardInline.js +0 -91
  17. package/lib/commonjs/components/Carousel.js +0 -130
  18. package/lib/commonjs/components/Header.js +0 -82
  19. package/lib/commonjs/components/HeaderLarge.js +0 -38
  20. package/lib/commonjs/components/HeaderMedium.js +0 -38
  21. package/lib/commonjs/components/HeaderOverline.js +0 -39
  22. package/lib/module/components/CardBlock.js +0 -98
  23. package/lib/module/components/CardContainer.js +0 -121
  24. package/lib/module/components/CardContainerRating.js +0 -125
  25. package/lib/module/components/CardContainerShortImage.js +0 -76
  26. package/lib/module/components/CardInline.js +0 -82
  27. package/lib/module/components/Carousel.js +0 -120
  28. package/lib/module/components/Header.js +0 -72
  29. package/lib/module/components/HeaderLarge.js +0 -28
  30. package/lib/module/components/HeaderMedium.js +0 -28
  31. package/lib/module/components/HeaderOverline.js +0 -29
  32. package/lib/typescript/src/components/CardBlock.d.ts +0 -21
  33. package/lib/typescript/src/components/CardBlock.d.ts.map +0 -1
  34. package/lib/typescript/src/components/CardContainer.d.ts +0 -23
  35. package/lib/typescript/src/components/CardContainer.d.ts.map +0 -1
  36. package/lib/typescript/src/components/CardContainerRating.d.ts +0 -24
  37. package/lib/typescript/src/components/CardContainerRating.d.ts.map +0 -1
  38. package/lib/typescript/src/components/CardContainerShortImage.d.ts +0 -19
  39. package/lib/typescript/src/components/CardContainerShortImage.d.ts.map +0 -1
  40. package/lib/typescript/src/components/CardInline.d.ts +0 -20
  41. package/lib/typescript/src/components/CardInline.d.ts.map +0 -1
  42. package/lib/typescript/src/components/Carousel.d.ts +0 -15
  43. package/lib/typescript/src/components/Carousel.d.ts.map +0 -1
  44. package/lib/typescript/src/components/Header.d.ts +0 -20
  45. package/lib/typescript/src/components/Header.d.ts.map +0 -1
  46. package/lib/typescript/src/components/HeaderLarge.d.ts +0 -17
  47. package/lib/typescript/src/components/HeaderLarge.d.ts.map +0 -1
  48. package/lib/typescript/src/components/HeaderMedium.d.ts +0 -17
  49. package/lib/typescript/src/components/HeaderMedium.d.ts.map +0 -1
  50. package/lib/typescript/src/components/HeaderOverline.d.ts +0 -17
  51. package/lib/typescript/src/components/HeaderOverline.d.ts.map +0 -1
  52. package/src/Provider.js +0 -9
  53. package/src/components/Accordion/AccordionGroup.js +0 -44
  54. package/src/components/Accordion/AccordionItem.js +0 -32
  55. package/src/components/Accordion/index.js +0 -2
  56. package/src/components/ActionSheet/ActionSheet.js +0 -45
  57. package/src/components/ActionSheet/ActionSheetCancel.js +0 -6
  58. package/src/components/ActionSheet/ActionSheetItem.js +0 -30
  59. package/src/components/ActionSheet/index.js +0 -3
  60. package/src/components/AnimatedCircularProgress.js +0 -43
  61. package/src/components/AspectRatio.js +0 -18
  62. package/src/components/AvatarEdit.js +0 -30
  63. package/src/components/Banner.js +0 -109
  64. package/src/components/Button.js +0 -114
  65. package/src/components/Card.js +0 -57
  66. package/src/components/CardBlock.js +0 -54
  67. package/src/components/CardBlock.tsx +0 -127
  68. package/src/components/CardContainer.js +0 -69
  69. package/src/components/CardContainer.tsx +0 -165
  70. package/src/components/CardContainerRating.js +0 -79
  71. package/src/components/CardContainerRating.tsx +0 -175
  72. package/src/components/CardContainerShortImage.js +0 -33
  73. package/src/components/CardContainerShortImage.tsx +0 -101
  74. package/src/components/CardInline.js +0 -36
  75. package/src/components/CardInline.tsx +0 -93
  76. package/src/components/Carousel.js +0 -68
  77. package/src/components/Carousel.tsx +0 -134
  78. package/src/components/Checkbox/Checkbox.js +0 -62
  79. package/src/components/Checkbox/CheckboxGroup.js +0 -21
  80. package/src/components/Checkbox/CheckboxGroupRow.js +0 -76
  81. package/src/components/Checkbox/CheckboxRow.js +0 -77
  82. package/src/components/Checkbox/context.js +0 -14
  83. package/src/components/Checkbox/index.js +0 -3
  84. package/src/components/CircleImage.js +0 -8
  85. package/src/components/CircularProgress.js +0 -81
  86. package/src/components/Config.js +0 -64
  87. package/src/components/Container.js +0 -43
  88. package/src/components/DatePicker/DatePicker.js +0 -377
  89. package/src/components/DatePicker/DatePickerComponent.js +0 -13
  90. package/src/components/DatePicker/DatePickerComponent.web.js +0 -30
  91. package/src/components/DatePicker/DatePickerComponentType.js +0 -1
  92. package/src/components/DeprecatedButton.js +0 -83
  93. package/src/components/DeprecatedCardWrapper.js +0 -18
  94. package/src/components/DeprecatedFAB.js +0 -114
  95. package/src/components/Divider.js +0 -13
  96. package/src/components/Elevation.js +0 -20
  97. package/src/components/FAB.js +0 -46
  98. package/src/components/FieldSearchBarFull.js +0 -53
  99. package/src/components/FormRow.js +0 -19
  100. package/src/components/Header.js +0 -44
  101. package/src/components/Header.tsx +0 -105
  102. package/src/components/HeaderLarge.js +0 -7
  103. package/src/components/HeaderLarge.tsx +0 -40
  104. package/src/components/HeaderMedium.js +0 -7
  105. package/src/components/HeaderMedium.tsx +0 -41
  106. package/src/components/HeaderOverline.js +0 -7
  107. package/src/components/HeaderOverline.tsx +0 -42
  108. package/src/components/IconButton.js +0 -35
  109. package/src/components/Image.js +0 -47
  110. package/src/components/Justification.js +0 -1
  111. package/src/components/Layout.js +0 -50
  112. package/src/components/NumberInput.js +0 -49
  113. package/src/components/Picker/Picker.js +0 -267
  114. package/src/components/Picker/PickerComponent.android.js +0 -69
  115. package/src/components/Picker/PickerComponent.ios.js +0 -79
  116. package/src/components/Picker/PickerComponent.web.js +0 -70
  117. package/src/components/Picker/PickerTypes.js +0 -1
  118. package/src/components/Portal/Portal.js +0 -35
  119. package/src/components/Portal/PortalConsumer.js +0 -27
  120. package/src/components/Portal/PortalHost.js +0 -107
  121. package/src/components/Portal/PortalManager.js +0 -32
  122. package/src/components/Pressable.js +0 -12
  123. package/src/components/ProgressBar.js +0 -118
  124. package/src/components/ProgressCircle.js +0 -13
  125. package/src/components/ProgressIndicator.js +0 -27
  126. package/src/components/RadioButton/RadioButton.js +0 -17
  127. package/src/components/RadioButton/RadioButtonFieldGroup.js +0 -17
  128. package/src/components/RadioButton/RadioButtonGroup.js +0 -43
  129. package/src/components/RadioButton/RadioButtonRow.js +0 -76
  130. package/src/components/RadioButton/context.js +0 -14
  131. package/src/components/RadioButton/index.js +0 -4
  132. package/src/components/ResizeMode.js +0 -1
  133. package/src/components/Row.js +0 -48
  134. package/src/components/RowBodyIcon.js +0 -8
  135. package/src/components/RowHeadlineImageCaption.js +0 -12
  136. package/src/components/RowHeadlineImageIcon.js +0 -14
  137. package/src/components/SVG.js +0 -13
  138. package/src/components/ScreenContainer.js +0 -34
  139. package/src/components/Slider.js +0 -63
  140. package/src/components/StarRating.js +0 -50
  141. package/src/components/StepIndicator.js +0 -346
  142. package/src/components/Stepper.js +0 -41
  143. package/src/components/Surface.js +0 -32
  144. package/src/components/Swiper/Swiper.js +0 -29
  145. package/src/components/Swiper/SwiperItem.js +0 -9
  146. package/src/components/Swiper/index.js +0 -2
  147. package/src/components/Switch.js +0 -56
  148. package/src/components/Text.js +0 -33
  149. package/src/components/TextField.js +0 -428
  150. package/src/components/ToggleButton.js +0 -39
  151. package/src/components/Touchable.js +0 -12
  152. package/src/components/Touchable.web.js +0 -2
  153. package/src/components/Typography.js +0 -36
  154. package/src/components/useAuthState.js +0 -31
  155. package/src/constants.js +0 -10
  156. package/src/hooks.js +0 -12
  157. package/src/index.js +0 -53
  158. package/src/interfaces/Icon.js +0 -8
  159. package/src/mappings/Accordion.js +0 -41
  160. package/src/mappings/AccordionItem.js +0 -16
  161. package/src/mappings/ActionSheet.js +0 -13
  162. package/src/mappings/ActionSheetCancel.js +0 -19
  163. package/src/mappings/ActionSheetItem.js +0 -23
  164. package/src/mappings/ActivityIndicator.js +0 -58
  165. package/src/mappings/AudioPlayer.js +0 -57
  166. package/src/mappings/AvatarEdit.js +0 -38
  167. package/src/mappings/Banner.js +0 -32
  168. package/src/mappings/BlurView.js +0 -42
  169. package/src/mappings/Button.js +0 -116
  170. package/src/mappings/Card.js +0 -52
  171. package/src/mappings/CardBlock.js +0 -123
  172. package/src/mappings/CardContainer.js +0 -104
  173. package/src/mappings/CardContainerRating.js +0 -126
  174. package/src/mappings/CardContainerShortImage.js +0 -120
  175. package/src/mappings/CardInline.js +0 -52
  176. package/src/mappings/Carousel.js +0 -19
  177. package/src/mappings/Checkbox.js +0 -46
  178. package/src/mappings/CheckboxGroup.js +0 -26
  179. package/src/mappings/CheckboxRow.js +0 -61
  180. package/src/mappings/CircleImage.js +0 -25
  181. package/src/mappings/Container.js +0 -30
  182. package/src/mappings/CustomCode.js +0 -8
  183. package/src/mappings/DatePicker.js +0 -176
  184. package/src/mappings/Divider.js +0 -27
  185. package/src/mappings/FAB.js +0 -37
  186. package/src/mappings/Fetch.js +0 -13
  187. package/src/mappings/FieldSearchBarFull.js +0 -50
  188. package/src/mappings/FlashList.js +0 -85
  189. package/src/mappings/FlatList.js +0 -37
  190. package/src/mappings/HeaderLarge.js +0 -29
  191. package/src/mappings/HeaderMedium.js +0 -55
  192. package/src/mappings/HeaderOverline.js +0 -55
  193. package/src/mappings/Icon.js +0 -32
  194. package/src/mappings/IconButton.js +0 -35
  195. package/src/mappings/Image.js +0 -35
  196. package/src/mappings/ImageBackground.js +0 -29
  197. package/src/mappings/KeyboardAvoidingView.js +0 -41
  198. package/src/mappings/KeyboardAwareScrollView.js +0 -50
  199. package/src/mappings/Layout.js +0 -200
  200. package/src/mappings/LinearGradient.js +0 -77
  201. package/src/mappings/MapCallout.js +0 -21
  202. package/src/mappings/MapMarker.js +0 -47
  203. package/src/mappings/MapView.js +0 -139
  204. package/src/mappings/Modal.js +0 -42
  205. package/src/mappings/NumberInput.js +0 -254
  206. package/src/mappings/Picker.js +0 -148
  207. package/src/mappings/ProgressBar.js +0 -101
  208. package/src/mappings/ProgressCircle.js +0 -109
  209. package/src/mappings/ProgressIndicator.js +0 -181
  210. package/src/mappings/RadioButton.js +0 -51
  211. package/src/mappings/RadioButtonGroup.js +0 -17
  212. package/src/mappings/RadioButtonRow.js +0 -42
  213. package/src/mappings/RowBodyIcon.js +0 -75
  214. package/src/mappings/RowHeadlineImageCaption.js +0 -167
  215. package/src/mappings/RowHeadlineImageIcon.js +0 -99
  216. package/src/mappings/SVG.js +0 -20
  217. package/src/mappings/SafeAreaView.js +0 -33
  218. package/src/mappings/ScrollView.js +0 -31
  219. package/src/mappings/Slider.js +0 -60
  220. package/src/mappings/StarRating.js +0 -43
  221. package/src/mappings/Stepper.js +0 -32
  222. package/src/mappings/Surface.js +0 -14
  223. package/src/mappings/Swiper.js +0 -62
  224. package/src/mappings/SwiperItem.js +0 -8
  225. package/src/mappings/Switch.js +0 -81
  226. package/src/mappings/Text.js +0 -251
  227. package/src/mappings/TextArea.js +0 -274
  228. package/src/mappings/TextField.js +0 -391
  229. package/src/mappings/TextInput.js +0 -402
  230. package/src/mappings/ToggleButton.js +0 -50
  231. package/src/mappings/Touchable.js +0 -60
  232. package/src/mappings/Video.js +0 -81
  233. package/src/mappings/View.js +0 -207
  234. package/src/mappings/WebView.js +0 -88
  235. package/src/styles/DarkTheme.js +0 -26
  236. package/src/styles/DefaultTheme.js +0 -111
  237. package/src/styles/fonts.js +0 -62
  238. package/src/styles/overlay.js +0 -60
  239. package/src/styles/shadow.js +0 -51
  240. package/src/theming.js +0 -3
  241. package/src/utilities.js +0 -102
@@ -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,125 +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 StarRating from "./StarRating";
9
- import { withTheme } from "../theming";
10
- import Config from "./Config";
11
- const ICON_CONTAINER_SIZE = Config.cardIconSize * 2;
12
- const ICON_CONTAINER_PADDING = Config.cardIconSize / 2 - 1;
13
- const CardContainerRating = _ref => {
14
- let {
15
- Icon,
16
- icon,
17
- image = Config.cardImageUrl,
18
- title,
19
- leftDescription,
20
- rightDescription,
21
- rating,
22
- aspectRatio = 1.5,
23
- elevation = 2,
24
- numColumns = 3,
25
- theme: {
26
- colors,
27
- roundness,
28
- typography
29
- },
30
- style,
31
- onPress,
32
- ...rest
33
- } = _ref;
34
- let titleStyle, rightDescriptionStyle;
35
- switch (numColumns) {
36
- case 2:
37
- titleStyle = typography.headline6;
38
- rightDescriptionStyle = typography.body2;
39
- break;
40
- case 3:
41
- titleStyle = typography.headline5;
42
- rightDescriptionStyle = typography.caption;
43
- break;
44
- }
45
- return /*#__PURE__*/React.createElement(Card, _extends({
46
- style: style,
47
- onPress: onPress,
48
- numColumns: numColumns
49
- }, rest), /*#__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);
@@ -1,76 +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 Image from "./Image";
5
- import Card from "./DeprecatedCardWrapper";
6
- import Elevation from "./Elevation";
7
- import { withTheme } from "../theming";
8
- import Config from "./Config";
9
- const CardContainerShortImage = _ref => {
10
- let {
11
- image = Config.squareImageUrl,
12
- title,
13
- subtitle,
14
- mode = "left",
15
- aspectRatio = 1,
16
- elevation = 2,
17
- theme: {
18
- colors,
19
- roundness,
20
- typography
21
- },
22
- style,
23
- onPress,
24
- ...rest
25
- } = _ref;
26
- return /*#__PURE__*/React.createElement(Card, _extends({
27
- style: style,
28
- onPress: onPress
29
- }, rest), /*#__PURE__*/React.createElement(Elevation, {
30
- style: {
31
- elevation,
32
- borderRadius: roundness
33
- }
34
- }, /*#__PURE__*/React.createElement(View, {
35
- style: {
36
- overflow: "hidden",
37
- flexDirection: "row",
38
- justifyContent: mode === "right" ? "space-between" : "flex-start",
39
- borderRadius: roundness
40
- }
41
- }, mode === "left" && /*#__PURE__*/React.createElement(Image, {
42
- style: {
43
- aspectRatio
44
- },
45
- source: typeof image === "string" ? {
46
- uri: image
47
- } : image,
48
- resizeMode: "cover"
49
- }), /*#__PURE__*/React.createElement(View, {
50
- style: {
51
- padding: 16,
52
- backgroundColor: colors.surface,
53
- flex: 1
54
- }
55
- }, /*#__PURE__*/React.createElement(Text, {
56
- numberOfLines: 1,
57
- style: [typography.headline5, {
58
- color: colors.strong
59
- }]
60
- }, title), subtitle ? /*#__PURE__*/React.createElement(Text, {
61
- numberOfLines: 1,
62
- style: [typography.body2, {
63
- color: colors.medium,
64
- marginTop: 4
65
- }]
66
- }, subtitle) : null), mode === "right" && /*#__PURE__*/React.createElement(Image, {
67
- style: {
68
- aspectRatio
69
- },
70
- source: typeof image === "string" ? {
71
- uri: image
72
- } : image,
73
- resizeMode: "cover"
74
- }))));
75
- };
76
- export default withTheme(CardContainerShortImage);
@@ -1,82 +0,0 @@
1
- // @ts-nocheck
2
- import React from "react";
3
- import { Pressable, View, StyleSheet } from "react-native";
4
- import { Title, Subtitle } from "./Typography";
5
- import Image from "./Image";
6
- import Surface from "./Surface";
7
- import Config from "./Config";
8
- import { withTheme } from "../theming";
9
- const CardInline = _ref => {
10
- let {
11
- image = Config.cardImageUrl,
12
- title,
13
- subtitle,
14
- aspectRatio = 1.5,
15
- elevation = 2,
16
- style,
17
- titleStyle,
18
- subtitleStyle,
19
- onPress
20
- } = _ref;
21
- const {
22
- alignItems,
23
- justifyContent,
24
- width,
25
- height
26
- } = StyleSheet.flatten(style || {});
27
- const imageStyles = width && height ? {
28
- width,
29
- height
30
- } : {
31
- aspectRatio
32
- };
33
- return /*#__PURE__*/React.createElement(Surface, {
34
- style: [{
35
- elevation
36
- }, style]
37
- }, /*#__PURE__*/React.createElement(Pressable, {
38
- disabled: !onPress,
39
- onPress: onPress,
40
- style: _ref2 => {
41
- let {
42
- pressed
43
- } = _ref2;
44
- return [{
45
- opacity: pressed ? 0.8 : 1
46
- }];
47
- }
48
- }, /*#__PURE__*/React.createElement(Image, {
49
- style: imageStyles,
50
- source: typeof image === "string" ? {
51
- uri: image
52
- } : image,
53
- resizeMode: "cover"
54
- }), /*#__PURE__*/React.createElement(View, {
55
- style: [styles.overlay, {
56
- justifyContent,
57
- alignItems
58
- }]
59
- }, title ? /*#__PURE__*/React.createElement(Title, {
60
- style: [{
61
- color: "white"
62
- }, titleStyle],
63
- text: title
64
- }) : null, subtitle ? /*#__PURE__*/React.createElement(Subtitle, {
65
- style: [{
66
- color: "rgba(255, 255, 255, 0.7)"
67
- }, subtitleStyle],
68
- text: subtitle
69
- }) : null)));
70
- };
71
- const styles = StyleSheet.create({
72
- overlay: {
73
- position: "absolute",
74
- top: 0,
75
- bottom: 0,
76
- left: 0,
77
- right: 0,
78
- padding: 16,
79
- backgroundColor: "rgba(0, 0, 0, 0.2)"
80
- }
81
- });
82
- export default withTheme(CardInline);
@@ -1,120 +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 * as React from "react";
3
- import { withTheme } from "../theming";
4
- import { ScrollView, View, StyleSheet, Dimensions } from "react-native";
5
- import Image from "./Image";
6
- const screenWidth = Dimensions.get("window").width;
7
- function Pager(_ref) {
8
- let {
9
- color,
10
- index,
11
- length
12
- } = _ref;
13
- return /*#__PURE__*/React.createElement(View, {
14
- style: styles.pager
15
- }, Array.from({
16
- length
17
- }).map((_, i) => {
18
- const current = index === i;
19
- const opacity = current ? 1 : 0.5;
20
- const size = current ? 10 : 8;
21
- return /*#__PURE__*/React.createElement(View, {
22
- key: i,
23
- style: [styles.bullet, {
24
- backgroundColor: color,
25
- opacity,
26
- width: size,
27
- height: size
28
- }]
29
- });
30
- }));
31
- }
32
- function Carousel(_ref2) {
33
- var _data$length;
34
- let {
35
- data,
36
- children,
37
- dotColor = "strong",
38
- style,
39
- ...rest
40
- } = _ref2;
41
- const [index, setIndex] = React.useState(0);
42
- const length = React.Children.count(children);
43
- const itemsLength = ((_data$length = data === null || data === void 0 ? void 0 : data.length) !== null && _data$length !== void 0 ? _data$length : 0) + length;
44
- const slides = Array.isArray(data) ? data : [];
45
- const {
46
- width,
47
- height
48
- } = StyleSheet.flatten(style || {});
49
- const slideWidth = width || screenWidth;
50
- const slideHeight = height || 250;
51
- return /*#__PURE__*/React.createElement(View, _extends({
52
- style: [styles.container, style]
53
- }, rest), /*#__PURE__*/React.createElement(ScrollView, {
54
- pagingEnabled: true,
55
- horizontal: true,
56
- decelerationRate: "fast",
57
- scrollEventThrottle: 200,
58
- showsHorizontalScrollIndicator: false,
59
- onScroll: _ref3 => {
60
- let {
61
- nativeEvent
62
- } = _ref3;
63
- const layoutWidth = nativeEvent.layoutMeasurement.width;
64
- const offset = nativeEvent.contentOffset.x;
65
- const currentIndex = Math.ceil(offset / layoutWidth);
66
- setIndex(currentIndex);
67
- }
68
- }, slides.length > 0 ? slides.map((item, i) => {
69
- return /*#__PURE__*/React.createElement(Image, {
70
- key: i,
71
- resizeMode: "cover",
72
- source: typeof item === "string" ? {
73
- uri: item
74
- } : item,
75
- style: [{
76
- width: slideWidth,
77
- height: slideHeight
78
- }]
79
- });
80
- }) : null, React.Children.map(children, child => {
81
- var _child$props;
82
- const s = (child === null || child === void 0 ? void 0 : (_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.style) || {};
83
- return /*#__PURE__*/React.createElement(View, {
84
- style: {
85
- width: slideWidth
86
- }
87
- }, /*#__PURE__*/React.cloneElement(child, {
88
- style: {
89
- ...s,
90
- width: slideWidth
91
- }
92
- }));
93
- })), /*#__PURE__*/React.createElement(Pager, {
94
- color: dotColor,
95
- index: index,
96
- length: itemsLength
97
- }));
98
- }
99
- const styles = StyleSheet.create({
100
- container: {
101
- backgroundColor: "#eee"
102
- },
103
- pager: {
104
- position: "absolute",
105
- bottom: 12,
106
- left: 0,
107
- right: 0,
108
- flexDirection: "row",
109
- justifyContent: "center",
110
- alignItems: "center"
111
- },
112
- bullet: {
113
- marginHorizontal: 2,
114
- width: 10,
115
- height: 10,
116
- borderRadius: 20,
117
- backgroundColor: "#000"
118
- }
119
- });
120
- export default withTheme(Carousel);
@@ -1,72 +0,0 @@
1
- import * as React from "react";
2
- import { View, Text, StyleSheet } from "react-native";
3
- import { withTheme } from "../theming";
4
- import Divider from "./Divider";
5
- import Touchable from "./Touchable";
6
- import Config from "./Config";
7
- const Header = _ref => {
8
- let {
9
- Icon,
10
- titleTypeStyle,
11
- titleColor,
12
- title,
13
- buttonText,
14
- dividerTopMargin,
15
- icon,
16
- onPress,
17
- style,
18
- theme: {
19
- colors,
20
- typography
21
- }
22
- } = _ref;
23
- return /*#__PURE__*/React.createElement(View, {
24
- style: [styles.container, style]
25
- }, /*#__PURE__*/React.createElement(View, {
26
- style: styles.topContainer
27
- }, /*#__PURE__*/React.createElement(Text, {
28
- style: [titleTypeStyle, {
29
- color: titleColor,
30
- flex: 1
31
- }],
32
- numberOfLines: 1
33
- }, title), onPress && /*#__PURE__*/React.createElement(Touchable, {
34
- style: {
35
- alignSelf: "center",
36
- marginLeft: 12
37
- },
38
- onPress: onPress
39
- }, /*#__PURE__*/React.createElement(View, {
40
- style: styles.buttonContainer
41
- }, /*#__PURE__*/React.createElement(Text, {
42
- style: [typography.subtitle2, {
43
- color: colors.light,
44
- marginRight: 8
45
- }],
46
- numberOfLines: 1
47
- }, buttonText), /*#__PURE__*/React.createElement(Icon, {
48
- name: icon,
49
- size: Config.headerIconSize,
50
- color: colors.light
51
- })))), /*#__PURE__*/React.createElement(Divider, {
52
- style: {
53
- marginTop: dividerTopMargin || 16
54
- }
55
- }));
56
- };
57
- const styles = StyleSheet.create({
58
- container: {
59
- alignSelf: "stretch"
60
- },
61
- topContainer: {
62
- flexDirection: "row",
63
- justifyContent: "space-between",
64
- alignItems: "center"
65
- },
66
- buttonContainer: {
67
- flexDirection: "row",
68
- justifyContent: "center",
69
- alignItems: "center"
70
- }
71
- });
72
- export default withTheme(Header);
@@ -1,28 +0,0 @@
1
- import * as React from "react";
2
- import { withTheme } from "../theming";
3
- import Header from "./Header";
4
- const HeaderLarge = _ref => {
5
- let {
6
- Icon,
7
- title,
8
- buttonText,
9
- icon,
10
- onPress = () => {},
11
- style,
12
- theme: {
13
- colors,
14
- typography
15
- }
16
- } = _ref;
17
- return /*#__PURE__*/React.createElement(Header, {
18
- Icon: Icon,
19
- titleTypeStyle: typography.headline4,
20
- titleColor: colors.strong,
21
- title: title,
22
- buttonText: buttonText,
23
- icon: icon,
24
- onPress: onPress,
25
- style: style
26
- });
27
- };
28
- export default withTheme(HeaderLarge);
@@ -1,28 +0,0 @@
1
- import * as React from "react";
2
- import { withTheme } from "../theming";
3
- import Header from "./Header";
4
- const HeaderMedium = _ref => {
5
- let {
6
- Icon,
7
- title,
8
- buttonText,
9
- icon,
10
- onPress = () => {},
11
- style,
12
- theme: {
13
- colors,
14
- typography
15
- }
16
- } = _ref;
17
- return /*#__PURE__*/React.createElement(Header, {
18
- Icon: Icon,
19
- titleTypeStyle: typography.headline6,
20
- titleColor: colors.strong,
21
- title: title,
22
- buttonText: buttonText,
23
- icon: icon,
24
- onPress: onPress,
25
- style: style
26
- });
27
- };
28
- export default withTheme(HeaderMedium);
@@ -1,29 +0,0 @@
1
- import * as React from "react";
2
- import { withTheme } from "../theming";
3
- import Header from "./Header";
4
- const HeaderOverline = _ref => {
5
- let {
6
- Icon,
7
- title,
8
- buttonText,
9
- icon,
10
- onPress = () => {},
11
- style,
12
- theme: {
13
- colors,
14
- typography
15
- }
16
- } = _ref;
17
- return /*#__PURE__*/React.createElement(Header, {
18
- Icon: Icon,
19
- titleTypeStyle: typography.overline,
20
- titleColor: colors.light,
21
- title: title && title.toUpperCase(),
22
- buttonText: buttonText,
23
- icon: icon,
24
- dividerTopMargin: 12,
25
- onPress: onPress,
26
- style: style
27
- });
28
- };
29
- export default withTheme(HeaderOverline);