@xaui/native 0.0.26 → 0.0.28
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/LICENSE +21 -0
- package/README.md +105 -228
- package/dist/alert/index.cjs +92 -166
- package/dist/alert/index.js +2 -1
- package/dist/app-bar/index.cjs +24 -98
- package/dist/app-bar/index.js +2 -1
- package/dist/autocomplete/index.cjs +192 -281
- package/dist/autocomplete/index.js +36 -48
- package/dist/avatar/index.cjs +59 -133
- package/dist/avatar/index.js +2 -1
- package/dist/badge/index.cjs +26 -99
- package/dist/badge/index.js +2 -1
- package/dist/bottom-sheet/index.cjs +5 -456
- package/dist/bottom-sheet/index.js +4 -363
- package/dist/bottom-tab-bar/index.cjs +93 -167
- package/dist/bottom-tab-bar/index.js +2 -2
- package/dist/button/index.cjs +73 -525
- package/dist/button/index.js +3 -2
- package/dist/card/index.cjs +76 -169
- package/dist/card/index.js +2 -2
- package/dist/carousel/index.cjs +68 -145
- package/dist/carousel/index.js +1 -1
- package/dist/chart/index.cjs +132 -173
- package/dist/checkbox/index.cjs +70 -143
- package/dist/checkbox/index.js +2 -1
- package/dist/chip/index.cjs +89 -164
- package/dist/chip/index.js +2 -1
- package/dist/chunk-BD72HIPR.cjs +75 -0
- package/dist/chunk-DHSTKO3K.cjs +19 -0
- package/dist/{chunk-CZFDZPAS.js → chunk-DXXNBF5P.js} +5 -0
- package/dist/{chunk-UI5L26KD.js → chunk-F7WH4DMG.js} +1 -1
- package/dist/chunk-GBHQCAKW.js +19 -0
- package/dist/chunk-HC2SSHNU.js +368 -0
- package/dist/chunk-HSPTLUFA.cjs +7 -0
- package/dist/chunk-JEGEPGVU.js +287 -0
- package/dist/chunk-KTLGDLCB.cjs +287 -0
- package/dist/{chunk-GHCVNQET.js → chunk-LTKYHG5V.js} +5 -12
- package/dist/{chunk-ULJSCNPE.js → chunk-LUBWRVI2.js} +1 -1
- package/dist/chunk-OQ2BLOOG.cjs +138 -0
- package/dist/chunk-QMYWIWSX.cjs +384 -0
- package/dist/chunk-XFPPR2VB.cjs +368 -0
- package/dist/core/index.cjs +22 -168
- package/dist/core/index.d.cts +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +5 -3
- package/dist/datepicker/index.cjs +239 -320
- package/dist/datepicker/index.js +2 -1
- package/dist/divider/index.cjs +5 -145
- package/dist/divider/index.js +3 -2
- package/dist/drawer/index.cjs +39 -112
- package/dist/drawer/index.js +2 -1
- package/dist/expansion-panel/index.cjs +91 -230
- package/dist/expansion-panel/index.js +3 -2
- package/dist/fab/index.cjs +6 -722
- package/dist/fab/index.js +4 -3
- package/dist/fab-menu/index.cjs +81 -814
- package/dist/fab-menu/index.js +4 -3
- package/dist/feature-discovery/index.cjs +72 -139
- package/dist/feature-discovery/index.js +2 -2
- package/dist/index.cjs +1 -18
- package/dist/indicator/index.cjs +5 -445
- package/dist/indicator/index.js +3 -2
- package/dist/input/index.cjs +214 -282
- package/dist/input/index.js +2 -2
- package/dist/list/index.cjs +71 -146
- package/dist/list/index.js +2 -1
- package/dist/menu/index.cjs +59 -127
- package/dist/menu/index.js +2 -2
- package/dist/menubox/index.cjs +60 -132
- package/dist/menubox/index.js +2 -1
- package/dist/pager/index.cjs +42 -80
- package/dist/progress/index.cjs +43 -114
- package/dist/progress/index.js +2 -1
- package/dist/radio/index.cjs +82 -154
- package/dist/radio/index.js +2 -1
- package/dist/segment-button/index.cjs +60 -147
- package/dist/segment-button/index.js +2 -2
- package/dist/select/index.cjs +149 -224
- package/dist/select/index.js +10 -22
- package/dist/skeleton/index.cjs +23 -94
- package/dist/skeleton/index.js +2 -2
- package/dist/slider/index.cjs +77 -156
- package/dist/slider/index.js +2 -1
- package/dist/snackbar/index.cjs +420 -0
- package/dist/snackbar/index.d.cts +175 -0
- package/dist/snackbar/index.d.ts +175 -0
- package/dist/snackbar/index.js +420 -0
- package/dist/stepper/index.cjs +121 -195
- package/dist/stepper/index.js +2 -1
- package/dist/switch/index.cjs +48 -121
- package/dist/switch/index.js +2 -1
- package/dist/tabs/index.cjs +67 -151
- package/dist/tabs/index.js +2 -1
- package/dist/timepicker/index.cjs +135 -593
- package/dist/timepicker/index.js +24 -383
- package/dist/toolbar/index.cjs +59 -128
- package/dist/toolbar/index.js +2 -1
- package/dist/typography/index.cjs +37 -92
- package/dist/typography/index.d.cts +1 -1
- package/dist/typography/index.d.ts +1 -1
- package/dist/typography/index.js +20 -1
- package/dist/view/index.cjs +178 -223
- package/package.json +7 -1
- package/dist/chunk-3XSXTM3G.js +0 -661
- package/dist/chunk-4KSZLONZ.js +0 -79
- package/dist/chunk-I4V5Y5GD.js +0 -76
- package/dist/chunk-URBEEDFX.js +0 -79
|
@@ -1,88 +1,15 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }require('../chunk-HSPTLUFA.cjs');
|
|
29
2
|
|
|
30
|
-
|
|
31
|
-
var
|
|
32
|
-
__export(bottom_tab_bar_exports, {
|
|
33
|
-
BottomTabBar: () => BottomTabBar,
|
|
34
|
-
BottomTabBarItem: () => BottomTabBarItem
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(bottom_tab_bar_exports);
|
|
3
|
+
|
|
4
|
+
var _chunkOQ2BLOOGcjs = require('../chunk-OQ2BLOOG.cjs');
|
|
37
5
|
|
|
38
6
|
// src/components/bottom-tab-bar/bottom-tab-bar.tsx
|
|
39
|
-
var
|
|
40
|
-
var
|
|
7
|
+
var _react = require('react'); var _react2 = _interopRequireDefault(_react);
|
|
8
|
+
var _reactnative = require('react-native');
|
|
41
9
|
|
|
42
10
|
// src/components/bottom-tab-bar/bottom-tab-bar.hook.ts
|
|
43
|
-
var import_react6 = require("react");
|
|
44
|
-
var import_core = require("@xaui/core");
|
|
45
|
-
|
|
46
|
-
// src/core/theme-context.tsx
|
|
47
|
-
var import_react4 = __toESM(require("react"), 1);
|
|
48
|
-
var import_react_native2 = require("react-native");
|
|
49
|
-
var import_theme = require("@xaui/core/theme");
|
|
50
|
-
var import_palette = require("@xaui/core/palette");
|
|
51
|
-
|
|
52
|
-
// src/core/portal/portal.tsx
|
|
53
|
-
var import_react2 = require("react");
|
|
54
|
-
|
|
55
|
-
// src/core/portal/portal-context.ts
|
|
56
|
-
var import_react = require("react");
|
|
57
|
-
var PortalContext = (0, import_react.createContext)(null);
|
|
58
|
-
|
|
59
|
-
// src/core/portal/portal-host.tsx
|
|
60
|
-
var import_react3 = __toESM(require("react"), 1);
|
|
61
|
-
var import_react_native = require("react-native");
|
|
62
|
-
var hostStyles = import_react_native.StyleSheet.create({
|
|
63
|
-
container: {
|
|
64
|
-
flex: 1
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
11
|
|
|
68
|
-
|
|
69
|
-
var XUIThemeContext = (0, import_react4.createContext)(null);
|
|
70
|
-
|
|
71
|
-
// src/core/theme-hooks.ts
|
|
72
|
-
var import_react5 = require("react");
|
|
73
|
-
var import_react_native3 = require("react-native");
|
|
74
|
-
function useXUITheme() {
|
|
75
|
-
const theme = (0, import_react5.useContext)(XUIThemeContext);
|
|
76
|
-
if (!theme) {
|
|
77
|
-
throw new Error("useXUITheme must be used within XUIProvider");
|
|
78
|
-
}
|
|
79
|
-
return theme;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// src/core/index.ts
|
|
83
|
-
var import_theme2 = require("@xaui/core/theme");
|
|
84
|
-
|
|
85
|
-
// src/components/bottom-tab-bar/bottom-tab-bar.hook.ts
|
|
12
|
+
var _core = require('@xaui/core');
|
|
86
13
|
var sizeMap = {
|
|
87
14
|
sm: {
|
|
88
15
|
minHeight: 68,
|
|
@@ -119,38 +46,38 @@ var sizeMap = {
|
|
|
119
46
|
}
|
|
120
47
|
};
|
|
121
48
|
var useBottomTabBarSizeStyles = (size) => {
|
|
122
|
-
return (0,
|
|
49
|
+
return _react.useMemo.call(void 0, () => sizeMap[size], [size]);
|
|
123
50
|
};
|
|
124
51
|
var useBottomTabBarColors = (themeColor, activeColor, inactiveColor, indicatorColor) => {
|
|
125
|
-
const theme = useXUITheme();
|
|
126
|
-
const colorScheme = theme.colors[(0,
|
|
127
|
-
return (0,
|
|
52
|
+
const theme = _chunkOQ2BLOOGcjs.useXUITheme.call(void 0, );
|
|
53
|
+
const colorScheme = theme.colors[_core.getSafeThemeColor.call(void 0, themeColor)];
|
|
54
|
+
return _react.useMemo.call(void 0, () => {
|
|
128
55
|
return {
|
|
129
|
-
activeColor: activeColor
|
|
130
|
-
inactiveColor: inactiveColor
|
|
131
|
-
indicatorColor: indicatorColor
|
|
56
|
+
activeColor: _nullishCoalesce(activeColor, () => ( colorScheme.main)),
|
|
57
|
+
inactiveColor: _nullishCoalesce(inactiveColor, () => ( _core.withOpacity.call(void 0, theme.colors.foreground, 0.66))),
|
|
58
|
+
indicatorColor: _nullishCoalesce(indicatorColor, () => ( _core.withOpacity.call(void 0, colorScheme.main, theme.mode === "dark" ? 0.28 : 0.16))),
|
|
132
59
|
containerColor: theme.colors.background,
|
|
133
|
-
borderColor: (0,
|
|
60
|
+
borderColor: _core.withOpacity.call(void 0, theme.colors.foreground, 0.08)
|
|
134
61
|
};
|
|
135
62
|
}, [activeColor, colorScheme.main, indicatorColor, inactiveColor, theme]);
|
|
136
63
|
};
|
|
137
64
|
|
|
138
65
|
// src/components/bottom-tab-bar/bottom-tab-bar-context.ts
|
|
139
|
-
|
|
140
|
-
var BottomTabBarContext = (0,
|
|
66
|
+
|
|
67
|
+
var BottomTabBarContext = _react.createContext.call(void 0,
|
|
141
68
|
null
|
|
142
69
|
);
|
|
143
70
|
var useBottomTabBarContext = () => {
|
|
144
|
-
return (0,
|
|
71
|
+
return _react.useContext.call(void 0, BottomTabBarContext);
|
|
145
72
|
};
|
|
146
73
|
|
|
147
74
|
// src/components/bottom-tab-bar/bottom-tab-bar-item.tsx
|
|
148
|
-
|
|
149
|
-
|
|
75
|
+
|
|
76
|
+
|
|
150
77
|
|
|
151
78
|
// src/components/bottom-tab-bar/bottom-tab-bar.style.ts
|
|
152
|
-
|
|
153
|
-
var styles =
|
|
79
|
+
|
|
80
|
+
var styles = _reactnative.StyleSheet.create({
|
|
154
81
|
container: {
|
|
155
82
|
flexDirection: "row",
|
|
156
83
|
alignItems: "stretch",
|
|
@@ -229,15 +156,15 @@ var BottomTabBarItem = ({
|
|
|
229
156
|
const ICON_ONLY_INDICATOR_HORIZONTAL_PADDING = 10;
|
|
230
157
|
const ICON_ONLY_INDICATOR_VERTICAL_PADDING = 10;
|
|
231
158
|
const context = useBottomTabBarContext();
|
|
232
|
-
const selected = isSelected
|
|
233
|
-
const disabled = isDisabled || !!context
|
|
234
|
-
const resolvedVariant = context
|
|
159
|
+
const selected = _nullishCoalesce(isSelected, () => ( _optionalChain([context, 'optionalAccess', _ => _.selectedKey]) === itemKey));
|
|
160
|
+
const disabled = isDisabled || !!_optionalChain([context, 'optionalAccess', _2 => _2.isDisabled]);
|
|
161
|
+
const resolvedVariant = _nullishCoalesce(_optionalChain([context, 'optionalAccess', _3 => _3.variant]), () => ( "stacked"));
|
|
235
162
|
const isIconOnly = resolvedVariant === "icon-only";
|
|
236
|
-
const resolvedShowLabel = isIconOnly ? false : showLabel
|
|
163
|
+
const resolvedShowLabel = isIconOnly ? false : _nullishCoalesce(_nullishCoalesce(showLabel, () => ( _optionalChain([context, 'optionalAccess', _4 => _4.showLabel]))), () => ( true));
|
|
237
164
|
const isInline = resolvedVariant === "inline";
|
|
238
|
-
const resolvedSize = context
|
|
239
|
-
const resolvedThemeColor = context
|
|
240
|
-
const [contentSize, setContentSize] = (0,
|
|
165
|
+
const resolvedSize = _nullishCoalesce(_optionalChain([context, 'optionalAccess', _5 => _5.size]), () => ( "md"));
|
|
166
|
+
const resolvedThemeColor = _nullishCoalesce(_optionalChain([context, 'optionalAccess', _6 => _6.themeColor]), () => ( "primary"));
|
|
167
|
+
const [contentSize, setContentSize] = _react.useState.call(void 0, { width: 0, height: 0 });
|
|
241
168
|
const sizeStyles = useBottomTabBarSizeStyles(resolvedSize);
|
|
242
169
|
const resolvedIndicatorWidth = isInline ? Math.max(
|
|
243
170
|
sizeStyles.indicatorHeight,
|
|
@@ -253,31 +180,31 @@ var BottomTabBarItem = ({
|
|
|
253
180
|
sizeStyles.indicatorHeight,
|
|
254
181
|
contentSize.height + ICON_ONLY_INDICATOR_VERTICAL_PADDING * 2
|
|
255
182
|
) : sizeStyles.indicatorHeight;
|
|
256
|
-
const
|
|
183
|
+
const colors = useBottomTabBarColors(
|
|
257
184
|
resolvedThemeColor,
|
|
258
|
-
activeColor
|
|
259
|
-
inactiveColor
|
|
260
|
-
indicatorColor
|
|
185
|
+
_nullishCoalesce(activeColor, () => ( _optionalChain([context, 'optionalAccess', _7 => _7.activeColor]))),
|
|
186
|
+
_nullishCoalesce(inactiveColor, () => ( _optionalChain([context, 'optionalAccess', _8 => _8.inactiveColor]))),
|
|
187
|
+
_nullishCoalesce(indicatorColor, () => ( _optionalChain([context, 'optionalAccess', _9 => _9.indicatorColor])))
|
|
261
188
|
);
|
|
262
|
-
const indicatorScale = (0,
|
|
263
|
-
const indicatorOpacity = (0,
|
|
264
|
-
(0,
|
|
265
|
-
|
|
266
|
-
|
|
189
|
+
const indicatorScale = _react.useRef.call(void 0, new _reactnative.Animated.Value(selected ? 1 : 0.75)).current;
|
|
190
|
+
const indicatorOpacity = _react.useRef.call(void 0, new _reactnative.Animated.Value(selected ? 1 : 0)).current;
|
|
191
|
+
_react.useEffect.call(void 0, () => {
|
|
192
|
+
_reactnative.Animated.parallel([
|
|
193
|
+
_reactnative.Animated.spring(indicatorScale, {
|
|
267
194
|
toValue: selected ? 1 : 0.75,
|
|
268
195
|
friction: 9,
|
|
269
196
|
tension: 95,
|
|
270
197
|
useNativeDriver: true
|
|
271
198
|
}),
|
|
272
|
-
|
|
199
|
+
_reactnative.Animated.timing(indicatorOpacity, {
|
|
273
200
|
toValue: selected ? 1 : 0,
|
|
274
201
|
duration: selected ? 180 : 140,
|
|
275
202
|
useNativeDriver: true
|
|
276
203
|
})
|
|
277
204
|
]).start();
|
|
278
205
|
}, [indicatorOpacity, indicatorScale, selected]);
|
|
279
|
-
const iconColor = selected ?
|
|
280
|
-
const iconNode = (0,
|
|
206
|
+
const iconColor = selected ? colors.activeColor : colors.inactiveColor;
|
|
207
|
+
const iconNode = _react.useMemo.call(void 0, () => {
|
|
281
208
|
const params = {
|
|
282
209
|
focused: !!selected,
|
|
283
210
|
color: iconColor,
|
|
@@ -288,8 +215,8 @@ var BottomTabBarItem = ({
|
|
|
288
215
|
}
|
|
289
216
|
return resolveIconNode(icon, params);
|
|
290
217
|
}, [activeIcon, icon, iconColor, selected, sizeStyles.iconSize]);
|
|
291
|
-
const labelNode = resolvedShowLabel ? /* @__PURE__ */
|
|
292
|
-
|
|
218
|
+
const labelNode = resolvedShowLabel ? /* @__PURE__ */ _react2.default.createElement(
|
|
219
|
+
_reactnative.Text,
|
|
293
220
|
{
|
|
294
221
|
numberOfLines: 1,
|
|
295
222
|
style: [
|
|
@@ -299,18 +226,18 @@ var BottomTabBarItem = ({
|
|
|
299
226
|
color: iconColor,
|
|
300
227
|
fontSize: sizeStyles.labelSize
|
|
301
228
|
},
|
|
302
|
-
customAppearance
|
|
229
|
+
_optionalChain([customAppearance, 'optionalAccess', _10 => _10.label])
|
|
303
230
|
]
|
|
304
231
|
},
|
|
305
232
|
label
|
|
306
233
|
) : null;
|
|
307
|
-
return /* @__PURE__ */
|
|
308
|
-
|
|
234
|
+
return /* @__PURE__ */ _react2.default.createElement(
|
|
235
|
+
_reactnative.Pressable,
|
|
309
236
|
{
|
|
310
237
|
onPress: (event) => {
|
|
311
238
|
if (disabled) return;
|
|
312
|
-
context
|
|
313
|
-
onPress
|
|
239
|
+
_optionalChain([context, 'optionalAccess', _11 => _11.onSelectionChange, 'optionalCall', _12 => _12(itemKey)]);
|
|
240
|
+
_optionalChain([onPress, 'optionalCall', _13 => _13(event)]);
|
|
314
241
|
},
|
|
315
242
|
onLongPress,
|
|
316
243
|
disabled,
|
|
@@ -320,8 +247,8 @@ var BottomTabBarItem = ({
|
|
|
320
247
|
testID,
|
|
321
248
|
style: styles.itemPressable
|
|
322
249
|
},
|
|
323
|
-
/* @__PURE__ */
|
|
324
|
-
|
|
250
|
+
/* @__PURE__ */ _react2.default.createElement(
|
|
251
|
+
_reactnative.View,
|
|
325
252
|
{
|
|
326
253
|
style: [
|
|
327
254
|
styles.itemContainer,
|
|
@@ -332,11 +259,11 @@ var BottomTabBarItem = ({
|
|
|
332
259
|
},
|
|
333
260
|
disabled && styles.disabled,
|
|
334
261
|
style,
|
|
335
|
-
customAppearance
|
|
262
|
+
_optionalChain([customAppearance, 'optionalAccess', _14 => _14.container])
|
|
336
263
|
]
|
|
337
264
|
},
|
|
338
|
-
/* @__PURE__ */
|
|
339
|
-
|
|
265
|
+
/* @__PURE__ */ _react2.default.createElement(
|
|
266
|
+
_reactnative.Animated.View,
|
|
340
267
|
{
|
|
341
268
|
style: [
|
|
342
269
|
styles.indicator,
|
|
@@ -345,11 +272,11 @@ var BottomTabBarItem = ({
|
|
|
345
272
|
height: resolvedIndicatorHeight,
|
|
346
273
|
marginBottom: !isInline && resolvedShowLabel ? sizeStyles.labelSpacing : 0
|
|
347
274
|
},
|
|
348
|
-
customAppearance
|
|
275
|
+
_optionalChain([customAppearance, 'optionalAccess', _15 => _15.indicator])
|
|
349
276
|
]
|
|
350
277
|
},
|
|
351
|
-
/* @__PURE__ */
|
|
352
|
-
|
|
278
|
+
/* @__PURE__ */ _react2.default.createElement(
|
|
279
|
+
_reactnative.Animated.View,
|
|
353
280
|
{
|
|
354
281
|
style: [
|
|
355
282
|
styles.indicatorBackground,
|
|
@@ -357,15 +284,15 @@ var BottomTabBarItem = ({
|
|
|
357
284
|
width: resolvedIndicatorWidth,
|
|
358
285
|
height: resolvedIndicatorHeight,
|
|
359
286
|
borderRadius: resolvedIndicatorHeight / 2,
|
|
360
|
-
backgroundColor:
|
|
287
|
+
backgroundColor: colors.indicatorColor,
|
|
361
288
|
transform: [{ scale: indicatorScale }],
|
|
362
289
|
opacity: indicatorOpacity
|
|
363
290
|
}
|
|
364
291
|
]
|
|
365
292
|
}
|
|
366
293
|
),
|
|
367
|
-
/* @__PURE__ */
|
|
368
|
-
|
|
294
|
+
/* @__PURE__ */ _react2.default.createElement(
|
|
295
|
+
_reactnative.View,
|
|
369
296
|
{
|
|
370
297
|
style: styles.indicatorContent,
|
|
371
298
|
onLayout: (event) => {
|
|
@@ -378,7 +305,7 @@ var BottomTabBarItem = ({
|
|
|
378
305
|
}
|
|
379
306
|
},
|
|
380
307
|
iconNode,
|
|
381
|
-
badge ? /* @__PURE__ */
|
|
308
|
+
badge ? /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: styles.badgeContainer }, badge) : null,
|
|
382
309
|
isInline ? labelNode : null
|
|
383
310
|
)
|
|
384
311
|
),
|
|
@@ -396,7 +323,7 @@ var getRouteLabel = (route, options, focused, color, variant) => {
|
|
|
396
323
|
return options.tabBarLabel({
|
|
397
324
|
focused,
|
|
398
325
|
color,
|
|
399
|
-
children: options.title
|
|
326
|
+
children: _nullishCoalesce(options.title, () => ( route.name)),
|
|
400
327
|
position: variant === "inline" ? "beside-icon" : "below-icon"
|
|
401
328
|
});
|
|
402
329
|
}
|
|
@@ -423,7 +350,7 @@ var BottomTabBar = (props) => {
|
|
|
423
350
|
customAppearance
|
|
424
351
|
} = props;
|
|
425
352
|
const sizeStyles = useBottomTabBarSizeStyles(size);
|
|
426
|
-
const
|
|
353
|
+
const colors = useBottomTabBarColors(
|
|
427
354
|
themeColor,
|
|
428
355
|
activeColor,
|
|
429
356
|
inactiveColor,
|
|
@@ -432,34 +359,34 @@ var BottomTabBar = (props) => {
|
|
|
432
359
|
if (isExpoRouterMode(props)) {
|
|
433
360
|
const { state, descriptors, navigation, insets } = props;
|
|
434
361
|
const currentRoute = state.routes[state.index];
|
|
435
|
-
const focusedOptions = descriptors[currentRoute.key]
|
|
436
|
-
const focusedStyle = focusedOptions
|
|
437
|
-
if (focusedStyle
|
|
362
|
+
const focusedOptions = _optionalChain([descriptors, 'access', _16 => _16[currentRoute.key], 'optionalAccess', _17 => _17.options]);
|
|
363
|
+
const focusedStyle = _optionalChain([focusedOptions, 'optionalAccess', _18 => _18.tabBarStyle]);
|
|
364
|
+
if (_optionalChain([focusedStyle, 'optionalAccess', _19 => _19.display]) === "none") {
|
|
438
365
|
return null;
|
|
439
366
|
}
|
|
440
|
-
const routerInsetBottom = insets
|
|
441
|
-
return /* @__PURE__ */
|
|
442
|
-
|
|
367
|
+
const routerInsetBottom = _nullishCoalesce(_optionalChain([insets, 'optionalAccess', _20 => _20.bottom]), () => ( insetBottom));
|
|
368
|
+
return /* @__PURE__ */ _react2.default.createElement(
|
|
369
|
+
_reactnative.View,
|
|
443
370
|
{
|
|
444
371
|
style: [
|
|
445
372
|
styles.container,
|
|
446
373
|
{
|
|
447
374
|
minHeight: sizeStyles.minHeight + routerInsetBottom,
|
|
448
375
|
paddingBottom: routerInsetBottom,
|
|
449
|
-
backgroundColor:
|
|
450
|
-
borderTopColor:
|
|
376
|
+
backgroundColor: colors.containerColor,
|
|
377
|
+
borderTopColor: colors.borderColor
|
|
451
378
|
},
|
|
452
379
|
style,
|
|
453
|
-
customAppearance
|
|
380
|
+
_optionalChain([customAppearance, 'optionalAccess', _21 => _21.container])
|
|
454
381
|
]
|
|
455
382
|
},
|
|
456
|
-
state.routes.filter((route) => descriptors[route.key]
|
|
457
|
-
const routeOptions = descriptors[route.key]
|
|
383
|
+
state.routes.filter((route) => _optionalChain([descriptors, 'access', _22 => _22[route.key], 'optionalAccess', _23 => _23.options, 'access', _24 => _24.href]) !== null).map((route) => {
|
|
384
|
+
const routeOptions = _nullishCoalesce(_optionalChain([descriptors, 'access', _25 => _25[route.key], 'optionalAccess', _26 => _26.options]), () => ( {}));
|
|
458
385
|
const focused = currentRoute.key === route.key;
|
|
459
|
-
const routeActiveColor = routeOptions.tabBarActiveTintColor
|
|
460
|
-
const routeInactiveColor = routeOptions.tabBarInactiveTintColor
|
|
461
|
-
const labelColor = focused ? routeActiveColor
|
|
462
|
-
return /* @__PURE__ */
|
|
386
|
+
const routeActiveColor = _nullishCoalesce(routeOptions.tabBarActiveTintColor, () => ( activeColor));
|
|
387
|
+
const routeInactiveColor = _nullishCoalesce(routeOptions.tabBarInactiveTintColor, () => ( inactiveColor));
|
|
388
|
+
const labelColor = focused ? _nullishCoalesce(routeActiveColor, () => ( colors.activeColor)) : _nullishCoalesce(routeInactiveColor, () => ( colors.inactiveColor));
|
|
389
|
+
return /* @__PURE__ */ _react2.default.createElement(
|
|
463
390
|
BottomTabBarItem,
|
|
464
391
|
{
|
|
465
392
|
key: route.key,
|
|
@@ -473,7 +400,7 @@ var BottomTabBar = (props) => {
|
|
|
473
400
|
),
|
|
474
401
|
icon: routeOptions.tabBarIcon,
|
|
475
402
|
isSelected: focused,
|
|
476
|
-
showLabel: routeOptions.tabBarShowLabel
|
|
403
|
+
showLabel: _nullishCoalesce(routeOptions.tabBarShowLabel, () => ( showLabel)),
|
|
477
404
|
activeColor: routeActiveColor,
|
|
478
405
|
inactiveColor: routeInactiveColor,
|
|
479
406
|
badge: routeOptions.tabBarBadge,
|
|
@@ -503,25 +430,25 @@ var BottomTabBar = (props) => {
|
|
|
503
430
|
);
|
|
504
431
|
}
|
|
505
432
|
const { children, selectedKey, defaultSelectedKey, onSelectionChange } = props;
|
|
506
|
-
const firstItemKey =
|
|
507
|
-
const child =
|
|
508
|
-
if (
|
|
433
|
+
const firstItemKey = _react2.default.useMemo(() => {
|
|
434
|
+
const child = _react2.default.Children.toArray(children)[0];
|
|
435
|
+
if (_react2.default.isValidElement(child)) {
|
|
509
436
|
return child.props.itemKey;
|
|
510
437
|
}
|
|
511
438
|
return void 0;
|
|
512
439
|
}, [children]);
|
|
513
440
|
const isControlled = typeof selectedKey === "string";
|
|
514
|
-
const [internalSelectedKey, setInternalSelectedKey] = (0,
|
|
515
|
-
defaultSelectedKey
|
|
441
|
+
const [internalSelectedKey, setInternalSelectedKey] = _react.useState.call(void 0,
|
|
442
|
+
_nullishCoalesce(defaultSelectedKey, () => ( firstItemKey))
|
|
516
443
|
);
|
|
517
444
|
const resolvedSelectedKey = isControlled ? selectedKey : internalSelectedKey;
|
|
518
445
|
const handleSelectionChange = (nextKey) => {
|
|
519
446
|
if (!isControlled) {
|
|
520
447
|
setInternalSelectedKey(nextKey);
|
|
521
448
|
}
|
|
522
|
-
onSelectionChange
|
|
449
|
+
_optionalChain([onSelectionChange, 'optionalCall', _27 => _27(nextKey)]);
|
|
523
450
|
};
|
|
524
|
-
const contextValue = (0,
|
|
451
|
+
const contextValue = _react.useMemo.call(void 0,
|
|
525
452
|
() => ({
|
|
526
453
|
selectedKey: resolvedSelectedKey,
|
|
527
454
|
onSelectionChange: handleSelectionChange,
|
|
@@ -546,26 +473,25 @@ var BottomTabBar = (props) => {
|
|
|
546
473
|
themeColor
|
|
547
474
|
]
|
|
548
475
|
);
|
|
549
|
-
return /* @__PURE__ */
|
|
550
|
-
|
|
476
|
+
return /* @__PURE__ */ _react2.default.createElement(BottomTabBarContext.Provider, { value: contextValue }, /* @__PURE__ */ _react2.default.createElement(
|
|
477
|
+
_reactnative.View,
|
|
551
478
|
{
|
|
552
479
|
style: [
|
|
553
480
|
styles.container,
|
|
554
481
|
{
|
|
555
482
|
minHeight: sizeStyles.minHeight + insetBottom,
|
|
556
483
|
paddingBottom: insetBottom,
|
|
557
|
-
backgroundColor:
|
|
558
|
-
borderTopColor:
|
|
484
|
+
backgroundColor: colors.containerColor,
|
|
485
|
+
borderTopColor: colors.borderColor
|
|
559
486
|
},
|
|
560
487
|
style,
|
|
561
|
-
customAppearance
|
|
488
|
+
_optionalChain([customAppearance, 'optionalAccess', _28 => _28.container])
|
|
562
489
|
]
|
|
563
490
|
},
|
|
564
491
|
children
|
|
565
492
|
));
|
|
566
493
|
};
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
});
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
|
|
497
|
+
exports.BottomTabBar = BottomTabBar; exports.BottomTabBarItem = BottomTabBarItem;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "../chunk-
|
|
1
|
+
import "../chunk-DXXNBF5P.js";
|
|
2
2
|
import {
|
|
3
3
|
useXUITheme
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-LTKYHG5V.js";
|
|
5
5
|
|
|
6
6
|
// src/components/bottom-tab-bar/bottom-tab-bar.tsx
|
|
7
7
|
import React2, { useMemo as useMemo3, useState as useState2 } from "react";
|