@hero-design/rn 8.84.2 → 8.85.0

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,7 +1,7 @@
1
- (node:2992) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
1
+ (node:2994) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
2
2
  (Use `node --trace-warnings ...` to show where the warning was created)
3
3
  
4
4
  src/index.ts → lib/index.js, es/index.js...
5
5
  (!) [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`.
6
6
  (!) [plugin node-resolve] preferring built-in module 'events' over local alternative at '/home/runner/work/hero-design/hero-design/node_modules/events/events.js', pass 'preferBuiltins: false' to disable this behavior or 'preferBuiltins: true' to disable this warning.or passing a function to 'preferBuiltins' to provide more fine-grained control over which built-in modules to prefer.
7
- created lib/index.js, es/index.js in 52.3s
7
+ created lib/index.js, es/index.js in 50s
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @hero-design/rn
2
2
 
3
+ ## 8.85.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#3605](https://github.com/Thinkei/hero-design/pull/3605) [`ab87bce2a285fbbe735eca30fa686f26eb2f2a97`](https://github.com/Thinkei/hero-design/commit/ab87bce2a285fbbe735eca30fa686f26eb2f2a97) Thanks [@vinhphan-eh](https://github.com/vinhphan-eh)! - [Box] Support gap property
8
+
9
+ ## 8.84.3
10
+
11
+ ### Patch Changes
12
+
13
+ - [#3598](https://github.com/Thinkei/hero-design/pull/3598) [`b837f8d5986633709c679de6132c10b8d404c398`](https://github.com/Thinkei/hero-design/commit/b837f8d5986633709c679de6132c10b8d404c398) Thanks [@nhatle684](https://github.com/nhatle684)! - [BottomSheet.ScrollView] Add support ref
14
+
3
15
  ## 8.84.2
4
16
 
5
17
  ### Patch Changes
package/es/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as reactNative from 'react-native';
2
2
  import { Platform, Dimensions, StyleSheet as StyleSheet$1, Animated, View, UIManager, LayoutAnimation, TouchableOpacity, Text as Text$1, Easing, useWindowDimensions, TouchableWithoutFeedback, Modal as Modal$1, Image as Image$1, Pressable, SafeAreaView, KeyboardAvoidingView, TouchableHighlight, ScrollView, FlatList, TextInput as TextInput$1, PanResponder, BackHandler, InteractionManager, Keyboard, SectionList, RefreshControl as RefreshControl$1 } from 'react-native';
3
3
  import * as React from 'react';
4
- import React__default, { useMemo, useEffect, useCallback, useRef, useLayoutEffect, useState, createContext, useContext, forwardRef, memo, useReducer, useImperativeHandle, isValidElement } from 'react';
4
+ import React__default, { useMemo, useEffect, useCallback, useRef, useLayoutEffect, useState, createContext, forwardRef, useContext, memo, useReducer, useImperativeHandle, isValidElement } from 'react';
5
5
  import { createIconSet } from 'react-native-vector-icons';
6
6
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
7
7
  import { MonthYearPickerViewIOS, MonthYearPickerDialogueAndroid } from '@hero-design/react-native-month-year-picker';
@@ -8831,6 +8831,10 @@ var space = {
8831
8831
  paddingVertical: {
8832
8832
  property: 'paddingVertical',
8833
8833
  scale: 'space'
8834
+ },
8835
+ gap: {
8836
+ property: 'gap',
8837
+ scale: 'space'
8834
8838
  }
8835
8839
  };
8836
8840
  var radii = {
@@ -10133,7 +10137,7 @@ var Header = function Header(_ref) {
10133
10137
  };
10134
10138
 
10135
10139
  var _excluded$x = ["scrollEventThrottle"];
10136
- var BottomSheetScrollView = function BottomSheetScrollView(_ref) {
10140
+ var BottomSheetScrollView = /*#__PURE__*/forwardRef(function (_ref, ref) {
10137
10141
  var _ref$scrollEventThrot = _ref.scrollEventThrottle,
10138
10142
  scrollEventThrottle = _ref$scrollEventThrot === void 0 ? 100 : _ref$scrollEventThrot,
10139
10143
  props = _objectWithoutProperties(_ref, _excluded$x);
@@ -10155,12 +10159,13 @@ var BottomSheetScrollView = function BottomSheetScrollView(_ref) {
10155
10159
  props === null || props === void 0 || (_props$onMomentumScro2 = props.onMomentumScrollEnd) === null || _props$onMomentumScro2 === void 0 || _props$onMomentumScro2.call(props, e);
10156
10160
  }, []);
10157
10161
  return /*#__PURE__*/React__default.createElement(ScrollView, _extends$1({}, props, {
10162
+ ref: ref,
10158
10163
  onScrollBeginDrag: onScrollBeginDrag,
10159
10164
  onMomentumScrollBegin: onMomentumScrollBegin,
10160
10165
  onMomentumScrollEnd: onMomentumScrollEnd,
10161
10166
  scrollEventThrottle: scrollEventThrottle
10162
10167
  }));
10163
- };
10168
+ });
10164
10169
 
10165
10170
  var BottomSheet = function BottomSheet(_ref) {
10166
10171
  var open = _ref.open,
package/lib/index.js CHANGED
@@ -8859,6 +8859,10 @@ var space = {
8859
8859
  paddingVertical: {
8860
8860
  property: 'paddingVertical',
8861
8861
  scale: 'space'
8862
+ },
8863
+ gap: {
8864
+ property: 'gap',
8865
+ scale: 'space'
8862
8866
  }
8863
8867
  };
8864
8868
  var radii = {
@@ -10161,7 +10165,7 @@ var Header = function Header(_ref) {
10161
10165
  };
10162
10166
 
10163
10167
  var _excluded$x = ["scrollEventThrottle"];
10164
- var BottomSheetScrollView = function BottomSheetScrollView(_ref) {
10168
+ var BottomSheetScrollView = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
10165
10169
  var _ref$scrollEventThrot = _ref.scrollEventThrottle,
10166
10170
  scrollEventThrottle = _ref$scrollEventThrot === void 0 ? 100 : _ref$scrollEventThrot,
10167
10171
  props = _objectWithoutProperties(_ref, _excluded$x);
@@ -10183,12 +10187,13 @@ var BottomSheetScrollView = function BottomSheetScrollView(_ref) {
10183
10187
  props === null || props === void 0 || (_props$onMomentumScro2 = props.onMomentumScrollEnd) === null || _props$onMomentumScro2 === void 0 || _props$onMomentumScro2.call(props, e);
10184
10188
  }, []);
10185
10189
  return /*#__PURE__*/React__namespace.default.createElement(reactNative.ScrollView, _extends$1({}, props, {
10190
+ ref: ref,
10186
10191
  onScrollBeginDrag: onScrollBeginDrag,
10187
10192
  onMomentumScrollBegin: onMomentumScrollBegin,
10188
10193
  onMomentumScrollEnd: onMomentumScrollEnd,
10189
10194
  scrollEventThrottle: scrollEventThrottle
10190
10195
  }));
10191
- };
10196
+ });
10192
10197
 
10193
10198
  var BottomSheet = function BottomSheet(_ref) {
10194
10199
  var open = _ref.open,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hero-design/rn",
3
- "version": "8.84.2",
3
+ "version": "8.85.0",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -1,4 +1,4 @@
1
- import React, { useContext, useCallback } from 'react';
1
+ import React, { useContext, useCallback, forwardRef } from 'react';
2
2
  import {
3
3
  NativeScrollEvent,
4
4
  NativeSyntheticEvent,
@@ -9,49 +9,49 @@ import BottomSheetContext, {
9
9
  BottomSheetContextType,
10
10
  } from './BottomSheetContext';
11
11
 
12
- const BottomSheetScrollView = ({
13
- scrollEventThrottle = 100,
14
- ...props
15
- }: ScrollViewProps): JSX.Element => {
16
- const { setInternalShowDivider } =
17
- useContext<BottomSheetContextType>(BottomSheetContext);
18
-
19
- const onScrollBeginDrag = useCallback(
20
- (e: NativeSyntheticEvent<NativeScrollEvent>) => {
21
- setInternalShowDivider(true);
22
-
23
- props?.onScrollBeginDrag?.(e);
24
- },
25
- []
26
- );
27
-
28
- const onMomentumScrollBegin = useCallback(
29
- (e: NativeSyntheticEvent<NativeScrollEvent>) => {
30
- setInternalShowDivider(true);
31
-
32
- props?.onMomentumScrollEnd?.(e);
33
- },
34
- []
35
- );
36
-
37
- const onMomentumScrollEnd = useCallback(
38
- (e: NativeSyntheticEvent<NativeScrollEvent>) => {
39
- setInternalShowDivider(false);
40
-
41
- props?.onMomentumScrollEnd?.(e);
42
- },
43
- []
44
- );
45
-
46
- return (
47
- <ScrollView
48
- {...props}
49
- onScrollBeginDrag={onScrollBeginDrag}
50
- onMomentumScrollBegin={onMomentumScrollBegin}
51
- onMomentumScrollEnd={onMomentumScrollEnd}
52
- scrollEventThrottle={scrollEventThrottle}
53
- />
54
- );
55
- };
12
+ const BottomSheetScrollView = forwardRef<ScrollView, ScrollViewProps>(
13
+ ({ scrollEventThrottle = 100, ...props }, ref): JSX.Element => {
14
+ const { setInternalShowDivider } =
15
+ useContext<BottomSheetContextType>(BottomSheetContext);
16
+
17
+ const onScrollBeginDrag = useCallback(
18
+ (e: NativeSyntheticEvent<NativeScrollEvent>) => {
19
+ setInternalShowDivider(true);
20
+
21
+ props?.onScrollBeginDrag?.(e);
22
+ },
23
+ []
24
+ );
25
+
26
+ const onMomentumScrollBegin = useCallback(
27
+ (e: NativeSyntheticEvent<NativeScrollEvent>) => {
28
+ setInternalShowDivider(true);
29
+
30
+ props?.onMomentumScrollEnd?.(e);
31
+ },
32
+ []
33
+ );
34
+
35
+ const onMomentumScrollEnd = useCallback(
36
+ (e: NativeSyntheticEvent<NativeScrollEvent>) => {
37
+ setInternalShowDivider(false);
38
+
39
+ props?.onMomentumScrollEnd?.(e);
40
+ },
41
+ []
42
+ );
43
+
44
+ return (
45
+ <ScrollView
46
+ {...props}
47
+ ref={ref}
48
+ onScrollBeginDrag={onScrollBeginDrag}
49
+ onMomentumScrollBegin={onMomentumScrollBegin}
50
+ onMomentumScrollEnd={onMomentumScrollEnd}
51
+ scrollEventThrottle={scrollEventThrottle}
52
+ />
53
+ );
54
+ }
55
+ );
56
56
 
57
57
  export default BottomSheetScrollView;
@@ -567,6 +567,7 @@ exports[`Box map prop to valid property and correct space from theme 1`] = `
567
567
  }
