@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/lib/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var ReactNative = require('react-native');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var reactNativeSafeAreaContext = require('react-native-safe-area-context');
|
|
8
8
|
|
|
@@ -26,8 +26,8 @@ function _interopNamespace(e) {
|
|
|
26
26
|
return Object.freeze(n);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
var
|
|
30
|
-
var
|
|
29
|
+
var ReactNative__namespace = /*#__PURE__*/_interopNamespace(ReactNative);
|
|
30
|
+
var ReactNative__default = /*#__PURE__*/_interopDefaultLegacy(ReactNative);
|
|
31
31
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
32
32
|
|
|
33
33
|
function ownKeys(object, enumerableOnly) {
|
|
@@ -47,7 +47,7 @@ function _objectSpread2(target) {
|
|
|
47
47
|
for (var i = 1; i < arguments.length; i++) {
|
|
48
48
|
var source = null != arguments[i] ? arguments[i] : {};
|
|
49
49
|
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
50
|
-
_defineProperty$
|
|
50
|
+
_defineProperty$2(target, key, source[key]);
|
|
51
51
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
52
52
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
53
53
|
});
|
|
@@ -66,7 +66,32 @@ function _typeof$2(obj) {
|
|
|
66
66
|
}, _typeof$2(obj);
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
function
|
|
69
|
+
function _classCallCheck$1(instance, Constructor) {
|
|
70
|
+
if (!(instance instanceof Constructor)) {
|
|
71
|
+
throw new TypeError("Cannot call a class as a function");
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function _defineProperties$1(target, props) {
|
|
76
|
+
for (var i = 0; i < props.length; i++) {
|
|
77
|
+
var descriptor = props[i];
|
|
78
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
79
|
+
descriptor.configurable = true;
|
|
80
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
81
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function _createClass$1(Constructor, protoProps, staticProps) {
|
|
86
|
+
if (protoProps) _defineProperties$1(Constructor.prototype, protoProps);
|
|
87
|
+
if (staticProps) _defineProperties$1(Constructor, staticProps);
|
|
88
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
89
|
+
writable: false
|
|
90
|
+
});
|
|
91
|
+
return Constructor;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function _defineProperty$2(obj, key, value) {
|
|
70
95
|
if (key in obj) {
|
|
71
96
|
Object.defineProperty(obj, key, {
|
|
72
97
|
value: value,
|
|
@@ -81,8 +106,8 @@ function _defineProperty$1(obj, key, value) {
|
|
|
81
106
|
return obj;
|
|
82
107
|
}
|
|
83
108
|
|
|
84
|
-
function _extends$
|
|
85
|
-
_extends$
|
|
109
|
+
function _extends$3() {
|
|
110
|
+
_extends$3 = Object.assign || function (target) {
|
|
86
111
|
for (var i = 1; i < arguments.length; i++) {
|
|
87
112
|
var source = arguments[i];
|
|
88
113
|
|
|
@@ -96,7 +121,54 @@ function _extends$2() {
|
|
|
96
121
|
return target;
|
|
97
122
|
};
|
|
98
123
|
|
|
99
|
-
return _extends$
|
|
124
|
+
return _extends$3.apply(this, arguments);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function _inherits$1(subClass, superClass) {
|
|
128
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
129
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
133
|
+
constructor: {
|
|
134
|
+
value: subClass,
|
|
135
|
+
writable: true,
|
|
136
|
+
configurable: true
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
Object.defineProperty(subClass, "prototype", {
|
|
140
|
+
writable: false
|
|
141
|
+
});
|
|
142
|
+
if (superClass) _setPrototypeOf$1(subClass, superClass);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function _getPrototypeOf$1(o) {
|
|
146
|
+
_getPrototypeOf$1 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
147
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
|
148
|
+
};
|
|
149
|
+
return _getPrototypeOf$1(o);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function _setPrototypeOf$1(o, p) {
|
|
153
|
+
_setPrototypeOf$1 = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
154
|
+
o.__proto__ = p;
|
|
155
|
+
return o;
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
return _setPrototypeOf$1(o, p);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function _isNativeReflectConstruct() {
|
|
162
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
163
|
+
if (Reflect.construct.sham) return false;
|
|
164
|
+
if (typeof Proxy === "function") return true;
|
|
165
|
+
|
|
166
|
+
try {
|
|
167
|
+
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
168
|
+
return true;
|
|
169
|
+
} catch (e) {
|
|
170
|
+
return false;
|
|
171
|
+
}
|
|
100
172
|
}
|
|
101
173
|
|
|
102
174
|
function _objectWithoutPropertiesLoose$1(source, excluded) {
|
|
@@ -135,6 +207,43 @@ function _objectWithoutProperties$1(source, excluded) {
|
|
|
135
207
|
return target;
|
|
136
208
|
}
|
|
137
209
|
|
|
210
|
+
function _assertThisInitialized$1(self) {
|
|
211
|
+
if (self === void 0) {
|
|
212
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
return self;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
function _possibleConstructorReturn$1(self, call) {
|
|
219
|
+
if (call && (typeof call === "object" || typeof call === "function")) {
|
|
220
|
+
return call;
|
|
221
|
+
} else if (call !== void 0) {
|
|
222
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
return _assertThisInitialized$1(self);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
function _createSuper(Derived) {
|
|
229
|
+
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
230
|
+
|
|
231
|
+
return function _createSuperInternal() {
|
|
232
|
+
var Super = _getPrototypeOf$1(Derived),
|
|
233
|
+
result;
|
|
234
|
+
|
|
235
|
+
if (hasNativeReflectConstruct) {
|
|
236
|
+
var NewTarget = _getPrototypeOf$1(this).constructor;
|
|
237
|
+
|
|
238
|
+
result = Reflect.construct(Super, arguments, NewTarget);
|
|
239
|
+
} else {
|
|
240
|
+
result = Super.apply(this, arguments);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
return _possibleConstructorReturn$1(this, result);
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
|
|
138
247
|
function _slicedToArray(arr, i) {
|
|
139
248
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
140
249
|
}
|
|
@@ -1434,8 +1543,8 @@ var createCache = function createCache(options) {
|
|
|
1434
1543
|
return cache;
|
|
1435
1544
|
};
|
|
1436
1545
|
|
|
1437
|
-
function _extends$
|
|
1438
|
-
_extends$
|
|
1546
|
+
function _extends$2() {
|
|
1547
|
+
_extends$2 = Object.assign ? Object.assign.bind() : function (target) {
|
|
1439
1548
|
for (var i = 1; i < arguments.length; i++) {
|
|
1440
1549
|
var source = arguments[i];
|
|
1441
1550
|
|
|
@@ -1448,7 +1557,7 @@ function _extends$1() {
|
|
|
1448
1557
|
|
|
1449
1558
|
return target;
|
|
1450
1559
|
};
|
|
1451
|
-
return _extends$
|
|
1560
|
+
return _extends$2.apply(this, arguments);
|
|
1452
1561
|
}
|
|
1453
1562
|
|
|
1454
1563
|
var weakMemoize = function weakMemoize(func) {
|
|
@@ -1491,7 +1600,7 @@ var getTheme$1 = function getTheme(outerTheme, theme) {
|
|
|
1491
1600
|
return mergedTheme;
|
|
1492
1601
|
}
|
|
1493
1602
|
|
|
1494
|
-
return _extends$
|
|
1603
|
+
return _extends$2({}, outerTheme, theme);
|
|
1495
1604
|
};
|
|
1496
1605
|
|
|
1497
1606
|
var createCacheWithTheme = /* #__PURE__ */weakMemoize(function (outerTheme) {
|
|
@@ -1516,11 +1625,13 @@ var BASE_BORDER_WIDTH = 1;
|
|
|
1516
1625
|
var BASE_SPACE = 8;
|
|
1517
1626
|
var BASE_FONT = 'BeVietnamPro';
|
|
1518
1627
|
var BASE_FONT_SIZE = 10;
|
|
1628
|
+
var BASE_RADIUS = 4;
|
|
1519
1629
|
var scale$1 = {
|
|
1520
1630
|
borderWidth: BASE_BORDER_WIDTH,
|
|
1521
1631
|
space: BASE_SPACE,
|
|
1522
1632
|
font: BASE_FONT,
|
|
1523
|
-
fontSize: BASE_FONT_SIZE
|
|
1633
|
+
fontSize: BASE_FONT_SIZE,
|
|
1634
|
+
radius: BASE_RADIUS
|
|
1524
1635
|
};
|
|
1525
1636
|
|
|
1526
1637
|
var palette = {
|
|
@@ -1577,6 +1688,7 @@ var palette = {
|
|
|
1577
1688
|
pinkLight75: '#fcd5ea',
|
|
1578
1689
|
pinkLight90: '#ffeef7',
|
|
1579
1690
|
purple: '#be83cf',
|
|
1691
|
+
purpleDark15: '#a26fb0',
|
|
1580
1692
|
red: '#de350b',
|
|
1581
1693
|
redDark15: '#bd2d09',
|
|
1582
1694
|
redDark30: '#9b2508',
|
|
@@ -1612,12 +1724,15 @@ var palette = {
|
|
|
1612
1724
|
var systemPalette = {
|
|
1613
1725
|
primary: palette.violet,
|
|
1614
1726
|
primaryLight: palette.violetLight60,
|
|
1727
|
+
primaryDark: palette.purpleDark15,
|
|
1728
|
+
primaryBackground: palette.violetLight90,
|
|
1729
|
+
secondary: palette.dodgerBlue,
|
|
1730
|
+
secondaryLight: palette.dodgerBlueLight75,
|
|
1615
1731
|
info: palette.dodgerBlue,
|
|
1616
1732
|
infoLight: palette.dodgerBlueLight75,
|
|
1617
1733
|
infoBackground: palette.dodgerBlueLight90,
|
|
1618
1734
|
success: palette.green,
|
|
1619
1735
|
successDark: palette.greenDark30,
|
|
1620
|
-
successLight: palette.greenDark75,
|
|
1621
1736
|
successBackground: palette.grotesqueGreenLight90,
|
|
1622
1737
|
danger: palette.red,
|
|
1623
1738
|
dangerLight: palette.redLight60,
|
|
@@ -1630,14 +1745,16 @@ var systemPalette = {
|
|
|
1630
1745
|
backgroundDark: palette.greyDark75,
|
|
1631
1746
|
text: palette.greyDark75,
|
|
1632
1747
|
disabledText: palette.greyDark15,
|
|
1748
|
+
disabledLightText: palette.greyLight45,
|
|
1633
1749
|
invertedText: palette.white,
|
|
1634
|
-
outline: palette.greyLight60
|
|
1750
|
+
outline: palette.greyLight60,
|
|
1751
|
+
archived: palette.greyLight45
|
|
1635
1752
|
};
|
|
1636
1753
|
|
|
1637
1754
|
var BASE_WIDTH = 390; // Based on iPhone 13's viewport size
|
|
1638
1755
|
|
|
1639
1756
|
var horizontalScale = function horizontalScale(size) {
|
|
1640
|
-
var _Dimensions$get =
|
|
1757
|
+
var _Dimensions$get = ReactNative.Dimensions.get('window'),
|
|
1641
1758
|
width = _Dimensions$get.width,
|
|
1642
1759
|
height = _Dimensions$get.height;
|
|
1643
1760
|
|
|
@@ -1723,56 +1840,64 @@ var getBorderWidths = function getBorderWidths(baseBorderWidth) {
|
|
|
1723
1840
|
};
|
|
1724
1841
|
};
|
|
1725
1842
|
|
|
1843
|
+
var getRadii = function getRadii(baseRadius) {
|
|
1844
|
+
return {
|
|
1845
|
+
rounded: 999,
|
|
1846
|
+
base: baseRadius,
|
|
1847
|
+
medium: baseRadius * 2
|
|
1848
|
+
};
|
|
1849
|
+
};
|
|
1850
|
+
|
|
1726
1851
|
var getGlobalTheme = function getGlobalTheme(scale, systemPalette) {
|
|
1727
1852
|
var fonts = getFonts(scale.font);
|
|
1728
1853
|
var fontSizes = getFontSizes(scale.fontSize);
|
|
1729
1854
|
var lineHeights = getLineHeights(fontSizes);
|
|
1730
1855
|
var borderWidths = getBorderWidths(scale.borderWidth);
|
|
1731
1856
|
var space = getSpace(scale.space);
|
|
1857
|
+
var radii = getRadii(scale.radius);
|
|
1732
1858
|
return {
|
|
1733
1859
|
colors: _objectSpread2({}, systemPalette),
|
|
1734
1860
|
fonts: fonts,
|
|
1735
1861
|
fontSizes: fontSizes,
|
|
1736
1862
|
lineHeights: lineHeights,
|
|
1737
1863
|
borderWidths: borderWidths,
|
|
1738
|
-
space: space
|
|
1864
|
+
space: space,
|
|
1865
|
+
radii: radii
|
|
1739
1866
|
};
|
|
1740
1867
|
};
|
|
1741
1868
|
|
|
1742
1869
|
var getBadgeTheme = function getBadgeTheme(theme) {
|
|
1743
|
-
var borderWidths = {
|
|
1744
|
-
"default": theme.borderWidths.base
|
|
1745
|
-
};
|
|
1746
1870
|
var colors = {
|
|
1747
1871
|
danger: theme.colors.danger,
|
|
1748
|
-
dangerBackground: theme.colors.dangerBackground,
|
|
1749
1872
|
info: theme.colors.info,
|
|
1750
|
-
infoBackground: theme.colors.infoBackground,
|
|
1751
1873
|
success: theme.colors.successDark,
|
|
1752
|
-
successBackground: theme.colors.successBackground,
|
|
1753
1874
|
warning: theme.colors.warningDark,
|
|
1754
|
-
|
|
1875
|
+
archived: theme.colors.archived,
|
|
1876
|
+
text: theme.colors.invertedText
|
|
1755
1877
|
};
|
|
1756
|
-
var
|
|
1878
|
+
var fonts = {
|
|
1757
1879
|
"default": theme.fonts.semiBold
|
|
1758
1880
|
};
|
|
1759
|
-
var
|
|
1881
|
+
var fontSizes = {
|
|
1760
1882
|
"default": theme.fontSizes.small
|
|
1761
1883
|
};
|
|
1884
|
+
var sizes = {
|
|
1885
|
+
height: theme.fontSizes.small + theme.space.small,
|
|
1886
|
+
minWidth: theme.fontSizes.small + theme.space.small,
|
|
1887
|
+
statusHeight: theme.space.small,
|
|
1888
|
+
statusWidth: theme.space.small
|
|
1889
|
+
};
|
|
1762
1890
|
var space = {
|
|
1763
1891
|
horizontalPadding: theme.space.small,
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
var radii = {
|
|
1767
|
-
"default": 4
|
|
1892
|
+
statusPositionTop: -theme.space.xxsmall,
|
|
1893
|
+
statusPositionRight: -theme.space.xxsmall
|
|
1768
1894
|
};
|
|
1769
1895
|
return {
|
|
1770
|
-
borderWidths: borderWidths,
|
|
1771
1896
|
colors: colors,
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1897
|
+
fonts: fonts,
|
|
1898
|
+
fontSizes: fontSizes,
|
|
1899
|
+
sizes: sizes,
|
|
1900
|
+
space: space
|
|
1776
1901
|
};
|
|
1777
1902
|
};
|
|
1778
1903
|
|
|
@@ -1804,11 +1929,61 @@ var getBottomNavigationTheme = function getBottomNavigationTheme(theme) {
|
|
|
1804
1929
|
};
|
|
1805
1930
|
};
|
|
1806
1931
|
|
|
1807
|
-
var
|
|
1932
|
+
var getButtonTheme = function getButtonTheme(theme) {
|
|
1933
|
+
var fonts = {
|
|
1934
|
+
"default": theme.fonts.semiBold
|
|
1935
|
+
};
|
|
1936
|
+
var fontSize = {
|
|
1937
|
+
"default": theme.fontSizes.xlarge
|
|
1938
|
+
};
|
|
1939
|
+
var lineHeight = {
|
|
1940
|
+
"default": theme.lineHeights.large
|
|
1941
|
+
};
|
|
1942
|
+
var borderWidth = {
|
|
1943
|
+
"default": theme.space.xxsmall
|
|
1944
|
+
};
|
|
1945
|
+
var space = {
|
|
1946
|
+
buttonPadding: theme.space.medium,
|
|
1947
|
+
iconPadding: theme.space.small
|
|
1948
|
+
};
|
|
1949
|
+
var sizes = {
|
|
1950
|
+
iconSize: theme.fontSizes.xxlarge
|
|
1951
|
+
};
|
|
1952
|
+
var radii = {
|
|
1953
|
+
"default": theme.space.xlarge
|
|
1954
|
+
};
|
|
1955
|
+
var colors = {
|
|
1956
|
+
primary: theme.colors.primary,
|
|
1957
|
+
pressedPrimary: theme.colors.primaryLight,
|
|
1958
|
+
secondary: theme.colors.secondary,
|
|
1959
|
+
pressedSecondary: theme.colors.secondaryLight,
|
|
1960
|
+
defaultText: theme.colors.text,
|
|
1961
|
+
disabledText: theme.colors.disabledLightText,
|
|
1962
|
+
disabledBorder: theme.colors.disabledLightText,
|
|
1963
|
+
disabledBackground: theme.colors.disabledLightText,
|
|
1964
|
+
invertedText: theme.colors.invertedText
|
|
1965
|
+
};
|
|
1966
|
+
return {
|
|
1967
|
+
borderWidth: borderWidth,
|
|
1968
|
+
fonts: fonts,
|
|
1969
|
+
fontSize: fontSize,
|
|
1970
|
+
sizes: sizes,
|
|
1971
|
+
radii: radii,
|
|
1972
|
+
colors: colors,
|
|
1973
|
+
lineHeight: lineHeight,
|
|
1974
|
+
space: space
|
|
1975
|
+
};
|
|
1976
|
+
};
|
|
1977
|
+
|
|
1978
|
+
var getCardTheme = function getCardTheme(theme) {
|
|
1979
|
+
var colors = {
|
|
1980
|
+
dataCardIndicator: theme.colors.primaryDark
|
|
1981
|
+
};
|
|
1808
1982
|
var radii = {
|
|
1809
1983
|
"default": 12
|
|
1810
1984
|
};
|
|
1811
1985
|
return {
|
|
1986
|
+
colors: colors,
|
|
1812
1987
|
radii: radii
|
|
1813
1988
|
};
|
|
1814
1989
|
};
|
|
@@ -1834,21 +2009,98 @@ var getDividerTheme = function getDividerTheme(theme) {
|
|
|
1834
2009
|
};
|
|
1835
2010
|
};
|
|
1836
2011
|
|
|
2012
|
+
var getDrawerTheme = function getDrawerTheme(theme) {
|
|
2013
|
+
var colors = {
|
|
2014
|
+
shadow: theme.colors.backgroundDark,
|
|
2015
|
+
background: theme.colors.platformBackground,
|
|
2016
|
+
backdrop: theme.colors.backgroundDark
|
|
2017
|
+
};
|
|
2018
|
+
var radii = {
|
|
2019
|
+
"default": 16
|
|
2020
|
+
};
|
|
2021
|
+
var shadows = {
|
|
2022
|
+
offset: {
|
|
2023
|
+
width: 0,
|
|
2024
|
+
height: 3
|
|
2025
|
+
},
|
|
2026
|
+
opacity: 0.27,
|
|
2027
|
+
radius: 4.65,
|
|
2028
|
+
elevation: 10
|
|
2029
|
+
};
|
|
2030
|
+
return {
|
|
2031
|
+
colors: colors,
|
|
2032
|
+
radii: radii,
|
|
2033
|
+
shadows: shadows
|
|
2034
|
+
};
|
|
2035
|
+
};
|
|
2036
|
+
|
|
1837
2037
|
var getTabsTheme = function getTabsTheme(theme) {
|
|
1838
2038
|
var colors = {
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
2039
|
+
active: theme.colors.primary,
|
|
2040
|
+
inactive: theme.colors.text,
|
|
2041
|
+
activeBackground: theme.colors.primaryBackground,
|
|
2042
|
+
headerBottom: theme.colors.outline,
|
|
2043
|
+
text: theme.colors.text
|
|
1842
2044
|
};
|
|
1843
2045
|
var space = {
|
|
1844
2046
|
flatListHorizontalPadding: theme.space.small,
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
2047
|
+
itemHorizontalPadding: theme.space.small,
|
|
2048
|
+
itemVerticalPadding: theme.space.small,
|
|
2049
|
+
outlineHorizontalPadding: theme.space.small,
|
|
2050
|
+
outlineVerticalPadding: theme.space.xsmall
|
|
2051
|
+
};
|
|
2052
|
+
var radii = {
|
|
2053
|
+
outline: theme.radii.medium
|
|
2054
|
+
};
|
|
2055
|
+
var borderWidths = {
|
|
2056
|
+
headerBottom: theme.borderWidths.base
|
|
2057
|
+
};
|
|
2058
|
+
var sizes = {
|
|
2059
|
+
indicator: theme.space.xxsmall
|
|
1848
2060
|
};
|
|
1849
2061
|
return {
|
|
2062
|
+
borderWidths: borderWidths,
|
|
1850
2063
|
colors: colors,
|
|
1851
|
-
space: space
|
|
2064
|
+
space: space,
|
|
2065
|
+
radii: radii,
|
|
2066
|
+
sizes: sizes
|
|
2067
|
+
};
|
|
2068
|
+
};
|
|
2069
|
+
|
|
2070
|
+
var getTagTheme = function getTagTheme(theme) {
|
|
2071
|
+
var borderWidths = {
|
|
2072
|
+
"default": theme.borderWidths.base
|
|
2073
|
+
};
|
|
2074
|
+
var colors = {
|
|
2075
|
+
danger: theme.colors.danger,
|
|
2076
|
+
dangerBackground: theme.colors.dangerBackground,
|
|
2077
|
+
info: theme.colors.info,
|
|
2078
|
+
infoBackground: theme.colors.infoBackground,
|
|
2079
|
+
success: theme.colors.successDark,
|
|
2080
|
+
successBackground: theme.colors.successBackground,
|
|
2081
|
+
warning: theme.colors.warningDark,
|
|
2082
|
+
warningBackground: theme.colors.warningBackground
|
|
2083
|
+
};
|
|
2084
|
+
var fonts = {
|
|
2085
|
+
"default": theme.fonts.semiBold
|
|
2086
|
+
};
|
|
2087
|
+
var fontSizes = {
|
|
2088
|
+
"default": theme.fontSizes.small
|
|
2089
|
+
};
|
|
2090
|
+
var space = {
|
|
2091
|
+
horizontalPadding: theme.space.small,
|
|
2092
|
+
verticalPadding: theme.space.xxsmall
|
|
2093
|
+
};
|
|
2094
|
+
var radii = {
|
|
2095
|
+
"default": theme.radii.base
|
|
2096
|
+
};
|
|
2097
|
+
return {
|
|
2098
|
+
borderWidths: borderWidths,
|
|
2099
|
+
colors: colors,
|
|
2100
|
+
fonts: fonts,
|
|
2101
|
+
fontSizes: fontSizes,
|
|
2102
|
+
space: space,
|
|
2103
|
+
radii: radii
|
|
1852
2104
|
};
|
|
1853
2105
|
};
|
|
1854
2106
|
|
|
@@ -1874,6 +2126,31 @@ var getIconTheme = function getIconTheme(theme) {
|
|
|
1874
2126
|
};
|
|
1875
2127
|
};
|
|
1876
2128
|
|
|
2129
|
+
var getProgressTheme = function getProgressTheme(theme) {
|
|
2130
|
+
var colors = {
|
|
2131
|
+
primary: theme.colors.primary,
|
|
2132
|
+
success: theme.colors.success,
|
|
2133
|
+
warning: theme.colors.warning,
|
|
2134
|
+
danger: theme.colors.danger,
|
|
2135
|
+
info: theme.colors.info,
|
|
2136
|
+
background: theme.colors.outline,
|
|
2137
|
+
innerBackground: theme.colors.platformBackground
|
|
2138
|
+
};
|
|
2139
|
+
var sizes = {
|
|
2140
|
+
radius: theme.space.xxxlarge,
|
|
2141
|
+
strokeWidth: theme.space.small,
|
|
2142
|
+
barHeight: theme.space.xsmall
|
|
2143
|
+
};
|
|
2144
|
+
var radii = {
|
|
2145
|
+
"default": theme.radii.rounded
|
|
2146
|
+
};
|
|
2147
|
+
return {
|
|
2148
|
+
colors: colors,
|
|
2149
|
+
sizes: sizes,
|
|
2150
|
+
radii: radii
|
|
2151
|
+
};
|
|
2152
|
+
};
|
|
2153
|
+
|
|
1877
2154
|
var getTypographyTheme = function getTypographyTheme(theme) {
|
|
1878
2155
|
var colors = {
|
|
1879
2156
|
body: theme.colors.text,
|
|
@@ -1911,7 +2188,8 @@ var getFABTheme = function getFABTheme(theme) {
|
|
|
1911
2188
|
icon: theme.colors.invertedText,
|
|
1912
2189
|
headerText: theme.colors.text,
|
|
1913
2190
|
actionItemBackground: theme.colors.infoLight,
|
|
1914
|
-
backdropBackground: theme.colors.platformBackground
|
|
2191
|
+
backdropBackground: theme.colors.platformBackground,
|
|
2192
|
+
titleText: theme.colors.invertedText
|
|
1915
2193
|
};
|
|
1916
2194
|
var sizes = {
|
|
1917
2195
|
width: 64,
|
|
@@ -1919,16 +2197,19 @@ var getFABTheme = function getFABTheme(theme) {
|
|
|
1919
2197
|
};
|
|
1920
2198
|
var fonts = {
|
|
1921
2199
|
header: theme.fonts.semiBold,
|
|
1922
|
-
actionItemText: theme.fonts.regular
|
|
2200
|
+
actionItemText: theme.fonts.regular,
|
|
2201
|
+
title: theme.fonts.semiBold
|
|
1923
2202
|
};
|
|
1924
2203
|
var fontSizes = {
|
|
1925
2204
|
header: theme.fontSizes.xxxlarge,
|
|
1926
|
-
|
|
1927
|
-
|
|
2205
|
+
actionItemText: theme.fontSizes.medium,
|
|
2206
|
+
title: theme.fontSizes.large
|
|
1928
2207
|
};
|
|
1929
2208
|
var lineHeights = {
|
|
1930
2209
|
header: theme.lineHeights.xxxlarge,
|
|
1931
|
-
actionItemText: theme.lineHeights.medium
|
|
2210
|
+
actionItemText: theme.lineHeights.medium,
|
|
2211
|
+
title: theme.lineHeights.large,
|
|
2212
|
+
icon: theme.lineHeights.large
|
|
1932
2213
|
};
|
|
1933
2214
|
var space = {
|
|
1934
2215
|
actionItemPaddingLeft: theme.space.medium,
|
|
@@ -1941,10 +2222,13 @@ var getFABTheme = function getFABTheme(theme) {
|
|
|
1941
2222
|
buttonMarginTop: theme.space.large,
|
|
1942
2223
|
buttonMarginRight: theme.space.large,
|
|
1943
2224
|
headerTextMarginRight: theme.space.large,
|
|
1944
|
-
headerTextMarginBottom: theme.space.large
|
|
2225
|
+
headerTextMarginBottom: theme.space.large,
|
|
2226
|
+
containerPaddingHorizontal: theme.space.medium,
|
|
2227
|
+
containerPaddingVertical: theme.space.medium,
|
|
2228
|
+
titleMarginHorizontal: theme.space.small
|
|
1945
2229
|
};
|
|
1946
2230
|
var radii = {
|
|
1947
|
-
actionItem:
|
|
2231
|
+
actionItem: theme.radii.rounded
|
|
1948
2232
|
};
|
|
1949
2233
|
return {
|
|
1950
2234
|
radii: radii,
|
|
@@ -1957,18 +2241,61 @@ var getFABTheme = function getFABTheme(theme) {
|
|
|
1957
2241
|
};
|
|
1958
2242
|
};
|
|
1959
2243
|
|
|
2244
|
+
var getAvatarTheme = function getAvatarTheme(theme) {
|
|
2245
|
+
var colors = {
|
|
2246
|
+
primary: theme.colors.primary,
|
|
2247
|
+
info: theme.colors.info,
|
|
2248
|
+
danger: theme.colors.danger,
|
|
2249
|
+
success: theme.colors.success,
|
|
2250
|
+
warning: theme.colors.warning
|
|
2251
|
+
};
|
|
2252
|
+
var sizes = {
|
|
2253
|
+
small: theme.space.xlarge,
|
|
2254
|
+
medium: theme.space.xxlarge,
|
|
2255
|
+
large: theme.space.xxxlarge,
|
|
2256
|
+
xlarge: theme.space.xxxxlarge
|
|
2257
|
+
};
|
|
2258
|
+
var fontSizes = {
|
|
2259
|
+
small: theme.fontSizes.large,
|
|
2260
|
+
medium: theme.fontSizes.xlarge,
|
|
2261
|
+
large: theme.fontSizes.xxlarge,
|
|
2262
|
+
xlarge: theme.fontSizes.xxxlarge
|
|
2263
|
+
};
|
|
2264
|
+
var radii = {
|
|
2265
|
+
small: theme.space.xlarge / 2,
|
|
2266
|
+
medium: theme.space.xxlarge / 2,
|
|
2267
|
+
large: theme.space.xxxlarge / 2,
|
|
2268
|
+
xlarge: theme.space.xxxxlarge / 2
|
|
2269
|
+
};
|
|
2270
|
+
var borderWidths = {
|
|
2271
|
+
"default": theme.borderWidths.base
|
|
2272
|
+
};
|
|
2273
|
+
return {
|
|
2274
|
+
colors: colors,
|
|
2275
|
+
sizes: sizes,
|
|
2276
|
+
radii: radii,
|
|
2277
|
+
borderWidths: borderWidths,
|
|
2278
|
+
fontSizes: fontSizes
|
|
2279
|
+
};
|
|
2280
|
+
};
|
|
2281
|
+
|
|
1960
2282
|
var getTheme = function getTheme() {
|
|
1961
2283
|
var scale = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : scale$1;
|
|
1962
2284
|
var systemPallete = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : systemPalette;
|
|
1963
2285
|
var globalTheme = getGlobalTheme(scale, systemPallete);
|
|
1964
2286
|
return _objectSpread2(_objectSpread2({}, globalTheme), {}, {
|
|
1965
2287
|
__hd__: {
|
|
2288
|
+
avatar: getAvatarTheme(globalTheme),
|
|
1966
2289
|
badge: getBadgeTheme(globalTheme),
|
|
1967
2290
|
bottomNavigation: getBottomNavigationTheme(globalTheme),
|
|
1968
|
-
|
|
2291
|
+
button: getButtonTheme(globalTheme),
|
|
2292
|
+
card: getCardTheme(globalTheme),
|
|
1969
2293
|
divider: getDividerTheme(globalTheme),
|
|
2294
|
+
drawer: getDrawerTheme(globalTheme),
|
|
2295
|
+
progress: getProgressTheme(globalTheme),
|
|
1970
2296
|
icon: getIconTheme(globalTheme),
|
|
1971
2297
|
tabs: getTabsTheme(globalTheme),
|
|
2298
|
+
tag: getTagTheme(globalTheme),
|
|
1972
2299
|
typography: getTypographyTheme(globalTheme),
|
|
1973
2300
|
fab: getFABTheme(globalTheme)
|
|
1974
2301
|
}
|
|
@@ -3895,65 +4222,241 @@ var getDisplayName = function getDisplayName(primitive) {
|
|
|
3895
4222
|
* a function that returns a styled component which render styles in React Native
|
|
3896
4223
|
*/
|
|
3897
4224
|
|
|
3898
|
-
var styled = createStyled(
|
|
4225
|
+
var styled = createStyled(ReactNative.StyleSheet);
|
|
3899
4226
|
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'];
|
|
3900
|
-
var index$
|
|
4227
|
+
var index$2 = components.reduce(function (acc, comp) {
|
|
3901
4228
|
return Object.defineProperty(acc, comp, {
|
|
3902
4229
|
enumerable: true,
|
|
3903
4230
|
configurable: false,
|
|
3904
4231
|
get: function get() {
|
|
3905
|
-
return styled(
|
|
4232
|
+
return styled(ReactNative__namespace[comp]);
|
|
3906
4233
|
}
|
|
3907
4234
|
});
|
|
3908
4235
|
}, styled);
|
|
3909
4236
|
|
|
3910
|
-
var
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
danger: 'dangerBackground',
|
|
3914
|
-
info: 'infoBackground'
|
|
3915
|
-
};
|
|
3916
|
-
var StyledView = index$1(reactNative.View)(function (_ref) {
|
|
3917
|
-
var themeIntent = _ref.themeIntent,
|
|
4237
|
+
var StyledPressable = index$2(ReactNative.TouchableOpacity)(function (_ref) {
|
|
4238
|
+
var themeSize = _ref.themeSize,
|
|
4239
|
+
themeIntent = _ref.themeIntent,
|
|
3918
4240
|
theme = _ref.theme;
|
|
3919
4241
|
return {
|
|
3920
|
-
borderWidth: theme.__hd__.
|
|
3921
|
-
borderRadius: theme.__hd__.
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
4242
|
+
borderWidth: theme.__hd__.avatar.borderWidths["default"],
|
|
4243
|
+
borderRadius: theme.__hd__.avatar.radii[themeSize],
|
|
4244
|
+
borderColor: theme.__hd__.avatar.colors[themeIntent],
|
|
4245
|
+
width: theme.__hd__.avatar.sizes[themeSize],
|
|
4246
|
+
height: theme.__hd__.avatar.sizes[themeSize],
|
|
4247
|
+
overflow: 'hidden'
|
|
3926
4248
|
};
|
|
3927
4249
|
});
|
|
3928
|
-
var
|
|
3929
|
-
var
|
|
4250
|
+
var StyledView$2 = index$2(ReactNative.View)(function (_ref2) {
|
|
4251
|
+
var themeSize = _ref2.themeSize,
|
|
4252
|
+
themeIntent = _ref2.themeIntent,
|
|
3930
4253
|
theme = _ref2.theme;
|
|
3931
4254
|
return {
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
4255
|
+
borderWidth: theme.__hd__.avatar.borderWidths["default"],
|
|
4256
|
+
borderRadius: theme.__hd__.avatar.radii[themeSize],
|
|
4257
|
+
borderColor: theme.__hd__.avatar.colors[themeIntent],
|
|
4258
|
+
width: theme.__hd__.avatar.sizes[themeSize],
|
|
4259
|
+
height: theme.__hd__.avatar.sizes[themeSize],
|
|
4260
|
+
overflow: 'hidden'
|
|
4261
|
+
};
|
|
4262
|
+
});
|
|
4263
|
+
var StyledTextWrapper = index$2(ReactNative.View)(function () {
|
|
4264
|
+
return {
|
|
4265
|
+
alignItems: 'center',
|
|
4266
|
+
justifyContent: 'center',
|
|
4267
|
+
display: 'flex',
|
|
4268
|
+
width: '100%',
|
|
4269
|
+
height: '100%'
|
|
4270
|
+
};
|
|
4271
|
+
});
|
|
4272
|
+
var StyledText$3 = index$2(ReactNative.Text)(function (_ref3) {
|
|
4273
|
+
var themeSize = _ref3.themeSize,
|
|
4274
|
+
themeIntent = _ref3.themeIntent,
|
|
4275
|
+
theme = _ref3.theme;
|
|
4276
|
+
return {
|
|
4277
|
+
fontSize: theme.__hd__.avatar.fontSizes[themeSize],
|
|
4278
|
+
color: theme.__hd__.avatar.colors[themeIntent],
|
|
4279
|
+
overflow: 'hidden'
|
|
4280
|
+
};
|
|
4281
|
+
});
|
|
4282
|
+
var StyledImage = index$2(ReactNative.Image)(function (_ref4) {
|
|
4283
|
+
var themeSize = _ref4.themeSize,
|
|
4284
|
+
theme = _ref4.theme;
|
|
4285
|
+
return {
|
|
4286
|
+
width: theme.__hd__.avatar.sizes[themeSize],
|
|
4287
|
+
height: theme.__hd__.avatar.sizes[themeSize]
|
|
3935
4288
|
};
|
|
3936
4289
|
});
|
|
3937
4290
|
|
|
3938
|
-
var
|
|
4291
|
+
var Avatar = function Avatar(_ref) {
|
|
4292
|
+
var onPress = _ref.onPress,
|
|
4293
|
+
source = _ref.source,
|
|
4294
|
+
testID = _ref.testID,
|
|
4295
|
+
style = _ref.style,
|
|
4296
|
+
title = _ref.title,
|
|
4297
|
+
_ref$size = _ref.size,
|
|
4298
|
+
size = _ref$size === void 0 ? 'small' : _ref$size,
|
|
4299
|
+
_ref$intent = _ref.intent,
|
|
4300
|
+
intent = _ref$intent === void 0 ? 'primary' : _ref$intent;
|
|
4301
|
+
var Wrapper = onPress ? StyledPressable : StyledView$2;
|
|
4302
|
+
return title !== undefined || source !== undefined ? /*#__PURE__*/React__default["default"].createElement(Wrapper, {
|
|
4303
|
+
testID: testID,
|
|
4304
|
+
onPress: onPress,
|
|
4305
|
+
themeIntent: intent,
|
|
4306
|
+
themeSize: size,
|
|
4307
|
+
style: style
|
|
4308
|
+
}, title !== undefined && source === undefined && /*#__PURE__*/React__default["default"].createElement(StyledTextWrapper, null, /*#__PURE__*/React__default["default"].createElement(StyledText$3, {
|
|
4309
|
+
themeIntent: intent,
|
|
4310
|
+
themeSize: size
|
|
4311
|
+
}, title)), source !== undefined && /*#__PURE__*/React__default["default"].createElement(StyledImage, {
|
|
4312
|
+
resizeMode: "cover",
|
|
4313
|
+
source: source,
|
|
4314
|
+
themeSize: size
|
|
4315
|
+
})) : null;
|
|
4316
|
+
};
|
|
3939
4317
|
|
|
3940
|
-
var
|
|
3941
|
-
var
|
|
4318
|
+
var StyledView$1 = index$2(ReactNative.Animated.View)(function (_ref) {
|
|
4319
|
+
var themeIntent = _ref.themeIntent,
|
|
4320
|
+
themePadding = _ref.themePadding,
|
|
4321
|
+
theme = _ref.theme;
|
|
4322
|
+
return {
|
|
4323
|
+
height: theme.__hd__.badge.sizes.height,
|
|
4324
|
+
minWidth: theme.__hd__.badge.sizes.minWidth,
|
|
4325
|
+
alignItems: 'center',
|
|
4326
|
+
justifyContent: 'center',
|
|
4327
|
+
backgroundColor: theme.__hd__.badge.colors[themeIntent],
|
|
4328
|
+
borderRadius: theme.radii.rounded,
|
|
4329
|
+
paddingHorizontal: themePadding === 'wideContent' ? theme.__hd__.badge.space.horizontalPadding : undefined
|
|
4330
|
+
};
|
|
4331
|
+
});
|
|
4332
|
+
var StyledText$2 = index$2(ReactNative.Text)(function (_ref2) {
|
|
4333
|
+
var theme = _ref2.theme;
|
|
4334
|
+
return {
|
|
4335
|
+
fontFamily: theme.__hd__.badge.fonts["default"],
|
|
4336
|
+
fontSize: theme.__hd__.badge.fontSizes["default"],
|
|
4337
|
+
color: theme.__hd__.badge.colors.text,
|
|
4338
|
+
includeFontPadding: false,
|
|
4339
|
+
textAlignVertical: 'center',
|
|
4340
|
+
textAlign: 'center'
|
|
4341
|
+
};
|
|
4342
|
+
});
|
|
4343
|
+
var StyledStatus = index$2(ReactNative.Animated.View)(function (_ref3) {
|
|
4344
|
+
var themeIntent = _ref3.themeIntent,
|
|
4345
|
+
theme = _ref3.theme;
|
|
4346
|
+
return {
|
|
4347
|
+
position: 'absolute',
|
|
4348
|
+
top: theme.__hd__.badge.space.statusPositionTop,
|
|
4349
|
+
right: theme.__hd__.badge.space.statusPositionRight,
|
|
4350
|
+
height: theme.__hd__.badge.sizes.statusHeight,
|
|
4351
|
+
width: theme.__hd__.badge.sizes.statusWidth,
|
|
4352
|
+
backgroundColor: theme.__hd__.badge.colors[themeIntent],
|
|
4353
|
+
borderRadius: theme.radii.rounded
|
|
4354
|
+
};
|
|
4355
|
+
});
|
|
4356
|
+
|
|
4357
|
+
var _excluded$a = ["children", "visible", "intent", "style", "testID"];
|
|
4358
|
+
|
|
4359
|
+
var Status = function Status(_ref) {
|
|
4360
|
+
var children = _ref.children,
|
|
4361
|
+
_ref$visible = _ref.visible,
|
|
4362
|
+
visible = _ref$visible === void 0 ? true : _ref$visible,
|
|
3942
4363
|
_ref$intent = _ref.intent,
|
|
3943
|
-
intent = _ref$intent === void 0 ? '
|
|
4364
|
+
intent = _ref$intent === void 0 ? 'danger' : _ref$intent,
|
|
3944
4365
|
style = _ref.style,
|
|
3945
4366
|
testID = _ref.testID,
|
|
3946
|
-
nativeProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
4367
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$a);
|
|
3947
4368
|
|
|
3948
|
-
|
|
3949
|
-
|
|
4369
|
+
var _React$useRef = React__default["default"].useRef(new ReactNative.Animated.Value(visible ? 1 : 0)),
|
|
4370
|
+
opacity = _React$useRef.current;
|
|
4371
|
+
|
|
4372
|
+
var isFirstRendering = React__default["default"].useRef(true);
|
|
4373
|
+
React__default["default"].useEffect(function () {
|
|
4374
|
+
// Do not run animation on very first rendering
|
|
4375
|
+
if (isFirstRendering.current) {
|
|
4376
|
+
isFirstRendering.current = false;
|
|
4377
|
+
return;
|
|
4378
|
+
}
|
|
4379
|
+
|
|
4380
|
+
ReactNative.Animated.timing(opacity, {
|
|
4381
|
+
toValue: visible ? 1 : 0,
|
|
4382
|
+
duration: 150,
|
|
4383
|
+
useNativeDriver: true
|
|
4384
|
+
}).start();
|
|
4385
|
+
}, [visible, opacity]);
|
|
4386
|
+
return /*#__PURE__*/React__default["default"].createElement(ReactNative.View, _extends$3({}, nativeProps, {
|
|
3950
4387
|
style: style,
|
|
3951
4388
|
testID: testID
|
|
3952
|
-
},
|
|
4389
|
+
}), children, /*#__PURE__*/React__default["default"].createElement(StyledStatus, {
|
|
4390
|
+
style: {
|
|
4391
|
+
opacity: opacity,
|
|
4392
|
+
transform: [{
|
|
4393
|
+
scale: opacity.interpolate({
|
|
4394
|
+
inputRange: [0, 1],
|
|
4395
|
+
outputRange: [0.5, 1]
|
|
4396
|
+
})
|
|
4397
|
+
}]
|
|
4398
|
+
},
|
|
3953
4399
|
themeIntent: intent
|
|
3954
|
-
}
|
|
4400
|
+
}));
|
|
4401
|
+
};
|
|
4402
|
+
|
|
4403
|
+
var _excluded$9 = ["content", "visible", "max", "intent", "style", "testID"];
|
|
4404
|
+
var DEFAULT_MAX_NUMBER = 99;
|
|
4405
|
+
|
|
4406
|
+
var getPaddingState = function getPaddingState(content) {
|
|
4407
|
+
return content.length > 1 ? 'wideContent' : 'narrowContent';
|
|
4408
|
+
};
|
|
4409
|
+
|
|
4410
|
+
var Badge = function Badge(_ref) {
|
|
4411
|
+
var originalContent = _ref.content,
|
|
4412
|
+
_ref$visible = _ref.visible,
|
|
4413
|
+
visible = _ref$visible === void 0 ? true : _ref$visible,
|
|
4414
|
+
_ref$max = _ref.max,
|
|
4415
|
+
max = _ref$max === void 0 ? DEFAULT_MAX_NUMBER : _ref$max,
|
|
4416
|
+
_ref$intent = _ref.intent,
|
|
4417
|
+
intent = _ref$intent === void 0 ? 'danger' : _ref$intent,
|
|
4418
|
+
style = _ref.style,
|
|
4419
|
+
testID = _ref.testID,
|
|
4420
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$9);
|
|
4421
|
+
|
|
4422
|
+
var _React$useRef = React__default["default"].useRef(new ReactNative.Animated.Value(visible ? 1 : 0)),
|
|
4423
|
+
opacity = _React$useRef.current;
|
|
4424
|
+
|
|
4425
|
+
var isFirstRendering = React__default["default"].useRef(true);
|
|
4426
|
+
React__default["default"].useEffect(function () {
|
|
4427
|
+
// Do not run animation on very first rendering
|
|
4428
|
+
if (isFirstRendering.current) {
|
|
4429
|
+
isFirstRendering.current = false;
|
|
4430
|
+
return;
|
|
4431
|
+
}
|
|
4432
|
+
|
|
4433
|
+
ReactNative.Animated.timing(opacity, {
|
|
4434
|
+
toValue: visible ? 1 : 0,
|
|
4435
|
+
duration: 150,
|
|
4436
|
+
useNativeDriver: true
|
|
4437
|
+
}).start();
|
|
4438
|
+
}, [visible, opacity]);
|
|
4439
|
+
var content = typeof originalContent === 'number' && originalContent > max ? "".concat(max, "+") : String(originalContent);
|
|
4440
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledView$1, _extends$3({}, nativeProps, {
|
|
4441
|
+
themeIntent: intent,
|
|
4442
|
+
themePadding: getPaddingState(content),
|
|
4443
|
+
style: [{
|
|
4444
|
+
opacity: opacity,
|
|
4445
|
+
transform: [{
|
|
4446
|
+
scale: opacity.interpolate({
|
|
4447
|
+
inputRange: [0, 1],
|
|
4448
|
+
outputRange: [0.5, 1]
|
|
4449
|
+
})
|
|
4450
|
+
}]
|
|
4451
|
+
}, style],
|
|
4452
|
+
testID: testID
|
|
4453
|
+
}), /*#__PURE__*/React__default["default"].createElement(StyledText$2, null, content));
|
|
3955
4454
|
};
|
|
3956
4455
|
|
|
4456
|
+
var Badge$1 = Object.assign(Badge, {
|
|
4457
|
+
Status: Status
|
|
4458
|
+
});
|
|
4459
|
+
|
|
3957
4460
|
var dist = {};
|
|
3958
4461
|
|
|
3959
4462
|
function _interopRequireDefault$5(obj) {
|
|
@@ -4705,8 +5208,8 @@ var runtime = {exports: {}};
|
|
|
4705
5208
|
|
|
4706
5209
|
var regenerator = runtime.exports;
|
|
4707
5210
|
|
|
4708
|
-
function _extends() {
|
|
4709
|
-
_extends_1 = _extends = Object.assign || function (target) {
|
|
5211
|
+
function _extends$1() {
|
|
5212
|
+
_extends_1 = _extends$1 = Object.assign || function (target) {
|
|
4710
5213
|
for (var i = 1; i < arguments.length; i++) {
|
|
4711
5214
|
var source = arguments[i];
|
|
4712
5215
|
|
|
@@ -4720,10 +5223,10 @@ function _extends() {
|
|
|
4720
5223
|
return target;
|
|
4721
5224
|
};
|
|
4722
5225
|
|
|
4723
|
-
return _extends.apply(this, arguments);
|
|
5226
|
+
return _extends$1.apply(this, arguments);
|
|
4724
5227
|
}
|
|
4725
5228
|
|
|
4726
|
-
var _extends_1 = _extends;
|
|
5229
|
+
var _extends_1 = _extends$1;
|
|
4727
5230
|
|
|
4728
5231
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
4729
5232
|
if (source == null) return {};
|
|
@@ -4975,7 +5478,7 @@ Object.defineProperty(ensureNativeModuleAvailable$1, "__esModule", {
|
|
|
4975
5478
|
|
|
4976
5479
|
ensureNativeModuleAvailable$1["default"] = ensureNativeModuleAvailable;
|
|
4977
5480
|
|
|
4978
|
-
var _reactNative$2 =
|
|
5481
|
+
var _reactNative$2 = ReactNative__default["default"];
|
|
4979
5482
|
var NativeIconAPI$1 = _reactNative$2.NativeModules.RNVectorIconsManager || _reactNative$2.NativeModules.RNVectorIconsModule;
|
|
4980
5483
|
|
|
4981
5484
|
function ensureNativeModuleAvailable() {
|
|
@@ -5103,7 +5606,7 @@ var _react$2 = _interopRequireWildcard$2(React__default["default"]);
|
|
|
5103
5606
|
|
|
5104
5607
|
var _propTypes$2 = _interopRequireDefault$4(propTypes.exports);
|
|
5105
5608
|
|
|
5106
|
-
var _reactNative$1 =
|
|
5609
|
+
var _reactNative$1 = ReactNative__default["default"];
|
|
5107
5610
|
var _objectUtils = objectUtils;
|
|
5108
5611
|
var _jsxFileName$2 = "/home/runner/work/react-native-vector-icons/react-native-vector-icons/lib/icon-button.js";
|
|
5109
5612
|
|
|
@@ -5285,7 +5788,7 @@ var _react$1 = _interopRequireWildcard$1(React__default["default"]);
|
|
|
5285
5788
|
|
|
5286
5789
|
var _propTypes$1 = _interopRequireDefault$3(propTypes.exports);
|
|
5287
5790
|
|
|
5288
|
-
var _reactNative =
|
|
5791
|
+
var _reactNative = ReactNative__default["default"];
|
|
5289
5792
|
|
|
5290
5793
|
var _ensureNativeModuleAvailable = _interopRequireDefault$3(ensureNativeModuleAvailable$1);
|
|
5291
5794
|
|
|
@@ -5600,7 +6103,7 @@ function createIconSet(glyphMap, fontFamily, fontFile, fontStyle) {
|
|
|
5600
6103
|
|
|
5601
6104
|
var createMultiStyleIconSet$1 = {};
|
|
5602
6105
|
|
|
5603
|
-
function _defineProperty(obj, key, value) {
|
|
6106
|
+
function _defineProperty$1(obj, key, value) {
|
|
5604
6107
|
if (key in obj) {
|
|
5605
6108
|
Object.defineProperty(obj, key, {
|
|
5606
6109
|
value: value,
|
|
@@ -5615,7 +6118,7 @@ function _defineProperty(obj, key, value) {
|
|
|
5615
6118
|
return obj;
|
|
5616
6119
|
}
|
|
5617
6120
|
|
|
5618
|
-
var defineProperty = _defineProperty;
|
|
6121
|
+
var defineProperty = _defineProperty$1;
|
|
5619
6122
|
|
|
5620
6123
|
var _interopRequireDefault$2 = interopRequireDefault;
|
|
5621
6124
|
Object.defineProperty(createMultiStyleIconSet$1, "__esModule", {
|
|
@@ -13583,7 +14086,7 @@ var heroIconConfig = {
|
|
|
13583
14086
|
};
|
|
13584
14087
|
|
|
13585
14088
|
var HeroIcon = dist.createIconSetFromIcoMoon(heroIconConfig, 'hero-icons', 'hero-icons.ttf');
|
|
13586
|
-
var StyledHeroIcon = index$
|
|
14089
|
+
var StyledHeroIcon = index$2(HeroIcon)(function (_ref) {
|
|
13587
14090
|
var themeIntent = _ref.themeIntent,
|
|
13588
14091
|
themeSize = _ref.themeSize,
|
|
13589
14092
|
theme = _ref.theme;
|
|
@@ -13621,7 +14124,7 @@ var FONTWEIGHT_MAP = {
|
|
|
13621
14124
|
regular: 'regular',
|
|
13622
14125
|
'semi-bold': 'semiBold'
|
|
13623
14126
|
};
|
|
13624
|
-
var StyledText = index$
|
|
14127
|
+
var StyledText$1 = index$2(ReactNative.Text)(function (_ref) {
|
|
13625
14128
|
var themeFontSize = _ref.themeFontSize,
|
|
13626
14129
|
themeFontWeight = _ref.themeFontWeight,
|
|
13627
14130
|
themeIntent = _ref.themeIntent,
|
|
@@ -13637,7 +14140,7 @@ var StyledText = index$1(reactNative.Text)(function (_ref) {
|
|
|
13637
14140
|
});
|
|
13638
14141
|
});
|
|
13639
14142
|
|
|
13640
|
-
var _excluded$
|
|
14143
|
+
var _excluded$8 = ["children", "fontSize", "fontWeight", "intent"];
|
|
13641
14144
|
|
|
13642
14145
|
var Text = function Text(_ref) {
|
|
13643
14146
|
var children = _ref.children,
|
|
@@ -13647,34 +14150,34 @@ var Text = function Text(_ref) {
|
|
|
13647
14150
|
fontWeight = _ref$fontWeight === void 0 ? 'regular' : _ref$fontWeight,
|
|
13648
14151
|
_ref$intent = _ref.intent,
|
|
13649
14152
|
intent = _ref$intent === void 0 ? 'body' : _ref$intent,
|
|
13650
|
-
nativeProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
14153
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$8);
|
|
13651
14154
|
|
|
13652
|
-
return /*#__PURE__*/React__default["default"].createElement(StyledText, _extends$
|
|
14155
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledText$1, _extends$3({}, nativeProps, {
|
|
13653
14156
|
themeFontSize: fontSize,
|
|
13654
14157
|
themeFontWeight: fontWeight,
|
|
13655
14158
|
themeIntent: intent
|
|
13656
|
-
}
|
|
14159
|
+
}), children);
|
|
13657
14160
|
};
|
|
13658
14161
|
|
|
13659
14162
|
var Typography = {
|
|
13660
14163
|
Text: Text
|
|
13661
14164
|
};
|
|
13662
14165
|
|
|
13663
|
-
var BottomNavigationTab = index$
|
|
14166
|
+
var BottomNavigationTab = index$2(ReactNative.View)(function (_ref) {
|
|
13664
14167
|
var themeVisibility = _ref.themeVisibility;
|
|
13665
14168
|
return {
|
|
13666
14169
|
flex: 1,
|
|
13667
14170
|
display: themeVisibility === false ? 'none' : 'flex'
|
|
13668
14171
|
};
|
|
13669
14172
|
});
|
|
13670
|
-
var BottomNavigationContainer = index$
|
|
14173
|
+
var BottomNavigationContainer = index$2(ReactNative.View)({
|
|
13671
14174
|
flex: 1,
|
|
13672
14175
|
overflow: 'hidden'
|
|
13673
14176
|
});
|
|
13674
|
-
var ContentWrapper$
|
|
14177
|
+
var ContentWrapper$2 = index$2(ReactNative.View)({
|
|
13675
14178
|
flex: 1
|
|
13676
14179
|
});
|
|
13677
|
-
var BottomBarWrapper = index$
|
|
14180
|
+
var BottomBarWrapper = index$2(ReactNative.View)(function (_ref2) {
|
|
13678
14181
|
var themeInsets = _ref2.themeInsets,
|
|
13679
14182
|
theme = _ref2.theme;
|
|
13680
14183
|
return {
|
|
@@ -13690,27 +14193,27 @@ var BottomBarWrapper = index$1(reactNative.View)(function (_ref2) {
|
|
|
13690
14193
|
elevation: theme.__hd__.bottomNavigation.shadows.elevation
|
|
13691
14194
|
};
|
|
13692
14195
|
});
|
|
13693
|
-
var BottomBar = index$
|
|
14196
|
+
var BottomBar = index$2(ReactNative.View)({
|
|
13694
14197
|
flex: 1,
|
|
13695
14198
|
flexDirection: 'row',
|
|
13696
14199
|
overflow: 'hidden',
|
|
13697
14200
|
alignItems: 'center'
|
|
13698
14201
|
});
|
|
13699
|
-
var BottomBarItem = index$
|
|
14202
|
+
var BottomBarItem = index$2(ReactNative.View)({
|
|
13700
14203
|
flex: 1,
|
|
13701
14204
|
alignItems: 'center'
|
|
13702
14205
|
});
|
|
13703
|
-
var StyledBottomBarText = index$
|
|
14206
|
+
var StyledBottomBarText = index$2(Typography.Text)(function (_ref3) {
|
|
13704
14207
|
var theme = _ref3.theme;
|
|
13705
14208
|
return {
|
|
13706
14209
|
marginTop: theme.__hd__.bottomNavigation.space.titleMarginTop
|
|
13707
14210
|
};
|
|
13708
14211
|
});
|
|
13709
14212
|
|
|
13710
|
-
var isIOS =
|
|
13711
|
-
|
|
14213
|
+
var isIOS = ReactNative.Platform.OS === 'ios';
|
|
14214
|
+
ReactNative.Platform.OS === 'android';
|
|
13712
14215
|
|
|
13713
|
-
var _excluded$
|
|
14216
|
+
var _excluded$7 = ["onTabPress", "renderActiveTabOnly", "selectedTabKey", "tabs"];
|
|
13714
14217
|
|
|
13715
14218
|
var getInactiveIcon = function getInactiveIcon(icon) {
|
|
13716
14219
|
var inactiveIcon = "".concat(icon, "-outlined");
|
|
@@ -13723,7 +14226,7 @@ var BottomNavigation = function BottomNavigation(_ref) {
|
|
|
13723
14226
|
renderActiveTabOnly = _ref$renderActiveTabO === void 0 ? false : _ref$renderActiveTabO,
|
|
13724
14227
|
selectedTabKey = _ref.selectedTabKey,
|
|
13725
14228
|
tabs = _ref.tabs,
|
|
13726
|
-
nativeProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
14229
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$7);
|
|
13727
14230
|
|
|
13728
14231
|
var insets = reactNativeSafeAreaContext.useSafeAreaInsets();
|
|
13729
14232
|
/**
|
|
@@ -13742,7 +14245,7 @@ var BottomNavigation = function BottomNavigation(_ref) {
|
|
|
13742
14245
|
});
|
|
13743
14246
|
}
|
|
13744
14247
|
|
|
13745
|
-
return /*#__PURE__*/React__default["default"].createElement(BottomNavigationContainer, nativeProps, /*#__PURE__*/React__default["default"].createElement(ContentWrapper$
|
|
14248
|
+
return /*#__PURE__*/React__default["default"].createElement(BottomNavigationContainer, nativeProps, /*#__PURE__*/React__default["default"].createElement(ContentWrapper$2, null, tabs.map(function (tab) {
|
|
13746
14249
|
var key = tab.key,
|
|
13747
14250
|
component = tab.component,
|
|
13748
14251
|
testID = tab.testID;
|
|
@@ -13778,7 +14281,7 @@ var BottomNavigation = function BottomNavigation(_ref) {
|
|
|
13778
14281
|
testID = tab.testID;
|
|
13779
14282
|
var active = selectedTabKey === key;
|
|
13780
14283
|
var inactiveIcon = getInactiveIcon(icon);
|
|
13781
|
-
return /*#__PURE__*/React__default["default"].createElement(
|
|
14284
|
+
return /*#__PURE__*/React__default["default"].createElement(ReactNative.TouchableWithoutFeedback, {
|
|
13782
14285
|
key: key,
|
|
13783
14286
|
onPress: function onPress() {
|
|
13784
14287
|
return onTabPress(key);
|
|
@@ -13797,388 +14300,1620 @@ var BottomNavigation = function BottomNavigation(_ref) {
|
|
|
13797
14300
|
}))));
|
|
13798
14301
|
};
|
|
13799
14302
|
|
|
13800
|
-
var
|
|
13801
|
-
var hitSlop = _ref.hitSlop,
|
|
13802
|
-
onPress = _ref.onPress,
|
|
13803
|
-
icon = _ref.icon,
|
|
13804
|
-
testID = _ref.testID,
|
|
13805
|
-
style = _ref.style,
|
|
13806
|
-
size = _ref.size,
|
|
13807
|
-
intent = _ref.intent;
|
|
13808
|
-
return /*#__PURE__*/React__default["default"].createElement(reactNative.TouchableOpacity, {
|
|
13809
|
-
style: style,
|
|
13810
|
-
onPress: onPress,
|
|
13811
|
-
testID: testID,
|
|
13812
|
-
hitSlop: hitSlop
|
|
13813
|
-
}, /*#__PURE__*/React__default["default"].createElement(Icon, {
|
|
13814
|
-
icon: icon,
|
|
13815
|
-
size: size,
|
|
13816
|
-
intent: intent
|
|
13817
|
-
}));
|
|
13818
|
-
};
|
|
13819
|
-
|
|
13820
|
-
var Button = {
|
|
13821
|
-
Icon: IconButton
|
|
13822
|
-
};
|
|
13823
|
-
|
|
13824
|
-
var StyledCard = index$1(reactNative.View)(function (_ref) {
|
|
13825
|
-
var theme = _ref.theme;
|
|
14303
|
+
var genLoadingIndicatorStyles = function genLoadingIndicatorStyles(theme, intent) {
|
|
13826
14304
|
return {
|
|
13827
|
-
|
|
13828
|
-
overflow: 'hidden'
|
|
14305
|
+
backgroundColor: theme.__hd__.button.colors[intent]
|
|
13829
14306
|
};
|
|
13830
|
-
});
|
|
13831
|
-
|
|
13832
|
-
var Card = function Card(props) {
|
|
13833
|
-
return /*#__PURE__*/React__default["default"].createElement(StyledCard, props);
|
|
13834
|
-
};
|
|
13835
|
-
|
|
13836
|
-
var StyledDivider = index$1(reactNative.View)(function (_ref) {
|
|
13837
|
-
var themeMarginHorizontal = _ref.themeMarginHorizontal,
|
|
13838
|
-
themeMarginVertical = _ref.themeMarginVertical,
|
|
13839
|
-
theme = _ref.theme;
|
|
13840
|
-
var horizontalMargin = themeMarginHorizontal !== undefined ? {
|
|
13841
|
-
marginHorizontal: theme.__hd__.divider.space[themeMarginHorizontal]
|
|
13842
|
-
} : {};
|
|
13843
|
-
var verticalMargin = themeMarginVertical !== undefined ? {
|
|
13844
|
-
marginVertical: theme.__hd__.divider.space[themeMarginVertical]
|
|
13845
|
-
} : {};
|
|
13846
|
-
return _objectSpread2(_objectSpread2({
|
|
13847
|
-
maxWidth: '100%',
|
|
13848
|
-
borderBottomColor: theme.__hd__.divider.colors["default"],
|
|
13849
|
-
borderBottomWidth: theme.__hd__.divider.borderWidths["default"]
|
|
13850
|
-
}, horizontalMargin), verticalMargin);
|
|
13851
|
-
});
|
|
13852
|
-
|
|
13853
|
-
var _excluded$2 = ["marginHorizontal", "marginVertical", "style", "testID"];
|
|
13854
|
-
|
|
13855
|
-
var Divider = function Divider(_ref) {
|
|
13856
|
-
var marginHorizontal = _ref.marginHorizontal,
|
|
13857
|
-
marginVertical = _ref.marginVertical,
|
|
13858
|
-
style = _ref.style,
|
|
13859
|
-
testID = _ref.testID,
|
|
13860
|
-
nativeProps = _objectWithoutProperties$1(_ref, _excluded$2);
|
|
13861
|
-
|
|
13862
|
-
return /*#__PURE__*/React__default["default"].createElement(StyledDivider, _extends$2({
|
|
13863
|
-
themeMarginHorizontal: marginHorizontal,
|
|
13864
|
-
themeMarginVertical: marginVertical,
|
|
13865
|
-
style: style,
|
|
13866
|
-
testID: testID
|
|
13867
|
-
}, nativeProps));
|
|
13868
14307
|
};
|
|
13869
14308
|
|
|
13870
|
-
var
|
|
14309
|
+
var StyledLoadingIndicatorWrapper = index$2(ReactNative.View)(function (_ref) {
|
|
13871
14310
|
var theme = _ref.theme;
|
|
13872
14311
|
return {
|
|
13873
|
-
|
|
13874
|
-
width: theme.__hd__.fab.sizes.width,
|
|
13875
|
-
backgroundColor: theme.__hd__.fab.colors.buttonBackground,
|
|
13876
|
-
borderRadius: 999,
|
|
13877
|
-
alignItems: 'center',
|
|
14312
|
+
flexDirection: 'row',
|
|
13878
14313
|
justifyContent: 'center',
|
|
13879
|
-
|
|
14314
|
+
alignItems: 'center',
|
|
14315
|
+
paddingVertical: theme.space.xxsmall
|
|
13880
14316
|
};
|
|
13881
14317
|
});
|
|
13882
|
-
var
|
|
13883
|
-
var
|
|
13884
|
-
|
|
13885
|
-
|
|
13886
|
-
|
|
14318
|
+
var StyledLoadingDot = index$2(ReactNative.View)(function (_ref2) {
|
|
14319
|
+
var _ref2$size = _ref2.size,
|
|
14320
|
+
size = _ref2$size === void 0 ? 12 : _ref2$size,
|
|
14321
|
+
themeVariant = _ref2.themeVariant,
|
|
14322
|
+
theme = _ref2.theme;
|
|
14323
|
+
|
|
14324
|
+
var themeStyling = function themeStyling() {
|
|
14325
|
+
switch (themeVariant) {
|
|
14326
|
+
case 'basic-transparent':
|
|
14327
|
+
case 'filled-primary':
|
|
14328
|
+
case 'filled-secondary':
|
|
14329
|
+
return {
|
|
14330
|
+
backgroundColor: theme.__hd__.button.colors.invertedText
|
|
14331
|
+
};
|
|
14332
|
+
|
|
14333
|
+
case 'outlined-primary':
|
|
14334
|
+
return genLoadingIndicatorStyles(theme, 'primary');
|
|
14335
|
+
|
|
14336
|
+
case 'outlined-secondary':
|
|
14337
|
+
return genLoadingIndicatorStyles(theme, 'secondary');
|
|
14338
|
+
}
|
|
13887
14339
|
};
|
|
14340
|
+
|
|
14341
|
+
return _objectSpread2({
|
|
14342
|
+
width: size,
|
|
14343
|
+
height: size,
|
|
14344
|
+
marginTop: theme.space.xsmall,
|
|
14345
|
+
marginBottom: theme.space.xsmall,
|
|
14346
|
+
marginHorizontal: theme.space.small,
|
|
14347
|
+
borderRadius: theme.space.small
|
|
14348
|
+
}, themeStyling());
|
|
13888
14349
|
});
|
|
13889
14350
|
|
|
13890
|
-
var _excluded$
|
|
13891
|
-
var
|
|
14351
|
+
var _excluded$6 = ["count", "size", "testID", "themeVariant"];
|
|
14352
|
+
var AnimatedLoadingIndicatorWrapper = ReactNative.Animated.createAnimatedComponent(StyledLoadingIndicatorWrapper);
|
|
14353
|
+
var AnimatedLoadingDot = ReactNative.Animated.createAnimatedComponent(StyledLoadingDot);
|
|
13892
14354
|
|
|
13893
|
-
var
|
|
13894
|
-
var
|
|
13895
|
-
|
|
14355
|
+
var renderDotComponent = function renderDotComponent(_ref) {
|
|
14356
|
+
var index = _ref.index,
|
|
14357
|
+
size = _ref.size,
|
|
14358
|
+
count = _ref.count,
|
|
14359
|
+
animation = _ref.animation,
|
|
14360
|
+
themeVariant = _ref.themeVariant;
|
|
14361
|
+
var interpolatedProgressAnimation = animation.current.interpolate({
|
|
14362
|
+
inputRange: [0.0, (index + 0.5) / (count + 1), (index + 1.0) / (count + 1), (index + 1.5) / (count + 1), 1.0],
|
|
14363
|
+
outputRange: [1.0, 1.36, 1.56, 1.06, 1.0]
|
|
14364
|
+
});
|
|
14365
|
+
return /*#__PURE__*/React__default["default"].createElement(ReactNative.Animated.View, {
|
|
14366
|
+
style: ReactNative.StyleSheet.flatten([{
|
|
14367
|
+
transform: [{
|
|
14368
|
+
scale: interpolatedProgressAnimation
|
|
14369
|
+
}]
|
|
14370
|
+
}]),
|
|
14371
|
+
key: index
|
|
14372
|
+
}, /*#__PURE__*/React__default["default"].createElement(AnimatedLoadingDot, {
|
|
14373
|
+
size: size,
|
|
14374
|
+
themeVariant: themeVariant
|
|
14375
|
+
}));
|
|
14376
|
+
};
|
|
14377
|
+
|
|
14378
|
+
var LoadingIndicator = function LoadingIndicator(_ref2) {
|
|
14379
|
+
var _ref2$count = _ref2.count,
|
|
14380
|
+
count = _ref2$count === void 0 ? 3 : _ref2$count,
|
|
14381
|
+
_ref2$size = _ref2.size,
|
|
14382
|
+
size = _ref2$size === void 0 ? 12 : _ref2$size,
|
|
14383
|
+
testID = _ref2.testID,
|
|
14384
|
+
themeVariant = _ref2.themeVariant,
|
|
14385
|
+
nativeProps = _objectWithoutProperties$1(_ref2, _excluded$6);
|
|
13896
14386
|
|
|
13897
|
-
var
|
|
14387
|
+
var progressAnimation = React.useRef(new ReactNative.Animated.Value(0));
|
|
13898
14388
|
React.useEffect(function () {
|
|
13899
|
-
var animation =
|
|
13900
|
-
toValue:
|
|
14389
|
+
var animation = ReactNative.Animated.loop(ReactNative.Animated.timing(progressAnimation.current, {
|
|
14390
|
+
toValue: 1,
|
|
14391
|
+
duration: 1200,
|
|
14392
|
+
easing: ReactNative.Easing.linear,
|
|
13901
14393
|
useNativeDriver: true
|
|
13902
|
-
});
|
|
14394
|
+
}));
|
|
13903
14395
|
animation.start();
|
|
13904
14396
|
return function () {
|
|
13905
14397
|
animation.stop();
|
|
13906
14398
|
};
|
|
13907
|
-
}, [
|
|
13908
|
-
|
|
13909
|
-
|
|
13910
|
-
|
|
13911
|
-
|
|
13912
|
-
|
|
13913
|
-
|
|
13914
|
-
|
|
13915
|
-
|
|
13916
|
-
|
|
13917
|
-
|
|
13918
|
-
|
|
14399
|
+
}, []);
|
|
14400
|
+
|
|
14401
|
+
var renderLoadingDot = function renderLoadingDot(item, index) {
|
|
14402
|
+
if (typeof renderDotComponent === 'function') {
|
|
14403
|
+
return renderDotComponent({
|
|
14404
|
+
index: index,
|
|
14405
|
+
count: count,
|
|
14406
|
+
size: size,
|
|
14407
|
+
animation: progressAnimation,
|
|
14408
|
+
themeVariant: themeVariant
|
|
14409
|
+
});
|
|
14410
|
+
}
|
|
14411
|
+
|
|
14412
|
+
return null;
|
|
14413
|
+
};
|
|
14414
|
+
|
|
14415
|
+
return /*#__PURE__*/React__default["default"].createElement(AnimatedLoadingIndicatorWrapper, _extends$3({
|
|
14416
|
+
testID: testID
|
|
14417
|
+
}, nativeProps), Array.from(new Array(count), renderLoadingDot, themeVariant));
|
|
13919
14418
|
};
|
|
13920
14419
|
|
|
13921
|
-
var
|
|
13922
|
-
|
|
13923
|
-
|
|
13924
|
-
animated = _ref.animated,
|
|
13925
|
-
testID = _ref.testID,
|
|
13926
|
-
active = _ref.active,
|
|
13927
|
-
style = _ref.style;
|
|
13928
|
-
return /*#__PURE__*/React__default["default"].createElement(StyledFABContainer, {
|
|
13929
|
-
testID: testID,
|
|
13930
|
-
onPress: onPress,
|
|
13931
|
-
activeOpacity: 0.6,
|
|
13932
|
-
style: style
|
|
13933
|
-
}, animated ? /*#__PURE__*/React__default["default"].createElement(AnimatedFABIcon, {
|
|
13934
|
-
active: active,
|
|
13935
|
-
icon: icon,
|
|
13936
|
-
testID: "animated-fab-icon"
|
|
13937
|
-
}) : /*#__PURE__*/React__default["default"].createElement(StyledFABIcon, {
|
|
13938
|
-
icon: icon,
|
|
13939
|
-
testID: "styled-fab-icon"
|
|
13940
|
-
}));
|
|
14420
|
+
var PRESSED_COLORS = {
|
|
14421
|
+
primary: 'pressedPrimary',
|
|
14422
|
+
secondary: 'pressedSecondary'
|
|
13941
14423
|
};
|
|
13942
14424
|
|
|
13943
|
-
var
|
|
13944
|
-
var
|
|
13945
|
-
|
|
13946
|
-
|
|
13947
|
-
|
|
13948
|
-
|
|
13949
|
-
|
|
13950
|
-
|
|
13951
|
-
|
|
13952
|
-
|
|
13953
|
-
|
|
13954
|
-
flexDirection: 'row',
|
|
13955
|
-
alignItems: 'center',
|
|
13956
|
-
alignSelf: 'flex-end',
|
|
13957
|
-
overflow: 'hidden'
|
|
13958
|
-
};
|
|
13959
|
-
});
|
|
13960
|
-
var StyledActionItemText = index$1(Typography.Text)(function (_ref2) {
|
|
13961
|
-
var theme = _ref2.theme;
|
|
13962
|
-
return {
|
|
13963
|
-
paddingLeft: theme.__hd__.fab.space.actionItemTextPaddingLeft,
|
|
13964
|
-
fontSize: theme.__hd__.fab.fontSizes.actionItemText,
|
|
13965
|
-
lineHeight: theme.__hd__.fab.lineHeights.actionItemText,
|
|
13966
|
-
fontFamily: theme.__hd__.fab.fonts.actionItemText
|
|
14425
|
+
var genBasicTransparentContainerStyles = function genBasicTransparentContainerStyles(theme, pressed, disabled) {
|
|
14426
|
+
var borderColorStyling = function borderColorStyling() {
|
|
14427
|
+
if (disabled) {
|
|
14428
|
+
return {
|
|
14429
|
+
borderColor: theme.__hd__.button.colors.disabledBorder
|
|
14430
|
+
};
|
|
14431
|
+
}
|
|
14432
|
+
|
|
14433
|
+
return {
|
|
14434
|
+
borderColor: theme.__hd__.button.colors.invertedText
|
|
14435
|
+
};
|
|
13967
14436
|
};
|
|
13968
|
-
});
|
|
13969
14437
|
|
|
13970
|
-
|
|
13971
|
-
|
|
13972
|
-
|
|
13973
|
-
|
|
13974
|
-
|
|
13975
|
-
|
|
13976
|
-
|
|
13977
|
-
|
|
13978
|
-
|
|
13979
|
-
|
|
13980
|
-
},
|
|
13981
|
-
icon: icon
|
|
13982
|
-
}), /*#__PURE__*/React__default["default"].createElement(StyledActionItemText, null, title));
|
|
14438
|
+
return _objectSpread2({
|
|
14439
|
+
width: '100%',
|
|
14440
|
+
flexDirection: 'row',
|
|
14441
|
+
justifyContent: 'center',
|
|
14442
|
+
alignItems: 'center',
|
|
14443
|
+
padding: theme.__hd__.button.space.buttonPadding - theme.__hd__.button.borderWidth["default"],
|
|
14444
|
+
borderWidth: theme.__hd__.button.borderWidth["default"],
|
|
14445
|
+
borderRadius: theme.__hd__.button.radii["default"],
|
|
14446
|
+
backgroundColor: 'transparent',
|
|
14447
|
+
opacity: pressed ? 0.6 : 1
|
|
14448
|
+
}, borderColorStyling());
|
|
13983
14449
|
};
|
|
13984
14450
|
|
|
13985
|
-
var
|
|
13986
|
-
|
|
13987
|
-
|
|
13988
|
-
|
|
13989
|
-
|
|
13990
|
-
|
|
13991
|
-
|
|
13992
|
-
|
|
13993
|
-
|
|
13994
|
-
|
|
14451
|
+
var genFilledContainerStyles = function genFilledContainerStyles(theme, intent, pressed, disabled) {
|
|
14452
|
+
var backgroundColorStyling = function backgroundColorStyling() {
|
|
14453
|
+
if (disabled) {
|
|
14454
|
+
return {
|
|
14455
|
+
backgroundColor: theme.__hd__.button.colors.disabledBorder
|
|
14456
|
+
};
|
|
14457
|
+
}
|
|
14458
|
+
|
|
14459
|
+
if (pressed) {
|
|
14460
|
+
return {
|
|
14461
|
+
backgroundColor: theme.__hd__.button.colors[PRESSED_COLORS[intent]]
|
|
14462
|
+
};
|
|
14463
|
+
}
|
|
14464
|
+
|
|
14465
|
+
return {
|
|
14466
|
+
backgroundColor: theme.__hd__.button.colors[intent]
|
|
14467
|
+
};
|
|
14468
|
+
};
|
|
14469
|
+
|
|
14470
|
+
return _objectSpread2({
|
|
14471
|
+
width: '100%',
|
|
14472
|
+
flexDirection: 'row',
|
|
14473
|
+
justifyContent: 'center',
|
|
14474
|
+
alignItems: 'center',
|
|
14475
|
+
padding: theme.__hd__.button.space.buttonPadding,
|
|
14476
|
+
borderRadius: theme.__hd__.button.radii["default"]
|
|
14477
|
+
}, backgroundColorStyling());
|
|
14478
|
+
};
|
|
14479
|
+
|
|
14480
|
+
var genOutlineContainerStyles = function genOutlineContainerStyles(theme, intent, pressed, disabled) {
|
|
14481
|
+
var borderColorStyling = function borderColorStyling() {
|
|
14482
|
+
if (disabled) {
|
|
14483
|
+
return {
|
|
14484
|
+
borderColor: theme.__hd__.button.colors.disabledBorder
|
|
14485
|
+
};
|
|
14486
|
+
}
|
|
14487
|
+
|
|
14488
|
+
if (pressed) {
|
|
14489
|
+
return {
|
|
14490
|
+
borderColor: theme.__hd__.button.colors[PRESSED_COLORS[intent]]
|
|
14491
|
+
};
|
|
14492
|
+
}
|
|
14493
|
+
|
|
14494
|
+
return {
|
|
14495
|
+
borderColor: theme.__hd__.button.colors[intent]
|
|
14496
|
+
};
|
|
14497
|
+
};
|
|
14498
|
+
|
|
14499
|
+
return _objectSpread2({
|
|
14500
|
+
width: '100%',
|
|
14501
|
+
flexDirection: 'row',
|
|
14502
|
+
justifyContent: 'center',
|
|
14503
|
+
alignItems: 'center',
|
|
14504
|
+
padding: theme.__hd__.button.space.buttonPadding - theme.__hd__.button.borderWidth["default"],
|
|
14505
|
+
borderWidth: theme.__hd__.button.borderWidth["default"],
|
|
14506
|
+
borderRadius: theme.__hd__.button.radii["default"],
|
|
14507
|
+
backgroundColor: 'transparent'
|
|
14508
|
+
}, borderColorStyling());
|
|
14509
|
+
};
|
|
14510
|
+
|
|
14511
|
+
var genOutlineTextStyles = function genOutlineTextStyles(theme, intent, pressed, disabled) {
|
|
14512
|
+
var textColorStyling = function textColorStyling() {
|
|
14513
|
+
if (disabled) {
|
|
14514
|
+
return {
|
|
14515
|
+
color: theme.__hd__.button.colors.disabledText
|
|
14516
|
+
};
|
|
14517
|
+
}
|
|
14518
|
+
|
|
14519
|
+
if (pressed) {
|
|
14520
|
+
return {
|
|
14521
|
+
color: theme.__hd__.button.colors[PRESSED_COLORS[intent]]
|
|
14522
|
+
};
|
|
14523
|
+
}
|
|
14524
|
+
|
|
14525
|
+
return {
|
|
14526
|
+
color: theme.__hd__.button.colors[intent]
|
|
14527
|
+
};
|
|
14528
|
+
};
|
|
14529
|
+
|
|
14530
|
+
return _objectSpread2({
|
|
14531
|
+
fontSize: theme.__hd__.button.fontSize["default"],
|
|
14532
|
+
lineHeight: theme.__hd__.button.lineHeight["default"]
|
|
14533
|
+
}, textColorStyling());
|
|
14534
|
+
};
|
|
14535
|
+
|
|
14536
|
+
var StyledButtonContainer = index$2(ReactNative.View)(function (_ref) {
|
|
14537
|
+
var _ref$disabled = _ref.disabled,
|
|
14538
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
14539
|
+
_ref$pressed = _ref.pressed,
|
|
14540
|
+
pressed = _ref$pressed === void 0 ? false : _ref$pressed,
|
|
14541
|
+
themeVariant = _ref.themeVariant,
|
|
14542
|
+
theme = _ref.theme;
|
|
14543
|
+
|
|
14544
|
+
switch (themeVariant) {
|
|
14545
|
+
case 'basic-transparent':
|
|
14546
|
+
return genBasicTransparentContainerStyles(theme, pressed, disabled);
|
|
14547
|
+
|
|
14548
|
+
case 'filled-primary':
|
|
14549
|
+
return genFilledContainerStyles(theme, 'primary', pressed, disabled);
|
|
14550
|
+
|
|
14551
|
+
case 'filled-secondary':
|
|
14552
|
+
return genFilledContainerStyles(theme, 'secondary', pressed, disabled);
|
|
14553
|
+
|
|
14554
|
+
case 'outlined-primary':
|
|
14555
|
+
return genOutlineContainerStyles(theme, 'primary', pressed, disabled);
|
|
14556
|
+
|
|
14557
|
+
case 'outlined-secondary':
|
|
14558
|
+
return genOutlineContainerStyles(theme, 'secondary', pressed, disabled);
|
|
14559
|
+
}
|
|
14560
|
+
});
|
|
14561
|
+
var StyledButtonText = index$2(Typography.Text)(function (_ref2) {
|
|
14562
|
+
var disabled = _ref2.disabled,
|
|
14563
|
+
pressed = _ref2.pressed,
|
|
14564
|
+
themeVariant = _ref2.themeVariant,
|
|
14565
|
+
theme = _ref2.theme;
|
|
14566
|
+
|
|
14567
|
+
var themeStyling = function themeStyling() {
|
|
14568
|
+
switch (themeVariant) {
|
|
14569
|
+
case 'basic-transparent':
|
|
14570
|
+
return {
|
|
14571
|
+
fontSize: theme.__hd__.button.fontSize["default"],
|
|
14572
|
+
lineHeight: theme.__hd__.button.lineHeight["default"],
|
|
14573
|
+
color: disabled ? theme.__hd__.button.colors.disabledText : theme.__hd__.button.colors.invertedText
|
|
14574
|
+
};
|
|
14575
|
+
|
|
14576
|
+
case 'filled-primary':
|
|
14577
|
+
case 'filled-secondary':
|
|
14578
|
+
return {
|
|
14579
|
+
fontSize: theme.__hd__.button.fontSize["default"],
|
|
14580
|
+
lineHeight: theme.__hd__.button.lineHeight["default"],
|
|
14581
|
+
color: theme.__hd__.button.colors.invertedText
|
|
14582
|
+
};
|
|
14583
|
+
|
|
14584
|
+
case 'outlined-primary':
|
|
14585
|
+
return genOutlineTextStyles(theme, 'primary', pressed, disabled);
|
|
14586
|
+
|
|
14587
|
+
case 'outlined-secondary':
|
|
14588
|
+
return genOutlineTextStyles(theme, 'secondary', pressed, disabled);
|
|
14589
|
+
}
|
|
14590
|
+
};
|
|
14591
|
+
|
|
14592
|
+
return _objectSpread2({
|
|
14593
|
+
flexShrink: 1,
|
|
14594
|
+
textAlign: 'center',
|
|
14595
|
+
fontFamily: theme.__hd__.button.fonts["default"]
|
|
14596
|
+
}, themeStyling());
|
|
14597
|
+
});
|
|
14598
|
+
var StyledButtonIconWrapper = index$2(ReactNative.View)(function (_ref3) {
|
|
14599
|
+
var themePosition = _ref3.themePosition,
|
|
14600
|
+
theme = _ref3.theme;
|
|
14601
|
+
|
|
14602
|
+
switch (themePosition) {
|
|
14603
|
+
case 'left':
|
|
14604
|
+
return {
|
|
14605
|
+
paddingRight: theme.__hd__.button.space.iconPadding
|
|
14606
|
+
};
|
|
14607
|
+
|
|
14608
|
+
case 'right':
|
|
14609
|
+
return {
|
|
14610
|
+
paddingLeft: theme.__hd__.button.space.iconPadding
|
|
14611
|
+
};
|
|
14612
|
+
}
|
|
14613
|
+
});
|
|
14614
|
+
var StyledButtonIcon = index$2(Icon)(function (_ref4) {
|
|
14615
|
+
var disabled = _ref4.disabled,
|
|
14616
|
+
pressed = _ref4.pressed,
|
|
14617
|
+
themeVariant = _ref4.themeVariant,
|
|
14618
|
+
theme = _ref4.theme;
|
|
14619
|
+
|
|
14620
|
+
var themeStyling = function themeStyling() {
|
|
14621
|
+
switch (themeVariant) {
|
|
14622
|
+
case 'basic-transparent':
|
|
14623
|
+
return {
|
|
14624
|
+
color: disabled ? theme.__hd__.button.colors.disabledText : theme.__hd__.button.colors.invertedText
|
|
14625
|
+
};
|
|
14626
|
+
|
|
14627
|
+
case 'filled-primary':
|
|
14628
|
+
case 'filled-secondary':
|
|
14629
|
+
return {
|
|
14630
|
+
color: theme.__hd__.button.colors.invertedText
|
|
14631
|
+
};
|
|
14632
|
+
|
|
14633
|
+
case 'outlined-primary':
|
|
14634
|
+
return genOutlineTextStyles(theme, 'primary', pressed, disabled);
|
|
14635
|
+
|
|
14636
|
+
case 'outlined-secondary':
|
|
14637
|
+
return genOutlineTextStyles(theme, 'secondary', pressed, disabled);
|
|
14638
|
+
}
|
|
14639
|
+
};
|
|
14640
|
+
|
|
14641
|
+
return _objectSpread2({
|
|
14642
|
+
fontSize: theme.__hd__.button.sizes.iconSize
|
|
14643
|
+
}, themeStyling());
|
|
14644
|
+
});
|
|
14645
|
+
|
|
14646
|
+
var FILLED_VARIANTS = {
|
|
14647
|
+
primary: 'filled-primary',
|
|
14648
|
+
secondary: 'filled-secondary'
|
|
14649
|
+
};
|
|
14650
|
+
var OUTLINED_VARIANTS = {
|
|
14651
|
+
primary: 'outlined-primary',
|
|
14652
|
+
secondary: 'outlined-secondary'
|
|
14653
|
+
};
|
|
14654
|
+
var getThemeVariant = function getThemeVariant(variant, intent) {
|
|
14655
|
+
switch (variant) {
|
|
14656
|
+
case 'basic-transparent':
|
|
14657
|
+
return variant;
|
|
14658
|
+
|
|
14659
|
+
case 'filled':
|
|
14660
|
+
return FILLED_VARIANTS[intent];
|
|
14661
|
+
|
|
14662
|
+
case 'outlined':
|
|
14663
|
+
return OUTLINED_VARIANTS[intent];
|
|
14664
|
+
}
|
|
14665
|
+
};
|
|
14666
|
+
|
|
14667
|
+
var Button = function Button(_ref) {
|
|
14668
|
+
var accessibilityHint = _ref.accessibilityHint,
|
|
14669
|
+
accessibilityLabel = _ref.accessibilityLabel,
|
|
14670
|
+
_ref$disabled = _ref.disabled,
|
|
14671
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
14672
|
+
icon = _ref.icon,
|
|
14673
|
+
_ref$intent = _ref.intent,
|
|
14674
|
+
intent = _ref$intent === void 0 ? 'primary' : _ref$intent,
|
|
14675
|
+
_ref$loading = _ref.loading,
|
|
14676
|
+
loading = _ref$loading === void 0 ? false : _ref$loading,
|
|
14677
|
+
onPress = _ref.onPress,
|
|
14678
|
+
rightIcon = _ref.rightIcon,
|
|
14679
|
+
style = _ref.style,
|
|
14680
|
+
testID = _ref.testID,
|
|
14681
|
+
text = _ref.text,
|
|
14682
|
+
_ref$variant = _ref.variant,
|
|
14683
|
+
variant = _ref$variant === void 0 ? 'filled' : _ref$variant;
|
|
14684
|
+
return /*#__PURE__*/React__default["default"].createElement(ReactNative.Pressable, {
|
|
14685
|
+
accessibilityHint: accessibilityHint,
|
|
14686
|
+
accessibilityLabel: accessibilityLabel,
|
|
14687
|
+
disabled: disabled || loading,
|
|
14688
|
+
onPress: onPress,
|
|
14689
|
+
testID: testID
|
|
14690
|
+
}, function (_ref2) {
|
|
14691
|
+
var pressed = _ref2.pressed;
|
|
14692
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledButtonContainer, {
|
|
14693
|
+
disabled: disabled,
|
|
14694
|
+
pressed: pressed,
|
|
14695
|
+
style: style,
|
|
14696
|
+
themeVariant: getThemeVariant(variant, intent)
|
|
14697
|
+
}, loading === true ? /*#__PURE__*/React__default["default"].createElement(LoadingIndicator, {
|
|
14698
|
+
testID: "".concat(testID, "-loading-indicator"),
|
|
14699
|
+
themeVariant: getThemeVariant(variant, intent)
|
|
14700
|
+
}) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, icon !== undefined && /*#__PURE__*/React__default["default"].createElement(StyledButtonIconWrapper, {
|
|
14701
|
+
themePosition: "left"
|
|
14702
|
+
}, /*#__PURE__*/React__default["default"].createElement(StyledButtonIcon, {
|
|
14703
|
+
disabled: disabled,
|
|
14704
|
+
icon: icon,
|
|
14705
|
+
pressed: pressed,
|
|
14706
|
+
testID: "".concat(testID, "-left-icon"),
|
|
14707
|
+
themeVariant: getThemeVariant(variant, intent)
|
|
14708
|
+
})), /*#__PURE__*/React__default["default"].createElement(StyledButtonText, {
|
|
14709
|
+
disabled: disabled,
|
|
14710
|
+
ellipsizeMode: "tail",
|
|
14711
|
+
numberOfLines: 1,
|
|
14712
|
+
pressed: pressed,
|
|
14713
|
+
themeVariant: getThemeVariant(variant, intent)
|
|
14714
|
+
}, text), rightIcon !== undefined && /*#__PURE__*/React__default["default"].createElement(StyledButtonIconWrapper, {
|
|
14715
|
+
themePosition: "right"
|
|
14716
|
+
}, /*#__PURE__*/React__default["default"].createElement(StyledButtonIcon, {
|
|
14717
|
+
disabled: disabled,
|
|
14718
|
+
icon: rightIcon,
|
|
14719
|
+
pressed: pressed,
|
|
14720
|
+
testID: "".concat(testID, "-right-icon"),
|
|
14721
|
+
themeVariant: getThemeVariant(variant, intent)
|
|
14722
|
+
}))));
|
|
14723
|
+
});
|
|
14724
|
+
};
|
|
14725
|
+
|
|
14726
|
+
var IconButton = function IconButton(_ref) {
|
|
14727
|
+
var hitSlop = _ref.hitSlop,
|
|
14728
|
+
onPress = _ref.onPress,
|
|
14729
|
+
icon = _ref.icon,
|
|
14730
|
+
testID = _ref.testID,
|
|
14731
|
+
style = _ref.style,
|
|
14732
|
+
size = _ref.size,
|
|
14733
|
+
intent = _ref.intent;
|
|
14734
|
+
return /*#__PURE__*/React__default["default"].createElement(ReactNative.TouchableOpacity, {
|
|
14735
|
+
style: style,
|
|
14736
|
+
onPress: onPress,
|
|
14737
|
+
testID: testID,
|
|
14738
|
+
hitSlop: hitSlop
|
|
14739
|
+
}, /*#__PURE__*/React__default["default"].createElement(Icon, {
|
|
14740
|
+
icon: icon,
|
|
14741
|
+
size: size,
|
|
14742
|
+
intent: intent
|
|
14743
|
+
}));
|
|
14744
|
+
};
|
|
14745
|
+
|
|
14746
|
+
var CompoundButton = Button;
|
|
14747
|
+
CompoundButton.Icon = IconButton;
|
|
14748
|
+
|
|
14749
|
+
var StyledCard = index$2(ReactNative.View)(function (_ref) {
|
|
14750
|
+
var themeVariant = _ref.themeVariant,
|
|
14751
|
+
theme = _ref.theme;
|
|
14752
|
+
var sharedStyles = {
|
|
14753
|
+
borderRadius: theme.__hd__.card.radii["default"],
|
|
14754
|
+
overflow: 'hidden'
|
|
14755
|
+
};
|
|
14756
|
+
var dataStyles = {
|
|
14757
|
+
flex: 1,
|
|
14758
|
+
flexDirection: 'row'
|
|
14759
|
+
};
|
|
14760
|
+
|
|
14761
|
+
switch (themeVariant) {
|
|
14762
|
+
case 'basic':
|
|
14763
|
+
return sharedStyles;
|
|
14764
|
+
|
|
14765
|
+
case 'data':
|
|
14766
|
+
return _objectSpread2(_objectSpread2({}, sharedStyles), dataStyles);
|
|
14767
|
+
}
|
|
14768
|
+
});
|
|
14769
|
+
var LeftDataCard = index$2(ReactNative.View)(function (_ref2) {
|
|
14770
|
+
var theme = _ref2.theme;
|
|
14771
|
+
return {
|
|
14772
|
+
backgroundColor: theme.__hd__.card.colors.dataCardIndicator,
|
|
14773
|
+
width: scale(16),
|
|
14774
|
+
height: '100%'
|
|
14775
|
+
};
|
|
14776
|
+
});
|
|
14777
|
+
|
|
14778
|
+
var _excluded$5 = ["variant", "children"];
|
|
14779
|
+
|
|
14780
|
+
var Card = function Card(_ref) {
|
|
14781
|
+
var _ref$variant = _ref.variant,
|
|
14782
|
+
variant = _ref$variant === void 0 ? 'basic' : _ref$variant,
|
|
14783
|
+
children = _ref.children,
|
|
14784
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$5);
|
|
14785
|
+
|
|
14786
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledCard, _extends$3({}, nativeProps, {
|
|
14787
|
+
themeVariant: variant
|
|
14788
|
+
}), variant === 'data' && /*#__PURE__*/React__default["default"].createElement(LeftDataCard, {
|
|
14789
|
+
testID: "data-card-indicator"
|
|
14790
|
+
}), children);
|
|
14791
|
+
};
|
|
14792
|
+
|
|
14793
|
+
var StyledWrapper$1 = index$2(ReactNative.Animated.View)(function () {
|
|
14794
|
+
return {
|
|
14795
|
+
margin: 0,
|
|
14796
|
+
padding: 0,
|
|
14797
|
+
overflow: 'hidden'
|
|
14798
|
+
};
|
|
14799
|
+
});
|
|
14800
|
+
var StyledChildWrapper = index$2(ReactNative.View)(function () {
|
|
14801
|
+
return {
|
|
14802
|
+
margin: 0,
|
|
14803
|
+
padding: 0
|
|
14804
|
+
};
|
|
14805
|
+
});
|
|
14806
|
+
|
|
14807
|
+
var usePrevious = function usePrevious(value) {
|
|
14808
|
+
var ref = React__default["default"].useRef();
|
|
14809
|
+
React__default["default"].useEffect(function () {
|
|
14810
|
+
ref.current = value;
|
|
14811
|
+
}, [value]);
|
|
14812
|
+
return ref.current;
|
|
14813
|
+
};
|
|
14814
|
+
|
|
14815
|
+
var Collapse = function Collapse(_ref) {
|
|
14816
|
+
var _ref$open = _ref.open,
|
|
14817
|
+
open = _ref$open === void 0 ? false : _ref$open,
|
|
14818
|
+
_ref$keepChildrenMoun = _ref.keepChildrenMounted,
|
|
14819
|
+
keepChildrenMounted = _ref$keepChildrenMoun === void 0 ? false : _ref$keepChildrenMoun,
|
|
14820
|
+
children = _ref.children,
|
|
14821
|
+
testID = _ref.testID,
|
|
14822
|
+
style = _ref.style;
|
|
14823
|
+
var collapseAnim = React__default["default"].useRef(new ReactNative.Animated.Value(0)).current;
|
|
14824
|
+
var innerRef = React__default["default"].useRef(null);
|
|
14825
|
+
|
|
14826
|
+
var _React$useState = React__default["default"].useState(0),
|
|
14827
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
14828
|
+
contentHeight = _React$useState2[0],
|
|
14829
|
+
setContentHeight = _React$useState2[1];
|
|
14830
|
+
|
|
14831
|
+
var _React$useState3 = React__default["default"].useState(0),
|
|
14832
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
14833
|
+
maxHeight = _React$useState4[0],
|
|
14834
|
+
setMaxHeight = _React$useState4[1];
|
|
14835
|
+
|
|
14836
|
+
var _useState = React.useState(false),
|
|
14837
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
14838
|
+
isWaitingToClose = _useState2[0],
|
|
14839
|
+
setIsWaitingToClose = _useState2[1];
|
|
14840
|
+
|
|
14841
|
+
var _useState3 = React.useState('percent'),
|
|
14842
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
14843
|
+
heightSource = _useState4[0],
|
|
14844
|
+
setHeightSource = _useState4[1];
|
|
14845
|
+
|
|
14846
|
+
var previousOpenState = usePrevious(open);
|
|
14847
|
+
var animatedCallback = React.useCallback(function () {
|
|
14848
|
+
if (open === true) {
|
|
14849
|
+
setIsWaitingToClose(true);
|
|
14850
|
+
setMaxHeight(contentHeight);
|
|
14851
|
+
} else {
|
|
14852
|
+
setIsWaitingToClose(false);
|
|
14853
|
+
}
|
|
14854
|
+
}, [open, contentHeight]);
|
|
14855
|
+
React.useEffect(function () {
|
|
14856
|
+
if (open !== previousOpenState && previousOpenState !== undefined) {
|
|
14857
|
+
var useHeightValue = maxHeight || 100;
|
|
14858
|
+
setHeightSource(useHeightValue > 100 ? 'container' : 'percent');
|
|
14859
|
+
ReactNative.Animated.timing(collapseAnim, {
|
|
14860
|
+
toValue: open ? useHeightValue : 0,
|
|
14861
|
+
easing: ReactNative.Easing.inOut(ReactNative.Easing.ease),
|
|
14862
|
+
useNativeDriver: false
|
|
14863
|
+
}).start(animatedCallback);
|
|
14864
|
+
}
|
|
14865
|
+
}, [open, previousOpenState, maxHeight]);
|
|
14866
|
+
var checkMaxHeight = React.useCallback(function (_ref2) {
|
|
14867
|
+
var height = _ref2.height;
|
|
14868
|
+
|
|
14869
|
+
if (height > contentHeight) {
|
|
14870
|
+
setContentHeight(height);
|
|
14871
|
+
}
|
|
14872
|
+
}, [contentHeight]);
|
|
14873
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledWrapper$1, {
|
|
14874
|
+
onLayout: function onLayout(event) {
|
|
14875
|
+
return checkMaxHeight(event.nativeEvent.layout);
|
|
14876
|
+
},
|
|
14877
|
+
style: [style, {
|
|
14878
|
+
maxHeight: heightSource === 'container' ? collapseAnim : collapseAnim.interpolate({
|
|
14879
|
+
inputRange: [0, 100],
|
|
14880
|
+
outputRange: ['0%', '100%']
|
|
14881
|
+
})
|
|
14882
|
+
}],
|
|
14883
|
+
testID: testID
|
|
14884
|
+
}, (keepChildrenMounted === true || open === true || open === false && isWaitingToClose === true) && /*#__PURE__*/React__default["default"].createElement(StyledChildWrapper, {
|
|
14885
|
+
ref: innerRef
|
|
14886
|
+
}, children));
|
|
14887
|
+
};
|
|
14888
|
+
|
|
14889
|
+
var StyledDivider = index$2(ReactNative.View)(function (_ref) {
|
|
14890
|
+
var themeMarginHorizontal = _ref.themeMarginHorizontal,
|
|
14891
|
+
themeMarginVertical = _ref.themeMarginVertical,
|
|
14892
|
+
theme = _ref.theme;
|
|
14893
|
+
var horizontalMargin = themeMarginHorizontal !== undefined ? {
|
|
14894
|
+
marginHorizontal: theme.__hd__.divider.space[themeMarginHorizontal]
|
|
14895
|
+
} : {};
|
|
14896
|
+
var verticalMargin = themeMarginVertical !== undefined ? {
|
|
14897
|
+
marginVertical: theme.__hd__.divider.space[themeMarginVertical]
|
|
14898
|
+
} : {};
|
|
14899
|
+
return _objectSpread2(_objectSpread2({
|
|
14900
|
+
maxWidth: '100%',
|
|
14901
|
+
borderBottomColor: theme.__hd__.divider.colors["default"],
|
|
14902
|
+
borderBottomWidth: theme.__hd__.divider.borderWidths["default"]
|
|
14903
|
+
}, horizontalMargin), verticalMargin);
|
|
14904
|
+
});
|
|
14905
|
+
|
|
14906
|
+
var _excluded$4 = ["marginHorizontal", "marginVertical", "style", "testID"];
|
|
14907
|
+
|
|
14908
|
+
var Divider = function Divider(_ref) {
|
|
14909
|
+
var marginHorizontal = _ref.marginHorizontal,
|
|
14910
|
+
marginVertical = _ref.marginVertical,
|
|
14911
|
+
style = _ref.style,
|
|
14912
|
+
testID = _ref.testID,
|
|
14913
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$4);
|
|
14914
|
+
|
|
14915
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledDivider, _extends$3({}, nativeProps, {
|
|
14916
|
+
themeMarginHorizontal: marginHorizontal,
|
|
14917
|
+
themeMarginVertical: marginVertical,
|
|
14918
|
+
style: style,
|
|
14919
|
+
testID: testID
|
|
14920
|
+
}));
|
|
14921
|
+
};
|
|
14922
|
+
|
|
14923
|
+
var AnimatedPressable = ReactNative.Animated.createAnimatedComponent(ReactNative.Pressable);
|
|
14924
|
+
var StyledContainer$1 = index$2(ReactNative.View)(function (_ref) {
|
|
14925
|
+
var theme = _ref.theme,
|
|
14926
|
+
enableShadow = _ref.enableShadow;
|
|
14927
|
+
return _objectSpread2(_objectSpread2({}, ReactNative.StyleSheet.absoluteFillObject), {}, {
|
|
14928
|
+
shadowColor: enableShadow ? theme.__hd__.drawer.colors.shadow : 'transparent',
|
|
14929
|
+
shadowOffset: theme.__hd__.drawer.shadows.offset,
|
|
14930
|
+
shadowOpacity: theme.__hd__.drawer.shadows.opacity,
|
|
14931
|
+
shadowRadius: theme.__hd__.drawer.shadows.radius,
|
|
14932
|
+
overflow: 'hidden',
|
|
14933
|
+
zIndex: 9999,
|
|
14934
|
+
elevation: 9999
|
|
14935
|
+
});
|
|
14936
|
+
});
|
|
14937
|
+
var StyledBackdrop$1 = index$2(AnimatedPressable)(function (_ref2) {
|
|
14938
|
+
var theme = _ref2.theme;
|
|
14939
|
+
return _objectSpread2(_objectSpread2({}, ReactNative.StyleSheet.absoluteFillObject), {}, {
|
|
14940
|
+
backgroundColor: theme.__hd__.drawer.colors.backdrop
|
|
14941
|
+
});
|
|
14942
|
+
});
|
|
14943
|
+
var StyledDrawerContainer = index$2(ReactNative.Animated.View)(function (_ref3) {
|
|
14944
|
+
var theme = _ref3.theme,
|
|
14945
|
+
enableShadow = _ref3.enableShadow;
|
|
14946
|
+
return {
|
|
14947
|
+
borderBottomLeftRadius: theme.__hd__.drawer.radii["default"],
|
|
14948
|
+
borderBottomRightRadius: theme.__hd__.drawer.radii["default"],
|
|
14949
|
+
backgroundColor: theme.__hd__.drawer.colors.background,
|
|
14950
|
+
elevation: enableShadow ? theme.__hd__.drawer.shadows.elevation : undefined,
|
|
14951
|
+
overflow: 'hidden'
|
|
14952
|
+
};
|
|
14953
|
+
});
|
|
14954
|
+
|
|
14955
|
+
var Drawer = function Drawer(_ref) {
|
|
14956
|
+
var visible = _ref.visible,
|
|
14957
|
+
children = _ref.children,
|
|
14958
|
+
_ref$hasBackdrop = _ref.hasBackdrop,
|
|
14959
|
+
hasBackdrop = _ref$hasBackdrop === void 0 ? true : _ref$hasBackdrop,
|
|
14960
|
+
onDismiss = _ref.onDismiss,
|
|
14961
|
+
testID = _ref.testID;
|
|
14962
|
+
var animatedValue = React.useRef(new ReactNative.Animated.Value(visible ? 1 : 0)).current;
|
|
14963
|
+
|
|
14964
|
+
var _useState = React.useState(0),
|
|
14965
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
14966
|
+
height = _useState2[0],
|
|
14967
|
+
setHeight = _useState2[1];
|
|
14968
|
+
|
|
14969
|
+
var enableShadow = visible && !hasBackdrop;
|
|
14970
|
+
var interpolateTranslateY = animatedValue.interpolate({
|
|
14971
|
+
inputRange: [0, 1],
|
|
14972
|
+
outputRange: [-height, 0]
|
|
14973
|
+
});
|
|
14974
|
+
var interpolateBackdropOpacity = hasBackdrop ? animatedValue.interpolate({
|
|
14975
|
+
inputRange: [0, 1],
|
|
14976
|
+
outputRange: [0, 0.35]
|
|
14977
|
+
}) : 0;
|
|
14978
|
+
React.useEffect(function () {
|
|
14979
|
+
var animation = ReactNative.Animated.timing(animatedValue, {
|
|
14980
|
+
toValue: visible ? 1 : 0,
|
|
14981
|
+
easing: ReactNative.Easing.inOut(ReactNative.Easing.cubic),
|
|
14982
|
+
useNativeDriver: true
|
|
14983
|
+
});
|
|
14984
|
+
animation.start();
|
|
14985
|
+
return function () {
|
|
14986
|
+
return animation.stop();
|
|
14987
|
+
};
|
|
14988
|
+
}, [visible]);
|
|
14989
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledContainer$1, {
|
|
14990
|
+
testID: testID,
|
|
14991
|
+
enableShadow: enableShadow,
|
|
14992
|
+
pointerEvents: "box-none"
|
|
14993
|
+
}, /*#__PURE__*/React__default["default"].createElement(StyledBackdrop$1, {
|
|
14994
|
+
pointerEvents: visible ? 'auto' : 'box-none',
|
|
14995
|
+
onPress: onDismiss,
|
|
14996
|
+
style: {
|
|
14997
|
+
opacity: interpolateBackdropOpacity
|
|
14998
|
+
}
|
|
14999
|
+
}), /*#__PURE__*/React__default["default"].createElement(StyledDrawerContainer, {
|
|
15000
|
+
enableShadow: enableShadow,
|
|
15001
|
+
onLayout: function onLayout(_ref2) {
|
|
15002
|
+
var nativeEvent = _ref2.nativeEvent;
|
|
15003
|
+
return setHeight(nativeEvent.layout.height);
|
|
15004
|
+
},
|
|
15005
|
+
style: {
|
|
15006
|
+
transform: [{
|
|
15007
|
+
translateY: interpolateTranslateY
|
|
15008
|
+
}]
|
|
15009
|
+
}
|
|
15010
|
+
}, children));
|
|
15011
|
+
};
|
|
15012
|
+
|
|
15013
|
+
var StyledFABContainer = index$2(ReactNative.TouchableHighlight)(function (_ref) {
|
|
15014
|
+
var theme = _ref.theme;
|
|
15015
|
+
return {
|
|
15016
|
+
backgroundColor: theme.__hd__.fab.colors.buttonBackground,
|
|
15017
|
+
borderRadius: theme.radii.rounded,
|
|
15018
|
+
alignItems: 'center',
|
|
15019
|
+
justifyContent: 'center',
|
|
15020
|
+
overflow: 'hidden',
|
|
15021
|
+
alignSelf: 'flex-start',
|
|
15022
|
+
paddingHorizontal: theme.__hd__.fab.space.containerPaddingHorizontal,
|
|
15023
|
+
paddingVertical: theme.__hd__.fab.space.containerPaddingVertical,
|
|
15024
|
+
flexDirection: 'row'
|
|
15025
|
+
};
|
|
15026
|
+
});
|
|
15027
|
+
var StyledFABIcon = index$2(Icon)(function (_ref2) {
|
|
15028
|
+
var theme = _ref2.theme;
|
|
15029
|
+
return {
|
|
15030
|
+
color: theme.__hd__.fab.colors.icon,
|
|
15031
|
+
lineHeight: theme.__hd__.fab.lineHeights.icon,
|
|
15032
|
+
textAlignVertical: 'center',
|
|
15033
|
+
textAlign: 'center'
|
|
15034
|
+
};
|
|
15035
|
+
});
|
|
15036
|
+
var StyledFABText = index$2(ReactNative.Text)(function (_ref3) {
|
|
15037
|
+
var theme = _ref3.theme;
|
|
15038
|
+
return {
|
|
15039
|
+
fontFamily: theme.__hd__.fab.fonts.title,
|
|
15040
|
+
fontSize: theme.__hd__.fab.fontSizes.title,
|
|
15041
|
+
lineHeight: theme.__hd__.fab.lineHeights.title,
|
|
15042
|
+
color: theme.__hd__.fab.colors.titleText,
|
|
15043
|
+
textAlignVertical: 'center',
|
|
15044
|
+
textAlign: 'center',
|
|
15045
|
+
marginHorizontal: theme.__hd__.fab.space.titleMarginHorizontal
|
|
15046
|
+
};
|
|
15047
|
+
});
|
|
15048
|
+
|
|
15049
|
+
var _excluded$3 = ["active"];
|
|
15050
|
+
var AnimatedIcons = ReactNative.Animated.createAnimatedComponent(StyledFABIcon);
|
|
15051
|
+
|
|
15052
|
+
var AnimatedFABIcon = function AnimatedFABIcon(_ref) {
|
|
15053
|
+
var active = _ref.active,
|
|
15054
|
+
iconProps = _objectWithoutProperties$1(_ref, _excluded$3);
|
|
15055
|
+
|
|
15056
|
+
var rotateAnimation = React.useRef(new ReactNative.Animated.Value(active ? 1 : 0));
|
|
15057
|
+
React.useEffect(function () {
|
|
15058
|
+
var animation = ReactNative.Animated.timing(rotateAnimation.current, {
|
|
15059
|
+
toValue: active ? 1 : 0,
|
|
15060
|
+
useNativeDriver: true
|
|
15061
|
+
});
|
|
15062
|
+
animation.start();
|
|
15063
|
+
return function () {
|
|
15064
|
+
animation.stop();
|
|
15065
|
+
};
|
|
15066
|
+
}, [active]);
|
|
15067
|
+
var interpolatedRotateAnimation = rotateAnimation.current.interpolate({
|
|
15068
|
+
inputRange: [0, 1],
|
|
15069
|
+
outputRange: ['0deg', '-45deg']
|
|
15070
|
+
});
|
|
15071
|
+
return /*#__PURE__*/React__default["default"].createElement(ReactNative.Animated.View, {
|
|
15072
|
+
style: ReactNative.StyleSheet.flatten([{
|
|
15073
|
+
transform: [{
|
|
15074
|
+
rotate: interpolatedRotateAnimation
|
|
15075
|
+
}]
|
|
15076
|
+
}])
|
|
15077
|
+
}, /*#__PURE__*/React__default["default"].createElement(AnimatedIcons, iconProps));
|
|
15078
|
+
};
|
|
15079
|
+
|
|
15080
|
+
var IconOnlyContent = function IconOnlyContent(_ref) {
|
|
15081
|
+
var icon = _ref.icon,
|
|
15082
|
+
animated = _ref.animated,
|
|
15083
|
+
active = _ref.active;
|
|
15084
|
+
|
|
15085
|
+
if (animated) {
|
|
15086
|
+
return /*#__PURE__*/React__default["default"].createElement(AnimatedFABIcon, {
|
|
15087
|
+
active: active,
|
|
15088
|
+
icon: icon,
|
|
15089
|
+
testID: "animated-fab-icon"
|
|
15090
|
+
});
|
|
15091
|
+
}
|
|
15092
|
+
|
|
15093
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledFABIcon, {
|
|
15094
|
+
icon: icon,
|
|
15095
|
+
testID: "styled-fab-icon"
|
|
15096
|
+
});
|
|
15097
|
+
};
|
|
15098
|
+
|
|
15099
|
+
var IconWithTextContent = function IconWithTextContent(_ref2) {
|
|
15100
|
+
var icon = _ref2.icon,
|
|
15101
|
+
title = _ref2.title;
|
|
15102
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(StyledFABIcon, {
|
|
15103
|
+
size: "xsmall",
|
|
15104
|
+
icon: icon,
|
|
15105
|
+
testID: "styled-fab-icon"
|
|
15106
|
+
}), /*#__PURE__*/React__default["default"].createElement(StyledFABText, null, title));
|
|
15107
|
+
};
|
|
15108
|
+
|
|
15109
|
+
var FAB = function FAB(_ref3) {
|
|
15110
|
+
var onPress = _ref3.onPress,
|
|
15111
|
+
title = _ref3.title,
|
|
15112
|
+
icon = _ref3.icon,
|
|
15113
|
+
animated = _ref3.animated,
|
|
15114
|
+
testID = _ref3.testID,
|
|
15115
|
+
active = _ref3.active,
|
|
15116
|
+
style = _ref3.style;
|
|
15117
|
+
var isIconOnly = !title;
|
|
15118
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledFABContainer, {
|
|
15119
|
+
testID: testID,
|
|
15120
|
+
style: style,
|
|
15121
|
+
onPress: onPress,
|
|
15122
|
+
activeOpacity: 0.6
|
|
15123
|
+
}, isIconOnly ? /*#__PURE__*/React__default["default"].createElement(IconOnlyContent, {
|
|
15124
|
+
animated: animated,
|
|
15125
|
+
active: active,
|
|
15126
|
+
icon: icon
|
|
15127
|
+
}) : /*#__PURE__*/React__default["default"].createElement(IconWithTextContent, {
|
|
15128
|
+
icon: icon,
|
|
15129
|
+
title: title
|
|
15130
|
+
}));
|
|
15131
|
+
};
|
|
15132
|
+
|
|
15133
|
+
var StyledActionItem = index$2(ReactNative.TouchableOpacity)(function (_ref) {
|
|
15134
|
+
var theme = _ref.theme;
|
|
15135
|
+
return {
|
|
15136
|
+
paddingLeft: theme.__hd__.fab.space.actionItemPaddingLeft,
|
|
15137
|
+
paddingRight: theme.__hd__.fab.space.actionItemPaddingRight,
|
|
15138
|
+
paddingTop: theme.__hd__.fab.space.actionItemPaddingTop,
|
|
15139
|
+
paddingBottom: theme.__hd__.fab.space.actionItemPaddingBottom,
|
|
15140
|
+
margin: theme.__hd__.fab.space.actionItemMargin,
|
|
15141
|
+
marginRight: theme.__hd__.fab.space.actionItemMarginRight,
|
|
15142
|
+
backgroundColor: theme.__hd__.fab.colors.actionItemBackground,
|
|
15143
|
+
borderRadius: theme.__hd__.fab.radii.actionItem,
|
|
15144
|
+
flexDirection: 'row',
|
|
15145
|
+
alignItems: 'center',
|
|
15146
|
+
alignSelf: 'flex-end',
|
|
15147
|
+
overflow: 'hidden'
|
|
15148
|
+
};
|
|
15149
|
+
});
|
|
15150
|
+
var StyledActionItemText = index$2(Typography.Text)(function (_ref2) {
|
|
15151
|
+
var theme = _ref2.theme;
|
|
15152
|
+
return {
|
|
15153
|
+
paddingLeft: theme.__hd__.fab.space.actionItemTextPaddingLeft,
|
|
15154
|
+
fontSize: theme.__hd__.fab.fontSizes.actionItemText,
|
|
15155
|
+
lineHeight: theme.__hd__.fab.lineHeights.actionItemText,
|
|
15156
|
+
fontFamily: theme.__hd__.fab.fonts.actionItemText
|
|
15157
|
+
};
|
|
15158
|
+
});
|
|
15159
|
+
|
|
15160
|
+
var ActionItem = function ActionItem(_ref) {
|
|
15161
|
+
var icon = _ref.icon,
|
|
15162
|
+
title = _ref.title,
|
|
15163
|
+
onPress = _ref.onPress,
|
|
15164
|
+
style = _ref.style,
|
|
15165
|
+
testID = _ref.testID;
|
|
15166
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledActionItem, {
|
|
15167
|
+
style: style,
|
|
15168
|
+
onPress: onPress,
|
|
15169
|
+
testID: testID
|
|
15170
|
+
}, /*#__PURE__*/React__default["default"].createElement(Icon, {
|
|
15171
|
+
icon: icon
|
|
15172
|
+
}), /*#__PURE__*/React__default["default"].createElement(StyledActionItemText, null, title));
|
|
15173
|
+
};
|
|
15174
|
+
|
|
15175
|
+
var StyledContainer = index$2(ReactNative.View)({
|
|
15176
|
+
position: 'absolute',
|
|
15177
|
+
left: 0,
|
|
15178
|
+
right: 0,
|
|
15179
|
+
top: 0,
|
|
15180
|
+
bottom: 0,
|
|
15181
|
+
alignItems: 'flex-end',
|
|
15182
|
+
justifyContent: 'flex-end'
|
|
15183
|
+
});
|
|
15184
|
+
var StyledActionGroupContainer = index$2(ReactNative.Animated.View)({
|
|
13995
15185
|
alignItems: 'flex-end',
|
|
13996
15186
|
justifyContent: 'flex-end',
|
|
13997
15187
|
width: '70%'
|
|
13998
15188
|
});
|
|
13999
|
-
var StyledFAB = index$
|
|
14000
|
-
var theme = _ref.theme;
|
|
15189
|
+
var StyledFAB = index$2(FAB)(function (_ref) {
|
|
15190
|
+
var theme = _ref.theme;
|
|
15191
|
+
return {
|
|
15192
|
+
marginRight: theme.__hd__.fab.space.buttonMarginRight,
|
|
15193
|
+
marginTop: theme.__hd__.fab.space.buttonMarginTop,
|
|
15194
|
+
alignSelf: 'flex-end'
|
|
15195
|
+
};
|
|
15196
|
+
});
|
|
15197
|
+
var StyledBackdrop = index$2(ReactNative.Animated.View)(function (_ref2) {
|
|
15198
|
+
var theme = _ref2.theme;
|
|
15199
|
+
return {
|
|
15200
|
+
position: 'absolute',
|
|
15201
|
+
left: 0,
|
|
15202
|
+
right: 0,
|
|
15203
|
+
top: 0,
|
|
15204
|
+
bottom: 0,
|
|
15205
|
+
backgroundColor: theme.__hd__.fab.colors.backdropBackground
|
|
15206
|
+
};
|
|
15207
|
+
});
|
|
15208
|
+
var StyledHeaderText = index$2(Typography.Text)(function (_ref3) {
|
|
15209
|
+
var theme = _ref3.theme;
|
|
15210
|
+
return {
|
|
15211
|
+
fontSize: theme.__hd__.fab.fontSizes.header,
|
|
15212
|
+
lineHeight: theme.__hd__.fab.lineHeights.header,
|
|
15213
|
+
fontFamily: theme.__hd__.fab.fonts.header,
|
|
15214
|
+
marginRight: theme.__hd__.fab.space.headerTextMarginRight,
|
|
15215
|
+
marginBottom: theme.__hd__.fab.space.headerTextMarginBottom,
|
|
15216
|
+
textAlign: 'right'
|
|
15217
|
+
};
|
|
15218
|
+
});
|
|
15219
|
+
|
|
15220
|
+
var ActionItemsListComponent = function ActionItemsListComponent(_ref) {
|
|
15221
|
+
var style = _ref.style,
|
|
15222
|
+
items = _ref.items;
|
|
15223
|
+
return /*#__PURE__*/React__default["default"].createElement(ReactNative.View, {
|
|
15224
|
+
style: style
|
|
15225
|
+
}, items === null || items === void 0 ? void 0 : items.map(function (itemProp) {
|
|
15226
|
+
return /*#__PURE__*/React__default["default"].createElement(ActionItem, _extends$3({
|
|
15227
|
+
key: itemProp.icon
|
|
15228
|
+
}, itemProp));
|
|
15229
|
+
}));
|
|
15230
|
+
};
|
|
15231
|
+
|
|
15232
|
+
var ActionGroup = function ActionGroup(_ref2) {
|
|
15233
|
+
var headerTitle = _ref2.headerTitle,
|
|
15234
|
+
onPress = _ref2.onPress,
|
|
15235
|
+
active = _ref2.active,
|
|
15236
|
+
style = _ref2.style,
|
|
15237
|
+
items = _ref2.items,
|
|
15238
|
+
testID = _ref2.testID,
|
|
15239
|
+
fabTitle = _ref2.fabTitle;
|
|
15240
|
+
var tranlateXAnimation = React.useRef(new ReactNative.Animated.Value(active ? 1 : 0));
|
|
15241
|
+
React.useEffect(function () {
|
|
15242
|
+
var animation = ReactNative.Animated.timing(tranlateXAnimation.current, {
|
|
15243
|
+
toValue: active ? 1 : 0,
|
|
15244
|
+
useNativeDriver: true
|
|
15245
|
+
});
|
|
15246
|
+
animation.start();
|
|
15247
|
+
}, [active]);
|
|
15248
|
+
var interpolatedTranlateXAnimation = tranlateXAnimation.current.interpolate({
|
|
15249
|
+
inputRange: [0, 1],
|
|
15250
|
+
outputRange: [400, 0]
|
|
15251
|
+
});
|
|
15252
|
+
var interpolatedOpacityAnimation = tranlateXAnimation.current.interpolate({
|
|
15253
|
+
inputRange: [0, 1],
|
|
15254
|
+
outputRange: [0, 0.9]
|
|
15255
|
+
});
|
|
15256
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledContainer, {
|
|
15257
|
+
testID: testID,
|
|
15258
|
+
pointerEvents: "box-none",
|
|
15259
|
+
style: style
|
|
15260
|
+
}, /*#__PURE__*/React__default["default"].createElement(StyledBackdrop, {
|
|
15261
|
+
pointerEvents: active ? 'auto' : 'box-none',
|
|
15262
|
+
testID: "back-drop",
|
|
15263
|
+
style: {
|
|
15264
|
+
opacity: interpolatedOpacityAnimation
|
|
15265
|
+
}
|
|
15266
|
+
}), /*#__PURE__*/React__default["default"].createElement(StyledActionGroupContainer, {
|
|
15267
|
+
testID: "action-group",
|
|
15268
|
+
style: {
|
|
15269
|
+
transform: [{
|
|
15270
|
+
translateX: interpolatedTranlateXAnimation
|
|
15271
|
+
}]
|
|
15272
|
+
}
|
|
15273
|
+
}, headerTitle && /*#__PURE__*/React__default["default"].createElement(StyledHeaderText, {
|
|
15274
|
+
testID: "header-text"
|
|
15275
|
+
}, headerTitle), /*#__PURE__*/React__default["default"].createElement(ActionItemsListComponent, {
|
|
15276
|
+
items: items
|
|
15277
|
+
})), /*#__PURE__*/React__default["default"].createElement(StyledFAB, {
|
|
15278
|
+
testID: "fab",
|
|
15279
|
+
icon: "add",
|
|
15280
|
+
onPress: onPress,
|
|
15281
|
+
animated: true,
|
|
15282
|
+
active: active,
|
|
15283
|
+
title: fabTitle
|
|
15284
|
+
}));
|
|
15285
|
+
};
|
|
15286
|
+
|
|
15287
|
+
var index$1 = Object.assign(FAB, {
|
|
15288
|
+
ActionGroup: ActionGroup
|
|
15289
|
+
});
|
|
15290
|
+
|
|
15291
|
+
var HalfCircleWrapper = index$2(ReactNative.View)(function (_ref) {
|
|
15292
|
+
var theme = _ref.theme;
|
|
15293
|
+
return {
|
|
15294
|
+
width: theme.__hd__.progress.sizes.radius,
|
|
15295
|
+
height: theme.__hd__.progress.sizes.radius * 2,
|
|
15296
|
+
overflow: 'hidden'
|
|
15297
|
+
};
|
|
15298
|
+
});
|
|
15299
|
+
var HalfCircleInnerFG = index$2(ReactNative.View)(function (_ref2) {
|
|
15300
|
+
var theme = _ref2.theme,
|
|
15301
|
+
themeIntent = _ref2.themeIntent;
|
|
15302
|
+
return {
|
|
15303
|
+
width: theme.__hd__.progress.sizes.radius * 2,
|
|
15304
|
+
height: theme.__hd__.progress.sizes.radius * 2,
|
|
15305
|
+
backgroundColor: theme.__hd__.progress.colors[themeIntent],
|
|
15306
|
+
borderRadius: theme.__hd__.progress.radii["default"]
|
|
15307
|
+
};
|
|
15308
|
+
});
|
|
15309
|
+
var HalfCircleInnerBG = index$2(ReactNative.View)(function (_ref3) {
|
|
15310
|
+
var theme = _ref3.theme;
|
|
15311
|
+
return {
|
|
15312
|
+
width: theme.__hd__.progress.sizes.radius * 2,
|
|
15313
|
+
height: theme.__hd__.progress.sizes.radius * 2,
|
|
15314
|
+
backgroundColor: theme.__hd__.progress.colors.background,
|
|
15315
|
+
borderRadius: theme.__hd__.progress.radii["default"]
|
|
15316
|
+
};
|
|
15317
|
+
});
|
|
15318
|
+
var DonutCircle = index$2(ReactNative.View)(function (_ref4) {
|
|
15319
|
+
var theme = _ref4.theme;
|
|
15320
|
+
return {
|
|
15321
|
+
position: 'absolute',
|
|
15322
|
+
top: theme.__hd__.progress.sizes.strokeWidth,
|
|
15323
|
+
left: theme.__hd__.progress.sizes.strokeWidth,
|
|
15324
|
+
width: theme.__hd__.progress.sizes.radius * 2 - theme.__hd__.progress.sizes.strokeWidth * 2,
|
|
15325
|
+
height: theme.__hd__.progress.sizes.radius * 2 - theme.__hd__.progress.sizes.strokeWidth * 2,
|
|
15326
|
+
zIndex: 3,
|
|
15327
|
+
backgroundColor: theme.__hd__.progress.colors.innerBackground,
|
|
15328
|
+
borderRadius: theme.__hd__.progress.radii["default"],
|
|
15329
|
+
alignItems: 'center',
|
|
15330
|
+
justifyContent: 'center'
|
|
15331
|
+
};
|
|
15332
|
+
});
|
|
15333
|
+
var StrokeEnd = index$2(ReactNative.View)(function (_ref5) {
|
|
15334
|
+
var theme = _ref5.theme,
|
|
15335
|
+
themeIntent = _ref5.themeIntent;
|
|
15336
|
+
return {
|
|
15337
|
+
position: 'absolute',
|
|
15338
|
+
top: 0,
|
|
15339
|
+
left: theme.__hd__.progress.sizes.radius - theme.__hd__.progress.sizes.strokeWidth / 2,
|
|
15340
|
+
width: theme.__hd__.progress.sizes.strokeWidth,
|
|
15341
|
+
height: theme.__hd__.progress.sizes.strokeWidth,
|
|
15342
|
+
borderRadius: theme.__hd__.progress.radii["default"],
|
|
15343
|
+
backgroundColor: theme.__hd__.progress.colors[themeIntent],
|
|
15344
|
+
zIndex: 2
|
|
15345
|
+
};
|
|
15346
|
+
});
|
|
15347
|
+
|
|
15348
|
+
var _excluded$2 = ["value", "intent", "style", "testID"];
|
|
15349
|
+
|
|
15350
|
+
var HalfCircle = function HalfCircle(_ref) {
|
|
15351
|
+
var type = _ref.type,
|
|
15352
|
+
_ref$themeIntent = _ref.themeIntent,
|
|
15353
|
+
themeIntent = _ref$themeIntent === void 0 ? 'primary' : _ref$themeIntent;
|
|
15354
|
+
return /*#__PURE__*/React__default["default"].createElement(HalfCircleWrapper, null, type === 'background' ? /*#__PURE__*/React__default["default"].createElement(HalfCircleInnerBG, null) : /*#__PURE__*/React__default["default"].createElement(HalfCircleInnerFG, {
|
|
15355
|
+
themeIntent: themeIntent
|
|
15356
|
+
}));
|
|
15357
|
+
};
|
|
15358
|
+
|
|
15359
|
+
var ProgressCircle = function ProgressCircle(_ref2) {
|
|
15360
|
+
var value = _ref2.value,
|
|
15361
|
+
_ref2$intent = _ref2.intent,
|
|
15362
|
+
intent = _ref2$intent === void 0 ? 'primary' : _ref2$intent,
|
|
15363
|
+
style = _ref2.style,
|
|
15364
|
+
testID = _ref2.testID,
|
|
15365
|
+
nativeProps = _objectWithoutProperties$1(_ref2, _excluded$2);
|
|
15366
|
+
|
|
15367
|
+
var theme = useTheme();
|
|
15368
|
+
var radius = theme.__hd__.progress.sizes.radius;
|
|
15369
|
+
var progressAnimatedValue = React.useRef(new ReactNative.Animated.Value(0));
|
|
15370
|
+
React.useEffect(function () {
|
|
15371
|
+
var animation = ReactNative.Animated.timing(progressAnimatedValue.current, {
|
|
15372
|
+
toValue: value,
|
|
15373
|
+
useNativeDriver: true
|
|
15374
|
+
});
|
|
15375
|
+
animation.start();
|
|
15376
|
+
return function () {
|
|
15377
|
+
return animation.stop();
|
|
15378
|
+
};
|
|
15379
|
+
}, [value]); // Animate progress circle: 0% => 50%
|
|
15380
|
+
|
|
15381
|
+
var interpolateRotateRightHalf = progressAnimatedValue.current.interpolate({
|
|
15382
|
+
inputRange: [0, 50],
|
|
15383
|
+
outputRange: ['0deg', '180deg'],
|
|
15384
|
+
extrapolate: 'clamp'
|
|
15385
|
+
});
|
|
15386
|
+
var interpolateOpacityRightHalf = progressAnimatedValue.current.interpolate({
|
|
15387
|
+
inputRange: [50, 51],
|
|
15388
|
+
outputRange: [1, 0],
|
|
15389
|
+
extrapolate: 'clamp'
|
|
15390
|
+
}); // Animate progress circle: 50% => 100%
|
|
15391
|
+
|
|
15392
|
+
var interpolateRotateSecondHalf = progressAnimatedValue.current.interpolate({
|
|
15393
|
+
inputRange: [50, 100],
|
|
15394
|
+
outputRange: ['0deg', '180deg'],
|
|
15395
|
+
extrapolate: 'clamp'
|
|
15396
|
+
}); // Curve at the end of progress stroke
|
|
15397
|
+
|
|
15398
|
+
var interpolateDotRotate = progressAnimatedValue.current.interpolate({
|
|
15399
|
+
inputRange: [0, 100],
|
|
15400
|
+
outputRange: ['0deg', '360deg'],
|
|
15401
|
+
extrapolate: 'clamp'
|
|
15402
|
+
});
|
|
15403
|
+
return /*#__PURE__*/React__default["default"].createElement(ReactNative.View, _extends$3({}, nativeProps, {
|
|
15404
|
+
testID: testID,
|
|
15405
|
+
style: style
|
|
15406
|
+
}), /*#__PURE__*/React__default["default"].createElement(ReactNative.View, {
|
|
15407
|
+
style: {
|
|
15408
|
+
flexDirection: 'row'
|
|
15409
|
+
}
|
|
15410
|
+
}, /*#__PURE__*/React__default["default"].createElement(ReactNative.View, null, /*#__PURE__*/React__default["default"].createElement(HalfCircle, {
|
|
15411
|
+
type: "foreground",
|
|
15412
|
+
themeIntent: intent
|
|
15413
|
+
}), /*#__PURE__*/React__default["default"].createElement(ReactNative.Animated.View, {
|
|
15414
|
+
style: _objectSpread2(_objectSpread2({}, ReactNative.StyleSheet.absoluteFillObject), {}, {
|
|
15415
|
+
transform: [{
|
|
15416
|
+
translateX: radius / 2
|
|
15417
|
+
}, {
|
|
15418
|
+
rotate: interpolateRotateSecondHalf
|
|
15419
|
+
}, {
|
|
15420
|
+
translateX: -radius / 2
|
|
15421
|
+
}]
|
|
15422
|
+
})
|
|
15423
|
+
}, /*#__PURE__*/React__default["default"].createElement(HalfCircle, {
|
|
15424
|
+
type: "background"
|
|
15425
|
+
}))), /*#__PURE__*/React__default["default"].createElement(ReactNative.View, {
|
|
15426
|
+
style: {
|
|
15427
|
+
transform: [{
|
|
15428
|
+
rotate: '180deg'
|
|
15429
|
+
}],
|
|
15430
|
+
zIndex: 1
|
|
15431
|
+
}
|
|
15432
|
+
}, /*#__PURE__*/React__default["default"].createElement(HalfCircle, {
|
|
15433
|
+
type: "foreground",
|
|
15434
|
+
themeIntent: intent
|
|
15435
|
+
}), /*#__PURE__*/React__default["default"].createElement(ReactNative.Animated.View, {
|
|
15436
|
+
style: _objectSpread2(_objectSpread2({}, ReactNative.StyleSheet.absoluteFillObject), {}, {
|
|
15437
|
+
transform: [{
|
|
15438
|
+
translateX: radius / 2
|
|
15439
|
+
}, {
|
|
15440
|
+
rotate: interpolateRotateRightHalf
|
|
15441
|
+
}, {
|
|
15442
|
+
translateX: -radius / 2
|
|
15443
|
+
}],
|
|
15444
|
+
opacity: interpolateOpacityRightHalf
|
|
15445
|
+
})
|
|
15446
|
+
}, /*#__PURE__*/React__default["default"].createElement(HalfCircle, {
|
|
15447
|
+
type: "background"
|
|
15448
|
+
}))), /*#__PURE__*/React__default["default"].createElement(StrokeEnd, {
|
|
15449
|
+
themeIntent: intent
|
|
15450
|
+
}), /*#__PURE__*/React__default["default"].createElement(ReactNative.Animated.View, {
|
|
15451
|
+
style: _objectSpread2(_objectSpread2({}, ReactNative.StyleSheet.absoluteFillObject), {}, {
|
|
15452
|
+
zIndex: 2,
|
|
15453
|
+
transform: [{
|
|
15454
|
+
rotate: interpolateDotRotate
|
|
15455
|
+
}]
|
|
15456
|
+
})
|
|
15457
|
+
}, /*#__PURE__*/React__default["default"].createElement(StrokeEnd, {
|
|
15458
|
+
themeIntent: intent
|
|
15459
|
+
})), /*#__PURE__*/React__default["default"].createElement(DonutCircle, null, /*#__PURE__*/React__default["default"].createElement(Typography.Text, {
|
|
15460
|
+
fontSize: "xlarge"
|
|
15461
|
+
}, "".concat(value, "%")))));
|
|
15462
|
+
};
|
|
15463
|
+
|
|
15464
|
+
var StyledWrapper = index$2(ReactNative.View)(function (_ref) {
|
|
15465
|
+
var theme = _ref.theme;
|
|
15466
|
+
return {
|
|
15467
|
+
height: theme.__hd__.progress.sizes.barHeight,
|
|
15468
|
+
alignSelf: 'stretch',
|
|
15469
|
+
backgroundColor: theme.__hd__.progress.colors.background,
|
|
15470
|
+
overflow: 'hidden'
|
|
15471
|
+
};
|
|
15472
|
+
});
|
|
15473
|
+
var StyledInner = index$2(ReactNative.Animated.View)(function (_ref2) {
|
|
15474
|
+
var theme = _ref2.theme,
|
|
15475
|
+
themeIntent = _ref2.themeIntent;
|
|
15476
|
+
return {
|
|
15477
|
+
flex: 1,
|
|
15478
|
+
alignSelf: 'stretch',
|
|
15479
|
+
backgroundColor: theme.__hd__.progress.colors[themeIntent]
|
|
15480
|
+
};
|
|
15481
|
+
});
|
|
15482
|
+
|
|
15483
|
+
var _excluded$1 = ["value", "intent", "style", "testID"];
|
|
15484
|
+
|
|
15485
|
+
var ProgressBar = function ProgressBar(_ref) {
|
|
15486
|
+
var value = _ref.value,
|
|
15487
|
+
_ref$intent = _ref.intent,
|
|
15488
|
+
intent = _ref$intent === void 0 ? 'primary' : _ref$intent,
|
|
15489
|
+
style = _ref.style,
|
|
15490
|
+
testID = _ref.testID,
|
|
15491
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$1);
|
|
15492
|
+
|
|
15493
|
+
var _useState = React.useState(0),
|
|
15494
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
15495
|
+
width = _useState2[0],
|
|
15496
|
+
setWidth = _useState2[1];
|
|
15497
|
+
|
|
15498
|
+
var progressAnimatedValue = React.useRef(new ReactNative.Animated.Value(0));
|
|
15499
|
+
React.useEffect(function () {
|
|
15500
|
+
var animation = ReactNative.Animated.timing(progressAnimatedValue.current, {
|
|
15501
|
+
toValue: value,
|
|
15502
|
+
useNativeDriver: true
|
|
15503
|
+
});
|
|
15504
|
+
animation.start();
|
|
15505
|
+
return function () {
|
|
15506
|
+
return animation.stop();
|
|
15507
|
+
};
|
|
15508
|
+
}, [value]);
|
|
15509
|
+
var interpolateTranslateX = progressAnimatedValue.current.interpolate({
|
|
15510
|
+
inputRange: [0, 100],
|
|
15511
|
+
outputRange: [-width, 0],
|
|
15512
|
+
extrapolate: 'clamp'
|
|
15513
|
+
});
|
|
15514
|
+
var interpolateBorderRadius = progressAnimatedValue.current.interpolate({
|
|
15515
|
+
inputRange: [99, 100],
|
|
15516
|
+
outputRange: [999, 0],
|
|
15517
|
+
extrapolate: 'clamp'
|
|
15518
|
+
});
|
|
15519
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledWrapper, _extends$3({}, nativeProps, {
|
|
15520
|
+
testID: testID,
|
|
15521
|
+
style: style
|
|
15522
|
+
}), /*#__PURE__*/React__default["default"].createElement(StyledInner, {
|
|
15523
|
+
themeIntent: intent,
|
|
15524
|
+
onLayout: function onLayout(_ref2) {
|
|
15525
|
+
var nativeEvent = _ref2.nativeEvent;
|
|
15526
|
+
return setWidth(nativeEvent.layout.width);
|
|
15527
|
+
},
|
|
15528
|
+
style: {
|
|
15529
|
+
transform: [{
|
|
15530
|
+
translateX: interpolateTranslateX
|
|
15531
|
+
}],
|
|
15532
|
+
borderTopRightRadius: interpolateBorderRadius,
|
|
15533
|
+
borderBottomRightRadius: interpolateBorderRadius
|
|
15534
|
+
}
|
|
15535
|
+
}));
|
|
15536
|
+
};
|
|
15537
|
+
|
|
15538
|
+
var Progress = {
|
|
15539
|
+
Circle: ProgressCircle,
|
|
15540
|
+
Bar: ProgressBar
|
|
15541
|
+
};
|
|
15542
|
+
|
|
15543
|
+
var childrenWithOverriddenStyle = function childrenWithOverriddenStyle(children) {
|
|
15544
|
+
return React.Children.map(children, function (child) {
|
|
15545
|
+
var element = child;
|
|
15546
|
+
return (
|
|
15547
|
+
/*#__PURE__*/
|
|
15548
|
+
// Add a wrapper to ensure layout is calculated correctly
|
|
15549
|
+
React__default["default"].createElement(ReactNative.View, {
|
|
15550
|
+
style: ReactNative.StyleSheet.absoluteFill,
|
|
15551
|
+
collapsable: false
|
|
15552
|
+
}, /*#__PURE__*/React__default["default"].cloneElement(element, _objectSpread2(_objectSpread2({}, element.props), {}, {
|
|
15553
|
+
// Override styles so that each page will fill the parent.
|
|
15554
|
+
style: [element.props.style, ReactNative.StyleSheet.absoluteFill]
|
|
15555
|
+
})))
|
|
15556
|
+
);
|
|
15557
|
+
});
|
|
15558
|
+
};
|
|
15559
|
+
|
|
15560
|
+
var VIEW_MANAGER_NAME = 'RNCViewPager';
|
|
15561
|
+
var PagerViewViewManager = ReactNative.requireNativeComponent(VIEW_MANAGER_NAME);
|
|
15562
|
+
function getViewManagerConfig() {
|
|
15563
|
+
var viewManagerName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : VIEW_MANAGER_NAME;
|
|
15564
|
+
return ReactNative.UIManager.getViewManagerConfig(viewManagerName);
|
|
15565
|
+
}
|
|
15566
|
+
|
|
15567
|
+
function _extends() {
|
|
15568
|
+
_extends = Object.assign || function (target) {
|
|
15569
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
15570
|
+
var source = arguments[i];
|
|
15571
|
+
|
|
15572
|
+
for (var key in source) {
|
|
15573
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
15574
|
+
target[key] = source[key];
|
|
15575
|
+
}
|
|
15576
|
+
}
|
|
15577
|
+
}
|
|
15578
|
+
|
|
15579
|
+
return target;
|
|
15580
|
+
};
|
|
15581
|
+
|
|
15582
|
+
return _extends.apply(this, arguments);
|
|
15583
|
+
}
|
|
15584
|
+
|
|
15585
|
+
function _defineProperty(obj, key, value) {
|
|
15586
|
+
if (key in obj) {
|
|
15587
|
+
Object.defineProperty(obj, key, {
|
|
15588
|
+
value: value,
|
|
15589
|
+
enumerable: true,
|
|
15590
|
+
configurable: true,
|
|
15591
|
+
writable: true
|
|
15592
|
+
});
|
|
15593
|
+
} else {
|
|
15594
|
+
obj[key] = value;
|
|
15595
|
+
}
|
|
15596
|
+
|
|
15597
|
+
return obj;
|
|
15598
|
+
}
|
|
15599
|
+
/**
|
|
15600
|
+
* Container that allows to flip left and right between child views. Each
|
|
15601
|
+
* child view of the `PagerView` will be treated as a separate page
|
|
15602
|
+
* and will be stretched to fill the `PagerView`.
|
|
15603
|
+
*
|
|
15604
|
+
* It is important all children are `<View>`s and not composite components.
|
|
15605
|
+
* You can set style properties like `padding` or `backgroundColor` for each
|
|
15606
|
+
* child. It is also important that each child have a `key` prop.
|
|
15607
|
+
*
|
|
15608
|
+
* Example:
|
|
15609
|
+
*
|
|
15610
|
+
* ```
|
|
15611
|
+
* render: function() {
|
|
15612
|
+
* return (
|
|
15613
|
+
* <PagerView
|
|
15614
|
+
* style={styles.PagerView}
|
|
15615
|
+
* initialPage={0}>
|
|
15616
|
+
* <View style={styles.pageStyle} key="1">
|
|
15617
|
+
* <Text>First page</Text>
|
|
15618
|
+
* </View>
|
|
15619
|
+
* <View style={styles.pageStyle} key="2">
|
|
15620
|
+
* <Text>Second page</Text>
|
|
15621
|
+
* </View>
|
|
15622
|
+
* </PagerView>
|
|
15623
|
+
* );
|
|
15624
|
+
* }
|
|
15625
|
+
*
|
|
15626
|
+
* ...
|
|
15627
|
+
*
|
|
15628
|
+
* var styles = {
|
|
15629
|
+
* ...
|
|
15630
|
+
* PagerView: {
|
|
15631
|
+
* flex: 1
|
|
15632
|
+
* },
|
|
15633
|
+
* pageStyle: {
|
|
15634
|
+
* alignItems: 'center',
|
|
15635
|
+
* padding: 20,
|
|
15636
|
+
* }
|
|
15637
|
+
* }
|
|
15638
|
+
* ```
|
|
15639
|
+
*/
|
|
15640
|
+
|
|
15641
|
+
var PagerView = /*#__PURE__*/function (_React$Component) {
|
|
15642
|
+
_inherits$1(PagerView, _React$Component);
|
|
15643
|
+
|
|
15644
|
+
var _super = _createSuper(PagerView);
|
|
15645
|
+
|
|
15646
|
+
function PagerView() {
|
|
15647
|
+
var _this;
|
|
15648
|
+
|
|
15649
|
+
_classCallCheck$1(this, PagerView);
|
|
15650
|
+
|
|
15651
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
15652
|
+
args[_key] = arguments[_key];
|
|
15653
|
+
}
|
|
15654
|
+
|
|
15655
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
15656
|
+
|
|
15657
|
+
_defineProperty(_assertThisInitialized$1(_this), "isScrolling", false);
|
|
15658
|
+
|
|
15659
|
+
_defineProperty(_assertThisInitialized$1(_this), "PagerView", /*#__PURE__*/React__default["default"].createRef());
|
|
15660
|
+
|
|
15661
|
+
_defineProperty(_assertThisInitialized$1(_this), "getInnerViewNode", function () {
|
|
15662
|
+
return _this.PagerView.current.getInnerViewNode();
|
|
15663
|
+
});
|
|
15664
|
+
|
|
15665
|
+
_defineProperty(_assertThisInitialized$1(_this), "_onPageScroll", function (e) {
|
|
15666
|
+
if (_this.props.onPageScroll) {
|
|
15667
|
+
_this.props.onPageScroll(e);
|
|
15668
|
+
} // Not implemented on iOS yet
|
|
15669
|
+
|
|
15670
|
+
|
|
15671
|
+
if (ReactNative.Platform.OS === 'android') {
|
|
15672
|
+
if (_this.props.keyboardDismissMode === 'on-drag') {
|
|
15673
|
+
ReactNative.Keyboard.dismiss();
|
|
15674
|
+
}
|
|
15675
|
+
}
|
|
15676
|
+
});
|
|
15677
|
+
|
|
15678
|
+
_defineProperty(_assertThisInitialized$1(_this), "_onPageScrollStateChanged", function (e) {
|
|
15679
|
+
if (_this.props.onPageScrollStateChanged) {
|
|
15680
|
+
_this.props.onPageScrollStateChanged(e);
|
|
15681
|
+
}
|
|
15682
|
+
|
|
15683
|
+
_this.isScrolling = e.nativeEvent.pageScrollState === 'dragging';
|
|
15684
|
+
});
|
|
15685
|
+
|
|
15686
|
+
_defineProperty(_assertThisInitialized$1(_this), "_onPageSelected", function (e) {
|
|
15687
|
+
if (_this.props.onPageSelected) {
|
|
15688
|
+
_this.props.onPageSelected(e);
|
|
15689
|
+
}
|
|
15690
|
+
});
|
|
15691
|
+
|
|
15692
|
+
_defineProperty(_assertThisInitialized$1(_this), "setPage", function (selectedPage) {
|
|
15693
|
+
ReactNative.UIManager.dispatchViewManagerCommand(ReactNative__default["default"].findNodeHandle(_assertThisInitialized$1(_this)), getViewManagerConfig().Commands.setPage, [selectedPage]);
|
|
15694
|
+
});
|
|
15695
|
+
|
|
15696
|
+
_defineProperty(_assertThisInitialized$1(_this), "setPageWithoutAnimation", function (selectedPage) {
|
|
15697
|
+
ReactNative.UIManager.dispatchViewManagerCommand(ReactNative__default["default"].findNodeHandle(_assertThisInitialized$1(_this)), getViewManagerConfig().Commands.setPageWithoutAnimation, [selectedPage]);
|
|
15698
|
+
});
|
|
15699
|
+
|
|
15700
|
+
_defineProperty(_assertThisInitialized$1(_this), "setScrollEnabled", function (scrollEnabled) {
|
|
15701
|
+
ReactNative.UIManager.dispatchViewManagerCommand(ReactNative__default["default"].findNodeHandle(_assertThisInitialized$1(_this)), getViewManagerConfig().Commands.setScrollEnabled, [scrollEnabled]);
|
|
15702
|
+
});
|
|
15703
|
+
|
|
15704
|
+
_defineProperty(_assertThisInitialized$1(_this), "_onMoveShouldSetResponderCapture", function () {
|
|
15705
|
+
return _this.isScrolling;
|
|
15706
|
+
});
|
|
15707
|
+
|
|
15708
|
+
return _this;
|
|
15709
|
+
}
|
|
15710
|
+
|
|
15711
|
+
_createClass$1(PagerView, [{
|
|
15712
|
+
key: "deducedLayoutDirection",
|
|
15713
|
+
get: function get() {
|
|
15714
|
+
var shouldUseDeviceRtlSetup = !this.props.layoutDirection || this.props.layoutDirection === 'locale';
|
|
15715
|
+
|
|
15716
|
+
if (shouldUseDeviceRtlSetup) {
|
|
15717
|
+
return ReactNative.I18nManager.isRTL ? 'rtl' : 'ltr';
|
|
15718
|
+
} else {
|
|
15719
|
+
return this.props.layoutDirection;
|
|
15720
|
+
}
|
|
15721
|
+
}
|
|
15722
|
+
}, {
|
|
15723
|
+
key: "render",
|
|
15724
|
+
value: function render() {
|
|
15725
|
+
return /*#__PURE__*/React__default["default"].createElement(PagerViewViewManager, _extends({}, this.props, {
|
|
15726
|
+
ref: this.PagerView
|
|
15727
|
+
/** TODO: Fix ref type */
|
|
15728
|
+
,
|
|
15729
|
+
style: this.props.style,
|
|
15730
|
+
layoutDirection: this.deducedLayoutDirection,
|
|
15731
|
+
onPageScroll: this._onPageScroll,
|
|
15732
|
+
onPageScrollStateChanged: this._onPageScrollStateChanged,
|
|
15733
|
+
onPageSelected: this._onPageSelected,
|
|
15734
|
+
onMoveShouldSetResponderCapture: this._onMoveShouldSetResponderCapture,
|
|
15735
|
+
children: childrenWithOverriddenStyle(this.props.children)
|
|
15736
|
+
}));
|
|
15737
|
+
}
|
|
15738
|
+
}]);
|
|
15739
|
+
|
|
15740
|
+
return PagerView;
|
|
15741
|
+
}(React__default["default"].Component);
|
|
15742
|
+
|
|
15743
|
+
var AnimatedPagerView = ReactNative.Animated.createAnimatedComponent(PagerView);
|
|
15744
|
+
var TabContainer$1 = index$2(ReactNative.View)({
|
|
15745
|
+
flex: 1,
|
|
15746
|
+
overflow: 'hidden'
|
|
15747
|
+
});
|
|
15748
|
+
var HeaderTabWrapper$1 = index$2(ReactNative.View)(function (_ref) {
|
|
15749
|
+
var theme = _ref.theme,
|
|
15750
|
+
themeInsets = _ref.themeInsets;
|
|
14001
15751
|
return {
|
|
14002
|
-
|
|
14003
|
-
|
|
14004
|
-
|
|
15752
|
+
paddingHorizontal: Math.max(themeInsets.left, themeInsets.right),
|
|
15753
|
+
borderBottomColor: theme.__hd__.tabs.colors.headerBottom,
|
|
15754
|
+
borderBottomWidth: theme.__hd__.tabs.borderWidths.headerBottom
|
|
14005
15755
|
};
|
|
14006
15756
|
});
|
|
14007
|
-
var
|
|
15757
|
+
var HeaderTab = index$2(ReactNative.View)({
|
|
15758
|
+
flexDirection: 'row'
|
|
15759
|
+
});
|
|
15760
|
+
var HeaderTabItem$1 = index$2(ReactNative.View)(function (_ref2) {
|
|
14008
15761
|
var theme = _ref2.theme;
|
|
14009
15762
|
return {
|
|
14010
|
-
|
|
14011
|
-
|
|
14012
|
-
|
|
14013
|
-
top: 0,
|
|
14014
|
-
bottom: 0,
|
|
14015
|
-
backgroundColor: theme.__hd__.fab.colors.backdropBackground
|
|
15763
|
+
flex: 1,
|
|
15764
|
+
alignItems: 'center',
|
|
15765
|
+
paddingVertical: theme.__hd__.tabs.space.itemVerticalPadding
|
|
14016
15766
|
};
|
|
14017
15767
|
});
|
|
14018
|
-
var
|
|
14019
|
-
|
|
15768
|
+
var ContentWrapper$1 = index$2(AnimatedPagerView)({
|
|
15769
|
+
flex: 1
|
|
15770
|
+
});
|
|
15771
|
+
var TabScreen$1 = index$2(ReactNative.View)({
|
|
15772
|
+
flex: 1
|
|
15773
|
+
});
|
|
15774
|
+
var StyledIndicator = index$2(ReactNative.Animated.View)(function (_ref3) {
|
|
15775
|
+
var theme = _ref3.theme,
|
|
15776
|
+
themeWidth = _ref3.themeWidth;
|
|
14020
15777
|
return {
|
|
14021
|
-
|
|
14022
|
-
|
|
14023
|
-
|
|
14024
|
-
|
|
14025
|
-
|
|
14026
|
-
textAlign: 'right'
|
|
15778
|
+
width: themeWidth,
|
|
15779
|
+
height: theme.__hd__.tabs.sizes.indicator,
|
|
15780
|
+
backgroundColor: theme.__hd__.tabs.colors.text,
|
|
15781
|
+
position: 'absolute',
|
|
15782
|
+
bottom: 0
|
|
14027
15783
|
};
|
|
14028
15784
|
});
|
|
14029
15785
|
|
|
14030
|
-
var
|
|
14031
|
-
var
|
|
14032
|
-
|
|
14033
|
-
|
|
14034
|
-
|
|
14035
|
-
|
|
14036
|
-
|
|
14037
|
-
|
|
14038
|
-
|
|
14039
|
-
|
|
14040
|
-
};
|
|
14041
|
-
|
|
14042
|
-
var ActionGroup = function ActionGroup(_ref2) {
|
|
14043
|
-
var headerTitle = _ref2.headerTitle,
|
|
14044
|
-
onPress = _ref2.onPress,
|
|
14045
|
-
active = _ref2.active,
|
|
14046
|
-
style = _ref2.style,
|
|
14047
|
-
items = _ref2.items,
|
|
14048
|
-
testID = _ref2.testID;
|
|
14049
|
-
var tranlateXAnimation = React.useRef(new reactNative.Animated.Value(active ? 1 : 0));
|
|
14050
|
-
React.useEffect(function () {
|
|
14051
|
-
var animation = reactNative.Animated.timing(tranlateXAnimation.current, {
|
|
14052
|
-
toValue: active ? 1 : 0,
|
|
14053
|
-
useNativeDriver: true
|
|
14054
|
-
});
|
|
14055
|
-
animation.start();
|
|
14056
|
-
}, [active]);
|
|
14057
|
-
var interpolatedTranlateXAnimation = tranlateXAnimation.current.interpolate({
|
|
14058
|
-
inputRange: [0, 1],
|
|
14059
|
-
outputRange: [400, 0]
|
|
14060
|
-
});
|
|
14061
|
-
var interpolatedOpacityAnimation = tranlateXAnimation.current.interpolate({
|
|
14062
|
-
inputRange: [0, 1],
|
|
14063
|
-
outputRange: [0, 0.9]
|
|
15786
|
+
var ActiveTabIndicator = function ActiveTabIndicator(_ref) {
|
|
15787
|
+
var scrollOffsetAnimatedValue = _ref.scrollOffsetAnimatedValue,
|
|
15788
|
+
positionAnimatedValue = _ref.positionAnimatedValue,
|
|
15789
|
+
tabsLength = _ref.tabsLength,
|
|
15790
|
+
tabsWidth = _ref.tabsWidth;
|
|
15791
|
+
var inputRange = [0, tabsLength];
|
|
15792
|
+
var indicatorWidth = tabsWidth / tabsLength;
|
|
15793
|
+
var translateX = ReactNative.Animated.add(scrollOffsetAnimatedValue, positionAnimatedValue).interpolate({
|
|
15794
|
+
inputRange: inputRange,
|
|
15795
|
+
outputRange: [0, tabsLength * indicatorWidth]
|
|
14064
15796
|
});
|
|
14065
|
-
return /*#__PURE__*/React__default["default"].createElement(
|
|
14066
|
-
|
|
14067
|
-
pointerEvents: "box-none",
|
|
14068
|
-
style: style
|
|
14069
|
-
}, /*#__PURE__*/React__default["default"].createElement(StyledBackdrop, {
|
|
14070
|
-
pointerEvents: active ? 'auto' : 'box-none',
|
|
14071
|
-
testID: "back-drop",
|
|
14072
|
-
style: {
|
|
14073
|
-
opacity: interpolatedOpacityAnimation
|
|
14074
|
-
}
|
|
14075
|
-
}), /*#__PURE__*/React__default["default"].createElement(StyledActionGroupContainer, {
|
|
14076
|
-
testID: "action-group",
|
|
15797
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledIndicator, {
|
|
15798
|
+
themeWidth: indicatorWidth,
|
|
14077
15799
|
style: {
|
|
14078
15800
|
transform: [{
|
|
14079
|
-
translateX:
|
|
15801
|
+
translateX: translateX
|
|
14080
15802
|
}]
|
|
14081
15803
|
}
|
|
14082
|
-
}
|
|
14083
|
-
testID: "header-text"
|
|
14084
|
-
}, headerTitle), /*#__PURE__*/React__default["default"].createElement(ActionItemsListComponent, {
|
|
14085
|
-
items: items
|
|
14086
|
-
})), /*#__PURE__*/React__default["default"].createElement(StyledFAB, {
|
|
14087
|
-
testID: "fab",
|
|
14088
|
-
icon: "add",
|
|
14089
|
-
onPress: onPress,
|
|
14090
|
-
animated: true,
|
|
14091
|
-
active: active
|
|
14092
|
-
}));
|
|
15804
|
+
});
|
|
14093
15805
|
};
|
|
14094
15806
|
|
|
14095
|
-
var
|
|
14096
|
-
|
|
14097
|
-
});
|
|
14098
|
-
|
|
14099
|
-
var TabScreen = index$1(reactNative.View)(function (_ref) {
|
|
14100
|
-
var themeVisibility = _ref.themeVisibility;
|
|
14101
|
-
return {
|
|
14102
|
-
flex: 1,
|
|
14103
|
-
display: themeVisibility === false ? 'none' : 'flex'
|
|
14104
|
-
};
|
|
15807
|
+
var TabScreen = index$2(ReactNative.View)({
|
|
15808
|
+
flex: 1
|
|
14105
15809
|
});
|
|
14106
|
-
var TabContainer = index$
|
|
15810
|
+
var TabContainer = index$2(ReactNative.View)({
|
|
14107
15811
|
flex: 1,
|
|
14108
15812
|
overflow: 'hidden'
|
|
14109
15813
|
});
|
|
14110
|
-
var ContentWrapper = index$
|
|
15814
|
+
var ContentWrapper = index$2(PagerView)({
|
|
14111
15815
|
flex: 1
|
|
14112
15816
|
});
|
|
14113
|
-
var HeaderTabWrapper = index$
|
|
14114
|
-
var
|
|
14115
|
-
|
|
15817
|
+
var HeaderTabWrapper = index$2(ReactNative.View)(function (_ref) {
|
|
15818
|
+
var theme = _ref.theme,
|
|
15819
|
+
themeInsets = _ref.themeInsets;
|
|
14116
15820
|
return {
|
|
14117
|
-
|
|
14118
|
-
|
|
14119
|
-
|
|
15821
|
+
paddingHorizontal: Math.max(themeInsets.left, themeInsets.right),
|
|
15822
|
+
borderBottomColor: theme.__hd__.tabs.colors.headerBottom,
|
|
15823
|
+
borderBottomWidth: theme.__hd__.tabs.borderWidths.headerBottom
|
|
14120
15824
|
};
|
|
14121
15825
|
});
|
|
14122
|
-
var
|
|
14123
|
-
var theme =
|
|
15826
|
+
var HeaderTabItem = index$2(ReactNative.Animated.View)(function (_ref2) {
|
|
15827
|
+
var theme = _ref2.theme;
|
|
14124
15828
|
return {
|
|
14125
|
-
|
|
14126
|
-
|
|
15829
|
+
paddingHorizontal: theme.__hd__.tabs.space.itemHorizontalPadding,
|
|
15830
|
+
paddingVertical: theme.__hd__.tabs.space.itemVerticalPadding
|
|
14127
15831
|
};
|
|
14128
15832
|
});
|
|
14129
|
-
var
|
|
14130
|
-
var theme =
|
|
14131
|
-
return {
|
|
14132
|
-
|
|
14133
|
-
|
|
14134
|
-
|
|
14135
|
-
paddingRight: theme.__hd__.tabs.space.itemHorizontalPadding,
|
|
14136
|
-
paddingTop: theme.__hd__.tabs.space.itemVerticalPadding,
|
|
14137
|
-
paddingBottom: theme.__hd__.tabs.space.itemVerticalPadding
|
|
14138
|
-
};
|
|
15833
|
+
var HeaderTabItemOutlineWrapper = index$2(ReactNative.View)(function (_ref3) {
|
|
15834
|
+
var theme = _ref3.theme;
|
|
15835
|
+
return _objectSpread2({
|
|
15836
|
+
paddingHorizontal: theme.__hd__.tabs.space.itemHorizontalPadding,
|
|
15837
|
+
paddingVertical: theme.__hd__.tabs.space.itemVerticalPadding
|
|
15838
|
+
}, ReactNative.StyleSheet.absoluteFillObject);
|
|
14139
15839
|
});
|
|
14140
|
-
var
|
|
14141
|
-
var
|
|
14142
|
-
|
|
15840
|
+
var HeaderTabItemOutline = index$2(ReactNative.Animated.View)(function (_ref4) {
|
|
15841
|
+
var theme = _ref4.theme,
|
|
15842
|
+
themeActive = _ref4.themeActive;
|
|
14143
15843
|
return {
|
|
14144
|
-
|
|
15844
|
+
borderRadius: theme.__hd__.tabs.radii.outline,
|
|
15845
|
+
backgroundColor: themeActive ? theme.__hd__.tabs.colors.activeBackground : undefined
|
|
14145
15846
|
};
|
|
14146
15847
|
});
|
|
14147
|
-
var
|
|
14148
|
-
var
|
|
14149
|
-
theme = _ref6.theme;
|
|
15848
|
+
var HeaderTabItemWrapper = index$2(ReactNative.View)(function (_ref5) {
|
|
15849
|
+
var theme = _ref5.theme;
|
|
14150
15850
|
return {
|
|
14151
|
-
|
|
14152
|
-
|
|
15851
|
+
paddingHorizontal: theme.__hd__.tabs.space.outlineHorizontalPadding,
|
|
15852
|
+
paddingVertical: theme.__hd__.tabs.space.outlineVerticalPadding
|
|
14153
15853
|
};
|
|
14154
15854
|
});
|
|
14155
15855
|
|
|
14156
|
-
var
|
|
15856
|
+
var useAnimatedValueArray = function useAnimatedValueArray(initialValues) {
|
|
15857
|
+
var refs = React__default["default"].useRef([]);
|
|
15858
|
+
refs.current.length = initialValues.length;
|
|
15859
|
+
initialValues.forEach(function (initialValue, i) {
|
|
15860
|
+
var _refs$current$i;
|
|
14157
15861
|
|
|
14158
|
-
|
|
14159
|
-
|
|
14160
|
-
|
|
14161
|
-
|
|
14162
|
-
selectedTabKey = _ref.selectedTabKey,
|
|
14163
|
-
tabs = _ref.tabs,
|
|
14164
|
-
nativeProps = _objectWithoutProperties$1(_ref, _excluded);
|
|
15862
|
+
refs.current[i] = (_refs$current$i = refs.current[i]) !== null && _refs$current$i !== void 0 ? _refs$current$i : new ReactNative.Animated.Value(initialValue);
|
|
15863
|
+
});
|
|
15864
|
+
return refs.current;
|
|
15865
|
+
};
|
|
14165
15866
|
|
|
14166
|
-
|
|
14167
|
-
var
|
|
14168
|
-
|
|
14169
|
-
|
|
14170
|
-
|
|
15867
|
+
var getTabItem$1 = function getTabItem(_ref) {
|
|
15868
|
+
var item = _ref.item,
|
|
15869
|
+
color = _ref.color,
|
|
15870
|
+
active = _ref.active;
|
|
15871
|
+
|
|
15872
|
+
if (isHeroIcon(item)) {
|
|
15873
|
+
return /*#__PURE__*/React__default["default"].createElement(Icon, {
|
|
15874
|
+
icon: item,
|
|
15875
|
+
testID: "hero-icon-".concat(item),
|
|
15876
|
+
size: "small",
|
|
15877
|
+
intent: active ? 'info' : 'text'
|
|
15878
|
+
});
|
|
15879
|
+
}
|
|
14171
15880
|
|
|
14172
|
-
|
|
14173
|
-
|
|
14174
|
-
|
|
14175
|
-
|
|
15881
|
+
if (typeof item === 'string') {
|
|
15882
|
+
return /*#__PURE__*/React__default["default"].createElement(Typography.Text, {
|
|
15883
|
+
fontWeight: active ? 'semi-bold' : 'regular',
|
|
15884
|
+
numberOfLines: 1,
|
|
15885
|
+
style: {
|
|
15886
|
+
color: color
|
|
15887
|
+
}
|
|
15888
|
+
}, item);
|
|
15889
|
+
}
|
|
14176
15890
|
|
|
14177
|
-
|
|
14178
|
-
|
|
14179
|
-
|
|
14180
|
-
|
|
15891
|
+
return item({
|
|
15892
|
+
color: color
|
|
15893
|
+
});
|
|
15894
|
+
};
|
|
14181
15895
|
|
|
15896
|
+
var ScrollableTab = function ScrollableTab(_ref2) {
|
|
15897
|
+
var onTabPress = _ref2.onTabPress,
|
|
15898
|
+
selectedTabKey = _ref2.selectedTabKey,
|
|
15899
|
+
tabs = _ref2.tabs,
|
|
15900
|
+
containerStyle = _ref2.containerStyle,
|
|
15901
|
+
barStyle = _ref2.barStyle,
|
|
15902
|
+
_ref2$lazy = _ref2.lazy,
|
|
15903
|
+
lazy = _ref2$lazy === void 0 ? false : _ref2$lazy,
|
|
15904
|
+
_ref2$lazyPreloadDist = _ref2.lazyPreloadDistance,
|
|
15905
|
+
lazyPreloadDistance = _ref2$lazyPreloadDist === void 0 ? 1 : _ref2$lazyPreloadDist;
|
|
15906
|
+
var flatListRef = React__default["default"].useRef(null);
|
|
15907
|
+
var pagerViewRef = React__default["default"].useRef(null);
|
|
15908
|
+
var insets = reactNativeSafeAreaContext.useSafeAreaInsets();
|
|
15909
|
+
var theme = useTheme();
|
|
15910
|
+
var selectedTabIndex = tabs.findIndex(function (item) {
|
|
15911
|
+
return item.key === selectedTabKey;
|
|
15912
|
+
});
|
|
15913
|
+
var tabsAnims = useAnimatedValueArray(tabs.map(function (_, i) {
|
|
15914
|
+
return i === selectedTabIndex ? 1 : 0;
|
|
15915
|
+
}));
|
|
15916
|
+
React__default["default"].useEffect(function () {
|
|
14182
15917
|
if (selectedTabIndex !== -1) {
|
|
14183
15918
|
var _flatListRef$current;
|
|
14184
15919
|
|
|
@@ -14187,18 +15922,25 @@ var Tabs = function Tabs(_ref) {
|
|
|
14187
15922
|
viewPosition: 0.5
|
|
14188
15923
|
});
|
|
14189
15924
|
}
|
|
14190
|
-
}, [selectedTabKey, tabs]);
|
|
14191
|
-
|
|
14192
|
-
if (!loaded.includes(selectedTabKey)) {
|
|
14193
|
-
// Set the current tab to be loaded if it was not loaded before
|
|
14194
|
-
setLoaded(function (loadedState) {
|
|
14195
|
-
return [].concat(_toConsumableArray$1(loadedState), [selectedTabKey]);
|
|
14196
|
-
});
|
|
14197
|
-
}
|
|
14198
15925
|
|
|
14199
|
-
|
|
14200
|
-
|
|
14201
|
-
|
|
15926
|
+
var animation = ReactNative.Animated.parallel(_toConsumableArray$1(tabs.map(function (_, i) {
|
|
15927
|
+
return ReactNative.Animated.timing(tabsAnims[i], {
|
|
15928
|
+
toValue: i === selectedTabIndex ? 1 : 0,
|
|
15929
|
+
duration: 150,
|
|
15930
|
+
useNativeDriver: true
|
|
15931
|
+
});
|
|
15932
|
+
})));
|
|
15933
|
+
animation.start();
|
|
15934
|
+
return function () {
|
|
15935
|
+
return animation.stop();
|
|
15936
|
+
};
|
|
15937
|
+
}, [selectedTabIndex]);
|
|
15938
|
+
return /*#__PURE__*/React__default["default"].createElement(TabContainer, {
|
|
15939
|
+
style: containerStyle
|
|
15940
|
+
}, /*#__PURE__*/React__default["default"].createElement(HeaderTabWrapper, {
|
|
15941
|
+
themeInsets: insets,
|
|
15942
|
+
style: barStyle
|
|
15943
|
+
}, /*#__PURE__*/React__default["default"].createElement(ReactNative.FlatList, {
|
|
14202
15944
|
ref: flatListRef,
|
|
14203
15945
|
horizontal: true,
|
|
14204
15946
|
data: tabs,
|
|
@@ -14206,8 +15948,8 @@ var Tabs = function Tabs(_ref) {
|
|
|
14206
15948
|
return String(tab.key);
|
|
14207
15949
|
},
|
|
14208
15950
|
showsHorizontalScrollIndicator: false,
|
|
14209
|
-
onScrollToIndexFailed: function onScrollToIndexFailed(
|
|
14210
|
-
var index =
|
|
15951
|
+
onScrollToIndexFailed: function onScrollToIndexFailed(_ref3) {
|
|
15952
|
+
var index = _ref3.index;
|
|
14211
15953
|
setTimeout(function () {
|
|
14212
15954
|
var _flatListRef$current2;
|
|
14213
15955
|
|
|
@@ -14217,67 +15959,270 @@ var Tabs = function Tabs(_ref) {
|
|
|
14217
15959
|
});
|
|
14218
15960
|
}, 100);
|
|
14219
15961
|
},
|
|
14220
|
-
|
|
14221
|
-
|
|
15962
|
+
contentContainerStyle: {
|
|
15963
|
+
paddingHorizontal: theme.__hd__.tabs.space.flatListHorizontalPadding
|
|
15964
|
+
},
|
|
15965
|
+
renderItem: function renderItem(_ref4) {
|
|
15966
|
+
var tab = _ref4.item,
|
|
15967
|
+
index = _ref4.index;
|
|
14222
15968
|
var key = tab.key,
|
|
14223
|
-
|
|
14224
|
-
|
|
14225
|
-
|
|
15969
|
+
testID = tab.testID,
|
|
15970
|
+
activeItem = tab.activeItem,
|
|
15971
|
+
originalInactiveItem = tab.inactiveItem,
|
|
15972
|
+
_tab$showBadge = tab.showBadge,
|
|
15973
|
+
showBadge = _tab$showBadge === void 0 ? false : _tab$showBadge;
|
|
14226
15974
|
var active = selectedTabKey === key;
|
|
14227
|
-
|
|
15975
|
+
var activeAnimated = tabsAnims[index];
|
|
15976
|
+
var outlineScale = active ? activeAnimated.interpolate({
|
|
15977
|
+
inputRange: [0, 1],
|
|
15978
|
+
outputRange: [0.5, 1]
|
|
15979
|
+
}) : 0;
|
|
15980
|
+
var inactiveItem = originalInactiveItem !== null && originalInactiveItem !== void 0 ? originalInactiveItem : activeItem;
|
|
15981
|
+
var tabItem = getTabItem$1({
|
|
15982
|
+
item: active ? activeItem : inactiveItem,
|
|
15983
|
+
color: active ? theme.__hd__.tabs.colors.active : theme.__hd__.tabs.colors.inactive,
|
|
15984
|
+
active: active
|
|
15985
|
+
});
|
|
15986
|
+
return /*#__PURE__*/React__default["default"].createElement(ReactNative.TouchableWithoutFeedback, {
|
|
14228
15987
|
key: key,
|
|
14229
15988
|
onPress: function onPress() {
|
|
14230
|
-
|
|
15989
|
+
var _pagerViewRef$current;
|
|
15990
|
+
|
|
15991
|
+
onTabPress(key);
|
|
15992
|
+
(_pagerViewRef$current = pagerViewRef.current) === null || _pagerViewRef$current === void 0 ? void 0 : _pagerViewRef$current.setPage(index);
|
|
14231
15993
|
},
|
|
14232
15994
|
testID: testID
|
|
14233
|
-
}, /*#__PURE__*/React__default["default"].createElement(HeaderTabItem, null, /*#__PURE__*/React__default["default"].createElement(
|
|
14234
|
-
|
|
14235
|
-
|
|
14236
|
-
|
|
14237
|
-
|
|
14238
|
-
|
|
14239
|
-
|
|
14240
|
-
|
|
14241
|
-
},
|
|
14242
|
-
|
|
14243
|
-
|
|
15995
|
+
}, /*#__PURE__*/React__default["default"].createElement(HeaderTabItem, null, /*#__PURE__*/React__default["default"].createElement(HeaderTabItemOutlineWrapper, null, /*#__PURE__*/React__default["default"].createElement(HeaderTabItemOutline, {
|
|
15996
|
+
themeActive: active,
|
|
15997
|
+
style: {
|
|
15998
|
+
flex: 1,
|
|
15999
|
+
transform: [{
|
|
16000
|
+
scaleX: outlineScale
|
|
16001
|
+
}]
|
|
16002
|
+
}
|
|
16003
|
+
})), /*#__PURE__*/React__default["default"].createElement(HeaderTabItemWrapper, null, /*#__PURE__*/React__default["default"].createElement(Badge$1.Status, {
|
|
16004
|
+
visible: showBadge
|
|
16005
|
+
}, tabItem))));
|
|
16006
|
+
}
|
|
16007
|
+
})), /*#__PURE__*/React__default["default"].createElement(ContentWrapper, {
|
|
16008
|
+
initialPage: selectedTabIndex,
|
|
16009
|
+
ref: pagerViewRef,
|
|
16010
|
+
onPageSelected: function onPageSelected(e) {
|
|
16011
|
+
var index = e.nativeEvent.position;
|
|
16012
|
+
var selectedItem = tabs[index];
|
|
16013
|
+
|
|
16014
|
+
if (selectedItem) {
|
|
16015
|
+
onTabPress(selectedItem.key);
|
|
16016
|
+
}
|
|
16017
|
+
}
|
|
16018
|
+
}, tabs.map(function (tab, index) {
|
|
14244
16019
|
var key = tab.key,
|
|
14245
16020
|
component = tab.component,
|
|
14246
16021
|
testID = tab.testID;
|
|
14247
16022
|
var active = selectedTabKey === key;
|
|
16023
|
+
var isLazyScreen = lazy && Math.abs(selectedTabIndex - index) > lazyPreloadDistance;
|
|
16024
|
+
return /*#__PURE__*/React__default["default"].createElement(TabScreen, {
|
|
16025
|
+
key: key,
|
|
16026
|
+
testID: testID ? "tab-screen-".concat(testID) : undefined,
|
|
16027
|
+
pointerEvents: active ? 'auto' : 'none',
|
|
16028
|
+
accessibilityElementsHidden: !active,
|
|
16029
|
+
importantForAccessibility: active ? 'auto' : 'no-hide-descendants',
|
|
16030
|
+
collapsable: false
|
|
16031
|
+
}, isLazyScreen ? null : component);
|
|
16032
|
+
})));
|
|
16033
|
+
};
|
|
14248
16034
|
|
|
14249
|
-
|
|
14250
|
-
|
|
14251
|
-
|
|
16035
|
+
var getTabItem = function getTabItem(_ref) {
|
|
16036
|
+
var item = _ref.item,
|
|
16037
|
+
color = _ref.color,
|
|
16038
|
+
active = _ref.active;
|
|
16039
|
+
|
|
16040
|
+
if (typeof item === 'string') {
|
|
16041
|
+
return /*#__PURE__*/React__default["default"].createElement(Typography.Text, {
|
|
16042
|
+
fontWeight: active ? 'semi-bold' : 'regular',
|
|
16043
|
+
numberOfLines: 1,
|
|
16044
|
+
style: {
|
|
16045
|
+
color: color
|
|
16046
|
+
}
|
|
16047
|
+
}, item);
|
|
16048
|
+
}
|
|
14252
16049
|
|
|
14253
|
-
|
|
14254
|
-
|
|
14255
|
-
|
|
16050
|
+
return item({
|
|
16051
|
+
color: color
|
|
16052
|
+
});
|
|
16053
|
+
};
|
|
16054
|
+
|
|
16055
|
+
var Tabs = function Tabs(_ref2) {
|
|
16056
|
+
var onTabPress = _ref2.onTabPress,
|
|
16057
|
+
selectedTabKey = _ref2.selectedTabKey,
|
|
16058
|
+
tabs = _ref2.tabs,
|
|
16059
|
+
containerStyle = _ref2.containerStyle,
|
|
16060
|
+
barStyle = _ref2.barStyle,
|
|
16061
|
+
_ref2$lazy = _ref2.lazy,
|
|
16062
|
+
lazy = _ref2$lazy === void 0 ? false : _ref2$lazy,
|
|
16063
|
+
_ref2$lazyPreloadDist = _ref2.lazyPreloadDistance,
|
|
16064
|
+
lazyPreloadDistance = _ref2$lazyPreloadDist === void 0 ? 1 : _ref2$lazyPreloadDist;
|
|
16065
|
+
var theme = useTheme();
|
|
16066
|
+
var insets = reactNativeSafeAreaContext.useSafeAreaInsets();
|
|
16067
|
+
var pagerViewRef = React__default["default"].useRef(null);
|
|
16068
|
+
var selectedTabIndex = tabs.findIndex(function (item) {
|
|
16069
|
+
return item.key === selectedTabKey;
|
|
16070
|
+
});
|
|
16071
|
+
var scrollOffsetAnimatedValue = React__default["default"].useRef(new ReactNative.Animated.Value(0)).current;
|
|
16072
|
+
var positionAnimatedValue = React__default["default"].useRef(new ReactNative.Animated.Value(0)).current;
|
|
16073
|
+
|
|
16074
|
+
var _React$useState = React__default["default"].useState(0),
|
|
16075
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
16076
|
+
tabsWidth = _React$useState2[0],
|
|
16077
|
+
setTabsWidth = _React$useState2[1];
|
|
16078
|
+
|
|
16079
|
+
return /*#__PURE__*/React__default["default"].createElement(TabContainer$1, {
|
|
16080
|
+
style: containerStyle
|
|
16081
|
+
}, /*#__PURE__*/React__default["default"].createElement(HeaderTabWrapper$1, {
|
|
16082
|
+
themeInsets: insets,
|
|
16083
|
+
style: barStyle
|
|
16084
|
+
}, /*#__PURE__*/React__default["default"].createElement(ReactNative.View, null, /*#__PURE__*/React__default["default"].createElement(HeaderTab, {
|
|
16085
|
+
onLayout: function onLayout(e) {
|
|
16086
|
+
var width = e.nativeEvent.layout.width;
|
|
16087
|
+
|
|
16088
|
+
if (tabsWidth !== width) {
|
|
16089
|
+
setTabsWidth(width);
|
|
16090
|
+
}
|
|
14256
16091
|
}
|
|
16092
|
+
}, tabs.map(function (tab, index) {
|
|
16093
|
+
var key = tab.key,
|
|
16094
|
+
testID = tab.testID,
|
|
16095
|
+
activeItem = tab.activeItem,
|
|
16096
|
+
originalInactiveItem = tab.inactiveItem,
|
|
16097
|
+
_tab$showBadge = tab.showBadge,
|
|
16098
|
+
showBadge = _tab$showBadge === void 0 ? false : _tab$showBadge;
|
|
16099
|
+
var active = selectedTabKey === key;
|
|
16100
|
+
var inactiveItem = originalInactiveItem !== null && originalInactiveItem !== void 0 ? originalInactiveItem : activeItem;
|
|
16101
|
+
var tabItem = getTabItem({
|
|
16102
|
+
item: active ? activeItem : inactiveItem,
|
|
16103
|
+
color: theme.__hd__.tabs.colors.text,
|
|
16104
|
+
active: active
|
|
16105
|
+
});
|
|
16106
|
+
return /*#__PURE__*/React__default["default"].createElement(ReactNative.TouchableWithoutFeedback, {
|
|
16107
|
+
key: key,
|
|
16108
|
+
onPress: function onPress() {
|
|
16109
|
+
var _pagerViewRef$current;
|
|
14257
16110
|
|
|
14258
|
-
|
|
16111
|
+
onTabPress(key);
|
|
16112
|
+
(_pagerViewRef$current = pagerViewRef.current) === null || _pagerViewRef$current === void 0 ? void 0 : _pagerViewRef$current.setPage(index);
|
|
16113
|
+
},
|
|
16114
|
+
testID: testID
|
|
16115
|
+
}, /*#__PURE__*/React__default["default"].createElement(HeaderTabItem$1, null, /*#__PURE__*/React__default["default"].createElement(Badge$1.Status, {
|
|
16116
|
+
visible: showBadge
|
|
16117
|
+
}, tabItem)));
|
|
16118
|
+
})), /*#__PURE__*/React__default["default"].createElement(ActiveTabIndicator, {
|
|
16119
|
+
positionAnimatedValue: positionAnimatedValue,
|
|
16120
|
+
scrollOffsetAnimatedValue: scrollOffsetAnimatedValue,
|
|
16121
|
+
tabsLength: tabs.length,
|
|
16122
|
+
tabsWidth: tabsWidth
|
|
16123
|
+
}))), /*#__PURE__*/React__default["default"].createElement(ContentWrapper$1, {
|
|
16124
|
+
initialPage: selectedTabIndex,
|
|
16125
|
+
ref: pagerViewRef,
|
|
16126
|
+
onPageSelected: function onPageSelected(e) {
|
|
16127
|
+
var index = e.nativeEvent.position;
|
|
16128
|
+
var selectedItem = tabs[index];
|
|
16129
|
+
|
|
16130
|
+
if (selectedItem) {
|
|
16131
|
+
onTabPress(selectedItem.key);
|
|
16132
|
+
}
|
|
16133
|
+
},
|
|
16134
|
+
onPageScroll: ReactNative.Animated.event([{
|
|
16135
|
+
nativeEvent: {
|
|
16136
|
+
offset: scrollOffsetAnimatedValue,
|
|
16137
|
+
position: positionAnimatedValue
|
|
16138
|
+
}
|
|
16139
|
+
}], {
|
|
16140
|
+
useNativeDriver: true
|
|
16141
|
+
})
|
|
16142
|
+
}, tabs.map(function (tab, index) {
|
|
16143
|
+
var key = tab.key,
|
|
16144
|
+
component = tab.component,
|
|
16145
|
+
testID = tab.testID;
|
|
16146
|
+
var active = selectedTabKey === key;
|
|
16147
|
+
var isLazyScreen = lazy && Math.abs(selectedTabIndex - index) > lazyPreloadDistance;
|
|
16148
|
+
return /*#__PURE__*/React__default["default"].createElement(TabScreen$1, {
|
|
14259
16149
|
key: key,
|
|
14260
16150
|
testID: testID ? "tab-screen-".concat(testID) : undefined,
|
|
14261
16151
|
pointerEvents: active ? 'auto' : 'none',
|
|
14262
16152
|
accessibilityElementsHidden: !active,
|
|
14263
16153
|
importantForAccessibility: active ? 'auto' : 'no-hide-descendants',
|
|
14264
|
-
collapsable: false
|
|
14265
|
-
|
|
14266
|
-
// This is an workaround for a bug where the clipped view never re-appears.
|
|
14267
|
-
isIOS ? selectedTabKey !== key : true,
|
|
14268
|
-
themeVisibility: active
|
|
14269
|
-
}, component);
|
|
16154
|
+
collapsable: false
|
|
16155
|
+
}, isLazyScreen ? null : component);
|
|
14270
16156
|
})));
|
|
14271
16157
|
};
|
|
14272
16158
|
|
|
14273
|
-
|
|
16159
|
+
var index = Object.assign(Tabs, {
|
|
16160
|
+
Scroll: ScrollableTab
|
|
16161
|
+
});
|
|
16162
|
+
|
|
16163
|
+
var BACKGROUND_INTENTS = {
|
|
16164
|
+
success: 'successBackground',
|
|
16165
|
+
warning: 'warningBackground',
|
|
16166
|
+
danger: 'dangerBackground',
|
|
16167
|
+
info: 'infoBackground'
|
|
16168
|
+
};
|
|
16169
|
+
var StyledView = index$2(ReactNative.View)(function (_ref) {
|
|
16170
|
+
var themeIntent = _ref.themeIntent,
|
|
16171
|
+
theme = _ref.theme;
|
|
16172
|
+
return {
|
|
16173
|
+
borderWidth: theme.__hd__.tag.borderWidths["default"],
|
|
16174
|
+
borderRadius: theme.__hd__.tag.radii["default"],
|
|
16175
|
+
paddingVertical: theme.__hd__.tag.space.verticalPadding,
|
|
16176
|
+
paddingHorizontal: theme.__hd__.tag.space.horizontalPadding,
|
|
16177
|
+
borderColor: theme.__hd__.tag.colors[themeIntent],
|
|
16178
|
+
backgroundColor: theme.__hd__.tag.colors[BACKGROUND_INTENTS[themeIntent]]
|
|
16179
|
+
};
|
|
16180
|
+
});
|
|
16181
|
+
var StyledText = index$2(ReactNative.Text)(function (_ref2) {
|
|
16182
|
+
var themeIntent = _ref2.themeIntent,
|
|
16183
|
+
theme = _ref2.theme;
|
|
16184
|
+
return {
|
|
16185
|
+
fontFamily: theme.__hd__.tag.fonts["default"],
|
|
16186
|
+
fontSize: theme.__hd__.tag.fontSizes["default"],
|
|
16187
|
+
color: theme.__hd__.tag.colors[themeIntent],
|
|
16188
|
+
includeFontPadding: false,
|
|
16189
|
+
textAlignVertical: 'center',
|
|
16190
|
+
textAlign: 'center'
|
|
16191
|
+
};
|
|
16192
|
+
});
|
|
16193
|
+
|
|
16194
|
+
var _excluded = ["content", "intent", "style", "testID"];
|
|
16195
|
+
|
|
16196
|
+
var Tag = function Tag(_ref) {
|
|
16197
|
+
var content = _ref.content,
|
|
16198
|
+
_ref$intent = _ref.intent,
|
|
16199
|
+
intent = _ref$intent === void 0 ? 'info' : _ref$intent,
|
|
16200
|
+
style = _ref.style,
|
|
16201
|
+
testID = _ref.testID,
|
|
16202
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded);
|
|
16203
|
+
|
|
16204
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledView, _extends$3({}, nativeProps, {
|
|
16205
|
+
themeIntent: intent,
|
|
16206
|
+
style: style,
|
|
16207
|
+
testID: testID
|
|
16208
|
+
}), /*#__PURE__*/React__default["default"].createElement(StyledText, {
|
|
16209
|
+
themeIntent: intent
|
|
16210
|
+
}, content));
|
|
16211
|
+
};
|
|
16212
|
+
|
|
16213
|
+
exports.Avatar = Avatar;
|
|
16214
|
+
exports.Badge = Badge$1;
|
|
14274
16215
|
exports.BottomNavigation = BottomNavigation;
|
|
14275
|
-
exports.Button =
|
|
16216
|
+
exports.Button = CompoundButton;
|
|
14276
16217
|
exports.Card = Card;
|
|
16218
|
+
exports.Collapse = Collapse;
|
|
14277
16219
|
exports.Divider = Divider;
|
|
14278
|
-
exports.
|
|
16220
|
+
exports.Drawer = Drawer;
|
|
16221
|
+
exports.FAB = index$1;
|
|
14279
16222
|
exports.Icon = Icon;
|
|
14280
|
-
exports.
|
|
16223
|
+
exports.Progress = Progress;
|
|
16224
|
+
exports.Tabs = index;
|
|
16225
|
+
exports.Tag = Tag;
|
|
14281
16226
|
exports.ThemeProvider = ThemeProvider;
|
|
14282
16227
|
exports.Typography = Typography;
|
|
14283
16228
|
exports.getTheme = getTheme;
|