@hero-design/rn 8.128.3 → 8.129.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.
package/lib/index.js CHANGED
@@ -8214,7 +8214,7 @@ var StyledText$4 = index$c(reactNative.Text)(function (_ref) {
8214
8214
  });
8215
8215
  });
8216
8216
 
8217
- var _excluded$O = ["children", "fontSize", "fontWeight", "intent", "typeface", "allowFontScaling"];
8217
+ var _excluded$P = ["children", "fontSize", "fontWeight", "intent", "typeface", "allowFontScaling"];
8218
8218
  /**
8219
8219
  * @deprecated Typography.Text is deprecated and will be removed in the next major release, please refer to https://design.employmenthero.com/mobile/Components/typography for the appropriate alternatives.
8220
8220
  */
@@ -8230,7 +8230,7 @@ var Text = function Text(_ref) {
8230
8230
  typeface = _ref$typeface === void 0 ? 'neutral' : _ref$typeface,
8231
8231
  _ref$allowFontScaling = _ref.allowFontScaling,
8232
8232
  allowFontScaling = _ref$allowFontScaling === void 0 ? false : _ref$allowFontScaling,
8233
- nativeProps = _objectWithoutProperties(_ref, _excluded$O);
8233
+ nativeProps = _objectWithoutProperties(_ref, _excluded$P);
8234
8234
  useDeprecation('Typography.Text is deprecated and will be removed in the next major release, please refer to https://design.employmenthero.com/mobile/Components/typography for the appropriate alternatives.');
8235
8235
  return /*#__PURE__*/React__namespace.default.createElement(StyledText$4, _extends$1({}, nativeProps, {
8236
8236
  themeFontSize: fontSize,
@@ -8283,10 +8283,10 @@ var pickAccessibilityProps = function pickAccessibilityProps(props) {
8283
8283
  }, {});
8284
8284
  };
8285
8285
 
8286
- var _excluded$N = ["children"];
8286
+ var _excluded$O = ["children"];
8287
8287
  var GradientText = function GradientText(_ref) {
8288
8288
  var children = _ref.children,
8289
- accessibilityProps = _objectWithoutProperties(_ref, _excluded$N);
8289
+ accessibilityProps = _objectWithoutProperties(_ref, _excluded$O);
8290
8290
  var theme = useTheme();
8291
8291
  var gradient = theme.colors.gradients.aiDiagonal;
8292
8292
  var _useState = React.useState(null),
@@ -8342,7 +8342,7 @@ var GradientText = function GradientText(_ref) {
8342
8342
  }, children));
8343
8343
  };
8344
8344
 