568
568
  >
569
569
  <View
570
+ gap="large"
570
571
  margin="large"
571
572
  marginBottom="large"
572
573
  marginEnd="large"
@@ -588,6 +589,7 @@ exports[`Box map prop to valid property and correct space from theme 1`] = `
588
589
  style={
589
590
  [
590
591
  {
592
+ "gap": 24,
591
593
  "margin": 24,
592
594
  "marginBottom": 24,
593
595
  "marginEnd": 24,
@@ -643,6 +645,7 @@ exports[`Box map prop to valid property and correct space from theme 2`] = `
643
645
  }
644
646
  >
645
647
  <View
648
+ gap="medium"
646
649
  margin="medium"
647
650
  marginBottom="medium"
648
651
  marginEnd="medium"
@@ -664,6 +667,7 @@ exports[`Box map prop to valid property and correct space from theme 2`] = `
664
667
  style={
665
668
  [
666
669
  {
670
+ "gap": 16,
667
671
  "margin": 16,
668
672
  "marginBottom": 16,
669
673
  "marginEnd": 16,
@@ -719,6 +723,7 @@ exports[`Box map prop to valid property and correct space from theme 3`] = `
719
723
  }
720
724
  >
721
725
  <View
726
+ gap="small"
722
727
  margin="small"
