@xaui/native 0.0.7 → 0.0.9
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/dist/accordion/index.cjs +86 -68
- package/dist/accordion/index.js +2 -2
- package/dist/autocomplete/index.cjs +1503 -0
- package/dist/autocomplete/index.d.cts +70 -0
- package/dist/autocomplete/index.d.ts +70 -0
- package/dist/autocomplete/index.js +11 -0
- package/dist/button/index.cjs +87 -69
- package/dist/button/index.js +2 -2
- package/dist/checkbox/index.cjs +48 -30
- package/dist/checkbox/index.js +1 -1
- package/dist/{chunk-B2VGVZ3J.js → chunk-63LRW4QD.js} +1 -1
- package/dist/chunk-6HUSEZDJ.js +1138 -0
- package/dist/chunk-7LXW4BXD.js +606 -0
- package/dist/chunk-GBHQCAKW.js +19 -0
- package/dist/{chunk-R34CVLCX.js → chunk-GNJIET26.js} +1 -1
- package/dist/chunk-NBRASCX4.js +145 -0
- package/dist/chunk-ZYTBRHLJ.js +150 -0
- package/dist/core/index.cjs +68 -10
- package/dist/core/index.d.cts +9 -1
- package/dist/core/index.d.ts +9 -1
- package/dist/core/index.js +5 -1
- package/dist/divider/index.cjs +31 -13
- package/dist/divider/index.js +2 -2
- package/dist/icon/index.cjs +680 -0
- package/dist/icon/index.d.cts +36 -0
- package/dist/icon/index.d.ts +36 -0
- package/dist/icon/index.js +13 -0
- package/dist/index.cjs +1641 -53
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +16 -4
- package/dist/indicator/index.cjs +60 -42
- package/dist/indicator/index.js +2 -2
- package/dist/progress/index.cjs +45 -27
- package/dist/progress/index.js +1 -1
- package/dist/select/index.cjs +107 -89
- package/dist/select/index.js +10 -23
- package/dist/switch/index.cjs +58 -40
- package/dist/switch/index.js +1 -1
- package/dist/typography/index.cjs +223 -0
- package/dist/typography/index.d.cts +43 -0
- package/dist/typography/index.d.ts +43 -0
- package/dist/typography/index.js +7 -0
- package/dist/view/index.cjs +966 -0
- package/dist/view/index.d.cts +527 -0
- package/dist/view/index.d.ts +527 -0
- package/dist/view/index.js +923 -0
- package/package.json +21 -1
- package/dist/chunk-ORMNMNOK.js +0 -89
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xaui/native",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"description": "Flutter-inspired React Native UI components with native animations powered by React Native Reanimated",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -66,6 +66,26 @@
|
|
|
66
66
|
"types": "./dist/divider/index.d.ts",
|
|
67
67
|
"import": "./dist/divider/index.js",
|
|
68
68
|
"require": "./dist/divider/index.js"
|
|
69
|
+
},
|
|
70
|
+
"./autocomplete": {
|
|
71
|
+
"types": "./dist/autocomplete/index.d.ts",
|
|
72
|
+
"import": "./dist/autocomplete/index.js",
|
|
73
|
+
"require": "./dist/autocomplete/index.js"
|
|
74
|
+
},
|
|
75
|
+
"./typography": {
|
|
76
|
+
"types": "./dist/typography/index.d.ts",
|
|
77
|
+
"import": "./dist/typography/index.js",
|
|
78
|
+
"require": "./dist/typography/index.js"
|
|
79
|
+
},
|
|
80
|
+
"./view": {
|
|
81
|
+
"types": "./dist/view/index.d.ts",
|
|
82
|
+
"import": "./dist/view/index.js",
|
|
83
|
+
"require": "./dist/view/index.js"
|
|
84
|
+
},
|
|
85
|
+
"./icon": {
|
|
86
|
+
"types": "./dist/icon/index.d.ts",
|
|
87
|
+
"import": "./dist/icon/index.js",
|
|
88
|
+
"require": "./dist/icon/index.js"
|
|
69
89
|
}
|
|
70
90
|
},
|
|
71
91
|
"files": [
|
package/dist/chunk-ORMNMNOK.js
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
// src/core/theme-context.tsx
|
|
2
|
-
import React, { createContext } from "react";
|
|
3
|
-
import { useColorScheme } from "react-native";
|
|
4
|
-
import { defaultTheme } from "@xaui/core/theme";
|
|
5
|
-
import { colors } from "@xaui/core/palette";
|
|
6
|
-
var XUIThemeContext = createContext(null);
|
|
7
|
-
function XUIProvider({
|
|
8
|
-
children,
|
|
9
|
-
theme: lightTheme,
|
|
10
|
-
darkTheme
|
|
11
|
-
}) {
|
|
12
|
-
const colorScheme = useColorScheme() ?? "light";
|
|
13
|
-
const theme = React.useMemo(() => {
|
|
14
|
-
if (!darkTheme && !lightTheme) return defaultTheme;
|
|
15
|
-
const activeTheme = colorScheme === "dark" && darkTheme ? darkTheme : lightTheme;
|
|
16
|
-
const mode = colorScheme === "dark" ? "dark" : "light";
|
|
17
|
-
if (!activeTheme) return defaultTheme;
|
|
18
|
-
return {
|
|
19
|
-
...defaultTheme,
|
|
20
|
-
...activeTheme,
|
|
21
|
-
mode,
|
|
22
|
-
colors: {
|
|
23
|
-
...defaultTheme.colors,
|
|
24
|
-
...activeTheme.colors
|
|
25
|
-
},
|
|
26
|
-
fontFamilies: {
|
|
27
|
-
...defaultTheme.fontFamilies,
|
|
28
|
-
...activeTheme.fontFamilies
|
|
29
|
-
},
|
|
30
|
-
fontSizes: {
|
|
31
|
-
...defaultTheme.fontSizes,
|
|
32
|
-
...activeTheme.fontSizes
|
|
33
|
-
},
|
|
34
|
-
palette: colors
|
|
35
|
-
};
|
|
36
|
-
}, [lightTheme, darkTheme, colorScheme]);
|
|
37
|
-
return /* @__PURE__ */ React.createElement(XUIThemeContext.Provider, { value: theme }, children);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// src/core/theme-hooks.ts
|
|
41
|
-
import { useContext, useMemo } from "react";
|
|
42
|
-
import { useColorScheme as useColorScheme2 } from "react-native";
|
|
43
|
-
function useColorMode() {
|
|
44
|
-
const nativeScheme = useColorScheme2();
|
|
45
|
-
return nativeScheme ?? "light";
|
|
46
|
-
}
|
|
47
|
-
function useXUITheme() {
|
|
48
|
-
const theme = useContext(XUIThemeContext);
|
|
49
|
-
if (!theme) {
|
|
50
|
-
throw new Error("useXUITheme must be used within XUIProvider");
|
|
51
|
-
}
|
|
52
|
-
return theme;
|
|
53
|
-
}
|
|
54
|
-
function useXUIColors() {
|
|
55
|
-
const theme = useXUITheme();
|
|
56
|
-
return theme.colors;
|
|
57
|
-
}
|
|
58
|
-
function useXUIPalette() {
|
|
59
|
-
const theme = useXUITheme();
|
|
60
|
-
return useMemo(() => theme.palette, [theme]);
|
|
61
|
-
}
|
|
62
|
-
function useBorderRadiusStyles(radius) {
|
|
63
|
-
const theme = useXUITheme();
|
|
64
|
-
const borderRadius = useMemo(() => {
|
|
65
|
-
const radiusMap = {
|
|
66
|
-
none: theme.borderRadius.none,
|
|
67
|
-
sm: theme.borderRadius.sm,
|
|
68
|
-
md: theme.borderRadius.md,
|
|
69
|
-
lg: theme.borderRadius.lg,
|
|
70
|
-
full: theme.borderRadius.full
|
|
71
|
-
};
|
|
72
|
-
return { borderRadius: radiusMap[radius] };
|
|
73
|
-
}, [radius, theme]);
|
|
74
|
-
return borderRadius;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// src/core/index.ts
|
|
78
|
-
import { defaultDarkTheme, defaultTheme as defaultTheme2 } from "@xaui/core/theme";
|
|
79
|
-
|
|
80
|
-
export {
|
|
81
|
-
XUIProvider,
|
|
82
|
-
useColorMode,
|
|
83
|
-
useXUITheme,
|
|
84
|
-
useXUIColors,
|
|
85
|
-
useXUIPalette,
|
|
86
|
-
useBorderRadiusStyles,
|
|
87
|
-
defaultDarkTheme,
|
|
88
|
-
defaultTheme2 as defaultTheme
|
|
89
|
-
};
|