@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
@@ -2,6 +2,9 @@ import {
2
2
  COMPONENT_TYPES,
3
3
  createStaticBoolProp,
4
4
  CONTAINER_COMPONENT_STYLES_SECTIONS,
5
+ Triggers,
6
+ createActionProp,
7
+ createColorProp,
5
8
  } from "@draftbit/types";
6
9
 
7
10
  export const SEED_DATA = {
@@ -11,7 +14,9 @@ export const SEED_DATA = {
11
14
  category: COMPONENT_TYPES.view,
12
15
  stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
13
16
  layout: {},
17
+ triggers: [Triggers.OnRefresh],
14
18
  props: {
19
+ onRefresh: createActionProp(),
15
20
  horizontal: createStaticBoolProp({
16
21
  label: "Horizontal",
17
22
  description: "Render your list horizontally",
@@ -21,7 +26,7 @@ export const SEED_DATA = {
21
26
  label: "Show Horizontal Scroll Indicator",
22
27
  description:
23
28
  "When true, shows a horizontal scroll indicator. The default value is true.",
24
- defaultValue: false,
29
+ defaultValue: true,
25
30
  }),
26
31
  showsVerticalScrollIndicator: createStaticBoolProp({
27
32
  label: "Show Vertical Scroll Indicator",
@@ -35,5 +40,9 @@ export const SEED_DATA = {
35
40
  "When true, the scroll view bounces when it reaches the end of the content if the content is larger then the scroll view along the axis of the scroll direction.",
36
41
  defaultValue: true,
37
42
  }),
43
+ refreshColor: createColorProp({
44
+ label: "Refreshing Color",
45
+ description: "Color of the refresh indicator",
46
+ }),
38
47
  },
39
48
  };
@@ -1,4 +1,4 @@
1
- import { COMPONENT_TYPES, createActionProp, Triggers, createStaticNumberProp, StylesPanelSections, } from "@draftbit/types";
1
+ import { COMPONENT_TYPES, createActionProp, Triggers, createStaticNumberProp, StylesPanelSections, createDisabledProp, GROUPS, createStaticBoolProp, } from "@draftbit/types";
2
2
  const SEED_DATA_PROPS = {
3
3
  stylesPanelSections: [
4
4
  StylesPanelSections.Size,
@@ -10,10 +10,11 @@ const SEED_DATA_PROPS = {
10
10
  props: {
11
11
  onPress: createActionProp(),
12
12
  onLongPress: createActionProp(),
13
+ disabled: createDisabledProp(),
13
14
  activeOpacity: createStaticNumberProp({
14
15
  label: "Active Opacity",
15
16
  description: "The opacity when the button is pressed.",
16
- defaultValue: 0.8,
17
+ defaultValue: null,
17
18
  min: 0,
18
19
  max: 1,
19
20
  step: 0.01,
@@ -23,7 +24,7 @@ const SEED_DATA_PROPS = {
23
24
  disabledOpacity: createStaticNumberProp({
24
25
  label: "Disabled Opacity",
25
26
  description: "The opacity when the button is disabled.",
26
- defaultValue: 0.8,
27
+ defaultValue: null,
27
28
  min: 0,
28
29
  max: 1,
29
30
  step: 0.01,
@@ -40,6 +41,12 @@ const SEED_DATA_PROPS = {
40
41
  description: "Sets additional distance outside of element in which a press can be detected.",
41
42
  required: false,
42
43
  }),
44
+ android_disableSound: createStaticBoolProp({
45
+ label: "Disable Sound",
46
+ description: "Disable the Android sound effect.",
47
+ defaultValue: null,
48
+ group: GROUPS.android,
49
+ }),
43
50
  },
44
51
  };
45
52
  export const SEED_DATA = [
@@ -4,6 +4,9 @@ import {
4
4
  Triggers,
5
5
  createStaticNumberProp,
6
6
  StylesPanelSections,
7
+ createDisabledProp,
8
+ GROUPS,
9
+ createStaticBoolProp,
7
10
  } from "@draftbit/types";
8
11
 
9
12
  const SEED_DATA_PROPS = {
@@ -17,10 +20,11 @@ const SEED_DATA_PROPS = {
17
20
  props: {
18
21
  onPress: createActionProp(),
19
22
  onLongPress: createActionProp(),
23
+ disabled: createDisabledProp(),
20
24
  activeOpacity: createStaticNumberProp({
21
25
  label: "Active Opacity",
22
26
  description: "The opacity when the button is pressed.",
23
- defaultValue: 0.8,
27
+ defaultValue: null,
24
28
  min: 0,
25
29
  max: 1,
26
30
  step: 0.01,
@@ -30,7 +34,7 @@ const SEED_DATA_PROPS = {
30
34
  disabledOpacity: createStaticNumberProp({
31
35
  label: "Disabled Opacity",
32
36
  description: "The opacity when the button is disabled.",
33
- defaultValue: 0.8,
37
+ defaultValue: null,
34
38
  min: 0,
35
39
  max: 1,
36
40
  step: 0.01,
@@ -49,6 +53,12 @@ const SEED_DATA_PROPS = {
49
53
  "Sets additional distance outside of element in which a press can be detected.",
50
54
  required: false,
51
55
  }),
56
+ android_disableSound: createStaticBoolProp({
57
+ label: "Disable Sound",
58
+ description: "Disable the Android sound effect.",
59
+ defaultValue: null,
60
+ group: GROUPS.android,
61
+ }),
52
62
  },
53
63
  };
54
64
 
@@ -1,115 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _reactNative = require("react-native");
9
- var _Image = _interopRequireDefault(require("./Image"));
10
- var _DeprecatedCardWrapper = _interopRequireDefault(require("./DeprecatedCardWrapper"));
11
- var _Elevation = _interopRequireDefault(require("./Elevation"));
12
- var _theming = require("../theming");
13
- var _Config = _interopRequireDefault(require("./Config"));
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
- const CardBlock = _ref => {
16
- let {
17
- image = _Config.default.cardImageUrl,
18
- title,
19
- leftDescription,
20
- rightDescription,
21
- titleCentered,
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 titleJustification;
35
- let titleStyle;
36
- if (titleCentered && !leftDescription && !rightDescription) {
37
- titleJustification = "center";
38
- } else {
39
- titleJustification = "space-between";
40
- }
41
- if (numColumns === 1) {
42
- titleStyle = typography.button;
43
- } else if (numColumns === 2) {
44
- titleStyle = typography.headline6;
45
- } else {
46
- titleStyle = typography.headline5;
47
- }
48
- const rightDescriptionStyles = [typography.subtitle2, {
49
- color: colors.light
50
- }];
51
- return /*#__PURE__*/_react.default.createElement(_DeprecatedCardWrapper.default, {
52
- style: style,
53
- onPress: onPress,
54
- numColumns: numColumns,
55
- ...rest
56
- }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
57
- style: {
58
- backgroundColor: colors.background
59
- }
60
- }, /*#__PURE__*/_react.default.createElement(_Elevation.default, {
61
- style: {
62
- elevation,
63
- borderRadius: roundness
64
- }
65
- }, /*#__PURE__*/_react.default.createElement(_Image.default, {
66
- style: {
67
- borderRadius: roundness,
68
- aspectRatio
69
- },
70
- source: typeof image === "string" ? {
71
- uri: image
72
- } : image,
73
- resizeMode: "cover"
74
- })), title ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
75
- style: {
76
- flexDirection: "row",
77
- alignItems: "center",
78
- justifyContent: titleJustification,
79
- marginTop: numColumns === 3 ? 16 : 12
80
- }
81
- }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
82
- numberOfLines: 1,
83
- style: [titleStyle, {
84
- color: colors.strong
85
- }]
86
- }, title), !leftDescription && rightDescription ? /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
87
- style: rightDescriptionStyles
88
- }, rightDescription) : null) : null, leftDescription ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
89
- style: {
90
- flexDirection: "row",
91
- justifyContent: "space-between",
92
- alignItems: "center",
93
- marginTop: numColumns === 3 ? 4 : 4 / 2
94
- }
95
- }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
96
- numberOfLines: 1,
97
- style: [typography.body2, {
98
- color: colors.medium
99
- }]
100
- }, leftDescription), rightDescription ? /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
101
- numberOfLines: 1,
102
- style: rightDescriptionStyles
103
- }, rightDescription) : null) : null));
104
- };
105
- var _default = (0, _theming.withTheme)(CardBlock);
106
- exports.default = _default;yle: [typography.body2, {
107
- color: colors.medium
108
- }]
109
- }, leftDescription), rightDescription ? /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
110
- numberOfLines: 1,
111
- style: rightDescriptionStyles
112
- }, rightDescription) : null) : null));
113
- };
114
- var _default = (0, _theming.withTheme)(CardBlock);
115
- exports.default = _default;
@@ -1,138 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _reactNative = require("react-native");
9
- var _color = _interopRequireDefault(require("color"));
10
- var _Image = _interopRequireDefault(require("./Image"));
11
- var _DeprecatedCardWrapper = _interopRequireDefault(require("./DeprecatedCardWrapper"));
12
- var _Elevation = _interopRequireDefault(require("./Elevation"));
13
- var _theming = require("../theming");
14
- var _Config = _interopRequireDefault(require("./Config"));
15
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
- const ICON_CONTAINER_SIZE = _Config.default.cardIconSize * 2;
17
- const ICON_CONTAINER_PADDING = _Config.default.cardIconSize / 2 - 1;
18
- const CardContainer = _ref => {
19
- let {
20
- Icon,
21
- icon,
22
- image = _Config.default.cardImageUrl,
23
- title,
24
- leftDescription,
25
- rightDescription,
26
- textCentered,
27
- aspectRatio = 1.5,
28
- elevation = 2,
29
- numColumns = 3,
30
- theme: {
31
- colors,
32
- roundness,
33
- typography
34
- },
35
- style,
36
- onPress,
37
- ...rest
38
- } = _ref;
39
- let textJustification;
40
- let titleStyle;
41
- if (textCentered && !rightDescription) {
42
- textJustification = "center";
43
- } else {
44
- textJustification = "space-between";
45
- }
46
- switch (numColumns) {
47
- case 2:
48
- titleStyle = typography.headline6;
49
- break;
50
- case 3:
51
- titleStyle = typography.headline5;
52
- break;
53
- }
54
- return /*#__PURE__*/_react.default.createElement(_DeprecatedCardWrapper.default, {
55
- style: style,
56
- onPress: onPress,
57
- numColumns: numColumns,
58
- ...rest
59
- }, /*#__PURE__*/_react.default.createElement(_Elevation.default, {
60
- style: {
61
- elevation,
62
- borderRadius: roundness
63
- }
64
- }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
65
- style: {
66
- borderRadius: roundness,
67
- overflow: "hidden",
68
- backgroundColor: colors.surface
69
- }
70
- }, /*#__PURE__*/_react.default.createElement(_Image.default, {
71
- style: {
72
- aspectRatio
73
- },
74
- source: typeof image === "string" ? {
75
- uri: image
76
- } : image,
77
- resizeMode: "cover"
78
- }), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
79
- style: {
80
- padding: numColumns === 1 ? 8 : 16
81
- }
82
- }, title ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
83
- style: {
84
- flexDirection: "row",
85
- alignItems: "center",
86
- justifyContent: textJustification
87
- }
88
- }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
89
- numberOfLines: 1,
90
- style: [titleStyle, {
91
- color: colors.strong
92
- }]
93
- }, title)) : null, leftDescription ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
94
- style: {
95
- flexDirection: "row",
96
- justifyContent: textJustification,
97
- alignItems: "center",
98
- marginTop: numColumns === 3 ? 4 : 4 / 2
99
- }
100
- }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
101
- numberOfLines: 1,
102
- style: [typography.body2, {
103
- color: colors.medium
104
- }]
105
- }, leftDescription), rightDescription ? /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
106
- numberOfLines: 1,
107
- style: [typography.subtitle2, {
108
- color: colors.light
109
- }]
110
- }, rightDescription) : null) : null), icon ? /*#__PURE__*/_react.default.createElement(_Elevation.default, {
111
- style: {
112
- elevation: _Config.default.cardIconElevation,
113
- position: "absolute",
114
- top: 12,
115
- right: 12,
116
- width: ICON_CONTAINER_SIZE,
117
- height: ICON_CONTAINER_SIZE,
118
- padding: ICON_CONTAINER_PADDING,
119
- borderRadius: ICON_CONTAINER_SIZE,
120
- backgroundColor: (0, _color.default)(colors.strong).alpha(_Config.default.cardIconBackgroundOpacity).rgb().string()
121
- }
122
- }, /*#__PURE__*/_react.default.createElement(Icon, {
123
- name: icon,
124
- size: _Config.default.cardIconSize,
125
- color: colors.surface
126
- })) : null)));
127
- };
128
- var _default = (0, _theming.withTheme)(CardContainer);
129
- exports.default = _default;0, _color.default)(colors.strong).alpha(_Config.default.cardIconBackgroundOpacity).rgb().string()
130
- }
131
- }, /*#__PURE__*/_react.default.createElement(Icon, {
132
- name: icon,
133
- size: _Config.default.cardIconSize,
134
- color: colors.surface
135
- })) : null)));
136
- };
137
- var _default = (0, _theming.withTheme)(CardContainer);
138
- exports.default = _default;
@@ -1,133 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _reactNative = require("react-native");
9
- var _color = _interopRequireDefault(require("color"));
10
- var _Image = _interopRequireDefault(require("./Image"));
11
- var _DeprecatedCardWrapper = _interopRequireDefault(require("./DeprecatedCardWrapper"));
12
- var _Elevation = _interopRequireDefault(require("./Elevation"));
13
- var _StarRating = _interopRequireDefault(require("./StarRating"));
14
- var _theming = require("../theming");
15
- var _Config = _interopRequireDefault(require("./Config"));
16
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
- 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); }
18
- const ICON_CONTAINER_SIZE = _Config.default.cardIconSize * 2;
19
- const ICON_CONTAINER_PADDING = _Config.default.cardIconSize / 2 - 1;
20
- const CardContainerRating = _ref => {
21
- let {
22
- Icon,
23
- icon,
24
- image = _Config.default.cardImageUrl,
25
- title,
26
- leftDescription,
27
- rightDescription,
28
- rating,
29
- aspectRatio = 1.5,
30
- elevation = 2,
31
- numColumns = 3,
32
- theme: {
33
- colors,
34
- roundness,
35
- typography
36
- },
37
- style,
38
- onPress,
39
- ...rest
40
- } = _ref;
41
- let titleStyle, rightDescriptionStyle;
42
- switch (numColumns) {
43
- case 2:
44
- titleStyle = typography.headline6;
45
- rightDescriptionStyle = typography.body2;
46
- break;
47
- case 3:
48
- titleStyle = typography.headline5;
49
- rightDescriptionStyle = typography.caption;
50
- break;
51
- }
52
- return /*#__PURE__*/_react.default.createElement(_DeprecatedCardWrapper.default, _extends({
53
- style: style,
54
- onPress: onPress,
55
- numColumns: numColumns
56
- }, rest), /*#__PURE__*/_react.default.createElement(_Elevation.default, {
57
- style: {
58
- elevation,
59
- borderRadius: roundness
60
- }
61
- }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
62
- style: {
63
- borderRadius: roundness,
64
- overflow: "hidden",
65
- backgroundColor: colors.background
66
- //background color is needed for bug on android 9 - https://github.com/facebook/react-native/issues/25093
67
- }
68
- }, /*#__PURE__*/_react.default.createElement(_Image.default, {
69
- style: {
70
- aspectRatio
71
- },
72
- source: typeof image === "string" ? {
73
- uri: image
74
- } : image,
75
- resizeMode: "cover"
76
- }), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
77
- style: {
78
- padding: numColumns === 1 ? 8 : 16
79
- }
80
- }, title ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
81
- style: {
82
- flexDirection: "row",
83
- alignItems: "center",
84
- justifyContent: "space-between"
85
- }
86
- }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
87
- numberOfLines: 1,
88
- style: [titleStyle, {
89
- color: colors.strong
90
- }]
91
- }, title)) : null, leftDescription ? /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
92
- numberOfLines: 1,
93
- style: [typography.body2, {
94
- color: colors.medium,
95
- marginTop: numColumns === 3 ? 4 : 4 / 2
96
- }]
97
- }, leftDescription) : null, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
98
- style: {
99
- flexDirection: "row",
100
- justifyContent: "space-between",
101
- alignItems: "center",
102
- marginTop: numColumns === 3 ? 16 : 12
103
- }
104
- }, /*#__PURE__*/_react.default.createElement(_StarRating.default, {
105
- Icon: Icon,
106
- starSize: numColumns === 1 ? 10 : 16,
107
- rating: rating
108
- }), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
109
- style: [rightDescriptionStyle, {
110
- color: colors.medium,
111
- marginLeft: 8
112
- }],
113
- numberOfLines: 1
114
- }, rightDescription))), icon ? /*#__PURE__*/_react.default.createElement(_Elevation.default, {
115
- style: {
116
- elevation: _Config.default.cardIconElevation,
117
- position: "absolute",
118
- top: 12,
119
- right: 12,
120
- width: ICON_CONTAINER_SIZE,
121
- height: ICON_CONTAINER_SIZE,
122
- padding: ICON_CONTAINER_PADDING,
123
- borderRadius: ICON_CONTAINER_SIZE,
124
- backgroundColor: (0, _color.default)(colors.strong).alpha(_Config.default.cardIconBackgroundOpacity).rgb().string()
125
- }
126
- }, /*#__PURE__*/_react.default.createElement(Icon, {
127
- name: icon,
128
- size: _Config.default.cardIconSize,
129
- color: colors.surface
130
- })) : null)));
131
- };
132
- var _default = (0, _theming.withTheme)(CardContainerRating);
133
- exports.default = _default;
@@ -1,84 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _reactNative = require("react-native");
9
- var _Image = _interopRequireDefault(require("./Image"));
10
- var _DeprecatedCardWrapper = _interopRequireDefault(require("./DeprecatedCardWrapper"));
11
- var _Elevation = _interopRequireDefault(require("./Elevation"));
12
- var _theming = require("../theming");
13
- var _Config = _interopRequireDefault(require("./Config"));
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
- 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); }
16
- const CardContainerShortImage = _ref => {
17
- let {
18
- image = _Config.default.squareImageUrl,
19
- title,
20
- subtitle,
21
- mode = "left",
22
- aspectRatio = 1,
23
- elevation = 2,
24
- theme: {
25
- colors,
26
- roundness,
27
- typography
28
- },
29
- style,
30
- onPress,
31
- ...rest
32
- } = _ref;
33
- return /*#__PURE__*/_react.default.createElement(_DeprecatedCardWrapper.default, _extends({
34
- style: style,
35
- onPress: onPress
36
- }, rest), /*#__PURE__*/_react.default.createElement(_Elevation.default, {
37
- style: {
38
- elevation,
39
- borderRadius: roundness
40
- }
41
- }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
42
- style: {
43
- overflow: "hidden",
44
- flexDirection: "row",
45
- justifyContent: mode === "right" ? "space-between" : "flex-start",
46
- borderRadius: roundness
47
- }
48
- }, mode === "left" && /*#__PURE__*/_react.default.createElement(_Image.default, {
49
- style: {
50
- aspectRatio
51
- },
52
- source: typeof image === "string" ? {
53
- uri: image
54
- } : image,
55
- resizeMode: "cover"
56
- }), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
57
- style: {
58
- padding: 16,
59
- backgroundColor: colors.surface,
60
- flex: 1
61
- }
62
- }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
63
- numberOfLines: 1,
64
- style: [typography.headline5, {
65
- color: colors.strong
66
- }]
67
- }, title), subtitle ? /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
68
- numberOfLines: 1,
69
- style: [typography.body2, {
70
- color: colors.medium,
71
- marginTop: 4
72
- }]
73
- }, subtitle) : null), mode === "right" && /*#__PURE__*/_react.default.createElement(_Image.default, {
74
- style: {
75
- aspectRatio
76
- },
77
- source: typeof image === "string" ? {
78
- uri: image
79
- } : image,
80
- resizeMode: "cover"
81
- }))));
82
- };
83
- var _default = (0, _theming.withTheme)(CardContainerShortImage);
84
- exports.default = _default;
@@ -1,91 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _reactNative = require("react-native");
9
- var _Typography = require("./Typography");
10
- var _Image = _interopRequireDefault(require("./Image"));
11
- var _Surface = _interopRequireDefault(require("./Surface"));
12
- var _Config = _interopRequireDefault(require("./Config"));
13
- var _theming = require("../theming");
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
- // @ts-nocheck
16
-
17
- const CardInline = _ref => {
18
- let {
19
- image = _Config.default.cardImageUrl,
20
- title,
21
- subtitle,
22
- aspectRatio = 1.5,
23
- elevation = 2,
24
- style,
25
- titleStyle,
26
- subtitleStyle,
27
- onPress
28
- } = _ref;
29
- const {
30
- alignItems,
31
- justifyContent,
32
- width,
33
- height
34
- } = _reactNative.StyleSheet.flatten(style || {});
35
- const imageStyles = width && height ? {
36
- width,
37
- height
38
- } : {
39
- aspectRatio
40
- };
41
- return /*#__PURE__*/_react.default.createElement(_Surface.default, {
42
- style: [{
43
- elevation
44
- }, style]
45
- }, /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, {
46
- disabled: !onPress,
47
- onPress: onPress,
48
- style: _ref2 => {
49
- let {
50
- pressed
51
- } = _ref2;
52
- return [{
53
- opacity: pressed ? 0.8 : 1
54
- }];
55
- }
56
- }, /*#__PURE__*/_react.default.createElement(_Image.default, {
57
- style: imageStyles,
58
- source: typeof image === "string" ? {
59
- uri: image
60
- } : image,
61
- resizeMode: "cover"
62
- }), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
63
- style: [styles.overlay, {
64
- justifyContent,
65
- alignItems
66
- }]
67
- }, title ? /*#__PURE__*/_react.default.createElement(_Typography.Title, {
68
- style: [{
69
- color: "white"
70
- }, titleStyle],
71
- text: title
72
- }) : null, subtitle ? /*#__PURE__*/_react.default.createElement(_Typography.Subtitle, {
73
- style: [{
74
- color: "rgba(255, 255, 255, 0.7)"
75
- }, subtitleStyle],
76
- text: subtitle
77
- }) : null)));
78
- };
79
- const styles = _reactNative.StyleSheet.create({
80
- overlay: {
81
- position: "absolute",
82
- top: 0,
83
- bottom: 0,
84
- left: 0,
85
- right: 0,
86
- padding: 16,
87
- backgroundColor: "rgba(0, 0, 0, 0.2)"
88
- }
89
- });
90
- var _default = (0, _theming.withTheme)(CardInline);
91
- exports.default = _default;