@hero-design/rn 7.2.1 → 7.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.expo/packager-info.json +1 -1
- package/.expo/prebuild/cached-packages.json +4 -0
- package/.expo/xcodebuild-error.log +2 -0
- package/.expo/xcodebuild.log +11199 -0
- package/.turbo/turbo-build.log +8 -8
- package/.turbo/turbo-build:types.log +2 -0
- package/.turbo/turbo-test.log +131 -0
- package/.turbo/turbo-type-check.log +7 -0
- package/es/index.js +2393 -457
- package/jest.config.js +1 -1
- package/lib/index.js +2407 -466
- 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 +39 -13
- 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 -5
- package/src/components/Card/__tests__/StyledCard.spec.tsx +15 -3
- package/src/components/Card/__tests__/__snapshots__/StyledCard.spec.tsx.snap +34 -2
- 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 +181 -22
- 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 +5 -5
- 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 +15 -0
- 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/Collapse.d.ts +2 -0
- package/types/playground/components/Drawer.d.ts +2 -0
- package/types/playground/components/IconButton.d.ts +2 -0
- package/types/playground/components/Progress.d.ts +2 -0
- package/types/playground/components/Tag.d.ts +2 -0
- package/types/src/components/Avatar/StyledAvatar.d.ts +46 -0
- package/types/src/components/Avatar/__tests__/StyledAvatar.spec.d.ts +1 -0
- package/types/src/components/Avatar/__tests__/index.spec.d.ts +1 -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__/Status.spec.d.ts +1 -0
- package/types/src/components/Badge/index.d.ts +17 -7
- package/types/src/components/Button/Button.d.ts +57 -0
- package/types/src/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +20 -0
- package/types/src/components/Button/LoadingIndicator/__tests__/StyledLoadingIndicator.spec.d.ts +1 -0
- package/types/src/components/Button/LoadingIndicator/__tests__/index.spec.d.ts +1 -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/Button/__tests__/Button.spec.d.ts +1 -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/index.d.ts +8 -4
- package/types/src/components/Card/StyledCard.d.ts +9 -1
- 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/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/index.d.ts +5 -1
- 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/index.d.ts +2 -2
- package/types/src/components/Icon/utils.d.ts +1 -1
- package/types/src/components/Progress/ProgressBar.d.ts +18 -0
- package/types/src/components/Progress/ProgressCircle.d.ts +18 -0
- package/types/src/components/Progress/StyledProgressBar.d.ts +18 -0
- package/types/src/components/Progress/StyledProgressCircle.d.ts +38 -0
- package/types/src/components/Progress/__tests__/index.spec.d.ts +1 -0
- package/types/src/components/Progress/index.d.ts +5 -0
- package/types/src/components/Progress/types.d.ts +1 -0
- package/types/src/components/Tabs/ActiveTabIndicator.d.ts +8 -0
- package/types/src/components/Tabs/ScrollableTabs.d.ts +3 -0
- package/types/src/components/Tabs/StyledScrollableTabs.d.ts +61 -0
- package/types/src/components/Tabs/StyledTabs.d.ts +22 -22
- package/types/src/components/Tabs/__tests__/ScrollableTabs.spec.d.ts +1 -0
- package/types/src/components/Tabs/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/index.d.ts +6 -1
- 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/button.d.ts +37 -0
- package/types/src/theme/components/card.d.ts +3 -3
- 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/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/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/index.d.ts +10 -0
- package/types/src/utils/hooks.d.ts +1 -0
- package/src/components/Card/__tests__/__snapshots__/index.spec.tsx.snap +0 -34
- package/testUtils/setup.ts +0 -18
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
|
}
|
|
@@ -1449,8 +1558,8 @@ var createCache = function createCache(options) {
|
|
|
1449
1558
|
return cache;
|
|
1450
1559
|
};
|
|
1451
1560
|
|
|
1452
|
-
function _extends$
|
|
1453
|
-
_extends$
|
|
1561
|
+
function _extends$2() {
|
|
1562
|
+
_extends$2 = Object.assign ? Object.assign.bind() : function (target) {
|
|
1454
1563
|
for (var i = 1; i < arguments.length; i++) {
|
|
1455
1564
|
var source = arguments[i];
|
|
1456
1565
|
|
|
@@ -1463,7 +1572,7 @@ function _extends$1() {
|
|
|
1463
1572
|
|
|
1464
1573
|
return target;
|
|
1465
1574
|
};
|
|
1466
|
-
return _extends$
|
|
1575
|
+
return _extends$2.apply(this, arguments);
|
|
1467
1576
|
}
|
|
1468
1577
|
|
|
1469
1578
|
var EmotionCacheContext = /* #__PURE__ */React.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case
|
|
@@ -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,16 +1929,62 @@ 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
|
+
};
|
|
1808
1952
|
var radii = {
|
|
1809
|
-
"default":
|
|
1953
|
+
"default": theme.space.xlarge
|
|
1810
1954
|
};
|
|
1811
|
-
var
|
|
1812
|
-
|
|
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
|
|
1813
1965
|
};
|
|
1814
1966
|
return {
|
|
1967
|
+
borderWidth: borderWidth,
|
|
1968
|
+
fonts: fonts,
|
|
1969
|
+
fontSize: fontSize,
|
|
1970
|
+
sizes: sizes,
|
|
1815
1971
|
radii: radii,
|
|
1816
|
-
|
|
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
|
+
};
|
|
1982
|
+
var radii = {
|
|
1983
|
+
"default": 12
|
|
1984
|
+
};
|
|
1985
|
+
return {
|
|
1986
|
+
colors: colors,
|
|
1987
|
+
radii: radii
|
|
1817
1988
|
};
|
|
1818
1989
|
};
|
|
1819
1990
|
|
|
@@ -1838,21 +2009,98 @@ var getDividerTheme = function getDividerTheme(theme) {
|
|
|
1838
2009
|
};
|
|
1839
2010
|
};
|
|
1840
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
|
+
|
|
1841
2037
|
var getTabsTheme = function getTabsTheme(theme) {
|
|
1842
2038
|
var colors = {
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
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
|
|
1846
2044
|
};
|
|
1847
2045
|
var space = {
|
|
1848
2046
|
flatListHorizontalPadding: theme.space.small,
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
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
|
|
1852
2060
|
};
|
|
1853
2061
|
return {
|
|
2062
|
+
borderWidths: borderWidths,
|
|
1854
2063
|
colors: colors,
|
|
1855
|
-
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
|
|
1856
2104
|
};
|
|
1857
2105
|
};
|
|
1858
2106
|
|
|
@@ -1878,6 +2126,31 @@ var getIconTheme = function getIconTheme(theme) {
|
|
|
1878
2126
|
};
|
|
1879
2127
|
};
|
|
1880
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
|
+
|
|
1881
2154
|
var getTypographyTheme = function getTypographyTheme(theme) {
|
|
1882
2155
|
var colors = {
|
|
1883
2156
|
body: theme.colors.text,
|
|
@@ -1915,7 +2188,8 @@ var getFABTheme = function getFABTheme(theme) {
|
|
|
1915
2188
|
icon: theme.colors.invertedText,
|
|
1916
2189
|
headerText: theme.colors.text,
|
|
1917
2190
|
actionItemBackground: theme.colors.infoLight,
|
|
1918
|
-
backdropBackground: theme.colors.platformBackground
|
|
2191
|
+
backdropBackground: theme.colors.platformBackground,
|
|
2192
|
+
titleText: theme.colors.invertedText
|
|
1919
2193
|
};
|
|
1920
2194
|
var sizes = {
|
|
1921
2195
|
width: 64,
|
|
@@ -1923,16 +2197,19 @@ var getFABTheme = function getFABTheme(theme) {
|
|
|
1923
2197
|
};
|
|
1924
2198
|
var fonts = {
|
|
1925
2199
|
header: theme.fonts.semiBold,
|
|
1926
|
-
actionItemText: theme.fonts.regular
|
|
2200
|
+
actionItemText: theme.fonts.regular,
|
|
2201
|
+
title: theme.fonts.semiBold
|
|
1927
2202
|
};
|
|
1928
2203
|
var fontSizes = {
|
|
1929
2204
|
header: theme.fontSizes.xxxlarge,
|
|
1930
|
-
|
|
1931
|
-
|
|
2205
|
+
actionItemText: theme.fontSizes.medium,
|
|
2206
|
+
title: theme.fontSizes.large
|
|
1932
2207
|
};
|
|
1933
2208
|
var lineHeights = {
|
|
1934
2209
|
header: theme.lineHeights.xxxlarge,
|
|
1935
|
-
actionItemText: theme.lineHeights.medium
|
|
2210
|
+
actionItemText: theme.lineHeights.medium,
|
|
2211
|
+
title: theme.lineHeights.large,
|
|
2212
|
+
icon: theme.lineHeights.large
|
|
1936
2213
|
};
|
|
1937
2214
|
var space = {
|
|
1938
2215
|
actionItemPaddingLeft: theme.space.medium,
|
|
@@ -1945,10 +2222,13 @@ var getFABTheme = function getFABTheme(theme) {
|
|
|
1945
2222
|
buttonMarginTop: theme.space.large,
|
|
1946
2223
|
buttonMarginRight: theme.space.large,
|
|
1947
2224
|
headerTextMarginRight: theme.space.large,
|
|
1948
|
-
headerTextMarginBottom: theme.space.large
|
|
2225
|
+
headerTextMarginBottom: theme.space.large,
|
|
2226
|
+
containerPaddingHorizontal: theme.space.medium,
|
|
2227
|
+
containerPaddingVertical: theme.space.medium,
|
|
2228
|
+
titleMarginHorizontal: theme.space.small
|
|
1949
2229
|
};
|
|
1950
2230
|
var radii = {
|
|
1951
|
-
actionItem:
|
|
2231
|
+
actionItem: theme.radii.rounded
|
|
1952
2232
|
};
|
|
1953
2233
|
return {
|
|
1954
2234
|
radii: radii,
|
|
@@ -1961,18 +2241,61 @@ var getFABTheme = function getFABTheme(theme) {
|
|
|
1961
2241
|
};
|
|
1962
2242
|
};
|
|
1963
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
|
+
|
|
1964
2282
|
var getTheme = function getTheme() {
|
|
1965
2283
|
var scale = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : scale$1;
|
|
1966
2284
|
var systemPallete = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : systemPalette;
|
|
1967
2285
|
var globalTheme = getGlobalTheme(scale, systemPallete);
|
|
1968
2286
|
return _objectSpread2(_objectSpread2({}, globalTheme), {}, {
|
|
1969
2287
|
__hd__: {
|
|
2288
|
+
avatar: getAvatarTheme(globalTheme),
|
|
1970
2289
|
badge: getBadgeTheme(globalTheme),
|
|
1971
2290
|
bottomNavigation: getBottomNavigationTheme(globalTheme),
|
|
2291
|
+
button: getButtonTheme(globalTheme),
|
|
1972
2292
|
card: getCardTheme(globalTheme),
|
|
1973
2293
|
divider: getDividerTheme(globalTheme),
|
|
2294
|
+
drawer: getDrawerTheme(globalTheme),
|
|
2295
|
+
progress: getProgressTheme(globalTheme),
|
|
1974
2296
|
icon: getIconTheme(globalTheme),
|
|
1975
2297
|
tabs: getTabsTheme(globalTheme),
|
|
2298
|
+
tag: getTagTheme(globalTheme),
|
|
1976
2299
|
typography: getTypographyTheme(globalTheme),
|
|
1977
2300
|
fab: getFABTheme(globalTheme)
|
|
1978
2301
|
}
|
|
@@ -3899,65 +4222,241 @@ var getDisplayName = function getDisplayName(primitive) {
|
|
|
3899
4222
|
* a function that returns a styled component which render styles in React Native
|
|
3900
4223
|
*/
|
|
3901
4224
|
|
|
3902
|
-
var styled = createStyled(
|
|
4225
|
+
var styled = createStyled(ReactNative.StyleSheet);
|
|
3903
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'];
|
|
3904
|
-
var index$
|
|
4227
|
+
var index$2 = components.reduce(function (acc, comp) {
|
|
3905
4228
|
return Object.defineProperty(acc, comp, {
|
|
3906
4229
|
enumerable: true,
|
|
3907
4230
|
configurable: false,
|
|
3908
4231
|
get: function get() {
|
|
3909
|
-
return styled(
|
|
4232
|
+
return styled(ReactNative__namespace[comp]);
|
|
3910
4233
|
}
|
|
3911
4234
|
});
|
|
3912
4235
|
}, styled);
|
|
3913
4236
|
|
|
3914
|
-
var
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
danger: 'dangerBackground',
|
|
3918
|
-
info: 'infoBackground'
|
|
3919
|
-
};
|
|
3920
|
-
var StyledView = index$1(reactNative.View)(function (_ref) {
|
|
3921
|
-
var themeIntent = _ref.themeIntent,
|
|
4237
|
+
var StyledPressable = index$2(ReactNative.TouchableOpacity)(function (_ref) {
|
|
4238
|
+
var themeSize = _ref.themeSize,
|
|
4239
|
+
themeIntent = _ref.themeIntent,
|
|
3922
4240
|
theme = _ref.theme;
|
|
3923
4241
|
return {
|
|
3924
|
-
borderWidth: theme.__hd__.
|
|
3925
|
-
borderRadius: theme.__hd__.
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
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'
|
|
3930
4248
|
};
|
|
3931
4249
|
});
|
|
3932
|
-
var
|
|
3933
|
-
var
|
|
4250
|
+
var StyledView$2 = index$2(ReactNative.View)(function (_ref2) {
|
|
4251
|
+
var themeSize = _ref2.themeSize,
|
|
4252
|
+
themeIntent = _ref2.themeIntent,
|
|
3934
4253
|
theme = _ref2.theme;
|
|
3935
4254
|
return {
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
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]
|
|
3939
4288
|
};
|
|
3940
4289
|
});
|
|
3941
4290
|
|
|
3942
|
-
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
|
+
};
|
|
3943
4317
|
|
|
3944
|
-
var
|
|
3945
|
-
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,
|
|
3946
4363
|
_ref$intent = _ref.intent,
|
|
3947
|
-
intent = _ref$intent === void 0 ? '
|
|
4364
|
+
intent = _ref$intent === void 0 ? 'danger' : _ref$intent,
|
|
3948
4365
|
style = _ref.style,
|
|
3949
4366
|
testID = _ref.testID,
|
|
3950
|
-
nativeProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
4367
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$a);
|
|
3951
4368
|
|
|
3952
|
-
|
|
3953
|
-
|
|
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, {
|
|
3954
4387
|
style: style,
|
|
3955
4388
|
testID: testID
|
|
3956
|
-
},
|
|
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
|
+
},
|
|
3957
4399
|
themeIntent: intent
|
|
3958
|
-
}
|
|
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));
|
|
3959
4454
|
};
|
|
3960
4455
|
|
|
4456
|
+
var Badge$1 = Object.assign(Badge, {
|
|
4457
|
+
Status: Status
|
|
4458
|
+
});
|
|
4459
|
+
|
|
3961
4460
|
var dist = {};
|
|
3962
4461
|
|
|
3963
4462
|
function _interopRequireDefault$5(obj) {
|
|
@@ -4709,8 +5208,8 @@ var runtime = {exports: {}};
|
|
|
4709
5208
|
|
|
4710
5209
|
var regenerator = runtime.exports;
|
|
4711
5210
|
|
|
4712
|
-
function _extends() {
|
|
4713
|
-
_extends_1 = _extends = Object.assign || function (target) {
|
|
5211
|
+
function _extends$1() {
|
|
5212
|
+
_extends_1 = _extends$1 = Object.assign || function (target) {
|
|
4714
5213
|
for (var i = 1; i < arguments.length; i++) {
|
|
4715
5214
|
var source = arguments[i];
|
|
4716
5215
|
|
|
@@ -4724,10 +5223,10 @@ function _extends() {
|
|
|
4724
5223
|
return target;
|
|
4725
5224
|
};
|
|
4726
5225
|
|
|
4727
|
-
return _extends.apply(this, arguments);
|
|
5226
|
+
return _extends$1.apply(this, arguments);
|
|
4728
5227
|
}
|
|
4729
5228
|
|
|
4730
|
-
var _extends_1 = _extends;
|
|
5229
|
+
var _extends_1 = _extends$1;
|
|
4731
5230
|
|
|
4732
5231
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
4733
5232
|
if (source == null) return {};
|
|
@@ -4979,7 +5478,7 @@ Object.defineProperty(ensureNativeModuleAvailable$1, "__esModule", {
|
|
|
4979
5478
|
|
|
4980
5479
|
ensureNativeModuleAvailable$1["default"] = ensureNativeModuleAvailable;
|
|
4981
5480
|
|
|
4982
|
-
var _reactNative$2 =
|
|
5481
|
+
var _reactNative$2 = ReactNative__default["default"];
|
|
4983
5482
|
var NativeIconAPI$1 = _reactNative$2.NativeModules.RNVectorIconsManager || _reactNative$2.NativeModules.RNVectorIconsModule;
|
|
4984
5483
|
|
|
4985
5484
|
function ensureNativeModuleAvailable() {
|
|
@@ -5107,7 +5606,7 @@ var _react$2 = _interopRequireWildcard$2(React__default["default"]);
|
|
|
5107
5606
|
|
|
5108
5607
|
var _propTypes$2 = _interopRequireDefault$4(propTypes.exports);
|
|
5109
5608
|
|
|
5110
|
-
var _reactNative$1 =
|
|
5609
|
+
var _reactNative$1 = ReactNative__default["default"];
|
|
5111
5610
|
var _objectUtils = objectUtils;
|
|
5112
5611
|
var _jsxFileName$2 = "/home/runner/work/react-native-vector-icons/react-native-vector-icons/lib/icon-button.js";
|
|
5113
5612
|
|
|
@@ -5289,7 +5788,7 @@ var _react$1 = _interopRequireWildcard$1(React__default["default"]);
|
|
|
5289
5788
|
|
|
5290
5789
|
var _propTypes$1 = _interopRequireDefault$3(propTypes.exports);
|
|
5291
5790
|
|
|
5292
|
-
var _reactNative =
|
|
5791
|
+
var _reactNative = ReactNative__default["default"];
|
|
5293
5792
|
|
|
5294
5793
|
var _ensureNativeModuleAvailable = _interopRequireDefault$3(ensureNativeModuleAvailable$1);
|
|
5295
5794
|
|
|
@@ -5604,7 +6103,7 @@ function createIconSet(glyphMap, fontFamily, fontFile, fontStyle) {
|
|
|
5604
6103
|
|
|
5605
6104
|
var createMultiStyleIconSet$1 = {};
|
|
5606
6105
|
|
|
5607
|
-
function _defineProperty(obj, key, value) {
|
|
6106
|
+
function _defineProperty$1(obj, key, value) {
|
|
5608
6107
|
if (key in obj) {
|
|
5609
6108
|
Object.defineProperty(obj, key, {
|
|
5610
6109
|
value: value,
|
|
@@ -5619,7 +6118,7 @@ function _defineProperty(obj, key, value) {
|
|
|
5619
6118
|
return obj;
|
|
5620
6119
|
}
|
|
5621
6120
|
|
|
5622
|
-
var defineProperty = _defineProperty;
|
|
6121
|
+
var defineProperty = _defineProperty$1;
|
|
5623
6122
|
|
|
5624
6123
|
var _interopRequireDefault$2 = interopRequireDefault;
|
|
5625
6124
|
Object.defineProperty(createMultiStyleIconSet$1, "__esModule", {
|
|
@@ -13587,7 +14086,7 @@ var heroIconConfig = {
|
|
|
13587
14086
|
};
|
|
13588
14087
|
|
|
13589
14088
|
var HeroIcon = dist.createIconSetFromIcoMoon(heroIconConfig, 'hero-icons', 'hero-icons.ttf');
|
|
13590
|
-
var StyledHeroIcon = index$
|
|
14089
|
+
var StyledHeroIcon = index$2(HeroIcon)(function (_ref) {
|
|
13591
14090
|
var themeIntent = _ref.themeIntent,
|
|
13592
14091
|
themeSize = _ref.themeSize,
|
|
13593
14092
|
theme = _ref.theme;
|
|
@@ -13625,7 +14124,7 @@ var FONTWEIGHT_MAP = {
|
|
|
13625
14124
|
regular: 'regular',
|
|
13626
14125
|
'semi-bold': 'semiBold'
|
|
13627
14126
|
};
|
|
13628
|
-
var StyledText = index$
|
|
14127
|
+
var StyledText$1 = index$2(ReactNative.Text)(function (_ref) {
|
|
13629
14128
|
var themeFontSize = _ref.themeFontSize,
|
|
13630
14129
|
themeFontWeight = _ref.themeFontWeight,
|
|
13631
14130
|
themeIntent = _ref.themeIntent,
|
|
@@ -13641,7 +14140,7 @@ var StyledText = index$1(reactNative.Text)(function (_ref) {
|
|
|
13641
14140
|
});
|
|
13642
14141
|
});
|
|
13643
14142
|
|
|
13644
|
-
var _excluded$
|
|
14143
|
+
var _excluded$8 = ["children", "fontSize", "fontWeight", "intent"];
|
|
13645
14144
|
|
|
13646
14145
|
var Text = function Text(_ref) {
|
|
13647
14146
|
var children = _ref.children,
|
|
@@ -13651,34 +14150,34 @@ var Text = function Text(_ref) {
|
|
|
13651
14150
|
fontWeight = _ref$fontWeight === void 0 ? 'regular' : _ref$fontWeight,
|
|
13652
14151
|
_ref$intent = _ref.intent,
|
|
13653
14152
|
intent = _ref$intent === void 0 ? 'body' : _ref$intent,
|
|
13654
|
-
nativeProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
14153
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$8);
|
|
13655
14154
|
|
|
13656
|
-
return /*#__PURE__*/React__default["default"].createElement(StyledText, _extends$
|
|
14155
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledText$1, _extends$3({}, nativeProps, {
|
|
13657
14156
|
themeFontSize: fontSize,
|
|
13658
14157
|
themeFontWeight: fontWeight,
|
|
13659
14158
|
themeIntent: intent
|
|
13660
|
-
}
|
|
14159
|
+
}), children);
|
|
13661
14160
|
};
|
|
13662
14161
|
|
|
13663
14162
|
var Typography = {
|
|
13664
14163
|
Text: Text
|
|
13665
14164
|
};
|
|
13666
14165
|
|
|
13667
|
-
var BottomNavigationTab = index$
|
|
14166
|
+
var BottomNavigationTab = index$2(ReactNative.View)(function (_ref) {
|
|
13668
14167
|
var themeVisibility = _ref.themeVisibility;
|
|
13669
14168
|
return {
|
|
13670
14169
|
flex: 1,
|
|
13671
14170
|
display: themeVisibility === false ? 'none' : 'flex'
|
|
13672
14171
|
};
|
|
13673
14172
|
});
|
|
13674
|
-
var BottomNavigationContainer = index$
|
|
14173
|
+
var BottomNavigationContainer = index$2(ReactNative.View)({
|
|
13675
14174
|
flex: 1,
|
|
13676
14175
|
overflow: 'hidden'
|
|
13677
14176
|
});
|
|
13678
|
-
var ContentWrapper$
|
|
14177
|
+
var ContentWrapper$2 = index$2(ReactNative.View)({
|
|
13679
14178
|
flex: 1
|
|
13680
14179
|
});
|
|
13681
|
-
var BottomBarWrapper = index$
|
|
14180
|
+
var BottomBarWrapper = index$2(ReactNative.View)(function (_ref2) {
|
|
13682
14181
|
var themeInsets = _ref2.themeInsets,
|
|
13683
14182
|
theme = _ref2.theme;
|
|
13684
14183
|
return {
|
|
@@ -13694,27 +14193,27 @@ var BottomBarWrapper = index$1(reactNative.View)(function (_ref2) {
|
|
|
13694
14193
|
elevation: theme.__hd__.bottomNavigation.shadows.elevation
|
|
13695
14194
|
};
|
|
13696
14195
|
});
|
|
13697
|
-
var BottomBar = index$
|
|
14196
|
+
var BottomBar = index$2(ReactNative.View)({
|
|
13698
14197
|
flex: 1,
|
|
13699
14198
|
flexDirection: 'row',
|
|
13700
14199
|
overflow: 'hidden',
|
|
13701
14200
|
alignItems: 'center'
|
|
13702
14201
|
});
|
|
13703
|
-
var BottomBarItem = index$
|
|
14202
|
+
var BottomBarItem = index$2(ReactNative.View)({
|
|
13704
14203
|
flex: 1,
|
|
13705
14204
|
alignItems: 'center'
|
|
13706
14205
|
});
|
|
13707
|
-
var StyledBottomBarText = index$
|
|
14206
|
+
var StyledBottomBarText = index$2(Typography.Text)(function (_ref3) {
|
|
13708
14207
|
var theme = _ref3.theme;
|
|
13709
14208
|
return {
|
|
13710
14209
|
marginTop: theme.__hd__.bottomNavigation.space.titleMarginTop
|
|
13711
14210
|
};
|
|
13712
14211
|
});
|
|
13713
14212
|
|
|
13714
|
-
var isIOS =
|
|
13715
|
-
|
|
14213
|
+
var isIOS = ReactNative.Platform.OS === 'ios';
|
|
14214
|
+
ReactNative.Platform.OS === 'android';
|
|
13716
14215
|
|
|
13717
|
-
var _excluded$
|
|
14216
|
+
var _excluded$7 = ["onTabPress", "renderActiveTabOnly", "selectedTabKey", "tabs"];
|
|
13718
14217
|
|
|
13719
14218
|
var getInactiveIcon = function getInactiveIcon(icon) {
|
|
13720
14219
|
var inactiveIcon = "".concat(icon, "-outlined");
|
|
@@ -13727,7 +14226,7 @@ var BottomNavigation = function BottomNavigation(_ref) {
|
|
|
13727
14226
|
renderActiveTabOnly = _ref$renderActiveTabO === void 0 ? false : _ref$renderActiveTabO,
|
|
13728
14227
|
selectedTabKey = _ref.selectedTabKey,
|
|
13729
14228
|
tabs = _ref.tabs,
|
|
13730
|
-
nativeProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
14229
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$7);
|
|
13731
14230
|
|
|
13732
14231
|
var insets = reactNativeSafeAreaContext.useSafeAreaInsets();
|
|
13733
14232
|
/**
|
|
@@ -13746,7 +14245,7 @@ var BottomNavigation = function BottomNavigation(_ref) {
|
|
|
13746
14245
|
});
|
|
13747
14246
|
}
|
|
13748
14247
|
|
|
13749
|
-
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) {
|
|
13750
14249
|
var key = tab.key,
|
|
13751
14250
|
component = tab.component,
|
|
13752
14251
|
testID = tab.testID;
|
|
@@ -13782,7 +14281,7 @@ var BottomNavigation = function BottomNavigation(_ref) {
|
|
|
13782
14281
|
testID = tab.testID;
|
|
13783
14282
|
var active = selectedTabKey === key;
|
|
13784
14283
|
var inactiveIcon = getInactiveIcon(icon);
|
|
13785
|
-
return /*#__PURE__*/React__default["default"].createElement(
|
|
14284
|
+
return /*#__PURE__*/React__default["default"].createElement(ReactNative.TouchableWithoutFeedback, {
|
|
13786
14285
|
key: key,
|
|
13787
14286
|
onPress: function onPress() {
|
|
13788
14287
|
return onTabPress(key);
|
|
@@ -13801,389 +14300,1621 @@ var BottomNavigation = function BottomNavigation(_ref) {
|
|
|
13801
14300
|
}))));
|
|
13802
14301
|
};
|
|
13803
14302
|
|
|
13804
|
-
var
|
|
13805
|
-
var hitSlop = _ref.hitSlop,
|
|
13806
|
-
onPress = _ref.onPress,
|
|
13807
|
-
icon = _ref.icon,
|
|
13808
|
-
testID = _ref.testID,
|
|
13809
|
-
style = _ref.style,
|
|
13810
|
-
size = _ref.size,
|
|
13811
|
-
intent = _ref.intent;
|
|
13812
|
-
return /*#__PURE__*/React__default["default"].createElement(reactNative.TouchableOpacity, {
|
|
13813
|
-
style: style,
|
|
13814
|
-
onPress: onPress,
|
|
13815
|
-
testID: testID,
|
|
13816
|
-
hitSlop: hitSlop
|
|
13817
|
-
}, /*#__PURE__*/React__default["default"].createElement(Icon, {
|
|
13818
|
-
icon: icon,
|
|
13819
|
-
size: size,
|
|
13820
|
-
intent: intent
|
|
13821
|
-
}));
|
|
13822
|
-
};
|
|
13823
|
-
|
|
13824
|
-
var Button = {
|
|
13825
|
-
Icon: IconButton
|
|
13826
|
-
};
|
|
13827
|
-
|
|
13828
|
-
var StyledCard = index$1(reactNative.View)(function (_ref) {
|
|
13829
|
-
var theme = _ref.theme;
|
|
14303
|
+
var genLoadingIndicatorStyles = function genLoadingIndicatorStyles(theme, intent) {
|
|
13830
14304
|
return {
|
|
13831
|
-
|
|
13832
|
-
padding: theme.__hd__.card.padding["default"],
|
|
13833
|
-
overflow: 'hidden'
|
|
14305
|
+
backgroundColor: theme.__hd__.button.colors[intent]
|
|
13834
14306
|
};
|
|
13835
|
-
});
|
|
13836
|
-
|
|
13837
|
-
var Card = function Card(props) {
|
|
13838
|
-
return /*#__PURE__*/React__default["default"].createElement(StyledCard, props);
|
|
13839
|
-
};
|
|
13840
|
-
|
|
13841
|
-
var StyledDivider = index$1(reactNative.View)(function (_ref) {
|
|
13842
|
-
var themeMarginHorizontal = _ref.themeMarginHorizontal,
|
|
13843
|
-
themeMarginVertical = _ref.themeMarginVertical,
|
|
13844
|
-
theme = _ref.theme;
|
|
13845
|
-
var horizontalMargin = themeMarginHorizontal !== undefined ? {
|
|
13846
|
-
marginHorizontal: theme.__hd__.divider.space[themeMarginHorizontal]
|
|
13847
|
-
} : {};
|
|
13848
|
-
var verticalMargin = themeMarginVertical !== undefined ? {
|
|
13849
|
-
marginVertical: theme.__hd__.divider.space[themeMarginVertical]
|
|
13850
|
-
} : {};
|
|
13851
|
-
return _objectSpread2(_objectSpread2({
|
|
13852
|
-
maxWidth: '100%',
|
|
13853
|
-
borderBottomColor: theme.__hd__.divider.colors["default"],
|
|
13854
|
-
borderBottomWidth: theme.__hd__.divider.borderWidths["default"]
|
|
13855
|
-
}, horizontalMargin), verticalMargin);
|
|
13856
|
-
});
|
|
13857
|
-
|
|
13858
|
-
var _excluded$2 = ["marginHorizontal", "marginVertical", "style", "testID"];
|
|
13859
|
-
|
|
13860
|
-
var Divider = function Divider(_ref) {
|
|
13861
|
-
var marginHorizontal = _ref.marginHorizontal,
|
|
13862
|
-
marginVertical = _ref.marginVertical,
|
|
13863
|
-
style = _ref.style,
|
|
13864
|
-
testID = _ref.testID,
|
|
13865
|
-
nativeProps = _objectWithoutProperties$1(_ref, _excluded$2);
|
|
13866
|
-
|
|
13867
|
-
return /*#__PURE__*/React__default["default"].createElement(StyledDivider, _extends$2({
|
|
13868
|
-
themeMarginHorizontal: marginHorizontal,
|
|
13869
|
-
themeMarginVertical: marginVertical,
|
|
13870
|
-
style: style,
|
|
13871
|
-
testID: testID
|
|
13872
|
-
}, nativeProps));
|
|
13873
14307
|
};
|
|
13874
14308
|
|
|
13875
|
-
var
|
|
14309
|
+
var StyledLoadingIndicatorWrapper = index$2(ReactNative.View)(function (_ref) {
|
|
13876
14310
|
var theme = _ref.theme;
|
|
13877
14311
|
return {
|
|
13878
|
-
|
|
13879
|
-
width: theme.__hd__.fab.sizes.width,
|
|
13880
|
-
backgroundColor: theme.__hd__.fab.colors.buttonBackground,
|
|
13881
|
-
borderRadius: 999,
|
|
13882
|
-
alignItems: 'center',
|
|
14312
|
+
flexDirection: 'row',
|
|
13883
14313
|
justifyContent: 'center',
|
|
13884
|
-
|
|
14314
|
+
alignItems: 'center',
|
|
14315
|
+
paddingVertical: theme.space.xxsmall
|
|
13885
14316
|
};
|
|
13886
14317
|
});
|
|
13887
|
-
var
|
|
13888
|
-
var
|
|
13889
|
-
|
|
13890
|
-
|
|
13891
|
-
|
|
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
|
+
}
|
|
13892
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());
|
|
13893
14349
|
});
|
|
13894
14350
|
|
|
13895
|
-
var _excluded$
|
|
13896
|
-
var
|
|
14351
|
+
var _excluded$6 = ["count", "size", "testID", "themeVariant"];
|
|
14352
|
+
var AnimatedLoadingIndicatorWrapper = ReactNative.Animated.createAnimatedComponent(StyledLoadingIndicatorWrapper);
|
|
14353
|
+
var AnimatedLoadingDot = ReactNative.Animated.createAnimatedComponent(StyledLoadingDot);
|
|
13897
14354
|
|
|
13898
|
-
var
|
|
13899
|
-
var
|
|
13900
|
-
|
|
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
|
+
};
|
|
13901
14377
|
|
|
13902
|
-
|
|
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);
|
|
14386
|
+
|
|
14387
|
+
var progressAnimation = React.useRef(new ReactNative.Animated.Value(0));
|
|
13903
14388
|
React.useEffect(function () {
|
|
13904
|
-
var animation =
|
|
13905
|
-
toValue:
|
|
14389
|
+
var animation = ReactNative.Animated.loop(ReactNative.Animated.timing(progressAnimation.current, {
|
|
14390
|
+
toValue: 1,
|
|
14391
|
+
duration: 1200,
|
|
14392
|
+
easing: ReactNative.Easing.linear,
|
|
13906
14393
|
useNativeDriver: true
|
|
13907
|
-
});
|
|
14394
|
+
}));
|
|
13908
14395
|
animation.start();
|
|
13909
14396
|
return function () {
|
|
13910
14397
|
animation.stop();
|
|
13911
14398
|
};
|
|
13912
|
-
}, [
|
|
13913
|
-
|
|
13914
|
-
|
|
13915
|
-
|
|
13916
|
-
|
|
13917
|
-
|
|
13918
|
-
|
|
13919
|
-
|
|
13920
|
-
|
|
13921
|
-
|
|
13922
|
-
|
|
13923
|
-
|
|
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));
|
|
13924
14418
|
};
|
|
13925
14419
|
|
|
13926
|
-
var
|
|
13927
|
-
|
|
13928
|
-
|
|
13929
|
-
animated = _ref.animated,
|
|
13930
|
-
testID = _ref.testID,
|
|
13931
|
-
active = _ref.active,
|
|
13932
|
-
style = _ref.style;
|
|
13933
|
-
return /*#__PURE__*/React__default["default"].createElement(StyledFABContainer, {
|
|
13934
|
-
testID: testID,
|
|
13935
|
-
onPress: onPress,
|
|
13936
|
-
activeOpacity: 0.6,
|
|
13937
|
-
style: style
|
|
13938
|
-
}, animated ? /*#__PURE__*/React__default["default"].createElement(AnimatedFABIcon, {
|
|
13939
|
-
active: active,
|
|
13940
|
-
icon: icon,
|
|
13941
|
-
testID: "animated-fab-icon"
|
|
13942
|
-
}) : /*#__PURE__*/React__default["default"].createElement(StyledFABIcon, {
|
|
13943
|
-
icon: icon,
|
|
13944
|
-
testID: "styled-fab-icon"
|
|
13945
|
-
}));
|
|
14420
|
+
var PRESSED_COLORS = {
|
|
14421
|
+
primary: 'pressedPrimary',
|
|
14422
|
+
secondary: 'pressedSecondary'
|
|
13946
14423
|
};
|
|
13947
14424
|
|
|
13948
|
-
var
|
|
13949
|
-
var
|
|
13950
|
-
|
|
13951
|
-
|
|
13952
|
-
|
|
13953
|
-
|
|
13954
|
-
|
|
13955
|
-
|
|
13956
|
-
|
|
13957
|
-
|
|
13958
|
-
|
|
13959
|
-
flexDirection: 'row',
|
|
13960
|
-
alignItems: 'center',
|
|
13961
|
-
alignSelf: 'flex-end',
|
|
13962
|
-
overflow: 'hidden'
|
|
13963
|
-
};
|
|
13964
|
-
});
|
|
13965
|
-
var StyledActionItemText = index$1(Typography.Text)(function (_ref2) {
|
|
13966
|
-
var theme = _ref2.theme;
|
|
13967
|
-
return {
|
|
13968
|
-
paddingLeft: theme.__hd__.fab.space.actionItemTextPaddingLeft,
|
|
13969
|
-
fontSize: theme.__hd__.fab.fontSizes.actionItemText,
|
|
13970
|
-
lineHeight: theme.__hd__.fab.lineHeights.actionItemText,
|
|
13971
|
-
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
|
+
};
|
|
13972
14436
|
};
|
|
13973
|
-
});
|
|
13974
14437
|
|
|
13975
|
-
|
|
13976
|
-
|
|
13977
|
-
|
|
13978
|
-
|
|
13979
|
-
|
|
13980
|
-
|
|
13981
|
-
|
|
13982
|
-
|
|
13983
|
-
|
|
13984
|
-
|
|
13985
|
-
},
|
|
13986
|
-
icon: icon
|
|
13987
|
-
}), /*#__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());
|
|
13988
14449
|
};
|
|
13989
14450
|
|
|
13990
|
-
var
|
|
13991
|
-
|
|
13992
|
-
|
|
13993
|
-
|
|
13994
|
-
|
|
13995
|
-
|
|
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
|
+
testID: "card",
|
|
14788
|
+
themeVariant: variant
|
|
14789
|
+
}), variant === 'data' && /*#__PURE__*/React__default["default"].createElement(LeftDataCard, {
|
|
14790
|
+
testID: "data-card-indicator"
|
|
14791
|
+
}), children);
|
|
14792
|
+
};
|
|
14793
|
+
|
|
14794
|
+
var StyledWrapper$1 = index$2(ReactNative.Animated.View)(function () {
|
|
14795
|
+
return {
|
|
14796
|
+
margin: 0,
|
|
14797
|
+
padding: 0,
|
|
14798
|
+
overflow: 'hidden'
|
|
14799
|
+
};
|
|
14800
|
+
});
|
|
14801
|
+
var StyledChildWrapper = index$2(ReactNative.View)(function () {
|
|
14802
|
+
return {
|
|
14803
|
+
margin: 0,
|
|
14804
|
+
padding: 0
|
|
14805
|
+
};
|
|
14806
|
+
});
|
|
14807
|
+
|
|
14808
|
+
var usePrevious = function usePrevious(value) {
|
|
14809
|
+
var ref = React__default["default"].useRef();
|
|
14810
|
+
React__default["default"].useEffect(function () {
|
|
14811
|
+
ref.current = value;
|
|
14812
|
+
}, [value]);
|
|
14813
|
+
return ref.current;
|
|
14814
|
+
};
|
|
14815
|
+
|
|
14816
|
+
var Collapse = function Collapse(_ref) {
|
|
14817
|
+
var _ref$open = _ref.open,
|
|
14818
|
+
open = _ref$open === void 0 ? false : _ref$open,
|
|
14819
|
+
_ref$keepChildrenMoun = _ref.keepChildrenMounted,
|
|
14820
|
+
keepChildrenMounted = _ref$keepChildrenMoun === void 0 ? false : _ref$keepChildrenMoun,
|
|
14821
|
+
children = _ref.children,
|
|
14822
|
+
testID = _ref.testID,
|
|
14823
|
+
style = _ref.style;
|
|
14824
|
+
var collapseAnim = React__default["default"].useRef(new ReactNative.Animated.Value(0)).current;
|
|
14825
|
+
var innerRef = React__default["default"].useRef(null);
|
|
14826
|
+
|
|
14827
|
+
var _React$useState = React__default["default"].useState(0),
|
|
14828
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
14829
|
+
contentHeight = _React$useState2[0],
|
|
14830
|
+
setContentHeight = _React$useState2[1];
|
|
14831
|
+
|
|
14832
|
+
var _React$useState3 = React__default["default"].useState(0),
|
|
14833
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
14834
|
+
maxHeight = _React$useState4[0],
|
|
14835
|
+
setMaxHeight = _React$useState4[1];
|
|
14836
|
+
|
|
14837
|
+
var _useState = React.useState(false),
|
|
14838
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
14839
|
+
isWaitingToClose = _useState2[0],
|
|
14840
|
+
setIsWaitingToClose = _useState2[1];
|
|
14841
|
+
|
|
14842
|
+
var _useState3 = React.useState('percent'),
|
|
14843
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
14844
|
+
heightSource = _useState4[0],
|
|
14845
|
+
setHeightSource = _useState4[1];
|
|
14846
|
+
|
|
14847
|
+
var previousOpenState = usePrevious(open);
|
|
14848
|
+
var animatedCallback = React.useCallback(function () {
|
|
14849
|
+
if (open === true) {
|
|
14850
|
+
setIsWaitingToClose(true);
|
|
14851
|
+
setMaxHeight(contentHeight);
|
|
14852
|
+
} else {
|
|
14853
|
+
setIsWaitingToClose(false);
|
|
14854
|
+
}
|
|
14855
|
+
}, [open, contentHeight]);
|
|
14856
|
+
React.useEffect(function () {
|
|
14857
|
+
if (open !== previousOpenState && previousOpenState !== undefined) {
|
|
14858
|
+
var useHeightValue = maxHeight || 100;
|
|
14859
|
+
setHeightSource(useHeightValue > 100 ? 'container' : 'percent');
|
|
14860
|
+
ReactNative.Animated.timing(collapseAnim, {
|
|
14861
|
+
toValue: open ? useHeightValue : 0,
|
|
14862
|
+
easing: ReactNative.Easing.inOut(ReactNative.Easing.ease),
|
|
14863
|
+
useNativeDriver: false
|
|
14864
|
+
}).start(animatedCallback);
|
|
14865
|
+
}
|
|
14866
|
+
}, [open, previousOpenState, maxHeight]);
|
|
14867
|
+
var checkMaxHeight = React.useCallback(function (_ref2) {
|
|
14868
|
+
var height = _ref2.height;
|
|
14869
|
+
|
|
14870
|
+
if (height > contentHeight) {
|
|
14871
|
+
setContentHeight(height);
|
|
14872
|
+
}
|
|
14873
|
+
}, [contentHeight]);
|
|
14874
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledWrapper$1, {
|
|
14875
|
+
onLayout: function onLayout(event) {
|
|
14876
|
+
return checkMaxHeight(event.nativeEvent.layout);
|
|
14877
|
+
},
|
|
14878
|
+
style: [style, {
|
|
14879
|
+
maxHeight: heightSource === 'container' ? collapseAnim : collapseAnim.interpolate({
|
|
14880
|
+
inputRange: [0, 100],
|
|
14881
|
+
outputRange: ['0%', '100%']
|
|
14882
|
+
})
|
|
14883
|
+
}],
|
|
14884
|
+
testID: testID
|
|
14885
|
+
}, (keepChildrenMounted === true || open === true || open === false && isWaitingToClose === true) && /*#__PURE__*/React__default["default"].createElement(StyledChildWrapper, {
|
|
14886
|
+
ref: innerRef
|
|
14887
|
+
}, children));
|
|
14888
|
+
};
|
|
14889
|
+
|
|
14890
|
+
var StyledDivider = index$2(ReactNative.View)(function (_ref) {
|
|
14891
|
+
var themeMarginHorizontal = _ref.themeMarginHorizontal,
|
|
14892
|
+
themeMarginVertical = _ref.themeMarginVertical,
|
|
14893
|
+
theme = _ref.theme;
|
|
14894
|
+
var horizontalMargin = themeMarginHorizontal !== undefined ? {
|
|
14895
|
+
marginHorizontal: theme.__hd__.divider.space[themeMarginHorizontal]
|
|
14896
|
+
} : {};
|
|
14897
|
+
var verticalMargin = themeMarginVertical !== undefined ? {
|
|
14898
|
+
marginVertical: theme.__hd__.divider.space[themeMarginVertical]
|
|
14899
|
+
} : {};
|
|
14900
|
+
return _objectSpread2(_objectSpread2({
|
|
14901
|
+
maxWidth: '100%',
|
|
14902
|
+
borderBottomColor: theme.__hd__.divider.colors["default"],
|
|
14903
|
+
borderBottomWidth: theme.__hd__.divider.borderWidths["default"]
|
|
14904
|
+
}, horizontalMargin), verticalMargin);
|
|
14905
|
+
});
|
|
14906
|
+
|
|
14907
|
+
var _excluded$4 = ["marginHorizontal", "marginVertical", "style", "testID"];
|
|
14908
|
+
|
|
14909
|
+
var Divider = function Divider(_ref) {
|
|
14910
|
+
var marginHorizontal = _ref.marginHorizontal,
|
|
14911
|
+
marginVertical = _ref.marginVertical,
|
|
14912
|
+
style = _ref.style,
|
|
14913
|
+
testID = _ref.testID,
|
|
14914
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$4);
|
|
14915
|
+
|
|
14916
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledDivider, _extends$3({}, nativeProps, {
|
|
14917
|
+
themeMarginHorizontal: marginHorizontal,
|
|
14918
|
+
themeMarginVertical: marginVertical,
|
|
14919
|
+
style: style,
|
|
14920
|
+
testID: testID
|
|
14921
|
+
}));
|
|
14922
|
+
};
|
|
14923
|
+
|
|
14924
|
+
var AnimatedPressable = ReactNative.Animated.createAnimatedComponent(ReactNative.Pressable);
|
|
14925
|
+
var StyledContainer$1 = index$2(ReactNative.View)(function (_ref) {
|
|
14926
|
+
var theme = _ref.theme,
|
|
14927
|
+
enableShadow = _ref.enableShadow;
|
|
14928
|
+
return _objectSpread2(_objectSpread2({}, ReactNative.StyleSheet.absoluteFillObject), {}, {
|
|
14929
|
+
shadowColor: enableShadow ? theme.__hd__.drawer.colors.shadow : 'transparent',
|
|
14930
|
+
shadowOffset: theme.__hd__.drawer.shadows.offset,
|
|
14931
|
+
shadowOpacity: theme.__hd__.drawer.shadows.opacity,
|
|
14932
|
+
shadowRadius: theme.__hd__.drawer.shadows.radius,
|
|
14933
|
+
overflow: 'hidden',
|
|
14934
|
+
zIndex: 9999,
|
|
14935
|
+
elevation: 9999
|
|
14936
|
+
});
|
|
14937
|
+
});
|
|
14938
|
+
var StyledBackdrop$1 = index$2(AnimatedPressable)(function (_ref2) {
|
|
14939
|
+
var theme = _ref2.theme;
|
|
14940
|
+
return _objectSpread2(_objectSpread2({}, ReactNative.StyleSheet.absoluteFillObject), {}, {
|
|
14941
|
+
backgroundColor: theme.__hd__.drawer.colors.backdrop
|
|
14942
|
+
});
|
|
14943
|
+
});
|
|
14944
|
+
var StyledDrawerContainer = index$2(ReactNative.Animated.View)(function (_ref3) {
|
|
14945
|
+
var theme = _ref3.theme,
|
|
14946
|
+
enableShadow = _ref3.enableShadow;
|
|
14947
|
+
return {
|
|
14948
|
+
borderBottomLeftRadius: theme.__hd__.drawer.radii["default"],
|
|
14949
|
+
borderBottomRightRadius: theme.__hd__.drawer.radii["default"],
|
|
14950
|
+
backgroundColor: theme.__hd__.drawer.colors.background,
|
|
14951
|
+
elevation: enableShadow ? theme.__hd__.drawer.shadows.elevation : undefined,
|
|
14952
|
+
overflow: 'hidden'
|
|
14953
|
+
};
|
|
14954
|
+
});
|
|
14955
|
+
|
|
14956
|
+
var Drawer = function Drawer(_ref) {
|
|
14957
|
+
var visible = _ref.visible,
|
|
14958
|
+
children = _ref.children,
|
|
14959
|
+
_ref$hasBackdrop = _ref.hasBackdrop,
|
|
14960
|
+
hasBackdrop = _ref$hasBackdrop === void 0 ? true : _ref$hasBackdrop,
|
|
14961
|
+
onDismiss = _ref.onDismiss,
|
|
14962
|
+
testID = _ref.testID;
|
|
14963
|
+
var animatedValue = React.useRef(new ReactNative.Animated.Value(visible ? 1 : 0)).current;
|
|
14964
|
+
|
|
14965
|
+
var _useState = React.useState(0),
|
|
14966
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
14967
|
+
height = _useState2[0],
|
|
14968
|
+
setHeight = _useState2[1];
|
|
14969
|
+
|
|
14970
|
+
var enableShadow = visible && !hasBackdrop;
|
|
14971
|
+
var interpolateTranslateY = animatedValue.interpolate({
|
|
14972
|
+
inputRange: [0, 1],
|
|
14973
|
+
outputRange: [-height, 0]
|
|
14974
|
+
});
|
|
14975
|
+
var interpolateBackdropOpacity = hasBackdrop ? animatedValue.interpolate({
|
|
14976
|
+
inputRange: [0, 1],
|
|
14977
|
+
outputRange: [0, 0.35]
|
|
14978
|
+
}) : 0;
|
|
14979
|
+
React.useEffect(function () {
|
|
14980
|
+
var animation = ReactNative.Animated.timing(animatedValue, {
|
|
14981
|
+
toValue: visible ? 1 : 0,
|
|
14982
|
+
easing: ReactNative.Easing.inOut(ReactNative.Easing.cubic),
|
|
14983
|
+
useNativeDriver: true
|
|
14984
|
+
});
|
|
14985
|
+
animation.start();
|
|
14986
|
+
return function () {
|
|
14987
|
+
return animation.stop();
|
|
14988
|
+
};
|
|
14989
|
+
}, [visible]);
|
|
14990
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledContainer$1, {
|
|
14991
|
+
testID: testID,
|
|
14992
|
+
enableShadow: enableShadow,
|
|
14993
|
+
pointerEvents: "box-none"
|
|
14994
|
+
}, /*#__PURE__*/React__default["default"].createElement(StyledBackdrop$1, {
|
|
14995
|
+
pointerEvents: visible ? 'auto' : 'box-none',
|
|
14996
|
+
onPress: onDismiss,
|
|
14997
|
+
style: {
|
|
14998
|
+
opacity: interpolateBackdropOpacity
|
|
14999
|
+
}
|
|
15000
|
+
}), /*#__PURE__*/React__default["default"].createElement(StyledDrawerContainer, {
|
|
15001
|
+
enableShadow: enableShadow,
|
|
15002
|
+
onLayout: function onLayout(_ref2) {
|
|
15003
|
+
var nativeEvent = _ref2.nativeEvent;
|
|
15004
|
+
return setHeight(nativeEvent.layout.height);
|
|
15005
|
+
},
|
|
15006
|
+
style: {
|
|
15007
|
+
transform: [{
|
|
15008
|
+
translateY: interpolateTranslateY
|
|
15009
|
+
}]
|
|
15010
|
+
}
|
|
15011
|
+
}, children));
|
|
15012
|
+
};
|
|
15013
|
+
|
|
15014
|
+
var StyledFABContainer = index$2(ReactNative.TouchableHighlight)(function (_ref) {
|
|
15015
|
+
var theme = _ref.theme;
|
|
15016
|
+
return {
|
|
15017
|
+
backgroundColor: theme.__hd__.fab.colors.buttonBackground,
|
|
15018
|
+
borderRadius: theme.radii.rounded,
|
|
15019
|
+
alignItems: 'center',
|
|
15020
|
+
justifyContent: 'center',
|
|
15021
|
+
overflow: 'hidden',
|
|
15022
|
+
alignSelf: 'flex-start',
|
|
15023
|
+
paddingHorizontal: theme.__hd__.fab.space.containerPaddingHorizontal,
|
|
15024
|
+
paddingVertical: theme.__hd__.fab.space.containerPaddingVertical,
|
|
15025
|
+
flexDirection: 'row'
|
|
15026
|
+
};
|
|
15027
|
+
});
|
|
15028
|
+
var StyledFABIcon = index$2(Icon)(function (_ref2) {
|
|
15029
|
+
var theme = _ref2.theme;
|
|
15030
|
+
return {
|
|
15031
|
+
color: theme.__hd__.fab.colors.icon,
|
|
15032
|
+
lineHeight: theme.__hd__.fab.lineHeights.icon,
|
|
15033
|
+
textAlignVertical: 'center',
|
|
15034
|
+
textAlign: 'center'
|
|
15035
|
+
};
|
|
15036
|
+
});
|
|
15037
|
+
var StyledFABText = index$2(ReactNative.Text)(function (_ref3) {
|
|
15038
|
+
var theme = _ref3.theme;
|
|
15039
|
+
return {
|
|
15040
|
+
fontFamily: theme.__hd__.fab.fonts.title,
|
|
15041
|
+
fontSize: theme.__hd__.fab.fontSizes.title,
|
|
15042
|
+
lineHeight: theme.__hd__.fab.lineHeights.title,
|
|
15043
|
+
color: theme.__hd__.fab.colors.titleText,
|
|
15044
|
+
textAlignVertical: 'center',
|
|
15045
|
+
textAlign: 'center',
|
|
15046
|
+
marginHorizontal: theme.__hd__.fab.space.titleMarginHorizontal
|
|
15047
|
+
};
|
|
15048
|
+
});
|
|
15049
|
+
|
|
15050
|
+
var _excluded$3 = ["active"];
|
|
15051
|
+
var AnimatedIcons = ReactNative.Animated.createAnimatedComponent(StyledFABIcon);
|
|
15052
|
+
|
|
15053
|
+
var AnimatedFABIcon = function AnimatedFABIcon(_ref) {
|
|
15054
|
+
var active = _ref.active,
|
|
15055
|
+
iconProps = _objectWithoutProperties$1(_ref, _excluded$3);
|
|
15056
|
+
|
|
15057
|
+
var rotateAnimation = React.useRef(new ReactNative.Animated.Value(active ? 1 : 0));
|
|
15058
|
+
React.useEffect(function () {
|
|
15059
|
+
var animation = ReactNative.Animated.timing(rotateAnimation.current, {
|
|
15060
|
+
toValue: active ? 1 : 0,
|
|
15061
|
+
useNativeDriver: true
|
|
15062
|
+
});
|
|
15063
|
+
animation.start();
|
|
15064
|
+
return function () {
|
|
15065
|
+
animation.stop();
|
|
15066
|
+
};
|
|
15067
|
+
}, [active]);
|
|
15068
|
+
var interpolatedRotateAnimation = rotateAnimation.current.interpolate({
|
|
15069
|
+
inputRange: [0, 1],
|
|
15070
|
+
outputRange: ['0deg', '-45deg']
|
|
15071
|
+
});
|
|
15072
|
+
return /*#__PURE__*/React__default["default"].createElement(ReactNative.Animated.View, {
|
|
15073
|
+
style: ReactNative.StyleSheet.flatten([{
|
|
15074
|
+
transform: [{
|
|
15075
|
+
rotate: interpolatedRotateAnimation
|
|
15076
|
+
}]
|
|
15077
|
+
}])
|
|
15078
|
+
}, /*#__PURE__*/React__default["default"].createElement(AnimatedIcons, iconProps));
|
|
15079
|
+
};
|
|
15080
|
+
|
|
15081
|
+
var IconOnlyContent = function IconOnlyContent(_ref) {
|
|
15082
|
+
var icon = _ref.icon,
|
|
15083
|
+
animated = _ref.animated,
|
|
15084
|
+
active = _ref.active;
|
|
15085
|
+
|
|
15086
|
+
if (animated) {
|
|
15087
|
+
return /*#__PURE__*/React__default["default"].createElement(AnimatedFABIcon, {
|
|
15088
|
+
active: active,
|
|
15089
|
+
icon: icon,
|
|
15090
|
+
testID: "animated-fab-icon"
|
|
15091
|
+
});
|
|
15092
|
+
}
|
|
15093
|
+
|
|
15094
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledFABIcon, {
|
|
15095
|
+
icon: icon,
|
|
15096
|
+
testID: "styled-fab-icon"
|
|
15097
|
+
});
|
|
15098
|
+
};
|
|
15099
|
+
|
|
15100
|
+
var IconWithTextContent = function IconWithTextContent(_ref2) {
|
|
15101
|
+
var icon = _ref2.icon,
|
|
15102
|
+
title = _ref2.title;
|
|
15103
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(StyledFABIcon, {
|
|
15104
|
+
size: "xsmall",
|
|
15105
|
+
icon: icon,
|
|
15106
|
+
testID: "styled-fab-icon"
|
|
15107
|
+
}), /*#__PURE__*/React__default["default"].createElement(StyledFABText, null, title));
|
|
15108
|
+
};
|
|
15109
|
+
|
|
15110
|
+
var FAB = function FAB(_ref3) {
|
|
15111
|
+
var onPress = _ref3.onPress,
|
|
15112
|
+
title = _ref3.title,
|
|
15113
|
+
icon = _ref3.icon,
|
|
15114
|
+
animated = _ref3.animated,
|
|
15115
|
+
testID = _ref3.testID,
|
|
15116
|
+
active = _ref3.active,
|
|
15117
|
+
style = _ref3.style;
|
|
15118
|
+
var isIconOnly = !title;
|
|
15119
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledFABContainer, {
|
|
15120
|
+
testID: testID,
|
|
15121
|
+
style: style,
|
|
15122
|
+
onPress: onPress,
|
|
15123
|
+
activeOpacity: 0.6
|
|
15124
|
+
}, isIconOnly ? /*#__PURE__*/React__default["default"].createElement(IconOnlyContent, {
|
|
15125
|
+
animated: animated,
|
|
15126
|
+
active: active,
|
|
15127
|
+
icon: icon
|
|
15128
|
+
}) : /*#__PURE__*/React__default["default"].createElement(IconWithTextContent, {
|
|
15129
|
+
icon: icon,
|
|
15130
|
+
title: title
|
|
15131
|
+
}));
|
|
15132
|
+
};
|
|
15133
|
+
|
|
15134
|
+
var StyledActionItem = index$2(ReactNative.TouchableOpacity)(function (_ref) {
|
|
15135
|
+
var theme = _ref.theme;
|
|
15136
|
+
return {
|
|
15137
|
+
paddingLeft: theme.__hd__.fab.space.actionItemPaddingLeft,
|
|
15138
|
+
paddingRight: theme.__hd__.fab.space.actionItemPaddingRight,
|
|
15139
|
+
paddingTop: theme.__hd__.fab.space.actionItemPaddingTop,
|
|
15140
|
+
paddingBottom: theme.__hd__.fab.space.actionItemPaddingBottom,
|
|
15141
|
+
margin: theme.__hd__.fab.space.actionItemMargin,
|
|
15142
|
+
marginRight: theme.__hd__.fab.space.actionItemMarginRight,
|
|
15143
|
+
backgroundColor: theme.__hd__.fab.colors.actionItemBackground,
|
|
15144
|
+
borderRadius: theme.__hd__.fab.radii.actionItem,
|
|
15145
|
+
flexDirection: 'row',
|
|
15146
|
+
alignItems: 'center',
|
|
15147
|
+
alignSelf: 'flex-end',
|
|
15148
|
+
overflow: 'hidden'
|
|
15149
|
+
};
|
|
15150
|
+
});
|
|
15151
|
+
var StyledActionItemText = index$2(Typography.Text)(function (_ref2) {
|
|
15152
|
+
var theme = _ref2.theme;
|
|
15153
|
+
return {
|
|
15154
|
+
paddingLeft: theme.__hd__.fab.space.actionItemTextPaddingLeft,
|
|
15155
|
+
fontSize: theme.__hd__.fab.fontSizes.actionItemText,
|
|
15156
|
+
lineHeight: theme.__hd__.fab.lineHeights.actionItemText,
|
|
15157
|
+
fontFamily: theme.__hd__.fab.fonts.actionItemText
|
|
15158
|
+
};
|
|
15159
|
+
});
|
|
15160
|
+
|
|
15161
|
+
var ActionItem = function ActionItem(_ref) {
|
|
15162
|
+
var icon = _ref.icon,
|
|
15163
|
+
title = _ref.title,
|
|
15164
|
+
onPress = _ref.onPress,
|
|
15165
|
+
style = _ref.style,
|
|
15166
|
+
testID = _ref.testID;
|
|
15167
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledActionItem, {
|
|
15168
|
+
style: style,
|
|
15169
|
+
onPress: onPress,
|
|
15170
|
+
testID: testID
|
|
15171
|
+
}, /*#__PURE__*/React__default["default"].createElement(Icon, {
|
|
15172
|
+
icon: icon
|
|
15173
|
+
}), /*#__PURE__*/React__default["default"].createElement(StyledActionItemText, null, title));
|
|
15174
|
+
};
|
|
15175
|
+
|
|
15176
|
+
var StyledContainer = index$2(ReactNative.View)({
|
|
15177
|
+
position: 'absolute',
|
|
15178
|
+
left: 0,
|
|
15179
|
+
right: 0,
|
|
15180
|
+
top: 0,
|
|
15181
|
+
bottom: 0,
|
|
13996
15182
|
alignItems: 'flex-end',
|
|
13997
15183
|
justifyContent: 'flex-end'
|
|
13998
15184
|
});
|
|
13999
|
-
var StyledActionGroupContainer = index$
|
|
15185
|
+
var StyledActionGroupContainer = index$2(ReactNative.Animated.View)({
|
|
14000
15186
|
alignItems: 'flex-end',
|
|
14001
15187
|
justifyContent: 'flex-end',
|
|
14002
15188
|
width: '70%'
|
|
14003
15189
|
});
|
|
14004
|
-
var StyledFAB = index$
|
|
14005
|
-
var theme = _ref.theme;
|
|
15190
|
+
var StyledFAB = index$2(FAB)(function (_ref) {
|
|
15191
|
+
var theme = _ref.theme;
|
|
15192
|
+
return {
|
|
15193
|
+
marginRight: theme.__hd__.fab.space.buttonMarginRight,
|
|
15194
|
+
marginTop: theme.__hd__.fab.space.buttonMarginTop,
|
|
15195
|
+
alignSelf: 'flex-end'
|
|
15196
|
+
};
|
|
15197
|
+
});
|
|
15198
|
+
var StyledBackdrop = index$2(ReactNative.Animated.View)(function (_ref2) {
|
|
15199
|
+
var theme = _ref2.theme;
|
|
15200
|
+
return {
|
|
15201
|
+
position: 'absolute',
|
|
15202
|
+
left: 0,
|
|
15203
|
+
right: 0,
|
|
15204
|
+
top: 0,
|
|
15205
|
+
bottom: 0,
|
|
15206
|
+
backgroundColor: theme.__hd__.fab.colors.backdropBackground
|
|
15207
|
+
};
|
|
15208
|
+
});
|
|
15209
|
+
var StyledHeaderText = index$2(Typography.Text)(function (_ref3) {
|
|
15210
|
+
var theme = _ref3.theme;
|
|
15211
|
+
return {
|
|
15212
|
+
fontSize: theme.__hd__.fab.fontSizes.header,
|
|
15213
|
+
lineHeight: theme.__hd__.fab.lineHeights.header,
|
|
15214
|
+
fontFamily: theme.__hd__.fab.fonts.header,
|
|
15215
|
+
marginRight: theme.__hd__.fab.space.headerTextMarginRight,
|
|
15216
|
+
marginBottom: theme.__hd__.fab.space.headerTextMarginBottom,
|
|
15217
|
+
textAlign: 'right'
|
|
15218
|
+
};
|
|
15219
|
+
});
|
|
15220
|
+
|
|
15221
|
+
var ActionItemsListComponent = function ActionItemsListComponent(_ref) {
|
|
15222
|
+
var style = _ref.style,
|
|
15223
|
+
items = _ref.items;
|
|
15224
|
+
return /*#__PURE__*/React__default["default"].createElement(ReactNative.View, {
|
|
15225
|
+
style: style
|
|
15226
|
+
}, items === null || items === void 0 ? void 0 : items.map(function (itemProp) {
|
|
15227
|
+
return /*#__PURE__*/React__default["default"].createElement(ActionItem, _extends$3({
|
|
15228
|
+
key: itemProp.icon
|
|
15229
|
+
}, itemProp));
|
|
15230
|
+
}));
|
|
15231
|
+
};
|
|
15232
|
+
|
|
15233
|
+
var ActionGroup = function ActionGroup(_ref2) {
|
|
15234
|
+
var headerTitle = _ref2.headerTitle,
|
|
15235
|
+
onPress = _ref2.onPress,
|
|
15236
|
+
active = _ref2.active,
|
|
15237
|
+
style = _ref2.style,
|
|
15238
|
+
items = _ref2.items,
|
|
15239
|
+
testID = _ref2.testID,
|
|
15240
|
+
fabTitle = _ref2.fabTitle;
|
|
15241
|
+
var tranlateXAnimation = React.useRef(new ReactNative.Animated.Value(active ? 1 : 0));
|
|
15242
|
+
React.useEffect(function () {
|
|
15243
|
+
var animation = ReactNative.Animated.timing(tranlateXAnimation.current, {
|
|
15244
|
+
toValue: active ? 1 : 0,
|
|
15245
|
+
useNativeDriver: true
|
|
15246
|
+
});
|
|
15247
|
+
animation.start();
|
|
15248
|
+
}, [active]);
|
|
15249
|
+
var interpolatedTranlateXAnimation = tranlateXAnimation.current.interpolate({
|
|
15250
|
+
inputRange: [0, 1],
|
|
15251
|
+
outputRange: [400, 0]
|
|
15252
|
+
});
|
|
15253
|
+
var interpolatedOpacityAnimation = tranlateXAnimation.current.interpolate({
|
|
15254
|
+
inputRange: [0, 1],
|
|
15255
|
+
outputRange: [0, 0.9]
|
|
15256
|
+
});
|
|
15257
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledContainer, {
|
|
15258
|
+
testID: testID,
|
|
15259
|
+
pointerEvents: "box-none",
|
|
15260
|
+
style: style
|
|
15261
|
+
}, /*#__PURE__*/React__default["default"].createElement(StyledBackdrop, {
|
|
15262
|
+
pointerEvents: active ? 'auto' : 'box-none',
|
|
15263
|
+
testID: "back-drop",
|
|
15264
|
+
style: {
|
|
15265
|
+
opacity: interpolatedOpacityAnimation
|
|
15266
|
+
}
|
|
15267
|
+
}), /*#__PURE__*/React__default["default"].createElement(StyledActionGroupContainer, {
|
|
15268
|
+
testID: "action-group",
|
|
15269
|
+
style: {
|
|
15270
|
+
transform: [{
|
|
15271
|
+
translateX: interpolatedTranlateXAnimation
|
|
15272
|
+
}]
|
|
15273
|
+
}
|
|
15274
|
+
}, headerTitle && /*#__PURE__*/React__default["default"].createElement(StyledHeaderText, {
|
|
15275
|
+
testID: "header-text"
|
|
15276
|
+
}, headerTitle), /*#__PURE__*/React__default["default"].createElement(ActionItemsListComponent, {
|
|
15277
|
+
items: items
|
|
15278
|
+
})), /*#__PURE__*/React__default["default"].createElement(StyledFAB, {
|
|
15279
|
+
testID: "fab",
|
|
15280
|
+
icon: "add",
|
|
15281
|
+
onPress: onPress,
|
|
15282
|
+
animated: true,
|
|
15283
|
+
active: active,
|
|
15284
|
+
title: fabTitle
|
|
15285
|
+
}));
|
|
15286
|
+
};
|
|
15287
|
+
|
|
15288
|
+
var index$1 = Object.assign(FAB, {
|
|
15289
|
+
ActionGroup: ActionGroup
|
|
15290
|
+
});
|
|
15291
|
+
|
|
15292
|
+
var HalfCircleWrapper = index$2(ReactNative.View)(function (_ref) {
|
|
15293
|
+
var theme = _ref.theme;
|
|
15294
|
+
return {
|
|
15295
|
+
width: theme.__hd__.progress.sizes.radius,
|
|
15296
|
+
height: theme.__hd__.progress.sizes.radius * 2,
|
|
15297
|
+
overflow: 'hidden'
|
|
15298
|
+
};
|
|
15299
|
+
});
|
|
15300
|
+
var HalfCircleInnerFG = index$2(ReactNative.View)(function (_ref2) {
|
|
15301
|
+
var theme = _ref2.theme,
|
|
15302
|
+
themeIntent = _ref2.themeIntent;
|
|
15303
|
+
return {
|
|
15304
|
+
width: theme.__hd__.progress.sizes.radius * 2,
|
|
15305
|
+
height: theme.__hd__.progress.sizes.radius * 2,
|
|
15306
|
+
backgroundColor: theme.__hd__.progress.colors[themeIntent],
|
|
15307
|
+
borderRadius: theme.__hd__.progress.radii["default"]
|
|
15308
|
+
};
|
|
15309
|
+
});
|
|
15310
|
+
var HalfCircleInnerBG = index$2(ReactNative.View)(function (_ref3) {
|
|
15311
|
+
var theme = _ref3.theme;
|
|
15312
|
+
return {
|
|
15313
|
+
width: theme.__hd__.progress.sizes.radius * 2,
|
|
15314
|
+
height: theme.__hd__.progress.sizes.radius * 2,
|
|
15315
|
+
backgroundColor: theme.__hd__.progress.colors.background,
|
|
15316
|
+
borderRadius: theme.__hd__.progress.radii["default"]
|
|
15317
|
+
};
|
|
15318
|
+
});
|
|
15319
|
+
var DonutCircle = index$2(ReactNative.View)(function (_ref4) {
|
|
15320
|
+
var theme = _ref4.theme;
|
|
15321
|
+
return {
|
|
15322
|
+
position: 'absolute',
|
|
15323
|
+
top: theme.__hd__.progress.sizes.strokeWidth,
|
|
15324
|
+
left: theme.__hd__.progress.sizes.strokeWidth,
|
|
15325
|
+
width: theme.__hd__.progress.sizes.radius * 2 - theme.__hd__.progress.sizes.strokeWidth * 2,
|
|
15326
|
+
height: theme.__hd__.progress.sizes.radius * 2 - theme.__hd__.progress.sizes.strokeWidth * 2,
|
|
15327
|
+
zIndex: 3,
|
|
15328
|
+
backgroundColor: theme.__hd__.progress.colors.innerBackground,
|
|
15329
|
+
borderRadius: theme.__hd__.progress.radii["default"],
|
|
15330
|
+
alignItems: 'center',
|
|
15331
|
+
justifyContent: 'center'
|
|
15332
|
+
};
|
|
15333
|
+
});
|
|
15334
|
+
var StrokeEnd = index$2(ReactNative.View)(function (_ref5) {
|
|
15335
|
+
var theme = _ref5.theme,
|
|
15336
|
+
themeIntent = _ref5.themeIntent;
|
|
15337
|
+
return {
|
|
15338
|
+
position: 'absolute',
|
|
15339
|
+
top: 0,
|
|
15340
|
+
left: theme.__hd__.progress.sizes.radius - theme.__hd__.progress.sizes.strokeWidth / 2,
|
|
15341
|
+
width: theme.__hd__.progress.sizes.strokeWidth,
|
|
15342
|
+
height: theme.__hd__.progress.sizes.strokeWidth,
|
|
15343
|
+
borderRadius: theme.__hd__.progress.radii["default"],
|
|
15344
|
+
backgroundColor: theme.__hd__.progress.colors[themeIntent],
|
|
15345
|
+
zIndex: 2
|
|
15346
|
+
};
|
|
15347
|
+
});
|
|
15348
|
+
|
|
15349
|
+
var _excluded$2 = ["value", "intent", "style", "testID"];
|
|
15350
|
+
|
|
15351
|
+
var HalfCircle = function HalfCircle(_ref) {
|
|
15352
|
+
var type = _ref.type,
|
|
15353
|
+
_ref$themeIntent = _ref.themeIntent,
|
|
15354
|
+
themeIntent = _ref$themeIntent === void 0 ? 'primary' : _ref$themeIntent;
|
|
15355
|
+
return /*#__PURE__*/React__default["default"].createElement(HalfCircleWrapper, null, type === 'background' ? /*#__PURE__*/React__default["default"].createElement(HalfCircleInnerBG, null) : /*#__PURE__*/React__default["default"].createElement(HalfCircleInnerFG, {
|
|
15356
|
+
themeIntent: themeIntent
|
|
15357
|
+
}));
|
|
15358
|
+
};
|
|
15359
|
+
|
|
15360
|
+
var ProgressCircle = function ProgressCircle(_ref2) {
|
|
15361
|
+
var value = _ref2.value,
|
|
15362
|
+
_ref2$intent = _ref2.intent,
|
|
15363
|
+
intent = _ref2$intent === void 0 ? 'primary' : _ref2$intent,
|
|
15364
|
+
style = _ref2.style,
|
|
15365
|
+
testID = _ref2.testID,
|
|
15366
|
+
nativeProps = _objectWithoutProperties$1(_ref2, _excluded$2);
|
|
15367
|
+
|
|
15368
|
+
var theme = useTheme();
|
|
15369
|
+
var radius = theme.__hd__.progress.sizes.radius;
|
|
15370
|
+
var progressAnimatedValue = React.useRef(new ReactNative.Animated.Value(0));
|
|
15371
|
+
React.useEffect(function () {
|
|
15372
|
+
var animation = ReactNative.Animated.timing(progressAnimatedValue.current, {
|
|
15373
|
+
toValue: value,
|
|
15374
|
+
useNativeDriver: true
|
|
15375
|
+
});
|
|
15376
|
+
animation.start();
|
|
15377
|
+
return function () {
|
|
15378
|
+
return animation.stop();
|
|
15379
|
+
};
|
|
15380
|
+
}, [value]); // Animate progress circle: 0% => 50%
|
|
15381
|
+
|
|
15382
|
+
var interpolateRotateRightHalf = progressAnimatedValue.current.interpolate({
|
|
15383
|
+
inputRange: [0, 50],
|
|
15384
|
+
outputRange: ['0deg', '180deg'],
|
|
15385
|
+
extrapolate: 'clamp'
|
|
15386
|
+
});
|
|
15387
|
+
var interpolateOpacityRightHalf = progressAnimatedValue.current.interpolate({
|
|
15388
|
+
inputRange: [50, 51],
|
|
15389
|
+
outputRange: [1, 0],
|
|
15390
|
+
extrapolate: 'clamp'
|
|
15391
|
+
}); // Animate progress circle: 50% => 100%
|
|
15392
|
+
|
|
15393
|
+
var interpolateRotateSecondHalf = progressAnimatedValue.current.interpolate({
|
|
15394
|
+
inputRange: [50, 100],
|
|
15395
|
+
outputRange: ['0deg', '180deg'],
|
|
15396
|
+
extrapolate: 'clamp'
|
|
15397
|
+
}); // Curve at the end of progress stroke
|
|
15398
|
+
|
|
15399
|
+
var interpolateDotRotate = progressAnimatedValue.current.interpolate({
|
|
15400
|
+
inputRange: [0, 100],
|
|
15401
|
+
outputRange: ['0deg', '360deg'],
|
|
15402
|
+
extrapolate: 'clamp'
|
|
15403
|
+
});
|
|
15404
|
+
return /*#__PURE__*/React__default["default"].createElement(ReactNative.View, _extends$3({}, nativeProps, {
|
|
15405
|
+
testID: testID,
|
|
15406
|
+
style: style
|
|
15407
|
+
}), /*#__PURE__*/React__default["default"].createElement(ReactNative.View, {
|
|
15408
|
+
style: {
|
|
15409
|
+
flexDirection: 'row'
|
|
15410
|
+
}
|
|
15411
|
+
}, /*#__PURE__*/React__default["default"].createElement(ReactNative.View, null, /*#__PURE__*/React__default["default"].createElement(HalfCircle, {
|
|
15412
|
+
type: "foreground",
|
|
15413
|
+
themeIntent: intent
|
|
15414
|
+
}), /*#__PURE__*/React__default["default"].createElement(ReactNative.Animated.View, {
|
|
15415
|
+
style: _objectSpread2(_objectSpread2({}, ReactNative.StyleSheet.absoluteFillObject), {}, {
|
|
15416
|
+
transform: [{
|
|
15417
|
+
translateX: radius / 2
|
|
15418
|
+
}, {
|
|
15419
|
+
rotate: interpolateRotateSecondHalf
|
|
15420
|
+
}, {
|
|
15421
|
+
translateX: -radius / 2
|
|
15422
|
+
}]
|
|
15423
|
+
})
|
|
15424
|
+
}, /*#__PURE__*/React__default["default"].createElement(HalfCircle, {
|
|
15425
|
+
type: "background"
|
|
15426
|
+
}))), /*#__PURE__*/React__default["default"].createElement(ReactNative.View, {
|
|
15427
|
+
style: {
|
|
15428
|
+
transform: [{
|
|
15429
|
+
rotate: '180deg'
|
|
15430
|
+
}],
|
|
15431
|
+
zIndex: 1
|
|
15432
|
+
}
|
|
15433
|
+
}, /*#__PURE__*/React__default["default"].createElement(HalfCircle, {
|
|
15434
|
+
type: "foreground",
|
|
15435
|
+
themeIntent: intent
|
|
15436
|
+
}), /*#__PURE__*/React__default["default"].createElement(ReactNative.Animated.View, {
|
|
15437
|
+
style: _objectSpread2(_objectSpread2({}, ReactNative.StyleSheet.absoluteFillObject), {}, {
|
|
15438
|
+
transform: [{
|
|
15439
|
+
translateX: radius / 2
|
|
15440
|
+
}, {
|
|
15441
|
+
rotate: interpolateRotateRightHalf
|
|
15442
|
+
}, {
|
|
15443
|
+
translateX: -radius / 2
|
|
15444
|
+
}],
|
|
15445
|
+
opacity: interpolateOpacityRightHalf
|
|
15446
|
+
})
|
|
15447
|
+
}, /*#__PURE__*/React__default["default"].createElement(HalfCircle, {
|
|
15448
|
+
type: "background"
|
|
15449
|
+
}))), /*#__PURE__*/React__default["default"].createElement(StrokeEnd, {
|
|
15450
|
+
themeIntent: intent
|
|
15451
|
+
}), /*#__PURE__*/React__default["default"].createElement(ReactNative.Animated.View, {
|
|
15452
|
+
style: _objectSpread2(_objectSpread2({}, ReactNative.StyleSheet.absoluteFillObject), {}, {
|
|
15453
|
+
zIndex: 2,
|
|
15454
|
+
transform: [{
|
|
15455
|
+
rotate: interpolateDotRotate
|
|
15456
|
+
}]
|
|
15457
|
+
})
|
|
15458
|
+
}, /*#__PURE__*/React__default["default"].createElement(StrokeEnd, {
|
|
15459
|
+
themeIntent: intent
|
|
15460
|
+
})), /*#__PURE__*/React__default["default"].createElement(DonutCircle, null, /*#__PURE__*/React__default["default"].createElement(Typography.Text, {
|
|
15461
|
+
fontSize: "xlarge"
|
|
15462
|
+
}, "".concat(value, "%")))));
|
|
15463
|
+
};
|
|
15464
|
+
|
|
15465
|
+
var StyledWrapper = index$2(ReactNative.View)(function (_ref) {
|
|
15466
|
+
var theme = _ref.theme;
|
|
15467
|
+
return {
|
|
15468
|
+
height: theme.__hd__.progress.sizes.barHeight,
|
|
15469
|
+
alignSelf: 'stretch',
|
|
15470
|
+
backgroundColor: theme.__hd__.progress.colors.background,
|
|
15471
|
+
overflow: 'hidden'
|
|
15472
|
+
};
|
|
15473
|
+
});
|
|
15474
|
+
var StyledInner = index$2(ReactNative.Animated.View)(function (_ref2) {
|
|
15475
|
+
var theme = _ref2.theme,
|
|
15476
|
+
themeIntent = _ref2.themeIntent;
|
|
15477
|
+
return {
|
|
15478
|
+
flex: 1,
|
|
15479
|
+
alignSelf: 'stretch',
|
|
15480
|
+
backgroundColor: theme.__hd__.progress.colors[themeIntent]
|
|
15481
|
+
};
|
|
15482
|
+
});
|
|
15483
|
+
|
|
15484
|
+
var _excluded$1 = ["value", "intent", "style", "testID"];
|
|
15485
|
+
|
|
15486
|
+
var ProgressBar = function ProgressBar(_ref) {
|
|
15487
|
+
var value = _ref.value,
|
|
15488
|
+
_ref$intent = _ref.intent,
|
|
15489
|
+
intent = _ref$intent === void 0 ? 'primary' : _ref$intent,
|
|
15490
|
+
style = _ref.style,
|
|
15491
|
+
testID = _ref.testID,
|
|
15492
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$1);
|
|
15493
|
+
|
|
15494
|
+
var _useState = React.useState(0),
|
|
15495
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
15496
|
+
width = _useState2[0],
|
|
15497
|
+
setWidth = _useState2[1];
|
|
15498
|
+
|
|
15499
|
+
var progressAnimatedValue = React.useRef(new ReactNative.Animated.Value(0));
|
|
15500
|
+
React.useEffect(function () {
|
|
15501
|
+
var animation = ReactNative.Animated.timing(progressAnimatedValue.current, {
|
|
15502
|
+
toValue: value,
|
|
15503
|
+
useNativeDriver: true
|
|
15504
|
+
});
|
|
15505
|
+
animation.start();
|
|
15506
|
+
return function () {
|
|
15507
|
+
return animation.stop();
|
|
15508
|
+
};
|
|
15509
|
+
}, [value]);
|
|
15510
|
+
var interpolateTranslateX = progressAnimatedValue.current.interpolate({
|
|
15511
|
+
inputRange: [0, 100],
|
|
15512
|
+
outputRange: [-width, 0],
|
|
15513
|
+
extrapolate: 'clamp'
|
|
15514
|
+
});
|
|
15515
|
+
var interpolateBorderRadius = progressAnimatedValue.current.interpolate({
|
|
15516
|
+
inputRange: [99, 100],
|
|
15517
|
+
outputRange: [999, 0],
|
|
15518
|
+
extrapolate: 'clamp'
|
|
15519
|
+
});
|
|
15520
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledWrapper, _extends$3({}, nativeProps, {
|
|
15521
|
+
testID: testID,
|
|
15522
|
+
style: style
|
|
15523
|
+
}), /*#__PURE__*/React__default["default"].createElement(StyledInner, {
|
|
15524
|
+
themeIntent: intent,
|
|
15525
|
+
onLayout: function onLayout(_ref2) {
|
|
15526
|
+
var nativeEvent = _ref2.nativeEvent;
|
|
15527
|
+
return setWidth(nativeEvent.layout.width);
|
|
15528
|
+
},
|
|
15529
|
+
style: {
|
|
15530
|
+
transform: [{
|
|
15531
|
+
translateX: interpolateTranslateX
|
|
15532
|
+
}],
|
|
15533
|
+
borderTopRightRadius: interpolateBorderRadius,
|
|
15534
|
+
borderBottomRightRadius: interpolateBorderRadius
|
|
15535
|
+
}
|
|
15536
|
+
}));
|
|
15537
|
+
};
|
|
15538
|
+
|
|
15539
|
+
var Progress = {
|
|
15540
|
+
Circle: ProgressCircle,
|
|
15541
|
+
Bar: ProgressBar
|
|
15542
|
+
};
|
|
15543
|
+
|
|
15544
|
+
var childrenWithOverriddenStyle = function childrenWithOverriddenStyle(children) {
|
|
15545
|
+
return React.Children.map(children, function (child) {
|
|
15546
|
+
var element = child;
|
|
15547
|
+
return (
|
|
15548
|
+
/*#__PURE__*/
|
|
15549
|
+
// Add a wrapper to ensure layout is calculated correctly
|
|
15550
|
+
React__default["default"].createElement(ReactNative.View, {
|
|
15551
|
+
style: ReactNative.StyleSheet.absoluteFill,
|
|
15552
|
+
collapsable: false
|
|
15553
|
+
}, /*#__PURE__*/React__default["default"].cloneElement(element, _objectSpread2(_objectSpread2({}, element.props), {}, {
|
|
15554
|
+
// Override styles so that each page will fill the parent.
|
|
15555
|
+
style: [element.props.style, ReactNative.StyleSheet.absoluteFill]
|
|
15556
|
+
})))
|
|
15557
|
+
);
|
|
15558
|
+
});
|
|
15559
|
+
};
|
|
15560
|
+
|
|
15561
|
+
var VIEW_MANAGER_NAME = 'RNCViewPager';
|
|
15562
|
+
var PagerViewViewManager = ReactNative.requireNativeComponent(VIEW_MANAGER_NAME);
|
|
15563
|
+
function getViewManagerConfig() {
|
|
15564
|
+
var viewManagerName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : VIEW_MANAGER_NAME;
|
|
15565
|
+
return ReactNative.UIManager.getViewManagerConfig(viewManagerName);
|
|
15566
|
+
}
|
|
15567
|
+
|
|
15568
|
+
function _extends() {
|
|
15569
|
+
_extends = Object.assign || function (target) {
|
|
15570
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
15571
|
+
var source = arguments[i];
|
|
15572
|
+
|
|
15573
|
+
for (var key in source) {
|
|
15574
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
15575
|
+
target[key] = source[key];
|
|
15576
|
+
}
|
|
15577
|
+
}
|
|
15578
|
+
}
|
|
15579
|
+
|
|
15580
|
+
return target;
|
|
15581
|
+
};
|
|
15582
|
+
|
|
15583
|
+
return _extends.apply(this, arguments);
|
|
15584
|
+
}
|
|
15585
|
+
|
|
15586
|
+
function _defineProperty(obj, key, value) {
|
|
15587
|
+
if (key in obj) {
|
|
15588
|
+
Object.defineProperty(obj, key, {
|
|
15589
|
+
value: value,
|
|
15590
|
+
enumerable: true,
|
|
15591
|
+
configurable: true,
|
|
15592
|
+
writable: true
|
|
15593
|
+
});
|
|
15594
|
+
} else {
|
|
15595
|
+
obj[key] = value;
|
|
15596
|
+
}
|
|
15597
|
+
|
|
15598
|
+
return obj;
|
|
15599
|
+
}
|
|
15600
|
+
/**
|
|
15601
|
+
* Container that allows to flip left and right between child views. Each
|
|
15602
|
+
* child view of the `PagerView` will be treated as a separate page
|
|
15603
|
+
* and will be stretched to fill the `PagerView`.
|
|
15604
|
+
*
|
|
15605
|
+
* It is important all children are `<View>`s and not composite components.
|
|
15606
|
+
* You can set style properties like `padding` or `backgroundColor` for each
|
|
15607
|
+
* child. It is also important that each child have a `key` prop.
|
|
15608
|
+
*
|
|
15609
|
+
* Example:
|
|
15610
|
+
*
|
|
15611
|
+
* ```
|
|
15612
|
+
* render: function() {
|
|
15613
|
+
* return (
|
|
15614
|
+
* <PagerView
|
|
15615
|
+
* style={styles.PagerView}
|
|
15616
|
+
* initialPage={0}>
|
|
15617
|
+
* <View style={styles.pageStyle} key="1">
|
|
15618
|
+
* <Text>First page</Text>
|
|
15619
|
+
* </View>
|
|
15620
|
+
* <View style={styles.pageStyle} key="2">
|
|
15621
|
+
* <Text>Second page</Text>
|
|
15622
|
+
* </View>
|
|
15623
|
+
* </PagerView>
|
|
15624
|
+
* );
|
|
15625
|
+
* }
|
|
15626
|
+
*
|
|
15627
|
+
* ...
|
|
15628
|
+
*
|
|
15629
|
+
* var styles = {
|
|
15630
|
+
* ...
|
|
15631
|
+
* PagerView: {
|
|
15632
|
+
* flex: 1
|
|
15633
|
+
* },
|
|
15634
|
+
* pageStyle: {
|
|
15635
|
+
* alignItems: 'center',
|
|
15636
|
+
* padding: 20,
|
|
15637
|
+
* }
|
|
15638
|
+
* }
|
|
15639
|
+
* ```
|
|
15640
|
+
*/
|
|
15641
|
+
|
|
15642
|
+
var PagerView = /*#__PURE__*/function (_React$Component) {
|
|
15643
|
+
_inherits$1(PagerView, _React$Component);
|
|
15644
|
+
|
|
15645
|
+
var _super = _createSuper(PagerView);
|
|
15646
|
+
|
|
15647
|
+
function PagerView() {
|
|
15648
|
+
var _this;
|
|
15649
|
+
|
|
15650
|
+
_classCallCheck$1(this, PagerView);
|
|
15651
|
+
|
|
15652
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
15653
|
+
args[_key] = arguments[_key];
|
|
15654
|
+
}
|
|
15655
|
+
|
|
15656
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
15657
|
+
|
|
15658
|
+
_defineProperty(_assertThisInitialized$1(_this), "isScrolling", false);
|
|
15659
|
+
|
|
15660
|
+
_defineProperty(_assertThisInitialized$1(_this), "PagerView", /*#__PURE__*/React__default["default"].createRef());
|
|
15661
|
+
|
|
15662
|
+
_defineProperty(_assertThisInitialized$1(_this), "getInnerViewNode", function () {
|
|
15663
|
+
return _this.PagerView.current.getInnerViewNode();
|
|
15664
|
+
});
|
|
15665
|
+
|
|
15666
|
+
_defineProperty(_assertThisInitialized$1(_this), "_onPageScroll", function (e) {
|
|
15667
|
+
if (_this.props.onPageScroll) {
|
|
15668
|
+
_this.props.onPageScroll(e);
|
|
15669
|
+
} // Not implemented on iOS yet
|
|
15670
|
+
|
|
15671
|
+
|
|
15672
|
+
if (ReactNative.Platform.OS === 'android') {
|
|
15673
|
+
if (_this.props.keyboardDismissMode === 'on-drag') {
|
|
15674
|
+
ReactNative.Keyboard.dismiss();
|
|
15675
|
+
}
|
|
15676
|
+
}
|
|
15677
|
+
});
|
|
15678
|
+
|
|
15679
|
+
_defineProperty(_assertThisInitialized$1(_this), "_onPageScrollStateChanged", function (e) {
|
|
15680
|
+
if (_this.props.onPageScrollStateChanged) {
|
|
15681
|
+
_this.props.onPageScrollStateChanged(e);
|
|
15682
|
+
}
|
|
15683
|
+
|
|
15684
|
+
_this.isScrolling = e.nativeEvent.pageScrollState === 'dragging';
|
|
15685
|
+
});
|
|
15686
|
+
|
|
15687
|
+
_defineProperty(_assertThisInitialized$1(_this), "_onPageSelected", function (e) {
|
|
15688
|
+
if (_this.props.onPageSelected) {
|
|
15689
|
+
_this.props.onPageSelected(e);
|
|
15690
|
+
}
|
|
15691
|
+
});
|
|
15692
|
+
|
|
15693
|
+
_defineProperty(_assertThisInitialized$1(_this), "setPage", function (selectedPage) {
|
|
15694
|
+
ReactNative.UIManager.dispatchViewManagerCommand(ReactNative__default["default"].findNodeHandle(_assertThisInitialized$1(_this)), getViewManagerConfig().Commands.setPage, [selectedPage]);
|
|
15695
|
+
});
|
|
15696
|
+
|
|
15697
|
+
_defineProperty(_assertThisInitialized$1(_this), "setPageWithoutAnimation", function (selectedPage) {
|
|
15698
|
+
ReactNative.UIManager.dispatchViewManagerCommand(ReactNative__default["default"].findNodeHandle(_assertThisInitialized$1(_this)), getViewManagerConfig().Commands.setPageWithoutAnimation, [selectedPage]);
|
|
15699
|
+
});
|
|
15700
|
+
|
|
15701
|
+
_defineProperty(_assertThisInitialized$1(_this), "setScrollEnabled", function (scrollEnabled) {
|
|
15702
|
+
ReactNative.UIManager.dispatchViewManagerCommand(ReactNative__default["default"].findNodeHandle(_assertThisInitialized$1(_this)), getViewManagerConfig().Commands.setScrollEnabled, [scrollEnabled]);
|
|
15703
|
+
});
|
|
15704
|
+
|
|
15705
|
+
_defineProperty(_assertThisInitialized$1(_this), "_onMoveShouldSetResponderCapture", function () {
|
|
15706
|
+
return _this.isScrolling;
|
|
15707
|
+
});
|
|
15708
|
+
|
|
15709
|
+
return _this;
|
|
15710
|
+
}
|
|
15711
|
+
|
|
15712
|
+
_createClass$1(PagerView, [{
|
|
15713
|
+
key: "deducedLayoutDirection",
|
|
15714
|
+
get: function get() {
|
|
15715
|
+
var shouldUseDeviceRtlSetup = !this.props.layoutDirection || this.props.layoutDirection === 'locale';
|
|
15716
|
+
|
|
15717
|
+
if (shouldUseDeviceRtlSetup) {
|
|
15718
|
+
return ReactNative.I18nManager.isRTL ? 'rtl' : 'ltr';
|
|
15719
|
+
} else {
|
|
15720
|
+
return this.props.layoutDirection;
|
|
15721
|
+
}
|
|
15722
|
+
}
|
|
15723
|
+
}, {
|
|
15724
|
+
key: "render",
|
|
15725
|
+
value: function render() {
|
|
15726
|
+
return /*#__PURE__*/React__default["default"].createElement(PagerViewViewManager, _extends({}, this.props, {
|
|
15727
|
+
ref: this.PagerView
|
|
15728
|
+
/** TODO: Fix ref type */
|
|
15729
|
+
,
|
|
15730
|
+
style: this.props.style,
|
|
15731
|
+
layoutDirection: this.deducedLayoutDirection,
|
|
15732
|
+
onPageScroll: this._onPageScroll,
|
|
15733
|
+
onPageScrollStateChanged: this._onPageScrollStateChanged,
|
|
15734
|
+
onPageSelected: this._onPageSelected,
|
|
15735
|
+
onMoveShouldSetResponderCapture: this._onMoveShouldSetResponderCapture,
|
|
15736
|
+
children: childrenWithOverriddenStyle(this.props.children)
|
|
15737
|
+
}));
|
|
15738
|
+
}
|
|
15739
|
+
}]);
|
|
15740
|
+
|
|
15741
|
+
return PagerView;
|
|
15742
|
+
}(React__default["default"].Component);
|
|
15743
|
+
|
|
15744
|
+
var AnimatedPagerView = ReactNative.Animated.createAnimatedComponent(PagerView);
|
|
15745
|
+
var TabContainer$1 = index$2(ReactNative.View)({
|
|
15746
|
+
flex: 1,
|
|
15747
|
+
overflow: 'hidden'
|
|
15748
|
+
});
|
|
15749
|
+
var HeaderTabWrapper$1 = index$2(ReactNative.View)(function (_ref) {
|
|
15750
|
+
var theme = _ref.theme,
|
|
15751
|
+
themeInsets = _ref.themeInsets;
|
|
14006
15752
|
return {
|
|
14007
|
-
|
|
14008
|
-
|
|
14009
|
-
|
|
15753
|
+
paddingHorizontal: Math.max(themeInsets.left, themeInsets.right),
|
|
15754
|
+
borderBottomColor: theme.__hd__.tabs.colors.headerBottom,
|
|
15755
|
+
borderBottomWidth: theme.__hd__.tabs.borderWidths.headerBottom
|
|
14010
15756
|
};
|
|
14011
15757
|
});
|
|
14012
|
-
var
|
|
15758
|
+
var HeaderTab = index$2(ReactNative.View)({
|
|
15759
|
+
flexDirection: 'row'
|
|
15760
|
+
});
|
|
15761
|
+
var HeaderTabItem$1 = index$2(ReactNative.View)(function (_ref2) {
|
|
14013
15762
|
var theme = _ref2.theme;
|
|
14014
15763
|
return {
|
|
14015
|
-
|
|
14016
|
-
|
|
14017
|
-
|
|
14018
|
-
top: 0,
|
|
14019
|
-
bottom: 0,
|
|
14020
|
-
backgroundColor: theme.__hd__.fab.colors.backdropBackground
|
|
15764
|
+
flex: 1,
|
|
15765
|
+
alignItems: 'center',
|
|
15766
|
+
paddingVertical: theme.__hd__.tabs.space.itemVerticalPadding
|
|
14021
15767
|
};
|
|
14022
15768
|
});
|
|
14023
|
-
var
|
|
14024
|
-
|
|
15769
|
+
var ContentWrapper$1 = index$2(AnimatedPagerView)({
|
|
15770
|
+
flex: 1
|
|
15771
|
+
});
|
|
15772
|
+
var TabScreen$1 = index$2(ReactNative.View)({
|
|
15773
|
+
flex: 1
|
|
15774
|
+
});
|
|
15775
|
+
var StyledIndicator = index$2(ReactNative.Animated.View)(function (_ref3) {
|
|
15776
|
+
var theme = _ref3.theme,
|
|
15777
|
+
themeWidth = _ref3.themeWidth;
|
|
14025
15778
|
return {
|
|
14026
|
-
|
|
14027
|
-
|
|
14028
|
-
|
|
14029
|
-
|
|
14030
|
-
|
|
14031
|
-
textAlign: 'right'
|
|
15779
|
+
width: themeWidth,
|
|
15780
|
+
height: theme.__hd__.tabs.sizes.indicator,
|
|
15781
|
+
backgroundColor: theme.__hd__.tabs.colors.text,
|
|
15782
|
+
position: 'absolute',
|
|
15783
|
+
bottom: 0
|
|
14032
15784
|
};
|
|
14033
15785
|
});
|
|
14034
15786
|
|
|
14035
|
-
var
|
|
14036
|
-
var
|
|
14037
|
-
|
|
14038
|
-
|
|
14039
|
-
|
|
14040
|
-
|
|
14041
|
-
|
|
14042
|
-
|
|
14043
|
-
|
|
14044
|
-
|
|
14045
|
-
};
|
|
14046
|
-
|
|
14047
|
-
var ActionGroup = function ActionGroup(_ref2) {
|
|
14048
|
-
var headerTitle = _ref2.headerTitle,
|
|
14049
|
-
onPress = _ref2.onPress,
|
|
14050
|
-
active = _ref2.active,
|
|
14051
|
-
style = _ref2.style,
|
|
14052
|
-
items = _ref2.items,
|
|
14053
|
-
testID = _ref2.testID;
|
|
14054
|
-
var tranlateXAnimation = React.useRef(new reactNative.Animated.Value(active ? 1 : 0));
|
|
14055
|
-
React.useEffect(function () {
|
|
14056
|
-
var animation = reactNative.Animated.timing(tranlateXAnimation.current, {
|
|
14057
|
-
toValue: active ? 1 : 0,
|
|
14058
|
-
useNativeDriver: true
|
|
14059
|
-
});
|
|
14060
|
-
animation.start();
|
|
14061
|
-
}, [active]);
|
|
14062
|
-
var interpolatedTranlateXAnimation = tranlateXAnimation.current.interpolate({
|
|
14063
|
-
inputRange: [0, 1],
|
|
14064
|
-
outputRange: [400, 0]
|
|
14065
|
-
});
|
|
14066
|
-
var interpolatedOpacityAnimation = tranlateXAnimation.current.interpolate({
|
|
14067
|
-
inputRange: [0, 1],
|
|
14068
|
-
outputRange: [0, 0.9]
|
|
15787
|
+
var ActiveTabIndicator = function ActiveTabIndicator(_ref) {
|
|
15788
|
+
var scrollOffsetAnimatedValue = _ref.scrollOffsetAnimatedValue,
|
|
15789
|
+
positionAnimatedValue = _ref.positionAnimatedValue,
|
|
15790
|
+
tabsLength = _ref.tabsLength,
|
|
15791
|
+
tabsWidth = _ref.tabsWidth;
|
|
15792
|
+
var inputRange = [0, tabsLength];
|
|
15793
|
+
var indicatorWidth = tabsWidth / tabsLength;
|
|
15794
|
+
var translateX = ReactNative.Animated.add(scrollOffsetAnimatedValue, positionAnimatedValue).interpolate({
|
|
15795
|
+
inputRange: inputRange,
|
|
15796
|
+
outputRange: [0, tabsLength * indicatorWidth]
|
|
14069
15797
|
});
|
|
14070
|
-
return /*#__PURE__*/React__default["default"].createElement(
|
|
14071
|
-
|
|
14072
|
-
pointerEvents: "box-none",
|
|
14073
|
-
style: style
|
|
14074
|
-
}, /*#__PURE__*/React__default["default"].createElement(StyledBackdrop, {
|
|
14075
|
-
pointerEvents: active ? 'auto' : 'box-none',
|
|
14076
|
-
testID: "back-drop",
|
|
14077
|
-
style: {
|
|
14078
|
-
opacity: interpolatedOpacityAnimation
|
|
14079
|
-
}
|
|
14080
|
-
}), /*#__PURE__*/React__default["default"].createElement(StyledActionGroupContainer, {
|
|
14081
|
-
testID: "action-group",
|
|
15798
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledIndicator, {
|
|
15799
|
+
themeWidth: indicatorWidth,
|
|
14082
15800
|
style: {
|
|
14083
15801
|
transform: [{
|
|
14084
|
-
translateX:
|
|
15802
|
+
translateX: translateX
|
|
14085
15803
|
}]
|
|
14086
15804
|
}
|
|
14087
|
-
}
|
|
14088
|
-
testID: "header-text"
|
|
14089
|
-
}, headerTitle), /*#__PURE__*/React__default["default"].createElement(ActionItemsListComponent, {
|
|
14090
|
-
items: items
|
|
14091
|
-
})), /*#__PURE__*/React__default["default"].createElement(StyledFAB, {
|
|
14092
|
-
testID: "fab",
|
|
14093
|
-
icon: "add",
|
|
14094
|
-
onPress: onPress,
|
|
14095
|
-
animated: true,
|
|
14096
|
-
active: active
|
|
14097
|
-
}));
|
|
15805
|
+
});
|
|
14098
15806
|
};
|
|
14099
15807
|
|
|
14100
|
-
var
|
|
14101
|
-
|
|
14102
|
-
});
|
|
14103
|
-
|
|
14104
|
-
var TabScreen = index$1(reactNative.View)(function (_ref) {
|
|
14105
|
-
var themeVisibility = _ref.themeVisibility;
|
|
14106
|
-
return {
|
|
14107
|
-
flex: 1,
|
|
14108
|
-
display: themeVisibility === false ? 'none' : 'flex'
|
|
14109
|
-
};
|
|
15808
|
+
var TabScreen = index$2(ReactNative.View)({
|
|
15809
|
+
flex: 1
|
|
14110
15810
|
});
|
|
14111
|
-
var TabContainer = index$
|
|
15811
|
+
var TabContainer = index$2(ReactNative.View)({
|
|
14112
15812
|
flex: 1,
|
|
14113
15813
|
overflow: 'hidden'
|
|
14114
15814
|
});
|
|
14115
|
-
var ContentWrapper = index$
|
|
15815
|
+
var ContentWrapper = index$2(PagerView)({
|
|
14116
15816
|
flex: 1
|
|
14117
15817
|
});
|
|
14118
|
-
var HeaderTabWrapper = index$
|
|
14119
|
-
var
|
|
14120
|
-
|
|
15818
|
+
var HeaderTabWrapper = index$2(ReactNative.View)(function (_ref) {
|
|
15819
|
+
var theme = _ref.theme,
|
|
15820
|
+
themeInsets = _ref.themeInsets;
|
|
14121
15821
|
return {
|
|
14122
|
-
|
|
14123
|
-
|
|
14124
|
-
|
|
15822
|
+
paddingHorizontal: Math.max(themeInsets.left, themeInsets.right),
|
|
15823
|
+
borderBottomColor: theme.__hd__.tabs.colors.headerBottom,
|
|
15824
|
+
borderBottomWidth: theme.__hd__.tabs.borderWidths.headerBottom
|
|
14125
15825
|
};
|
|
14126
15826
|
});
|
|
14127
|
-
var
|
|
14128
|
-
var theme =
|
|
15827
|
+
var HeaderTabItem = index$2(ReactNative.Animated.View)(function (_ref2) {
|
|
15828
|
+
var theme = _ref2.theme;
|
|
14129
15829
|
return {
|
|
14130
|
-
|
|
14131
|
-
|
|
15830
|
+
paddingHorizontal: theme.__hd__.tabs.space.itemHorizontalPadding,
|
|
15831
|
+
paddingVertical: theme.__hd__.tabs.space.itemVerticalPadding
|
|
14132
15832
|
};
|
|
14133
15833
|
});
|
|
14134
|
-
var
|
|
14135
|
-
var theme =
|
|
14136
|
-
return {
|
|
14137
|
-
|
|
14138
|
-
|
|
14139
|
-
|
|
14140
|
-
paddingRight: theme.__hd__.tabs.space.itemHorizontalPadding,
|
|
14141
|
-
paddingTop: theme.__hd__.tabs.space.itemVerticalPadding,
|
|
14142
|
-
paddingBottom: theme.__hd__.tabs.space.itemVerticalPadding
|
|
14143
|
-
};
|
|
15834
|
+
var HeaderTabItemOutlineWrapper = index$2(ReactNative.View)(function (_ref3) {
|
|
15835
|
+
var theme = _ref3.theme;
|
|
15836
|
+
return _objectSpread2({
|
|
15837
|
+
paddingHorizontal: theme.__hd__.tabs.space.itemHorizontalPadding,
|
|
15838
|
+
paddingVertical: theme.__hd__.tabs.space.itemVerticalPadding
|
|
15839
|
+
}, ReactNative.StyleSheet.absoluteFillObject);
|
|
14144
15840
|
});
|
|
14145
|
-
var
|
|
14146
|
-
var
|
|
14147
|
-
|
|
15841
|
+
var HeaderTabItemOutline = index$2(ReactNative.Animated.View)(function (_ref4) {
|
|
15842
|
+
var theme = _ref4.theme,
|
|
15843
|
+
themeActive = _ref4.themeActive;
|
|
14148
15844
|
return {
|
|
14149
|
-
|
|
15845
|
+
borderRadius: theme.__hd__.tabs.radii.outline,
|
|
15846
|
+
backgroundColor: themeActive ? theme.__hd__.tabs.colors.activeBackground : undefined
|
|
14150
15847
|
};
|
|
14151
15848
|
});
|
|
14152
|
-
var
|
|
14153
|
-
var
|
|
14154
|
-
theme = _ref6.theme;
|
|
15849
|
+
var HeaderTabItemWrapper = index$2(ReactNative.View)(function (_ref5) {
|
|
15850
|
+
var theme = _ref5.theme;
|
|
14155
15851
|
return {
|
|
14156
|
-
|
|
14157
|
-
|
|
15852
|
+
paddingHorizontal: theme.__hd__.tabs.space.outlineHorizontalPadding,
|
|
15853
|
+
paddingVertical: theme.__hd__.tabs.space.outlineVerticalPadding
|
|
14158
15854
|
};
|
|
14159
15855
|
});
|
|
14160
15856
|
|
|
14161
|
-
var
|
|
15857
|
+
var useAnimatedValueArray = function useAnimatedValueArray(initialValues) {
|
|
15858
|
+
var refs = React__default["default"].useRef([]);
|
|
15859
|
+
refs.current.length = initialValues.length;
|
|
15860
|
+
initialValues.forEach(function (initialValue, i) {
|
|
15861
|
+
var _refs$current$i;
|
|
14162
15862
|
|
|
14163
|
-
|
|
14164
|
-
|
|
14165
|
-
|
|
14166
|
-
|
|
14167
|
-
selectedTabKey = _ref.selectedTabKey,
|
|
14168
|
-
tabs = _ref.tabs,
|
|
14169
|
-
nativeProps = _objectWithoutProperties$1(_ref, _excluded);
|
|
15863
|
+
refs.current[i] = (_refs$current$i = refs.current[i]) !== null && _refs$current$i !== void 0 ? _refs$current$i : new ReactNative.Animated.Value(initialValue);
|
|
15864
|
+
});
|
|
15865
|
+
return refs.current;
|
|
15866
|
+
};
|
|
14170
15867
|
|
|
14171
|
-
|
|
14172
|
-
var
|
|
14173
|
-
|
|
14174
|
-
|
|
14175
|
-
|
|
15868
|
+
var getTabItem$1 = function getTabItem(_ref) {
|
|
15869
|
+
var item = _ref.item,
|
|
15870
|
+
color = _ref.color,
|
|
15871
|
+
active = _ref.active;
|
|
15872
|
+
|
|
15873
|
+
if (isHeroIcon(item)) {
|
|
15874
|
+
return /*#__PURE__*/React__default["default"].createElement(Icon, {
|
|
15875
|
+
icon: item,
|
|
15876
|
+
testID: "hero-icon-".concat(item),
|
|
15877
|
+
size: "small",
|
|
15878
|
+
intent: active ? 'info' : 'text'
|
|
15879
|
+
});
|
|
15880
|
+
}
|
|
14176
15881
|
|
|
14177
|
-
|
|
14178
|
-
|
|
14179
|
-
|
|
14180
|
-
|
|
15882
|
+
if (typeof item === 'string') {
|
|
15883
|
+
return /*#__PURE__*/React__default["default"].createElement(Typography.Text, {
|
|
15884
|
+
fontWeight: active ? 'semi-bold' : 'regular',
|
|
15885
|
+
numberOfLines: 1,
|
|
15886
|
+
style: {
|
|
15887
|
+
color: color
|
|
15888
|
+
}
|
|
15889
|
+
}, item);
|
|
15890
|
+
}
|
|
14181
15891
|
|
|
14182
|
-
|
|
14183
|
-
|
|
14184
|
-
|
|
14185
|
-
|
|
15892
|
+
return item({
|
|
15893
|
+
color: color
|
|
15894
|
+
});
|
|
15895
|
+
};
|
|
14186
15896
|
|
|
15897
|
+
var ScrollableTab = function ScrollableTab(_ref2) {
|
|
15898
|
+
var onTabPress = _ref2.onTabPress,
|
|
15899
|
+
selectedTabKey = _ref2.selectedTabKey,
|
|
15900
|
+
tabs = _ref2.tabs,
|
|
15901
|
+
containerStyle = _ref2.containerStyle,
|
|
15902
|
+
barStyle = _ref2.barStyle,
|
|
15903
|
+
_ref2$lazy = _ref2.lazy,
|
|
15904
|
+
lazy = _ref2$lazy === void 0 ? false : _ref2$lazy,
|
|
15905
|
+
_ref2$lazyPreloadDist = _ref2.lazyPreloadDistance,
|
|
15906
|
+
lazyPreloadDistance = _ref2$lazyPreloadDist === void 0 ? 1 : _ref2$lazyPreloadDist;
|
|
15907
|
+
var flatListRef = React__default["default"].useRef(null);
|
|
15908
|
+
var pagerViewRef = React__default["default"].useRef(null);
|
|
15909
|
+
var insets = reactNativeSafeAreaContext.useSafeAreaInsets();
|
|
15910
|
+
var theme = useTheme();
|
|
15911
|
+
var selectedTabIndex = tabs.findIndex(function (item) {
|
|
15912
|
+
return item.key === selectedTabKey;
|
|
15913
|
+
});
|
|
15914
|
+
var tabsAnims = useAnimatedValueArray(tabs.map(function (_, i) {
|
|
15915
|
+
return i === selectedTabIndex ? 1 : 0;
|
|
15916
|
+
}));
|
|
15917
|
+
React__default["default"].useEffect(function () {
|
|
14187
15918
|
if (selectedTabIndex !== -1) {
|
|
14188
15919
|
var _flatListRef$current;
|
|
14189
15920
|
|
|
@@ -14192,18 +15923,25 @@ var Tabs = function Tabs(_ref) {
|
|
|
14192
15923
|
viewPosition: 0.5
|
|
14193
15924
|
});
|
|
14194
15925
|
}
|
|
14195
|
-
}, [selectedTabKey, tabs]);
|
|
14196
|
-
|
|
14197
|
-
if (!loaded.includes(selectedTabKey)) {
|
|
14198
|
-
// Set the current tab to be loaded if it was not loaded before
|
|
14199
|
-
setLoaded(function (loadedState) {
|
|
14200
|
-
return [].concat(_toConsumableArray$1(loadedState), [selectedTabKey]);
|
|
14201
|
-
});
|
|
14202
|
-
}
|
|
14203
15926
|
|
|
14204
|
-
|
|
14205
|
-
|
|
14206
|
-
|
|
15927
|
+
var animation = ReactNative.Animated.parallel(_toConsumableArray$1(tabs.map(function (_, i) {
|
|
15928
|
+
return ReactNative.Animated.timing(tabsAnims[i], {
|
|
15929
|
+
toValue: i === selectedTabIndex ? 1 : 0,
|
|
15930
|
+
duration: 150,
|
|
15931
|
+
useNativeDriver: true
|
|
15932
|
+
});
|
|
15933
|
+
})));
|
|
15934
|
+
animation.start();
|
|
15935
|
+
return function () {
|
|
15936
|
+
return animation.stop();
|
|
15937
|
+
};
|
|
15938
|
+
}, [selectedTabIndex]);
|
|
15939
|
+
return /*#__PURE__*/React__default["default"].createElement(TabContainer, {
|
|
15940
|
+
style: containerStyle
|
|
15941
|
+
}, /*#__PURE__*/React__default["default"].createElement(HeaderTabWrapper, {
|
|
15942
|
+
themeInsets: insets,
|
|
15943
|
+
style: barStyle
|
|
15944
|
+
}, /*#__PURE__*/React__default["default"].createElement(ReactNative.FlatList, {
|
|
14207
15945
|
ref: flatListRef,
|
|
14208
15946
|
horizontal: true,
|
|
14209
15947
|
data: tabs,
|
|
@@ -14211,8 +15949,8 @@ var Tabs = function Tabs(_ref) {
|
|
|
14211
15949
|
return String(tab.key);
|
|
14212
15950
|
},
|
|
14213
15951
|
showsHorizontalScrollIndicator: false,
|
|
14214
|
-
onScrollToIndexFailed: function onScrollToIndexFailed(
|
|
14215
|
-
var index =
|
|
15952
|
+
onScrollToIndexFailed: function onScrollToIndexFailed(_ref3) {
|
|
15953
|
+
var index = _ref3.index;
|
|
14216
15954
|
setTimeout(function () {
|
|
14217
15955
|
var _flatListRef$current2;
|
|
14218
15956
|
|
|
@@ -14222,67 +15960,270 @@ var Tabs = function Tabs(_ref) {
|
|
|
14222
15960
|
});
|
|
14223
15961
|
}, 100);
|
|
14224
15962
|
},
|
|
14225
|
-
|
|
14226
|
-
|
|
15963
|
+
contentContainerStyle: {
|
|
15964
|
+
paddingHorizontal: theme.__hd__.tabs.space.flatListHorizontalPadding
|
|
15965
|
+
},
|
|
15966
|
+
renderItem: function renderItem(_ref4) {
|
|
15967
|
+
var tab = _ref4.item,
|
|
15968
|
+
index = _ref4.index;
|
|
14227
15969
|
var key = tab.key,
|
|
14228
|
-
|
|
14229
|
-
|
|
14230
|
-
|
|
15970
|
+
testID = tab.testID,
|
|
15971
|
+
activeItem = tab.activeItem,
|
|
15972
|
+
originalInactiveItem = tab.inactiveItem,
|
|
15973
|
+
_tab$showBadge = tab.showBadge,
|
|
15974
|
+
showBadge = _tab$showBadge === void 0 ? false : _tab$showBadge;
|
|
14231
15975
|
var active = selectedTabKey === key;
|
|
14232
|
-
|
|
15976
|
+
var activeAnimated = tabsAnims[index];
|
|
15977
|
+
var outlineScale = active ? activeAnimated.interpolate({
|
|
15978
|
+
inputRange: [0, 1],
|
|
15979
|
+
outputRange: [0.5, 1]
|
|
15980
|
+
}) : 0;
|
|
15981
|
+
var inactiveItem = originalInactiveItem !== null && originalInactiveItem !== void 0 ? originalInactiveItem : activeItem;
|
|
15982
|
+
var tabItem = getTabItem$1({
|
|
15983
|
+
item: active ? activeItem : inactiveItem,
|
|
15984
|
+
color: active ? theme.__hd__.tabs.colors.active : theme.__hd__.tabs.colors.inactive,
|
|
15985
|
+
active: active
|
|
15986
|
+
});
|
|
15987
|
+
return /*#__PURE__*/React__default["default"].createElement(ReactNative.TouchableWithoutFeedback, {
|
|
14233
15988
|
key: key,
|
|
14234
15989
|
onPress: function onPress() {
|
|
14235
|
-
|
|
15990
|
+
var _pagerViewRef$current;
|
|
15991
|
+
|
|
15992
|
+
onTabPress(key);
|
|
15993
|
+
(_pagerViewRef$current = pagerViewRef.current) === null || _pagerViewRef$current === void 0 ? void 0 : _pagerViewRef$current.setPage(index);
|
|
14236
15994
|
},
|
|
14237
15995
|
testID: testID
|
|
14238
|
-
}, /*#__PURE__*/React__default["default"].createElement(HeaderTabItem, null, /*#__PURE__*/React__default["default"].createElement(
|
|
14239
|
-
|
|
14240
|
-
|
|
14241
|
-
|
|
14242
|
-
|
|
14243
|
-
|
|
14244
|
-
|
|
14245
|
-
|
|
14246
|
-
},
|
|
14247
|
-
|
|
14248
|
-
|
|
15996
|
+
}, /*#__PURE__*/React__default["default"].createElement(HeaderTabItem, null, /*#__PURE__*/React__default["default"].createElement(HeaderTabItemOutlineWrapper, null, /*#__PURE__*/React__default["default"].createElement(HeaderTabItemOutline, {
|
|
15997
|
+
themeActive: active,
|
|
15998
|
+
style: {
|
|
15999
|
+
flex: 1,
|
|
16000
|
+
transform: [{
|
|
16001
|
+
scaleX: outlineScale
|
|
16002
|
+
}]
|
|
16003
|
+
}
|
|
16004
|
+
})), /*#__PURE__*/React__default["default"].createElement(HeaderTabItemWrapper, null, /*#__PURE__*/React__default["default"].createElement(Badge$1.Status, {
|
|
16005
|
+
visible: showBadge
|
|
16006
|
+
}, tabItem))));
|
|
16007
|
+
}
|
|
16008
|
+
})), /*#__PURE__*/React__default["default"].createElement(ContentWrapper, {
|
|
16009
|
+
initialPage: selectedTabIndex,
|
|
16010
|
+
ref: pagerViewRef,
|
|
16011
|
+
onPageSelected: function onPageSelected(e) {
|
|
16012
|
+
var index = e.nativeEvent.position;
|
|
16013
|
+
var selectedItem = tabs[index];
|
|
16014
|
+
|
|
16015
|
+
if (selectedItem) {
|
|
16016
|
+
onTabPress(selectedItem.key);
|
|
16017
|
+
}
|
|
16018
|
+
}
|
|
16019
|
+
}, tabs.map(function (tab, index) {
|
|
14249
16020
|
var key = tab.key,
|
|
14250
16021
|
component = tab.component,
|
|
14251
16022
|
testID = tab.testID;
|
|
14252
16023
|
var active = selectedTabKey === key;
|
|
16024
|
+
var isLazyScreen = lazy && Math.abs(selectedTabIndex - index) > lazyPreloadDistance;
|
|
16025
|
+
return /*#__PURE__*/React__default["default"].createElement(TabScreen, {
|
|
16026
|
+
key: key,
|
|
16027
|
+
testID: testID ? "tab-screen-".concat(testID) : undefined,
|
|
16028
|
+
pointerEvents: active ? 'auto' : 'none',
|
|
16029
|
+
accessibilityElementsHidden: !active,
|
|
16030
|
+
importantForAccessibility: active ? 'auto' : 'no-hide-descendants',
|
|
16031
|
+
collapsable: false
|
|
16032
|
+
}, isLazyScreen ? null : component);
|
|
16033
|
+
})));
|
|
16034
|
+
};
|
|
14253
16035
|
|
|
14254
|
-
|
|
14255
|
-
|
|
14256
|
-
|
|
16036
|
+
var getTabItem = function getTabItem(_ref) {
|
|
16037
|
+
var item = _ref.item,
|
|
16038
|
+
color = _ref.color,
|
|
16039
|
+
active = _ref.active;
|
|
16040
|
+
|
|
16041
|
+
if (typeof item === 'string') {
|
|
16042
|
+
return /*#__PURE__*/React__default["default"].createElement(Typography.Text, {
|
|
16043
|
+
fontWeight: active ? 'semi-bold' : 'regular',
|
|
16044
|
+
numberOfLines: 1,
|
|
16045
|
+
style: {
|
|
16046
|
+
color: color
|
|
16047
|
+
}
|
|
16048
|
+
}, item);
|
|
16049
|
+
}
|
|
14257
16050
|
|
|
14258
|
-
|
|
14259
|
-
|
|
14260
|
-
|
|
16051
|
+
return item({
|
|
16052
|
+
color: color
|
|
16053
|
+
});
|
|
16054
|
+
};
|
|
16055
|
+
|
|
16056
|
+
var Tabs = function Tabs(_ref2) {
|
|
16057
|
+
var onTabPress = _ref2.onTabPress,
|
|
16058
|
+
selectedTabKey = _ref2.selectedTabKey,
|
|
16059
|
+
tabs = _ref2.tabs,
|
|
16060
|
+
containerStyle = _ref2.containerStyle,
|
|
16061
|
+
barStyle = _ref2.barStyle,
|
|
16062
|
+
_ref2$lazy = _ref2.lazy,
|
|
16063
|
+
lazy = _ref2$lazy === void 0 ? false : _ref2$lazy,
|
|
16064
|
+
_ref2$lazyPreloadDist = _ref2.lazyPreloadDistance,
|
|
16065
|
+
lazyPreloadDistance = _ref2$lazyPreloadDist === void 0 ? 1 : _ref2$lazyPreloadDist;
|
|
16066
|
+
var theme = useTheme();
|
|
16067
|
+
var insets = reactNativeSafeAreaContext.useSafeAreaInsets();
|
|
16068
|
+
var pagerViewRef = React__default["default"].useRef(null);
|
|
16069
|
+
var selectedTabIndex = tabs.findIndex(function (item) {
|
|
16070
|
+
return item.key === selectedTabKey;
|
|
16071
|
+
});
|
|
16072
|
+
var scrollOffsetAnimatedValue = React__default["default"].useRef(new ReactNative.Animated.Value(0)).current;
|
|
16073
|
+
var positionAnimatedValue = React__default["default"].useRef(new ReactNative.Animated.Value(0)).current;
|
|
16074
|
+
|
|
16075
|
+
var _React$useState = React__default["default"].useState(0),
|
|
16076
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
16077
|
+
tabsWidth = _React$useState2[0],
|
|
16078
|
+
setTabsWidth = _React$useState2[1];
|
|
16079
|
+
|
|
16080
|
+
return /*#__PURE__*/React__default["default"].createElement(TabContainer$1, {
|
|
16081
|
+
style: containerStyle
|
|
16082
|
+
}, /*#__PURE__*/React__default["default"].createElement(HeaderTabWrapper$1, {
|
|
16083
|
+
themeInsets: insets,
|
|
16084
|
+
style: barStyle
|
|
16085
|
+
}, /*#__PURE__*/React__default["default"].createElement(ReactNative.View, null, /*#__PURE__*/React__default["default"].createElement(HeaderTab, {
|
|
16086
|
+
onLayout: function onLayout(e) {
|
|
16087
|
+
var width = e.nativeEvent.layout.width;
|
|
16088
|
+
|
|
16089
|
+
if (tabsWidth !== width) {
|
|
16090
|
+
setTabsWidth(width);
|
|
16091
|
+
}
|
|
14261
16092
|
}
|
|
16093
|
+
}, tabs.map(function (tab, index) {
|
|
16094
|
+
var key = tab.key,
|
|
16095
|
+
testID = tab.testID,
|
|
16096
|
+
activeItem = tab.activeItem,
|
|
16097
|
+
originalInactiveItem = tab.inactiveItem,
|
|
16098
|
+
_tab$showBadge = tab.showBadge,
|
|
16099
|
+
showBadge = _tab$showBadge === void 0 ? false : _tab$showBadge;
|
|
16100
|
+
var active = selectedTabKey === key;
|
|
16101
|
+
var inactiveItem = originalInactiveItem !== null && originalInactiveItem !== void 0 ? originalInactiveItem : activeItem;
|
|
16102
|
+
var tabItem = getTabItem({
|
|
16103
|
+
item: active ? activeItem : inactiveItem,
|
|
16104
|
+
color: theme.__hd__.tabs.colors.text,
|
|
16105
|
+
active: active
|
|
16106
|
+
});
|
|
16107
|
+
return /*#__PURE__*/React__default["default"].createElement(ReactNative.TouchableWithoutFeedback, {
|
|
16108
|
+
key: key,
|
|
16109
|
+
onPress: function onPress() {
|
|
16110
|
+
var _pagerViewRef$current;
|
|
14262
16111
|
|
|
14263
|
-
|
|
16112
|
+
onTabPress(key);
|
|
16113
|
+
(_pagerViewRef$current = pagerViewRef.current) === null || _pagerViewRef$current === void 0 ? void 0 : _pagerViewRef$current.setPage(index);
|
|
16114
|
+
},
|
|
16115
|
+
testID: testID
|
|
16116
|
+
}, /*#__PURE__*/React__default["default"].createElement(HeaderTabItem$1, null, /*#__PURE__*/React__default["default"].createElement(Badge$1.Status, {
|
|
16117
|
+
visible: showBadge
|
|
16118
|
+
}, tabItem)));
|
|
16119
|
+
})), /*#__PURE__*/React__default["default"].createElement(ActiveTabIndicator, {
|
|
16120
|
+
positionAnimatedValue: positionAnimatedValue,
|
|
16121
|
+
scrollOffsetAnimatedValue: scrollOffsetAnimatedValue,
|
|
16122
|
+
tabsLength: tabs.length,
|
|
16123
|
+
tabsWidth: tabsWidth
|
|
16124
|
+
}))), /*#__PURE__*/React__default["default"].createElement(ContentWrapper$1, {
|
|
16125
|
+
initialPage: selectedTabIndex,
|
|
16126
|
+
ref: pagerViewRef,
|
|
16127
|
+
onPageSelected: function onPageSelected(e) {
|
|
16128
|
+
var index = e.nativeEvent.position;
|
|
16129
|
+
var selectedItem = tabs[index];
|
|
16130
|
+
|
|
16131
|
+
if (selectedItem) {
|
|
16132
|
+
onTabPress(selectedItem.key);
|
|
16133
|
+
}
|
|
16134
|
+
},
|
|
16135
|
+
onPageScroll: ReactNative.Animated.event([{
|
|
16136
|
+
nativeEvent: {
|
|
16137
|
+
offset: scrollOffsetAnimatedValue,
|
|
16138
|
+
position: positionAnimatedValue
|
|
16139
|
+
}
|
|
16140
|
+
}], {
|
|
16141
|
+
useNativeDriver: true
|
|
16142
|
+
})
|
|
16143
|
+
}, tabs.map(function (tab, index) {
|
|
16144
|
+
var key = tab.key,
|
|
16145
|
+
component = tab.component,
|
|
16146
|
+
testID = tab.testID;
|
|
16147
|
+
var active = selectedTabKey === key;
|
|
16148
|
+
var isLazyScreen = lazy && Math.abs(selectedTabIndex - index) > lazyPreloadDistance;
|
|
16149
|
+
return /*#__PURE__*/React__default["default"].createElement(TabScreen$1, {
|
|
14264
16150
|
key: key,
|
|
14265
16151
|
testID: testID ? "tab-screen-".concat(testID) : undefined,
|
|
14266
16152
|
pointerEvents: active ? 'auto' : 'none',
|
|
14267
16153
|
accessibilityElementsHidden: !active,
|
|
14268
16154
|
importantForAccessibility: active ? 'auto' : 'no-hide-descendants',
|
|
14269
|
-
collapsable: false
|
|
14270
|
-
|
|
14271
|
-
// This is an workaround for a bug where the clipped view never re-appears.
|
|
14272
|
-
isIOS ? selectedTabKey !== key : true,
|
|
14273
|
-
themeVisibility: active
|
|
14274
|
-
}, component);
|
|
16155
|
+
collapsable: false
|
|
16156
|
+
}, isLazyScreen ? null : component);
|
|
14275
16157
|
})));
|
|
14276
16158
|
};
|
|
14277
16159
|
|
|
14278
|
-
|
|
16160
|
+
var index = Object.assign(Tabs, {
|
|
16161
|
+
Scroll: ScrollableTab
|
|
16162
|
+
});
|
|
16163
|
+
|
|
16164
|
+
var BACKGROUND_INTENTS = {
|
|
16165
|
+
success: 'successBackground',
|
|
16166
|
+
warning: 'warningBackground',
|
|
16167
|
+
danger: 'dangerBackground',
|
|
16168
|
+
info: 'infoBackground'
|
|
16169
|
+
};
|
|
16170
|
+
var StyledView = index$2(ReactNative.View)(function (_ref) {
|
|
16171
|
+
var themeIntent = _ref.themeIntent,
|
|
16172
|
+
theme = _ref.theme;
|
|
16173
|
+
return {
|
|
16174
|
+
borderWidth: theme.__hd__.tag.borderWidths["default"],
|
|
16175
|
+
borderRadius: theme.__hd__.tag.radii["default"],
|
|
16176
|
+
paddingVertical: theme.__hd__.tag.space.verticalPadding,
|
|
16177
|
+
paddingHorizontal: theme.__hd__.tag.space.horizontalPadding,
|
|
16178
|
+
borderColor: theme.__hd__.tag.colors[themeIntent],
|
|
16179
|
+
backgroundColor: theme.__hd__.tag.colors[BACKGROUND_INTENTS[themeIntent]]
|
|
16180
|
+
};
|
|
16181
|
+
});
|
|
16182
|
+
var StyledText = index$2(ReactNative.Text)(function (_ref2) {
|
|
16183
|
+
var themeIntent = _ref2.themeIntent,
|
|
16184
|
+
theme = _ref2.theme;
|
|
16185
|
+
return {
|
|
16186
|
+
fontFamily: theme.__hd__.tag.fonts["default"],
|
|
16187
|
+
fontSize: theme.__hd__.tag.fontSizes["default"],
|
|
16188
|
+
color: theme.__hd__.tag.colors[themeIntent],
|
|
16189
|
+
includeFontPadding: false,
|
|
16190
|
+
textAlignVertical: 'center',
|
|
16191
|
+
textAlign: 'center'
|
|
16192
|
+
};
|
|
16193
|
+
});
|
|
16194
|
+
|
|
16195
|
+
var _excluded = ["content", "intent", "style", "testID"];
|
|
16196
|
+
|
|
16197
|
+
var Tag = function Tag(_ref) {
|
|
16198
|
+
var content = _ref.content,
|
|
16199
|
+
_ref$intent = _ref.intent,
|
|
16200
|
+
intent = _ref$intent === void 0 ? 'info' : _ref$intent,
|
|
16201
|
+
style = _ref.style,
|
|
16202
|
+
testID = _ref.testID,
|
|
16203
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded);
|
|
16204
|
+
|
|
16205
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledView, _extends$3({}, nativeProps, {
|
|
16206
|
+
themeIntent: intent,
|
|
16207
|
+
style: style,
|
|
16208
|
+
testID: testID
|
|
16209
|
+
}), /*#__PURE__*/React__default["default"].createElement(StyledText, {
|
|
16210
|
+
themeIntent: intent
|
|
16211
|
+
}, content));
|
|
16212
|
+
};
|
|
16213
|
+
|
|
16214
|
+
exports.Avatar = Avatar;
|
|
16215
|
+
exports.Badge = Badge$1;
|
|
14279
16216
|
exports.BottomNavigation = BottomNavigation;
|
|
14280
|
-
exports.Button =
|
|
16217
|
+
exports.Button = CompoundButton;
|
|
14281
16218
|
exports.Card = Card;
|
|
16219
|
+
exports.Collapse = Collapse;
|
|
14282
16220
|
exports.Divider = Divider;
|
|
14283
|
-
exports.
|
|
16221
|
+
exports.Drawer = Drawer;
|
|
16222
|
+
exports.FAB = index$1;
|
|
14284
16223
|
exports.Icon = Icon;
|
|
14285
|
-
exports.
|
|
16224
|
+
exports.Progress = Progress;
|
|
16225
|
+
exports.Tabs = index;
|
|
16226
|
+
exports.Tag = Tag;
|
|
14286
16227
|
exports.ThemeProvider = ThemeProvider;
|
|
14287
16228
|
exports.Typography = Typography;
|
|
14288
16229
|
exports.getTheme = getTheme;
|