@hero-design/rn 8.3.0 → 8.3.2
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/.turbo/turbo-build.log +9 -9
- package/es/index.js +88 -88
- package/lib/index.js +85 -85
- package/package.json +5 -5
- package/src/components/Carousel/CarouselItem.tsx +1 -6
- package/src/components/Carousel/CarouselPaginator/StyledCarouselPaginator.tsx +10 -9
- package/src/components/Carousel/CarouselPaginator/index.tsx +2 -3
- package/src/components/Carousel/StyledCarousel.tsx +9 -6
- package/src/components/Carousel/__tests__/StyledCarousel.spec.tsx +3 -3
- package/src/components/Carousel/__tests__/__snapshots__/StyledCarousel.spec.tsx.snap +1 -2
- package/src/components/Carousel/__tests__/__snapshots__/index.spec.tsx.snap +600 -0
- package/src/components/Carousel/__tests__/index.spec.tsx +15 -7
- package/src/components/Carousel/index.tsx +65 -84
- package/src/components/TextInput/index.tsx +199 -197
- package/src/components/Typography/Text/StyledText.tsx +1 -0
- package/src/components/Typography/Text/index.tsx +1 -0
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +9 -2
- package/src/theme/components/carousel.ts +5 -2
- package/src/theme/components/typography.ts +2 -0
- package/src/theme/global/typography.ts +3 -0
- package/types/components/Carousel/CarouselItem.d.ts +1 -2
- package/types/components/Carousel/CarouselPaginator/StyledCarouselPaginator.d.ts +0 -2
- package/types/components/Carousel/StyledCarousel.d.ts +6 -4
- package/types/components/Carousel/index.d.ts +9 -23
- package/types/components/TextInput/index.d.ts +2 -2
- package/types/components/Typography/Text/StyledText.d.ts +1 -1
- package/types/components/Typography/Text/index.d.ts +1 -1
- package/types/theme/components/carousel.d.ts +3 -0
- package/types/theme/components/typography.d.ts +2 -0
- package/types/theme/global/typography.d.ts +1 -0
package/lib/index.js
CHANGED
|
@@ -1405,6 +1405,7 @@ var getFontSizes = function getFontSizes(baseFontSize) {
|
|
|
1405
1405
|
});
|
|
1406
1406
|
return {
|
|
1407
1407
|
'7xlarge': scale(fontSizes[10]),
|
|
1408
|
+
'6xlarge': scale(fontSizes[9]),
|
|
1408
1409
|
xxxxxlarge: scale(fontSizes[8]),
|
|
1409
1410
|
xxxxlarge: scale(fontSizes[7]),
|
|
1410
1411
|
xxxlarge: scale(fontSizes[6]),
|
|
@@ -1421,6 +1422,7 @@ var getLineHeights = function getLineHeights(fontSizes) {
|
|
|
1421
1422
|
var additionalSpace = 8;
|
|
1422
1423
|
return {
|
|
1423
1424
|
'7xlarge': fontSizes['7xlarge'] + additionalSpace,
|
|
1425
|
+
'6xlarge': fontSizes['6xlarge'] + additionalSpace,
|
|
1424
1426
|
xxxxxlarge: fontSizes.xxxxxlarge + additionalSpace,
|
|
1425
1427
|
xxxxlarge: fontSizes.xxxxlarge + additionalSpace,
|
|
1426
1428
|
xxxlarge: fontSizes.xxxlarge + additionalSpace,
|
|
@@ -1833,7 +1835,10 @@ var getCarouselTheme = function getCarouselTheme(theme) {
|
|
|
1833
1835
|
var space = {
|
|
1834
1836
|
headingMarginTop: theme.space.small,
|
|
1835
1837
|
headingMarginBottom: theme.space.medium,
|
|
1836
|
-
paginatorMarginHorizontal: theme.space.small
|
|
1838
|
+
paginatorMarginHorizontal: theme.space.small,
|
|
1839
|
+
footerPaddingHorizontal: theme.space.large,
|
|
1840
|
+
footerPaddingVertical: theme.space.medium,
|
|
1841
|
+
footerMarginBottom: theme.space.large
|
|
1837
1842
|
};
|
|
1838
1843
|
var sizes = {
|
|
1839
1844
|
indicatorWidth: theme.sizes.medium,
|
|
@@ -1844,13 +1849,13 @@ var getCarouselTheme = function getCarouselTheme(theme) {
|
|
|
1844
1849
|
paginatorBorderRadius: theme.radii.rounded
|
|
1845
1850
|
};
|
|
1846
1851
|
var fontSizes = {
|
|
1847
|
-
heading: theme.fontSizes
|
|
1852
|
+
heading: theme.fontSizes['6xlarge']
|
|
1848
1853
|
};
|
|
1849
1854
|
var fonts = {
|
|
1850
1855
|
heading: theme.fonts.playful.semiBold
|
|
1851
1856
|
};
|
|
1852
1857
|
var lineHeights = {
|
|
1853
|
-
heading: theme.lineHeights
|
|
1858
|
+
heading: theme.lineHeights['6xlarge']
|
|
1854
1859
|
};
|
|
1855
1860
|
return {
|
|
1856
1861
|
colors: colors,
|
|
@@ -2698,6 +2703,7 @@ var getTypographyTheme = function getTypographyTheme(theme) {
|
|
|
2698
2703
|
xlarge: theme.fontSizes.xlarge,
|
|
2699
2704
|
xxxlarge: theme.fontSizes.xxxlarge,
|
|
2700
2705
|
xxxxxlarge: theme.fontSizes.xxxxxlarge,
|
|
2706
|
+
'6xlarge': theme.fontSizes['6xlarge'],
|
|
2701
2707
|
'7xlarge': theme.fontSizes['7xlarge']
|
|
2702
2708
|
};
|
|
2703
2709
|
var lineHeights = {
|
|
@@ -2707,6 +2713,7 @@ var getTypographyTheme = function getTypographyTheme(theme) {
|
|
|
2707
2713
|
xlarge: theme.lineHeights.xlarge,
|
|
2708
2714
|
xxxlarge: theme.lineHeights.xxxlarge,
|
|
2709
2715
|
xxxxxlarge: theme.lineHeights.xxxxxlarge,
|
|
2716
|
+
'6xlarge': theme.lineHeights['6xlarge'],
|
|
2710
2717
|
'7xlarge': theme.lineHeights['7xlarge']
|
|
2711
2718
|
};
|
|
2712
2719
|
return {
|
|
@@ -10518,7 +10525,8 @@ var Calendar = function Calendar(_ref) {
|
|
|
10518
10525
|
var StyledCarouselPaginator = index$a(reactNative.View)(function () {
|
|
10519
10526
|
return {
|
|
10520
10527
|
flexDirection: 'row',
|
|
10521
|
-
alignItems: 'center'
|
|
10528
|
+
alignItems: 'center',
|
|
10529
|
+
marginStart: 'auto'
|
|
10522
10530
|
};
|
|
10523
10531
|
});
|
|
10524
10532
|
var StyledCarouselPaginatorAnimatedView = index$a(reactNative.Animated.View)(function (_ref) {
|
|
@@ -10539,7 +10547,7 @@ var CarouselPaginator = function CarouselPaginator(_ref) {
|
|
|
10539
10547
|
width = _useWindowDimensions.width;
|
|
10540
10548
|
var theme = useTheme();
|
|
10541
10549
|
return /*#__PURE__*/React__default["default"].createElement(StyledCarouselPaginator, null, new Array(numberOfSlides).fill('').map(function (_, index) {
|
|
10542
|
-
var inputRange = [(index - 1) * width, index * width, (index + 1) * width];
|
|
10550
|
+
var inputRange = [(index - 1) * width - 1, index * width - 1, (index + 1) * width];
|
|
10543
10551
|
var indicatorWidth = scrollX.interpolate({
|
|
10544
10552
|
inputRange: inputRange,
|
|
10545
10553
|
outputRange: [theme.space.small, theme.space.large, theme.space.small],
|
|
@@ -10551,7 +10559,6 @@ var CarouselPaginator = function CarouselPaginator(_ref) {
|
|
|
10551
10559
|
extrapolate: 'clamp'
|
|
10552
10560
|
});
|
|
10553
10561
|
return /*#__PURE__*/React__default["default"].createElement(StyledCarouselPaginatorAnimatedView, {
|
|
10554
|
-
indicatorWidth: indicatorWidth,
|
|
10555
10562
|
style: [{
|
|
10556
10563
|
width: indicatorWidth,
|
|
10557
10564
|
opacity: opacity
|
|
@@ -10582,10 +10589,9 @@ var Image = function Image(_ref) {
|
|
|
10582
10589
|
}, imageNativeProps));
|
|
10583
10590
|
};
|
|
10584
10591
|
|
|
10585
|
-
var
|
|
10592
|
+
var StyledBackDrop = index$a(reactNative.View)(function (_ref) {
|
|
10586
10593
|
var themeSlideBackground = _ref.themeSlideBackground;
|
|
10587
10594
|
return {
|
|
10588
|
-
zIndex: 99999,
|
|
10589
10595
|
position: 'absolute',
|
|
10590
10596
|
backgroundColor: themeSlideBackground,
|
|
10591
10597
|
top: 0,
|
|
@@ -10596,8 +10602,8 @@ var StyledCarousel = index$a(reactNative.View)(function (_ref) {
|
|
|
10596
10602
|
});
|
|
10597
10603
|
var StyledCarouselView = index$a(reactNative.View)(function () {
|
|
10598
10604
|
return {
|
|
10599
|
-
|
|
10600
|
-
|
|
10605
|
+
flexGrow: 2,
|
|
10606
|
+
justifyContent: 'space-between'
|
|
10601
10607
|
};
|
|
10602
10608
|
});
|
|
10603
10609
|
var StyledCarouselHeading = index$a(Typography.Text)(function (_ref2) {
|
|
@@ -10623,9 +10629,14 @@ var StyledCarouselContentWrapper = index$a(Box)(function (_ref3) {
|
|
|
10623
10629
|
width: width
|
|
10624
10630
|
};
|
|
10625
10631
|
});
|
|
10626
|
-
var StyledCarouselFooterWrapper = index$a(
|
|
10632
|
+
var StyledCarouselFooterWrapper = index$a(reactNative.View)(function (_ref4) {
|
|
10633
|
+
var theme = _ref4.theme;
|
|
10627
10634
|
return {
|
|
10628
|
-
|
|
10635
|
+
paddingHorizontal: theme.__hd__.carousel.space.footerPaddingHorizontal,
|
|
10636
|
+
flexDirection: 'row',
|
|
10637
|
+
justifyContent: 'space-between',
|
|
10638
|
+
paddingVertical: theme.__hd__.carousel.space.footerPaddingVertical,
|
|
10639
|
+
marginBottom: theme.__hd__.carousel.space.footerMarginBottom
|
|
10629
10640
|
};
|
|
10630
10641
|
});
|
|
10631
10642
|
|
|
@@ -10634,8 +10645,7 @@ var CarouselItem = function CarouselItem(_ref) {
|
|
|
10634
10645
|
image = _ref.image,
|
|
10635
10646
|
content = _ref.content,
|
|
10636
10647
|
heading = _ref.heading,
|
|
10637
|
-
body = _ref.body
|
|
10638
|
-
minHeight = _ref.minHeight;
|
|
10648
|
+
body = _ref.body;
|
|
10639
10649
|
return /*#__PURE__*/React__default["default"].createElement(Box, {
|
|
10640
10650
|
style: {
|
|
10641
10651
|
width: width
|
|
@@ -10647,67 +10657,71 @@ var CarouselItem = function CarouselItem(_ref) {
|
|
|
10647
10657
|
}), /*#__PURE__*/React__default["default"].createElement(StyledCarouselContentWrapper, {
|
|
10648
10658
|
paddingHorizontal: "large",
|
|
10649
10659
|
marginTop: "large",
|
|
10650
|
-
width: width
|
|
10651
|
-
|
|
10652
|
-
minHeight: minHeight
|
|
10653
|
-
}
|
|
10654
|
-
}, content, /*#__PURE__*/React__default["default"].createElement(StyledCarouselHeading, null, heading), body ? /*#__PURE__*/React__default["default"].createElement(Typography.Text, {
|
|
10655
|
-
fontSize: "large"
|
|
10656
|
-
}, body) : null));
|
|
10660
|
+
width: width
|
|
10661
|
+
}, content, /*#__PURE__*/React__default["default"].createElement(StyledCarouselHeading, null, heading), body ? /*#__PURE__*/React__default["default"].createElement(Typography.Text, null, body) : null));
|
|
10657
10662
|
};
|
|
10658
10663
|
|
|
10659
|
-
var _excluded$9 = ["items", "
|
|
10664
|
+
var _excluded$9 = ["items", "onItemIndexChange", "renderActions", "selectedItemIndex", "style"];
|
|
10665
|
+
function useStateFromProp(initialValue) {
|
|
10666
|
+
var _useState = React.useState(initialValue),
|
|
10667
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
10668
|
+
value = _useState2[0],
|
|
10669
|
+
setValue = _useState2[1];
|
|
10670
|
+
React.useEffect(function () {
|
|
10671
|
+
return setValue(initialValue);
|
|
10672
|
+
}, [initialValue]);
|
|
10673
|
+
return [value, setValue];
|
|
10674
|
+
}
|
|
10660
10675
|
var Carousel = function Carousel(_ref) {
|
|
10661
10676
|
var items = _ref.items,
|
|
10662
|
-
|
|
10663
|
-
|
|
10664
|
-
|
|
10665
|
-
_ref$
|
|
10666
|
-
|
|
10667
|
-
_ref$skipButtonLabel = _ref.skipButtonLabel,
|
|
10668
|
-
skipButtonLabel = _ref$skipButtonLabel === void 0 ? 'Skip' : _ref$skipButtonLabel,
|
|
10669
|
-
_ref$footerHeight = _ref.footerHeight,
|
|
10670
|
-
footerHeight = _ref$footerHeight === void 0 ? 70 : _ref$footerHeight,
|
|
10671
|
-
_ref$minContentHeight = _ref.minContentHeight,
|
|
10672
|
-
minContentHeight = _ref$minContentHeight === void 0 ? 250 : _ref$minContentHeight,
|
|
10677
|
+
onItemIndexChange = _ref.onItemIndexChange,
|
|
10678
|
+
renderActions = _ref.renderActions,
|
|
10679
|
+
_ref$selectedItemInde = _ref.selectedItemIndex,
|
|
10680
|
+
selectedItemIndex = _ref$selectedItemInde === void 0 ? 0 : _ref$selectedItemInde,
|
|
10681
|
+
style = _ref.style,
|
|
10673
10682
|
nativeProps = _objectWithoutProperties(_ref, _excluded$9);
|
|
10674
10683
|
var carouselRef = React.useRef(null);
|
|
10675
|
-
var
|
|
10676
|
-
|
|
10677
|
-
currentSlideIndex =
|
|
10678
|
-
setCurrentSlideIndex =
|
|
10684
|
+
var _useStateFromProp = useStateFromProp(selectedItemIndex),
|
|
10685
|
+
_useStateFromProp2 = _slicedToArray(_useStateFromProp, 2),
|
|
10686
|
+
currentSlideIndex = _useStateFromProp2[0],
|
|
10687
|
+
setCurrentSlideIndex = _useStateFromProp2[1];
|
|
10688
|
+
var internalOnItemIndexChange = React.useCallback(function (index) {
|
|
10689
|
+
setCurrentSlideIndex(index);
|
|
10690
|
+
if (onItemIndexChange) {
|
|
10691
|
+
onItemIndexChange(index);
|
|
10692
|
+
}
|
|
10693
|
+
}, [setCurrentSlideIndex, onItemIndexChange]);
|
|
10679
10694
|
var _useWindowDimensions = reactNative.useWindowDimensions(),
|
|
10680
10695
|
width = _useWindowDimensions.width;
|
|
10681
10696
|
var scrollX = React.useRef(new reactNative.Animated.Value(0)).current;
|
|
10697
|
+
React.useEffect(function () {
|
|
10698
|
+
// must use setTimeout since when layout is mounted, the pagination dots are not set correct scrollX
|
|
10699
|
+
var handle = setTimeout(function () {
|
|
10700
|
+
var _carouselRef$current;
|
|
10701
|
+
scrollX.setValue(currentSlideIndex * width);
|
|
10702
|
+
(_carouselRef$current = carouselRef.current) === null || _carouselRef$current === void 0 ? void 0 : _carouselRef$current.scrollToOffset({
|
|
10703
|
+
offset: currentSlideIndex * width,
|
|
10704
|
+
animated: true
|
|
10705
|
+
});
|
|
10706
|
+
}, 100);
|
|
10707
|
+
return function () {
|
|
10708
|
+
clearTimeout(handle);
|
|
10709
|
+
};
|
|
10710
|
+
}, [currentSlideIndex, carouselRef]);
|
|
10682
10711
|
var visibleSlideChanged = React.useCallback(function (_ref2) {
|
|
10683
10712
|
var viewableItems = _ref2.viewableItems;
|
|
10684
10713
|
if (!viewableItems || viewableItems && !viewableItems.length) return;
|
|
10685
|
-
var
|
|
10686
|
-
|
|
10687
|
-
|
|
10688
|
-
if (onSlideChange) {
|
|
10689
|
-
onSlideChange(currentSlide);
|
|
10690
|
-
}
|
|
10691
|
-
}, [items, onSlideChange]);
|
|
10692
|
-
var skipCarousel = React.useCallback(function () {
|
|
10693
|
-
var currentSlide = items[currentSlideIndex];
|
|
10694
|
-
if (onSkipPress) {
|
|
10695
|
-
onSkipPress(currentSlide);
|
|
10696
|
-
}
|
|
10697
|
-
}, [currentSlideIndex, onSkipPress, items]);
|
|
10698
|
-
var finishCarousel = React.useCallback(function () {
|
|
10699
|
-
var currentSlide = items[currentSlideIndex];
|
|
10700
|
-
if (onFinishPress) {
|
|
10701
|
-
onFinishPress(currentSlide);
|
|
10702
|
-
}
|
|
10703
|
-
}, [onFinishPress, items, currentSlideIndex]);
|
|
10714
|
+
var index = viewableItems[0].index;
|
|
10715
|
+
internalOnItemIndexChange(index);
|
|
10716
|
+
}, []);
|
|
10704
10717
|
var viewConfig = React.useRef({
|
|
10705
10718
|
viewAreaCoveragePercentThreshold: 50
|
|
10706
10719
|
}).current;
|
|
10707
|
-
|
|
10708
|
-
|
|
10720
|
+
return /*#__PURE__*/React__default["default"].createElement(reactNative.View, _extends$1({
|
|
10721
|
+
style: style
|
|
10722
|
+
}, nativeProps), /*#__PURE__*/React__default["default"].createElement(StyledBackDrop, {
|
|
10709
10723
|
themeSlideBackground: items[currentSlideIndex].background
|
|
10710
|
-
}
|
|
10724
|
+
}), /*#__PURE__*/React__default["default"].createElement(StyledCarouselView, null, /*#__PURE__*/React__default["default"].createElement(reactNative.FlatList, {
|
|
10711
10725
|
horizontal: true,
|
|
10712
10726
|
showsHorizontalScrollIndicator: false,
|
|
10713
10727
|
pagingEnabled: true,
|
|
@@ -10738,23 +10752,10 @@ var Carousel = function Carousel(_ref) {
|
|
|
10738
10752
|
heading: heading,
|
|
10739
10753
|
body: body,
|
|
10740
10754
|
content: content,
|
|
10741
|
-
minHeight: minContentHeight,
|
|
10742
10755
|
width: width
|
|
10743
10756
|
});
|
|
10744
10757
|
}
|
|
10745
|
-
}), /*#__PURE__*/React__default["default"].createElement(StyledCarouselFooterWrapper, {
|
|
10746
|
-
paddingHorizontal: "large",
|
|
10747
|
-
flexDirection: "row",
|
|
10748
|
-
justifyContent: "space-between",
|
|
10749
|
-
style: {
|
|
10750
|
-
height: footerHeight
|
|
10751
|
-
}
|
|
10752
|
-
}, /*#__PURE__*/React__default["default"].createElement(CompoundButton, {
|
|
10753
|
-
variant: isLastSlide ? 'filled' : 'text',
|
|
10754
|
-
intent: "primary",
|
|
10755
|
-
onPress: isLastSlide ? finishCarousel : skipCarousel,
|
|
10756
|
-
text: isLastSlide ? finishButtonLabel : skipButtonLabel
|
|
10757
|
-
}), /*#__PURE__*/React__default["default"].createElement(CarouselPaginator, {
|
|
10758
|
+
}), /*#__PURE__*/React__default["default"].createElement(StyledCarouselFooterWrapper, null, renderActions && renderActions(currentSlideIndex), /*#__PURE__*/React__default["default"].createElement(CarouselPaginator, {
|
|
10758
10759
|
numberOfSlides: items.length,
|
|
10759
10760
|
scrollX: scrollX
|
|
10760
10761
|
}))));
|
|
@@ -11063,7 +11064,7 @@ var getVariant$1 = function getVariant(_ref) {
|
|
|
11063
11064
|
// Fix issue: Placeholder is not shown on iOS when multiline is true
|
|
11064
11065
|
// https://github.com/callstack/react-native-paper/pull/3331
|
|
11065
11066
|
var EMPTY_PLACEHOLDER_VALUE = ' ';
|
|
11066
|
-
var TextInput = function
|
|
11067
|
+
var TextInput = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
|
|
11067
11068
|
var _ref3;
|
|
11068
11069
|
var label = _ref2.label,
|
|
11069
11070
|
prefix = _ref2.prefix,
|
|
@@ -11232,8 +11233,7 @@ var TextInput = function TextInput(_ref2, ref) {
|
|
|
11232
11233
|
themeVariant: variant,
|
|
11233
11234
|
fontSize: "small"
|
|
11234
11235
|
}, displayText.length, "/", maxLength)), !!helpText && /*#__PURE__*/React__default["default"].createElement(StyledHelperText, null, helpText)));
|
|
11235
|
-
};
|
|
11236
|
-
var TextInput$1 = /*#__PURE__*/React__default["default"].forwardRef(TextInput);
|
|
11236
|
+
});
|
|
11237
11237
|
|
|
11238
11238
|
var DatePickerAndroid = function DatePickerAndroid(_ref) {
|
|
11239
11239
|
var value = _ref.value,
|
|
@@ -11265,7 +11265,7 @@ var DatePickerAndroid = function DatePickerAndroid(_ref) {
|
|
|
11265
11265
|
}, /*#__PURE__*/React__default["default"].createElement(reactNative.View, {
|
|
11266
11266
|
pointerEvents: "none",
|
|
11267
11267
|
testID: "datePickerInputAndroid"
|
|
11268
|
-
}, /*#__PURE__*/React__default["default"].createElement(TextInput
|
|
11268
|
+
}, /*#__PURE__*/React__default["default"].createElement(TextInput, {
|
|
11269
11269
|
label: label,
|
|
11270
11270
|
value: displayValue,
|
|
11271
11271
|
suffix: "calendar-dates-outlined",
|
|
@@ -11333,7 +11333,7 @@ var DatePickerIOS = function DatePickerIOS(_ref) {
|
|
|
11333
11333
|
}, /*#__PURE__*/React__default["default"].createElement(reactNative.View, {
|
|
11334
11334
|
pointerEvents: "none",
|
|
11335
11335
|
testID: "datePickerInputIOS"
|
|
11336
|
-
}, /*#__PURE__*/React__default["default"].createElement(TextInput
|
|
11336
|
+
}, /*#__PURE__*/React__default["default"].createElement(TextInput, {
|
|
11337
11337
|
label: label,
|
|
11338
11338
|
value: displayValue,
|
|
11339
11339
|
suffix: "calendar-dates-outlined",
|
|
@@ -13378,7 +13378,7 @@ function MultiSelect(_ref) {
|
|
|
13378
13378
|
}
|
|
13379
13379
|
}, /*#__PURE__*/React__default["default"].createElement(reactNative.View, {
|
|
13380
13380
|
pointerEvents: "none"
|
|
13381
|
-
}, /*#__PURE__*/React__default["default"].createElement(TextInput
|
|
13381
|
+
}, /*#__PURE__*/React__default["default"].createElement(TextInput, _extends$1({}, inputProps, {
|
|
13382
13382
|
label: label,
|
|
13383
13383
|
value: displayedValue,
|
|
13384
13384
|
suffix: "arrow-down",
|
|
@@ -13426,7 +13426,7 @@ function MultiSelect(_ref) {
|
|
|
13426
13426
|
(_sectionListRef$curre = sectionListRef.current) === null || _sectionListRef$curre === void 0 ? void 0 : _sectionListRef$curre.scrollToLocation(scrollParams);
|
|
13427
13427
|
}
|
|
13428
13428
|
}
|
|
13429
|
-
}, onQueryChange && /*#__PURE__*/React__default["default"].createElement(StyledSearchBar, null, /*#__PURE__*/React__default["default"].createElement(TextInput
|
|
13429
|
+
}, onQueryChange && /*#__PURE__*/React__default["default"].createElement(StyledSearchBar, null, /*#__PURE__*/React__default["default"].createElement(TextInput, {
|
|
13430
13430
|
editable: true,
|
|
13431
13431
|
placeholder: "Search",
|
|
13432
13432
|
suffix: "search-outlined",
|
|
@@ -13554,7 +13554,7 @@ var SingleSelect = function SingleSelect(_ref) {
|
|
|
13554
13554
|
}
|
|
13555
13555
|
}, /*#__PURE__*/React__default["default"].createElement(reactNative.View, {
|
|
13556
13556
|
pointerEvents: "none"
|
|
13557
|
-
}, /*#__PURE__*/React__default["default"].createElement(TextInput
|
|
13557
|
+
}, /*#__PURE__*/React__default["default"].createElement(TextInput, _extends$1({}, inputProps, {
|
|
13558
13558
|
label: label,
|
|
13559
13559
|
value: displayedValue,
|
|
13560
13560
|
suffix: "arrow-down",
|
|
@@ -13586,7 +13586,7 @@ var SingleSelect = function SingleSelect(_ref) {
|
|
|
13586
13586
|
(_sectionListRef$curre = sectionListRef.current) === null || _sectionListRef$curre === void 0 ? void 0 : _sectionListRef$curre.scrollToLocation(scrollParams);
|
|
13587
13587
|
}
|
|
13588
13588
|
}
|
|
13589
|
-
}, onQueryChange && /*#__PURE__*/React__default["default"].createElement(StyledSearchBar, null, /*#__PURE__*/React__default["default"].createElement(TextInput
|
|
13589
|
+
}, onQueryChange && /*#__PURE__*/React__default["default"].createElement(StyledSearchBar, null, /*#__PURE__*/React__default["default"].createElement(TextInput, {
|
|
13590
13590
|
editable: true,
|
|
13591
13591
|
placeholder: "Search",
|
|
13592
13592
|
suffix: "search-outlined",
|
|
@@ -14327,7 +14327,7 @@ var TimePickerAndroid = function TimePickerAndroid(_ref) {
|
|
|
14327
14327
|
}, /*#__PURE__*/React__default["default"].createElement(reactNative.View, {
|
|
14328
14328
|
pointerEvents: "none",
|
|
14329
14329
|
testID: "timePickerInputAndroid"
|
|
14330
|
-
}, /*#__PURE__*/React__default["default"].createElement(TextInput
|
|
14330
|
+
}, /*#__PURE__*/React__default["default"].createElement(TextInput, {
|
|
14331
14331
|
label: label,
|
|
14332
14332
|
value: displayValue,
|
|
14333
14333
|
suffix: showSuffix ? 'clock-3' : undefined,
|
|
@@ -14395,7 +14395,7 @@ var TimePickerIOS = function TimePickerIOS(_ref) {
|
|
|
14395
14395
|
}, /*#__PURE__*/React__default["default"].createElement(reactNative.View, {
|
|
14396
14396
|
pointerEvents: "none",
|
|
14397
14397
|
testID: "timePickerInputIOS"
|
|
14398
|
-
}, /*#__PURE__*/React__default["default"].createElement(TextInput
|
|
14398
|
+
}, /*#__PURE__*/React__default["default"].createElement(TextInput, {
|
|
14399
14399
|
label: label,
|
|
14400
14400
|
value: displayValue,
|
|
14401
14401
|
suffix: showSuffix ? 'clock-3' : undefined,
|
|
@@ -31274,7 +31274,7 @@ exports.Swipeable = index$5;
|
|
|
31274
31274
|
exports.Switch = index$3;
|
|
31275
31275
|
exports.Tabs = index$2;
|
|
31276
31276
|
exports.Tag = Tag;
|
|
31277
|
-
exports.TextInput = TextInput
|
|
31277
|
+
exports.TextInput = TextInput;
|
|
31278
31278
|
exports.ThemeProvider = ThemeProvider;
|
|
31279
31279
|
exports.ThemeSwitcher = ThemeSwitcher;
|
|
31280
31280
|
exports.TimePicker = TimePicker;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hero-design/rn",
|
|
3
|
-
"version": "8.3.
|
|
3
|
+
"version": "8.3.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@emotion/native": "^11.9.3",
|
|
23
23
|
"@emotion/react": "^11.9.3",
|
|
24
|
-
"@hero-design/colors": "8.3.
|
|
24
|
+
"@hero-design/colors": "8.3.2",
|
|
25
25
|
"date-fns": "^2.16.1",
|
|
26
26
|
"events": "^3.2.0",
|
|
27
27
|
"hero-editor": "^1.9.21"
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@babel/preset-typescript": "^7.17.12",
|
|
45
45
|
"@babel/runtime": "^7.18.9",
|
|
46
46
|
"@emotion/jest": "^11.9.3",
|
|
47
|
-
"@hero-design/eslint-plugin": "8.3.
|
|
47
|
+
"@hero-design/eslint-plugin": "8.3.2",
|
|
48
48
|
"@react-native-community/datetimepicker": "^3.5.2",
|
|
49
49
|
"@react-native-community/slider": "4.1.12",
|
|
50
50
|
"@rollup/plugin-babel": "^5.3.1",
|
|
@@ -60,9 +60,9 @@
|
|
|
60
60
|
"@types/react-native": "^0.67.7",
|
|
61
61
|
"@types/react-native-vector-icons": "^6.4.10",
|
|
62
62
|
"babel-plugin-inline-import": "^3.0.0",
|
|
63
|
-
"eslint-config-hd": "8.3.
|
|
63
|
+
"eslint-config-hd": "8.3.2",
|
|
64
64
|
"jest": "^27.3.1",
|
|
65
|
-
"prettier-config-hd": "8.3.
|
|
65
|
+
"prettier-config-hd": "8.3.2",
|
|
66
66
|
"react": "18.0.0",
|
|
67
67
|
"react-native": "0.69.7",
|
|
68
68
|
"react-native-gesture-handler": "~2.1.0",
|
|
@@ -11,7 +11,6 @@ import { CarouselData } from './types';
|
|
|
11
11
|
|
|
12
12
|
interface CarouselItemProps extends Omit<CarouselData, 'background'> {
|
|
13
13
|
width: number;
|
|
14
|
-
minHeight: number;
|
|
15
14
|
}
|
|
16
15
|
|
|
17
16
|
const CarouselItem = ({
|
|
@@ -20,7 +19,6 @@ const CarouselItem = ({
|
|
|
20
19
|
content,
|
|
21
20
|
heading,
|
|
22
21
|
body,
|
|
23
|
-
minHeight,
|
|
24
22
|
}: CarouselItemProps) => {
|
|
25
23
|
return (
|
|
26
24
|
<Box style={{ width }}>
|
|
@@ -34,13 +32,10 @@ const CarouselItem = ({
|
|
|
34
32
|
paddingHorizontal="large"
|
|
35
33
|
marginTop="large"
|
|
36
34
|
width={width}
|
|
37
|
-
style={{ minHeight }}
|
|
38
35
|
>
|
|
39
36
|
{content}
|
|
40
37
|
<StyledCarouselHeading>{heading}</StyledCarouselHeading>
|
|
41
|
-
{body ?
|
|
42
|
-
<Typography.Text fontSize="large">{body}</Typography.Text>
|
|
43
|
-
) : null}
|
|
38
|
+
{body ? <Typography.Text>{body}</Typography.Text> : null}
|
|
44
39
|
</StyledCarouselContentWrapper>
|
|
45
40
|
</Box>
|
|
46
41
|
);
|
|
@@ -4,16 +4,17 @@ import styled from '@emotion/native';
|
|
|
4
4
|
const StyledCarouselPaginator = styled(View)(() => ({
|
|
5
5
|
flexDirection: 'row',
|
|
6
6
|
alignItems: 'center',
|
|
7
|
+
marginStart: 'auto',
|
|
7
8
|
}));
|
|
8
9
|
|
|
9
|
-
const StyledCarouselPaginatorAnimatedView = styled(Animated.View)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
const StyledCarouselPaginatorAnimatedView = styled(Animated.View)(
|
|
11
|
+
({ theme }) => ({
|
|
12
|
+
height: theme.__hd__.carousel.sizes.paginatorHeight,
|
|
13
|
+
width: theme.__hd__.carousel.sizes.paginatorWidth,
|
|
14
|
+
borderRadius: theme.__hd__.carousel.radii.paginatorBorderRadius,
|
|
15
|
+
backgroundColor: theme.__hd__.carousel.colors.paginatorBackgroundColor,
|
|
16
|
+
marginHorizontal: theme.__hd__.carousel.space.paginatorMarginHorizontal,
|
|
17
|
+
})
|
|
18
|
+
);
|
|
18
19
|
|
|
19
20
|
export { StyledCarouselPaginator, StyledCarouselPaginatorAnimatedView };
|
|
@@ -22,8 +22,8 @@ const CarouselPaginator = ({
|
|
|
22
22
|
<StyledCarouselPaginator>
|
|
23
23
|
{new Array(numberOfSlides).fill('').map((_, index) => {
|
|
24
24
|
const inputRange = [
|
|
25
|
-
(index - 1) * width,
|
|
26
|
-
index * width,
|
|
25
|
+
(index - 1) * width - 1,
|
|
26
|
+
index * width - 1,
|
|
27
27
|
(index + 1) * width,
|
|
28
28
|
];
|
|
29
29
|
|
|
@@ -45,7 +45,6 @@ const CarouselPaginator = ({
|
|
|
45
45
|
|
|
46
46
|
return (
|
|
47
47
|
<StyledCarouselPaginatorAnimatedView
|
|
48
|
-
indicatorWidth={indicatorWidth}
|
|
49
48
|
style={[{ width: indicatorWidth, opacity }]}
|
|
50
49
|
key={index.toString()}
|
|
51
50
|
/>
|
|
@@ -4,10 +4,9 @@ import Typography from '../Typography';
|
|
|
4
4
|
import Image from '../Image';
|
|
5
5
|
import Box from '../Box';
|
|
6
6
|
|
|
7
|
-
const
|
|
7
|
+
const StyledBackDrop = styled(View)<{
|
|
8
8
|
themeSlideBackground: string;
|
|
9
9
|
}>(({ themeSlideBackground }) => ({
|
|
10
|
-
zIndex: 99999,
|
|
11
10
|
position: 'absolute',
|
|
12
11
|
backgroundColor: themeSlideBackground,
|
|
13
12
|
top: 0,
|
|
@@ -17,8 +16,8 @@ const StyledCarousel = styled(View)<{
|
|
|
17
16
|
}));
|
|
18
17
|
|
|
19
18
|
const StyledCarouselView = styled(View)(() => ({
|
|
19
|
+
flexGrow: 2,
|
|
20
20
|
justifyContent: 'space-between',
|
|
21
|
-
height: '100%',
|
|
22
21
|
}));
|
|
23
22
|
|
|
24
23
|
const StyledCarouselHeading = styled(Typography.Text)(({ theme }) => ({
|
|
@@ -41,12 +40,16 @@ const StyledCarouselContentWrapper = styled(Box)<{
|
|
|
41
40
|
width,
|
|
42
41
|
}));
|
|
43
42
|
|
|
44
|
-
const StyledCarouselFooterWrapper = styled(
|
|
45
|
-
|
|
43
|
+
const StyledCarouselFooterWrapper = styled(View)(({ theme }) => ({
|
|
44
|
+
paddingHorizontal: theme.__hd__.carousel.space.footerPaddingHorizontal,
|
|
45
|
+
flexDirection: 'row',
|
|
46
|
+
justifyContent: 'space-between',
|
|
47
|
+
paddingVertical: theme.__hd__.carousel.space.footerPaddingVertical,
|
|
48
|
+
marginBottom: theme.__hd__.carousel.space.footerMarginBottom,
|
|
46
49
|
}));
|
|
47
50
|
|
|
48
51
|
export {
|
|
49
|
-
|
|
52
|
+
StyledBackDrop,
|
|
50
53
|
StyledCarouselView,
|
|
51
54
|
StyledCarouselHeading,
|
|
52
55
|
StyledCarouselImage,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import renderWithTheme from '../../../testHelpers/renderWithTheme';
|
|
3
|
-
import {
|
|
3
|
+
import { StyledBackDrop } from '../StyledCarousel';
|
|
4
4
|
import theme from '../../../theme';
|
|
5
5
|
|
|
6
|
-
describe('
|
|
6
|
+
describe('StyledBackDrop', () => {
|
|
7
7
|
it('renders correct basic style', () => {
|
|
8
8
|
const { toJSON } = renderWithTheme(
|
|
9
|
-
<
|
|
9
|
+
<StyledBackDrop themeSlideBackground={theme.colors.highlightedSurface} />
|
|
10
10
|
);
|
|
11
11
|
expect(toJSON()).toMatchSnapshot();
|
|
12
12
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`
|
|
3
|
+
exports[`StyledBackDrop renders correct basic style 1`] = `
|
|
4
4
|
<View
|
|
5
5
|
style={
|
|
6
6
|
Array [
|
|
@@ -11,7 +11,6 @@ exports[`StyledCard renders correct basic style 1`] = `
|
|
|
11
11
|
"position": "absolute",
|
|
12
12
|
"right": 0,
|
|
13
13
|
"top": 0,
|
|
14
|
-
"zIndex": 99999,
|
|
15
14
|
},
|
|
16
15
|
undefined,
|
|
17
16
|
]
|