@hero-design/rn 8.2.3 → 8.3.1

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 (35) hide show
  1. package/.turbo/turbo-build.log +9 -9
  2. package/es/index.js +316 -53
  3. package/lib/index.js +315 -51
  4. package/package.json +5 -5
  5. package/src/components/Carousel/CarouselItem.tsx +44 -0
  6. package/src/components/Carousel/CarouselPaginator/StyledCarouselPaginator.tsx +20 -0
  7. package/src/components/Carousel/CarouselPaginator/index.tsx +57 -0
  8. package/src/components/Carousel/StyledCarousel.tsx +58 -0
  9. package/src/components/Carousel/__tests__/StyledCarousel.spec.tsx +13 -0
  10. package/src/components/Carousel/__tests__/__snapshots__/StyledCarousel.spec.tsx.snap +20 -0
  11. package/src/components/Carousel/__tests__/__snapshots__/index.spec.tsx.snap +600 -0
  12. package/src/components/Carousel/__tests__/index.spec.tsx +94 -0
  13. package/src/components/Carousel/index.tsx +157 -0
  14. package/src/components/Carousel/types.ts +10 -0
  15. package/src/components/Typography/Text/StyledText.tsx +1 -0
  16. package/src/components/Typography/Text/index.tsx +1 -0
  17. package/src/index.ts +2 -0
  18. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +34 -0
  19. package/src/theme/components/carousel.ts +42 -0
  20. package/src/theme/components/typography.ts +2 -0
  21. package/src/theme/getTheme.ts +3 -0
  22. package/src/theme/global/typography.ts +3 -0
  23. package/types/components/Carousel/CarouselItem.d.ts +6 -0
  24. package/types/components/Carousel/CarouselPaginator/StyledCarouselPaginator.d.ts +14 -0
  25. package/types/components/Carousel/CarouselPaginator/index.d.ts +7 -0
  26. package/types/components/Carousel/StyledCarousel.d.ts +36 -0
  27. package/types/components/Carousel/index.d.ts +32 -0
  28. package/types/components/Carousel/types.d.ts +9 -0
  29. package/types/components/Typography/Text/StyledText.d.ts +1 -1
  30. package/types/components/Typography/Text/index.d.ts +1 -1
  31. package/types/index.d.ts +2 -1
  32. package/types/theme/components/carousel.d.ts +32 -0
  33. package/types/theme/components/typography.d.ts +2 -0
  34. package/types/theme/getTheme.d.ts +2 -0
  35. package/types/theme/global/typography.d.ts +1 -0
@@ -1,9 +1,9 @@
1
- @hero-design/rn:build: cache hit, replaying output e72791422bc29fc3
2
- @hero-design/rn:build: $ yarn build:js && yarn build:types
3
- @hero-design/rn:build: $ rollup -c
4
- @hero-design/rn:build: 
5
- @hero-design/rn:build: src/index.ts → lib/index.js, es/index.js...
6
- @hero-design/rn:build: (!) Plugin replace: @rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.
7
- @hero-design/rn:build: (!) Plugin node-resolve: preferring built-in module 'events' over local alternative at '/root/hero-design/node_modules/events/events.js', pass 'preferBuiltins: false' to disable this behavior or 'preferBuiltins: true' to disable this warning
8
- @hero-design/rn:build: created lib/index.js, es/index.js in 32.4s
9
- @hero-design/rn:build: $ tsc --noEmit false --emitDeclarationOnly --project tsconfig.prod.json
1
+ @hero-design/rn:build: cache hit, replaying output 3ad2304a0e6682cc
2
+ @hero-design/rn:build: $ yarn build:js && yarn build:types
3
+ @hero-design/rn:build: $ rollup -c
4
+ @hero-design/rn:build: 
5
+ @hero-design/rn:build: src/index.ts → lib/index.js, es/index.js...
6
+ @hero-design/rn:build: (!) Plugin replace: @rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.
7
+ @hero-design/rn:build: (!) Plugin node-resolve: preferring built-in module 'events' over local alternative at '/root/hero-design/node_modules/events/events.js', pass 'preferBuiltins: false' to disable this behavior or 'preferBuiltins: true' to disable this warning
8
+ @hero-design/rn:build: created lib/index.js, es/index.js in 23.8s
9
+ @hero-design/rn:build: $ tsc --noEmit false --emitDeclarationOnly --project tsconfig.prod.json
package/es/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as reactNative from 'react-native';
2
- import { Platform, Dimensions, StyleSheet as StyleSheet$1, Animated, View, Easing, TouchableOpacity, Text as Text$1, Image as Image$1, TouchableWithoutFeedback, Pressable, SafeAreaView, KeyboardAvoidingView, ScrollView, Modal, TextInput as TextInput$2, PanResponder, TouchableHighlight, InteractionManager, useWindowDimensions, Keyboard, SectionList, FlatList, LayoutAnimation, RefreshControl as RefreshControl$1 } from 'react-native';
2
+ import { Platform, Dimensions, StyleSheet as StyleSheet$1, Animated, View, Easing, TouchableOpacity, Text as Text$1, Image as Image$1, TouchableWithoutFeedback, Pressable, SafeAreaView, KeyboardAvoidingView, ScrollView, Modal, useWindowDimensions, FlatList, TextInput as TextInput$2, PanResponder, TouchableHighlight, InteractionManager, Keyboard, SectionList, LayoutAnimation, RefreshControl as RefreshControl$1 } from 'react-native';
3
3
  import React, { useContext, createContext, createElement, useMemo, forwardRef, useEffect, useCallback, useRef, useState, useLayoutEffect, useImperativeHandle } from 'react';
