@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/es/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import * as reactNative from 'react-native';
2
- import { StyleSheet as StyleSheet$1, Platform, Dimensions, Keyboard, Animated, View, UIManager, LayoutAnimation, TouchableOpacity, Text as Text$1, Easing, useWindowDimensions, TouchableWithoutFeedback, Modal as Modal$1, Image as Image$1, Pressable, SafeAreaView, KeyboardAvoidingView, TouchableHighlight, ScrollView, FlatList, TextInput as TextInput$1, PanResponder, BackHandler, InteractionManager, SectionList, RefreshControl as RefreshControl$1 } from 'react-native';
2
+ import { StyleSheet as StyleSheet$1, Platform, Dimensions, Keyboard, Animated, View, UIManager, LayoutAnimation, TouchableOpacity, Text as Text$1, Easing, useWindowDimensions, TouchableWithoutFeedback, Modal as Modal$1, Image as Image$1, Pressable, KeyboardAvoidingView, TouchableHighlight, ScrollView, FlatList, TextInput as TextInput$1, PanResponder, BackHandler, InteractionManager, SectionList, RefreshControl as RefreshControl$1 } from 'react-native';
3
3
  import * as React from 'react';
4
4
  import React__default, { useState, useEffect, useMemo, useCallback, useRef, useLayoutEffect, createContext, forwardRef, useContext, memo, useReducer, isValidElement, useImperativeHandle } from 'react';
5
5
  import MaskedView from '@react-native-masked-view/masked-view';
6
6
  import { LinearGradient } from 'expo-linear-gradient';
7
7
  import { createIconSet } from 'react-native-vector-icons';
8
- import { useSafeAreaInsets } from 'react-native-safe-area-context';
8
+ import { useSafeAreaInsets, SafeAreaView } from 'react-native-safe-area-context';
9
9
  import { MonthYearPickerViewIOS, MonthYearPickerDialogueAndroid } from '@hero-design/react-native-month-year-picker';
10
10
  import Svg, { G, ForeignObject, Line as Line$1, Path as Path$1, Rect, Mask, Circle as Circle$1, Defs, ClipPath } from 'react-native-svg';
11
11
  import DateTimePicker from '@react-native-community/datetimepicker';
@@ -8184,7 +8184,7 @@ var StyledText$4 = index$c(Text$1)(function (_ref) {
8184
8184
  });
8185
8185
  });
8186
8186
 
8187
- var _excluded$O = ["children", "fontSize", "fontWeight", "intent", "typeface", "allowFontScaling"];
8187
+ var _excluded$P = ["children", "fontSize", "fontWeight", "intent", "typeface", "allowFontScaling"];
8188
8188
  /**
8189
8189
  * @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.
8190
8190
  */
@@ -8200,7 +8200,7 @@ var Text = function Text(_ref) {
8200
8200
  typeface = _ref$typeface === void 0 ? 'neutral' : _ref$typeface,
8201
8201
  _ref$allowFontScaling = _ref.allowFontScaling,
8202
8202
  allowFontScaling = _ref$allowFontScaling === void 0 ? false : _ref$allowFontScaling,
8203
- nativeProps = _objectWithoutProperties(_ref, _excluded$O);
8203
+ nativeProps = _objectWithoutProperties(_ref, _excluded$P);
8204
8204
  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.');
8205
8205
  return /*#__PURE__*/React__default.createElement(StyledText$4, _extends$1({}, nativeProps, {
8206
8206
  themeFontSize: fontSize,
@@ -8253,10 +8253,10 @@ var pickAccessibilityProps = function pickAccessibilityProps(props) {
8253
8253
  }, {});
8254
8254
  };
8255
8255
 
8256
- var _excluded$N = ["children"];
8256
+ var _excluded$O = ["children"];
8257
8257
  var GradientText = function GradientText(_ref) {
8258
8258
  var children = _ref.children,
8259
- accessibilityProps = _objectWithoutProperties(_ref, _excluded$N);
8259
+ accessibilityProps = _objectWithoutProperties(_ref, _excluded$O);
8260
8260
  var theme = useTheme();
8261
8261
  var gradient = theme.colors.gradients.aiDiagonal;
8262
8262
  var _useState = useState(null),
@@ -8312,7 +8312,7 @@ var GradientText = function GradientText(_ref) {
8312
8312
  }, children));
8313
8313
  };
8314
8314
 