8345
- var _excluded$M = ["children", "fontWeight", "intent", "allowFontScaling", "fontStyle", "style", "testID"];
8345
+ var _excluded$N = ["children", "fontWeight", "intent", "allowFontScaling", "fontStyle", "style", "testID"];
8346
8346
  var Caption = function Caption(_ref) {
8347
8347
  var children = _ref.children,
8348
8348
  _ref$fontWeight = _ref.fontWeight,
@@ -8355,7 +8355,7 @@ var Caption = function Caption(_ref) {
8355
8355
  fontStyle = _ref$fontStyle === void 0 ? 'normal' : _ref$fontStyle,
8356
8356
  style = _ref.style,
8357
8357
  testID = _ref.testID,
8358
- nativeProps = _objectWithoutProperties(_ref, _excluded$M);
8358
+ nativeProps = _objectWithoutProperties(_ref, _excluded$N);
8359
8359
  var isAi = intent === 'ai';
8360
8360
  var styledText = /*#__PURE__*/React__namespace.default.createElement(StyledCaption, _extends$1({}, nativeProps, {
8361
8361
  themeFontWeight: fontWeight,
@@ -8387,7 +8387,7 @@ var StyledLabel$1 = index$c(reactNative.Text)(function (_ref) {
8387
8387
  };
8388
8388
  });
8389
8389
 
8390
- var _excluded$L = ["children", "intent", "allowFontScaling", "fontStyle", "fontWeight", "style", "testID"];
8390
+ var _excluded$M = ["children", "intent", "allowFontScaling", "fontStyle", "fontWeight", "style", "testID"];
8391
8391
  var Label = function Label(_ref) {
8392
8392
  var children = _ref.children,
8393
8393
  _ref$intent = _ref.intent,
@@ -8400,7 +8400,7 @@ var Label = function Label(_ref) {
8400
8400
  fontWeight = _ref$fontWeight === void 0 ? 'regular' : _ref$fontWeight,
8401
8401
  style = _ref.style,
8402
8402
  testID = _ref.testID,
8403
- nativeProps = _objectWithoutProperties(_ref, _excluded$L);
8403
+ nativeProps = _objectWithoutProperties(_ref, _excluded$M);
8404
8404
  var isAi = intent === 'ai';
8405
8405
  var styledText = /*#__PURE__*/React__namespace.default.createElement(StyledLabel$1, _extends$1({}, nativeProps, {
8406
8406
  themeIntent: isAi ? 'body' : intent,
@@ -8431,7 +8431,7 @@ var StyledTitle$1 = index$c(reactNative.Text)(function (_ref) {
8431
8431
  };
8432
8432
  });
8433
8433
 
8434
- var _excluded$K = ["children", "intent", "allowFontScaling", "level", "typeface", "fontStyle", "style", "testID"];
8434
+ var _excluded$L = ["children", "intent", "allowFontScaling", "level", "typeface", "fontStyle", "style", "testID"];
8435
8435
  var Title = function Title(_ref) {
8436
8436
  var children = _ref.children,
8437
8437
  _ref$intent = _ref.intent,
@@ -8446,7 +8446,7 @@ var Title = function Title(_ref) {
8446
8446
  fontStyle = _ref$fontStyle === void 0 ? 'normal' : _ref$fontStyle,
8447
8447
  style = _ref.style,
8448
8448
  testID = _ref.testID,
8449
- nativeProps = _objectWithoutProperties(_ref, _excluded$K);
8449
+ nativeProps = _objectWithoutProperties(_ref, _excluded$L);
8450
8450
  var isAi = intent === 'ai';
8451
8451
  var styledText = /*#__PURE__*/React__namespace.default.createElement(StyledTitle$1, _extends$1({}, nativeProps, {
8452
8452
  themeLevel: level,
@@ -8496,7 +8496,7 @@ var StyledBody$2 = index$c(reactNative.Text)(function (_ref) {
8496
8496
  };
8497
8497
  });
8498
8498
 
8499
- var _excluded$J = ["children", "intent", "allowFontScaling", "typeface", "variant", "fontStyle", "style", "testID"];
8499
+ var _excluded$K = ["children", "intent", "allowFontScaling", "typeface", "variant", "fontStyle", "style", "testID"];
8500
8500
  var Body = function Body(_ref) {
8501
8501
  var children = _ref.children,
8502
8502
  _ref$intent = _ref.intent,
@@ -8511,7 +8511,7 @@ var Body = function Body(_ref) {
8511
8511
  fontStyle = _ref$fontStyle === void 0 ? 'normal' : _ref$fontStyle,
8512
8512
  style = _ref.style,
8513
8513
  testID = _ref.testID,
8514
- nativeProps = _objectWithoutProperties(_ref, _excluded$J);
8514
+ nativeProps = _objectWithoutProperties(_ref, _excluded$K);
8515
8515
  var isAi = intent === 'ai';
8516
8516
  var styledText = /*#__PURE__*/React__namespace.default.createElement(StyledBody$2, _extends$1({}, nativeProps, {
8517
8517
  themeTypeface: typeface,
@@ -9175,22 +9175,22 @@ var SpinWrapper = function SpinWrapper(_ref) {
9175
9175
  }, children);
9176
9176
  };
9177
9177
 
9178
- var _excluded$I = ["style"];
9178
+ var _excluded$J = ["style"];
9179
9179
  var AnimatedIcon = function AnimatedIcon(_ref) {
9180
9180
  var style = _ref.style,
9181
- otherProps = _objectWithoutProperties(_ref, _excluded$I);
9181
+ otherProps = _objectWithoutProperties(_ref, _excluded$J);
9182
9182
  return /*#__PURE__*/React__namespace.default.createElement(SpinWrapper, {
9183
9183
  style: style
9184
9184
  }, /*#__PURE__*/React__namespace.default.createElement(StyledHeroIcon, otherProps));
9185
9185
  };
9186
9186
 
9187
- var _excluded$H = ["name", "themeSize", "testID", "style"];
9187
+ var _excluded$I = ["name", "themeSize", "testID", "style"];
9188
9188
  var GradientIcon = function GradientIcon(_ref) {
9189
9189
  var name = _ref.name,
9190
9190
  themeSize = _ref.themeSize,
9191
9191
  testID = _ref.testID,
9192
9192
  style = _ref.style,
9193
- accessibilityProps = _objectWithoutProperties(_ref, _excluded$H);
9193
+ accessibilityProps = _objectWithoutProperties(_ref, _excluded$I);
9194
9194
  var theme = useTheme();
9195
9195
  var gradient = theme.colors.gradients.aiDiagonal;
9196
9196
  var size = theme.__hd__.icon.sizes[themeSize];
@@ -9318,7 +9318,7 @@ var AccordionItem = function AccordionItem(_ref) {
9318
9318
  }, content));
9319
9319
  };
9320
9320
 
9321
- var _excluded$G = ["key"];
9321
+ var _excluded$H = ["key"];
9322
9322
  var Accordion = function Accordion(_ref) {
9323
9323
  var items = _ref.items,
9324
9324
  activeItemKey = _ref.activeItemKey,
@@ -9341,7 +9341,7 @@ var Accordion = function Accordion(_ref) {
9341
9341
  accessible: accessible
9342
9342
  }, items.map(function (_ref2, index) {
9343
9343
  var key = _ref2.key,
9344
- props = _objectWithoutProperties(_ref2, _excluded$G);
9344
+ props = _objectWithoutProperties(_ref2, _excluded$H);
9345
9345
  var open = _activeItemKey === key;
9346
9346
  return /*#__PURE__*/React__namespace.default.createElement(React__namespace.default.Fragment, {
9347
9347
  key: key
@@ -10177,7 +10177,7 @@ var borderWidths = {
10177
10177
  var config = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, colors), space), radii), borderWidths);
10178
10178
  var flexPropsKey = ['alignContent', 'alignItems', 'alignSelf', 'display', 'flex', 'flexBasis', 'flexDirection', 'flexGrow', 'flexShrink', 'flexWrap', 'justifyContent'];
10179
10179
 
10180
- var _excluded$F = ["theme"];
10180
+ var _excluded$G = ["theme"];
10181
10181
  var getThemeValue = function getThemeValue(theme, key, props) {
10182
10182
  var propConfig = config[key];
10183
10183
  var propValue = props[key];
@@ -10204,18 +10204,18 @@ var mapStylePropToThemeValue = function mapStylePropToThemeValue(theme, props) {
10204
10204
  var configKeys = Object.keys(config);
10205
10205
  var StyledBox = index$c(reactNative.View)(function (_ref5) {
10206
10206
  var theme = _ref5.theme,
10207
- otherProps = _objectWithoutProperties(_ref5, _excluded$F);
10207
+ otherProps = _objectWithoutProperties(_ref5, _excluded$G);
10208
10208
  var styleProps = pick(configKeys, otherProps);
10209
10209
  var flexProps = pick(_toConsumableArray(flexPropsKey), otherProps);
10210
10210
  return _objectSpread2(_objectSpread2({}, mapStylePropToThemeValue(theme, styleProps)), flexProps);
10211
10211
  });
10212
10212
 
10213
- var _excluded$E = ["children", "style", "testID"];
10213
+ var _excluded$F = ["children", "style", "testID"];
10214
10214
  var Box = function Box(_ref) {
10215
10215
  var children = _ref.children,
10216
10216
  style = _ref.style,
10217
10217
  testID = _ref.testID,
10218
- otherProps = _objectWithoutProperties(_ref, _excluded$E);
10218
+ otherProps = _objectWithoutProperties(_ref, _excluded$F);
10219
10219
  return /*#__PURE__*/React__namespace.default.createElement(StyledBox, _extends$1({}, otherProps, {
10220
10220
  style: style,
10221
10221
  testID: testID
@@ -10486,7 +10486,7 @@ var StyledIcon$4 = index$c(Icon)(function (_ref6) {
10486
10486
  };
10487
10487
  });
10488
10488
 
10489
- var _excluded$D = ["children", "visible", "intent", "style", "testID"];
10489
+ var _excluded$E = ["children", "visible", "intent", "style", "testID"];
10490
10490
  var Status$1 = function Status(_ref) {
10491
10491
  var children = _ref.children,
10492
10492
  _ref$visible = _ref.visible,
@@ -10495,7 +10495,7 @@ var Status$1 = function Status(_ref) {
10495
10495
  intent = _ref$intent === void 0 ? 'danger' : _ref$intent,
10496
10496
  style = _ref.style,
10497
10497
  testID = _ref.testID,
10498
- nativeProps = _objectWithoutProperties(_ref, _excluded$D);
10498
+ nativeProps = _objectWithoutProperties(_ref, _excluded$E);
10499
10499
  var _React$useRef = React__namespace.default.useRef(new reactNative.Animated.Value(visible ? 1 : 0)),
10500
10500
  opacity = _React$useRef.current;
10501
10501
  var isFirstRendering = React__namespace.default.useRef(true);
@@ -10531,7 +10531,7 @@ var Status$1 = function Status(_ref) {
10531
10531
 
10532
10532
  var DEFAULT_MAX_NUMBER = 99;
10533
10533
 
10534
- var _excluded$C = ["children", "visible", "style", "max", "testID", "content"];
10534
+ var _excluded$D = ["children", "visible", "style", "max", "testID", "content"];
10535
10535
  var Status = function Status(_ref) {
10536
10536
  var children = _ref.children,
10537
10537
  _ref$visible = _ref.visible,
@@ -10541,7 +10541,7 @@ var Status = function Status(_ref) {
10541
10541
  max = _ref$max === void 0 ? DEFAULT_MAX_NUMBER : _ref$max,
10542
10542
  testID = _ref.testID,
10543
10543
  originalContent = _ref.content,
10544
- nativeProps = _objectWithoutProperties(_ref, _excluded$C);
10544
+ nativeProps = _objectWithoutProperties(_ref, _excluded$D);
10545
10545
  var content = React.useMemo(function () {
10546
10546
  return originalContent > max ? "".concat(max, "+") : String(originalContent);
10547
10547
  }, [originalContent, max]);
@@ -10553,7 +10553,7 @@ var Status = function Status(_ref) {
10553
10553
  }, /*#__PURE__*/React__namespace.default.createElement(StyledCountText, null, content)));
10554
10554
  };
10555
10555
 
10556
- var _excluded$B = ["content", "visible", "max", "intent", "style", "testID", "size", "variant", "icon"];
10556
+ var _excluded$C = ["content", "visible", "max", "intent", "style", "testID", "size", "variant", "icon"];
10557
10557
  var getPaddingState = function getPaddingState(content) {
10558
10558
  return content.length > 1 ? 'wideContent' : 'narrowContent';
10559
10559
  };
@@ -10572,7 +10572,7 @@ var Badge = function Badge(_ref) {
10572
10572
  _ref$variant = _ref.variant,
10573
10573
  variant = _ref$variant === void 0 ? 'filled' : _ref$variant,
10574
10574
  icon = _ref.icon,
10575
- nativeProps = _objectWithoutProperties(_ref, _excluded$B);
10575
+ nativeProps = _objectWithoutProperties(_ref, _excluded$C);
10576
10576
  var _React$useRef = React__namespace.default.useRef(new reactNative.Animated.Value(visible ? 1 : 0)),
10577
10577
  opacity = _React$useRef.current;
10578
10578
  var isFirstRendering = React__namespace.default.useRef(true);
@@ -10690,7 +10690,7 @@ var StyledBottomBarText = index$c(Typography.Label)(function (_ref4) {
10690
10690
  };
10691
10691
  });
10692
10692
 
10693
- var _excluded$A = ["onTabPress", "renderActiveTabOnly", "selectedTabKey", "tabs"];
10693
+ var _excluded$B = ["onTabPress", "renderActiveTabOnly", "selectedTabKey", "tabs"];
10694
10694
  var getInactiveIcon = function getInactiveIcon(icon) {
10695
10695
  var inactiveIcon = "".concat(icon, "-outlined");
10696
10696
  return isHeroIcon(inactiveIcon) ? inactiveIcon : icon;
@@ -10701,7 +10701,7 @@ var BottomNavigation = function BottomNavigation(_ref) {
10701
10701
  renderActiveTabOnly = _ref$renderActiveTabO === void 0 ? false : _ref$renderActiveTabO,
10702
10702
  selectedTabKey = _ref.selectedTabKey,
10703
10703
  tabs = _ref.tabs,
10704
- nativeProps = _objectWithoutProperties(_ref, _excluded$A);
10704
+ nativeProps = _objectWithoutProperties(_ref, _excluded$B);
10705
10705
  var insets = reactNativeSafeAreaContext.useSafeAreaInsets();
10706
10706
  /**
10707
10707
  * List of loaded tabs, tabs will be loaded when navigated to.
@@ -10793,13 +10793,13 @@ var StyledDivider = index$c(reactNative.View)(function (_ref) {
10793
10793
  }, horizontalMargin), verticalMargin);
10794
10794
  });
10795
10795
 
10796
- var _excluded$z = ["marginHorizontal", "marginVertical", "style", "testID"];
10796
+ var _excluded$A = ["marginHorizontal", "marginVertical", "style", "testID"];
10797
10797
  var Divider = function Divider(_ref) {
10798
10798
  var marginHorizontal = _ref.marginHorizontal,
10799
10799
  marginVertical = _ref.marginVertical,
10800
10800
  style = _ref.style,
10801
10801
  testID = _ref.testID,
10802
- nativeProps = _objectWithoutProperties(_ref, _excluded$z);
10802
+ nativeProps = _objectWithoutProperties(_ref, _excluded$A);
10803
10803
  return /*#__PURE__*/React__namespace.default.createElement(StyledDivider, _extends$1({}, nativeProps, {
10804
10804
  themeMarginHorizontal: marginHorizontal,
10805
10805
  themeMarginVertical: marginVertical,
@@ -10809,7 +10809,7 @@ var Divider = function Divider(_ref) {
10809
10809
  };
10810
10810
 
10811
10811
  var AnimatedPressable$1 = reactNative.Animated.createAnimatedComponent(reactNative.Pressable);
10812
- var AnimatedSafeAreaView = reactNative.Animated.createAnimatedComponent(reactNative.SafeAreaView);
10812
+ var AnimatedSafeAreaView = reactNative.Animated.createAnimatedComponent(reactNativeSafeAreaContext.SafeAreaView);
10813
10813
  var StyledWrapper$b = index$c(reactNative.View)(_objectSpread2(_objectSpread2({}, reactNative.StyleSheet.absoluteFillObject), {}, {
10814
10814
  flexDirection: 'column-reverse'
10815
10815
  }));
@@ -10901,7 +10901,7 @@ var Footer$1 = function Footer(_ref) {
10901
10901
  };
10902
10902
 
10903
10903
  // eslint-disable-next-line @typescript-eslint/no-empty-function
10904
- var noop$2 = function noop() {};
10904
+ var noop$3 = function noop() {};
10905
10905
 
10906
10906
  var StyledLoadingIndicatorWrapper = index$c(reactNative.View)({
10907
10907
  flexDirection: 'row',
@@ -10930,7 +10930,7 @@ var StyledLoadingDot = index$c(reactNative.View)(function (_ref) {
10930
10930
  }, themeStyling());
10931
10931
  });
10932
10932
 
10933
- var _excluded$y = ["count", "size", "testID", "themeVariant"];
10933
+ var _excluded$z = ["count", "size", "testID", "themeVariant"];
10934
10934
  var AnimatedLoadingIndicatorWrapper = reactNative.Animated.createAnimatedComponent(StyledLoadingIndicatorWrapper);
10935
10935
  var AnimatedLoadingDot = reactNative.Animated.createAnimatedComponent(StyledLoadingDot);
10936
10936
  var renderDotComponent = function renderDotComponent(_ref) {
@@ -10962,7 +10962,7 @@ var LoadingIndicator = function LoadingIndicator(_ref2) {
10962
10962
  size = _ref2$size === void 0 ? 12 : _ref2$size,
10963
10963
  testID = _ref2.testID,
10964
10964
  themeVariant = _ref2.themeVariant,
10965
- nativeProps = _objectWithoutProperties(_ref2, _excluded$y);
10965
+ nativeProps = _objectWithoutProperties(_ref2, _excluded$z);
10966
10966
  var progressAnimation = React.useRef(new reactNative.Animated.Value(0));
10967
10967
  React.useEffect(function () {
10968
10968
  var animation = reactNative.Animated.loop(reactNative.Animated.timing(progressAnimation.current, {
@@ -11566,7 +11566,7 @@ var Header = function Header(_ref) {
11566
11566
  var content = _ref.content,
11567
11567
  showDivider = _ref.showDivider,
11568
11568
  _ref$onRequestClose = _ref.onRequestClose,
11569
- onRequestClose = _ref$onRequestClose === void 0 ? noop$2 : _ref$onRequestClose,
11569
+ onRequestClose = _ref$onRequestClose === void 0 ? noop$3 : _ref$onRequestClose,
11570
11570
  showCloseButton = _ref.showCloseButton,
11571
11571
  _ref$variant = _ref.variant,
11572
11572
  variant = _ref$variant === void 0 ? 'fixed' : _ref$variant;
@@ -11594,11 +11594,11 @@ var Header = function Header(_ref) {
11594
11594
  }))) : null), showDivider ? /*#__PURE__*/React__namespace.default.createElement(Divider, null) : null);
11595
11595
  };
11596
11596
 
11597
- var _excluded$x = ["scrollEventThrottle"];
11597
+ var _excluded$y = ["scrollEventThrottle"];
11598
11598
  var BottomSheetScrollView = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
11599
11599
  var _ref$scrollEventThrot = _ref.scrollEventThrottle,
11600
11600
  scrollEventThrottle = _ref$scrollEventThrot === void 0 ? 100 : _ref$scrollEventThrot,
11601
- props = _objectWithoutProperties(_ref, _excluded$x);
11601
+ props = _objectWithoutProperties(_ref, _excluded$y);
11602
11602
  var _useContext = React.useContext(BottomSheetContext),
11603
11603
  setInternalShowDivider = _useContext.setInternalShowDivider;
11604
11604
  var onScrollBeginDrag = React.useCallback(function (e) {
@@ -14212,7 +14212,7 @@ var setStartOrEndDate = function setStartOrEndDate(_ref2) {
14212
14212
  };
14213
14213
  };
14214
14214
  var shouldUseMonthPicker = function shouldUseMonthPicker(onMonthChange) {
14215
- return onMonthChange !== noop$2;
14215
+ return onMonthChange !== noop$3;
14216
14216
  };
14217
14217
  var getCalendarDate = function getCalendarDate(_ref3) {
14218
14218
  var visibleDate = _ref3.visibleDate,
@@ -14348,20 +14348,20 @@ var CalendarRange = function CalendarRange(_ref) {
14348
14348
  visibleDate = _ref.visibleDate,
14349
14349
  onChange = _ref.onChange,
14350
14350
  _ref$onPreviousPress = _ref.onPreviousPress,
14351
- onPreviousPress = _ref$onPreviousPress === void 0 ? noop$2 : _ref$onPreviousPress,
14351
+ onPreviousPress = _ref$onPreviousPress === void 0 ? noop$3 : _ref$onPreviousPress,
14352
14352
  _ref$onNextPress = _ref.onNextPress,
14353
- onNextPress = _ref$onNextPress === void 0 ? noop$2 : _ref$onNextPress,
14353
+ onNextPress = _ref$onNextPress === void 0 ? noop$3 : _ref$onNextPress,
14354
14354
  _ref$onTitlePress = _ref.onTitlePress,
14355
- onTitlePress = _ref$onTitlePress === void 0 ? noop$2 : _ref$onTitlePress,
14355
+ onTitlePress = _ref$onTitlePress === void 0 ? noop$3 : _ref$onTitlePress,
14356
14356
  minDate = _ref.minDate,
14357
14357
  maxDate = _ref.maxDate,
14358
14358
  _ref$markedDates = _ref.markedDates,
14359
14359
  markedDates = _ref$markedDates === void 0 ? [] : _ref$markedDates,
14360
14360
  testID = _ref.testID,
14361
14361
  _ref$onMonthChange = _ref.onMonthChange,
14362
- onMonthChange = _ref$onMonthChange === void 0 ? noop$2 : _ref$onMonthChange,
14362
+ onMonthChange = _ref$onMonthChange === void 0 ? noop$3 : _ref$onMonthChange,
14363
14363
  _ref$onToggleMonthPic = _ref.onToggleMonthPicker,
14364
- onToggleMonthPicker = _ref$onToggleMonthPic === void 0 ? noop$2 : _ref$onToggleMonthPic,
14364
+ onToggleMonthPicker = _ref$onToggleMonthPic === void 0 ? noop$3 : _ref$onToggleMonthPic,
14365
14365
  monthPickerConfirmLabel = _ref.monthPickerConfirmLabel,
14366
14366
  monthPickerCancelLabel = _ref.monthPickerCancelLabel;
14367
14367
  var theme = useTheme();
@@ -14529,20 +14529,20 @@ var Calendar = function Calendar(_ref) {
14529
14529
  visibleDate = _ref.visibleDate,
14530
14530
  onChange = _ref.onChange,
14531
14531
  _ref$onPreviousPress = _ref.onPreviousPress,
14532
- onPreviousPress = _ref$onPreviousPress === void 0 ? noop$2 : _ref$onPreviousPress,
14532
+ onPreviousPress = _ref$onPreviousPress === void 0 ? noop$3 : _ref$onPreviousPress,
14533
14533
  _ref$onNextPress = _ref.onNextPress,
14534
- onNextPress = _ref$onNextPress === void 0 ? noop$2 : _ref$onNextPress,
14534
+ onNextPress = _ref$onNextPress === void 0 ? noop$3 : _ref$onNextPress,
14535
14535
  _ref$onTitlePress = _ref.onTitlePress,
14536
- onTitlePress = _ref$onTitlePress === void 0 ? noop$2 : _ref$onTitlePress,
14536
+ onTitlePress = _ref$onTitlePress === void 0 ? noop$3 : _ref$onTitlePress,
14537
14537
  minDate = _ref.minDate,
14538
14538
  maxDate = _ref.maxDate,
14539
14539
  _ref$markedDates = _ref.markedDates,
14540
14540
  markedDates = _ref$markedDates === void 0 ? [] : _ref$markedDates,
14541
14541
  testID = _ref.testID,
14542
14542
  _ref$onMonthChange = _ref.onMonthChange,
14543
- onMonthChange = _ref$onMonthChange === void 0 ? noop$2 : _ref$onMonthChange,
14543
+ onMonthChange = _ref$onMonthChange === void 0 ? noop$3 : _ref$onMonthChange,
14544
14544
  _ref$onToggleMonthPic = _ref.onToggleMonthPicker,
14545
- onToggleMonthPicker = _ref$onToggleMonthPic === void 0 ? noop$2 : _ref$onToggleMonthPic,
14545
+ onToggleMonthPicker = _ref$onToggleMonthPic === void 0 ? noop$3 : _ref$onToggleMonthPic,
14546
14546
  monthPickerConfirmLabel = _ref.monthPickerConfirmLabel,
14547
14547
  monthPickerCancelLabel = _ref.monthPickerCancelLabel;
14548
14548
  var theme = useTheme();
@@ -14720,12 +14720,12 @@ var Indicator = index$c(reactNative.View)(function (_ref3) {
14720
14720
  };
14721
14721
  });
14722
14722
 
14723
- var _excluded$w = ["intent", "children"];
14723
+ var _excluded$x = ["intent", "children"];
14724
14724
  var DataCard = function DataCard(_ref) {
14725
14725
  var _ref$intent = _ref.intent,
14726
14726
  intent = _ref$intent === void 0 ? 'info' : _ref$intent,
14727
14727
  children = _ref.children,
14728
- nativeProps = _objectWithoutProperties(_ref, _excluded$w);
14728
+ nativeProps = _objectWithoutProperties(_ref, _excluded$x);
14729
14729
  return /*#__PURE__*/React__namespace.default.createElement(StyledDataCard, nativeProps, /*#__PURE__*/React__namespace.default.createElement(Indicator, {
14730
14730
  themeIntent: intent,
14731
14731
  testID: "data-card-indicator"
@@ -14744,13 +14744,13 @@ var StyledCard$1 = index$c(reactNative.View)(function (_ref) {
14744
14744
  });
14745
14745
  });
14746
14746
 
14747
- var _excluded$v = ["intent", "children", "variant"];
14747
+ var _excluded$w = ["intent", "children", "variant"];
14748
14748
  var Card = function Card(_ref) {
14749
14749
  var intent = _ref.intent,
14750
14750
  children = _ref.children,
14751
14751
  _ref$variant = _ref.variant,
14752
14752
  variant = _ref$variant === void 0 ? 'basic' : _ref$variant,
14753
- nativeProps = _objectWithoutProperties(_ref, _excluded$v);
14753
+ nativeProps = _objectWithoutProperties(_ref, _excluded$w);
14754
14754
  return /*#__PURE__*/React__namespace.default.createElement(StyledCard$1, _extends$1({}, nativeProps, {
14755
14755
  themeIntent: intent,
14756
14756
  themeVariant: variant
@@ -15017,7 +15017,7 @@ var CardCarousel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
15017
15017
  });
15018
15018
  CardCarousel.displayName = 'CardCarousel';
15019
15019
 
15020
- var _excluded$u = ["rounded", "size", "testID", "style"];
15020
+ var _excluded$v = ["rounded", "size", "testID", "style"];
15021
15021
  /**
15022
15022
  * @deprecated Image component will soon be deprecated. Please use `Image` from `react-native` instead.
15023
15023
  */
@@ -15028,7 +15028,7 @@ var Image = function Image(_ref) {
15028
15028
  size = _ref$size === void 0 ? '6xlarge' : _ref$size,
15029
15029
  testID = _ref.testID,
15030
15030
  style = _ref.style,
15031
- imageNativeProps = _objectWithoutProperties(_ref, _excluded$u);
15031
+ imageNativeProps = _objectWithoutProperties(_ref, _excluded$v);
15032
15032
  useDeprecation('Image component will soon be deprecated. Please use `Image` from `react-native` instead.');
15033
15033
  var theme = useTheme();
15034
15034
  var imageSize = theme.__hd__.image.sizes[size];
@@ -15163,7 +15163,7 @@ var CarouselItem = function CarouselItem(_ref) {
15163
15163
  }, heading), !!body && /*#__PURE__*/React__namespace.default.createElement(Typography.Body, null, body)));
15164
15164
  };
15165
15165
 
15166
- var _excluded$t = ["items", "onItemIndexChange", "renderActions", "selectedItemIndex", "style", "shouldShowPagination", "testID", "pageControlPosition"];
15166
+ var _excluded$u = ["items", "onItemIndexChange", "renderActions", "selectedItemIndex", "style", "shouldShowPagination", "testID", "pageControlPosition"];
15167
15167
  function useStateFromProp(initialValue) {
15168
15168
  var _useState = React.useState(initialValue),
15169
15169
  _useState2 = _slicedToArray(_useState, 2),
@@ -15174,7 +15174,7 @@ function useStateFromProp(initialValue) {
15174
15174
  }, [initialValue]);
15175
15175
  return [value, setValue];
15176
15176
  }
15177
- var noop$1 = function noop(_) {
15177
+ var noop$2 = function noop(_) {
15178
15178
  return true;
15179
15179
  };
15180
15180
  var Carousel = function Carousel(_ref) {
@@ -15186,12 +15186,12 @@ var Carousel = function Carousel(_ref) {
15186
15186
  selectedItemIndex = _ref$selectedItemInde === void 0 ? 0 : _ref$selectedItemInde,
15187
15187
  style = _ref.style,
15188
15188
  _ref$shouldShowPagina = _ref.shouldShowPagination,
15189
- shouldShowPagination = _ref$shouldShowPagina === void 0 ? noop$1 : _ref$shouldShowPagina,
15189
+ shouldShowPagination = _ref$shouldShowPagina === void 0 ? noop$2 : _ref$shouldShowPagina,
15190
15190
  testID = _ref.testID,
15191
15191
  _ref$pageControlPosit = _ref.pageControlPosition,
15192
15192
  pageControlPosition = _ref$pageControlPosit === void 0 ? 'top' : _ref$pageControlPosit,
15193
- nativeProps = _objectWithoutProperties(_ref, _excluded$t);
15194
- useDeprecation("shouldShowPagination prop has been deprecated", shouldShowPagination !== noop$1);
15193
+ nativeProps = _objectWithoutProperties(_ref, _excluded$u);
15194
+ useDeprecation("shouldShowPagination prop has been deprecated", shouldShowPagination !== noop$2);
15195
15195
  useDeprecation("The use of 'pageControlPosition == bottom' has been deprecated", pageControlPosition === 'bottom');
15196
15196
  var theme = useTheme();
15197
15197
  var carouselRef = React.useRef(null);
@@ -15912,7 +15912,7 @@ function range(start, stop, step) {
15912
15912
  return range;
15913
15913
  }
15914
15914
 
15915
- var noop = {
15915
+ var noop$1 = {
15916
15916
  value: function value() {}
15917
15917
  };
15918
15918
  function dispatch() {
@@ -15986,7 +15986,7 @@ function get$1(type, name) {
15986
15986
  function set$1(type, name, callback) {
15987
15987
  for (var i = 0, n = type.length; i < n; ++i) {
15988
15988
  if (type[i].name === name) {
15989
- type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));
15989
+ type[i] = noop$1, type = type.slice(0, i).concat(type.slice(i + 1));
15990
15990
  break;
15991
15991
  }
15992
15992
  }
@@ -20461,7 +20461,7 @@ var StyledChipIcon = index$c(Icon)(function (_ref2) {
20461
20461
  };
20462
20462
  });
20463
20463
 
20464
- var _excluded$s = ["label", "variant", "selected", "icon", "onPress", "showSelectedIcon", "accessible", "onBlur", "onFocus"];
20464
+ var _excluded$t = ["label", "variant", "selected", "icon", "onPress", "showSelectedIcon", "accessible", "onBlur", "onFocus"];
20465
20465
  var getChipLabel = function getChipLabel(label) {
20466
20466
  if (typeof label === 'string') {
20467
20467
  return /*#__PURE__*/React__namespace.default.createElement(Typography.Body, {
@@ -20497,7 +20497,7 @@ var Chip = function Chip(_ref) {
20497
20497
  accessible = _ref.accessible,
20498
20498
  onBlur = _ref.onBlur,
20499
20499
  onFocus = _ref.onFocus,
20500
- otherProps = _objectWithoutProperties(_ref, _excluded$s);
20500
+ otherProps = _objectWithoutProperties(_ref, _excluded$t);
20501
20501
  useDeprecation('Chip variant `outlined` and `filled` are deprecated.', variant === 'outlined' || variant === 'filled');
20502
20502
  var renamedVariant = getChipVariant(variant);
20503
20503
  var shouldShowSelectedIcon = (renamedVariant === 'selection' || renamedVariant === 'compact-outlined') && selected && showSelectedIcon;
@@ -20888,7 +20888,7 @@ var StyledErrorAndMaxLengthContainer = index$c(reactNative.View)(function (_ref1
20888
20888
  };
20889
20889
  });
20890
20890
 
20891
- var _excluded$r = ["label", "prefix", "suffix", "style", "textStyle", "testID", "accessibilityLabelledBy", "error", "required", "editable", "disabled", "loading", "maxLength", "hideCharacterCount", "helpText", "value", "defaultValue", "renderInputValue", "allowFontScaling", "variant"];
20891
+ var _excluded$s = ["label", "prefix", "suffix", "style", "textStyle", "testID", "accessibilityLabelledBy", "error", "required", "editable", "disabled", "loading", "maxLength", "hideCharacterCount", "helpText", "value", "defaultValue", "renderInputValue", "allowFontScaling", "variant"];
20892
20892
  var getState$3 = function getState(_ref) {
20893
20893
  var disabled = _ref.disabled,
20894
20894
  error = _ref.error,
@@ -21004,7 +21004,7 @@ var TextInput = /*#__PURE__*/React.forwardRef(function (_ref8, ref) {
21004
21004
  allowFontScaling = _ref8$allowFontScalin === void 0 ? false : _ref8$allowFontScalin,
21005
21005
  _ref8$variant = _ref8.variant,
21006
21006
  variant = _ref8$variant === void 0 ? 'text' : _ref8$variant,
21007
- nativeProps = _objectWithoutProperties(_ref8, _excluded$r);
21007
+ nativeProps = _objectWithoutProperties(_ref8, _excluded$s);
21008
21008
  var displayText = getDisplayText(value, defaultValue);
21009
21009
  var isEmptyValue = displayText.length === 0;
21010
21010
  var _React$useState = React__namespace.default.useState(0),
@@ -21751,11 +21751,11 @@ var DatePickerIOS = function DatePickerIOS(_ref) {
21751
21751
  }));
21752
21752
  };
21753
21753
 
21754
- var _excluded$q = ["variant"];
21754
+ var _excluded$r = ["variant"];
21755
21755
  var DatePicker = function DatePicker(_ref) {
21756
21756
  var _ref$variant = _ref.variant,
21757
21757
  variant = _ref$variant === void 0 ? 'default' : _ref$variant,
21758
- props = _objectWithoutProperties(_ref, _excluded$q);
21758
+ props = _objectWithoutProperties(_ref, _excluded$r);
21759
21759
  if (variant === 'calendar') {
21760
21760
  return /*#__PURE__*/React__namespace.default.createElement(DatePickerCalendar, props);
21761
21761
  }
@@ -21836,7 +21836,7 @@ var StyledDragableDrawerContainer = index$c(reactNative.Animated.View)(function
21836
21836
  backgroundColor: theme.__hd__.drawer.colors.background,
21837
21837
  elevation: enableShadow ? theme.__hd__.drawer.shadows.elevation : undefined,
21838
21838
  overflow: 'hidden',
21839
- maxHeight: '100%'
21839
+ height: '100%'
21840
21840
  };
21841
21841
  });
21842
21842
  var StyledHandlerContainer$1 = index$c(reactNative.View)(function (_ref6) {
@@ -21857,6 +21857,23 @@ var StyledHandler = index$c(reactNative.View)(function (_ref7) {
21857
21857
  };
21858
21858
  });
21859
21859
 
21860
+ var noop = function noop() {
21861
+ return {};
21862
+ };
21863
+ var DragableDrawerContext = /*#__PURE__*/React.createContext({
21864
+ isAtMaxHeight: false,
21865
+ scrollYRef: {
21866
+ current: 0
21867
+ },
21868
+ onScrollY: noop,
21869
+ beginPan: noop,
21870
+ movePan: noop,
21871
+ releasePan: noop
21872
+ });
21873
+ var useDragableDrawerContext = function useDragableDrawerContext() {
21874
+ return React.useContext(DragableDrawerContext);
21875
+ };
21876
+
21860
21877
  var getOffset = function getOffset(height, percentage) {
21861
21878
  if (percentage < 0) return height;
21862
21879
  if (percentage > 100) return 0;
@@ -21885,34 +21902,39 @@ var calculateAnimatedToValue = function calculateAnimatedToValue(position, heigh
21885
21902
  return heightSnapPoints[minIndex];
21886
21903
  };
21887
21904
 
21888
- var DragableDrawer = function DragableDrawer(_ref) {
21889
- var children = _ref.children,
21905
+ var FLICK_VELOCITY_THRESHOLD = 0.3;
21906
+ var SHORT_DRAG_THRESHOLD_PX = 20;
21907
+ var VELOCITY_PROJECTION_FACTOR = 200;
21908
+ var useDragablePan = function useDragablePan(_ref) {
21909
+ var height = _ref.height,
21890
21910
  initialHeightPercentage = _ref.initialHeightPercentage,
21891
- _ref$minimumHeightPer = _ref.minimumHeightPercentage,
21892
- minimumHeightPercentage = _ref$minimumHeightPer === void 0 ? 10 : _ref$minimumHeightPer,
21893
- _ref$snapPoints = _ref.snapPoints,
21894
- snapPoints = _ref$snapPoints === void 0 ? [] : _ref$snapPoints,
21911
+ minimumHeightPercentage = _ref.minimumHeightPercentage,
21912
+ snapPoints = _ref.snapPoints,
21895
21913
  onExpanded = _ref.onExpanded,
21896
- onCollapsed = _ref.onCollapsed,
21897
- testID = _ref.testID;
21898
- var _useState = React.useState(0),
21899
- _useState2 = _slicedToArray(_useState, 2),
21900
- height = _useState2[0],
21901
- setHeight = _useState2[1];
21914
+ onCollapsed = _ref.onCollapsed;
21902
21915
  var baseHeightForMeasure = React.useRef(0);
21903
21916
  var snapPointsData = React.useRef({
21904
21917
  list: [],
21905
21918
  minHeightOffset: 0,
21906
21919
  maxHeightOffset: 0
21907
21920
  });
21908
- // Track drag
21909
21921
  var pan = React.useRef(new reactNative.Animated.Value(0)).current;
21910
21922
  var offset = React.useRef(0);
21911
21923
  var offsetBeforePan = React.useRef(0);
21912
- var _useState3 = React.useState(-1),
21924
+ var _useState = React.useState(-1),
21925
+ _useState2 = _slicedToArray(_useState, 2),
21926
+ animatedToValue = _useState2[0],
21927
+ setAnimatedToValue = _useState2[1];
21928
+ var _useState3 = React.useState(false),
21913
21929
  _useState4 = _slicedToArray(_useState3, 2),
21914
- animatedToValue = _useState4[0],
21915
- setAnimatedToValue = _useState4[1];
21930
+ isAtMaxHeight = _useState4[0],
21931
+ setIsAtMaxHeight = _useState4[1];
21932
+ var scrollYRef = React.useRef(0);
21933
+ var minimumHeightPercentageRef = React.useRef(minimumHeightPercentage);
21934
+ minimumHeightPercentageRef.current = minimumHeightPercentage;
21935
+ var onScrollY = React.useCallback(function (y) {
21936
+ scrollYRef.current = y;
21937
+ }, []);
21916
21938
  React.useEffect(function () {
21917
21939
  var id = pan.addListener(function (_ref2) {
21918
21940
  var value = _ref2.value;
@@ -21927,13 +21949,12 @@ var DragableDrawer = function DragableDrawer(_ref) {
21927
21949
  var initialOffset = getOffset(height, initialHeightPercentage || minimumHeightPercentage);
21928
21950
  setAnimatedToValue(initialOffset);
21929
21951
  }
21930
- }, [height]);
21952
+ }, [height, initialHeightPercentage, minimumHeightPercentage]);
21931
21953
  React.useEffect(function () {
21932
21954
  if (height > 0) {
21933
21955
  pan.setValue(height);
21934
21956
  offset.current = height;
21935
21957
  baseHeightForMeasure.current = height;
21936
- // Calculate snap points information
21937
21958
  snapPointsData.current = calculateSnapPointsData(minimumHeightPercentage, height, snapPoints);
21938
21959
  }
21939
21960
  }, [height, minimumHeightPercentage]);
@@ -21944,11 +21965,18 @@ var DragableDrawer = function DragableDrawer(_ref) {
21944
21965
  useNativeDriver: reactNative.Platform.OS !== 'web',
21945
21966
  easing: reactNative.Easing.inOut(reactNative.Easing.cubic)
21946
21967
  });
21947
- animation.start(function () {
21948
- if (animatedToValue === 0) {
21949
- onExpanded === null || onExpanded === void 0 || onExpanded();
21950
- } else if (animatedToValue === getOffset(height, minimumHeightPercentage)) {
21951
- onCollapsed === null || onCollapsed === void 0 || onCollapsed();
21968
+ animation.start(function (_ref3) {
21969
+ var finished = _ref3.finished;
21970
+ if (finished) {
21971
+ if (animatedToValue === 0) {
21972
+ setIsAtMaxHeight(true);
21973
+ onExpanded === null || onExpanded === void 0 || onExpanded();
21974
+ } else {
21975
+ setIsAtMaxHeight(false);
21976
+ if (animatedToValue === getOffset(height, minimumHeightPercentage)) {
21977
+ onCollapsed === null || onCollapsed === void 0 || onCollapsed();
21978
+ }
21979
+ }
21952
21980
  }
21953
21981
  setAnimatedToValue(-1);
21954
21982
  });
@@ -21956,41 +21984,130 @@ var DragableDrawer = function DragableDrawer(_ref) {
21956
21984
  return animation.stop();
21957
21985
  };
21958
21986
  }
21959
- }, [animatedToValue]);
21987
+ }, [animatedToValue, onExpanded, onCollapsed, height, minimumHeightPercentage]);
21988
+ var beginPan = React.useCallback(function () {
21989
+ pan.stopAnimation();
21990
+ setIsAtMaxHeight(false);
21991
+ offsetBeforePan.current = offset.current;
21992
+ pan.setOffset(offset.current);
21993
+ pan.setValue(0);
21994
+ }, []);
21995
+ var movePan = React.useCallback(function (dy) {
21996
+ var _snapPointsData$curre;
21997
+ // Moving toward top, stop at highest snap point
21998
+ if (offsetBeforePan.current + dy < 0) {
21999
+ pan.setValue(-offsetBeforePan.current);
22000
+ return;
22001
+ }
22002
+ // Moving toward bottom, stop at lowest snap point
22003
+ if (offsetBeforePan.current + dy > ((_snapPointsData$curre = snapPointsData.current) === null || _snapPointsData$curre === void 0 ? void 0 : _snapPointsData$curre.minHeightOffset)) {
22004
+ pan.setValue(baseHeightForMeasure.current - baseHeightForMeasure.current * (minimumHeightPercentageRef.current / 100) - offsetBeforePan.current);
22005
+ return;
22006
+ }
22007
+ pan.setValue(dy);
22008
+ }, []);
22009
+ var releasePan = React.useCallback(function (dy, vy) {
22010
+ pan.flattenOffset();
22011
+ var offsetAfterPan = offsetBeforePan.current + dy;
22012
+ // Flick or short downward drag: snap to the next lower snap point.
22013
+ if (vy > FLICK_VELOCITY_THRESHOLD || dy > SHORT_DRAG_THRESHOLD_PX) {
22014
+ var lowerPoints = snapPointsData.current.list.filter(function (p) {
22015
+ return p > offsetBeforePan.current;
22016
+ }).sort(function (a, b) {
22017
+ return a - b;
22018
+ });
22019
+ if (lowerPoints.length > 0) {
22020
+ setAnimatedToValue(lowerPoints[0]);
22021
+ return;
22022
+ }
22023
+ }
22024
+ // Upward flick or drag: project the intended landing position using
22025
+ // velocity, then snap to the nearest higher snap point to that projection.
22026
+ // This allows fast flicks to skip intermediate snap points.
22027
+ if (vy < -FLICK_VELOCITY_THRESHOLD || dy < -SHORT_DRAG_THRESHOLD_PX) {
22028
+ var projected = offsetAfterPan + vy * VELOCITY_PROJECTION_FACTOR;
22029
+ var higherPoints = snapPointsData.current.list.filter(function (p) {
22030
+ return p < offsetBeforePan.current;
22031
+ }).sort(function (a, b) {
22032
+ return b - a;
22033
+ });
22034
+ if (higherPoints.length > 0) {
22035
+ setAnimatedToValue(calculateAnimatedToValue(projected, higherPoints));
22036
+ return;
22037
+ }
22038
+ }
22039
+ // Otherwise: snap to nearest.
22040
+ setAnimatedToValue(calculateAnimatedToValue(offsetAfterPan, snapPointsData.current.list));
22041
+ }, []);
21960
22042
  var panResponder = React.useRef(reactNative.PanResponder.create({
21961
22043
  onMoveShouldSetPanResponder: function onMoveShouldSetPanResponder() {
21962
22044
  return true;
21963
22045
  },
21964
22046
  onPanResponderGrant: function onPanResponderGrant() {
21965
- offsetBeforePan.current = offset.current;
21966
- pan.setOffset(offset.current);
21967
- pan.setValue(0);
22047
+ return beginPan();
21968
22048
  },
21969
22049
  onPanResponderMove: function onPanResponderMove(_, gesture) {
21970
- var _snapPointsData$curre;
21971
- var panDistance = gesture.dy;
21972
- // Moving toward top, stop at highest snap point
21973
- if (offsetBeforePan.current + panDistance < 0) {
21974
- pan.setValue(-offsetBeforePan.current);
21975
- return;
21976
- }
21977
- // Moving toward bottom, stop at lowest snap point
21978
- if (offsetBeforePan.current + panDistance > ((_snapPointsData$curre = snapPointsData.current) === null || _snapPointsData$curre === void 0 ? void 0 : _snapPointsData$curre.minHeightOffset)) {
21979
- pan.setValue(baseHeightForMeasure.current - baseHeightForMeasure.current * (minimumHeightPercentage / 100) - offsetBeforePan.current);
21980
- return;
21981
- }
21982
- pan.setValue(panDistance);
22050
+ return movePan(gesture.dy);
21983
22051
  },
21984
22052
  onPanResponderRelease: function onPanResponderRelease(_, gesture) {
21985
- pan.flattenOffset();
21986
- // Attach to nearest snappoint
21987
- var panDistance = gesture.dy;
21988
- var offsetAfterPan = offsetBeforePan.current + panDistance;
21989
- var animatedValue = calculateAnimatedToValue(offsetAfterPan, snapPointsData.current.list);
21990
- setAnimatedToValue(animatedValue);
22053
+ return releasePan(gesture.dy, gesture.vy);
21991
22054
  }
21992
22055
  })).current;
21993
- return /*#__PURE__*/React__namespace.default.createElement(StyledDragableContainer, {
22056
+ return {
22057
+ pan: pan,
22058
+ isAtMaxHeight: isAtMaxHeight,
22059
+ scrollYRef: scrollYRef,
22060
+ onScrollY: onScrollY,
22061
+ beginPan: beginPan,
22062
+ movePan: movePan,
22063
+ releasePan: releasePan,
22064
+ panHandlers: panResponder.panHandlers
22065
+ };
22066
+ };
22067
+
22068
+ var DragableDrawer = function DragableDrawer(_ref) {
22069
+ var children = _ref.children,
22070
+ initialHeightPercentage = _ref.initialHeightPercentage,
22071
+ _ref$minimumHeightPer = _ref.minimumHeightPercentage,
22072
+ minimumHeightPercentage = _ref$minimumHeightPer === void 0 ? 10 : _ref$minimumHeightPer,
22073
+ _ref$snapPoints = _ref.snapPoints,
22074
+ snapPoints = _ref$snapPoints === void 0 ? [] : _ref$snapPoints,
22075
+ onExpanded = _ref.onExpanded,
22076
+ onCollapsed = _ref.onCollapsed,
22077
+ testID = _ref.testID;
22078
+ var _useState = React.useState(0),
22079
+ _useState2 = _slicedToArray(_useState, 2),
22080
+ height = _useState2[0],
22081
+ setHeight = _useState2[1];
22082
+ var _useDragablePan = useDragablePan({
22083
+ height: height,
22084
+ initialHeightPercentage: initialHeightPercentage,
22085
+ minimumHeightPercentage: minimumHeightPercentage,
22086
+ snapPoints: snapPoints,
22087
+ onExpanded: onExpanded,
22088
+ onCollapsed: onCollapsed
22089
+ }),
22090
+ pan = _useDragablePan.pan,
22091
+ isAtMaxHeight = _useDragablePan.isAtMaxHeight,
22092
+ scrollYRef = _useDragablePan.scrollYRef,
22093
+ onScrollY = _useDragablePan.onScrollY,
22094
+ beginPan = _useDragablePan.beginPan,
22095
+ movePan = _useDragablePan.movePan,
22096
+ releasePan = _useDragablePan.releasePan,
22097
+ panHandlers = _useDragablePan.panHandlers;
22098
+ var contextValue = React.useMemo(function () {
22099
+ return {
22100
+ isAtMaxHeight: isAtMaxHeight,
22101
+ scrollYRef: scrollYRef,
22102
+ onScrollY: onScrollY,
22103
+ beginPan: beginPan,
22104
+ movePan: movePan,
22105
+ releasePan: releasePan
22106
+ };
22107
+ }, [isAtMaxHeight, onScrollY, beginPan, movePan, releasePan]);
22108
+ return /*#__PURE__*/React__namespace.default.createElement(DragableDrawerContext.Provider, {
22109
+ value: contextValue
22110
+ }, /*#__PURE__*/React__namespace.default.createElement(StyledDragableContainer, {
21994
22111
  testID: testID,
21995
22112
  enableShadow: true,
21996
22113
  pointerEvents: "box-none"
@@ -21998,16 +22115,106 @@ var DragableDrawer = function DragableDrawer(_ref) {
21998
22115
  enableShadow: true,
21999
22116
  style: {
22000
22117
  transform: [{
22001
- scaleY: baseHeightForMeasure.current > 0 ? 1 : 0
22118
+ scaleY: height > 0 ? 1 : 0
22002
22119
  }, {
22003
22120
  translateY: pan
22004
22121
  }]
22005
22122
  },
22006
- onLayout: function onLayout(_ref3) {
22007
- var nativeEvent = _ref3.nativeEvent;
22123
+ onLayout: function onLayout(_ref2) {
22124
+ var nativeEvent = _ref2.nativeEvent;
22008
22125
  setHeight(nativeEvent.layout.height);
22009
22126
  }
22010
- }, /*#__PURE__*/React__namespace.default.createElement(StyledHandlerContainer$1, panResponder.panHandlers, /*#__PURE__*/React__namespace.default.createElement(StyledHandler, null)), children));
22127
+ }, /*#__PURE__*/React__namespace.default.createElement(StyledHandlerContainer$1, panHandlers, /*#__PURE__*/React__namespace.default.createElement(StyledHandler, null)), children)));
22128
+ };
22129
+
22130
+ var _excluded$q = ["onScroll", "onScrollEndDrag", "onMomentumScrollEnd", "scrollEventThrottle", "children"];
22131
+ // scrollY tolerance: treat anything within this many pixels of the top as
22132
+ // "at scroll top" to handle fractional pixels and throttled scroll events.
22133
+ var SCROLL_TOP_THRESHOLD_PX = 5;
22134
+ // Minimum downward finger movement before the pull-down collapse is triggered.
22135
+ var PULL_DOWN_THRESHOLD_PX = 10;
22136
+ var DEFAULT_SCROLL_EVENT_THROTTLE = 16;
22137
+ /**
22138
+ * A ScrollView that coordinates with a parent DragableDrawer.
22139
+ *
22140
+ * - Drawer below max height: all gestures move the drawer; scroll is locked.
22141
+ * - Drawer at max height: native scrolling works normally.
22142
+ * - Drawer at max + scrolled to top + pull down: drawer collapses.
22143
+ *
22144
+ * The native ScrollView with bounces={false}/overScrollMode="never" will not
22145
+ * intercept a downward gesture at scrollY=0 (nothing left to scroll), so
22146
+ * onMoveShouldSetPanResponderCapture fires cleanly on both platforms.
22147
+ * onScrollEndDrag + onMomentumScrollEnd ensure scrollYRef is up-to-date
22148
+ * before the next gesture starts.
22149
+ */
22150
+ var DragableScrollView = function DragableScrollView(_ref) {
22151
+ var onScroll = _ref.onScroll,
22152
+ onScrollEndDragProp = _ref.onScrollEndDrag,
22153
+ onMomentumScrollEndProp = _ref.onMomentumScrollEnd,
22154
+ _ref$scrollEventThrot = _ref.scrollEventThrottle,
22155
+ scrollEventThrottle = _ref$scrollEventThrot === void 0 ? DEFAULT_SCROLL_EVENT_THROTTLE : _ref$scrollEventThrot,
22156
+ children = _ref.children,
22157
+ props = _objectWithoutProperties(_ref, _excluded$q);
22158
+ var _useDragableDrawerCon = useDragableDrawerContext(),
22159
+ isAtMaxHeight = _useDragableDrawerCon.isAtMaxHeight,
22160
+ scrollYRef = _useDragableDrawerCon.scrollYRef,
22161
+ onScrollY = _useDragableDrawerCon.onScrollY,
22162
+ beginPan = _useDragableDrawerCon.beginPan,
22163
+ movePan = _useDragableDrawerCon.movePan,
22164
+ releasePan = _useDragableDrawerCon.releasePan;
22165
+ // Mirror context value into a ref so PanResponder closures always read
22166
+ // the latest value (PanResponder is created once and closures are frozen).
22167
+ var isAtMaxHeightRef = React.useRef(isAtMaxHeight);
22168
+ isAtMaxHeightRef.current = isAtMaxHeight;
22169
+ var panResponder = React.useRef(reactNative.PanResponder.create({
22170
+ // Drawer below max: capture on start so the native ScrollView never
22171
+ // gets the touch and scroll is completely locked.
22172
+ onStartShouldSetPanResponderCapture: function onStartShouldSetPanResponderCapture() {
22173
+ return !isAtMaxHeightRef.current;
22174
+ },
22175
+ // Drawer at max + scroll at top + pull down: recapture for collapse.
22176
+ // bounces={false} / overScrollMode="never" means the native ScrollView
22177
+ // has nothing to do here, so it will not intercept the gesture and this
22178
+ // capture fires reliably before any scroll activity begins.
22179
+ onMoveShouldSetPanResponderCapture: function onMoveShouldSetPanResponderCapture(_, gesture) {
22180
+ return isAtMaxHeightRef.current && scrollYRef.current <= SCROLL_TOP_THRESHOLD_PX && gesture.dy > PULL_DOWN_THRESHOLD_PX;
22181
+ },
22182
+ onPanResponderGrant: function onPanResponderGrant() {
22183
+ return beginPan();
22184
+ },
22185
+ onPanResponderMove: function onPanResponderMove(_, gesture) {
22186
+ return movePan(gesture.dy);
22187
+ },
22188
+ onPanResponderRelease: function onPanResponderRelease(_, gesture) {
22189
+ return releasePan(gesture.dy, gesture.vy);
22190
+ }
22191
+ })).current;
22192
+ var handleScroll = function handleScroll(e) {
22193
+ onScrollY(e.nativeEvent.contentOffset.y);
22194
+ onScroll === null || onScroll === void 0 || onScroll(e);
22195
+ };
22196
+ // Keep scrollYRef accurate at every scroll boundary so the next gesture
22197
+ // checks the correct position even when onScroll is throttled.
22198
+ var handleScrollEndDrag = function handleScrollEndDrag(e) {
22199
+ onScrollY(e.nativeEvent.contentOffset.y);
22200
+ onScrollEndDragProp === null || onScrollEndDragProp === void 0 || onScrollEndDragProp(e);
22201
+ };
22202
+ var handleMomentumScrollEnd = function handleMomentumScrollEnd(e) {
22203
+ onScrollY(e.nativeEvent.contentOffset.y);
22204
+ onMomentumScrollEndProp === null || onMomentumScrollEndProp === void 0 || onMomentumScrollEndProp(e);
22205
+ };
22206
+ return /*#__PURE__*/React__namespace.default.createElement(reactNative.View, _extends$1({}, panResponder.panHandlers, {
22207
+ style: {
22208
+ flex: 1
22209
+ }
22210
+ }), /*#__PURE__*/React__namespace.default.createElement(reactNative.ScrollView, _extends$1({}, props, {
22211
+ scrollEnabled: isAtMaxHeight,
22212
+ onScroll: handleScroll,
22213
+ onScrollEndDrag: handleScrollEndDrag,
22214
+ onMomentumScrollEnd: handleMomentumScrollEnd,
22215
+ scrollEventThrottle: scrollEventThrottle,
22216
+ overScrollMode: "always"
22217
+ }), children));
22011
22218
  };
22012
22219
 
22013
22220
  var BACKDROP_OPACITY = 0.56;
@@ -22068,7 +22275,8 @@ var Drawer = function Drawer(_ref) {
22068
22275
  }, children));
22069
22276
  };
22070
22277
  var index$7 = Object.assign(Drawer, {
22071
- Dragable: DragableDrawer
22278
+ Dragable: DragableDrawer,
22279
+ DragableScrollView: DragableScrollView
22072
22280
  });
22073
22281
 
22074
22282
  var DEFAULT_ILLUSTRATION_SIZE = scale(72);
@@ -24193,7 +24401,7 @@ var FABWithTitleStyle = /*#__PURE__*/React.forwardRef(function (_ref3, ref) {
24193
24401
  return {
24194
24402
  show: function show() {
24195
24403
  var animated = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
24196
- var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop$2;
24404
+ var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop$3;
24197
24405
  setDisplayState({
24198
24406
  hideButton: false,
24199
24407
  hideTitle: false
@@ -24214,7 +24422,7 @@ var FABWithTitleStyle = /*#__PURE__*/React.forwardRef(function (_ref3, ref) {
24214
24422
  },
24215
24423
  collapse: function collapse() {
24216
24424
  var animated = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
24217
- var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop$2;
24425
+ var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop$3;
24218
24426
  setDisplayState({
24219
24427
  hideButton: false,
24220
24428
  hideTitle: true
@@ -24235,7 +24443,7 @@ var FABWithTitleStyle = /*#__PURE__*/React.forwardRef(function (_ref3, ref) {
24235
24443
  },
24236
24444
  hide: function hide() {
24237
24445
  var animated = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
24238
- var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop$2;
24446
+ var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop$3;
24239
24447
  if (animated) {
24240
24448
  reactNative.Animated.stagger(20, [reactNative.Animated.spring(animatedValues.opacity, {
24241
24449
  toValue: 0,
@@ -27560,7 +27768,7 @@ var SuccessPage = function SuccessPage(_ref2) {
27560
27768
  testID = _ref2.testID,
27561
27769
  ctaText = _ref2.ctaText,
27562
27770
  _ref2$onCtaPress = _ref2.onCtaPress,
27563
- onCtaPress = _ref2$onCtaPress === void 0 ? noop$2 : _ref2$onCtaPress,
27771
+ onCtaPress = _ref2$onCtaPress === void 0 ? noop$3 : _ref2$onCtaPress,
27564
27772
  secondaryCtaText = _ref2.secondaryCtaText,
27565
27773
  onSecondaryCtaPress = _ref2.onSecondaryCtaPress,
27566
27774
  icon = _ref2.icon,