@draftbit/core 46.6.0 → 46.6.2

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 (244) hide show
  1. package/lib/commonjs/components/AvatarEdit.js +15 -4
  2. package/lib/commonjs/components/CardContainer.js +4 -13
  3. package/lib/commonjs/components/CardContainerShortImage.js +4 -15
  4. package/lib/commonjs/components/Carousel.js +30 -8
  5. package/lib/commonjs/components/Checkbox/Checkbox.js +4 -22
  6. package/lib/commonjs/components/Checkbox/CheckboxGroup.js +2 -17
  7. package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +23 -5
  8. package/lib/commonjs/components/DatePicker/DatePicker.js +26 -13
  9. package/lib/commonjs/components/Divider.js +14 -1
  10. package/lib/commonjs/components/Elevation.js +2 -14
  11. package/lib/commonjs/components/FieldSearchBarFull.js +2 -1
  12. package/lib/commonjs/components/IconButton.js +19 -4
  13. package/lib/commonjs/components/Image.js +2 -17
  14. package/lib/commonjs/components/Layout.js +19 -40
  15. package/lib/commonjs/components/Picker/Picker.js +4 -9
  16. package/lib/commonjs/components/Picker/PickerComponent.web.js +3 -20
  17. package/lib/commonjs/components/Portal/Portal.js +27 -3
  18. package/lib/commonjs/components/Portal/PortalConsumer.js +22 -7
  19. package/lib/commonjs/components/Pressable.js +2 -15
  20. package/lib/commonjs/components/ProgressBar.js +7 -37
  21. package/lib/commonjs/components/RadioButton/context.js +1 -1
  22. package/lib/commonjs/components/StarRating.js +23 -4
  23. package/lib/commonjs/components/StepIndicator.js +18 -57
  24. package/lib/commonjs/components/Switch.js +10 -19
  25. package/lib/commonjs/components/Touchable.js +2 -15
  26. package/lib/commonjs/constants.js +1 -1
  27. package/lib/commonjs/hooks.js +1 -2
  28. package/lib/commonjs/mappings/StarRating.js +6 -2
  29. package/lib/commonjs/styles/overlay.js +1 -3
  30. package/lib/commonjs/utilities.js +1 -2
  31. package/lib/module/components/AnimatedCircularProgress.js +13 -1
  32. package/lib/module/components/AspectRatio.js +18 -1
  33. package/lib/module/components/Banner.js +25 -4
  34. package/lib/module/components/CardBlock.js +14 -4
  35. package/lib/module/components/CardContainerRating.js +14 -4
  36. package/lib/module/components/CardContainerShortImage.js +18 -4
  37. package/lib/module/components/Carousel.js +8 -32
  38. package/lib/module/components/Checkbox/Checkbox.js +4 -25
  39. package/lib/module/components/Checkbox/CheckboxGroupRow.js +5 -24
  40. package/lib/module/components/CircularProgress.js +8 -28
  41. package/lib/module/components/Container.js +17 -4
  42. package/lib/module/components/DatePicker/DatePicker.js +13 -27
  43. package/lib/module/components/DeprecatedButton.js +3 -21
  44. package/lib/module/components/DeprecatedFAB.js +23 -3
  45. package/lib/module/components/FieldSearchBarFull.js +2 -1
  46. package/lib/module/components/FormRow.js +17 -2
  47. package/lib/module/components/Image.js +2 -18
  48. package/lib/module/components/Picker/Picker.js +4 -10
  49. package/lib/module/components/Picker/PickerComponent.ios.js +11 -36
  50. package/lib/module/components/Picker/PickerComponent.web.js +3 -21
  51. package/lib/module/components/Portal/Portal.js +28 -3
  52. package/lib/module/components/Portal/PortalHost.js +45 -15
  53. package/lib/module/components/Portal/PortalManager.js +33 -7
  54. package/lib/module/components/ProgressBar.js +39 -7
  55. package/lib/module/components/RadioButton/RadioButton.js +13 -1
  56. package/lib/module/components/RadioButton/RadioButtonGroup.js +16 -2
  57. package/lib/module/components/RadioButton/context.js +1 -1
  58. package/lib/module/components/ScreenContainer.js +4 -21
  59. package/lib/module/components/Slider.js +21 -4
  60. package/lib/module/components/StepIndicator.js +58 -18
  61. package/lib/module/components/Surface.js +15 -1
  62. package/lib/module/components/Text.js +4 -50
  63. package/lib/module/mappings/StarRating.js +2 -7
  64. package/package.json +3 -3
  65. package/src/Provider.js +0 -9
  66. package/src/components/Accordion/AccordionGroup.js +0 -44
  67. package/src/components/Accordion/AccordionItem.js +0 -32
  68. package/src/components/Accordion/index.js +0 -2
  69. package/src/components/ActionSheet/ActionSheet.js +0 -45
  70. package/src/components/ActionSheet/ActionSheetCancel.js +0 -6
  71. package/src/components/ActionSheet/ActionSheetItem.js +0 -30
  72. package/src/components/ActionSheet/index.js +0 -3
  73. package/src/components/AnimatedCircularProgress.js +0 -43
  74. package/src/components/AspectRatio.js +0 -18
  75. package/src/components/AvatarEdit.js +0 -30
  76. package/src/components/Banner.js +0 -109
  77. package/src/components/Button.js +0 -114
  78. package/src/components/Card.js +0 -57
  79. package/src/components/CardBlock.js +0 -54
  80. package/src/components/CardContainer.js +0 -69
  81. package/src/components/CardContainerRating.js +0 -79
  82. package/src/components/CardContainerShortImage.js +0 -33
  83. package/src/components/CardInline.js +0 -36
  84. package/src/components/Carousel.js +0 -68
  85. package/src/components/Checkbox/Checkbox.js +0 -62
  86. package/src/components/Checkbox/CheckboxGroup.js +0 -21
  87. package/src/components/Checkbox/CheckboxGroupRow.js +0 -76
  88. package/src/components/Checkbox/CheckboxRow.js +0 -77
  89. package/src/components/Checkbox/context.js +0 -14
  90. package/src/components/Checkbox/index.js +0 -3
  91. package/src/components/CircleImage.js +0 -8
  92. package/src/components/CircularProgress.js +0 -81
  93. package/src/components/Config.js +0 -64
  94. package/src/components/Container.js +0 -43
  95. package/src/components/DatePicker/DatePicker.js +0 -377
  96. package/src/components/DatePicker/DatePickerComponent.js +0 -13
  97. package/src/components/DatePicker/DatePickerComponent.web.js +0 -30
  98. package/src/components/DatePicker/DatePickerComponentType.js +0 -1
  99. package/src/components/DeprecatedButton.js +0 -83
  100. package/src/components/DeprecatedCardWrapper.js +0 -18
  101. package/src/components/DeprecatedFAB.js +0 -114
  102. package/src/components/Divider.js +0 -13
  103. package/src/components/Elevation.js +0 -20
  104. package/src/components/FAB.js +0 -46
  105. package/src/components/FieldSearchBarFull.js +0 -53
  106. package/src/components/FormRow.js +0 -19
  107. package/src/components/Header.js +0 -44
  108. package/src/components/HeaderLarge.js +0 -7
  109. package/src/components/HeaderMedium.js +0 -7
  110. package/src/components/HeaderOverline.js +0 -7
  111. package/src/components/IconButton.js +0 -35
  112. package/src/components/Image.js +0 -47
  113. package/src/components/Justification.js +0 -1
  114. package/src/components/Layout.js +0 -50
  115. package/src/components/NumberInput.js +0 -49
  116. package/src/components/Picker/Picker.js +0 -267
  117. package/src/components/Picker/PickerComponent.android.js +0 -69
  118. package/src/components/Picker/PickerComponent.ios.js +0 -79
  119. package/src/components/Picker/PickerComponent.web.js +0 -70
  120. package/src/components/Picker/PickerTypes.js +0 -1
  121. package/src/components/Portal/Portal.js +0 -35
  122. package/src/components/Portal/PortalConsumer.js +0 -27
  123. package/src/components/Portal/PortalHost.js +0 -107
  124. package/src/components/Portal/PortalManager.js +0 -32
  125. package/src/components/Pressable.js +0 -12
  126. package/src/components/ProgressBar.js +0 -118
  127. package/src/components/ProgressCircle.js +0 -13
  128. package/src/components/ProgressIndicator.js +0 -27
  129. package/src/components/RadioButton/RadioButton.js +0 -17
  130. package/src/components/RadioButton/RadioButtonFieldGroup.js +0 -17
  131. package/src/components/RadioButton/RadioButtonGroup.js +0 -43
  132. package/src/components/RadioButton/RadioButtonRow.js +0 -76
  133. package/src/components/RadioButton/context.js +0 -14
  134. package/src/components/RadioButton/index.js +0 -4
  135. package/src/components/ResizeMode.js +0 -1
  136. package/src/components/Row.js +0 -48
  137. package/src/components/RowBodyIcon.js +0 -8
  138. package/src/components/RowHeadlineImageCaption.js +0 -12
  139. package/src/components/RowHeadlineImageIcon.js +0 -14
  140. package/src/components/SVG.js +0 -13
  141. package/src/components/ScreenContainer.js +0 -34
  142. package/src/components/Slider.js +0 -63
  143. package/src/components/StarRating.js +0 -50
  144. package/src/components/StepIndicator.js +0 -346
  145. package/src/components/Stepper.js +0 -41
  146. package/src/components/Surface.js +0 -32
  147. package/src/components/Swiper/Swiper.js +0 -29
  148. package/src/components/Swiper/SwiperItem.js +0 -9
  149. package/src/components/Swiper/index.js +0 -2
  150. package/src/components/Switch.js +0 -56
  151. package/src/components/Text.js +0 -33
  152. package/src/components/TextField.js +0 -428
  153. package/src/components/ToggleButton.js +0 -39
  154. package/src/components/Touchable.js +0 -12
  155. package/src/components/Touchable.web.js +0 -2
  156. package/src/components/Typography.js +0 -36
  157. package/src/components/useAuthState.js +0 -31
  158. package/src/constants.js +0 -10
  159. package/src/hooks.js +0 -12
  160. package/src/index.js +0 -53
  161. package/src/interfaces/Icon.js +0 -8
  162. package/src/mappings/Accordion.js +0 -41
  163. package/src/mappings/AccordionItem.js +0 -16
  164. package/src/mappings/ActionSheet.js +0 -13
  165. package/src/mappings/ActionSheetCancel.js +0 -19
  166. package/src/mappings/ActionSheetItem.js +0 -23
  167. package/src/mappings/ActivityIndicator.js +0 -58
  168. package/src/mappings/AudioPlayer.js +0 -57
  169. package/src/mappings/AvatarEdit.js +0 -38
  170. package/src/mappings/Banner.js +0 -32
  171. package/src/mappings/BlurView.js +0 -42
  172. package/src/mappings/Button.js +0 -116
  173. package/src/mappings/Card.js +0 -52
  174. package/src/mappings/CardBlock.js +0 -123
  175. package/src/mappings/CardContainer.js +0 -104
  176. package/src/mappings/CardContainerRating.js +0 -126
  177. package/src/mappings/CardContainerShortImage.js +0 -120
  178. package/src/mappings/CardInline.js +0 -52
  179. package/src/mappings/Carousel.js +0 -19
  180. package/src/mappings/Checkbox.js +0 -46
  181. package/src/mappings/CheckboxGroup.js +0 -26
  182. package/src/mappings/CheckboxRow.js +0 -61
  183. package/src/mappings/CircleImage.js +0 -25
  184. package/src/mappings/Container.js +0 -30
  185. package/src/mappings/CustomCode.js +0 -8
  186. package/src/mappings/DatePicker.js +0 -176
  187. package/src/mappings/Divider.js +0 -27
  188. package/src/mappings/FAB.js +0 -37
  189. package/src/mappings/Fetch.js +0 -13
  190. package/src/mappings/FieldSearchBarFull.js +0 -50
  191. package/src/mappings/FlashList.js +0 -79
  192. package/src/mappings/FlatList.js +0 -36
  193. package/src/mappings/HeaderLarge.js +0 -29
  194. package/src/mappings/HeaderMedium.js +0 -55
  195. package/src/mappings/HeaderOverline.js +0 -55
  196. package/src/mappings/Icon.js +0 -32
  197. package/src/mappings/IconButton.js +0 -35
  198. package/src/mappings/Image.js +0 -35
  199. package/src/mappings/ImageBackground.js +0 -29
  200. package/src/mappings/KeyboardAvoidingView.js +0 -41
  201. package/src/mappings/KeyboardAwareScrollView.js +0 -50
  202. package/src/mappings/Layout.js +0 -200
  203. package/src/mappings/LinearGradient.js +0 -77
  204. package/src/mappings/MapCallout.js +0 -21
  205. package/src/mappings/MapMarker.js +0 -47
  206. package/src/mappings/MapView.js +0 -139
  207. package/src/mappings/Modal.js +0 -42
  208. package/src/mappings/NumberInput.js +0 -254
  209. package/src/mappings/Picker.js +0 -148
  210. package/src/mappings/ProgressBar.js +0 -101
  211. package/src/mappings/ProgressCircle.js +0 -109
  212. package/src/mappings/ProgressIndicator.js +0 -181
  213. package/src/mappings/RadioButton.js +0 -51
  214. package/src/mappings/RadioButtonGroup.js +0 -17
  215. package/src/mappings/RadioButtonRow.js +0 -42
  216. package/src/mappings/RowBodyIcon.js +0 -75
  217. package/src/mappings/RowHeadlineImageCaption.js +0 -167
  218. package/src/mappings/RowHeadlineImageIcon.js +0 -99
  219. package/src/mappings/SVG.js +0 -20
  220. package/src/mappings/SafeAreaView.js +0 -33
  221. package/src/mappings/ScrollView.js +0 -31
  222. package/src/mappings/Slider.js +0 -60
  223. package/src/mappings/StarRating.js +0 -43
  224. package/src/mappings/Stepper.js +0 -32
  225. package/src/mappings/Surface.js +0 -14
  226. package/src/mappings/Swiper.js +0 -62
  227. package/src/mappings/SwiperItem.js +0 -8
  228. package/src/mappings/Switch.js +0 -81
  229. package/src/mappings/Text.js +0 -251
  230. package/src/mappings/TextArea.js +0 -274
  231. package/src/mappings/TextField.js +0 -391
  232. package/src/mappings/TextInput.js +0 -402
  233. package/src/mappings/ToggleButton.js +0 -50
  234. package/src/mappings/Touchable.js +0 -60
  235. package/src/mappings/Video.js +0 -81
  236. package/src/mappings/View.js +0 -207
  237. package/src/mappings/WebView.js +0 -88
  238. package/src/styles/DarkTheme.js +0 -26
  239. package/src/styles/DefaultTheme.js +0 -111
  240. package/src/styles/fonts.js +0 -62
  241. package/src/styles/overlay.js +0 -60
  242. package/src/styles/shadow.js +0 -51
  243. package/src/theming.js +0 -3
  244. package/src/utilities.js +0 -102
