@xaui/native 0.0.27 → 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 +6 -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
package/dist/tabs/index.cjs
CHANGED
|
@@ -1,133 +1,50 @@
|
|
|
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
|
-
// src/components/tabs/index.ts
|
|
31
|
-
var tabs_exports = {};
|
|
32
|
-
__export(tabs_exports, {
|
|
33
|
-
Tab: () => Tab,
|
|
34
|
-
Tabs: () => Tabs
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(tabs_exports);
|
|
37
3
|
|
|
38
|
-
// src/components/tabs/tabs.tsx
|
|
39
|
-
var import_react7 = __toESM(require("react"), 1);
|
|
40
|
-
var import_react_native6 = require("react-native");
|
|
41
4
|
|
|
42
|
-
|
|
43
|
-
var import_react5 = require("react");
|
|
44
|
-
var import_react_native3 = require("react-native");
|
|
5
|
+
var _chunkOQ2BLOOGcjs = require('../chunk-OQ2BLOOG.cjs');
|
|
45
6
|
|
|
46
|
-
// src/
|
|
47
|
-
var
|
|
48
|
-
var import_react_native2 = require("react-native");
|
|
49
|
-
var import_theme = require("@xaui/core/theme");
|
|
50
|
-
var import_palette = require("@xaui/core/palette");
|
|
7
|
+
// src/components/tabs/tabs.tsx
|
|
8
|
+
var _react = require('react'); var _react2 = _interopRequireDefault(_react);
|
|
51
9
|
|
|
52
|
-
// src/core/portal/portal.tsx
|
|
53
|
-
var import_react2 = require("react");
|
|
54
10
|
|
|
55
|
-
// src/core/portal/portal-context.ts
|
|
56
|
-
var import_react = require("react");
|
|
57
|
-
var PortalContext = (0, import_react.createContext)(null);
|
|
58
11
|
|
|
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
12
|
|
|
68
|
-
// src/core/theme-context.tsx
|
|
69
|
-
var XUIThemeContext = (0, import_react4.createContext)(null);
|
|
70
13
|
|
|
71
|
-
|
|
72
|
-
function useXUITheme() {
|
|
73
|
-
const theme = (0, import_react5.useContext)(XUIThemeContext);
|
|
74
|
-
if (!theme) {
|
|
75
|
-
throw new Error("useXUITheme must be used within XUIProvider");
|
|
76
|
-
}
|
|
77
|
-
return theme;
|
|
78
|
-
}
|
|
79
|
-
function useBorderRadiusStyles(radius) {
|
|
80
|
-
const theme = useXUITheme();
|
|
81
|
-
const borderRadius = (0, import_react5.useMemo)(() => {
|
|
82
|
-
const radiusMap = {
|
|
83
|
-
none: theme.borderRadius.none,
|
|
84
|
-
sm: theme.borderRadius.sm,
|
|
85
|
-
md: theme.borderRadius.md,
|
|
86
|
-
lg: theme.borderRadius.lg,
|
|
87
|
-
full: theme.borderRadius.full
|
|
88
|
-
};
|
|
89
|
-
return { borderRadius: radiusMap[radius] };
|
|
90
|
-
}, [radius, theme]);
|
|
91
|
-
return borderRadius;
|
|
92
|
-
}
|
|
14
|
+
var _reactnative = require('react-native');
|
|
93
15
|
|
|
94
16
|
// src/components/tabs/tabs.animation.ts
|
|
95
|
-
|
|
17
|
+
|
|
96
18
|
var runTabsCursorAnimation = (translateX, width, scaleX, toX, toWidth, duration) => {
|
|
97
19
|
scaleX.setValue(0.75);
|
|
98
|
-
|
|
99
|
-
|
|
20
|
+
_reactnative.Animated.parallel([
|
|
21
|
+
_reactnative.Animated.timing(translateX, {
|
|
100
22
|
toValue: toX,
|
|
101
23
|
duration,
|
|
102
|
-
easing:
|
|
24
|
+
easing: _reactnative.Easing.inOut(_reactnative.Easing.quad),
|
|
103
25
|
useNativeDriver: false
|
|
104
26
|
}),
|
|
105
|
-
|
|
27
|
+
_reactnative.Animated.timing(width, {
|
|
106
28
|
toValue: toWidth,
|
|
107
29
|
duration,
|
|
108
|
-
easing:
|
|
30
|
+
easing: _reactnative.Easing.inOut(_reactnative.Easing.quad),
|
|
109
31
|
useNativeDriver: false
|
|
110
32
|
}),
|
|
111
|
-
|
|
33
|
+
_reactnative.Animated.timing(scaleX, {
|
|
112
34
|
toValue: 1,
|
|
113
35
|
duration,
|
|
114
|
-
easing:
|
|
36
|
+
easing: _reactnative.Easing.out(_reactnative.Easing.quad),
|
|
115
37
|
useNativeDriver: false
|
|
116
38
|
})
|
|
117
39
|
]).start();
|
|
118
40
|
};
|
|
119
41
|
|
|
120
42
|
// src/components/tabs/tabs.hook.ts
|
|
121
|
-
var import_react6 = require("react");
|
|
122
|
-
var import_core = require("@xaui/core");
|
|
123
43
|
|
|
124
|
-
|
|
125
|
-
var import_theme2 = require("@xaui/core/theme");
|
|
126
|
-
|
|
127
|
-
// src/components/tabs/tabs.hook.ts
|
|
44
|
+
var _core = require('@xaui/core');
|
|
128
45
|
function useTabsSizeStyles(size) {
|
|
129
|
-
const theme = useXUITheme();
|
|
130
|
-
return (0,
|
|
46
|
+
const theme = _chunkOQ2BLOOGcjs.useXUITheme.call(void 0, );
|
|
47
|
+
return _react.useMemo.call(void 0, () => {
|
|
131
48
|
const sizes = {
|
|
132
49
|
xs: {
|
|
133
50
|
minHeight: 32,
|
|
@@ -158,11 +75,11 @@ function useTabsSizeStyles(size) {
|
|
|
158
75
|
}, [size, theme]);
|
|
159
76
|
}
|
|
160
77
|
function useTabsVariantStyles(color, variant) {
|
|
161
|
-
const theme = useXUITheme();
|
|
162
|
-
const safeColor = (0,
|
|
78
|
+
const theme = _chunkOQ2BLOOGcjs.useXUITheme.call(void 0, );
|
|
79
|
+
const safeColor = _core.getSafeThemeColor.call(void 0, color);
|
|
163
80
|
const palette = theme.colors[safeColor];
|
|
164
|
-
const cursorSolidColor = (0,
|
|
165
|
-
return (0,
|
|
81
|
+
const cursorSolidColor = _core.withPaletteNumber.call(void 0, palette.main, 400);
|
|
82
|
+
return _react.useMemo.call(void 0, () => {
|
|
166
83
|
const variants = {
|
|
167
84
|
solid: {
|
|
168
85
|
listBackgroundColor: palette.background,
|
|
@@ -222,8 +139,8 @@ function useTabsVariantStyles(color, variant) {
|
|
|
222
139
|
}
|
|
223
140
|
|
|
224
141
|
// src/components/tabs/tabs.style.ts
|
|
225
|
-
|
|
226
|
-
var styles =
|
|
142
|
+
|
|
143
|
+
var styles = _reactnative.StyleSheet.create({
|
|
227
144
|
container: {
|
|
228
145
|
width: "100%"
|
|
229
146
|
},
|
|
@@ -266,18 +183,18 @@ var styles = import_react_native5.StyleSheet.create({
|
|
|
266
183
|
|
|
267
184
|
// src/components/tabs/tabs.tsx
|
|
268
185
|
function isTabDisabled(item, disabledKeys, isDisabled) {
|
|
269
|
-
return isDisabled || item.isDisabled === true || disabledKeys
|
|
186
|
+
return isDisabled || item.isDisabled === true || _optionalChain([disabledKeys, 'optionalAccess', _ => _.includes, 'call', _2 => _2(item.key)]) === true;
|
|
270
187
|
}
|
|
271
188
|
function getFallbackKey(items, disabledKeys, isDisabled) {
|
|
272
189
|
if (isDisabled) return "";
|
|
273
190
|
const firstEnabled = items.find((item) => !isTabDisabled(item, disabledKeys, false));
|
|
274
|
-
return firstEnabled
|
|
191
|
+
return _nullishCoalesce(_optionalChain([firstEnabled, 'optionalAccess', _3 => _3.key]), () => ( ""));
|
|
275
192
|
}
|
|
276
193
|
var Tab = () => null;
|
|
277
194
|
Tab.displayName = "Tab";
|
|
278
195
|
function toTabItems(children) {
|
|
279
|
-
return
|
|
280
|
-
if (!
|
|
196
|
+
return _react2.default.Children.toArray(children).flatMap((child) => {
|
|
197
|
+
if (!_react2.default.isValidElement(child) || child.type !== Tab) {
|
|
281
198
|
return [];
|
|
282
199
|
}
|
|
283
200
|
if (child.key == null) {
|
|
@@ -313,35 +230,35 @@ var Tabs = ({
|
|
|
313
230
|
content,
|
|
314
231
|
customAppearance
|
|
315
232
|
}) => {
|
|
316
|
-
const items = (0,
|
|
233
|
+
const items = _react.useMemo.call(void 0, () => toTabItems(children), [children]);
|
|
317
234
|
const isControlled = controlledSelectedKey !== void 0;
|
|
318
|
-
const initialKey = (0,
|
|
235
|
+
const initialKey = _react.useMemo.call(void 0, () => {
|
|
319
236
|
if (defaultSelectedKey) return defaultSelectedKey;
|
|
320
237
|
return getFallbackKey(items, disabledKeys, isDisabled);
|
|
321
238
|
}, [defaultSelectedKey, disabledKeys, isDisabled, items]);
|
|
322
|
-
const [internalSelectedKey, setInternalSelectedKey] = (0,
|
|
323
|
-
const [layouts, setLayouts] = (0,
|
|
324
|
-
const [listWidth, setListWidth] = (0,
|
|
325
|
-
const selectedKey = (isControlled ? controlledSelectedKey : internalSelectedKey)
|
|
326
|
-
const selectedItem = (0,
|
|
239
|
+
const [internalSelectedKey, setInternalSelectedKey] = _react.useState.call(void 0, initialKey);
|
|
240
|
+
const [layouts, setLayouts] = _react.useState.call(void 0, {});
|
|
241
|
+
const [listWidth, setListWidth] = _react.useState.call(void 0, 0);
|
|
242
|
+
const selectedKey = _nullishCoalesce((isControlled ? controlledSelectedKey : internalSelectedKey), () => ( ""));
|
|
243
|
+
const selectedItem = _react.useMemo.call(void 0,
|
|
327
244
|
() => items.find((item) => item.key === selectedKey),
|
|
328
245
|
[items, selectedKey]
|
|
329
246
|
);
|
|
330
247
|
const sizeStyles = useTabsSizeStyles(size);
|
|
331
248
|
const variantStyles = useTabsVariantStyles(color, variant);
|
|
332
|
-
const radiusStyles = useBorderRadiusStyles(radius);
|
|
333
|
-
const cursorTranslateX = (0,
|
|
334
|
-
const cursorWidth = (0,
|
|
335
|
-
const cursorScaleX = (0,
|
|
336
|
-
const prevCursorLayout = (0,
|
|
337
|
-
(0,
|
|
249
|
+
const radiusStyles = _chunkOQ2BLOOGcjs.useBorderRadiusStyles.call(void 0, radius);
|
|
250
|
+
const cursorTranslateX = _react.useRef.call(void 0, new _reactnative.Animated.Value(0)).current;
|
|
251
|
+
const cursorWidth = _react.useRef.call(void 0, new _reactnative.Animated.Value(0)).current;
|
|
252
|
+
const cursorScaleX = _react.useRef.call(void 0, new _reactnative.Animated.Value(1)).current;
|
|
253
|
+
const prevCursorLayout = _react.useRef.call(void 0, null);
|
|
254
|
+
_react.useEffect.call(void 0, () => {
|
|
338
255
|
if (isControlled || selectedKey) return;
|
|
339
256
|
const nextFallback = getFallbackKey(items, disabledKeys, isDisabled);
|
|
340
257
|
if (nextFallback && nextFallback !== selectedKey) {
|
|
341
258
|
setInternalSelectedKey(nextFallback);
|
|
342
259
|
}
|
|
343
260
|
}, [disabledKeys, isControlled, isDisabled, items, selectedKey]);
|
|
344
|
-
(0,
|
|
261
|
+
_react.useEffect.call(void 0, () => {
|
|
345
262
|
if (!selectedKey) return;
|
|
346
263
|
const selectedLayout = layouts[selectedKey];
|
|
347
264
|
if (!selectedLayout) return;
|
|
@@ -370,7 +287,7 @@ var Tabs = ({
|
|
|
370
287
|
layouts,
|
|
371
288
|
selectedKey
|
|
372
289
|
]);
|
|
373
|
-
const onTabLayout = (0,
|
|
290
|
+
const onTabLayout = _react.useCallback.call(void 0,
|
|
374
291
|
(key, event) => {
|
|
375
292
|
const nextLayout = event.nativeEvent.layout;
|
|
376
293
|
setLayouts((prev) => {
|
|
@@ -379,7 +296,7 @@ var Tabs = ({
|
|
|
379
296
|
return prev;
|
|
380
297
|
}
|
|
381
298
|
const isBordered = variant === "bordered";
|
|
382
|
-
const isFirstTab = items[0]
|
|
299
|
+
const isFirstTab = _optionalChain([items, 'access', _4 => _4[0], 'optionalAccess', _5 => _5.key]) === key;
|
|
383
300
|
let cursorWidth2 = nextLayout.width;
|
|
384
301
|
let cursorX = nextLayout.x;
|
|
385
302
|
if (isBordered) {
|
|
@@ -402,20 +319,20 @@ var Tabs = ({
|
|
|
402
319
|
},
|
|
403
320
|
[items, listWidth, setLayouts, variant, variantStyles.listBorderWidth]
|
|
404
321
|
);
|
|
405
|
-
const handleTabPress = (0,
|
|
322
|
+
const handleTabPress = _react.useCallback.call(void 0,
|
|
406
323
|
(item) => {
|
|
407
324
|
if (isTabDisabled(item, disabledKeys, isDisabled)) return;
|
|
408
325
|
if (!isControlled) {
|
|
409
326
|
setInternalSelectedKey(item.key);
|
|
410
327
|
}
|
|
411
|
-
onSelectionChange
|
|
328
|
+
_optionalChain([onSelectionChange, 'optionalCall', _6 => _6(item.key)]);
|
|
412
329
|
},
|
|
413
330
|
[disabledKeys, isControlled, isDisabled, onSelectionChange]
|
|
414
331
|
);
|
|
415
332
|
const shouldShowCursor = !!selectedKey && !!layouts[selectedKey] && !isDisabled && items.length > 0;
|
|
416
|
-
const resolvedContent = typeof content === "function" ? content({ selectedKey, selectedItem }) : content
|
|
417
|
-
return /* @__PURE__ */
|
|
418
|
-
|
|
333
|
+
const resolvedContent = typeof content === "function" ? content({ selectedKey, selectedItem }) : _nullishCoalesce(content, () => ( _optionalChain([selectedItem, 'optionalAccess', _7 => _7.content])));
|
|
334
|
+
return /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: [styles.container, _optionalChain([customAppearance, 'optionalAccess', _8 => _8.container])] }, /* @__PURE__ */ _react2.default.createElement(
|
|
335
|
+
_reactnative.View,
|
|
419
336
|
{
|
|
420
337
|
onLayout: (event) => setListWidth(event.nativeEvent.layout.width),
|
|
421
338
|
style: [
|
|
@@ -425,16 +342,16 @@ var Tabs = ({
|
|
|
425
342
|
backgroundColor: variantStyles.listBackgroundColor,
|
|
426
343
|
borderColor: variantStyles.listBorderColor,
|
|
427
344
|
borderWidth: variantStyles.listBorderWidth,
|
|
428
|
-
borderBottomWidth: variant === "underlined" ? variantStyles.cursorHeight
|
|
345
|
+
borderBottomWidth: variant === "underlined" ? _nullishCoalesce(variantStyles.cursorHeight, () => ( 2)) : variantStyles.listBorderWidth,
|
|
429
346
|
paddingHorizontal: variantStyles.listPaddingHorizontal,
|
|
430
347
|
...variant === "bordered" && { overflow: "hidden" }
|
|
431
348
|
},
|
|
432
349
|
fullWidth && styles.fullWidth,
|
|
433
|
-
customAppearance
|
|
350
|
+
_optionalChain([customAppearance, 'optionalAccess', _9 => _9.list])
|
|
434
351
|
]
|
|
435
352
|
},
|
|
436
|
-
shouldShowCursor && /* @__PURE__ */
|
|
437
|
-
|
|
353
|
+
shouldShowCursor && /* @__PURE__ */ _react2.default.createElement(
|
|
354
|
+
_reactnative.Animated.View,
|
|
438
355
|
{
|
|
439
356
|
pointerEvents: "none",
|
|
440
357
|
style: [
|
|
@@ -465,15 +382,15 @@ var Tabs = ({
|
|
|
465
382
|
elevation: 2
|
|
466
383
|
}
|
|
467
384
|
},
|
|
468
|
-
customAppearance
|
|
385
|
+
_optionalChain([customAppearance, 'optionalAccess', _10 => _10.cursor])
|
|
469
386
|
]
|
|
470
387
|
}
|
|
471
388
|
),
|
|
472
389
|
items.map((item) => {
|
|
473
390
|
const isSelected = selectedKey === item.key;
|
|
474
391
|
const disabled = isTabDisabled(item, disabledKeys, isDisabled);
|
|
475
|
-
return /* @__PURE__ */
|
|
476
|
-
|
|
392
|
+
return /* @__PURE__ */ _react2.default.createElement(
|
|
393
|
+
_reactnative.Pressable,
|
|
477
394
|
{
|
|
478
395
|
key: item.key,
|
|
479
396
|
onLayout: (event) => onTabLayout(item.key, event),
|
|
@@ -481,8 +398,8 @@ var Tabs = ({
|
|
|
481
398
|
disabled,
|
|
482
399
|
style: [styles.tabPressable, disabled && styles.disabled]
|
|
483
400
|
},
|
|
484
|
-
/* @__PURE__ */
|
|
485
|
-
|
|
401
|
+
/* @__PURE__ */ _react2.default.createElement(
|
|
402
|
+
_reactnative.View,
|
|
486
403
|
{
|
|
487
404
|
style: [
|
|
488
405
|
styles.tab,
|
|
@@ -491,12 +408,12 @@ var Tabs = ({
|
|
|
491
408
|
paddingHorizontal: sizeStyles.paddingHorizontal,
|
|
492
409
|
paddingVertical: sizeStyles.paddingVertical
|
|
493
410
|
},
|
|
494
|
-
customAppearance
|
|
495
|
-
isSelected && customAppearance
|
|
411
|
+
_optionalChain([customAppearance, 'optionalAccess', _11 => _11.tab]),
|
|
412
|
+
isSelected && _optionalChain([customAppearance, 'optionalAccess', _12 => _12.selectedTab])
|
|
496
413
|
]
|
|
497
414
|
},
|
|
498
|
-
renderTab ? renderTab(item, { isSelected, isDisabled: disabled }) : /* @__PURE__ */
|
|
499
|
-
|
|
415
|
+
renderTab ? renderTab(item, { isSelected, isDisabled: disabled }) : /* @__PURE__ */ _react2.default.createElement(_react2.default.Fragment, null, item.startContent, /* @__PURE__ */ _react2.default.createElement(
|
|
416
|
+
_reactnative.Text,
|
|
500
417
|
{
|
|
501
418
|
numberOfLines: 1,
|
|
502
419
|
style: [
|
|
@@ -505,8 +422,8 @@ var Tabs = ({
|
|
|
505
422
|
color: isSelected ? variantStyles.selectedTextColor : variantStyles.textColor,
|
|
506
423
|
fontSize: sizeStyles.fontSize
|
|
507
424
|
},
|
|
508
|
-
customAppearance
|
|
509
|
-
isSelected && customAppearance
|
|
425
|
+
_optionalChain([customAppearance, 'optionalAccess', _13 => _13.text]),
|
|
426
|
+
isSelected && _optionalChain([customAppearance, 'optionalAccess', _14 => _14.selectedText])
|
|
510
427
|
]
|
|
511
428
|
},
|
|
512
429
|
item.title
|
|
@@ -514,10 +431,9 @@ var Tabs = ({
|
|
|
514
431
|
)
|
|
515
432
|
);
|
|
516
433
|
})
|
|
517
|
-
), resolvedContent !== void 0 && /* @__PURE__ */
|
|
434
|
+
), resolvedContent !== void 0 && /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: [styles.content, _optionalChain([customAppearance, 'optionalAccess', _15 => _15.content])] }, resolvedContent));
|
|
518
435
|
};
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
});
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
exports.Tab = Tab; exports.Tabs = Tabs;
|
package/dist/tabs/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import "../chunk-DXXNBF5P.js";
|
|
1
2
|
import {
|
|
2
3
|
useBorderRadiusStyles,
|
|
3
4
|
useXUITheme
|
|
4
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-LTKYHG5V.js";
|
|
5
6
|
|
|
6
7
|
// src/components/tabs/tabs.tsx
|
|
7
8
|
import React, { useCallback, useEffect, useMemo as useMemo2, useRef, useState } from "react";
|