8315
- var _excluded$M = ["children", "fontWeight", "intent", "allowFontScaling", "fontStyle", "style", "testID"];
8315
+ var _excluded$N = ["children", "fontWeight", "intent", "allowFontScaling", "fontStyle", "style", "testID"];
8316
8316
  var Caption = function Caption(_ref) {
8317
8317
  var children = _ref.children,
8318
8318
  _ref$fontWeight = _ref.fontWeight,
@@ -8325,7 +8325,7 @@ var Caption = function Caption(_ref) {
8325
8325
  fontStyle = _ref$fontStyle === void 0 ? 'normal' : _ref$fontStyle,
8326
8326
  style = _ref.style,
8327
8327
  testID = _ref.testID,
8328
- nativeProps = _objectWithoutProperties(_ref, _excluded$M);
8328
+ nativeProps = _objectWithoutProperties(_ref, _excluded$N);
8329
8329
  var isAi = intent === 'ai';
8330
8330
  var styledText = /*#__PURE__*/React__default.createElement(StyledCaption, _extends$1({}, nativeProps, {
8331
8331
  themeFontWeight: fontWeight,
@@ -8357,7 +8357,7 @@ var StyledLabel$1 = index$c(Text$1)(function (_ref) {
8357
8357
  };
8358
8358
  });
8359
8359
 
8360
- var _excluded$L = ["children", "intent", "allowFontScaling", "fontStyle", "fontWeight", "style", "testID"];
8360
+ var _excluded$M = ["children", "intent", "allowFontScaling", "fontStyle", "fontWeight", "style", "testID"];
8361
8361
  var Label = function Label(_ref) {
8362
8362
  var children = _ref.children,
8363
8363
  _ref$intent = _ref.intent,
@@ -8370,7 +8370,7 @@ var Label = function Label(_ref) {
8370
8370
  fontWeight = _ref$fontWeight === void 0 ? 'regular' : _ref$fontWeight,
8371
8371
  style = _ref.style,
8372
8372
  testID = _ref.testID,
8373
- nativeProps = _objectWithoutProperties(_ref, _excluded$L);
8373
+ nativeProps = _objectWithoutProperties(_ref, _excluded$M);
8374
8374
  var isAi = intent === 'ai';
8375
8375
  var styledText = /*#__PURE__*/React__default.createElement(StyledLabel$1, _extends$1({}, nativeProps, {
8376
8376
  themeIntent: isAi ? 'body' : intent,
@@ -8401,7 +8401,7 @@ var StyledTitle$1 = index$c(Text$1)(function (_ref) {
8401
8401
  };
8402
8402
  });
8403
8403
 
8404
- var _excluded$K = ["children", "intent", "allowFontScaling", "level", "typeface", "fontStyle", "style", "testID"];
8404
+ var _excluded$L = ["children", "intent", "allowFontScaling", "level", "typeface", "fontStyle", "style", "testID"];
8405
8405
  var Title = function Title(_ref) {
8406
8406
  var children = _ref.children,
8407
8407
  _ref$intent = _ref.intent,
@@ -8416,7 +8416,7 @@ var Title = function Title(_ref) {
8416
8416
  fontStyle = _ref$fontStyle === void 0 ? 'normal' : _ref$fontStyle,
8417
8417
  style = _ref.style,
8418
8418
  testID = _ref.testID,
8419
- nativeProps = _objectWithoutProperties(_ref, _excluded$K);
8419
+ nativeProps = _objectWithoutProperties(_ref, _excluded$L);
8420
8420
  var isAi = intent === 'ai';
8421
8421
  var styledText = /*#__PURE__*/React__default.createElement(StyledTitle$1, _extends$1({}, nativeProps, {
8422
8422
  themeLevel: level,
@@ -8466,7 +8466,7 @@ var StyledBody$2 = index$c(Text$1)(function (_ref) {
8466
8466
  };
8467
8467
  });
8468
8468
 
8469
- var _excluded$J = ["children", "intent", "allowFontScaling", "typeface", "variant", "fontStyle", "style", "testID"];
8469
+ var _excluded$K = ["children", "intent", "allowFontScaling", "typeface", "variant", "fontStyle", "style", "testID"];
8470
8470
  var Body = function Body(_ref) {
8471
8471
  var children = _ref.children,
8472
8472
  _ref$intent = _ref.intent,
@@ -8481,7 +8481,7 @@ var Body = function Body(_ref) {
8481
8481
  fontStyle = _ref$fontStyle === void 0 ? 'normal' : _ref$fontStyle,
8482
8482
  style = _ref.style,
8483
8483
  testID = _ref.testID,
8484
- nativeProps = _objectWithoutProperties(_ref, _excluded$J);
8484
+ nativeProps = _objectWithoutProperties(_ref, _excluded$K);
8485
8485
  var isAi = intent === 'ai';
8486
8486
  var styledText = /*#__PURE__*/React__default.createElement(StyledBody$2, _extends$1({}, nativeProps, {
8487
8487
  themeTypeface: typeface,
@@ -9145,22 +9145,22 @@ var SpinWrapper = function SpinWrapper(_ref) {
9145
9145
  }, children);
9146
9146
  };
9147
9147
 
9148
- var _excluded$I = ["style"];
9148
+ var _excluded$J = ["style"];
9149
9149
  var AnimatedIcon = function AnimatedIcon(_ref) {
9150
9150
  var style = _ref.style,
9151
- otherProps = _objectWithoutProperties(_ref, _excluded$I);
9151
+ otherProps = _objectWithoutProperties(_ref, _excluded$J);
9152
9152
  return /*#__PURE__*/React__default.createElement(SpinWrapper, {
9153
9153
  style: style
9154
9154
  }, /*#__PURE__*/React__default.createElement(StyledHeroIcon, otherProps));
9155
9155
  };
9156
9156
 
9157
- var _excluded$H = ["name", "themeSize", "testID", "style"];
9157
+ var _excluded$I = ["name", "themeSize", "testID", "style"];
9158
9158
  var GradientIcon = function GradientIcon(_ref) {
9159
9159
  var name = _ref.name,
9160
9160
  themeSize = _ref.themeSize,
9161
9161
  testID = _ref.testID,
9162
9162
  style = _ref.style,
9163
- accessibilityProps = _objectWithoutProperties(_ref, _excluded$H);
9163
+ accessibilityProps = _objectWithoutProperties(_ref, _excluded$I);
9164
9164
  var theme = useTheme();
9165
9165
  var gradient = theme.colors.gradients.aiDiagonal;
9166
9166
  var size = theme.__hd__.icon.sizes[themeSize];
@@ -9288,7 +9288,7 @@ var AccordionItem = function AccordionItem(_ref) {
9288
9288
  }, content));
9289
9289
  };
9290
9290
 
9291
- var _excluded$G = ["key"];
9291
+ var _excluded$H = ["key"];
9292
9292
  var Accordion = function Accordion(_ref) {
9293
9293
  var items = _ref.items,
9294
9294
  activeItemKey = _ref.activeItemKey,
@@ -9311,7 +9311,7 @@ var Accordion = function Accordion(_ref) {
9311
9311
  accessible: accessible
9312
9312
  }, items.map(function (_ref2, index) {
9313
9313
  var key = _ref2.key,
9314
- props = _objectWithoutProperties(_ref2, _excluded$G);
9314
+ props = _objectWithoutProperties(_ref2, _excluded$H);
9315
9315
  var open = _activeItemKey === key;
9316
9316
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
9317
9317
  key: key
@@ -10147,7 +10147,7 @@ var borderWidths = {
10147
10147
  var config = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, colors), space), radii), borderWidths);
10148
10148
  var flexPropsKey = ['alignContent', 'alignItems', 'alignSelf', 'display', 'flex', 'flexBasis', 'flexDirection', 'flexGrow', 'flexShrink', 'flexWrap', 'justifyContent'];
10149
10149
 
10150
- var _excluded$F = ["theme"];
10150
+ var _excluded$G = ["theme"];
10151
10151
  var getThemeValue = function getThemeValue(theme, key, props) {
10152
10152
  var propConfig = config[key];
10153
10153
  var propValue = props[key];
@@ -10174,18 +10174,18 @@ var mapStylePropToThemeValue = function mapStylePropToThemeValue(theme, props) {
10174
10174
  var configKeys = Object.keys(config);
10175
10175
  var StyledBox = index$c(View)(function (_ref5) {
10176
10176
  var theme = _ref5.theme,
10177
- otherProps = _objectWithoutProperties(_ref5, _excluded$F);
10177
+ otherProps = _objectWithoutProperties(_ref5, _excluded$G);
10178
10178
  var styleProps = pick(configKeys, otherProps);
10179
10179
  var flexProps = pick(_toConsumableArray(flexPropsKey), otherProps);
10180
10180
  return _objectSpread2(_objectSpread2({}, mapStylePropToThemeValue(theme, styleProps)), flexProps);
10181
10181
  });
10182
10182
 
10183
- var _excluded$E = ["children", "style", "testID"];
10183
+ var _excluded$F = ["children", "style", "testID"];
10184
10184
  var Box = function Box(_ref) {
10185
10185
  var children = _ref.children,
10186
10186
  style = _ref.style,
10187
10187
  testID = _ref.testID,
10188
- otherProps = _objectWithoutProperties(_ref, _excluded$E);
10188
+ otherProps = _objectWithoutProperties(_ref, _excluded$F);
10189
10189
  return /*#__PURE__*/React__default.createElement(StyledBox, _extends$1({}, otherProps, {
10190
10190
  style: style,
10191
10191
  testID: testID
@@ -10456,7 +10456,7 @@ var StyledIcon$4 = index$c(Icon)(function (_ref6) {
10456
10456
  };
10457
10457
  });
10458
10458
 
10459
- var _excluded$D = ["children", "visible", "intent", "style", "testID"];
10459
+ var _excluded$E = ["children", "visible", "intent", "style", "testID"];
10460
10460
  var Status$1 = function Status(_ref) {
10461
10461
  var children = _ref.children,
10462
10462
  _ref$visible = _ref.visible,
@@ -10465,7 +10465,7 @@ var Status$1 = function Status(_ref) {
10465
10465
  intent = _ref$intent === void 0 ? 'danger' : _ref$intent,
10466
10466
  style = _ref.style,
10467
10467
  testID = _ref.testID,
10468
- nativeProps = _objectWithoutProperties(_ref, _excluded$D);
10468
+ nativeProps = _objectWithoutProperties(_ref, _excluded$E);
10469
10469
  var _React$useRef = React__default.useRef(new Animated.Value(visible ? 1 : 0)),
10470
10470
  opacity = _React$useRef.current;
10471
10471
  var isFirstRendering = React__default.useRef(true);
@@ -10501,7 +10501,7 @@ var Status$1 = function Status(_ref) {
10501
10501
 
10502
10502
  var DEFAULT_MAX_NUMBER = 99;
10503
10503
 
10504
- var _excluded$C = ["children", "visible", "style", "max", "testID", "content"];
10504
+ var _excluded$D = ["children", "visible", "style", "max", "testID", "content"];
10505
10505
  var Status = function Status(_ref) {
10506
10506
  var children = _ref.children,
10507
10507
  _ref$visible = _ref.visible,
@@ -10511,7 +10511,7 @@ var Status = function Status(_ref) {
10511
10511
  max = _ref$max === void 0 ? DEFAULT_MAX_NUMBER : _ref$max,
10512
10512
  testID = _ref.testID,
10513
10513
  originalContent = _ref.content,
10514
- nativeProps = _objectWithoutProperties(_ref, _excluded$C);
10514
+ nativeProps = _objectWithoutProperties(_ref, _excluded$D);
10515
10515
  var content = useMemo(function () {
10516
10516
  return originalContent > max ? "".concat(max, "+") : String(originalContent);
10517
10517
  }, [originalContent, max]);
@@ -10523,7 +10523,7 @@ var Status = function Status(_ref) {
10523
10523
  }, /*#__PURE__*/React__default.createElement(StyledCountText, null, content)));
10524
10524
  };
10525
10525
 
10526
- var _excluded$B = ["content", "visible", "max", "intent", "style", "testID", "size", "variant", "icon"];
10526
+ var _excluded$C = ["content", "visible", "max", "intent", "style", "testID", "size", "variant", "icon"];
10527
10527
  var getPaddingState = function getPaddingState(content) {
10528
10528
  return content.length > 1 ? 'wideContent' : 'narrowContent';
10529
10529
  };
@@ -10542,7 +10542,7 @@ var Badge$1 = function Badge(_ref) {
10542
10542
  _ref$variant = _ref.variant,
10543
10543
  variant = _ref$variant === void 0 ? 'filled' : _ref$variant,
10544
10544
  icon = _ref.icon,
10545
- nativeProps = _objectWithoutProperties(_ref, _excluded$B);
10545
+ nativeProps = _objectWithoutProperties(_ref, _excluded$C);
10546
10546
  var _React$useRef = React__default.useRef(new Animated.Value(visible ? 1 : 0)),
10547
10547
  opacity = _React$useRef.current;
10548
10548
  var isFirstRendering = React__default.useRef(true);
@@ -10660,7 +10660,7 @@ var StyledBottomBarText = index$c(Typography.Label)(function (_ref4) {
10660
10660
  };
10661
10661
  });
10662
10662
 
10663
- var _excluded$A = ["onTabPress", "renderActiveTabOnly", "selectedTabKey", "tabs"];
10663
+ var _excluded$B = ["onTabPress", "renderActiveTabOnly", "selectedTabKey", "tabs"];
10664
10664
  var getInactiveIcon = function getInactiveIcon(icon) {
10665
10665
  var inactiveIcon = "".concat(icon, "-outlined");
10666
10666
  return isHeroIcon(inactiveIcon) ? inactiveIcon : icon;
@@ -10671,7 +10671,7 @@ var BottomNavigation = function BottomNavigation(_ref) {
10671
10671
  renderActiveTabOnly = _ref$renderActiveTabO === void 0 ? false : _ref$renderActiveTabO,
10672
10672
  selectedTabKey = _ref.selectedTabKey,
10673
10673
  tabs = _ref.tabs,
10674
- nativeProps = _objectWithoutProperties(_ref, _excluded$A);
10674
+ nativeProps = _objectWithoutProperties(_ref, _excluded$B);
10675
10675
  var insets = useSafeAreaInsets();
10676
10676
  /**
10677
10677
  * List of loaded tabs, tabs will be loaded when navigated to.
@@ -10763,13 +10763,13 @@ var StyledDivider = index$c(View)(function (_ref) {
10763
10763
  }, horizontalMargin), verticalMargin);
10764
10764
  });
10765
10765
 
10766
- var _excluded$z = ["marginHorizontal", "marginVertical", "style", "testID"];
10766
+ var _excluded$A = ["marginHorizontal", "marginVertical", "style", "testID"];
10767
10767
  var Divider = function Divider(_ref) {
10768
10768
  var marginHorizontal = _ref.marginHorizontal,
10769
10769
  marginVertical = _ref.marginVertical,
10770
10770
  style = _ref.style,
10771
10771
  testID = _ref.testID,
10772
- nativeProps = _objectWithoutProperties(_ref, _excluded$z);
10772
+ nativeProps = _objectWithoutProperties(_ref, _excluded$A);
10773
10773
  return /*#__PURE__*/React__default.createElement(StyledDivider, _extends$1({}, nativeProps, {
10774
10774
  themeMarginHorizontal: marginHorizontal,
10775
10775
  themeMarginVertical: marginVertical,
@@ -10871,7 +10871,7 @@ var Footer$1 = function Footer(_ref) {
10871
10871
  };
10872
10872
 
10873
10873
  // eslint-disable-next-line @typescript-eslint/no-empty-function
10874
- var noop$2 = function noop() {};
10874
+ var noop$3 = function noop() {};
10875
10875
 
10876
10876
  var StyledLoadingIndicatorWrapper = index$c(View)({
10877
10877
  flexDirection: 'row',
@@ -10900,7 +10900,7 @@ var StyledLoadingDot = index$c(View)(function (_ref) {
10900
10900
  }, themeStyling());
10901
10901
  });
10902
10902
 
10903
- var _excluded$y = ["count", "size", "testID", "themeVariant"];
10903
+ var _excluded$z = ["count", "size", "testID", "themeVariant"];
10904
10904
  var AnimatedLoadingIndicatorWrapper = Animated.createAnimatedComponent(StyledLoadingIndicatorWrapper);
10905
10905
  var AnimatedLoadingDot = Animated.createAnimatedComponent(StyledLoadingDot);
10906
10906
  var renderDotComponent = function renderDotComponent(_ref) {
@@ -10932,7 +10932,7 @@ var LoadingIndicator = function LoadingIndicator(_ref2) {
10932
10932
  size = _ref2$size === void 0 ? 12 : _ref2$size,
10933
10933
  testID = _ref2.testID,
10934
10934
  themeVariant = _ref2.themeVariant,
10935
- nativeProps = _objectWithoutProperties(_ref2, _excluded$y);
10935
+ nativeProps = _objectWithoutProperties(_ref2, _excluded$z);
10936
10936
  var progressAnimation = useRef(new Animated.Value(0));
10937
10937
  useEffect(function () {
10938
10938
  var animation = Animated.loop(Animated.timing(progressAnimation.current, {
@@ -11536,7 +11536,7 @@ var Header = function Header(_ref) {
11536
11536
  var content = _ref.content,
11537
11537
  showDivider = _ref.showDivider,
11538
11538
  _ref$onRequestClose = _ref.onRequestClose,
11539
- onRequestClose = _ref$onRequestClose === void 0 ? noop$2 : _ref$onRequestClose,
11539
+ onRequestClose = _ref$onRequestClose === void 0 ? noop$3 : _ref$onRequestClose,
11540
11540
  showCloseButton = _ref.showCloseButton,
11541
11541
  _ref$variant = _ref.variant,
11542
11542
  variant = _ref$variant === void 0 ? 'fixed' : _ref$variant;
@@ -11564,11 +11564,11 @@ var Header = function Header(_ref) {
11564
11564
  }))) : null), showDivider ? /*#__PURE__*/React__default.createElement(Divider, null) : null);
11565
11565
  };
11566
11566
 
11567
- var _excluded$x = ["scrollEventThrottle"];
11567
+ var _excluded$y = ["scrollEventThrottle"];
11568
11568
  var BottomSheetScrollView = /*#__PURE__*/forwardRef(function (_ref, ref) {
11569
11569
  var _ref$scrollEventThrot = _ref.scrollEventThrottle,
11570
11570
  scrollEventThrottle = _ref$scrollEventThrot === void 0 ? 100 : _ref$scrollEventThrot,
11571
- props = _objectWithoutProperties(_ref, _excluded$x);
11571
+ props = _objectWithoutProperties(_ref, _excluded$y);
11572
11572
  var _useContext = useContext(BottomSheetContext),
11573
11573
  setInternalShowDivider = _useContext.setInternalShowDivider;
11574
11574
  var onScrollBeginDrag = useCallback(function (e) {
@@ -14182,7 +14182,7 @@ var setStartOrEndDate = function setStartOrEndDate(_ref2) {
14182
14182
  };
14183
14183
  };
14184
14184
  var shouldUseMonthPicker = function shouldUseMonthPicker(onMonthChange) {
14185
- return onMonthChange !== noop$2;
14185
+ return onMonthChange !== noop$3;
14186
14186
  };
14187
14187
  var getCalendarDate = function getCalendarDate(_ref3) {
14188
14188
  var visibleDate = _ref3.visibleDate,
@@ -14318,20 +14318,20 @@ var CalendarRange = function CalendarRange(_ref) {
14318
14318
  visibleDate = _ref.visibleDate,
14319
14319
  onChange = _ref.onChange,
14320
14320
  _ref$onPreviousPress = _ref.onPreviousPress,
14321
- onPreviousPress = _ref$onPreviousPress === void 0 ? noop$2 : _ref$onPreviousPress,
14321
+ onPreviousPress = _ref$onPreviousPress === void 0 ? noop$3 : _ref$onPreviousPress,
14322
14322
  _ref$onNextPress = _ref.onNextPress,
14323
- onNextPress = _ref$onNextPress === void 0 ? noop$2 : _ref$onNextPress,
14323
+ onNextPress = _ref$onNextPress === void 0 ? noop$3 : _ref$onNextPress,
14324
14324
  _ref$onTitlePress = _ref.onTitlePress,
14325
- onTitlePress = _ref$onTitlePress === void 0 ? noop$2 : _ref$onTitlePress,
14325
+ onTitlePress = _ref$onTitlePress === void 0 ? noop$3 : _ref$onTitlePress,
14326
14326
  minDate = _ref.minDate,
14327
14327
  maxDate = _ref.maxDate,
14328
14328
  _ref$markedDates = _ref.markedDates,
14329
14329
  markedDates = _ref$markedDates === void 0 ? [] : _ref$markedDates,
14330
14330
  testID = _ref.testID,
14331
14331
  _ref$onMonthChange = _ref.onMonthChange,
14332
- onMonthChange = _ref$onMonthChange === void 0 ? noop$2 : _ref$onMonthChange,
14332
+ onMonthChange = _ref$onMonthChange === void 0 ? noop$3 : _ref$onMonthChange,
14333
14333
  _ref$onToggleMonthPic = _ref.onToggleMonthPicker,
14334
- onToggleMonthPicker = _ref$onToggleMonthPic === void 0 ? noop$2 : _ref$onToggleMonthPic,
14334
+ onToggleMonthPicker = _ref$onToggleMonthPic === void 0 ? noop$3 : _ref$onToggleMonthPic,
14335
14335
  monthPickerConfirmLabel = _ref.monthPickerConfirmLabel,
14336
14336
  monthPickerCancelLabel = _ref.monthPickerCancelLabel;
14337
14337
  var theme = useTheme();
@@ -14499,20 +14499,20 @@ var Calendar$1 = function Calendar(_ref) {
14499
14499
  visibleDate = _ref.visibleDate,
14500
14500
  onChange = _ref.onChange,
14501
14501
  _ref$onPreviousPress = _ref.onPreviousPress,
14502
- onPreviousPress = _ref$onPreviousPress === void 0 ? noop$2 : _ref$onPreviousPress,
14502
+ onPreviousPress = _ref$onPreviousPress === void 0 ? noop$3 : _ref$onPreviousPress,
14503
14503
  _ref$onNextPress = _ref.onNextPress,
14504
- onNextPress = _ref$onNextPress === void 0 ? noop$2 : _ref$onNextPress,
14504
+ onNextPress = _ref$onNextPress === void 0 ? noop$3 : _ref$onNextPress,
14505
14505
  _ref$onTitlePress = _ref.onTitlePress,
14506
- onTitlePress = _ref$onTitlePress === void 0 ? noop$2 : _ref$onTitlePress,
14506
+ onTitlePress = _ref$onTitlePress === void 0 ? noop$3 : _ref$onTitlePress,
14507
14507
  minDate = _ref.minDate,
14508
14508
  maxDate = _ref.maxDate,
14509
14509
  _ref$markedDates = _ref.markedDates,
14510
14510
  markedDates = _ref$markedDates === void 0 ? [] : _ref$markedDates,
14511
14511
  testID = _ref.testID,
14512
14512
  _ref$onMonthChange = _ref.onMonthChange,
14513
- onMonthChange = _ref$onMonthChange === void 0 ? noop$2 : _ref$onMonthChange,
14513
+ onMonthChange = _ref$onMonthChange === void 0 ? noop$3 : _ref$onMonthChange,
14514
14514
  _ref$onToggleMonthPic = _ref.onToggleMonthPicker,
14515
- onToggleMonthPicker = _ref$onToggleMonthPic === void 0 ? noop$2 : _ref$onToggleMonthPic,
14515
+ onToggleMonthPicker = _ref$onToggleMonthPic === void 0 ? noop$3 : _ref$onToggleMonthPic,
14516
14516
  monthPickerConfirmLabel = _ref.monthPickerConfirmLabel,
14517
14517
  monthPickerCancelLabel = _ref.monthPickerCancelLabel;
14518
14518
  var theme = useTheme();
@@ -14690,12 +14690,12 @@ var Indicator = index$c(View)(function (_ref3) {
14690
14690
  };
14691
14691
  });
14692
14692
 
14693
- var _excluded$w = ["intent", "children"];
14693
+ var _excluded$x = ["intent", "children"];
14694
14694
  var DataCard = function DataCard(_ref) {
14695
14695
  var _ref$intent = _ref.intent,
14696
14696
  intent = _ref$intent === void 0 ? 'info' : _ref$intent,
14697
14697
  children = _ref.children,
14698
- nativeProps = _objectWithoutProperties(_ref, _excluded$w);
14698
+ nativeProps = _objectWithoutProperties(_ref, _excluded$x);
14699
14699
  return /*#__PURE__*/React__default.createElement(StyledDataCard, nativeProps, /*#__PURE__*/React__default.createElement(Indicator, {
14700
14700
  themeIntent: intent,
14701
14701
  testID: "data-card-indicator"
@@ -14714,13 +14714,13 @@ var StyledCard$1 = index$c(View)(function (_ref) {
14714
14714
  });
14715
14715
  });
14716
14716
 
14717
- var _excluded$v = ["intent", "children", "variant"];
14717
+ var _excluded$w = ["intent", "children", "variant"];
14718
14718
  var Card$1 = function Card(_ref) {
14719
14719
  var intent = _ref.intent,
14720
14720
  children = _ref.children,
14721
14721
  _ref$variant = _ref.variant,
14722
14722
  variant = _ref$variant === void 0 ? 'basic' : _ref$variant,
14723
- nativeProps = _objectWithoutProperties(_ref, _excluded$v);
14723
+ nativeProps = _objectWithoutProperties(_ref, _excluded$w);
14724
14724
  return /*#__PURE__*/React__default.createElement(StyledCard$1, _extends$1({}, nativeProps, {
14725
14725
  themeIntent: intent,
14726
14726
  themeVariant: variant
@@ -14987,7 +14987,7 @@ var CardCarousel = /*#__PURE__*/forwardRef(function (_ref, ref) {
14987
14987
  });
14988
14988
  CardCarousel.displayName = 'CardCarousel';
14989
14989
 
14990
- var _excluded$u = ["rounded", "size", "testID", "style"];
14990
+ var _excluded$v = ["rounded", "size", "testID", "style"];
14991
14991
  /**
14992
14992
  * @deprecated Image component will soon be deprecated. Please use `Image` from `react-native` instead.
14993
14993
  */
@@ -14998,7 +14998,7 @@ var Image = function Image(_ref) {
14998
14998
  size = _ref$size === void 0 ? '6xlarge' : _ref$size,
14999
14999
  testID = _ref.testID,
15000
15000
  style = _ref.style,
15001
- imageNativeProps = _objectWithoutProperties(_ref, _excluded$u);
15001
+ imageNativeProps = _objectWithoutProperties(_ref, _excluded$v);
15002
15002
  useDeprecation('Image component will soon be deprecated. Please use `Image` from `react-native` instead.');
15003
15003
  var theme = useTheme();
15004
15004
  var imageSize = theme.__hd__.image.sizes[size];
@@ -15133,7 +15133,7 @@ var CarouselItem = function CarouselItem(_ref) {
15133
15133
  }, heading), !!body && /*#__PURE__*/React__default.createElement(Typography.Body, null, body)));
15134
15134
  };
15135
15135
 
15136
- var _excluded$t = ["items", "onItemIndexChange", "renderActions", "selectedItemIndex", "style", "shouldShowPagination", "testID", "pageControlPosition"];
15136
+ var _excluded$u = ["items", "onItemIndexChange", "renderActions", "selectedItemIndex", "style", "shouldShowPagination", "testID", "pageControlPosition"];
15137
15137
  function useStateFromProp(initialValue) {
15138
15138
  var _useState = useState(initialValue),
15139
15139
  _useState2 = _slicedToArray(_useState, 2),
@@ -15144,7 +15144,7 @@ function useStateFromProp(initialValue) {
15144
15144
  }, [initialValue]);
15145
15145
  return [value, setValue];
15146
15146
  }
15147
- var noop$1 = function noop(_) {
15147
+ var noop$2 = function noop(_) {
15148
15148
  return true;
15149
15149
  };
15150
15150
  var Carousel = function Carousel(_ref) {
@@ -15156,12 +15156,12 @@ var Carousel = function Carousel(_ref) {
15156
15156
  selectedItemIndex = _ref$selectedItemInde === void 0 ? 0 : _ref$selectedItemInde,
15157
15157
  style = _ref.style,
15158
15158
  _ref$shouldShowPagina = _ref.shouldShowPagination,
15159
- shouldShowPagination = _ref$shouldShowPagina === void 0 ? noop$1 : _ref$shouldShowPagina,
15159
+ shouldShowPagination = _ref$shouldShowPagina === void 0 ? noop$2 : _ref$shouldShowPagina,
15160
15160
  testID = _ref.testID,
15161
15161
  _ref$pageControlPosit = _ref.pageControlPosition,
15162
15162
  pageControlPosition = _ref$pageControlPosit === void 0 ? 'top' : _ref$pageControlPosit,
15163
- nativeProps = _objectWithoutProperties(_ref, _excluded$t);
15164
- useDeprecation("shouldShowPagination prop has been deprecated", shouldShowPagination !== noop$1);
15163
+ nativeProps = _objectWithoutProperties(_ref, _excluded$u);
15164
+ useDeprecation("shouldShowPagination prop has been deprecated", shouldShowPagination !== noop$2);
15165
15165
  useDeprecation("The use of 'pageControlPosition == bottom' has been deprecated", pageControlPosition === 'bottom');
15166
15166
  var theme = useTheme();
15167
15167
  var carouselRef = useRef(null);
@@ -15882,7 +15882,7 @@ function range(start, stop, step) {
15882
15882
  return range;
15883
15883
  }
15884
15884
 
15885
- var noop = {
15885
+ var noop$1 = {
15886
15886
  value: function value() {}
15887
15887
  };
15888
15888
  function dispatch() {
@@ -15956,7 +15956,7 @@ function get$1(type, name) {
15956
15956
  function set$1(type, name, callback) {
15957
15957
  for (var i = 0, n = type.length; i < n; ++i) {
15958
15958
  if (type[i].name === name) {
15959
- type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));
15959
+ type[i] = noop$1, type = type.slice(0, i).concat(type.slice(i + 1));
15960
15960
  break;
15961
15961
  }
15962
15962
  }
@@ -20431,7 +20431,7 @@ var StyledChipIcon = index$c(Icon)(function (_ref2) {
20431
20431
  };
20432
20432
  });
20433
20433
 
20434
- var _excluded$s = ["label", "variant", "selected", "icon", "onPress", "showSelectedIcon", "accessible", "onBlur", "onFocus"];
20434
+ var _excluded$t = ["label", "variant", "selected", "icon", "onPress", "showSelectedIcon", "accessible", "onBlur", "onFocus"];
20435
20435
  var getChipLabel = function getChipLabel(label) {
20436
20436
  if (typeof label === 'string') {
20437
20437
  return /*#__PURE__*/React__default.createElement(Typography.Body, {
@@ -20467,7 +20467,7 @@ var Chip = function Chip(_ref) {
20467
20467
  accessible = _ref.accessible,
20468
20468
  onBlur = _ref.onBlur,
20469
20469
  onFocus = _ref.onFocus,
20470
- otherProps = _objectWithoutProperties(_ref, _excluded$s);
20470
+ otherProps = _objectWithoutProperties(_ref, _excluded$t);
20471
20471
  useDeprecation('Chip variant `outlined` and `filled` are deprecated.', variant === 'outlined' || variant === 'filled');
20472
20472
  var renamedVariant = getChipVariant(variant);
20473
20473
  var shouldShowSelectedIcon = (renamedVariant === 'selection' || renamedVariant === 'compact-outlined') && selected && showSelectedIcon;
@@ -20858,7 +20858,7 @@ var StyledErrorAndMaxLengthContainer = index$c(View)(function (_ref14) {
20858
20858
  };
20859
20859
  });
20860
20860
 
20861
- var _excluded$r = ["label", "prefix", "suffix", "style", "textStyle", "testID", "accessibilityLabelledBy", "error", "required", "editable", "disabled", "loading", "maxLength", "hideCharacterCount", "helpText", "value", "defaultValue", "renderInputValue", "allowFontScaling", "variant"];
20861
+ var _excluded$s = ["label", "prefix", "suffix", "style", "textStyle", "testID", "accessibilityLabelledBy", "error", "required", "editable", "disabled", "loading", "maxLength", "hideCharacterCount", "helpText", "value", "defaultValue", "renderInputValue", "allowFontScaling", "variant"];
20862
20862
  var getState$3 = function getState(_ref) {
20863
20863
  var disabled = _ref.disabled,
20864
20864
  error = _ref.error,
@@ -20974,7 +20974,7 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref8, ref) {
20974
20974
  allowFontScaling = _ref8$allowFontScalin === void 0 ? false : _ref8$allowFontScalin,
20975
20975
  _ref8$variant = _ref8.variant,
20976
20976
  variant = _ref8$variant === void 0 ? 'text' : _ref8$variant,
20977
- nativeProps = _objectWithoutProperties(_ref8, _excluded$r);
20977
+ nativeProps = _objectWithoutProperties(_ref8, _excluded$s);
20978
20978
  var displayText = getDisplayText(value, defaultValue);
20979
20979
  var isEmptyValue = displayText.length === 0;
20980
20980
  var _React$useState = React__default.useState(0),
@@ -21721,11 +21721,11 @@ var DatePickerIOS = function DatePickerIOS(_ref) {
21721
21721
  }));
21722
21722
  };
21723
21723
 
21724
- var _excluded$q = ["variant"];
21724
+ var _excluded$r = ["variant"];
21725
21725
  var DatePicker = function DatePicker(_ref) {
21726
21726
  var _ref$variant = _ref.variant,
21727
21727
  variant = _ref$variant === void 0 ? 'default' : _ref$variant,
21728
- props = _objectWithoutProperties(_ref, _excluded$q);
21728
+ props = _objectWithoutProperties(_ref, _excluded$r);
21729
21729
  if (variant === 'calendar') {
21730
21730
  return /*#__PURE__*/React__default.createElement(DatePickerCalendar, props);
21731
21731
  }
@@ -21806,7 +21806,7 @@ var StyledDragableDrawerContainer = index$c(Animated.View)(function (_ref5) {
21806
21806
  backgroundColor: theme.__hd__.drawer.colors.background,
21807
21807
  elevation: enableShadow ? theme.__hd__.drawer.shadows.elevation : undefined,
21808
21808
  overflow: 'hidden',
21809
- maxHeight: '100%'
21809
+ height: '100%'
21810
21810
  };
21811
21811
  });
21812
21812
  var StyledHandlerContainer$1 = index$c(View)(function (_ref6) {
@@ -21827,6 +21827,23 @@ var StyledHandler = index$c(View)(function (_ref7) {
21827
21827
  };
21828
21828
  });
21829
21829
 
21830
+ var noop = function noop() {
21831
+ return {};
21832
+ };
21833
+ var DragableDrawerContext = /*#__PURE__*/createContext({
21834
+ isAtMaxHeight: false,
21835
+ scrollYRef: {
21836
+ current: 0
21837
+ },
21838
+ onScrollY: noop,
21839
+ beginPan: noop,
21840
+ movePan: noop,
21841
+ releasePan: noop
21842
+ });
21843
+ var useDragableDrawerContext = function useDragableDrawerContext() {
21844
+ return useContext(DragableDrawerContext);
21845
+ };
21846
+
21830
21847
  var getOffset = function getOffset(height, percentage) {
21831
21848
  if (percentage < 0) return height;
21832
21849
  if (percentage > 100) return 0;
@@ -21855,34 +21872,39 @@ var calculateAnimatedToValue = function calculateAnimatedToValue(position, heigh
21855
21872
  return heightSnapPoints[minIndex];
21856
21873
  };
21857
21874
 
21858
- var DragableDrawer = function DragableDrawer(_ref) {
21859
- var children = _ref.children,
21875
+ var FLICK_VELOCITY_THRESHOLD = 0.3;
21876
+ var SHORT_DRAG_THRESHOLD_PX = 20;
21877
+ var VELOCITY_PROJECTION_FACTOR = 200;
21878
+ var useDragablePan = function useDragablePan(_ref) {
21879
+ var height = _ref.height,
21860
21880
  initialHeightPercentage = _ref.initialHeightPercentage,
21861
- _ref$minimumHeightPer = _ref.minimumHeightPercentage,
21862
- minimumHeightPercentage = _ref$minimumHeightPer === void 0 ? 10 : _ref$minimumHeightPer,
21863
- _ref$snapPoints = _ref.snapPoints,
21864
- snapPoints = _ref$snapPoints === void 0 ? [] : _ref$snapPoints,
21881
+ minimumHeightPercentage = _ref.minimumHeightPercentage,
21882
+ snapPoints = _ref.snapPoints,
21865
21883
  onExpanded = _ref.onExpanded,
21866
- onCollapsed = _ref.onCollapsed,
21867
- testID = _ref.testID;
21868
- var _useState = useState(0),
21869
- _useState2 = _slicedToArray(_useState, 2),
21870
- height = _useState2[0],
21871
- setHeight = _useState2[1];
21884
+ onCollapsed = _ref.onCollapsed;
21872
21885
  var baseHeightForMeasure = useRef(0);
21873
21886
  var snapPointsData = useRef({
21874
21887
  list: [],
21875
21888
  minHeightOffset: 0,
21876
21889
  maxHeightOffset: 0
21877
21890
  });
21878
- // Track drag
21879
21891
  var pan = useRef(new Animated.Value(0)).current;
21880
21892
  var offset = useRef(0);
21881
21893
  var offsetBeforePan = useRef(0);
21882
- var _useState3 = useState(-1),
21894
+ var _useState = useState(-1),
21895
+ _useState2 = _slicedToArray(_useState, 2),
21896
+ animatedToValue = _useState2[0],
21897
+ setAnimatedToValue = _useState2[1];
21898
+ var _useState3 = useState(false),
21883
21899
  _useState4 = _slicedToArray(_useState3, 2),
21884
- animatedToValue = _useState4[0],
21885
- setAnimatedToValue = _useState4[1];
21900
+ isAtMaxHeight = _useState4[0],
21901
+ setIsAtMaxHeight = _useState4[1];
21902
+ var scrollYRef = useRef(0);
21903
+ var minimumHeightPercentageRef = useRef(minimumHeightPercentage);
21904
+ minimumHeightPercentageRef.current = minimumHeightPercentage;
21905
+ var onScrollY = useCallback(function (y) {
21906
+ scrollYRef.current = y;
21907
+ }, []);
21886
21908
  useEffect(function () {
21887
21909
  var id = pan.addListener(function (_ref2) {
21888
21910
  var value = _ref2.value;
@@ -21897,13 +21919,12 @@ var DragableDrawer = function DragableDrawer(_ref) {
21897
21919
  var initialOffset = getOffset(height, initialHeightPercentage || minimumHeightPercentage);
21898
21920
  setAnimatedToValue(initialOffset);
21899
21921
  }
21900
- }, [height]);
21922
+ }, [height, initialHeightPercentage, minimumHeightPercentage]);
21901
21923
  useEffect(function () {
21902
21924
  if (height > 0) {
21903
21925
  pan.setValue(height);
21904
21926
  offset.current = height;
21905
21927
  baseHeightForMeasure.current = height;
21906
- // Calculate snap points information
21907
21928
  snapPointsData.current = calculateSnapPointsData(minimumHeightPercentage, height, snapPoints);
21908
21929
  }
21909
21930
  }, [height, minimumHeightPercentage]);
@@ -21914,11 +21935,18 @@ var DragableDrawer = function DragableDrawer(_ref) {
21914
21935
  useNativeDriver: Platform.OS !== 'web',
21915
21936
  easing: Easing.inOut(Easing.cubic)
21916
21937
  });
21917
- animation.start(function () {
21918
- if (animatedToValue === 0) {
21919
- onExpanded === null || onExpanded === void 0 || onExpanded();
21920
- } else if (animatedToValue === getOffset(height, minimumHeightPercentage)) {
21921
- onCollapsed === null || onCollapsed === void 0 || onCollapsed();
21938
+ animation.start(function (_ref3) {
21939
+ var finished = _ref3.finished;
21940
+ if (finished) {
21941
+ if (animatedToValue === 0) {
21942
+ setIsAtMaxHeight(true);
21943
+ onExpanded === null || onExpanded === void 0 || onExpanded();
21944
+ } else {
21945
+ setIsAtMaxHeight(false);
21946
+ if (animatedToValue === getOffset(height, minimumHeightPercentage)) {
21947
+ onCollapsed === null || onCollapsed === void 0 || onCollapsed();
21948
+ }
21949
+ }
21922
21950
  }
21923
21951
  setAnimatedToValue(-1);
21924
21952
  });
@@ -21926,41 +21954,130 @@ var DragableDrawer = function DragableDrawer(_ref) {
21926
21954
  return animation.stop();
21927
21955
  };
21928
21956
  }
21929
- }, [animatedToValue]);
21957
+ }, [animatedToValue, onExpanded, onCollapsed, height, minimumHeightPercentage]);
21958
+ var beginPan = useCallback(function () {
21959
+ pan.stopAnimation();
21960
+ setIsAtMaxHeight(false);
21961
+ offsetBeforePan.current = offset.current;
21962
+ pan.setOffset(offset.current);
21963
+ pan.setValue(0);
21964
+ }, []);
21965
+ var movePan = useCallback(function (dy) {
21966
+ var _snapPointsData$curre;
21967
+ // Moving toward top, stop at highest snap point
21968
+ if (offsetBeforePan.current + dy < 0) {
21969
+ pan.setValue(-offsetBeforePan.current);
21970
+ return;
21971
+ }
21972
+ // Moving toward bottom, stop at lowest snap point
21973
+ if (offsetBeforePan.current + dy > ((_snapPointsData$curre = snapPointsData.current) === null || _snapPointsData$curre === void 0 ? void 0 : _snapPointsData$curre.minHeightOffset)) {
21974
+ pan.setValue(baseHeightForMeasure.current - baseHeightForMeasure.current * (minimumHeightPercentageRef.current / 100) - offsetBeforePan.current);
21975
+ return;
21976
+ }
21977
+ pan.setValue(dy);
21978
+ }, []);
21979
+ var releasePan = useCallback(function (dy, vy) {
21980
+ pan.flattenOffset();
21981
+ var offsetAfterPan = offsetBeforePan.current + dy;
21982
+ // Flick or short downward drag: snap to the next lower snap point.
21983
+ if (vy > FLICK_VELOCITY_THRESHOLD || dy > SHORT_DRAG_THRESHOLD_PX) {
21984
+ var lowerPoints = snapPointsData.current.list.filter(function (p) {
21985
+ return p > offsetBeforePan.current;
21986
+ }).sort(function (a, b) {
21987
+ return a - b;
21988
+ });
21989
+ if (lowerPoints.length > 0) {
21990
+ setAnimatedToValue(lowerPoints[0]);
21991
+ return;
21992
+ }
21993
+ }
21994
+ // Upward flick or drag: project the intended landing position using
21995
+ // velocity, then snap to the nearest higher snap point to that projection.
21996
+ // This allows fast flicks to skip intermediate snap points.
21997
+ if (vy < -FLICK_VELOCITY_THRESHOLD || dy < -SHORT_DRAG_THRESHOLD_PX) {
21998
+ var projected = offsetAfterPan + vy * VELOCITY_PROJECTION_FACTOR;
21999
+ var higherPoints = snapPointsData.current.list.filter(function (p) {
22000
+ return p < offsetBeforePan.current;
22001
+ }).sort(function (a, b) {
22002
+ return b - a;
22003
+ });
22004
+ if (higherPoints.length > 0) {
22005
+ setAnimatedToValue(calculateAnimatedToValue(projected, higherPoints));
22006
+ return;
22007
+ }
22008
+ }
22009
+ // Otherwise: snap to nearest.
22010
+ setAnimatedToValue(calculateAnimatedToValue(offsetAfterPan, snapPointsData.current.list));
22011
+ }, []);
21930
22012
  var panResponder = useRef(PanResponder.create({
21931
22013
  onMoveShouldSetPanResponder: function onMoveShouldSetPanResponder() {
21932
22014
  return true;
21933
22015
  },
21934
22016
  onPanResponderGrant: function onPanResponderGrant() {
21935
- offsetBeforePan.current = offset.current;
21936
- pan.setOffset(offset.current);
21937
- pan.setValue(0);
22017
+ return beginPan();
21938
22018
  },
21939
22019
  onPanResponderMove: function onPanResponderMove(_, gesture) {
21940
- var _snapPointsData$curre;
21941
- var panDistance = gesture.dy;
21942
- // Moving toward top, stop at highest snap point
21943
- if (offsetBeforePan.current + panDistance < 0) {
21944
- pan.setValue(-offsetBeforePan.current);
21945
- return;
21946
- }
21947
- // Moving toward bottom, stop at lowest snap point
21948
- if (offsetBeforePan.current + panDistance > ((_snapPointsData$curre = snapPointsData.current) === null || _snapPointsData$curre === void 0 ? void 0 : _snapPointsData$curre.minHeightOffset)) {
21949
- pan.setValue(baseHeightForMeasure.current - baseHeightForMeasure.current * (minimumHeightPercentage / 100) - offsetBeforePan.current);
21950
- return;
21951
- }
21952
- pan.setValue(panDistance);
22020
+ return movePan(gesture.dy);
21953
22021
  },
21954
22022
  onPanResponderRelease: function onPanResponderRelease(_, gesture) {
21955
- pan.flattenOffset();
21956
- // Attach to nearest snappoint
21957
- var panDistance = gesture.dy;
21958
- var offsetAfterPan = offsetBeforePan.current + panDistance;
21959
- var animatedValue = calculateAnimatedToValue(offsetAfterPan, snapPointsData.current.list);
21960
- setAnimatedToValue(animatedValue);
22023
+ return releasePan(gesture.dy, gesture.vy);
21961
22024
  }
21962
22025
  })).current;
21963
- return /*#__PURE__*/React__default.createElement(StyledDragableContainer, {
22026
+ return {
22027
+ pan: pan,
22028
+ isAtMaxHeight: isAtMaxHeight,
22029
+ scrollYRef: scrollYRef,
22030
+ onScrollY: onScrollY,
22031
+ beginPan: beginPan,
22032
+ movePan: movePan,
22033
+ releasePan: releasePan,
22034
+ panHandlers: panResponder.panHandlers
22035
+ };
22036
+ };
22037
+
22038
+ var DragableDrawer = function DragableDrawer(_ref) {
22039
+ var children = _ref.children,
22040
+ initialHeightPercentage = _ref.initialHeightPercentage,
22041
+ _ref$minimumHeightPer = _ref.minimumHeightPercentage,
22042
+ minimumHeightPercentage = _ref$minimumHeightPer === void 0 ? 10 : _ref$minimumHeightPer,
22043
+ _ref$snapPoints = _ref.snapPoints,
22044
+ snapPoints = _ref$snapPoints === void 0 ? [] : _ref$snapPoints,
22045
+ onExpanded = _ref.onExpanded,
22046
+ onCollapsed = _ref.onCollapsed,
22047
+ testID = _ref.testID;
22048
+ var _useState = useState(0),
22049
+ _useState2 = _slicedToArray(_useState, 2),
22050
+ height = _useState2[0],
22051
+ setHeight = _useState2[1];
22052
+ var _useDragablePan = useDragablePan({
22053
+ height: height,
22054
+ initialHeightPercentage: initialHeightPercentage,
22055
+ minimumHeightPercentage: minimumHeightPercentage,
22056
+ snapPoints: snapPoints,
22057
+ onExpanded: onExpanded,
22058
+ onCollapsed: onCollapsed
22059
+ }),
22060
+ pan = _useDragablePan.pan,
22061
+ isAtMaxHeight = _useDragablePan.isAtMaxHeight,
22062
+ scrollYRef = _useDragablePan.scrollYRef,
22063
+ onScrollY = _useDragablePan.onScrollY,
22064
+ beginPan = _useDragablePan.beginPan,
22065
+ movePan = _useDragablePan.movePan,
22066
+ releasePan = _useDragablePan.releasePan,
22067
+ panHandlers = _useDragablePan.panHandlers;
22068
+ var contextValue = useMemo(function () {
22069
+ return {
22070
+ isAtMaxHeight: isAtMaxHeight,
22071
+ scrollYRef: scrollYRef,
22072
+ onScrollY: onScrollY,
22073
+ beginPan: beginPan,
22074
+ movePan: movePan,
22075
+ releasePan: releasePan
22076
+ };
22077
+ }, [isAtMaxHeight, onScrollY, beginPan, movePan, releasePan]);
22078
+ return /*#__PURE__*/React__default.createElement(DragableDrawerContext.Provider, {
22079
+ value: contextValue
22080
+ }, /*#__PURE__*/React__default.createElement(StyledDragableContainer, {
21964
22081
  testID: testID,
21965
22082
  enableShadow: true,
21966
22083
  pointerEvents: "box-none"
@@ -21968,16 +22085,106 @@ var DragableDrawer = function DragableDrawer(_ref) {
21968
22085
  enableShadow: true,
21969
22086
  style: {
21970
22087
  transform: [{
21971
- scaleY: baseHeightForMeasure.current > 0 ? 1 : 0
22088
+ scaleY: height > 0 ? 1 : 0
21972
22089
  }, {
21973
22090
  translateY: pan
21974
22091
  }]
21975
22092
  },
21976
- onLayout: function onLayout(_ref3) {
21977
- var nativeEvent = _ref3.nativeEvent;
22093
+ onLayout: function onLayout(_ref2) {
22094
+ var nativeEvent = _ref2.nativeEvent;
21978
22095
  setHeight(nativeEvent.layout.height);
21979
22096
  }
21980
- }, /*#__PURE__*/React__default.createElement(StyledHandlerContainer$1, panResponder.panHandlers, /*#__PURE__*/React__default.createElement(StyledHandler, null)), children));
22097
+ }, /*#__PURE__*/React__default.createElement(StyledHandlerContainer$1, panHandlers, /*#__PURE__*/React__default.createElement(StyledHandler, null)), children)));
22098
+ };
22099
+
22100
+ var _excluded$q = ["onScroll", "onScrollEndDrag", "onMomentumScrollEnd", "scrollEventThrottle", "children"];
22101
+ // scrollY tolerance: treat anything within this many pixels of the top as
22102
+ // "at scroll top" to handle fractional pixels and throttled scroll events.
22103
+ var SCROLL_TOP_THRESHOLD_PX = 5;
22104
+ // Minimum downward finger movement before the pull-down collapse is triggered.
22105
+ var PULL_DOWN_THRESHOLD_PX = 10;
22106
+ var DEFAULT_SCROLL_EVENT_THROTTLE = 16;
22107
+ /**
22108
+ * A ScrollView that coordinates with a parent DragableDrawer.
22109
+ *
22110
+ * - Drawer below max height: all gestures move the drawer; scroll is locked.
22111
+ * - Drawer at max height: native scrolling works normally.
22112
+ * - Drawer at max + scrolled to top + pull down: drawer collapses.
22113
+ *
22114
+ * The native ScrollView with bounces={false}/overScrollMode="never" will not
22115
+ * intercept a downward gesture at scrollY=0 (nothing left to scroll), so
22116
+ * onMoveShouldSetPanResponderCapture fires cleanly on both platforms.
22117
+ * onScrollEndDrag + onMomentumScrollEnd ensure scrollYRef is up-to-date
22118
+ * before the next gesture starts.
22119
+ */
22120
+ var DragableScrollView = function DragableScrollView(_ref) {
22121
+ var onScroll = _ref.onScroll,
22122
+ onScrollEndDragProp = _ref.onScrollEndDrag,
22123
+ onMomentumScrollEndProp = _ref.onMomentumScrollEnd,
22124
+ _ref$scrollEventThrot = _ref.scrollEventThrottle,
22125
+ scrollEventThrottle = _ref$scrollEventThrot === void 0 ? DEFAULT_SCROLL_EVENT_THROTTLE : _ref$scrollEventThrot,
22126
+ children = _ref.children,
22127
+ props = _objectWithoutProperties(_ref, _excluded$q);
22128
+ var _useDragableDrawerCon = useDragableDrawerContext(),
22129
+ isAtMaxHeight = _useDragableDrawerCon.isAtMaxHeight,
22130
+ scrollYRef = _useDragableDrawerCon.scrollYRef,
22131
+ onScrollY = _useDragableDrawerCon.onScrollY,
22132
+ beginPan = _useDragableDrawerCon.beginPan,
22133
+ movePan = _useDragableDrawerCon.movePan,
22134
+ releasePan = _useDragableDrawerCon.releasePan;
22135
+ // Mirror context value into a ref so PanResponder closures always read
22136
+ // the latest value (PanResponder is created once and closures are frozen).
22137
+ var isAtMaxHeightRef = useRef(isAtMaxHeight);
22138
+ isAtMaxHeightRef.current = isAtMaxHeight;
22139
+ var panResponder = useRef(PanResponder.create({
22140
+ // Drawer below max: capture on start so the native ScrollView never
22141
+ // gets the touch and scroll is completely locked.
22142
+ onStartShouldSetPanResponderCapture: function onStartShouldSetPanResponderCapture() {
22143
+ return !isAtMaxHeightRef.current;
22144
+ },
22145
+ // Drawer at max + scroll at top + pull down: recapture for collapse.
22146
+ // bounces={false} / overScrollMode="never" means the native ScrollView
22147
+ // has nothing to do here, so it will not intercept the gesture and this
22148
+ // capture fires reliably before any scroll activity begins.
22149
+ onMoveShouldSetPanResponderCapture: function onMoveShouldSetPanResponderCapture(_, gesture) {
22150
+ return isAtMaxHeightRef.current && scrollYRef.current <= SCROLL_TOP_THRESHOLD_PX && gesture.dy > PULL_DOWN_THRESHOLD_PX;
22151
+ },
22152
+ onPanResponderGrant: function onPanResponderGrant() {
22153
+ return beginPan();
22154
+ },
22155
+ onPanResponderMove: function onPanResponderMove(_, gesture) {
22156
+ return movePan(gesture.dy);
22157
+ },
22158
+ onPanResponderRelease: function onPanResponderRelease(_, gesture) {
22159
+ return releasePan(gesture.dy, gesture.vy);
22160
+ }
22161
+ })).current;
22162
+ var handleScroll = function handleScroll(e) {
22163
+ onScrollY(e.nativeEvent.contentOffset.y);
22164
+ onScroll === null || onScroll === void 0 || onScroll(e);
22165
+ };
22166
+ // Keep scrollYRef accurate at every scroll boundary so the next gesture
22167
+ // checks the correct position even when onScroll is throttled.
22168
+ var handleScrollEndDrag = function handleScrollEndDrag(e) {
22169
+ onScrollY(e.nativeEvent.contentOffset.y);
22170
+ onScrollEndDragProp === null || onScrollEndDragProp === void 0 || onScrollEndDragProp(e);
22171
+ };
22172
+ var handleMomentumScrollEnd = function handleMomentumScrollEnd(e) {
22173
+ onScrollY(e.nativeEvent.contentOffset.y);
22174
+ onMomentumScrollEndProp === null || onMomentumScrollEndProp === void 0 || onMomentumScrollEndProp(e);
22175
+ };
22176
+ return /*#__PURE__*/React__default.createElement(View, _extends$1({}, panResponder.panHandlers, {
22177
+ style: {
22178
+ flex: 1
22179
+ }
22180
+ }), /*#__PURE__*/React__default.createElement(ScrollView, _extends$1({}, props, {
22181
+ scrollEnabled: isAtMaxHeight,
22182
+ onScroll: handleScroll,
22183
+ onScrollEndDrag: handleScrollEndDrag,
22184
+ onMomentumScrollEnd: handleMomentumScrollEnd,
22185
+ scrollEventThrottle: scrollEventThrottle,
22186
+ overScrollMode: "always"
22187
+ }), children));
21981
22188
  };
21982
22189
 
21983
22190
  var BACKDROP_OPACITY = 0.56;
@@ -22038,7 +22245,8 @@ var Drawer = function Drawer(_ref) {
22038
22245
  }, children));
22039
22246
  };
22040
22247
  var index$7 = Object.assign(Drawer, {
22041
- Dragable: DragableDrawer
22248
+ Dragable: DragableDrawer,
22249
+ DragableScrollView: DragableScrollView
22042
22250
  });
22043
22251
 
22044
22252
  var DEFAULT_ILLUSTRATION_SIZE = scale(72);
@@ -24163,7 +24371,7 @@ var FABWithTitleStyle = /*#__PURE__*/forwardRef(function (_ref3, ref) {
24163
24371
  return {
24164
24372
  show: function show() {
24165
24373
  var animated = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
24166
- var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop$2;
24374
+ var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop$3;
24167
24375
  setDisplayState({
24168
24376
  hideButton: false,
24169
24377
  hideTitle: false
@@ -24184,7 +24392,7 @@ var FABWithTitleStyle = /*#__PURE__*/forwardRef(function (_ref3, ref) {
24184
24392
  },
24185
24393
  collapse: function collapse() {
24186
24394
  var animated = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
24187
- var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop$2;
24395
+ var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop$3;
24188
24396
  setDisplayState({
24189
24397
  hideButton: false,
24190
24398
  hideTitle: true
@@ -24205,7 +24413,7 @@ var FABWithTitleStyle = /*#__PURE__*/forwardRef(function (_ref3, ref) {
24205
24413
  },
24206
24414
  hide: function hide() {
24207
24415
  var animated = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
24208
- var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop$2;
24416
+ var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop$3;
24209
24417
  if (animated) {
24210
24418
  Animated.stagger(20, [Animated.spring(animatedValues.opacity, {
24211
24419
  toValue: 0,
@@ -27530,7 +27738,7 @@ var SuccessPage = function SuccessPage(_ref2) {
27530
27738
  testID = _ref2.testID,
27531
27739
  ctaText = _ref2.ctaText,
27532
27740
  _ref2$onCtaPress = _ref2.onCtaPress,
27533
- onCtaPress = _ref2$onCtaPress === void 0 ? noop$2 : _ref2$onCtaPress,
27741
+ onCtaPress = _ref2$onCtaPress === void 0 ? noop$3 : _ref2$onCtaPress,
27534
27742
  secondaryCtaText = _ref2.secondaryCtaText,
27535
27743
  onSecondaryCtaPress = _ref2.onSecondaryCtaPress,
27536
27744
  icon = _ref2.icon,