@hero-design/rn 7.22.0 → 7.22.1

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.
@@ -1,9 +1,9 @@
1
- @hero-design/rn:build: cache hit, replaying output 37ea971f848bea65
1
+ @hero-design/rn:build: cache hit, replaying output f989e19224b6c38b
2
2
  @hero-design/rn:build: $ yarn build:js && yarn build:types
3
3
  @hero-design/rn:build: $ rollup -c
4
4
  @hero-design/rn:build: 
5
5
  @hero-design/rn:build: src/index.ts → lib/index.js, es/index.js...
6
6
  @hero-design/rn:build: (!) Plugin replace: @rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.
7
7
  @hero-design/rn:build: (!) Plugin node-resolve: preferring built-in module 'events' over local alternative at '/root/hero-design/node_modules/events/events.js', pass 'preferBuiltins: false' to disable this behavior or 'preferBuiltins: true' to disable this warning
8
- @hero-design/rn:build: created lib/index.js, es/index.js in 20s
8
+ @hero-design/rn:build: created lib/index.js, es/index.js in 26.3s
9
9
  @hero-design/rn:build: $ tsc --noEmit false --emitDeclarationOnly
package/es/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as reactNative from 'react-native';
2
- import { Platform, Dimensions, StyleSheet as StyleSheet$1, Animated, View, Easing, TouchableOpacity, Text as Text$1, Image as Image$1, TouchableWithoutFeedback, Pressable, SafeAreaView, TouchableHighlight, Modal, TextInput as TextInput$1, PanResponder, InteractionManager, SectionList, Keyboard, FlatList, LayoutAnimation } from 'react-native';
2
+ import { Platform, Dimensions, StyleSheet as StyleSheet$1, Animated, View, Easing, TouchableOpacity, Text as Text$1, Image as Image$1, TouchableWithoutFeedback, Pressable, SafeAreaView, KeyboardAvoidingView, TouchableHighlight, Modal, TextInput as TextInput$1, PanResponder, InteractionManager, SectionList, Keyboard, FlatList, LayoutAnimation } from 'react-native';
3
3
  import React, { useContext, createContext, createElement, forwardRef, useEffect, useCallback, useRef, useMemo, useState, useLayoutEffect, useImperativeHandle } from 'react';
4
4
  import { createIconSetFromIcoMoon } from 'react-native-vector-icons';
5
5
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
@@ -15234,6 +15234,12 @@ var AnimatedSafeAreaView = Animated.createAnimatedComponent(SafeAreaView);
15234
15234
  var StyledWrapper$7 = index$8(View)(_objectSpread2(_objectSpread2({}, StyleSheet$1.absoluteFillObject), {}, {
15235
15235
  flexDirection: 'column-reverse'
15236
15236
  }));