@@ -13,6 +13,7 @@ var _hooks = require("../hooks");
13
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
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
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
+ 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
17
  function Switch(_ref) {
17
18
  let {
18
19
  value,
@@ -37,6 +38,7 @@ function Switch(_ref) {
37
38
  setChecked(value);
38
39
  }
39
40
  }, [value, checked]);
41
+
40
42
  // This special logic is to handle weird APIs like Airtable that return
41
43
  // true or undefined for a boolean
42
44
  const previousDefaultValue = (0, _hooks.usePrevious)(defaultValue);
@@ -45,24 +47,24 @@ function Switch(_ref) {
45
47
  setChecked(Boolean(defaultValue));
46
48
  }
47
49
  }, [defaultValue, previousDefaultValue]);
48
- return /*#__PURE__*/React.createElement(_reactNative.Switch, {
50
+ return /*#__PURE__*/React.createElement(_reactNative.Switch, _extends({
49
51
  value: checked,
50
52
  disabled: disabled,
51
53
  trackColor: {
52
54
  false: inactiveTrackThemeColor,
53
55
  true: activeTrackThemeColor
54
56
  },
55
- thumbColor: value ? activeThumbThemeColor : inactiveThumbThemeColor,
57
+ thumbColor: value ? activeThumbThemeColor : inactiveThumbThemeColor
56
58
  // @ts-ignore react-native-web only
59
+ ,
57
60
  activeThumbColor: activeThumbThemeColor,
58
61
  ios_backgroundColor: inactiveTrackThemeColor,
59
62
  style: style,
60
63
  onValueChange: bool => {
61
64
  setChecked(bool);
62
65
  onValueChange && onValueChange(bool);
63
- },
64
- ...rest
65
- });
66
+ }
67
+ }, rest));
66
68
  }