4
4
  import { createIconSet } from 'react-native-vector-icons';
5
5
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
@@ -1376,6 +1376,7 @@ var getFontSizes = function getFontSizes(baseFontSize) {
1376
1376
  });
1377
1377
  return {
1378
1378
  '7xlarge': scale(fontSizes[10]),
1379
+ '6xlarge': scale(fontSizes[9]),
1379
1380
  xxxxxlarge: scale(fontSizes[8]),
1380
1381
  xxxxlarge: scale(fontSizes[7]),
1381
1382
  xxxlarge: scale(fontSizes[6]),
@@ -1392,6 +1393,7 @@ var getLineHeights = function getLineHeights(fontSizes) {
1392
1393
  var additionalSpace = 8;
1393
1394
  return {
1394
1395
  '7xlarge': fontSizes['7xlarge'] + additionalSpace,
1396
+ '6xlarge': fontSizes['6xlarge'] + additionalSpace,
1395
1397
  xxxxxlarge: fontSizes.xxxxxlarge + additionalSpace,
1396
1398
  xxxxlarge: fontSizes.xxxxlarge + additionalSpace,
1397
1399
  xxxlarge: fontSizes.xxxlarge + additionalSpace,
@@ -1797,6 +1799,46 @@ var getCardTheme = function getCardTheme(theme) {
1797
1799
  };
1798
1800
  };
1799
1801
 
1802
+ var getCarouselTheme = function getCarouselTheme(theme) {
1803
+ var colors = {
1804
+ paginatorBackgroundColor: theme.colors.primary
1805
+ };
1806
+ var space = {
1807
+ headingMarginTop: theme.space.small,
1808
+ headingMarginBottom: theme.space.medium,
1809
+ paginatorMarginHorizontal: theme.space.small,
1810
+ footerPaddingHorizontal: theme.space.large,
1811
+ footerPaddingVertical: theme.space.medium,
1812
+ footerMarginBottom: theme.space.large
1813
+ };
1814
+ var sizes = {
1815
+ indicatorWidth: theme.sizes.medium,
1816
+ paginatorHeight: theme.sizes.small,
1817
+ paginatorWidth: theme.sizes.small
1818
+ };
1819
+ var radii = {
1820
+ paginatorBorderRadius: theme.radii.rounded
1821
+ };
1822
+ var fontSizes = {
1823
+ heading: theme.fontSizes['6xlarge']
1824
+ };
1825
+ var fonts = {
1826
+ heading: theme.fonts.playful.semiBold
1827
+ };
1828
+ var lineHeights = {
1829
+ heading: theme.lineHeights['6xlarge']
1830
+ };
1831
+ return {
1832
+ colors: colors,
1833
+ sizes: sizes,
1834
+ radii: radii,
1835
+ space: space,
1836
+ fonts: fonts,
1837
+ fontSizes: fontSizes,
1838
+ lineHeights: lineHeights
1839
+ };
1840
+ };
1841
+
1800
1842
  var getCheckboxTheme = function getCheckboxTheme(theme) {
1801
1843
  var colors = {
1802
1844
  "default": theme.colors.primaryOutline,
@@ -2632,6 +2674,7 @@ var getTypographyTheme = function getTypographyTheme(theme) {
2632
2674
  xlarge: theme.fontSizes.xlarge,
2633
2675
  xxxlarge: theme.fontSizes.xxxlarge,
2634
2676
  xxxxxlarge: theme.fontSizes.xxxxxlarge,
2677
+ '6xlarge': theme.fontSizes['6xlarge'],
2635
2678
  '7xlarge': theme.fontSizes['7xlarge']
2636
2679
  };
2637
2680
  var lineHeights = {
@@ -2641,6 +2684,7 @@ var getTypographyTheme = function getTypographyTheme(theme) {
2641
2684
  xlarge: theme.lineHeights.xlarge,
2642
2685
  xxxlarge: theme.lineHeights.xxxlarge,
2643
2686
  xxxxxlarge: theme.lineHeights.xxxxxlarge,
2687
+ '6xlarge': theme.lineHeights['6xlarge'],
2644
2688
  '7xlarge': theme.lineHeights['7xlarge']
2645
2689
  };
2646
2690
  return {
@@ -2667,6 +2711,7 @@ var getTheme$1 = function getTheme() {
2667
2711
  button: getButtonTheme(globalTheme),
2668
2712
  calendar: getCalendarTheme(globalTheme),
2669
2713
  card: getCardTheme(globalTheme),
2714
+ carousel: getCarouselTheme(globalTheme),
2670
2715
  checkbox: getCheckboxTheme(globalTheme),
2671
2716
  contentNavigator: getContentNavigatorTheme(globalTheme),
2672
2717
  datePicker: getDatePickerTheme(globalTheme),
@@ -5701,7 +5746,7 @@ var StyledText$3 = index$a(Text$1)(function (_ref) {
5701
5746
  });
5702
5747
  });
5703
5748
 
5704
- var _excluded$k = ["children", "fontSize", "fontWeight", "intent", "typeface"];
5749
+ var _excluded$l = ["children", "fontSize", "fontWeight", "intent", "typeface"];
5705
5750
  var Text = function Text(_ref) {
5706
5751
  var children = _ref.children,
5707
5752
  _ref$fontSize = _ref.fontSize,
@@ -5712,7 +5757,7 @@ var Text = function Text(_ref) {
5712
5757
  intent = _ref$intent === void 0 ? 'body' : _ref$intent,
5713
5758
  _ref$typeface = _ref.typeface,
5714
5759
  typeface = _ref$typeface === void 0 ? 'neutral' : _ref$typeface,
5715
- nativeProps = _objectWithoutProperties(_ref, _excluded$k);
5760
+ nativeProps = _objectWithoutProperties(_ref, _excluded$l);
5716
5761
  return /*#__PURE__*/React.createElement(StyledText$3, _extends$1({}, nativeProps, {
5717
5762
  themeFontSize: fontSize,
5718
5763
  themeFontWeight: fontWeight,
@@ -6191,10 +6236,10 @@ var StyledHeroIcon = index$a(HeroIcon)(function (_ref) {
6191
6236
  };
6192
6237
  });
6193
6238
 
6194
- var _excluded$j = ["style"];
6239
+ var _excluded$k = ["style"];
6195
6240
  var AnimatedIcon = function AnimatedIcon(_ref) {
6196
6241
  var style = _ref.style,
6197
- otherProps = _objectWithoutProperties(_ref, _excluded$j);
6242
+ otherProps = _objectWithoutProperties(_ref, _excluded$k);
6198
6243
  var rotateAnimation = useRef(new Animated.Value(0));
6199
6244
  useEffect(function () {
6200
6245
  var animation = Animated.loop(Animated.timing(rotateAnimation.current, {
@@ -6300,7 +6345,7 @@ var AccordionItem = function AccordionItem(_ref) {
6300
6345
  }, content));
6301
6346
  };
6302
6347
 
6303
- var _excluded$i = ["key"];
6348
+ var _excluded$j = ["key"];
6304
6349
  var Accordion = function Accordion(_ref) {
6305
6350
  var items = _ref.items,
6306
6351
  activeItemKey = _ref.activeItemKey,
@@ -6321,7 +6366,7 @@ var Accordion = function Accordion(_ref) {
6321
6366
  testID: testID
6322
6367
  }, items.map(function (_ref2, index) {
6323
6368
  var key = _ref2.key,
6324
- props = _objectWithoutProperties(_ref2, _excluded$i);
6369
+ props = _objectWithoutProperties(_ref2, _excluded$j);
6325
6370
  var open = _activeItemKey === key;
6326
6371
  return /*#__PURE__*/React.createElement(React.Fragment, {
6327
6372
  key: key
@@ -6703,7 +6748,7 @@ var StyledStatus = index$a(Animated.View)(function (_ref3) {
6703
6748
  };
6704
6749
  });
6705
6750
 
6706
- var _excluded$h = ["children", "visible", "intent", "style", "testID"];
6751
+ var _excluded$i = ["children", "visible", "intent", "style", "testID"];
6707
6752
  var Status = function Status(_ref) {
6708
6753
  var children = _ref.children,
6709
6754
  _ref$visible = _ref.visible,
@@ -6712,7 +6757,7 @@ var Status = function Status(_ref) {
6712
6757
  intent = _ref$intent === void 0 ? 'danger' : _ref$intent,
6713
6758
  style = _ref.style,
6714
6759
  testID = _ref.testID,
6715
- nativeProps = _objectWithoutProperties(_ref, _excluded$h);
6760
+ nativeProps = _objectWithoutProperties(_ref, _excluded$i);
6716
6761
  var _React$useRef = React.useRef(new Animated.Value(visible ? 1 : 0)),
6717
6762
  opacity = _React$useRef.current;
6718
6763
  var isFirstRendering = React.useRef(true);
@@ -6745,7 +6790,7 @@ var Status = function Status(_ref) {
6745
6790
  }));
6746
6791
  };
6747
6792
 
6748
- var _excluded$g = ["content", "visible", "max", "intent", "style", "testID"];
6793
+ var _excluded$h = ["content", "visible", "max", "intent", "style", "testID"];
6749
6794
  var DEFAULT_MAX_NUMBER = 99;
6750
6795
  var getPaddingState = function getPaddingState(content) {
6751
6796
  return content.length > 1 ? 'wideContent' : 'narrowContent';
@@ -6760,7 +6805,7 @@ var Badge = function Badge(_ref) {
6760
6805
  intent = _ref$intent === void 0 ? 'danger' : _ref$intent,
6761
6806
  style = _ref.style,
6762
6807
  testID = _ref.testID,
6763
- nativeProps = _objectWithoutProperties(_ref, _excluded$g);
6808
+ nativeProps = _objectWithoutProperties(_ref, _excluded$h);
6764
6809
  var _React$useRef = React.useRef(new Animated.Value(visible ? 1 : 0)),
6765
6810
  opacity = _React$useRef.current;
6766
6811
  var isFirstRendering = React.useRef(true);
@@ -6864,7 +6909,7 @@ function omit(keys, obj) {
6864
6909
  return result;
6865
6910
  }
6866
6911
 
6867
- var _excluded$f = ["onTabPress", "renderActiveTabOnly", "selectedTabKey", "tabs"];
6912
+ var _excluded$g = ["onTabPress", "renderActiveTabOnly", "selectedTabKey", "tabs"];
6868
6913
  var getInactiveIcon = function getInactiveIcon(icon) {
6869
6914
  var inactiveIcon = "".concat(icon, "-outlined");
6870
6915
  return isHeroIcon(inactiveIcon) ? inactiveIcon : icon;
@@ -6875,7 +6920,7 @@ var BottomNavigation = function BottomNavigation(_ref) {
6875
6920
  renderActiveTabOnly = _ref$renderActiveTabO === void 0 ? false : _ref$renderActiveTabO,
6876
6921
  selectedTabKey = _ref.selectedTabKey,
6877
6922
  tabs = _ref.tabs,
6878
- nativeProps = _objectWithoutProperties(_ref, _excluded$f);
6923
+ nativeProps = _objectWithoutProperties(_ref, _excluded$g);
6879
6924
  var insets = useSafeAreaInsets();
6880
6925
  /**
6881
6926
  * List of loaded tabs, tabs will be loaded when navigated to.
@@ -6962,13 +7007,13 @@ var StyledDivider = index$a(View)(function (_ref) {
6962
7007
  }, horizontalMargin), verticalMargin);
6963
7008
  });
6964
7009
 
6965
- var _excluded$e = ["marginHorizontal", "marginVertical", "style", "testID"];
7010
+ var _excluded$f = ["marginHorizontal", "marginVertical", "style", "testID"];
6966
7011
  var Divider = function Divider(_ref) {
6967
7012
  var marginHorizontal = _ref.marginHorizontal,
6968
7013
  marginVertical = _ref.marginVertical,
6969
7014
  style = _ref.style,
6970
7015
  testID = _ref.testID,
6971
- nativeProps = _objectWithoutProperties(_ref, _excluded$e);
7016
+ nativeProps = _objectWithoutProperties(_ref, _excluded$f);
6972
7017
  return /*#__PURE__*/React.createElement(StyledDivider, _extends$1({}, nativeProps, {
6973
7018
  themeMarginHorizontal: marginHorizontal,
6974
7019
  themeMarginVertical: marginVertical,
@@ -7098,7 +7143,7 @@ var StyledLoadingDot = index$a(View)(function (_ref2) {
7098
7143
  }, themeStyling());
7099
7144
  });
7100
7145
 
7101
- var _excluded$d = ["count", "size", "testID", "themeVariant"];
7146
+ var _excluded$e = ["count", "size", "testID", "themeVariant"];
7102
7147
  var AnimatedLoadingIndicatorWrapper = Animated.createAnimatedComponent(StyledLoadingIndicatorWrapper);
7103
7148
  var AnimatedLoadingDot = Animated.createAnimatedComponent(StyledLoadingDot);
7104
7149
  var renderDotComponent = function renderDotComponent(_ref) {
@@ -7130,7 +7175,7 @@ var LoadingIndicator = function LoadingIndicator(_ref2) {
7130
7175
  size = _ref2$size === void 0 ? 12 : _ref2$size,
7131
7176
  testID = _ref2.testID,
7132
7177
  themeVariant = _ref2.themeVariant,
7133
- nativeProps = _objectWithoutProperties(_ref2, _excluded$d);
7178
+ nativeProps = _objectWithoutProperties(_ref2, _excluded$e);
7134
7179
  var progressAnimation = useRef(new Animated.Value(0));
7135
7180
  useEffect(function () {
7136
7181
  var animation = Animated.loop(Animated.timing(progressAnimation.current, {
@@ -7526,11 +7571,11 @@ var Header = function Header(_ref) {
7526
7571
  })) : null), showDivider ? /*#__PURE__*/React.createElement(Divider, null) : null);
7527
7572
  };
7528
7573
 
7529
- var _excluded$c = ["scrollEventThrottle"];
7574
+ var _excluded$d = ["scrollEventThrottle"];
7530
7575
  var BottomSheetScrollView = function BottomSheetScrollView(_ref) {
7531
7576
  var _ref$scrollEventThrot = _ref.scrollEventThrottle,
7532
7577
  scrollEventThrottle = _ref$scrollEventThrot === void 0 ? 100 : _ref$scrollEventThrot,
7533
- props = _objectWithoutProperties(_ref, _excluded$c);
7578
+ props = _objectWithoutProperties(_ref, _excluded$d);
7534
7579
  var _useContext = useContext(BottomSheetContext),
7535
7580
  setInternalShowDivider = _useContext.setInternalShowDivider;
7536
7581
  var onScrollBeginDrag = useCallback(function (e) {
@@ -7845,7 +7890,7 @@ var borderWidths = {
7845
7890
  var config = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, colors), space), radii), borderWidths);
7846
7891
  var flexPropsKey = ['alignContent', 'alignItems', 'alignSelf', 'display', 'flex', 'flexBasis', 'flexDirection', 'flexGrow', 'flexShrink', 'flexWrap', 'justifyContent'];
7847
7892
 
7848
- var _excluded$b = ["theme"];
7893
+ var _excluded$c = ["theme"];
7849
7894
  var getThemeValue = function getThemeValue(theme, key, props) {
7850
7895
  var propConfig = config[key];
7851
7896
  var propValue = props[key];
@@ -7872,18 +7917,18 @@ var mapStylePropToThemeValue = function mapStylePropToThemeValue(theme, props) {
7872
7917
  var configKeys = Object.keys(config);
7873
7918
  var StyledBox = index$a(View)(function (_ref5) {
7874
7919
  var theme = _ref5.theme,
7875
- otherProps = _objectWithoutProperties(_ref5, _excluded$b);
7920
+ otherProps = _objectWithoutProperties(_ref5, _excluded$c);
7876
7921
  var styleProps = pick(configKeys, otherProps);
7877
7922
  var flexProps = pick(_toConsumableArray(flexPropsKey), otherProps);
7878
7923
  return _objectSpread2(_objectSpread2({}, mapStylePropToThemeValue(theme, styleProps)), flexProps);
7879
7924
  });
7880
7925
 
7881
- var _excluded$a = ["children", "style", "testID"];
7926
+ var _excluded$b = ["children", "style", "testID"];
7882
7927
  var Box = function Box(_ref) {
7883
7928
  var children = _ref.children,
7884
7929
  style = _ref.style,
7885
7930
  testID = _ref.testID,
7886
- otherProps = _objectWithoutProperties(_ref, _excluded$a);
7931
+ otherProps = _objectWithoutProperties(_ref, _excluded$b);
7887
7932
  return /*#__PURE__*/React.createElement(StyledBox, _extends$1({}, otherProps, {
7888
7933
  style: style,
7889
7934
  testID: testID
@@ -10448,6 +10493,245 @@ var Calendar = function Calendar(_ref) {
10448
10493
  })));
10449
10494
  };
10450
10495
 
10496
+ var StyledCarouselPaginator = index$a(View)(function () {
10497
+ return {
10498
+ flexDirection: 'row',
10499
+ alignItems: 'center',
10500
+ marginStart: 'auto'
10501
+ };
10502
+ });
10503
+ var StyledCarouselPaginatorAnimatedView = index$a(Animated.View)(function (_ref) {
10504
+ var theme = _ref.theme;
10505
+ return {
10506
+ height: theme.__hd__.carousel.sizes.paginatorHeight,
10507
+ width: theme.__hd__.carousel.sizes.paginatorWidth,
10508
+ borderRadius: theme.__hd__.carousel.radii.paginatorBorderRadius,
10509
+ backgroundColor: theme.__hd__.carousel.colors.paginatorBackgroundColor,
10510
+ marginHorizontal: theme.__hd__.carousel.space.paginatorMarginHorizontal
10511
+ };
10512
+ });
10513
+
10514
+ var CarouselPaginator = function CarouselPaginator(_ref) {
10515
+ var numberOfSlides = _ref.numberOfSlides,
10516
+ scrollX = _ref.scrollX;
10517
+ var _useWindowDimensions = useWindowDimensions(),
10518
+ width = _useWindowDimensions.width;
10519
+ var theme = useTheme();
10520
+ return /*#__PURE__*/React.createElement(StyledCarouselPaginator, null, new Array(numberOfSlides).fill('').map(function (_, index) {
10521
+ var inputRange = [(index - 1) * width - 1, index * width - 1, (index + 1) * width];
10522
+ var indicatorWidth = scrollX.interpolate({
10523
+ inputRange: inputRange,
10524
+ outputRange: [theme.space.small, theme.space.large, theme.space.small],
10525
+ extrapolate: 'clamp'
10526
+ });
10527
+ var opacity = scrollX.interpolate({
10528
+ inputRange: inputRange,
10529
+ outputRange: [0.5, 1, 0.5],
10530
+ extrapolate: 'clamp'
10531
+ });
10532
+ return /*#__PURE__*/React.createElement(StyledCarouselPaginatorAnimatedView, {
10533
+ style: [{
10534
+ width: indicatorWidth,
10535
+ opacity: opacity
10536
+ }],
10537
+ key: index.toString()
10538
+ });
10539
+ }));
10540
+ };
10541
+
10542
+ var _excluded$a = ["rounded", "size", "testID", "style"];
10543
+ var Image = function Image(_ref) {
10544
+ var _ref$rounded = _ref.rounded,
10545
+ rounded = _ref$rounded === void 0 ? false : _ref$rounded,
10546
+ _ref$size = _ref.size,
10547
+ size = _ref$size === void 0 ? '6xlarge' : _ref$size,
10548
+ testID = _ref.testID,
10549
+ style = _ref.style,
10550
+ imageNativeProps = _objectWithoutProperties(_ref, _excluded$a);
10551
+ var theme = useTheme();
10552
+ var imageSize = theme.__hd__.image.sizes[size];
10553
+ return /*#__PURE__*/React.createElement(Image$1, _extends$1({
10554
+ testID: testID,
10555
+ style: [{
10556
+ width: imageSize,
10557
+ height: imageSize,
10558
+ borderRadius: rounded ? imageSize / 2 : 0
10559
+ }, style]
10560
+ }, imageNativeProps));
10561
+ };
10562
+
10563
+ var StyledBackDrop = index$a(View)(function (_ref) {
10564
+ var themeSlideBackground = _ref.themeSlideBackground;
10565
+ return {
10566
+ position: 'absolute',
10567
+ backgroundColor: themeSlideBackground,
10568
+ top: 0,
10569
+ bottom: 0,
10570
+ right: 0,
10571
+ left: 0
10572
+ };
10573
+ });
10574
+ var StyledCarouselView = index$a(View)(function () {
10575
+ return {
10576
+ flexGrow: 2,
10577
+ justifyContent: 'space-between'
10578
+ };
10579
+ });
10580
+ var StyledCarouselHeading = index$a(Typography.Text)(function (_ref2) {
10581
+ var theme = _ref2.theme;
10582
+ return {
10583
+ marginTop: theme.__hd__.carousel.space.headingMarginTop,
10584
+ marginBottom: theme.__hd__.carousel.space.headingMarginBottom,
10585
+ fontFamily: theme.__hd__.carousel.fonts.heading,
10586
+ fontSize: theme.__hd__.carousel.fontSizes.heading,
10587
+ lineHeight: theme.__hd__.carousel.lineHeights.heading
10588
+ };
10589
+ });
10590
+ var StyledCarouselImage = index$a(Image)(function () {
10591
+ return {
10592
+ flex: 1,
10593
+ width: '100%',
10594
+ resizeMode: 'contain'
10595
+ };
10596
+ });
10597
+ var StyledCarouselContentWrapper = index$a(Box)(function (_ref3) {
10598
+ var width = _ref3.width;
10599
+ return {
10600
+ width: width
10601
+ };
10602
+ });
10603
+ var StyledCarouselFooterWrapper = index$a(View)(function (_ref4) {
10604
+ var theme = _ref4.theme;
10605
+ return {
10606
+ paddingHorizontal: theme.__hd__.carousel.space.footerPaddingHorizontal,
10607
+ flexDirection: 'row',
10608
+ justifyContent: 'space-between',
10609
+ paddingVertical: theme.__hd__.carousel.space.footerPaddingVertical,
10610
+ marginBottom: theme.__hd__.carousel.space.footerMarginBottom
10611
+ };
10612
+ });
10613
+
10614
+ var CarouselItem = function CarouselItem(_ref) {
10615
+ var width = _ref.width,
10616
+ image = _ref.image,
10617
+ content = _ref.content,
10618
+ heading = _ref.heading,
10619
+ body = _ref.body;
10620
+ return /*#__PURE__*/React.createElement(Box, {
10621
+ style: {
10622
+ width: width
10623
+ }
10624
+ }, image && /*#__PURE__*/React.createElement(StyledCarouselImage, {
10625
+ source: typeof image === 'string' ? {
10626
+ uri: image
10627
+ } : image
10628
+ }), /*#__PURE__*/React.createElement(StyledCarouselContentWrapper, {
10629
+ paddingHorizontal: "large",
10630
+ marginTop: "large",
10631
+ width: width
10632
+ }, content, /*#__PURE__*/React.createElement(StyledCarouselHeading, null, heading), body ? /*#__PURE__*/React.createElement(Typography.Text, null, body) : null));
10633
+ };
10634
+
10635
+ var _excluded$9 = ["items", "onItemIndexChange", "renderActions", "selectedItemIndex", "style"];
10636
+ function useStateFromProp(initialValue) {
10637
+ var _useState = useState(initialValue),
10638
+ _useState2 = _slicedToArray(_useState, 2),
10639
+ value = _useState2[0],
10640
+ setValue = _useState2[1];
10641
+ useEffect(function () {
10642
+ return setValue(initialValue);
10643
+ }, [initialValue]);
10644
+ return [value, setValue];
10645
+ }
10646
+ var Carousel = function Carousel(_ref) {
10647
+ var items = _ref.items,
10648
+ onItemIndexChange = _ref.onItemIndexChange,
10649
+ renderActions = _ref.renderActions,
10650
+ _ref$selectedItemInde = _ref.selectedItemIndex,
10651
+ selectedItemIndex = _ref$selectedItemInde === void 0 ? 0 : _ref$selectedItemInde,
10652
+ style = _ref.style,
10653
+ nativeProps = _objectWithoutProperties(_ref, _excluded$9);
10654
+ var carouselRef = useRef(null);
10655
+ var _useStateFromProp = useStateFromProp(selectedItemIndex),
10656
+ _useStateFromProp2 = _slicedToArray(_useStateFromProp, 2),
10657
+ currentSlideIndex = _useStateFromProp2[0],
10658
+ setCurrentSlideIndex = _useStateFromProp2[1];
10659
+ var internalOnItemIndexChange = useCallback(function (index) {
10660
+ setCurrentSlideIndex(index);
10661
+ if (onItemIndexChange) {
10662
+ onItemIndexChange(index);
10663
+ }
10664
+ }, [setCurrentSlideIndex, onItemIndexChange]);
10665
+ var _useWindowDimensions = useWindowDimensions(),
10666
+ width = _useWindowDimensions.width;
10667
+ var scrollX = useRef(new Animated.Value(0)).current;
10668
+ useEffect(function () {
10669
+ // must use setTimeout since when layout is mounted, the pagination dots are not set correct scrollX
10670
+ var handle = setTimeout(function () {
10671
+ var _carouselRef$current;
10672
+ scrollX.setValue(currentSlideIndex * width);
10673
+ (_carouselRef$current = carouselRef.current) === null || _carouselRef$current === void 0 ? void 0 : _carouselRef$current.scrollToOffset({
10674
+ offset: currentSlideIndex * width,
10675
+ animated: true
10676
+ });
10677
+ }, 100);
10678
+ return function () {
10679
+ clearTimeout(handle);
10680
+ };
10681
+ }, [currentSlideIndex, carouselRef]);
10682
+ var visibleSlideChanged = useCallback(function (_ref2) {
10683
+ var viewableItems = _ref2.viewableItems;
10684
+ if (!viewableItems || viewableItems && !viewableItems.length) return;
10685
+ var index = viewableItems[0].index;
10686
+ internalOnItemIndexChange(index);
10687
+ }, []);
10688
+ var viewConfig = useRef({
10689
+ viewAreaCoveragePercentThreshold: 50
10690
+ }).current;
10691
+ return /*#__PURE__*/React.createElement(View, _extends$1({
10692
+ style: style
10693
+ }, nativeProps), /*#__PURE__*/React.createElement(StyledBackDrop, {
10694
+ themeSlideBackground: items[currentSlideIndex].background
10695
+ }), /*#__PURE__*/React.createElement(StyledCarouselView, null, /*#__PURE__*/React.createElement(FlatList, {
10696
+ horizontal: true,
10697
+ showsHorizontalScrollIndicator: false,
10698
+ pagingEnabled: true,
10699
+ bounces: false,
10700
+ data: items,
10701
+ onViewableItemsChanged: visibleSlideChanged,
10702
+ viewabilityConfig: viewConfig,
10703
+ scrollEventThrottle: 32,
10704
+ ref: carouselRef,
10705
+ onScroll: Animated.event([{
10706
+ nativeEvent: {
10707
+ contentOffset: {
10708
+ x: scrollX
10709
+ }
10710
+ }
10711
+ }], {
10712
+ useNativeDriver: false
10713
+ }),
10714
+ renderItem: function renderItem(_ref3) {
10715
+ var item = _ref3.item;
10716
+ if (!item) return null;
10717
+ var image = item.image,
10718
+ heading = item.heading,
10719
+ body = item.body,
10720
+ content = item.content;
10721
+ return /*#__PURE__*/React.createElement(CarouselItem, {
10722
+ image: image,
10723
+ heading: heading,
10724
+ body: body,
10725
+ content: content,
10726
+ width: width
10727
+ });
10728
+ }
10729
+ }), /*#__PURE__*/React.createElement(StyledCarouselFooterWrapper, null, renderActions && renderActions(currentSlideIndex), /*#__PURE__*/React.createElement(CarouselPaginator, {
10730
+ numberOfSlides: items.length,
10731
+ scrollX: scrollX
10732
+ }))));
10733
+ };
10734
+
10451
10735
  var StyledDataCard = index$a(View)(function (_ref) {
10452
10736
  var theme = _ref.theme;
10453
10737
  return {
@@ -10466,12 +10750,12 @@ var Indicator = index$a(View)(function (_ref2) {
10466
10750
  };
10467
10751
  });
10468
10752
 
10469
- var _excluded$9 = ["intent", "children"];
10753
+ var _excluded$8 = ["intent", "children"];
10470
10754
  var DataCard = function DataCard(_ref) {
10471
10755
  var _ref$intent = _ref.intent,
10472
10756
  intent = _ref$intent === void 0 ? 'info' : _ref$intent,
10473
10757
  children = _ref.children,
10474
- nativeProps = _objectWithoutProperties(_ref, _excluded$9);
10758
+ nativeProps = _objectWithoutProperties(_ref, _excluded$8);
10475
10759
  return /*#__PURE__*/React.createElement(StyledDataCard, nativeProps, /*#__PURE__*/React.createElement(Indicator, {
10476
10760
  themeIntent: intent,
10477
10761
  testID: "data-card-indicator"
@@ -10489,11 +10773,11 @@ var StyledCard = index$a(View)(function (_ref) {
10489
10773
  });
10490
10774
  });
10491
10775
 
10492
- var _excluded$8 = ["intent", "children"];
10776
+ var _excluded$7 = ["intent", "children"];
10493
10777
  var Card = function Card(_ref) {
10494
10778
  var intent = _ref.intent,
10495
10779
  children = _ref.children,
10496
- nativeProps = _objectWithoutProperties(_ref, _excluded$8);
10780
+ nativeProps = _objectWithoutProperties(_ref, _excluded$7);
10497
10781
  return /*#__PURE__*/React.createElement(StyledCard, _extends$1({}, nativeProps, {
10498
10782
  themeIntent: intent
10499
10783
  }), children);
@@ -10727,7 +11011,7 @@ var StyledErrorAndMaxLengthContainer = index$a(View)(function () {
10727
11011
  };
10728
11012
  });
10729
11013
 
10730
- 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"];
10731
11015
  var getVariant$1 = function getVariant(_ref) {
10732
11016
  var disabled = _ref.disabled,
10733
11017
  error = _ref.error,
@@ -10773,7 +11057,7 @@ var TextInput = function TextInput(_ref2, ref) {
10773
11057
  value = _ref2.value,
10774
11058
  defaultValue = _ref2.defaultValue,
10775
11059
  renderInputValue = _ref2.renderInputValue,
10776
- nativeProps = _objectWithoutProperties(_ref2, _excluded$7);
11060
+ nativeProps = _objectWithoutProperties(_ref2, _excluded$6);
10777
11061
  var displayText = (_ref3 = value !== undefined ? value : defaultValue) !== null && _ref3 !== void 0 ? _ref3 : '';
10778
11062
  var isEmptyValue = displayText.length === 0;
10779
11063
  var actualSuffix = loading ? 'loading' : suffix;
@@ -11452,11 +11736,11 @@ var StyledFABText = index$a(Text$1)(function (_ref3) {
11452
11736
  };
11453
11737
  });
11454
11738
 
11455
- var _excluded$6 = ["active"];
11739
+ var _excluded$5 = ["active"];
11456
11740
  var AnimatedIcons = Animated.createAnimatedComponent(StyledFABIcon);
11457
11741
  var AnimatedFABIcon = function AnimatedFABIcon(_ref) {
11458
11742
  var active = _ref.active,
11459
- iconProps = _objectWithoutProperties(_ref, _excluded$6);
11743
+ iconProps = _objectWithoutProperties(_ref, _excluded$5);
11460
11744
  var rotateAnimation = useRef(new Animated.Value(active ? 1 : 0));
11461
11745
  useEffect(function () {
11462
11746
  var animation = Animated.timing(rotateAnimation.current, {
@@ -11703,27 +11987,6 @@ var index$6 = Object.assign(FAB, {
11703
11987
  ActionGroup: ActionGroup
11704
11988
  });
11705
11989
 
11706
- var _excluded$5 = ["rounded", "size", "testID", "style"];
11707
- var Image = function Image(_ref) {
11708
- var _ref$rounded = _ref.rounded,
11709
- rounded = _ref$rounded === void 0 ? false : _ref$rounded,
11710
- _ref$size = _ref.size,
11711
- size = _ref$size === void 0 ? '6xlarge' : _ref$size,
11712
- testID = _ref.testID,
11713
- style = _ref.style,
11714
- imageNativeProps = _objectWithoutProperties(_ref, _excluded$5);
11715
- var theme = useTheme();
11716
- var imageSize = theme.__hd__.image.sizes[size];
11717
- return /*#__PURE__*/React.createElement(Image$1, _extends$1({
11718
- testID: testID,
11719
- style: [{
11720
- width: imageSize,
11721
- height: imageSize,
11722
- borderRadius: rounded ? imageSize / 2 : 0
11723
- }, style]
11724
- }, imageNativeProps));
11725
- };
11726
-
11727
11990
  var StyledListItemContainer$1 = index$a(TouchableOpacity)(function (_ref) {
11728
11991
  var theme = _ref.theme,
11729
11992
  _ref$themeSelected = _ref.themeSelected,
@@ -30947,4 +31210,4 @@ var index = Object.assign(RichTextEditor$1, {
30947
31210
  Toolbar: EditorToolbar
30948
31211
  });
30949
31212
 
30950
- export { Accordion, Alert, Attachment, index$9 as Avatar, Badge$1 as Badge, BottomNavigation, BottomSheet$1 as BottomSheet, Box, CompoundButton as Button, Calendar, index$8 as Card, Checkbox, Collapse, ContentNavigator, DatePicker, Divider, index$7 as Drawer, Empty, index$6 as FAB, Icon, Image, List, PinInput, Progress, CompoundRadio as Radio, RefreshControl, index as RichTextEditor, SectionHeading, index$4 as Select, Slider, Spinner, index$5 as Swipeable, index$3 as Switch, index$2 as Tabs, Tag, TextInput$1 as TextInput, ThemeProvider, ThemeSwitcher, TimePicker, Toast, index$1 as Toolbar, Typography, eBensSystemPalette, getTheme$1 as getTheme, jobsSystemPalette, scale, swagSystemPalette, defaultTheme as theme, useAvatarColors, useTheme, walletSystemPalette, workSystemPalette };
31213
+ export { Accordion, Alert, Attachment, index$9 as Avatar, Badge$1 as Badge, BottomNavigation, BottomSheet$1 as BottomSheet, Box, CompoundButton as Button, Calendar, index$8 as Card, Carousel, Checkbox, Collapse, ContentNavigator, DatePicker, Divider, index$7 as Drawer, Empty, index$6 as FAB, Icon, Image, List, PinInput, Progress, CompoundRadio as Radio, RefreshControl, index as RichTextEditor, SectionHeading, index$4 as Select, Slider, Spinner, index$5 as Swipeable, index$3 as Switch, index$2 as Tabs, Tag, TextInput$1 as TextInput, ThemeProvider, ThemeSwitcher, TimePicker, Toast, index$1 as Toolbar, Typography, eBensSystemPalette, getTheme$1 as getTheme, jobsSystemPalette, scale, swagSystemPalette, defaultTheme as theme, useAvatarColors, useTheme, walletSystemPalette, workSystemPalette };