@hero-design/rn 8.3.4 → 8.5.0-alpha.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.
Files changed (36) hide show
  1. package/.turbo/turbo-build.log +66 -9
  2. package/assets/fonts/hero-icons-mobile.ttf +0 -0
  3. package/es/index.js +473 -133
  4. package/lib/index.js +473 -133
  5. package/package.json +5 -7
  6. package/rollup.config.js +0 -1
  7. package/src/components/Carousel/CarouselItem.tsx +3 -1
  8. package/src/components/Carousel/StyledCarousel.tsx +2 -0
  9. package/src/components/Carousel/__tests__/__snapshots__/index.spec.tsx.snap +18 -15
  10. package/src/components/Icon/HeroIcon/glyphMap.json +1 -1
  11. package/src/components/Icon/IconList.ts +9 -0
  12. package/src/components/List/ListItem.tsx +1 -5
  13. package/src/components/List/__tests__/__snapshots__/ListItem.spec.tsx.snap +8 -8
  14. package/src/components/Select/BaseOptionList.tsx +5 -12
  15. package/src/components/Select/MultiSelect/OptionList.tsx +6 -6
  16. package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +3 -0
  17. package/src/components/Select/MultiSelect/index.tsx +9 -0
  18. package/src/components/Select/SingleSelect/OptionList.tsx +5 -3
  19. package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +24 -4
  20. package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +21 -3
  21. package/src/components/Select/SingleSelect/index.tsx +8 -0
  22. package/src/components/Swipeable/Buttons.tsx +65 -0
  23. package/src/components/Swipeable/StyledSwipeable.tsx +14 -2
  24. package/src/components/Swipeable/SwipeableAction.tsx +15 -7
  25. package/src/components/Swipeable/index.tsx +531 -136
  26. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +1 -1
  27. package/src/theme/components/carousel.ts +1 -1
  28. package/types/components/Calendar/helpers.d.ts +2 -2
  29. package/types/components/Select/helpers.d.ts +1 -1
  30. package/types/components/Swipeable/Buttons.d.ts +15 -0
  31. package/types/components/Swipeable/StyledSwipeable.d.ts +15 -2
  32. package/types/components/Swipeable/SwipeableAction.d.ts +10 -6
  33. package/types/components/Swipeable/index.d.ts +24 -41
  34. package/types/components/Toolbar/index.d.ts +2 -3
  35. package/types/testHelpers/renderWithTheme.d.ts +1 -1
  36. package/.turbo/turbo-publish:npm.log +0 -0
package/es/index.js CHANGED
@@ -5,7 +5,6 @@ import { createIconSet } from 'react-native-vector-icons';
5
5
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
6
6
  import DateTimePicker from '@react-native-community/datetimepicker';
7
7
  import RnSlider from '@react-native-community/slider';
8
- import { RectButton, GestureHandlerRootView, Swipeable as Swipeable$1 } from 'react-native-gesture-handler';
9
8
  import PagerView from 'react-native-pager-view';
10
9
  import { EventEmitter } from 'events';
11
10
  import { WebView } from 'react-native-webview';
@@ -5607,7 +5606,7 @@ var index$a = components.reduce(function (acc, comp) {
5607
5606
  });
5608
5607
  }, styled);
5609
5608
 