67
69
  function Row(_ref2) {
68
70
  let {
@@ -91,7 +93,7 @@ function Row(_ref2) {
91
93
  setChecked(defaultValue);
92
94
  }
93
95
  }, [defaultValue]);
94
- return /*#__PURE__*/React.createElement(_FormRow.default, {
96
+ return /*#__PURE__*/React.createElement(_FormRow.default, _extends({
95
97
  disabled: disabled,
96
98
  onPress: () => {
97
99
  setChecked(!checked);
@@ -99,9 +101,8 @@ function Row(_ref2) {
99
101
  },
100
102
  label: label,
101
103
  direction: direction,
102
- style: style,
103
- ...rest
104
- }, /*#__PURE__*/React.createElement(Switch, {
104
+ style: style
105
+ }, rest), /*#__PURE__*/React.createElement(Switch, {
105
106
  theme: theme,
106
107
  value: checked,
107
108
  disabled: disabled,
@@ -115,14 +116,4 @@ function Row(_ref2) {
115
116
  const SwitchRow = (0, _theming.withTheme)(Row);
116
117
  exports.SwitchRow = SwitchRow;
117
118
  var _default = (0, _theming.withTheme)(Switch);
118
- exports.default = _default;hange: onValueChange,
119
- activeTrackColor: activeTrackColor,
120
- inactiveTrackColor: inactiveTrackColor,
121
- activeThumbColor: activeThumbColor,
122
- inactiveThumbColor: inactiveThumbColor
123
- }));
124
- }
125
- const SwitchRow = (0, _theming.withTheme)(Row);
126
- exports.SwitchRow = SwitchRow;
127
- var _default = (0, _theming.withTheme)(Switch);
128
119
  exports.default = _default;
@@ -7,6 +7,7 @@ exports.default = Touchable;
7
7
  var _react = _interopRequireDefault(require("react"));
8
8
  var _reactNative = require("react-native");
9
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
+ 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); }
10
11
  function Touchable(_ref) {
11
12
  let {
12
13
  children,
@@ -19,22 +20,8 @@ function Touchable(_ref) {
19
20
  style,
20
21
  ...props
21
22
  } = _ref;
22
- return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, {
23
+ return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, _extends({
23
24
  disabled: disabled,
24
- onPress: onPress,
25
- delayLongPress: delayLongPress ? delayLongPress : 500,
26
- hitSlop: hitSlop ? hitSlop : 8,
27
- style: _ref2 => {
28
- let {
29
- pressed
30
- } = _ref2;
31
- return [{
32
- opacity: pressed ? activeOpacity : disabled ? disabledOpacity : 1
33
- }, style];
34
- },
35
- ...props
36
- }, children);
37
- } disabled: disabled,
38
25
  onPress: onPress,
39
26
  delayLongPress: delayLongPress ? delayLongPress : 500,
40
27
  hitSlop: hitSlop ? hitSlop : 8,
@@ -12,4 +12,4 @@ const APPROX_STATUSBAR_HEIGHT = _reactNative.Platform.select({
12
12
  android: DEFAULT_STATUSBAR_HEIGHT_EXPO,
13
13
  ios: _reactNative.Platform.Version < 11 ? DEFAULT_STATUSBAR_HEIGHT_EXPO : 0
14
14
  });
15
- exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_HEIGHT;
15
+ exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_HEIGHT;AR_HEIGHT;
@@ -10,12 +10,11 @@ function usePrevious(value) {
10
10
  // The ref object is a generic container whose current property is mutable
11
11
  // and can hold any value, similar to an instance property on a class
12
12
  const ref = _react.default.useRef();
13
-
14
13
  // Store current value in ref
15
14
  _react.default.useEffect(() => {
16
15
  ref.current = value;
17
16
  }, [value]);
18
-
19
17
  // Return previous value (happens before update in useEffect above)
20
18
  return ref.current;
19
+ }
21
20
  }
@@ -23,9 +23,7 @@ const SEED_DATA = {
23
23
  }),
24
24
  fieldName: (0, _types.createFieldNameProp)({
25
25
  defaultValue: "ratingValue",
26
- // this is the name of the variable declared on the screen in Draftbit
27
26
  handlerPropName: "onPress",
28
- // the change handler prop in this component
29
27
  valuePropName: "rating" // the value prop in this component
30
28
  }),
31
29
 
@@ -50,4 +48,10 @@ const SEED_DATA = {
50
48
  })
51
49
  }
