@hero-design/rn 7.2.2 → 7.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +2 -2
- package/es/index.js +2389 -449
- package/jest.config.js +1 -1
- package/lib/index.js +2410 -465
- 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/ScrollableTab.d.ts +3 -0
- package/types/src/components/Tabs/ScrollableTabs.d.ts +3 -0
- package/types/src/components/Tabs/StyledScrollableTab.d.ts +61 -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__/ScrollableTab.spec.d.ts +1 -0
- 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/.expo/README.md +0 -15
- package/.expo/packager-info.json +0 -10
- package/.expo/settings.json +0 -10
- 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
|
}
|
|
@@ -1407,8 +1516,8 @@ var createCache = function createCache(options) {
|
|
|
1407
1516
|
return cache;
|
|
1408
1517
|
};
|
|
1409
1518
|
|
|
1410
|
-
function _extends$
|
|
1411
|
-
_extends$
|
|
1519
|
+
function _extends$2() {
|
|
1520
|
+
_extends$2 = Object.assign ? Object.assign.bind() : function (target) {
|
|
1412
1521
|
for (var i = 1; i < arguments.length; i++) {
|
|
1413
1522
|
var source = arguments[i];
|
|
1414
1523
|
|
|
@@ -1421,7 +1530,7 @@ function _extends$1() {
|
|
|
1421
1530
|
|
|
1422
1531
|
return target;
|
|
1423
1532
|
};
|
|
1424
|
-
return _extends$
|
|
1533
|
+
return _extends$2.apply(this, arguments);
|
|
1425
1534
|
}
|
|
1426
1535
|
|
|
1427
1536
|
var weakMemoize = function weakMemoize(func) {
|
|
@@ -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
|
|
|
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
|
+
|
|
1933
2255
|
var getTheme = function getTheme() {
|
|
1934
2256
|
var scale = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : scale$1;
|
|
1935
2257
|
var systemPallete = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : systemPalette;
|
|
1936
2258
|
var globalTheme = getGlobalTheme(scale, systemPallete);
|
|
1937
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
|
-
danger: 'dangerBackground',
|
|
3887
|
-
info: 'infoBackground'
|
|
3888
|
-
};
|
|
3889
|
-
var StyledView = index$1(View)(function (_ref) {
|
|
3890
|
-
var themeIntent = _ref.themeIntent,
|
|
4210
|
+
var StyledPressable = index$2(TouchableOpacity)(function (_ref) {
|
|
4211
|
+
var themeSize = _ref.themeSize,
|
|
4212
|
+
themeIntent = _ref.themeIntent,
|
|
3891
4213
|
theme = _ref.theme;
|
|
3892
4214
|
return {
|
|
3893
|
-
borderWidth: theme.__hd__.
|
|
3894
|
-
borderRadius: theme.__hd__.
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
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'
|
|
3899
4221
|
};
|
|
3900
4222
|
});
|
|
3901
|
-
var
|
|
3902
|
-
var
|
|
4223
|
+
var StyledView$2 = index$2(View)(function (_ref2) {
|
|
4224
|
+
var themeSize = _ref2.themeSize,
|
|
4225
|
+
themeIntent = _ref2.themeIntent,
|
|
3903
4226
|
theme = _ref2.theme;
|
|
3904
4227
|
return {
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
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]
|
|
3908
4261
|
};
|
|
3909
4262
|
});
|
|
3910
4263
|
|
|
3911
|
-
var
|
|
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;
|
|
4289
|
+
};
|
|
3912
4290
|
|
|
3913
|
-
var
|
|
3914
|
-
var
|
|
4291
|
+
var StyledView$1 = index$2(Animated.View)(function (_ref) {
|
|
4292
|
+
var themeIntent = _ref.themeIntent,
|
|
4293
|
+
themePadding = _ref.themePadding,
|
|
4294
|
+
theme = _ref.theme;
|
|
4295
|
+
return {
|
|
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'
|
|
4314
|
+
};
|
|
4315
|
+
});
|
|
4316
|
+
var StyledStatus = index$2(Animated.View)(function (_ref3) {
|
|
4317
|
+
var themeIntent = _ref3.themeIntent,
|
|
4318
|
+
theme = _ref3.theme;
|
|
4319
|
+
return {
|
|
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
|
|
4327
|
+
};
|
|
4328
|
+
});
|
|
4329
|
+
|
|
4330
|
+
var _excluded$a = ["children", "visible", "intent", "style", "testID"];
|
|
4331
|
+
|
|
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,192 +14273,879 @@ 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
|
-
|
|
13927
|
-
flexDirection: 'row',
|
|
13928
|
-
alignItems: 'center',
|
|
13929
|
-
alignSelf: 'flex-end',
|
|
13930
|
-
overflow: 'hidden'
|
|
13931
|
-
};
|
|
13932
|
-
});
|
|
13933
|
-
var StyledActionItemText = index$1(Typography.Text)(function (_ref2) {
|
|
13934
|
-
var theme = _ref2.theme;
|
|
13935
|
-
return {
|
|
13936
|
-
paddingLeft: theme.__hd__.fab.space.actionItemTextPaddingLeft,
|
|
13937
|
-
fontSize: theme.__hd__.fab.fontSizes.actionItemText,
|
|
13938
|
-
lineHeight: theme.__hd__.fab.lineHeights.actionItemText,
|
|
13939
|
-
fontFamily: theme.__hd__.fab.fonts.actionItemText
|
|
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
|
+
};
|
|
13940
14409
|
};
|
|
13941
|
-
});
|
|
13942
14410
|
|
|
13943
|
-
|
|
13944
|
-
|
|
13945
|
-
|
|
13946
|
-
|
|
13947
|
-
|
|
13948
|
-
|
|
13949
|
-
|
|
13950
|
-
|
|
13951
|
-
|
|
13952
|
-
|
|
13953
|
-
},
|
|
13954
|
-
icon: icon
|
|
13955
|
-
}), /*#__PURE__*/React.createElement(StyledActionItemText, null, title));
|
|
14411
|
+
return _objectSpread2({
|
|
14412
|
+
width: '100%',
|
|
14413
|
+
flexDirection: 'row',
|
|
14414
|
+
justifyContent: 'center',
|
|
14415
|
+
alignItems: 'center',
|
|
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());
|
|
13956
14422
|
};
|
|
13957
14423
|
|
|
13958
|
-
var
|
|
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"],
|
|
14727
|
+
overflow: 'hidden'
|
|
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
|
+
}
|
|
14741
|
+
});
|
|
14742
|
+
var LeftDataCard = index$2(View)(function (_ref2) {
|
|
14743
|
+
var theme = _ref2.theme;
|
|
14744
|
+
return {
|
|
14745
|
+
backgroundColor: theme.__hd__.card.colors.dataCardIndicator,
|
|
14746
|
+
width: scale(16),
|
|
14747
|
+
height: '100%'
|
|
14748
|
+
};
|
|
14749
|
+
});
|
|
14750
|
+
|
|
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
|
+
themeVariant: variant
|
|
14761
|
+
}), variant === 'data' && /*#__PURE__*/React.createElement(LeftDataCard, {
|
|
14762
|
+
testID: "data-card-indicator"
|
|
14763
|
+
}), children);
|
|
14764
|
+
};
|
|
14765
|
+
|
|
14766
|
+
var StyledWrapper$1 = index$2(Animated.View)(function () {
|
|
14767
|
+
return {
|
|
14768
|
+
margin: 0,
|
|
14769
|
+
padding: 0,
|
|
14770
|
+
overflow: 'hidden'
|
|
14771
|
+
};
|
|
14772
|
+
});
|
|
14773
|
+
var StyledChildWrapper = index$2(View)(function () {
|
|
14774
|
+
return {
|
|
14775
|
+
margin: 0,
|
|
14776
|
+
padding: 0
|
|
14777
|
+
};
|
|
14778
|
+
});
|
|
14779
|
+
|
|
14780
|
+
var usePrevious = function usePrevious(value) {
|
|
14781
|
+
var ref = React.useRef();
|
|
14782
|
+
React.useEffect(function () {
|
|
14783
|
+
ref.current = value;
|
|
14784
|
+
}, [value]);
|
|
14785
|
+
return ref.current;
|
|
14786
|
+
};
|
|
14787
|
+
|
|
14788
|
+
var Collapse = function Collapse(_ref) {
|
|
14789
|
+
var _ref$open = _ref.open,
|
|
14790
|
+
open = _ref$open === void 0 ? false : _ref$open,
|
|
14791
|
+
_ref$keepChildrenMoun = _ref.keepChildrenMounted,
|
|
14792
|
+
keepChildrenMounted = _ref$keepChildrenMoun === void 0 ? false : _ref$keepChildrenMoun,
|
|
14793
|
+
children = _ref.children,
|
|
14794
|
+
testID = _ref.testID,
|
|
14795
|
+
style = _ref.style;
|
|
14796
|
+
var collapseAnim = React.useRef(new Animated.Value(0)).current;
|
|
14797
|
+
var innerRef = React.useRef(null);
|
|
14798
|
+
|
|
14799
|
+
var _React$useState = React.useState(0),
|
|
14800
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
14801
|
+
contentHeight = _React$useState2[0],
|
|
14802
|
+
setContentHeight = _React$useState2[1];
|
|
14803
|
+
|
|
14804
|
+
var _React$useState3 = React.useState(0),
|
|
14805
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
14806
|
+
maxHeight = _React$useState4[0],
|
|
14807
|
+
setMaxHeight = _React$useState4[1];
|
|
14808
|
+
|
|
14809
|
+
var _useState = useState(false),
|
|
14810
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
14811
|
+
isWaitingToClose = _useState2[0],
|
|
14812
|
+
setIsWaitingToClose = _useState2[1];
|
|
14813
|
+
|
|
14814
|
+
var _useState3 = useState('percent'),
|
|
14815
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
14816
|
+
heightSource = _useState4[0],
|
|
14817
|
+
setHeightSource = _useState4[1];
|
|
14818
|
+
|
|
14819
|
+
var previousOpenState = usePrevious(open);
|
|
14820
|
+
var animatedCallback = useCallback(function () {
|
|
14821
|
+
if (open === true) {
|
|
14822
|
+
setIsWaitingToClose(true);
|
|
14823
|
+
setMaxHeight(contentHeight);
|
|
14824
|
+
} else {
|
|
14825
|
+
setIsWaitingToClose(false);
|
|
14826
|
+
}
|
|
14827
|
+
}, [open, contentHeight]);
|
|
14828
|
+
useEffect(function () {
|
|
14829
|
+
if (open !== previousOpenState && previousOpenState !== undefined) {
|
|
14830
|
+
var useHeightValue = maxHeight || 100;
|
|
14831
|
+
setHeightSource(useHeightValue > 100 ? 'container' : 'percent');
|
|
14832
|
+
Animated.timing(collapseAnim, {
|
|
14833
|
+
toValue: open ? useHeightValue : 0,
|
|
14834
|
+
easing: Easing.inOut(Easing.ease),
|
|
14835
|
+
useNativeDriver: false
|
|
14836
|
+
}).start(animatedCallback);
|
|
14837
|
+
}
|
|
14838
|
+
}, [open, previousOpenState, maxHeight]);
|
|
14839
|
+
var checkMaxHeight = useCallback(function (_ref2) {
|
|
14840
|
+
var height = _ref2.height;
|
|
14841
|
+
|
|
14842
|
+
if (height > contentHeight) {
|
|
14843
|
+
setContentHeight(height);
|
|
14844
|
+
}
|
|
14845
|
+
}, [contentHeight]);
|
|
14846
|
+
return /*#__PURE__*/React.createElement(StyledWrapper$1, {
|
|
14847
|
+
onLayout: function onLayout(event) {
|
|
14848
|
+
return checkMaxHeight(event.nativeEvent.layout);
|
|
14849
|
+
},
|
|
14850
|
+
style: [style, {
|
|
14851
|
+
maxHeight: heightSource === 'container' ? collapseAnim : collapseAnim.interpolate({
|
|
14852
|
+
inputRange: [0, 100],
|
|
14853
|
+
outputRange: ['0%', '100%']
|
|
14854
|
+
})
|
|
14855
|
+
}],
|
|
14856
|
+
testID: testID
|
|
14857
|
+
}, (keepChildrenMounted === true || open === true || open === false && isWaitingToClose === true) && /*#__PURE__*/React.createElement(StyledChildWrapper, {
|
|
14858
|
+
ref: innerRef
|
|
14859
|
+
}, children));
|
|
14860
|
+
};
|
|
14861
|
+
|
|
14862
|
+
var StyledDivider = index$2(View)(function (_ref) {
|
|
14863
|
+
var themeMarginHorizontal = _ref.themeMarginHorizontal,
|
|
14864
|
+
themeMarginVertical = _ref.themeMarginVertical,
|
|
14865
|
+
theme = _ref.theme;
|
|
14866
|
+
var horizontalMargin = themeMarginHorizontal !== undefined ? {
|
|
14867
|
+
marginHorizontal: theme.__hd__.divider.space[themeMarginHorizontal]
|
|
14868
|
+
} : {};
|
|
14869
|
+
var verticalMargin = themeMarginVertical !== undefined ? {
|
|
14870
|
+
marginVertical: theme.__hd__.divider.space[themeMarginVertical]
|
|
14871
|
+
} : {};
|
|
14872
|
+
return _objectSpread2(_objectSpread2({
|
|
14873
|
+
maxWidth: '100%',
|
|
14874
|
+
borderBottomColor: theme.__hd__.divider.colors["default"],
|
|
14875
|
+
borderBottomWidth: theme.__hd__.divider.borderWidths["default"]
|
|
14876
|
+
}, horizontalMargin), verticalMargin);
|
|
14877
|
+
});
|
|
14878
|
+
|
|
14879
|
+
var _excluded$4 = ["marginHorizontal", "marginVertical", "style", "testID"];
|
|
14880
|
+
|
|
14881
|
+
var Divider = function Divider(_ref) {
|
|
14882
|
+
var marginHorizontal = _ref.marginHorizontal,
|
|
14883
|
+
marginVertical = _ref.marginVertical,
|
|
14884
|
+
style = _ref.style,
|
|
14885
|
+
testID = _ref.testID,
|
|
14886
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$4);
|
|
14887
|
+
|
|
14888
|
+
return /*#__PURE__*/React.createElement(StyledDivider, _extends$3({}, nativeProps, {
|
|
14889
|
+
themeMarginHorizontal: marginHorizontal,
|
|
14890
|
+
themeMarginVertical: marginVertical,
|
|
14891
|
+
style: style,
|
|
14892
|
+
testID: testID
|
|
14893
|
+
}));
|
|
14894
|
+
};
|
|
14895
|
+
|
|
14896
|
+
var AnimatedPressable = Animated.createAnimatedComponent(Pressable);
|
|
14897
|
+
var StyledContainer$1 = index$2(View)(function (_ref) {
|
|
14898
|
+
var theme = _ref.theme,
|
|
14899
|
+
enableShadow = _ref.enableShadow;
|
|
14900
|
+
return _objectSpread2(_objectSpread2({}, StyleSheet$1.absoluteFillObject), {}, {
|
|
14901
|
+
shadowColor: enableShadow ? theme.__hd__.drawer.colors.shadow : 'transparent',
|
|
14902
|
+
shadowOffset: theme.__hd__.drawer.shadows.offset,
|
|
14903
|
+
shadowOpacity: theme.__hd__.drawer.shadows.opacity,
|
|
14904
|
+
shadowRadius: theme.__hd__.drawer.shadows.radius,
|
|
14905
|
+
overflow: 'hidden',
|
|
14906
|
+
zIndex: 9999,
|
|
14907
|
+
elevation: 9999
|
|
14908
|
+
});
|
|
14909
|
+
});
|
|
14910
|
+
var StyledBackdrop$1 = index$2(AnimatedPressable)(function (_ref2) {
|
|
14911
|
+
var theme = _ref2.theme;
|
|
14912
|
+
return _objectSpread2(_objectSpread2({}, StyleSheet$1.absoluteFillObject), {}, {
|
|
14913
|
+
backgroundColor: theme.__hd__.drawer.colors.backdrop
|
|
14914
|
+
});
|
|
14915
|
+
});
|
|
14916
|
+
var StyledDrawerContainer = index$2(Animated.View)(function (_ref3) {
|
|
14917
|
+
var theme = _ref3.theme,
|
|
14918
|
+
enableShadow = _ref3.enableShadow;
|
|
14919
|
+
return {
|
|
14920
|
+
borderBottomLeftRadius: theme.__hd__.drawer.radii["default"],
|
|
14921
|
+
borderBottomRightRadius: theme.__hd__.drawer.radii["default"],
|
|
14922
|
+
backgroundColor: theme.__hd__.drawer.colors.background,
|
|
14923
|
+
elevation: enableShadow ? theme.__hd__.drawer.shadows.elevation : undefined,
|
|
14924
|
+
overflow: 'hidden'
|
|
14925
|
+
};
|
|
14926
|
+
});
|
|
14927
|
+
|
|
14928
|
+
var Drawer = function Drawer(_ref) {
|
|
14929
|
+
var visible = _ref.visible,
|
|
14930
|
+
children = _ref.children,
|
|
14931
|
+
_ref$hasBackdrop = _ref.hasBackdrop,
|
|
14932
|
+
hasBackdrop = _ref$hasBackdrop === void 0 ? true : _ref$hasBackdrop,
|
|
14933
|
+
onDismiss = _ref.onDismiss,
|
|
14934
|
+
testID = _ref.testID;
|
|
14935
|
+
var animatedValue = useRef(new Animated.Value(visible ? 1 : 0)).current;
|
|
14936
|
+
|
|
14937
|
+
var _useState = useState(0),
|
|
14938
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
14939
|
+
height = _useState2[0],
|
|
14940
|
+
setHeight = _useState2[1];
|
|
14941
|
+
|
|
14942
|
+
var enableShadow = visible && !hasBackdrop;
|
|
14943
|
+
var interpolateTranslateY = animatedValue.interpolate({
|
|
14944
|
+
inputRange: [0, 1],
|
|
14945
|
+
outputRange: [-height, 0]
|
|
14946
|
+
});
|
|
14947
|
+
var interpolateBackdropOpacity = hasBackdrop ? animatedValue.interpolate({
|
|
14948
|
+
inputRange: [0, 1],
|
|
14949
|
+
outputRange: [0, 0.35]
|
|
14950
|
+
}) : 0;
|
|
14951
|
+
useEffect(function () {
|
|
14952
|
+
var animation = Animated.timing(animatedValue, {
|
|
14953
|
+
toValue: visible ? 1 : 0,
|
|
14954
|
+
easing: Easing.inOut(Easing.cubic),
|
|
14955
|
+
useNativeDriver: true
|
|
14956
|
+
});
|
|
14957
|
+
animation.start();
|
|
14958
|
+
return function () {
|
|
14959
|
+
return animation.stop();
|
|
14960
|
+
};
|
|
14961
|
+
}, [visible]);
|
|
14962
|
+
return /*#__PURE__*/React.createElement(StyledContainer$1, {
|
|
14963
|
+
testID: testID,
|
|
14964
|
+
enableShadow: enableShadow,
|
|
14965
|
+
pointerEvents: "box-none"
|
|
14966
|
+
}, /*#__PURE__*/React.createElement(StyledBackdrop$1, {
|
|
14967
|
+
pointerEvents: visible ? 'auto' : 'box-none',
|
|
14968
|
+
onPress: onDismiss,
|
|
14969
|
+
style: {
|
|
14970
|
+
opacity: interpolateBackdropOpacity
|
|
14971
|
+
}
|
|
14972
|
+
}), /*#__PURE__*/React.createElement(StyledDrawerContainer, {
|
|
14973
|
+
enableShadow: enableShadow,
|
|
14974
|
+
onLayout: function onLayout(_ref2) {
|
|
14975
|
+
var nativeEvent = _ref2.nativeEvent;
|
|
14976
|
+
return setHeight(nativeEvent.layout.height);
|
|
14977
|
+
},
|
|
14978
|
+
style: {
|
|
14979
|
+
transform: [{
|
|
14980
|
+
translateY: interpolateTranslateY
|
|
14981
|
+
}]
|
|
14982
|
+
}
|
|
14983
|
+
}, children));
|
|
14984
|
+
};
|
|
14985
|
+
|
|
14986
|
+
var StyledFABContainer = index$2(TouchableHighlight)(function (_ref) {
|
|
14987
|
+
var theme = _ref.theme;
|
|
14988
|
+
return {
|
|
14989
|
+
backgroundColor: theme.__hd__.fab.colors.buttonBackground,
|
|
14990
|
+
borderRadius: theme.radii.rounded,
|
|
14991
|
+
alignItems: 'center',
|
|
14992
|
+
justifyContent: 'center',
|
|
14993
|
+
overflow: 'hidden',
|
|
14994
|
+
alignSelf: 'flex-start',
|
|
14995
|
+
paddingHorizontal: theme.__hd__.fab.space.containerPaddingHorizontal,
|
|
14996
|
+
paddingVertical: theme.__hd__.fab.space.containerPaddingVertical,
|
|
14997
|
+
flexDirection: 'row'
|
|
14998
|
+
};
|
|
14999
|
+
});
|
|
15000
|
+
var StyledFABIcon = index$2(Icon)(function (_ref2) {
|
|
15001
|
+
var theme = _ref2.theme;
|
|
15002
|
+
return {
|
|
15003
|
+
color: theme.__hd__.fab.colors.icon,
|
|
15004
|
+
lineHeight: theme.__hd__.fab.lineHeights.icon,
|
|
15005
|
+
textAlignVertical: 'center',
|
|
15006
|
+
textAlign: 'center'
|
|
15007
|
+
};
|
|
15008
|
+
});
|
|
15009
|
+
var StyledFABText = index$2(Text$1)(function (_ref3) {
|
|
15010
|
+
var theme = _ref3.theme;
|
|
15011
|
+
return {
|
|
15012
|
+
fontFamily: theme.__hd__.fab.fonts.title,
|
|
15013
|
+
fontSize: theme.__hd__.fab.fontSizes.title,
|
|
15014
|
+
lineHeight: theme.__hd__.fab.lineHeights.title,
|
|
15015
|
+
color: theme.__hd__.fab.colors.titleText,
|
|
15016
|
+
textAlignVertical: 'center',
|
|
15017
|
+
textAlign: 'center',
|
|
15018
|
+
marginHorizontal: theme.__hd__.fab.space.titleMarginHorizontal
|
|
15019
|
+
};
|
|
15020
|
+
});
|
|
15021
|
+
|
|
15022
|
+
var _excluded$3 = ["active"];
|
|
15023
|
+
var AnimatedIcons = Animated.createAnimatedComponent(StyledFABIcon);
|
|
15024
|
+
|
|
15025
|
+
var AnimatedFABIcon = function AnimatedFABIcon(_ref) {
|
|
15026
|
+
var active = _ref.active,
|
|
15027
|
+
iconProps = _objectWithoutProperties$1(_ref, _excluded$3);
|
|
15028
|
+
|
|
15029
|
+
var rotateAnimation = useRef(new Animated.Value(active ? 1 : 0));
|
|
15030
|
+
useEffect(function () {
|
|
15031
|
+
var animation = Animated.timing(rotateAnimation.current, {
|
|
15032
|
+
toValue: active ? 1 : 0,
|
|
15033
|
+
useNativeDriver: true
|
|
15034
|
+
});
|
|
15035
|
+
animation.start();
|
|
15036
|
+
return function () {
|
|
15037
|
+
animation.stop();
|
|
15038
|
+
};
|
|
15039
|
+
}, [active]);
|
|
15040
|
+
var interpolatedRotateAnimation = rotateAnimation.current.interpolate({
|
|
15041
|
+
inputRange: [0, 1],
|
|
15042
|
+
outputRange: ['0deg', '-45deg']
|
|
15043
|
+
});
|
|
15044
|
+
return /*#__PURE__*/React.createElement(Animated.View, {
|
|
15045
|
+
style: StyleSheet$1.flatten([{
|
|
15046
|
+
transform: [{
|
|
15047
|
+
rotate: interpolatedRotateAnimation
|
|
15048
|
+
}]
|
|
15049
|
+
}])
|
|
15050
|
+
}, /*#__PURE__*/React.createElement(AnimatedIcons, iconProps));
|
|
15051
|
+
};
|
|
15052
|
+
|
|
15053
|
+
var IconOnlyContent = function IconOnlyContent(_ref) {
|
|
15054
|
+
var icon = _ref.icon,
|
|
15055
|
+
animated = _ref.animated,
|
|
15056
|
+
active = _ref.active;
|
|
15057
|
+
|
|
15058
|
+
if (animated) {
|
|
15059
|
+
return /*#__PURE__*/React.createElement(AnimatedFABIcon, {
|
|
15060
|
+
active: active,
|
|
15061
|
+
icon: icon,
|
|
15062
|
+
testID: "animated-fab-icon"
|
|
15063
|
+
});
|
|
15064
|
+
}
|
|
15065
|
+
|
|
15066
|
+
return /*#__PURE__*/React.createElement(StyledFABIcon, {
|
|
15067
|
+
icon: icon,
|
|
15068
|
+
testID: "styled-fab-icon"
|
|
15069
|
+
});
|
|
15070
|
+
};
|
|
15071
|
+
|
|
15072
|
+
var IconWithTextContent = function IconWithTextContent(_ref2) {
|
|
15073
|
+
var icon = _ref2.icon,
|
|
15074
|
+
title = _ref2.title;
|
|
15075
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StyledFABIcon, {
|
|
15076
|
+
size: "xsmall",
|
|
15077
|
+
icon: icon,
|
|
15078
|
+
testID: "styled-fab-icon"
|
|
15079
|
+
}), /*#__PURE__*/React.createElement(StyledFABText, null, title));
|
|
15080
|
+
};
|
|
15081
|
+
|
|
15082
|
+
var FAB = function FAB(_ref3) {
|
|
15083
|
+
var onPress = _ref3.onPress,
|
|
15084
|
+
title = _ref3.title,
|
|
15085
|
+
icon = _ref3.icon,
|
|
15086
|
+
animated = _ref3.animated,
|
|
15087
|
+
testID = _ref3.testID,
|
|
15088
|
+
active = _ref3.active,
|
|
15089
|
+
style = _ref3.style;
|
|
15090
|
+
var isIconOnly = !title;
|
|
15091
|
+
return /*#__PURE__*/React.createElement(StyledFABContainer, {
|
|
15092
|
+
testID: testID,
|
|
15093
|
+
style: style,
|
|
15094
|
+
onPress: onPress,
|
|
15095
|
+
activeOpacity: 0.6
|
|
15096
|
+
}, isIconOnly ? /*#__PURE__*/React.createElement(IconOnlyContent, {
|
|
15097
|
+
animated: animated,
|
|
15098
|
+
active: active,
|
|
15099
|
+
icon: icon
|
|
15100
|
+
}) : /*#__PURE__*/React.createElement(IconWithTextContent, {
|
|
15101
|
+
icon: icon,
|
|
15102
|
+
title: title
|
|
15103
|
+
}));
|
|
15104
|
+
};
|
|
15105
|
+
|
|
15106
|
+
var StyledActionItem = index$2(TouchableOpacity)(function (_ref) {
|
|
15107
|
+
var theme = _ref.theme;
|
|
15108
|
+
return {
|
|
15109
|
+
paddingLeft: theme.__hd__.fab.space.actionItemPaddingLeft,
|
|
15110
|
+
paddingRight: theme.__hd__.fab.space.actionItemPaddingRight,
|
|
15111
|
+
paddingTop: theme.__hd__.fab.space.actionItemPaddingTop,
|
|
15112
|
+
paddingBottom: theme.__hd__.fab.space.actionItemPaddingBottom,
|
|
15113
|
+
margin: theme.__hd__.fab.space.actionItemMargin,
|
|
15114
|
+
marginRight: theme.__hd__.fab.space.actionItemMarginRight,
|
|
15115
|
+
backgroundColor: theme.__hd__.fab.colors.actionItemBackground,
|
|
15116
|
+
borderRadius: theme.__hd__.fab.radii.actionItem,
|
|
15117
|
+
flexDirection: 'row',
|
|
15118
|
+
alignItems: 'center',
|
|
15119
|
+
alignSelf: 'flex-end',
|
|
15120
|
+
overflow: 'hidden'
|
|
15121
|
+
};
|
|
15122
|
+
});
|
|
15123
|
+
var StyledActionItemText = index$2(Typography.Text)(function (_ref2) {
|
|
15124
|
+
var theme = _ref2.theme;
|
|
15125
|
+
return {
|
|
15126
|
+
paddingLeft: theme.__hd__.fab.space.actionItemTextPaddingLeft,
|
|
15127
|
+
fontSize: theme.__hd__.fab.fontSizes.actionItemText,
|
|
15128
|
+
lineHeight: theme.__hd__.fab.lineHeights.actionItemText,
|
|
15129
|
+
fontFamily: theme.__hd__.fab.fonts.actionItemText
|
|
15130
|
+
};
|
|
15131
|
+
});
|
|
15132
|
+
|
|
15133
|
+
var ActionItem = function ActionItem(_ref) {
|
|
15134
|
+
var icon = _ref.icon,
|
|
15135
|
+
title = _ref.title,
|
|
15136
|
+
onPress = _ref.onPress,
|
|
15137
|
+
style = _ref.style,
|
|
15138
|
+
testID = _ref.testID;
|
|
15139
|
+
return /*#__PURE__*/React.createElement(StyledActionItem, {
|
|
15140
|
+
style: style,
|
|
15141
|
+
onPress: onPress,
|
|
15142
|
+
testID: testID
|
|
15143
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
15144
|
+
icon: icon
|
|
15145
|
+
}), /*#__PURE__*/React.createElement(StyledActionItemText, null, title));
|
|
15146
|
+
};
|
|
15147
|
+
|
|
15148
|
+
var StyledContainer = index$2(View)({
|
|
13959
15149
|
position: 'absolute',
|
|
13960
15150
|
left: 0,
|
|
13961
15151
|
right: 0,
|
|
@@ -13964,194 +15154,739 @@ var StyledContainer = index$1(View)({
|
|
|
13964
15154
|
alignItems: 'flex-end',
|
|
13965
15155
|
justifyContent: 'flex-end'
|
|
13966
15156
|
});
|
|
13967
|
-
var StyledActionGroupContainer = index$
|
|
15157
|
+
var StyledActionGroupContainer = index$2(Animated.View)({
|
|
13968
15158
|
alignItems: 'flex-end',
|
|
13969
15159
|
justifyContent: 'flex-end',
|
|
13970
15160
|
width: '70%'
|
|
13971
15161
|
});
|
|
13972
|
-
var StyledFAB = index$
|
|
13973
|
-
var theme = _ref.theme;
|
|
15162
|
+
var StyledFAB = index$2(FAB)(function (_ref) {
|
|
15163
|
+
var theme = _ref.theme;
|
|
15164
|
+
return {
|
|
15165
|
+
marginRight: theme.__hd__.fab.space.buttonMarginRight,
|
|
15166
|
+
marginTop: theme.__hd__.fab.space.buttonMarginTop,
|
|
15167
|
+
alignSelf: 'flex-end'
|
|
15168
|
+
};
|
|
15169
|
+
});
|
|
15170
|
+
var StyledBackdrop = index$2(Animated.View)(function (_ref2) {
|
|
15171
|
+
var theme = _ref2.theme;
|
|
15172
|
+
return {
|
|
15173
|
+
position: 'absolute',
|
|
15174
|
+
left: 0,
|
|
15175
|
+
right: 0,
|
|
15176
|
+
top: 0,
|
|
15177
|
+
bottom: 0,
|
|
15178
|
+
backgroundColor: theme.__hd__.fab.colors.backdropBackground
|
|
15179
|
+
};
|
|
15180
|
+
});
|
|
15181
|
+
var StyledHeaderText = index$2(Typography.Text)(function (_ref3) {
|
|
15182
|
+
var theme = _ref3.theme;
|
|
15183
|
+
return {
|
|
15184
|
+
fontSize: theme.__hd__.fab.fontSizes.header,
|
|
15185
|
+
lineHeight: theme.__hd__.fab.lineHeights.header,
|
|
15186
|
+
fontFamily: theme.__hd__.fab.fonts.header,
|
|
15187
|
+
marginRight: theme.__hd__.fab.space.headerTextMarginRight,
|
|
15188
|
+
marginBottom: theme.__hd__.fab.space.headerTextMarginBottom,
|
|
15189
|
+
textAlign: 'right'
|
|
15190
|
+
};
|
|
15191
|
+
});
|
|
15192
|
+
|
|
15193
|
+
var ActionItemsListComponent = function ActionItemsListComponent(_ref) {
|
|
15194
|
+
var style = _ref.style,
|
|
15195
|
+
items = _ref.items;
|
|
15196
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
15197
|
+
style: style
|
|
15198
|
+
}, items === null || items === void 0 ? void 0 : items.map(function (itemProp) {
|
|
15199
|
+
return /*#__PURE__*/React.createElement(ActionItem, _extends$3({
|
|
15200
|
+
key: itemProp.icon
|
|
15201
|
+
}, itemProp));
|
|
15202
|
+
}));
|
|
15203
|
+
};
|
|
15204
|
+
|
|
15205
|
+
var ActionGroup = function ActionGroup(_ref2) {
|
|
15206
|
+
var headerTitle = _ref2.headerTitle,
|
|
15207
|
+
onPress = _ref2.onPress,
|
|
15208
|
+
active = _ref2.active,
|
|
15209
|
+
style = _ref2.style,
|
|
15210
|
+
items = _ref2.items,
|
|
15211
|
+
testID = _ref2.testID,
|
|
15212
|
+
fabTitle = _ref2.fabTitle;
|
|
15213
|
+
var tranlateXAnimation = useRef(new Animated.Value(active ? 1 : 0));
|
|
15214
|
+
useEffect(function () {
|
|
15215
|
+
var animation = Animated.timing(tranlateXAnimation.current, {
|
|
15216
|
+
toValue: active ? 1 : 0,
|
|
15217
|
+
useNativeDriver: true
|
|
15218
|
+
});
|
|
15219
|
+
animation.start();
|
|
15220
|
+
}, [active]);
|
|
15221
|
+
var interpolatedTranlateXAnimation = tranlateXAnimation.current.interpolate({
|
|
15222
|
+
inputRange: [0, 1],
|
|
15223
|
+
outputRange: [400, 0]
|
|
15224
|
+
});
|
|
15225
|
+
var interpolatedOpacityAnimation = tranlateXAnimation.current.interpolate({
|
|
15226
|
+
inputRange: [0, 1],
|
|
15227
|
+
outputRange: [0, 0.9]
|
|
15228
|
+
});
|
|
15229
|
+
return /*#__PURE__*/React.createElement(StyledContainer, {
|
|
15230
|
+
testID: testID,
|
|
15231
|
+
pointerEvents: "box-none",
|
|
15232
|
+
style: style
|
|
15233
|
+
}, /*#__PURE__*/React.createElement(StyledBackdrop, {
|
|
15234
|
+
pointerEvents: active ? 'auto' : 'box-none',
|
|
15235
|
+
testID: "back-drop",
|
|
15236
|
+
style: {
|
|
15237
|
+
opacity: interpolatedOpacityAnimation
|
|
15238
|
+
}
|
|
15239
|
+
}), /*#__PURE__*/React.createElement(StyledActionGroupContainer, {
|
|
15240
|
+
testID: "action-group",
|
|
15241
|
+
style: {
|
|
15242
|
+
transform: [{
|
|
15243
|
+
translateX: interpolatedTranlateXAnimation
|
|
15244
|
+
}]
|
|
15245
|
+
}
|
|
15246
|
+
}, headerTitle && /*#__PURE__*/React.createElement(StyledHeaderText, {
|
|
15247
|
+
testID: "header-text"
|
|
15248
|
+
}, headerTitle), /*#__PURE__*/React.createElement(ActionItemsListComponent, {
|
|
15249
|
+
items: items
|
|
15250
|
+
})), /*#__PURE__*/React.createElement(StyledFAB, {
|
|
15251
|
+
testID: "fab",
|
|
15252
|
+
icon: "add",
|
|
15253
|
+
onPress: onPress,
|
|
15254
|
+
animated: true,
|
|
15255
|
+
active: active,
|
|
15256
|
+
title: fabTitle
|
|
15257
|
+
}));
|
|
15258
|
+
};
|
|
15259
|
+
|
|
15260
|
+
var index$1 = Object.assign(FAB, {
|
|
15261
|
+
ActionGroup: ActionGroup
|
|
15262
|
+
});
|
|
15263
|
+
|
|
15264
|
+
var HalfCircleWrapper = index$2(View)(function (_ref) {
|
|
15265
|
+
var theme = _ref.theme;
|
|
15266
|
+
return {
|
|
15267
|
+
width: theme.__hd__.progress.sizes.radius,
|
|
15268
|
+
height: theme.__hd__.progress.sizes.radius * 2,
|
|
15269
|
+
overflow: 'hidden'
|
|
15270
|
+
};
|
|
15271
|
+
});
|
|
15272
|
+
var HalfCircleInnerFG = index$2(View)(function (_ref2) {
|
|
15273
|
+
var theme = _ref2.theme,
|
|
15274
|
+
themeIntent = _ref2.themeIntent;
|
|
15275
|
+
return {
|
|
15276
|
+
width: theme.__hd__.progress.sizes.radius * 2,
|
|
15277
|
+
height: theme.__hd__.progress.sizes.radius * 2,
|
|
15278
|
+
backgroundColor: theme.__hd__.progress.colors[themeIntent],
|
|
15279
|
+
borderRadius: theme.__hd__.progress.radii["default"]
|
|
15280
|
+
};
|
|
15281
|
+
});
|
|
15282
|
+
var HalfCircleInnerBG = index$2(View)(function (_ref3) {
|
|
15283
|
+
var theme = _ref3.theme;
|
|
15284
|
+
return {
|
|
15285
|
+
width: theme.__hd__.progress.sizes.radius * 2,
|
|
15286
|
+
height: theme.__hd__.progress.sizes.radius * 2,
|
|
15287
|
+
backgroundColor: theme.__hd__.progress.colors.background,
|
|
15288
|
+
borderRadius: theme.__hd__.progress.radii["default"]
|
|
15289
|
+
};
|
|
15290
|
+
});
|
|
15291
|
+
var DonutCircle = index$2(View)(function (_ref4) {
|
|
15292
|
+
var theme = _ref4.theme;
|
|
15293
|
+
return {
|
|
15294
|
+
position: 'absolute',
|
|
15295
|
+
top: theme.__hd__.progress.sizes.strokeWidth,
|
|
15296
|
+
left: theme.__hd__.progress.sizes.strokeWidth,
|
|
15297
|
+
width: theme.__hd__.progress.sizes.radius * 2 - theme.__hd__.progress.sizes.strokeWidth * 2,
|
|
15298
|
+
height: theme.__hd__.progress.sizes.radius * 2 - theme.__hd__.progress.sizes.strokeWidth * 2,
|
|
15299
|
+
zIndex: 3,
|
|
15300
|
+
backgroundColor: theme.__hd__.progress.colors.innerBackground,
|
|
15301
|
+
borderRadius: theme.__hd__.progress.radii["default"],
|
|
15302
|
+
alignItems: 'center',
|
|
15303
|
+
justifyContent: 'center'
|
|
15304
|
+
};
|
|
15305
|
+
});
|
|
15306
|
+
var StrokeEnd = index$2(View)(function (_ref5) {
|
|
15307
|
+
var theme = _ref5.theme,
|
|
15308
|
+
themeIntent = _ref5.themeIntent;
|
|
15309
|
+
return {
|
|
15310
|
+
position: 'absolute',
|
|
15311
|
+
top: 0,
|
|
15312
|
+
left: theme.__hd__.progress.sizes.radius - theme.__hd__.progress.sizes.strokeWidth / 2,
|
|
15313
|
+
width: theme.__hd__.progress.sizes.strokeWidth,
|
|
15314
|
+
height: theme.__hd__.progress.sizes.strokeWidth,
|
|
15315
|
+
borderRadius: theme.__hd__.progress.radii["default"],
|
|
15316
|
+
backgroundColor: theme.__hd__.progress.colors[themeIntent],
|
|
15317
|
+
zIndex: 2
|
|
15318
|
+
};
|
|
15319
|
+
});
|
|
15320
|
+
|
|
15321
|
+
var _excluded$2 = ["value", "intent", "style", "testID"];
|
|
15322
|
+
|
|
15323
|
+
var HalfCircle = function HalfCircle(_ref) {
|
|
15324
|
+
var type = _ref.type,
|
|
15325
|
+
_ref$themeIntent = _ref.themeIntent,
|
|
15326
|
+
themeIntent = _ref$themeIntent === void 0 ? 'primary' : _ref$themeIntent;
|
|
15327
|
+
return /*#__PURE__*/React.createElement(HalfCircleWrapper, null, type === 'background' ? /*#__PURE__*/React.createElement(HalfCircleInnerBG, null) : /*#__PURE__*/React.createElement(HalfCircleInnerFG, {
|
|
15328
|
+
themeIntent: themeIntent
|
|
15329
|
+
}));
|
|
15330
|
+
};
|
|
15331
|
+
|
|
15332
|
+
var ProgressCircle = function ProgressCircle(_ref2) {
|
|
15333
|
+
var value = _ref2.value,
|
|
15334
|
+
_ref2$intent = _ref2.intent,
|
|
15335
|
+
intent = _ref2$intent === void 0 ? 'primary' : _ref2$intent,
|
|
15336
|
+
style = _ref2.style,
|
|
15337
|
+
testID = _ref2.testID,
|
|
15338
|
+
nativeProps = _objectWithoutProperties$1(_ref2, _excluded$2);
|
|
15339
|
+
|
|
15340
|
+
var theme = useTheme();
|
|
15341
|
+
var radius = theme.__hd__.progress.sizes.radius;
|
|
15342
|
+
var progressAnimatedValue = useRef(new Animated.Value(0));
|
|
15343
|
+
useEffect(function () {
|
|
15344
|
+
var animation = Animated.timing(progressAnimatedValue.current, {
|
|
15345
|
+
toValue: value,
|
|
15346
|
+
useNativeDriver: true
|
|
15347
|
+
});
|
|
15348
|
+
animation.start();
|
|
15349
|
+
return function () {
|
|
15350
|
+
return animation.stop();
|
|
15351
|
+
};
|
|
15352
|
+
}, [value]); // Animate progress circle: 0% => 50%
|
|
15353
|
+
|
|
15354
|
+
var interpolateRotateRightHalf = progressAnimatedValue.current.interpolate({
|
|
15355
|
+
inputRange: [0, 50],
|
|
15356
|
+
outputRange: ['0deg', '180deg'],
|
|
15357
|
+
extrapolate: 'clamp'
|
|
15358
|
+
});
|
|
15359
|
+
var interpolateOpacityRightHalf = progressAnimatedValue.current.interpolate({
|
|
15360
|
+
inputRange: [50, 51],
|
|
15361
|
+
outputRange: [1, 0],
|
|
15362
|
+
extrapolate: 'clamp'
|
|
15363
|
+
}); // Animate progress circle: 50% => 100%
|
|
15364
|
+
|
|
15365
|
+
var interpolateRotateSecondHalf = progressAnimatedValue.current.interpolate({
|
|
15366
|
+
inputRange: [50, 100],
|
|
15367
|
+
outputRange: ['0deg', '180deg'],
|
|
15368
|
+
extrapolate: 'clamp'
|
|
15369
|
+
}); // Curve at the end of progress stroke
|
|
15370
|
+
|
|
15371
|
+
var interpolateDotRotate = progressAnimatedValue.current.interpolate({
|
|
15372
|
+
inputRange: [0, 100],
|
|
15373
|
+
outputRange: ['0deg', '360deg'],
|
|
15374
|
+
extrapolate: 'clamp'
|
|
15375
|
+
});
|
|
15376
|
+
return /*#__PURE__*/React.createElement(View, _extends$3({}, nativeProps, {
|
|
15377
|
+
testID: testID,
|
|
15378
|
+
style: style
|
|
15379
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
15380
|
+
style: {
|
|
15381
|
+
flexDirection: 'row'
|
|
15382
|
+
}
|
|
15383
|
+
}, /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(HalfCircle, {
|
|
15384
|
+
type: "foreground",
|
|
15385
|
+
themeIntent: intent
|
|
15386
|
+
}), /*#__PURE__*/React.createElement(Animated.View, {
|
|
15387
|
+
style: _objectSpread2(_objectSpread2({}, StyleSheet$1.absoluteFillObject), {}, {
|
|
15388
|
+
transform: [{
|
|
15389
|
+
translateX: radius / 2
|
|
15390
|
+
}, {
|
|
15391
|
+
rotate: interpolateRotateSecondHalf
|
|
15392
|
+
}, {
|
|
15393
|
+
translateX: -radius / 2
|
|
15394
|
+
}]
|
|
15395
|
+
})
|
|
15396
|
+
}, /*#__PURE__*/React.createElement(HalfCircle, {
|
|
15397
|
+
type: "background"
|
|
15398
|
+
}))), /*#__PURE__*/React.createElement(View, {
|
|
15399
|
+
style: {
|
|
15400
|
+
transform: [{
|
|
15401
|
+
rotate: '180deg'
|
|
15402
|
+
}],
|
|
15403
|
+
zIndex: 1
|
|
15404
|
+
}
|
|
15405
|
+
}, /*#__PURE__*/React.createElement(HalfCircle, {
|
|
15406
|
+
type: "foreground",
|
|
15407
|
+
themeIntent: intent
|
|
15408
|
+
}), /*#__PURE__*/React.createElement(Animated.View, {
|
|
15409
|
+
style: _objectSpread2(_objectSpread2({}, StyleSheet$1.absoluteFillObject), {}, {
|
|
15410
|
+
transform: [{
|
|
15411
|
+
translateX: radius / 2
|
|
15412
|
+
}, {
|
|
15413
|
+
rotate: interpolateRotateRightHalf
|
|
15414
|
+
}, {
|
|
15415
|
+
translateX: -radius / 2
|
|
15416
|
+
}],
|
|
15417
|
+
opacity: interpolateOpacityRightHalf
|
|
15418
|
+
})
|
|
15419
|
+
}, /*#__PURE__*/React.createElement(HalfCircle, {
|
|
15420
|
+
type: "background"
|
|
15421
|
+
}))), /*#__PURE__*/React.createElement(StrokeEnd, {
|
|
15422
|
+
themeIntent: intent
|
|
15423
|
+
}), /*#__PURE__*/React.createElement(Animated.View, {
|
|
15424
|
+
style: _objectSpread2(_objectSpread2({}, StyleSheet$1.absoluteFillObject), {}, {
|
|
15425
|
+
zIndex: 2,
|
|
15426
|
+
transform: [{
|
|
15427
|
+
rotate: interpolateDotRotate
|
|
15428
|
+
}]
|
|
15429
|
+
})
|
|
15430
|
+
}, /*#__PURE__*/React.createElement(StrokeEnd, {
|
|
15431
|
+
themeIntent: intent
|
|
15432
|
+
})), /*#__PURE__*/React.createElement(DonutCircle, null, /*#__PURE__*/React.createElement(Typography.Text, {
|
|
15433
|
+
fontSize: "xlarge"
|
|
15434
|
+
}, "".concat(value, "%")))));
|
|
15435
|
+
};
|
|
15436
|
+
|
|
15437
|
+
var StyledWrapper = index$2(View)(function (_ref) {
|
|
15438
|
+
var theme = _ref.theme;
|
|
15439
|
+
return {
|
|
15440
|
+
height: theme.__hd__.progress.sizes.barHeight,
|
|
15441
|
+
alignSelf: 'stretch',
|
|
15442
|
+
backgroundColor: theme.__hd__.progress.colors.background,
|
|
15443
|
+
overflow: 'hidden'
|
|
15444
|
+
};
|
|
15445
|
+
});
|
|
15446
|
+
var StyledInner = index$2(Animated.View)(function (_ref2) {
|
|
15447
|
+
var theme = _ref2.theme,
|
|
15448
|
+
themeIntent = _ref2.themeIntent;
|
|
15449
|
+
return {
|
|
15450
|
+
flex: 1,
|
|
15451
|
+
alignSelf: 'stretch',
|
|
15452
|
+
backgroundColor: theme.__hd__.progress.colors[themeIntent]
|
|
15453
|
+
};
|
|
15454
|
+
});
|
|
15455
|
+
|
|
15456
|
+
var _excluded$1 = ["value", "intent", "style", "testID"];
|
|
15457
|
+
|
|
15458
|
+
var ProgressBar = function ProgressBar(_ref) {
|
|
15459
|
+
var value = _ref.value,
|
|
15460
|
+
_ref$intent = _ref.intent,
|
|
15461
|
+
intent = _ref$intent === void 0 ? 'primary' : _ref$intent,
|
|
15462
|
+
style = _ref.style,
|
|
15463
|
+
testID = _ref.testID,
|
|
15464
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$1);
|
|
15465
|
+
|
|
15466
|
+
var _useState = useState(0),
|
|
15467
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
15468
|
+
width = _useState2[0],
|
|
15469
|
+
setWidth = _useState2[1];
|
|
15470
|
+
|
|
15471
|
+
var progressAnimatedValue = useRef(new Animated.Value(0));
|
|
15472
|
+
useEffect(function () {
|
|
15473
|
+
var animation = Animated.timing(progressAnimatedValue.current, {
|
|
15474
|
+
toValue: value,
|
|
15475
|
+
useNativeDriver: true
|
|
15476
|
+
});
|
|
15477
|
+
animation.start();
|
|
15478
|
+
return function () {
|
|
15479
|
+
return animation.stop();
|
|
15480
|
+
};
|
|
15481
|
+
}, [value]);
|
|
15482
|
+
var interpolateTranslateX = progressAnimatedValue.current.interpolate({
|
|
15483
|
+
inputRange: [0, 100],
|
|
15484
|
+
outputRange: [-width, 0],
|
|
15485
|
+
extrapolate: 'clamp'
|
|
15486
|
+
});
|
|
15487
|
+
var interpolateBorderRadius = progressAnimatedValue.current.interpolate({
|
|
15488
|
+
inputRange: [99, 100],
|
|
15489
|
+
outputRange: [999, 0],
|
|
15490
|
+
extrapolate: 'clamp'
|
|
15491
|
+
});
|
|
15492
|
+
return /*#__PURE__*/React.createElement(StyledWrapper, _extends$3({}, nativeProps, {
|
|
15493
|
+
testID: testID,
|
|
15494
|
+
style: style
|
|
15495
|
+
}), /*#__PURE__*/React.createElement(StyledInner, {
|
|
15496
|
+
themeIntent: intent,
|
|
15497
|
+
onLayout: function onLayout(_ref2) {
|
|
15498
|
+
var nativeEvent = _ref2.nativeEvent;
|
|
15499
|
+
return setWidth(nativeEvent.layout.width);
|
|
15500
|
+
},
|
|
15501
|
+
style: {
|
|
15502
|
+
transform: [{
|
|
15503
|
+
translateX: interpolateTranslateX
|
|
15504
|
+
}],
|
|
15505
|
+
borderTopRightRadius: interpolateBorderRadius,
|
|
15506
|
+
borderBottomRightRadius: interpolateBorderRadius
|
|
15507
|
+
}
|
|
15508
|
+
}));
|
|
15509
|
+
};
|
|
15510
|
+
|
|
15511
|
+
var Progress = {
|
|
15512
|
+
Circle: ProgressCircle,
|
|
15513
|
+
Bar: ProgressBar
|
|
15514
|
+
};
|
|
15515
|
+
|
|
15516
|
+
var childrenWithOverriddenStyle = function childrenWithOverriddenStyle(children) {
|
|
15517
|
+
return Children.map(children, function (child) {
|
|
15518
|
+
var element = child;
|
|
15519
|
+
return (
|
|
15520
|
+
/*#__PURE__*/
|
|
15521
|
+
// Add a wrapper to ensure layout is calculated correctly
|
|
15522
|
+
React.createElement(View, {
|
|
15523
|
+
style: StyleSheet$1.absoluteFill,
|
|
15524
|
+
collapsable: false
|
|
15525
|
+
}, /*#__PURE__*/React.cloneElement(element, _objectSpread2(_objectSpread2({}, element.props), {}, {
|
|
15526
|
+
// Override styles so that each page will fill the parent.
|
|
15527
|
+
style: [element.props.style, StyleSheet$1.absoluteFill]
|
|
15528
|
+
})))
|
|
15529
|
+
);
|
|
15530
|
+
});
|
|
15531
|
+
};
|
|
15532
|
+
|
|
15533
|
+
var VIEW_MANAGER_NAME = 'RNCViewPager';
|
|
15534
|
+
var PagerViewViewManager = requireNativeComponent(VIEW_MANAGER_NAME);
|
|
15535
|
+
function getViewManagerConfig() {
|
|
15536
|
+
var viewManagerName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : VIEW_MANAGER_NAME;
|
|
15537
|
+
return UIManager.getViewManagerConfig(viewManagerName);
|
|
15538
|
+
}
|
|
15539
|
+
|
|
15540
|
+
function _extends() {
|
|
15541
|
+
_extends = Object.assign || function (target) {
|
|
15542
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
15543
|
+
var source = arguments[i];
|
|
15544
|
+
|
|
15545
|
+
for (var key in source) {
|
|
15546
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
15547
|
+
target[key] = source[key];
|
|
15548
|
+
}
|
|
15549
|
+
}
|
|
15550
|
+
}
|
|
15551
|
+
|
|
15552
|
+
return target;
|
|
15553
|
+
};
|
|
15554
|
+
|
|
15555
|
+
return _extends.apply(this, arguments);
|
|
15556
|
+
}
|
|
15557
|
+
|
|
15558
|
+
function _defineProperty(obj, key, value) {
|
|
15559
|
+
if (key in obj) {
|
|
15560
|
+
Object.defineProperty(obj, key, {
|
|
15561
|
+
value: value,
|
|
15562
|
+
enumerable: true,
|
|
15563
|
+
configurable: true,
|
|
15564
|
+
writable: true
|
|
15565
|
+
});
|
|
15566
|
+
} else {
|
|
15567
|
+
obj[key] = value;
|
|
15568
|
+
}
|
|
15569
|
+
|
|
15570
|
+
return obj;
|
|
15571
|
+
}
|
|
15572
|
+
/**
|
|
15573
|
+
* Container that allows to flip left and right between child views. Each
|
|
15574
|
+
* child view of the `PagerView` will be treated as a separate page
|
|
15575
|
+
* and will be stretched to fill the `PagerView`.
|
|
15576
|
+
*
|
|
15577
|
+
* It is important all children are `<View>`s and not composite components.
|
|
15578
|
+
* You can set style properties like `padding` or `backgroundColor` for each
|
|
15579
|
+
* child. It is also important that each child have a `key` prop.
|
|
15580
|
+
*
|
|
15581
|
+
* Example:
|
|
15582
|
+
*
|
|
15583
|
+
* ```
|
|
15584
|
+
* render: function() {
|
|
15585
|
+
* return (
|
|
15586
|
+
* <PagerView
|
|
15587
|
+
* style={styles.PagerView}
|
|
15588
|
+
* initialPage={0}>
|
|
15589
|
+
* <View style={styles.pageStyle} key="1">
|
|
15590
|
+
* <Text>First page</Text>
|
|
15591
|
+
* </View>
|
|
15592
|
+
* <View style={styles.pageStyle} key="2">
|
|
15593
|
+
* <Text>Second page</Text>
|
|
15594
|
+
* </View>
|
|
15595
|
+
* </PagerView>
|
|
15596
|
+
* );
|
|
15597
|
+
* }
|
|
15598
|
+
*
|
|
15599
|
+
* ...
|
|
15600
|
+
*
|
|
15601
|
+
* var styles = {
|
|
15602
|
+
* ...
|
|
15603
|
+
* PagerView: {
|
|
15604
|
+
* flex: 1
|
|
15605
|
+
* },
|
|
15606
|
+
* pageStyle: {
|
|
15607
|
+
* alignItems: 'center',
|
|
15608
|
+
* padding: 20,
|
|
15609
|
+
* }
|
|
15610
|
+
* }
|
|
15611
|
+
* ```
|
|
15612
|
+
*/
|
|
15613
|
+
|
|
15614
|
+
var PagerView = /*#__PURE__*/function (_React$Component) {
|
|
15615
|
+
_inherits$1(PagerView, _React$Component);
|
|
15616
|
+
|
|
15617
|
+
var _super = _createSuper(PagerView);
|
|
15618
|
+
|
|
15619
|
+
function PagerView() {
|
|
15620
|
+
var _this;
|
|
15621
|
+
|
|
15622
|
+
_classCallCheck$1(this, PagerView);
|
|
15623
|
+
|
|
15624
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
15625
|
+
args[_key] = arguments[_key];
|
|
15626
|
+
}
|
|
15627
|
+
|
|
15628
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
15629
|
+
|
|
15630
|
+
_defineProperty(_assertThisInitialized$1(_this), "isScrolling", false);
|
|
15631
|
+
|
|
15632
|
+
_defineProperty(_assertThisInitialized$1(_this), "PagerView", /*#__PURE__*/React.createRef());
|
|
15633
|
+
|
|
15634
|
+
_defineProperty(_assertThisInitialized$1(_this), "getInnerViewNode", function () {
|
|
15635
|
+
return _this.PagerView.current.getInnerViewNode();
|
|
15636
|
+
});
|
|
15637
|
+
|
|
15638
|
+
_defineProperty(_assertThisInitialized$1(_this), "_onPageScroll", function (e) {
|
|
15639
|
+
if (_this.props.onPageScroll) {
|
|
15640
|
+
_this.props.onPageScroll(e);
|
|
15641
|
+
} // Not implemented on iOS yet
|
|
15642
|
+
|
|
15643
|
+
|
|
15644
|
+
if (Platform.OS === 'android') {
|
|
15645
|
+
if (_this.props.keyboardDismissMode === 'on-drag') {
|
|
15646
|
+
Keyboard.dismiss();
|
|
15647
|
+
}
|
|
15648
|
+
}
|
|
15649
|
+
});
|
|
15650
|
+
|
|
15651
|
+
_defineProperty(_assertThisInitialized$1(_this), "_onPageScrollStateChanged", function (e) {
|
|
15652
|
+
if (_this.props.onPageScrollStateChanged) {
|
|
15653
|
+
_this.props.onPageScrollStateChanged(e);
|
|
15654
|
+
}
|
|
15655
|
+
|
|
15656
|
+
_this.isScrolling = e.nativeEvent.pageScrollState === 'dragging';
|
|
15657
|
+
});
|
|
15658
|
+
|
|
15659
|
+
_defineProperty(_assertThisInitialized$1(_this), "_onPageSelected", function (e) {
|
|
15660
|
+
if (_this.props.onPageSelected) {
|
|
15661
|
+
_this.props.onPageSelected(e);
|
|
15662
|
+
}
|
|
15663
|
+
});
|
|
15664
|
+
|
|
15665
|
+
_defineProperty(_assertThisInitialized$1(_this), "setPage", function (selectedPage) {
|
|
15666
|
+
UIManager.dispatchViewManagerCommand(ReactNative__default.findNodeHandle(_assertThisInitialized$1(_this)), getViewManagerConfig().Commands.setPage, [selectedPage]);
|
|
15667
|
+
});
|
|
15668
|
+
|
|
15669
|
+
_defineProperty(_assertThisInitialized$1(_this), "setPageWithoutAnimation", function (selectedPage) {
|
|
15670
|
+
UIManager.dispatchViewManagerCommand(ReactNative__default.findNodeHandle(_assertThisInitialized$1(_this)), getViewManagerConfig().Commands.setPageWithoutAnimation, [selectedPage]);
|
|
15671
|
+
});
|
|
15672
|
+
|
|
15673
|
+
_defineProperty(_assertThisInitialized$1(_this), "setScrollEnabled", function (scrollEnabled) {
|
|
15674
|
+
UIManager.dispatchViewManagerCommand(ReactNative__default.findNodeHandle(_assertThisInitialized$1(_this)), getViewManagerConfig().Commands.setScrollEnabled, [scrollEnabled]);
|
|
15675
|
+
});
|
|
15676
|
+
|
|
15677
|
+
_defineProperty(_assertThisInitialized$1(_this), "_onMoveShouldSetResponderCapture", function () {
|
|
15678
|
+
return _this.isScrolling;
|
|
15679
|
+
});
|
|
15680
|
+
|
|
15681
|
+
return _this;
|
|
15682
|
+
}
|
|
15683
|
+
|
|
15684
|
+
_createClass$1(PagerView, [{
|
|
15685
|
+
key: "deducedLayoutDirection",
|
|
15686
|
+
get: function get() {
|
|
15687
|
+
var shouldUseDeviceRtlSetup = !this.props.layoutDirection || this.props.layoutDirection === 'locale';
|
|
15688
|
+
|
|
15689
|
+
if (shouldUseDeviceRtlSetup) {
|
|
15690
|
+
return I18nManager.isRTL ? 'rtl' : 'ltr';
|
|
15691
|
+
} else {
|
|
15692
|
+
return this.props.layoutDirection;
|
|
15693
|
+
}
|
|
15694
|
+
}
|
|
15695
|
+
}, {
|
|
15696
|
+
key: "render",
|
|
15697
|
+
value: function render() {
|
|
15698
|
+
return /*#__PURE__*/React.createElement(PagerViewViewManager, _extends({}, this.props, {
|
|
15699
|
+
ref: this.PagerView
|
|
15700
|
+
/** TODO: Fix ref type */
|
|
15701
|
+
,
|
|
15702
|
+
style: this.props.style,
|
|
15703
|
+
layoutDirection: this.deducedLayoutDirection,
|
|
15704
|
+
onPageScroll: this._onPageScroll,
|
|
15705
|
+
onPageScrollStateChanged: this._onPageScrollStateChanged,
|
|
15706
|
+
onPageSelected: this._onPageSelected,
|
|
15707
|
+
onMoveShouldSetResponderCapture: this._onMoveShouldSetResponderCapture,
|
|
15708
|
+
children: childrenWithOverriddenStyle(this.props.children)
|
|
15709
|
+
}));
|
|
15710
|
+
}
|
|
15711
|
+
}]);
|
|
15712
|
+
|
|
15713
|
+
return PagerView;
|
|
15714
|
+
}(React.Component);
|
|
15715
|
+
|
|
15716
|
+
var AnimatedPagerView = Animated.createAnimatedComponent(PagerView);
|
|
15717
|
+
var TabContainer$1 = index$2(View)({
|
|
15718
|
+
flex: 1,
|
|
15719
|
+
overflow: 'hidden'
|
|
15720
|
+
});
|
|
15721
|
+
var HeaderTabWrapper$1 = index$2(View)(function (_ref) {
|
|
15722
|
+
var theme = _ref.theme,
|
|
15723
|
+
themeInsets = _ref.themeInsets;
|
|
13974
15724
|
return {
|
|
13975
|
-
|
|
13976
|
-
|
|
13977
|
-
|
|
15725
|
+
paddingHorizontal: Math.max(themeInsets.left, themeInsets.right),
|
|
15726
|
+
borderBottomColor: theme.__hd__.tabs.colors.headerBottom,
|
|
15727
|
+
borderBottomWidth: theme.__hd__.tabs.borderWidths.headerBottom
|
|
13978
15728
|
};
|
|
13979
15729
|
});
|
|
13980
|
-
var
|
|
15730
|
+
var HeaderTab = index$2(View)({
|
|
15731
|
+
flexDirection: 'row'
|
|
15732
|
+
});
|
|
15733
|
+
var HeaderTabItem$1 = index$2(View)(function (_ref2) {
|
|
13981
15734
|
var theme = _ref2.theme;
|
|
13982
15735
|
return {
|
|
13983
|
-
|
|
13984
|
-
|
|
13985
|
-
|
|
13986
|
-
top: 0,
|
|
13987
|
-
bottom: 0,
|
|
13988
|
-
backgroundColor: theme.__hd__.fab.colors.backdropBackground
|
|
15736
|
+
flex: 1,
|
|
15737
|
+
alignItems: 'center',
|
|
15738
|
+
paddingVertical: theme.__hd__.tabs.space.itemVerticalPadding
|
|
13989
15739
|
};
|
|
13990
15740
|
});
|
|
13991
|
-
var
|
|
13992
|
-
|
|
15741
|
+
var ContentWrapper$1 = index$2(AnimatedPagerView)({
|
|
15742
|
+
flex: 1
|
|
15743
|
+
});
|
|
15744
|
+
var TabScreen$1 = index$2(View)({
|
|
15745
|
+
flex: 1
|
|
15746
|
+
});
|
|
15747
|
+
var StyledIndicator = index$2(Animated.View)(function (_ref3) {
|
|
15748
|
+
var theme = _ref3.theme,
|
|
15749
|
+
themeWidth = _ref3.themeWidth;
|
|
13993
15750
|
return {
|
|
13994
|
-
|
|
13995
|
-
|
|
13996
|
-
|
|
13997
|
-
|
|
13998
|
-
|
|
13999
|
-
textAlign: 'right'
|
|
15751
|
+
width: themeWidth,
|
|
15752
|
+
height: theme.__hd__.tabs.sizes.indicator,
|
|
15753
|
+
backgroundColor: theme.__hd__.tabs.colors.text,
|
|
15754
|
+
position: 'absolute',
|
|
15755
|
+
bottom: 0
|
|
14000
15756
|
};
|
|
14001
15757
|
});
|
|
14002
15758
|
|
|
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]
|
|
15759
|
+
var ActiveTabIndicator = function ActiveTabIndicator(_ref) {
|
|
15760
|
+
var scrollOffsetAnimatedValue = _ref.scrollOffsetAnimatedValue,
|
|
15761
|
+
positionAnimatedValue = _ref.positionAnimatedValue,
|
|
15762
|
+
tabsLength = _ref.tabsLength,
|
|
15763
|
+
tabsWidth = _ref.tabsWidth;
|
|
15764
|
+
var inputRange = [0, tabsLength];
|
|
15765
|
+
var indicatorWidth = tabsWidth / tabsLength;
|
|
15766
|
+
var translateX = Animated.add(scrollOffsetAnimatedValue, positionAnimatedValue).interpolate({
|
|
15767
|
+
inputRange: inputRange,
|
|
15768
|
+
outputRange: [0, tabsLength * indicatorWidth]
|
|
14037
15769
|
});
|
|
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",
|
|
15770
|
+
return /*#__PURE__*/React.createElement(StyledIndicator, {
|
|
15771
|
+
themeWidth: indicatorWidth,
|
|
14050
15772
|
style: {
|
|
14051
15773
|
transform: [{
|
|
14052
|
-
translateX:
|
|
15774
|
+
translateX: translateX
|
|
14053
15775
|
}]
|
|
14054
15776
|
}
|
|
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
|
-
}));
|
|
15777
|
+
});
|
|
14066
15778
|
};
|
|
14067
15779
|
|
|
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
|
-
};
|
|
15780
|
+
var TabScreen = index$2(View)({
|
|
15781
|
+
flex: 1
|
|
14078
15782
|
});
|
|
14079
|
-
var TabContainer = index$
|
|
15783
|
+
var TabContainer = index$2(View)({
|
|
14080
15784
|
flex: 1,
|
|
14081
15785
|
overflow: 'hidden'
|
|
14082
15786
|
});
|
|
14083
|
-
var ContentWrapper = index$
|
|
15787
|
+
var ContentWrapper = index$2(PagerView)({
|
|
14084
15788
|
flex: 1
|
|
14085
15789
|
});
|
|
14086
|
-
var HeaderTabWrapper = index$
|
|
14087
|
-
var
|
|
14088
|
-
|
|
15790
|
+
var HeaderTabWrapper = index$2(View)(function (_ref) {
|
|
15791
|
+
var theme = _ref.theme,
|
|
15792
|
+
themeInsets = _ref.themeInsets;
|
|
14089
15793
|
return {
|
|
14090
|
-
|
|
14091
|
-
|
|
14092
|
-
|
|
15794
|
+
paddingHorizontal: Math.max(themeInsets.left, themeInsets.right),
|
|
15795
|
+
borderBottomColor: theme.__hd__.tabs.colors.headerBottom,
|
|
15796
|
+
borderBottomWidth: theme.__hd__.tabs.borderWidths.headerBottom
|
|
14093
15797
|
};
|
|
14094
15798
|
});
|
|
14095
|
-
var
|
|
14096
|
-
var theme =
|
|
15799
|
+
var HeaderTabItem = index$2(Animated.View)(function (_ref2) {
|
|
15800
|
+
var theme = _ref2.theme;
|
|
14097
15801
|
return {
|
|
14098
|
-
|
|
14099
|
-
|
|
15802
|
+
paddingHorizontal: theme.__hd__.tabs.space.itemHorizontalPadding,
|
|
15803
|
+
paddingVertical: theme.__hd__.tabs.space.itemVerticalPadding
|
|
14100
15804
|
};
|
|
14101
15805
|
});
|
|
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
|
-
};
|
|
15806
|
+
var HeaderTabItemOutlineWrapper = index$2(View)(function (_ref3) {
|
|
15807
|
+
var theme = _ref3.theme;
|
|
15808
|
+
return _objectSpread2({
|
|
15809
|
+
paddingHorizontal: theme.__hd__.tabs.space.itemHorizontalPadding,
|
|
15810
|
+
paddingVertical: theme.__hd__.tabs.space.itemVerticalPadding
|
|
15811
|
+
}, StyleSheet$1.absoluteFillObject);
|
|
14112
15812
|
});
|
|
14113
|
-
var
|
|
14114
|
-
var
|
|
14115
|
-
|
|
15813
|
+
var HeaderTabItemOutline = index$2(Animated.View)(function (_ref4) {
|
|
15814
|
+
var theme = _ref4.theme,
|
|
15815
|
+
themeActive = _ref4.themeActive;
|
|
14116
15816
|
return {
|
|
14117
|
-
|
|
15817
|
+
borderRadius: theme.__hd__.tabs.radii.outline,
|
|
15818
|
+
backgroundColor: themeActive ? theme.__hd__.tabs.colors.activeBackground : undefined
|
|
14118
15819
|
};
|
|
14119
15820
|
});
|
|
14120
|
-
var
|
|
14121
|
-
var
|
|
14122
|
-
theme = _ref6.theme;
|
|
15821
|
+
var HeaderTabItemWrapper = index$2(View)(function (_ref5) {
|
|
15822
|
+
var theme = _ref5.theme;
|
|
14123
15823
|
return {
|
|
14124
|
-
|
|
14125
|
-
|
|
15824
|
+
paddingHorizontal: theme.__hd__.tabs.space.outlineHorizontalPadding,
|
|
15825
|
+
paddingVertical: theme.__hd__.tabs.space.outlineVerticalPadding
|
|
14126
15826
|
};
|
|
14127
15827
|
});
|
|
14128
15828
|
|
|
14129
|
-
var
|
|
15829
|
+
var useAnimatedValueArray = function useAnimatedValueArray(initialValues) {
|
|
15830
|
+
var refs = React.useRef([]);
|
|
15831
|
+
refs.current.length = initialValues.length;
|
|
15832
|
+
initialValues.forEach(function (initialValue, i) {
|
|
15833
|
+
var _refs$current$i;
|
|
14130
15834
|
|
|
14131
|
-
|
|
14132
|
-
|
|
14133
|
-
|
|
14134
|
-
|
|
14135
|
-
selectedTabKey = _ref.selectedTabKey,
|
|
14136
|
-
tabs = _ref.tabs,
|
|
14137
|
-
nativeProps = _objectWithoutProperties$1(_ref, _excluded);
|
|
15835
|
+
refs.current[i] = (_refs$current$i = refs.current[i]) !== null && _refs$current$i !== void 0 ? _refs$current$i : new Animated.Value(initialValue);
|
|
15836
|
+
});
|
|
15837
|
+
return refs.current;
|
|
15838
|
+
};
|
|
14138
15839
|
|
|
14139
|
-
|
|
14140
|
-
var
|
|
14141
|
-
|
|
14142
|
-
|
|
14143
|
-
|
|
15840
|
+
var getTabItem$1 = function getTabItem(_ref) {
|
|
15841
|
+
var item = _ref.item,
|
|
15842
|
+
color = _ref.color,
|
|
15843
|
+
active = _ref.active;
|
|
15844
|
+
|
|
15845
|
+
if (isHeroIcon(item)) {
|
|
15846
|
+
return /*#__PURE__*/React.createElement(Icon, {
|
|
15847
|
+
icon: item,
|
|
15848
|
+
testID: "hero-icon-".concat(item),
|
|
15849
|
+
size: "small",
|
|
15850
|
+
intent: active ? 'info' : 'text'
|
|
15851
|
+
});
|
|
15852
|
+
}
|
|
14144
15853
|
|
|
14145
|
-
|
|
14146
|
-
|
|
14147
|
-
|
|
14148
|
-
|
|
15854
|
+
if (typeof item === 'string') {
|
|
15855
|
+
return /*#__PURE__*/React.createElement(Typography.Text, {
|
|
15856
|
+
fontWeight: active ? 'semi-bold' : 'regular',
|
|
15857
|
+
numberOfLines: 1,
|
|
15858
|
+
style: {
|
|
15859
|
+
color: color
|
|
15860
|
+
}
|
|
15861
|
+
}, item);
|
|
15862
|
+
}
|
|
14149
15863
|
|
|
14150
|
-
|
|
14151
|
-
|
|
14152
|
-
|
|
14153
|
-
|
|
15864
|
+
return item({
|
|
15865
|
+
color: color
|
|
15866
|
+
});
|
|
15867
|
+
};
|
|
14154
15868
|
|
|
15869
|
+
var ScrollableTab = function ScrollableTab(_ref2) {
|
|
15870
|
+
var onTabPress = _ref2.onTabPress,
|
|
15871
|
+
selectedTabKey = _ref2.selectedTabKey,
|
|
15872
|
+
tabs = _ref2.tabs,
|
|
15873
|
+
containerStyle = _ref2.containerStyle,
|
|
15874
|
+
barStyle = _ref2.barStyle,
|
|
15875
|
+
_ref2$lazy = _ref2.lazy,
|
|
15876
|
+
lazy = _ref2$lazy === void 0 ? false : _ref2$lazy,
|
|
15877
|
+
_ref2$lazyPreloadDist = _ref2.lazyPreloadDistance,
|
|
15878
|
+
lazyPreloadDistance = _ref2$lazyPreloadDist === void 0 ? 1 : _ref2$lazyPreloadDist;
|
|
15879
|
+
var flatListRef = React.useRef(null);
|
|
15880
|
+
var pagerViewRef = React.useRef(null);
|
|
15881
|
+
var insets = useSafeAreaInsets();
|
|
15882
|
+
var theme = useTheme();
|
|
15883
|
+
var selectedTabIndex = tabs.findIndex(function (item) {
|
|
15884
|
+
return item.key === selectedTabKey;
|
|
15885
|
+
});
|
|
15886
|
+
var tabsAnims = useAnimatedValueArray(tabs.map(function (_, i) {
|
|
15887
|
+
return i === selectedTabIndex ? 1 : 0;
|
|
15888
|
+
}));
|
|
15889
|
+
React.useEffect(function () {
|
|
14155
15890
|
if (selectedTabIndex !== -1) {
|
|
14156
15891
|
var _flatListRef$current;
|
|
14157
15892
|
|
|
@@ -14160,18 +15895,25 @@ var Tabs = function Tabs(_ref) {
|
|
|
14160
15895
|
viewPosition: 0.5
|
|
14161
15896
|
});
|
|
14162
15897
|
}
|
|
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
15898
|
|
|
14172
|
-
|
|
14173
|
-
|
|
14174
|
-
|
|
15899
|
+
var animation = Animated.parallel(_toConsumableArray$1(tabs.map(function (_, i) {
|
|
15900
|
+
return Animated.timing(tabsAnims[i], {
|
|
15901
|
+
toValue: i === selectedTabIndex ? 1 : 0,
|
|
15902
|
+
duration: 150,
|
|
15903
|
+
useNativeDriver: true
|
|
15904
|
+
});
|
|
15905
|
+
})));
|
|
15906
|
+
animation.start();
|
|
15907
|
+
return function () {
|
|
15908
|
+
return animation.stop();
|
|
15909
|
+
};
|
|
15910
|
+
}, [selectedTabIndex]);
|
|
15911
|
+
return /*#__PURE__*/React.createElement(TabContainer, {
|
|
15912
|
+
style: containerStyle
|
|
15913
|
+
}, /*#__PURE__*/React.createElement(HeaderTabWrapper, {
|
|
15914
|
+
themeInsets: insets,
|
|
15915
|
+
style: barStyle
|
|
15916
|
+
}, /*#__PURE__*/React.createElement(FlatList, {
|
|
14175
15917
|
ref: flatListRef,
|
|
14176
15918
|
horizontal: true,
|
|
14177
15919
|
data: tabs,
|
|
@@ -14179,8 +15921,8 @@ var Tabs = function Tabs(_ref) {
|
|
|
14179
15921
|
return String(tab.key);
|
|
14180
15922
|
},
|
|
14181
15923
|
showsHorizontalScrollIndicator: false,
|
|
14182
|
-
onScrollToIndexFailed: function onScrollToIndexFailed(
|
|
14183
|
-
var index =
|
|
15924
|
+
onScrollToIndexFailed: function onScrollToIndexFailed(_ref3) {
|
|
15925
|
+
var index = _ref3.index;
|
|
14184
15926
|
setTimeout(function () {
|
|
14185
15927
|
var _flatListRef$current2;
|
|
14186
15928
|
|
|
@@ -14190,57 +15932,255 @@ var Tabs = function Tabs(_ref) {
|
|
|
14190
15932
|
});
|
|
14191
15933
|
}, 100);
|
|
14192
15934
|
},
|
|
14193
|
-
|
|
14194
|
-
|
|
15935
|
+
contentContainerStyle: {
|
|
15936
|
+
paddingHorizontal: theme.__hd__.tabs.space.flatListHorizontalPadding
|
|
15937
|
+
},
|
|
15938
|
+
renderItem: function renderItem(_ref4) {
|
|
15939
|
+
var tab = _ref4.item,
|
|
15940
|
+
index = _ref4.index;
|
|
14195
15941
|
var key = tab.key,
|
|
14196
|
-
|
|
14197
|
-
|
|
14198
|
-
|
|
15942
|
+
testID = tab.testID,
|
|
15943
|
+
activeItem = tab.activeItem,
|
|
15944
|
+
originalInactiveItem = tab.inactiveItem,
|
|
15945
|
+
_tab$showBadge = tab.showBadge,
|
|
15946
|
+
showBadge = _tab$showBadge === void 0 ? false : _tab$showBadge;
|
|
14199
15947
|
var active = selectedTabKey === key;
|
|
14200
|
-
|
|
15948
|
+
var activeAnimated = tabsAnims[index];
|
|
15949
|
+
var outlineScale = active ? activeAnimated.interpolate({
|
|
15950
|
+
inputRange: [0, 1],
|
|
15951
|
+
outputRange: [0.5, 1]
|
|
15952
|
+
}) : 0;
|
|
15953
|
+
var inactiveItem = originalInactiveItem !== null && originalInactiveItem !== void 0 ? originalInactiveItem : activeItem;
|
|
15954
|
+
var tabItem = getTabItem$1({
|
|
15955
|
+
item: active ? activeItem : inactiveItem,
|
|
15956
|
+
color: active ? theme.__hd__.tabs.colors.active : theme.__hd__.tabs.colors.inactive,
|
|
15957
|
+
active: active
|
|
15958
|
+
});
|
|
15959
|
+
return /*#__PURE__*/React.createElement(TouchableWithoutFeedback, {
|
|
14201
15960
|
key: key,
|
|
14202
15961
|
onPress: function onPress() {
|
|
14203
|
-
|
|
15962
|
+
var _pagerViewRef$current;
|
|
15963
|
+
|
|
15964
|
+
onTabPress(key);
|
|
15965
|
+
(_pagerViewRef$current = pagerViewRef.current) === null || _pagerViewRef$current === void 0 ? void 0 : _pagerViewRef$current.setPage(index);
|
|
14204
15966
|
},
|
|
14205
15967
|
testID: testID
|
|
14206
|
-
}, /*#__PURE__*/React.createElement(HeaderTabItem, null, /*#__PURE__*/React.createElement(
|
|
14207
|
-
|
|
14208
|
-
|
|
14209
|
-
|
|
14210
|
-
|
|
14211
|
-
|
|
14212
|
-
|
|
14213
|
-
|
|
14214
|
-
},
|
|
14215
|
-
|
|
14216
|
-
|
|
15968
|
+
}, /*#__PURE__*/React.createElement(HeaderTabItem, null, /*#__PURE__*/React.createElement(HeaderTabItemOutlineWrapper, null, /*#__PURE__*/React.createElement(HeaderTabItemOutline, {
|
|
15969
|
+
themeActive: active,
|
|
15970
|
+
style: {
|
|
15971
|
+
flex: 1,
|
|
15972
|
+
transform: [{
|
|
15973
|
+
scaleX: outlineScale
|
|
15974
|
+
}]
|
|
15975
|
+
}
|
|
15976
|
+
})), /*#__PURE__*/React.createElement(HeaderTabItemWrapper, null, /*#__PURE__*/React.createElement(Badge$1.Status, {
|
|
15977
|
+
visible: showBadge
|
|
15978
|
+
}, tabItem))));
|
|
15979
|
+
}
|
|
15980
|
+
})), /*#__PURE__*/React.createElement(ContentWrapper, {
|
|
15981
|
+
initialPage: selectedTabIndex,
|
|
15982
|
+
ref: pagerViewRef,
|
|
15983
|
+
onPageSelected: function onPageSelected(e) {
|
|
15984
|
+
var index = e.nativeEvent.position;
|
|
15985
|
+
var selectedItem = tabs[index];
|
|
15986
|
+
|
|
15987
|
+
if (selectedItem) {
|
|
15988
|
+
onTabPress(selectedItem.key);
|
|
15989
|
+
}
|
|
15990
|
+
}
|
|
15991
|
+
}, tabs.map(function (tab, index) {
|
|
14217
15992
|
var key = tab.key,
|
|
14218
15993
|
component = tab.component,
|
|
14219
15994
|
testID = tab.testID;
|
|
14220
15995
|
var active = selectedTabKey === key;
|
|
15996
|
+
var isLazyScreen = lazy && Math.abs(selectedTabIndex - index) > lazyPreloadDistance;
|
|
15997
|
+
return /*#__PURE__*/React.createElement(TabScreen, {
|
|
15998
|
+
key: key,
|
|
15999
|
+
testID: testID ? "tab-screen-".concat(testID) : undefined,
|
|
16000
|
+
pointerEvents: active ? 'auto' : 'none',
|
|
16001
|
+
accessibilityElementsHidden: !active,
|
|
16002
|
+
importantForAccessibility: active ? 'auto' : 'no-hide-descendants',
|
|
16003
|
+
collapsable: false
|
|
16004
|
+
}, isLazyScreen ? null : component);
|
|
16005
|
+
})));
|
|
16006
|
+
};
|
|
14221
16007
|
|
|
14222
|
-
|
|
14223
|
-
|
|
14224
|
-
|
|
16008
|
+
var getTabItem = function getTabItem(_ref) {
|
|
16009
|
+
var item = _ref.item,
|
|
16010
|
+
color = _ref.color,
|
|
16011
|
+
active = _ref.active;
|
|
16012
|
+
|
|
16013
|
+
if (typeof item === 'string') {
|
|
16014
|
+
return /*#__PURE__*/React.createElement(Typography.Text, {
|
|
16015
|
+
fontWeight: active ? 'semi-bold' : 'regular',
|
|
16016
|
+
numberOfLines: 1,
|
|
16017
|
+
style: {
|
|
16018
|
+
color: color
|
|
16019
|
+
}
|
|
16020
|
+
}, item);
|
|
16021
|
+
}
|
|
14225
16022
|
|
|
14226
|
-
|
|
14227
|
-
|
|
14228
|
-
|
|
16023
|
+
return item({
|
|
16024
|
+
color: color
|
|
16025
|
+
});
|
|
16026
|
+
};
|
|
16027
|
+
|
|
16028
|
+
var Tabs = function Tabs(_ref2) {
|
|
16029
|
+
var onTabPress = _ref2.onTabPress,
|
|
16030
|
+
selectedTabKey = _ref2.selectedTabKey,
|
|
16031
|
+
tabs = _ref2.tabs,
|
|
16032
|
+
containerStyle = _ref2.containerStyle,
|
|
16033
|
+
barStyle = _ref2.barStyle,
|
|
16034
|
+
_ref2$lazy = _ref2.lazy,
|
|
16035
|
+
lazy = _ref2$lazy === void 0 ? false : _ref2$lazy,
|
|
16036
|
+
_ref2$lazyPreloadDist = _ref2.lazyPreloadDistance,
|
|
16037
|
+
lazyPreloadDistance = _ref2$lazyPreloadDist === void 0 ? 1 : _ref2$lazyPreloadDist;
|
|
16038
|
+
var theme = useTheme();
|
|
16039
|
+
var insets = useSafeAreaInsets();
|
|
16040
|
+
var pagerViewRef = React.useRef(null);
|
|
16041
|
+
var selectedTabIndex = tabs.findIndex(function (item) {
|
|
16042
|
+
return item.key === selectedTabKey;
|
|
16043
|
+
});
|
|
16044
|
+
var scrollOffsetAnimatedValue = React.useRef(new Animated.Value(0)).current;
|
|
16045
|
+
var positionAnimatedValue = React.useRef(new Animated.Value(0)).current;
|
|
16046
|
+
|
|
16047
|
+
var _React$useState = React.useState(0),
|
|
16048
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
16049
|
+
tabsWidth = _React$useState2[0],
|
|
16050
|
+
setTabsWidth = _React$useState2[1];
|
|
16051
|
+
|
|
16052
|
+
return /*#__PURE__*/React.createElement(TabContainer$1, {
|
|
16053
|
+
style: containerStyle
|
|
16054
|
+
}, /*#__PURE__*/React.createElement(HeaderTabWrapper$1, {
|
|
16055
|
+
themeInsets: insets,
|
|
16056
|
+
style: barStyle
|
|
16057
|
+
}, /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(HeaderTab, {
|
|
16058
|
+
onLayout: function onLayout(e) {
|
|
16059
|
+
var width = e.nativeEvent.layout.width;
|
|
16060
|
+
|
|
16061
|
+
if (tabsWidth !== width) {
|
|
16062
|
+
setTabsWidth(width);
|
|
16063
|
+
}
|
|
14229
16064
|
}
|
|
16065
|
+
}, tabs.map(function (tab, index) {
|
|
16066
|
+
var key = tab.key,
|
|
16067
|
+
testID = tab.testID,
|
|
16068
|
+
activeItem = tab.activeItem,
|
|
16069
|
+
originalInactiveItem = tab.inactiveItem,
|
|
16070
|
+
_tab$showBadge = tab.showBadge,
|
|
16071
|
+
showBadge = _tab$showBadge === void 0 ? false : _tab$showBadge;
|
|
16072
|
+
var active = selectedTabKey === key;
|
|
16073
|
+
var inactiveItem = originalInactiveItem !== null && originalInactiveItem !== void 0 ? originalInactiveItem : activeItem;
|
|
16074
|
+
var tabItem = getTabItem({
|
|
16075
|
+
item: active ? activeItem : inactiveItem,
|
|
16076
|
+
color: theme.__hd__.tabs.colors.text,
|
|
16077
|
+
active: active
|
|
16078
|
+
});
|
|
16079
|
+
return /*#__PURE__*/React.createElement(TouchableWithoutFeedback, {
|
|
16080
|
+
key: key,
|
|
16081
|
+
onPress: function onPress() {
|
|
16082
|
+
var _pagerViewRef$current;
|
|
14230
16083
|
|
|
14231
|
-
|
|
16084
|
+
onTabPress(key);
|
|
16085
|
+
(_pagerViewRef$current = pagerViewRef.current) === null || _pagerViewRef$current === void 0 ? void 0 : _pagerViewRef$current.setPage(index);
|
|
16086
|
+
},
|
|
16087
|
+
testID: testID
|
|
16088
|
+
}, /*#__PURE__*/React.createElement(HeaderTabItem$1, null, /*#__PURE__*/React.createElement(Badge$1.Status, {
|
|
16089
|
+
visible: showBadge
|
|
16090
|
+
}, tabItem)));
|
|
16091
|
+
})), /*#__PURE__*/React.createElement(ActiveTabIndicator, {
|
|
16092
|
+
positionAnimatedValue: positionAnimatedValue,
|
|
16093
|
+
scrollOffsetAnimatedValue: scrollOffsetAnimatedValue,
|
|
16094
|
+
tabsLength: tabs.length,
|
|
16095
|
+
tabsWidth: tabsWidth
|
|
16096
|
+
}))), /*#__PURE__*/React.createElement(ContentWrapper$1, {
|
|
16097
|
+
initialPage: selectedTabIndex,
|
|
16098
|
+
ref: pagerViewRef,
|
|
16099
|
+
onPageSelected: function onPageSelected(e) {
|
|
16100
|
+
var index = e.nativeEvent.position;
|
|
16101
|
+
var selectedItem = tabs[index];
|
|
16102
|
+
|
|
16103
|
+
if (selectedItem) {
|
|
16104
|
+
onTabPress(selectedItem.key);
|
|
16105
|
+
}
|
|
16106
|
+
},
|
|
16107
|
+
onPageScroll: Animated.event([{
|
|
16108
|
+
nativeEvent: {
|
|
16109
|
+
offset: scrollOffsetAnimatedValue,
|
|
16110
|
+
position: positionAnimatedValue
|
|
16111
|
+
}
|
|
16112
|
+
}], {
|
|
16113
|
+
useNativeDriver: true
|
|
16114
|
+
})
|
|
16115
|
+
}, tabs.map(function (tab, index) {
|
|
16116
|
+
var key = tab.key,
|
|
16117
|
+
component = tab.component,
|
|
16118
|
+
testID = tab.testID;
|
|
16119
|
+
var active = selectedTabKey === key;
|
|
16120
|
+
var isLazyScreen = lazy && Math.abs(selectedTabIndex - index) > lazyPreloadDistance;
|
|
16121
|
+
return /*#__PURE__*/React.createElement(TabScreen$1, {
|
|
14232
16122
|
key: key,
|
|
14233
16123
|
testID: testID ? "tab-screen-".concat(testID) : undefined,
|
|
14234
16124
|
pointerEvents: active ? 'auto' : 'none',
|
|
14235
16125
|
accessibilityElementsHidden: !active,
|
|
14236
16126
|
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);
|
|
16127
|
+
collapsable: false
|
|
16128
|
+
}, isLazyScreen ? null : component);
|
|
14243
16129
|
})));
|
|
14244
16130
|
};
|
|
14245
16131
|
|
|
14246
|
-
|
|
16132
|
+
var index = Object.assign(Tabs, {
|
|
16133
|
+
Scroll: ScrollableTab
|
|
16134
|
+
});
|
|
16135
|
+
|
|
16136
|
+
var BACKGROUND_INTENTS = {
|
|
16137
|
+
success: 'successBackground',
|
|
16138
|
+
warning: 'warningBackground',
|
|
16139
|
+
danger: 'dangerBackground',
|
|
16140
|
+
info: 'infoBackground'
|
|
16141
|
+
};
|
|
16142
|
+
var StyledView = index$2(View)(function (_ref) {
|
|
16143
|
+
var themeIntent = _ref.themeIntent,
|
|
16144
|
+
theme = _ref.theme;
|
|
16145
|
+
return {
|
|
16146
|
+
borderWidth: theme.__hd__.tag.borderWidths["default"],
|
|
16147
|
+
borderRadius: theme.__hd__.tag.radii["default"],
|
|
16148
|
+
paddingVertical: theme.__hd__.tag.space.verticalPadding,
|
|
16149
|
+
paddingHorizontal: theme.__hd__.tag.space.horizontalPadding,
|
|
16150
|
+
borderColor: theme.__hd__.tag.colors[themeIntent],
|
|
16151
|
+
backgroundColor: theme.__hd__.tag.colors[BACKGROUND_INTENTS[themeIntent]]
|
|
16152
|
+
};
|
|
16153
|
+
});
|
|
16154
|
+
var StyledText = index$2(Text$1)(function (_ref2) {
|
|
16155
|
+
var themeIntent = _ref2.themeIntent,
|
|
16156
|
+
theme = _ref2.theme;
|
|
16157
|
+
return {
|
|
16158
|
+
fontFamily: theme.__hd__.tag.fonts["default"],
|
|
16159
|
+
fontSize: theme.__hd__.tag.fontSizes["default"],
|
|
16160
|
+
color: theme.__hd__.tag.colors[themeIntent],
|
|
16161
|
+
includeFontPadding: false,
|
|
16162
|
+
textAlignVertical: 'center',
|
|
16163
|
+
textAlign: 'center'
|
|
16164
|
+
};
|
|
16165
|
+
});
|
|
16166
|
+
|
|
16167
|
+
var _excluded = ["content", "intent", "style", "testID"];
|
|
16168
|
+
|
|
16169
|
+
var Tag = function Tag(_ref) {
|
|
16170
|
+
var content = _ref.content,
|
|
16171
|
+
_ref$intent = _ref.intent,
|
|
16172
|
+
intent = _ref$intent === void 0 ? 'info' : _ref$intent,
|
|
16173
|
+
style = _ref.style,
|
|
16174
|
+
testID = _ref.testID,
|
|
16175
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded);
|
|
16176
|
+
|
|
16177
|
+
return /*#__PURE__*/React.createElement(StyledView, _extends$3({}, nativeProps, {
|
|
16178
|
+
themeIntent: intent,
|
|
16179
|
+
style: style,
|
|
16180
|
+
testID: testID
|
|
16181
|
+
}), /*#__PURE__*/React.createElement(StyledText, {
|
|
16182
|
+
themeIntent: intent
|
|
16183
|
+
}, content));
|
|
16184
|
+
};
|
|
16185
|
+
|
|
16186
|
+
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 };
|