@hero-design/rn 7.10.2-rc.0 → 7.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +8 -8
- package/es/index.js +374 -111
- package/lib/assets/fonts/hero-icons.ttf +0 -0
- package/lib/index.js +373 -109
- package/package.json +2 -2
- package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +4 -0
- package/src/components/FAB/ActionGroup/index.tsx +16 -5
- package/src/components/PinInput/PinCell.tsx +34 -0
- package/src/components/PinInput/StyledPinInput.tsx +88 -0
- package/src/components/PinInput/__tests__/PinCell.spec.tsx +48 -0
- package/src/components/PinInput/__tests__/StyledPinInput.spec.tsx +22 -0
- package/src/components/PinInput/__tests__/__snapshots__/PinCell.spec.tsx.snap +186 -0
- package/src/components/PinInput/__tests__/__snapshots__/StyledPinInput.spec.tsx.snap +58 -0
- package/src/components/PinInput/__tests__/__snapshots__/index.spec.tsx.snap +1028 -0
- package/src/components/PinInput/__tests__/index.spec.tsx +91 -0
- package/src/components/PinInput/index.tsx +173 -0
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +240 -214
- package/src/components/Select/MultiSelect/index.tsx +11 -16
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +240 -214
- package/src/components/Select/SingleSelect/index.tsx +11 -16
- package/src/components/TextInput/StyledTextInput.tsx +7 -4
- package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +0 -1
- package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +294 -182
- package/src/components/TextInput/__tests__/index.spec.tsx +15 -0
- package/src/components/TextInput/index.tsx +40 -34
- package/src/components/Typography/Text/StyledText.tsx +1 -1
- package/src/components/Typography/Text/__tests__/StyledText.spec.tsx +1 -0
- package/src/components/Typography/Text/__tests__/__snapshots__/StyledText.spec.tsx.snap +22 -0
- package/src/components/Typography/Text/index.tsx +1 -1
- package/src/index.ts +2 -0
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +36 -1
- package/src/theme/components/pinInput.ts +45 -0
- package/src/theme/components/textInput.ts +1 -1
- package/src/theme/components/typography.ts +2 -0
- package/src/theme/global/colors.ts +1 -1
- package/src/theme/global/space.ts +10 -10
- package/src/theme/index.ts +6 -3
- package/types/components/Alert/StyledAlert.d.ts +0 -0
- package/types/components/Alert/__tests__/index.spec.d.ts +0 -0
- package/types/components/Alert/index.d.ts +0 -0
- package/types/components/Avatar/StyledAvatar.d.ts +0 -0
- package/types/components/Avatar/__tests__/StyledAvatar.spec.d.ts +0 -0
- package/types/components/Avatar/__tests__/index.spec.d.ts +0 -0
- package/types/components/Avatar/index.d.ts +0 -0
- package/types/components/Badge/Status.d.ts +0 -0
- package/types/components/Badge/StyledBadge.d.ts +0 -0
- package/types/components/Badge/__tests__/Badge.spec.d.ts +0 -0
- package/types/components/Badge/__tests__/Status.spec.d.ts +0 -0
- package/types/components/Badge/index.d.ts +0 -0
- package/types/components/BottomNavigation/StyledBottomNavigation.d.ts +0 -0
- package/types/components/BottomNavigation/__tests__/index.spec.d.ts +0 -0
- package/types/components/BottomNavigation/index.d.ts +0 -0
- package/types/components/BottomSheet/Footer.d.ts +0 -0
- package/types/components/BottomSheet/Header.d.ts +0 -0
- package/types/components/BottomSheet/StyledBottomSheet.d.ts +0 -0
- package/types/components/BottomSheet/__tests__/index.spec.d.ts +0 -0
- package/types/components/BottomSheet/index.d.ts +0 -0
- package/types/components/Button/Button.d.ts +0 -0
- package/types/components/Button/IconButton.d.ts +0 -0
- package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +0 -0
- package/types/components/Button/LoadingIndicator/__tests__/StyledLoadingIndicator.spec.d.ts +0 -0
- package/types/components/Button/LoadingIndicator/__tests__/index.spec.d.ts +0 -0
- package/types/components/Button/LoadingIndicator/index.d.ts +0 -0
- package/types/components/Button/StyledButton.d.ts +0 -0
- package/types/components/Button/UtilityButton/__tests__/index.spec.d.ts +0 -0
- package/types/components/Button/UtilityButton/index.d.ts +0 -0
- package/types/components/Button/UtilityButton/styled.d.ts +0 -0
- package/types/components/Button/__tests__/Button.spec.d.ts +0 -0
- package/types/components/Button/__tests__/IconButton.spec.d.ts +0 -0
- package/types/components/Button/__tests__/StyledButton.spec.d.ts +0 -0
- package/types/components/Button/index.d.ts +0 -0
- package/types/components/Card/DataCard/StyledDataCard.d.ts +0 -0
- package/types/components/Card/DataCard/__tests__/StyledDataCard.spec.d.ts +0 -0
- package/types/components/Card/DataCard/__tests__/index.spec.d.ts +0 -0
- package/types/components/Card/DataCard/index.d.ts +0 -0
- package/types/components/Card/StyledCard.d.ts +0 -0
- package/types/components/Card/__tests__/StyledCard.spec.d.ts +0 -0
- package/types/components/Card/__tests__/index.spec.d.ts +0 -0
- package/types/components/Card/index.d.ts +0 -0
- package/types/components/Checkbox/StyledCheckbox.d.ts +0 -0
- package/types/components/Checkbox/__tests__/StyledCheckbox.spec.d.ts +0 -0
- package/types/components/Checkbox/__tests__/index.spec.d.ts +0 -0
- package/types/components/Checkbox/index.d.ts +0 -0
- package/types/components/Collapse/StyledCollapse.d.ts +0 -0
- package/types/components/Collapse/__tests__/StyledCollapse.spec.d.ts +0 -0
- package/types/components/Collapse/__tests__/index.spec.d.ts +0 -0
- package/types/components/Collapse/index.d.ts +0 -0
- package/types/components/ContentNavigator/StyledContentNavigator.d.ts +0 -0
- package/types/components/ContentNavigator/__tests__/StyledContentNavigator.spec.d.ts +0 -0
- package/types/components/ContentNavigator/__tests__/index.spec.d.ts +0 -0
- package/types/components/ContentNavigator/index.d.ts +0 -0
- package/types/components/Divider/StyledDivider.d.ts +0 -0
- package/types/components/Divider/__tests__/StyledDivider.spec.d.ts +0 -0
- package/types/components/Divider/index.d.ts +0 -0
- package/types/components/Drawer/StyledDrawer.d.ts +0 -0
- package/types/components/Drawer/__tests__/index.spec.d.ts +0 -0
- package/types/components/Drawer/index.d.ts +0 -0
- package/types/components/FAB/ActionGroup/ActionItem.d.ts +0 -0
- package/types/components/FAB/ActionGroup/StyledActionGroup.d.ts +0 -0
- package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +0 -0
- package/types/components/FAB/ActionGroup/__tests__/index.spec.d.ts +0 -0
- package/types/components/FAB/ActionGroup/index.d.ts +0 -0
- package/types/components/FAB/AnimatedFABIcon.d.ts +0 -0
- package/types/components/FAB/FAB.d.ts +0 -0
- package/types/components/FAB/StyledFAB.d.ts +0 -0
- package/types/components/FAB/__tests__/AnimatedFABIcon.spec.d.ts +0 -0
- package/types/components/FAB/__tests__/StyledFAB.spec.d.ts +0 -0
- package/types/components/FAB/__tests__/index.spec.d.ts +0 -0
- package/types/components/FAB/index.d.ts +0 -0
- package/types/components/Icon/HeroIcon/index.d.ts +0 -0
- package/types/components/Icon/IconList.d.ts +0 -0
- package/types/components/Icon/__tests__/index.spec.d.ts +0 -0
- package/types/components/Icon/index.d.ts +0 -0
- package/types/components/Icon/utils.d.ts +0 -0
- package/types/components/List/BasicListItem.d.ts +0 -0
- package/types/components/List/ListItem.d.ts +0 -0
- package/types/components/List/StyledBasicListItem.d.ts +0 -0
- package/types/components/List/StyledListItem.d.ts +0 -0
- package/types/components/List/__tests__/BasicListItem.spec.d.ts +0 -0
- package/types/components/List/__tests__/ListItem.spec.d.ts +0 -0
- package/types/components/List/__tests__/StyledBasicListItem.spec.d.ts +0 -0
- package/types/components/List/__tests__/StyledListItem.spec.d.ts +0 -0
- package/types/components/List/index.d.ts +0 -0
- package/types/components/PinInput/PinCell.d.ts +8 -0
- package/types/components/PinInput/StyledPinInput.d.ts +73 -0
- package/types/components/PinInput/__tests__/PinCell.spec.d.ts +1 -0
- package/types/components/PinInput/__tests__/StyledPinInput.spec.d.ts +1 -0
- package/types/components/PinInput/__tests__/index.spec.d.ts +1 -0
- package/types/components/PinInput/index.d.ts +48 -0
- package/types/components/Progress/ProgressBar.d.ts +0 -0
- package/types/components/Progress/ProgressCircle.d.ts +0 -0
- package/types/components/Progress/StyledProgressBar.d.ts +0 -0
- package/types/components/Progress/StyledProgressCircle.d.ts +0 -0
- package/types/components/Progress/__tests__/index.spec.d.ts +0 -0
- package/types/components/Progress/index.d.ts +0 -0
- package/types/components/Progress/types.d.ts +0 -0
- package/types/components/Radio/Radio.d.ts +0 -0
- package/types/components/Radio/RadioGroup.d.ts +0 -0
- package/types/components/Radio/StyledRadio.d.ts +0 -0
- package/types/components/Radio/__tests__/Radio.spec.d.ts +0 -0
- package/types/components/Radio/__tests__/RadioGroup.spec.d.ts +0 -0
- package/types/components/Radio/__tests__/StyledRadio.spec.d.ts +0 -0
- package/types/components/Radio/index.d.ts +0 -0
- package/types/components/Radio/types.d.ts +0 -0
- package/types/components/SectionHeading/StyledHeading.d.ts +0 -0
- package/types/components/SectionHeading/__tests__/StyledHeading.spec.d.ts +0 -0
- package/types/components/SectionHeading/__tests__/index.spec.d.ts +0 -0
- package/types/components/SectionHeading/index.d.ts +0 -0
- package/types/components/Select/Footer.d.ts +0 -0
- package/types/components/Select/MultiSelect/Option.d.ts +0 -0
- package/types/components/Select/MultiSelect/OptionList.d.ts +0 -0
- package/types/components/Select/MultiSelect/__tests__/Option.spec.d.ts +0 -0
- package/types/components/Select/MultiSelect/__tests__/OptionList.spec.d.ts +0 -0
- package/types/components/Select/MultiSelect/__tests__/index.spec.d.ts +0 -0
- package/types/components/Select/MultiSelect/index.d.ts +0 -0
- package/types/components/Select/SingleSelect/Option.d.ts +0 -0
- package/types/components/Select/SingleSelect/OptionList.d.ts +0 -0
- package/types/components/Select/SingleSelect/__tests__/Option.spec.d.ts +0 -0
- package/types/components/Select/SingleSelect/__tests__/OptionList.spec.d.ts +0 -0
- package/types/components/Select/SingleSelect/__tests__/index.spec.d.ts +0 -0
- package/types/components/Select/SingleSelect/index.d.ts +0 -0
- package/types/components/Select/StyledSelect.d.ts +0 -0
- package/types/components/Select/__tests__/StyledSelect.spec.d.ts +0 -0
- package/types/components/Select/helpers.d.ts +0 -0
- package/types/components/Select/index.d.ts +0 -0
- package/types/components/Select/types.d.ts +0 -0
- package/types/components/Spinner/AnimatedSpinner.d.ts +0 -0
- package/types/components/Spinner/StyledSpinner.d.ts +0 -0
- package/types/components/Spinner/__tests__/AnimatedSpinner.spec.d.ts +0 -0
- package/types/components/Spinner/__tests__/StyledSpinner.spec.d.ts +0 -0
- package/types/components/Spinner/__tests__/index.spec.d.ts +0 -0
- package/types/components/Spinner/index.d.ts +0 -0
- package/types/components/Switch/StyledSwitch.d.ts +0 -0
- package/types/components/Switch/__tests__/StyledHeading.spec.d.ts +0 -0
- package/types/components/Switch/__tests__/index.spec.d.ts +0 -0
- package/types/components/Switch/index.d.ts +0 -0
- package/types/components/Tabs/ActiveTabIndicator.d.ts +0 -0
- package/types/components/Tabs/ScrollableTabs.d.ts +0 -0
- package/types/components/Tabs/StyledScrollableTabs.d.ts +0 -0
- package/types/components/Tabs/StyledTabs.d.ts +0 -0
- package/types/components/Tabs/__tests__/ScrollableTabs.spec.d.ts +0 -0
- package/types/components/Tabs/__tests__/index.spec.d.ts +0 -0
- package/types/components/Tabs/index.d.ts +0 -0
- package/types/components/Tabs/utils.d.ts +0 -0
- package/types/components/Tag/StyledTag.d.ts +0 -0
- package/types/components/Tag/__tests__/Tag.spec.d.ts +0 -0
- package/types/components/Tag/index.d.ts +0 -0
- package/types/components/TextInput/StyledTextInput.d.ts +7 -1
- package/types/components/TextInput/__tests__/StyledTextInput.spec.d.ts +0 -0
- package/types/components/TextInput/__tests__/index.spec.d.ts +0 -0
- package/types/components/TextInput/index.d.ts +0 -0
- package/types/components/Toast/StyledToast.d.ts +0 -0
- package/types/components/Toast/Toast.d.ts +0 -0
- package/types/components/Toast/ToastContainer.d.ts +0 -0
- package/types/components/Toast/ToastContext.d.ts +0 -0
- package/types/components/Toast/ToastProvider.d.ts +0 -0
- package/types/components/Toast/__tests__/Toast.spec.d.ts +0 -0
- package/types/components/Toast/__tests__/ToastContainer.spec.d.ts +0 -0
- package/types/components/Toast/index.d.ts +0 -0
- package/types/components/Toast/types.d.ts +0 -0
- package/types/components/Toolbar/StyledToolbar.d.ts +0 -0
- package/types/components/Toolbar/ToolbarGroup.d.ts +0 -0
- package/types/components/Toolbar/ToolbarItem.d.ts +0 -0
- package/types/components/Toolbar/__tests__/ToolbarGroup.spec.d.ts +0 -0
- package/types/components/Toolbar/__tests__/ToolbarItem.spec.d.ts +0 -0
- package/types/components/Toolbar/index.d.ts +0 -0
- package/types/components/Typography/Text/StyledText.d.ts +1 -1
- package/types/components/Typography/Text/__tests__/StyledText.spec.d.ts +0 -0
- package/types/components/Typography/Text/__tests__/index.spec.d.ts +0 -0
- package/types/components/Typography/Text/index.d.ts +1 -1
- package/types/components/Typography/index.d.ts +0 -0
- package/types/index.d.ts +2 -1
- package/types/testHelpers/renderWithTheme.d.ts +0 -0
- package/types/theme/__tests__/index.spec.d.ts +0 -0
- package/types/theme/components/alert.d.ts +0 -0
- package/types/theme/components/avatar.d.ts +0 -0
- package/types/theme/components/badge.d.ts +0 -0
- package/types/theme/components/bottomNavigation.d.ts +0 -0
- package/types/theme/components/bottomSheet.d.ts +0 -0
- package/types/theme/components/button.d.ts +0 -0
- package/types/theme/components/card.d.ts +0 -0
- package/types/theme/components/checkbox.d.ts +0 -0
- package/types/theme/components/contentNavigator.d.ts +0 -0
- package/types/theme/components/divider.d.ts +0 -0
- package/types/theme/components/drawer.d.ts +0 -0
- package/types/theme/components/fab.d.ts +0 -0
- package/types/theme/components/icon.d.ts +0 -0
- package/types/theme/components/list.d.ts +0 -0
- package/types/theme/components/pinInput.d.ts +35 -0
- package/types/theme/components/progress.d.ts +0 -0
- package/types/theme/components/radio.d.ts +0 -0
- package/types/theme/components/sectionHeading.d.ts +0 -0
- package/types/theme/components/select.d.ts +0 -0
- package/types/theme/components/spinner.d.ts +0 -0
- package/types/theme/components/switch.d.ts +0 -0
- package/types/theme/components/tabs.d.ts +0 -0
- package/types/theme/components/tag.d.ts +0 -0
- package/types/theme/components/textInput.d.ts +1 -1
- package/types/theme/components/toast.d.ts +0 -0
- package/types/theme/components/toolbar.d.ts +0 -0
- package/types/theme/components/typography.d.ts +2 -0
- package/types/theme/global/borders.d.ts +0 -0
- package/types/theme/global/colors.d.ts +0 -0
- package/types/theme/global/index.d.ts +0 -0
- package/types/theme/global/scale.d.ts +0 -0
- package/types/theme/global/space.d.ts +0 -0
- package/types/theme/global/typography.d.ts +0 -0
- package/types/theme/index.d.ts +4 -2
- package/types/types.d.ts +0 -0
- package/types/utils/__tests__/scale.spec.d.ts +0 -0
- package/types/utils/helpers.d.ts +0 -0
- package/types/utils/hooks.d.ts +0 -0
- package/types/utils/scale.d.ts +0 -0
- package/src/components/TextInput/__tests__/.log/ti-10343.log +0 -62
- package/src/components/TextInput/__tests__/.log/tsserver.log +0 -6983
package/es/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as ReactNative from 'react-native';
|
|
2
|
-
import ReactNative__default, { Dimensions, StyleSheet as StyleSheet$1, Text as Text$1, View, TouchableOpacity, Image, Animated, Platform, TouchableWithoutFeedback, Pressable, Easing, Modal, TouchableHighlight, TextInput as TextInput$1, requireNativeComponent, UIManager, I18nManager, Keyboard, FlatList, LayoutAnimation } from 'react-native';
|
|
2
|
+
import ReactNative__default, { Dimensions, StyleSheet as StyleSheet$1, Text as Text$1, View, TouchableOpacity, Image, Animated, Platform, TouchableWithoutFeedback, Pressable, Easing, Modal, TouchableHighlight, TextInput as TextInput$1, InteractionManager, requireNativeComponent, UIManager, I18nManager, Keyboard, FlatList, LayoutAnimation } from 'react-native';
|
|
3
3
|
import React, { useContext, createContext, createElement, forwardRef, useRef, useEffect, useState, useCallback, Children, useLayoutEffect, useImperativeHandle, useMemo } from 'react';
|
|
4
4
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
5
5
|
|
|
@@ -1296,21 +1296,6 @@ function prefixer(element, index, children, callback) {
|
|
|
1296
1296
|
}
|
|
1297
1297
|
}
|
|
1298
1298
|
|
|
1299
|
-
var weakMemoize = function weakMemoize(func) {
|
|
1300
|
-
// $FlowFixMe flow doesn't include all non-primitive types as allowed for weakmaps
|
|
1301
|
-
var cache = new WeakMap();
|
|
1302
|
-
return function (arg) {
|
|
1303
|
-
if (cache.has(arg)) {
|
|
1304
|
-
// $FlowFixMe
|
|
1305
|
-
return cache.get(arg);
|
|
1306
|
-
}
|
|
1307
|
-
|
|
1308
|
-
var ret = func(arg);
|
|
1309
|
-
cache.set(arg, ret);
|
|
1310
|
-
return ret;
|
|
1311
|
-
};
|
|
1312
|
-
};
|
|
1313
|
-
|
|
1314
1299
|
var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {
|
|
1315
1300
|
var previous = 0;
|
|
1316
1301
|
var character = 0;
|
|
@@ -1548,6 +1533,21 @@ function _extends$2() {
|
|
|
1548
1533
|
return _extends$2.apply(this, arguments);
|
|
1549
1534
|
}
|
|
1550
1535
|
|
|
1536
|
+
var weakMemoize = function weakMemoize(func) {
|
|
1537
|
+
// $FlowFixMe flow doesn't include all non-primitive types as allowed for weakmaps
|
|
1538
|
+
var cache = new WeakMap();
|
|
1539
|
+
return function (arg) {
|
|
1540
|
+
if (cache.has(arg)) {
|
|
1541
|
+
// $FlowFixMe
|
|
1542
|
+
return cache.get(arg);
|
|
1543
|
+
}
|
|
1544
|
+
|
|
1545
|
+
var ret = func(arg);
|
|
1546
|
+
cache.set(arg, ret);
|
|
1547
|
+
return ret;
|
|
1548
|
+
};
|
|
1549
|
+
};
|
|
1550
|
+
|
|
1551
1551
|
var EmotionCacheContext = /* #__PURE__ */createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case
|
|
1552
1552
|
// because this module is primarily intended for the browser and node
|
|
1553
1553
|
// but it's also required in react native and similar environments sometimes
|
|
@@ -2713,7 +2713,8 @@ var getSpace = function getSpace(baseSpace) {
|
|
|
2713
2713
|
xlarge: scale(baseSpace * 4),
|
|
2714
2714
|
xxlarge: scale(baseSpace * 5),
|
|
2715
2715
|
xxxlarge: scale(baseSpace * 6),
|
|
2716
|
-
xxxxlarge: scale(baseSpace * 7)
|
|
2716
|
+
xxxxlarge: scale(baseSpace * 7) // 56
|
|
2717
|
+
|
|
2717
2718
|
};
|
|
2718
2719
|
};
|
|
2719
2720
|
|
|
@@ -3162,6 +3163,96 @@ var getIconTheme = function getIconTheme(theme) {
|
|
|
3162
3163
|
};
|
|
3163
3164
|
};
|
|
3164
3165
|
|
|
3166
|
+
var getListTheme = function getListTheme(theme) {
|
|
3167
|
+
var colors = {
|
|
3168
|
+
checkedListItemContainerBackground: theme.colors.primaryBackground,
|
|
3169
|
+
listItemContainerBackground: theme.colors.platformBackground,
|
|
3170
|
+
leadingStatus: {
|
|
3171
|
+
danger: theme.colors.danger,
|
|
3172
|
+
info: theme.colors.infoLight,
|
|
3173
|
+
success: theme.colors.successDark,
|
|
3174
|
+
warning: theme.colors.warningLight,
|
|
3175
|
+
archived: theme.colors.archived
|
|
3176
|
+
}
|
|
3177
|
+
};
|
|
3178
|
+
var space = {
|
|
3179
|
+
listItemContainerPadding: theme.space.medium,
|
|
3180
|
+
leadingStatusMarginRight: theme.space.small,
|
|
3181
|
+
prefixContainerMarginRight: theme.space.small,
|
|
3182
|
+
suffixContainerMarginLeft: theme.space.small
|
|
3183
|
+
};
|
|
3184
|
+
var radii = {
|
|
3185
|
+
card: theme.radii.medium,
|
|
3186
|
+
cardShadow: theme.radii.base,
|
|
3187
|
+
leadingStatus: theme.radii.rounded
|
|
3188
|
+
};
|
|
3189
|
+
var offsets = {
|
|
3190
|
+
cardShadow: {
|
|
3191
|
+
width: 0,
|
|
3192
|
+
height: 2
|
|
3193
|
+
}
|
|
3194
|
+
};
|
|
3195
|
+
var widths = {
|
|
3196
|
+
leadingStatus: 8
|
|
3197
|
+
};
|
|
3198
|
+
var opacity = {
|
|
3199
|
+
disabled: 0.38,
|
|
3200
|
+
enabled: 1,
|
|
3201
|
+
cardShadow: 1
|
|
3202
|
+
};
|
|
3203
|
+
return {
|
|
3204
|
+
colors: colors,
|
|
3205
|
+
space: space,
|
|
3206
|
+
radii: radii,
|
|
3207
|
+
offsets: offsets,
|
|
3208
|
+
widths: widths,
|
|
3209
|
+
opacity: opacity
|
|
3210
|
+
};
|
|
3211
|
+
};
|
|
3212
|
+
|
|
3213
|
+
var getPinInputTheme = function getPinInputTheme(theme) {
|
|
3214
|
+
var borderWidths = {
|
|
3215
|
+
"default": theme.borderWidths.base,
|
|
3216
|
+
focused: theme.borderWidths.medium
|
|
3217
|
+
};
|
|
3218
|
+
var colors = {
|
|
3219
|
+
"default": theme.colors.text,
|
|
3220
|
+
mask: theme.colors.subduedText,
|
|
3221
|
+
error: theme.colors.danger,
|
|
3222
|
+
disabled: theme.colors.archivedDark
|
|
3223
|
+
};
|
|
3224
|
+
var fonts = {
|
|
3225
|
+
cellText: theme.fonts.semiBold,
|
|
3226
|
+
errorMessage: theme.fonts.regular
|
|
3227
|
+
};
|
|
3228
|
+
var fontSizes = {
|
|
3229
|
+
cellText: theme.fontSizes.xxxxlarge,
|
|
3230
|
+
errorMessage: theme.fontSizes.small
|
|
3231
|
+
};
|
|
3232
|
+
var sizes = {
|
|
3233
|
+
cellWidth: theme.space.xxlarge,
|
|
3234
|
+
cellHeight: theme.space.xxxlarge,
|
|
3235
|
+
mask: theme.space.medium
|
|
3236
|
+
};
|
|
3237
|
+
var space = {
|
|
3238
|
+
spacer: theme.space.medium,
|
|
3239
|
+
errorMessagePadding: theme.space.xsmall
|
|
3240
|
+
};
|
|
3241
|
+
var radii = {
|
|
3242
|
+
cell: theme.radii.medium,
|
|
3243
|
+
mask: theme.radii.rounded
|
|
3244
|
+
};
|
|
3245
|
+
return {
|
|
3246
|
+
borderWidths: borderWidths,
|
|
3247
|
+
colors: colors,
|
|
3248
|
+
fonts: fonts,
|
|
3249
|
+
fontSizes: fontSizes,
|
|
3250
|
+
sizes: sizes,
|
|
3251
|
+
space: space,
|
|
3252
|
+
radii: radii
|
|
3253
|
+
};
|
|
3254
|
+
};
|
|
3255
|
+
|
|
3165
3256
|
var getProgressTheme = function getProgressTheme(theme) {
|
|
3166
3257
|
var colors = {
|
|
3167
3258
|
primary: theme.colors.primary,
|
|
@@ -3443,10 +3534,10 @@ var getTextInputTheme = function getTextInputTheme(theme) {
|
|
|
3443
3534
|
labelHorizontalPadding: theme.space.xsmall,
|
|
3444
3535
|
inputHorizontalMargin: theme.space.small,
|
|
3445
3536
|
containerMarginVertical: theme.space.small,
|
|
3446
|
-
errorContainerMarginLeft: theme.space.medium,
|
|
3447
3537
|
errorContainerMarginRight: theme.space.xsmall,
|
|
3448
3538
|
errorMarginLeft: theme.space.xsmall,
|
|
3449
|
-
maxLengthLabelMarginLeft: theme.space.xsmall
|
|
3539
|
+
maxLengthLabelMarginLeft: theme.space.xsmall,
|
|
3540
|
+
errorAndHelpTextContainerPaddingLeft: theme.space.medium
|
|
3450
3541
|
};
|
|
3451
3542
|
var fontSizes = {
|
|
3452
3543
|
text: theme.fontSizes.medium,
|
|
@@ -3547,13 +3638,15 @@ var getTypographyTheme = function getTypographyTheme(theme) {
|
|
|
3547
3638
|
small: theme.fontSizes.small,
|
|
3548
3639
|
medium: theme.fontSizes.medium,
|
|
3549
3640
|
large: theme.fontSizes.large,
|
|
3550
|
-
xlarge: theme.fontSizes.xlarge
|
|
3641
|
+
xlarge: theme.fontSizes.xlarge,
|
|
3642
|
+
xxxxxlarge: theme.fontSizes.xxxxxlarge
|
|
3551
3643
|
};
|
|
3552
3644
|
var lineHeights = {
|
|
3553
3645
|
small: theme.lineHeights.small,
|
|
3554
3646
|
medium: theme.lineHeights.medium,
|
|
3555
3647
|
large: theme.lineHeights.large,
|
|
3556
|
-
xlarge: theme.lineHeights.xlarge
|
|
3648
|
+
xlarge: theme.lineHeights.xlarge,
|
|
3649
|
+
xxxxxlarge: theme.lineHeights.xxxxxlarge
|
|
3557
3650
|
};
|
|
3558
3651
|
return {
|
|
3559
3652
|
colors: colors,
|
|
@@ -3563,53 +3656,6 @@ var getTypographyTheme = function getTypographyTheme(theme) {
|
|
|
3563
3656
|
};
|
|
3564
3657
|
};
|
|
3565
3658
|
|
|
3566
|
-
var getListTheme = function getListTheme(theme) {
|
|
3567
|
-
var colors = {
|
|
3568
|
-
checkedListItemContainerBackground: theme.colors.primaryBackground,
|
|
3569
|
-
listItemContainerBackground: theme.colors.platformBackground,
|
|
3570
|
-
leadingStatus: {
|
|
3571
|
-
danger: theme.colors.danger,
|
|
3572
|
-
info: theme.colors.infoLight,
|
|
3573
|
-
success: theme.colors.successDark,
|
|
3574
|
-
warning: theme.colors.warningLight,
|
|
3575
|
-
archived: theme.colors.archived
|
|
3576
|
-
}
|
|
3577
|
-
};
|
|
3578
|
-
var space = {
|
|
3579
|
-
listItemContainerPadding: theme.space.medium,
|
|
3580
|
-
leadingStatusMarginRight: theme.space.small,
|
|
3581
|
-
prefixContainerMarginRight: theme.space.small,
|
|
3582
|
-
suffixContainerMarginLeft: theme.space.small
|
|
3583
|
-
};
|
|
3584
|
-
var radii = {
|
|
3585
|
-
card: theme.radii.medium,
|
|
3586
|
-
cardShadow: theme.radii.base,
|
|
3587
|
-
leadingStatus: theme.radii.rounded
|
|
3588
|
-
};
|
|
3589
|
-
var offsets = {
|
|
3590
|
-
cardShadow: {
|
|
3591
|
-
width: 0,
|
|
3592
|
-
height: 2
|
|
3593
|
-
}
|
|
3594
|
-
};
|
|
3595
|
-
var widths = {
|
|
3596
|
-
leadingStatus: 8
|
|
3597
|
-
};
|
|
3598
|
-
var opacity = {
|
|
3599
|
-
disabled: 0.38,
|
|
3600
|
-
enabled: 1,
|
|
3601
|
-
cardShadow: 1
|
|
3602
|
-
};
|
|
3603
|
-
return {
|
|
3604
|
-
colors: colors,
|
|
3605
|
-
space: space,
|
|
3606
|
-
radii: radii,
|
|
3607
|
-
offsets: offsets,
|
|
3608
|
-
widths: widths,
|
|
3609
|
-
opacity: opacity
|
|
3610
|
-
};
|
|
3611
|
-
};
|
|
3612
|
-
|
|
3613
3659
|
var getTheme = function getTheme() {
|
|
3614
3660
|
var scale = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : scale$1;
|
|
3615
3661
|
var systemPallete = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : systemPalette;
|
|
@@ -3629,6 +3675,8 @@ var getTheme = function getTheme() {
|
|
|
3629
3675
|
drawer: getDrawerTheme(globalTheme),
|
|
3630
3676
|
fab: getFABTheme(globalTheme),
|
|
3631
3677
|
icon: getIconTheme(globalTheme),
|
|
3678
|
+
list: getListTheme(globalTheme),
|
|
3679
|
+
pinInput: getPinInputTheme(globalTheme),
|
|
3632
3680
|
progress: getProgressTheme(globalTheme),
|
|
3633
3681
|
radio: getRadioTheme(globalTheme),
|
|
3634
3682
|
sectionHeading: getSectionHeadingTheme(globalTheme),
|
|
@@ -3640,8 +3688,7 @@ var getTheme = function getTheme() {
|
|
|
3640
3688
|
textInput: getTextInputTheme(globalTheme),
|
|
3641
3689
|
toast: getToastTheme(globalTheme),
|
|
3642
3690
|
toolbar: getToolbarTheme(globalTheme),
|
|
3643
|
-
typography: getTypographyTheme(globalTheme)
|
|
3644
|
-
list: getListTheme(globalTheme)
|
|
3691
|
+
typography: getTypographyTheme(globalTheme)
|
|
3645
3692
|
}
|
|
3646
3693
|
});
|
|
3647
3694
|
};
|
|
@@ -16102,7 +16149,7 @@ var Divider = function Divider(_ref) {
|
|
|
16102
16149
|
};
|
|
16103
16150
|
|
|
16104
16151
|
var AnimatedPressable$1 = Animated.createAnimatedComponent(Pressable);
|
|
16105
|
-
var StyledWrapper$
|
|
16152
|
+
var StyledWrapper$6 = index$5(View)(_objectSpread2(_objectSpread2({}, StyleSheet$1.absoluteFillObject), {}, {
|
|
16106
16153
|
flexDirection: 'column-reverse'
|
|
16107
16154
|
}));
|
|
16108
16155
|
var StyledBottomSheet = index$5(Animated.View)(function (_ref) {
|
|
@@ -16864,7 +16911,7 @@ var BottomSheet = function BottomSheet(_ref) {
|
|
|
16864
16911
|
transparent: true,
|
|
16865
16912
|
testID: testID,
|
|
16866
16913
|
onShow: onOpen
|
|
16867
|
-
}, /*#__PURE__*/React.createElement(StyledWrapper$
|
|
16914
|
+
}, /*#__PURE__*/React.createElement(StyledWrapper$6, {
|
|
16868
16915
|
pointerEvents: "box-none"
|
|
16869
16916
|
}, /*#__PURE__*/React.createElement(StyledBackdrop$2, {
|
|
16870
16917
|
style: {
|
|
@@ -16972,7 +17019,7 @@ var index$4 = Object.assign(Card, {
|
|
|
16972
17019
|
Data: DataCard
|
|
16973
17020
|
});
|
|
16974
17021
|
|
|
16975
|
-
var StyledWrapper$
|
|
17022
|
+
var StyledWrapper$5 = index$5(Animated.View)(function () {
|
|
16976
17023
|
return {
|
|
16977
17024
|
margin: 0,
|
|
16978
17025
|
padding: 0,
|
|
@@ -17032,7 +17079,7 @@ var Collapse = function Collapse(_ref) {
|
|
|
17032
17079
|
var height = _ref2.height;
|
|
17033
17080
|
setContentHeight(height);
|
|
17034
17081
|
}, [contentHeight]);
|
|
17035
|
-
return /*#__PURE__*/React.createElement(StyledWrapper$
|
|
17082
|
+
return /*#__PURE__*/React.createElement(StyledWrapper$5, {
|
|
17036
17083
|
style: [style, {
|
|
17037
17084
|
height: collapseAnim
|
|
17038
17085
|
}],
|
|
@@ -17044,7 +17091,7 @@ var Collapse = function Collapse(_ref) {
|
|
|
17044
17091
|
}, children)));
|
|
17045
17092
|
};
|
|
17046
17093
|
|
|
17047
|
-
var StyledWrapper$
|
|
17094
|
+
var StyledWrapper$4 = index$5(TouchableOpacity)(function (_ref) {
|
|
17048
17095
|
var theme = _ref.theme,
|
|
17049
17096
|
disabled = _ref.disabled;
|
|
17050
17097
|
return {
|
|
@@ -17066,7 +17113,7 @@ var CheckBox = function CheckBox(_ref) {
|
|
|
17066
17113
|
onPress = _ref.onPress,
|
|
17067
17114
|
style = _ref.style,
|
|
17068
17115
|
testID = _ref.testID;
|
|
17069
|
-
return /*#__PURE__*/React.createElement(StyledWrapper$
|
|
17116
|
+
return /*#__PURE__*/React.createElement(StyledWrapper$4, {
|
|
17070
17117
|
onPress: onPress,
|
|
17071
17118
|
disabled: disabled,
|
|
17072
17119
|
style: style,
|
|
@@ -17455,10 +17502,14 @@ var ActionGroup = function ActionGroup(_ref2) {
|
|
|
17455
17502
|
inputRange: [0, 1],
|
|
17456
17503
|
outputRange: [400, 0]
|
|
17457
17504
|
});
|
|
17458
|
-
var
|
|
17505
|
+
var interpolatedBackdropOpacityAnimation = tranlateXAnimation.current.interpolate({
|
|
17459
17506
|
inputRange: [0, 1],
|
|
17460
17507
|
outputRange: [0, 0.9]
|
|
17461
17508
|
});
|
|
17509
|
+
var interpolatedActionGroupOpacityAnimation = tranlateXAnimation.current.interpolate({
|
|
17510
|
+
inputRange: [0, 1],
|
|
17511
|
+
outputRange: [0, 1]
|
|
17512
|
+
});
|
|
17462
17513
|
return /*#__PURE__*/React.createElement(StyledContainer$1, {
|
|
17463
17514
|
testID: testID,
|
|
17464
17515
|
pointerEvents: "box-none",
|
|
@@ -17467,11 +17518,13 @@ var ActionGroup = function ActionGroup(_ref2) {
|
|
|
17467
17518
|
pointerEvents: active ? 'auto' : 'box-none',
|
|
17468
17519
|
testID: "back-drop",
|
|
17469
17520
|
style: {
|
|
17470
|
-
opacity:
|
|
17521
|
+
opacity: interpolatedBackdropOpacityAnimation
|
|
17471
17522
|
}
|
|
17472
17523
|
}), /*#__PURE__*/React.createElement(StyledActionGroupContainer, {
|
|
17524
|
+
pointerEvents: active ? 'auto' : 'none',
|
|
17473
17525
|
testID: "action-group",
|
|
17474
17526
|
style: {
|
|
17527
|
+
opacity: interpolatedActionGroupOpacityAnimation,
|
|
17475
17528
|
transform: [{
|
|
17476
17529
|
translateX: interpolatedTranlateXAnimation
|
|
17477
17530
|
}]
|
|
@@ -17683,6 +17736,227 @@ var List = {
|
|
|
17683
17736
|
BasicItem: BasicListItem
|
|
17684
17737
|
};
|
|
17685
17738
|
|
|
17739
|
+
var StyledWrapper$3 = index$5(View)(function () {
|
|
17740
|
+
return {
|
|
17741
|
+
alignContent: 'flex-start'
|
|
17742
|
+
};
|
|
17743
|
+
});
|
|
17744
|
+
var StyledPinWrapper = index$5(View)(function () {
|
|
17745
|
+
return {
|
|
17746
|
+
flexDirection: 'row'
|
|
17747
|
+
};
|
|
17748
|
+
});
|
|
17749
|
+
var StyledCell = index$5(View)(function (_ref) {
|
|
17750
|
+
var theme = _ref.theme,
|
|
17751
|
+
themeFocused = _ref.themeFocused,
|
|
17752
|
+
themeState = _ref.themeState;
|
|
17753
|
+
return {
|
|
17754
|
+
justifyContent: 'center',
|
|
17755
|
+
alignItems: 'center',
|
|
17756
|
+
width: theme.__hd__.pinInput.sizes.cellWidth,
|
|
17757
|
+
height: theme.__hd__.pinInput.sizes.cellHeight,
|
|
17758
|
+
borderWidth: themeFocused ? theme.__hd__.pinInput.borderWidths.focused : theme.__hd__.pinInput.borderWidths["default"],
|
|
17759
|
+
borderRadius: theme.__hd__.pinInput.radii.cell,
|
|
17760
|
+
borderColor: theme.__hd__.pinInput.colors[themeState]
|
|
17761
|
+
};
|
|
17762
|
+
});
|
|
17763
|
+
var StyledCellText = index$5(Text$1)(function (_ref2) {
|
|
17764
|
+
var theme = _ref2.theme,
|
|
17765
|
+
themeState = _ref2.themeState;
|
|
17766
|
+
return {
|
|
17767
|
+
fontFamily: theme.__hd__.pinInput.fonts.cellText,
|
|
17768
|
+
fontSize: theme.__hd__.pinInput.fontSizes.cellText,
|
|
17769
|
+
color: theme.__hd__.pinInput.colors[themeState]
|
|
17770
|
+
};
|
|
17771
|
+
});
|
|
17772
|
+
var StyledSpacer = index$5(View)(function (_ref3) {
|
|
17773
|
+
var theme = _ref3.theme;
|
|
17774
|
+
return {
|
|
17775
|
+
marginLeft: theme.__hd__.pinInput.space.spacer
|
|
17776
|
+
};
|
|
17777
|
+
});
|
|
17778
|
+
var StyledMask = index$5(View)(function (_ref4) {
|
|
17779
|
+
var theme = _ref4.theme,
|
|
17780
|
+
themeState = _ref4.themeState;
|
|
17781
|
+
return {
|
|
17782
|
+
width: theme.__hd__.pinInput.sizes.mask,
|
|
17783
|
+
height: theme.__hd__.pinInput.sizes.mask,
|
|
17784
|
+
borderWidth: theme.__hd__.pinInput.borderWidths["default"],
|
|
17785
|
+
borderRadius: theme.__hd__.pinInput.radii.mask,
|
|
17786
|
+
borderColor: theme.__hd__.pinInput.colors[themeState]
|
|
17787
|
+
};
|
|
17788
|
+
});
|
|
17789
|
+
var StyledFilledMask = index$5(View)(function (_ref5) {
|
|
17790
|
+
var theme = _ref5.theme,
|
|
17791
|
+
themeState = _ref5.themeState;
|
|
17792
|
+
return {
|
|
17793
|
+
width: theme.__hd__.pinInput.sizes.mask,
|
|
17794
|
+
height: theme.__hd__.pinInput.sizes.mask,
|
|
17795
|
+
borderWidth: theme.__hd__.pinInput.borderWidths["default"],
|
|
17796
|
+
borderRadius: theme.__hd__.pinInput.radii.mask,
|
|
17797
|
+
borderColor: theme.__hd__.pinInput.colors[themeState],
|
|
17798
|
+
backgroundColor: theme.__hd__.pinInput.colors[themeState]
|
|
17799
|
+
};
|
|
17800
|
+
});
|
|
17801
|
+
var StyledHiddenInput = index$5(TextInput$1)(function (_ref6) {
|
|
17802
|
+
var themePinLength = _ref6.themePinLength,
|
|
17803
|
+
theme = _ref6.theme;
|
|
17804
|
+
var cellWidth = theme.__hd__.pinInput.sizes.cellWidth;
|
|
17805
|
+
var spacerWidth = theme.__hd__.pinInput.space.spacer;
|
|
17806
|
+
return {
|
|
17807
|
+
position: 'absolute',
|
|
17808
|
+
opacity: 0,
|
|
17809
|
+
left: 0,
|
|
17810
|
+
top: 0,
|
|
17811
|
+
width: themePinLength * cellWidth + (themePinLength - 1) * spacerWidth,
|
|
17812
|
+
height: '100%'
|
|
17813
|
+
};
|
|
17814
|
+
});
|
|
17815
|
+
var StyledErrorContainer$1 = index$5(View)(function (_ref7) {
|
|
17816
|
+
var theme = _ref7.theme;
|
|
17817
|
+
return {
|
|
17818
|
+
flexDirection: 'row',
|
|
17819
|
+
paddingTop: theme.__hd__.pinInput.space.errorMessagePadding
|
|
17820
|
+
};
|
|
17821
|
+
});
|
|
17822
|
+
var StyledErrorMessage = index$5(Text$1)(function (_ref8) {
|
|
17823
|
+
var theme = _ref8.theme;
|
|
17824
|
+
return {
|
|
17825
|
+
fontFamily: theme.__hd__.pinInput.fonts.errorMessage,
|
|
17826
|
+
fontSize: theme.__hd__.pinInput.fontSizes.errorMessage,
|
|
17827
|
+
color: theme.__hd__.pinInput.colors.error,
|
|
17828
|
+
paddingLeft: theme.__hd__.pinInput.space.errorMessagePadding
|
|
17829
|
+
};
|
|
17830
|
+
});
|
|
17831
|
+
|
|
17832
|
+
function PinCell(_ref) {
|
|
17833
|
+
var value = _ref.value,
|
|
17834
|
+
_ref$secure = _ref.secure,
|
|
17835
|
+
secure = _ref$secure === void 0 ? true : _ref$secure,
|
|
17836
|
+
_ref$focused = _ref.focused,
|
|
17837
|
+
focused = _ref$focused === void 0 ? false : _ref$focused,
|
|
17838
|
+
_ref$state = _ref.state,
|
|
17839
|
+
state = _ref$state === void 0 ? 'default' : _ref$state;
|
|
17840
|
+
return /*#__PURE__*/React.createElement(StyledCell, {
|
|
17841
|
+
themeFocused: focused,
|
|
17842
|
+
themeState: state
|
|
17843
|
+
}, value === '' && /*#__PURE__*/React.createElement(StyledMask, {
|
|
17844
|
+
themeState: state,
|
|
17845
|
+
testID: "pin-cell-mask"
|
|
17846
|
+
}), value !== '' && secure && /*#__PURE__*/React.createElement(StyledFilledMask, {
|
|
17847
|
+
themeState: state,
|
|
17848
|
+
testID: "pin-cell-filled-mask"
|
|
17849
|
+
}), value !== '' && !secure && /*#__PURE__*/React.createElement(StyledCellText, {
|
|
17850
|
+
themeState: state
|
|
17851
|
+
}, value));
|
|
17852
|
+
}
|
|
17853
|
+
|
|
17854
|
+
function getState(_ref) {
|
|
17855
|
+
var disabled = _ref.disabled,
|
|
17856
|
+
error = _ref.error;
|
|
17857
|
+
|
|
17858
|
+
if (disabled) {
|
|
17859
|
+
return 'disabled';
|
|
17860
|
+
}
|
|
17861
|
+
|
|
17862
|
+
if (error) {
|
|
17863
|
+
return 'error';
|
|
17864
|
+
}
|
|
17865
|
+
|
|
17866
|
+
return 'default';
|
|
17867
|
+
}
|
|
17868
|
+
|
|
17869
|
+
function PinInput(_ref2) {
|
|
17870
|
+
var _ref2$value = _ref2.value,
|
|
17871
|
+
value = _ref2$value === void 0 ? '' : _ref2$value,
|
|
17872
|
+
onChangeText = _ref2.onChangeText,
|
|
17873
|
+
onFulfill = _ref2.onFulfill,
|
|
17874
|
+
_ref2$length = _ref2.length,
|
|
17875
|
+
length = _ref2$length === void 0 ? 4 : _ref2$length,
|
|
17876
|
+
_ref2$disabled = _ref2.disabled,
|
|
17877
|
+
disabled = _ref2$disabled === void 0 ? false : _ref2$disabled,
|
|
17878
|
+
_ref2$secure = _ref2.secure,
|
|
17879
|
+
secure = _ref2$secure === void 0 ? true : _ref2$secure,
|
|
17880
|
+
_ref2$autoFocus = _ref2.autoFocus,
|
|
17881
|
+
autoFocus = _ref2$autoFocus === void 0 ? false : _ref2$autoFocus,
|
|
17882
|
+
error = _ref2.error,
|
|
17883
|
+
style = _ref2.style,
|
|
17884
|
+
testID = _ref2.testID;
|
|
17885
|
+
var inputRef = useRef(null);
|
|
17886
|
+
|
|
17887
|
+
var _useState = useState(autoFocus),
|
|
17888
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
17889
|
+
focused = _useState2[0],
|
|
17890
|
+
setFocused = _useState2[1];
|
|
17891
|
+
|
|
17892
|
+
var state = getState({
|
|
17893
|
+
disabled: disabled,
|
|
17894
|
+
error: error
|
|
17895
|
+
});
|
|
17896
|
+
var focus = useCallback(function () {
|
|
17897
|
+
if (inputRef !== null && inputRef !== void 0 && inputRef.current) {
|
|
17898
|
+
inputRef.current.focus();
|
|
17899
|
+
setFocused(true);
|
|
17900
|
+
}
|
|
17901
|
+
}, []);
|
|
17902
|
+
var blur = useCallback(function () {
|
|
17903
|
+
if (inputRef !== null && inputRef !== void 0 && inputRef.current) {
|
|
17904
|
+
inputRef.current.blur();
|
|
17905
|
+
setFocused(false);
|
|
17906
|
+
}
|
|
17907
|
+
}, []);
|
|
17908
|
+
var changeText = useCallback(function (text) {
|
|
17909
|
+
var pin = (text.match(/[0-9]/g) || []).join('');
|
|
17910
|
+
|
|
17911
|
+
if (onChangeText) {
|
|
17912
|
+
onChangeText(pin);
|
|
17913
|
+
}
|
|
17914
|
+
|
|
17915
|
+
if (pin.length === length && onFulfill) {
|
|
17916
|
+
onFulfill(pin);
|
|
17917
|
+
}
|
|
17918
|
+
}, []);
|
|
17919
|
+
useEffect(function () {
|
|
17920
|
+
// Must run after animations for keyboard to automatically open
|
|
17921
|
+
if (autoFocus) {
|
|
17922
|
+
InteractionManager.runAfterInteractions(focus);
|
|
17923
|
+
}
|
|
17924
|
+
}, [inputRef]);
|
|
17925
|
+
return /*#__PURE__*/React.createElement(StyledWrapper$3, {
|
|
17926
|
+
style: style,
|
|
17927
|
+
testID: testID
|
|
17928
|
+
}, /*#__PURE__*/React.createElement(StyledPinWrapper, null, _toConsumableArray$1(Array(length).keys()).map(function (index) {
|
|
17929
|
+
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
17930
|
+
key: index
|
|
17931
|
+
}, index !== 0 && /*#__PURE__*/React.createElement(StyledSpacer, null), /*#__PURE__*/React.createElement(PinCell, {
|
|
17932
|
+
value: value.charAt(index),
|
|
17933
|
+
secure: secure,
|
|
17934
|
+
focused: focused && index === value.length,
|
|
17935
|
+
state: state
|
|
17936
|
+
}));
|
|
17937
|
+
})), state === 'error' && /*#__PURE__*/React.createElement(StyledErrorContainer$1, null, /*#__PURE__*/React.createElement(Icon, {
|
|
17938
|
+
icon: "circle-info",
|
|
17939
|
+
size: "xsmall",
|
|
17940
|
+
intent: "danger",
|
|
17941
|
+
testID: "pin-error-icon"
|
|
17942
|
+
}), /*#__PURE__*/React.createElement(StyledErrorMessage, null, error)), /*#__PURE__*/React.createElement(StyledHiddenInput, {
|
|
17943
|
+
themePinLength: length,
|
|
17944
|
+
ref: inputRef,
|
|
17945
|
+
value: value,
|
|
17946
|
+
onChangeText: changeText,
|
|
17947
|
+
secureTextEntry: secure,
|
|
17948
|
+
editable: !disabled,
|
|
17949
|
+
autoFocus: autoFocus,
|
|
17950
|
+
onFocus: focus,
|
|
17951
|
+
onBlur: blur,
|
|
17952
|
+
maxLength: length,
|
|
17953
|
+
keyboardType: "numeric",
|
|
17954
|
+
contextMenuHidden: true,
|
|
17955
|
+
caretHidden: true,
|
|
17956
|
+
testID: "pin-hidden-input"
|
|
17957
|
+
}));
|
|
17958
|
+
}
|
|
17959
|
+
|
|
17686
17960
|
var HalfCircleWrapper = index$5(View)(function (_ref) {
|
|
17687
17961
|
var theme = _ref.theme;
|
|
17688
17962
|
return {
|
|
@@ -18372,7 +18646,6 @@ var StyledAsteriskLabelInsideTextInput = index$5(Typography.Text)(function (_ref
|
|
|
18372
18646
|
var StyledErrorContainer = index$5(View)(function (_ref7) {
|
|
18373
18647
|
var theme = _ref7.theme;
|
|
18374
18648
|
return {
|
|
18375
|
-
marginLeft: theme.__hd__.textInput.space.errorContainerMarginLeft,
|
|
18376
18649
|
marginRight: theme.__hd__.textInput.space.errorContainerMarginRight,
|
|
18377
18650
|
flexDirection: 'row',
|
|
18378
18651
|
alignItems: 'center',
|
|
@@ -18404,8 +18677,7 @@ var StyledMaxLengthMessage = index$5(Typography.Text)(function (_ref9) {
|
|
|
18404
18677
|
var StyledHelperText = index$5(Typography.Text)(function (_ref10) {
|
|
18405
18678
|
var theme = _ref10.theme;
|
|
18406
18679
|
return {
|
|
18407
|
-
fontSize: theme.__hd__.textInput.fontSizes.error
|
|
18408
|
-
marginLeft: theme.__hd__.textInput.space.errorMarginLeft
|
|
18680
|
+
fontSize: theme.__hd__.textInput.fontSizes.error
|
|
18409
18681
|
};
|
|
18410
18682
|
});
|
|
18411
18683
|
var StyledTextInput = index$5(TextInput$1)(function (_ref11) {
|
|
@@ -18445,9 +18717,14 @@ var StyledTextInputAndLabelContainer = index$5(View)(function () {
|
|
|
18445
18717
|
flexGrow: 2
|
|
18446
18718
|
};
|
|
18447
18719
|
});
|
|
18448
|
-
var StyledErrorAndHelpTextContainer = index$5(View)(function () {
|
|
18720
|
+
var StyledErrorAndHelpTextContainer = index$5(View)(function (_ref14) {
|
|
18721
|
+
var theme = _ref14.theme;
|
|
18722
|
+
return {
|
|
18723
|
+
paddingLeft: theme.__hd__.textInput.space.errorAndHelpTextContainerPaddingLeft
|
|
18724
|
+
};
|
|
18725
|
+
});
|
|
18726
|
+
var StyledErrorAndMaxLengthContainer = index$5(View)(function () {
|
|
18449
18727
|
return {
|
|
18450
|
-
flex: 1,
|
|
18451
18728
|
flexDirection: 'row',
|
|
18452
18729
|
justifyContent: 'space-between'
|
|
18453
18730
|
};
|
|
@@ -18485,6 +18762,8 @@ var getVariant = function getVariant(_ref) {
|
|
|
18485
18762
|
};
|
|
18486
18763
|
|
|
18487
18764
|
var TextInput = function TextInput(_ref2) {
|
|
18765
|
+
var _ref3;
|
|
18766
|
+
|
|
18488
18767
|
var label = _ref2.label,
|
|
18489
18768
|
prefix = _ref2.prefix,
|
|
18490
18769
|
suffix = _ref2.suffix,
|
|
@@ -18505,7 +18784,7 @@ var TextInput = function TextInput(_ref2) {
|
|
|
18505
18784
|
nativeProps = _objectWithoutProperties$1(_ref2, _excluded$1);
|
|
18506
18785
|
|
|
18507
18786
|
var textInputReference = useRef(null);
|
|
18508
|
-
var displayText = value
|
|
18787
|
+
var displayText = (_ref3 = value !== undefined ? value : defaultValue) !== null && _ref3 !== void 0 ? _ref3 : '';
|
|
18509
18788
|
var isEmptyValue = displayText.length === 0;
|
|
18510
18789
|
|
|
18511
18790
|
var _React$useState = React.useState(false),
|
|
@@ -18533,7 +18812,7 @@ var TextInput = function TextInput(_ref2) {
|
|
|
18533
18812
|
}, required && /*#__PURE__*/React.createElement(StyledAsteriskLabel, {
|
|
18534
18813
|
themeVariant: variant,
|
|
18535
18814
|
fontSize: "small"
|
|
18536
|
-
}, "*"), /*#__PURE__*/React.createElement(StyledLabel, {
|
|
18815
|
+
}, "*"), !!label && /*#__PURE__*/React.createElement(StyledLabel, {
|
|
18537
18816
|
nativeID: accessibilityLabelledBy,
|
|
18538
18817
|
testID: "input-label",
|
|
18539
18818
|
fontSize: "small",
|
|
@@ -18547,7 +18826,7 @@ var TextInput = function TextInput(_ref2) {
|
|
|
18547
18826
|
pointerEvents: "none"
|
|
18548
18827
|
}, required && /*#__PURE__*/React.createElement(StyledAsteriskLabelInsideTextInput, {
|
|
18549
18828
|
themeVariant: variant
|
|
18550
|
-
}, "*"), /*#__PURE__*/React.createElement(StyledLabelInsideTextInput, {
|
|
18829
|
+
}, "*"), !!label && /*#__PURE__*/React.createElement(StyledLabelInsideTextInput, {
|
|
18551
18830
|
nativeID: accessibilityLabelledBy,
|
|
18552
18831
|
testID: "input-label",
|
|
18553
18832
|
fontSize: "medium",
|
|
@@ -18593,7 +18872,7 @@ var TextInput = function TextInput(_ref2) {
|
|
|
18593
18872
|
testID: "input-suffix",
|
|
18594
18873
|
icon: suffix,
|
|
18595
18874
|
size: "xsmall"
|
|
18596
|
-
}) : suffix), /*#__PURE__*/React.createElement(StyledErrorAndHelpTextContainer, null, error && /*#__PURE__*/React.createElement(StyledErrorContainer, null, /*#__PURE__*/React.createElement(Icon, {
|
|
18875
|
+
}) : suffix), /*#__PURE__*/React.createElement(StyledErrorAndHelpTextContainer, null, /*#__PURE__*/React.createElement(StyledErrorAndMaxLengthContainer, null, error && /*#__PURE__*/React.createElement(StyledErrorContainer, null, /*#__PURE__*/React.createElement(Icon, {
|
|
18597
18876
|
testID: "input-error-icon",
|
|
18598
18877
|
icon: "circle-info",
|
|
18599
18878
|
size: "xsmall",
|
|
@@ -18603,7 +18882,7 @@ var TextInput = function TextInput(_ref2) {
|
|
|
18603
18882
|
}, error)), shouldShowMaxLength && /*#__PURE__*/React.createElement(StyledMaxLengthMessage, {
|
|
18604
18883
|
themeVariant: variant,
|
|
18605
18884
|
fontSize: "small"
|
|
18606
|
-
}, displayText.length, "/", maxLength), helpText && /*#__PURE__*/React.createElement(StyledHelperText, null, helpText)));
|
|
18885
|
+
}, displayText.length, "/", maxLength)), helpText && /*#__PURE__*/React.createElement(StyledHelperText, null, helpText)));
|
|
18607
18886
|
};
|
|
18608
18887
|
|
|
18609
18888
|
function MultiSelect(_ref) {
|
|
@@ -18614,7 +18893,6 @@ function MultiSelect(_ref) {
|
|
|
18614
18893
|
label = _ref.label,
|
|
18615
18894
|
footerLabel = _ref.footerLabel,
|
|
18616
18895
|
onConfirm = _ref.onConfirm;
|
|
18617
|
-
var theme = useTheme$1();
|
|
18618
18896
|
|
|
18619
18897
|
var _useState = useState(false),
|
|
18620
18898
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -18635,23 +18913,16 @@ function MultiSelect(_ref) {
|
|
|
18635
18913
|
onPress: function onPress() {
|
|
18636
18914
|
return setOpen(true);
|
|
18637
18915
|
}
|
|
18916
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
18917
|
+
pointerEvents: "none"
|
|
18638
18918
|
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
18639
18919
|
label: label,
|
|
18640
18920
|
value: displayedValue,
|
|
18641
|
-
onPressIn: function onPressIn() {
|
|
18642
|
-
return setOpen(true);
|
|
18643
|
-
},
|
|
18644
|
-
editable: false // when input is not editable on Android, the text color is gray
|
|
18645
|
-
// hence, adding this to make the text color the same as iOS
|
|
18646
|
-
,
|
|
18647
|
-
textStyle: {
|
|
18648
|
-
color: theme.colors.text
|
|
18649
|
-
},
|
|
18650
18921
|
suffix: "arrow-down",
|
|
18651
18922
|
multiline: true,
|
|
18652
18923
|
style: style,
|
|
18653
18924
|
testID: testID
|
|
18654
|
-
}), /*#__PURE__*/React.createElement(BottomSheet, {
|
|
18925
|
+
})), /*#__PURE__*/React.createElement(BottomSheet, {
|
|
18655
18926
|
open: open,
|
|
18656
18927
|
onRequestClose: function onRequestClose() {
|
|
18657
18928
|
return setOpen(false);
|
|
@@ -18721,7 +18992,6 @@ var SingleSelect = function SingleSelect(_ref) {
|
|
|
18721
18992
|
style = _ref.style,
|
|
18722
18993
|
label = _ref.label,
|
|
18723
18994
|
onConfirm = _ref.onConfirm;
|
|
18724
|
-
var theme = useTheme$1();
|
|
18725
18995
|
|
|
18726
18996
|
var _useState = useState(false),
|
|
18727
18997
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -18740,23 +19010,16 @@ var SingleSelect = function SingleSelect(_ref) {
|
|
|
18740
19010
|
onPress: function onPress() {
|
|
18741
19011
|
return setOpen(true);
|
|
18742
19012
|
}
|
|
19013
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
19014
|
+
pointerEvents: "none"
|
|
18743
19015
|
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
18744
19016
|
label: label,
|
|
18745
19017
|
value: displayedValue,
|
|
18746
|
-
onPressIn: function onPressIn() {
|
|
18747
|
-
return setOpen(true);
|
|
18748
|
-
},
|
|
18749
|
-
editable: false // when input is not editable on Android, the text color is gray
|
|
18750
|
-
// hence, adding this to make the text color the same as iOS
|
|
18751
|
-
,
|
|
18752
|
-
textStyle: {
|
|
18753
|
-
color: theme.colors.text
|
|
18754
|
-
},
|
|
18755
19018
|
suffix: "arrow-down",
|
|
18756
19019
|
multiline: true,
|
|
18757
19020
|
style: style,
|
|
18758
19021
|
testID: testID
|
|
18759
|
-
}), /*#__PURE__*/React.createElement(BottomSheet, {
|
|
19022
|
+
})), /*#__PURE__*/React.createElement(BottomSheet, {
|
|
18760
19023
|
open: open,
|
|
18761
19024
|
onRequestClose: function onRequestClose() {
|
|
18762
19025
|
return setOpen(false);
|
|
@@ -19926,4 +20189,4 @@ var index = Object.assign(Toolbar, {
|
|
|
19926
20189
|
Group: ToolbarGroup
|
|
19927
20190
|
});
|
|
19928
20191
|
|
|
19929
|
-
export { Alert, Avatar, Badge$1 as Badge, BottomNavigation, BottomSheet, CompoundButton as Button, index$4 as Card, CheckBox as Checkbox, Collapse, ContentNavigator, Divider, Drawer, index$3 as FAB, Icon, List, Progress, CompoundRadio as Radio, SectionHeading, index$2 as Select, Spinner, Switch, index$1 as Tabs, Tag, TextInput, ThemeProvider, Toast, index as Toolbar, Typography, getTheme, scale, theme, useTheme };
|
|
20192
|
+
export { Alert, Avatar, Badge$1 as Badge, BottomNavigation, BottomSheet, CompoundButton as Button, index$4 as Card, CheckBox as Checkbox, Collapse, ContentNavigator, Divider, Drawer, index$3 as FAB, Icon, List, PinInput, Progress, CompoundRadio as Radio, SectionHeading, index$2 as Select, Spinner, Switch, index$1 as Tabs, Tag, TextInput, ThemeProvider, Toast, index as Toolbar, Typography, getTheme, scale, theme, useTheme };
|