723
728
  marginBottom="small"
724
729
  marginEnd="small"
@@ -740,6 +745,7 @@ exports[`Box map prop to valid property and correct space from theme 3`] = `
740
745
  style={
741
746
  [
742
747
  {
748
+ "gap": 8,
743
749
  "margin": 8,
744
750
  "marginBottom": 8,
745
751
  "marginEnd": 8,
@@ -795,6 +801,7 @@ exports[`Box map prop to valid property and correct space from theme 4`] = `
795
801
  }
796
802
  >
797
803
  <View
804
+ gap="xlarge"
798
805
  margin="xlarge"
799
806
  marginBottom="xlarge"
800
807
  marginEnd="xlarge"
@@ -816,6 +823,7 @@ exports[`Box map prop to valid property and correct space from theme 4`] = `
816
823
  style={
817
824
  [
818
825
  {
826
+ "gap": 32,
819
827
  "margin": 32,
820
828
  "marginBottom": 32,
821
829
  "marginEnd": 32,
@@ -81,6 +81,7 @@ describe('Box', () => {
81
81
  paddingStart={space}
82
82
  paddingTop={space}
83
83
  paddingVertical={space}
84
+ gap={space}
84
85
  />
85
86
  );
86
87
 
@@ -110,6 +110,10 @@ const space = {
110
110
  property: 'paddingVertical',
111
111
  scale: 'space',
112
112
  },
113
+ gap: {
114
+ property: 'gap',
115
+ scale: 'space',
116
+ },
113
117
  } as const;
114
118
 
115
119
  const radii = {
@@ -4840,3 +4840,5 @@ var drawChart = (function (exports) {
4840
4840
  </body>
4841
4841
  </html>
4842
4842
 
4843
+
4844
+