15237
+ var StyledKeyboardAvoidingView = index$8(KeyboardAvoidingView)(function () {
15238
+ return {
15239
+ flex: 1,
15240
+ flexDirection: 'column-reverse'
15241
+ };
15242
+ });
15237
15243
  var StyledBottomSheet = index$8(AnimatedSafeAreaView)(function (_ref) {
15238
15244
  var theme = _ref.theme;
15239
15245
  return {
@@ -15936,18 +15942,18 @@ var BottomSheet = function BottomSheet(_ref) {
15936
15942
  _ref$showDivider = _ref.showDivider,
15937
15943
  showDivider = _ref$showDivider === void 0 ? true : _ref$showDivider,
15938
15944
  style = _ref.style,
15939
- testID = _ref.testID;
15945
+ testID = _ref.testID,
15946
+ _ref$keyboardAvoiding = _ref.keyboardAvoidingViewProps,
15947
+ keyboardAvoidingViewProps = _ref$keyboardAvoiding === void 0 ? {} : _ref$keyboardAvoiding;
15940
15948
 
15941
- var _useState = useState(0),
15942
- _useState2 = _slicedToArray(_useState, 2),
15943
- height = _useState2[0],
15944
- setHeight = _useState2[1]; // Internal state to control modal open/close timing with animation
15949
+ var _Dimensions$get = Dimensions.get('window'),
15950
+ height = _Dimensions$get.height; // Internal state to control modal open/close timing with animation
15945
15951
 
15946
15952
 
15947
- var _useState3 = useState(open),
15948
- _useState4 = _slicedToArray(_useState3, 2),
15949
- visible = _useState4[0],
15950
- setVisibility = _useState4[1];
15953
+ var _useState = useState(open),
15954
+ _useState2 = _slicedToArray(_useState, 2),
15955
+ visible = _useState2[0],
15956
+ setVisibility = _useState2[1];
15951
15957
 
15952
15958
  var animatedValue = useRef(new Animated.Value(open ? 0 : 1));
15953
15959
  useEffect(function () {
@@ -16005,11 +16011,9 @@ var BottomSheet = function BottomSheet(_ref) {
16005
16011
  opacity: interpolateOpacity
16006
16012
  },
16007
16013
  onPress: onRequestClose
16008
- }), /*#__PURE__*/React.createElement(StyledBottomSheet, {
16009
- onLayout: function onLayout(_ref3) {
16010
- var nativeEvent = _ref3.nativeEvent;
16011
- return setHeight(nativeEvent.layout.height);
16012
- },
16014
+ }), /*#__PURE__*/React.createElement(StyledKeyboardAvoidingView, _extends$1({
16015
+ behavior: Platform.OS === 'ios' ? 'padding' : 'height'
16016
+ }, keyboardAvoidingViewProps), /*#__PURE__*/React.createElement(StyledBottomSheet, {
16013
16017
  style: [style, {
16014
16018
  transform: [{
16015
16019
  scaleY: height > 0 ? 1 : 0
@@ -16024,7 +16028,7 @@ var BottomSheet = function BottomSheet(_ref) {
16024
16028
  showCloseButton: showCloseButton
16025
16029
  }) : null, children, footer ? /*#__PURE__*/React.createElement(Footer$1, {
16026
16030
  showDivider: showDivider
16027
- }, footer) : null)));
16031
+ }, footer) : null))));
16028
16032
  };
16029
16033
 