52
50
  };
51
+ exports.SEED_DATA = SEED_DATA;pes.createColorProp)({
52
+ label: "Inactive Color",
53
+ defaultValue: "divider"
54
+ })
55
+ }
56
+ };
53
57
  exports.SEED_DATA = SEED_DATA;
@@ -15,7 +15,6 @@ function overlay(elevation) {
15
15
  let surfaceColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _DarkTheme.default.colors.surface;
16
16
  if (isAnimatedValue(elevation)) {
17
17
  const inputRange = [0, 1, 2, 3, 8, 24];
18
-
19
18
  // @ts-expect-error: TS doesn't seem to refine the type correctly
20
19
  return elevation.interpolate({
21
20
  inputRange,
@@ -24,7 +23,6 @@ function overlay(elevation) {
24
23
  })
25
24
  });
26
25
  }
27
-
28
26
  // @ts-expect-error: TS doesn't seem to refine the type correctly
29
27
  return calculateColor(surfaceColor, elevation);
30
28
  }
@@ -65,4 +63,4 @@ const elevationOverlayTransparency = {
65
63
  22: 15.72,
66
64
  23: 15.84,
67
65
  24: 16
68
- };
66
+ };};
@@ -57,7 +57,6 @@ function extractBorderAndMarginStyles(style, additionalBorderStyles, additionalM
57
57
  marginStyles
58
58
  };
