@hero-design/rn 8.128.2 → 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
@@ -5008,7 +5008,7 @@ var swagLightGlobalPalette = _objectSpread2(_objectSpread2({}, globalPalette$1),
5008
5008
  });
5009
5009
 
5010
5010
  var ehWorkBrandSystemPalette = {
5011
- primary: '#7622d7',
5011
+ primary: '#460078',
5012
5012
  onPrimary: '#fdfbff',
5013
5013
  secondary: '#b382fd',
5014
5014
  onSecondary: palette$4.white,
@@ -5037,7 +5037,6 @@ var swagSystemPalette = _objectSpread2(_objectSpread2({}, ehWorkSystemPalette),
5037
5037
 
5038
5038
  var ehJobsSystemPalette = _objectSpread2(_objectSpread2({}, swagSystemPalette), {}, {
5039
5039
  name: 'ehJobs',
5040
- primary: '#7622d7',
5041
5040
  secondary: '#40d1ff',
5042
5041
  onSecondary: '#460078',
5043
5042
  secondaryHighlightedSurface: '#ecfaff',
@@ -8215,7 +8214,7 @@ var StyledText$4 = index$c(reactNative.Text)(function (_ref) {
8215
8214
  });
8216
8215
  });
8217
8216
 
8218
- var _excluded$O = ["children", "fontSize", "fontWeight", "intent", "typeface", "allowFontScaling"];
8217
+ var _excluded$P = ["children", "fontSize", "fontWeight", "intent", "typeface", "allowFontScaling"];
8219
8218
  /**
8220
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.
8221
8220
  */
@@ -8231,7 +8230,7 @@ var Text = function Text(_ref) {
8231
8230
  typeface = _ref$typeface === void 0 ? 'neutral' : _ref$typeface,
8232
8231
  _ref$allowFontScaling = _ref.allowFontScaling,
8233
8232
  allowFontScaling = _ref$allowFontScaling === void 0 ? false : _ref$allowFontScaling,
8234
- nativeProps = _objectWithoutProperties(_ref, _excluded$O);
8233
+ nativeProps = _objectWithoutProperties(_ref, _excluded$P);
8235
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.');
8236
8235
  return /*#__PURE__*/React__namespace.default.createElement(StyledText$4, _extends$1({}, nativeProps, {
8237
8236
  themeFontSize: fontSize,
@@ -8284,10 +8283,10 @@ var pickAccessibilityProps = function pickAccessibilityProps(props) {
8284
8283
  }, {});
8285
8284
  };
8286
8285
 
8287
- var _excluded$N = ["children"];
8286
+ var _excluded$O = ["children"];
8288
8287
  var GradientText = function GradientText(_ref) {
8289
8288
  var children = _ref.children,
8290
- accessibilityProps = _objectWithoutProperties(_ref, _excluded$N);
8289
+ accessibilityProps = _objectWithoutProperties(_ref, _excluded$O);
8291
8290
  var theme = useTheme();
8292
8291
  var gradient = theme.colors.gradients.aiDiagonal;
8293
8292
  var _useState = React.useState(null),
@@ -8343,7 +8342,7 @@ var GradientText = function GradientText(_ref) {
8343
8342
  }, children));
8344
8343
  };
8345
8344
 
8346
- var _excluded$M = ["children", "fontWeight", "intent", "allowFontScaling", "fontStyle", "style", "testID"];
8345
+ var _excluded$N = ["children", "fontWeight", "intent", "allowFontScaling", "fontStyle", "style", "testID"];
8347
8346
  var Caption = function Caption(_ref) {
8348
8347
  var children = _ref.children,
8349
8348
  _ref$fontWeight = _ref.fontWeight,
@@ -8356,7 +8355,7 @@ var Caption = function Caption(_ref) {
8356
8355
  fontStyle = _ref$fontStyle === void 0 ? 'normal' : _ref$fontStyle,
8357
8356
  style = _ref.style,
8358
8357
  testID = _ref.testID,
8359
- nativeProps = _objectWithoutProperties(_ref, _excluded$M);
8358
+ nativeProps = _objectWithoutProperties(_ref, _excluded$N);
8360
8359
  var isAi = intent === 'ai';
8361
8360
  var styledText = /*#__PURE__*/React__namespace.default.createElement(StyledCaption, _extends$1({}, nativeProps, {
8362
8361
  themeFontWeight: fontWeight,
@@ -8388,7 +8387,7 @@ var StyledLabel$1 = index$c(reactNative.Text)(function (_ref) {
8388
8387
  };
8389
8388
  });
8390
8389
 
8391
- var _excluded$L = ["children", "intent", "allowFontScaling", "fontStyle", "fontWeight", "style", "testID"];
8390
+ var _excluded$M = ["children", "intent", "allowFontScaling", "fontStyle", "fontWeight", "style", "testID"];
8392
8391
  var Label = function Label(_ref) {
8393
8392
  var children = _ref.children,
8394
8393
  _ref$intent = _ref.intent,
@@ -8401,7 +8400,7 @@ var Label = function Label(_ref) {
8401
8400
  fontWeight = _ref$fontWeight === void 0 ? 'regular' : _ref$fontWeight,
8402
8401
  style = _ref.style,
8403
8402
  testID = _ref.testID,
8404
- nativeProps = _objectWithoutProperties(_ref, _excluded$L);
8403
+ nativeProps = _objectWithoutProperties(_ref, _excluded$M);
8405
8404
  var isAi = intent === 'ai';
8406
8405
  var styledText = /*#__PURE__*/React__namespace.default.createElement(StyledLabel$1, _extends$1({}, nativeProps, {
8407
8406
  themeIntent: isAi ? 'body' : intent,
@@ -8432,7 +8431,7 @@ var StyledTitle$1 = index$c(reactNative.Text)(function (_ref) {
8432
8431
  };
8433
8432
  });
8434
8433
 
8435
- var _excluded$K = ["children", "intent", "allowFontScaling", "level", "typeface", "fontStyle", "style", "testID"];
8434
+ var _excluded$L = ["children", "intent", "allowFontScaling", "level", "typeface", "fontStyle", "style", "testID"];
8436
8435
  var Title = function Title(_ref) {
8437
8436
  var children = _ref.children,
8438
8437
  _ref$intent = _ref.intent,
@@ -8447,7 +8446,7 @@ var Title = function Title(_ref) {
8447
8446
  fontStyle = _ref$fontStyle === void 0 ? 'normal' : _ref$fontStyle,
8448
8447
  style = _ref.style,
8449
8448
  testID = _ref.testID,
8450
- nativeProps = _objectWithoutProperties(_ref, _excluded$K);
8449
+ nativeProps = _objectWithoutProperties(_ref, _excluded$L);
8451
8450
  var isAi = intent === 'ai';
8452
8451
  var styledText = /*#__PURE__*/React__namespace.default.createElement(StyledTitle$1, _extends$1({}, nativeProps, {
8453
8452
  themeLevel: level,
@@ -8497,7 +8496,7 @@ var StyledBody$2 = index$c(reactNative.Text)(function (_ref) {
8497
8496
  };
8498
8497
  });
8499
8498
 
8500
- var _excluded$J = ["children", "intent", "allowFontScaling", "typeface", "variant", "fontStyle", "style", "testID"];
8499
+ var _excluded$K = ["children", "intent", "allowFontScaling", "typeface", "variant", "fontStyle", "style", "testID"];
8501
8500
  var Body = function Body(_ref) {
8502
8501
  var children = _ref.children,
8503
8502
  _ref$intent = _ref.intent,
@@ -8512,7 +8511,7 @@ var Body = function Body(_ref) {
8512
8511
  fontStyle = _ref$fontStyle === void 0 ? 'normal' : _ref$fontStyle,
8513
8512
  style = _ref.style,
8514
8513
  testID = _ref.testID,
8515
- nativeProps = _objectWithoutProperties(_ref, _excluded$J);
8514
+ nativeProps = _objectWithoutProperties(_ref, _excluded$K);
8516
8515
  var isAi = intent === 'ai';
8517
8516
  var styledText = /*#__PURE__*/React__namespace.default.createElement(StyledBody$2, _extends$1({}, nativeProps, {
8518
8517
  themeTypeface: typeface,
@@ -9176,22 +9175,22 @@ var SpinWrapper = function SpinWrapper(_ref) {
9176
9175
  }, children);
9177
9176
  };
9178
9177
 
9179
- var _excluded$I = ["style"];
9178
+ var _excluded$J = ["style"];
9180
9179
  var AnimatedIcon = function AnimatedIcon(_ref) {
9181
9180
  var style = _ref.style,
9182
- otherProps = _objectWithoutProperties(_ref, _excluded$I);
9181
+ otherProps = _objectWithoutProperties(_ref, _excluded$J);
9183
9182
  return /*#__PURE__*/React__namespace.default.createElement(SpinWrapper, {
9184
9183
  style: style
9185
9184
  }, /*#__PURE__*/React__namespace.default.createElement(StyledHeroIcon, otherProps));
9186
9185
  };
9187
9186
 
9188
- var _excluded$H = ["name", "themeSize", "testID", "style"];
9187
+ var _excluded$I = ["name", "themeSize", "testID", "style"];
9189
9188
  var GradientIcon = function GradientIcon(_ref) {
9190
9189
  var name = _ref.name,
9191
9190
  themeSize = _ref.themeSize,
9192
9191
  testID = _ref.testID,
9193
9192
  style = _ref.style,
9194
- accessibilityProps = _objectWithoutProperties(_ref, _excluded$H);
9193
+ accessibilityProps = _objectWithoutProperties(_ref, _excluded$I);
9195
9194
  var theme = useTheme();
9196
9195
  var gradient = theme.colors.gradients.aiDiagonal;
9197
9196
  var size = theme.__hd__.icon.sizes[themeSize];
@@ -9319,7 +9318,7 @@ var AccordionItem = function AccordionItem(_ref) {
9319
9318
  }, content));
9320
9319
  };
9321
9320
 
9322
- var _excluded$G = ["key"];
9321
+ var _excluded$H = ["key"];
9323
9322
  var Accordion = function Accordion(_ref) {
9324
9323
  var items = _ref.items,
9325
9324
  activeItemKey = _ref.activeItemKey,
@@ -9342,7 +9341,7 @@ var Accordion = function Accordion(_ref) {
9342
9341
  accessible: accessible
9343
9342
  }, items.map(function (_ref2, index) {
9344
9343
  var key = _ref2.key,
9345
- props = _objectWithoutProperties(_ref2, _excluded$G);
9344
+ props = _objectWithoutProperties(_ref2, _excluded$H);
9346
9345
  var open = _activeItemKey === key;
9347
9346
  return /*#__PURE__*/React__namespace.default.createElement(React__namespace.default.Fragment, {
9348
9347
  key: key
@@ -10178,7 +10177,7 @@ var borderWidths = {
10178
10177
  var config = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, colors), space), radii), borderWidths);
10179
10178
  var flexPropsKey = ['alignContent', 'alignItems', 'alignSelf', 'display', 'flex', 'flexBasis', 'flexDirection', 'flexGrow', 'flexShrink', 'flexWrap', 'justifyContent'];
10180
10179
 
10181
- var _excluded$F = ["theme"];
10180
+ var _excluded$G = ["theme"];
10182
10181
  var getThemeValue = function getThemeValue(theme, key, props) {
10183
10182
  var propConfig = config[key];
10184
10183
  var propValue = props[key];
@@ -10205,18 +10204,18 @@ var mapStylePropToThemeValue = function mapStylePropToThemeValue(theme, props) {
10205
10204
  var configKeys = Object.keys(config);
10206
10205
  var StyledBox = index$c(reactNative.View)(function (_ref5) {
10207
10206
  var theme = _ref5.theme,
10208
- otherProps = _objectWithoutProperties(_ref5, _excluded$F);
10207
+ otherProps = _objectWithoutProperties(_ref5, _excluded$G);
10209
10208
  var styleProps = pick(configKeys, otherProps);
10210
10209
  var flexProps = pick(_toConsumableArray(flexPropsKey), otherProps);
10211
10210
  return _objectSpread2(_objectSpread2({}, mapStylePropToThemeValue(theme, styleProps)), flexProps);
10212
10211
  });
10213
10212
 
10214
- var _excluded$E = ["children", "style", "testID"];
10213
+ var _excluded$F = ["children", "style", "testID"];
10215
10214
  var Box = function Box(_ref) {
10216
10215
  var children = _ref.children,
10217
10216
  style = _ref.style,
10218
10217
  testID = _ref.testID,
10219
- otherProps = _objectWithoutProperties(_ref, _excluded$E);
10218
+ otherProps = _objectWithoutProperties(_ref, _excluded$F);
10220
10219
  return /*#__PURE__*/React__namespace.default.createElement(StyledBox, _extends$1({}, otherProps, {
10221
10220
  style: style,
10222
10221
  testID: testID
@@ -10487,7 +10486,7 @@ var StyledIcon$4 = index$c(Icon)(function (_ref6) {
10487
10486
  };
10488
10487
  });
10489
10488
 
10490
- var _excluded$D = ["children", "visible", "intent", "style", "testID"];
10489
+ var _excluded$E = ["children", "visible", "intent", "style", "testID"];
10491
10490
  var Status$1 = function Status(_ref) {
10492
10491
  var children = _ref.children,
10493
10492
  _ref$visible = _ref.visible,
@@ -10496,7 +10495,7 @@ var Status$1 = function Status(_ref) {
10496
10495
  intent = _ref$intent === void 0 ? 'danger' : _ref$intent,
10497
10496
  style = _ref.style,
10498
10497
  testID = _ref.testID,
10499
- nativeProps = _objectWithoutProperties(_ref, _excluded$D);
10498
+ nativeProps = _objectWithoutProperties(_ref, _excluded$E);
10500
10499
  var _React$useRef = React__namespace.default.useRef(new reactNative.Animated.Value(visible ? 1 : 0)),
10501
10500
  opacity = _React$useRef.current;
10502
10501
  var isFirstRendering = React__namespace.default.useRef(true);
@@ -10532,7 +10531,7 @@ var Status$1 = function Status(_ref) {
10532
10531
 
10533
10532
  var DEFAULT_MAX_NUMBER = 99;
10534
10533
 
10535
- var _excluded$C = ["children", "visible", "style", "max", "testID", "content"];
10534
+ var _excluded$D = ["children", "visible", "style", "max", "testID", "content"];
10536
10535
  var Status = function Status(_ref) {
10537
10536
  var children = _ref.children,
10538
10537
  _ref$visible = _ref.visible,
@@ -10542,7 +10541,7 @@ var Status = function Status(_ref) {
10542
10541
  max = _ref$max === void 0 ? DEFAULT_MAX_NUMBER : _ref$max,
10543
10542
  testID = _ref.testID,
10544
10543
  originalContent = _ref.content,
10545
- nativeProps = _objectWithoutProperties(_ref, _excluded$C);
10544
+ nativeProps = _objectWithoutProperties(_ref, _excluded$D);
10546
10545
  var content = React.useMemo(function () {
10547
10546
  return originalContent > max ? "".concat(max, "+") : String(originalContent);
10548
10547
  }, [originalContent, max]);
@@ -10554,7 +10553,7 @@ var Status = function Status(_ref) {
10554
10553
  }, /*#__PURE__*/React__namespace.default.createElement(StyledCountText, null, content)));
10555
10554
  };
10556
10555
 
10557
- 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"];
10558
10557
  var getPaddingState = function getPaddingState(content) {
10559
10558
  return content.length > 1 ? 'wideContent' : 'narrowContent';
10560
10559
  };
@@ -10573,7 +10572,7 @@ var Badge = function Badge(_ref) {
10573
10572
  _ref$variant = _ref.variant,
10574
10573
  variant = _ref$variant === void 0 ? 'filled' : _ref$variant,
10575
10574
  icon = _ref.icon,
10576
- nativeProps = _objectWithoutProperties(_ref, _excluded$B);
10575
+ nativeProps = _objectWithoutProperties(_ref, _excluded$C);
10577
10576
  var _React$useRef = React__namespace.default.useRef(new reactNative.Animated.Value(visible ? 1 : 0)),
10578
10577
  opacity = _React$useRef.current;
10579
10578
  var isFirstRendering = React__namespace.default.useRef(true);
@@ -10691,7 +10690,7 @@ var StyledBottomBarText = index$c(Typography.Label)(function (_ref4) {
10691
10690
  };
10692
10691
  });
10693
10692
 
10694
- var _excluded$A = ["onTabPress", "renderActiveTabOnly", "selectedTabKey", "tabs"];
10693
+ var _excluded$B = ["onTabPress", "renderActiveTabOnly", "selectedTabKey", "tabs"];
10695
10694
  var getInactiveIcon = function getInactiveIcon(icon) {
10696
10695
  var inactiveIcon = "".concat(icon, "-outlined");
10697
10696
  return isHeroIcon(inactiveIcon) ? inactiveIcon : icon;
@@ -10702,7 +10701,7 @@ var BottomNavigation = function BottomNavigation(_ref) {
10702
10701
  renderActiveTabOnly = _ref$renderActiveTabO === void 0 ? false : _ref$renderActiveTabO,
10703
10702
  selectedTabKey = _ref.selectedTabKey,
10704
10703
  tabs = _ref.tabs,
10705
- nativeProps = _objectWithoutProperties(_ref, _excluded$A);
10704
+ nativeProps = _objectWithoutProperties(_ref, _excluded$B);
10706
10705
  var insets = reactNativeSafeAreaContext.useSafeAreaInsets();
10707
10706
  /**
10708
10707
  * List of loaded tabs, tabs will be loaded when navigated to.
@@ -10794,13 +10793,13 @@ var StyledDivider = index$c(reactNative.View)(function (_ref) {
10794
10793
  }, horizontalMargin), verticalMargin);
10795
10794
  });
10796
10795
 
10797
- var _excluded$z = ["marginHorizontal", "marginVertical", "style", "testID"];
10796
+ var _excluded$A = ["marginHorizontal", "marginVertical", "style", "testID"];
10798
10797
  var Divider = function Divider(_ref) {
10799
10798
  var marginHorizontal = _ref.marginHorizontal,
10800
10799
  marginVertical = _ref.marginVertical,
10801
10800
  style = _ref.style,
10802
10801
  testID = _ref.testID,
10803
- nativeProps = _objectWithoutProperties(_ref, _excluded$z);
10802
+ nativeProps = _objectWithoutProperties(_ref, _excluded$A);
10804
10803
  return /*#__PURE__*/React__namespace.default.createElement(StyledDivider, _extends$1({}, nativeProps, {
10805
10804
  themeMarginHorizontal: marginHorizontal,
10806
10805
  themeMarginVertical: marginVertical,
@@ -10810,7 +10809,7 @@ var Divider = function Divider(_ref) {
10810
10809
  };
10811
10810
 
10812
10811
  var AnimatedPressable$1 = reactNative.Animated.createAnimatedComponent(reactNative.Pressable);
10813
- var AnimatedSafeAreaView = reactNative.Animated.createAnimatedComponent(reactNative.SafeAreaView);
10812
+ var AnimatedSafeAreaView = reactNative.Animated.createAnimatedComponent(reactNativeSafeAreaContext.SafeAreaView);
10814
10813
  var StyledWrapper$b = index$c(reactNative.View)(_objectSpread2(_objectSpread2({}, reactNative.StyleSheet.absoluteFillObject), {}, {
10815
10814
  flexDirection: 'column-reverse'
10816
10815
  }));
@@ -10902,7 +10901,7 @@ var Footer$1 = function Footer(_ref) {
10902
10901
  };
10903
10902
 
10904
10903
  // eslint-disable-next-line @typescript-eslint/no-empty-function
10905
- var noop$2 = function noop() {};
10904
+ var noop$3 = function noop() {};
10906
10905
 
10907
10906
  var StyledLoadingIndicatorWrapper = index$c(reactNative.View)({
10908
10907
  flexDirection: 'row',
@@ -10931,7 +10930,7 @@ var StyledLoadingDot = index$c(reactNative.View)(function (_ref) {
10931
10930
  }, themeStyling());
10932
10931
  });
10933
10932
 
10934
- var _excluded$y = ["count", "size", "testID", "themeVariant"];
10933
+ var _excluded$z = ["count", "size", "testID", "themeVariant"];
10935
10934
  var AnimatedLoadingIndicatorWrapper = reactNative.Animated.createAnimatedComponent(StyledLoadingIndicatorWrapper);
10936
10935
  var AnimatedLoadingDot = reactNative.Animated.createAnimatedComponent(StyledLoadingDot);
10937
10936
  var renderDotComponent = function renderDotComponent(_ref) {
@@ -10963,7 +10962,7 @@ var LoadingIndicator = function LoadingIndicator(_ref2) {
10963
10962
  size = _ref2$size === void 0 ? 12 : _ref2$size,
10964
10963
  testID = _ref2.testID,
10965
10964
  themeVariant = _ref2.themeVariant,
10966
- nativeProps = _objectWithoutProperties(_ref2, _excluded$y);
10965
+ nativeProps = _objectWithoutProperties(_ref2, _excluded$z);
10967
10966
  var progressAnimation = React.useRef(new reactNative.Animated.Value(0));
10968
10967
  React.useEffect(function () {
10969
10968
  var animation = reactNative.Animated.loop(reactNative.Animated.timing(progressAnimation.current, {
@@ -11567,7 +11566,7 @@ var Header = function Header(_ref) {
11567
11566
  var content = _ref.content,
11568
11567
  showDivider = _ref.showDivider,
11569
11568
  _ref$onRequestClose = _ref.onRequestClose,
11570
- onRequestClose = _ref$onRequestClose === void 0 ? noop$2 : _ref$onRequestClose,
11569
+ onRequestClose = _ref$onRequestClose === void 0 ? noop$3 : _ref$onRequestClose,
11571
11570
  showCloseButton = _ref.showCloseButton,
11572
11571
  _ref$variant = _ref.variant,
11573
11572
  variant = _ref$variant === void 0 ? 'fixed' : _ref$variant;
@@ -11595,11 +11594,11 @@ var Header = function Header(_ref) {
11595
11594
  }))) : null), showDivider ? /*#__PURE__*/React__namespace.default.createElement(Divider, null) : null);
11596
11595
  };
11597
11596
 
11598
- var _excluded$x = ["scrollEventThrottle"];
11597
+ var _excluded$y = ["scrollEventThrottle"];
11599
11598
  var BottomSheetScrollView = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
11600
11599
  var _ref$scrollEventThrot = _ref.scrollEventThrottle,
11601
11600
  scrollEventThrottle = _ref$scrollEventThrot === void 0 ? 100 : _ref$scrollEventThrot,
11602
- props = _objectWithoutProperties(_ref, _excluded$x);
11601
+ props = _objectWithoutProperties(_ref, _excluded$y);
11603
11602
  var _useContext = React.useContext(BottomSheetContext),
11604
11603
  setInternalShowDivider = _useContext.setInternalShowDivider;
11605
11604
  var onScrollBeginDrag = React.useCallback(function (e) {
@@ -14213,7 +14212,7 @@ var setStartOrEndDate = function setStartOrEndDate(_ref2) {
14213
14212
  };
14214
14213
  };
14215
14214
  var shouldUseMonthPicker = function shouldUseMonthPicker(onMonthChange) {
14216
- return onMonthChange !== noop$2;
14215
+ return onMonthChange !== noop$3;
14217
14216
  };
14218
14217
  var getCalendarDate = function getCalendarDate(_ref3) {
14219
14218
  var visibleDate = _ref3.visibleDate,
@@ -14349,20 +14348,20 @@ var CalendarRange = function CalendarRange(_ref) {
14349
14348
  visibleDate = _ref.visibleDate,
14350
14349
  onChange = _ref.onChange,
14351
14350
  _ref$onPreviousPress = _ref.onPreviousPress,
14352
- onPreviousPress = _ref$onPreviousPress === void 0 ? noop$2 : _ref$onPreviousPress,
14351
+ onPreviousPress = _ref$onPreviousPress === void 0 ? noop$3 : _ref$onPreviousPress,
14353
14352
  _ref$onNextPress = _ref.onNextPress,
14354
- onNextPress = _ref$onNextPress === void 0 ? noop$2 : _ref$onNextPress,
14353
+ onNextPress = _ref$onNextPress === void 0 ? noop$3 : _ref$onNextPress,
14355
14354
  _ref$onTitlePress = _ref.onTitlePress,
14356
- onTitlePress = _ref$onTitlePress === void 0 ? noop$2 : _ref$onTitlePress,
14355
+ onTitlePress = _ref$onTitlePress === void 0 ? noop$3 : _ref$onTitlePress,
14357
14356
  minDate = _ref.minDate,
14358
14357
  maxDate = _ref.maxDate,
14359
14358
  _ref$markedDates = _ref.markedDates,
14360
14359
  markedDates = _ref$markedDates === void 0 ? [] : _ref$markedDates,
14361
14360
  testID = _ref.testID,
14362
14361
  _ref$onMonthChange = _ref.onMonthChange,
14363
- onMonthChange = _ref$onMonthChange === void 0 ? noop$2 : _ref$onMonthChange,
14362
+ onMonthChange = _ref$onMonthChange === void 0 ? noop$3 : _ref$onMonthChange,
14364
14363
  _ref$onToggleMonthPic = _ref.onToggleMonthPicker,
14365
- onToggleMonthPicker = _ref$onToggleMonthPic === void 0 ? noop$2 : _ref$onToggleMonthPic,
14364
+ onToggleMonthPicker = _ref$onToggleMonthPic === void 0 ? noop$3 : _ref$onToggleMonthPic,
14366
14365
  monthPickerConfirmLabel = _ref.monthPickerConfirmLabel,
14367
14366
  monthPickerCancelLabel = _ref.monthPickerCancelLabel;
14368
14367
  var theme = useTheme();
@@ -14530,20 +14529,20 @@ var Calendar = function Calendar(_ref) {
14530
14529
  visibleDate = _ref.visibleDate,
14531
14530
  onChange = _ref.onChange,
14532
14531
  _ref$onPreviousPress = _ref.onPreviousPress,
14533
- onPreviousPress = _ref$onPreviousPress === void 0 ? noop$2 : _ref$onPreviousPress,
14532
+ onPreviousPress = _ref$onPreviousPress === void 0 ? noop$3 : _ref$onPreviousPress,
14534
14533
  _ref$onNextPress = _ref.onNextPress,
14535
- onNextPress = _ref$onNextPress === void 0 ? noop$2 : _ref$onNextPress,
14534
+ onNextPress = _ref$onNextPress === void 0 ? noop$3 : _ref$onNextPress,
14536
14535
  _ref$onTitlePress = _ref.onTitlePress,
14537
- onTitlePress = _ref$onTitlePress === void 0 ? noop$2 : _ref$onTitlePress,
14536
+ onTitlePress = _ref$onTitlePress === void 0 ? noop$3 : _ref$onTitlePress,
14538
14537
  minDate = _ref.minDate,
14539
14538
  maxDate = _ref.maxDate,
14540
14539
  _ref$markedDates = _ref.markedDates,
14541
14540
  markedDates = _ref$markedDates === void 0 ? [] : _ref$markedDates,
14542
14541
  testID = _ref.testID,
14543
14542
  _ref$onMonthChange = _ref.onMonthChange,
14544
- onMonthChange = _ref$onMonthChange === void 0 ? noop$2 : _ref$onMonthChange,
14543
+ onMonthChange = _ref$onMonthChange === void 0 ? noop$3 : _ref$onMonthChange,
14545
14544
  _ref$onToggleMonthPic = _ref.onToggleMonthPicker,
14546
- onToggleMonthPicker = _ref$onToggleMonthPic === void 0 ? noop$2 : _ref$onToggleMonthPic,
14545
+ onToggleMonthPicker = _ref$onToggleMonthPic === void 0 ? noop$3 : _ref$onToggleMonthPic,
14547
14546
  monthPickerConfirmLabel = _ref.monthPickerConfirmLabel,
14548
14547
  monthPickerCancelLabel = _ref.monthPickerCancelLabel;
14549
14548
  var theme = useTheme();
@@ -14721,12 +14720,12 @@ var Indicator = index$c(reactNative.View)(function (_ref3) {
14721
14720
  };
14722
14721
  });
14723
14722
 
14724
- var _excluded$w = ["intent", "children"];
14723
+ var _excluded$x = ["intent", "children"];
14725
14724
  var DataCard = function DataCard(_ref) {
14726
14725
  var _ref$intent = _ref.intent,
14727
14726
  intent = _ref$intent === void 0 ? 'info' : _ref$intent,
14728
14727
  children = _ref.children,
14729
- nativeProps = _objectWithoutProperties(_ref, _excluded$w);
14728
+ nativeProps = _objectWithoutProperties(_ref, _excluded$x);
14730
14729
  return /*#__PURE__*/React__namespace.default.createElement(StyledDataCard, nativeProps, /*#__PURE__*/React__namespace.default.createElement(Indicator, {
14731
14730
  themeIntent: intent,
14732
14731
  testID: "data-card-indicator"
@@ -14745,13 +14744,13 @@ var StyledCard$1 = index$c(reactNative.View)(function (_ref) {
14745
14744
  });
14746
14745
  });
14747
14746
 
14748
- var _excluded$v = ["intent", "children", "variant"];
14747
+ var _excluded$w = ["intent", "children", "variant"];
14749
14748
  var Card = function Card(_ref) {
14750
14749
  var intent = _ref.intent,
14751
14750
  children = _ref.children,
14752
14751
  _ref$variant = _ref.variant,
14753
14752
  variant = _ref$variant === void 0 ? 'basic' : _ref$variant,
14754
- nativeProps = _objectWithoutProperties(_ref, _excluded$v);
14753
+ nativeProps = _objectWithoutProperties(_ref, _excluded$w);
14755
14754
  return /*#__PURE__*/React__namespace.default.createElement(StyledCard$1, _extends$1({}, nativeProps, {
14756
14755
  themeIntent: intent,
14757
14756
  themeVariant: variant
@@ -15018,7 +15017,7 @@ var CardCarousel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
15018
15017
  });
15019
15018
  CardCarousel.displayName = 'CardCarousel';
15020
15019
 
15021
- var _excluded$u = ["rounded", "size", "testID", "style"];
15020
+ var _excluded$v = ["rounded", "size", "testID", "style"];
15022
15021
  /**
15023
15022
  * @deprecated Image component will soon be deprecated. Please use `Image` from `react-native` instead.
15024
15023
  */
@@ -15029,7 +15028,7 @@ var Image = function Image(_ref) {
15029
15028
  size = _ref$size === void 0 ? '6xlarge' : _ref$size,
15030
15029
  testID = _ref.testID,
15031
15030
  style = _ref.style,
15032
- imageNativeProps = _objectWithoutProperties(_ref, _excluded$u);
15031
+ imageNativeProps = _objectWithoutProperties(_ref, _excluded$v);
15033
15032
  useDeprecation('Image component will soon be deprecated. Please use `Image` from `react-native` instead.');
15034
15033
  var theme = useTheme();
15035
15034
  var imageSize = theme.__hd__.image.sizes[size];
@@ -15164,7 +15163,7 @@ var CarouselItem = function CarouselItem(_ref) {
15164
15163
  }, heading), !!body && /*#__PURE__*/React__namespace.default.createElement(Typography.Body, null, body)));
15165
15164
  };
15166
15165
 
15167
- var _excluded$t = ["items", "onItemIndexChange", "renderActions", "selectedItemIndex", "style", "shouldShowPagination", "testID", "pageControlPosition"];
15166
+ var _excluded$u = ["items", "onItemIndexChange", "renderActions", "selectedItemIndex", "style", "shouldShowPagination", "testID", "pageControlPosition"];
15168
15167
  function useStateFromProp(initialValue) {
15169
15168
  var _useState = React.useState(initialValue),
15170
15169
  _useState2 = _slicedToArray(_useState, 2),
@@ -15175,7 +15174,7 @@ function useStateFromProp(initialValue) {
15175
15174
  }, [initialValue]);
15176
15175
  return [value, setValue];
15177
15176
  }
15178
- var noop$1 = function noop(_) {
15177
+ var noop$2 = function noop(_) {
15179
15178
  return true;
15180
15179
  };
15181
15180
  var Carousel = function Carousel(_ref) {
@@ -15187,12 +15186,12 @@ var Carousel = function Carousel(_ref) {
15187
15186
  selectedItemIndex = _ref$selectedItemInde === void 0 ? 0 : _ref$selectedItemInde,
15188
15187
  style = _ref.style,
15189
15188
  _ref$shouldShowPagina = _ref.shouldShowPagination,
15190
- shouldShowPagination = _ref$shouldShowPagina === void 0 ? noop$1 : _ref$shouldShowPagina,
15189
+ shouldShowPagination = _ref$shouldShowPagina === void 0 ? noop$2 : _ref$shouldShowPagina,
15191
15190
  testID = _ref.testID,
15192
15191
  _ref$pageControlPosit = _ref.pageControlPosition,
15193
15192
  pageControlPosition = _ref$pageControlPosit === void 0 ? 'top' : _ref$pageControlPosit,
15194
- nativeProps = _objectWithoutProperties(_ref, _excluded$t);
15195
- 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);
15196
15195
  useDeprecation("The use of 'pageControlPosition == bottom' has been deprecated", pageControlPosition === 'bottom');
15197
15196
  var theme = useTheme();
15198
15197
  var carouselRef = React.useRef(null);
@@ -15913,7 +15912,7 @@ function range(start, stop, step) {
15913
15912
  return range;
15914
15913
  }
15915
15914
 
15916
- var noop = {
15915
+ var noop$1 = {
15917
15916
  value: function value() {}
15918
15917
  };
15919
15918
  function dispatch() {
@@ -15987,7 +15986,7 @@ function get$1(type, name) {
15987
15986
  function set$1(type, name, callback) {
15988
15987
  for (var i = 0, n = type.length; i < n; ++i) {
15989
15988
  if (type[i].name === name) {
15990
- 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));
15991
15990
  break;
15992
15991
  }
15993
15992
  }
@@ -20462,7 +20461,7 @@ var StyledChipIcon = index$c(Icon)(function (_ref2) {
20462
20461
  };
20463
20462
  });
20464
20463
 
20465
- 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"];
20466
20465
  var getChipLabel = function getChipLabel(label) {
20467
20466
  if (typeof label === 'string') {
20468
20467
  return /*#__PURE__*/React__namespace.default.createElement(Typography.Body, {
@@ -20498,7 +20497,7 @@ var Chip = function Chip(_ref) {
20498
20497
  accessible = _ref.accessible,
20499
20498
  onBlur = _ref.onBlur,
20500
20499
  onFocus = _ref.onFocus,
20501
- otherProps = _objectWithoutProperties(_ref, _excluded$s);
20500
+ otherProps = _objectWithoutProperties(_ref, _excluded$t);
20502
20501
  useDeprecation('Chip variant `outlined` and `filled` are deprecated.', variant === 'outlined' || variant === 'filled');
20503
20502
  var renamedVariant = getChipVariant(variant);
20504
20503
  var shouldShowSelectedIcon = (renamedVariant === 'selection' || renamedVariant === 'compact-outlined') && selected && showSelectedIcon;
@@ -20889,7 +20888,7 @@ var StyledErrorAndMaxLengthContainer = index$c(reactNative.View)(function (_ref1
20889
20888
  };
20890
20889
  });
20891
20890
 
20892
- 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"];
20893
20892
  var getState$3 = function getState(_ref) {
20894
20893
  var disabled = _ref.disabled,
20895
20894
  error = _ref.error,
@@ -21005,7 +21004,7 @@ var TextInput = /*#__PURE__*/React.forwardRef(function (_ref8, ref) {
21005
21004
  allowFontScaling = _ref8$allowFontScalin === void 0 ? false : _ref8$allowFontScalin,
21006
21005
  _ref8$variant = _ref8.variant,
21007
21006
  variant = _ref8$variant === void 0 ? 'text' : _ref8$variant,
21008
- nativeProps = _objectWithoutProperties(_ref8, _excluded$r);
21007
+ nativeProps = _objectWithoutProperties(_ref8, _excluded$s);
21009
21008
  var displayText = getDisplayText(value, defaultValue);
21010
21009
  var isEmptyValue = displayText.length === 0;
21011
21010
  var _React$useState = React__namespace.default.useState(0),
@@ -21752,11 +21751,11 @@ var DatePickerIOS = function DatePickerIOS(_ref) {
21752
21751
  }));
21753
21752
  };
21754
21753
 
21755
- var _excluded$q = ["variant"];
21754
+ var _excluded$r = ["variant"];
21756
21755
  var DatePicker = function DatePicker(_ref) {
21757
21756
  var _ref$variant = _ref.variant,
21758
21757
  variant = _ref$variant === void 0 ? 'default' : _ref$variant,
21759
- props = _objectWithoutProperties(_ref, _excluded$q);
21758
+ props = _objectWithoutProperties(_ref, _excluded$r);
21760
21759
  if (variant === 'calendar') {
21761
21760
  return /*#__PURE__*/React__namespace.default.createElement(DatePickerCalendar, props);
21762
21761
  }
@@ -21837,7 +21836,7 @@ var StyledDragableDrawerContainer = index$c(reactNative.Animated.View)(function
21837
21836
  backgroundColor: theme.__hd__.drawer.colors.background,
21838
21837
  elevation: enableShadow ? theme.__hd__.drawer.shadows.elevation : undefined,
21839
21838
  overflow: 'hidden',
21840
- maxHeight: '100%'
21839
+ height: '100%'
21841
21840
  };
21842
21841
  });
21843
21842
  var StyledHandlerContainer$1 = index$c(reactNative.View)(function (_ref6) {
@@ -21858,6 +21857,23 @@ var StyledHandler = index$c(reactNative.View)(function (_ref7) {
21858
21857
  };
21859
21858
  });
21860
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
+
21861
21877
  var getOffset = function getOffset(height, percentage) {
21862
21878
  if (percentage < 0) return height;
21863
21879
  if (percentage > 100) return 0;
@@ -21886,34 +21902,39 @@ var calculateAnimatedToValue = function calculateAnimatedToValue(position, heigh
21886
21902
  return heightSnapPoints[minIndex];
21887
21903
  };
21888
21904
 
21889
- var DragableDrawer = function DragableDrawer(_ref) {
21890
- 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,
21891
21910
  initialHeightPercentage = _ref.initialHeightPercentage,
21892
- _ref$minimumHeightPer = _ref.minimumHeightPercentage,
21893
- minimumHeightPercentage = _ref$minimumHeightPer === void 0 ? 10 : _ref$minimumHeightPer,
21894
- _ref$snapPoints = _ref.snapPoints,
21895
- snapPoints = _ref$snapPoints === void 0 ? [] : _ref$snapPoints,
21911
+ minimumHeightPercentage = _ref.minimumHeightPercentage,
21912
+ snapPoints = _ref.snapPoints,
21896
21913
  onExpanded = _ref.onExpanded,
21897
- onCollapsed = _ref.onCollapsed,
21898
- testID = _ref.testID;
21899
- var _useState = React.useState(0),
21900
- _useState2 = _slicedToArray(_useState, 2),
21901
- height = _useState2[0],
21902
- setHeight = _useState2[1];
21914
+ onCollapsed = _ref.onCollapsed;
21903
21915
  var baseHeightForMeasure = React.useRef(0);
21904
21916
  var snapPointsData = React.useRef({
21905
21917
  list: [],
21906
21918
  minHeightOffset: 0,
21907
21919
  maxHeightOffset: 0
21908
21920
  });
21909
- // Track drag
21910
21921
  var pan = React.useRef(new reactNative.Animated.Value(0)).current;
21911
21922
  var offset = React.useRef(0);
21912
21923
  var offsetBeforePan = React.useRef(0);
21913
- 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),
21914
21929
  _useState4 = _slicedToArray(_useState3, 2),
21915
- animatedToValue = _useState4[0],
21916
- 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
+ }, []);
21917
21938
  React.useEffect(function () {
21918
21939
  var id = pan.addListener(function (_ref2) {
21919
21940
  var value = _ref2.value;
@@ -21928,13 +21949,12 @@ var DragableDrawer = function DragableDrawer(_ref) {
21928
21949
  var initialOffset = getOffset(height, initialHeightPercentage || minimumHeightPercentage);
21929
21950
  setAnimatedToValue(initialOffset);
21930
21951
  }
21931
- }, [height]);
21952
+ }, [height, initialHeightPercentage, minimumHeightPercentage]);
21932
21953
  React.useEffect(function () {
21933
21954
  if (height > 0) {
21934
21955
  pan.setValue(height);
21935
21956
  offset.current = height;
21936
21957
  baseHeightForMeasure.current = height;
21937
- // Calculate snap points information
21938
21958
  snapPointsData.current = calculateSnapPointsData(minimumHeightPercentage, height, snapPoints);
21939
21959
  }
21940
21960
  }, [height, minimumHeightPercentage]);
@@ -21945,11 +21965,18 @@ var DragableDrawer = function DragableDrawer(_ref) {
21945
21965
  useNativeDriver: reactNative.Platform.OS !== 'web',
21946
21966
  easing: reactNative.Easing.inOut(reactNative.Easing.cubic)
21947
21967
  });
21948
- animation.start(function () {
21949
- if (animatedToValue === 0) {
21950
- onExpanded === null || onExpanded === void 0 || onExpanded();
21951
- } else if (animatedToValue === getOffset(height, minimumHeightPercentage)) {
21952
- 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
+ }
21953
21980
  }
21954
21981
  setAnimatedToValue(-1);
21955
21982
  });
@@ -21957,41 +21984,130 @@ var DragableDrawer = function DragableDrawer(_ref) {
21957
21984
  return animation.stop();
21958
21985
  };
21959
21986
  }
21960
- }, [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
+ }, []);
21961
22042
  var panResponder = React.useRef(reactNative.PanResponder.create({
21962
22043
  onMoveShouldSetPanResponder: function onMoveShouldSetPanResponder() {
21963
22044
  return true;
21964
22045
  },
21965
22046
  onPanResponderGrant: function onPanResponderGrant() {
21966
- offsetBeforePan.current = offset.current;
21967
- pan.setOffset(offset.current);
21968
- pan.setValue(0);
22047
+ return beginPan();
21969
22048
  },
21970
22049
  onPanResponderMove: function onPanResponderMove(_, gesture) {
21971
- var _snapPointsData$curre;
21972
- var panDistance = gesture.dy;
21973
- // Moving toward top, stop at highest snap point
21974
- if (offsetBeforePan.current + panDistance < 0) {
21975
- pan.setValue(-offsetBeforePan.current);
21976
- return;
21977
- }
21978
- // Moving toward bottom, stop at lowest snap point
21979
- if (offsetBeforePan.current + panDistance > ((_snapPointsData$curre = snapPointsData.current) === null || _snapPointsData$curre === void 0 ? void 0 : _snapPointsData$curre.minHeightOffset)) {
21980
- pan.setValue(baseHeightForMeasure.current - baseHeightForMeasure.current * (minimumHeightPercentage / 100) - offsetBeforePan.current);
21981
- return;
21982
- }
21983
- pan.setValue(panDistance);
22050
+ return movePan(gesture.dy);
21984
22051
  },
21985
22052
  onPanResponderRelease: function onPanResponderRelease(_, gesture) {
21986
- pan.flattenOffset();
21987
- // Attach to nearest snappoint
21988
- var panDistance = gesture.dy;
21989
- var offsetAfterPan = offsetBeforePan.current + panDistance;
21990
- var animatedValue = calculateAnimatedToValue(offsetAfterPan, snapPointsData.current.list);
21991
- setAnimatedToValue(animatedValue);
22053
+ return releasePan(gesture.dy, gesture.vy);
21992
22054
  }
21993
22055
  })).current;
21994
- 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, {
21995
22111
  testID: testID,
21996
22112
  enableShadow: true,
21997
22113
  pointerEvents: "box-none"
@@ -21999,16 +22115,106 @@ var DragableDrawer = function DragableDrawer(_ref) {
21999
22115
  enableShadow: true,
22000
22116
  style: {
22001
22117
  transform: [{
22002
- scaleY: baseHeightForMeasure.current > 0 ? 1 : 0
22118
+ scaleY: height > 0 ? 1 : 0
22003
22119
  }, {
22004
22120
  translateY: pan
22005
22121
  }]
22006
22122
  },
22007
- onLayout: function onLayout(_ref3) {
22008
- var nativeEvent = _ref3.nativeEvent;
22123
+ onLayout: function onLayout(_ref2) {
22124
+ var nativeEvent = _ref2.nativeEvent;
22009
22125
  setHeight(nativeEvent.layout.height);
22010
22126
  }
22011
- }, /*#__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));
22012
22218
  };
22013
22219
 
22014
22220
  var BACKDROP_OPACITY = 0.56;
@@ -22069,7 +22275,8 @@ var Drawer = function Drawer(_ref) {
22069
22275
  }, children));
22070
22276
  };
22071
22277
  var index$7 = Object.assign(Drawer, {
22072
- Dragable: DragableDrawer
22278
+ Dragable: DragableDrawer,
22279
+ DragableScrollView: DragableScrollView
22073
22280
  });
22074
22281
 
22075
22282
  var DEFAULT_ILLUSTRATION_SIZE = scale(72);
@@ -24194,7 +24401,7 @@ var FABWithTitleStyle = /*#__PURE__*/React.forwardRef(function (_ref3, ref) {
24194
24401
  return {
24195
24402
  show: function show() {
24196
24403
  var animated = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
24197
- 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;
24198
24405
  setDisplayState({
24199
24406
  hideButton: false,
24200
24407
  hideTitle: false
@@ -24215,7 +24422,7 @@ var FABWithTitleStyle = /*#__PURE__*/React.forwardRef(function (_ref3, ref) {
24215
24422
  },
24216
24423
  collapse: function collapse() {
24217
24424
  var animated = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
24218
- 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;
24219
24426
  setDisplayState({
24220
24427
  hideButton: false,
24221
24428
  hideTitle: true
@@ -24236,7 +24443,7 @@ var FABWithTitleStyle = /*#__PURE__*/React.forwardRef(function (_ref3, ref) {
24236
24443
  },
24237
24444
  hide: function hide() {
24238
24445
  var animated = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
24239
- 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;
24240
24447
  if (animated) {
24241
24448
  reactNative.Animated.stagger(20, [reactNative.Animated.spring(animatedValues.opacity, {
24242
24449
  toValue: 0,
@@ -27561,7 +27768,7 @@ var SuccessPage = function SuccessPage(_ref2) {
27561
27768
  testID = _ref2.testID,
27562
27769
  ctaText = _ref2.ctaText,
27563
27770
  _ref2$onCtaPress = _ref2.onCtaPress,
27564
- onCtaPress = _ref2$onCtaPress === void 0 ? noop$2 : _ref2$onCtaPress,
27771
+ onCtaPress = _ref2$onCtaPress === void 0 ? noop$3 : _ref2$onCtaPress,
27565
27772
  secondaryCtaText = _ref2.secondaryCtaText,
27566
27773
  onSecondaryCtaPress = _ref2.onSecondaryCtaPress,
27567
27774
  icon = _ref2.icon,