@hero-design/rn 8.103.4 → 8.103.6

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 (41) hide show
  1. package/.turbo/turbo-build.log +4 -4
  2. package/CHANGELOG.md +19 -0
  3. package/es/index.js +53 -19
  4. package/lib/index.js +53 -19
  5. package/package.json +1 -1
  6. package/src/components/DatePicker/__tests__/__snapshots__/DatePicker.spec.tsx.snap +3 -0
  7. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerAndroid.spec.tsx.snap +1 -0
  8. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerCalendar.spec.tsx.snap +1 -0
  9. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +2 -0
  10. package/src/components/PinInput/__tests__/__snapshots__/index.spec.tsx.snap +5 -5
  11. package/src/components/PinInput/index.tsx +1 -1
  12. package/src/components/RichTextEditor/RichTextEditor.tsx +6 -2
  13. package/src/components/RichTextEditor/StyledRichTextEditor.ts +1 -4
  14. package/src/components/RichTextEditor/__tests__/RichTextEditor.spec.tsx +4 -2
  15. package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +8 -5
  16. package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +7 -0
  17. package/src/components/Select/MultiSelect/__tests__/index.spec.tsx +53 -0
  18. package/src/components/Select/MultiSelect/index.tsx +18 -8
  19. package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +6 -0
  20. package/src/components/Select/SingleSelect/__tests__/index.spec.tsx +50 -0
  21. package/src/components/Select/SingleSelect/index.tsx +19 -8
  22. package/src/components/Select/StyledSelect.tsx +25 -2
  23. package/src/components/Select/index.tsx +8 -2
  24. package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +14 -0
  25. package/src/components/TextInput/index.tsx +35 -5
  26. package/src/components/TimePicker/__tests__/__snapshots__/TimePickerAndroid.spec.tsx.snap +2 -0
  27. package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +2 -0
  28. package/src/index.internal.ts +6 -1
  29. package/src/types.internal.ts +2 -3
  30. package/stats/8.103.4/rn-stats.html +0 -2
  31. package/stats/8.103.5/rn-stats.html +4842 -0
  32. package/stats/8.103.6/rn-stats.html +4844 -0
  33. package/types/components/RichTextEditor/StyledRichTextEditor.d.ts +0 -2
  34. package/types/components/Select/MultiSelect/index.d.ts +2 -1
  35. package/types/components/Select/SingleSelect/index.d.ts +2 -1
  36. package/types/components/Select/StyledSelect.d.ts +8 -1
  37. package/types/components/Select/index.d.ts +2 -2
  38. package/types/components/Select/index.internal.d.ts +1 -1
  39. package/types/components/TextInput/index.d.ts +14 -3
  40. package/types/index.internal.d.ts +1 -1
  41. package/types/types.internal.d.ts +2 -2
@@ -1,4 +1,4 @@
1
- (node:3329) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
1
+ (node:3296) 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...
@@ -11,13 +11,13 @@ node_modules/d3-selection/src/selection/index.js -> node_modules/d3-selection/sr
11
11
  (!) [plugin typescript] src/components/RichTextEditor/__tests__/RichTextEditor.spec.tsx (61:35): @rollup/plugin-typescript TS2307: Cannot find module '../../../../types' or its corresponding type declarations.
12
12
  /home/runner/work/hero-design/hero-design/packages/rn/src/components/RichTextEditor/__tests__/RichTextEditor.spec.tsx:61:35
13
13
  
14
- 61 import { RichTextEditorRef } from "../../../../types";
14
+ 61 import { RichTextEditorRef } from '../../../../types';
15
15
     ~~~~~~~~~~~~~~~~~~~
16
16
  