16030
16034
  var colors = {
package/lib/index.js CHANGED
@@ -15263,6 +15263,12 @@ var AnimatedSafeAreaView = reactNative.Animated.createAnimatedComponent(reactNat
15263
15263
  var StyledWrapper$7 = index$8(reactNative.View)(_objectSpread2(_objectSpread2({}, reactNative.StyleSheet.absoluteFillObject), {}, {
15264
15264
  flexDirection: 'column-reverse'
15265
15265
  }));
15266
+ var StyledKeyboardAvoidingView = index$8(reactNative.KeyboardAvoidingView)(function () {
15267
+ return {
15268
+ flex: 1,
15269
+ flexDirection: 'column-reverse'
15270
+ };
15271
+ });
15266
15272
  var StyledBottomSheet = index$8(AnimatedSafeAreaView)(function (_ref) {
15267
15273
  var theme = _ref.theme;
15268
15274
  return {
@@ -15965,18 +15971,18 @@ var BottomSheet = function BottomSheet(_ref) {
15965
15971
  _ref$showDivider = _ref.showDivider,
15966
15972
  showDivider = _ref$showDivider === void 0 ? true : _ref$showDivider,
15967
15973
  style = _ref.style,
15968
- testID = _ref.testID;
15974
+ testID = _ref.testID,
15975
+ _ref$keyboardAvoiding = _ref.keyboardAvoidingViewProps,
15976
+ keyboardAvoidingViewProps = _ref$keyboardAvoiding === void 0 ? {} : _ref$keyboardAvoiding;
15969
15977
 
15970
- var _useState = React.useState(0),
15971
- _useState2 = _slicedToArray(_useState, 2),
15972
- height = _useState2[0],
15973
- setHeight = _useState2[1]; // Internal state to control modal open/close timing with animation
15978
+ var _Dimensions$get = reactNative.Dimensions.get('window'),
15979
+ height = _Dimensions$get.height; // Internal state to control modal open/close timing with animation
15974
15980
 
15975
15981
 
15976
- var _useState3 = React.useState(open),
15977
- _useState4 = _slicedToArray(_useState3, 2),
15978
- visible = _useState4[0],
15979
- setVisibility = _useState4[1];
15982
+ var _useState = React.useState(open),
15983
+ _useState2 = _slicedToArray(_useState, 2),
15984
+ visible = _useState2[0],
15985
+ setVisibility = _useState2[1];
15980
15986
 
15981
15987
  var animatedValue = React.useRef(new reactNative.Animated.Value(open ? 0 : 1));
15982
15988
  React.useEffect(function () {
@@ -16034,11 +16040,9 @@ var BottomSheet = function BottomSheet(_ref) {
16034
16040
  opacity: interpolateOpacity
16035
16041
  },
16036
16042
  onPress: onRequestClose
16037
- }), /*#__PURE__*/React__default["default"].createElement(StyledBottomSheet, {
16038
- onLayout: function onLayout(_ref3) {
16039
- var nativeEvent = _ref3.nativeEvent;
16040
- return setHeight(nativeEvent.layout.height);
16041
- },
16043
+ }), /*#__PURE__*/React__default["default"].createElement(StyledKeyboardAvoidingView, _extends$1({
16044
+ behavior: reactNative.Platform.OS === 'ios' ? 'padding' : 'height'
16045
+ }, keyboardAvoidingViewProps), /*#__PURE__*/React__default["default"].createElement(StyledBottomSheet, {
16042
16046
  style: [style, {
16043
16047
  transform: [{
16044
16048
  scaleY: height > 0 ? 1 : 0
@@ -16053,7 +16057,7 @@ var BottomSheet = function BottomSheet(_ref) {
16053
16057
  showCloseButton: showCloseButton
16054
16058
  }) : null, children, footer ? /*#__PURE__*/React__default["default"].createElement(Footer$1, {
16055
16059
  showDivider: showDivider
16056
- }, footer) : null)));
16060
+ }, footer) : null))));
16057
16061
  };
16058
16062
 
16059
16063
  var colors = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hero-design/rn",
3
- "version": "7.22.0",
3
+ "version": "7.22.1",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -20,7 +20,7 @@
20
20
  "dependencies": {
21
21
  "@emotion/native": "^11.9.3",
22
22
  "@emotion/react": "^11.9.3",
23
- "@hero-design/colors": "7.22.0",
23
+ "@hero-design/colors": "7.22.1",
24
24
  "date-fns": "^2.16.1",
25
25
  "events": "^3.2.0",
26
26
  "hero-editor": "^1.9.9"
@@ -57,7 +57,7 @@
57
57
  "@types/react-native": "^0.67.7",
58
58
  "@types/react-native-vector-icons": "^6.4.10",
59
59
  "babel-plugin-inline-import": "^3.0.0",
60
- "eslint-config-hd": "7.22.0",
60
+ "eslint-config-hd": "7.22.1",
61
61
  "jest": "^27.3.1",
62
62
  "react": "17.0.2",
63
63
  "react-native": "0.65.1",
@@ -70,7 +70,7 @@
70
70
  "rollup-plugin-copy": "^3.4.0",
71
71
  "rollup-plugin-flow": "^1.1.1",
72
72
  "ts-jest": "^27.0.7",
73
- "prettier-config-hd": "7.22.0"
73
+ "prettier-config-hd": "7.22.1"
74
74
  },
75
75
  "prettier": "prettier-config-hd"
76
76
  }
@@ -1,6 +1,8 @@
1
1
  import styled from '@emotion/native';
2
2
  import {
3
3
  Animated,
4
+ KeyboardAvoidingView,
5
+ KeyboardAvoidingViewProps,
4
6
  Pressable,
5
7
  SafeAreaView,
6
8
  StyleSheet,
@@ -17,6 +19,13 @@ const StyledWrapper = styled(View)<ViewProps>({
17
19
  flexDirection: 'column-reverse',
18
20
  });
19
21
 
22
+ const StyledKeyboardAvoidingView = styled(
23
+ KeyboardAvoidingView
24
+ )<KeyboardAvoidingViewProps>(() => ({
25
+ flex: 1,
26
+ flexDirection: 'column-reverse',
27
+ }));
28
+
20
29
  const StyledBottomSheet = styled(AnimatedSafeAreaView)<
21
30
  ComponentProps<typeof AnimatedSafeAreaView>
22
31
  >(({ theme }) => ({
@@ -77,4 +86,5 @@ export {
77
86
  StyledIconWrapper,
78
87
  StyledBottomSheet,
79
88
  StyledBackdrop,
89
+ StyledKeyboardAvoidingView,
80
90
  };