@hero-design/rn 7.2.2 → 7.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/.expo/packager-info.json +1 -1
- package/.expo/prebuild/cached-packages.json +4 -0
- package/.expo/xcodebuild-error.log +2 -0
- package/.expo/xcodebuild.log +11199 -0
- package/.turbo/turbo-build.log +8 -8
- package/.turbo/turbo-build:types.log +2 -0
- package/.turbo/turbo-test.log +131 -0
- package/.turbo/turbo-type-check.log +7 -0
- package/es/index.js +2409 -468
- package/jest.config.js +1 -1
- package/lib/index.js +2430 -484
- package/package.json +4 -2
- package/playground/components/Avatar.tsx +102 -0
- package/playground/components/Badge.tsx +146 -9
- package/playground/components/Button.tsx +138 -35
- package/playground/components/Card.tsx +36 -1
- package/playground/components/Collapse.tsx +99 -0
- package/playground/components/Drawer.tsx +32 -0
- package/playground/components/FAB.tsx +15 -0
- package/playground/components/IconButton.tsx +67 -0
- package/playground/components/Progress.tsx +95 -0
- package/playground/components/Tabs.tsx +106 -14
- package/playground/components/Tag.tsx +45 -0
- package/playground/index.tsx +18 -0
- package/src/components/Avatar/StyledAvatar.tsx +61 -0
- package/src/components/Avatar/__tests__/StyledAvatar.spec.tsx +48 -0
- package/src/components/Avatar/__tests__/__snapshots__/StyledAvatar.spec.tsx.snap +87 -0
- package/src/components/Avatar/__tests__/__snapshots__/index.spec.tsx.snap +88 -0
- package/src/components/Avatar/__tests__/index.spec.tsx +26 -0
- package/src/components/Avatar/index.tsx +71 -0
- package/src/components/Badge/Status.tsx +77 -0
- package/src/components/Badge/StyledBadge.tsx +38 -26
- package/src/components/Badge/__tests__/Badge.spec.tsx +16 -0
- package/src/components/Badge/__tests__/Status.spec.tsx +27 -0
- package/src/components/Badge/__tests__/__snapshots__/Badge.spec.tsx.snap +133 -52
- package/src/components/Badge/__tests__/__snapshots__/Status.spec.tsx.snap +89 -0
- package/src/components/Badge/index.tsx +77 -19
- package/src/components/Button/Button.tsx +163 -0
- package/src/components/Button/LoadingIndicator/StyledLoadingIndicator.tsx +58 -0
- package/src/components/Button/LoadingIndicator/__tests__/StyledLoadingIndicator.spec.tsx +20 -0
- package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/StyledLoadingIndicator.spec.tsx.snap +101 -0
- package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/index.spec.tsx.snap +606 -0
- package/src/components/Button/LoadingIndicator/__tests__/index.spec.tsx +24 -0
- package/src/components/Button/LoadingIndicator/index.tsx +140 -0
- package/src/components/Button/StyledButton.tsx +254 -0
- package/src/components/Button/__tests__/Button.spec.tsx +86 -0
- package/src/components/Button/__tests__/{index.spec.tsx → IconButton.spec.tsx} +0 -0
- package/src/components/Button/__tests__/StyledButton.spec.tsx +154 -0
- package/src/components/Button/__tests__/__snapshots__/{index.spec.tsx.snap → IconButton.spec.tsx.snap} +0 -0
- package/src/components/Button/__tests__/__snapshots__/StyledButton.spec.tsx.snap +895 -0
- package/src/components/Button/index.tsx +10 -2
- package/src/components/Card/StyledCard.tsx +27 -4
- package/src/components/Card/__tests__/StyledCard.spec.tsx +15 -3
- package/src/components/Card/__tests__/__snapshots__/StyledCard.spec.tsx.snap +34 -1
- package/src/components/Card/__tests__/index.spec.tsx +16 -21
- package/src/components/Card/index.tsx +15 -2
- package/src/components/Collapse/StyledCollapse.tsx +15 -0
- package/src/components/Collapse/__tests__/StyledCollapse.spec.tsx +26 -0
- package/src/components/Collapse/__tests__/__snapshots__/StyledCollapse.spec.tsx.snap +37 -0
- package/src/components/Collapse/__tests__/__snapshots__/index.spec.tsx.snap +84 -0
- package/src/components/Collapse/__tests__/index.spec.tsx +42 -0
- package/src/components/Collapse/index.tsx +109 -0
- package/src/components/Divider/index.tsx +1 -1
- package/src/components/Drawer/StyledDrawer.tsx +39 -0
- package/src/components/Drawer/__tests__/__snapshots__/index.spec.tsx.snap +244 -0
- package/src/components/Drawer/__tests__/index.spec.tsx +37 -0
- package/src/components/Drawer/index.tsx +93 -0
- package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +78 -62
- package/src/components/FAB/ActionGroup/__tests__/index.spec.tsx +2 -0
- package/src/components/FAB/ActionGroup/index.tsx +13 -0
- package/src/components/FAB/FAB.tsx +63 -13
- package/src/components/FAB/StyledFAB.tsx +25 -6
- package/src/components/FAB/__tests__/__snapshots__/AnimatedFABIcon.spec.tsx.snap +6 -2
- package/src/components/FAB/__tests__/__snapshots__/StyledFAB.spec.tsx.snap +7 -3
- package/src/components/FAB/__tests__/__snapshots__/index.spec.tsx.snap +88 -6
- package/src/components/FAB/__tests__/index.spec.tsx +16 -0
- package/src/components/Progress/ProgressBar.tsx +73 -0
- package/src/components/Progress/ProgressCircle.tsx +165 -0
- package/src/components/Progress/StyledProgressBar.tsx +21 -0
- package/src/components/Progress/StyledProgressCircle.tsx +66 -0
- package/src/components/Progress/__tests__/__snapshots__/index.spec.js.snap +641 -0
- package/src/components/Progress/__tests__/index.spec.js +46 -0
- package/src/components/Progress/index.tsx +6 -0
- package/src/components/Progress/types.ts +1 -0
- package/src/components/Tabs/ActiveTabIndicator.tsx +37 -0
- package/src/components/Tabs/ScrollableTabs.tsx +216 -0
- package/src/components/Tabs/StyledScrollableTabs.tsx +60 -0
- package/src/components/Tabs/StyledTabs.tsx +30 -44
- package/src/components/Tabs/__tests__/ScrollableTabs.spec.tsx +84 -0
- package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +591 -0
- package/src/components/Tabs/__tests__/__snapshots__/index.spec.tsx.snap +317 -224
- package/src/components/Tabs/__tests__/index.spec.tsx +22 -21
- package/src/components/Tabs/index.tsx +155 -114
- package/src/components/Tabs/utils.ts +13 -0
- package/src/components/Tag/StyledTag.tsx +35 -0
- package/src/components/Tag/__tests__/Tag.spec.tsx +41 -0
- package/src/components/Tag/__tests__/__snapshots__/Tag.spec.tsx.snap +153 -0
- package/src/components/Tag/index.tsx +41 -0
- package/src/components/Typography/Text/index.tsx +1 -1
- package/src/index.ts +10 -0
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +182 -20
- package/src/theme/components/avatar.ts +40 -0
- package/src/theme/components/badge.ts +14 -16
- package/src/theme/components/button.ts +57 -0
- package/src/theme/components/card.ts +8 -2
- package/src/theme/components/drawer.ts +24 -0
- package/src/theme/components/fab.ts +9 -2
- package/src/theme/components/progress.ts +27 -0
- package/src/theme/components/tabs.ts +22 -7
- package/src/theme/components/tag.ts +39 -0
- package/src/theme/global/borders.ts +13 -1
- package/src/theme/global/colors.ts +6 -1
- package/src/theme/global/index.ts +3 -1
- package/src/theme/global/scale.ts +3 -0
- package/src/theme/index.ts +16 -1
- package/src/utils/hooks.ts +10 -0
- package/testUtils/setup.tsx +43 -0
- package/types/playground/components/Avatar.d.ts +2 -0
- package/types/playground/components/Badge.d.ts +0 -0
- package/types/playground/components/BottomNavigation.d.ts +0 -0
- package/types/playground/components/Button.d.ts +0 -0
- package/types/playground/components/Card.d.ts +0 -0
- package/types/playground/components/Collapse.d.ts +2 -0
- package/types/playground/components/Divider.d.ts +0 -0
- package/types/playground/components/Drawer.d.ts +2 -0
- package/types/playground/components/FAB.d.ts +0 -0
- package/types/playground/components/Icon.d.ts +0 -0
- package/types/playground/components/IconButton.d.ts +2 -0
- package/types/playground/components/Progress.d.ts +2 -0
- package/types/playground/components/Tabs.d.ts +0 -0
- package/types/playground/components/Tag.d.ts +2 -0
- package/types/playground/components/Typography.d.ts +0 -0
- package/types/playground/index.d.ts +0 -0
- package/types/src/components/Avatar/StyledAvatar.d.ts +46 -0
- package/types/src/components/{BottomNavigation/__tests__/BottomNavigation.spec.d.ts → Avatar/__tests__/StyledAvatar.spec.d.ts} +0 -0
- package/types/src/components/{Card/__tests__/Card.spec.d.ts → Avatar/__tests__/index.spec.d.ts} +0 -0
- package/types/src/components/Avatar/index.d.ts +25 -0
- package/types/src/components/Badge/Status.d.ts +24 -0
- package/types/src/components/Badge/StyledBadge.d.ts +17 -9
- package/types/src/components/Badge/__tests__/Badge.spec.d.ts +0 -0
- package/types/src/components/{FAB/__tests__/StyledFABContainer.spec.d.ts → Badge/__tests__/Status.spec.d.ts} +0 -0
- package/types/src/components/Badge/index.d.ts +17 -7
- package/types/src/components/BottomNavigation/StyledBottomNavigation.d.ts +0 -0
- package/types/src/components/BottomNavigation/__tests__/index.spec.d.ts +0 -0
- package/types/src/components/BottomNavigation/index.d.ts +0 -0
- package/types/src/components/Button/Button.d.ts +57 -0
- package/types/src/components/Button/IconButton.d.ts +0 -0
- package/types/src/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +20 -0
- package/types/src/components/{FAB/__tests__/StyledFABIcon.spec.d.ts → Button/LoadingIndicator/__tests__/StyledLoadingIndicator.spec.d.ts} +0 -0
- package/types/src/components/{Icon/__tests__/Icon.spec.d.ts → Button/LoadingIndicator/__tests__/index.spec.d.ts} +0 -0
- package/types/src/components/Button/LoadingIndicator/index.d.ts +26 -0
- package/types/src/components/Button/StyledButton.d.ts +40 -0
- package/types/src/components/{Tabs/__tests__/Tabs.spec.d.ts → Button/__tests__/Button.spec.d.ts} +0 -0
- package/types/src/components/Button/__tests__/IconButton.spec.d.ts +1 -0
- package/types/src/components/Button/__tests__/StyledButton.spec.d.ts +1 -0
- package/types/src/components/Button/__tests__/index.spec.d.ts +0 -0
- package/types/src/components/Button/index.d.ts +8 -4
- package/types/src/components/Card/StyledCard.d.ts +9 -1
- package/types/src/components/Card/__tests__/StyledCard.spec.d.ts +0 -0
- package/types/src/components/Card/__tests__/index.spec.d.ts +0 -0
- package/types/src/components/Card/index.d.ts +5 -1
- package/types/src/components/Collapse/StyledCollapse.d.ts +15 -0
- package/types/src/components/Collapse/__tests__/StyledCollapse.spec.d.ts +1 -0
- package/types/src/components/Collapse/__tests__/index.spec.d.ts +1 -0
- package/types/src/components/Collapse/index.d.ts +23 -0
- package/types/src/components/Divider/StyledDivider.d.ts +0 -0
- package/types/src/components/Divider/__tests__/StyledDivider.spec.d.ts +0 -0
- package/types/src/components/Divider/index.d.ts +0 -0
- package/types/src/components/Drawer/StyledDrawer.d.ts +25 -0
- package/types/src/components/Drawer/__tests__/index.spec.d.ts +1 -0
- package/types/src/components/Drawer/index.d.ts +25 -0
- package/types/src/components/FAB/ActionGroup/ActionItem.d.ts +0 -0
- package/types/src/components/FAB/ActionGroup/StyledActionGroup.d.ts +0 -0
- package/types/src/components/FAB/ActionGroup/StyledActionItem.d.ts +0 -0
- package/types/src/components/FAB/ActionGroup/__tests__/index.spec.d.ts +0 -0
- package/types/src/components/FAB/ActionGroup/index.d.ts +5 -1
- package/types/src/components/FAB/AnimatedFABIcon.d.ts +0 -0
- package/types/src/components/FAB/FAB.d.ts +5 -1
- package/types/src/components/FAB/StyledFAB.d.ts +8 -2
- package/types/src/components/FAB/__tests__/AnimatedFABIcon.spec.d.ts +0 -0
- package/types/src/components/FAB/__tests__/StyledFAB.spec.d.ts +0 -0
- package/types/src/components/FAB/__tests__/index.spec.d.ts +0 -0
- package/types/src/components/FAB/index.d.ts +2 -2
- package/types/src/components/Icon/HeroIcon/index.d.ts +0 -0
- package/types/src/components/Icon/IconList.d.ts +0 -0
- package/types/src/components/Icon/__tests__/index.spec.d.ts +0 -0
- package/types/src/components/Icon/index.d.ts +0 -0
- package/types/src/components/Icon/utils.d.ts +1 -1
- package/types/src/components/Progress/ProgressBar.d.ts +18 -0
- package/types/src/components/Progress/ProgressCircle.d.ts +18 -0
- package/types/src/components/Progress/StyledProgressBar.d.ts +18 -0
- package/types/src/components/Progress/StyledProgressCircle.d.ts +38 -0
- package/types/src/components/Progress/__tests__/index.spec.d.ts +1 -0
- package/types/src/components/Progress/index.d.ts +5 -0
- package/types/src/components/Progress/types.d.ts +1 -0
- package/types/src/components/Tabs/ActiveTabIndicator.d.ts +8 -0
- package/types/src/components/Tabs/ScrollableTabs.d.ts +3 -0
- package/types/src/components/Tabs/StyledScrollableTabs.d.ts +61 -0
- package/types/src/components/Tabs/StyledTabs.d.ts +22 -22
- package/types/src/components/Tabs/__tests__/ScrollableTabs.spec.d.ts +1 -0
- package/types/src/components/Tabs/__tests__/index.spec.d.ts +0 -0
- package/types/src/components/Tabs/index.d.ts +28 -19
- package/types/src/components/Tabs/utils.d.ts +2 -0
- package/types/src/components/Tag/StyledTag.d.ts +20 -0
- package/types/src/components/Tag/__tests__/Tag.spec.d.ts +1 -0
- package/types/src/components/Tag/index.d.ts +21 -0
- package/types/src/components/Typography/Text/StyledText.d.ts +0 -0
- package/types/src/components/Typography/Text/__tests__/StyledText.spec.d.ts +0 -0
- package/types/src/components/Typography/Text/__tests__/index.spec.d.ts +0 -0
- package/types/src/components/Typography/Text/index.d.ts +0 -0
- package/types/src/components/Typography/index.d.ts +0 -0
- package/types/src/index.d.ts +6 -1
- package/types/src/testHelpers/renderWithTheme.d.ts +0 -0
- package/types/src/theme/__tests__/index.spec.d.ts +0 -0
- package/types/src/theme/components/avatar.d.ts +32 -0
- package/types/src/theme/components/badge.d.ts +12 -13
- package/types/src/theme/components/bottomNavigation.d.ts +0 -0
- package/types/src/theme/components/button.d.ts +37 -0
- package/types/src/theme/components/card.d.ts +5 -1
- package/types/src/theme/components/divider.d.ts +0 -0
- package/types/src/theme/components/drawer.d.ts +21 -0
- package/types/src/theme/components/fab.d.ts +8 -1
- package/types/src/theme/components/icon.d.ts +0 -0
- package/types/src/theme/components/progress.d.ts +21 -0
- package/types/src/theme/components/tabs.d.ts +14 -2
- package/types/src/theme/components/tag.d.ts +30 -0
- package/types/src/theme/components/typography.d.ts +0 -0
- package/types/src/theme/global/borders.d.ts +7 -1
- package/types/src/theme/global/colors.d.ts +6 -1
- package/types/src/theme/global/index.d.ts +7 -1
- package/types/src/theme/global/scale.d.ts +1 -0
- package/types/src/theme/global/space.d.ts +0 -0
- package/types/src/theme/global/typography.d.ts +0 -0
- package/types/src/theme/index.d.ts +10 -0
- package/types/src/types.d.ts +0 -0
- package/types/src/utils/__tests__/scale.spec.d.ts +0 -0
- package/types/src/utils/helpers.d.ts +0 -0
- package/types/src/utils/hooks.d.ts +1 -0
- package/types/src/utils/scale.d.ts +0 -0
- package/src/components/Card/__tests__/__snapshots__/index.spec.tsx.snap +0 -33
- package/testUtils/setup.ts +0 -18
- package/types/src/components/FAB/StyledFABContainer.d.ts +0 -3
- package/types/src/components/FAB/StyledFABIcon.d.ts +0 -3
- package/types/src/styled-components.d.ts +0 -6
package/es/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
import React, { useContext, createElement, createContext, forwardRef, useRef, useEffect } from 'react';
|
|
1
|
+
import * as ReactNative from 'react-native';
|
|
2
|
+
import ReactNative__default, { Dimensions, StyleSheet as StyleSheet$1, TouchableOpacity, View, Text as Text$1, Image, Animated, Platform, TouchableWithoutFeedback, Easing, Pressable, TouchableHighlight, requireNativeComponent, UIManager, I18nManager, Keyboard, FlatList } from 'react-native';
|
|
3
|
+
import React, { useContext, createElement, createContext, forwardRef, useRef, useEffect, useState, useCallback, Children } from 'react';
|
|
4
4
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
5
5
|
|
|
6
6
|
function ownKeys(object, enumerableOnly) {
|
|
@@ -20,7 +20,7 @@ function _objectSpread2(target) {
|
|
|
20
20
|
for (var i = 1; i < arguments.length; i++) {
|
|
21
21
|
var source = null != arguments[i] ? arguments[i] : {};
|
|
22
22
|
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
23
|
-
_defineProperty$
|
|
23
|
+
_defineProperty$2(target, key, source[key]);
|
|
24
24
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
25
25
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
26
26
|
});
|
|
@@ -39,7 +39,32 @@ function _typeof$2(obj) {
|
|
|
39
39
|
}, _typeof$2(obj);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
function
|
|
42
|
+
function _classCallCheck$1(instance, Constructor) {
|
|
43
|
+
if (!(instance instanceof Constructor)) {
|
|
44
|
+
throw new TypeError("Cannot call a class as a function");
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function _defineProperties$1(target, props) {
|
|
49
|
+
for (var i = 0; i < props.length; i++) {
|
|
50
|
+
var descriptor = props[i];
|
|
51
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
52
|
+
descriptor.configurable = true;
|
|
53
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
54
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function _createClass$1(Constructor, protoProps, staticProps) {
|
|
59
|
+
if (protoProps) _defineProperties$1(Constructor.prototype, protoProps);
|
|
60
|
+
if (staticProps) _defineProperties$1(Constructor, staticProps);
|
|
61
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
62
|
+
writable: false
|
|
63
|
+
});
|
|
64
|
+
return Constructor;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function _defineProperty$2(obj, key, value) {
|
|
43
68
|
if (key in obj) {
|
|
44
69
|
Object.defineProperty(obj, key, {
|
|
45
70
|
value: value,
|
|
@@ -54,8 +79,8 @@ function _defineProperty$1(obj, key, value) {
|
|
|
54
79
|
return obj;
|
|
55
80
|
}
|
|
56
81
|
|
|
57
|
-
function _extends$
|
|
58
|
-
_extends$
|
|
82
|
+
function _extends$3() {
|
|
83
|
+
_extends$3 = Object.assign || function (target) {
|
|
59
84
|
for (var i = 1; i < arguments.length; i++) {
|
|
60
85
|
var source = arguments[i];
|
|
61
86
|
|
|
@@ -69,7 +94,54 @@ function _extends$2() {
|
|
|
69
94
|
return target;
|
|
70
95
|
};
|
|
71
96
|
|
|
72
|
-
return _extends$
|
|
97
|
+
return _extends$3.apply(this, arguments);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function _inherits$1(subClass, superClass) {
|
|
101
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
102
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
106
|
+
constructor: {
|
|
107
|
+
value: subClass,
|
|
108
|
+
writable: true,
|
|
109
|
+
configurable: true
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
Object.defineProperty(subClass, "prototype", {
|
|
113
|
+
writable: false
|
|
114
|
+
});
|
|
115
|
+
if (superClass) _setPrototypeOf$1(subClass, superClass);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function _getPrototypeOf$1(o) {
|
|
119
|
+
_getPrototypeOf$1 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
120
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
|
121
|
+
};
|
|
122
|
+
return _getPrototypeOf$1(o);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function _setPrototypeOf$1(o, p) {
|
|
126
|
+
_setPrototypeOf$1 = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
127
|
+
o.__proto__ = p;
|
|
128
|
+
return o;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
return _setPrototypeOf$1(o, p);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function _isNativeReflectConstruct() {
|
|
135
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
136
|
+
if (Reflect.construct.sham) return false;
|
|
137
|
+
if (typeof Proxy === "function") return true;
|
|
138
|
+
|
|
139
|
+
try {
|
|
140
|
+
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
141
|
+
return true;
|
|
142
|
+
} catch (e) {
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
73
145
|
}
|
|
74
146
|
|
|
75
147
|
function _objectWithoutPropertiesLoose$1(source, excluded) {
|
|
@@ -108,6 +180,43 @@ function _objectWithoutProperties$1(source, excluded) {
|
|
|
108
180
|
return target;
|
|
109
181
|
}
|
|
110
182
|
|
|
183
|
+
function _assertThisInitialized$1(self) {
|
|
184
|
+
if (self === void 0) {
|
|
185
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
return self;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function _possibleConstructorReturn$1(self, call) {
|
|
192
|
+
if (call && (typeof call === "object" || typeof call === "function")) {
|
|
193
|
+
return call;
|
|
194
|
+
} else if (call !== void 0) {
|
|
195
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
return _assertThisInitialized$1(self);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
function _createSuper(Derived) {
|
|
202
|
+
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
203
|
+
|
|
204
|
+
return function _createSuperInternal() {
|
|
205
|
+
var Super = _getPrototypeOf$1(Derived),
|
|
206
|
+
result;
|
|
207
|
+
|
|
208
|
+
if (hasNativeReflectConstruct) {
|
|
209
|
+
var NewTarget = _getPrototypeOf$1(this).constructor;
|
|
210
|
+
|
|
211
|
+
result = Reflect.construct(Super, arguments, NewTarget);
|
|
212
|
+
} else {
|
|
213
|
+
result = Super.apply(this, arguments);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
return _possibleConstructorReturn$1(this, result);
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
|
|
111
220
|
function _slicedToArray(arr, i) {
|
|
112
221
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
113
222
|
}
|
|
@@ -1187,6 +1296,21 @@ function prefixer(element, index, children, callback) {
|
|
|
1187
1296
|
}
|
|
1188
1297
|
}
|
|
1189
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
|
+
|
|
1190
1314
|
var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {
|
|
1191
1315
|
var previous = 0;
|
|
1192
1316
|
var character = 0;
|
|
@@ -1407,8 +1531,8 @@ var createCache = function createCache(options) {
|
|
|
1407
1531
|
return cache;
|
|
1408
1532
|
};
|
|
1409
1533
|
|
|
1410
|
-
function _extends$
|
|
1411
|
-
_extends$
|
|
1534
|
+
function _extends$2() {
|
|
1535
|
+
_extends$2 = Object.assign ? Object.assign.bind() : function (target) {
|
|
1412
1536
|
for (var i = 1; i < arguments.length; i++) {
|
|
1413
1537
|
var source = arguments[i];
|
|
1414
1538
|
|
|
@@ -1421,24 +1545,9 @@ function _extends$1() {
|
|
|
1421
1545
|
|
|
1422
1546
|
return target;
|
|
1423
1547
|
};
|
|
1424
|
-
return _extends$
|
|
1548
|
+
return _extends$2.apply(this, arguments);
|
|
1425
1549
|
}
|
|
1426
1550
|
|
|
1427
|
-
var weakMemoize = function weakMemoize(func) {
|
|
1428
|
-
// $FlowFixMe flow doesn't include all non-primitive types as allowed for weakmaps
|
|
1429
|
-
var cache = new WeakMap();
|
|
1430
|
-
return function (arg) {
|
|
1431
|
-
if (cache.has(arg)) {
|
|
1432
|
-
// $FlowFixMe
|
|
1433
|
-
return cache.get(arg);
|
|
1434
|
-
}
|
|
1435
|
-
|
|
1436
|
-
var ret = func(arg);
|
|
1437
|
-
cache.set(arg, ret);
|
|
1438
|
-
return ret;
|
|
1439
|
-
};
|
|
1440
|
-
};
|
|
1441
|
-
|
|
1442
1551
|
var EmotionCacheContext = /* #__PURE__ */createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case
|
|
1443
1552
|
// because this module is primarily intended for the browser and node
|
|
1444
1553
|
// but it's also required in react native and similar environments sometimes
|
|
@@ -1464,7 +1573,7 @@ var getTheme$1 = function getTheme(outerTheme, theme) {
|
|
|
1464
1573
|
return mergedTheme;
|
|
1465
1574
|
}
|
|
1466
1575
|
|
|
1467
|
-
return _extends$
|
|
1576
|
+
return _extends$2({}, outerTheme, theme);
|
|
1468
1577
|
};
|
|
1469
1578
|
|
|
1470
1579
|
var createCacheWithTheme = /* #__PURE__ */weakMemoize(function (outerTheme) {
|
|
@@ -1489,11 +1598,13 @@ var BASE_BORDER_WIDTH = 1;
|
|
|
1489
1598
|
var BASE_SPACE = 8;
|
|
1490
1599
|
var BASE_FONT = 'BeVietnamPro';
|
|
1491
1600
|
var BASE_FONT_SIZE = 10;
|
|
1601
|
+
var BASE_RADIUS = 4;
|
|
1492
1602
|
var scale$1 = {
|
|
1493
1603
|
borderWidth: BASE_BORDER_WIDTH,
|
|
1494
1604
|
space: BASE_SPACE,
|
|
1495
1605
|
font: BASE_FONT,
|
|
1496
|
-
fontSize: BASE_FONT_SIZE
|
|
1606
|
+
fontSize: BASE_FONT_SIZE,
|
|
1607
|
+
radius: BASE_RADIUS
|
|
1497
1608
|
};
|
|
1498
1609
|
|
|
1499
1610
|
var palette = {
|
|
@@ -1550,6 +1661,7 @@ var palette = {
|
|
|
1550
1661
|
pinkLight75: '#fcd5ea',
|
|
1551
1662
|
pinkLight90: '#ffeef7',
|
|
1552
1663
|
purple: '#be83cf',
|
|
1664
|
+
purpleDark15: '#a26fb0',
|
|
1553
1665
|
red: '#de350b',
|
|
1554
1666
|
redDark15: '#bd2d09',
|
|
1555
1667
|
redDark30: '#9b2508',
|
|
@@ -1585,12 +1697,15 @@ var palette = {
|
|
|
1585
1697
|
var systemPalette = {
|
|
1586
1698
|
primary: palette.violet,
|
|
1587
1699
|
primaryLight: palette.violetLight60,
|
|
1700
|
+
primaryDark: palette.purpleDark15,
|
|
1701
|
+
primaryBackground: palette.violetLight90,
|
|
1702
|
+
secondary: palette.dodgerBlue,
|
|
1703
|
+
secondaryLight: palette.dodgerBlueLight75,
|
|
1588
1704
|
info: palette.dodgerBlue,
|
|
1589
1705
|
infoLight: palette.dodgerBlueLight75,
|
|
1590
1706
|
infoBackground: palette.dodgerBlueLight90,
|
|
1591
1707
|
success: palette.green,
|
|
1592
1708
|
successDark: palette.greenDark30,
|
|
1593
|
-
successLight: palette.greenDark75,
|
|
1594
1709
|
successBackground: palette.grotesqueGreenLight90,
|
|
1595
1710
|
danger: palette.red,
|
|
1596
1711
|
dangerLight: palette.redLight60,
|
|
@@ -1603,8 +1718,10 @@ var systemPalette = {
|
|
|
1603
1718
|
backgroundDark: palette.greyDark75,
|
|
1604
1719
|
text: palette.greyDark75,
|
|
1605
1720
|
disabledText: palette.greyDark15,
|
|
1721
|
+
disabledLightText: palette.greyLight45,
|
|
1606
1722
|
invertedText: palette.white,
|
|
1607
|
-
outline: palette.greyLight60
|
|
1723
|
+
outline: palette.greyLight60,
|
|
1724
|
+
archived: palette.greyLight45
|
|
1608
1725
|
};
|
|
1609
1726
|
|
|
1610
1727
|
var BASE_WIDTH = 390; // Based on iPhone 13's viewport size
|
|
@@ -1696,56 +1813,64 @@ var getBorderWidths = function getBorderWidths(baseBorderWidth) {
|
|
|
1696
1813
|
};
|
|
1697
1814
|
};
|
|
1698
1815
|
|
|
1816
|
+
var getRadii = function getRadii(baseRadius) {
|
|
1817
|
+
return {
|
|
1818
|
+
rounded: 999,
|
|
1819
|
+
base: baseRadius,
|
|
1820
|
+
medium: baseRadius * 2
|
|
1821
|
+
};
|
|
1822
|
+
};
|
|
1823
|
+
|
|
1699
1824
|
var getGlobalTheme = function getGlobalTheme(scale, systemPalette) {
|
|
1700
1825
|
var fonts = getFonts(scale.font);
|
|
1701
1826
|
var fontSizes = getFontSizes(scale.fontSize);
|
|
1702
1827
|
var lineHeights = getLineHeights(fontSizes);
|
|
1703
1828
|
var borderWidths = getBorderWidths(scale.borderWidth);
|
|
1704
1829
|
var space = getSpace(scale.space);
|
|
1830
|
+
var radii = getRadii(scale.radius);
|
|
1705
1831
|
return {
|
|
1706
1832
|
colors: _objectSpread2({}, systemPalette),
|
|
1707
1833
|
fonts: fonts,
|
|
1708
1834
|
fontSizes: fontSizes,
|
|
1709
1835
|
lineHeights: lineHeights,
|
|
1710
1836
|
borderWidths: borderWidths,
|
|
1711
|
-
space: space
|
|
1837
|
+
space: space,
|
|
1838
|
+
radii: radii
|
|
1712
1839
|
};
|
|
1713
1840
|
};
|
|
1714
1841
|
|
|
1715
1842
|
var getBadgeTheme = function getBadgeTheme(theme) {
|
|
1716
|
-
var borderWidths = {
|
|
1717
|
-
"default": theme.borderWidths.base
|
|
1718
|
-
};
|
|
1719
1843
|
var colors = {
|
|
1720
1844
|
danger: theme.colors.danger,
|
|
1721
|
-
dangerBackground: theme.colors.dangerBackground,
|
|
1722
1845
|
info: theme.colors.info,
|
|
1723
|
-
infoBackground: theme.colors.infoBackground,
|
|
1724
1846
|
success: theme.colors.successDark,
|
|
1725
|
-
successBackground: theme.colors.successBackground,
|
|
1726
1847
|
warning: theme.colors.warningDark,
|
|
1727
|
-
|
|
1848
|
+
archived: theme.colors.archived,
|
|
1849
|
+
text: theme.colors.invertedText
|
|
1728
1850
|
};
|
|
1729
|
-
var
|
|
1851
|
+
var fonts = {
|
|
1730
1852
|
"default": theme.fonts.semiBold
|
|
1731
1853
|
};
|
|
1732
|
-
var
|
|
1854
|
+
var fontSizes = {
|
|
1733
1855
|
"default": theme.fontSizes.small
|
|
1734
1856
|
};
|
|
1857
|
+
var sizes = {
|
|
1858
|
+
height: theme.fontSizes.small + theme.space.small,
|
|
1859
|
+
minWidth: theme.fontSizes.small + theme.space.small,
|
|
1860
|
+
statusHeight: theme.space.small,
|
|
1861
|
+
statusWidth: theme.space.small
|
|
1862
|
+
};
|
|
1735
1863
|
var space = {
|
|
1736
1864
|
horizontalPadding: theme.space.small,
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
var radii = {
|
|
1740
|
-
"default": 4
|
|
1865
|
+
statusPositionTop: -theme.space.xxsmall,
|
|
1866
|
+
statusPositionRight: -theme.space.xxsmall
|
|
1741
1867
|
};
|
|
1742
1868
|
return {
|
|
1743
|
-
borderWidths: borderWidths,
|
|
1744
1869
|
colors: colors,
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1870
|
+
fonts: fonts,
|
|
1871
|
+
fontSizes: fontSizes,
|
|
1872
|
+
sizes: sizes,
|
|
1873
|
+
space: space
|
|
1749
1874
|
};
|
|
1750
1875
|
};
|
|
1751
1876
|
|
|
@@ -1777,11 +1902,61 @@ var getBottomNavigationTheme = function getBottomNavigationTheme(theme) {
|
|
|
1777
1902
|
};
|
|
1778
1903
|
};
|
|
1779
1904
|
|
|
1780
|
-
var
|
|
1905
|
+
var getButtonTheme = function getButtonTheme(theme) {
|
|
1906
|
+
var fonts = {
|
|
1907
|
+
"default": theme.fonts.semiBold
|
|
1908
|
+
};
|
|
1909
|
+
var fontSize = {
|
|
1910
|
+
"default": theme.fontSizes.xlarge
|
|
1911
|
+
};
|
|
1912
|
+
var lineHeight = {
|
|
1913
|
+
"default": theme.lineHeights.large
|
|
1914
|
+
};
|
|
1915
|
+
var borderWidth = {
|
|
1916
|
+
"default": theme.space.xxsmall
|
|
1917
|
+
};
|
|
1918
|
+
var space = {
|
|
1919
|
+
buttonPadding: theme.space.medium,
|
|
1920
|
+
iconPadding: theme.space.small
|
|
1921
|
+
};
|
|
1922
|
+
var sizes = {
|
|
1923
|
+
iconSize: theme.fontSizes.xxlarge
|
|
1924
|
+
};
|
|
1925
|
+
var radii = {
|
|
1926
|
+
"default": theme.space.xlarge
|
|
1927
|
+
};
|
|
1928
|
+
var colors = {
|
|
1929
|
+
primary: theme.colors.primary,
|
|
1930
|
+
pressedPrimary: theme.colors.primaryLight,
|
|
1931
|
+
secondary: theme.colors.secondary,
|
|
1932
|
+
pressedSecondary: theme.colors.secondaryLight,
|
|
1933
|
+
defaultText: theme.colors.text,
|
|
1934
|
+
disabledText: theme.colors.disabledLightText,
|
|
1935
|
+
disabledBorder: theme.colors.disabledLightText,
|
|
1936
|
+
disabledBackground: theme.colors.disabledLightText,
|
|
1937
|
+
invertedText: theme.colors.invertedText
|
|
1938
|
+
};
|
|
1939
|
+
return {
|
|
1940
|
+
borderWidth: borderWidth,
|
|
1941
|
+
fonts: fonts,
|
|
1942
|
+
fontSize: fontSize,
|
|
1943
|
+
sizes: sizes,
|
|
1944
|
+
radii: radii,
|
|
1945
|
+
colors: colors,
|
|
1946
|
+
lineHeight: lineHeight,
|
|
1947
|
+
space: space
|
|
1948
|
+
};
|
|
1949
|
+
};
|
|
1950
|
+
|
|
1951
|
+
var getCardTheme = function getCardTheme(theme) {
|
|
1952
|
+
var colors = {
|
|
1953
|
+
dataCardIndicator: theme.colors.primaryDark
|
|
1954
|
+
};
|
|
1781
1955
|
var radii = {
|
|
1782
1956
|
"default": 12
|
|
1783
1957
|
};
|
|
1784
1958
|
return {
|
|
1959
|
+
colors: colors,
|
|
1785
1960
|
radii: radii
|
|
1786
1961
|
};
|
|
1787
1962
|
};
|
|
@@ -1807,21 +1982,98 @@ var getDividerTheme = function getDividerTheme(theme) {
|
|
|
1807
1982
|
};
|
|
1808
1983
|
};
|
|
1809
1984
|
|
|
1985
|
+
var getDrawerTheme = function getDrawerTheme(theme) {
|
|
1986
|
+
var colors = {
|
|
1987
|
+
shadow: theme.colors.backgroundDark,
|
|
1988
|
+
background: theme.colors.platformBackground,
|
|
1989
|
+
backdrop: theme.colors.backgroundDark
|
|
1990
|
+
};
|
|
1991
|
+
var radii = {
|
|
1992
|
+
"default": 16
|
|
1993
|
+
};
|
|
1994
|
+
var shadows = {
|
|
1995
|
+
offset: {
|
|
1996
|
+
width: 0,
|
|
1997
|
+
height: 3
|
|
1998
|
+
},
|
|
1999
|
+
opacity: 0.27,
|
|
2000
|
+
radius: 4.65,
|
|
2001
|
+
elevation: 10
|
|
2002
|
+
};
|
|
2003
|
+
return {
|
|
2004
|
+
colors: colors,
|
|
2005
|
+
radii: radii,
|
|
2006
|
+
shadows: shadows
|
|
2007
|
+
};
|
|
2008
|
+
};
|
|
2009
|
+
|
|
1810
2010
|
var getTabsTheme = function getTabsTheme(theme) {
|
|
1811
2011
|
var colors = {
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
2012
|
+
active: theme.colors.primary,
|
|
2013
|
+
inactive: theme.colors.text,
|
|
2014
|
+
activeBackground: theme.colors.primaryBackground,
|
|
2015
|
+
headerBottom: theme.colors.outline,
|
|
2016
|
+
text: theme.colors.text
|
|
1815
2017
|
};
|
|
1816
2018
|
var space = {
|
|
1817
2019
|
flatListHorizontalPadding: theme.space.small,
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
2020
|
+
itemHorizontalPadding: theme.space.small,
|
|
2021
|
+
itemVerticalPadding: theme.space.small,
|
|
2022
|
+
outlineHorizontalPadding: theme.space.small,
|
|
2023
|
+
outlineVerticalPadding: theme.space.xsmall
|
|
2024
|
+
};
|
|
2025
|
+
var radii = {
|
|
2026
|
+
outline: theme.radii.medium
|
|
2027
|
+
};
|
|
2028
|
+
var borderWidths = {
|
|
2029
|
+
headerBottom: theme.borderWidths.base
|
|
2030
|
+
};
|
|
2031
|
+
var sizes = {
|
|
2032
|
+
indicator: theme.space.xxsmall
|
|
1821
2033
|
};
|
|
1822
2034
|
return {
|
|
2035
|
+
borderWidths: borderWidths,
|
|
1823
2036
|
colors: colors,
|
|
1824
|
-
space: space
|
|
2037
|
+
space: space,
|
|
2038
|
+
radii: radii,
|
|
2039
|
+
sizes: sizes
|
|
2040
|
+
};
|
|
2041
|
+
};
|
|
2042
|
+
|
|
2043
|
+
var getTagTheme = function getTagTheme(theme) {
|
|
2044
|
+
var borderWidths = {
|
|
2045
|
+
"default": theme.borderWidths.base
|
|
2046
|
+
};
|
|
2047
|
+
var colors = {
|
|
2048
|
+
danger: theme.colors.danger,
|
|
2049
|
+
dangerBackground: theme.colors.dangerBackground,
|
|
2050
|
+
info: theme.colors.info,
|
|
2051
|
+
infoBackground: theme.colors.infoBackground,
|
|
2052
|
+
success: theme.colors.successDark,
|
|
2053
|
+
successBackground: theme.colors.successBackground,
|
|
2054
|
+
warning: theme.colors.warningDark,
|
|
2055
|
+
warningBackground: theme.colors.warningBackground
|
|
2056
|
+
};
|
|
2057
|
+
var fonts = {
|
|
2058
|
+
"default": theme.fonts.semiBold
|
|
2059
|
+
};
|
|
2060
|
+
var fontSizes = {
|
|
2061
|
+
"default": theme.fontSizes.small
|
|
2062
|
+
};
|
|
2063
|
+
var space = {
|
|
2064
|
+
horizontalPadding: theme.space.small,
|
|
2065
|
+
verticalPadding: theme.space.xxsmall
|
|
2066
|
+
};
|
|
2067
|
+
var radii = {
|
|
2068
|
+
"default": theme.radii.base
|
|
2069
|
+
};
|
|
2070
|
+
return {
|
|
2071
|
+
borderWidths: borderWidths,
|
|
2072
|
+
colors: colors,
|
|
2073
|
+
fonts: fonts,
|
|
2074
|
+
fontSizes: fontSizes,
|
|
2075
|
+
space: space,
|
|
2076
|
+
radii: radii
|
|
1825
2077
|
};
|
|
1826
2078
|
};
|
|
1827
2079
|
|
|
@@ -1847,6 +2099,31 @@ var getIconTheme = function getIconTheme(theme) {
|
|
|
1847
2099
|
};
|
|
1848
2100
|
};
|
|
1849
2101
|
|
|
2102
|
+
var getProgressTheme = function getProgressTheme(theme) {
|
|
2103
|
+
var colors = {
|
|
2104
|
+
primary: theme.colors.primary,
|
|
2105
|
+
success: theme.colors.success,
|
|
2106
|
+
warning: theme.colors.warning,
|
|
2107
|
+
danger: theme.colors.danger,
|
|
2108
|
+
info: theme.colors.info,
|
|
2109
|
+
background: theme.colors.outline,
|
|
2110
|
+
innerBackground: theme.colors.platformBackground
|
|
2111
|
+
};
|
|
2112
|
+
var sizes = {
|
|
2113
|
+
radius: theme.space.xxxlarge,
|
|
2114
|
+
strokeWidth: theme.space.small,
|
|
2115
|
+
barHeight: theme.space.xsmall
|
|
2116
|
+
};
|
|
2117
|
+
var radii = {
|
|
2118
|
+
"default": theme.radii.rounded
|
|
2119
|
+
};
|
|
2120
|
+
return {
|
|
2121
|
+
colors: colors,
|
|
2122
|
+
sizes: sizes,
|
|
2123
|
+
radii: radii
|
|
2124
|
+
};
|
|
2125
|
+
};
|
|
2126
|
+
|
|
1850
2127
|
var getTypographyTheme = function getTypographyTheme(theme) {
|
|
1851
2128
|
var colors = {
|
|
1852
2129
|
body: theme.colors.text,
|
|
@@ -1884,7 +2161,8 @@ var getFABTheme = function getFABTheme(theme) {
|
|
|
1884
2161
|
icon: theme.colors.invertedText,
|
|
1885
2162
|
headerText: theme.colors.text,
|
|
1886
2163
|
actionItemBackground: theme.colors.infoLight,
|
|
1887
|
-
backdropBackground: theme.colors.platformBackground
|
|
2164
|
+
backdropBackground: theme.colors.platformBackground,
|
|
2165
|
+
titleText: theme.colors.invertedText
|
|
1888
2166
|
};
|
|
1889
2167
|
var sizes = {
|
|
1890
2168
|
width: 64,
|
|
@@ -1892,16 +2170,19 @@ var getFABTheme = function getFABTheme(theme) {
|
|
|
1892
2170
|
};
|
|
1893
2171
|
var fonts = {
|
|
1894
2172
|
header: theme.fonts.semiBold,
|
|
1895
|
-
actionItemText: theme.fonts.regular
|
|
2173
|
+
actionItemText: theme.fonts.regular,
|
|
2174
|
+
title: theme.fonts.semiBold
|
|
1896
2175
|
};
|
|
1897
2176
|
var fontSizes = {
|
|
1898
2177
|
header: theme.fontSizes.xxxlarge,
|
|
1899
|
-
|
|
1900
|
-
|
|
2178
|
+
actionItemText: theme.fontSizes.medium,
|
|
2179
|
+
title: theme.fontSizes.large
|
|
1901
2180
|
};
|
|
1902
2181
|
var lineHeights = {
|
|
1903
2182
|
header: theme.lineHeights.xxxlarge,
|
|
1904
|
-
actionItemText: theme.lineHeights.medium
|
|
2183
|
+
actionItemText: theme.lineHeights.medium,
|
|
2184
|
+
title: theme.lineHeights.large,
|
|
2185
|
+
icon: theme.lineHeights.large
|
|
1905
2186
|
};
|
|
1906
2187
|
var space = {
|
|
1907
2188
|
actionItemPaddingLeft: theme.space.medium,
|
|
@@ -1914,10 +2195,13 @@ var getFABTheme = function getFABTheme(theme) {
|
|
|
1914
2195
|
buttonMarginTop: theme.space.large,
|
|
1915
2196
|
buttonMarginRight: theme.space.large,
|
|
1916
2197
|
headerTextMarginRight: theme.space.large,
|
|
1917
|
-
headerTextMarginBottom: theme.space.large
|
|
2198
|
+
headerTextMarginBottom: theme.space.large,
|
|
2199
|
+
containerPaddingHorizontal: theme.space.medium,
|
|
2200
|
+
containerPaddingVertical: theme.space.medium,
|
|
2201
|
+
titleMarginHorizontal: theme.space.small
|
|
1918
2202
|
};
|
|
1919
2203
|
var radii = {
|
|
1920
|
-
actionItem:
|
|
2204
|
+
actionItem: theme.radii.rounded
|
|
1921
2205
|
};
|
|
1922
2206
|
return {
|
|
1923
2207
|
radii: radii,
|
|
@@ -1930,18 +2214,61 @@ var getFABTheme = function getFABTheme(theme) {
|
|
|
1930
2214
|
};
|
|
1931
2215
|
};
|
|
1932
2216
|
|
|
1933
|
-
var
|
|
1934
|
-
var
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
2217
|
+
var getAvatarTheme = function getAvatarTheme(theme) {
|
|
2218
|
+
var colors = {
|
|
2219
|
+
primary: theme.colors.primary,
|
|
2220
|
+
info: theme.colors.info,
|
|
2221
|
+
danger: theme.colors.danger,
|
|
2222
|
+
success: theme.colors.success,
|
|
2223
|
+
warning: theme.colors.warning
|
|
2224
|
+
};
|
|
2225
|
+
var sizes = {
|
|
2226
|
+
small: theme.space.xlarge,
|
|
2227
|
+
medium: theme.space.xxlarge,
|
|
2228
|
+
large: theme.space.xxxlarge,
|
|
2229
|
+
xlarge: theme.space.xxxxlarge
|
|
2230
|
+
};
|
|
2231
|
+
var fontSizes = {
|
|
2232
|
+
small: theme.fontSizes.large,
|
|
2233
|
+
medium: theme.fontSizes.xlarge,
|
|
2234
|
+
large: theme.fontSizes.xxlarge,
|
|
2235
|
+
xlarge: theme.fontSizes.xxxlarge
|
|
2236
|
+
};
|
|
2237
|
+
var radii = {
|
|
2238
|
+
small: theme.space.xlarge / 2,
|
|
2239
|
+
medium: theme.space.xxlarge / 2,
|
|
2240
|
+
large: theme.space.xxxlarge / 2,
|
|
2241
|
+
xlarge: theme.space.xxxxlarge / 2
|
|
2242
|
+
};
|
|
2243
|
+
var borderWidths = {
|
|
2244
|
+
"default": theme.borderWidths.base
|
|
2245
|
+
};
|
|
2246
|
+
return {
|
|
2247
|
+
colors: colors,
|
|
2248
|
+
sizes: sizes,
|
|
2249
|
+
radii: radii,
|
|
2250
|
+
borderWidths: borderWidths,
|
|
2251
|
+
fontSizes: fontSizes
|
|
2252
|
+
};
|
|
2253
|
+
};
|
|
2254
|
+
|
|
2255
|
+
var getTheme = function getTheme() {
|
|
2256
|
+
var scale = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : scale$1;
|
|
2257
|
+
var systemPallete = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : systemPalette;
|
|
2258
|
+
var globalTheme = getGlobalTheme(scale, systemPallete);
|
|
2259
|
+
return _objectSpread2(_objectSpread2({}, globalTheme), {}, {
|
|
1938
2260
|
__hd__: {
|
|
2261
|
+
avatar: getAvatarTheme(globalTheme),
|
|
1939
2262
|
badge: getBadgeTheme(globalTheme),
|
|
1940
2263
|
bottomNavigation: getBottomNavigationTheme(globalTheme),
|
|
1941
|
-
|
|
2264
|
+
button: getButtonTheme(globalTheme),
|
|
2265
|
+
card: getCardTheme(globalTheme),
|
|
1942
2266
|
divider: getDividerTheme(globalTheme),
|
|
2267
|
+
drawer: getDrawerTheme(globalTheme),
|
|
2268
|
+
progress: getProgressTheme(globalTheme),
|
|
1943
2269
|
icon: getIconTheme(globalTheme),
|
|
1944
2270
|
tabs: getTabsTheme(globalTheme),
|
|
2271
|
+
tag: getTagTheme(globalTheme),
|
|
1945
2272
|
typography: getTypographyTheme(globalTheme),
|
|
1946
2273
|
fab: getFABTheme(globalTheme)
|
|
1947
2274
|
}
|
|
@@ -3870,63 +4197,239 @@ var getDisplayName = function getDisplayName(primitive) {
|
|
|
3870
4197
|
|
|
3871
4198
|
var styled = createStyled(StyleSheet$1);
|
|
3872
4199
|
var components = ['ActivityIndicator', 'Button', 'DatePickerIOS', 'DrawerLayoutAndroid', 'FlatList', 'Image', 'ImageBackground', 'KeyboardAvoidingView', 'ListView', 'Modal', 'NavigatorIOS', 'Picker', 'PickerIOS', 'Pressable', 'ProgressBarAndroid', 'ProgressViewIOS', 'RecyclerViewBackedScrollView', 'RefreshControl', 'SafeAreaView', 'ScrollView', 'SectionList', 'SegmentedControlIOS', 'Slider', 'SnapshotViewIOS', 'StatusBar', 'SwipeableListView', 'Switch', 'SwitchIOS', 'TabBarIOS', 'Text', 'TextInput', 'ToolbarAndroid', 'TouchableHighlight', 'TouchableNativeFeedback', 'TouchableOpacity', 'TouchableWithoutFeedback', 'View', 'ViewPagerAndroid'];
|
|
3873
|
-
var index$
|
|
4200
|
+
var index$2 = components.reduce(function (acc, comp) {
|
|
3874
4201
|
return Object.defineProperty(acc, comp, {
|
|
3875
4202
|
enumerable: true,
|
|
3876
4203
|
configurable: false,
|
|
3877
4204
|
get: function get() {
|
|
3878
|
-
return styled(
|
|
4205
|
+
return styled(ReactNative[comp]);
|
|
3879
4206
|
}
|
|
3880
4207
|
});
|
|
3881
4208
|
}, styled);
|
|
3882
4209
|
|
|
3883
|
-
var
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
4210
|
+
var StyledPressable = index$2(TouchableOpacity)(function (_ref) {
|
|
4211
|
+
var themeSize = _ref.themeSize,
|
|
4212
|
+
themeIntent = _ref.themeIntent,
|
|
4213
|
+
theme = _ref.theme;
|
|
4214
|
+
return {
|
|
4215
|
+
borderWidth: theme.__hd__.avatar.borderWidths["default"],
|
|
4216
|
+
borderRadius: theme.__hd__.avatar.radii[themeSize],
|
|
4217
|
+
borderColor: theme.__hd__.avatar.colors[themeIntent],
|
|
4218
|
+
width: theme.__hd__.avatar.sizes[themeSize],
|
|
4219
|
+
height: theme.__hd__.avatar.sizes[themeSize],
|
|
4220
|
+
overflow: 'hidden'
|
|
4221
|
+
};
|
|
4222
|
+
});
|
|
4223
|
+
var StyledView$2 = index$2(View)(function (_ref2) {
|
|
4224
|
+
var themeSize = _ref2.themeSize,
|
|
4225
|
+
themeIntent = _ref2.themeIntent,
|
|
4226
|
+
theme = _ref2.theme;
|
|
4227
|
+
return {
|
|
4228
|
+
borderWidth: theme.__hd__.avatar.borderWidths["default"],
|
|
4229
|
+
borderRadius: theme.__hd__.avatar.radii[themeSize],
|
|
4230
|
+
borderColor: theme.__hd__.avatar.colors[themeIntent],
|
|
4231
|
+
width: theme.__hd__.avatar.sizes[themeSize],
|
|
4232
|
+
height: theme.__hd__.avatar.sizes[themeSize],
|
|
4233
|
+
overflow: 'hidden'
|
|
4234
|
+
};
|
|
4235
|
+
});
|
|
4236
|
+
var StyledTextWrapper = index$2(View)(function () {
|
|
4237
|
+
return {
|
|
4238
|
+
alignItems: 'center',
|
|
4239
|
+
justifyContent: 'center',
|
|
4240
|
+
display: 'flex',
|
|
4241
|
+
width: '100%',
|
|
4242
|
+
height: '100%'
|
|
4243
|
+
};
|
|
4244
|
+
});
|
|
4245
|
+
var StyledText$3 = index$2(Text$1)(function (_ref3) {
|
|
4246
|
+
var themeSize = _ref3.themeSize,
|
|
4247
|
+
themeIntent = _ref3.themeIntent,
|
|
4248
|
+
theme = _ref3.theme;
|
|
4249
|
+
return {
|
|
4250
|
+
fontSize: theme.__hd__.avatar.fontSizes[themeSize],
|
|
4251
|
+
color: theme.__hd__.avatar.colors[themeIntent],
|
|
4252
|
+
overflow: 'hidden'
|
|
4253
|
+
};
|
|
4254
|
+
});
|
|
4255
|
+
var StyledImage = index$2(Image)(function (_ref4) {
|
|
4256
|
+
var themeSize = _ref4.themeSize,
|
|
4257
|
+
theme = _ref4.theme;
|
|
4258
|
+
return {
|
|
4259
|
+
width: theme.__hd__.avatar.sizes[themeSize],
|
|
4260
|
+
height: theme.__hd__.avatar.sizes[themeSize]
|
|
4261
|
+
};
|
|
4262
|
+
});
|
|
4263
|
+
|
|
4264
|
+
var Avatar = function Avatar(_ref) {
|
|
4265
|
+
var onPress = _ref.onPress,
|
|
4266
|
+
source = _ref.source,
|
|
4267
|
+
testID = _ref.testID,
|
|
4268
|
+
style = _ref.style,
|
|
4269
|
+
title = _ref.title,
|
|
4270
|
+
_ref$size = _ref.size,
|
|
4271
|
+
size = _ref$size === void 0 ? 'small' : _ref$size,
|
|
4272
|
+
_ref$intent = _ref.intent,
|
|
4273
|
+
intent = _ref$intent === void 0 ? 'primary' : _ref$intent;
|
|
4274
|
+
var Wrapper = onPress ? StyledPressable : StyledView$2;
|
|
4275
|
+
return title !== undefined || source !== undefined ? /*#__PURE__*/React.createElement(Wrapper, {
|
|
4276
|
+
testID: testID,
|
|
4277
|
+
onPress: onPress,
|
|
4278
|
+
themeIntent: intent,
|
|
4279
|
+
themeSize: size,
|
|
4280
|
+
style: style
|
|
4281
|
+
}, title !== undefined && source === undefined && /*#__PURE__*/React.createElement(StyledTextWrapper, null, /*#__PURE__*/React.createElement(StyledText$3, {
|
|
4282
|
+
themeIntent: intent,
|
|
4283
|
+
themeSize: size
|
|
4284
|
+
}, title)), source !== undefined && /*#__PURE__*/React.createElement(StyledImage, {
|
|
4285
|
+
resizeMode: "cover",
|
|
4286
|
+
source: source,
|
|
4287
|
+
themeSize: size
|
|
4288
|
+
})) : null;
|
|
3888
4289
|
};
|
|
3889
|
-
|
|
4290
|
+
|
|
4291
|
+
var StyledView$1 = index$2(Animated.View)(function (_ref) {
|
|
3890
4292
|
var themeIntent = _ref.themeIntent,
|
|
4293
|
+
themePadding = _ref.themePadding,
|
|
3891
4294
|
theme = _ref.theme;
|
|
3892
4295
|
return {
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
4296
|
+
height: theme.__hd__.badge.sizes.height,
|
|
4297
|
+
minWidth: theme.__hd__.badge.sizes.minWidth,
|
|
4298
|
+
alignItems: 'center',
|
|
4299
|
+
justifyContent: 'center',
|
|
4300
|
+
backgroundColor: theme.__hd__.badge.colors[themeIntent],
|
|
4301
|
+
borderRadius: theme.radii.rounded,
|
|
4302
|
+
paddingHorizontal: themePadding === 'wideContent' ? theme.__hd__.badge.space.horizontalPadding : undefined
|
|
4303
|
+
};
|
|
4304
|
+
});
|
|
4305
|
+
var StyledText$2 = index$2(Text$1)(function (_ref2) {
|
|
4306
|
+
var theme = _ref2.theme;
|
|
4307
|
+
return {
|
|
4308
|
+
fontFamily: theme.__hd__.badge.fonts["default"],
|
|
4309
|
+
fontSize: theme.__hd__.badge.fontSizes["default"],
|
|
4310
|
+
color: theme.__hd__.badge.colors.text,
|
|
4311
|
+
includeFontPadding: false,
|
|
4312
|
+
textAlignVertical: 'center',
|
|
4313
|
+
textAlign: 'center'
|
|
3899
4314
|
};
|
|
3900
4315
|
});
|
|
3901
|
-
var
|
|
3902
|
-
var themeIntent =
|
|
3903
|
-
theme =
|
|
4316
|
+
var StyledStatus = index$2(Animated.View)(function (_ref3) {
|
|
4317
|
+
var themeIntent = _ref3.themeIntent,
|
|
4318
|
+
theme = _ref3.theme;
|
|
3904
4319
|
return {
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
4320
|
+
position: 'absolute',
|
|
4321
|
+
top: theme.__hd__.badge.space.statusPositionTop,
|
|
4322
|
+
right: theme.__hd__.badge.space.statusPositionRight,
|
|
4323
|
+
height: theme.__hd__.badge.sizes.statusHeight,
|
|
4324
|
+
width: theme.__hd__.badge.sizes.statusWidth,
|
|
4325
|
+
backgroundColor: theme.__hd__.badge.colors[themeIntent],
|
|
4326
|
+
borderRadius: theme.radii.rounded
|
|
3908
4327
|
};
|
|
3909
4328
|
});
|
|
3910
4329
|
|
|
3911
|
-
var _excluded$
|
|
4330
|
+
var _excluded$a = ["children", "visible", "intent", "style", "testID"];
|
|
3912
4331
|
|
|
3913
|
-
var
|
|
3914
|
-
var
|
|
4332
|
+
var Status = function Status(_ref) {
|
|
4333
|
+
var children = _ref.children,
|
|
4334
|
+
_ref$visible = _ref.visible,
|
|
4335
|
+
visible = _ref$visible === void 0 ? true : _ref$visible,
|
|
3915
4336
|
_ref$intent = _ref.intent,
|
|
3916
|
-
intent = _ref$intent === void 0 ? '
|
|
4337
|
+
intent = _ref$intent === void 0 ? 'danger' : _ref$intent,
|
|
3917
4338
|
style = _ref.style,
|
|
3918
4339
|
testID = _ref.testID,
|
|
3919
|
-
nativeProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
4340
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$a);
|
|
3920
4341
|
|
|
3921
|
-
|
|
3922
|
-
|
|
4342
|
+
var _React$useRef = React.useRef(new Animated.Value(visible ? 1 : 0)),
|
|
4343
|
+
opacity = _React$useRef.current;
|
|
4344
|
+
|
|
4345
|
+
var isFirstRendering = React.useRef(true);
|
|
4346
|
+
React.useEffect(function () {
|
|
4347
|
+
// Do not run animation on very first rendering
|
|
4348
|
+
if (isFirstRendering.current) {
|
|
4349
|
+
isFirstRendering.current = false;
|
|
4350
|
+
return;
|
|
4351
|
+
}
|
|
4352
|
+
|
|
4353
|
+
Animated.timing(opacity, {
|
|
4354
|
+
toValue: visible ? 1 : 0,
|
|
4355
|
+
duration: 150,
|
|
4356
|
+
useNativeDriver: true
|
|
4357
|
+
}).start();
|
|
4358
|
+
}, [visible, opacity]);
|
|
4359
|
+
return /*#__PURE__*/React.createElement(View, _extends$3({}, nativeProps, {
|
|
3923
4360
|
style: style,
|
|
3924
4361
|
testID: testID
|
|
3925
|
-
},
|
|
4362
|
+
}), children, /*#__PURE__*/React.createElement(StyledStatus, {
|
|
4363
|
+
style: {
|
|
4364
|
+
opacity: opacity,
|
|
4365
|
+
transform: [{
|
|
4366
|
+
scale: opacity.interpolate({
|
|
4367
|
+
inputRange: [0, 1],
|
|
4368
|
+
outputRange: [0.5, 1]
|
|
4369
|
+
})
|
|
4370
|
+
}]
|
|
4371
|
+
},
|
|
3926
4372
|
themeIntent: intent
|
|
3927
|
-
}
|
|
4373
|
+
}));
|
|
4374
|
+
};
|
|
4375
|
+
|
|
4376
|
+
var _excluded$9 = ["content", "visible", "max", "intent", "style", "testID"];
|
|
4377
|
+
var DEFAULT_MAX_NUMBER = 99;
|
|
4378
|
+
|
|
4379
|
+
var getPaddingState = function getPaddingState(content) {
|
|
4380
|
+
return content.length > 1 ? 'wideContent' : 'narrowContent';
|
|
4381
|
+
};
|
|
4382
|
+
|
|
4383
|
+
var Badge = function Badge(_ref) {
|
|
4384
|
+
var originalContent = _ref.content,
|
|
4385
|
+
_ref$visible = _ref.visible,
|
|
4386
|
+
visible = _ref$visible === void 0 ? true : _ref$visible,
|
|
4387
|
+
_ref$max = _ref.max,
|
|
4388
|
+
max = _ref$max === void 0 ? DEFAULT_MAX_NUMBER : _ref$max,
|
|
4389
|
+
_ref$intent = _ref.intent,
|
|
4390
|
+
intent = _ref$intent === void 0 ? 'danger' : _ref$intent,
|
|
4391
|
+
style = _ref.style,
|
|
4392
|
+
testID = _ref.testID,
|
|
4393
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$9);
|
|
4394
|
+
|
|
4395
|
+
var _React$useRef = React.useRef(new Animated.Value(visible ? 1 : 0)),
|
|
4396
|
+
opacity = _React$useRef.current;
|
|
4397
|
+
|
|
4398
|
+
var isFirstRendering = React.useRef(true);
|
|
4399
|
+
React.useEffect(function () {
|
|
4400
|
+
// Do not run animation on very first rendering
|
|
4401
|
+
if (isFirstRendering.current) {
|
|
4402
|
+
isFirstRendering.current = false;
|
|
4403
|
+
return;
|
|
4404
|
+
}
|
|
4405
|
+
|
|
4406
|
+
Animated.timing(opacity, {
|
|
4407
|
+
toValue: visible ? 1 : 0,
|
|
4408
|
+
duration: 150,
|
|
4409
|
+
useNativeDriver: true
|
|
4410
|
+
}).start();
|
|
4411
|
+
}, [visible, opacity]);
|
|
4412
|
+
var content = typeof originalContent === 'number' && originalContent > max ? "".concat(max, "+") : String(originalContent);
|
|
4413
|
+
return /*#__PURE__*/React.createElement(StyledView$1, _extends$3({}, nativeProps, {
|
|
4414
|
+
themeIntent: intent,
|
|
4415
|
+
themePadding: getPaddingState(content),
|
|
4416
|
+
style: [{
|
|
4417
|
+
opacity: opacity,
|
|
4418
|
+
transform: [{
|
|
4419
|
+
scale: opacity.interpolate({
|
|
4420
|
+
inputRange: [0, 1],
|
|
4421
|
+
outputRange: [0.5, 1]
|
|
4422
|
+
})
|
|
4423
|
+
}]
|
|
4424
|
+
}, style],
|
|
4425
|
+
testID: testID
|
|
4426
|
+
}), /*#__PURE__*/React.createElement(StyledText$2, null, content));
|
|
3928
4427
|
};
|
|
3929
4428
|
|
|
4429
|
+
var Badge$1 = Object.assign(Badge, {
|
|
4430
|
+
Status: Status
|
|
4431
|
+
});
|
|
4432
|
+
|
|
3930
4433
|
var dist = {};
|
|
3931
4434
|
|
|
3932
4435
|
function _interopRequireDefault$5(obj) {
|
|
@@ -4678,8 +5181,8 @@ var runtime = {exports: {}};
|
|
|
4678
5181
|
|
|
4679
5182
|
var regenerator = runtime.exports;
|
|
4680
5183
|
|
|
4681
|
-
function _extends() {
|
|
4682
|
-
_extends_1 = _extends = Object.assign || function (target) {
|
|
5184
|
+
function _extends$1() {
|
|
5185
|
+
_extends_1 = _extends$1 = Object.assign || function (target) {
|
|
4683
5186
|
for (var i = 1; i < arguments.length; i++) {
|
|
4684
5187
|
var source = arguments[i];
|
|
4685
5188
|
|
|
@@ -4693,10 +5196,10 @@ function _extends() {
|
|
|
4693
5196
|
return target;
|
|
4694
5197
|
};
|
|
4695
5198
|
|
|
4696
|
-
return _extends.apply(this, arguments);
|
|
5199
|
+
return _extends$1.apply(this, arguments);
|
|
4697
5200
|
}
|
|
4698
5201
|
|
|
4699
|
-
var _extends_1 = _extends;
|
|
5202
|
+
var _extends_1 = _extends$1;
|
|
4700
5203
|
|
|
4701
5204
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
4702
5205
|
if (source == null) return {};
|
|
@@ -4948,7 +5451,7 @@ Object.defineProperty(ensureNativeModuleAvailable$1, "__esModule", {
|
|
|
4948
5451
|
|
|
4949
5452
|
ensureNativeModuleAvailable$1["default"] = ensureNativeModuleAvailable;
|
|
4950
5453
|
|
|
4951
|
-
var _reactNative$2 =
|
|
5454
|
+
var _reactNative$2 = ReactNative__default;
|
|
4952
5455
|
var NativeIconAPI$1 = _reactNative$2.NativeModules.RNVectorIconsManager || _reactNative$2.NativeModules.RNVectorIconsModule;
|
|
4953
5456
|
|
|
4954
5457
|
function ensureNativeModuleAvailable() {
|
|
@@ -5076,7 +5579,7 @@ var _react$2 = _interopRequireWildcard$2(React);
|
|
|
5076
5579
|
|
|
5077
5580
|
var _propTypes$2 = _interopRequireDefault$4(propTypes.exports);
|
|
5078
5581
|
|
|
5079
|
-
var _reactNative$1 =
|
|
5582
|
+
var _reactNative$1 = ReactNative__default;
|
|
5080
5583
|
var _objectUtils = objectUtils;
|
|
5081
5584
|
var _jsxFileName$2 = "/home/runner/work/react-native-vector-icons/react-native-vector-icons/lib/icon-button.js";
|
|
5082
5585
|
|
|
@@ -5258,7 +5761,7 @@ var _react$1 = _interopRequireWildcard$1(React);
|
|
|
5258
5761
|
|
|
5259
5762
|
var _propTypes$1 = _interopRequireDefault$3(propTypes.exports);
|
|
5260
5763
|
|
|
5261
|
-
var _reactNative =
|
|
5764
|
+
var _reactNative = ReactNative__default;
|
|
5262
5765
|
|
|
5263
5766
|
var _ensureNativeModuleAvailable = _interopRequireDefault$3(ensureNativeModuleAvailable$1);
|
|
5264
5767
|
|
|
@@ -5573,7 +6076,7 @@ function createIconSet(glyphMap, fontFamily, fontFile, fontStyle) {
|
|
|
5573
6076
|
|
|
5574
6077
|
var createMultiStyleIconSet$1 = {};
|
|
5575
6078
|
|
|
5576
|
-
function _defineProperty(obj, key, value) {
|
|
6079
|
+
function _defineProperty$1(obj, key, value) {
|
|
5577
6080
|
if (key in obj) {
|
|
5578
6081
|
Object.defineProperty(obj, key, {
|
|
5579
6082
|
value: value,
|
|
@@ -5588,7 +6091,7 @@ function _defineProperty(obj, key, value) {
|
|
|
5588
6091
|
return obj;
|
|
5589
6092
|
}
|
|
5590
6093
|
|
|
5591
|
-
var defineProperty = _defineProperty;
|
|
6094
|
+
var defineProperty = _defineProperty$1;
|
|
5592
6095
|
|
|
5593
6096
|
var _interopRequireDefault$2 = interopRequireDefault;
|
|
5594
6097
|
Object.defineProperty(createMultiStyleIconSet$1, "__esModule", {
|
|
@@ -13556,7 +14059,7 @@ var heroIconConfig = {
|
|
|
13556
14059
|
};
|
|
13557
14060
|
|
|
13558
14061
|
var HeroIcon = dist.createIconSetFromIcoMoon(heroIconConfig, 'hero-icons', 'hero-icons.ttf');
|
|
13559
|
-
var StyledHeroIcon = index$
|
|
14062
|
+
var StyledHeroIcon = index$2(HeroIcon)(function (_ref) {
|
|
13560
14063
|
var themeIntent = _ref.themeIntent,
|
|
13561
14064
|
themeSize = _ref.themeSize,
|
|
13562
14065
|
theme = _ref.theme;
|
|
@@ -13594,7 +14097,7 @@ var FONTWEIGHT_MAP = {
|
|
|
13594
14097
|
regular: 'regular',
|
|
13595
14098
|
'semi-bold': 'semiBold'
|
|
13596
14099
|
};
|
|
13597
|
-
var StyledText = index$
|
|
14100
|
+
var StyledText$1 = index$2(Text$1)(function (_ref) {
|
|
13598
14101
|
var themeFontSize = _ref.themeFontSize,
|
|
13599
14102
|
themeFontWeight = _ref.themeFontWeight,
|
|
13600
14103
|
themeIntent = _ref.themeIntent,
|
|
@@ -13610,7 +14113,7 @@ var StyledText = index$1(Text$1)(function (_ref) {
|
|
|
13610
14113
|
});
|
|
13611
14114
|
});
|
|
13612
14115
|
|
|
13613
|
-
var _excluded$
|
|
14116
|
+
var _excluded$8 = ["children", "fontSize", "fontWeight", "intent"];
|
|
13614
14117
|
|
|
13615
14118
|
var Text = function Text(_ref) {
|
|
13616
14119
|
var children = _ref.children,
|
|
@@ -13620,34 +14123,34 @@ var Text = function Text(_ref) {
|
|
|
13620
14123
|
fontWeight = _ref$fontWeight === void 0 ? 'regular' : _ref$fontWeight,
|
|
13621
14124
|
_ref$intent = _ref.intent,
|
|
13622
14125
|
intent = _ref$intent === void 0 ? 'body' : _ref$intent,
|
|
13623
|
-
nativeProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
14126
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$8);
|
|
13624
14127
|
|
|
13625
|
-
return /*#__PURE__*/React.createElement(StyledText, _extends$
|
|
14128
|
+
return /*#__PURE__*/React.createElement(StyledText$1, _extends$3({}, nativeProps, {
|
|
13626
14129
|
themeFontSize: fontSize,
|
|
13627
14130
|
themeFontWeight: fontWeight,
|
|
13628
14131
|
themeIntent: intent
|
|
13629
|
-
}
|
|
14132
|
+
}), children);
|
|
13630
14133
|
};
|
|
13631
14134
|
|
|
13632
14135
|
var Typography = {
|
|
13633
14136
|
Text: Text
|
|
13634
14137
|
};
|
|
13635
14138
|
|
|
13636
|
-
var BottomNavigationTab = index$
|
|
14139
|
+
var BottomNavigationTab = index$2(View)(function (_ref) {
|
|
13637
14140
|
var themeVisibility = _ref.themeVisibility;
|
|
13638
14141
|
return {
|
|
13639
14142
|
flex: 1,
|
|
13640
14143
|
display: themeVisibility === false ? 'none' : 'flex'
|
|
13641
14144
|
};
|
|
13642
14145
|
});
|
|
13643
|
-
var BottomNavigationContainer = index$
|
|
14146
|
+
var BottomNavigationContainer = index$2(View)({
|
|
13644
14147
|
flex: 1,
|
|
13645
14148
|
overflow: 'hidden'
|
|
13646
14149
|
});
|
|
13647
|
-
var ContentWrapper$
|
|
14150
|
+
var ContentWrapper$2 = index$2(View)({
|
|
13648
14151
|
flex: 1
|
|
13649
14152
|
});
|
|
13650
|
-
var BottomBarWrapper = index$
|
|
14153
|
+
var BottomBarWrapper = index$2(View)(function (_ref2) {
|
|
13651
14154
|
var themeInsets = _ref2.themeInsets,
|
|
13652
14155
|
theme = _ref2.theme;
|
|
13653
14156
|
return {
|
|
@@ -13663,17 +14166,17 @@ var BottomBarWrapper = index$1(View)(function (_ref2) {
|
|
|
13663
14166
|
elevation: theme.__hd__.bottomNavigation.shadows.elevation
|
|
13664
14167
|
};
|
|
13665
14168
|
});
|
|
13666
|
-
var BottomBar = index$
|
|
14169
|
+
var BottomBar = index$2(View)({
|
|
13667
14170
|
flex: 1,
|
|
13668
14171
|
flexDirection: 'row',
|
|
13669
14172
|
overflow: 'hidden',
|
|
13670
14173
|
alignItems: 'center'
|
|
13671
14174
|
});
|
|
13672
|
-
var BottomBarItem = index$
|
|
14175
|
+
var BottomBarItem = index$2(View)({
|
|
13673
14176
|
flex: 1,
|
|
13674
14177
|
alignItems: 'center'
|
|
13675
14178
|
});
|
|
13676
|
-
var StyledBottomBarText = index$
|
|
14179
|
+
var StyledBottomBarText = index$2(Typography.Text)(function (_ref3) {
|
|
13677
14180
|
var theme = _ref3.theme;
|
|
13678
14181
|
return {
|
|
13679
14182
|
marginTop: theme.__hd__.bottomNavigation.space.titleMarginTop
|
|
@@ -13683,7 +14186,7 @@ var StyledBottomBarText = index$1(Typography.Text)(function (_ref3) {
|
|
|
13683
14186
|
var isIOS = Platform.OS === 'ios';
|
|
13684
14187
|
Platform.OS === 'android';
|
|
13685
14188
|
|
|
13686
|
-
var _excluded$
|
|
14189
|
+
var _excluded$7 = ["onTabPress", "renderActiveTabOnly", "selectedTabKey", "tabs"];
|
|
13687
14190
|
|
|
13688
14191
|
var getInactiveIcon = function getInactiveIcon(icon) {
|
|
13689
14192
|
var inactiveIcon = "".concat(icon, "-outlined");
|
|
@@ -13696,7 +14199,7 @@ var BottomNavigation = function BottomNavigation(_ref) {
|
|
|
13696
14199
|
renderActiveTabOnly = _ref$renderActiveTabO === void 0 ? false : _ref$renderActiveTabO,
|
|
13697
14200
|
selectedTabKey = _ref.selectedTabKey,
|
|
13698
14201
|
tabs = _ref.tabs,
|
|
13699
|
-
nativeProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
14202
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$7);
|
|
13700
14203
|
|
|
13701
14204
|
var insets = useSafeAreaInsets();
|
|
13702
14205
|
/**
|
|
@@ -13715,7 +14218,7 @@ var BottomNavigation = function BottomNavigation(_ref) {
|
|
|
13715
14218
|
});
|
|
13716
14219
|
}
|
|
13717
14220
|
|
|
13718
|
-
return /*#__PURE__*/React.createElement(BottomNavigationContainer, nativeProps, /*#__PURE__*/React.createElement(ContentWrapper$
|
|
14221
|
+
return /*#__PURE__*/React.createElement(BottomNavigationContainer, nativeProps, /*#__PURE__*/React.createElement(ContentWrapper$2, null, tabs.map(function (tab) {
|
|
13719
14222
|
var key = tab.key,
|
|
13720
14223
|
component = tab.component,
|
|
13721
14224
|
testID = tab.testID;
|
|
@@ -13770,388 +14273,1621 @@ var BottomNavigation = function BottomNavigation(_ref) {
|
|
|
13770
14273
|
}))));
|
|
13771
14274
|
};
|
|
13772
14275
|
|
|
13773
|
-
var
|
|
13774
|
-
var hitSlop = _ref.hitSlop,
|
|
13775
|
-
onPress = _ref.onPress,
|
|
13776
|
-
icon = _ref.icon,
|
|
13777
|
-
testID = _ref.testID,
|
|
13778
|
-
style = _ref.style,
|
|
13779
|
-
size = _ref.size,
|
|
13780
|
-
intent = _ref.intent;
|
|
13781
|
-
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
13782
|
-
style: style,
|
|
13783
|
-
onPress: onPress,
|
|
13784
|
-
testID: testID,
|
|
13785
|
-
hitSlop: hitSlop
|
|
13786
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
13787
|
-
icon: icon,
|
|
13788
|
-
size: size,
|
|
13789
|
-
intent: intent
|
|
13790
|
-
}));
|
|
13791
|
-
};
|
|
13792
|
-
|
|
13793
|
-
var Button = {
|
|
13794
|
-
Icon: IconButton
|
|
13795
|
-
};
|
|
13796
|
-
|
|
13797
|
-
var StyledCard = index$1(View)(function (_ref) {
|
|
13798
|
-
var theme = _ref.theme;
|
|
14276
|
+
var genLoadingIndicatorStyles = function genLoadingIndicatorStyles(theme, intent) {
|
|
13799
14277
|
return {
|
|
13800
|
-
|
|
13801
|
-
overflow: 'hidden'
|
|
14278
|
+
backgroundColor: theme.__hd__.button.colors[intent]
|
|
13802
14279
|
};
|
|
13803
|
-
});
|
|
13804
|
-
|
|
13805
|
-
var Card = function Card(props) {
|
|
13806
|
-
return /*#__PURE__*/React.createElement(StyledCard, props);
|
|
13807
|
-
};
|
|
13808
|
-
|
|
13809
|
-
var StyledDivider = index$1(View)(function (_ref) {
|
|
13810
|
-
var themeMarginHorizontal = _ref.themeMarginHorizontal,
|
|
13811
|
-
themeMarginVertical = _ref.themeMarginVertical,
|
|
13812
|
-
theme = _ref.theme;
|
|
13813
|
-
var horizontalMargin = themeMarginHorizontal !== undefined ? {
|
|
13814
|
-
marginHorizontal: theme.__hd__.divider.space[themeMarginHorizontal]
|
|
13815
|
-
} : {};
|
|
13816
|
-
var verticalMargin = themeMarginVertical !== undefined ? {
|
|
13817
|
-
marginVertical: theme.__hd__.divider.space[themeMarginVertical]
|
|
13818
|
-
} : {};
|
|
13819
|
-
return _objectSpread2(_objectSpread2({
|
|
13820
|
-
maxWidth: '100%',
|
|
13821
|
-
borderBottomColor: theme.__hd__.divider.colors["default"],
|
|
13822
|
-
borderBottomWidth: theme.__hd__.divider.borderWidths["default"]
|
|
13823
|
-
}, horizontalMargin), verticalMargin);
|
|
13824
|
-
});
|
|
13825
|
-
|
|
13826
|
-
var _excluded$2 = ["marginHorizontal", "marginVertical", "style", "testID"];
|
|
13827
|
-
|
|
13828
|
-
var Divider = function Divider(_ref) {
|
|
13829
|
-
var marginHorizontal = _ref.marginHorizontal,
|
|
13830
|
-
marginVertical = _ref.marginVertical,
|
|
13831
|
-
style = _ref.style,
|
|
13832
|
-
testID = _ref.testID,
|
|
13833
|
-
nativeProps = _objectWithoutProperties$1(_ref, _excluded$2);
|
|
13834
|
-
|
|
13835
|
-
return /*#__PURE__*/React.createElement(StyledDivider, _extends$2({
|
|
13836
|
-
themeMarginHorizontal: marginHorizontal,
|
|
13837
|
-
themeMarginVertical: marginVertical,
|
|
13838
|
-
style: style,
|
|
13839
|
-
testID: testID
|
|
13840
|
-
}, nativeProps));
|
|
13841
14280
|
};
|
|
13842
14281
|
|
|
13843
|
-
var
|
|
14282
|
+
var StyledLoadingIndicatorWrapper = index$2(View)(function (_ref) {
|
|
13844
14283
|
var theme = _ref.theme;
|
|
13845
14284
|
return {
|
|
13846
|
-
|
|
13847
|
-
width: theme.__hd__.fab.sizes.width,
|
|
13848
|
-
backgroundColor: theme.__hd__.fab.colors.buttonBackground,
|
|
13849
|
-
borderRadius: 999,
|
|
13850
|
-
alignItems: 'center',
|
|
14285
|
+
flexDirection: 'row',
|
|
13851
14286
|
justifyContent: 'center',
|
|
13852
|
-
|
|
14287
|
+
alignItems: 'center',
|
|
14288
|
+
paddingVertical: theme.space.xxsmall
|
|
13853
14289
|
};
|
|
13854
14290
|
});
|
|
13855
|
-
var
|
|
13856
|
-
var
|
|
13857
|
-
|
|
13858
|
-
|
|
13859
|
-
|
|
14291
|
+
var StyledLoadingDot = index$2(View)(function (_ref2) {
|
|
14292
|
+
var _ref2$size = _ref2.size,
|
|
14293
|
+
size = _ref2$size === void 0 ? 12 : _ref2$size,
|
|
14294
|
+
themeVariant = _ref2.themeVariant,
|
|
14295
|
+
theme = _ref2.theme;
|
|
14296
|
+
|
|
14297
|
+
var themeStyling = function themeStyling() {
|
|
14298
|
+
switch (themeVariant) {
|
|
14299
|
+
case 'basic-transparent':
|
|
14300
|
+
case 'filled-primary':
|
|
14301
|
+
case 'filled-secondary':
|
|
14302
|
+
return {
|
|
14303
|
+
backgroundColor: theme.__hd__.button.colors.invertedText
|
|
14304
|
+
};
|
|
14305
|
+
|
|
14306
|
+
case 'outlined-primary':
|
|
14307
|
+
return genLoadingIndicatorStyles(theme, 'primary');
|
|
14308
|
+
|
|
14309
|
+
case 'outlined-secondary':
|
|
14310
|
+
return genLoadingIndicatorStyles(theme, 'secondary');
|
|
14311
|
+
}
|
|
13860
14312
|
};
|
|
14313
|
+
|
|
14314
|
+
return _objectSpread2({
|
|
14315
|
+
width: size,
|
|
14316
|
+
height: size,
|
|
14317
|
+
marginTop: theme.space.xsmall,
|
|
14318
|
+
marginBottom: theme.space.xsmall,
|
|
14319
|
+
marginHorizontal: theme.space.small,
|
|
14320
|
+
borderRadius: theme.space.small
|
|
14321
|
+
}, themeStyling());
|
|
13861
14322
|
});
|
|
13862
14323
|
|
|
13863
|
-
var _excluded$
|
|
13864
|
-
var
|
|
14324
|
+
var _excluded$6 = ["count", "size", "testID", "themeVariant"];
|
|
14325
|
+
var AnimatedLoadingIndicatorWrapper = Animated.createAnimatedComponent(StyledLoadingIndicatorWrapper);
|
|
14326
|
+
var AnimatedLoadingDot = Animated.createAnimatedComponent(StyledLoadingDot);
|
|
13865
14327
|
|
|
13866
|
-
var
|
|
13867
|
-
var
|
|
13868
|
-
|
|
14328
|
+
var renderDotComponent = function renderDotComponent(_ref) {
|
|
14329
|
+
var index = _ref.index,
|
|
14330
|
+
size = _ref.size,
|
|
14331
|
+
count = _ref.count,
|
|
14332
|
+
animation = _ref.animation,
|
|
14333
|
+
themeVariant = _ref.themeVariant;
|
|
14334
|
+
var interpolatedProgressAnimation = animation.current.interpolate({
|
|
14335
|
+
inputRange: [0.0, (index + 0.5) / (count + 1), (index + 1.0) / (count + 1), (index + 1.5) / (count + 1), 1.0],
|
|
14336
|
+
outputRange: [1.0, 1.36, 1.56, 1.06, 1.0]
|
|
14337
|
+
});
|
|
14338
|
+
return /*#__PURE__*/React.createElement(Animated.View, {
|
|
14339
|
+
style: StyleSheet$1.flatten([{
|
|
14340
|
+
transform: [{
|
|
14341
|
+
scale: interpolatedProgressAnimation
|
|
14342
|
+
}]
|
|
14343
|
+
}]),
|
|
14344
|
+
key: index
|
|
14345
|
+
}, /*#__PURE__*/React.createElement(AnimatedLoadingDot, {
|
|
14346
|
+
size: size,
|
|
14347
|
+
themeVariant: themeVariant
|
|
14348
|
+
}));
|
|
14349
|
+
};
|
|
13869
14350
|
|
|
13870
|
-
|
|
14351
|
+
var LoadingIndicator = function LoadingIndicator(_ref2) {
|
|
14352
|
+
var _ref2$count = _ref2.count,
|
|
14353
|
+
count = _ref2$count === void 0 ? 3 : _ref2$count,
|
|
14354
|
+
_ref2$size = _ref2.size,
|
|
14355
|
+
size = _ref2$size === void 0 ? 12 : _ref2$size,
|
|
14356
|
+
testID = _ref2.testID,
|
|
14357
|
+
themeVariant = _ref2.themeVariant,
|
|
14358
|
+
nativeProps = _objectWithoutProperties$1(_ref2, _excluded$6);
|
|
14359
|
+
|
|
14360
|
+
var progressAnimation = useRef(new Animated.Value(0));
|
|
13871
14361
|
useEffect(function () {
|
|
13872
|
-
var animation = Animated.timing(
|
|
13873
|
-
toValue:
|
|
14362
|
+
var animation = Animated.loop(Animated.timing(progressAnimation.current, {
|
|
14363
|
+
toValue: 1,
|
|
14364
|
+
duration: 1200,
|
|
14365
|
+
easing: Easing.linear,
|
|
13874
14366
|
useNativeDriver: true
|
|
13875
|
-
});
|
|
14367
|
+
}));
|
|
13876
14368
|
animation.start();
|
|
13877
14369
|
return function () {
|
|
13878
14370
|
animation.stop();
|
|
13879
14371
|
};
|
|
13880
|
-
}, [
|
|
13881
|
-
|
|
13882
|
-
|
|
13883
|
-
|
|
13884
|
-
|
|
13885
|
-
|
|
13886
|
-
|
|
13887
|
-
|
|
13888
|
-
|
|
13889
|
-
|
|
13890
|
-
|
|
13891
|
-
|
|
14372
|
+
}, []);
|
|
14373
|
+
|
|
14374
|
+
var renderLoadingDot = function renderLoadingDot(item, index) {
|
|
14375
|
+
if (typeof renderDotComponent === 'function') {
|
|
14376
|
+
return renderDotComponent({
|
|
14377
|
+
index: index,
|
|
14378
|
+
count: count,
|
|
14379
|
+
size: size,
|
|
14380
|
+
animation: progressAnimation,
|
|
14381
|
+
themeVariant: themeVariant
|
|
14382
|
+
});
|
|
14383
|
+
}
|
|
14384
|
+
|
|
14385
|
+
return null;
|
|
14386
|
+
};
|
|
14387
|
+
|
|
14388
|
+
return /*#__PURE__*/React.createElement(AnimatedLoadingIndicatorWrapper, _extends$3({
|
|
14389
|
+
testID: testID
|
|
14390
|
+
}, nativeProps), Array.from(new Array(count), renderLoadingDot, themeVariant));
|
|
13892
14391
|
};
|
|
13893
14392
|
|
|
13894
|
-
var
|
|
13895
|
-
|
|
13896
|
-
|
|
13897
|
-
animated = _ref.animated,
|
|
13898
|
-
testID = _ref.testID,
|
|
13899
|
-
active = _ref.active,
|
|
13900
|
-
style = _ref.style;
|
|
13901
|
-
return /*#__PURE__*/React.createElement(StyledFABContainer, {
|
|
13902
|
-
testID: testID,
|
|
13903
|
-
onPress: onPress,
|
|
13904
|
-
activeOpacity: 0.6,
|
|
13905
|
-
style: style
|
|
13906
|
-
}, animated ? /*#__PURE__*/React.createElement(AnimatedFABIcon, {
|
|
13907
|
-
active: active,
|
|
13908
|
-
icon: icon,
|
|
13909
|
-
testID: "animated-fab-icon"
|
|
13910
|
-
}) : /*#__PURE__*/React.createElement(StyledFABIcon, {
|
|
13911
|
-
icon: icon,
|
|
13912
|
-
testID: "styled-fab-icon"
|
|
13913
|
-
}));
|
|
14393
|
+
var PRESSED_COLORS = {
|
|
14394
|
+
primary: 'pressedPrimary',
|
|
14395
|
+
secondary: 'pressedSecondary'
|
|
13914
14396
|
};
|
|
13915
14397
|
|
|
13916
|
-
var
|
|
13917
|
-
var
|
|
13918
|
-
|
|
13919
|
-
|
|
13920
|
-
|
|
13921
|
-
|
|
13922
|
-
|
|
13923
|
-
|
|
13924
|
-
|
|
13925
|
-
|
|
13926
|
-
|
|
14398
|
+
var genBasicTransparentContainerStyles = function genBasicTransparentContainerStyles(theme, pressed, disabled) {
|
|
14399
|
+
var borderColorStyling = function borderColorStyling() {
|
|
14400
|
+
if (disabled) {
|
|
14401
|
+
return {
|
|
14402
|
+
borderColor: theme.__hd__.button.colors.disabledBorder
|
|
14403
|
+
};
|
|
14404
|
+
}
|
|
14405
|
+
|
|
14406
|
+
return {
|
|
14407
|
+
borderColor: theme.__hd__.button.colors.invertedText
|
|
14408
|
+
};
|
|
14409
|
+
};
|
|
14410
|
+
|
|
14411
|
+
return _objectSpread2({
|
|
14412
|
+
width: '100%',
|
|
13927
14413
|
flexDirection: 'row',
|
|
14414
|
+
justifyContent: 'center',
|
|
13928
14415
|
alignItems: 'center',
|
|
13929
|
-
|
|
14416
|
+
padding: theme.__hd__.button.space.buttonPadding - theme.__hd__.button.borderWidth["default"],
|
|
14417
|
+
borderWidth: theme.__hd__.button.borderWidth["default"],
|
|
14418
|
+
borderRadius: theme.__hd__.button.radii["default"],
|
|
14419
|
+
backgroundColor: 'transparent',
|
|
14420
|
+
opacity: pressed ? 0.6 : 1
|
|
14421
|
+
}, borderColorStyling());
|
|
14422
|
+
};
|
|
14423
|
+
|
|
14424
|
+
var genFilledContainerStyles = function genFilledContainerStyles(theme, intent, pressed, disabled) {
|
|
14425
|
+
var backgroundColorStyling = function backgroundColorStyling() {
|
|
14426
|
+
if (disabled) {
|
|
14427
|
+
return {
|
|
14428
|
+
backgroundColor: theme.__hd__.button.colors.disabledBorder
|
|
14429
|
+
};
|
|
14430
|
+
}
|
|
14431
|
+
|
|
14432
|
+
if (pressed) {
|
|
14433
|
+
return {
|
|
14434
|
+
backgroundColor: theme.__hd__.button.colors[PRESSED_COLORS[intent]]
|
|
14435
|
+
};
|
|
14436
|
+
}
|
|
14437
|
+
|
|
14438
|
+
return {
|
|
14439
|
+
backgroundColor: theme.__hd__.button.colors[intent]
|
|
14440
|
+
};
|
|
14441
|
+
};
|
|
14442
|
+
|
|
14443
|
+
return _objectSpread2({
|
|
14444
|
+
width: '100%',
|
|
14445
|
+
flexDirection: 'row',
|
|
14446
|
+
justifyContent: 'center',
|
|
14447
|
+
alignItems: 'center',
|
|
14448
|
+
padding: theme.__hd__.button.space.buttonPadding,
|
|
14449
|
+
borderRadius: theme.__hd__.button.radii["default"]
|
|
14450
|
+
}, backgroundColorStyling());
|
|
14451
|
+
};
|
|
14452
|
+
|
|
14453
|
+
var genOutlineContainerStyles = function genOutlineContainerStyles(theme, intent, pressed, disabled) {
|
|
14454
|
+
var borderColorStyling = function borderColorStyling() {
|
|
14455
|
+
if (disabled) {
|
|
14456
|
+
return {
|
|
14457
|
+
borderColor: theme.__hd__.button.colors.disabledBorder
|
|
14458
|
+
};
|
|
14459
|
+
}
|
|
14460
|
+
|
|
14461
|
+
if (pressed) {
|
|
14462
|
+
return {
|
|
14463
|
+
borderColor: theme.__hd__.button.colors[PRESSED_COLORS[intent]]
|
|
14464
|
+
};
|
|
14465
|
+
}
|
|
14466
|
+
|
|
14467
|
+
return {
|
|
14468
|
+
borderColor: theme.__hd__.button.colors[intent]
|
|
14469
|
+
};
|
|
14470
|
+
};
|
|
14471
|
+
|
|
14472
|
+
return _objectSpread2({
|
|
14473
|
+
width: '100%',
|
|
14474
|
+
flexDirection: 'row',
|
|
14475
|
+
justifyContent: 'center',
|
|
14476
|
+
alignItems: 'center',
|
|
14477
|
+
padding: theme.__hd__.button.space.buttonPadding - theme.__hd__.button.borderWidth["default"],
|
|
14478
|
+
borderWidth: theme.__hd__.button.borderWidth["default"],
|
|
14479
|
+
borderRadius: theme.__hd__.button.radii["default"],
|
|
14480
|
+
backgroundColor: 'transparent'
|
|
14481
|
+
}, borderColorStyling());
|
|
14482
|
+
};
|
|
14483
|
+
|
|
14484
|
+
var genOutlineTextStyles = function genOutlineTextStyles(theme, intent, pressed, disabled) {
|
|
14485
|
+
var textColorStyling = function textColorStyling() {
|
|
14486
|
+
if (disabled) {
|
|
14487
|
+
return {
|
|
14488
|
+
color: theme.__hd__.button.colors.disabledText
|
|
14489
|
+
};
|
|
14490
|
+
}
|
|
14491
|
+
|
|
14492
|
+
if (pressed) {
|
|
14493
|
+
return {
|
|
14494
|
+
color: theme.__hd__.button.colors[PRESSED_COLORS[intent]]
|
|
14495
|
+
};
|
|
14496
|
+
}
|
|
14497
|
+
|
|
14498
|
+
return {
|
|
14499
|
+
color: theme.__hd__.button.colors[intent]
|
|
14500
|
+
};
|
|
14501
|
+
};
|
|
14502
|
+
|
|
14503
|
+
return _objectSpread2({
|
|
14504
|
+
fontSize: theme.__hd__.button.fontSize["default"],
|
|
14505
|
+
lineHeight: theme.__hd__.button.lineHeight["default"]
|
|
14506
|
+
}, textColorStyling());
|
|
14507
|
+
};
|
|
14508
|
+
|
|
14509
|
+
var StyledButtonContainer = index$2(View)(function (_ref) {
|
|
14510
|
+
var _ref$disabled = _ref.disabled,
|
|
14511
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
14512
|
+
_ref$pressed = _ref.pressed,
|
|
14513
|
+
pressed = _ref$pressed === void 0 ? false : _ref$pressed,
|
|
14514
|
+
themeVariant = _ref.themeVariant,
|
|
14515
|
+
theme = _ref.theme;
|
|
14516
|
+
|
|
14517
|
+
switch (themeVariant) {
|
|
14518
|
+
case 'basic-transparent':
|
|
14519
|
+
return genBasicTransparentContainerStyles(theme, pressed, disabled);
|
|
14520
|
+
|
|
14521
|
+
case 'filled-primary':
|
|
14522
|
+
return genFilledContainerStyles(theme, 'primary', pressed, disabled);
|
|
14523
|
+
|
|
14524
|
+
case 'filled-secondary':
|
|
14525
|
+
return genFilledContainerStyles(theme, 'secondary', pressed, disabled);
|
|
14526
|
+
|
|
14527
|
+
case 'outlined-primary':
|
|
14528
|
+
return genOutlineContainerStyles(theme, 'primary', pressed, disabled);
|
|
14529
|
+
|
|
14530
|
+
case 'outlined-secondary':
|
|
14531
|
+
return genOutlineContainerStyles(theme, 'secondary', pressed, disabled);
|
|
14532
|
+
}
|
|
14533
|
+
});
|
|
14534
|
+
var StyledButtonText = index$2(Typography.Text)(function (_ref2) {
|
|
14535
|
+
var disabled = _ref2.disabled,
|
|
14536
|
+
pressed = _ref2.pressed,
|
|
14537
|
+
themeVariant = _ref2.themeVariant,
|
|
14538
|
+
theme = _ref2.theme;
|
|
14539
|
+
|
|
14540
|
+
var themeStyling = function themeStyling() {
|
|
14541
|
+
switch (themeVariant) {
|
|
14542
|
+
case 'basic-transparent':
|
|
14543
|
+
return {
|
|
14544
|
+
fontSize: theme.__hd__.button.fontSize["default"],
|
|
14545
|
+
lineHeight: theme.__hd__.button.lineHeight["default"],
|
|
14546
|
+
color: disabled ? theme.__hd__.button.colors.disabledText : theme.__hd__.button.colors.invertedText
|
|
14547
|
+
};
|
|
14548
|
+
|
|
14549
|
+
case 'filled-primary':
|
|
14550
|
+
case 'filled-secondary':
|
|
14551
|
+
return {
|
|
14552
|
+
fontSize: theme.__hd__.button.fontSize["default"],
|
|
14553
|
+
lineHeight: theme.__hd__.button.lineHeight["default"],
|
|
14554
|
+
color: theme.__hd__.button.colors.invertedText
|
|
14555
|
+
};
|
|
14556
|
+
|
|
14557
|
+
case 'outlined-primary':
|
|
14558
|
+
return genOutlineTextStyles(theme, 'primary', pressed, disabled);
|
|
14559
|
+
|
|
14560
|
+
case 'outlined-secondary':
|
|
14561
|
+
return genOutlineTextStyles(theme, 'secondary', pressed, disabled);
|
|
14562
|
+
}
|
|
14563
|
+
};
|
|
14564
|
+
|
|
14565
|
+
return _objectSpread2({
|
|
14566
|
+
flexShrink: 1,
|
|
14567
|
+
textAlign: 'center',
|
|
14568
|
+
fontFamily: theme.__hd__.button.fonts["default"]
|
|
14569
|
+
}, themeStyling());
|
|
14570
|
+
});
|
|
14571
|
+
var StyledButtonIconWrapper = index$2(View)(function (_ref3) {
|
|
14572
|
+
var themePosition = _ref3.themePosition,
|
|
14573
|
+
theme = _ref3.theme;
|
|
14574
|
+
|
|
14575
|
+
switch (themePosition) {
|
|
14576
|
+
case 'left':
|
|
14577
|
+
return {
|
|
14578
|
+
paddingRight: theme.__hd__.button.space.iconPadding
|
|
14579
|
+
};
|
|
14580
|
+
|
|
14581
|
+
case 'right':
|
|
14582
|
+
return {
|
|
14583
|
+
paddingLeft: theme.__hd__.button.space.iconPadding
|
|
14584
|
+
};
|
|
14585
|
+
}
|
|
14586
|
+
});
|
|
14587
|
+
var StyledButtonIcon = index$2(Icon)(function (_ref4) {
|
|
14588
|
+
var disabled = _ref4.disabled,
|
|
14589
|
+
pressed = _ref4.pressed,
|
|
14590
|
+
themeVariant = _ref4.themeVariant,
|
|
14591
|
+
theme = _ref4.theme;
|
|
14592
|
+
|
|
14593
|
+
var themeStyling = function themeStyling() {
|
|
14594
|
+
switch (themeVariant) {
|
|
14595
|
+
case 'basic-transparent':
|
|
14596
|
+
return {
|
|
14597
|
+
color: disabled ? theme.__hd__.button.colors.disabledText : theme.__hd__.button.colors.invertedText
|
|
14598
|
+
};
|
|
14599
|
+
|
|
14600
|
+
case 'filled-primary':
|
|
14601
|
+
case 'filled-secondary':
|
|
14602
|
+
return {
|
|
14603
|
+
color: theme.__hd__.button.colors.invertedText
|
|
14604
|
+
};
|
|
14605
|
+
|
|
14606
|
+
case 'outlined-primary':
|
|
14607
|
+
return genOutlineTextStyles(theme, 'primary', pressed, disabled);
|
|
14608
|
+
|
|
14609
|
+
case 'outlined-secondary':
|
|
14610
|
+
return genOutlineTextStyles(theme, 'secondary', pressed, disabled);
|
|
14611
|
+
}
|
|
14612
|
+
};
|
|
14613
|
+
|
|
14614
|
+
return _objectSpread2({
|
|
14615
|
+
fontSize: theme.__hd__.button.sizes.iconSize
|
|
14616
|
+
}, themeStyling());
|
|
14617
|
+
});
|
|
14618
|
+
|
|
14619
|
+
var FILLED_VARIANTS = {
|
|
14620
|
+
primary: 'filled-primary',
|
|
14621
|
+
secondary: 'filled-secondary'
|
|
14622
|
+
};
|
|
14623
|
+
var OUTLINED_VARIANTS = {
|
|
14624
|
+
primary: 'outlined-primary',
|
|
14625
|
+
secondary: 'outlined-secondary'
|
|
14626
|
+
};
|
|
14627
|
+
var getThemeVariant = function getThemeVariant(variant, intent) {
|
|
14628
|
+
switch (variant) {
|
|
14629
|
+
case 'basic-transparent':
|
|
14630
|
+
return variant;
|
|
14631
|
+
|
|
14632
|
+
case 'filled':
|
|
14633
|
+
return FILLED_VARIANTS[intent];
|
|
14634
|
+
|
|
14635
|
+
case 'outlined':
|
|
14636
|
+
return OUTLINED_VARIANTS[intent];
|
|
14637
|
+
}
|
|
14638
|
+
};
|
|
14639
|
+
|
|
14640
|
+
var Button = function Button(_ref) {
|
|
14641
|
+
var accessibilityHint = _ref.accessibilityHint,
|
|
14642
|
+
accessibilityLabel = _ref.accessibilityLabel,
|
|
14643
|
+
_ref$disabled = _ref.disabled,
|
|
14644
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
14645
|
+
icon = _ref.icon,
|
|
14646
|
+
_ref$intent = _ref.intent,
|
|
14647
|
+
intent = _ref$intent === void 0 ? 'primary' : _ref$intent,
|
|
14648
|
+
_ref$loading = _ref.loading,
|
|
14649
|
+
loading = _ref$loading === void 0 ? false : _ref$loading,
|
|
14650
|
+
onPress = _ref.onPress,
|
|
14651
|
+
rightIcon = _ref.rightIcon,
|
|
14652
|
+
style = _ref.style,
|
|
14653
|
+
testID = _ref.testID,
|
|
14654
|
+
text = _ref.text,
|
|
14655
|
+
_ref$variant = _ref.variant,
|
|
14656
|
+
variant = _ref$variant === void 0 ? 'filled' : _ref$variant;
|
|
14657
|
+
return /*#__PURE__*/React.createElement(Pressable, {
|
|
14658
|
+
accessibilityHint: accessibilityHint,
|
|
14659
|
+
accessibilityLabel: accessibilityLabel,
|
|
14660
|
+
disabled: disabled || loading,
|
|
14661
|
+
onPress: onPress,
|
|
14662
|
+
testID: testID
|
|
14663
|
+
}, function (_ref2) {
|
|
14664
|
+
var pressed = _ref2.pressed;
|
|
14665
|
+
return /*#__PURE__*/React.createElement(StyledButtonContainer, {
|
|
14666
|
+
disabled: disabled,
|
|
14667
|
+
pressed: pressed,
|
|
14668
|
+
style: style,
|
|
14669
|
+
themeVariant: getThemeVariant(variant, intent)
|
|
14670
|
+
}, loading === true ? /*#__PURE__*/React.createElement(LoadingIndicator, {
|
|
14671
|
+
testID: "".concat(testID, "-loading-indicator"),
|
|
14672
|
+
themeVariant: getThemeVariant(variant, intent)
|
|
14673
|
+
}) : /*#__PURE__*/React.createElement(React.Fragment, null, icon !== undefined && /*#__PURE__*/React.createElement(StyledButtonIconWrapper, {
|
|
14674
|
+
themePosition: "left"
|
|
14675
|
+
}, /*#__PURE__*/React.createElement(StyledButtonIcon, {
|
|
14676
|
+
disabled: disabled,
|
|
14677
|
+
icon: icon,
|
|
14678
|
+
pressed: pressed,
|
|
14679
|
+
testID: "".concat(testID, "-left-icon"),
|
|
14680
|
+
themeVariant: getThemeVariant(variant, intent)
|
|
14681
|
+
})), /*#__PURE__*/React.createElement(StyledButtonText, {
|
|
14682
|
+
disabled: disabled,
|
|
14683
|
+
ellipsizeMode: "tail",
|
|
14684
|
+
numberOfLines: 1,
|
|
14685
|
+
pressed: pressed,
|
|
14686
|
+
themeVariant: getThemeVariant(variant, intent)
|
|
14687
|
+
}, text), rightIcon !== undefined && /*#__PURE__*/React.createElement(StyledButtonIconWrapper, {
|
|
14688
|
+
themePosition: "right"
|
|
14689
|
+
}, /*#__PURE__*/React.createElement(StyledButtonIcon, {
|
|
14690
|
+
disabled: disabled,
|
|
14691
|
+
icon: rightIcon,
|
|
14692
|
+
pressed: pressed,
|
|
14693
|
+
testID: "".concat(testID, "-right-icon"),
|
|
14694
|
+
themeVariant: getThemeVariant(variant, intent)
|
|
14695
|
+
}))));
|
|
14696
|
+
});
|
|
14697
|
+
};
|
|
14698
|
+
|
|
14699
|
+
var IconButton = function IconButton(_ref) {
|
|
14700
|
+
var hitSlop = _ref.hitSlop,
|
|
14701
|
+
onPress = _ref.onPress,
|
|
14702
|
+
icon = _ref.icon,
|
|
14703
|
+
testID = _ref.testID,
|
|
14704
|
+
style = _ref.style,
|
|
14705
|
+
size = _ref.size,
|
|
14706
|
+
intent = _ref.intent;
|
|
14707
|
+
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
14708
|
+
style: style,
|
|
14709
|
+
onPress: onPress,
|
|
14710
|
+
testID: testID,
|
|
14711
|
+
hitSlop: hitSlop
|
|
14712
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
14713
|
+
icon: icon,
|
|
14714
|
+
size: size,
|
|
14715
|
+
intent: intent
|
|
14716
|
+
}));
|
|
14717
|
+
};
|
|
14718
|
+
|
|
14719
|
+
var CompoundButton = Button;
|
|
14720
|
+
CompoundButton.Icon = IconButton;
|
|
14721
|
+
|
|
14722
|
+
var StyledCard = index$2(View)(function (_ref) {
|
|
14723
|
+
var themeVariant = _ref.themeVariant,
|
|
14724
|
+
theme = _ref.theme;
|
|
14725
|
+
var sharedStyles = {
|
|
14726
|
+
borderRadius: theme.__hd__.card.radii["default"],
|
|
13930
14727
|
overflow: 'hidden'
|
|
13931
14728
|
};
|
|
14729
|
+
var dataStyles = {
|
|
14730
|
+
flex: 1,
|
|
14731
|
+
flexDirection: 'row'
|
|
14732
|
+
};
|
|
14733
|
+
|
|
14734
|
+
switch (themeVariant) {
|
|
14735
|
+
case 'basic':
|
|
14736
|
+
return sharedStyles;
|
|
14737
|
+
|
|
14738
|
+
case 'data':
|
|
14739
|
+
return _objectSpread2(_objectSpread2({}, sharedStyles), dataStyles);
|
|
14740
|
+
}
|
|
13932
14741
|
});
|
|
13933
|
-
var
|
|
14742
|
+
var LeftDataCard = index$2(View)(function (_ref2) {
|
|
13934
14743
|
var theme = _ref2.theme;
|
|
13935
14744
|
return {
|
|
13936
|
-
|
|
13937
|
-
|
|
13938
|
-
|
|
13939
|
-
fontFamily: theme.__hd__.fab.fonts.actionItemText
|
|
14745
|
+
backgroundColor: theme.__hd__.card.colors.dataCardIndicator,
|
|
14746
|
+
width: scale(16),
|
|
14747
|
+
height: '100%'
|
|
13940
14748
|
};
|
|
13941
14749
|
});
|
|
13942
14750
|
|
|
13943
|
-
var
|
|
13944
|
-
|
|
13945
|
-
|
|
13946
|
-
|
|
14751
|
+
var _excluded$5 = ["variant", "children"];
|
|
14752
|
+
|
|
14753
|
+
var Card = function Card(_ref) {
|
|
14754
|
+
var _ref$variant = _ref.variant,
|
|
14755
|
+
variant = _ref$variant === void 0 ? 'basic' : _ref$variant,
|
|
14756
|
+
children = _ref.children,
|
|
14757
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$5);
|
|
14758
|
+
|
|
14759
|
+
return /*#__PURE__*/React.createElement(StyledCard, _extends$3({}, nativeProps, {
|
|
14760
|
+
testID: "card",
|
|
14761
|
+
themeVariant: variant
|
|
14762
|
+
}), variant === 'data' && /*#__PURE__*/React.createElement(LeftDataCard, {
|
|
14763
|
+
testID: "data-card-indicator"
|
|
14764
|
+
}), children);
|
|
14765
|
+
};
|
|
14766
|
+
|
|
14767
|
+
var StyledWrapper$1 = index$2(Animated.View)(function () {
|
|
14768
|
+
return {
|
|
14769
|
+
margin: 0,
|
|
14770
|
+
padding: 0,
|
|
14771
|
+
overflow: 'hidden'
|
|
14772
|
+
};
|
|
14773
|
+
});
|
|
14774
|
+
var StyledChildWrapper = index$2(View)(function () {
|
|
14775
|
+
return {
|
|
14776
|
+
margin: 0,
|
|
14777
|
+
padding: 0
|
|
14778
|
+
};
|
|
14779
|
+
});
|
|
14780
|
+
|
|
14781
|
+
var usePrevious = function usePrevious(value) {
|
|
14782
|
+
var ref = React.useRef();
|
|
14783
|
+
React.useEffect(function () {
|
|
14784
|
+
ref.current = value;
|
|
14785
|
+
}, [value]);
|
|
14786
|
+
return ref.current;
|
|
14787
|
+
};
|
|
14788
|
+
|
|
14789
|
+
var Collapse = function Collapse(_ref) {
|
|
14790
|
+
var _ref$open = _ref.open,
|
|
14791
|
+
open = _ref$open === void 0 ? false : _ref$open,
|
|
14792
|
+
_ref$keepChildrenMoun = _ref.keepChildrenMounted,
|
|
14793
|
+
keepChildrenMounted = _ref$keepChildrenMoun === void 0 ? false : _ref$keepChildrenMoun,
|
|
14794
|
+
children = _ref.children,
|
|
14795
|
+
testID = _ref.testID,
|
|
14796
|
+
style = _ref.style;
|
|
14797
|
+
var collapseAnim = React.useRef(new Animated.Value(0)).current;
|
|
14798
|
+
var innerRef = React.useRef(null);
|
|
14799
|
+
|
|
14800
|
+
var _React$useState = React.useState(0),
|
|
14801
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
14802
|
+
contentHeight = _React$useState2[0],
|
|
14803
|
+
setContentHeight = _React$useState2[1];
|
|
14804
|
+
|
|
14805
|
+
var _React$useState3 = React.useState(0),
|
|
14806
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
14807
|
+
maxHeight = _React$useState4[0],
|
|
14808
|
+
setMaxHeight = _React$useState4[1];
|
|
14809
|
+
|
|
14810
|
+
var _useState = useState(false),
|
|
14811
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
14812
|
+
isWaitingToClose = _useState2[0],
|
|
14813
|
+
setIsWaitingToClose = _useState2[1];
|
|
14814
|
+
|
|
14815
|
+
var _useState3 = useState('percent'),
|
|
14816
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
14817
|
+
heightSource = _useState4[0],
|
|
14818
|
+
setHeightSource = _useState4[1];
|
|
14819
|
+
|
|
14820
|
+
var previousOpenState = usePrevious(open);
|
|
14821
|
+
var animatedCallback = useCallback(function () {
|
|
14822
|
+
if (open === true) {
|
|
14823
|
+
setIsWaitingToClose(true);
|
|
14824
|
+
setMaxHeight(contentHeight);
|
|
14825
|
+
} else {
|
|
14826
|
+
setIsWaitingToClose(false);
|
|
14827
|
+
}
|
|
14828
|
+
}, [open, contentHeight]);
|
|
14829
|
+
useEffect(function () {
|
|
14830
|
+
if (open !== previousOpenState && previousOpenState !== undefined) {
|
|
14831
|
+
var useHeightValue = maxHeight || 100;
|
|
14832
|
+
setHeightSource(useHeightValue > 100 ? 'container' : 'percent');
|
|
14833
|
+
Animated.timing(collapseAnim, {
|
|
14834
|
+
toValue: open ? useHeightValue : 0,
|
|
14835
|
+
easing: Easing.inOut(Easing.ease),
|
|
14836
|
+
useNativeDriver: false
|
|
14837
|
+
}).start(animatedCallback);
|
|
14838
|
+
}
|
|
14839
|
+
}, [open, previousOpenState, maxHeight]);
|
|
14840
|
+
var checkMaxHeight = useCallback(function (_ref2) {
|
|
14841
|
+
var height = _ref2.height;
|
|
14842
|
+
|
|
14843
|
+
if (height > contentHeight) {
|
|
14844
|
+
setContentHeight(height);
|
|
14845
|
+
}
|
|
14846
|
+
}, [contentHeight]);
|
|
14847
|
+
return /*#__PURE__*/React.createElement(StyledWrapper$1, {
|
|
14848
|
+
onLayout: function onLayout(event) {
|
|
14849
|
+
return checkMaxHeight(event.nativeEvent.layout);
|
|
14850
|
+
},
|
|
14851
|
+
style: [style, {
|
|
14852
|
+
maxHeight: heightSource === 'container' ? collapseAnim : collapseAnim.interpolate({
|
|
14853
|
+
inputRange: [0, 100],
|
|
14854
|
+
outputRange: ['0%', '100%']
|
|
14855
|
+
})
|
|
14856
|
+
}],
|
|
14857
|
+
testID: testID
|
|
14858
|
+
}, (keepChildrenMounted === true || open === true || open === false && isWaitingToClose === true) && /*#__PURE__*/React.createElement(StyledChildWrapper, {
|
|
14859
|
+
ref: innerRef
|
|
14860
|
+
}, children));
|
|
14861
|
+
};
|
|
14862
|
+
|
|
14863
|
+
var StyledDivider = index$2(View)(function (_ref) {
|
|
14864
|
+
var themeMarginHorizontal = _ref.themeMarginHorizontal,
|
|
14865
|
+
themeMarginVertical = _ref.themeMarginVertical,
|
|
14866
|
+
theme = _ref.theme;
|
|
14867
|
+
var horizontalMargin = themeMarginHorizontal !== undefined ? {
|
|
14868
|
+
marginHorizontal: theme.__hd__.divider.space[themeMarginHorizontal]
|
|
14869
|
+
} : {};
|
|
14870
|
+
var verticalMargin = themeMarginVertical !== undefined ? {
|
|
14871
|
+
marginVertical: theme.__hd__.divider.space[themeMarginVertical]
|
|
14872
|
+
} : {};
|
|
14873
|
+
return _objectSpread2(_objectSpread2({
|
|
14874
|
+
maxWidth: '100%',
|
|
14875
|
+
borderBottomColor: theme.__hd__.divider.colors["default"],
|
|
14876
|
+
borderBottomWidth: theme.__hd__.divider.borderWidths["default"]
|
|
14877
|
+
}, horizontalMargin), verticalMargin);
|
|
14878
|
+
});
|
|
14879
|
+
|
|
14880
|
+
var _excluded$4 = ["marginHorizontal", "marginVertical", "style", "testID"];
|
|
14881
|
+
|
|
14882
|
+
var Divider = function Divider(_ref) {
|
|
14883
|
+
var marginHorizontal = _ref.marginHorizontal,
|
|
14884
|
+
marginVertical = _ref.marginVertical,
|
|
13947
14885
|
style = _ref.style,
|
|
13948
|
-
testID = _ref.testID
|
|
13949
|
-
|
|
14886
|
+
testID = _ref.testID,
|
|
14887
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$4);
|
|
14888
|
+
|
|
14889
|
+
return /*#__PURE__*/React.createElement(StyledDivider, _extends$3({}, nativeProps, {
|
|
14890
|
+
themeMarginHorizontal: marginHorizontal,
|
|
14891
|
+
themeMarginVertical: marginVertical,
|
|
13950
14892
|
style: style,
|
|
13951
|
-
onPress: onPress,
|
|
13952
14893
|
testID: testID
|
|
13953
|
-
}
|
|
13954
|
-
|
|
13955
|
-
|
|
14894
|
+
}));
|
|
14895
|
+
};
|
|
14896
|
+
|
|
14897
|
+
var AnimatedPressable = Animated.createAnimatedComponent(Pressable);
|
|
14898
|
+
var StyledContainer$1 = index$2(View)(function (_ref) {
|
|
14899
|
+
var theme = _ref.theme,
|
|
14900
|
+
enableShadow = _ref.enableShadow;
|
|
14901
|
+
return _objectSpread2(_objectSpread2({}, StyleSheet$1.absoluteFillObject), {}, {
|
|
14902
|
+
shadowColor: enableShadow ? theme.__hd__.drawer.colors.shadow : 'transparent',
|
|
14903
|
+
shadowOffset: theme.__hd__.drawer.shadows.offset,
|
|
14904
|
+
shadowOpacity: theme.__hd__.drawer.shadows.opacity,
|
|
14905
|
+
shadowRadius: theme.__hd__.drawer.shadows.radius,
|
|
14906
|
+
overflow: 'hidden',
|
|
14907
|
+
zIndex: 9999,
|
|
14908
|
+
elevation: 9999
|
|
14909
|
+
});
|
|
14910
|
+
});
|
|
14911
|
+
var StyledBackdrop$1 = index$2(AnimatedPressable)(function (_ref2) {
|
|
14912
|
+
var theme = _ref2.theme;
|
|
14913
|
+
return _objectSpread2(_objectSpread2({}, StyleSheet$1.absoluteFillObject), {}, {
|
|
14914
|
+
backgroundColor: theme.__hd__.drawer.colors.backdrop
|
|
14915
|
+
});
|
|
14916
|
+
});
|
|
14917
|
+
var StyledDrawerContainer = index$2(Animated.View)(function (_ref3) {
|
|
14918
|
+
var theme = _ref3.theme,
|
|
14919
|
+
enableShadow = _ref3.enableShadow;
|
|
14920
|
+
return {
|
|
14921
|
+
borderBottomLeftRadius: theme.__hd__.drawer.radii["default"],
|
|
14922
|
+
borderBottomRightRadius: theme.__hd__.drawer.radii["default"],
|
|
14923
|
+
backgroundColor: theme.__hd__.drawer.colors.background,
|
|
14924
|
+
elevation: enableShadow ? theme.__hd__.drawer.shadows.elevation : undefined,
|
|
14925
|
+
overflow: 'hidden'
|
|
14926
|
+
};
|
|
14927
|
+
});
|
|
14928
|
+
|
|
14929
|
+
var Drawer = function Drawer(_ref) {
|
|
14930
|
+
var visible = _ref.visible,
|
|
14931
|
+
children = _ref.children,
|
|
14932
|
+
_ref$hasBackdrop = _ref.hasBackdrop,
|
|
14933
|
+
hasBackdrop = _ref$hasBackdrop === void 0 ? true : _ref$hasBackdrop,
|
|
14934
|
+
onDismiss = _ref.onDismiss,
|
|
14935
|
+
testID = _ref.testID;
|
|
14936
|
+
var animatedValue = useRef(new Animated.Value(visible ? 1 : 0)).current;
|
|
14937
|
+
|
|
14938
|
+
var _useState = useState(0),
|
|
14939
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
14940
|
+
height = _useState2[0],
|
|
14941
|
+
setHeight = _useState2[1];
|
|
14942
|
+
|
|
14943
|
+
var enableShadow = visible && !hasBackdrop;
|
|
14944
|
+
var interpolateTranslateY = animatedValue.interpolate({
|
|
14945
|
+
inputRange: [0, 1],
|
|
14946
|
+
outputRange: [-height, 0]
|
|
14947
|
+
});
|
|
14948
|
+
var interpolateBackdropOpacity = hasBackdrop ? animatedValue.interpolate({
|
|
14949
|
+
inputRange: [0, 1],
|
|
14950
|
+
outputRange: [0, 0.35]
|
|
14951
|
+
}) : 0;
|
|
14952
|
+
useEffect(function () {
|
|
14953
|
+
var animation = Animated.timing(animatedValue, {
|
|
14954
|
+
toValue: visible ? 1 : 0,
|
|
14955
|
+
easing: Easing.inOut(Easing.cubic),
|
|
14956
|
+
useNativeDriver: true
|
|
14957
|
+
});
|
|
14958
|
+
animation.start();
|
|
14959
|
+
return function () {
|
|
14960
|
+
return animation.stop();
|
|
14961
|
+
};
|
|
14962
|
+
}, [visible]);
|
|
14963
|
+
return /*#__PURE__*/React.createElement(StyledContainer$1, {
|
|
14964
|
+
testID: testID,
|
|
14965
|
+
enableShadow: enableShadow,
|
|
14966
|
+
pointerEvents: "box-none"
|
|
14967
|
+
}, /*#__PURE__*/React.createElement(StyledBackdrop$1, {
|
|
14968
|
+
pointerEvents: visible ? 'auto' : 'box-none',
|
|
14969
|
+
onPress: onDismiss,
|
|
14970
|
+
style: {
|
|
14971
|
+
opacity: interpolateBackdropOpacity
|
|
14972
|
+
}
|
|
14973
|
+
}), /*#__PURE__*/React.createElement(StyledDrawerContainer, {
|
|
14974
|
+
enableShadow: enableShadow,
|
|
14975
|
+
onLayout: function onLayout(_ref2) {
|
|
14976
|
+
var nativeEvent = _ref2.nativeEvent;
|
|
14977
|
+
return setHeight(nativeEvent.layout.height);
|
|
14978
|
+
},
|
|
14979
|
+
style: {
|
|
14980
|
+
transform: [{
|
|
14981
|
+
translateY: interpolateTranslateY
|
|
14982
|
+
}]
|
|
14983
|
+
}
|
|
14984
|
+
}, children));
|
|
13956
14985
|
};
|
|
13957
14986
|
|
|
13958
|
-
var
|
|
13959
|
-
|
|
13960
|
-
|
|
13961
|
-
|
|
13962
|
-
|
|
13963
|
-
|
|
13964
|
-
|
|
13965
|
-
|
|
13966
|
-
|
|
13967
|
-
|
|
13968
|
-
|
|
13969
|
-
|
|
13970
|
-
|
|
14987
|
+
var StyledFABContainer = index$2(TouchableHighlight)(function (_ref) {
|
|
14988
|
+
var theme = _ref.theme;
|
|
14989
|
+
return {
|
|
14990
|
+
backgroundColor: theme.__hd__.fab.colors.buttonBackground,
|
|
14991
|
+
borderRadius: theme.radii.rounded,
|
|
14992
|
+
alignItems: 'center',
|
|
14993
|
+
justifyContent: 'center',
|
|
14994
|
+
overflow: 'hidden',
|
|
14995
|
+
alignSelf: 'flex-start',
|
|
14996
|
+
paddingHorizontal: theme.__hd__.fab.space.containerPaddingHorizontal,
|
|
14997
|
+
paddingVertical: theme.__hd__.fab.space.containerPaddingVertical,
|
|
14998
|
+
flexDirection: 'row'
|
|
14999
|
+
};
|
|
15000
|
+
});
|
|
15001
|
+
var StyledFABIcon = index$2(Icon)(function (_ref2) {
|
|
15002
|
+
var theme = _ref2.theme;
|
|
15003
|
+
return {
|
|
15004
|
+
color: theme.__hd__.fab.colors.icon,
|
|
15005
|
+
lineHeight: theme.__hd__.fab.lineHeights.icon,
|
|
15006
|
+
textAlignVertical: 'center',
|
|
15007
|
+
textAlign: 'center'
|
|
15008
|
+
};
|
|
15009
|
+
});
|
|
15010
|
+
var StyledFABText = index$2(Text$1)(function (_ref3) {
|
|
15011
|
+
var theme = _ref3.theme;
|
|
15012
|
+
return {
|
|
15013
|
+
fontFamily: theme.__hd__.fab.fonts.title,
|
|
15014
|
+
fontSize: theme.__hd__.fab.fontSizes.title,
|
|
15015
|
+
lineHeight: theme.__hd__.fab.lineHeights.title,
|
|
15016
|
+
color: theme.__hd__.fab.colors.titleText,
|
|
15017
|
+
textAlignVertical: 'center',
|
|
15018
|
+
textAlign: 'center',
|
|
15019
|
+
marginHorizontal: theme.__hd__.fab.space.titleMarginHorizontal
|
|
15020
|
+
};
|
|
15021
|
+
});
|
|
15022
|
+
|
|
15023
|
+
var _excluded$3 = ["active"];
|
|
15024
|
+
var AnimatedIcons = Animated.createAnimatedComponent(StyledFABIcon);
|
|
15025
|
+
|
|
15026
|
+
var AnimatedFABIcon = function AnimatedFABIcon(_ref) {
|
|
15027
|
+
var active = _ref.active,
|
|
15028
|
+
iconProps = _objectWithoutProperties$1(_ref, _excluded$3);
|
|
15029
|
+
|
|
15030
|
+
var rotateAnimation = useRef(new Animated.Value(active ? 1 : 0));
|
|
15031
|
+
useEffect(function () {
|
|
15032
|
+
var animation = Animated.timing(rotateAnimation.current, {
|
|
15033
|
+
toValue: active ? 1 : 0,
|
|
15034
|
+
useNativeDriver: true
|
|
15035
|
+
});
|
|
15036
|
+
animation.start();
|
|
15037
|
+
return function () {
|
|
15038
|
+
animation.stop();
|
|
15039
|
+
};
|
|
15040
|
+
}, [active]);
|
|
15041
|
+
var interpolatedRotateAnimation = rotateAnimation.current.interpolate({
|
|
15042
|
+
inputRange: [0, 1],
|
|
15043
|
+
outputRange: ['0deg', '-45deg']
|
|
15044
|
+
});
|
|
15045
|
+
return /*#__PURE__*/React.createElement(Animated.View, {
|
|
15046
|
+
style: StyleSheet$1.flatten([{
|
|
15047
|
+
transform: [{
|
|
15048
|
+
rotate: interpolatedRotateAnimation
|
|
15049
|
+
}]
|
|
15050
|
+
}])
|
|
15051
|
+
}, /*#__PURE__*/React.createElement(AnimatedIcons, iconProps));
|
|
15052
|
+
};
|
|
15053
|
+
|
|
15054
|
+
var IconOnlyContent = function IconOnlyContent(_ref) {
|
|
15055
|
+
var icon = _ref.icon,
|
|
15056
|
+
animated = _ref.animated,
|
|
15057
|
+
active = _ref.active;
|
|
15058
|
+
|
|
15059
|
+
if (animated) {
|
|
15060
|
+
return /*#__PURE__*/React.createElement(AnimatedFABIcon, {
|
|
15061
|
+
active: active,
|
|
15062
|
+
icon: icon,
|
|
15063
|
+
testID: "animated-fab-icon"
|
|
15064
|
+
});
|
|
15065
|
+
}
|
|
15066
|
+
|
|
15067
|
+
return /*#__PURE__*/React.createElement(StyledFABIcon, {
|
|
15068
|
+
icon: icon,
|
|
15069
|
+
testID: "styled-fab-icon"
|
|
15070
|
+
});
|
|
15071
|
+
};
|
|
15072
|
+
|
|
15073
|
+
var IconWithTextContent = function IconWithTextContent(_ref2) {
|
|
15074
|
+
var icon = _ref2.icon,
|
|
15075
|
+
title = _ref2.title;
|
|
15076
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StyledFABIcon, {
|
|
15077
|
+
size: "xsmall",
|
|
15078
|
+
icon: icon,
|
|
15079
|
+
testID: "styled-fab-icon"
|
|
15080
|
+
}), /*#__PURE__*/React.createElement(StyledFABText, null, title));
|
|
15081
|
+
};
|
|
15082
|
+
|
|
15083
|
+
var FAB = function FAB(_ref3) {
|
|
15084
|
+
var onPress = _ref3.onPress,
|
|
15085
|
+
title = _ref3.title,
|
|
15086
|
+
icon = _ref3.icon,
|
|
15087
|
+
animated = _ref3.animated,
|
|
15088
|
+
testID = _ref3.testID,
|
|
15089
|
+
active = _ref3.active,
|
|
15090
|
+
style = _ref3.style;
|
|
15091
|
+
var isIconOnly = !title;
|
|
15092
|
+
return /*#__PURE__*/React.createElement(StyledFABContainer, {
|
|
15093
|
+
testID: testID,
|
|
15094
|
+
style: style,
|
|
15095
|
+
onPress: onPress,
|
|
15096
|
+
activeOpacity: 0.6
|
|
15097
|
+
}, isIconOnly ? /*#__PURE__*/React.createElement(IconOnlyContent, {
|
|
15098
|
+
animated: animated,
|
|
15099
|
+
active: active,
|
|
15100
|
+
icon: icon
|
|
15101
|
+
}) : /*#__PURE__*/React.createElement(IconWithTextContent, {
|
|
15102
|
+
icon: icon,
|
|
15103
|
+
title: title
|
|
15104
|
+
}));
|
|
15105
|
+
};
|
|
15106
|
+
|
|
15107
|
+
var StyledActionItem = index$2(TouchableOpacity)(function (_ref) {
|
|
15108
|
+
var theme = _ref.theme;
|
|
15109
|
+
return {
|
|
15110
|
+
paddingLeft: theme.__hd__.fab.space.actionItemPaddingLeft,
|
|
15111
|
+
paddingRight: theme.__hd__.fab.space.actionItemPaddingRight,
|
|
15112
|
+
paddingTop: theme.__hd__.fab.space.actionItemPaddingTop,
|
|
15113
|
+
paddingBottom: theme.__hd__.fab.space.actionItemPaddingBottom,
|
|
15114
|
+
margin: theme.__hd__.fab.space.actionItemMargin,
|
|
15115
|
+
marginRight: theme.__hd__.fab.space.actionItemMarginRight,
|
|
15116
|
+
backgroundColor: theme.__hd__.fab.colors.actionItemBackground,
|
|
15117
|
+
borderRadius: theme.__hd__.fab.radii.actionItem,
|
|
15118
|
+
flexDirection: 'row',
|
|
15119
|
+
alignItems: 'center',
|
|
15120
|
+
alignSelf: 'flex-end',
|
|
15121
|
+
overflow: 'hidden'
|
|
15122
|
+
};
|
|
15123
|
+
});
|
|
15124
|
+
var StyledActionItemText = index$2(Typography.Text)(function (_ref2) {
|
|
15125
|
+
var theme = _ref2.theme;
|
|
15126
|
+
return {
|
|
15127
|
+
paddingLeft: theme.__hd__.fab.space.actionItemTextPaddingLeft,
|
|
15128
|
+
fontSize: theme.__hd__.fab.fontSizes.actionItemText,
|
|
15129
|
+
lineHeight: theme.__hd__.fab.lineHeights.actionItemText,
|
|
15130
|
+
fontFamily: theme.__hd__.fab.fonts.actionItemText
|
|
15131
|
+
};
|
|
15132
|
+
});
|
|
15133
|
+
|
|
15134
|
+
var ActionItem = function ActionItem(_ref) {
|
|
15135
|
+
var icon = _ref.icon,
|
|
15136
|
+
title = _ref.title,
|
|
15137
|
+
onPress = _ref.onPress,
|
|
15138
|
+
style = _ref.style,
|
|
15139
|
+
testID = _ref.testID;
|
|
15140
|
+
return /*#__PURE__*/React.createElement(StyledActionItem, {
|
|
15141
|
+
style: style,
|
|
15142
|
+
onPress: onPress,
|
|
15143
|
+
testID: testID
|
|
15144
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
15145
|
+
icon: icon
|
|
15146
|
+
}), /*#__PURE__*/React.createElement(StyledActionItemText, null, title));
|
|
15147
|
+
};
|
|
15148
|
+
|
|
15149
|
+
var StyledContainer = index$2(View)({
|
|
15150
|
+
position: 'absolute',
|
|
15151
|
+
left: 0,
|
|
15152
|
+
right: 0,
|
|
15153
|
+
top: 0,
|
|
15154
|
+
bottom: 0,
|
|
15155
|
+
alignItems: 'flex-end',
|
|
15156
|
+
justifyContent: 'flex-end'
|
|
15157
|
+
});
|
|
15158
|
+
var StyledActionGroupContainer = index$2(Animated.View)({
|
|
15159
|
+
alignItems: 'flex-end',
|
|
15160
|
+
justifyContent: 'flex-end',
|
|
15161
|
+
width: '70%'
|
|
15162
|
+
});
|
|
15163
|
+
var StyledFAB = index$2(FAB)(function (_ref) {
|
|
15164
|
+
var theme = _ref.theme;
|
|
15165
|
+
return {
|
|
15166
|
+
marginRight: theme.__hd__.fab.space.buttonMarginRight,
|
|
15167
|
+
marginTop: theme.__hd__.fab.space.buttonMarginTop,
|
|
15168
|
+
alignSelf: 'flex-end'
|
|
15169
|
+
};
|
|
15170
|
+
});
|
|
15171
|
+
var StyledBackdrop = index$2(Animated.View)(function (_ref2) {
|
|
15172
|
+
var theme = _ref2.theme;
|
|
15173
|
+
return {
|
|
15174
|
+
position: 'absolute',
|
|
15175
|
+
left: 0,
|
|
15176
|
+
right: 0,
|
|
15177
|
+
top: 0,
|
|
15178
|
+
bottom: 0,
|
|
15179
|
+
backgroundColor: theme.__hd__.fab.colors.backdropBackground
|
|
15180
|
+
};
|
|
15181
|
+
});
|
|
15182
|
+
var StyledHeaderText = index$2(Typography.Text)(function (_ref3) {
|
|
15183
|
+
var theme = _ref3.theme;
|
|
15184
|
+
return {
|
|
15185
|
+
fontSize: theme.__hd__.fab.fontSizes.header,
|
|
15186
|
+
lineHeight: theme.__hd__.fab.lineHeights.header,
|
|
15187
|
+
fontFamily: theme.__hd__.fab.fonts.header,
|
|
15188
|
+
marginRight: theme.__hd__.fab.space.headerTextMarginRight,
|
|
15189
|
+
marginBottom: theme.__hd__.fab.space.headerTextMarginBottom,
|
|
15190
|
+
textAlign: 'right'
|
|
15191
|
+
};
|
|
15192
|
+
});
|
|
15193
|
+
|
|
15194
|
+
var ActionItemsListComponent = function ActionItemsListComponent(_ref) {
|
|
15195
|
+
var style = _ref.style,
|
|
15196
|
+
items = _ref.items;
|
|
15197
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
15198
|
+
style: style
|
|
15199
|
+
}, items === null || items === void 0 ? void 0 : items.map(function (itemProp) {
|
|
15200
|
+
return /*#__PURE__*/React.createElement(ActionItem, _extends$3({
|
|
15201
|
+
key: itemProp.icon
|
|
15202
|
+
}, itemProp));
|
|
15203
|
+
}));
|
|
15204
|
+
};
|
|
15205
|
+
|
|
15206
|
+
var ActionGroup = function ActionGroup(_ref2) {
|
|
15207
|
+
var headerTitle = _ref2.headerTitle,
|
|
15208
|
+
onPress = _ref2.onPress,
|
|
15209
|
+
active = _ref2.active,
|
|
15210
|
+
style = _ref2.style,
|
|
15211
|
+
items = _ref2.items,
|
|
15212
|
+
testID = _ref2.testID,
|
|
15213
|
+
fabTitle = _ref2.fabTitle;
|
|
15214
|
+
var tranlateXAnimation = useRef(new Animated.Value(active ? 1 : 0));
|
|
15215
|
+
useEffect(function () {
|
|
15216
|
+
var animation = Animated.timing(tranlateXAnimation.current, {
|
|
15217
|
+
toValue: active ? 1 : 0,
|
|
15218
|
+
useNativeDriver: true
|
|
15219
|
+
});
|
|
15220
|
+
animation.start();
|
|
15221
|
+
}, [active]);
|
|
15222
|
+
var interpolatedTranlateXAnimation = tranlateXAnimation.current.interpolate({
|
|
15223
|
+
inputRange: [0, 1],
|
|
15224
|
+
outputRange: [400, 0]
|
|
15225
|
+
});
|
|
15226
|
+
var interpolatedOpacityAnimation = tranlateXAnimation.current.interpolate({
|
|
15227
|
+
inputRange: [0, 1],
|
|
15228
|
+
outputRange: [0, 0.9]
|
|
15229
|
+
});
|
|
15230
|
+
return /*#__PURE__*/React.createElement(StyledContainer, {
|
|
15231
|
+
testID: testID,
|
|
15232
|
+
pointerEvents: "box-none",
|
|
15233
|
+
style: style
|
|
15234
|
+
}, /*#__PURE__*/React.createElement(StyledBackdrop, {
|
|
15235
|
+
pointerEvents: active ? 'auto' : 'box-none',
|
|
15236
|
+
testID: "back-drop",
|
|
15237
|
+
style: {
|
|
15238
|
+
opacity: interpolatedOpacityAnimation
|
|
15239
|
+
}
|
|
15240
|
+
}), /*#__PURE__*/React.createElement(StyledActionGroupContainer, {
|
|
15241
|
+
testID: "action-group",
|
|
15242
|
+
style: {
|
|
15243
|
+
transform: [{
|
|
15244
|
+
translateX: interpolatedTranlateXAnimation
|
|
15245
|
+
}]
|
|
15246
|
+
}
|
|
15247
|
+
}, headerTitle && /*#__PURE__*/React.createElement(StyledHeaderText, {
|
|
15248
|
+
testID: "header-text"
|
|
15249
|
+
}, headerTitle), /*#__PURE__*/React.createElement(ActionItemsListComponent, {
|
|
15250
|
+
items: items
|
|
15251
|
+
})), /*#__PURE__*/React.createElement(StyledFAB, {
|
|
15252
|
+
testID: "fab",
|
|
15253
|
+
icon: "add",
|
|
15254
|
+
onPress: onPress,
|
|
15255
|
+
animated: true,
|
|
15256
|
+
active: active,
|
|
15257
|
+
title: fabTitle
|
|
15258
|
+
}));
|
|
15259
|
+
};
|
|
15260
|
+
|
|
15261
|
+
var index$1 = Object.assign(FAB, {
|
|
15262
|
+
ActionGroup: ActionGroup
|
|
15263
|
+
});
|
|
15264
|
+
|
|
15265
|
+
var HalfCircleWrapper = index$2(View)(function (_ref) {
|
|
15266
|
+
var theme = _ref.theme;
|
|
15267
|
+
return {
|
|
15268
|
+
width: theme.__hd__.progress.sizes.radius,
|
|
15269
|
+
height: theme.__hd__.progress.sizes.radius * 2,
|
|
15270
|
+
overflow: 'hidden'
|
|
15271
|
+
};
|
|
15272
|
+
});
|
|
15273
|
+
var HalfCircleInnerFG = index$2(View)(function (_ref2) {
|
|
15274
|
+
var theme = _ref2.theme,
|
|
15275
|
+
themeIntent = _ref2.themeIntent;
|
|
15276
|
+
return {
|
|
15277
|
+
width: theme.__hd__.progress.sizes.radius * 2,
|
|
15278
|
+
height: theme.__hd__.progress.sizes.radius * 2,
|
|
15279
|
+
backgroundColor: theme.__hd__.progress.colors[themeIntent],
|
|
15280
|
+
borderRadius: theme.__hd__.progress.radii["default"]
|
|
15281
|
+
};
|
|
15282
|
+
});
|
|
15283
|
+
var HalfCircleInnerBG = index$2(View)(function (_ref3) {
|
|
15284
|
+
var theme = _ref3.theme;
|
|
15285
|
+
return {
|
|
15286
|
+
width: theme.__hd__.progress.sizes.radius * 2,
|
|
15287
|
+
height: theme.__hd__.progress.sizes.radius * 2,
|
|
15288
|
+
backgroundColor: theme.__hd__.progress.colors.background,
|
|
15289
|
+
borderRadius: theme.__hd__.progress.radii["default"]
|
|
15290
|
+
};
|
|
15291
|
+
});
|
|
15292
|
+
var DonutCircle = index$2(View)(function (_ref4) {
|
|
15293
|
+
var theme = _ref4.theme;
|
|
15294
|
+
return {
|
|
15295
|
+
position: 'absolute',
|
|
15296
|
+
top: theme.__hd__.progress.sizes.strokeWidth,
|
|
15297
|
+
left: theme.__hd__.progress.sizes.strokeWidth,
|
|
15298
|
+
width: theme.__hd__.progress.sizes.radius * 2 - theme.__hd__.progress.sizes.strokeWidth * 2,
|
|
15299
|
+
height: theme.__hd__.progress.sizes.radius * 2 - theme.__hd__.progress.sizes.strokeWidth * 2,
|
|
15300
|
+
zIndex: 3,
|
|
15301
|
+
backgroundColor: theme.__hd__.progress.colors.innerBackground,
|
|
15302
|
+
borderRadius: theme.__hd__.progress.radii["default"],
|
|
15303
|
+
alignItems: 'center',
|
|
15304
|
+
justifyContent: 'center'
|
|
15305
|
+
};
|
|
15306
|
+
});
|
|
15307
|
+
var StrokeEnd = index$2(View)(function (_ref5) {
|
|
15308
|
+
var theme = _ref5.theme,
|
|
15309
|
+
themeIntent = _ref5.themeIntent;
|
|
15310
|
+
return {
|
|
15311
|
+
position: 'absolute',
|
|
15312
|
+
top: 0,
|
|
15313
|
+
left: theme.__hd__.progress.sizes.radius - theme.__hd__.progress.sizes.strokeWidth / 2,
|
|
15314
|
+
width: theme.__hd__.progress.sizes.strokeWidth,
|
|
15315
|
+
height: theme.__hd__.progress.sizes.strokeWidth,
|
|
15316
|
+
borderRadius: theme.__hd__.progress.radii["default"],
|
|
15317
|
+
backgroundColor: theme.__hd__.progress.colors[themeIntent],
|
|
15318
|
+
zIndex: 2
|
|
15319
|
+
};
|
|
15320
|
+
});
|
|
15321
|
+
|
|
15322
|
+
var _excluded$2 = ["value", "intent", "style", "testID"];
|
|
15323
|
+
|
|
15324
|
+
var HalfCircle = function HalfCircle(_ref) {
|
|
15325
|
+
var type = _ref.type,
|
|
15326
|
+
_ref$themeIntent = _ref.themeIntent,
|
|
15327
|
+
themeIntent = _ref$themeIntent === void 0 ? 'primary' : _ref$themeIntent;
|
|
15328
|
+
return /*#__PURE__*/React.createElement(HalfCircleWrapper, null, type === 'background' ? /*#__PURE__*/React.createElement(HalfCircleInnerBG, null) : /*#__PURE__*/React.createElement(HalfCircleInnerFG, {
|
|
15329
|
+
themeIntent: themeIntent
|
|
15330
|
+
}));
|
|
15331
|
+
};
|
|
15332
|
+
|
|
15333
|
+
var ProgressCircle = function ProgressCircle(_ref2) {
|
|
15334
|
+
var value = _ref2.value,
|
|
15335
|
+
_ref2$intent = _ref2.intent,
|
|
15336
|
+
intent = _ref2$intent === void 0 ? 'primary' : _ref2$intent,
|
|
15337
|
+
style = _ref2.style,
|
|
15338
|
+
testID = _ref2.testID,
|
|
15339
|
+
nativeProps = _objectWithoutProperties$1(_ref2, _excluded$2);
|
|
15340
|
+
|
|
15341
|
+
var theme = useTheme();
|
|
15342
|
+
var radius = theme.__hd__.progress.sizes.radius;
|
|
15343
|
+
var progressAnimatedValue = useRef(new Animated.Value(0));
|
|
15344
|
+
useEffect(function () {
|
|
15345
|
+
var animation = Animated.timing(progressAnimatedValue.current, {
|
|
15346
|
+
toValue: value,
|
|
15347
|
+
useNativeDriver: true
|
|
15348
|
+
});
|
|
15349
|
+
animation.start();
|
|
15350
|
+
return function () {
|
|
15351
|
+
return animation.stop();
|
|
15352
|
+
};
|
|
15353
|
+
}, [value]); // Animate progress circle: 0% => 50%
|
|
15354
|
+
|
|
15355
|
+
var interpolateRotateRightHalf = progressAnimatedValue.current.interpolate({
|
|
15356
|
+
inputRange: [0, 50],
|
|
15357
|
+
outputRange: ['0deg', '180deg'],
|
|
15358
|
+
extrapolate: 'clamp'
|
|
15359
|
+
});
|
|
15360
|
+
var interpolateOpacityRightHalf = progressAnimatedValue.current.interpolate({
|
|
15361
|
+
inputRange: [50, 51],
|
|
15362
|
+
outputRange: [1, 0],
|
|
15363
|
+
extrapolate: 'clamp'
|
|
15364
|
+
}); // Animate progress circle: 50% => 100%
|
|
15365
|
+
|
|
15366
|
+
var interpolateRotateSecondHalf = progressAnimatedValue.current.interpolate({
|
|
15367
|
+
inputRange: [50, 100],
|
|
15368
|
+
outputRange: ['0deg', '180deg'],
|
|
15369
|
+
extrapolate: 'clamp'
|
|
15370
|
+
}); // Curve at the end of progress stroke
|
|
15371
|
+
|
|
15372
|
+
var interpolateDotRotate = progressAnimatedValue.current.interpolate({
|
|
15373
|
+
inputRange: [0, 100],
|
|
15374
|
+
outputRange: ['0deg', '360deg'],
|
|
15375
|
+
extrapolate: 'clamp'
|
|
15376
|
+
});
|
|
15377
|
+
return /*#__PURE__*/React.createElement(View, _extends$3({}, nativeProps, {
|
|
15378
|
+
testID: testID,
|
|
15379
|
+
style: style
|
|
15380
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
15381
|
+
style: {
|
|
15382
|
+
flexDirection: 'row'
|
|
15383
|
+
}
|
|
15384
|
+
}, /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(HalfCircle, {
|
|
15385
|
+
type: "foreground",
|
|
15386
|
+
themeIntent: intent
|
|
15387
|
+
}), /*#__PURE__*/React.createElement(Animated.View, {
|
|
15388
|
+
style: _objectSpread2(_objectSpread2({}, StyleSheet$1.absoluteFillObject), {}, {
|
|
15389
|
+
transform: [{
|
|
15390
|
+
translateX: radius / 2
|
|
15391
|
+
}, {
|
|
15392
|
+
rotate: interpolateRotateSecondHalf
|
|
15393
|
+
}, {
|
|
15394
|
+
translateX: -radius / 2
|
|
15395
|
+
}]
|
|
15396
|
+
})
|
|
15397
|
+
}, /*#__PURE__*/React.createElement(HalfCircle, {
|
|
15398
|
+
type: "background"
|
|
15399
|
+
}))), /*#__PURE__*/React.createElement(View, {
|
|
15400
|
+
style: {
|
|
15401
|
+
transform: [{
|
|
15402
|
+
rotate: '180deg'
|
|
15403
|
+
}],
|
|
15404
|
+
zIndex: 1
|
|
15405
|
+
}
|
|
15406
|
+
}, /*#__PURE__*/React.createElement(HalfCircle, {
|
|
15407
|
+
type: "foreground",
|
|
15408
|
+
themeIntent: intent
|
|
15409
|
+
}), /*#__PURE__*/React.createElement(Animated.View, {
|
|
15410
|
+
style: _objectSpread2(_objectSpread2({}, StyleSheet$1.absoluteFillObject), {}, {
|
|
15411
|
+
transform: [{
|
|
15412
|
+
translateX: radius / 2
|
|
15413
|
+
}, {
|
|
15414
|
+
rotate: interpolateRotateRightHalf
|
|
15415
|
+
}, {
|
|
15416
|
+
translateX: -radius / 2
|
|
15417
|
+
}],
|
|
15418
|
+
opacity: interpolateOpacityRightHalf
|
|
15419
|
+
})
|
|
15420
|
+
}, /*#__PURE__*/React.createElement(HalfCircle, {
|
|
15421
|
+
type: "background"
|
|
15422
|
+
}))), /*#__PURE__*/React.createElement(StrokeEnd, {
|
|
15423
|
+
themeIntent: intent
|
|
15424
|
+
}), /*#__PURE__*/React.createElement(Animated.View, {
|
|
15425
|
+
style: _objectSpread2(_objectSpread2({}, StyleSheet$1.absoluteFillObject), {}, {
|
|
15426
|
+
zIndex: 2,
|
|
15427
|
+
transform: [{
|
|
15428
|
+
rotate: interpolateDotRotate
|
|
15429
|
+
}]
|
|
15430
|
+
})
|
|
15431
|
+
}, /*#__PURE__*/React.createElement(StrokeEnd, {
|
|
15432
|
+
themeIntent: intent
|
|
15433
|
+
})), /*#__PURE__*/React.createElement(DonutCircle, null, /*#__PURE__*/React.createElement(Typography.Text, {
|
|
15434
|
+
fontSize: "xlarge"
|
|
15435
|
+
}, "".concat(value, "%")))));
|
|
15436
|
+
};
|
|
15437
|
+
|
|
15438
|
+
var StyledWrapper = index$2(View)(function (_ref) {
|
|
15439
|
+
var theme = _ref.theme;
|
|
15440
|
+
return {
|
|
15441
|
+
height: theme.__hd__.progress.sizes.barHeight,
|
|
15442
|
+
alignSelf: 'stretch',
|
|
15443
|
+
backgroundColor: theme.__hd__.progress.colors.background,
|
|
15444
|
+
overflow: 'hidden'
|
|
15445
|
+
};
|
|
15446
|
+
});
|
|
15447
|
+
var StyledInner = index$2(Animated.View)(function (_ref2) {
|
|
15448
|
+
var theme = _ref2.theme,
|
|
15449
|
+
themeIntent = _ref2.themeIntent;
|
|
15450
|
+
return {
|
|
15451
|
+
flex: 1,
|
|
15452
|
+
alignSelf: 'stretch',
|
|
15453
|
+
backgroundColor: theme.__hd__.progress.colors[themeIntent]
|
|
15454
|
+
};
|
|
15455
|
+
});
|
|
15456
|
+
|
|
15457
|
+
var _excluded$1 = ["value", "intent", "style", "testID"];
|
|
15458
|
+
|
|
15459
|
+
var ProgressBar = function ProgressBar(_ref) {
|
|
15460
|
+
var value = _ref.value,
|
|
15461
|
+
_ref$intent = _ref.intent,
|
|
15462
|
+
intent = _ref$intent === void 0 ? 'primary' : _ref$intent,
|
|
15463
|
+
style = _ref.style,
|
|
15464
|
+
testID = _ref.testID,
|
|
15465
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$1);
|
|
15466
|
+
|
|
15467
|
+
var _useState = useState(0),
|
|
15468
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
15469
|
+
width = _useState2[0],
|
|
15470
|
+
setWidth = _useState2[1];
|
|
15471
|
+
|
|
15472
|
+
var progressAnimatedValue = useRef(new Animated.Value(0));
|
|
15473
|
+
useEffect(function () {
|
|
15474
|
+
var animation = Animated.timing(progressAnimatedValue.current, {
|
|
15475
|
+
toValue: value,
|
|
15476
|
+
useNativeDriver: true
|
|
15477
|
+
});
|
|
15478
|
+
animation.start();
|
|
15479
|
+
return function () {
|
|
15480
|
+
return animation.stop();
|
|
15481
|
+
};
|
|
15482
|
+
}, [value]);
|
|
15483
|
+
var interpolateTranslateX = progressAnimatedValue.current.interpolate({
|
|
15484
|
+
inputRange: [0, 100],
|
|
15485
|
+
outputRange: [-width, 0],
|
|
15486
|
+
extrapolate: 'clamp'
|
|
15487
|
+
});
|
|
15488
|
+
var interpolateBorderRadius = progressAnimatedValue.current.interpolate({
|
|
15489
|
+
inputRange: [99, 100],
|
|
15490
|
+
outputRange: [999, 0],
|
|
15491
|
+
extrapolate: 'clamp'
|
|
15492
|
+
});
|
|
15493
|
+
return /*#__PURE__*/React.createElement(StyledWrapper, _extends$3({}, nativeProps, {
|
|
15494
|
+
testID: testID,
|
|
15495
|
+
style: style
|
|
15496
|
+
}), /*#__PURE__*/React.createElement(StyledInner, {
|
|
15497
|
+
themeIntent: intent,
|
|
15498
|
+
onLayout: function onLayout(_ref2) {
|
|
15499
|
+
var nativeEvent = _ref2.nativeEvent;
|
|
15500
|
+
return setWidth(nativeEvent.layout.width);
|
|
15501
|
+
},
|
|
15502
|
+
style: {
|
|
15503
|
+
transform: [{
|
|
15504
|
+
translateX: interpolateTranslateX
|
|
15505
|
+
}],
|
|
15506
|
+
borderTopRightRadius: interpolateBorderRadius,
|
|
15507
|
+
borderBottomRightRadius: interpolateBorderRadius
|
|
15508
|
+
}
|
|
15509
|
+
}));
|
|
15510
|
+
};
|
|
15511
|
+
|
|
15512
|
+
var Progress = {
|
|
15513
|
+
Circle: ProgressCircle,
|
|
15514
|
+
Bar: ProgressBar
|
|
15515
|
+
};
|
|
15516
|
+
|
|
15517
|
+
var childrenWithOverriddenStyle = function childrenWithOverriddenStyle(children) {
|
|
15518
|
+
return Children.map(children, function (child) {
|
|
15519
|
+
var element = child;
|
|
15520
|
+
return (
|
|
15521
|
+
/*#__PURE__*/
|
|
15522
|
+
// Add a wrapper to ensure layout is calculated correctly
|
|
15523
|
+
React.createElement(View, {
|
|
15524
|
+
style: StyleSheet$1.absoluteFill,
|
|
15525
|
+
collapsable: false
|
|
15526
|
+
}, /*#__PURE__*/React.cloneElement(element, _objectSpread2(_objectSpread2({}, element.props), {}, {
|
|
15527
|
+
// Override styles so that each page will fill the parent.
|
|
15528
|
+
style: [element.props.style, StyleSheet$1.absoluteFill]
|
|
15529
|
+
})))
|
|
15530
|
+
);
|
|
15531
|
+
});
|
|
15532
|
+
};
|
|
15533
|
+
|
|
15534
|
+
var VIEW_MANAGER_NAME = 'RNCViewPager';
|
|
15535
|
+
var PagerViewViewManager = requireNativeComponent(VIEW_MANAGER_NAME);
|
|
15536
|
+
function getViewManagerConfig() {
|
|
15537
|
+
var viewManagerName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : VIEW_MANAGER_NAME;
|
|
15538
|
+
return UIManager.getViewManagerConfig(viewManagerName);
|
|
15539
|
+
}
|
|
15540
|
+
|
|
15541
|
+
function _extends() {
|
|
15542
|
+
_extends = Object.assign || function (target) {
|
|
15543
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
15544
|
+
var source = arguments[i];
|
|
15545
|
+
|
|
15546
|
+
for (var key in source) {
|
|
15547
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
15548
|
+
target[key] = source[key];
|
|
15549
|
+
}
|
|
15550
|
+
}
|
|
15551
|
+
}
|
|
15552
|
+
|
|
15553
|
+
return target;
|
|
15554
|
+
};
|
|
15555
|
+
|
|
15556
|
+
return _extends.apply(this, arguments);
|
|
15557
|
+
}
|
|
15558
|
+
|
|
15559
|
+
function _defineProperty(obj, key, value) {
|
|
15560
|
+
if (key in obj) {
|
|
15561
|
+
Object.defineProperty(obj, key, {
|
|
15562
|
+
value: value,
|
|
15563
|
+
enumerable: true,
|
|
15564
|
+
configurable: true,
|
|
15565
|
+
writable: true
|
|
15566
|
+
});
|
|
15567
|
+
} else {
|
|
15568
|
+
obj[key] = value;
|
|
15569
|
+
}
|
|
15570
|
+
|
|
15571
|
+
return obj;
|
|
15572
|
+
}
|
|
15573
|
+
/**
|
|
15574
|
+
* Container that allows to flip left and right between child views. Each
|
|
15575
|
+
* child view of the `PagerView` will be treated as a separate page
|
|
15576
|
+
* and will be stretched to fill the `PagerView`.
|
|
15577
|
+
*
|
|
15578
|
+
* It is important all children are `<View>`s and not composite components.
|
|
15579
|
+
* You can set style properties like `padding` or `backgroundColor` for each
|
|
15580
|
+
* child. It is also important that each child have a `key` prop.
|
|
15581
|
+
*
|
|
15582
|
+
* Example:
|
|
15583
|
+
*
|
|
15584
|
+
* ```
|
|
15585
|
+
* render: function() {
|
|
15586
|
+
* return (
|
|
15587
|
+
* <PagerView
|
|
15588
|
+
* style={styles.PagerView}
|
|
15589
|
+
* initialPage={0}>
|
|
15590
|
+
* <View style={styles.pageStyle} key="1">
|
|
15591
|
+
* <Text>First page</Text>
|
|
15592
|
+
* </View>
|
|
15593
|
+
* <View style={styles.pageStyle} key="2">
|
|
15594
|
+
* <Text>Second page</Text>
|
|
15595
|
+
* </View>
|
|
15596
|
+
* </PagerView>
|
|
15597
|
+
* );
|
|
15598
|
+
* }
|
|
15599
|
+
*
|
|
15600
|
+
* ...
|
|
15601
|
+
*
|
|
15602
|
+
* var styles = {
|
|
15603
|
+
* ...
|
|
15604
|
+
* PagerView: {
|
|
15605
|
+
* flex: 1
|
|
15606
|
+
* },
|
|
15607
|
+
* pageStyle: {
|
|
15608
|
+
* alignItems: 'center',
|
|
15609
|
+
* padding: 20,
|
|
15610
|
+
* }
|
|
15611
|
+
* }
|
|
15612
|
+
* ```
|
|
15613
|
+
*/
|
|
15614
|
+
|
|
15615
|
+
var PagerView = /*#__PURE__*/function (_React$Component) {
|
|
15616
|
+
_inherits$1(PagerView, _React$Component);
|
|
15617
|
+
|
|
15618
|
+
var _super = _createSuper(PagerView);
|
|
15619
|
+
|
|
15620
|
+
function PagerView() {
|
|
15621
|
+
var _this;
|
|
15622
|
+
|
|
15623
|
+
_classCallCheck$1(this, PagerView);
|
|
15624
|
+
|
|
15625
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
15626
|
+
args[_key] = arguments[_key];
|
|
15627
|
+
}
|
|
15628
|
+
|
|
15629
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
15630
|
+
|
|
15631
|
+
_defineProperty(_assertThisInitialized$1(_this), "isScrolling", false);
|
|
15632
|
+
|
|
15633
|
+
_defineProperty(_assertThisInitialized$1(_this), "PagerView", /*#__PURE__*/React.createRef());
|
|
15634
|
+
|
|
15635
|
+
_defineProperty(_assertThisInitialized$1(_this), "getInnerViewNode", function () {
|
|
15636
|
+
return _this.PagerView.current.getInnerViewNode();
|
|
15637
|
+
});
|
|
15638
|
+
|
|
15639
|
+
_defineProperty(_assertThisInitialized$1(_this), "_onPageScroll", function (e) {
|
|
15640
|
+
if (_this.props.onPageScroll) {
|
|
15641
|
+
_this.props.onPageScroll(e);
|
|
15642
|
+
} // Not implemented on iOS yet
|
|
15643
|
+
|
|
15644
|
+
|
|
15645
|
+
if (Platform.OS === 'android') {
|
|
15646
|
+
if (_this.props.keyboardDismissMode === 'on-drag') {
|
|
15647
|
+
Keyboard.dismiss();
|
|
15648
|
+
}
|
|
15649
|
+
}
|
|
15650
|
+
});
|
|
15651
|
+
|
|
15652
|
+
_defineProperty(_assertThisInitialized$1(_this), "_onPageScrollStateChanged", function (e) {
|
|
15653
|
+
if (_this.props.onPageScrollStateChanged) {
|
|
15654
|
+
_this.props.onPageScrollStateChanged(e);
|
|
15655
|
+
}
|
|
15656
|
+
|
|
15657
|
+
_this.isScrolling = e.nativeEvent.pageScrollState === 'dragging';
|
|
15658
|
+
});
|
|
15659
|
+
|
|
15660
|
+
_defineProperty(_assertThisInitialized$1(_this), "_onPageSelected", function (e) {
|
|
15661
|
+
if (_this.props.onPageSelected) {
|
|
15662
|
+
_this.props.onPageSelected(e);
|
|
15663
|
+
}
|
|
15664
|
+
});
|
|
15665
|
+
|
|
15666
|
+
_defineProperty(_assertThisInitialized$1(_this), "setPage", function (selectedPage) {
|
|
15667
|
+
UIManager.dispatchViewManagerCommand(ReactNative__default.findNodeHandle(_assertThisInitialized$1(_this)), getViewManagerConfig().Commands.setPage, [selectedPage]);
|
|
15668
|
+
});
|
|
15669
|
+
|
|
15670
|
+
_defineProperty(_assertThisInitialized$1(_this), "setPageWithoutAnimation", function (selectedPage) {
|
|
15671
|
+
UIManager.dispatchViewManagerCommand(ReactNative__default.findNodeHandle(_assertThisInitialized$1(_this)), getViewManagerConfig().Commands.setPageWithoutAnimation, [selectedPage]);
|
|
15672
|
+
});
|
|
15673
|
+
|
|
15674
|
+
_defineProperty(_assertThisInitialized$1(_this), "setScrollEnabled", function (scrollEnabled) {
|
|
15675
|
+
UIManager.dispatchViewManagerCommand(ReactNative__default.findNodeHandle(_assertThisInitialized$1(_this)), getViewManagerConfig().Commands.setScrollEnabled, [scrollEnabled]);
|
|
15676
|
+
});
|
|
15677
|
+
|
|
15678
|
+
_defineProperty(_assertThisInitialized$1(_this), "_onMoveShouldSetResponderCapture", function () {
|
|
15679
|
+
return _this.isScrolling;
|
|
15680
|
+
});
|
|
15681
|
+
|
|
15682
|
+
return _this;
|
|
15683
|
+
}
|
|
15684
|
+
|
|
15685
|
+
_createClass$1(PagerView, [{
|
|
15686
|
+
key: "deducedLayoutDirection",
|
|
15687
|
+
get: function get() {
|
|
15688
|
+
var shouldUseDeviceRtlSetup = !this.props.layoutDirection || this.props.layoutDirection === 'locale';
|
|
15689
|
+
|
|
15690
|
+
if (shouldUseDeviceRtlSetup) {
|
|
15691
|
+
return I18nManager.isRTL ? 'rtl' : 'ltr';
|
|
15692
|
+
} else {
|
|
15693
|
+
return this.props.layoutDirection;
|
|
15694
|
+
}
|
|
15695
|
+
}
|
|
15696
|
+
}, {
|
|
15697
|
+
key: "render",
|
|
15698
|
+
value: function render() {
|
|
15699
|
+
return /*#__PURE__*/React.createElement(PagerViewViewManager, _extends({}, this.props, {
|
|
15700
|
+
ref: this.PagerView
|
|
15701
|
+
/** TODO: Fix ref type */
|
|
15702
|
+
,
|
|
15703
|
+
style: this.props.style,
|
|
15704
|
+
layoutDirection: this.deducedLayoutDirection,
|
|
15705
|
+
onPageScroll: this._onPageScroll,
|
|
15706
|
+
onPageScrollStateChanged: this._onPageScrollStateChanged,
|
|
15707
|
+
onPageSelected: this._onPageSelected,
|
|
15708
|
+
onMoveShouldSetResponderCapture: this._onMoveShouldSetResponderCapture,
|
|
15709
|
+
children: childrenWithOverriddenStyle(this.props.children)
|
|
15710
|
+
}));
|
|
15711
|
+
}
|
|
15712
|
+
}]);
|
|
15713
|
+
|
|
15714
|
+
return PagerView;
|
|
15715
|
+
}(React.Component);
|
|
15716
|
+
|
|
15717
|
+
var AnimatedPagerView = Animated.createAnimatedComponent(PagerView);
|
|
15718
|
+
var TabContainer$1 = index$2(View)({
|
|
15719
|
+
flex: 1,
|
|
15720
|
+
overflow: 'hidden'
|
|
13971
15721
|
});
|
|
13972
|
-
var
|
|
13973
|
-
var theme = _ref.theme
|
|
15722
|
+
var HeaderTabWrapper$1 = index$2(View)(function (_ref) {
|
|
15723
|
+
var theme = _ref.theme,
|
|
15724
|
+
themeInsets = _ref.themeInsets;
|
|
13974
15725
|
return {
|
|
13975
|
-
|
|
13976
|
-
|
|
13977
|
-
|
|
15726
|
+
paddingHorizontal: Math.max(themeInsets.left, themeInsets.right),
|
|
15727
|
+
borderBottomColor: theme.__hd__.tabs.colors.headerBottom,
|
|
15728
|
+
borderBottomWidth: theme.__hd__.tabs.borderWidths.headerBottom
|
|
13978
15729
|
};
|
|
13979
15730
|
});
|
|
13980
|
-
var
|
|
15731
|
+
var HeaderTab = index$2(View)({
|
|
15732
|
+
flexDirection: 'row'
|
|
15733
|
+
});
|
|
15734
|
+
var HeaderTabItem$1 = index$2(View)(function (_ref2) {
|
|
13981
15735
|
var theme = _ref2.theme;
|
|
13982
15736
|
return {
|
|
13983
|
-
|
|
13984
|
-
|
|
13985
|
-
|
|
13986
|
-
top: 0,
|
|
13987
|
-
bottom: 0,
|
|
13988
|
-
backgroundColor: theme.__hd__.fab.colors.backdropBackground
|
|
15737
|
+
flex: 1,
|
|
15738
|
+
alignItems: 'center',
|
|
15739
|
+
paddingVertical: theme.__hd__.tabs.space.itemVerticalPadding
|
|
13989
15740
|
};
|
|
13990
15741
|
});
|
|
13991
|
-
var
|
|
13992
|
-
|
|
15742
|
+
var ContentWrapper$1 = index$2(AnimatedPagerView)({
|
|
15743
|
+
flex: 1
|
|
15744
|
+
});
|
|
15745
|
+
var TabScreen$1 = index$2(View)({
|
|
15746
|
+
flex: 1
|
|
15747
|
+
});
|
|
15748
|
+
var StyledIndicator = index$2(Animated.View)(function (_ref3) {
|
|
15749
|
+
var theme = _ref3.theme,
|
|
15750
|
+
themeWidth = _ref3.themeWidth;
|
|
13993
15751
|
return {
|
|
13994
|
-
|
|
13995
|
-
|
|
13996
|
-
|
|
13997
|
-
|
|
13998
|
-
|
|
13999
|
-
textAlign: 'right'
|
|
15752
|
+
width: themeWidth,
|
|
15753
|
+
height: theme.__hd__.tabs.sizes.indicator,
|
|
15754
|
+
backgroundColor: theme.__hd__.tabs.colors.text,
|
|
15755
|
+
position: 'absolute',
|
|
15756
|
+
bottom: 0
|
|
14000
15757
|
};
|
|
14001
15758
|
});
|
|
14002
15759
|
|
|
14003
|
-
var
|
|
14004
|
-
var
|
|
14005
|
-
|
|
14006
|
-
|
|
14007
|
-
|
|
14008
|
-
|
|
14009
|
-
|
|
14010
|
-
|
|
14011
|
-
|
|
14012
|
-
|
|
14013
|
-
};
|
|
14014
|
-
|
|
14015
|
-
var ActionGroup = function ActionGroup(_ref2) {
|
|
14016
|
-
var headerTitle = _ref2.headerTitle,
|
|
14017
|
-
onPress = _ref2.onPress,
|
|
14018
|
-
active = _ref2.active,
|
|
14019
|
-
style = _ref2.style,
|
|
14020
|
-
items = _ref2.items,
|
|
14021
|
-
testID = _ref2.testID;
|
|
14022
|
-
var tranlateXAnimation = useRef(new Animated.Value(active ? 1 : 0));
|
|
14023
|
-
useEffect(function () {
|
|
14024
|
-
var animation = Animated.timing(tranlateXAnimation.current, {
|
|
14025
|
-
toValue: active ? 1 : 0,
|
|
14026
|
-
useNativeDriver: true
|
|
14027
|
-
});
|
|
14028
|
-
animation.start();
|
|
14029
|
-
}, [active]);
|
|
14030
|
-
var interpolatedTranlateXAnimation = tranlateXAnimation.current.interpolate({
|
|
14031
|
-
inputRange: [0, 1],
|
|
14032
|
-
outputRange: [400, 0]
|
|
14033
|
-
});
|
|
14034
|
-
var interpolatedOpacityAnimation = tranlateXAnimation.current.interpolate({
|
|
14035
|
-
inputRange: [0, 1],
|
|
14036
|
-
outputRange: [0, 0.9]
|
|
15760
|
+
var ActiveTabIndicator = function ActiveTabIndicator(_ref) {
|
|
15761
|
+
var scrollOffsetAnimatedValue = _ref.scrollOffsetAnimatedValue,
|
|
15762
|
+
positionAnimatedValue = _ref.positionAnimatedValue,
|
|
15763
|
+
tabsLength = _ref.tabsLength,
|
|
15764
|
+
tabsWidth = _ref.tabsWidth;
|
|
15765
|
+
var inputRange = [0, tabsLength];
|
|
15766
|
+
var indicatorWidth = tabsWidth / tabsLength;
|
|
15767
|
+
var translateX = Animated.add(scrollOffsetAnimatedValue, positionAnimatedValue).interpolate({
|
|
15768
|
+
inputRange: inputRange,
|
|
15769
|
+
outputRange: [0, tabsLength * indicatorWidth]
|
|
14037
15770
|
});
|
|
14038
|
-
return /*#__PURE__*/React.createElement(
|
|
14039
|
-
|
|
14040
|
-
pointerEvents: "box-none",
|
|
14041
|
-
style: style
|
|
14042
|
-
}, /*#__PURE__*/React.createElement(StyledBackdrop, {
|
|
14043
|
-
pointerEvents: active ? 'auto' : 'box-none',
|
|
14044
|
-
testID: "back-drop",
|
|
14045
|
-
style: {
|
|
14046
|
-
opacity: interpolatedOpacityAnimation
|
|
14047
|
-
}
|
|
14048
|
-
}), /*#__PURE__*/React.createElement(StyledActionGroupContainer, {
|
|
14049
|
-
testID: "action-group",
|
|
15771
|
+
return /*#__PURE__*/React.createElement(StyledIndicator, {
|
|
15772
|
+
themeWidth: indicatorWidth,
|
|
14050
15773
|
style: {
|
|
14051
15774
|
transform: [{
|
|
14052
|
-
translateX:
|
|
15775
|
+
translateX: translateX
|
|
14053
15776
|
}]
|
|
14054
15777
|
}
|
|
14055
|
-
}
|
|
14056
|
-
testID: "header-text"
|
|
14057
|
-
}, headerTitle), /*#__PURE__*/React.createElement(ActionItemsListComponent, {
|
|
14058
|
-
items: items
|
|
14059
|
-
})), /*#__PURE__*/React.createElement(StyledFAB, {
|
|
14060
|
-
testID: "fab",
|
|
14061
|
-
icon: "add",
|
|
14062
|
-
onPress: onPress,
|
|
14063
|
-
animated: true,
|
|
14064
|
-
active: active
|
|
14065
|
-
}));
|
|
15778
|
+
});
|
|
14066
15779
|
};
|
|
14067
15780
|
|
|
14068
|
-
var
|
|
14069
|
-
|
|
14070
|
-
});
|
|
14071
|
-
|
|
14072
|
-
var TabScreen = index$1(View)(function (_ref) {
|
|
14073
|
-
var themeVisibility = _ref.themeVisibility;
|
|
14074
|
-
return {
|
|
14075
|
-
flex: 1,
|
|
14076
|
-
display: themeVisibility === false ? 'none' : 'flex'
|
|
14077
|
-
};
|
|
15781
|
+
var TabScreen = index$2(View)({
|
|
15782
|
+
flex: 1
|
|
14078
15783
|
});
|
|
14079
|
-
var TabContainer = index$
|
|
15784
|
+
var TabContainer = index$2(View)({
|
|
14080
15785
|
flex: 1,
|
|
14081
15786
|
overflow: 'hidden'
|
|
14082
15787
|
});
|
|
14083
|
-
var ContentWrapper = index$
|
|
15788
|
+
var ContentWrapper = index$2(PagerView)({
|
|
14084
15789
|
flex: 1
|
|
14085
15790
|
});
|
|
14086
|
-
var HeaderTabWrapper = index$
|
|
14087
|
-
var
|
|
14088
|
-
|
|
15791
|
+
var HeaderTabWrapper = index$2(View)(function (_ref) {
|
|
15792
|
+
var theme = _ref.theme,
|
|
15793
|
+
themeInsets = _ref.themeInsets;
|
|
14089
15794
|
return {
|
|
14090
|
-
|
|
14091
|
-
|
|
14092
|
-
|
|
15795
|
+
paddingHorizontal: Math.max(themeInsets.left, themeInsets.right),
|
|
15796
|
+
borderBottomColor: theme.__hd__.tabs.colors.headerBottom,
|
|
15797
|
+
borderBottomWidth: theme.__hd__.tabs.borderWidths.headerBottom
|
|
14093
15798
|
};
|
|
14094
15799
|
});
|
|
14095
|
-
var
|
|
14096
|
-
var theme =
|
|
15800
|
+
var HeaderTabItem = index$2(Animated.View)(function (_ref2) {
|
|
15801
|
+
var theme = _ref2.theme;
|
|
14097
15802
|
return {
|
|
14098
|
-
|
|
14099
|
-
|
|
15803
|
+
paddingHorizontal: theme.__hd__.tabs.space.itemHorizontalPadding,
|
|
15804
|
+
paddingVertical: theme.__hd__.tabs.space.itemVerticalPadding
|
|
14100
15805
|
};
|
|
14101
15806
|
});
|
|
14102
|
-
var
|
|
14103
|
-
var theme =
|
|
14104
|
-
return {
|
|
14105
|
-
|
|
14106
|
-
|
|
14107
|
-
|
|
14108
|
-
paddingRight: theme.__hd__.tabs.space.itemHorizontalPadding,
|
|
14109
|
-
paddingTop: theme.__hd__.tabs.space.itemVerticalPadding,
|
|
14110
|
-
paddingBottom: theme.__hd__.tabs.space.itemVerticalPadding
|
|
14111
|
-
};
|
|
15807
|
+
var HeaderTabItemOutlineWrapper = index$2(View)(function (_ref3) {
|
|
15808
|
+
var theme = _ref3.theme;
|
|
15809
|
+
return _objectSpread2({
|
|
15810
|
+
paddingHorizontal: theme.__hd__.tabs.space.itemHorizontalPadding,
|
|
15811
|
+
paddingVertical: theme.__hd__.tabs.space.itemVerticalPadding
|
|
15812
|
+
}, StyleSheet$1.absoluteFillObject);
|
|
14112
15813
|
});
|
|
14113
|
-
var
|
|
14114
|
-
var
|
|
14115
|
-
|
|
15814
|
+
var HeaderTabItemOutline = index$2(Animated.View)(function (_ref4) {
|
|
15815
|
+
var theme = _ref4.theme,
|
|
15816
|
+
themeActive = _ref4.themeActive;
|
|
14116
15817
|
return {
|
|
14117
|
-
|
|
15818
|
+
borderRadius: theme.__hd__.tabs.radii.outline,
|
|
15819
|
+
backgroundColor: themeActive ? theme.__hd__.tabs.colors.activeBackground : undefined
|
|
14118
15820
|
};
|
|
14119
15821
|
});
|
|
14120
|
-
var
|
|
14121
|
-
var
|
|
14122
|
-
theme = _ref6.theme;
|
|
15822
|
+
var HeaderTabItemWrapper = index$2(View)(function (_ref5) {
|
|
15823
|
+
var theme = _ref5.theme;
|
|
14123
15824
|
return {
|
|
14124
|
-
|
|
14125
|
-
|
|
15825
|
+
paddingHorizontal: theme.__hd__.tabs.space.outlineHorizontalPadding,
|
|
15826
|
+
paddingVertical: theme.__hd__.tabs.space.outlineVerticalPadding
|
|
14126
15827
|
};
|
|
14127
15828
|
});
|
|
14128
15829
|
|
|
14129
|
-
var
|
|
15830
|
+
var useAnimatedValueArray = function useAnimatedValueArray(initialValues) {
|
|
15831
|
+
var refs = React.useRef([]);
|
|
15832
|
+
refs.current.length = initialValues.length;
|
|
15833
|
+
initialValues.forEach(function (initialValue, i) {
|
|
15834
|
+
var _refs$current$i;
|
|
14130
15835
|
|
|
14131
|
-
|
|
14132
|
-
|
|
14133
|
-
|
|
14134
|
-
|
|
14135
|
-
selectedTabKey = _ref.selectedTabKey,
|
|
14136
|
-
tabs = _ref.tabs,
|
|
14137
|
-
nativeProps = _objectWithoutProperties$1(_ref, _excluded);
|
|
15836
|
+
refs.current[i] = (_refs$current$i = refs.current[i]) !== null && _refs$current$i !== void 0 ? _refs$current$i : new Animated.Value(initialValue);
|
|
15837
|
+
});
|
|
15838
|
+
return refs.current;
|
|
15839
|
+
};
|
|
14138
15840
|
|
|
14139
|
-
|
|
14140
|
-
var
|
|
14141
|
-
|
|
14142
|
-
|
|
14143
|
-
|
|
15841
|
+
var getTabItem$1 = function getTabItem(_ref) {
|
|
15842
|
+
var item = _ref.item,
|
|
15843
|
+
color = _ref.color,
|
|
15844
|
+
active = _ref.active;
|
|
15845
|
+
|
|
15846
|
+
if (isHeroIcon(item)) {
|
|
15847
|
+
return /*#__PURE__*/React.createElement(Icon, {
|
|
15848
|
+
icon: item,
|
|
15849
|
+
testID: "hero-icon-".concat(item),
|
|
15850
|
+
size: "small",
|
|
15851
|
+
intent: active ? 'info' : 'text'
|
|
15852
|
+
});
|
|
15853
|
+
}
|
|
14144
15854
|
|
|
14145
|
-
|
|
14146
|
-
|
|
14147
|
-
|
|
14148
|
-
|
|
15855
|
+
if (typeof item === 'string') {
|
|
15856
|
+
return /*#__PURE__*/React.createElement(Typography.Text, {
|
|
15857
|
+
fontWeight: active ? 'semi-bold' : 'regular',
|
|
15858
|
+
numberOfLines: 1,
|
|
15859
|
+
style: {
|
|
15860
|
+
color: color
|
|
15861
|
+
}
|
|
15862
|
+
}, item);
|
|
15863
|
+
}
|
|
14149
15864
|
|
|
14150
|
-
|
|
14151
|
-
|
|
14152
|
-
|
|
14153
|
-
|
|
15865
|
+
return item({
|
|
15866
|
+
color: color
|
|
15867
|
+
});
|
|
15868
|
+
};
|
|
14154
15869
|
|
|
15870
|
+
var ScrollableTab = function ScrollableTab(_ref2) {
|
|
15871
|
+
var onTabPress = _ref2.onTabPress,
|
|
15872
|
+
selectedTabKey = _ref2.selectedTabKey,
|
|
15873
|
+
tabs = _ref2.tabs,
|
|
15874
|
+
containerStyle = _ref2.containerStyle,
|
|
15875
|
+
barStyle = _ref2.barStyle,
|
|
15876
|
+
_ref2$lazy = _ref2.lazy,
|
|
15877
|
+
lazy = _ref2$lazy === void 0 ? false : _ref2$lazy,
|
|
15878
|
+
_ref2$lazyPreloadDist = _ref2.lazyPreloadDistance,
|
|
15879
|
+
lazyPreloadDistance = _ref2$lazyPreloadDist === void 0 ? 1 : _ref2$lazyPreloadDist;
|
|
15880
|
+
var flatListRef = React.useRef(null);
|
|
15881
|
+
var pagerViewRef = React.useRef(null);
|
|
15882
|
+
var insets = useSafeAreaInsets();
|
|
15883
|
+
var theme = useTheme();
|
|
15884
|
+
var selectedTabIndex = tabs.findIndex(function (item) {
|
|
15885
|
+
return item.key === selectedTabKey;
|
|
15886
|
+
});
|
|
15887
|
+
var tabsAnims = useAnimatedValueArray(tabs.map(function (_, i) {
|
|
15888
|
+
return i === selectedTabIndex ? 1 : 0;
|
|
15889
|
+
}));
|
|
15890
|
+
React.useEffect(function () {
|
|
14155
15891
|
if (selectedTabIndex !== -1) {
|
|
14156
15892
|
var _flatListRef$current;
|
|
14157
15893
|
|
|
@@ -14160,18 +15896,25 @@ var Tabs = function Tabs(_ref) {
|
|
|
14160
15896
|
viewPosition: 0.5
|
|
14161
15897
|
});
|
|
14162
15898
|
}
|
|
14163
|
-
}, [selectedTabKey, tabs]);
|
|
14164
|
-
|
|
14165
|
-
if (!loaded.includes(selectedTabKey)) {
|
|
14166
|
-
// Set the current tab to be loaded if it was not loaded before
|
|
14167
|
-
setLoaded(function (loadedState) {
|
|
14168
|
-
return [].concat(_toConsumableArray$1(loadedState), [selectedTabKey]);
|
|
14169
|
-
});
|
|
14170
|
-
}
|
|
14171
15899
|
|
|
14172
|
-
|
|
14173
|
-
|
|
14174
|
-
|
|
15900
|
+
var animation = Animated.parallel(_toConsumableArray$1(tabs.map(function (_, i) {
|
|
15901
|
+
return Animated.timing(tabsAnims[i], {
|
|
15902
|
+
toValue: i === selectedTabIndex ? 1 : 0,
|
|
15903
|
+
duration: 150,
|
|
15904
|
+
useNativeDriver: true
|
|
15905
|
+
});
|
|
15906
|
+
})));
|
|
15907
|
+
animation.start();
|
|
15908
|
+
return function () {
|
|
15909
|
+
return animation.stop();
|
|
15910
|
+
};
|
|
15911
|
+
}, [selectedTabIndex]);
|
|
15912
|
+
return /*#__PURE__*/React.createElement(TabContainer, {
|
|
15913
|
+
style: containerStyle
|
|
15914
|
+
}, /*#__PURE__*/React.createElement(HeaderTabWrapper, {
|
|
15915
|
+
themeInsets: insets,
|
|
15916
|
+
style: barStyle
|
|
15917
|
+
}, /*#__PURE__*/React.createElement(FlatList, {
|
|
14175
15918
|
ref: flatListRef,
|
|
14176
15919
|
horizontal: true,
|
|
14177
15920
|
data: tabs,
|
|
@@ -14179,8 +15922,8 @@ var Tabs = function Tabs(_ref) {
|
|
|
14179
15922
|
return String(tab.key);
|
|
14180
15923
|
},
|
|
14181
15924
|
showsHorizontalScrollIndicator: false,
|
|
14182
|
-
onScrollToIndexFailed: function onScrollToIndexFailed(
|
|
14183
|
-
var index =
|
|
15925
|
+
onScrollToIndexFailed: function onScrollToIndexFailed(_ref3) {
|
|
15926
|
+
var index = _ref3.index;
|
|
14184
15927
|
setTimeout(function () {
|
|
14185
15928
|
var _flatListRef$current2;
|
|
14186
15929
|
|
|
@@ -14190,57 +15933,255 @@ var Tabs = function Tabs(_ref) {
|
|
|
14190
15933
|
});
|
|
14191
15934
|
}, 100);
|
|
14192
15935
|
},
|
|
14193
|
-
|
|
14194
|
-
|
|
15936
|
+
contentContainerStyle: {
|
|
15937
|
+
paddingHorizontal: theme.__hd__.tabs.space.flatListHorizontalPadding
|
|
15938
|
+
},
|
|
15939
|
+
renderItem: function renderItem(_ref4) {
|
|
15940
|
+
var tab = _ref4.item,
|
|
15941
|
+
index = _ref4.index;
|
|
14195
15942
|
var key = tab.key,
|
|
14196
|
-
|
|
14197
|
-
|
|
14198
|
-
|
|
15943
|
+
testID = tab.testID,
|
|
15944
|
+
activeItem = tab.activeItem,
|
|
15945
|
+
originalInactiveItem = tab.inactiveItem,
|
|
15946
|
+
_tab$showBadge = tab.showBadge,
|
|
15947
|
+
showBadge = _tab$showBadge === void 0 ? false : _tab$showBadge;
|
|
14199
15948
|
var active = selectedTabKey === key;
|
|
14200
|
-
|
|
15949
|
+
var activeAnimated = tabsAnims[index];
|
|
15950
|
+
var outlineScale = active ? activeAnimated.interpolate({
|
|
15951
|
+
inputRange: [0, 1],
|
|
15952
|
+
outputRange: [0.5, 1]
|
|
15953
|
+
}) : 0;
|
|
15954
|
+
var inactiveItem = originalInactiveItem !== null && originalInactiveItem !== void 0 ? originalInactiveItem : activeItem;
|
|
15955
|
+
var tabItem = getTabItem$1({
|
|
15956
|
+
item: active ? activeItem : inactiveItem,
|
|
15957
|
+
color: active ? theme.__hd__.tabs.colors.active : theme.__hd__.tabs.colors.inactive,
|
|
15958
|
+
active: active
|
|
15959
|
+
});
|
|
15960
|
+
return /*#__PURE__*/React.createElement(TouchableWithoutFeedback, {
|
|
14201
15961
|
key: key,
|
|
14202
15962
|
onPress: function onPress() {
|
|
14203
|
-
|
|
15963
|
+
var _pagerViewRef$current;
|
|
15964
|
+
|
|
15965
|
+
onTabPress(key);
|
|
15966
|
+
(_pagerViewRef$current = pagerViewRef.current) === null || _pagerViewRef$current === void 0 ? void 0 : _pagerViewRef$current.setPage(index);
|
|
14204
15967
|
},
|
|
14205
15968
|
testID: testID
|
|
14206
|
-
}, /*#__PURE__*/React.createElement(HeaderTabItem, null, /*#__PURE__*/React.createElement(
|
|
14207
|
-
|
|
14208
|
-
|
|
14209
|
-
|
|
14210
|
-
|
|
14211
|
-
|
|
14212
|
-
|
|
14213
|
-
|
|
14214
|
-
},
|
|
14215
|
-
|
|
14216
|
-
|
|
15969
|
+
}, /*#__PURE__*/React.createElement(HeaderTabItem, null, /*#__PURE__*/React.createElement(HeaderTabItemOutlineWrapper, null, /*#__PURE__*/React.createElement(HeaderTabItemOutline, {
|
|
15970
|
+
themeActive: active,
|
|
15971
|
+
style: {
|
|
15972
|
+
flex: 1,
|
|
15973
|
+
transform: [{
|
|
15974
|
+
scaleX: outlineScale
|
|
15975
|
+
}]
|
|
15976
|
+
}
|
|
15977
|
+
})), /*#__PURE__*/React.createElement(HeaderTabItemWrapper, null, /*#__PURE__*/React.createElement(Badge$1.Status, {
|
|
15978
|
+
visible: showBadge
|
|
15979
|
+
}, tabItem))));
|
|
15980
|
+
}
|
|
15981
|
+
})), /*#__PURE__*/React.createElement(ContentWrapper, {
|
|
15982
|
+
initialPage: selectedTabIndex,
|
|
15983
|
+
ref: pagerViewRef,
|
|
15984
|
+
onPageSelected: function onPageSelected(e) {
|
|
15985
|
+
var index = e.nativeEvent.position;
|
|
15986
|
+
var selectedItem = tabs[index];
|
|
15987
|
+
|
|
15988
|
+
if (selectedItem) {
|
|
15989
|
+
onTabPress(selectedItem.key);
|
|
15990
|
+
}
|
|
15991
|
+
}
|
|
15992
|
+
}, tabs.map(function (tab, index) {
|
|
14217
15993
|
var key = tab.key,
|
|
14218
15994
|
component = tab.component,
|
|
14219
15995
|
testID = tab.testID;
|
|
14220
15996
|
var active = selectedTabKey === key;
|
|
15997
|
+
var isLazyScreen = lazy && Math.abs(selectedTabIndex - index) > lazyPreloadDistance;
|
|
15998
|
+
return /*#__PURE__*/React.createElement(TabScreen, {
|
|
15999
|
+
key: key,
|
|
16000
|
+
testID: testID ? "tab-screen-".concat(testID) : undefined,
|
|
16001
|
+
pointerEvents: active ? 'auto' : 'none',
|
|
16002
|
+
accessibilityElementsHidden: !active,
|
|
16003
|
+
importantForAccessibility: active ? 'auto' : 'no-hide-descendants',
|
|
16004
|
+
collapsable: false
|
|
16005
|
+
}, isLazyScreen ? null : component);
|
|
16006
|
+
})));
|
|
16007
|
+
};
|
|
14221
16008
|
|
|
14222
|
-
|
|
14223
|
-
|
|
14224
|
-
|
|
16009
|
+
var getTabItem = function getTabItem(_ref) {
|
|
16010
|
+
var item = _ref.item,
|
|
16011
|
+
color = _ref.color,
|
|
16012
|
+
active = _ref.active;
|
|
16013
|
+
|
|
16014
|
+
if (typeof item === 'string') {
|
|
16015
|
+
return /*#__PURE__*/React.createElement(Typography.Text, {
|
|
16016
|
+
fontWeight: active ? 'semi-bold' : 'regular',
|
|
16017
|
+
numberOfLines: 1,
|
|
16018
|
+
style: {
|
|
16019
|
+
color: color
|
|
16020
|
+
}
|
|
16021
|
+
}, item);
|
|
16022
|
+
}
|
|
14225
16023
|
|
|
14226
|
-
|
|
14227
|
-
|
|
14228
|
-
|
|
16024
|
+
return item({
|
|
16025
|
+
color: color
|
|
16026
|
+
});
|
|
16027
|
+
};
|
|
16028
|
+
|
|
16029
|
+
var Tabs = function Tabs(_ref2) {
|
|
16030
|
+
var onTabPress = _ref2.onTabPress,
|
|
16031
|
+
selectedTabKey = _ref2.selectedTabKey,
|
|
16032
|
+
tabs = _ref2.tabs,
|
|
16033
|
+
containerStyle = _ref2.containerStyle,
|
|
16034
|
+
barStyle = _ref2.barStyle,
|
|
16035
|
+
_ref2$lazy = _ref2.lazy,
|
|
16036
|
+
lazy = _ref2$lazy === void 0 ? false : _ref2$lazy,
|
|
16037
|
+
_ref2$lazyPreloadDist = _ref2.lazyPreloadDistance,
|
|
16038
|
+
lazyPreloadDistance = _ref2$lazyPreloadDist === void 0 ? 1 : _ref2$lazyPreloadDist;
|
|
16039
|
+
var theme = useTheme();
|
|
16040
|
+
var insets = useSafeAreaInsets();
|
|
16041
|
+
var pagerViewRef = React.useRef(null);
|
|
16042
|
+
var selectedTabIndex = tabs.findIndex(function (item) {
|
|
16043
|
+
return item.key === selectedTabKey;
|
|
16044
|
+
});
|
|
16045
|
+
var scrollOffsetAnimatedValue = React.useRef(new Animated.Value(0)).current;
|
|
16046
|
+
var positionAnimatedValue = React.useRef(new Animated.Value(0)).current;
|
|
16047
|
+
|
|
16048
|
+
var _React$useState = React.useState(0),
|
|
16049
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
16050
|
+
tabsWidth = _React$useState2[0],
|
|
16051
|
+
setTabsWidth = _React$useState2[1];
|
|
16052
|
+
|
|
16053
|
+
return /*#__PURE__*/React.createElement(TabContainer$1, {
|
|
16054
|
+
style: containerStyle
|
|
16055
|
+
}, /*#__PURE__*/React.createElement(HeaderTabWrapper$1, {
|
|
16056
|
+
themeInsets: insets,
|
|
16057
|
+
style: barStyle
|
|
16058
|
+
}, /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(HeaderTab, {
|
|
16059
|
+
onLayout: function onLayout(e) {
|
|
16060
|
+
var width = e.nativeEvent.layout.width;
|
|
16061
|
+
|
|
16062
|
+
if (tabsWidth !== width) {
|
|
16063
|
+
setTabsWidth(width);
|
|
16064
|
+
}
|
|
14229
16065
|
}
|
|
16066
|
+
}, tabs.map(function (tab, index) {
|
|
16067
|
+
var key = tab.key,
|
|
16068
|
+
testID = tab.testID,
|
|
16069
|
+
activeItem = tab.activeItem,
|
|
16070
|
+
originalInactiveItem = tab.inactiveItem,
|
|
16071
|
+
_tab$showBadge = tab.showBadge,
|
|
16072
|
+
showBadge = _tab$showBadge === void 0 ? false : _tab$showBadge;
|
|
16073
|
+
var active = selectedTabKey === key;
|
|
16074
|
+
var inactiveItem = originalInactiveItem !== null && originalInactiveItem !== void 0 ? originalInactiveItem : activeItem;
|
|
16075
|
+
var tabItem = getTabItem({
|
|
16076
|
+
item: active ? activeItem : inactiveItem,
|
|
16077
|
+
color: theme.__hd__.tabs.colors.text,
|
|
16078
|
+
active: active
|
|
16079
|
+
});
|
|
16080
|
+
return /*#__PURE__*/React.createElement(TouchableWithoutFeedback, {
|
|
16081
|
+
key: key,
|
|
16082
|
+
onPress: function onPress() {
|
|
16083
|
+
var _pagerViewRef$current;
|
|
14230
16084
|
|
|
14231
|
-
|
|
16085
|
+
onTabPress(key);
|
|
16086
|
+
(_pagerViewRef$current = pagerViewRef.current) === null || _pagerViewRef$current === void 0 ? void 0 : _pagerViewRef$current.setPage(index);
|
|
16087
|
+
},
|
|
16088
|
+
testID: testID
|
|
16089
|
+
}, /*#__PURE__*/React.createElement(HeaderTabItem$1, null, /*#__PURE__*/React.createElement(Badge$1.Status, {
|
|
16090
|
+
visible: showBadge
|
|
16091
|
+
}, tabItem)));
|
|
16092
|
+
})), /*#__PURE__*/React.createElement(ActiveTabIndicator, {
|
|
16093
|
+
positionAnimatedValue: positionAnimatedValue,
|
|
16094
|
+
scrollOffsetAnimatedValue: scrollOffsetAnimatedValue,
|
|
16095
|
+
tabsLength: tabs.length,
|
|
16096
|
+
tabsWidth: tabsWidth
|
|
16097
|
+
}))), /*#__PURE__*/React.createElement(ContentWrapper$1, {
|
|
16098
|
+
initialPage: selectedTabIndex,
|
|
16099
|
+
ref: pagerViewRef,
|
|
16100
|
+
onPageSelected: function onPageSelected(e) {
|
|
16101
|
+
var index = e.nativeEvent.position;
|
|
16102
|
+
var selectedItem = tabs[index];
|
|
16103
|
+
|
|
16104
|
+
if (selectedItem) {
|
|
16105
|
+
onTabPress(selectedItem.key);
|
|
16106
|
+
}
|
|
16107
|
+
},
|
|
16108
|
+
onPageScroll: Animated.event([{
|
|
16109
|
+
nativeEvent: {
|
|
16110
|
+
offset: scrollOffsetAnimatedValue,
|
|
16111
|
+
position: positionAnimatedValue
|
|
16112
|
+
}
|
|
16113
|
+
}], {
|
|
16114
|
+
useNativeDriver: true
|
|
16115
|
+
})
|
|
16116
|
+
}, tabs.map(function (tab, index) {
|
|
16117
|
+
var key = tab.key,
|
|
16118
|
+
component = tab.component,
|
|
16119
|
+
testID = tab.testID;
|
|
16120
|
+
var active = selectedTabKey === key;
|
|
16121
|
+
var isLazyScreen = lazy && Math.abs(selectedTabIndex - index) > lazyPreloadDistance;
|
|
16122
|
+
return /*#__PURE__*/React.createElement(TabScreen$1, {
|
|
14232
16123
|
key: key,
|
|
14233
16124
|
testID: testID ? "tab-screen-".concat(testID) : undefined,
|
|
14234
16125
|
pointerEvents: active ? 'auto' : 'none',
|
|
14235
16126
|
accessibilityElementsHidden: !active,
|
|
14236
16127
|
importantForAccessibility: active ? 'auto' : 'no-hide-descendants',
|
|
14237
|
-
collapsable: false
|
|
14238
|
-
|
|
14239
|
-
// This is an workaround for a bug where the clipped view never re-appears.
|
|
14240
|
-
isIOS ? selectedTabKey !== key : true,
|
|
14241
|
-
themeVisibility: active
|
|
14242
|
-
}, component);
|
|
16128
|
+
collapsable: false
|
|
16129
|
+
}, isLazyScreen ? null : component);
|
|
14243
16130
|
})));
|
|
14244
16131
|
};
|
|
14245
16132
|
|
|
14246
|
-
|
|
16133
|
+
var index = Object.assign(Tabs, {
|
|
16134
|
+
Scroll: ScrollableTab
|
|
16135
|
+
});
|
|
16136
|
+
|
|
16137
|
+
var BACKGROUND_INTENTS = {
|
|
16138
|
+
success: 'successBackground',
|
|
16139
|
+
warning: 'warningBackground',
|
|
16140
|
+
danger: 'dangerBackground',
|
|
16141
|
+
info: 'infoBackground'
|
|
16142
|
+
};
|
|
16143
|
+
var StyledView = index$2(View)(function (_ref) {
|
|
16144
|
+
var themeIntent = _ref.themeIntent,
|
|
16145
|
+
theme = _ref.theme;
|
|
16146
|
+
return {
|
|
16147
|
+
borderWidth: theme.__hd__.tag.borderWidths["default"],
|
|
16148
|
+
borderRadius: theme.__hd__.tag.radii["default"],
|
|
16149
|
+
paddingVertical: theme.__hd__.tag.space.verticalPadding,
|
|
16150
|
+
paddingHorizontal: theme.__hd__.tag.space.horizontalPadding,
|
|
16151
|
+
borderColor: theme.__hd__.tag.colors[themeIntent],
|
|
16152
|
+
backgroundColor: theme.__hd__.tag.colors[BACKGROUND_INTENTS[themeIntent]]
|
|
16153
|
+
};
|
|
16154
|
+
});
|
|
16155
|
+
var StyledText = index$2(Text$1)(function (_ref2) {
|
|
16156
|
+
var themeIntent = _ref2.themeIntent,
|
|
16157
|
+
theme = _ref2.theme;
|
|
16158
|
+
return {
|
|
16159
|
+
fontFamily: theme.__hd__.tag.fonts["default"],
|
|
16160
|
+
fontSize: theme.__hd__.tag.fontSizes["default"],
|
|
16161
|
+
color: theme.__hd__.tag.colors[themeIntent],
|
|
16162
|
+
includeFontPadding: false,
|
|
16163
|
+
textAlignVertical: 'center',
|
|
16164
|
+
textAlign: 'center'
|
|
16165
|
+
};
|
|
16166
|
+
});
|
|
16167
|
+
|
|
16168
|
+
var _excluded = ["content", "intent", "style", "testID"];
|
|
16169
|
+
|
|
16170
|
+
var Tag = function Tag(_ref) {
|
|
16171
|
+
var content = _ref.content,
|
|
16172
|
+
_ref$intent = _ref.intent,
|
|
16173
|
+
intent = _ref$intent === void 0 ? 'info' : _ref$intent,
|
|
16174
|
+
style = _ref.style,
|
|
16175
|
+
testID = _ref.testID,
|
|
16176
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded);
|
|
16177
|
+
|
|
16178
|
+
return /*#__PURE__*/React.createElement(StyledView, _extends$3({}, nativeProps, {
|
|
16179
|
+
themeIntent: intent,
|
|
16180
|
+
style: style,
|
|
16181
|
+
testID: testID
|
|
16182
|
+
}), /*#__PURE__*/React.createElement(StyledText, {
|
|
16183
|
+
themeIntent: intent
|
|
16184
|
+
}, content));
|
|
16185
|
+
};
|
|
16186
|
+
|
|
16187
|
+
export { Avatar, Badge$1 as Badge, BottomNavigation, CompoundButton as Button, Card, Collapse, Divider, Drawer, index$1 as FAB, Icon, Progress, index as Tabs, Tag, ThemeProvider, Typography, getTheme, scale, theme, useTheme };
|