59
59
  }
60
-
61
60
  /**
62
61
  * Merges a style object on top of another style object. In React Native,
63
62
  * keys with undefined values in a style object will still override styles
@@ -90,4 +89,4 @@ function getValueForRadioButton(value) {
90
89
  } else {
91
90
  throw new Error("Invalid value: ".concat(value));
92
91
  }
93
- }
92
+ }}
@@ -1,4 +1,3 @@
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
1
  import * as React from "react";
3
2
  import { Animated, Easing } from "react-native";
4
3
  import CircularProgress from "./CircularProgress";
@@ -46,6 +45,19 @@ const AnimatedCircularProgress = _ref => {
46
45
  React.useEffect(() => {
47
46
  animate();
48
47
  }, [fill, animate]);
48
+ return /*#__PURE__*/React.createElement(AnimatedProgress, {
49
+ ...other,
50
+ style: other.style,
51
+ childrenContainerStyle: other.childrenContainerStyle,
52
+ fill: fillAnimation,
53
+ tintColor: animateColor()
54
+ });
55
+ };
56
+ export default AnimatedCircularProgress;imation;
57
+ };
58
+ React.useEffect(() => {
59
+ animate();
60
+ }, [fill, animate]);
49
61
  return /*#__PURE__*/React.createElement(AnimatedProgress, _extends({}, other, {
50
62
  style: other.style,
51
63
  childrenContainerStyle: other.childrenContainerStyle,
@@ -1,4 +1,3 @@
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
1
  import React from "react";
3
2
  import { View, StyleSheet } from "react-native";
4
3
  const AspectRatio = props => {
@@ -27,6 +26,24 @@ const AspectRatio = props => {
27
26
  });
28
27
  }
29
28
  }
29
+ return /*#__PURE__*/React.createElement(View, {
30
+ ...props,
31
+ style: style,
32
+ onLayout: _ref => {
33
+ let {
34
+ nativeEvent: {
35
+ layout: l
36
+ }
37
+ } = _ref;
38
+ return setLayout(l);
39
+ }
40
+ }, props.children);
41
+ };
42
+ export default AspectRatio;idth,
43
+ height: width * (1 / aspectRatio)
44
+ });
45
+ }
46
+ }
30
47
  return /*#__PURE__*/React.createElement(View, _extends({}, props, {
31
48
  style: style,
32
49
  onLayout: _ref => {
@@ -1,4 +1,3 @@
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
1
  import * as React from "react";
3
2
  import { Button, Text, View, StyleSheet, Animated } from "react-native";
4
3
  import Surface from "./Surface";
@@ -61,7 +60,6 @@ const Banner = _ref => {
61
60
  measured: true
62
61
  });
63
62
  };
64
-
65
63
  // The banner animation has 2 parts:
66
64
  // 1. Blank spacer element which animates its height to move the content
67
65
  // 2. Actual banner which animates its translateY
@@ -71,9 +69,10 @@ const Banner = _ref => {
71
69
  // However we can't animated banner's height directly as it'll also resize the content inside
72
70
  const height = Animated.multiply(position, layout.height);
73
71
  const translateY = Animated.multiply(Animated.add(position, -1), layout.height);
74
- return /*#__PURE__*/React.createElement(Surface, _extends({}, rest, {
72
+ return /*#__PURE__*/React.createElement(Surface, {
73
+ ...rest,
75
74
  style: [styles.container, shadow(ELEVATION), style]
76
- }), /*#__PURE__*/React.createElement(View, {
75
+ }, /*#__PURE__*/React.createElement(View, {
77
76
  style: [styles.wrapper, contentStyle]
78
77
  }, /*#__PURE__*/React.createElement(Animated.View, {
79
78
  style: {
@@ -154,4 +153,26 @@ const styles = StyleSheet.create({
154
153
  margin: 8
155
154
  }
156
155
  });
156
+ export default withTheme(Banner);
157
+ },
158
+ content: {
159
+ flexDirection: "row",
160
+ justifyContent: "flex-start",
161
+ marginHorizontal: 8,
162
+ marginTop: 16,
163
+ marginBottom: 0
164
+ },
165
+ icon: {
166
+ margin: 8
167
+ },
168
+ message: {
169
+ flex: 1,
170
+ margin: 8
171
+ },
172
+ actions: {
173
+ flexDirection: "row",
174
+ justifyContent: "flex-end",
175
+ margin: 8
176
+ }
177
+ });
157
178
  export default withTheme(Banner);
@@ -1,4 +1,3 @@
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
1
  import React from "react";
3
2
  import { View, Text } from "react-native";
4
3
  import Image from "./Image";
@@ -42,11 +41,12 @@ const CardBlock = _ref => {
42
41
  const rightDescriptionStyles = [typography.subtitle2, {
43
42
  color: colors.light
44
43
  }];
45
- return /*#__PURE__*/React.createElement(Card, _extends({
44
+ return /*#__PURE__*/React.createElement(Card, {
46
45
  style: style,
47
46
  onPress: onPress,
48
- numColumns: numColumns
49
- }, rest), /*#__PURE__*/React.createElement(View, {
47
+ numColumns: numColumns,
48
+ ...rest
49
+ }, /*#__PURE__*/React.createElement(View, {
50
50
  style: {
51
51
  backgroundColor: colors.background
52
52
  }
@@ -95,4 +95,14 @@ const CardBlock = _ref => {
95
95
  style: rightDescriptionStyles
96
96
  }, rightDescription) : null) : null));
97
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
+ };
98
108
  export default withTheme(CardBlock);
@@ -1,4 +1,3 @@
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
1
  import React from "react";
3
2
  import { View, Text } from "react-native";
4
3
  import color from "color";
@@ -42,11 +41,12 @@ const CardContainerRating = _ref => {
42
41
  rightDescriptionStyle = typography.caption;
43
42
  break;
44
43
  }
45
- return /*#__PURE__*/React.createElement(Card, _extends({
44
+ return /*#__PURE__*/React.createElement(Card, {
46
45
  style: style,
47
46
  onPress: onPress,
48
- numColumns: numColumns
49
- }, rest), /*#__PURE__*/React.createElement(Elevation, {
47
+ numColumns: numColumns,
48
+ ...rest
49
+ }, /*#__PURE__*/React.createElement(Elevation, {
50
50
  style: {
51
51
  elevation,
52
52
  borderRadius: roundness
@@ -122,4 +122,14 @@ const CardContainerRating = _ref => {
122
122
  color: colors.surface
123
123
  })) : null)));
124
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
+ };
125
135
  export default withTheme(CardContainerRating);
@@ -1,4 +1,3 @@
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
1
  import React from "react";
3
2
  import { View, Text } from "react-native";
4
3
  import Image from "./Image";
@@ -23,10 +22,11 @@ const CardContainerShortImage = _ref => {
23
22
  onPress,
24
23
  ...rest
25
24
  } = _ref;
26
- return /*#__PURE__*/React.createElement(Card, _extends({
25
+ return /*#__PURE__*/React.createElement(Card, {
27
26
  style: style,
28
- onPress: onPress
29
- }, rest), /*#__PURE__*/React.createElement(Elevation, {
27
+ onPress: onPress,
28
+ ...rest
29
+ }, /*#__PURE__*/React.createElement(Elevation, {
30
30
  style: {
31
31
  elevation,
32
32
  borderRadius: roundness
@@ -73,4 +73,18 @@ const CardContainerShortImage = _ref => {
73
73
  resizeMode: "cover"
74
74
  }))));
75
75
  };
76
+ export default withTheme(CardContainerShortImage);2, {
77
+ color: colors.medium,
78
+ marginTop: 4
79
+ }]
80
+ }, subtitle) : null), mode === "right" && /*#__PURE__*/React.createElement(Image, {
81
+ style: {
82
+ aspectRatio
83
+ },
84
+ source: typeof image === "string" ? {
85
+ uri: image
86
+ } : image,
87
+ resizeMode: "cover"
88
+ }))));
89
+ };
76
90
  export default withTheme(CardContainerShortImage);
@@ -1,3 +1,4 @@
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); }
1
2
  import * as React from "react";
2
3
  import { withTheme } from "../theming";
3
4
  import { ScrollView, View, StyleSheet, Dimensions } from "react-native";
@@ -29,6 +30,7 @@ function Pager(_ref) {
29
30
  }));