17
17
  (!) [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.
18
- created lib/index.js, es/index.js in 1m 11.1s
18
+ created lib/index.js, es/index.js in 1m 9.6s
19
19
  
20
20
  /home/runner/work/hero-design/hero-design/packages/rn/src/locales/en_AU.ts, /home/runner/work/hero-design/hero-design/packages/rn/src/locales/en_CA.ts, /home/runner/work/hero-design/hero-design/packages/rn/src/locales/index.ts, /home/runner/work/hero-design/hero-design/packages/rn/src/locales/types.ts → ., ....
21
21
  (!) Generated empty chunks
22
22
  "locales/types" and "locales/types"
23
- created ., . in 22.1s
23
+ created ., . in 18.8s
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @hero-design/rn
2
2
 
3
+ ## 8.103.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [#4075](https://github.com/Thinkei/hero-design/pull/4075) [`3bd134bd08699566d3c25ad157b7ca68f5debc47`](https://github.com/Thinkei/hero-design/commit/3bd134bd08699566d3c25ad157b7ca68f5debc47) Thanks [@ttkien](https://github.com/ttkien)! - [TextInput] fix layout issue on Android: The height of TextInput is incorrectly increased when the text is long
8
+
9
+ - [#4071](https://github.com/Thinkei/hero-design/pull/4071) [`a045cd45b79141f02b6570907033fa3f037b5862`](https://github.com/Thinkei/hero-design/commit/a045cd45b79141f02b6570907033fa3f037b5862) Thanks [@vinhphan-eh](https://github.com/vinhphan-eh)! - [Select] Add internal zIndex for group style
10
+
11
+ - [#4077](https://github.com/Thinkei/hero-design/pull/4077) [`fa025fbffdf997d83f77919b78eae2520ddb6e2e`](https://github.com/Thinkei/hero-design/commit/fa025fbffdf997d83f77919b78eae2520ddb6e2e) Thanks [@ttkien](https://github.com/ttkien)! - [RichTextEditor] Fix issue that WebView automatiically reset when height is changed on Android
12
+
13
+ ## 8.103.5
14
+
15
+ ### Patch Changes
16
+
17
+ - [#4068](https://github.com/Thinkei/hero-design/pull/4068) [`3fd150ed0925245f0c9df0956681f19becac09c7`](https://github.com/Thinkei/hero-design/commit/3fd150ed0925245f0c9df0956681f19becac09c7) Thanks [@ttkien](https://github.com/ttkien)! - [RichTextEditor] apply new TextInput
18
+ [TextInput] update typings
19
+
20
+ - [#4074](https://github.com/Thinkei/hero-design/pull/4074) [`3b1be909daf4d17abe49f37672ecde1ad048ae05`](https://github.com/Thinkei/hero-design/commit/3b1be909daf4d17abe49f37672ecde1ad048ae05) Thanks [@cuongnguyeneh](https://github.com/cuongnguyeneh)! - [PinInput] fix: android lagging issue by replacing keyboardType by inputMode prop
21
+
3
22
  ## 8.103.4
4
23
 
5
24
  ### Patch Changes
package/es/index.js CHANGED
@@ -19987,9 +19987,13 @@ var renderInput$1 = function renderInput(_ref3) {
19987
19987
  renderInputValue = _ref3.renderInputValue,
19988
19988
  ref = _ref3.ref,
19989
19989
  theme = _ref3.theme;
19990
- return renderInputValue ? renderInputValue(nativeInputProps) : /*#__PURE__*/React__default.createElement(StyledTextInput, _extends$1({}, nativeInputProps, {
19990
+ var multiline = variant === 'textarea' || nativeInputProps.multiline;
19991
+ // `numberOfLines` must be `1` for single-line inputs to render properly on Android.
19992
+ var numberOfLines = multiline ? nativeInputProps.numberOfLines : 1;
19993
+ return renderInputValue ? renderInputValue(nativeInputProps, ref) : /*#__PURE__*/React__default.createElement(StyledTextInput, _extends$1({}, nativeInputProps, {
19991
19994
  themeVariant: variant,
19992
- multiline: variant === 'textarea' || nativeInputProps.multiline,
19995
+ multiline: multiline,
19996
+ numberOfLines: numberOfLines,
19993
19997
  ref: ref,
19994
19998
  placeholderTextColor: theme.__hd__.textInput.colors.placeholder
19995
19999
  }));
@@ -23974,7 +23978,7 @@ var PinInput = /*#__PURE__*/forwardRef(function (_ref2, ref) {
23974
23978
  onFocus: focus,
23975
23979
  onBlur: blur,
23976
23980
  pointerEvents: "none",
23977
- keyboardType: "numeric",
23981
+ inputMode: "numeric",
23978
23982
  testID: "pin-hidden-input",
23979
23983
  textContentType: textContentType,
23980
23984
  autoComplete: autoComplete,
@@ -24919,6 +24923,22 @@ var StyledSectionList = index$b(SectionList)(function (_ref4) {
24919
24923
  paddingHorizontal: theme.__hd__.select.space.optionListHorizontalPadding
24920
24924
  };
24921
24925
  });
24926
+ var getZIndexByState = function getZIndexByState(_ref5) {
24927
+ var themeHasError = _ref5.themeHasError;
24928
+ if (themeHasError) {
24929
+ return 1;
24930
+ }
24931
+ return 0;
24932
+ };
24933
+ var StyledTouchableOpacity = index$b(TouchableOpacity)(function (_ref6) {
24934
+ var themeGroupStyleEnabled = _ref6.themeGroupStyleEnabled,
24935
+ themeHasError = _ref6.themeHasError;
24936
+ return _objectSpread2({}, themeGroupStyleEnabled && {
24937
+ zIndex: getZIndexByState({
24938
+ themeHasError: themeHasError
24939
+ })
24940
+ });
24941
+ });
24922
24942
 
24923
24943
  var _excluded$g = ["keyExtractor", "loading", "onEndReached", "onQueryChange", "sections", "renderItem", "sectionListRef"];
24924
24944
  var BaseOptionList = function BaseOptionList(_ref) {
@@ -25057,7 +25077,7 @@ var OptionList$1 = function OptionList(_ref) {
25057
25077
  }, rest));
25058
25078
  };
25059
25079
 
25060
- var _excluded$e = ["footerLabel", "label", "loading", "inputProps", "onConfirm", "onDismiss", "onEndReached", "onQueryChange", "options", "renderOption", "renderSelectedValue", "query", "error", "editable", "disabled", "required", "style", "testID", "value", "supportedOrientations", "bottomSheetConfig"];
25080
+ var _excluded$e = ["footerLabel", "label", "loading", "inputProps", "onConfirm", "onDismiss", "onEndReached", "onQueryChange", "options", "renderOption", "renderSelectedValue", "query", "error", "editable", "disabled", "required", "style", "testID", "value", "supportedOrientations", "bottomSheetConfig", "groupStyleEnabled"];
25061
25081
  function MultiSelect(_ref) {
25062
25082
  var footerLabel = _ref.footerLabel,
25063
25083
  label = _ref.label,
@@ -25085,6 +25105,8 @@ function MultiSelect(_ref) {
25085
25105
  supportedOrientations = _ref$supportedOrienta === void 0 ? ['portrait'] : _ref$supportedOrienta,
25086
25106
  _ref$bottomSheetConfi = _ref.bottomSheetConfig,
25087
25107
  bottomSheetConfig = _ref$bottomSheetConfi === void 0 ? {} : _ref$bottomSheetConfi,
25108
+ _ref$groupStyleEnable = _ref.groupStyleEnabled,
25109
+ groupStyleEnabled = _ref$groupStyleEnable === void 0 ? false : _ref$groupStyleEnable,
25088
25110
  rest = _objectWithoutProperties(_ref, _excluded$e);
25089
25111
  var _useKeyboard = useKeyboard(),
25090
25112
  isKeyboardVisible = _useKeyboard.isKeyboardVisible,
@@ -25109,15 +25131,19 @@ function MultiSelect(_ref) {
25109
25131
  var bottomSheetVariant = bottomSheetConfig.variant,
25110
25132
  bottomSheetHeader = bottomSheetConfig.header;
25111
25133
  var TextInputComponent = rest.TextInputComponent || TextInput;
25134
+ var onPress = useCallback(function () {
25135
+ setOpen(true);
25136
+ }, []);
25112
25137
  useEffect(function () {
25113
25138
  setSelectingValue(value);
25114
25139
  }, [open, value]);
25115
25140
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(View, {
25116
25141
  pointerEvents: !editable || disabled || inputProps !== null && inputProps !== void 0 && inputProps.loading ? 'none' : 'auto'
25117
- }, /*#__PURE__*/React__default.createElement(TouchableOpacity, {
25118
- onPress: function onPress() {
25119
- return setOpen(true);
25120
- }
25142
+ }, /*#__PURE__*/React__default.createElement(StyledTouchableOpacity, {
25143
+ onPress: onPress,
25144
+ themeGroupStyleEnabled: groupStyleEnabled,
25145
+ themeHasError: !!error,
25146
+ testID: "multi-select-touchable-opacity"
25121
25147
  }, /*#__PURE__*/React__default.createElement(View, {
25122
25148
  pointerEvents: "none"
25123
25149
  }, /*#__PURE__*/React__default.createElement(TextInputComponent, _extends$1({}, inputProps, {
@@ -25268,7 +25294,7 @@ var OptionList = function OptionList(_ref) {
25268
25294
  }, rest));
25269
25295
  };
25270
25296
 
25271
- var _excluded$c = ["label", "loading", "inputProps", "onConfirm", "onDismiss", "onEndReached", "onQueryChange", "options", "renderOption", "renderSelectedValue", "query", "error", "editable", "disabled", "required", "style", "testID", "value", "supportedOrientations", "bottomSheetConfig"];
25297
+ var _excluded$c = ["label", "loading", "inputProps", "onConfirm", "onDismiss", "onEndReached", "onQueryChange", "options", "renderOption", "renderSelectedValue", "query", "error", "editable", "disabled", "required", "style", "testID", "value", "supportedOrientations", "bottomSheetConfig", "groupStyleEnabled"];
25272
25298
  var SingleSelect = function SingleSelect(_ref) {
25273
25299
  var _flatOptions$find;
25274
25300
  var label = _ref.label,
@@ -25296,6 +25322,8 @@ var SingleSelect = function SingleSelect(_ref) {
25296
25322
  supportedOrientations = _ref$supportedOrienta === void 0 ? ['portrait'] : _ref$supportedOrienta,
25297
25323
  _ref$bottomSheetConfi = _ref.bottomSheetConfig,
25298
25324
  bottomSheetConfig = _ref$bottomSheetConfi === void 0 ? {} : _ref$bottomSheetConfi,
25325
+ _ref$groupStyleEnable = _ref.groupStyleEnabled,
25326
+ groupStyleEnabled = _ref$groupStyleEnable === void 0 ? false : _ref$groupStyleEnable,
25299
25327
  rest = _objectWithoutProperties(_ref, _excluded$c);
25300
25328
  var _useKeyboard = useKeyboard(),
25301
25329
  isKeyboardVisible = _useKeyboard.isKeyboardVisible,
@@ -25314,12 +25342,16 @@ var SingleSelect = function SingleSelect(_ref) {
25314
25342
  var bottomSheetVariant = bottomSheetConfig.variant,
25315
25343
  bottomSheetHeader = bottomSheetConfig.header;
25316
25344
  var TextInputComponent = rest.TextInputComponent || TextInput;
25345
+ var onPress = useCallback(function () {
25346
+ setOpen(true);
25347
+ }, []);
25317
25348
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(View, {
25318
25349
  pointerEvents: !editable || disabled || inputProps !== null && inputProps !== void 0 && inputProps.loading ? 'none' : 'auto'
25319
- }, /*#__PURE__*/React__default.createElement(TouchableOpacity, {
25320
- onPress: function onPress() {
25321
- return setOpen(true);
25322
- }
25350
+ }, /*#__PURE__*/React__default.createElement(StyledTouchableOpacity, {
25351
+ onPress: onPress,
25352
+ themeGroupStyleEnabled: groupStyleEnabled,
25353
+ themeHasError: !!error,
25354
+ testID: "single-select-touchable-opacity"
25323
25355
  }, /*#__PURE__*/React__default.createElement(View, {
25324
25356
  pointerEvents: "none"
25325
25357
  }, /*#__PURE__*/React__default.createElement(TextInputComponent, _extends$1({}, inputProps, {
@@ -45942,10 +45974,8 @@ index$b(View)(function (_ref) {
45942
45974
  };
45943
45975
  });
45944
45976
  var StyledWebView = index$b(WebView)(function (_ref2) {
45945
- var height = _ref2.height,
45946
- theme = _ref2.theme;
45977
+ var theme = _ref2.theme;
45947
45978
  return {
45948
- height: height,
45949
45979
  minHeight: theme.__hd__.richTextEditor.sizes.editorMinHeight,
45950
45980
  backgroundColor: 'transparent',
45951
45981
  textAlignVertical: 'center',
@@ -46198,7 +46228,12 @@ var RichTextEditor = function RichTextEditor(_ref) {
46198
46228
  }, /*#__PURE__*/React__default.createElement(StyledBorderBackDrop, {
46199
46229
  themeState: state,
46200
46230
  themeFocused: isFocused
46201
- }), /*#__PURE__*/React__default.createElement(StyledTextInputAndLabelContainer, null, /*#__PURE__*/React__default.createElement(TouchableWithoutFeedback, {
46231
+ }), /*#__PURE__*/React__default.createElement(StyledTextInputAndLabelContainer, {
46232
+ style: {
46233
+ height: webviewHeight
46234
+ },
46235
+ testID: "webViewWrapper"
46236
+ }, /*#__PURE__*/React__default.createElement(TouchableWithoutFeedback, {
46202
46237
  onPress: function onPress(e) {
46203
46238
  return e.stopPropagation();
46204
46239
  }
@@ -46213,8 +46248,7 @@ var RichTextEditor = function RichTextEditor(_ref) {
46213
46248
  onMessage: onMessage,
46214
46249
  scrollEnabled: false,
46215
46250
  hideKeyboardAccessoryView: true,
46216
- keyboardDisplayRequiresUserAction: false,
46217
- height: webviewHeight
46251
+ keyboardDisplayRequiresUserAction: false
46218
46252
  })))), /*#__PURE__*/React__default.createElement(StyledErrorAndHelpTextContainer, null, /*#__PURE__*/React__default.createElement(StyledErrorAndMaxLengthContainer, null, error ? /*#__PURE__*/React__default.createElement(StyledErrorContainer$2, null, /*#__PURE__*/React__default.createElement(Icon, {
46219
46253
  testID: "input-error-icon",
46220
46254
  icon: "circle-info",
package/lib/index.js CHANGED
@@ -20016,9 +20016,13 @@ var renderInput$1 = function renderInput(_ref3) {
20016
20016
  renderInputValue = _ref3.renderInputValue,
20017
20017
  ref = _ref3.ref,
20018
20018
  theme = _ref3.theme;
20019
- return renderInputValue ? renderInputValue(nativeInputProps) : /*#__PURE__*/React__namespace.default.createElement(StyledTextInput, _extends$1({}, nativeInputProps, {
20019
+ var multiline = variant === 'textarea' || nativeInputProps.multiline;
20020
+ // `numberOfLines` must be `1` for single-line inputs to render properly on Android.
20021
+ var numberOfLines = multiline ? nativeInputProps.numberOfLines : 1;
20022
+ return renderInputValue ? renderInputValue(nativeInputProps, ref) : /*#__PURE__*/React__namespace.default.createElement(StyledTextInput, _extends$1({}, nativeInputProps, {
20020
20023
  themeVariant: variant,
20021
- multiline: variant === 'textarea' || nativeInputProps.multiline,
20024
+ multiline: multiline,
20025
+ numberOfLines: numberOfLines,
20022
20026
  ref: ref,
20023
20027
  placeholderTextColor: theme.__hd__.textInput.colors.placeholder
20024
20028
  }));
@@ -24003,7 +24007,7 @@ var PinInput = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
24003
24007
  onFocus: focus,
24004
24008
  onBlur: blur,
24005
24009
  pointerEvents: "none",
24006
- keyboardType: "numeric",
24010
+ inputMode: "numeric",
24007
24011
  testID: "pin-hidden-input",
24008
24012
  textContentType: textContentType,
24009
24013
  autoComplete: autoComplete,
@@ -24948,6 +24952,22 @@ var StyledSectionList = index$b(reactNative.SectionList)(function (_ref4) {
24948
24952
  paddingHorizontal: theme.__hd__.select.space.optionListHorizontalPadding
24949
24953
  };
24950
24954
  });
24955
+ var getZIndexByState = function getZIndexByState(_ref5) {
24956
+ var themeHasError = _ref5.themeHasError;
24957
+ if (themeHasError) {
24958
+ return 1;
24959
+ }
24960
+ return 0;
24961
+ };
24962
+ var StyledTouchableOpacity = index$b(reactNative.TouchableOpacity)(function (_ref6) {
24963
+ var themeGroupStyleEnabled = _ref6.themeGroupStyleEnabled,
24964
+ themeHasError = _ref6.themeHasError;
24965
+ return _objectSpread2({}, themeGroupStyleEnabled && {
24966
+ zIndex: getZIndexByState({
24967
+ themeHasError: themeHasError
24968
+ })
24969
+ });
24970
+ });
24951
24971
 
24952
24972
  var _excluded$g = ["keyExtractor", "loading", "onEndReached", "onQueryChange", "sections", "renderItem", "sectionListRef"];
24953
24973
  var BaseOptionList = function BaseOptionList(_ref) {
@@ -25086,7 +25106,7 @@ var OptionList$1 = function OptionList(_ref) {
25086
25106
  }, rest));
25087
25107
  };
25088
25108
 
25089
- var _excluded$e = ["footerLabel", "label", "loading", "inputProps", "onConfirm", "onDismiss", "onEndReached", "onQueryChange", "options", "renderOption", "renderSelectedValue", "query", "error", "editable", "disabled", "required", "style", "testID", "value", "supportedOrientations", "bottomSheetConfig"];
25109
+ var _excluded$e = ["footerLabel", "label", "loading", "inputProps", "onConfirm", "onDismiss", "onEndReached", "onQueryChange", "options", "renderOption", "renderSelectedValue", "query", "error", "editable", "disabled", "required", "style", "testID", "value", "supportedOrientations", "bottomSheetConfig", "groupStyleEnabled"];
25090
25110
  function MultiSelect(_ref) {
25091
25111
  var footerLabel = _ref.footerLabel,
25092
25112
  label = _ref.label,
@@ -25114,6 +25134,8 @@ function MultiSelect(_ref) {
25114
25134
  supportedOrientations = _ref$supportedOrienta === void 0 ? ['portrait'] : _ref$supportedOrienta,
25115
25135
  _ref$bottomSheetConfi = _ref.bottomSheetConfig,
25116
25136
  bottomSheetConfig = _ref$bottomSheetConfi === void 0 ? {} : _ref$bottomSheetConfi,
25137
+ _ref$groupStyleEnable = _ref.groupStyleEnabled,
25138
+ groupStyleEnabled = _ref$groupStyleEnable === void 0 ? false : _ref$groupStyleEnable,
25117
25139
  rest = _objectWithoutProperties(_ref, _excluded$e);
25118
25140
  var _useKeyboard = useKeyboard(),
25119
25141
  isKeyboardVisible = _useKeyboard.isKeyboardVisible,
@@ -25138,15 +25160,19 @@ function MultiSelect(_ref) {
25138
25160
  var bottomSheetVariant = bottomSheetConfig.variant,
25139
25161
  bottomSheetHeader = bottomSheetConfig.header;
25140
25162
  var TextInputComponent = rest.TextInputComponent || TextInput;
25163
+ var onPress = React.useCallback(function () {
25164
+ setOpen(true);
25165
+ }, []);
25141
25166
  React.useEffect(function () {
25142
25167
  setSelectingValue(value);
25143
25168
  }, [open, value]);
25144
25169
  return /*#__PURE__*/React__namespace.default.createElement(React__namespace.default.Fragment, null, /*#__PURE__*/React__namespace.default.createElement(reactNative.View, {
25145
25170
  pointerEvents: !editable || disabled || inputProps !== null && inputProps !== void 0 && inputProps.loading ? 'none' : 'auto'
25146
- }, /*#__PURE__*/React__namespace.default.createElement(reactNative.TouchableOpacity, {
25147
- onPress: function onPress() {
25148
- return setOpen(true);
25149
- }
25171
+ }, /*#__PURE__*/React__namespace.default.createElement(StyledTouchableOpacity, {
25172
+ onPress: onPress,
25173
+ themeGroupStyleEnabled: groupStyleEnabled,
25174
+ themeHasError: !!error,
25175
+ testID: "multi-select-touchable-opacity"
25150
25176
  }, /*#__PURE__*/React__namespace.default.createElement(reactNative.View, {
25151
25177
  pointerEvents: "none"
25152
25178
  }, /*#__PURE__*/React__namespace.default.createElement(TextInputComponent, _extends$1({}, inputProps, {
@@ -25297,7 +25323,7 @@ var OptionList = function OptionList(_ref) {
25297
25323
  }, rest));
25298
25324
  };
25299
25325
 
25300
- var _excluded$c = ["label", "loading", "inputProps", "onConfirm", "onDismiss", "onEndReached", "onQueryChange", "options", "renderOption", "renderSelectedValue", "query", "error", "editable", "disabled", "required", "style", "testID", "value", "supportedOrientations", "bottomSheetConfig"];
25326
+ var _excluded$c = ["label", "loading", "inputProps", "onConfirm", "onDismiss", "onEndReached", "onQueryChange", "options", "renderOption", "renderSelectedValue", "query", "error", "editable", "disabled", "required", "style", "testID", "value", "supportedOrientations", "bottomSheetConfig", "groupStyleEnabled"];
25301
25327
  var SingleSelect = function SingleSelect(_ref) {
25302
25328
  var _flatOptions$find;
25303
25329
  var label = _ref.label,
@@ -25325,6 +25351,8 @@ var SingleSelect = function SingleSelect(_ref) {
25325
25351
  supportedOrientations = _ref$supportedOrienta === void 0 ? ['portrait'] : _ref$supportedOrienta,
25326
25352
  _ref$bottomSheetConfi = _ref.bottomSheetConfig,
25327
25353
  bottomSheetConfig = _ref$bottomSheetConfi === void 0 ? {} : _ref$bottomSheetConfi,
25354
+ _ref$groupStyleEnable = _ref.groupStyleEnabled,
25355
+ groupStyleEnabled = _ref$groupStyleEnable === void 0 ? false : _ref$groupStyleEnable,
25328
25356
  rest = _objectWithoutProperties(_ref, _excluded$c);
25329
25357
  var _useKeyboard = useKeyboard(),
25330
25358
  isKeyboardVisible = _useKeyboard.isKeyboardVisible,
@@ -25343,12 +25371,16 @@ var SingleSelect = function SingleSelect(_ref) {
25343
25371
  var bottomSheetVariant = bottomSheetConfig.variant,
25344
25372
  bottomSheetHeader = bottomSheetConfig.header;
25345
25373
  var TextInputComponent = rest.TextInputComponent || TextInput;
25374
+ var onPress = React.useCallback(function () {
25375
+ setOpen(true);
25376
+ }, []);
25346
25377
  return /*#__PURE__*/React__namespace.default.createElement(React__namespace.default.Fragment, null, /*#__PURE__*/React__namespace.default.createElement(reactNative.View, {
25347
25378
  pointerEvents: !editable || disabled || inputProps !== null && inputProps !== void 0 && inputProps.loading ? 'none' : 'auto'
25348
- }, /*#__PURE__*/React__namespace.default.createElement(reactNative.TouchableOpacity, {
25349
- onPress: function onPress() {
25350
- return setOpen(true);
25351
- }
25379
+ }, /*#__PURE__*/React__namespace.default.createElement(StyledTouchableOpacity, {
25380
+ onPress: onPress,
25381
+ themeGroupStyleEnabled: groupStyleEnabled,
25382
+ themeHasError: !!error,
25383
+ testID: "single-select-touchable-opacity"
25352
25384
  }, /*#__PURE__*/React__namespace.default.createElement(reactNative.View, {
25353
25385
  pointerEvents: "none"
25354
25386
  }, /*#__PURE__*/React__namespace.default.createElement(TextInputComponent, _extends$1({}, inputProps, {
@@ -45971,10 +46003,8 @@ index$b(reactNative.View)(function (_ref) {
45971
46003
  };
45972
46004
  });
45973
46005
  var StyledWebView = index$b(reactNativeWebview.WebView)(function (_ref2) {
45974
- var height = _ref2.height,
45975
- theme = _ref2.theme;
46006
+ var theme = _ref2.theme;
45976
46007
  return {
45977
- height: height,
45978
46008
  minHeight: theme.__hd__.richTextEditor.sizes.editorMinHeight,
45979
46009
  backgroundColor: 'transparent',
45980
46010
  textAlignVertical: 'center',
@@ -46227,7 +46257,12 @@ var RichTextEditor = function RichTextEditor(_ref) {
46227
46257
  }, /*#__PURE__*/React__namespace.default.createElement(StyledBorderBackDrop, {
46228
46258
  themeState: state,
46229
46259
  themeFocused: isFocused
46230
- }), /*#__PURE__*/React__namespace.default.createElement(StyledTextInputAndLabelContainer, null, /*#__PURE__*/React__namespace.default.createElement(reactNative.TouchableWithoutFeedback, {
46260
+ }), /*#__PURE__*/React__namespace.default.createElement(StyledTextInputAndLabelContainer, {
46261
+ style: {
46262
+ height: webviewHeight
46263
+ },
46264
+ testID: "webViewWrapper"
46265
+ }, /*#__PURE__*/React__namespace.default.createElement(reactNative.TouchableWithoutFeedback, {
46231
46266
  onPress: function onPress(e) {
46232
46267
  return e.stopPropagation();
46233
46268
  }
@@ -46242,8 +46277,7 @@ var RichTextEditor = function RichTextEditor(_ref) {
46242
46277
  onMessage: onMessage,
46243
46278
  scrollEnabled: false,
46244
46279
  hideKeyboardAccessoryView: true,
46245
- keyboardDisplayRequiresUserAction: false,
46246
- height: webviewHeight
46280
+ keyboardDisplayRequiresUserAction: false
46247
46281
  })))), /*#__PURE__*/React__namespace.default.createElement(StyledErrorAndHelpTextContainer, null, /*#__PURE__*/React__namespace.default.createElement(StyledErrorAndMaxLengthContainer, null, error ? /*#__PURE__*/React__namespace.default.createElement(StyledErrorContainer$2, null, /*#__PURE__*/React__namespace.default.createElement(Icon, {
46248
46282
  testID: "input-error-icon",
46249
46283
  icon: "circle-info",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hero-design/rn",
3
- "version": "8.103.4",
3
+ "version": "8.103.6",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -190,6 +190,7 @@ exports[`DatePicker renders DatePickerAndroid when OS is android 1`] = `
190
190
  }
191
191
  allowFontScaling={false}
192
192
  editable={true}
193
+ numberOfLines={1}
193
194
  onBlur={[Function]}
194
195
  onChangeText={[Function]}
195
196
  onFocus={[Function]}
@@ -476,6 +477,7 @@ exports[`DatePicker renders DatePickerIOS when OS is iOS 1`] = `
476
477
  }
477
478
  allowFontScaling={false}
478
479
  editable={true}
480
+ numberOfLines={1}
479
481
  onBlur={[Function]}
480
482
  onChangeText={[Function]}
481
483
  onFocus={[Function]}
@@ -762,6 +764,7 @@ exports[`DatePicker renders variant Calendar 1`] = `
762
764
  }
763
765
  allowFontScaling={false}
764
766
  editable={true}
767
+ numberOfLines={1}
765
768
  onBlur={[Function]}
766
769
  onChangeText={[Function]}
767
770
  onFocus={[Function]}
@@ -190,6 +190,7 @@ exports[`DatePickerAndroid renders correctly 1`] = `
190
190
  }
191
191
  allowFontScaling={false}
192
192
  editable={true}
193
+ numberOfLines={1}
193
194
  onBlur={[Function]}
194
195
  onChangeText={[Function]}
195
196
  onFocus={[Function]}
@@ -190,6 +190,7 @@ exports[`DatePickerCalendar renders correctly 1`] = `
190
190
  }
191
191
  allowFontScaling={false}
192
192
  editable={true}
193
+ numberOfLines={1}
193
194
  onBlur={[Function]}
194
195
  onChangeText={[Function]}
195
196
  onFocus={[Function]}
@@ -190,6 +190,7 @@ exports[`DatePickerIOS renders correctly 1`] = `
190
190
  }
191
191
  allowFontScaling={false}
192
192
  editable={true}
193
+ numberOfLines={1}
193
194
  onBlur={[Function]}
194
195
  onChangeText={[Function]}
195
196
  onFocus={[Function]}
@@ -859,6 +860,7 @@ exports[`DatePickerIOS renders correctly with custom locale 1`] = `
859
860
  }
860
861
  allowFontScaling={false}
861
862
  editable={true}
863
+ numberOfLines={1}
862
864
  onBlur={[Function]}
863
865
  onChangeText={[Function]}
864
866
  onFocus={[Function]}
@@ -258,7 +258,7 @@ exports[`rendering renders correctly 1`] = `
258
258
  <TextInput
259
259
  autoFocus={false}
260
260
  editable={true}
261
- keyboardType="numeric"
261
+ inputMode="numeric"
262
262
  onBlur={[Function]}
263
263
  onChangeText={[Function]}
264
264
  onFocus={[Function]}
@@ -573,7 +573,7 @@ exports[`rendering renders correctly when disabled 1`] = `
573
573
  <TextInput
574
574
  autoFocus={false}
575
575
  editable={false}
576
- keyboardType="numeric"
576
+ inputMode="numeric"
577
577
  onBlur={[Function]}
578
578
  onChangeText={[Function]}
579
579
  onFocus={[Function]}
@@ -1018,7 +1018,7 @@ exports[`rendering renders correctly when length is 6 and secure is false 1`] =
1018
1018
  <TextInput
1019
1019
  autoFocus={false}
1020
1020
  editable={true}
1021
- keyboardType="numeric"
1021
+ inputMode="numeric"
1022
1022
  onBlur={[Function]}
1023
1023
  onChangeText={[Function]}
1024
1024
  onFocus={[Function]}
@@ -1386,7 +1386,7 @@ exports[`rendering renders correctly when there is error 1`] = `
1386
1386
  <TextInput
1387
1387
  autoFocus={false}
1388
1388
  editable={true}
1389
- keyboardType="numeric"
1389
+ inputMode="numeric"
1390
1390
  onBlur={[Function]}
1391
1391
  onChangeText={[Function]}
1392
1392
  onFocus={[Function]}
@@ -1702,7 +1702,7 @@ exports[`rendering renders correctly with textContentType and autoComplete 1`] =
1702
1702
  autoComplete="one-time-code"
1703
1703
  autoFocus={false}
1704
1704
  editable={true}
1705
- keyboardType="numeric"
1705
+ inputMode="numeric"
1706
1706
  onBlur={[Function]}
1707
1707
  onChangeText={[Function]}
1708
1708
  onFocus={[Function]}
@@ -231,7 +231,7 @@ const PinInput = forwardRef<PinInputHandler, PinInputProps>(
231
231
  onFocus={focus}
232
232
  onBlur={blur}
233
233
  pointerEvents="none"
234
- keyboardType="numeric"
234
+ inputMode="numeric"
235
235
  testID="pin-hidden-input"
236
236
  textContentType={textContentType}
237
237
  autoComplete={autoComplete}
@@ -408,7 +408,12 @@ const RichTextEditor: ComponentType<RichTextEditorProps> = ({
408
408
  <StyledTextInputContainer onLayout={onLayout}>
409
409
  <StyledBorderBackDrop themeState={state} themeFocused={isFocused} />
410
410
 
411
- <StyledTextInputAndLabelContainer>
411
+ <StyledTextInputAndLabelContainer
412
+ style={{
413
+ height: webviewHeight,
414
+ }}
415
+ testID="webViewWrapper"
416
+ >
412
417
  <TouchableWithoutFeedback onPress={(e) => e.stopPropagation()}>
413
418
  <StyledWebView
414
419
  ref={webview}
@@ -420,7 +425,6 @@ const RichTextEditor: ComponentType<RichTextEditorProps> = ({
420
425
  scrollEnabled={false}
421
426
  hideKeyboardAccessoryView
422
427
  keyboardDisplayRequiresUserAction={false}
423
- height={webviewHeight}
424
428
  />
425
429
  </TouchableWithoutFeedback>
426
430
  </StyledTextInputAndLabelContainer>
@@ -6,10 +6,7 @@ export const StyledWrapper = styled(View)(({ theme }) => ({
6
6
  marginBottom: theme.__hd__.richTextEditor.space.wrapperMarginBottom,
7
7
  }));
8
8
 
9
- export const StyledWebView = styled(WebView)<{
10
- height: number | undefined;
11
- }>(({ height, theme }) => ({
12
- height,
9
+ export const StyledWebView = styled(WebView)(({ theme }) => ({
13
10
  minHeight: theme.__hd__.richTextEditor.sizes.editorMinHeight,
14
11
  backgroundColor: 'transparent',
15
12
  textAlignVertical: 'center',
@@ -58,7 +58,7 @@ jest.mock('../utils/rnWebView', () => {
58
58
  /* eslint-disable */
59
59
  /// @ts-ignore
60
60
  import { postMessageMock } from '../utils/rnWebView';
61
- import { RichTextEditorRef } from "../../../../types";
61
+ import { RichTextEditorRef } from '../../../../types';
62
62
  /* eslint-enable */
63
63
 
64
64
  describe('RichTextEditor', () => {
@@ -201,7 +201,9 @@ describe('RichTextEditor', () => {
201
201
  );
202
202
 
203
203
  expect(wrapper.toJSON()).toMatchSnapshot();
204
- expect(wrapper.getByTestId('webview')).toHaveStyle({ height: 480 });
204
+ expect(wrapper.getByTestId('webViewWrapper')).toHaveStyle({
205
+ height: 480,
206
+ });
205
207
  });
206
208
  });
207
209
  });
@@ -132,9 +132,12 @@ exports[`RichTextEditor onMessage recevied event editor-layout should update hei
132
132
  "flexGrow": 2,
133
133
  "flexShrink": 1,
134
134
  },
135
- undefined,
135
+ {
136
+ "height": 480,
137
+ },
136
138
  ]
137
139
  }
140
+ testID="webViewWrapper"
138
141
  >
139
142
  <WebView
140
143
  accessibilityState={
@@ -148,7 +151,6 @@ exports[`RichTextEditor onMessage recevied event editor-layout should update hei
148
151
  }
149
152
  accessible={true}
150
153
  focusable={true}
151
- height={480}
152
154
  hideKeyboardAccessoryView={true}
153
155
  keyboardDisplayRequiresUserAction={false}
154
156
  onClick={[Function]}
@@ -204,7 +206,6 @@ exports[`RichTextEditor onMessage recevied event editor-layout should update hei
204
206
  {
205
207
  "backgroundColor": "transparent",
206
208
  "fontSize": 16,
207
- "height": 480,
208
209
  "marginHorizontal": 8,
209
210
  "minHeight": 24,
210
211
  "textAlignVertical": "center",
@@ -456,9 +457,12 @@ exports[`RichTextEditor should render correctly 1`] = `
456
457
  "flexGrow": 2,
457
458
  "flexShrink": 1,
458
459
  },
459
- undefined,
460
+ {
461
+ "height": undefined,
462
+ },
460
463
  ]
461
464
  }
465
+ testID="webViewWrapper"
462
466
  >
463
467
  <WebView
464
468
  accessibilityState={
@@ -527,7 +531,6 @@ exports[`RichTextEditor should render correctly 1`] = `
527
531
  {
528
532
  "backgroundColor": "transparent",
529
533
  "fontSize": 16,
530
- "height": undefined,
531
534
  "marginHorizontal": 8,
532
535
  "minHeight": 24,
533
536
  "textAlignVertical": "center",