@xaui/native 0.1.5 → 0.2.0
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/README.md +109 -113
- package/dist/alert/index.cjs +6 -9
- package/dist/alert/index.js +4 -7
- package/dist/app-bar/index.cjs +4 -4
- package/dist/app-bar/index.js +2 -2
- package/dist/autocomplete/index.cjs +20 -25
- package/dist/autocomplete/index.d.cts +1 -1
- package/dist/autocomplete/index.d.ts +1 -1
- package/dist/autocomplete/index.js +11 -16
- package/dist/avatar/index.cjs +9 -9
- package/dist/avatar/index.js +5 -5
- package/dist/badge/index.cjs +13 -14
- package/dist/badge/index.js +10 -11
- package/dist/bottom-sheet/index.cjs +3 -3
- package/dist/bottom-sheet/index.js +2 -2
- package/dist/bottom-tab-bar/index.cjs +2 -2
- package/dist/bottom-tab-bar/index.js +1 -1
- package/dist/button/index.cjs +19 -22
- package/dist/button/index.d.cts +3 -3
- package/dist/button/index.d.ts +3 -3
- package/dist/button/index.js +12 -15
- package/dist/card/index.cjs +8 -8
- package/dist/card/index.js +3 -3
- package/dist/carousel/index.cjs +2 -2
- package/dist/carousel/index.js +1 -1
- package/dist/checkbox/index.cjs +11 -11
- package/dist/checkbox/index.js +6 -6
- package/dist/chip/index.cjs +11 -11
- package/dist/chip/index.js +9 -9
- package/dist/{chunk-K24VDBNN.js → chunk-4JFWQ5XT.js} +2 -2
- package/dist/{chunk-RZJFCDFS.cjs → chunk-7UFBLUMV.cjs} +13 -19
- package/dist/{chunk-M6A23KUM.js → chunk-A45TVXU5.js} +29 -5
- package/dist/{chunk-3XWF77Y3.cjs → chunk-BYWUAPC4.cjs} +4 -4
- package/dist/{chunk-X5KNZ6YJ.cjs → chunk-DJ4Q37UT.cjs} +2 -2
- package/dist/{chunk-LVNBYERF.js → chunk-RBSA4NH4.js} +13 -19
- package/dist/{chunk-HYL4EU3Y.cjs → chunk-UGEINZM7.cjs} +14 -13
- package/dist/{chunk-WGWXGIZ3.js → chunk-UU4HHBDN.js} +10 -9
- package/dist/{chunk-J3BOFXIH.js → chunk-VSZEXOUN.js} +4 -4
- package/dist/{chunk-FBTBWI3P.cjs → chunk-YIEUN3G5.cjs} +7 -7
- package/dist/{chunk-43I45LX7.cjs → chunk-ZH6ZSV2Q.cjs} +33 -9
- package/dist/{chunk-2JKWVIPB.js → chunk-ZY7IUTAT.js} +1 -1
- package/dist/color-picker/index.cjs +7 -7
- package/dist/color-picker/index.d.cts +1 -1
- package/dist/color-picker/index.d.ts +1 -1
- package/dist/color-picker/index.js +4 -4
- package/dist/core/index.cjs +2 -2
- package/dist/core/index.d.cts +1 -2
- package/dist/core/index.d.ts +1 -2
- package/dist/core/index.js +1 -1
- package/dist/datepicker/index.cjs +28 -30
- package/dist/datepicker/index.d.cts +1 -1
- package/dist/datepicker/index.d.ts +1 -1
- package/dist/datepicker/index.js +17 -19
- package/dist/dialog/index.cjs +5 -5
- package/dist/dialog/index.js +1 -1
- package/dist/divider/index.cjs +3 -3
- package/dist/divider/index.js +2 -2
- package/dist/drawer/index.cjs +4 -4
- package/dist/drawer/index.js +3 -3
- package/dist/expansion-panel/index.cjs +12 -12
- package/dist/expansion-panel/index.js +3 -3
- package/dist/fab/index.cjs +4 -4
- package/dist/fab/index.js +3 -3
- package/dist/fab-menu/index.cjs +8 -8
- package/dist/fab-menu/index.js +4 -4
- package/dist/feature-discovery/index.cjs +6 -6
- package/dist/feature-discovery/index.js +5 -5
- package/dist/indicator/index.cjs +3 -3
- package/dist/indicator/index.js +2 -2
- package/dist/input/index.cjs +38 -20
- package/dist/input/index.d.cts +2 -2
- package/dist/input/index.d.ts +2 -2
- package/dist/input/index.js +36 -18
- package/dist/input-trigger/index.cjs +193 -4
- package/dist/input-trigger/index.d.cts +5 -3
- package/dist/input-trigger/index.d.ts +5 -3
- package/dist/input-trigger/index.js +192 -3
- package/dist/{input-trigger.type-BL70fHE9.d.cts → input-trigger.type-By_1ZjKd.d.cts} +86 -3
- package/dist/{input-trigger.type-BODYStHk.d.ts → input-trigger.type-DlSqg2eG.d.ts} +86 -3
- package/dist/list/index.cjs +6 -6
- package/dist/list/index.js +2 -2
- package/dist/menu/index.cjs +4 -4
- package/dist/menu/index.js +2 -2
- package/dist/menubox/index.cjs +7 -7
- package/dist/menubox/index.d.cts +1 -1
- package/dist/menubox/index.d.ts +1 -1
- package/dist/menubox/index.js +3 -3
- package/dist/picker/index.cjs +7 -7
- package/dist/picker/index.d.cts +1 -1
- package/dist/picker/index.d.ts +1 -1
- package/dist/picker/index.js +4 -4
- package/dist/progress/index.cjs +3 -3
- package/dist/progress/index.js +2 -2
- package/dist/radio/index.cjs +9 -9
- package/dist/radio/index.js +3 -3
- package/dist/refresh-control/index.cjs +45 -0
- package/dist/refresh-control/index.d.cts +55 -0
- package/dist/refresh-control/index.d.ts +55 -0
- package/dist/refresh-control/index.js +45 -0
- package/dist/segment-button/index.cjs +8 -8
- package/dist/segment-button/index.js +5 -5
- package/dist/select/index.cjs +50 -58
- package/dist/select/index.d.cts +2 -2
- package/dist/select/index.d.ts +2 -2
- package/dist/select/index.js +37 -45
- package/dist/skeleton/index.cjs +4 -4
- package/dist/skeleton/index.js +3 -3
- package/dist/slider/index.cjs +5 -5
- package/dist/slider/index.js +1 -1
- package/dist/snackbar/index.cjs +6 -6
- package/dist/snackbar/index.js +4 -4
- package/dist/snippet/index.cjs +4 -4
- package/dist/snippet/index.js +2 -2
- package/dist/stepper/index.cjs +3 -3
- package/dist/stepper/index.js +2 -2
- package/dist/switch/index.cjs +8 -8
- package/dist/switch/index.js +2 -2
- package/dist/tabs/index.cjs +7 -7
- package/dist/tabs/index.js +4 -4
- package/dist/timepicker/index.cjs +7 -7
- package/dist/timepicker/index.js +4 -4
- package/dist/toolbar/index.cjs +3 -3
- package/dist/toolbar/index.js +2 -2
- package/dist/typography/index.cjs +3 -3
- package/dist/typography/index.js +1 -1
- package/dist/view/index.cjs +4 -4
- package/dist/view/index.js +2 -2
- package/package.json +8 -3
|
@@ -2,7 +2,7 @@ import React, { ReactNode } from 'react';
|
|
|
2
2
|
import { ViewStyle, TextStyle } from 'react-native';
|
|
3
3
|
import { T as ThemeColor, S as Size, R as Radius } from '../index-BOw6tbkc.cjs';
|
|
4
4
|
|
|
5
|
-
type AutocompleteVariant = '
|
|
5
|
+
type AutocompleteVariant = 'bordered' | 'colored' | 'light' | 'underlined';
|
|
6
6
|
type AutocompleteLabelPlacement = 'inside' | 'outside' | 'outside-left' | 'outside-top';
|
|
7
7
|
type AutocompleteMenuTrigger = 'focus' | 'input' | 'manual';
|
|
8
8
|
type AutocompleteCustomAppearance = {
|
|
@@ -2,7 +2,7 @@ import React, { ReactNode } from 'react';
|
|
|
2
2
|
import { ViewStyle, TextStyle } from 'react-native';
|
|
3
3
|
import { T as ThemeColor, S as Size, R as Radius } from '../index-BOw6tbkc.js';
|
|
4
4
|
|
|
5
|
-
type AutocompleteVariant = '
|
|
5
|
+
type AutocompleteVariant = 'bordered' | 'colored' | 'light' | 'underlined';
|
|
6
6
|
type AutocompleteLabelPlacement = 'inside' | 'outside' | 'outside-left' | 'outside-top';
|
|
7
7
|
type AutocompleteMenuTrigger = 'focus' | 'input' | 'manual';
|
|
8
8
|
type AutocompleteCustomAppearance = {
|
|
@@ -5,7 +5,7 @@ import "../chunk-SHBDANQN.js";
|
|
|
5
5
|
import {
|
|
6
6
|
Portal,
|
|
7
7
|
useXUITheme
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-RBSA4NH4.js";
|
|
9
9
|
|
|
10
10
|
// src/components/autocomplete/autocomplete.tsx
|
|
11
11
|
import React4, { useCallback as useCallback3, useMemo as useMemo3, useRef as useRef3, useState as useState3 } from "react";
|
|
@@ -21,7 +21,7 @@ var AutocompleteContext = createContext({
|
|
|
21
21
|
|
|
22
22
|
// src/components/autocomplete/autocomplete.hook.ts
|
|
23
23
|
import { useMemo } from "react";
|
|
24
|
-
import { getSafeThemeColor } from "@xaui/core";
|
|
24
|
+
import { getSafeThemeColor, withOpacity } from "@xaui/core";
|
|
25
25
|
import { colors } from "@xaui/core/palette";
|
|
26
26
|
var useAutocompleteColorScheme = (themeColor) => {
|
|
27
27
|
const theme = useXUITheme();
|
|
@@ -93,28 +93,23 @@ var useAutocompleteVariantStyles = (themeColor, variant, isInvalid) => {
|
|
|
93
93
|
const { theme, colorScheme } = useAutocompleteColorScheme(themeColor);
|
|
94
94
|
return useMemo(() => {
|
|
95
95
|
let borderColor = isInvalid ? theme.colors.danger.main : colorScheme.main;
|
|
96
|
-
if (
|
|
96
|
+
if (variant === "bordered" && themeColor === "default") {
|
|
97
97
|
borderColor = colors.gray[300];
|
|
98
98
|
}
|
|
99
99
|
const styles4 = {
|
|
100
|
-
|
|
100
|
+
bordered: {
|
|
101
101
|
backgroundColor: "transparent",
|
|
102
102
|
borderWidth: theme.borderWidth.md,
|
|
103
103
|
borderColor
|
|
104
104
|
},
|
|
105
|
-
|
|
106
|
-
backgroundColor: colorScheme.
|
|
105
|
+
colored: {
|
|
106
|
+
backgroundColor: withOpacity(colorScheme.container, 0.5),
|
|
107
107
|
borderWidth: 0
|
|
108
108
|
},
|
|
109
109
|
light: {
|
|
110
110
|
backgroundColor: "transparent",
|
|
111
111
|
borderWidth: 0
|
|
112
112
|
},
|
|
113
|
-
faded: {
|
|
114
|
-
backgroundColor: `${colorScheme.background}90`,
|
|
115
|
-
borderWidth: theme.borderWidth.md,
|
|
116
|
-
borderColor
|
|
117
|
-
},
|
|
118
113
|
underlined: {
|
|
119
114
|
backgroundColor: "transparent",
|
|
120
115
|
borderBottomWidth: theme.borderWidth.md,
|
|
@@ -420,7 +415,7 @@ var styles2 = StyleSheet2.create({
|
|
|
420
415
|
});
|
|
421
416
|
|
|
422
417
|
// src/components/dialogs/autocomplete-dialog/autocomplete-dialog-header.tsx
|
|
423
|
-
import { withOpacity } from "@xaui/core";
|
|
418
|
+
import { withOpacity as withOpacity2 } from "@xaui/core";
|
|
424
419
|
var AutocompleteDialogHeader = ({
|
|
425
420
|
title,
|
|
426
421
|
inputValue,
|
|
@@ -451,11 +446,11 @@ var AutocompleteDialogHeader = ({
|
|
|
451
446
|
value: inputValue,
|
|
452
447
|
onChangeText: onInputChange,
|
|
453
448
|
placeholder,
|
|
454
|
-
placeholderTextColor:
|
|
449
|
+
placeholderTextColor: withOpacity2(theme.colors.foreground, 0.5),
|
|
455
450
|
style: [
|
|
456
451
|
styles2.input,
|
|
457
452
|
{
|
|
458
|
-
backgroundColor: theme.colors.default.
|
|
453
|
+
backgroundColor: theme.colors.default.container,
|
|
459
454
|
color: theme.colors.foreground
|
|
460
455
|
},
|
|
461
456
|
inputTextStyle
|
|
@@ -562,7 +557,7 @@ var AutocompleteDialog = ({
|
|
|
562
557
|
[children]
|
|
563
558
|
);
|
|
564
559
|
const checkmarkColor = theme.colors[themeColor].main;
|
|
565
|
-
const checkmarkBackgroundColor = theme.colors[themeColor].
|
|
560
|
+
const checkmarkBackgroundColor = theme.colors[themeColor].container;
|
|
566
561
|
useAutocompleteDialogAnimation({ visible, fadeAnim, slideAnim, scaleAnim });
|
|
567
562
|
useEffect3(() => {
|
|
568
563
|
if (!visible) return;
|
|
@@ -748,7 +743,7 @@ var AutocompleteTrigger = ({
|
|
|
748
743
|
var defaultPlaceholder = "Search...";
|
|
749
744
|
var Autocomplete = ({
|
|
750
745
|
children,
|
|
751
|
-
variant = "
|
|
746
|
+
variant = "colored",
|
|
752
747
|
themeColor = "default",
|
|
753
748
|
size = "md",
|
|
754
749
|
radius = "md",
|
package/dist/avatar/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
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-56RPWZD2.cjs');
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunk7UFBLUMVcjs = require('../chunk-7UFBLUMV.cjs');
|
|
5
5
|
|
|
6
6
|
// src/components/avatar/avatar.tsx
|
|
7
7
|
var _react = require('react'); var _react2 = _interopRequireDefault(_react);
|
|
@@ -50,7 +50,7 @@ function resolveAvatarSize(size) {
|
|
|
50
50
|
return sizeMap[size];
|
|
51
51
|
}
|
|
52
52
|
function useAvatarSizeStyles(size) {
|
|
53
|
-
const theme =
|
|
53
|
+
const theme = _chunk7UFBLUMVcjs.useXUITheme.call(void 0, );
|
|
54
54
|
const resolvedSize = _react.useMemo.call(void 0, () => resolveAvatarSize(size), [size]);
|
|
55
55
|
const fontSize = _react.useMemo.call(void 0, () => {
|
|
56
56
|
if (typeof size === "number") {
|
|
@@ -64,7 +64,7 @@ function useAvatarSizeStyles(size) {
|
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
66
|
function useAvatarRadiusStyles(radius, size) {
|
|
67
|
-
const theme =
|
|
67
|
+
const theme = _chunk7UFBLUMVcjs.useXUITheme.call(void 0, );
|
|
68
68
|
return _react.useMemo.call(void 0, () => {
|
|
69
69
|
if (radius === "full") {
|
|
70
70
|
return { borderRadius: size / 2 };
|
|
@@ -80,21 +80,21 @@ function useAvatarRadiusStyles(radius, size) {
|
|
|
80
80
|
}, [radius, size, theme]);
|
|
81
81
|
}
|
|
82
82
|
function useAvatarColors(themeColor, isDisabled) {
|
|
83
|
-
const theme =
|
|
83
|
+
const theme = _chunk7UFBLUMVcjs.useXUITheme.call(void 0, );
|
|
84
84
|
const safeThemeColor = _core.getSafeThemeColor.call(void 0, themeColor);
|
|
85
85
|
const colorScheme = theme.colors[safeThemeColor];
|
|
86
86
|
const backgroundColor = _react.useMemo.call(void 0, () => {
|
|
87
87
|
if (isDisabled) {
|
|
88
88
|
return theme.colors.background;
|
|
89
89
|
}
|
|
90
|
-
return colorScheme.
|
|
91
|
-
}, [colorScheme.
|
|
90
|
+
return colorScheme.container;
|
|
91
|
+
}, [colorScheme.container, isDisabled, theme.colors.background]);
|
|
92
92
|
const textColor = _react.useMemo.call(void 0, () => {
|
|
93
93
|
if (safeThemeColor === "default") {
|
|
94
94
|
return theme.colors.foreground;
|
|
95
95
|
}
|
|
96
|
-
return colorScheme.
|
|
97
|
-
}, [safeThemeColor, colorScheme.
|
|
96
|
+
return colorScheme.onContainer;
|
|
97
|
+
}, [safeThemeColor, colorScheme.onContainer, theme.colors.foreground]);
|
|
98
98
|
return {
|
|
99
99
|
backgroundColor,
|
|
100
100
|
textColor,
|
|
@@ -199,7 +199,7 @@ var AvatarGroup = ({
|
|
|
199
199
|
renderCount,
|
|
200
200
|
customAppearance
|
|
201
201
|
}) => {
|
|
202
|
-
const theme =
|
|
202
|
+
const theme = _chunk7UFBLUMVcjs.useXUITheme.call(void 0, );
|
|
203
203
|
const resolvedSize = resolveAvatarSize(size);
|
|
204
204
|
const spacing = theme.spacing.xs;
|
|
205
205
|
const overlap = Math.round(resolvedSize * 0.28);
|
package/dist/avatar/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../chunk-SHBDANQN.js";
|
|
2
2
|
import {
|
|
3
3
|
useXUITheme
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-RBSA4NH4.js";
|
|
5
5
|
|
|
6
6
|
// src/components/avatar/avatar.tsx
|
|
7
7
|
import React from "react";
|
|
@@ -87,14 +87,14 @@ function useAvatarColors(themeColor, isDisabled) {
|
|
|
87
87
|
if (isDisabled) {
|
|
88
88
|
return theme.colors.background;
|
|
89
89
|
}
|
|
90
|
-
return colorScheme.
|
|
91
|
-
}, [colorScheme.
|
|
90
|
+
return colorScheme.container;
|
|
91
|
+
}, [colorScheme.container, isDisabled, theme.colors.background]);
|
|
92
92
|
const textColor = useMemo(() => {
|
|
93
93
|
if (safeThemeColor === "default") {
|
|
94
94
|
return theme.colors.foreground;
|
|
95
95
|
}
|
|
96
|
-
return colorScheme.
|
|
97
|
-
}, [safeThemeColor, colorScheme.
|
|
96
|
+
return colorScheme.onContainer;
|
|
97
|
+
}, [safeThemeColor, colorScheme.onContainer, theme.colors.foreground]);
|
|
98
98
|
return {
|
|
99
99
|
backgroundColor,
|
|
100
100
|
textColor,
|
package/dist/badge/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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-56RPWZD2.cjs');
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunk7UFBLUMVcjs = require('../chunk-7UFBLUMV.cjs');
|
|
5
5
|
|
|
6
6
|
// src/components/badge/badge.tsx
|
|
7
7
|
var _react = require('react'); var _react2 = _interopRequireDefault(_react);
|
|
@@ -41,7 +41,7 @@ var fontSizeMap = {
|
|
|
41
41
|
lg: 12
|
|
42
42
|
};
|
|
43
43
|
function useBadgeSizeStyles(size, isDot, isOneChar) {
|
|
44
|
-
const theme =
|
|
44
|
+
const theme = _chunk7UFBLUMVcjs.useXUITheme.call(void 0, );
|
|
45
45
|
return _react.useMemo.call(void 0, () => {
|
|
46
46
|
const { height, minWidth, dot } = sizeMap[size];
|
|
47
47
|
const fontSize = fontSizeMap[size];
|
|
@@ -71,38 +71,37 @@ function useBadgeSizeStyles(size, isDot, isOneChar) {
|
|
|
71
71
|
}, [isDot, isOneChar, size, theme]);
|
|
72
72
|
}
|
|
73
73
|
function useBadgeVariantStyles(themeColor, variant) {
|
|
74
|
-
const theme =
|
|
74
|
+
const theme = _chunk7UFBLUMVcjs.useXUITheme.call(void 0, );
|
|
75
75
|
const safeThemeColor = _core.getSafeThemeColor.call(void 0, themeColor);
|
|
76
76
|
const colorScheme = theme.colors[safeThemeColor];
|
|
77
77
|
return _react.useMemo.call(void 0, () => {
|
|
78
|
-
const isDark = theme.mode === "dark";
|
|
79
78
|
if (variant === "flat") {
|
|
80
79
|
return {
|
|
81
|
-
backgroundColor:
|
|
82
|
-
color: colorScheme.
|
|
80
|
+
backgroundColor: colorScheme.container,
|
|
81
|
+
color: colorScheme.onContainer
|
|
83
82
|
};
|
|
84
83
|
}
|
|
85
84
|
if (variant === "faded") {
|
|
86
85
|
return {
|
|
87
|
-
backgroundColor:
|
|
88
|
-
color: colorScheme.
|
|
86
|
+
backgroundColor: _core.withOpacity.call(void 0, colorScheme.container, 0.7),
|
|
87
|
+
color: colorScheme.onContainer
|
|
89
88
|
};
|
|
90
89
|
}
|
|
91
90
|
if (variant === "shadow") {
|
|
92
91
|
return {
|
|
93
|
-
backgroundColor:
|
|
94
|
-
color:
|
|
92
|
+
backgroundColor: colorScheme.main,
|
|
93
|
+
color: colorScheme.onMain,
|
|
95
94
|
shadow: theme.shadows.sm
|
|
96
95
|
};
|
|
97
96
|
}
|
|
98
97
|
return {
|
|
99
|
-
backgroundColor:
|
|
100
|
-
color:
|
|
98
|
+
backgroundColor: colorScheme.main,
|
|
99
|
+
color: colorScheme.onMain
|
|
101
100
|
};
|
|
102
101
|
}, [colorScheme, theme, variant]);
|
|
103
102
|
}
|
|
104
103
|
function useBadgeRadiusStyles(radius, height) {
|
|
105
|
-
const theme =
|
|
104
|
+
const theme = _chunk7UFBLUMVcjs.useXUITheme.call(void 0, );
|
|
106
105
|
return _react.useMemo.call(void 0, () => {
|
|
107
106
|
if (radius === "full") {
|
|
108
107
|
return { borderRadius: height / 2 };
|
|
@@ -148,7 +147,7 @@ var Badge = ({
|
|
|
148
147
|
if (!shouldRender && !children) {
|
|
149
148
|
return null;
|
|
150
149
|
}
|
|
151
|
-
const forceOneChar = isOneChar
|
|
150
|
+
const forceOneChar = isOneChar;
|
|
152
151
|
const sizeStyles = useBadgeSizeStyles(size, isDot, forceOneChar);
|
|
153
152
|
const variantStyles = useBadgeVariantStyles(themeColor, variant);
|
|
154
153
|
const radiusStyles = useBadgeRadiusStyles(radius, sizeStyles.height);
|
package/dist/badge/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../chunk-SHBDANQN.js";
|
|
2
2
|
import {
|
|
3
3
|
useXUITheme
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-RBSA4NH4.js";
|
|
5
5
|
|
|
6
6
|
// src/components/badge/badge.tsx
|
|
7
7
|
import React from "react";
|
|
@@ -75,29 +75,28 @@ function useBadgeVariantStyles(themeColor, variant) {
|
|
|
75
75
|
const safeThemeColor = getSafeThemeColor(themeColor);
|
|
76
76
|
const colorScheme = theme.colors[safeThemeColor];
|
|
77
77
|
return useMemo(() => {
|
|
78
|
-
const isDark = theme.mode === "dark";
|
|
79
78
|
if (variant === "flat") {
|
|
80
79
|
return {
|
|
81
|
-
backgroundColor:
|
|
82
|
-
color: colorScheme.
|
|
80
|
+
backgroundColor: colorScheme.container,
|
|
81
|
+
color: colorScheme.onContainer
|
|
83
82
|
};
|
|
84
83
|
}
|
|
85
84
|
if (variant === "faded") {
|
|
86
85
|
return {
|
|
87
|
-
backgroundColor:
|
|
88
|
-
color: colorScheme.
|
|
86
|
+
backgroundColor: withOpacity(colorScheme.container, 0.7),
|
|
87
|
+
color: colorScheme.onContainer
|
|
89
88
|
};
|
|
90
89
|
}
|
|
91
90
|
if (variant === "shadow") {
|
|
92
91
|
return {
|
|
93
|
-
backgroundColor:
|
|
94
|
-
color:
|
|
92
|
+
backgroundColor: colorScheme.main,
|
|
93
|
+
color: colorScheme.onMain,
|
|
95
94
|
shadow: theme.shadows.sm
|
|
96
95
|
};
|
|
97
96
|
}
|
|
98
97
|
return {
|
|
99
|
-
backgroundColor:
|
|
100
|
-
color:
|
|
98
|
+
backgroundColor: colorScheme.main,
|
|
99
|
+
color: colorScheme.onMain
|
|
101
100
|
};
|
|
102
101
|
}, [colorScheme, theme, variant]);
|
|
103
102
|
}
|
|
@@ -148,7 +147,7 @@ var Badge = ({
|
|
|
148
147
|
if (!shouldRender && !children) {
|
|
149
148
|
return null;
|
|
150
149
|
}
|
|
151
|
-
const forceOneChar = isOneChar
|
|
150
|
+
const forceOneChar = isOneChar;
|
|
152
151
|
const sizeStyles = useBadgeSizeStyles(size, isDot, forceOneChar);
|
|
153
152
|
const variantStyles = useBadgeVariantStyles(themeColor, variant);
|
|
154
153
|
const radiusStyles = useBadgeRadiusStyles(radius, sizeStyles.height);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-EUQDGTST.cjs');
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkBYWUAPC4cjs = require('../chunk-BYWUAPC4.cjs');
|
|
5
5
|
require('../chunk-56RPWZD2.cjs');
|
|
6
|
-
require('../chunk-
|
|
6
|
+
require('../chunk-7UFBLUMV.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
exports.BottomSheet =
|
|
9
|
+
exports.BottomSheet = _chunkBYWUAPC4cjs.BottomSheet;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
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-56RPWZD2.cjs');
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunk7UFBLUMVcjs = require('../chunk-7UFBLUMV.cjs');
|
|
5
5
|
|
|
6
6
|
// src/components/bottom-tab-bar/bottom-tab-bar.tsx
|
|
7
7
|
var _react = require('react'); var _react2 = _interopRequireDefault(_react);
|
|
@@ -49,7 +49,7 @@ var useBottomTabBarSizeStyles = (size) => {
|
|
|
49
49
|
return _react.useMemo.call(void 0, () => sizeMap[size], [size]);
|
|
50
50
|
};
|
|
51
51
|
var useBottomTabBarColors = (themeColor, activeColor, inactiveColor, indicatorColor) => {
|
|
52
|
-
const theme =
|
|
52
|
+
const theme = _chunk7UFBLUMVcjs.useXUITheme.call(void 0, );
|
|
53
53
|
const colorScheme = theme.colors[_core.getSafeThemeColor.call(void 0, themeColor)];
|
|
54
54
|
return _react.useMemo.call(void 0, () => {
|
|
55
55
|
return {
|
package/dist/button/index.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkYIEUN3G5cjs = require('../chunk-YIEUN3G5.cjs');
|
|
4
4
|
require('../chunk-56RPWZD2.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunk7UFBLUMVcjs = require('../chunk-7UFBLUMV.cjs');
|
|
9
9
|
|
|
10
10
|
// src/components/button/button.tsx
|
|
11
11
|
var _react = require('react'); var _react2 = _interopRequireDefault(_react);
|
|
@@ -56,22 +56,20 @@ var styles = _reactnative.StyleSheet.create({
|
|
|
56
56
|
|
|
57
57
|
var _core = require('@xaui/core');
|
|
58
58
|
var useTextStyles = (themeColor, variant) => {
|
|
59
|
-
const theme =
|
|
59
|
+
const theme = _chunk7UFBLUMVcjs.useXUITheme.call(void 0, );
|
|
60
60
|
const safeThemeColor = _core.getSafeThemeColor.call(void 0, themeColor);
|
|
61
61
|
const colorScheme = theme.colors[safeThemeColor];
|
|
62
62
|
const textColor = _react.useMemo.call(void 0, () => {
|
|
63
|
-
|
|
64
|
-
if (variant === "
|
|
65
|
-
return isDark ? colorScheme.main : colorScheme.foreground;
|
|
66
|
-
}
|
|
63
|
+
if (variant === "solid") return colorScheme.onMain;
|
|
64
|
+
if (variant === "flat" || variant === "faded") return colorScheme.onContainer;
|
|
67
65
|
return colorScheme.main;
|
|
68
|
-
}, [variant, colorScheme
|
|
66
|
+
}, [variant, colorScheme]);
|
|
69
67
|
return {
|
|
70
68
|
textColor
|
|
71
69
|
};
|
|
72
70
|
};
|
|
73
71
|
function useSizesStyles(size) {
|
|
74
|
-
const theme =
|
|
72
|
+
const theme = _chunk7UFBLUMVcjs.useXUITheme.call(void 0, );
|
|
75
73
|
const sizeStyles = _react.useMemo.call(void 0, () => {
|
|
76
74
|
const sizes = {
|
|
77
75
|
xs: {
|
|
@@ -113,23 +111,22 @@ function useSizesStyles(size) {
|
|
|
113
111
|
return { sizeStyles, spinnerSize };
|
|
114
112
|
}
|
|
115
113
|
function useVariantSizesStyles(themeColor, variant, elevation = 0) {
|
|
116
|
-
const theme =
|
|
114
|
+
const theme = _chunk7UFBLUMVcjs.useXUITheme.call(void 0, );
|
|
117
115
|
const safeThemeColor = _core.getSafeThemeColor.call(void 0, themeColor);
|
|
118
116
|
const colorScheme = theme.colors[safeThemeColor];
|
|
119
117
|
const variantStyles = _react.useMemo.call(void 0, () => {
|
|
120
|
-
const isDark = theme.mode === "dark";
|
|
121
118
|
const styles2 = {
|
|
122
119
|
solid: {
|
|
123
|
-
backgroundColor:
|
|
120
|
+
backgroundColor: colorScheme.main,
|
|
124
121
|
borderWidth: 0
|
|
125
122
|
},
|
|
126
|
-
|
|
123
|
+
bordered: {
|
|
127
124
|
backgroundColor: "transparent",
|
|
128
125
|
borderWidth: theme.borderWidth.md,
|
|
129
126
|
borderColor: colorScheme.main
|
|
130
127
|
},
|
|
131
128
|
flat: {
|
|
132
|
-
backgroundColor:
|
|
129
|
+
backgroundColor: colorScheme.container,
|
|
133
130
|
borderWidth: 0
|
|
134
131
|
},
|
|
135
132
|
light: {
|
|
@@ -137,13 +134,13 @@ function useVariantSizesStyles(themeColor, variant, elevation = 0) {
|
|
|
137
134
|
borderWidth: 0
|
|
138
135
|
},
|
|
139
136
|
faded: {
|
|
140
|
-
backgroundColor:
|
|
137
|
+
backgroundColor: colorScheme.container,
|
|
141
138
|
borderWidth: theme.borderWidth.md,
|
|
142
|
-
borderColor:
|
|
139
|
+
borderColor: colorScheme.main
|
|
143
140
|
}
|
|
144
141
|
};
|
|
145
142
|
const baseStyle = styles2[variant];
|
|
146
|
-
const shouldApplyElevation = variant !== "
|
|
143
|
+
const shouldApplyElevation = variant !== "bordered" && variant !== "light";
|
|
147
144
|
const shadowStyles = elevation === 0 ? {} : elevation === 1 ? theme.shadows.sm : elevation === 2 ? theme.shadows.md : elevation === 3 ? theme.shadows.lg : theme.shadows.xl;
|
|
148
145
|
return {
|
|
149
146
|
...baseStyle,
|
|
@@ -210,7 +207,7 @@ var Button = ({
|
|
|
210
207
|
const animatedScale = _react2.default.useRef(new _reactnative.Animated.Value(1)).current;
|
|
211
208
|
const animatedOpacity = _react2.default.useRef(new _reactnative.Animated.Value(1)).current;
|
|
212
209
|
const { sizeStyles, spinnerSize } = useSizesStyles(size);
|
|
213
|
-
const radiusStyles =
|
|
210
|
+
const radiusStyles = _chunk7UFBLUMVcjs.useBorderRadiusStyles.call(void 0, radius);
|
|
214
211
|
const variantStyles = useVariantSizesStyles(themeColor, variant, elevation);
|
|
215
212
|
const { textColor } = useTextStyles(themeColor, variant);
|
|
216
213
|
const handlePressIn = (event) => {
|
|
@@ -226,7 +223,7 @@ var Button = ({
|
|
|
226
223
|
_optionalChain([onPressOut, 'optionalCall', _2 => _2(event)]);
|
|
227
224
|
};
|
|
228
225
|
const spinner = /* @__PURE__ */ _react2.default.createElement(
|
|
229
|
-
|
|
226
|
+
_chunkYIEUN3G5cjs.ActivityIndicator,
|
|
230
227
|
{
|
|
231
228
|
variant: "circular",
|
|
232
229
|
themeColor: variant === "solid" ? void 0 : themeColor,
|
|
@@ -300,7 +297,7 @@ var iconButtonStyles = _reactnative.StyleSheet.create({
|
|
|
300
297
|
// src/components/button/icon-button.hook.ts
|
|
301
298
|
|
|
302
299
|
var useIconButtonSizeStyles = (size) => {
|
|
303
|
-
const theme =
|
|
300
|
+
const theme = _chunk7UFBLUMVcjs.useXUITheme.call(void 0, );
|
|
304
301
|
return _react.useMemo.call(void 0, () => {
|
|
305
302
|
const sizeMap = {
|
|
306
303
|
xs: { width: theme.componentSizes.xs, height: theme.componentSizes.xs },
|
|
@@ -331,7 +328,7 @@ var IconButton = ({
|
|
|
331
328
|
const animatedScale = _react2.default.useRef(new _reactnative.Animated.Value(1)).current;
|
|
332
329
|
const animatedOpacity = _react2.default.useRef(new _reactnative.Animated.Value(1)).current;
|
|
333
330
|
const sizeStyles = useIconButtonSizeStyles(size);
|
|
334
|
-
const radiusStyles =
|
|
331
|
+
const radiusStyles = _chunk7UFBLUMVcjs.useBorderRadiusStyles.call(void 0, radius);
|
|
335
332
|
const variantStyles = useVariantSizesStyles(themeColor, variant, elevation);
|
|
336
333
|
const { textColor } = useTextStyles(themeColor, variant);
|
|
337
334
|
const handlePressIn = (event) => {
|
|
@@ -378,7 +375,7 @@ var IconButton = ({
|
|
|
378
375
|
]
|
|
379
376
|
},
|
|
380
377
|
isLoading ? /* @__PURE__ */ _react2.default.createElement(
|
|
381
|
-
|
|
378
|
+
_chunkYIEUN3G5cjs.ActivityIndicator,
|
|
382
379
|
{
|
|
383
380
|
variant: "circular",
|
|
384
381
|
themeColor: variant === "solid" ? void 0 : themeColor,
|
package/dist/button/index.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ import React, { ReactNode } from 'react';
|
|
|
2
2
|
import { ViewStyle, TextStyle, GestureResponderEvent } from 'react-native';
|
|
3
3
|
import { T as ThemeColor, S as Size } from '../index-BOw6tbkc.cjs';
|
|
4
4
|
|
|
5
|
-
type ButtonVariant = 'solid' | '
|
|
5
|
+
type ButtonVariant = 'solid' | 'bordered' | 'flat' | 'light' | 'faded';
|
|
6
6
|
type ButtonRadius = 'none' | 'sm' | 'md' | 'lg' | 'full';
|
|
7
7
|
type SpinnerPlacement = 'start' | 'end';
|
|
8
8
|
type ElevationLevel = 0 | 1 | 2 | 3 | 4;
|
|
@@ -75,7 +75,7 @@ type ButtonProps = {
|
|
|
75
75
|
isLoading?: boolean;
|
|
76
76
|
/**
|
|
77
77
|
* Android elevation level from 0 to 4.
|
|
78
|
-
* Does not apply to `
|
|
78
|
+
* Does not apply to `bordered` and `light` variants.
|
|
79
79
|
* @default 0
|
|
80
80
|
*/
|
|
81
81
|
elevation?: ElevationLevel;
|
|
@@ -140,7 +140,7 @@ type IconButtonProps = {
|
|
|
140
140
|
isLoading?: boolean;
|
|
141
141
|
/**
|
|
142
142
|
* Android elevation level from 0 to 4.
|
|
143
|
-
* Does not apply to `
|
|
143
|
+
* Does not apply to `bordered` and `light` variants.
|
|
144
144
|
* @default 0
|
|
145
145
|
*/
|
|
146
146
|
elevation?: ElevationLevel;
|
package/dist/button/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import React, { ReactNode } from 'react';
|
|
|
2
2
|
import { ViewStyle, TextStyle, GestureResponderEvent } from 'react-native';
|
|
3
3
|
import { T as ThemeColor, S as Size } from '../index-BOw6tbkc.js';
|
|
4
4
|
|
|
5
|
-
type ButtonVariant = 'solid' | '
|
|
5
|
+
type ButtonVariant = 'solid' | 'bordered' | 'flat' | 'light' | 'faded';
|
|
6
6
|
type ButtonRadius = 'none' | 'sm' | 'md' | 'lg' | 'full';
|
|
7
7
|
type SpinnerPlacement = 'start' | 'end';
|
|
8
8
|
type ElevationLevel = 0 | 1 | 2 | 3 | 4;
|
|
@@ -75,7 +75,7 @@ type ButtonProps = {
|
|
|
75
75
|
isLoading?: boolean;
|
|
76
76
|
/**
|
|
77
77
|
* Android elevation level from 0 to 4.
|
|
78
|
-
* Does not apply to `
|
|
78
|
+
* Does not apply to `bordered` and `light` variants.
|
|
79
79
|
* @default 0
|
|
80
80
|
*/
|
|
81
81
|
elevation?: ElevationLevel;
|
|
@@ -140,7 +140,7 @@ type IconButtonProps = {
|
|
|
140
140
|
isLoading?: boolean;
|
|
141
141
|
/**
|
|
142
142
|
* Android elevation level from 0 to 4.
|
|
143
|
-
* Does not apply to `
|
|
143
|
+
* Does not apply to `bordered` and `light` variants.
|
|
144
144
|
* @default 0
|
|
145
145
|
*/
|
|
146
146
|
elevation?: ElevationLevel;
|
package/dist/button/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ActivityIndicator
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-VSZEXOUN.js";
|
|
4
4
|
import "../chunk-SHBDANQN.js";
|
|
5
5
|
import {
|
|
6
6
|
useBorderRadiusStyles,
|
|
7
7
|
useXUITheme
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-RBSA4NH4.js";
|
|
9
9
|
|
|
10
10
|
// src/components/button/button.tsx
|
|
11
11
|
import React from "react";
|
|
@@ -54,18 +54,16 @@ var styles = StyleSheet.create({
|
|
|
54
54
|
|
|
55
55
|
// src/components/button/button.hook.ts
|
|
56
56
|
import { useMemo } from "react";
|
|
57
|
-
import { getSafeThemeColor
|
|
57
|
+
import { getSafeThemeColor } from "@xaui/core";
|
|
58
58
|
var useTextStyles = (themeColor, variant) => {
|
|
59
59
|
const theme = useXUITheme();
|
|
60
60
|
const safeThemeColor = getSafeThemeColor(themeColor);
|
|
61
61
|
const colorScheme = theme.colors[safeThemeColor];
|
|
62
62
|
const textColor = useMemo(() => {
|
|
63
|
-
|
|
64
|
-
if (variant === "
|
|
65
|
-
return isDark ? colorScheme.main : colorScheme.foreground;
|
|
66
|
-
}
|
|
63
|
+
if (variant === "solid") return colorScheme.onMain;
|
|
64
|
+
if (variant === "flat" || variant === "faded") return colorScheme.onContainer;
|
|
67
65
|
return colorScheme.main;
|
|
68
|
-
}, [variant, colorScheme
|
|
66
|
+
}, [variant, colorScheme]);
|
|
69
67
|
return {
|
|
70
68
|
textColor
|
|
71
69
|
};
|
|
@@ -117,19 +115,18 @@ function useVariantSizesStyles(themeColor, variant, elevation = 0) {
|
|
|
117
115
|
const safeThemeColor = getSafeThemeColor(themeColor);
|
|
118
116
|
const colorScheme = theme.colors[safeThemeColor];
|
|
119
117
|
const variantStyles = useMemo(() => {
|
|
120
|
-
const isDark = theme.mode === "dark";
|
|
121
118
|
const styles2 = {
|
|
122
119
|
solid: {
|
|
123
|
-
backgroundColor:
|
|
120
|
+
backgroundColor: colorScheme.main,
|
|
124
121
|
borderWidth: 0
|
|
125
122
|
},
|
|
126
|
-
|
|
123
|
+
bordered: {
|
|
127
124
|
backgroundColor: "transparent",
|
|
128
125
|
borderWidth: theme.borderWidth.md,
|
|
129
126
|
borderColor: colorScheme.main
|
|
130
127
|
},
|
|
131
128
|
flat: {
|
|
132
|
-
backgroundColor:
|
|
129
|
+
backgroundColor: colorScheme.container,
|
|
133
130
|
borderWidth: 0
|
|
134
131
|
},
|
|
135
132
|
light: {
|
|
@@ -137,13 +134,13 @@ function useVariantSizesStyles(themeColor, variant, elevation = 0) {
|
|
|
137
134
|
borderWidth: 0
|
|
138
135
|
},
|
|
139
136
|
faded: {
|
|
140
|
-
backgroundColor:
|
|
137
|
+
backgroundColor: colorScheme.container,
|
|
141
138
|
borderWidth: theme.borderWidth.md,
|
|
142
|
-
borderColor:
|
|
139
|
+
borderColor: colorScheme.main
|
|
143
140
|
}
|
|
144
141
|
};
|
|
145
142
|
const baseStyle = styles2[variant];
|
|
146
|
-
const shouldApplyElevation = variant !== "
|
|
143
|
+
const shouldApplyElevation = variant !== "bordered" && variant !== "light";
|
|
147
144
|
const shadowStyles = elevation === 0 ? {} : elevation === 1 ? theme.shadows.sm : elevation === 2 ? theme.shadows.md : elevation === 3 ? theme.shadows.lg : theme.shadows.xl;
|
|
148
145
|
return {
|
|
149
146
|
...baseStyle,
|