5610
- var StyledWrapper$b = index$a(Animated.View)(function () {
5609
+ var StyledWrapper$c = index$a(Animated.View)(function () {
5611
5610
  return {
5612
5611
  margin: 0,
5613
5612
  padding: 0,
@@ -5681,7 +5680,7 @@ var Collapse = function Collapse(_ref) {
5681
5680
  var height = _ref2.height;
5682
5681
  setContentHeight(height);
5683
5682
  }, []);
5684
- return /*#__PURE__*/React.createElement(StyledWrapper$b, {
5683
+ return /*#__PURE__*/React.createElement(StyledWrapper$c, {
5685
5684
  style: {
5686
5685
  height: collapseAnim
5687
5686
  },
@@ -5694,7 +5693,7 @@ var Collapse = function Collapse(_ref) {
5694
5693
  }, children)));
5695
5694
  };
5696
5695
 
5697
- var StyledWrapper$a = index$a(View)(function () {
5696
+ var StyledWrapper$b = index$a(View)(function () {
5698
5697
  return {};
5699
5698
  });
5700
5699
  var StyledItemWrapper = index$a(View)(function (_ref) {
@@ -5747,7 +5746,7 @@ var StyledText$3 = index$a(Text$1)(function (_ref) {
5747
5746
  });
5748
5747
  });
5749
5748
 
5750
- var _excluded$m = ["children", "fontSize", "fontWeight", "intent", "typeface"];
5749
+ var _excluded$l = ["children", "fontSize", "fontWeight", "intent", "typeface"];
5751
5750
  var Text = function Text(_ref) {
5752
5751
  var children = _ref.children,
5753
5752
  _ref$fontSize = _ref.fontSize,
@@ -5758,7 +5757,7 @@ var Text = function Text(_ref) {
5758
5757
  intent = _ref$intent === void 0 ? 'body' : _ref$intent,
5759
5758
  _ref$typeface = _ref.typeface,
5760
5759
  typeface = _ref$typeface === void 0 ? 'neutral' : _ref$typeface,
5761
- nativeProps = _objectWithoutProperties(_ref, _excluded$m);
5760
+ nativeProps = _objectWithoutProperties(_ref, _excluded$l);
5762
5761
  return /*#__PURE__*/React.createElement(StyledText$3, _extends$1({}, nativeProps, {
5763
5762
  themeFontSize: fontSize,
5764
5763
  themeFontWeight: fontWeight,
@@ -6237,10 +6236,10 @@ var StyledHeroIcon = index$a(HeroIcon)(function (_ref) {
6237
6236
  };
6238
6237
  });
6239
6238
 
6240
- var _excluded$l = ["style"];
6239
+ var _excluded$k = ["style"];
6241
6240
  var AnimatedIcon = function AnimatedIcon(_ref) {
6242
6241
  var style = _ref.style,
6243
- otherProps = _objectWithoutProperties(_ref, _excluded$l);
6242
+ otherProps = _objectWithoutProperties(_ref, _excluded$k);
6244
6243
  var rotateAnimation = useRef(new Animated.Value(0));
6245
6244
  useEffect(function () {
6246
6245
  var animation = Animated.loop(Animated.timing(rotateAnimation.current, {
@@ -6346,7 +6345,7 @@ var AccordionItem = function AccordionItem(_ref) {
6346
6345
  }, content));
6347
6346
  };
6348
6347
 
6349
- var _excluded$k = ["key"];
6348
+ var _excluded$j = ["key"];
6350
6349
  var Accordion = function Accordion(_ref) {
6351
6350
  var items = _ref.items,
6352
6351
  activeItemKey = _ref.activeItemKey,
@@ -6362,12 +6361,12 @@ var Accordion = function Accordion(_ref) {
6362
6361
  _usePropsOrInternalSt2 = _slicedToArray(_usePropsOrInternalSt, 2),
6363
6362
  _activeItemKey = _usePropsOrInternalSt2[0],
6364
6363
  _onItemPress = _usePropsOrInternalSt2[1];
6365
- return /*#__PURE__*/React.createElement(StyledWrapper$a, {
6364
+ return /*#__PURE__*/React.createElement(StyledWrapper$b, {
6366
6365
  style: style,
6367
6366
  testID: testID
6368
6367
  }, items.map(function (_ref2, index) {
6369
6368
  var key = _ref2.key,
6370
- props = _objectWithoutProperties(_ref2, _excluded$k);
6369
+ props = _objectWithoutProperties(_ref2, _excluded$j);
6371
6370
  var open = _activeItemKey === key;
6372
6371
  return /*#__PURE__*/React.createElement(React.Fragment, {
6373
6372
  key: key
@@ -6549,7 +6548,7 @@ var Attachment = function Attachment(_ref) {
6549
6548
  })) : null);
6550
6549
  };
6551
6550
 
6552
- var StyledWrapper$9 = index$a(TouchableOpacity)(function (_ref) {
6551
+ var StyledWrapper$a = index$a(TouchableOpacity)(function (_ref) {
6553
6552
  var themeSize = _ref.themeSize,
6554
6553
  themeIntent = _ref.themeIntent,
6555
6554
  theme = _ref.theme;
@@ -6604,7 +6603,7 @@ var Avatar = function Avatar(_ref) {
6604
6603
  hasImageError = _useState2[0],
6605
6604
  setHasImageError = _useState2[1];
6606
6605
  if (title === undefined && source === undefined) return null;
6607
- return /*#__PURE__*/React.createElement(StyledWrapper$9, {
6606
+ return /*#__PURE__*/React.createElement(StyledWrapper$a, {
6608
6607
  testID: testID,
6609
6608
  onPress: onPress,
6610
6609
  disabled: onPress === undefined,
@@ -6628,7 +6627,7 @@ var Avatar = function Avatar(_ref) {
6628
6627
  };
6629
6628
 
6630
6629
  var VISIBLE_RATIO = 0.7;
6631
- var StyledWrapper$8 = index$a(View)(function (_ref) {
6630
+ var StyledWrapper$9 = index$a(View)(function (_ref) {
6632
6631
  var theme = _ref.theme,
6633
6632
  themeSize = _ref.themeSize,
6634
6633
  themeAvatarCount = _ref.themeAvatarCount;
@@ -6690,7 +6689,7 @@ var AvatarStack = function AvatarStack(_ref) {
6690
6689
  });
6691
6690
  avatars.push(remainingAvatar);
6692
6691
  }
6693
- return /*#__PURE__*/React.createElement(StyledWrapper$8, {
6692
+ return /*#__PURE__*/React.createElement(StyledWrapper$9, {
6694
6693
  themeSize: size,
6695
6694
  themeAvatarCount: avatars.length,
6696
6695
  style: style,
@@ -6749,7 +6748,7 @@ var StyledStatus = index$a(Animated.View)(function (_ref3) {
6749
6748
  };
6750
6749
  });
6751
6750
 
6752
- var _excluded$j = ["children", "visible", "intent", "style", "testID"];
6751
+ var _excluded$i = ["children", "visible", "intent", "style", "testID"];
6753
6752
  var Status = function Status(_ref) {
6754
6753
  var children = _ref.children,
6755
6754
  _ref$visible = _ref.visible,
@@ -6758,7 +6757,7 @@ var Status = function Status(_ref) {
6758
6757
  intent = _ref$intent === void 0 ? 'danger' : _ref$intent,
6759
6758
  style = _ref.style,
6760
6759
  testID = _ref.testID,
6761
- nativeProps = _objectWithoutProperties(_ref, _excluded$j);
6760
+ nativeProps = _objectWithoutProperties(_ref, _excluded$i);
6762
6761
  var _React$useRef = React.useRef(new Animated.Value(visible ? 1 : 0)),
6763
6762
  opacity = _React$useRef.current;
6764
6763
  var isFirstRendering = React.useRef(true);
@@ -6791,7 +6790,7 @@ var Status = function Status(_ref) {
6791
6790
  }));
6792
6791
  };
6793
6792
 
6794
- var _excluded$i = ["content", "visible", "max", "intent", "style", "testID"];
6793
+ var _excluded$h = ["content", "visible", "max", "intent", "style", "testID"];
6795
6794
  var DEFAULT_MAX_NUMBER = 99;
6796
6795
  var getPaddingState = function getPaddingState(content) {
6797
6796
  return content.length > 1 ? 'wideContent' : 'narrowContent';
@@ -6806,7 +6805,7 @@ var Badge = function Badge(_ref) {
6806
6805
  intent = _ref$intent === void 0 ? 'danger' : _ref$intent,
6807
6806
  style = _ref.style,
6808
6807
  testID = _ref.testID,
6809
- nativeProps = _objectWithoutProperties(_ref, _excluded$i);
6808
+ nativeProps = _objectWithoutProperties(_ref, _excluded$h);
6810
6809
  var _React$useRef = React.useRef(new Animated.Value(visible ? 1 : 0)),
6811
6810
  opacity = _React$useRef.current;
6812
6811
  var isFirstRendering = React.useRef(true);
@@ -6910,7 +6909,7 @@ function omit(keys, obj) {
6910
6909
  return result;
6911
6910
  }
6912
6911
 
6913
- var _excluded$h = ["onTabPress", "renderActiveTabOnly", "selectedTabKey", "tabs"];
6912
+ var _excluded$g = ["onTabPress", "renderActiveTabOnly", "selectedTabKey", "tabs"];
6914
6913
  var getInactiveIcon = function getInactiveIcon(icon) {
6915
6914
  var inactiveIcon = "".concat(icon, "-outlined");
6916
6915
  return isHeroIcon(inactiveIcon) ? inactiveIcon : icon;
@@ -6921,7 +6920,7 @@ var BottomNavigation = function BottomNavigation(_ref) {
6921
6920
  renderActiveTabOnly = _ref$renderActiveTabO === void 0 ? false : _ref$renderActiveTabO,
6922
6921
  selectedTabKey = _ref.selectedTabKey,
6923
6922
  tabs = _ref.tabs,
6924
- nativeProps = _objectWithoutProperties(_ref, _excluded$h);
6923
+ nativeProps = _objectWithoutProperties(_ref, _excluded$g);
6925
6924
  var insets = useSafeAreaInsets();
6926
6925
  /**
6927
6926
  * List of loaded tabs, tabs will be loaded when navigated to.
@@ -7008,13 +7007,13 @@ var StyledDivider = index$a(View)(function (_ref) {
7008
7007
  }, horizontalMargin), verticalMargin);
7009
7008
  });
7010
7009
 
7011
- var _excluded$g = ["marginHorizontal", "marginVertical", "style", "testID"];
7010
+ var _excluded$f = ["marginHorizontal", "marginVertical", "style", "testID"];
7012
7011
  var Divider = function Divider(_ref) {
7013
7012
  var marginHorizontal = _ref.marginHorizontal,
7014
7013
  marginVertical = _ref.marginVertical,
7015
7014
  style = _ref.style,
7016
7015
  testID = _ref.testID,
7017
- nativeProps = _objectWithoutProperties(_ref, _excluded$g);
7016
+ nativeProps = _objectWithoutProperties(_ref, _excluded$f);
7018
7017
  return /*#__PURE__*/React.createElement(StyledDivider, _extends$1({}, nativeProps, {
7019
7018
  themeMarginHorizontal: marginHorizontal,
7020
7019
  themeMarginVertical: marginVertical,
@@ -7025,7 +7024,7 @@ var Divider = function Divider(_ref) {
7025
7024
 
7026
7025
  var AnimatedPressable$1 = Animated.createAnimatedComponent(Pressable);
7027
7026
  var AnimatedSafeAreaView = Animated.createAnimatedComponent(SafeAreaView);
7028
- var StyledWrapper$7 = index$a(View)(_objectSpread2(_objectSpread2({}, StyleSheet$1.absoluteFillObject), {}, {
7027
+ var StyledWrapper$8 = index$a(View)(_objectSpread2(_objectSpread2({}, StyleSheet$1.absoluteFillObject), {}, {
7029
7028
  flexDirection: 'column-reverse'
7030
7029
  }));
7031
7030
  var StyledKeyboardAvoidingView = index$a(KeyboardAvoidingView)(function () {
@@ -7144,7 +7143,7 @@ var StyledLoadingDot = index$a(View)(function (_ref2) {
7144
7143
  }, themeStyling());
7145
7144
  });
7146
7145
 
7147
- var _excluded$f = ["count", "size", "testID", "themeVariant"];
7146
+ var _excluded$e = ["count", "size", "testID", "themeVariant"];
7148
7147
  var AnimatedLoadingIndicatorWrapper = Animated.createAnimatedComponent(StyledLoadingIndicatorWrapper);
7149
7148
  var AnimatedLoadingDot = Animated.createAnimatedComponent(StyledLoadingDot);
7150
7149
  var renderDotComponent = function renderDotComponent(_ref) {
@@ -7176,7 +7175,7 @@ var LoadingIndicator = function LoadingIndicator(_ref2) {
7176
7175
  size = _ref2$size === void 0 ? 12 : _ref2$size,
7177
7176
  testID = _ref2.testID,
7178
7177
  themeVariant = _ref2.themeVariant,
7179
- nativeProps = _objectWithoutProperties(_ref2, _excluded$f);
7178
+ nativeProps = _objectWithoutProperties(_ref2, _excluded$e);
7180
7179
  var progressAnimation = useRef(new Animated.Value(0));
7181
7180
  useEffect(function () {
7182
7181
  var animation = Animated.loop(Animated.timing(progressAnimation.current, {
@@ -7572,11 +7571,11 @@ var Header = function Header(_ref) {
7572
7571
  })) : null), showDivider ? /*#__PURE__*/React.createElement(Divider, null) : null);
7573
7572
  };
7574
7573
 
7575
- var _excluded$e = ["scrollEventThrottle"];
7574
+ var _excluded$d = ["scrollEventThrottle"];
7576
7575
  var BottomSheetScrollView = function BottomSheetScrollView(_ref) {
7577
7576
  var _ref$scrollEventThrot = _ref.scrollEventThrottle,
7578
7577
  scrollEventThrottle = _ref$scrollEventThrot === void 0 ? 100 : _ref$scrollEventThrot,
7579
- props = _objectWithoutProperties(_ref, _excluded$e);
7578
+ props = _objectWithoutProperties(_ref, _excluded$d);
7580
7579
  var _useContext = useContext(BottomSheetContext),
7581
7580
  setInternalShowDivider = _useContext.setInternalShowDivider;
7582
7581
  var onScrollBeginDrag = useCallback(function (e) {
@@ -7684,7 +7683,7 @@ var BottomSheet = function BottomSheet(_ref) {
7684
7683
  transparent: true,
7685
7684
  testID: testID,
7686
7685
  onShow: onOpen
7687
- }, /*#__PURE__*/React.createElement(StyledWrapper$7, {
7686
+ }, /*#__PURE__*/React.createElement(StyledWrapper$8, {
7688
7687
  pointerEvents: "box-none"
7689
7688
  }, /*#__PURE__*/React.createElement(StyledKeyboardAvoidingView, _extends$1({
7690
7689
  behavior: Platform.OS === 'ios' ? 'padding' : 'height'
@@ -7891,7 +7890,7 @@ var borderWidths = {
7891
7890
  var config = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, colors), space), radii), borderWidths);
7892
7891
  var flexPropsKey = ['alignContent', 'alignItems', 'alignSelf', 'display', 'flex', 'flexBasis', 'flexDirection', 'flexGrow', 'flexShrink', 'flexWrap', 'justifyContent'];
7893
7892
 
7894
- var _excluded$d = ["theme"];
7893
+ var _excluded$c = ["theme"];
7895
7894
  var getThemeValue = function getThemeValue(theme, key, props) {
7896
7895
  var propConfig = config[key];
7897
7896
  var propValue = props[key];
@@ -7918,18 +7917,18 @@ var mapStylePropToThemeValue = function mapStylePropToThemeValue(theme, props) {
7918
7917
  var configKeys = Object.keys(config);
7919
7918
  var StyledBox = index$a(View)(function (_ref5) {
7920
7919
  var theme = _ref5.theme,
7921
- otherProps = _objectWithoutProperties(_ref5, _excluded$d);
7920
+ otherProps = _objectWithoutProperties(_ref5, _excluded$c);
7922
7921
  var styleProps = pick(configKeys, otherProps);
7923
7922
  var flexProps = pick(_toConsumableArray(flexPropsKey), otherProps);
7924
7923
  return _objectSpread2(_objectSpread2({}, mapStylePropToThemeValue(theme, styleProps)), flexProps);
7925
7924
  });
7926
7925
 
7927
- var _excluded$c = ["children", "style", "testID"];
7926
+ var _excluded$b = ["children", "style", "testID"];
7928
7927
  var Box = function Box(_ref) {
7929
7928
  var children = _ref.children,
7930
7929
  style = _ref.style,
7931
7930
  testID = _ref.testID,
7932
- otherProps = _objectWithoutProperties(_ref, _excluded$c);
7931
+ otherProps = _objectWithoutProperties(_ref, _excluded$b);
7933
7932
  return /*#__PURE__*/React.createElement(StyledBox, _extends$1({}, otherProps, {
7934
7933
  style: style,
7935
7934
  testID: testID
@@ -10540,7 +10539,7 @@ var CarouselPaginator = function CarouselPaginator(_ref) {
10540
10539
  }));
10541
10540
  };
10542
10541
 
10543
- var _excluded$b = ["rounded", "size", "testID", "style"];
10542
+ var _excluded$a = ["rounded", "size", "testID", "style"];
10544
10543
  var Image = function Image(_ref) {
10545
10544
  var _ref$rounded = _ref.rounded,
10546
10545
  rounded = _ref$rounded === void 0 ? false : _ref$rounded,
@@ -10548,7 +10547,7 @@ var Image = function Image(_ref) {
10548
10547
  size = _ref$size === void 0 ? '6xlarge' : _ref$size,
10549
10548
  testID = _ref.testID,
10550
10549
  style = _ref.style,
10551
- imageNativeProps = _objectWithoutProperties(_ref, _excluded$b);
10550
+ imageNativeProps = _objectWithoutProperties(_ref, _excluded$a);
10552
10551
  var theme = useTheme();
10553
10552
  var imageSize = theme.__hd__.image.sizes[size];
10554
10553
  return /*#__PURE__*/React.createElement(Image$1, _extends$1({
@@ -10633,7 +10632,7 @@ var CarouselItem = function CarouselItem(_ref) {
10633
10632
  }, content, /*#__PURE__*/React.createElement(StyledCarouselHeading, null, heading), body ? /*#__PURE__*/React.createElement(Typography.Text, null, body) : null));
10634
10633
  };
10635
10634
 
10636
- var _excluded$a = ["items", "onItemIndexChange", "renderActions", "selectedItemIndex", "style"];
10635
+ var _excluded$9 = ["items", "onItemIndexChange", "renderActions", "selectedItemIndex", "style"];
10637
10636
  function useStateFromProp(initialValue) {
10638
10637
  var _useState = useState(initialValue),
10639
10638
  _useState2 = _slicedToArray(_useState, 2),
@@ -10651,7 +10650,7 @@ var Carousel = function Carousel(_ref) {
10651
10650
  _ref$selectedItemInde = _ref.selectedItemIndex,
10652
10651
  selectedItemIndex = _ref$selectedItemInde === void 0 ? 0 : _ref$selectedItemInde,
10653
10652
  style = _ref.style,
10654
- nativeProps = _objectWithoutProperties(_ref, _excluded$a);
10653
+ nativeProps = _objectWithoutProperties(_ref, _excluded$9);
10655
10654
  var carouselRef = useRef(null);
10656
10655
  var _useStateFromProp = useStateFromProp(selectedItemIndex),
10657
10656
  _useStateFromProp2 = _slicedToArray(_useStateFromProp, 2),
@@ -10751,12 +10750,12 @@ var Indicator = index$a(View)(function (_ref2) {
10751
10750
  };
10752
10751
  });
10753
10752
 
10754
- var _excluded$9 = ["intent", "children"];
10753
+ var _excluded$8 = ["intent", "children"];
10755
10754
  var DataCard = function DataCard(_ref) {
10756
10755
  var _ref$intent = _ref.intent,
10757
10756
  intent = _ref$intent === void 0 ? 'info' : _ref$intent,
10758
10757
  children = _ref.children,
10759
- nativeProps = _objectWithoutProperties(_ref, _excluded$9);
10758
+ nativeProps = _objectWithoutProperties(_ref, _excluded$8);
10760
10759
  return /*#__PURE__*/React.createElement(StyledDataCard, nativeProps, /*#__PURE__*/React.createElement(Indicator, {
10761
10760
  themeIntent: intent,
10762
10761
  testID: "data-card-indicator"
@@ -10774,11 +10773,11 @@ var StyledCard = index$a(View)(function (_ref) {
10774
10773
  });
10775
10774
  });
10776
10775
 
10777
- var _excluded$8 = ["intent", "children"];
10776
+ var _excluded$7 = ["intent", "children"];
10778
10777
  var Card = function Card(_ref) {
10779
10778
  var intent = _ref.intent,
10780
10779
  children = _ref.children,
10781
- nativeProps = _objectWithoutProperties(_ref, _excluded$8);
10780
+ nativeProps = _objectWithoutProperties(_ref, _excluded$7);
10782
10781
  return /*#__PURE__*/React.createElement(StyledCard, _extends$1({}, nativeProps, {
10783
10782
  themeIntent: intent
10784
10783
  }), children);
@@ -10787,7 +10786,7 @@ var index$8 = Object.assign(Card, {
10787
10786
  Data: DataCard
10788
10787
  });
10789
10788
 
10790
- var StyledWrapper$6 = index$a(TouchableOpacity)(function (_ref) {
10789
+ var StyledWrapper$7 = index$a(TouchableOpacity)(function (_ref) {
10791
10790
  var theme = _ref.theme,
10792
10791
  themeWithBorder = _ref.themeWithBorder,
10793
10792
  themeDisabled = _ref.themeDisabled;
@@ -10844,7 +10843,7 @@ var Checkbox = function Checkbox(_ref) {
10844
10843
  onPress = _ref.onPress,
10845
10844
  style = _ref.style,
10846
10845
  testID = _ref.testID;
10847
- return /*#__PURE__*/React.createElement(StyledWrapper$6, {
10846
+ return /*#__PURE__*/React.createElement(StyledWrapper$7, {
10848
10847
  onPress: onPress,
10849
10848
  disabled: disabled,
10850
10849
  themeDisabled: disabled,
@@ -11012,7 +11011,7 @@ var StyledErrorAndMaxLengthContainer = index$a(View)(function () {
11012
11011
  };
11013
11012
  });
11014
11013
 
11015
- var _excluded$7 = ["label", "prefix", "suffix", "style", "textStyle", "testID", "accessibilityLabelledBy", "error", "required", "editable", "disabled", "loading", "maxLength", "helpText", "value", "defaultValue", "renderInputValue"];
11014
+ var _excluded$6 = ["label", "prefix", "suffix", "style", "textStyle", "testID", "accessibilityLabelledBy", "error", "required", "editable", "disabled", "loading", "maxLength", "helpText", "value", "defaultValue", "renderInputValue"];
11016
11015
  var getVariant$1 = function getVariant(_ref) {
11017
11016
  var disabled = _ref.disabled,
11018
11017
  error = _ref.error,
@@ -11058,7 +11057,7 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref2, ref) {
11058
11057
  value = _ref2.value,
11059
11058
  defaultValue = _ref2.defaultValue,
11060
11059
  renderInputValue = _ref2.renderInputValue,
11061
- nativeProps = _objectWithoutProperties(_ref2, _excluded$7);
11060
+ nativeProps = _objectWithoutProperties(_ref2, _excluded$6);
11062
11061
  var displayText = (_ref3 = value !== undefined ? value : defaultValue) !== null && _ref3 !== void 0 ? _ref3 : '';
11063
11062
  var isEmptyValue = displayText.length === 0;
11064
11063
  var actualSuffix = loading ? 'loading' : suffix;
@@ -11644,7 +11643,7 @@ var index$7 = Object.assign(Drawer, {
11644
11643
  Dragable: DragableDrawer
11645
11644
  });
11646
11645
 
11647
- var StyledWrapper$5 = index$a(View)(function (_ref) {
11646
+ var StyledWrapper$6 = index$a(View)(function (_ref) {
11648
11647
  var theme = _ref.theme;
11649
11648
  return {
11650
11649
  display: 'flex',
@@ -11686,7 +11685,7 @@ var Empty = function Empty(_ref) {
11686
11685
  _ref$variant = _ref.variant,
11687
11686
  variant = _ref$variant === void 0 ? 'light' : _ref$variant;
11688
11687
  var theme = useTheme();
11689
- return /*#__PURE__*/React.createElement(StyledWrapper$5, {
11688
+ return /*#__PURE__*/React.createElement(StyledWrapper$6, {
11690
11689
  style: style,
11691
11690
  testID: testID
11692
11691
  }, image !== undefined && /*#__PURE__*/React.cloneElement(image, _objectSpread2(_objectSpread2({}, image.props), {}, {
@@ -11736,11 +11735,11 @@ var StyledFABText = index$a(Text$1)(function (_ref3) {
11736
11735
  };
11737
11736
  });
11738
11737
 
11739
- var _excluded$6 = ["active"];
11738
+ var _excluded$5 = ["active"];
11740
11739
  var AnimatedIcons = Animated.createAnimatedComponent(StyledFABIcon);
11741
11740
  var AnimatedFABIcon = function AnimatedFABIcon(_ref) {
11742
11741
  var active = _ref.active,
11743
- iconProps = _objectWithoutProperties(_ref, _excluded$6);
11742
+ iconProps = _objectWithoutProperties(_ref, _excluded$5);
11744
11743
  var rotateAnimation = useRef(new Animated.Value(active ? 1 : 0));
11745
11744
  useEffect(function () {
11746
11745
  var animation = Animated.timing(rotateAnimation.current, {
@@ -12176,7 +12175,7 @@ var List = {
12176
12175
  BasicItem: BasicListItem
12177
12176
  };
12178
12177
 
12179
- var StyledWrapper$4 = index$a(View)(function () {
12178
+ var StyledWrapper$5 = index$a(View)(function () {
12180
12179
  return {
12181
12180
  alignContent: 'flex-start'
12182
12181
  };
@@ -12354,7 +12353,7 @@ function PinInput(_ref2) {
12354
12353
  InteractionManager.runAfterInteractions(focus);
12355
12354
  }
12356
12355
  }, [inputRef]);
12357
- return /*#__PURE__*/React.createElement(StyledWrapper$4, {
12356
+ return /*#__PURE__*/React.createElement(StyledWrapper$5, {
12358
12357
  style: style,
12359
12358
  testID: testID
12360
12359
  }, /*#__PURE__*/React.createElement(StyledPinWrapper, null, _toConsumableArray(Array(length).keys()).map(function (index) {
@@ -12471,7 +12470,7 @@ var StyledStrokeEnd = index$a(View)(function (_ref6) {
12471
12470
  };
12472
12471
  });
12473
12472
 
12474
- var _excluded$5 = ["value", "renderValue", "intent", "style", "testID"];
12473
+ var _excluded$4 = ["value", "renderValue", "intent", "style", "testID"];
12475
12474
  var HalfCircle = function HalfCircle(_ref) {
12476
12475
  var type = _ref.type,
12477
12476
  themeIntent = _ref.themeIntent;
@@ -12492,7 +12491,7 @@ var ProgressCircle = function ProgressCircle(_ref2) {
12492
12491
  intent = _ref2$intent === void 0 ? 'primary' : _ref2$intent,
12493
12492
  style = _ref2.style,
12494
12493
  testID = _ref2.testID,
12495
- nativeProps = _objectWithoutProperties(_ref2, _excluded$5);
12494
+ nativeProps = _objectWithoutProperties(_ref2, _excluded$4);
12496
12495
  var theme = useTheme$1();
12497
12496
  var radius = theme.__hd__.progress.sizes.circleDiameter / 2;
12498
12497
  var progressAnimatedValue = useRef(new Animated.Value(0));
@@ -12589,7 +12588,7 @@ var ProgressCircle = function ProgressCircle(_ref2) {
12589
12588
  }, renderValue(value)))));
12590
12589
  };
12591
12590
 
12592
- var StyledWrapper$3 = index$a(View)(function (_ref) {
12591
+ var StyledWrapper$4 = index$a(View)(function (_ref) {
12593
12592
  var theme = _ref.theme,
12594
12593
  themeIntent = _ref.themeIntent;
12595
12594
  return {
@@ -12609,14 +12608,14 @@ var StyledInner = index$a(Animated.View)(function (_ref2) {
12609
12608
  };
12610
12609
  });
12611
12610
 
12612
- var _excluded$4 = ["value", "intent", "style", "testID"];
12611
+ var _excluded$3 = ["value", "intent", "style", "testID"];
12613
12612
  var ProgressBar = function ProgressBar(_ref) {
12614
12613
  var value = _ref.value,
12615
12614
  _ref$intent = _ref.intent,
12616
12615
  intent = _ref$intent === void 0 ? 'primary' : _ref$intent,
12617
12616
  style = _ref.style,
12618
12617
  testID = _ref.testID,
12619
- nativeProps = _objectWithoutProperties(_ref, _excluded$4);
12618
+ nativeProps = _objectWithoutProperties(_ref, _excluded$3);
12620
12619
  var _useState = useState(0),
12621
12620
  _useState2 = _slicedToArray(_useState, 2),
12622
12621
  width = _useState2[0],
@@ -12642,7 +12641,7 @@ var ProgressBar = function ProgressBar(_ref) {
12642
12641
  outputRange: [999, 0],
12643
12642
  extrapolate: 'clamp'
12644
12643
  });
12645
- return /*#__PURE__*/React.createElement(StyledWrapper$3, _extends$1({}, nativeProps, {
12644
+ return /*#__PURE__*/React.createElement(StyledWrapper$4, _extends$1({}, nativeProps, {
12646
12645
  testID: testID,
12647
12646
  style: style,
12648
12647
  themeIntent: intent
@@ -12807,14 +12806,14 @@ var AnimatedSpinner = function AnimatedSpinner(_ref) {
12807
12806
  }, dotProps))));
12808
12807
  };
12809
12808
 
12810
- var _excluded$3 = ["testID", "size", "intent"];
12809
+ var _excluded$2 = ["testID", "size", "intent"];
12811
12810
  var Spinner = function Spinner(_ref) {
12812
12811
  var testID = _ref.testID,
12813
12812
  _ref$size = _ref.size,
12814
12813
  size = _ref$size === void 0 ? 'medium' : _ref$size,
12815
12814
  _ref$intent = _ref.intent,
12816
12815
  intent = _ref$intent === void 0 ? 'primary' : _ref$intent,
12817
- nativeProps = _objectWithoutProperties(_ref, _excluded$3);
12816
+ nativeProps = _objectWithoutProperties(_ref, _excluded$2);
12818
12817
  return /*#__PURE__*/React.createElement(StyledView$1, nativeProps, /*#__PURE__*/React.createElement(StyledSpinnerContainer, {
12819
12818
  testID: testID
12820
12819
  }, /*#__PURE__*/React.createElement(AnimatedSpinner, {
@@ -12823,12 +12822,60 @@ var Spinner = function Spinner(_ref) {
12823
12822
  })));
12824
12823
  };
12825
12824
 
12825
+ var Buttons = function Buttons(_ref) {
12826
+ var _buttons$length;
12827
+ var buttons = _ref.buttons,
12828
+ isLeftButtons = _ref.isLeftButtons,
12829
+ leftButtonContainerStyle = _ref.leftButtonContainerStyle,
12830
+ rightButtonContainerStyle = _ref.rightButtonContainerStyle,
12831
+ panAnimatedValue = _ref.panAnimatedValue,
12832
+ width = _ref.width,
12833
+ canSwipeLeft = _ref.canSwipeLeft,
12834
+ canSwipeRight = _ref.canSwipeRight,
12835
+ buttonWidth = _ref.buttonWidth;
12836
+ var count = (_buttons$length = buttons === null || buttons === void 0 ? void 0 : buttons.length) !== null && _buttons$length !== void 0 ? _buttons$length : 0;
12837
+ var leftEnd = canSwipeLeft ? -width : 0;
12838
+ var rightEnd = canSwipeRight ? width : 0;
12839
+ var inputRange = isLeftButtons ? [0, rightEnd] : [leftEnd, 0];
12840
+ return /*#__PURE__*/React.createElement(React.Fragment, null, buttons === null || buttons === void 0 ? void 0 : buttons.map(function (buttonContent, index) {
12841
+ var outputMultiplier = -index / count;
12842
+ var outputRange = isLeftButtons ? [0, rightEnd * outputMultiplier] : [leftEnd * outputMultiplier, 0];
12843
+ var transform = [{
12844
+ translateX: panAnimatedValue.x.interpolate({
12845
+ inputRange: inputRange,
12846
+ outputRange: outputRange,
12847
+ extrapolate: 'clamp'
12848
+ })
12849
+ }];
12850
+ var buttonStyle = [StyleSheet$1.absoluteFill, {
12851
+ width: buttonWidth,
12852
+ transform: transform
12853
+ }, isLeftButtons ? leftButtonContainerStyle : rightButtonContainerStyle];
12854
+ return /*#__PURE__*/React.createElement(Animated.View, {
12855
+ key: index,
12856
+ style: buttonStyle
12857
+ }, buttonContent);
12858
+ }));
12859
+ };
12860
+
12826
12861
  var StyledRectButton = index$a(TouchableOpacity)(function (_ref) {
12827
12862
  var theme = _ref.theme,
12828
12863
  themeIntent = _ref.themeIntent;
12829
12864
  return {
12830
12865
  flex: 1,
12831
- backgroundColor: theme.__hd__.swipeable.colors[themeIntent]
12866
+ backgroundColor: theme.__hd__.swipeable.colors[themeIntent],
12867
+ alignItems: 'center',
12868
+ justifyContent: 'center'
12869
+ };
12870
+ });
12871
+ var StyledWrapper$3 = index$a(View)(function () {
12872
+ return {
12873
+ flexDirection: 'row'
12874
+ };
12875
+ });
12876
+ var StyledContent = index$a(Animated.View)(function () {
12877
+ return {
12878
+ flex: 1
12832
12879
  };
12833
12880
  });
12834
12881
 
@@ -12837,86 +12884,381 @@ var SwipeableAction = function SwipeableAction(_ref) {
12837
12884
  intent = _ref$intent === void 0 ? 'primary' : _ref$intent,
12838
12885
  onPress = _ref.onPress,
12839
12886
  style = _ref.style,
12840
- children = _ref.children,
12841
- testID = _ref.testID;
12887
+ testID = _ref.testID,
12888
+ label = _ref.label,
12889
+ icon = _ref.icon;
12842
12890
  return /*#__PURE__*/React.createElement(StyledRectButton, {
12843
12891
  onPress: onPress,
12844
12892
  themeIntent: intent,
12845
12893
  style: style,
12846
12894
  testID: testID
12847
- }, children);
12895
+ }, /*#__PURE__*/React.createElement(Icon, {
12896
+ icon: icon,
12897
+ size: "xsmall"
12898
+ }), /*#__PURE__*/React.createElement(Typography.Text, {
12899
+ fontSize: "small"
12900
+ }, label));
12901
+ };
12902
+
12903
+ var _excluded$1 = ["children", "leftActions", "leftContent", "rightActions", "rightContent", "style", "leftActionsWidth", "leftButtonWidth", "onSwipeLeftStart", "onSwipeLeftEnd", "rightActionsWidth", "rightButtonWidth", "onSwipeRightStart", "onSwipeRightEnd", "swipeState", "onStateChange"];
12904
+ var swipeStartMinDistance = 15;
12905
+ var getReleaseAnimationConfig = function getReleaseAnimationConfig(swipeState, props) {
12906
+ var totalLeftButtonsWidth = props.totalLeftButtonsWidth,
12907
+ totalRightButtonsWidth = props.totalRightButtonsWidth;
12908
+ var swipeReleaseAnimationConfig = {
12909
+ toValue: {
12910
+ x: 0,
12911
+ y: 0
12912
+ },
12913
+ duration: 100,
12914
+ easing: Easing.elastic(0.5),
12915
+ useNativeDriver: true
12916
+ };
12917
+ if (swipeState === 'leftOpen') {
12918
+ return _objectSpread2(_objectSpread2({}, swipeReleaseAnimationConfig), {}, {
12919
+ toValue: {
12920
+ x: totalLeftButtonsWidth,
12921
+ y: 0
12922
+ }
12923
+ });
12924
+ }
12925
+ if (swipeState === 'rightOpen') {
12926
+ return _objectSpread2(_objectSpread2({}, swipeReleaseAnimationConfig), {}, {
12927
+ toValue: {
12928
+ x: totalRightButtonsWidth * -1,
12929
+ y: 0
12930
+ }
12931
+ });
12932
+ }
12933
+ return swipeReleaseAnimationConfig;
12848
12934
  };
12849
-
12850
- var _excluded$2 = ["children", "state", "onStateChange", "leftActions", "leftActionsWidth", "rightActions", "rightActionsWidth"];
12851
- var renderActions = function renderActions(actions, width, progress, direction) {
12852
- var trans = progress.interpolate({
12853
- inputRange: [0, 1],
12854
- outputRange: direction === 'left' ? [-width, 0] : [width, 0],
12855
- extrapolate: 'clamp'
12935
+ var getPos = function getPos(_ref) {
12936
+ var swipeState = _ref.swipeState,
12937
+ totalLeftButtonsWidth = _ref.totalLeftButtonsWidth,
12938
+ totalRightButtonsWidth = _ref.totalRightButtonsWidth;
12939
+ if (swipeState === 'leftOpen') {
12940
+ return {
12941
+ x: totalLeftButtonsWidth,
12942
+ y: 0
12943
+ };
12944
+ }
12945
+ if (swipeState === 'rightOpen') {
12946
+ return {
12947
+ x: totalRightButtonsWidth * -1,
12948
+ y: 0
12949
+ };
12950
+ }
12951
+ return {
12952
+ x: 0,
12953
+ y: 0
12954
+ };
12955
+ };
12956
+ var Swipeable = function Swipeable(_ref2) {
12957
+ var children = _ref2.children,
12958
+ _ref2$leftActions = _ref2.leftActions,
12959
+ leftActions = _ref2$leftActions === void 0 ? [] : _ref2$leftActions,
12960
+ leftContent = _ref2.leftContent,
12961
+ _ref2$rightActions = _ref2.rightActions,
12962
+ rightActions = _ref2$rightActions === void 0 ? [] : _ref2$rightActions,
12963
+ rightContent = _ref2.rightContent,
12964
+ style = _ref2.style,
12965
+ _ref2$leftActionsWidt = _ref2.leftActionsWidth,
12966
+ leftActionsWidth = _ref2$leftActionsWidt === void 0 ? scale(85) : _ref2$leftActionsWidt,
12967
+ _ref2$leftButtonWidth = _ref2.leftButtonWidth,
12968
+ leftButtonWidth = _ref2$leftButtonWidth === void 0 ? scale(85) : _ref2$leftButtonWidth,
12969
+ _ref2$onSwipeLeftStar = _ref2.onSwipeLeftStart,
12970
+ onSwipeLeftStart = _ref2$onSwipeLeftStar === void 0 ? noop : _ref2$onSwipeLeftStar,
12971
+ _ref2$onSwipeLeftEnd = _ref2.onSwipeLeftEnd,
12972
+ onSwipeLeftEnd = _ref2$onSwipeLeftEnd === void 0 ? noop : _ref2$onSwipeLeftEnd,
12973
+ _ref2$rightActionsWid = _ref2.rightActionsWidth,
12974
+ rightActionsWidth = _ref2$rightActionsWid === void 0 ? scale(85) : _ref2$rightActionsWid,
12975
+ _ref2$rightButtonWidt = _ref2.rightButtonWidth,
12976
+ rightButtonWidth = _ref2$rightButtonWidt === void 0 ? scale(85) : _ref2$rightButtonWidt,
12977
+ _ref2$onSwipeRightSta = _ref2.onSwipeRightStart,
12978
+ onSwipeRightStart = _ref2$onSwipeRightSta === void 0 ? noop : _ref2$onSwipeRightSta,
12979
+ _ref2$onSwipeRightEnd = _ref2.onSwipeRightEnd,
12980
+ onSwipeRightEnd = _ref2$onSwipeRightEnd === void 0 ? noop : _ref2$onSwipeRightEnd,
12981
+ _ref2$swipeState = _ref2.swipeState,
12982
+ swipeState = _ref2$swipeState === void 0 ? 'closed' : _ref2$swipeState,
12983
+ _ref2$onStateChange = _ref2.onStateChange,
12984
+ onStateChange = _ref2$onStateChange === void 0 ? noop : _ref2$onStateChange,
12985
+ rest = _objectWithoutProperties(_ref2, _excluded$1);
12986
+ var propsWithDefaultValue = _objectSpread2({
12987
+ children: children,
12988
+ leftActions: leftActions,
12989
+ leftContent: leftContent,
12990
+ rightActions: rightActions,
12991
+ rightContent: rightContent,
12992
+ style: style,
12993
+ leftActionsWidth: leftActionsWidth,
12994
+ leftButtonWidth: leftButtonWidth,
12995
+ onSwipeLeftStart: onSwipeLeftStart,
12996
+ onSwipeLeftEnd: onSwipeLeftEnd,
12997
+ rightActionsWidth: rightActionsWidth,
12998
+ rightButtonWidth: rightButtonWidth,
12999
+ onSwipeRightStart: onSwipeRightStart,
13000
+ onSwipeRightEnd: onSwipeRightEnd,
13001
+ swipeState: swipeState,
13002
+ onStateChange: onStateChange
13003
+ }, rest);
13004
+ var unmountedRef = React.useRef(false);
13005
+ useEffect(function () {
13006
+ return function () {
13007
+ unmountedRef.current = true;
13008
+ };
13009
+ }, []);
13010
+ var totalLeftButtonsWidth = leftActions.length * leftButtonWidth;
13011
+ var totalRightButtonsWidth = rightActions.length * rightButtonWidth;
13012
+ var _React$useState = React.useState(0),
13013
+ _React$useState2 = _slicedToArray(_React$useState, 2),
13014
+ width = _React$useState2[0],
13015
+ setWidth = _React$useState2[1];
13016
+ var hasLeftButtons = !leftContent && leftActions && leftActions.length > 0;
13017
+ var hasRightButtons = !rightContent && rightActions && rightActions.length > 0;
13018
+ var canSwipeRight = !!leftContent || !!hasLeftButtons;
13019
+ var canSwipeLeft = !!rightContent || !!hasRightButtons;
13020
+ var propsRef = React.useRef(undefined);
13021
+ var _React$useState3 = React.useState({
13022
+ pan: new Animated.ValueXY(getPos({
13023
+ swipeState: swipeState,
13024
+ totalLeftButtonsWidth: totalLeftButtonsWidth,
13025
+ totalRightButtonsWidth: totalRightButtonsWidth
13026
+ })),
13027
+ lastOffset: {
13028
+ x: 0,
13029
+ y: 0
13030
+ },
13031
+ leftActionActivated: false,
13032
+ rightActionActivated: true,
13033
+ swipeState: 'closed'
13034
+ }),
13035
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
13036
+ state = _React$useState4[0],
13037
+ setState = _React$useState4[1];
13038
+ propsRef.current = _objectSpread2(_objectSpread2({}, propsWithDefaultValue), {}, {
13039
+ canSwipeLeft: canSwipeLeft,
13040
+ canSwipeRight: canSwipeRight,
13041
+ totalLeftButtonsWidth: totalLeftButtonsWidth,
13042
+ totalRightButtonsWidth: totalRightButtonsWidth,
13043
+ hasLeftButtons: hasLeftButtons,
13044
+ hasRightButtons: hasRightButtons,
13045
+ unmountedRef: unmountedRef
12856
13046
  });
12857
- return /*#__PURE__*/React.createElement(Animated.View, {
12858
- style: {
12859
- width: width,
12860
- flexDirection: 'row',
12861
- transform: [{
12862
- translateX: trans
12863
- }]
12864
- }
12865
- }, actions);
12866
- };
12867
- var Swipeable = function Swipeable(_ref) {
12868
- var children = _ref.children,
12869
- state = _ref.state,
12870
- onStateChange = _ref.onStateChange,
12871
- leftActions = _ref.leftActions,
12872
- leftActionsWidth = _ref.leftActionsWidth,
12873
- rightActions = _ref.rightActions,
12874
- rightActionsWidth = _ref.rightActionsWidth,
12875
- swipeableProps = _objectWithoutProperties(_ref, _excluded$2);
12876
- var _useWindowDimensions = useWindowDimensions(),
12877
- width = _useWindowDimensions.width;
12878
- var swipeableRef = useRef(null);
12879
- var renderLeftActions = useCallback(function (progress) {
12880
- return renderActions(leftActions, leftActionsWidth || width, progress, 'left');
12881
- }, [leftActions, leftActionsWidth, width]);
12882
- var renderRightActions = useCallback(function (progress) {
12883
- return renderActions(rightActions, rightActionsWidth || width, progress, 'right');
12884
- }, [rightActions, rightActionsWidth, width]);
12885
13047
  useEffect(function () {
12886
- if (swipeableRef.current === null) return;
12887
- switch (state) {
12888
- case 'leftOpen':
12889
- swipeableRef.current.openLeft();
12890
- break;
12891
- case 'rightOpen':
12892
- swipeableRef.current.openRight();
12893
- break;
12894
- case 'closed':
12895
- swipeableRef.current.close();
12896
- break;
13048
+ var animation = null;
13049
+ if (state.swipeState !== swipeState) {
13050
+ animation = animationToNewState(swipeState, state.pan, totalLeftButtonsWidth, totalRightButtonsWidth);
13051
+ animation.start();
12897
13052
  }
12898
- }, [state]);
12899
- return /*#__PURE__*/React.createElement(GestureHandlerRootView, null, /*#__PURE__*/React.createElement(Swipeable$1, _extends$1({}, swipeableProps, {
12900
- ref: swipeableRef
12901
- }, leftActions !== undefined && {
12902
- renderLeftActions: renderLeftActions
12903
- }, rightActions !== undefined && {
12904
- renderRightActions: renderRightActions
12905
- }, {
12906
- onSwipeableLeftOpen: function onSwipeableLeftOpen() {
12907
- return onStateChange === null || onStateChange === void 0 ? void 0 : onStateChange('leftOpen');
13053
+ return function () {
13054
+ if (animation) {
13055
+ animation.stop();
13056
+ }
13057
+ };
13058
+ }, [swipeState]);
13059
+ var transform = [{
13060
+ translateX: state.pan.x.interpolate({
13061
+ inputRange: [canSwipeLeft ? -width : 0, canSwipeRight ? width : 0],
13062
+ outputRange: [canSwipeLeft ? -width + StyleSheet$1.hairlineWidth : 0, canSwipeRight ? width - StyleSheet$1.hairlineWidth : 0],
13063
+ extrapolate: 'clamp'
13064
+ })
13065
+ }];
13066
+ var panResponder = React.useRef(PanResponder.create({
13067
+ onMoveShouldSetPanResponder: function onMoveShouldSetPanResponder(_, gestureState) {
13068
+ return Math.abs(gestureState.dx) > swipeStartMinDistance;
13069
+ },
13070
+ onMoveShouldSetPanResponderCapture: function onMoveShouldSetPanResponderCapture(_, gestureState) {
13071
+ return Math.abs(gestureState.dx) > swipeStartMinDistance;
13072
+ },
13073
+ onPanResponderGrant: function onPanResponderGrant() {
13074
+ setState(function (prevState) {
13075
+ prevState.pan.setOffset(prevState.lastOffset);
13076
+ return prevState;
13077
+ });
13078
+ },
13079
+ onPanResponderMove: function onPanResponderMove(event, gestureState) {
13080
+ setState(function (prevState) {
13081
+ return hanleOnPanResponderMove(prevState, propsRef.current, event, gestureState);
13082
+ });
12908
13083
  },
12909
- onSwipeableRightOpen: function onSwipeableRightOpen() {
12910
- return onStateChange === null || onStateChange === void 0 ? void 0 : onStateChange('rightOpen');
13084
+ onPanResponderRelease: function onPanResponderRelease(event, gestureState) {
13085
+ setState(function (prevState) {
13086
+ return hanleOnPanResponderEnd(prevState, propsRef.current, event, gestureState);
13087
+ });
12911
13088
  },
12912
- onSwipeableClose: function onSwipeableClose() {
12913
- return onStateChange === null || onStateChange === void 0 ? void 0 : onStateChange('closed');
13089
+ onPanResponderTerminationRequest: function onPanResponderTerminationRequest() {
13090
+ return false;
13091
+ },
13092
+ onPanResponderTerminate: function onPanResponderTerminate(event, gestureState) {
13093
+ setState(function (prevState) {
13094
+ return hanleOnPanResponderEnd(prevState, propsRef.current, event, gestureState);
13095
+ });
13096
+ }
13097
+ })).current;
13098
+ return /*#__PURE__*/React.createElement(StyledWrapper$3, _extends$1({
13099
+ onLayout: function onLayout(event) {
13100
+ var width = event.nativeEvent.layout.width;
13101
+ setWidth(width);
13102
+ },
13103
+ style: [{
13104
+ flexDirection: 'row'
13105
+ }, style]
13106
+ }, panResponder.panHandlers, rest), canSwipeRight && /*#__PURE__*/React.createElement(Animated.View, {
13107
+ style: [{
13108
+ transform: transform,
13109
+ marginLeft: -width,
13110
+ width: width
13111
+ }]
13112
+ }, leftContent || /*#__PURE__*/React.createElement(Buttons, {
13113
+ buttons: leftActions,
13114
+ isLeftButtons: true,
13115
+ panAnimatedValue: state.pan,
13116
+ width: width,
13117
+ canSwipeLeft: canSwipeLeft,
13118
+ canSwipeRight: canSwipeRight,
13119
+ buttonWidth: leftButtonWidth
13120
+ })), /*#__PURE__*/React.createElement(StyledContent, {
13121
+ style: {
13122
+ transform: transform
13123
+ }
13124
+ }, children), canSwipeLeft && /*#__PURE__*/React.createElement(Animated.View, {
13125
+ style: [{
13126
+ transform: transform,
13127
+ marginRight: -width,
13128
+ width: width
13129
+ }]
13130
+ }, rightContent || /*#__PURE__*/React.createElement(Buttons, {
13131
+ buttons: rightActions,
13132
+ isLeftButtons: false,
13133
+ panAnimatedValue: state.pan,
13134
+ width: width,
13135
+ canSwipeRight: canSwipeRight,
13136
+ canSwipeLeft: canSwipeLeft,
13137
+ buttonWidth: rightButtonWidth
13138
+ })));
13139
+ };
13140
+ var animationToNewState = function animationToNewState(swipeState, pan, totalLeftButtonsWidth, totalRightButtonsWidth) {
13141
+ var animationConfig = getReleaseAnimationConfig(swipeState, {
13142
+ totalLeftButtonsWidth: totalLeftButtonsWidth,
13143
+ totalRightButtonsWidth: totalRightButtonsWidth
13144
+ });
13145
+ pan.flattenOffset();
13146
+ return Animated.timing(pan, animationConfig);
13147
+ };
13148
+ var hanleOnPanResponderEnd = function hanleOnPanResponderEnd(state, contextValues, event, gestureState) {
13149
+ var totalLeftButtonsWidth = contextValues.totalLeftButtonsWidth,
13150
+ totalRightButtonsWidth = contextValues.totalRightButtonsWidth,
13151
+ unmountedRef = contextValues.unmountedRef,
13152
+ onSwipeLeftEnd = contextValues.onSwipeLeftEnd,
13153
+ onSwipeRightEnd = contextValues.onSwipeRightEnd,
13154
+ onStateChange = contextValues.onStateChange;
13155
+ var leftActionActivated = state.leftActionActivated,
13156
+ rightActionActivated = state.rightActionActivated,
13157
+ pan = state.pan,
13158
+ swipeState = state.swipeState;
13159
+ var animationConfig = getReleaseAnimationConfig(swipeState, {
13160
+ totalLeftButtonsWidth: totalLeftButtonsWidth,
13161
+ totalRightButtonsWidth: totalRightButtonsWidth
13162
+ });
13163
+ animationToNewState(swipeState, pan, totalLeftButtonsWidth, totalRightButtonsWidth).start(function () {
13164
+ if (unmountedRef.current) {
13165
+ return;
12914
13166
  }
12915
- }), children));
13167
+ if (leftActionActivated && onSwipeLeftEnd) {
13168
+ onSwipeLeftEnd(event, gestureState);
13169
+ }
13170
+ if (rightActionActivated && onSwipeRightEnd) {
13171
+ onSwipeRightEnd(event, gestureState);
13172
+ }
13173
+ onStateChange(swipeState);
13174
+ });
13175
+ return _objectSpread2(_objectSpread2({}, state), {}, {
13176
+ lastOffset: {
13177
+ x: animationConfig.toValue.x,
13178
+ y: animationConfig.toValue.y
13179
+ },
13180
+ leftActionActivated: false,
13181
+ rightActionActivated: false
13182
+ });
13183
+ };
13184
+ var hanleOnPanResponderMove = function hanleOnPanResponderMove(state, contextValues, event, gestureState) {
13185
+ var leftActionsWidth = contextValues.leftActionsWidth,
13186
+ rightActionsWidth = contextValues.rightActionsWidth,
13187
+ onSwipeLeftStart = contextValues.onSwipeLeftStart,
13188
+ onSwipeRightStart = contextValues.onSwipeRightStart,
13189
+ canSwipeRight = contextValues.canSwipeRight,
13190
+ canSwipeLeft = contextValues.canSwipeLeft,
13191
+ hasLeftButtons = contextValues.hasLeftButtons,
13192
+ hasRightButtons = contextValues.hasRightButtons;
13193
+ var lastOffset = state.lastOffset,
13194
+ leftActionActivated = state.leftActionActivated,
13195
+ swipeState = state.swipeState,
13196
+ rightActionActivated = state.rightActionActivated;
13197
+ var dx = gestureState.dx,
13198
+ vx = gestureState.vx;
13199
+ var x = dx + lastOffset.x;
13200
+ var isSwipingLeft = vx < 0;
13201
+ var isSwipingRight = vx > 0;
13202
+ var leftActionsActivated = swipeState === 'leftOpen';
13203
+ var rightActionsActivated = swipeState === 'rightOpen';
13204
+ var nextLeftActionActivated = leftActionActivated;
13205
+ var nextLeftButtonsActivated = leftActionsActivated;
13206
+ var nextRightActionActivated = rightActionActivated;
13207
+ var nextRightButtonsActivated = rightActionsActivated;
13208
+ Animated.event([null, {
13209
+ dx: state.pan.x,
13210
+ dy: state.pan.y
13211
+ }], {
13212
+ useNativeDriver: false
13213
+ })(event, gestureState);
13214
+ if (!leftActionActivated && canSwipeRight && x >= leftActionsWidth) {
13215
+ nextLeftActionActivated = true;
13216
+ onSwipeRightStart(event, gestureState);
13217
+ }
13218
+ if (leftActionActivated && canSwipeRight && x < leftActionsWidth) {
13219
+ nextLeftActionActivated = false;
13220
+ }
13221
+ if (!rightActionActivated && canSwipeLeft && x <= -rightActionsWidth) {
13222
+ nextRightActionActivated = true;
13223
+ onSwipeLeftStart(event, gestureState);
13224
+ }
13225
+ if (rightActionActivated && canSwipeLeft && x > -rightActionsWidth) {
13226
+ nextRightActionActivated = false;
13227
+ }
13228
+ if (!leftActionsActivated && hasLeftButtons && !isSwipingLeft && x >= leftActionsWidth) {
13229
+ nextLeftButtonsActivated = true;
13230
+ }
13231
+ if (leftActionsActivated && hasLeftButtons && isSwipingLeft) {
13232
+ nextLeftButtonsActivated = false;
13233
+ }
13234
+ if (!rightActionsActivated && hasRightButtons && !isSwipingRight && x <= -rightActionsWidth) {
13235
+ nextRightButtonsActivated = true;
13236
+ }
13237
+ if (rightActionsActivated && hasRightButtons && isSwipingRight) {
13238
+ nextRightButtonsActivated = false;
13239
+ }
13240
+ var needsUpdate = nextLeftActionActivated !== leftActionActivated || nextLeftButtonsActivated !== leftActionsActivated || nextRightActionActivated !== rightActionActivated || nextRightButtonsActivated !== rightActionsActivated;
13241
+ if (needsUpdate) {
13242
+ var nextSwipeState = function () {
13243
+ if (nextLeftButtonsActivated) {
13244
+ return 'leftOpen';
13245
+ } else if (nextRightButtonsActivated) {
13246
+ return 'rightOpen';
13247
+ } else {
13248
+ return 'closed';
13249
+ }
13250
+ }();
13251
+ return _objectSpread2(_objectSpread2({}, state), {}, {
13252
+ leftActionActivated: nextLeftActionActivated,
13253
+ rightActionActivated: nextRightActionActivated,
13254
+ swipeState: nextSwipeState
13255
+ });
13256
+ } else {
13257
+ return state;
13258
+ }
12916
13259
  };
12917
- var index$5 = Object.assign(Swipeable, {
12918
- Action: SwipeableAction,
12919
- Content: RectButton
13260
+ var index$5 = Object.assign( /*#__PURE__*/React.memo(Swipeable), {
13261
+ Action: SwipeableAction
12920
13262
  });
12921
13263
 
12922
13264
  var Circle = index$a(View)(function (_ref) {
@@ -14257,7 +14599,7 @@ var StyledText = index$a(Text$1)(function (_ref3) {
14257
14599
  };
14258
14600
  });
14259
14601
 
14260
- var _excluded$1 = ["content", "variant", "intent", "style", "testID"];
14602
+ var _excluded = ["content", "variant", "intent", "style", "testID"];
14261
14603
  var Tag = function Tag(_ref) {
14262
14604
  var content = _ref.content,
14263
14605
  _ref$variant = _ref.variant,
@@ -14266,7 +14608,7 @@ var Tag = function Tag(_ref) {
14266
14608
  intent = _ref$intent === void 0 ? 'primary' : _ref$intent,
14267
14609
  style = _ref.style,
14268
14610
  testID = _ref.testID,
14269
- nativeProps = _objectWithoutProperties(_ref, _excluded$1);
14611
+ nativeProps = _objectWithoutProperties(_ref, _excluded);
14270
14612
  return /*#__PURE__*/React.createElement(StyledView, _extends$1({}, nativeProps, {
14271
14613
  themeIntent: intent,
14272
14614
  themeVariant: variant,
@@ -14827,11 +15169,9 @@ var ToolbarGroup = function ToolbarGroup(_ref) {
14827
15169
  }));
14828
15170
  };
14829
15171
 
14830
- var _excluded = ["children"];
14831
15172
  var Toolbar = function Toolbar(_ref) {
14832
- var children = _ref.children,
14833
- rest = _objectWithoutProperties(_ref, _excluded);
14834
- return /*#__PURE__*/React.createElement(ToolbarWrapper, rest, children);
15173
+ var children = _ref.children;
15174
+ return /*#__PURE__*/React.createElement(ToolbarWrapper, null, children);
14835
15175
  };
14836
15176
  var index$1 = Object.assign(Toolbar, {
14837
15177
  Group: ToolbarGroup