@hero-design/rn 8.103.5 → 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 (33) hide show
  1. package/.turbo/turbo-build.log +4 -4
  2. package/CHANGELOG.md +10 -0
  3. package/es/index.js +51 -17
  4. package/lib/index.js +51 -17
  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/RichTextEditor/RichTextEditor.tsx +6 -2
  11. package/src/components/RichTextEditor/StyledRichTextEditor.ts +1 -4
  12. package/src/components/RichTextEditor/__tests__/RichTextEditor.spec.tsx +4 -2
  13. package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +8 -5
  14. package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +7 -0
  15. package/src/components/Select/MultiSelect/__tests__/index.spec.tsx +53 -0
  16. package/src/components/Select/MultiSelect/index.tsx +18 -8
  17. package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +6 -0
  18. package/src/components/Select/SingleSelect/__tests__/index.spec.tsx +50 -0
  19. package/src/components/Select/SingleSelect/index.tsx +19 -8
  20. package/src/components/Select/StyledSelect.tsx +25 -2
  21. package/src/components/Select/index.tsx +8 -2
  22. package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +14 -0
  23. package/src/components/TextInput/index.tsx +6 -1
  24. package/src/components/TimePicker/__tests__/__snapshots__/TimePickerAndroid.spec.tsx.snap +2 -0
  25. package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +2 -0
  26. package/stats/8.103.5/rn-stats.html +0 -2
  27. package/stats/8.103.6/rn-stats.html +4844 -0
  28. package/types/components/RichTextEditor/StyledRichTextEditor.d.ts +0 -2
  29. package/types/components/Select/MultiSelect/index.d.ts +2 -1
  30. package/types/components/Select/SingleSelect/index.d.ts +2 -1
  31. package/types/components/Select/StyledSelect.d.ts +8 -1
  32. package/types/components/Select/index.d.ts +2 -2
  33. package/types/components/Select/index.internal.d.ts +1 -1
@@ -1,4 +1,4 @@
1
- (node:3289) 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 15.3s
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 20.9s
23
+ created ., . in 18.8s
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
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
+
3
13
  ## 8.103.5
4
14
 
5
15
  ### 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
+ 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;
19990
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
  }));
@@ -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
+ 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;
20019
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
  }));
@@ -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.5",
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]}
@@ -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",
@@ -44,6 +44,7 @@ exports[`rendering allows custom renderer 1`] = `
44
44
  "opacity": 1,
45
45
  }
46
46
  }
47
+ testID="multi-select-touchable-opacity"
47
48
  >
48
49
  <View
49
50
  pointerEvents="none"
@@ -1573,6 +1574,7 @@ exports[`rendering renders correct floating bottom sheet variant 1`] = `
1573
1574
  "opacity": 1,
1574
1575
  }
1575
1576
  }
1577
+ testID="multi-select-touchable-opacity"
1576
1578
  >
1577
1579
  <View
1578
1580
  pointerEvents="none"
@@ -3288,6 +3290,7 @@ exports[`rendering renders correctly when bottom sheet is NOT visible 1`] = `
3288
3290
  "opacity": 1,
3289
3291
  }
3290
3292
  }
3293
+ testID="multi-select-touchable-opacity"
3291
3294
  >
3292
3295
  <View
3293
3296
  pointerEvents="none"
@@ -3579,6 +3582,7 @@ exports[`rendering renders correctly when bottom sheet is visible 1`] = `
3579
3582
  "opacity": 1,
3580
3583
  }
3581
3584
  }
3585
+ testID="multi-select-touchable-opacity"
3582
3586
  >
3583
3587
  <View
3584
3588
  pointerEvents="none"
@@ -5308,6 +5312,7 @@ exports[`rendering renders correctly when input is loading 1`] = `
5308
5312
  "opacity": 1,
5309
5313
  }
5310
5314
  }
5315
+ testID="multi-select-touchable-opacity"
5311
5316
  >
5312
5317
  <View
5313
5318
  pointerEvents="none"
@@ -5612,6 +5617,7 @@ exports[`rendering renders correctly when receives sections 1`] = `
5612
5617
  "opacity": 1,
5613
5618
  }
5614
5619
  }
5620
+ testID="multi-select-touchable-opacity"
5615
5621
  >
5616
5622
  <View
5617
5623
  pointerEvents="none"
@@ -6929,6 +6935,7 @@ exports[`rendering renders correctly when receives sections 2`] = `
6929
6935
  "opacity": 1,
6930
6936
  }
6931
6937
  }
6938
+ testID="multi-select-touchable-opacity"
6932
6939
  >
6933
6940
  <View
6934
6941
  pointerEvents="none"
@@ -362,6 +362,59 @@ describe('rendering', () => {
362
362
  expect(getByText('Monday')).toBeVisible();
363
363
  expect(getByText('Tuesday')).toBeVisible();
364
364
  });
365
+
366
+ it('renders correctly when groupStyleEnabled is true and no error', () => {
367
+ const { getByTestId } = renderWithTheme(
368
+ <MultiSelect
369
+ label="Allow notifications"
370
+ footerLabel="Confirm"
371
+ options={options}
372
+ value={['mon', 'tue']}
373
+ onConfirm={jest.fn()}
374
+ groupStyleEnabled
375
+ />
376
+ );
377
+
378
+ const touchableOpacity = getByTestId('multi-select-touchable-opacity');
379
+ expect(touchableOpacity).toBeTruthy();
380
+ expect(touchableOpacity.props.style).toHaveProperty('zIndex', 0);
381
+ });
382
+
383
+ it('renders correctly when groupStyleEnabled is true and has error', () => {
384
+ const { getByTestId } = renderWithTheme(
385
+ <MultiSelect
386
+ label="Allow notifications"
387
+ footerLabel="Confirm"
388
+ options={options}
389
+ value={['mon', 'tue']}
390
+ onConfirm={jest.fn()}
391
+ groupStyleEnabled
392
+ error="This field is required"
393
+ />
394
+ );
395
+
396
+ const touchableOpacity = getByTestId('multi-select-touchable-opacity');
397
+ expect(touchableOpacity).toBeTruthy();
398
+ expect(touchableOpacity.props.style).toHaveProperty('zIndex', 1);
399
+ });
400
+
401
+ it('renders correctly when groupStyleEnabled is false', () => {
402
+ const { getByTestId } = renderWithTheme(
403
+ <MultiSelect
404
+ label="Allow notifications"
405
+ footerLabel="Confirm"
406
+ options={options}
407
+ value={['mon', 'tue']}
408
+ onConfirm={jest.fn()}
409
+ groupStyleEnabled={false}
410
+ error="This field is required"
411
+ />
412
+ );
413
+
414
+ const touchableOpacity = getByTestId('multi-select-touchable-opacity');
415
+ expect(touchableOpacity).toBeTruthy();
416
+ expect(touchableOpacity.props.style).not.toHaveProperty('zIndex');
417
+ });
365
418
  });
366
419
 
367
420
  describe('behavior', () => {