@hero-design/rn 8.2.2 → 8.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +9 -9
- package/es/index.js +409 -80
- package/lib/index.js +407 -77
- package/package.json +5 -5
- package/src/components/Box/StyledBox.tsx +8 -6
- package/src/components/Card/StyledCard.tsx +1 -1
- package/src/components/Card/__tests__/__snapshots__/index.spec.tsx.snap +74 -0
- package/src/components/Card/__tests__/index.spec.tsx +2 -0
- package/src/components/Card/index.tsx +1 -1
- package/src/components/Carousel/CarouselItem.tsx +49 -0
- package/src/components/Carousel/CarouselPaginator/StyledCarouselPaginator.tsx +19 -0
- package/src/components/Carousel/CarouselPaginator/index.tsx +58 -0
- package/src/components/Carousel/StyledCarousel.tsx +55 -0
- package/src/components/Carousel/__tests__/StyledCarousel.spec.tsx +13 -0
- package/src/components/Carousel/__tests__/__snapshots__/StyledCarousel.spec.tsx.snap +21 -0
- package/src/components/Carousel/__tests__/index.spec.tsx +86 -0
- package/src/components/Carousel/index.tsx +176 -0
- package/src/components/Carousel/types.ts +10 -0
- package/src/components/Icon/index.tsx +28 -2
- package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +160 -0
- package/src/components/TextInput/__tests__/index.spec.tsx +50 -3
- package/src/components/TextInput/index.tsx +65 -30
- package/src/components/Toolbar/ToolbarGroup.tsx +20 -14
- package/src/components/Toolbar/ToolbarItem.tsx +9 -1
- package/src/components/Toolbar/__tests__/__snapshots__/ToolbarGroup.spec.tsx.snap +12 -0
- package/src/components/Toolbar/__tests__/__snapshots__/ToolbarItem.spec.tsx.snap +6 -0
- package/src/index.ts +2 -0
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +27 -0
- package/src/theme/components/carousel.ts +39 -0
- package/src/theme/getTheme.ts +3 -0
- package/src/types.ts +4 -1
- package/src/utils/__tests__/helpers.spec.ts +22 -4
- package/src/utils/helpers.ts +10 -9
- package/types/components/BottomNavigation/StyledBottomNavigation.d.ts +1 -1
- package/types/components/Box/StyledBox.d.ts +2 -2
- package/types/components/Button/StyledButton.d.ts +1 -1
- package/types/components/Button/UtilityButton/StyledUtilityButton.d.ts +1 -1
- package/types/components/Card/StyledCard.d.ts +1 -1
- package/types/components/Card/index.d.ts +1 -1
- package/types/components/Carousel/CarouselItem.d.ts +7 -0
- package/types/components/Carousel/CarouselPaginator/StyledCarouselPaginator.d.ts +16 -0
- package/types/components/Carousel/CarouselPaginator/index.d.ts +7 -0
- package/types/components/Carousel/StyledCarousel.d.ts +34 -0
- package/types/components/Carousel/index.d.ts +46 -0
- package/types/components/Carousel/types.d.ts +9 -0
- package/types/components/Checkbox/StyledCheckbox.d.ts +1 -1
- package/types/components/ContentNavigator/StyledContentNavigator.d.ts +1 -1
- package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +1 -1
- package/types/components/Icon/index.d.ts +3 -3
- package/types/components/TextInput/StyledTextInput.d.ts +7 -7
- package/types/components/TextInput/index.d.ts +25 -3
- package/types/components/Toolbar/ToolbarItem.d.ts +6 -1
- package/types/index.d.ts +2 -1
- package/types/theme/components/carousel.d.ts +29 -0
- package/types/theme/getTheme.d.ts +2 -0
- package/types/types.d.ts +3 -2
- package/types/utils/helpers.d.ts +2 -2
package/lib/index.js
CHANGED
|
@@ -1826,6 +1826,43 @@ var getCardTheme = function getCardTheme(theme) {
|
|
|
1826
1826
|
};
|
|
1827
1827
|
};
|
|
1828
1828
|
|
|
1829
|
+
var getCarouselTheme = function getCarouselTheme(theme) {
|
|
1830
|
+
var colors = {
|
|
1831
|
+
paginatorBackgroundColor: theme.colors.primary
|
|
1832
|
+
};
|
|
1833
|
+
var space = {
|
|
1834
|
+
headingMarginTop: theme.space.small,
|
|
1835
|
+
headingMarginBottom: theme.space.medium,
|
|
1836
|
+
paginatorMarginHorizontal: theme.space.small
|
|
1837
|
+
};
|
|
1838
|
+
var sizes = {
|
|
1839
|
+
indicatorWidth: theme.sizes.medium,
|
|
1840
|
+
paginatorHeight: theme.sizes.small,
|
|
1841
|
+
paginatorWidth: theme.sizes.small
|
|
1842
|
+
};
|
|
1843
|
+
var radii = {
|
|
1844
|
+
paginatorBorderRadius: theme.radii.rounded
|
|
1845
|
+
};
|
|
1846
|
+
var fontSizes = {
|
|
1847
|
+
heading: theme.fontSizes.xxxxxlarge
|
|
1848
|
+
};
|
|
1849
|
+
var fonts = {
|
|
1850
|
+
heading: theme.fonts.playful.semiBold
|
|
1851
|
+
};
|
|
1852
|
+
var lineHeights = {
|
|
1853
|
+
heading: theme.lineHeights.xxxlarge
|
|
1854
|
+
};
|
|
1855
|
+
return {
|
|
1856
|
+
colors: colors,
|
|
1857
|
+
sizes: sizes,
|
|
1858
|
+
radii: radii,
|
|
1859
|
+
space: space,
|
|
1860
|
+
fonts: fonts,
|
|
1861
|
+
fontSizes: fontSizes,
|
|
1862
|
+
lineHeights: lineHeights
|
|
1863
|
+
};
|
|
1864
|
+
};
|
|
1865
|
+
|
|
1829
1866
|
var getCheckboxTheme = function getCheckboxTheme(theme) {
|
|
1830
1867
|
var colors = {
|
|
1831
1868
|
"default": theme.colors.primaryOutline,
|
|
@@ -2696,6 +2733,7 @@ var getTheme$1 = function getTheme() {
|
|
|
2696
2733
|
button: getButtonTheme(globalTheme),
|
|
2697
2734
|
calendar: getCalendarTheme(globalTheme),
|
|
2698
2735
|
card: getCardTheme(globalTheme),
|
|
2736
|
+
carousel: getCarouselTheme(globalTheme),
|
|
2699
2737
|
checkbox: getCheckboxTheme(globalTheme),
|
|
2700
2738
|
contentNavigator: getContentNavigatorTheme(globalTheme),
|
|
2701
2739
|
datePicker: getDatePickerTheme(globalTheme),
|
|
@@ -5730,7 +5768,7 @@ var StyledText$3 = index$a(reactNative.Text)(function (_ref) {
|
|
|
5730
5768
|
});
|
|
5731
5769
|
});
|
|
5732
5770
|
|
|
5733
|
-
var _excluded$
|
|
5771
|
+
var _excluded$l = ["children", "fontSize", "fontWeight", "intent", "typeface"];
|
|
5734
5772
|
var Text = function Text(_ref) {
|
|
5735
5773
|
var children = _ref.children,
|
|
5736
5774
|
_ref$fontSize = _ref.fontSize,
|
|
@@ -5741,7 +5779,7 @@ var Text = function Text(_ref) {
|
|
|
5741
5779
|
intent = _ref$intent === void 0 ? 'body' : _ref$intent,
|
|
5742
5780
|
_ref$typeface = _ref.typeface,
|
|
5743
5781
|
typeface = _ref$typeface === void 0 ? 'neutral' : _ref$typeface,
|
|
5744
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
5782
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$l);
|
|
5745
5783
|
return /*#__PURE__*/React__default["default"].createElement(StyledText$3, _extends$1({}, nativeProps, {
|
|
5746
5784
|
themeFontSize: fontSize,
|
|
5747
5785
|
themeFontWeight: fontWeight,
|
|
@@ -6220,10 +6258,10 @@ var StyledHeroIcon = index$a(HeroIcon)(function (_ref) {
|
|
|
6220
6258
|
};
|
|
6221
6259
|
});
|
|
6222
6260
|
|
|
6223
|
-
var _excluded$
|
|
6261
|
+
var _excluded$k = ["style"];
|
|
6224
6262
|
var AnimatedIcon = function AnimatedIcon(_ref) {
|
|
6225
6263
|
var style = _ref.style,
|
|
6226
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$
|
|
6264
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$k);
|
|
6227
6265
|
var rotateAnimation = React.useRef(new reactNative.Animated.Value(0));
|
|
6228
6266
|
React.useEffect(function () {
|
|
6229
6267
|
var animation = reactNative.Animated.loop(reactNative.Animated.timing(rotateAnimation.current, {
|
|
@@ -6259,21 +6297,45 @@ var Icon = function Icon(_ref) {
|
|
|
6259
6297
|
intent = _ref$intent === void 0 ? 'text' : _ref$intent,
|
|
6260
6298
|
testID = _ref.testID,
|
|
6261
6299
|
_ref$spin = _ref.spin,
|
|
6262
|
-
spin = _ref$spin === void 0 ? false : _ref$spin
|
|
6300
|
+
spin = _ref$spin === void 0 ? false : _ref$spin,
|
|
6301
|
+
accessibilityLabel = _ref.accessibilityLabel,
|
|
6302
|
+
accessibilityHint = _ref.accessibilityHint,
|
|
6303
|
+
accessibilityRole = _ref.accessibilityRole,
|
|
6304
|
+
accessibilityState = _ref.accessibilityState,
|
|
6305
|
+
accessibilityValue = _ref.accessibilityValue,
|
|
6306
|
+
accessibilityLiveRegion = _ref.accessibilityLiveRegion,
|
|
6307
|
+
accessibilityElementsHidden = _ref.accessibilityElementsHidden,
|
|
6308
|
+
accessible = _ref.accessible,
|
|
6309
|
+
accessibilityIgnoresInvertColors = _ref.accessibilityIgnoresInvertColors,
|
|
6310
|
+
accessibilityViewIsModal = _ref.accessibilityViewIsModal,
|
|
6311
|
+
accessibilityActions = _ref.accessibilityActions;
|
|
6263
6312
|
useDeprecation("".concat(icon, " icon is deprecated and will be removed in the next major release, please use ").concat(icon.replace('carat', 'caret'), " instead."), icon.startsWith('carat'));
|
|
6264
|
-
|
|
6313
|
+
var accessibilityProps = {
|
|
6314
|
+
accessibilityLabel: accessibilityLabel,
|
|
6315
|
+
accessibilityHint: accessibilityHint,
|
|
6316
|
+
accessibilityRole: accessibilityRole,
|
|
6317
|
+
accessibilityState: accessibilityState,
|
|
6318
|
+
accessibilityValue: accessibilityValue,
|
|
6319
|
+
accessibilityLiveRegion: accessibilityLiveRegion,
|
|
6320
|
+
accessibilityElementsHidden: accessibilityElementsHidden,
|
|
6321
|
+
accessible: accessible,
|
|
6322
|
+
accessibilityIgnoresInvertColors: accessibilityIgnoresInvertColors,
|
|
6323
|
+
accessibilityViewIsModal: accessibilityViewIsModal,
|
|
6324
|
+
accessibilityActions: accessibilityActions
|
|
6325
|
+
};
|
|
6326
|
+
return spin ? /*#__PURE__*/React__default["default"].createElement(AnimatedIcon, _extends$1({
|
|
6265
6327
|
name: icon,
|
|
6266
6328
|
themeIntent: intent,
|
|
6267
6329
|
themeSize: size,
|
|
6268
6330
|
style: style,
|
|
6269
6331
|
testID: testID
|
|
6270
|
-
}) : /*#__PURE__*/React__default["default"].createElement(StyledHeroIcon, {
|
|
6332
|
+
}, accessibilityProps)) : /*#__PURE__*/React__default["default"].createElement(StyledHeroIcon, _extends$1({
|
|
6271
6333
|
name: icon,
|
|
6272
6334
|
themeIntent: intent,
|
|
6273
6335
|
themeSize: size,
|
|
6274
6336
|
style: style,
|
|
6275
6337
|
testID: testID
|
|
6276
|
-
});
|
|
6338
|
+
}, accessibilityProps));
|
|
6277
6339
|
};
|
|
6278
6340
|
Icon.List = IconList;
|
|
6279
6341
|
|
|
@@ -6305,7 +6367,7 @@ var AccordionItem = function AccordionItem(_ref) {
|
|
|
6305
6367
|
}, content));
|
|
6306
6368
|
};
|
|
6307
6369
|
|
|
6308
|
-
var _excluded$
|
|
6370
|
+
var _excluded$j = ["key"];
|
|
6309
6371
|
var Accordion = function Accordion(_ref) {
|
|
6310
6372
|
var items = _ref.items,
|
|
6311
6373
|
activeItemKey = _ref.activeItemKey,
|
|
@@ -6326,7 +6388,7 @@ var Accordion = function Accordion(_ref) {
|
|
|
6326
6388
|
testID: testID
|
|
6327
6389
|
}, items.map(function (_ref2, index) {
|
|
6328
6390
|
var key = _ref2.key,
|
|
6329
|
-
props = _objectWithoutProperties(_ref2, _excluded$
|
|
6391
|
+
props = _objectWithoutProperties(_ref2, _excluded$j);
|
|
6330
6392
|
var open = _activeItemKey === key;
|
|
6331
6393
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, {
|
|
6332
6394
|
key: key
|
|
@@ -6708,7 +6770,7 @@ var StyledStatus = index$a(reactNative.Animated.View)(function (_ref3) {
|
|
|
6708
6770
|
};
|
|
6709
6771
|
});
|
|
6710
6772
|
|
|
6711
|
-
var _excluded$
|
|
6773
|
+
var _excluded$i = ["children", "visible", "intent", "style", "testID"];
|
|
6712
6774
|
var Status = function Status(_ref) {
|
|
6713
6775
|
var children = _ref.children,
|
|
6714
6776
|
_ref$visible = _ref.visible,
|
|
@@ -6717,7 +6779,7 @@ var Status = function Status(_ref) {
|
|
|
6717
6779
|
intent = _ref$intent === void 0 ? 'danger' : _ref$intent,
|
|
6718
6780
|
style = _ref.style,
|
|
6719
6781
|
testID = _ref.testID,
|
|
6720
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
6782
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$i);
|
|
6721
6783
|
var _React$useRef = React__default["default"].useRef(new reactNative.Animated.Value(visible ? 1 : 0)),
|
|
6722
6784
|
opacity = _React$useRef.current;
|
|
6723
6785
|
var isFirstRendering = React__default["default"].useRef(true);
|
|
@@ -6750,7 +6812,7 @@ var Status = function Status(_ref) {
|
|
|
6750
6812
|
}));
|
|
6751
6813
|
};
|
|
6752
6814
|
|
|
6753
|
-
var _excluded$
|
|
6815
|
+
var _excluded$h = ["content", "visible", "max", "intent", "style", "testID"];
|
|
6754
6816
|
var DEFAULT_MAX_NUMBER = 99;
|
|
6755
6817
|
var getPaddingState = function getPaddingState(content) {
|
|
6756
6818
|
return content.length > 1 ? 'wideContent' : 'narrowContent';
|
|
@@ -6765,7 +6827,7 @@ var Badge = function Badge(_ref) {
|
|
|
6765
6827
|
intent = _ref$intent === void 0 ? 'danger' : _ref$intent,
|
|
6766
6828
|
style = _ref.style,
|
|
6767
6829
|
testID = _ref.testID,
|
|
6768
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
6830
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$h);
|
|
6769
6831
|
var _React$useRef = React__default["default"].useRef(new reactNative.Animated.Value(visible ? 1 : 0)),
|
|
6770
6832
|
opacity = _React$useRef.current;
|
|
6771
6833
|
var isFirstRendering = React__default["default"].useRef(true);
|
|
@@ -6854,22 +6916,22 @@ var StyledBottomBarText = index$a(Typography.Text)(function (_ref3) {
|
|
|
6854
6916
|
|
|
6855
6917
|
var isIOS = reactNative.Platform.OS === 'ios';
|
|
6856
6918
|
var isAndroid = reactNative.Platform.OS === 'android';
|
|
6857
|
-
|
|
6919
|
+
function pick(keys, obj) {
|
|
6858
6920
|
return keys.filter(function (key) {
|
|
6859
|
-
return key in
|
|
6921
|
+
return key in obj;
|
|
6860
6922
|
}).reduce(function (result, cur) {
|
|
6861
|
-
return _objectSpread2(_objectSpread2({}, result), {}, _defineProperty({}, cur,
|
|
6923
|
+
return _objectSpread2(_objectSpread2({}, result), {}, _defineProperty({}, cur, obj[cur]));
|
|
6862
6924
|
}, {});
|
|
6863
|
-
}
|
|
6864
|
-
|
|
6865
|
-
var result =
|
|
6925
|
+
}
|
|
6926
|
+
function omit(keys, obj) {
|
|
6927
|
+
var result = obj;
|
|
6866
6928
|
keys.forEach(function (key) {
|
|
6867
6929
|
delete result[key];
|
|
6868
6930
|
});
|
|
6869
6931
|
return result;
|
|
6870
|
-
}
|
|
6932
|
+
}
|
|
6871
6933
|
|
|
6872
|
-
var _excluded$
|
|
6934
|
+
var _excluded$g = ["onTabPress", "renderActiveTabOnly", "selectedTabKey", "tabs"];
|
|
6873
6935
|
var getInactiveIcon = function getInactiveIcon(icon) {
|
|
6874
6936
|
var inactiveIcon = "".concat(icon, "-outlined");
|
|
6875
6937
|
return isHeroIcon(inactiveIcon) ? inactiveIcon : icon;
|
|
@@ -6880,7 +6942,7 @@ var BottomNavigation = function BottomNavigation(_ref) {
|
|
|
6880
6942
|
renderActiveTabOnly = _ref$renderActiveTabO === void 0 ? false : _ref$renderActiveTabO,
|
|
6881
6943
|
selectedTabKey = _ref.selectedTabKey,
|
|
6882
6944
|
tabs = _ref.tabs,
|
|
6883
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
6945
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$g);
|
|
6884
6946
|
var insets = reactNativeSafeAreaContext.useSafeAreaInsets();
|
|
6885
6947
|
/**
|
|
6886
6948
|
* List of loaded tabs, tabs will be loaded when navigated to.
|
|
@@ -6967,13 +7029,13 @@ var StyledDivider = index$a(reactNative.View)(function (_ref) {
|
|
|
6967
7029
|
}, horizontalMargin), verticalMargin);
|
|
6968
7030
|
});
|
|
6969
7031
|
|
|
6970
|
-
var _excluded$
|
|
7032
|
+
var _excluded$f = ["marginHorizontal", "marginVertical", "style", "testID"];
|
|
6971
7033
|
var Divider = function Divider(_ref) {
|
|
6972
7034
|
var marginHorizontal = _ref.marginHorizontal,
|
|
6973
7035
|
marginVertical = _ref.marginVertical,
|
|
6974
7036
|
style = _ref.style,
|
|
6975
7037
|
testID = _ref.testID,
|
|
6976
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
7038
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$f);
|
|
6977
7039
|
return /*#__PURE__*/React__default["default"].createElement(StyledDivider, _extends$1({}, nativeProps, {
|
|
6978
7040
|
themeMarginHorizontal: marginHorizontal,
|
|
6979
7041
|
themeMarginVertical: marginVertical,
|
|
@@ -7103,7 +7165,7 @@ var StyledLoadingDot = index$a(reactNative.View)(function (_ref2) {
|
|
|
7103
7165
|
}, themeStyling());
|
|
7104
7166
|
});
|
|
7105
7167
|
|
|
7106
|
-
var _excluded$
|
|
7168
|
+
var _excluded$e = ["count", "size", "testID", "themeVariant"];
|
|
7107
7169
|
var AnimatedLoadingIndicatorWrapper = reactNative.Animated.createAnimatedComponent(StyledLoadingIndicatorWrapper);
|
|
7108
7170
|
var AnimatedLoadingDot = reactNative.Animated.createAnimatedComponent(StyledLoadingDot);
|
|
7109
7171
|
var renderDotComponent = function renderDotComponent(_ref) {
|
|
@@ -7135,7 +7197,7 @@ var LoadingIndicator = function LoadingIndicator(_ref2) {
|
|
|
7135
7197
|
size = _ref2$size === void 0 ? 12 : _ref2$size,
|
|
7136
7198
|
testID = _ref2.testID,
|
|
7137
7199
|
themeVariant = _ref2.themeVariant,
|
|
7138
|
-
nativeProps = _objectWithoutProperties(_ref2, _excluded$
|
|
7200
|
+
nativeProps = _objectWithoutProperties(_ref2, _excluded$e);
|
|
7139
7201
|
var progressAnimation = React.useRef(new reactNative.Animated.Value(0));
|
|
7140
7202
|
React.useEffect(function () {
|
|
7141
7203
|
var animation = reactNative.Animated.loop(reactNative.Animated.timing(progressAnimation.current, {
|
|
@@ -7531,11 +7593,11 @@ var Header = function Header(_ref) {
|
|
|
7531
7593
|
})) : null), showDivider ? /*#__PURE__*/React__default["default"].createElement(Divider, null) : null);
|
|
7532
7594
|
};
|
|
7533
7595
|
|
|
7534
|
-
var _excluded$
|
|
7596
|
+
var _excluded$d = ["scrollEventThrottle"];
|
|
7535
7597
|
var BottomSheetScrollView = function BottomSheetScrollView(_ref) {
|
|
7536
7598
|
var _ref$scrollEventThrot = _ref.scrollEventThrottle,
|
|
7537
7599
|
scrollEventThrottle = _ref$scrollEventThrot === void 0 ? 100 : _ref$scrollEventThrot,
|
|
7538
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
7600
|
+
props = _objectWithoutProperties(_ref, _excluded$d);
|
|
7539
7601
|
var _useContext = React.useContext(BottomSheetContext),
|
|
7540
7602
|
setInternalShowDivider = _useContext.setInternalShowDivider;
|
|
7541
7603
|
var onScrollBeginDrag = React.useCallback(function (e) {
|
|
@@ -7850,7 +7912,7 @@ var borderWidths = {
|
|
|
7850
7912
|
var config = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, colors), space), radii), borderWidths);
|
|
7851
7913
|
var flexPropsKey = ['alignContent', 'alignItems', 'alignSelf', 'display', 'flex', 'flexBasis', 'flexDirection', 'flexGrow', 'flexShrink', 'flexWrap', 'justifyContent'];
|
|
7852
7914
|
|
|
7853
|
-
var _excluded$
|
|
7915
|
+
var _excluded$c = ["theme"];
|
|
7854
7916
|
var getThemeValue = function getThemeValue(theme, key, props) {
|
|
7855
7917
|
var propConfig = config[key];
|
|
7856
7918
|
var propValue = props[key];
|
|
@@ -7877,18 +7939,18 @@ var mapStylePropToThemeValue = function mapStylePropToThemeValue(theme, props) {
|
|
|
7877
7939
|
var configKeys = Object.keys(config);
|
|
7878
7940
|
var StyledBox = index$a(reactNative.View)(function (_ref5) {
|
|
7879
7941
|
var theme = _ref5.theme,
|
|
7880
|
-
otherProps = _objectWithoutProperties(_ref5, _excluded$
|
|
7942
|
+
otherProps = _objectWithoutProperties(_ref5, _excluded$c);
|
|
7881
7943
|
var styleProps = pick(configKeys, otherProps);
|
|
7882
7944
|
var flexProps = pick(_toConsumableArray(flexPropsKey), otherProps);
|
|
7883
7945
|
return _objectSpread2(_objectSpread2({}, mapStylePropToThemeValue(theme, styleProps)), flexProps);
|
|
7884
7946
|
});
|
|
7885
7947
|
|
|
7886
|
-
var _excluded$
|
|
7948
|
+
var _excluded$b = ["children", "style", "testID"];
|
|
7887
7949
|
var Box = function Box(_ref) {
|
|
7888
7950
|
var children = _ref.children,
|
|
7889
7951
|
style = _ref.style,
|
|
7890
7952
|
testID = _ref.testID,
|
|
7891
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$
|
|
7953
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$b);
|
|
7892
7954
|
return /*#__PURE__*/React__default["default"].createElement(StyledBox, _extends$1({}, otherProps, {
|
|
7893
7955
|
style: style,
|
|
7894
7956
|
testID: testID
|
|
@@ -10453,6 +10515,251 @@ var Calendar = function Calendar(_ref) {
|
|
|
10453
10515
|
})));
|
|
10454
10516
|
};
|
|
10455
10517
|
|
|
10518
|
+
var StyledCarouselPaginator = index$a(reactNative.View)(function () {
|
|
10519
|
+
return {
|
|
10520
|
+
flexDirection: 'row',
|
|
10521
|
+
alignItems: 'center'
|
|
10522
|
+
};
|
|
10523
|
+
});
|
|
10524
|
+
var StyledCarouselPaginatorAnimatedView = index$a(reactNative.Animated.View)(function (_ref) {
|
|
10525
|
+
var theme = _ref.theme;
|
|
10526
|
+
return {
|
|
10527
|
+
height: theme.__hd__.carousel.sizes.paginatorHeight,
|
|
10528
|
+
width: theme.__hd__.carousel.sizes.paginatorWidth,
|
|
10529
|
+
borderRadius: theme.__hd__.carousel.radii.paginatorBorderRadius,
|
|
10530
|
+
backgroundColor: theme.__hd__.carousel.colors.paginatorBackgroundColor,
|
|
10531
|
+
marginHorizontal: theme.__hd__.carousel.space.paginatorMarginHorizontal
|
|
10532
|
+
};
|
|
10533
|
+
});
|
|
10534
|
+
|
|
10535
|
+
var CarouselPaginator = function CarouselPaginator(_ref) {
|
|
10536
|
+
var numberOfSlides = _ref.numberOfSlides,
|
|
10537
|
+
scrollX = _ref.scrollX;
|
|
10538
|
+
var _useWindowDimensions = reactNative.useWindowDimensions(),
|
|
10539
|
+
width = _useWindowDimensions.width;
|
|
10540
|
+
var theme = useTheme();
|
|
10541
|
+
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];
|
|
10543
|
+
var indicatorWidth = scrollX.interpolate({
|
|
10544
|
+
inputRange: inputRange,
|
|
10545
|
+
outputRange: [theme.space.small, theme.space.large, theme.space.small],
|
|
10546
|
+
extrapolate: 'clamp'
|
|
10547
|
+
});
|
|
10548
|
+
var opacity = scrollX.interpolate({
|
|
10549
|
+
inputRange: inputRange,
|
|
10550
|
+
outputRange: [0.5, 1, 0.5],
|
|
10551
|
+
extrapolate: 'clamp'
|
|
10552
|
+
});
|
|
10553
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledCarouselPaginatorAnimatedView, {
|
|
10554
|
+
indicatorWidth: indicatorWidth,
|
|
10555
|
+
style: [{
|
|
10556
|
+
width: indicatorWidth,
|
|
10557
|
+
opacity: opacity
|
|
10558
|
+
}],
|
|
10559
|
+
key: index.toString()
|
|
10560
|
+
});
|
|
10561
|
+
}));
|
|
10562
|
+
};
|
|
10563
|
+
|
|
10564
|
+
var _excluded$a = ["rounded", "size", "testID", "style"];
|
|
10565
|
+
var Image = function Image(_ref) {
|
|
10566
|
+
var _ref$rounded = _ref.rounded,
|
|
10567
|
+
rounded = _ref$rounded === void 0 ? false : _ref$rounded,
|
|
10568
|
+
_ref$size = _ref.size,
|
|
10569
|
+
size = _ref$size === void 0 ? '6xlarge' : _ref$size,
|
|
10570
|
+
testID = _ref.testID,
|
|
10571
|
+
style = _ref.style,
|
|
10572
|
+
imageNativeProps = _objectWithoutProperties(_ref, _excluded$a);
|
|
10573
|
+
var theme = useTheme();
|
|
10574
|
+
var imageSize = theme.__hd__.image.sizes[size];
|
|
10575
|
+
return /*#__PURE__*/React__default["default"].createElement(reactNative.Image, _extends$1({
|
|
10576
|
+
testID: testID,
|
|
10577
|
+
style: [{
|
|
10578
|
+
width: imageSize,
|
|
10579
|
+
height: imageSize,
|
|
10580
|
+
borderRadius: rounded ? imageSize / 2 : 0
|
|
10581
|
+
}, style]
|
|
10582
|
+
}, imageNativeProps));
|
|
10583
|
+
};
|
|
10584
|
+
|
|
10585
|
+
var StyledCarousel = index$a(reactNative.View)(function (_ref) {
|
|
10586
|
+
var themeSlideBackground = _ref.themeSlideBackground;
|
|
10587
|
+
return {
|
|
10588
|
+
zIndex: 99999,
|
|
10589
|
+
position: 'absolute',
|
|
10590
|
+
backgroundColor: themeSlideBackground,
|
|
10591
|
+
top: 0,
|
|
10592
|
+
bottom: 0,
|
|
10593
|
+
right: 0,
|
|
10594
|
+
left: 0
|
|
10595
|
+
};
|
|
10596
|
+
});
|
|
10597
|
+
var StyledCarouselView = index$a(reactNative.View)(function () {
|
|
10598
|
+
return {
|
|
10599
|
+
justifyContent: 'space-between',
|
|
10600
|
+
height: '100%'
|
|
10601
|
+
};
|
|
10602
|
+
});
|
|
10603
|
+
var StyledCarouselHeading = index$a(Typography.Text)(function (_ref2) {
|
|
10604
|
+
var theme = _ref2.theme;
|
|
10605
|
+
return {
|
|
10606
|
+
marginTop: theme.__hd__.carousel.space.headingMarginTop,
|
|
10607
|
+
marginBottom: theme.__hd__.carousel.space.headingMarginBottom,
|
|
10608
|
+
fontFamily: theme.__hd__.carousel.fonts.heading,
|
|
10609
|
+
fontSize: theme.__hd__.carousel.fontSizes.heading,
|
|
10610
|
+
lineHeight: theme.__hd__.carousel.lineHeights.heading
|
|
10611
|
+
};
|
|
10612
|
+
});
|
|
10613
|
+
var StyledCarouselImage = index$a(Image)(function () {
|
|
10614
|
+
return {
|
|
10615
|
+
flex: 1,
|
|
10616
|
+
width: '100%',
|
|
10617
|
+
resizeMode: 'contain'
|
|
10618
|
+
};
|
|
10619
|
+
});
|
|
10620
|
+
var StyledCarouselContentWrapper = index$a(Box)(function (_ref3) {
|
|
10621
|
+
var width = _ref3.width;
|
|
10622
|
+
return {
|
|
10623
|
+
width: width
|
|
10624
|
+
};
|
|
10625
|
+
});
|
|
10626
|
+
var StyledCarouselFooterWrapper = index$a(Box)(function () {
|
|
10627
|
+
return {
|
|
10628
|
+
width: '100%'
|
|
10629
|
+
};
|
|
10630
|
+
});
|
|
10631
|
+
|
|
10632
|
+
var CarouselItem = function CarouselItem(_ref) {
|
|
10633
|
+
var width = _ref.width,
|
|
10634
|
+
image = _ref.image,
|
|
10635
|
+
content = _ref.content,
|
|
10636
|
+
heading = _ref.heading,
|
|
10637
|
+
body = _ref.body,
|
|
10638
|
+
minHeight = _ref.minHeight;
|
|
10639
|
+
return /*#__PURE__*/React__default["default"].createElement(Box, {
|
|
10640
|
+
style: {
|
|
10641
|
+
width: width
|
|
10642
|
+
}
|
|
10643
|
+
}, image && /*#__PURE__*/React__default["default"].createElement(StyledCarouselImage, {
|
|
10644
|
+
source: typeof image === 'string' ? {
|
|
10645
|
+
uri: image
|
|
10646
|
+
} : image
|
|
10647
|
+
}), /*#__PURE__*/React__default["default"].createElement(StyledCarouselContentWrapper, {
|
|
10648
|
+
paddingHorizontal: "large",
|
|
10649
|
+
marginTop: "large",
|
|
10650
|
+
width: width,
|
|
10651
|
+
style: {
|
|
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));
|
|
10657
|
+
};
|
|
10658
|
+
|
|
10659
|
+
var _excluded$9 = ["items", "onFinishPress", "onSkipPress", "onSlideChange", "finishButtonLabel", "skipButtonLabel", "footerHeight", "minContentHeight"];
|
|
10660
|
+
var Carousel = function Carousel(_ref) {
|
|
10661
|
+
var items = _ref.items,
|
|
10662
|
+
onFinishPress = _ref.onFinishPress,
|
|
10663
|
+
onSkipPress = _ref.onSkipPress,
|
|
10664
|
+
onSlideChange = _ref.onSlideChange,
|
|
10665
|
+
_ref$finishButtonLabe = _ref.finishButtonLabel,
|
|
10666
|
+
finishButtonLabel = _ref$finishButtonLabe === void 0 ? "Let's go!" : _ref$finishButtonLabe,
|
|
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,
|
|
10673
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$9);
|
|
10674
|
+
var carouselRef = React.useRef(null);
|
|
10675
|
+
var _useState = React.useState(0),
|
|
10676
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
10677
|
+
currentSlideIndex = _useState2[0],
|
|
10678
|
+
setCurrentSlideIndex = _useState2[1];
|
|
10679
|
+
var _useWindowDimensions = reactNative.useWindowDimensions(),
|
|
10680
|
+
width = _useWindowDimensions.width;
|
|
10681
|
+
var scrollX = React.useRef(new reactNative.Animated.Value(0)).current;
|
|
10682
|
+
var visibleSlideChanged = React.useCallback(function (_ref2) {
|
|
10683
|
+
var viewableItems = _ref2.viewableItems;
|
|
10684
|
+
if (!viewableItems || viewableItems && !viewableItems.length) return;
|
|
10685
|
+
var currentIndex = viewableItems[0].index;
|
|
10686
|
+
setCurrentSlideIndex(viewableItems[0].index);
|
|
10687
|
+
var currentSlide = items[currentIndex];
|
|
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]);
|
|
10704
|
+
var viewConfig = React.useRef({
|
|
10705
|
+
viewAreaCoveragePercentThreshold: 50
|
|
10706
|
+
}).current;
|
|
10707
|
+
var isLastSlide = currentSlideIndex === items.length - 1;
|
|
10708
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledCarousel, _extends$1({
|
|
10709
|
+
themeSlideBackground: items[currentSlideIndex].background
|
|
10710
|
+
}, nativeProps), /*#__PURE__*/React__default["default"].createElement(StyledCarouselView, null, /*#__PURE__*/React__default["default"].createElement(reactNative.FlatList, {
|
|
10711
|
+
horizontal: true,
|
|
10712
|
+
showsHorizontalScrollIndicator: false,
|
|
10713
|
+
pagingEnabled: true,
|
|
10714
|
+
bounces: false,
|
|
10715
|
+
data: items,
|
|
10716
|
+
onViewableItemsChanged: visibleSlideChanged,
|
|
10717
|
+
viewabilityConfig: viewConfig,
|
|
10718
|
+
scrollEventThrottle: 32,
|
|
10719
|
+
ref: carouselRef,
|
|
10720
|
+
onScroll: reactNative.Animated.event([{
|
|
10721
|
+
nativeEvent: {
|
|
10722
|
+
contentOffset: {
|
|
10723
|
+
x: scrollX
|
|
10724
|
+
}
|
|
10725
|
+
}
|
|
10726
|
+
}], {
|
|
10727
|
+
useNativeDriver: false
|
|
10728
|
+
}),
|
|
10729
|
+
renderItem: function renderItem(_ref3) {
|
|
10730
|
+
var item = _ref3.item;
|
|
10731
|
+
if (!item) return null;
|
|
10732
|
+
var image = item.image,
|
|
10733
|
+
heading = item.heading,
|
|
10734
|
+
body = item.body,
|
|
10735
|
+
content = item.content;
|
|
10736
|
+
return /*#__PURE__*/React__default["default"].createElement(CarouselItem, {
|
|
10737
|
+
image: image,
|
|
10738
|
+
heading: heading,
|
|
10739
|
+
body: body,
|
|
10740
|
+
content: content,
|
|
10741
|
+
minHeight: minContentHeight,
|
|
10742
|
+
width: width
|
|
10743
|
+
});
|
|
10744
|
+
}
|
|
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
|
+
numberOfSlides: items.length,
|
|
10759
|
+
scrollX: scrollX
|
|
10760
|
+
}))));
|
|
10761
|
+
};
|
|
10762
|
+
|
|
10456
10763
|
var StyledDataCard = index$a(reactNative.View)(function (_ref) {
|
|
10457
10764
|
var theme = _ref.theme;
|
|
10458
10765
|
return {
|
|
@@ -10471,12 +10778,12 @@ var Indicator = index$a(reactNative.View)(function (_ref2) {
|
|
|
10471
10778
|
};
|
|
10472
10779
|
});
|
|
10473
10780
|
|
|
10474
|
-
var _excluded$
|
|
10781
|
+
var _excluded$8 = ["intent", "children"];
|
|
10475
10782
|
var DataCard = function DataCard(_ref) {
|
|
10476
10783
|
var _ref$intent = _ref.intent,
|
|
10477
10784
|
intent = _ref$intent === void 0 ? 'info' : _ref$intent,
|
|
10478
10785
|
children = _ref.children,
|
|
10479
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
10786
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$8);
|
|
10480
10787
|
return /*#__PURE__*/React__default["default"].createElement(StyledDataCard, nativeProps, /*#__PURE__*/React__default["default"].createElement(Indicator, {
|
|
10481
10788
|
themeIntent: intent,
|
|
10482
10789
|
testID: "data-card-indicator"
|
|
@@ -10494,11 +10801,11 @@ var StyledCard = index$a(reactNative.View)(function (_ref) {
|
|
|
10494
10801
|
});
|
|
10495
10802
|
});
|
|
10496
10803
|
|
|
10497
|
-
var _excluded$
|
|
10804
|
+
var _excluded$7 = ["intent", "children"];
|
|
10498
10805
|
var Card = function Card(_ref) {
|
|
10499
10806
|
var intent = _ref.intent,
|
|
10500
10807
|
children = _ref.children,
|
|
10501
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
10808
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$7);
|
|
10502
10809
|
return /*#__PURE__*/React__default["default"].createElement(StyledCard, _extends$1({}, nativeProps, {
|
|
10503
10810
|
themeIntent: intent
|
|
10504
10811
|
}), children);
|
|
@@ -10732,7 +11039,7 @@ var StyledErrorAndMaxLengthContainer = index$a(reactNative.View)(function () {
|
|
|
10732
11039
|
};
|
|
10733
11040
|
});
|
|
10734
11041
|
|
|
10735
|
-
var _excluded$
|
|
11042
|
+
var _excluded$6 = ["label", "prefix", "suffix", "style", "textStyle", "testID", "accessibilityLabelledBy", "error", "required", "editable", "disabled", "loading", "maxLength", "helpText", "value", "defaultValue", "renderInputValue"];
|
|
10736
11043
|
var getVariant$1 = function getVariant(_ref) {
|
|
10737
11044
|
var disabled = _ref.disabled,
|
|
10738
11045
|
error = _ref.error,
|
|
@@ -10756,7 +11063,7 @@ var getVariant$1 = function getVariant(_ref) {
|
|
|
10756
11063
|
// Fix issue: Placeholder is not shown on iOS when multiline is true
|
|
10757
11064
|
// https://github.com/callstack/react-native-paper/pull/3331
|
|
10758
11065
|
var EMPTY_PLACEHOLDER_VALUE = ' ';
|
|
10759
|
-
var TextInput = function TextInput(_ref2) {
|
|
11066
|
+
var TextInput = function TextInput(_ref2, ref) {
|
|
10760
11067
|
var _ref3;
|
|
10761
11068
|
var label = _ref2.label,
|
|
10762
11069
|
prefix = _ref2.prefix,
|
|
@@ -10778,7 +11085,7 @@ var TextInput = function TextInput(_ref2) {
|
|
|
10778
11085
|
value = _ref2.value,
|
|
10779
11086
|
defaultValue = _ref2.defaultValue,
|
|
10780
11087
|
renderInputValue = _ref2.renderInputValue,
|
|
10781
|
-
nativeProps = _objectWithoutProperties(_ref2, _excluded$
|
|
11088
|
+
nativeProps = _objectWithoutProperties(_ref2, _excluded$6);
|
|
10782
11089
|
var displayText = (_ref3 = value !== undefined ? value : defaultValue) !== null && _ref3 !== void 0 ? _ref3 : '';
|
|
10783
11090
|
var isEmptyValue = displayText.length === 0;
|
|
10784
11091
|
var actualSuffix = loading ? 'loading' : suffix;
|
|
@@ -10796,6 +11103,35 @@ var TextInput = function TextInput(_ref2) {
|
|
|
10796
11103
|
});
|
|
10797
11104
|
var shouldShowMaxLength = maxLength !== undefined;
|
|
10798
11105
|
var theme = useTheme();
|
|
11106
|
+
var innerTextInput = React__default["default"].useRef();
|
|
11107
|
+
React__default["default"].useImperativeHandle(ref, function () {
|
|
11108
|
+
return {
|
|
11109
|
+
// we don't expose this method, it's for testing https://medium.com/developer-rants/how-to-test-useref-without-mocking-useref-699165f4994e
|
|
11110
|
+
getNativeTextInputRef: function getNativeTextInputRef() {
|
|
11111
|
+
return innerTextInput.current;
|
|
11112
|
+
},
|
|
11113
|
+
focus: function focus() {
|
|
11114
|
+
var _innerTextInput$curre;
|
|
11115
|
+
(_innerTextInput$curre = innerTextInput.current) === null || _innerTextInput$curre === void 0 ? void 0 : _innerTextInput$curre.focus();
|
|
11116
|
+
},
|
|
11117
|
+
clear: function clear() {
|
|
11118
|
+
var _innerTextInput$curre2;
|
|
11119
|
+
return (_innerTextInput$curre2 = innerTextInput.current) === null || _innerTextInput$curre2 === void 0 ? void 0 : _innerTextInput$curre2.clear();
|
|
11120
|
+
},
|
|
11121
|
+
setNativeProps: function setNativeProps(args) {
|
|
11122
|
+
var _innerTextInput$curre3;
|
|
11123
|
+
return (_innerTextInput$curre3 = innerTextInput.current) === null || _innerTextInput$curre3 === void 0 ? void 0 : _innerTextInput$curre3.setNativeProps(args);
|
|
11124
|
+
},
|
|
11125
|
+
isFocused: function isFocused() {
|
|
11126
|
+
var _innerTextInput$curre4;
|
|
11127
|
+
return ((_innerTextInput$curre4 = innerTextInput.current) === null || _innerTextInput$curre4 === void 0 ? void 0 : _innerTextInput$curre4.isFocused()) || false;
|
|
11128
|
+
},
|
|
11129
|
+
blur: function blur() {
|
|
11130
|
+
var _innerTextInput$curre5;
|
|
11131
|
+
return (_innerTextInput$curre5 = innerTextInput.current) === null || _innerTextInput$curre5 === void 0 ? void 0 : _innerTextInput$curre5.blur();
|
|
11132
|
+
}
|
|
11133
|
+
};
|
|
11134
|
+
}, [innerTextInput]);
|
|
10799
11135
|
var _useMemo = React.useMemo(function () {
|
|
10800
11136
|
if (!textStyle) {
|
|
10801
11137
|
return {};
|
|
@@ -10875,7 +11211,11 @@ var TextInput = function TextInput(_ref2) {
|
|
|
10875
11211
|
testID: "input-label",
|
|
10876
11212
|
fontSize: "medium",
|
|
10877
11213
|
themeVariant: variant
|
|
10878
|
-
}, label)), renderInputValue ? renderInputValue(nativeInputProps) : /*#__PURE__*/React__default["default"].createElement(StyledTextInput,
|
|
11214
|
+
}, label)), renderInputValue ? renderInputValue(nativeInputProps) : /*#__PURE__*/React__default["default"].createElement(StyledTextInput, _extends$1({}, nativeInputProps, {
|
|
11215
|
+
ref: function ref(reference) {
|
|
11216
|
+
innerTextInput.current = reference;
|
|
11217
|
+
}
|
|
11218
|
+
}))), typeof actualSuffix === 'string' ? /*#__PURE__*/React__default["default"].createElement(Icon, {
|
|
10879
11219
|
intent: variant === 'disabled' ? 'disabled-text' : 'text',
|
|
10880
11220
|
testID: "input-suffix",
|
|
10881
11221
|
icon: actualSuffix,
|
|
@@ -10893,6 +11233,7 @@ var TextInput = function TextInput(_ref2) {
|
|
|
10893
11233
|
fontSize: "small"
|
|
10894
11234
|
}, displayText.length, "/", maxLength)), !!helpText && /*#__PURE__*/React__default["default"].createElement(StyledHelperText, null, helpText)));
|
|
10895
11235
|
};
|
|
11236
|
+
var TextInput$1 = /*#__PURE__*/React__default["default"].forwardRef(TextInput);
|
|
10896
11237
|
|
|
10897
11238
|
var DatePickerAndroid = function DatePickerAndroid(_ref) {
|
|
10898
11239
|
var value = _ref.value,
|
|
@@ -10924,7 +11265,7 @@ var DatePickerAndroid = function DatePickerAndroid(_ref) {
|
|
|
10924
11265
|
}, /*#__PURE__*/React__default["default"].createElement(reactNative.View, {
|
|
10925
11266
|
pointerEvents: "none",
|
|
10926
11267
|
testID: "datePickerInputAndroid"
|
|
10927
|
-
}, /*#__PURE__*/React__default["default"].createElement(TextInput, {
|
|
11268
|
+
}, /*#__PURE__*/React__default["default"].createElement(TextInput$1, {
|
|
10928
11269
|
label: label,
|
|
10929
11270
|
value: displayValue,
|
|
10930
11271
|
suffix: "calendar-dates-outlined",
|
|
@@ -10992,7 +11333,7 @@ var DatePickerIOS = function DatePickerIOS(_ref) {
|
|
|
10992
11333
|
}, /*#__PURE__*/React__default["default"].createElement(reactNative.View, {
|
|
10993
11334
|
pointerEvents: "none",
|
|
10994
11335
|
testID: "datePickerInputIOS"
|
|
10995
|
-
}, /*#__PURE__*/React__default["default"].createElement(TextInput, {
|
|
11336
|
+
}, /*#__PURE__*/React__default["default"].createElement(TextInput$1, {
|
|
10996
11337
|
label: label,
|
|
10997
11338
|
value: displayValue,
|
|
10998
11339
|
suffix: "calendar-dates-outlined",
|
|
@@ -11423,11 +11764,11 @@ var StyledFABText = index$a(reactNative.Text)(function (_ref3) {
|
|
|
11423
11764
|
};
|
|
11424
11765
|
});
|
|
11425
11766
|
|
|
11426
|
-
var _excluded$
|
|
11767
|
+
var _excluded$5 = ["active"];
|
|
11427
11768
|
var AnimatedIcons = reactNative.Animated.createAnimatedComponent(StyledFABIcon);
|
|
11428
11769
|
var AnimatedFABIcon = function AnimatedFABIcon(_ref) {
|
|
11429
11770
|
var active = _ref.active,
|
|
11430
|
-
iconProps = _objectWithoutProperties(_ref, _excluded$
|
|
11771
|
+
iconProps = _objectWithoutProperties(_ref, _excluded$5);
|
|
11431
11772
|
var rotateAnimation = React.useRef(new reactNative.Animated.Value(active ? 1 : 0));
|
|
11432
11773
|
React.useEffect(function () {
|
|
11433
11774
|
var animation = reactNative.Animated.timing(rotateAnimation.current, {
|
|
@@ -11674,27 +12015,6 @@ var index$6 = Object.assign(FAB, {
|
|
|
11674
12015
|
ActionGroup: ActionGroup
|
|
11675
12016
|
});
|
|
11676
12017
|
|
|
11677
|
-
var _excluded$5 = ["rounded", "size", "testID", "style"];
|
|
11678
|
-
var Image = function Image(_ref) {
|
|
11679
|
-
var _ref$rounded = _ref.rounded,
|
|
11680
|
-
rounded = _ref$rounded === void 0 ? false : _ref$rounded,
|
|
11681
|
-
_ref$size = _ref.size,
|
|
11682
|
-
size = _ref$size === void 0 ? '6xlarge' : _ref$size,
|
|
11683
|
-
testID = _ref.testID,
|
|
11684
|
-
style = _ref.style,
|
|
11685
|
-
imageNativeProps = _objectWithoutProperties(_ref, _excluded$5);
|
|
11686
|
-
var theme = useTheme();
|
|
11687
|
-
var imageSize = theme.__hd__.image.sizes[size];
|
|
11688
|
-
return /*#__PURE__*/React__default["default"].createElement(reactNative.Image, _extends$1({
|
|
11689
|
-
testID: testID,
|
|
11690
|
-
style: [{
|
|
11691
|
-
width: imageSize,
|
|
11692
|
-
height: imageSize,
|
|
11693
|
-
borderRadius: rounded ? imageSize / 2 : 0
|
|
11694
|
-
}, style]
|
|
11695
|
-
}, imageNativeProps));
|
|
11696
|
-
};
|
|
11697
|
-
|
|
11698
12018
|
var StyledListItemContainer$1 = index$a(reactNative.TouchableOpacity)(function (_ref) {
|
|
11699
12019
|
var theme = _ref.theme,
|
|
11700
12020
|
_ref$themeSelected = _ref.themeSelected,
|
|
@@ -13058,7 +13378,7 @@ function MultiSelect(_ref) {
|
|
|
13058
13378
|
}
|
|
13059
13379
|
}, /*#__PURE__*/React__default["default"].createElement(reactNative.View, {
|
|
13060
13380
|
pointerEvents: "none"
|
|
13061
|
-
}, /*#__PURE__*/React__default["default"].createElement(TextInput, _extends$1({}, inputProps, {
|
|
13381
|
+
}, /*#__PURE__*/React__default["default"].createElement(TextInput$1, _extends$1({}, inputProps, {
|
|
13062
13382
|
label: label,
|
|
13063
13383
|
value: displayedValue,
|
|
13064
13384
|
suffix: "arrow-down",
|
|
@@ -13106,7 +13426,7 @@ function MultiSelect(_ref) {
|
|
|
13106
13426
|
(_sectionListRef$curre = sectionListRef.current) === null || _sectionListRef$curre === void 0 ? void 0 : _sectionListRef$curre.scrollToLocation(scrollParams);
|
|
13107
13427
|
}
|
|
13108
13428
|
}
|
|
13109
|
-
}, 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$1, {
|
|
13110
13430
|
editable: true,
|
|
13111
13431
|
placeholder: "Search",
|
|
13112
13432
|
suffix: "search-outlined",
|
|
@@ -13234,7 +13554,7 @@ var SingleSelect = function SingleSelect(_ref) {
|
|
|
13234
13554
|
}
|
|
13235
13555
|
}, /*#__PURE__*/React__default["default"].createElement(reactNative.View, {
|
|
13236
13556
|
pointerEvents: "none"
|
|
13237
|
-
}, /*#__PURE__*/React__default["default"].createElement(TextInput, _extends$1({}, inputProps, {
|
|
13557
|
+
}, /*#__PURE__*/React__default["default"].createElement(TextInput$1, _extends$1({}, inputProps, {
|
|
13238
13558
|
label: label,
|
|
13239
13559
|
value: displayedValue,
|
|
13240
13560
|
suffix: "arrow-down",
|
|
@@ -13266,7 +13586,7 @@ var SingleSelect = function SingleSelect(_ref) {
|
|
|
13266
13586
|
(_sectionListRef$curre = sectionListRef.current) === null || _sectionListRef$curre === void 0 ? void 0 : _sectionListRef$curre.scrollToLocation(scrollParams);
|
|
13267
13587
|
}
|
|
13268
13588
|
}
|
|
13269
|
-
}, 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$1, {
|
|
13270
13590
|
editable: true,
|
|
13271
13591
|
placeholder: "Search",
|
|
13272
13592
|
suffix: "search-outlined",
|
|
@@ -14007,7 +14327,7 @@ var TimePickerAndroid = function TimePickerAndroid(_ref) {
|
|
|
14007
14327
|
}, /*#__PURE__*/React__default["default"].createElement(reactNative.View, {
|
|
14008
14328
|
pointerEvents: "none",
|
|
14009
14329
|
testID: "timePickerInputAndroid"
|
|
14010
|
-
}, /*#__PURE__*/React__default["default"].createElement(TextInput, {
|
|
14330
|
+
}, /*#__PURE__*/React__default["default"].createElement(TextInput$1, {
|
|
14011
14331
|
label: label,
|
|
14012
14332
|
value: displayValue,
|
|
14013
14333
|
suffix: showSuffix ? 'clock-3' : undefined,
|
|
@@ -14075,7 +14395,7 @@ var TimePickerIOS = function TimePickerIOS(_ref) {
|
|
|
14075
14395
|
}, /*#__PURE__*/React__default["default"].createElement(reactNative.View, {
|
|
14076
14396
|
pointerEvents: "none",
|
|
14077
14397
|
testID: "timePickerInputIOS"
|
|
14078
|
-
}, /*#__PURE__*/React__default["default"].createElement(TextInput, {
|
|
14398
|
+
}, /*#__PURE__*/React__default["default"].createElement(TextInput$1, {
|
|
14079
14399
|
label: label,
|
|
14080
14400
|
value: displayValue,
|
|
14081
14401
|
suffix: showSuffix ? 'clock-3' : undefined,
|
|
@@ -14475,10 +14795,12 @@ var ToolbarItem = function ToolbarItem(_ref) {
|
|
|
14475
14795
|
_ref$intent = _ref.intent,
|
|
14476
14796
|
intent = _ref$intent === void 0 ? 'primary' : _ref$intent,
|
|
14477
14797
|
_ref$disabled = _ref.disabled,
|
|
14478
|
-
disabled = _ref$disabled === void 0 ? false : _ref$disabled
|
|
14798
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
14799
|
+
style = _ref.style;
|
|
14479
14800
|
return /*#__PURE__*/React__default["default"].createElement(ToolbarItemWrapper, {
|
|
14480
14801
|
onPress: onPress,
|
|
14481
|
-
disabled: disabled
|
|
14802
|
+
disabled: disabled,
|
|
14803
|
+
style: style
|
|
14482
14804
|
}, icon ? /*#__PURE__*/React__default["default"].createElement(Icon, {
|
|
14483
14805
|
icon: icon,
|
|
14484
14806
|
size: label ? 'medium' : 'large',
|
|
@@ -14487,7 +14809,8 @@ var ToolbarItem = function ToolbarItem(_ref) {
|
|
|
14487
14809
|
}) : null, label ? /*#__PURE__*/React__default["default"].createElement(Typography.Text, {
|
|
14488
14810
|
fontSize: icon ? 'small' : 'large',
|
|
14489
14811
|
fontWeight: "semi-bold",
|
|
14490
|
-
intent: disabled ? 'subdued' : intent
|
|
14812
|
+
intent: disabled ? 'subdued' : intent,
|
|
14813
|
+
maxFontSizeMultiplier: 2
|
|
14491
14814
|
}, label) : null);
|
|
14492
14815
|
};
|
|
14493
14816
|
|
|
@@ -14496,6 +14819,9 @@ var ToolbarGroup = function ToolbarGroup(_ref) {
|
|
|
14496
14819
|
align = _ref$align === void 0 ? 'right' : _ref$align,
|
|
14497
14820
|
_ref$items = _ref.items,
|
|
14498
14821
|
items = _ref$items === void 0 ? [] : _ref$items;
|
|
14822
|
+
// set maxWidth prevents overflow of items
|
|
14823
|
+
// issue: https://github.com/Thinkei/hero-design/issues/1619
|
|
14824
|
+
var maxWidth = items.length > 0 ? "".concat(100 / items.length, "%") : undefined;
|
|
14499
14825
|
return /*#__PURE__*/React__default["default"].createElement(ToolbarGroupWrapper, {
|
|
14500
14826
|
align: align
|
|
14501
14827
|
}, items.map(function (_ref2) {
|
|
@@ -14510,7 +14836,10 @@ var ToolbarGroup = function ToolbarGroup(_ref) {
|
|
|
14510
14836
|
icon: icon,
|
|
14511
14837
|
intent: intent,
|
|
14512
14838
|
onPress: onPress,
|
|
14513
|
-
disabled: disabled
|
|
14839
|
+
disabled: disabled,
|
|
14840
|
+
style: {
|
|
14841
|
+
maxWidth: maxWidth
|
|
14842
|
+
}
|
|
14514
14843
|
});
|
|
14515
14844
|
}));
|
|
14516
14845
|
};
|
|
@@ -30920,6 +31249,7 @@ exports.Box = Box;
|
|
|
30920
31249
|
exports.Button = CompoundButton;
|
|
30921
31250
|
exports.Calendar = Calendar;
|
|
30922
31251
|
exports.Card = index$8;
|
|
31252
|
+
exports.Carousel = Carousel;
|
|
30923
31253
|
exports.Checkbox = Checkbox;
|
|
30924
31254
|
exports.Collapse = Collapse;
|
|
30925
31255
|
exports.ContentNavigator = ContentNavigator;
|
|
@@ -30944,7 +31274,7 @@ exports.Swipeable = index$5;
|
|
|
30944
31274
|
exports.Switch = index$3;
|
|
30945
31275
|
exports.Tabs = index$2;
|
|
30946
31276
|
exports.Tag = Tag;
|
|
30947
|
-
exports.TextInput = TextInput;
|
|
31277
|
+
exports.TextInput = TextInput$1;
|
|
30948
31278
|
exports.ThemeProvider = ThemeProvider;
|
|
30949
31279
|
exports.ThemeSwitcher = ThemeSwitcher;
|
|
30950
31280
|
exports.TimePicker = TimePicker;
|