@xaui/native 0.0.21 → 0.0.24
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 +195 -2
- package/dist/alert/index.js +1 -2
- package/dist/app-bar/index.cjs +217 -0
- package/dist/app-bar/index.d.cts +52 -0
- package/dist/app-bar/index.d.ts +52 -0
- package/dist/app-bar/index.js +142 -0
- package/dist/autocomplete/index.js +48 -36
- package/dist/avatar/index.js +1 -2
- package/dist/badge/index.js +1 -2
- package/dist/bottom-sheet/index.js +1 -2
- package/dist/bottom-tab-bar/index.cjs +571 -0
- package/dist/bottom-tab-bar/index.d.cts +211 -0
- package/dist/bottom-tab-bar/index.d.ts +211 -0
- package/dist/bottom-tab-bar/index.js +497 -0
- package/dist/button/index.d.cts +102 -5
- package/dist/button/index.d.ts +102 -5
- package/dist/button/index.js +2 -3
- package/dist/button.type-j1ZdkkSl.d.cts +4 -0
- package/dist/button.type-j1ZdkkSl.d.ts +4 -0
- package/dist/card/index.cjs +2 -0
- package/dist/card/index.d.cts +6 -1
- package/dist/card/index.d.ts +6 -1
- package/dist/card/index.js +4 -2
- package/dist/carousel/index.js +1 -1
- package/dist/chart/index.cjs +1067 -0
- package/dist/chart/index.d.cts +218 -0
- package/dist/chart/index.d.ts +218 -0
- package/dist/chart/index.js +1026 -0
- package/dist/checkbox/index.js +1 -2
- package/dist/chip/index.js +1 -2
- package/dist/chunk-3XSXTM3G.js +661 -0
- package/dist/chunk-4KSZLONZ.js +79 -0
- package/dist/{chunk-DXXNBF5P.js → chunk-CZFDZPAS.js} +0 -5
- package/dist/{chunk-LTKYHG5V.js → chunk-GHCVNQET.js} +12 -5
- package/dist/chunk-I4V5Y5GD.js +76 -0
- package/dist/{chunk-F7WH4DMG.js → chunk-UI5L26KD.js} +1 -1
- package/dist/{chunk-LUBWRVI2.js → chunk-ULJSCNPE.js} +1 -1
- package/dist/chunk-URBEEDFX.js +79 -0
- package/dist/core/index.js +3 -5
- package/dist/datepicker/index.js +1 -2
- package/dist/divider/index.js +2 -3
- package/dist/drawer/index.cjs +310 -0
- package/dist/drawer/index.d.cts +58 -0
- package/dist/drawer/index.d.ts +58 -0
- package/dist/drawer/index.js +236 -0
- package/dist/{accordion → expansion-panel}/index.cjs +45 -45
- package/dist/{accordion → expansion-panel}/index.d.cts +30 -30
- package/dist/{accordion → expansion-panel}/index.d.ts +30 -30
- package/dist/{accordion → expansion-panel}/index.js +40 -41
- package/dist/fab/index.d.cts +3 -3
- package/dist/fab/index.d.ts +3 -3
- package/dist/fab/index.js +3 -4
- package/dist/fab-menu/index.d.cts +2 -2
- package/dist/fab-menu/index.d.ts +2 -2
- package/dist/fab-menu/index.js +3 -4
- package/dist/{fab.type-Ba0QMprb.d.ts → fab.type-CgIYqQlT.d.ts} +1 -1
- package/dist/{fab.type-U09H8B7D.d.cts → fab.type-l2vjG8-p.d.cts} +1 -1
- package/dist/feature-discovery/index.cjs +531 -0
- package/dist/feature-discovery/index.d.cts +82 -0
- package/dist/feature-discovery/index.d.ts +82 -0
- package/dist/feature-discovery/index.js +464 -0
- package/dist/indicator/index.js +2 -3
- package/dist/input/index.cjs +258 -164
- package/dist/input/index.d.cts +15 -1
- package/dist/input/index.d.ts +15 -1
- package/dist/input/index.js +219 -126
- package/dist/list/index.js +1 -2
- package/dist/menu/index.js +2 -2
- package/dist/menubox/index.cjs +369 -0
- package/dist/menubox/index.d.cts +98 -0
- package/dist/menubox/index.d.ts +98 -0
- package/dist/menubox/index.js +296 -0
- package/dist/pager/index.cjs +243 -0
- package/dist/pager/index.d.cts +93 -0
- package/dist/pager/index.d.ts +93 -0
- package/dist/pager/index.js +205 -0
- package/dist/progress/index.js +1 -2
- package/dist/radio/index.cjs +537 -0
- package/dist/radio/index.d.cts +145 -0
- package/dist/radio/index.d.ts +145 -0
- package/dist/radio/index.js +464 -0
- package/dist/segment-button/index.js +2 -2
- package/dist/select/index.js +22 -10
- package/dist/skeleton/index.js +2 -2
- package/dist/slider/index.cjs +655 -0
- package/dist/slider/index.d.cts +171 -0
- package/dist/slider/index.d.ts +171 -0
- package/dist/slider/index.js +575 -0
- package/dist/stepper/index.cjs +624 -0
- package/dist/stepper/index.d.cts +137 -0
- package/dist/stepper/index.d.ts +137 -0
- package/dist/stepper/index.js +549 -0
- package/dist/switch/index.js +1 -2
- package/dist/tabs/index.cjs +523 -0
- package/dist/tabs/index.d.cts +176 -0
- package/dist/tabs/index.d.ts +176 -0
- package/dist/tabs/index.js +438 -0
- package/dist/timepicker/index.cjs +1280 -0
- package/dist/timepicker/index.d.cts +215 -0
- package/dist/timepicker/index.d.ts +215 -0
- package/dist/timepicker/index.js +1181 -0
- package/dist/toolbar/index.cjs +395 -0
- package/dist/toolbar/index.d.cts +100 -0
- package/dist/toolbar/index.d.ts +100 -0
- package/dist/toolbar/index.js +325 -0
- package/dist/typography/index.js +1 -2
- package/dist/view/index.cjs +16 -2
- package/dist/view/index.js +16 -2
- package/package.json +73 -8
- package/dist/button.type-D8tzEBo7.d.ts +0 -104
- package/dist/button.type-ikaWzhIg.d.cts +0 -104
- package/dist/chunk-GBHQCAKW.js +0 -19
- package/dist/chunk-JEGEPGVU.js +0 -287
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useXUITheme
|
|
3
|
+
} from "../chunk-4KSZLONZ.js";
|
|
4
|
+
|
|
5
|
+
// src/components/toolbar/toolbar.tsx
|
|
6
|
+
import React, { useEffect } from "react";
|
|
7
|
+
import { View } from "react-native";
|
|
8
|
+
import Animated, {
|
|
9
|
+
useAnimatedStyle,
|
|
10
|
+
useSharedValue,
|
|
11
|
+
withSpring,
|
|
12
|
+
withTiming
|
|
13
|
+
} from "react-native-reanimated";
|
|
14
|
+
|
|
15
|
+
// src/components/toolbar/toolbar.hook.ts
|
|
16
|
+
import { useMemo } from "react";
|
|
17
|
+
import { getSafeThemeColor, withOpacity } from "@xaui/core";
|
|
18
|
+
var variantMap = {
|
|
19
|
+
floating: {
|
|
20
|
+
containerHeight: 72,
|
|
21
|
+
containerWidth: "auto",
|
|
22
|
+
iconSize: 26,
|
|
23
|
+
actionSize: 40,
|
|
24
|
+
borderRadius: 56,
|
|
25
|
+
paddingHorizontal: 16,
|
|
26
|
+
paddingVertical: 16,
|
|
27
|
+
gap: 0,
|
|
28
|
+
isElevated: true
|
|
29
|
+
},
|
|
30
|
+
docked: {
|
|
31
|
+
containerHeight: 72,
|
|
32
|
+
containerWidth: "auto",
|
|
33
|
+
iconSize: 26,
|
|
34
|
+
actionSize: 40,
|
|
35
|
+
borderRadius: 0,
|
|
36
|
+
paddingHorizontal: 16,
|
|
37
|
+
paddingVertical: 16,
|
|
38
|
+
gap: 0,
|
|
39
|
+
isElevated: false
|
|
40
|
+
},
|
|
41
|
+
vertical: {
|
|
42
|
+
containerHeight: "auto",
|
|
43
|
+
containerWidth: 80,
|
|
44
|
+
iconSize: 26,
|
|
45
|
+
actionSize: 40,
|
|
46
|
+
borderRadius: 0,
|
|
47
|
+
paddingHorizontal: 16,
|
|
48
|
+
paddingVertical: 16,
|
|
49
|
+
gap: 0,
|
|
50
|
+
isElevated: false
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
var useToolbarVariantStyles = (variant, position) => {
|
|
54
|
+
return useMemo(() => {
|
|
55
|
+
const baseStyles = variantMap[variant];
|
|
56
|
+
const isVertical = variant === "vertical";
|
|
57
|
+
return {
|
|
58
|
+
...baseStyles,
|
|
59
|
+
isVertical,
|
|
60
|
+
position
|
|
61
|
+
};
|
|
62
|
+
}, [variant, position]);
|
|
63
|
+
};
|
|
64
|
+
var useToolbarColors = (themeColor) => {
|
|
65
|
+
const theme = useXUITheme();
|
|
66
|
+
const colorScheme = theme.colors[getSafeThemeColor(themeColor)];
|
|
67
|
+
return useMemo(() => {
|
|
68
|
+
return {
|
|
69
|
+
background: theme.mode === "dark" ? theme.colors.default.background : theme.colors.background,
|
|
70
|
+
divider: withOpacity(theme.colors.foreground, 0.1),
|
|
71
|
+
title: theme.colors.foreground,
|
|
72
|
+
subtitle: withOpacity(theme.colors.foreground, 0.72),
|
|
73
|
+
action: colorScheme.main,
|
|
74
|
+
pressed: withOpacity(colorScheme.main, 0.16),
|
|
75
|
+
shadow: withOpacity(theme.colors.foreground, 0.35)
|
|
76
|
+
};
|
|
77
|
+
}, [colorScheme.main, theme.colors, theme.mode]);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
// src/components/toolbar/toolbar.style.ts
|
|
81
|
+
import { StyleSheet } from "react-native";
|
|
82
|
+
var styles = StyleSheet.create({
|
|
83
|
+
container: {
|
|
84
|
+
position: "absolute",
|
|
85
|
+
zIndex: 40
|
|
86
|
+
},
|
|
87
|
+
top: {
|
|
88
|
+
top: 0,
|
|
89
|
+
left: 0,
|
|
90
|
+
right: 0
|
|
91
|
+
},
|
|
92
|
+
bottom: {
|
|
93
|
+
bottom: 0,
|
|
94
|
+
left: 0,
|
|
95
|
+
right: 0
|
|
96
|
+
},
|
|
97
|
+
left: {
|
|
98
|
+
left: 0,
|
|
99
|
+
top: 0,
|
|
100
|
+
bottom: 0
|
|
101
|
+
},
|
|
102
|
+
right: {
|
|
103
|
+
right: 0,
|
|
104
|
+
top: 0,
|
|
105
|
+
bottom: 0
|
|
106
|
+
},
|
|
107
|
+
floating: {
|
|
108
|
+
margin: 16
|
|
109
|
+
},
|
|
110
|
+
floatingBottom: {
|
|
111
|
+
marginBottom: 16
|
|
112
|
+
},
|
|
113
|
+
floatingTop: {
|
|
114
|
+
marginTop: 16
|
|
115
|
+
},
|
|
116
|
+
elevated: {
|
|
117
|
+
shadowOffset: { width: 0, height: 2 },
|
|
118
|
+
shadowOpacity: 0.15,
|
|
119
|
+
shadowRadius: 8,
|
|
120
|
+
elevation: 3
|
|
121
|
+
},
|
|
122
|
+
content: {
|
|
123
|
+
flexDirection: "row",
|
|
124
|
+
alignItems: "center"
|
|
125
|
+
},
|
|
126
|
+
contentVertical: {
|
|
127
|
+
flexDirection: "column",
|
|
128
|
+
alignItems: "center",
|
|
129
|
+
justifyContent: "center"
|
|
130
|
+
},
|
|
131
|
+
actions: {
|
|
132
|
+
flexDirection: "row",
|
|
133
|
+
alignItems: "center",
|
|
134
|
+
justifyContent: "space-between",
|
|
135
|
+
width: "100%"
|
|
136
|
+
},
|
|
137
|
+
actionsVertical: {
|
|
138
|
+
flexDirection: "column",
|
|
139
|
+
alignItems: "center",
|
|
140
|
+
justifyContent: "space-between",
|
|
141
|
+
height: "100%"
|
|
142
|
+
},
|
|
143
|
+
actionButton: {
|
|
144
|
+
alignItems: "center",
|
|
145
|
+
justifyContent: "center",
|
|
146
|
+
borderRadius: 999
|
|
147
|
+
},
|
|
148
|
+
disabledAction: {
|
|
149
|
+
opacity: 0.38
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
// src/components/toolbar/toolbar-context.ts
|
|
154
|
+
import { createContext, useContext } from "react";
|
|
155
|
+
var ToolbarContext = createContext(null);
|
|
156
|
+
var useToolbarContext = () => {
|
|
157
|
+
return useContext(ToolbarContext);
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
// src/components/toolbar/toolbar.tsx
|
|
161
|
+
var Toolbar = ({
|
|
162
|
+
variant = "docked",
|
|
163
|
+
position = "top",
|
|
164
|
+
isVisible = true,
|
|
165
|
+
themeColor = "primary",
|
|
166
|
+
showDivider = false,
|
|
167
|
+
isElevated,
|
|
168
|
+
children,
|
|
169
|
+
style,
|
|
170
|
+
customAppearance
|
|
171
|
+
}) => {
|
|
172
|
+
const variantStyles = useToolbarVariantStyles(variant, position);
|
|
173
|
+
const colors = useToolbarColors(themeColor);
|
|
174
|
+
const translateValue = useSharedValue(
|
|
175
|
+
isVisible ? 0 : getInitialTranslate(position)
|
|
176
|
+
);
|
|
177
|
+
const opacityValue = useSharedValue(isVisible ? 1 : 0);
|
|
178
|
+
useEffect(() => {
|
|
179
|
+
if (isVisible) {
|
|
180
|
+
translateValue.value = withSpring(0, {
|
|
181
|
+
damping: 20,
|
|
182
|
+
stiffness: 300
|
|
183
|
+
});
|
|
184
|
+
opacityValue.value = withTiming(1, { duration: 200 });
|
|
185
|
+
} else {
|
|
186
|
+
translateValue.value = withSpring(getInitialTranslate(position), {
|
|
187
|
+
damping: 20,
|
|
188
|
+
stiffness: 300
|
|
189
|
+
});
|
|
190
|
+
opacityValue.value = withTiming(0, { duration: 200 });
|
|
191
|
+
}
|
|
192
|
+
}, [isVisible, position, translateValue, opacityValue]);
|
|
193
|
+
const animatedStyle = useAnimatedStyle(() => {
|
|
194
|
+
const transform = position === "left" || position === "right" ? [{ translateX: translateValue.value }] : [{ translateY: translateValue.value }];
|
|
195
|
+
return {
|
|
196
|
+
opacity: opacityValue.value,
|
|
197
|
+
transform
|
|
198
|
+
};
|
|
199
|
+
});
|
|
200
|
+
const isVertical = variantStyles.isVertical;
|
|
201
|
+
const shouldElevate = isElevated ?? variantStyles.isElevated;
|
|
202
|
+
const positionStyle = position === "top" ? styles.top : position === "bottom" ? styles.bottom : position === "left" ? styles.left : styles.right;
|
|
203
|
+
const floatingStyle = variant === "floating" ? [
|
|
204
|
+
styles.floating,
|
|
205
|
+
position === "bottom" && styles.floatingBottom,
|
|
206
|
+
position === "top" && styles.floatingTop
|
|
207
|
+
] : null;
|
|
208
|
+
return /* @__PURE__ */ React.createElement(
|
|
209
|
+
ToolbarContext.Provider,
|
|
210
|
+
{
|
|
211
|
+
value: {
|
|
212
|
+
actionColor: colors.action,
|
|
213
|
+
actionPressedColor: colors.pressed,
|
|
214
|
+
iconSize: variantStyles.iconSize,
|
|
215
|
+
actionButtonSize: variantStyles.actionSize
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
/* @__PURE__ */ React.createElement(
|
|
219
|
+
Animated.View,
|
|
220
|
+
{
|
|
221
|
+
style: [
|
|
222
|
+
styles.container,
|
|
223
|
+
positionStyle,
|
|
224
|
+
floatingStyle,
|
|
225
|
+
animatedStyle,
|
|
226
|
+
{
|
|
227
|
+
height: variantStyles.containerHeight,
|
|
228
|
+
width: variantStyles.containerWidth
|
|
229
|
+
},
|
|
230
|
+
style,
|
|
231
|
+
customAppearance?.container
|
|
232
|
+
]
|
|
233
|
+
},
|
|
234
|
+
/* @__PURE__ */ React.createElement(
|
|
235
|
+
View,
|
|
236
|
+
{
|
|
237
|
+
style: [
|
|
238
|
+
isVertical ? styles.contentVertical : styles.content,
|
|
239
|
+
{
|
|
240
|
+
backgroundColor: colors.background,
|
|
241
|
+
borderRadius: variantStyles.borderRadius,
|
|
242
|
+
paddingHorizontal: variantStyles.paddingHorizontal,
|
|
243
|
+
paddingVertical: variantStyles.paddingVertical,
|
|
244
|
+
borderBottomWidth: showDivider ? 1 : 0,
|
|
245
|
+
borderBottomColor: showDivider ? colors.divider : "transparent",
|
|
246
|
+
height: "100%",
|
|
247
|
+
width: "100%"
|
|
248
|
+
},
|
|
249
|
+
shouldElevate && [styles.elevated, { shadowColor: colors.shadow }],
|
|
250
|
+
customAppearance?.topRow
|
|
251
|
+
]
|
|
252
|
+
},
|
|
253
|
+
/* @__PURE__ */ React.createElement(
|
|
254
|
+
View,
|
|
255
|
+
{
|
|
256
|
+
style: [
|
|
257
|
+
isVertical ? styles.actionsVertical : styles.actions,
|
|
258
|
+
{ gap: variantStyles.gap },
|
|
259
|
+
customAppearance?.actionsContainer
|
|
260
|
+
]
|
|
261
|
+
},
|
|
262
|
+
children
|
|
263
|
+
)
|
|
264
|
+
)
|
|
265
|
+
)
|
|
266
|
+
);
|
|
267
|
+
};
|
|
268
|
+
function getInitialTranslate(position) {
|
|
269
|
+
switch (position) {
|
|
270
|
+
case "top":
|
|
271
|
+
return -100;
|
|
272
|
+
case "bottom":
|
|
273
|
+
return 100;
|
|
274
|
+
case "left":
|
|
275
|
+
return -100;
|
|
276
|
+
case "right":
|
|
277
|
+
return 100;
|
|
278
|
+
default:
|
|
279
|
+
return 0;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
// src/components/toolbar/toolbar-action.tsx
|
|
284
|
+
import React2 from "react";
|
|
285
|
+
import { Pressable } from "react-native";
|
|
286
|
+
var ToolbarAction = ({
|
|
287
|
+
icon,
|
|
288
|
+
isDisabled = false,
|
|
289
|
+
style,
|
|
290
|
+
onPress,
|
|
291
|
+
onLongPress,
|
|
292
|
+
accessibilityLabel,
|
|
293
|
+
testID
|
|
294
|
+
}) => {
|
|
295
|
+
const context = useToolbarContext();
|
|
296
|
+
const iconNode = typeof icon === "function" ? icon({
|
|
297
|
+
color: context?.actionColor ?? "#000000",
|
|
298
|
+
size: context?.iconSize ?? 26
|
|
299
|
+
}) : icon;
|
|
300
|
+
return /* @__PURE__ */ React2.createElement(
|
|
301
|
+
Pressable,
|
|
302
|
+
{
|
|
303
|
+
onPress: isDisabled ? void 0 : onPress,
|
|
304
|
+
onLongPress: isDisabled ? void 0 : onLongPress,
|
|
305
|
+
accessibilityRole: "button",
|
|
306
|
+
accessibilityLabel,
|
|
307
|
+
testID,
|
|
308
|
+
style: ({ pressed }) => [
|
|
309
|
+
styles.actionButton,
|
|
310
|
+
{
|
|
311
|
+
width: context?.actionButtonSize ?? 40,
|
|
312
|
+
height: context?.actionButtonSize ?? 40,
|
|
313
|
+
backgroundColor: pressed ? context?.actionPressedColor ?? "transparent" : "transparent"
|
|
314
|
+
},
|
|
315
|
+
isDisabled && styles.disabledAction,
|
|
316
|
+
style
|
|
317
|
+
]
|
|
318
|
+
},
|
|
319
|
+
iconNode
|
|
320
|
+
);
|
|
321
|
+
};
|
|
322
|
+
export {
|
|
323
|
+
Toolbar,
|
|
324
|
+
ToolbarAction
|
|
325
|
+
};
|
package/dist/typography/index.js
CHANGED
package/dist/view/index.cjs
CHANGED
|
@@ -352,7 +352,17 @@ var import_react_native9 = require("react-native");
|
|
|
352
352
|
// src/components/view/rounded-view/rounded-view.hook.ts
|
|
353
353
|
var import_react9 = require("react");
|
|
354
354
|
var useRoundedViewStyle = (props) => {
|
|
355
|
-
const {
|
|
355
|
+
const {
|
|
356
|
+
all = 0,
|
|
357
|
+
top,
|
|
358
|
+
bottom,
|
|
359
|
+
left,
|
|
360
|
+
right,
|
|
361
|
+
topLeft,
|
|
362
|
+
topRight,
|
|
363
|
+
bottomLeft,
|
|
364
|
+
bottomRight
|
|
365
|
+
} = props;
|
|
356
366
|
return (0, import_react9.useMemo)(() => {
|
|
357
367
|
return {
|
|
358
368
|
borderTopLeftRadius: topLeft ?? top ?? left ?? all,
|
|
@@ -412,7 +422,11 @@ var styles2 = import_react_native9.StyleSheet.create({
|
|
|
412
422
|
// src/components/view/aspect-ratio/aspect-ratio.tsx
|
|
413
423
|
var import_react11 = __toESM(require("react"), 1);
|
|
414
424
|
var import_react_native10 = require("react-native");
|
|
415
|
-
var AspectRatio = ({
|
|
425
|
+
var AspectRatio = ({
|
|
426
|
+
children,
|
|
427
|
+
ratio,
|
|
428
|
+
style
|
|
429
|
+
}) => {
|
|
416
430
|
return /* @__PURE__ */ import_react11.default.createElement(import_react_native10.View, { style: [{ aspectRatio: ratio }, style] }, children);
|
|
417
431
|
};
|
|
418
432
|
|
package/dist/view/index.js
CHANGED
|
@@ -300,7 +300,17 @@ import { View as View9, StyleSheet as StyleSheet2 } from "react-native";
|
|
|
300
300
|
// src/components/view/rounded-view/rounded-view.hook.ts
|
|
301
301
|
import { useMemo } from "react";
|
|
302
302
|
var useRoundedViewStyle = (props) => {
|
|
303
|
-
const {
|
|
303
|
+
const {
|
|
304
|
+
all = 0,
|
|
305
|
+
top,
|
|
306
|
+
bottom,
|
|
307
|
+
left,
|
|
308
|
+
right,
|
|
309
|
+
topLeft,
|
|
310
|
+
topRight,
|
|
311
|
+
bottomLeft,
|
|
312
|
+
bottomRight
|
|
313
|
+
} = props;
|
|
304
314
|
return useMemo(() => {
|
|
305
315
|
return {
|
|
306
316
|
borderTopLeftRadius: topLeft ?? top ?? left ?? all,
|
|
@@ -360,7 +370,11 @@ var styles2 = StyleSheet2.create({
|
|
|
360
370
|
// src/components/view/aspect-ratio/aspect-ratio.tsx
|
|
361
371
|
import React10 from "react";
|
|
362
372
|
import { View as View10 } from "react-native";
|
|
363
|
-
var AspectRatio = ({
|
|
373
|
+
var AspectRatio = ({
|
|
374
|
+
children,
|
|
375
|
+
ratio,
|
|
376
|
+
style
|
|
377
|
+
}) => {
|
|
364
378
|
return /* @__PURE__ */ React10.createElement(View10, { style: [{ aspectRatio: ratio }, style] }, children);
|
|
365
379
|
};
|
|
366
380
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xaui/native",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.24",
|
|
4
4
|
"description": "Flutter-inspired React Native UI components with native animations powered by React Native Reanimated",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"import": "./dist/checkbox/index.js",
|
|
38
38
|
"require": "./dist/checkbox/index.js"
|
|
39
39
|
},
|
|
40
|
-
"./
|
|
41
|
-
"types": "./dist/
|
|
42
|
-
"import": "./dist/
|
|
43
|
-
"require": "./dist/
|
|
40
|
+
"./expansion-panel": {
|
|
41
|
+
"types": "./dist/expansion-panel/index.d.ts",
|
|
42
|
+
"import": "./dist/expansion-panel/index.js",
|
|
43
|
+
"require": "./dist/expansion-panel/index.js"
|
|
44
44
|
},
|
|
45
45
|
"./progress": {
|
|
46
46
|
"types": "./dist/progress/index.d.ts",
|
|
@@ -57,6 +57,11 @@
|
|
|
57
57
|
"import": "./dist/switch/index.js",
|
|
58
58
|
"require": "./dist/switch/index.js"
|
|
59
59
|
},
|
|
60
|
+
"./slider": {
|
|
61
|
+
"types": "./dist/slider/index.d.ts",
|
|
62
|
+
"import": "./dist/slider/index.js",
|
|
63
|
+
"require": "./dist/slider/index.js"
|
|
64
|
+
},
|
|
60
65
|
"./select": {
|
|
61
66
|
"types": "./dist/select/index.d.ts",
|
|
62
67
|
"import": "./dist/select/index.js",
|
|
@@ -67,6 +72,11 @@
|
|
|
67
72
|
"import": "./dist/divider/index.js",
|
|
68
73
|
"require": "./dist/divider/index.js"
|
|
69
74
|
},
|
|
75
|
+
"./drawer": {
|
|
76
|
+
"types": "./dist/drawer/index.d.ts",
|
|
77
|
+
"import": "./dist/drawer/index.js",
|
|
78
|
+
"require": "./dist/drawer/index.js"
|
|
79
|
+
},
|
|
70
80
|
"./skeleton": {
|
|
71
81
|
"types": "./dist/skeleton/index.d.ts",
|
|
72
82
|
"import": "./dist/skeleton/index.js",
|
|
@@ -117,6 +127,16 @@
|
|
|
117
127
|
"import": "./dist/segment-button/index.js",
|
|
118
128
|
"require": "./dist/segment-button/index.js"
|
|
119
129
|
},
|
|
130
|
+
"./tabs": {
|
|
131
|
+
"types": "./dist/tabs/index.d.ts",
|
|
132
|
+
"import": "./dist/tabs/index.js",
|
|
133
|
+
"require": "./dist/tabs/index.js"
|
|
134
|
+
},
|
|
135
|
+
"./pager": {
|
|
136
|
+
"types": "./dist/pager/index.d.ts",
|
|
137
|
+
"import": "./dist/pager/index.js",
|
|
138
|
+
"require": "./dist/pager/index.js"
|
|
139
|
+
},
|
|
120
140
|
"./chip": {
|
|
121
141
|
"types": "./dist/chip/index.d.ts",
|
|
122
142
|
"import": "./dist/chip/index.js",
|
|
@@ -127,6 +147,11 @@
|
|
|
127
147
|
"import": "./dist/bottom-sheet/index.js",
|
|
128
148
|
"require": "./dist/bottom-sheet/index.js"
|
|
129
149
|
},
|
|
150
|
+
"./bottom-tab-bar": {
|
|
151
|
+
"types": "./dist/bottom-tab-bar/index.d.ts",
|
|
152
|
+
"import": "./dist/bottom-tab-bar/index.js",
|
|
153
|
+
"require": "./dist/bottom-tab-bar/index.js"
|
|
154
|
+
},
|
|
130
155
|
"./menu": {
|
|
131
156
|
"types": "./dist/menu/index.d.ts",
|
|
132
157
|
"import": "./dist/menu/index.js",
|
|
@@ -142,6 +167,11 @@
|
|
|
142
167
|
"import": "./dist/fab-menu/index.js",
|
|
143
168
|
"require": "./dist/fab-menu/index.js"
|
|
144
169
|
},
|
|
170
|
+
"./feature-discovery": {
|
|
171
|
+
"types": "./dist/feature-discovery/index.d.ts",
|
|
172
|
+
"import": "./dist/feature-discovery/index.js",
|
|
173
|
+
"require": "./dist/feature-discovery/index.js"
|
|
174
|
+
},
|
|
145
175
|
"./card": {
|
|
146
176
|
"types": "./dist/card/index.d.ts",
|
|
147
177
|
"import": "./dist/card/index.js",
|
|
@@ -156,6 +186,41 @@
|
|
|
156
186
|
"types": "./dist/list/index.d.ts",
|
|
157
187
|
"import": "./dist/list/index.js",
|
|
158
188
|
"require": "./dist/list/index.js"
|
|
189
|
+
},
|
|
190
|
+
"./radio": {
|
|
191
|
+
"types": "./dist/radio/index.d.ts",
|
|
192
|
+
"import": "./dist/radio/index.js",
|
|
193
|
+
"require": "./dist/radio/index.js"
|
|
194
|
+
},
|
|
195
|
+
"./toolbar": {
|
|
196
|
+
"types": "./dist/toolbar/index.d.ts",
|
|
197
|
+
"import": "./dist/toolbar/index.js",
|
|
198
|
+
"require": "./dist/toolbar/index.js"
|
|
199
|
+
},
|
|
200
|
+
"./app-bar": {
|
|
201
|
+
"types": "./dist/app-bar/index.d.ts",
|
|
202
|
+
"import": "./dist/app-bar/index.js",
|
|
203
|
+
"require": "./dist/app-bar/index.js"
|
|
204
|
+
},
|
|
205
|
+
"./timepicker": {
|
|
206
|
+
"types": "./dist/timepicker/index.d.ts",
|
|
207
|
+
"import": "./dist/timepicker/index.js",
|
|
208
|
+
"require": "./dist/timepicker/index.js"
|
|
209
|
+
},
|
|
210
|
+
"./stepper": {
|
|
211
|
+
"types": "./dist/stepper/index.d.ts",
|
|
212
|
+
"import": "./dist/stepper/index.js",
|
|
213
|
+
"require": "./dist/stepper/index.js"
|
|
214
|
+
},
|
|
215
|
+
"./menubox": {
|
|
216
|
+
"types": "./dist/menubox/index.d.ts",
|
|
217
|
+
"import": "./dist/menubox/index.js",
|
|
218
|
+
"require": "./dist/menubox/index.js"
|
|
219
|
+
},
|
|
220
|
+
"./chart": {
|
|
221
|
+
"types": "./dist/chart/index.d.ts",
|
|
222
|
+
"import": "./dist/chart/index.js",
|
|
223
|
+
"require": "./dist/chart/index.js"
|
|
159
224
|
}
|
|
160
225
|
},
|
|
161
226
|
"files": [
|
|
@@ -169,7 +234,7 @@
|
|
|
169
234
|
},
|
|
170
235
|
"dependencies": {
|
|
171
236
|
"@xaui/core": "0.1.7",
|
|
172
|
-
"@xaui/icons": "0.0.
|
|
237
|
+
"@xaui/icons": "0.0.4"
|
|
173
238
|
},
|
|
174
239
|
"peerDependencies": {
|
|
175
240
|
"react": "^18.0.0 || ^19.0.0",
|
|
@@ -193,8 +258,8 @@
|
|
|
193
258
|
"access": "public"
|
|
194
259
|
},
|
|
195
260
|
"scripts": {
|
|
196
|
-
"build": "tsup --config tsup.config.ts",
|
|
197
|
-
"dev": "tsup --config tsup.config.ts --watch",
|
|
261
|
+
"build": "rm -rf dist && NODE_OPTIONS=--max-old-space-size=4096 tsup --config tsup.config.ts",
|
|
262
|
+
"dev": "NODE_OPTIONS=--max-old-space-size=4096 tsup --config tsup.config.ts --watch",
|
|
198
263
|
"test": "vitest",
|
|
199
264
|
"lint": "eslint src/",
|
|
200
265
|
"type-check": "tsc --noEmit"
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { ViewStyle, TextStyle, GestureResponderEvent } from 'react-native';
|
|
3
|
-
import { T as ThemeColor, S as Size } from './index-BOw6tbkc.js';
|
|
4
|
-
|
|
5
|
-
type ButtonVariant = 'solid' | 'outlined' | 'flat' | 'light' | 'faded';
|
|
6
|
-
type ButtonRadius = 'none' | 'sm' | 'md' | 'lg' | 'full';
|
|
7
|
-
type SpinnerPlacement = 'start' | 'end';
|
|
8
|
-
type ElevationLevel = 0 | 1 | 2 | 3 | 4;
|
|
9
|
-
type ButtonCustomAppearance = {
|
|
10
|
-
/**
|
|
11
|
-
* Custom styles for the outer container
|
|
12
|
-
*/
|
|
13
|
-
container?: ViewStyle;
|
|
14
|
-
/**
|
|
15
|
-
* Custom styles for the button
|
|
16
|
-
*/
|
|
17
|
-
button?: ViewStyle;
|
|
18
|
-
/**
|
|
19
|
-
* Custom styles for the button text
|
|
20
|
-
*/
|
|
21
|
-
text?: TextStyle;
|
|
22
|
-
};
|
|
23
|
-
type ButtonProps = {
|
|
24
|
-
/**
|
|
25
|
-
* The content to display in the button.
|
|
26
|
-
*/
|
|
27
|
-
children: ReactNode;
|
|
28
|
-
/**
|
|
29
|
-
* The theme color of the button.
|
|
30
|
-
* @default 'default'
|
|
31
|
-
*/
|
|
32
|
-
themeColor?: ThemeColor;
|
|
33
|
-
/**
|
|
34
|
-
* The variant of the button.
|
|
35
|
-
* @default 'solid'
|
|
36
|
-
*/
|
|
37
|
-
variant?: ButtonVariant;
|
|
38
|
-
/**
|
|
39
|
-
* The size of the button.
|
|
40
|
-
* @default 'md'
|
|
41
|
-
*/
|
|
42
|
-
size?: Size;
|
|
43
|
-
/**
|
|
44
|
-
* The border radius of the button.
|
|
45
|
-
* @default 'md'
|
|
46
|
-
*/
|
|
47
|
-
radius?: ButtonRadius;
|
|
48
|
-
/**
|
|
49
|
-
* Content to display at the start of the button.
|
|
50
|
-
*/
|
|
51
|
-
startContent?: ReactNode;
|
|
52
|
-
/**
|
|
53
|
-
* Content to display at the end of the button.
|
|
54
|
-
*/
|
|
55
|
-
endContent?: ReactNode;
|
|
56
|
-
/**
|
|
57
|
-
* The placement of the spinner when isLoading is true.
|
|
58
|
-
* @default 'start'
|
|
59
|
-
*/
|
|
60
|
-
spinnerPlacement?: SpinnerPlacement;
|
|
61
|
-
/**
|
|
62
|
-
* Whether the button should take the full width of its container.
|
|
63
|
-
* @default false
|
|
64
|
-
*/
|
|
65
|
-
fullWidth?: boolean;
|
|
66
|
-
/**
|
|
67
|
-
* Whether the button is disabled.
|
|
68
|
-
* @default false
|
|
69
|
-
*/
|
|
70
|
-
isDisabled?: boolean;
|
|
71
|
-
/**
|
|
72
|
-
* Whether the button is in a loading state.
|
|
73
|
-
* @default false
|
|
74
|
-
*/
|
|
75
|
-
isLoading?: boolean;
|
|
76
|
-
/**
|
|
77
|
-
* Android elevation level from 0 to 4.
|
|
78
|
-
* Does not apply to `outlined` and `light` variants.
|
|
79
|
-
* @default 0
|
|
80
|
-
*/
|
|
81
|
-
elevation?: ElevationLevel;
|
|
82
|
-
/**
|
|
83
|
-
* Custom appearance styles for button parts
|
|
84
|
-
*/
|
|
85
|
-
customAppearance?: ButtonCustomAppearance;
|
|
86
|
-
/**
|
|
87
|
-
* Callback fired when the button is pressed.
|
|
88
|
-
*/
|
|
89
|
-
onPress?: (event: GestureResponderEvent) => void;
|
|
90
|
-
/**
|
|
91
|
-
* Callback fired when the button is long pressed.
|
|
92
|
-
*/
|
|
93
|
-
onLongPress?: (event: GestureResponderEvent) => void;
|
|
94
|
-
/**
|
|
95
|
-
* Callback fired when the button press starts.
|
|
96
|
-
*/
|
|
97
|
-
onPressIn?: (event: GestureResponderEvent) => void;
|
|
98
|
-
/**
|
|
99
|
-
* Callback fired when the button press ends.
|
|
100
|
-
*/
|
|
101
|
-
onPressOut?: (event: GestureResponderEvent) => void;
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
export type { ButtonRadius as B, ElevationLevel as E, SpinnerPlacement as S, ButtonProps as a, ButtonVariant as b };
|