@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/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';
@@ -4978,7 +4978,7 @@ var swagLightGlobalPalette = _objectSpread2(_objectSpread2({}, globalPalette$1),
4978
4978
  });
4979
4979
 
4980
4980
  var ehWorkBrandSystemPalette = {
4981
- primary: '#7622d7',
4981
+ primary: '#460078',
4982
4982
  onPrimary: '#fdfbff',
4983
4983
  secondary: '#b382fd',
4984
4984
  onSecondary: palette$4.white,
@@ -5007,7 +5007,6 @@ var swagSystemPalette = _objectSpread2(_objectSpread2({}, ehWorkSystemPalette),
5007
5007
 
5008
5008
  var ehJobsSystemPalette = _objectSpread2(_objectSpread2({}, swagSystemPalette), {}, {
5009
5009
  name: 'ehJobs',
5010
- primary: '#7622d7',
5011
5010
  secondary: '#40d1ff',
5012
5011
  onSecondary: '#460078',
5013
5012
  secondaryHighlightedSurface: '#ecfaff',
@@ -8185,7 +8184,7 @@ var StyledText$4 = index$c(Text$1)(function (_ref) {
8185
8184
  });
8186
8185
  });
8187
8186
 
8188
- var _excluded$O = ["children", "fontSize", "fontWeight", "intent", "typeface", "allowFontScaling"];
8187
+ var _excluded$P = ["children", "fontSize", "fontWeight", "intent", "typeface", "allowFontScaling"];
8189
8188
  /**
8190
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.
8191
8190
  */
@@ -8201,7 +8200,7 @@ var Text = function Text(_ref) {
8201
8200
  typeface = _ref$typeface === void 0 ? 'neutral' : _ref$typeface,
8202
8201
  _ref$allowFontScaling = _ref.allowFontScaling,
8203
8202
  allowFontScaling = _ref$allowFontScaling === void 0 ? false : _ref$allowFontScaling,
8204
- nativeProps = _objectWithoutProperties(_ref, _excluded$O);
8203
+ nativeProps = _objectWithoutProperties(_ref, _excluded$P);
8205
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.');
8206
8205
  return /*#__PURE__*/React__default.createElement(StyledText$4, _extends$1({}, nativeProps, {
8207
8206
  themeFontSize: fontSize,
@@ -8254,10 +8253,10 @@ var pickAccessibilityProps = function pickAccessibilityProps(props) {
8254
8253
  }, {});
8255
8254
  };
8256
8255
 
8257
- var _excluded$N = ["children"];
8256
+ var _excluded$O = ["children"];
8258
8257
  var GradientText = function GradientText(_ref) {
8259
8258
  var children = _ref.children,
8260
- accessibilityProps = _objectWithoutProperties(_ref, _excluded$N);
8259
+ accessibilityProps = _objectWithoutProperties(_ref, _excluded$O);
8261
8260
  var theme = useTheme();
8262
8261
  var gradient = theme.colors.gradients.aiDiagonal;
8263
8262
  var _useState = useState(null),
@@ -8313,7 +8312,7 @@ var GradientText = function GradientText(_ref) {
8313
8312
  }, children));
8314
8313
  };
8315
8314
 
8316
- var _excluded$M = ["children", "fontWeight", "intent", "allowFontScaling", "fontStyle", "style", "testID"];
8315
+ var _excluded$N = ["children", "fontWeight", "intent", "allowFontScaling", "fontStyle", "style", "testID"];
8317
8316
  var Caption = function Caption(_ref) {
8318
8317
  var children = _ref.children,
8319
8318
  _ref$fontWeight = _ref.fontWeight,
@@ -8326,7 +8325,7 @@ var Caption = function Caption(_ref) {
8326
8325
  fontStyle = _ref$fontStyle === void 0 ? 'normal' : _ref$fontStyle,
8327
8326
  style = _ref.style,
8328
8327
  testID = _ref.testID,
8329
- nativeProps = _objectWithoutProperties(_ref, _excluded$M);
8328
+ nativeProps = _objectWithoutProperties(_ref, _excluded$N);
8330
8329
  var isAi = intent === 'ai';
8331
8330
  var styledText = /*#__PURE__*/React__default.createElement(StyledCaption, _extends$1({}, nativeProps, {
8332
8331
  themeFontWeight: fontWeight,
@@ -8358,7 +8357,7 @@ var StyledLabel$1 = index$c(Text$1)(function (_ref) {
8358
8357
  };
8359
8358
  });
8360
8359
 
8361
- var _excluded$L = ["children", "intent", "allowFontScaling", "fontStyle", "fontWeight", "style", "testID"];
8360
+ var _excluded$M = ["children", "intent", "allowFontScaling", "fontStyle", "fontWeight", "style", "testID"];
8362
8361
  var Label = function Label(_ref) {
8363
8362
  var children = _ref.children,
8364
8363
  _ref$intent = _ref.intent,
@@ -8371,7 +8370,7 @@ var Label = function Label(_ref) {
8371
8370
  fontWeight = _ref$fontWeight === void 0 ? 'regular' : _ref$fontWeight,
8372
8371
  style = _ref.style,
8373
8372
  testID = _ref.testID,
8374
- nativeProps = _objectWithoutProperties(_ref, _excluded$L);
8373
+ nativeProps = _objectWithoutProperties(_ref, _excluded$M);
8375
8374
  var isAi = intent === 'ai';
8376
8375
  var styledText = /*#__PURE__*/React__default.createElement(StyledLabel$1, _extends$1({}, nativeProps, {
8377
8376
  themeIntent: isAi ? 'body' : intent,
@@ -8402,7 +8401,7 @@ var StyledTitle$1 = index$c(Text$1)(function (_ref) {
8402
8401
  };
8403
8402
  });
8404
8403
 
8405
- var _excluded$K = ["children", "intent", "allowFontScaling", "level", "typeface", "fontStyle", "style", "testID"];
8404
+ var _excluded$L = ["children", "intent", "allowFontScaling", "level", "typeface", "fontStyle", "style", "testID"];
8406
8405
  var Title = function Title(_ref) {
8407
8406
  var children = _ref.children,
8408
8407
  _ref$intent = _ref.intent,
@@ -8417,7 +8416,7 @@ var Title = function Title(_ref) {
8417
8416
  fontStyle = _ref$fontStyle === void 0 ? 'normal' : _ref$fontStyle,
8418
8417
  style = _ref.style,
8419
8418
  testID = _ref.testID,
8420
- nativeProps = _objectWithoutProperties(_ref, _excluded$K);
8419
+ nativeProps = _objectWithoutProperties(_ref, _excluded$L);
8421
8420
  var isAi = intent === 'ai';
8422
8421
  var styledText = /*#__PURE__*/React__default.createElement(StyledTitle$1, _extends$1({}, nativeProps, {
8423
8422
  themeLevel: level,
@@ -8467,7 +8466,7 @@ var StyledBody$2 = index$c(Text$1)(function (_ref) {
8467
8466
  };
8468
8467
  });
8469
8468
 
8470
- var _excluded$J = ["children", "intent", "allowFontScaling", "typeface", "variant", "fontStyle", "style", "testID"];
8469
+ var _excluded$K = ["children", "intent", "allowFontScaling", "typeface", "variant", "fontStyle", "style", "testID"];
8471
8470
  var Body = function Body(_ref) {
8472
8471
  var children = _ref.children,
8473
8472
  _ref$intent = _ref.intent,
@@ -8482,7 +8481,7 @@ var Body = function Body(_ref) {
8482
8481
  fontStyle = _ref$fontStyle === void 0 ? 'normal' : _ref$fontStyle,
8483
8482
  style = _ref.style,
8484
8483
  testID = _ref.testID,
8485
- nativeProps = _objectWithoutProperties(_ref, _excluded$J);
8484
+ nativeProps = _objectWithoutProperties(_ref, _excluded$K);
8486
8485
  var isAi = intent === 'ai';
8487
8486
  var styledText = /*#__PURE__*/React__default.createElement(StyledBody$2, _extends$1({}, nativeProps, {
8488
8487
  themeTypeface: typeface,
@@ -9146,22 +9145,22 @@ var SpinWrapper = function SpinWrapper(_ref) {
9146
9145
  }, children);
9147
9146
  };
9148
9147
 
9149
- var _excluded$I = ["style"];
9148
+ var _excluded$J = ["style"];
9150
9149
  var AnimatedIcon = function AnimatedIcon(_ref) {
9151
9150
  var style = _ref.style,
9152
- otherProps = _objectWithoutProperties(_ref, _excluded$I);
9151
+ otherProps = _objectWithoutProperties(_ref, _excluded$J);
9153
9152
  return /*#__PURE__*/React__default.createElement(SpinWrapper, {
9154
9153
  style: style
9155
9154
  }, /*#__PURE__*/React__default.createElement(StyledHeroIcon, otherProps));
9156
9155
  };
9157
9156
 
9158
- var _excluded$H = ["name", "themeSize", "testID", "style"];
9157
+ var _excluded$I = ["name", "themeSize", "testID", "style"];
9159
9158
  var GradientIcon = function GradientIcon(_ref) {
9160
9159
  var name = _ref.name,
9161
9160
  themeSize = _ref.themeSize,
9162
9161
  testID = _ref.testID,
9163
9162
  style = _ref.style,
9164
- accessibilityProps = _objectWithoutProperties(_ref, _excluded$H);
9163
+ accessibilityProps = _objectWithoutProperties(_ref, _excluded$I);
9165
9164
  var theme = useTheme();
9166
9165
  var gradient = theme.colors.gradients.aiDiagonal;
9167
9166
  var size = theme.__hd__.icon.sizes[themeSize];
@@ -9289,7 +9288,7 @@ var AccordionItem = function AccordionItem(_ref) {
9289
9288
  }, content));
9290
9289
  };
9291
9290
 
9292
- var _excluded$G = ["key"];
9291
+ var _excluded$H = ["key"];
9293
9292
  var Accordion = function Accordion(_ref) {
9294
9293
  var items = _ref.items,
9295
9294
  activeItemKey = _ref.activeItemKey,
@@ -9312,7 +9311,7 @@ var Accordion = function Accordion(_ref) {
9312
9311
  accessible: accessible
9313
9312
  }, items.map(function (_ref2, index) {
9314
9313
  var key = _ref2.key,
9315
- props = _objectWithoutProperties(_ref2, _excluded$G);
9314
+ props = _objectWithoutProperties(_ref2, _excluded$H);
9316
9315
  var open = _activeItemKey === key;
9317
9316
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
9318
9317
  key: key
@@ -10148,7 +10147,7 @@ var borderWidths = {
10148
10147
  var config = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, colors), space), radii), borderWidths);
10149
10148
  var flexPropsKey = ['alignContent', 'alignItems', 'alignSelf', 'display', 'flex', 'flexBasis', 'flexDirection', 'flexGrow', 'flexShrink', 'flexWrap', 'justifyContent'];
10150
10149
 
10151
- var _excluded$F = ["theme"];
10150
+ var _excluded$G = ["theme"];
10152
10151
  var getThemeValue = function getThemeValue(theme, key, props) {
10153
10152
  var propConfig = config[key];
10154
10153
  var propValue = props[key];
@@ -10175,18 +10174,18 @@ var mapStylePropToThemeValue = function mapStylePropToThemeValue(theme, props) {
10175
10174
  var configKeys = Object.keys(config);
10176
10175
  var StyledBox = index$c(View)(function (_ref5) {
10177
10176
  var theme = _ref5.theme,
10178
- otherProps = _objectWithoutProperties(_ref5, _excluded$F);
10177
+ otherProps = _objectWithoutProperties(_ref5, _excluded$G);
10179
10178
  var styleProps = pick(configKeys, otherProps);
10180
10179
  var flexProps = pick(_toConsumableArray(flexPropsKey), otherProps);
10181
10180
  return _objectSpread2(_objectSpread2({}, mapStylePropToThemeValue(theme, styleProps)), flexProps);
10182
10181
  });
10183
10182
 
10184
- var _excluded$E = ["children", "style", "testID"];
10183
+ var _excluded$F = ["children", "style", "testID"];
10185
10184
  var Box = function Box(_ref) {
10186
10185
  var children = _ref.children,
10187
10186
  style = _ref.style,
10188
10187
  testID = _ref.testID,
10189
- otherProps = _objectWithoutProperties(_ref, _excluded$E);
10188
+ otherProps = _objectWithoutProperties(_ref, _excluded$F);
10190
10189
  return /*#__PURE__*/React__default.createElement(StyledBox, _extends$1({}, otherProps, {
10191
10190
  style: style,
10192
10191
  testID: testID
@@ -10457,7 +10456,7 @@ var StyledIcon$4 = index$c(Icon)(function (_ref6) {
10457
10456
  };
10458
10457
  });
10459
10458
 
10460
- var _excluded$D = ["children", "visible", "intent", "style", "testID"];
10459
+ var _excluded$E = ["children", "visible", "intent", "style", "testID"];
10461
10460
  var Status$1 = function Status(_ref) {
10462
10461
  var children = _ref.children,
10463
10462
  _ref$visible = _ref.visible,
@@ -10466,7 +10465,7 @@ var Status$1 = function Status(_ref) {
10466
10465
  intent = _ref$intent === void 0 ? 'danger' : _ref$intent,
10467
10466
  style = _ref.style,
10468
10467
  testID = _ref.testID,
10469
- nativeProps = _objectWithoutProperties(_ref, _excluded$D);
10468
+ nativeProps = _objectWithoutProperties(_ref, _excluded$E);
10470
10469
  var _React$useRef = React__default.useRef(new Animated.Value(visible ? 1 : 0)),
10471
10470
  opacity = _React$useRef.current;
10472
10471
  var isFirstRendering = React__default.useRef(true);
@@ -10502,7 +10501,7 @@ var Status$1 = function Status(_ref) {
10502
10501
 
10503
10502
  var DEFAULT_MAX_NUMBER = 99;
10504
10503
 
10505
- var _excluded$C = ["children", "visible", "style", "max", "testID", "content"];
10504
+ var _excluded$D = ["children", "visible", "style", "max", "testID", "content"];
10506
10505
  var Status = function Status(_ref) {
10507
10506
  var children = _ref.children,
10508
10507
  _ref$visible = _ref.visible,
@@ -10512,7 +10511,7 @@ var Status = function Status(_ref) {
10512
10511
  max = _ref$max === void 0 ? DEFAULT_MAX_NUMBER : _ref$max,
10513
10512
  testID = _ref.testID,
10514
10513
  originalContent = _ref.content,
10515
- nativeProps = _objectWithoutProperties(_ref, _excluded$C);
10514
+ nativeProps = _objectWithoutProperties(_ref, _excluded$D);
10516
10515
  var content = useMemo(function () {
10517
10516
  return originalContent > max ? "".concat(max, "+") : String(originalContent);
10518
10517
  }, [originalContent, max]);
@@ -10524,7 +10523,7 @@ var Status = function Status(_ref) {
10524
10523
  }, /*#__PURE__*/React__default.createElement(StyledCountText, null, content)));
10525
10524
  };
10526
10525
 
10527
- 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"];
10528
10527
  var getPaddingState = function getPaddingState(content) {
10529
10528
  return content.length > 1 ? 'wideContent' : 'narrowContent';
10530
10529
  };
@@ -10543,7 +10542,7 @@ var Badge$1 = function Badge(_ref) {
10543
10542
  _ref$variant = _ref.variant,
10544
10543
  variant = _ref$variant === void 0 ? 'filled' : _ref$variant,
10545
10544
  icon = _ref.icon,
10546
- nativeProps = _objectWithoutProperties(_ref, _excluded$B);
10545
+ nativeProps = _objectWithoutProperties(_ref, _excluded$C);
10547
10546
  var _React$useRef = React__default.useRef(new Animated.Value(visible ? 1 : 0)),
10548
10547
  opacity = _React$useRef.current;
10549
10548
  var isFirstRendering = React__default.useRef(true);
@@ -10661,7 +10660,7 @@ var StyledBottomBarText = index$c(Typography.Label)(function (_ref4) {
10661
10660
  };
10662
10661
  });
10663
10662
 
10664
- var _excluded$A = ["onTabPress", "renderActiveTabOnly", "selectedTabKey", "tabs"];
10663
+ var _excluded$B = ["onTabPress", "renderActiveTabOnly", "selectedTabKey", "tabs"];
10665
10664
  var getInactiveIcon = function getInactiveIcon(icon) {
10666
10665
  var inactiveIcon = "".concat(icon, "-outlined");
10667
10666
  return isHeroIcon(inactiveIcon) ? inactiveIcon : icon;
@@ -10672,7 +10671,7 @@ var BottomNavigation = function BottomNavigation(_ref) {
10672
10671
  renderActiveTabOnly = _ref$renderActiveTabO === void 0 ? false : _ref$renderActiveTabO,
10673
10672
  selectedTabKey = _ref.selectedTabKey,
10674
10673
  tabs = _ref.tabs,
10675
- nativeProps = _objectWithoutProperties(_ref, _excluded$A);
10674
+ nativeProps = _objectWithoutProperties(_ref, _excluded$B);
10676
10675
  var insets = useSafeAreaInsets();
10677
10676
  /**
10678
10677
  * List of loaded tabs, tabs will be loaded when navigated to.
@@ -10764,13 +10763,13 @@ var StyledDivider = index$c(View)(function (_ref) {
10764
10763
  }, horizontalMargin), verticalMargin);
10765
10764
  });
10766
10765
 
10767
- var _excluded$z = ["marginHorizontal", "marginVertical", "style", "testID"];
10766
+ var _excluded$A = ["marginHorizontal", "marginVertical", "style", "testID"];
10768
10767
  var Divider = function Divider(_ref) {
10769
10768
  var marginHorizontal = _ref.marginHorizontal,
10770
10769
  marginVertical = _ref.marginVertical,
10771
10770
  style = _ref.style,
10772
10771
  testID = _ref.testID,
10773
- nativeProps = _objectWithoutProperties(_ref, _excluded$z);
10772
+ nativeProps = _objectWithoutProperties(_ref, _excluded$A);
10774
10773
  return /*#__PURE__*/React__default.createElement(StyledDivider, _extends$1({}, nativeProps, {
10775
10774
  themeMarginHorizontal: marginHorizontal,
10776
10775
  themeMarginVertical: marginVertical,
@@ -10872,7 +10871,7 @@ var Footer$1 = function Footer(_ref) {
10872
10871
  };
10873
10872
 
10874
10873
  // eslint-disable-next-line @typescript-eslint/no-empty-function
10875
- var noop$2 = function noop() {};
10874
+ var noop$3 = function noop() {};
10876
10875
 
10877
10876
  var StyledLoadingIndicatorWrapper = index$c(View)({
10878
10877
  flexDirection: 'row',
@@ -10901,7 +10900,7 @@ var StyledLoadingDot = index$c(View)(function (_ref) {
10901
10900
  }, themeStyling());
10902
10901
  });
10903
10902
 
10904
- var _excluded$y = ["count", "size", "testID", "themeVariant"];
10903
+ var _excluded$z = ["count", "size", "testID", "themeVariant"];
10905
10904
  var AnimatedLoadingIndicatorWrapper = Animated.createAnimatedComponent(StyledLoadingIndicatorWrapper);
10906
10905
  var AnimatedLoadingDot = Animated.createAnimatedComponent(StyledLoadingDot);
10907
10906
  var renderDotComponent = function renderDotComponent(_ref) {
@@ -10933,7 +10932,7 @@ var LoadingIndicator = function LoadingIndicator(_ref2) {
10933
10932
  size = _ref2$size === void 0 ? 12 : _ref2$size,
10934
10933
  testID = _ref2.testID,
10935
10934
  themeVariant = _ref2.themeVariant,
10936
- nativeProps = _objectWithoutProperties(_ref2, _excluded$y);
10935
+ nativeProps = _objectWithoutProperties(_ref2, _excluded$z);
10937
10936
  var progressAnimation = useRef(new Animated.Value(0));
10938
10937
  useEffect(function () {
10939
10938
  var animation = Animated.loop(Animated.timing(progressAnimation.current, {
@@ -11537,7 +11536,7 @@ var Header = function Header(_ref) {
11537
11536
  var content = _ref.content,
11538
11537
  showDivider = _ref.showDivider,
11539
11538
  _ref$onRequestClose = _ref.onRequestClose,
11540
- onRequestClose = _ref$onRequestClose === void 0 ? noop$2 : _ref$onRequestClose,
11539
+ onRequestClose = _ref$onRequestClose === void 0 ? noop$3 : _ref$onRequestClose,
11541
11540
  showCloseButton = _ref.showCloseButton,
11542
11541
  _ref$variant = _ref.variant,
11543
11542
  variant = _ref$variant === void 0 ? 'fixed' : _ref$variant;
@@ -11565,11 +11564,11 @@ var Header = function Header(_ref) {
11565
11564
  }))) : null), showDivider ? /*#__PURE__*/React__default.createElement(Divider, null) : null);
11566
11565
  };
11567
11566
 
11568
- var _excluded$x = ["scrollEventThrottle"];
11567
+ var _excluded$y = ["scrollEventThrottle"];
11569
11568
  var BottomSheetScrollView = /*#__PURE__*/forwardRef(function (_ref, ref) {
11570
11569
  var _ref$scrollEventThrot = _ref.scrollEventThrottle,
11571
11570
  scrollEventThrottle = _ref$scrollEventThrot === void 0 ? 100 : _ref$scrollEventThrot,
11572
- props = _objectWithoutProperties(_ref, _excluded$x);
11571
+ props = _objectWithoutProperties(_ref, _excluded$y);
11573
11572
  var _useContext = useContext(BottomSheetContext),
11574
11573
  setInternalShowDivider = _useContext.setInternalShowDivider;
11575
11574
  var onScrollBeginDrag = useCallback(function (e) {
@@ -14183,7 +14182,7 @@ var setStartOrEndDate = function setStartOrEndDate(_ref2) {
14183
14182
  };
14184
14183
  };
14185
14184
  var shouldUseMonthPicker = function shouldUseMonthPicker(onMonthChange) {
14186
- return onMonthChange !== noop$2;
14185
+ return onMonthChange !== noop$3;
14187
14186
  };
14188
14187
  var getCalendarDate = function getCalendarDate(_ref3) {
14189
14188
  var visibleDate = _ref3.visibleDate,
@@ -14319,20 +14318,20 @@ var CalendarRange = function CalendarRange(_ref) {
14319
14318
  visibleDate = _ref.visibleDate,
14320
14319
  onChange = _ref.onChange,
14321
14320
  _ref$onPreviousPress = _ref.onPreviousPress,
14322
- onPreviousPress = _ref$onPreviousPress === void 0 ? noop$2 : _ref$onPreviousPress,
14321
+ onPreviousPress = _ref$onPreviousPress === void 0 ? noop$3 : _ref$onPreviousPress,
14323
14322
  _ref$onNextPress = _ref.onNextPress,
14324
- onNextPress = _ref$onNextPress === void 0 ? noop$2 : _ref$onNextPress,
14323
+ onNextPress = _ref$onNextPress === void 0 ? noop$3 : _ref$onNextPress,
14325
14324
  _ref$onTitlePress = _ref.onTitlePress,
14326
- onTitlePress = _ref$onTitlePress === void 0 ? noop$2 : _ref$onTitlePress,
14325
+ onTitlePress = _ref$onTitlePress === void 0 ? noop$3 : _ref$onTitlePress,
14327
14326
  minDate = _ref.minDate,
14328
14327
  maxDate = _ref.maxDate,
14329
14328
  _ref$markedDates = _ref.markedDates,
14330
14329
  markedDates = _ref$markedDates === void 0 ? [] : _ref$markedDates,
14331
14330
  testID = _ref.testID,
14332
14331
  _ref$onMonthChange = _ref.onMonthChange,
14333
- onMonthChange = _ref$onMonthChange === void 0 ? noop$2 : _ref$onMonthChange,
14332
+ onMonthChange = _ref$onMonthChange === void 0 ? noop$3 : _ref$onMonthChange,
14334
14333
  _ref$onToggleMonthPic = _ref.onToggleMonthPicker,
14335
- onToggleMonthPicker = _ref$onToggleMonthPic === void 0 ? noop$2 : _ref$onToggleMonthPic,
14334
+ onToggleMonthPicker = _ref$onToggleMonthPic === void 0 ? noop$3 : _ref$onToggleMonthPic,
14336
14335
  monthPickerConfirmLabel = _ref.monthPickerConfirmLabel,
14337
14336
  monthPickerCancelLabel = _ref.monthPickerCancelLabel;
14338
14337
  var theme = useTheme();
@@ -14500,20 +14499,20 @@ var Calendar$1 = function Calendar(_ref) {
14500
14499
  visibleDate = _ref.visibleDate,
14501
14500
  onChange = _ref.onChange,
14502
14501
  _ref$onPreviousPress = _ref.onPreviousPress,
14503
- onPreviousPress = _ref$onPreviousPress === void 0 ? noop$2 : _ref$onPreviousPress,
14502
+ onPreviousPress = _ref$onPreviousPress === void 0 ? noop$3 : _ref$onPreviousPress,
14504
14503
  _ref$onNextPress = _ref.onNextPress,
14505
- onNextPress = _ref$onNextPress === void 0 ? noop$2 : _ref$onNextPress,
14504
+ onNextPress = _ref$onNextPress === void 0 ? noop$3 : _ref$onNextPress,
14506
14505
  _ref$onTitlePress = _ref.onTitlePress,
14507
- onTitlePress = _ref$onTitlePress === void 0 ? noop$2 : _ref$onTitlePress,
14506
+ onTitlePress = _ref$onTitlePress === void 0 ? noop$3 : _ref$onTitlePress,
14508
14507
  minDate = _ref.minDate,
14509
14508
  maxDate = _ref.maxDate,
14510
14509
  _ref$markedDates = _ref.markedDates,
14511
14510
  markedDates = _ref$markedDates === void 0 ? [] : _ref$markedDates,
14512
14511
  testID = _ref.testID,
14513
14512
  _ref$onMonthChange = _ref.onMonthChange,
14514
- onMonthChange = _ref$onMonthChange === void 0 ? noop$2 : _ref$onMonthChange,
14513
+ onMonthChange = _ref$onMonthChange === void 0 ? noop$3 : _ref$onMonthChange,
14515
14514
  _ref$onToggleMonthPic = _ref.onToggleMonthPicker,
14516
- onToggleMonthPicker = _ref$onToggleMonthPic === void 0 ? noop$2 : _ref$onToggleMonthPic,
14515
+ onToggleMonthPicker = _ref$onToggleMonthPic === void 0 ? noop$3 : _ref$onToggleMonthPic,
14517
14516
  monthPickerConfirmLabel = _ref.monthPickerConfirmLabel,
14518
14517
  monthPickerCancelLabel = _ref.monthPickerCancelLabel;
14519
14518
  var theme = useTheme();
@@ -14691,12 +14690,12 @@ var Indicator = index$c(View)(function (_ref3) {
14691
14690
  };
14692
14691
  });
14693
14692
 
14694
- var _excluded$w = ["intent", "children"];
14693
+ var _excluded$x = ["intent", "children"];
14695
14694
  var DataCard = function DataCard(_ref) {
14696
14695
  var _ref$intent = _ref.intent,
14697
14696
  intent = _ref$intent === void 0 ? 'info' : _ref$intent,
14698
14697
  children = _ref.children,
14699
- nativeProps = _objectWithoutProperties(_ref, _excluded$w);
14698
+ nativeProps = _objectWithoutProperties(_ref, _excluded$x);
14700
14699
  return /*#__PURE__*/React__default.createElement(StyledDataCard, nativeProps, /*#__PURE__*/React__default.createElement(Indicator, {
14701
14700
  themeIntent: intent,
14702
14701
  testID: "data-card-indicator"
@@ -14715,13 +14714,13 @@ var StyledCard$1 = index$c(View)(function (_ref) {
14715
14714
  });
14716
14715
  });
14717
14716
 
14718
- var _excluded$v = ["intent", "children", "variant"];
14717
+ var _excluded$w = ["intent", "children", "variant"];
14719
14718
  var Card$1 = function Card(_ref) {
14720
14719
  var intent = _ref.intent,
14721
14720
  children = _ref.children,
14722
14721
  _ref$variant = _ref.variant,
14723
14722
  variant = _ref$variant === void 0 ? 'basic' : _ref$variant,
14724
- nativeProps = _objectWithoutProperties(_ref, _excluded$v);
14723
+ nativeProps = _objectWithoutProperties(_ref, _excluded$w);
14725
14724
  return /*#__PURE__*/React__default.createElement(StyledCard$1, _extends$1({}, nativeProps, {
14726
14725
  themeIntent: intent,
14727
14726
  themeVariant: variant
@@ -14988,7 +14987,7 @@ var CardCarousel = /*#__PURE__*/forwardRef(function (_ref, ref) {
14988
14987
  });
14989
14988
  CardCarousel.displayName = 'CardCarousel';
14990
14989
 
14991
- var _excluded$u = ["rounded", "size", "testID", "style"];
14990
+ var _excluded$v = ["rounded", "size", "testID", "style"];
14992
14991
  /**
14993
14992
  * @deprecated Image component will soon be deprecated. Please use `Image` from `react-native` instead.
14994
14993
  */
@@ -14999,7 +14998,7 @@ var Image = function Image(_ref) {
14999
14998
  size = _ref$size === void 0 ? '6xlarge' : _ref$size,
15000
14999
  testID = _ref.testID,
15001
15000
  style = _ref.style,
15002
- imageNativeProps = _objectWithoutProperties(_ref, _excluded$u);
15001
+ imageNativeProps = _objectWithoutProperties(_ref, _excluded$v);
15003
15002
  useDeprecation('Image component will soon be deprecated. Please use `Image` from `react-native` instead.');
15004
15003
  var theme = useTheme();
15005
15004
  var imageSize = theme.__hd__.image.sizes[size];
@@ -15134,7 +15133,7 @@ var CarouselItem = function CarouselItem(_ref) {
15134
15133
  }, heading), !!body && /*#__PURE__*/React__default.createElement(Typography.Body, null, body)));
15135
15134
  };
15136
15135
 
15137
- var _excluded$t = ["items", "onItemIndexChange", "renderActions", "selectedItemIndex", "style", "shouldShowPagination", "testID", "pageControlPosition"];
15136
+ var _excluded$u = ["items", "onItemIndexChange", "renderActions", "selectedItemIndex", "style", "shouldShowPagination", "testID", "pageControlPosition"];
15138
15137
  function useStateFromProp(initialValue) {
15139
15138
  var _useState = useState(initialValue),
15140
15139
  _useState2 = _slicedToArray(_useState, 2),
@@ -15145,7 +15144,7 @@ function useStateFromProp(initialValue) {
15145
15144
  }, [initialValue]);
15146
15145
  return [value, setValue];
15147
15146
  }
15148
- var noop$1 = function noop(_) {
15147
+ var noop$2 = function noop(_) {
15149
15148
  return true;
15150
15149
  };
15151
15150
  var Carousel = function Carousel(_ref) {
@@ -15157,12 +15156,12 @@ var Carousel = function Carousel(_ref) {
15157
15156
  selectedItemIndex = _ref$selectedItemInde === void 0 ? 0 : _ref$selectedItemInde,
15158
15157
  style = _ref.style,
15159
15158
  _ref$shouldShowPagina = _ref.shouldShowPagination,
15160
- shouldShowPagination = _ref$shouldShowPagina === void 0 ? noop$1 : _ref$shouldShowPagina,
15159
+ shouldShowPagination = _ref$shouldShowPagina === void 0 ? noop$2 : _ref$shouldShowPagina,
15161
15160
  testID = _ref.testID,
15162
15161
  _ref$pageControlPosit = _ref.pageControlPosition,
15163
15162
  pageControlPosition = _ref$pageControlPosit === void 0 ? 'top' : _ref$pageControlPosit,
15164
- nativeProps = _objectWithoutProperties(_ref, _excluded$t);
15165
- 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);
15166
15165
  useDeprecation("The use of 'pageControlPosition == bottom' has been deprecated", pageControlPosition === 'bottom');
15167
15166
  var theme = useTheme();
15168
15167
  var carouselRef = useRef(null);
@@ -15883,7 +15882,7 @@ function range(start, stop, step) {
15883
15882
  return range;
15884
15883
  }
15885
15884
 
15886
- var noop = {
15885
+ var noop$1 = {
15887
15886
  value: function value() {}
15888
15887
  };
15889
15888
  function dispatch() {
@@ -15957,7 +15956,7 @@ function get$1(type, name) {
15957
15956
  function set$1(type, name, callback) {
15958
15957
  for (var i = 0, n = type.length; i < n; ++i) {
15959
15958
  if (type[i].name === name) {
15960
- 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));
15961
15960
  break;
15962
15961
  }
15963
15962
  }
@@ -20432,7 +20431,7 @@ var StyledChipIcon = index$c(Icon)(function (_ref2) {
20432
20431
  };
20433
20432
  });
20434
20433
 
20435
- 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"];
20436
20435
  var getChipLabel = function getChipLabel(label) {
20437
20436
  if (typeof label === 'string') {
20438
20437
  return /*#__PURE__*/React__default.createElement(Typography.Body, {
@@ -20468,7 +20467,7 @@ var Chip = function Chip(_ref) {
20468
20467
  accessible = _ref.accessible,
20469
20468
  onBlur = _ref.onBlur,
20470
20469
  onFocus = _ref.onFocus,
20471
- otherProps = _objectWithoutProperties(_ref, _excluded$s);
20470
+ otherProps = _objectWithoutProperties(_ref, _excluded$t);
20472
20471
  useDeprecation('Chip variant `outlined` and `filled` are deprecated.', variant === 'outlined' || variant === 'filled');
20473
20472
  var renamedVariant = getChipVariant(variant);
20474
20473
  var shouldShowSelectedIcon = (renamedVariant === 'selection' || renamedVariant === 'compact-outlined') && selected && showSelectedIcon;
@@ -20859,7 +20858,7 @@ var StyledErrorAndMaxLengthContainer = index$c(View)(function (_ref14) {
20859
20858
  };
20860
20859
  });
20861
20860
 
20862
- 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"];
20863
20862
  var getState$3 = function getState(_ref) {
20864
20863
  var disabled = _ref.disabled,
20865
20864
  error = _ref.error,
@@ -20975,7 +20974,7 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref8, ref) {
20975
20974
  allowFontScaling = _ref8$allowFontScalin === void 0 ? false : _ref8$allowFontScalin,
20976
20975
  _ref8$variant = _ref8.variant,
20977
20976
  variant = _ref8$variant === void 0 ? 'text' : _ref8$variant,
20978
- nativeProps = _objectWithoutProperties(_ref8, _excluded$r);
20977
+ nativeProps = _objectWithoutProperties(_ref8, _excluded$s);
20979
20978
  var displayText = getDisplayText(value, defaultValue);
20980
20979
  var isEmptyValue = displayText.length === 0;
20981
20980
  var _React$useState = React__default.useState(0),
@@ -21722,11 +21721,11 @@ var DatePickerIOS = function DatePickerIOS(_ref) {
21722
21721
  }));
21723
21722
  };
21724
21723
 
21725
- var _excluded$q = ["variant"];
21724
+ var _excluded$r = ["variant"];
21726
21725
  var DatePicker = function DatePicker(_ref) {
21727
21726
  var _ref$variant = _ref.variant,
21728
21727
  variant = _ref$variant === void 0 ? 'default' : _ref$variant,
21729
- props = _objectWithoutProperties(_ref, _excluded$q);
21728
+ props = _objectWithoutProperties(_ref, _excluded$r);
21730
21729
  if (variant === 'calendar') {
21731
21730
  return /*#__PURE__*/React__default.createElement(DatePickerCalendar, props);
21732
21731
  }
@@ -21807,7 +21806,7 @@ var StyledDragableDrawerContainer = index$c(Animated.View)(function (_ref5) {
21807
21806
  backgroundColor: theme.__hd__.drawer.colors.background,
21808
21807
  elevation: enableShadow ? theme.__hd__.drawer.shadows.elevation : undefined,
21809
21808
  overflow: 'hidden',
21810
- maxHeight: '100%'
21809
+ height: '100%'
21811
21810
  };
21812
21811
  });
21813
21812
  var StyledHandlerContainer$1 = index$c(View)(function (_ref6) {
@@ -21828,6 +21827,23 @@ var StyledHandler = index$c(View)(function (_ref7) {
21828
21827
  };
21829
21828
  });
21830
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
+
21831
21847
  var getOffset = function getOffset(height, percentage) {
21832
21848
  if (percentage < 0) return height;
21833
21849
  if (percentage > 100) return 0;
@@ -21856,34 +21872,39 @@ var calculateAnimatedToValue = function calculateAnimatedToValue(position, heigh
21856
21872
  return heightSnapPoints[minIndex];
21857
21873
  };
21858
21874
 
21859
- var DragableDrawer = function DragableDrawer(_ref) {
21860
- 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,
21861
21880
  initialHeightPercentage = _ref.initialHeightPercentage,
21862
- _ref$minimumHeightPer = _ref.minimumHeightPercentage,
21863
- minimumHeightPercentage = _ref$minimumHeightPer === void 0 ? 10 : _ref$minimumHeightPer,
21864
- _ref$snapPoints = _ref.snapPoints,
21865
- snapPoints = _ref$snapPoints === void 0 ? [] : _ref$snapPoints,
21881
+ minimumHeightPercentage = _ref.minimumHeightPercentage,
21882
+ snapPoints = _ref.snapPoints,
21866
21883
  onExpanded = _ref.onExpanded,
21867
- onCollapsed = _ref.onCollapsed,
21868
- testID = _ref.testID;
21869
- var _useState = useState(0),
21870
- _useState2 = _slicedToArray(_useState, 2),
21871
- height = _useState2[0],
21872
- setHeight = _useState2[1];
21884
+ onCollapsed = _ref.onCollapsed;
21873
21885
  var baseHeightForMeasure = useRef(0);
21874
21886
  var snapPointsData = useRef({
21875
21887
  list: [],
21876
21888
  minHeightOffset: 0,
21877
21889
  maxHeightOffset: 0
21878
21890
  });
21879
- // Track drag
21880
21891
  var pan = useRef(new Animated.Value(0)).current;
21881
21892
  var offset = useRef(0);
21882
21893
  var offsetBeforePan = useRef(0);
21883
- 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),
21884
21899
  _useState4 = _slicedToArray(_useState3, 2),
21885
- animatedToValue = _useState4[0],
21886
- 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
+ }, []);
21887
21908
  useEffect(function () {
21888
21909
  var id = pan.addListener(function (_ref2) {
21889
21910
  var value = _ref2.value;
@@ -21898,13 +21919,12 @@ var DragableDrawer = function DragableDrawer(_ref) {
21898
21919
  var initialOffset = getOffset(height, initialHeightPercentage || minimumHeightPercentage);
21899
21920
  setAnimatedToValue(initialOffset);
21900
21921
  }
21901
- }, [height]);
21922
+ }, [height, initialHeightPercentage, minimumHeightPercentage]);
21902
21923
  useEffect(function () {
21903
21924
  if (height > 0) {
21904
21925
  pan.setValue(height);
21905
21926
  offset.current = height;
21906
21927
  baseHeightForMeasure.current = height;
21907
- // Calculate snap points information
21908
21928
  snapPointsData.current = calculateSnapPointsData(minimumHeightPercentage, height, snapPoints);
21909
21929
  }
21910
21930
  }, [height, minimumHeightPercentage]);
@@ -21915,11 +21935,18 @@ var DragableDrawer = function DragableDrawer(_ref) {
21915
21935
  useNativeDriver: Platform.OS !== 'web',
21916
21936
  easing: Easing.inOut(Easing.cubic)
21917
21937
  });
21918
- animation.start(function () {
21919
- if (animatedToValue === 0) {
21920
- onExpanded === null || onExpanded === void 0 || onExpanded();
21921
- } else if (animatedToValue === getOffset(height, minimumHeightPercentage)) {
21922
- 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
+ }
21923
21950
  }
21924
21951
  setAnimatedToValue(-1);
21925
21952
  });
@@ -21927,41 +21954,130 @@ var DragableDrawer = function DragableDrawer(_ref) {
21927
21954
  return animation.stop();
21928
21955
  };
21929
21956
  }
21930
- }, [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
+ }, []);
21931
22012
  var panResponder = useRef(PanResponder.create({
21932
22013
  onMoveShouldSetPanResponder: function onMoveShouldSetPanResponder() {
21933
22014
  return true;
21934
22015
  },
21935
22016
  onPanResponderGrant: function onPanResponderGrant() {
21936
- offsetBeforePan.current = offset.current;
21937
- pan.setOffset(offset.current);
21938
- pan.setValue(0);
22017
+ return beginPan();
21939
22018
  },
21940
22019
  onPanResponderMove: function onPanResponderMove(_, gesture) {
21941
- var _snapPointsData$curre;
21942
- var panDistance = gesture.dy;
21943
- // Moving toward top, stop at highest snap point
21944
- if (offsetBeforePan.current + panDistance < 0) {
21945
- pan.setValue(-offsetBeforePan.current);
21946
- return;
21947
- }
21948
- // Moving toward bottom, stop at lowest snap point
21949
- if (offsetBeforePan.current + panDistance > ((_snapPointsData$curre = snapPointsData.current) === null || _snapPointsData$curre === void 0 ? void 0 : _snapPointsData$curre.minHeightOffset)) {
21950
- pan.setValue(baseHeightForMeasure.current - baseHeightForMeasure.current * (minimumHeightPercentage / 100) - offsetBeforePan.current);
21951
- return;
21952
- }
21953
- pan.setValue(panDistance);
22020
+ return movePan(gesture.dy);
21954
22021
  },
21955
22022
  onPanResponderRelease: function onPanResponderRelease(_, gesture) {
21956
- pan.flattenOffset();
21957
- // Attach to nearest snappoint
21958
- var panDistance = gesture.dy;
21959
- var offsetAfterPan = offsetBeforePan.current + panDistance;
21960
- var animatedValue = calculateAnimatedToValue(offsetAfterPan, snapPointsData.current.list);
21961
- setAnimatedToValue(animatedValue);
22023
+ return releasePan(gesture.dy, gesture.vy);
21962
22024
  }
21963
22025
  })).current;
21964
- 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, {
21965
22081
  testID: testID,
21966
22082
  enableShadow: true,
21967
22083
  pointerEvents: "box-none"
@@ -21969,16 +22085,106 @@ var DragableDrawer = function DragableDrawer(_ref) {
21969
22085
  enableShadow: true,
21970
22086
  style: {
21971
22087
  transform: [{
21972
- scaleY: baseHeightForMeasure.current > 0 ? 1 : 0
22088
+ scaleY: height > 0 ? 1 : 0
21973
22089
  }, {
21974
22090
  translateY: pan
21975
22091
  }]
21976
22092
  },
21977
- onLayout: function onLayout(_ref3) {
21978
- var nativeEvent = _ref3.nativeEvent;
22093
+ onLayout: function onLayout(_ref2) {
22094
+ var nativeEvent = _ref2.nativeEvent;
21979
22095
  setHeight(nativeEvent.layout.height);
21980
22096
  }
21981
- }, /*#__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));
21982
22188
  };
21983
22189
 
21984
22190
  var BACKDROP_OPACITY = 0.56;
@@ -22039,7 +22245,8 @@ var Drawer = function Drawer(_ref) {
22039
22245
  }, children));
22040
22246
  };
22041
22247
  var index$7 = Object.assign(Drawer, {
22042
- Dragable: DragableDrawer
22248
+ Dragable: DragableDrawer,
22249
+ DragableScrollView: DragableScrollView
22043
22250
  });
22044
22251
 
22045
22252
  var DEFAULT_ILLUSTRATION_SIZE = scale(72);
@@ -24164,7 +24371,7 @@ var FABWithTitleStyle = /*#__PURE__*/forwardRef(function (_ref3, ref) {
24164
24371
  return {
24165
24372
  show: function show() {
24166
24373
  var animated = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
24167
- 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;
24168
24375
  setDisplayState({
24169
24376
  hideButton: false,
24170
24377
  hideTitle: false
@@ -24185,7 +24392,7 @@ var FABWithTitleStyle = /*#__PURE__*/forwardRef(function (_ref3, ref) {
24185
24392
  },
24186
24393
  collapse: function collapse() {
24187
24394
  var animated = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
24188
- 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;
24189
24396
  setDisplayState({
24190
24397
  hideButton: false,
24191
24398
  hideTitle: true
@@ -24206,7 +24413,7 @@ var FABWithTitleStyle = /*#__PURE__*/forwardRef(function (_ref3, ref) {
24206
24413
  },
24207
24414
  hide: function hide() {
24208
24415
  var animated = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
24209
- 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;
24210
24417
  if (animated) {
24211
24418
  Animated.stagger(20, [Animated.spring(animatedValues.opacity, {
24212
24419
  toValue: 0,
@@ -27531,7 +27738,7 @@ var SuccessPage = function SuccessPage(_ref2) {
27531
27738
  testID = _ref2.testID,
27532
27739
  ctaText = _ref2.ctaText,
27533
27740
  _ref2$onCtaPress = _ref2.onCtaPress,
27534
- onCtaPress = _ref2$onCtaPress === void 0 ? noop$2 : _ref2$onCtaPress,
27741
+ onCtaPress = _ref2$onCtaPress === void 0 ? noop$3 : _ref2$onCtaPress,
27535
27742
  secondaryCtaText = _ref2.secondaryCtaText,
27536
27743
  onSecondaryCtaPress = _ref2.onSecondaryCtaPress,
27537
27744
  icon = _ref2.icon,