30
31
  }
31
32
  function Carousel(_ref2) {
33
+ var _data$length;
32
34
  let {
33
35
  data,
34
36
  children,
@@ -36,10 +38,9 @@ function Carousel(_ref2) {
36
38
  style,
37
39
  ...rest
38
40
  } = _ref2;
39
- var _a;
40
41
  const [index, setIndex] = React.useState(0);
41
42
  const length = React.Children.count(children);
42
- const itemsLength = ((_a = data === null || data === void 0 ? void 0 : data.length) !== null && _a !== void 0 ? _a : 0) + length;
43
+ const itemsLength = ((_data$length = data === null || data === void 0 ? void 0 : data.length) !== null && _data$length !== void 0 ? _data$length : 0) + length;
43
44
  const slides = Array.isArray(data) ? data : [];
44
45
  const {
45
46
  width,
@@ -47,10 +48,9 @@ function Carousel(_ref2) {
47
48
  } = StyleSheet.flatten(style || {});
48
49
  const slideWidth = width || screenWidth;
49
50
  const slideHeight = height || 250;
50
- return /*#__PURE__*/React.createElement(View, {
51
- style: [styles.container, style],
52
- ...rest
53
- }, /*#__PURE__*/React.createElement(ScrollView, {
51
+ return /*#__PURE__*/React.createElement(View, _extends({
52
+ style: [styles.container, style]
53
+ }, rest), /*#__PURE__*/React.createElement(ScrollView, {
54
54
  pagingEnabled: true,
55
55
  horizontal: true,
56
56
  decelerationRate: "fast",
@@ -78,8 +78,8 @@ function Carousel(_ref2) {
78
78
  }]
79
79
  });
80
80
  }) : null, React.Children.map(children, child => {
81
- var _a;
82
- const s = ((_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.style) || {};
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
83
  return /*#__PURE__*/React.createElement(View, {
84
84
  style: {
85
85
  width: slideWidth
@@ -117,28 +117,4 @@ const styles = StyleSheet.create({
117
117
  backgroundColor: "#000"
118
118
  }
119
119
  });
120
- export default withTheme(Carousel);gth
121
- }));
122
- }
123
- const styles = StyleSheet.create({
124
- container: {
125
- backgroundColor: "#eee"
126
- },
127
- pager: {
128
- position: "absolute",
129
- bottom: 12,
130
- left: 0,
131
- right: 0,
132
- flexDirection: "row",
133
- justifyContent: "center",
134
- alignItems: "center"
135
- },
136
- bullet: {
137
- marginHorizontal: 2,
138
- width: 10,
139
- height: 10,
140
- borderRadius: 20,
141
- backgroundColor: "#000"
142
- }
143
- });
144
120
  export default withTheme(Carousel);
@@ -1,3 +1,4 @@
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); }
1
2
  import * as React from "react";
2
3
  import { View, StyleSheet, Pressable } from "react-native";
3
4
  import { useTheme } from "../../theming";
@@ -25,6 +26,7 @@ const Checkbox = _ref => {
25
26
  setInternalValue(status);
26
27
  }
27
28
  }, [status]);
29
+
28
30
  // This special logic is to handle weird APIs like Airtable that return
29
31
  // true or undefined for a boolean
30
32
  const previousDefaultValue = usePrevious(defaultValue);
@@ -48,8 +50,7 @@ const Checkbox = _ref => {
48
50
  onUncheck === null || onUncheck === void 0 ? void 0 : onUncheck();
49
51
  }
50
52
  };
