@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/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
|
+
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';
|
|
@@ -1797,6 +1797,43 @@ var getCardTheme = function getCardTheme(theme) {
|
|
|
1797
1797
|
};
|
|
1798
1798
|
};
|
|
1799
1799
|
|
|
1800
|
+
var getCarouselTheme = function getCarouselTheme(theme) {
|
|
1801
|
+
var colors = {
|
|
1802
|
+
paginatorBackgroundColor: theme.colors.primary
|
|
1803
|
+
};
|
|
1804
|
+
var space = {
|
|
1805
|
+
headingMarginTop: theme.space.small,
|
|
1806
|
+
headingMarginBottom: theme.space.medium,
|
|
1807
|
+
paginatorMarginHorizontal: theme.space.small
|
|
1808
|
+
};
|
|
1809
|
+
var sizes = {
|
|
1810
|
+
indicatorWidth: theme.sizes.medium,
|
|
1811
|
+
paginatorHeight: theme.sizes.small,
|
|
1812
|
+
paginatorWidth: theme.sizes.small
|
|
1813
|
+
};
|
|
1814
|
+
var radii = {
|
|
1815
|
+
paginatorBorderRadius: theme.radii.rounded
|
|
1816
|
+
};
|
|
1817
|
+
var fontSizes = {
|
|
1818
|
+
heading: theme.fontSizes.xxxxxlarge
|
|
1819
|
+
};
|
|
1820
|
+
var fonts = {
|
|
1821
|
+
heading: theme.fonts.playful.semiBold
|
|
1822
|
+
};
|
|
1823
|
+
var lineHeights = {
|
|
1824
|
+
heading: theme.lineHeights.xxxlarge
|
|
1825
|
+
};
|
|
1826
|
+
return {
|
|
1827
|
+
colors: colors,
|
|
1828
|
+
sizes: sizes,
|
|
1829
|
+
radii: radii,
|
|
1830
|
+
space: space,
|
|
1831
|
+
fonts: fonts,
|
|
1832
|
+
fontSizes: fontSizes,
|
|
1833
|
+
lineHeights: lineHeights
|
|
1834
|
+
};
|
|
1835
|
+
};
|
|
1836
|
+
|
|
1800
1837
|
var getCheckboxTheme = function getCheckboxTheme(theme) {
|
|
1801
1838
|
var colors = {
|
|
1802
1839
|
"default": theme.colors.primaryOutline,
|
|
@@ -2667,6 +2704,7 @@ var getTheme$1 = function getTheme() {
|
|
|
2667
2704
|
button: getButtonTheme(globalTheme),
|
|
2668
2705
|
calendar: getCalendarTheme(globalTheme),
|
|
2669
2706
|
card: getCardTheme(globalTheme),
|
|
2707
|
+
carousel: getCarouselTheme(globalTheme),
|
|
2670
2708
|
checkbox: getCheckboxTheme(globalTheme),
|
|
2671
2709
|
contentNavigator: getContentNavigatorTheme(globalTheme),
|
|
2672
2710
|
datePicker: getDatePickerTheme(globalTheme),
|
|
@@ -5701,7 +5739,7 @@ var StyledText$3 = index$a(Text$1)(function (_ref) {
|
|
|
5701
5739
|
});
|
|
5702
5740
|
});
|
|
5703
5741
|
|
|
5704
|
-
var _excluded$
|
|
5742
|
+
var _excluded$l = ["children", "fontSize", "fontWeight", "intent", "typeface"];
|
|
5705
5743
|
var Text = function Text(_ref) {
|
|
5706
5744
|
var children = _ref.children,
|
|
5707
5745
|
_ref$fontSize = _ref.fontSize,
|
|
@@ -5712,7 +5750,7 @@ var Text = function Text(_ref) {
|
|
|
5712
5750
|
intent = _ref$intent === void 0 ? 'body' : _ref$intent,
|
|
5713
5751
|
_ref$typeface = _ref.typeface,
|
|
5714
5752
|
typeface = _ref$typeface === void 0 ? 'neutral' : _ref$typeface,
|
|
5715
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
5753
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$l);
|
|
5716
5754
|
return /*#__PURE__*/React.createElement(StyledText$3, _extends$1({}, nativeProps, {
|
|
5717
5755
|
themeFontSize: fontSize,
|
|
5718
5756
|
themeFontWeight: fontWeight,
|
|
@@ -6191,10 +6229,10 @@ var StyledHeroIcon = index$a(HeroIcon)(function (_ref) {
|
|
|
6191
6229
|
};
|
|
6192
6230
|
});
|
|
6193
6231
|
|
|
6194
|
-
var _excluded$
|
|
6232
|
+
var _excluded$k = ["style"];
|
|
6195
6233
|
var AnimatedIcon = function AnimatedIcon(_ref) {
|
|
6196
6234
|
var style = _ref.style,
|
|
6197
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$
|
|
6235
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$k);
|
|
6198
6236
|
var rotateAnimation = useRef(new Animated.Value(0));
|
|
6199
6237
|
useEffect(function () {
|
|
6200
6238
|
var animation = Animated.loop(Animated.timing(rotateAnimation.current, {
|
|
@@ -6230,21 +6268,45 @@ var Icon = function Icon(_ref) {
|
|
|
6230
6268
|
intent = _ref$intent === void 0 ? 'text' : _ref$intent,
|
|
6231
6269
|
testID = _ref.testID,
|
|
6232
6270
|
_ref$spin = _ref.spin,
|
|
6233
|
-
spin = _ref$spin === void 0 ? false : _ref$spin
|
|
6271
|
+
spin = _ref$spin === void 0 ? false : _ref$spin,
|
|
6272
|
+
accessibilityLabel = _ref.accessibilityLabel,
|
|
6273
|
+
accessibilityHint = _ref.accessibilityHint,
|
|
6274
|
+
accessibilityRole = _ref.accessibilityRole,
|
|
6275
|
+
accessibilityState = _ref.accessibilityState,
|
|
6276
|
+
accessibilityValue = _ref.accessibilityValue,
|
|
6277
|
+
accessibilityLiveRegion = _ref.accessibilityLiveRegion,
|
|
6278
|
+
accessibilityElementsHidden = _ref.accessibilityElementsHidden,
|
|
6279
|
+
accessible = _ref.accessible,
|
|
6280
|
+
accessibilityIgnoresInvertColors = _ref.accessibilityIgnoresInvertColors,
|
|
6281
|
+
accessibilityViewIsModal = _ref.accessibilityViewIsModal,
|
|
6282
|
+
accessibilityActions = _ref.accessibilityActions;
|
|
6234
6283
|
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'));
|
|
6235
|
-
|
|
6284
|
+
var accessibilityProps = {
|
|
6285
|
+
accessibilityLabel: accessibilityLabel,
|
|
6286
|
+
accessibilityHint: accessibilityHint,
|
|
6287
|
+
accessibilityRole: accessibilityRole,
|
|
6288
|
+
accessibilityState: accessibilityState,
|
|
6289
|
+
accessibilityValue: accessibilityValue,
|
|
6290
|
+
accessibilityLiveRegion: accessibilityLiveRegion,
|
|
6291
|
+
accessibilityElementsHidden: accessibilityElementsHidden,
|
|
6292
|
+
accessible: accessible,
|
|
6293
|
+
accessibilityIgnoresInvertColors: accessibilityIgnoresInvertColors,
|
|
6294
|
+
accessibilityViewIsModal: accessibilityViewIsModal,
|
|
6295
|
+
accessibilityActions: accessibilityActions
|
|
6296
|
+
};
|
|
6297
|
+
return spin ? /*#__PURE__*/React.createElement(AnimatedIcon, _extends$1({
|
|
6236
6298
|
name: icon,
|
|
6237
6299
|
themeIntent: intent,
|
|
6238
6300
|
themeSize: size,
|
|
6239
6301
|
style: style,
|
|
6240
6302
|
testID: testID
|
|
6241
|
-
}) : /*#__PURE__*/React.createElement(StyledHeroIcon, {
|
|
6303
|
+
}, accessibilityProps)) : /*#__PURE__*/React.createElement(StyledHeroIcon, _extends$1({
|
|
6242
6304
|
name: icon,
|
|
6243
6305
|
themeIntent: intent,
|
|
6244
6306
|
themeSize: size,
|
|
6245
6307
|
style: style,
|
|
6246
6308
|
testID: testID
|
|
6247
|
-
});
|
|
6309
|
+
}, accessibilityProps));
|
|
6248
6310
|
};
|
|
6249
6311
|
Icon.List = IconList;
|
|
6250
6312
|
|
|
@@ -6276,7 +6338,7 @@ var AccordionItem = function AccordionItem(_ref) {
|
|
|
6276
6338
|
}, content));
|
|
6277
6339
|
};
|
|
6278
6340
|
|
|
6279
|
-
var _excluded$
|
|
6341
|
+
var _excluded$j = ["key"];
|
|
6280
6342
|
var Accordion = function Accordion(_ref) {
|
|
6281
6343
|
var items = _ref.items,
|
|
6282
6344
|
activeItemKey = _ref.activeItemKey,
|
|
@@ -6297,7 +6359,7 @@ var Accordion = function Accordion(_ref) {
|
|
|
6297
6359
|
testID: testID
|
|
6298
6360
|
}, items.map(function (_ref2, index) {
|
|
6299
6361
|
var key = _ref2.key,
|
|
6300
|
-
props = _objectWithoutProperties(_ref2, _excluded$
|
|
6362
|
+
props = _objectWithoutProperties(_ref2, _excluded$j);
|
|
6301
6363
|
var open = _activeItemKey === key;
|
|
6302
6364
|
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
6303
6365
|
key: key
|
|
@@ -6679,7 +6741,7 @@ var StyledStatus = index$a(Animated.View)(function (_ref3) {
|
|
|
6679
6741
|
};
|
|
6680
6742
|
});
|
|
6681
6743
|
|
|
6682
|
-
var _excluded$
|
|
6744
|
+
var _excluded$i = ["children", "visible", "intent", "style", "testID"];
|
|
6683
6745
|
var Status = function Status(_ref) {
|
|
6684
6746
|
var children = _ref.children,
|
|
6685
6747
|
_ref$visible = _ref.visible,
|
|
@@ -6688,7 +6750,7 @@ var Status = function Status(_ref) {
|
|
|
6688
6750
|
intent = _ref$intent === void 0 ? 'danger' : _ref$intent,
|
|
6689
6751
|
style = _ref.style,
|
|
6690
6752
|
testID = _ref.testID,
|
|
6691
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
6753
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$i);
|
|
6692
6754
|
var _React$useRef = React.useRef(new Animated.Value(visible ? 1 : 0)),
|
|
6693
6755
|
opacity = _React$useRef.current;
|
|
6694
6756
|
var isFirstRendering = React.useRef(true);
|
|
@@ -6721,7 +6783,7 @@ var Status = function Status(_ref) {
|
|
|
6721
6783
|
}));
|
|
6722
6784
|
};
|
|
6723
6785
|
|
|
6724
|
-
var _excluded$
|
|
6786
|
+
var _excluded$h = ["content", "visible", "max", "intent", "style", "testID"];
|
|
6725
6787
|
var DEFAULT_MAX_NUMBER = 99;
|
|
6726
6788
|
var getPaddingState = function getPaddingState(content) {
|
|
6727
6789
|
return content.length > 1 ? 'wideContent' : 'narrowContent';
|
|
@@ -6736,7 +6798,7 @@ var Badge = function Badge(_ref) {
|
|
|
6736
6798
|
intent = _ref$intent === void 0 ? 'danger' : _ref$intent,
|
|
6737
6799
|
style = _ref.style,
|
|
6738
6800
|
testID = _ref.testID,
|
|
6739
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
6801
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$h);
|
|
6740
6802
|
var _React$useRef = React.useRef(new Animated.Value(visible ? 1 : 0)),
|
|
6741
6803
|
opacity = _React$useRef.current;
|
|
6742
6804
|
var isFirstRendering = React.useRef(true);
|
|
@@ -6825,22 +6887,22 @@ var StyledBottomBarText = index$a(Typography.Text)(function (_ref3) {
|
|
|
6825
6887
|
|
|
6826
6888
|
var isIOS = Platform.OS === 'ios';
|
|
6827
6889
|
var isAndroid = Platform.OS === 'android';
|
|
6828
|
-
|
|
6890
|
+
function pick(keys, obj) {
|
|
6829
6891
|
return keys.filter(function (key) {
|
|
6830
|
-
return key in
|
|
6892
|
+
return key in obj;
|
|
6831
6893
|
}).reduce(function (result, cur) {
|
|
6832
|
-
return _objectSpread2(_objectSpread2({}, result), {}, _defineProperty({}, cur,
|
|
6894
|
+
return _objectSpread2(_objectSpread2({}, result), {}, _defineProperty({}, cur, obj[cur]));
|
|
6833
6895
|
}, {});
|
|
6834
|
-
}
|
|
6835
|
-
|
|
6836
|
-
var result =
|
|
6896
|
+
}
|
|
6897
|
+
function omit(keys, obj) {
|
|
6898
|
+
var result = obj;
|
|
6837
6899
|
keys.forEach(function (key) {
|
|
6838
6900
|
delete result[key];
|
|
6839
6901
|
});
|
|
6840
6902
|
return result;
|
|
6841
|
-
}
|
|
6903
|
+
}
|
|
6842
6904
|
|
|
6843
|
-
var _excluded$
|
|
6905
|
+
var _excluded$g = ["onTabPress", "renderActiveTabOnly", "selectedTabKey", "tabs"];
|
|
6844
6906
|
var getInactiveIcon = function getInactiveIcon(icon) {
|
|
6845
6907
|
var inactiveIcon = "".concat(icon, "-outlined");
|
|
6846
6908
|
return isHeroIcon(inactiveIcon) ? inactiveIcon : icon;
|
|
@@ -6851,7 +6913,7 @@ var BottomNavigation = function BottomNavigation(_ref) {
|
|
|
6851
6913
|
renderActiveTabOnly = _ref$renderActiveTabO === void 0 ? false : _ref$renderActiveTabO,
|
|
6852
6914
|
selectedTabKey = _ref.selectedTabKey,
|
|
6853
6915
|
tabs = _ref.tabs,
|
|
6854
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
6916
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$g);
|
|
6855
6917
|
var insets = useSafeAreaInsets();
|
|
6856
6918
|
/**
|
|
6857
6919
|
* List of loaded tabs, tabs will be loaded when navigated to.
|
|
@@ -6938,13 +7000,13 @@ var StyledDivider = index$a(View)(function (_ref) {
|
|
|
6938
7000
|
}, horizontalMargin), verticalMargin);
|
|
6939
7001
|
});
|
|
6940
7002
|
|
|
6941
|
-
var _excluded$
|
|
7003
|
+
var _excluded$f = ["marginHorizontal", "marginVertical", "style", "testID"];
|
|
6942
7004
|
var Divider = function Divider(_ref) {
|
|
6943
7005
|
var marginHorizontal = _ref.marginHorizontal,
|
|
6944
7006
|
marginVertical = _ref.marginVertical,
|
|
6945
7007
|
style = _ref.style,
|
|
6946
7008
|
testID = _ref.testID,
|
|
6947
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
7009
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$f);
|
|
6948
7010
|
return /*#__PURE__*/React.createElement(StyledDivider, _extends$1({}, nativeProps, {
|
|
6949
7011
|
themeMarginHorizontal: marginHorizontal,
|
|
6950
7012
|
themeMarginVertical: marginVertical,
|
|
@@ -7074,7 +7136,7 @@ var StyledLoadingDot = index$a(View)(function (_ref2) {
|
|
|
7074
7136
|
}, themeStyling());
|
|
7075
7137
|
});
|
|
7076
7138
|
|
|
7077
|
-
var _excluded$
|
|
7139
|
+
var _excluded$e = ["count", "size", "testID", "themeVariant"];
|
|
7078
7140
|
var AnimatedLoadingIndicatorWrapper = Animated.createAnimatedComponent(StyledLoadingIndicatorWrapper);
|
|
7079
7141
|
var AnimatedLoadingDot = Animated.createAnimatedComponent(StyledLoadingDot);
|
|
7080
7142
|
var renderDotComponent = function renderDotComponent(_ref) {
|
|
@@ -7106,7 +7168,7 @@ var LoadingIndicator = function LoadingIndicator(_ref2) {
|
|
|
7106
7168
|
size = _ref2$size === void 0 ? 12 : _ref2$size,
|
|
7107
7169
|
testID = _ref2.testID,
|
|
7108
7170
|
themeVariant = _ref2.themeVariant,
|
|
7109
|
-
nativeProps = _objectWithoutProperties(_ref2, _excluded$
|
|
7171
|
+
nativeProps = _objectWithoutProperties(_ref2, _excluded$e);
|
|
7110
7172
|
var progressAnimation = useRef(new Animated.Value(0));
|
|
7111
7173
|
useEffect(function () {
|
|
7112
7174
|
var animation = Animated.loop(Animated.timing(progressAnimation.current, {
|
|
@@ -7502,11 +7564,11 @@ var Header = function Header(_ref) {
|
|
|
7502
7564
|
})) : null), showDivider ? /*#__PURE__*/React.createElement(Divider, null) : null);
|
|
7503
7565
|
};
|
|
7504
7566
|
|
|
7505
|
-
var _excluded$
|
|
7567
|
+
var _excluded$d = ["scrollEventThrottle"];
|
|
7506
7568
|
var BottomSheetScrollView = function BottomSheetScrollView(_ref) {
|
|
7507
7569
|
var _ref$scrollEventThrot = _ref.scrollEventThrottle,
|
|
7508
7570
|
scrollEventThrottle = _ref$scrollEventThrot === void 0 ? 100 : _ref$scrollEventThrot,
|
|
7509
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
7571
|
+
props = _objectWithoutProperties(_ref, _excluded$d);
|
|
7510
7572
|
var _useContext = useContext(BottomSheetContext),
|
|
7511
7573
|
setInternalShowDivider = _useContext.setInternalShowDivider;
|
|
7512
7574
|
var onScrollBeginDrag = useCallback(function (e) {
|
|
@@ -7821,7 +7883,7 @@ var borderWidths = {
|
|
|
7821
7883
|
var config = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, colors), space), radii), borderWidths);
|
|
7822
7884
|
var flexPropsKey = ['alignContent', 'alignItems', 'alignSelf', 'display', 'flex', 'flexBasis', 'flexDirection', 'flexGrow', 'flexShrink', 'flexWrap', 'justifyContent'];
|
|
7823
7885
|
|
|
7824
|
-
var _excluded$
|
|
7886
|
+
var _excluded$c = ["theme"];
|
|
7825
7887
|
var getThemeValue = function getThemeValue(theme, key, props) {
|
|
7826
7888
|
var propConfig = config[key];
|
|
7827
7889
|
var propValue = props[key];
|
|
@@ -7848,18 +7910,18 @@ var mapStylePropToThemeValue = function mapStylePropToThemeValue(theme, props) {
|
|
|
7848
7910
|
var configKeys = Object.keys(config);
|
|
7849
7911
|
var StyledBox = index$a(View)(function (_ref5) {
|
|
7850
7912
|
var theme = _ref5.theme,
|
|
7851
|
-
otherProps = _objectWithoutProperties(_ref5, _excluded$
|
|
7913
|
+
otherProps = _objectWithoutProperties(_ref5, _excluded$c);
|
|
7852
7914
|
var styleProps = pick(configKeys, otherProps);
|
|
7853
7915
|
var flexProps = pick(_toConsumableArray(flexPropsKey), otherProps);
|
|
7854
7916
|
return _objectSpread2(_objectSpread2({}, mapStylePropToThemeValue(theme, styleProps)), flexProps);
|
|
7855
7917
|
});
|
|
7856
7918
|
|
|
7857
|
-
var _excluded$
|
|
7919
|
+
var _excluded$b = ["children", "style", "testID"];
|
|
7858
7920
|
var Box = function Box(_ref) {
|
|
7859
7921
|
var children = _ref.children,
|
|
7860
7922
|
style = _ref.style,
|
|
7861
7923
|
testID = _ref.testID,
|
|
7862
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$
|
|
7924
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$b);
|
|
7863
7925
|
return /*#__PURE__*/React.createElement(StyledBox, _extends$1({}, otherProps, {
|
|
7864
7926
|
style: style,
|
|
7865
7927
|
testID: testID
|
|
@@ -10424,6 +10486,251 @@ var Calendar = function Calendar(_ref) {
|
|
|
10424
10486
|
})));
|
|
10425
10487
|
};
|
|
10426
10488
|
|
|
10489
|
+
var StyledCarouselPaginator = index$a(View)(function () {
|
|
10490
|
+
return {
|
|
10491
|
+
flexDirection: 'row',
|
|
10492
|
+
alignItems: 'center'
|
|
10493
|
+
};
|
|
10494
|
+
});
|
|
10495
|
+
var StyledCarouselPaginatorAnimatedView = index$a(Animated.View)(function (_ref) {
|
|
10496
|
+
var theme = _ref.theme;
|
|
10497
|
+
return {
|
|
10498
|
+
height: theme.__hd__.carousel.sizes.paginatorHeight,
|
|
10499
|
+
width: theme.__hd__.carousel.sizes.paginatorWidth,
|
|
10500
|
+
borderRadius: theme.__hd__.carousel.radii.paginatorBorderRadius,
|
|
10501
|
+
backgroundColor: theme.__hd__.carousel.colors.paginatorBackgroundColor,
|
|
10502
|
+
marginHorizontal: theme.__hd__.carousel.space.paginatorMarginHorizontal
|
|
10503
|
+
};
|
|
10504
|
+
});
|
|
10505
|
+
|
|
10506
|
+
var CarouselPaginator = function CarouselPaginator(_ref) {
|
|
10507
|
+
var numberOfSlides = _ref.numberOfSlides,
|
|
10508
|
+
scrollX = _ref.scrollX;
|
|
10509
|
+
var _useWindowDimensions = useWindowDimensions(),
|
|
10510
|
+
width = _useWindowDimensions.width;
|
|
10511
|
+
var theme = useTheme();
|
|
10512
|
+
return /*#__PURE__*/React.createElement(StyledCarouselPaginator, null, new Array(numberOfSlides).fill('').map(function (_, index) {
|
|
10513
|
+
var inputRange = [(index - 1) * width, index * width, (index + 1) * width];
|
|
10514
|
+
var indicatorWidth = scrollX.interpolate({
|
|
10515
|
+
inputRange: inputRange,
|
|
10516
|
+
outputRange: [theme.space.small, theme.space.large, theme.space.small],
|
|
10517
|
+
extrapolate: 'clamp'
|
|
10518
|
+
});
|
|
10519
|
+
var opacity = scrollX.interpolate({
|
|
10520
|
+
inputRange: inputRange,
|
|
10521
|
+
outputRange: [0.5, 1, 0.5],
|
|
10522
|
+
extrapolate: 'clamp'
|
|
10523
|
+
});
|
|
10524
|
+
return /*#__PURE__*/React.createElement(StyledCarouselPaginatorAnimatedView, {
|
|
10525
|
+
indicatorWidth: indicatorWidth,
|
|
10526
|
+
style: [{
|
|
10527
|
+
width: indicatorWidth,
|
|
10528
|
+
opacity: opacity
|
|
10529
|
+
}],
|
|
10530
|
+
key: index.toString()
|
|
10531
|
+
});
|
|
10532
|
+
}));
|
|
10533
|
+
};
|
|
10534
|
+
|
|
10535
|
+
var _excluded$a = ["rounded", "size", "testID", "style"];
|
|
10536
|
+
var Image = function Image(_ref) {
|
|
10537
|
+
var _ref$rounded = _ref.rounded,
|
|
10538
|
+
rounded = _ref$rounded === void 0 ? false : _ref$rounded,
|
|
10539
|
+
_ref$size = _ref.size,
|
|
10540
|
+
size = _ref$size === void 0 ? '6xlarge' : _ref$size,
|
|
10541
|
+
testID = _ref.testID,
|
|
10542
|
+
style = _ref.style,
|
|
10543
|
+
imageNativeProps = _objectWithoutProperties(_ref, _excluded$a);
|
|
10544
|
+
var theme = useTheme();
|
|
10545
|
+
var imageSize = theme.__hd__.image.sizes[size];
|
|
10546
|
+
return /*#__PURE__*/React.createElement(Image$1, _extends$1({
|
|
10547
|
+
testID: testID,
|
|
10548
|
+
style: [{
|
|
10549
|
+
width: imageSize,
|
|
10550
|
+
height: imageSize,
|
|
10551
|
+
borderRadius: rounded ? imageSize / 2 : 0
|
|
10552
|
+
}, style]
|
|
10553
|
+
}, imageNativeProps));
|
|
10554
|
+
};
|
|
10555
|
+
|
|
10556
|
+
var StyledCarousel = index$a(View)(function (_ref) {
|
|
10557
|
+
var themeSlideBackground = _ref.themeSlideBackground;
|
|
10558
|
+
return {
|
|
10559
|
+
zIndex: 99999,
|
|
10560
|
+
position: 'absolute',
|
|
10561
|
+
backgroundColor: themeSlideBackground,
|
|
10562
|
+
top: 0,
|
|
10563
|
+
bottom: 0,
|
|
10564
|
+
right: 0,
|
|
10565
|
+
left: 0
|
|
10566
|
+
};
|
|
10567
|
+
});
|
|
10568
|
+
var StyledCarouselView = index$a(View)(function () {
|
|
10569
|
+
return {
|
|
10570
|
+
justifyContent: 'space-between',
|
|
10571
|
+
height: '100%'
|
|
10572
|
+
};
|
|
10573
|
+
});
|
|
10574
|
+
var StyledCarouselHeading = index$a(Typography.Text)(function (_ref2) {
|
|
10575
|
+
var theme = _ref2.theme;
|
|
10576
|
+
return {
|
|
10577
|
+
marginTop: theme.__hd__.carousel.space.headingMarginTop,
|
|
10578
|
+
marginBottom: theme.__hd__.carousel.space.headingMarginBottom,
|
|
10579
|
+
fontFamily: theme.__hd__.carousel.fonts.heading,
|
|
10580
|
+
fontSize: theme.__hd__.carousel.fontSizes.heading,
|
|
10581
|
+
lineHeight: theme.__hd__.carousel.lineHeights.heading
|
|
10582
|
+
};
|
|
10583
|
+
});
|
|
10584
|
+
var StyledCarouselImage = index$a(Image)(function () {
|
|
10585
|
+
return {
|
|
10586
|
+
flex: 1,
|
|
10587
|
+
width: '100%',
|
|
10588
|
+
resizeMode: 'contain'
|
|
10589
|
+
};
|
|
10590
|
+
});
|
|
10591
|
+
var StyledCarouselContentWrapper = index$a(Box)(function (_ref3) {
|
|
10592
|
+
var width = _ref3.width;
|
|
10593
|
+
return {
|
|
10594
|
+
width: width
|
|
10595
|
+
};
|
|
10596
|
+
});
|
|
10597
|
+
var StyledCarouselFooterWrapper = index$a(Box)(function () {
|
|
10598
|
+
return {
|
|
10599
|
+
width: '100%'
|
|
10600
|
+
};
|
|
10601
|
+
});
|
|
10602
|
+
|
|
10603
|
+
var CarouselItem = function CarouselItem(_ref) {
|
|
10604
|
+
var width = _ref.width,
|
|
10605
|
+
image = _ref.image,
|
|
10606
|
+
content = _ref.content,
|
|
10607
|
+
heading = _ref.heading,
|
|
10608
|
+
body = _ref.body,
|
|
10609
|
+
minHeight = _ref.minHeight;
|
|
10610
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
10611
|
+
style: {
|
|
10612
|
+
width: width
|
|
10613
|
+
}
|
|
10614
|
+
}, image && /*#__PURE__*/React.createElement(StyledCarouselImage, {
|
|
10615
|
+
source: typeof image === 'string' ? {
|
|
10616
|
+
uri: image
|
|
10617
|
+
} : image
|
|
10618
|
+
}), /*#__PURE__*/React.createElement(StyledCarouselContentWrapper, {
|
|
10619
|
+
paddingHorizontal: "large",
|
|
10620
|
+
marginTop: "large",
|
|
10621
|
+
width: width,
|
|
10622
|
+
style: {
|
|
10623
|
+
minHeight: minHeight
|
|
10624
|
+
}
|
|
10625
|
+
}, content, /*#__PURE__*/React.createElement(StyledCarouselHeading, null, heading), body ? /*#__PURE__*/React.createElement(Typography.Text, {
|
|
10626
|
+
fontSize: "large"
|
|
10627
|
+
}, body) : null));
|
|
10628
|
+
};
|
|
10629
|
+
|
|
10630
|
+
var _excluded$9 = ["items", "onFinishPress", "onSkipPress", "onSlideChange", "finishButtonLabel", "skipButtonLabel", "footerHeight", "minContentHeight"];
|
|
10631
|
+
var Carousel = function Carousel(_ref) {
|
|
10632
|
+
var items = _ref.items,
|
|
10633
|
+
onFinishPress = _ref.onFinishPress,
|
|
10634
|
+
onSkipPress = _ref.onSkipPress,
|
|
10635
|
+
onSlideChange = _ref.onSlideChange,
|
|
10636
|
+
_ref$finishButtonLabe = _ref.finishButtonLabel,
|
|
10637
|
+
finishButtonLabel = _ref$finishButtonLabe === void 0 ? "Let's go!" : _ref$finishButtonLabe,
|
|
10638
|
+
_ref$skipButtonLabel = _ref.skipButtonLabel,
|
|
10639
|
+
skipButtonLabel = _ref$skipButtonLabel === void 0 ? 'Skip' : _ref$skipButtonLabel,
|
|
10640
|
+
_ref$footerHeight = _ref.footerHeight,
|
|
10641
|
+
footerHeight = _ref$footerHeight === void 0 ? 70 : _ref$footerHeight,
|
|
10642
|
+
_ref$minContentHeight = _ref.minContentHeight,
|
|
10643
|
+
minContentHeight = _ref$minContentHeight === void 0 ? 250 : _ref$minContentHeight,
|
|
10644
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$9);
|
|
10645
|
+
var carouselRef = useRef(null);
|
|
10646
|
+
var _useState = useState(0),
|
|
10647
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
10648
|
+
currentSlideIndex = _useState2[0],
|
|
10649
|
+
setCurrentSlideIndex = _useState2[1];
|
|
10650
|
+
var _useWindowDimensions = useWindowDimensions(),
|
|
10651
|
+
width = _useWindowDimensions.width;
|
|
10652
|
+
var scrollX = useRef(new Animated.Value(0)).current;
|
|
10653
|
+
var visibleSlideChanged = useCallback(function (_ref2) {
|
|
10654
|
+
var viewableItems = _ref2.viewableItems;
|
|
10655
|
+
if (!viewableItems || viewableItems && !viewableItems.length) return;
|
|
10656
|
+
var currentIndex = viewableItems[0].index;
|
|
10657
|
+
setCurrentSlideIndex(viewableItems[0].index);
|
|
10658
|
+
var currentSlide = items[currentIndex];
|
|
10659
|
+
if (onSlideChange) {
|
|
10660
|
+
onSlideChange(currentSlide);
|
|
10661
|
+
}
|
|
10662
|
+
}, [items, onSlideChange]);
|
|
10663
|
+
var skipCarousel = useCallback(function () {
|
|
10664
|
+
var currentSlide = items[currentSlideIndex];
|
|
10665
|
+
if (onSkipPress) {
|
|
10666
|
+
onSkipPress(currentSlide);
|
|
10667
|
+
}
|
|
10668
|
+
}, [currentSlideIndex, onSkipPress, items]);
|
|
10669
|
+
var finishCarousel = useCallback(function () {
|
|
10670
|
+
var currentSlide = items[currentSlideIndex];
|
|
10671
|
+
if (onFinishPress) {
|
|
10672
|
+
onFinishPress(currentSlide);
|
|
10673
|
+
}
|
|
10674
|
+
}, [onFinishPress, items, currentSlideIndex]);
|
|
10675
|
+
var viewConfig = useRef({
|
|
10676
|
+
viewAreaCoveragePercentThreshold: 50
|
|
10677
|
+
}).current;
|
|
10678
|
+
var isLastSlide = currentSlideIndex === items.length - 1;
|
|
10679
|
+
return /*#__PURE__*/React.createElement(StyledCarousel, _extends$1({
|
|
10680
|
+
themeSlideBackground: items[currentSlideIndex].background
|
|
10681
|
+
}, nativeProps), /*#__PURE__*/React.createElement(StyledCarouselView, null, /*#__PURE__*/React.createElement(FlatList, {
|
|
10682
|
+
horizontal: true,
|
|
10683
|
+
showsHorizontalScrollIndicator: false,
|
|
10684
|
+
pagingEnabled: true,
|
|
10685
|
+
bounces: false,
|
|
10686
|
+
data: items,
|
|
10687
|
+
onViewableItemsChanged: visibleSlideChanged,
|
|
10688
|
+
viewabilityConfig: viewConfig,
|
|
10689
|
+
scrollEventThrottle: 32,
|
|
10690
|
+
ref: carouselRef,
|
|
10691
|
+
onScroll: Animated.event([{
|
|
10692
|
+
nativeEvent: {
|
|
10693
|
+
contentOffset: {
|
|
10694
|
+
x: scrollX
|
|
10695
|
+
}
|
|
10696
|
+
}
|
|
10697
|
+
}], {
|
|
10698
|
+
useNativeDriver: false
|
|
10699
|
+
}),
|
|
10700
|
+
renderItem: function renderItem(_ref3) {
|
|
10701
|
+
var item = _ref3.item;
|
|
10702
|
+
if (!item) return null;
|
|
10703
|
+
var image = item.image,
|
|
10704
|
+
heading = item.heading,
|
|
10705
|
+
body = item.body,
|
|
10706
|
+
content = item.content;
|
|
10707
|
+
return /*#__PURE__*/React.createElement(CarouselItem, {
|
|
10708
|
+
image: image,
|
|
10709
|
+
heading: heading,
|
|
10710
|
+
body: body,
|
|
10711
|
+
content: content,
|
|
10712
|
+
minHeight: minContentHeight,
|
|
10713
|
+
width: width
|
|
10714
|
+
});
|
|
10715
|
+
}
|
|
10716
|
+
}), /*#__PURE__*/React.createElement(StyledCarouselFooterWrapper, {
|
|
10717
|
+
paddingHorizontal: "large",
|
|
10718
|
+
flexDirection: "row",
|
|
10719
|
+
justifyContent: "space-between",
|
|
10720
|
+
style: {
|
|
10721
|
+
height: footerHeight
|
|
10722
|
+
}
|
|
10723
|
+
}, /*#__PURE__*/React.createElement(CompoundButton, {
|
|
10724
|
+
variant: isLastSlide ? 'filled' : 'text',
|
|
10725
|
+
intent: "primary",
|
|
10726
|
+
onPress: isLastSlide ? finishCarousel : skipCarousel,
|
|
10727
|
+
text: isLastSlide ? finishButtonLabel : skipButtonLabel
|
|
10728
|
+
}), /*#__PURE__*/React.createElement(CarouselPaginator, {
|
|
10729
|
+
numberOfSlides: items.length,
|
|
10730
|
+
scrollX: scrollX
|
|
10731
|
+
}))));
|
|
10732
|
+
};
|
|
10733
|
+
|
|
10427
10734
|
var StyledDataCard = index$a(View)(function (_ref) {
|
|
10428
10735
|
var theme = _ref.theme;
|
|
10429
10736
|
return {
|
|
@@ -10442,12 +10749,12 @@ var Indicator = index$a(View)(function (_ref2) {
|
|
|
10442
10749
|
};
|
|
10443
10750
|
});
|
|
10444
10751
|
|
|
10445
|
-
var _excluded$
|
|
10752
|
+
var _excluded$8 = ["intent", "children"];
|
|
10446
10753
|
var DataCard = function DataCard(_ref) {
|
|
10447
10754
|
var _ref$intent = _ref.intent,
|
|
10448
10755
|
intent = _ref$intent === void 0 ? 'info' : _ref$intent,
|
|
10449
10756
|
children = _ref.children,
|
|
10450
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
10757
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$8);
|
|
10451
10758
|
return /*#__PURE__*/React.createElement(StyledDataCard, nativeProps, /*#__PURE__*/React.createElement(Indicator, {
|
|
10452
10759
|
themeIntent: intent,
|
|
10453
10760
|
testID: "data-card-indicator"
|
|
@@ -10465,11 +10772,11 @@ var StyledCard = index$a(View)(function (_ref) {
|
|
|
10465
10772
|
});
|
|
10466
10773
|
});
|
|
10467
10774
|
|
|
10468
|
-
var _excluded$
|
|
10775
|
+
var _excluded$7 = ["intent", "children"];
|
|
10469
10776
|
var Card = function Card(_ref) {
|
|
10470
10777
|
var intent = _ref.intent,
|
|
10471
10778
|
children = _ref.children,
|
|
10472
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
10779
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$7);
|
|
10473
10780
|
return /*#__PURE__*/React.createElement(StyledCard, _extends$1({}, nativeProps, {
|
|
10474
10781
|
themeIntent: intent
|
|
10475
10782
|
}), children);
|
|
@@ -10650,7 +10957,7 @@ var StyledHelperText = index$a(Typography.Text)(function (_ref10) {
|
|
|
10650
10957
|
fontSize: theme.__hd__.textInput.fontSizes.error
|
|
10651
10958
|
};
|
|
10652
10959
|
});
|
|
10653
|
-
var StyledTextInput = index$a(TextInput$
|
|
10960
|
+
var StyledTextInput = index$a(TextInput$2)(function (_ref11) {
|
|
10654
10961
|
var theme = _ref11.theme;
|
|
10655
10962
|
return {
|
|
10656
10963
|
textAlignVertical: 'center',
|
|
@@ -10703,7 +11010,7 @@ var StyledErrorAndMaxLengthContainer = index$a(View)(function () {
|
|
|
10703
11010
|
};
|
|
10704
11011
|
});
|
|
10705
11012
|
|
|
10706
|
-
var _excluded$
|
|
11013
|
+
var _excluded$6 = ["label", "prefix", "suffix", "style", "textStyle", "testID", "accessibilityLabelledBy", "error", "required", "editable", "disabled", "loading", "maxLength", "helpText", "value", "defaultValue", "renderInputValue"];
|
|
10707
11014
|
var getVariant$1 = function getVariant(_ref) {
|
|
10708
11015
|
var disabled = _ref.disabled,
|
|
10709
11016
|
error = _ref.error,
|
|
@@ -10727,7 +11034,7 @@ var getVariant$1 = function getVariant(_ref) {
|
|
|
10727
11034
|
// Fix issue: Placeholder is not shown on iOS when multiline is true
|
|
10728
11035
|
// https://github.com/callstack/react-native-paper/pull/3331
|
|
10729
11036
|
var EMPTY_PLACEHOLDER_VALUE = ' ';
|
|
10730
|
-
var TextInput = function TextInput(_ref2) {
|
|
11037
|
+
var TextInput = function TextInput(_ref2, ref) {
|
|
10731
11038
|
var _ref3;
|
|
10732
11039
|
var label = _ref2.label,
|
|
10733
11040
|
prefix = _ref2.prefix,
|
|
@@ -10749,7 +11056,7 @@ var TextInput = function TextInput(_ref2) {
|
|
|
10749
11056
|
value = _ref2.value,
|
|
10750
11057
|
defaultValue = _ref2.defaultValue,
|
|
10751
11058
|
renderInputValue = _ref2.renderInputValue,
|
|
10752
|
-
nativeProps = _objectWithoutProperties(_ref2, _excluded$
|
|
11059
|
+
nativeProps = _objectWithoutProperties(_ref2, _excluded$6);
|
|
10753
11060
|
var displayText = (_ref3 = value !== undefined ? value : defaultValue) !== null && _ref3 !== void 0 ? _ref3 : '';
|
|
10754
11061
|
var isEmptyValue = displayText.length === 0;
|
|
10755
11062
|
var actualSuffix = loading ? 'loading' : suffix;
|
|
@@ -10767,6 +11074,35 @@ var TextInput = function TextInput(_ref2) {
|
|
|
10767
11074
|
});
|
|
10768
11075
|
var shouldShowMaxLength = maxLength !== undefined;
|
|
10769
11076
|
var theme = useTheme();
|
|
11077
|
+
var innerTextInput = React.useRef();
|
|
11078
|
+
React.useImperativeHandle(ref, function () {
|
|
11079
|
+
return {
|
|
11080
|
+
// we don't expose this method, it's for testing https://medium.com/developer-rants/how-to-test-useref-without-mocking-useref-699165f4994e
|
|
11081
|
+
getNativeTextInputRef: function getNativeTextInputRef() {
|
|
11082
|
+
return innerTextInput.current;
|
|
11083
|
+
},
|
|
11084
|
+
focus: function focus() {
|
|
11085
|
+
var _innerTextInput$curre;
|
|
11086
|
+
(_innerTextInput$curre = innerTextInput.current) === null || _innerTextInput$curre === void 0 ? void 0 : _innerTextInput$curre.focus();
|
|
11087
|
+
},
|
|
11088
|
+
clear: function clear() {
|
|
11089
|
+
var _innerTextInput$curre2;
|
|
11090
|
+
return (_innerTextInput$curre2 = innerTextInput.current) === null || _innerTextInput$curre2 === void 0 ? void 0 : _innerTextInput$curre2.clear();
|
|
11091
|
+
},
|
|
11092
|
+
setNativeProps: function setNativeProps(args) {
|
|
11093
|
+
var _innerTextInput$curre3;
|
|
11094
|
+
return (_innerTextInput$curre3 = innerTextInput.current) === null || _innerTextInput$curre3 === void 0 ? void 0 : _innerTextInput$curre3.setNativeProps(args);
|
|
11095
|
+
},
|
|
11096
|
+
isFocused: function isFocused() {
|
|
11097
|
+
var _innerTextInput$curre4;
|
|
11098
|
+
return ((_innerTextInput$curre4 = innerTextInput.current) === null || _innerTextInput$curre4 === void 0 ? void 0 : _innerTextInput$curre4.isFocused()) || false;
|
|
11099
|
+
},
|
|
11100
|
+
blur: function blur() {
|
|
11101
|
+
var _innerTextInput$curre5;
|
|
11102
|
+
return (_innerTextInput$curre5 = innerTextInput.current) === null || _innerTextInput$curre5 === void 0 ? void 0 : _innerTextInput$curre5.blur();
|
|
11103
|
+
}
|
|
11104
|
+
};
|
|
11105
|
+
}, [innerTextInput]);
|
|
10770
11106
|
var _useMemo = useMemo(function () {
|
|
10771
11107
|
if (!textStyle) {
|
|
10772
11108
|
return {};
|
|
@@ -10846,7 +11182,11 @@ var TextInput = function TextInput(_ref2) {
|
|
|
10846
11182
|
testID: "input-label",
|
|
10847
11183
|
fontSize: "medium",
|
|
10848
11184
|
themeVariant: variant
|
|
10849
|
-
}, label)), renderInputValue ? renderInputValue(nativeInputProps) : /*#__PURE__*/React.createElement(StyledTextInput,
|
|
11185
|
+
}, label)), renderInputValue ? renderInputValue(nativeInputProps) : /*#__PURE__*/React.createElement(StyledTextInput, _extends$1({}, nativeInputProps, {
|
|
11186
|
+
ref: function ref(reference) {
|
|
11187
|
+
innerTextInput.current = reference;
|
|
11188
|
+
}
|
|
11189
|
+
}))), typeof actualSuffix === 'string' ? /*#__PURE__*/React.createElement(Icon, {
|
|
10850
11190
|
intent: variant === 'disabled' ? 'disabled-text' : 'text',
|
|
10851
11191
|
testID: "input-suffix",
|
|
10852
11192
|
icon: actualSuffix,
|
|
@@ -10864,6 +11204,7 @@ var TextInput = function TextInput(_ref2) {
|
|
|
10864
11204
|
fontSize: "small"
|
|
10865
11205
|
}, displayText.length, "/", maxLength)), !!helpText && /*#__PURE__*/React.createElement(StyledHelperText, null, helpText)));
|
|
10866
11206
|
};
|
|
11207
|
+
var TextInput$1 = /*#__PURE__*/React.forwardRef(TextInput);
|
|
10867
11208
|
|
|
10868
11209
|
var DatePickerAndroid = function DatePickerAndroid(_ref) {
|
|
10869
11210
|
var value = _ref.value,
|
|
@@ -10895,7 +11236,7 @@ var DatePickerAndroid = function DatePickerAndroid(_ref) {
|
|
|
10895
11236
|
}, /*#__PURE__*/React.createElement(View, {
|
|
10896
11237
|
pointerEvents: "none",
|
|
10897
11238
|
testID: "datePickerInputAndroid"
|
|
10898
|
-
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
11239
|
+
}, /*#__PURE__*/React.createElement(TextInput$1, {
|
|
10899
11240
|
label: label,
|
|
10900
11241
|
value: displayValue,
|
|
10901
11242
|
suffix: "calendar-dates-outlined",
|
|
@@ -10963,7 +11304,7 @@ var DatePickerIOS = function DatePickerIOS(_ref) {
|
|
|
10963
11304
|
}, /*#__PURE__*/React.createElement(View, {
|
|
10964
11305
|
pointerEvents: "none",
|
|
10965
11306
|
testID: "datePickerInputIOS"
|
|
10966
|
-
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
11307
|
+
}, /*#__PURE__*/React.createElement(TextInput$1, {
|
|
10967
11308
|
label: label,
|
|
10968
11309
|
value: displayValue,
|
|
10969
11310
|
suffix: "calendar-dates-outlined",
|
|
@@ -11394,11 +11735,11 @@ var StyledFABText = index$a(Text$1)(function (_ref3) {
|
|
|
11394
11735
|
};
|
|
11395
11736
|
});
|
|
11396
11737
|
|
|
11397
|
-
var _excluded$
|
|
11738
|
+
var _excluded$5 = ["active"];
|
|
11398
11739
|
var AnimatedIcons = Animated.createAnimatedComponent(StyledFABIcon);
|
|
11399
11740
|
var AnimatedFABIcon = function AnimatedFABIcon(_ref) {
|
|
11400
11741
|
var active = _ref.active,
|
|
11401
|
-
iconProps = _objectWithoutProperties(_ref, _excluded$
|
|
11742
|
+
iconProps = _objectWithoutProperties(_ref, _excluded$5);
|
|
11402
11743
|
var rotateAnimation = useRef(new Animated.Value(active ? 1 : 0));
|
|
11403
11744
|
useEffect(function () {
|
|
11404
11745
|
var animation = Animated.timing(rotateAnimation.current, {
|
|
@@ -11645,27 +11986,6 @@ var index$6 = Object.assign(FAB, {
|
|
|
11645
11986
|
ActionGroup: ActionGroup
|
|
11646
11987
|
});
|
|
11647
11988
|
|
|
11648
|
-
var _excluded$5 = ["rounded", "size", "testID", "style"];
|
|
11649
|
-
var Image = function Image(_ref) {
|
|
11650
|
-
var _ref$rounded = _ref.rounded,
|
|
11651
|
-
rounded = _ref$rounded === void 0 ? false : _ref$rounded,
|
|
11652
|
-
_ref$size = _ref.size,
|
|
11653
|
-
size = _ref$size === void 0 ? '6xlarge' : _ref$size,
|
|
11654
|
-
testID = _ref.testID,
|
|
11655
|
-
style = _ref.style,
|
|
11656
|
-
imageNativeProps = _objectWithoutProperties(_ref, _excluded$5);
|
|
11657
|
-
var theme = useTheme();
|
|
11658
|
-
var imageSize = theme.__hd__.image.sizes[size];
|
|
11659
|
-
return /*#__PURE__*/React.createElement(Image$1, _extends$1({
|
|
11660
|
-
testID: testID,
|
|
11661
|
-
style: [{
|
|
11662
|
-
width: imageSize,
|
|
11663
|
-
height: imageSize,
|
|
11664
|
-
borderRadius: rounded ? imageSize / 2 : 0
|
|
11665
|
-
}, style]
|
|
11666
|
-
}, imageNativeProps));
|
|
11667
|
-
};
|
|
11668
|
-
|
|
11669
11989
|
var StyledListItemContainer$1 = index$a(TouchableOpacity)(function (_ref) {
|
|
11670
11990
|
var theme = _ref.theme,
|
|
11671
11991
|
_ref$themeSelected = _ref.themeSelected,
|
|
@@ -11917,7 +12237,7 @@ var StyledFilledMask = index$a(View)(function (_ref5) {
|
|
|
11917
12237
|
backgroundColor: theme.__hd__.pinInput.colors[themeState]
|
|
11918
12238
|
};
|
|
11919
12239
|
});
|
|
11920
|
-
var StyledHiddenInput = index$a(TextInput$
|
|
12240
|
+
var StyledHiddenInput = index$a(TextInput$2)(function (_ref6) {
|
|
11921
12241
|
var themePinLength = _ref6.themePinLength,
|
|
11922
12242
|
theme = _ref6.theme;
|
|
11923
12243
|
var cellWidth = theme.__hd__.pinInput.sizes.cellWidth;
|
|
@@ -13029,7 +13349,7 @@ function MultiSelect(_ref) {
|
|
|
13029
13349
|
}
|
|
13030
13350
|
}, /*#__PURE__*/React.createElement(View, {
|
|
13031
13351
|
pointerEvents: "none"
|
|
13032
|
-
}, /*#__PURE__*/React.createElement(TextInput, _extends$1({}, inputProps, {
|
|
13352
|
+
}, /*#__PURE__*/React.createElement(TextInput$1, _extends$1({}, inputProps, {
|
|
13033
13353
|
label: label,
|
|
13034
13354
|
value: displayedValue,
|
|
13035
13355
|
suffix: "arrow-down",
|
|
@@ -13077,7 +13397,7 @@ function MultiSelect(_ref) {
|
|
|
13077
13397
|
(_sectionListRef$curre = sectionListRef.current) === null || _sectionListRef$curre === void 0 ? void 0 : _sectionListRef$curre.scrollToLocation(scrollParams);
|
|
13078
13398
|
}
|
|
13079
13399
|
}
|
|
13080
|
-
}, onQueryChange && /*#__PURE__*/React.createElement(StyledSearchBar, null, /*#__PURE__*/React.createElement(TextInput, {
|
|
13400
|
+
}, onQueryChange && /*#__PURE__*/React.createElement(StyledSearchBar, null, /*#__PURE__*/React.createElement(TextInput$1, {
|
|
13081
13401
|
editable: true,
|
|
13082
13402
|
placeholder: "Search",
|
|
13083
13403
|
suffix: "search-outlined",
|
|
@@ -13205,7 +13525,7 @@ var SingleSelect = function SingleSelect(_ref) {
|
|
|
13205
13525
|
}
|
|
13206
13526
|
}, /*#__PURE__*/React.createElement(View, {
|
|
13207
13527
|
pointerEvents: "none"
|
|
13208
|
-
}, /*#__PURE__*/React.createElement(TextInput, _extends$1({}, inputProps, {
|
|
13528
|
+
}, /*#__PURE__*/React.createElement(TextInput$1, _extends$1({}, inputProps, {
|
|
13209
13529
|
label: label,
|
|
13210
13530
|
value: displayedValue,
|
|
13211
13531
|
suffix: "arrow-down",
|
|
@@ -13237,7 +13557,7 @@ var SingleSelect = function SingleSelect(_ref) {
|
|
|
13237
13557
|
(_sectionListRef$curre = sectionListRef.current) === null || _sectionListRef$curre === void 0 ? void 0 : _sectionListRef$curre.scrollToLocation(scrollParams);
|
|
13238
13558
|
}
|
|
13239
13559
|
}
|
|
13240
|
-
}, onQueryChange && /*#__PURE__*/React.createElement(StyledSearchBar, null, /*#__PURE__*/React.createElement(TextInput, {
|
|
13560
|
+
}, onQueryChange && /*#__PURE__*/React.createElement(StyledSearchBar, null, /*#__PURE__*/React.createElement(TextInput$1, {
|
|
13241
13561
|
editable: true,
|
|
13242
13562
|
placeholder: "Search",
|
|
13243
13563
|
suffix: "search-outlined",
|
|
@@ -13978,7 +14298,7 @@ var TimePickerAndroid = function TimePickerAndroid(_ref) {
|
|
|
13978
14298
|
}, /*#__PURE__*/React.createElement(View, {
|
|
13979
14299
|
pointerEvents: "none",
|
|
13980
14300
|
testID: "timePickerInputAndroid"
|
|
13981
|
-
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
14301
|
+
}, /*#__PURE__*/React.createElement(TextInput$1, {
|
|
13982
14302
|
label: label,
|
|
13983
14303
|
value: displayValue,
|
|
13984
14304
|
suffix: showSuffix ? 'clock-3' : undefined,
|
|
@@ -14046,7 +14366,7 @@ var TimePickerIOS = function TimePickerIOS(_ref) {
|
|
|
14046
14366
|
}, /*#__PURE__*/React.createElement(View, {
|
|
14047
14367
|
pointerEvents: "none",
|
|
14048
14368
|
testID: "timePickerInputIOS"
|
|
14049
|
-
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
14369
|
+
}, /*#__PURE__*/React.createElement(TextInput$1, {
|
|
14050
14370
|
label: label,
|
|
14051
14371
|
value: displayValue,
|
|
14052
14372
|
suffix: showSuffix ? 'clock-3' : undefined,
|
|
@@ -14446,10 +14766,12 @@ var ToolbarItem = function ToolbarItem(_ref) {
|
|
|
14446
14766
|
_ref$intent = _ref.intent,
|
|
14447
14767
|
intent = _ref$intent === void 0 ? 'primary' : _ref$intent,
|
|
14448
14768
|
_ref$disabled = _ref.disabled,
|
|
14449
|
-
disabled = _ref$disabled === void 0 ? false : _ref$disabled
|
|
14769
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
14770
|
+
style = _ref.style;
|
|
14450
14771
|
return /*#__PURE__*/React.createElement(ToolbarItemWrapper, {
|
|
14451
14772
|
onPress: onPress,
|
|
14452
|
-
disabled: disabled
|
|
14773
|
+
disabled: disabled,
|
|
14774
|
+
style: style
|
|
14453
14775
|
}, icon ? /*#__PURE__*/React.createElement(Icon, {
|
|
14454
14776
|
icon: icon,
|
|
14455
14777
|
size: label ? 'medium' : 'large',
|
|
@@ -14458,7 +14780,8 @@ var ToolbarItem = function ToolbarItem(_ref) {
|
|
|
14458
14780
|
}) : null, label ? /*#__PURE__*/React.createElement(Typography.Text, {
|
|
14459
14781
|
fontSize: icon ? 'small' : 'large',
|
|
14460
14782
|
fontWeight: "semi-bold",
|
|
14461
|
-
intent: disabled ? 'subdued' : intent
|
|
14783
|
+
intent: disabled ? 'subdued' : intent,
|
|
14784
|
+
maxFontSizeMultiplier: 2
|
|
14462
14785
|
}, label) : null);
|
|
14463
14786
|
};
|
|
14464
14787
|
|
|
@@ -14467,6 +14790,9 @@ var ToolbarGroup = function ToolbarGroup(_ref) {
|
|
|
14467
14790
|
align = _ref$align === void 0 ? 'right' : _ref$align,
|
|
14468
14791
|
_ref$items = _ref.items,
|
|
14469
14792
|
items = _ref$items === void 0 ? [] : _ref$items;
|
|
14793
|
+
// set maxWidth prevents overflow of items
|
|
14794
|
+
// issue: https://github.com/Thinkei/hero-design/issues/1619
|
|
14795
|
+
var maxWidth = items.length > 0 ? "".concat(100 / items.length, "%") : undefined;
|
|
14470
14796
|
return /*#__PURE__*/React.createElement(ToolbarGroupWrapper, {
|
|
14471
14797
|
align: align
|
|
14472
14798
|
}, items.map(function (_ref2) {
|
|
@@ -14481,7 +14807,10 @@ var ToolbarGroup = function ToolbarGroup(_ref) {
|
|
|
14481
14807
|
icon: icon,
|
|
14482
14808
|
intent: intent,
|
|
14483
14809
|
onPress: onPress,
|
|
14484
|
-
disabled: disabled
|
|
14810
|
+
disabled: disabled,
|
|
14811
|
+
style: {
|
|
14812
|
+
maxWidth: maxWidth
|
|
14813
|
+
}
|
|
14485
14814
|
});
|
|
14486
14815
|
}));
|
|
14487
14816
|
};
|
|
@@ -30880,4 +31209,4 @@ var index = Object.assign(RichTextEditor$1, {
|
|
|
30880
31209
|
Toolbar: EditorToolbar
|
|
30881
31210
|
});
|
|
30882
31211
|
|
|
30883
|
-
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, ThemeProvider, ThemeSwitcher, TimePicker, Toast, index$1 as Toolbar, Typography, eBensSystemPalette, getTheme$1 as getTheme, jobsSystemPalette, scale, swagSystemPalette, defaultTheme as theme, useAvatarColors, useTheme, walletSystemPalette, workSystemPalette };
|
|
31212
|
+
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 };
|