@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.
Files changed (49) hide show
  1. package/dist/accordion/index.cjs +86 -68
  2. package/dist/accordion/index.js +2 -2
  3. package/dist/autocomplete/index.cjs +1503 -0
  4. package/dist/autocomplete/index.d.cts +70 -0
  5. package/dist/autocomplete/index.d.ts +70 -0
  6. package/dist/autocomplete/index.js +11 -0
  7. package/dist/button/index.cjs +87 -69
  8. package/dist/button/index.js +2 -2
  9. package/dist/checkbox/index.cjs +48 -30
  10. package/dist/checkbox/index.js +1 -1
  11. package/dist/{chunk-B2VGVZ3J.js → chunk-63LRW4QD.js} +1 -1
  12. package/dist/chunk-6HUSEZDJ.js +1138 -0
  13. package/dist/chunk-7LXW4BXD.js +606 -0
  14. package/dist/chunk-GBHQCAKW.js +19 -0
  15. package/dist/{chunk-R34CVLCX.js → chunk-GNJIET26.js} +1 -1
  16. package/dist/chunk-NBRASCX4.js +145 -0
  17. package/dist/chunk-ZYTBRHLJ.js +150 -0
  18. package/dist/core/index.cjs +68 -10
  19. package/dist/core/index.d.cts +9 -1
  20. package/dist/core/index.d.ts +9 -1
  21. package/dist/core/index.js +5 -1
  22. package/dist/divider/index.cjs +31 -13
  23. package/dist/divider/index.js +2 -2
  24. package/dist/icon/index.cjs +680 -0
  25. package/dist/icon/index.d.cts +36 -0
  26. package/dist/icon/index.d.ts +36 -0
  27. package/dist/icon/index.js +13 -0
  28. package/dist/index.cjs +1641 -53
  29. package/dist/index.d.cts +3 -0
  30. package/dist/index.d.ts +3 -0
  31. package/dist/index.js +16 -4
  32. package/dist/indicator/index.cjs +60 -42
  33. package/dist/indicator/index.js +2 -2
  34. package/dist/progress/index.cjs +45 -27
  35. package/dist/progress/index.js +1 -1
  36. package/dist/select/index.cjs +107 -89
  37. package/dist/select/index.js +10 -23
  38. package/dist/switch/index.cjs +58 -40
  39. package/dist/switch/index.js +1 -1
  40. package/dist/typography/index.cjs +223 -0
  41. package/dist/typography/index.d.cts +43 -0
  42. package/dist/typography/index.d.ts +43 -0
  43. package/dist/typography/index.js +7 -0
  44. package/dist/view/index.cjs +966 -0
  45. package/dist/view/index.d.cts +527 -0
  46. package/dist/view/index.d.ts +527 -0
  47. package/dist/view/index.js +923 -0
  48. package/package.json +21 -1
  49. 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.7",
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": [
@@ -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
- };