51
- return /*#__PURE__*/React.createElement(Pressable, {
52
- ...rest,
53
+ return /*#__PURE__*/React.createElement(Pressable, _extends({}, rest, {
53
54
  onPress: handlePress,
54
55
  disabled: disabled,
55
56
  accessibilityState: {
@@ -61,7 +62,7 @@ const Checkbox = _ref => {
61
62
  width: size,
62
63
  height: size
63
64
  }]
64
- }, /*#__PURE__*/React.createElement(Icon, {
65
+ }), /*#__PURE__*/React.createElement(Icon, {
65
66
  style: styles.icon,
66
67
  name: internalValue ? checkedIcon : uncheckedIcon,
67
68
  size: size,
@@ -94,26 +95,4 @@ const styles = StyleSheet.create({
94
95
  alignSelf: "center"
95
96
  }
96
97
  });
97
- export default Checkbox;or: checkboxColor
98
- }]
99
- })));
100
- };
101
- const styles = StyleSheet.create({
102
- container: {
103
- borderRadius: 18
104
- },
105
- fillContainer: {
106
- alignItems: "center",
107
- justifyContent: "center"
108
- },
109
- icon: {
110
- alignSelf: "center"
111
- },
112
- fill: {
113
- borderRadius: 5,
114
- width: 30,
115
- height: 30,
116
- alignSelf: "center"
117
- }
118
- });
119
98
  export default Checkbox;
@@ -1,3 +1,4 @@
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); }
1
2
  import * as React from "react";
2
3
  import { StyleSheet, View, Platform, Pressable } from "react-native";
3
4
  import Checkbox from "./Checkbox";
@@ -5,7 +6,7 @@ import Text from "../Text";
5
6
  import { useCheckboxGroupContext } from "./context";
6
7
  import { Direction as GroupDirection } from "./context";
7
8
  import { extractStyles } from "../../utilities";
8
- export var Direction;
9
+ export let Direction;
9
10
  (function (Direction) {
10
11
  Direction["Row"] = "row";
11
12
  Direction["RowReverse"] = "row-reverse";
@@ -62,14 +63,13 @@ const CheckboxGroupRow = _ref => {
62
63
  textStyles,
63
64
  viewStyles
64
65
  } = extractStyles(style);
65
- return /*#__PURE__*/React.createElement(Pressable, {
66
+ return /*#__PURE__*/React.createElement(Pressable, _extends({
66
67
  onPress: handlePress,
67
68
  style: [styles.mainParent, {
68
69
  flexDirection: direction
69
70
  }, viewStyles],
70
- disabled: disabled,
71
- ...rest
72
- }, /*#__PURE__*/React.createElement(View, {
71
+ disabled: disabled
72
+ }, rest), /*#__PURE__*/React.createElement(View, {
73
73
  style: [styles.label, {
74
74
  alignItems: direction === Direction.Row ? "flex-start" : "flex-end"
75
75
  }, labelContainerStyle]
@@ -107,23 +107,4 @@ const styles = StyleSheet.create({
107
107
  flex: 3
108
108
  }
109
109
  });
110
- export default CheckboxGroupRow;reate({
111
- mainParent: {
112
- alignItems: "center",
113
- justifyContent: "space-around",
114
- paddingStart: 20,
115
- minHeight: 50,
116
- paddingEnd: 20,
117
- display: "flex",
118
- ...Platform.select({
119
- web: {
120
- cursor: "pointer",
121
- userSelect: "none"
122
- }
123
- })
124
- },
125
- label: {
126
- flex: 3
127
- }
128
- });
129
110
  export default CheckboxGroupRow;
@@ -1,24 +1,27 @@
1
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
1
4
  import React from "react";
2
5
  import { View } from "react-native";
3
6
  import { Svg, Path, G } from "react-native-svg";
4
7
  class CircularProgress extends React.Component {
5
8
  constructor() {
6
9
  super(...arguments);
7
- this.polarToCartesian = (centerX, centerY, radius, angleInDegrees) => {
10
+ _defineProperty(this, "polarToCartesian", (centerX, centerY, radius, angleInDegrees) => {
8
11
  var angleInRadians = (angleInDegrees - 90) * Math.PI / 180.0;
9
12
  return {
10
13
  x: centerX + radius * Math.cos(angleInRadians),
11
14
  y: centerY + radius * Math.sin(angleInRadians)
12
15
  };
13
- };
14
- this.circlePath = (x, y, radius, startAngle, endAngle) => {
16
+ });
17
+ _defineProperty(this, "circlePath", (x, y, radius, startAngle, endAngle) => {
15
18
  var start = this.polarToCartesian(x, y, radius, endAngle * 0.9999);
16
19
  var end = this.polarToCartesian(x, y, radius, startAngle);
17
20
  var largeArcFlag = endAngle - startAngle <= 180 ? "0" : "1";
18
21
  var d = ["M", start.x, start.y, "A", radius, radius, 0, largeArcFlag, 0, end.x, end.y];
19
22
  return d.join(" ");
20
- };
21
- this.clampFill = fill => Math.min(100, Math.max(0, fill));
23
+ });
24
+ _defineProperty(this, "clampFill", fill => Math.min(100, Math.max(0, fill)));
22
25
  }
23
26
  render() {
24
27
  const {
@@ -98,27 +101,4 @@ class CircularProgress extends React.Component {
98
101
  }, children(fill)));
99
102
  }
100
103
  }
101
- export default CircularProgress;eElement(G, {
102
- rotation: rotation,
103
- originX: (size + padding) / 2,
104
- originY: (size + padding) / 2
105
- }, backgroundColor && /*#__PURE__*/React.createElement(Path, {
106
- d: backgroundPath,
107
- stroke: backgroundColor,
108
- strokeWidth: backgroundWidth || width,
109
- strokeLinecap: lineCap,
110
- strokeDasharray: strokeDasharrayBackground,
111
- fill: "transparent"
112
- }), fill > 0 && /*#__PURE__*/React.createElement(Path, {
113
- d: circlePathItem,
114
- stroke: tintColor,
115
- strokeWidth: width,
116
- strokeLinecap: lineCap,
117
- strokeDasharray: strokeDasharrayTint,
118
- fill: "transparent"
119
- }), cap)), children && /*#__PURE__*/React.createElement(View, {
120
- style: localChildrenContainerStyle
121
- }, children(fill)));
122
- }
123
- }
124
104
  export default CircularProgress;