@xaui/native 0.0.26 → 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 +7 -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/chunk-4KSZLONZ.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
// src/core/theme-hooks.ts
|
|
2
|
-
import { useContext as useContext2, useMemo as useMemo2 } from "react";
|
|
3
|
-
import { useColorScheme as useColorScheme2 } from "react-native";
|
|
4
|
-
|
|
5
|
-
// src/core/theme-context.tsx
|
|
6
|
-
import React3, { createContext as createContext2 } from "react";
|
|
7
|
-
import { useColorScheme } from "react-native";
|
|
8
|
-
import { defaultTheme } from "@xaui/core/theme";
|
|
9
|
-
import { colors } from "@xaui/core/palette";
|
|
10
|
-
|
|
11
|
-
// src/core/portal/portal.tsx
|
|
12
|
-
import { useContext, useEffect, useLayoutEffect, useRef } from "react";
|
|
13
|
-
|
|
14
|
-
// src/core/portal/portal-context.ts
|
|
15
|
-
import { createContext } from "react";
|
|
16
|
-
var PortalContext = createContext(null);
|
|
17
|
-
|
|
18
|
-
// src/core/portal/portal.tsx
|
|
19
|
-
var portalId = 0;
|
|
20
|
-
var Portal = ({ children }) => {
|
|
21
|
-
const context = useContext(PortalContext);
|
|
22
|
-
const keyRef = useRef(`portal-${++portalId}`);
|
|
23
|
-
useLayoutEffect(() => {
|
|
24
|
-
if (!context) return;
|
|
25
|
-
context.addPortal(keyRef.current, children);
|
|
26
|
-
}, [children, context]);
|
|
27
|
-
useEffect(() => {
|
|
28
|
-
if (!context) return;
|
|
29
|
-
const key = keyRef.current;
|
|
30
|
-
return () => {
|
|
31
|
-
context.removePortal(key);
|
|
32
|
-
};
|
|
33
|
-
}, [context]);
|
|
34
|
-
return null;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
// src/core/portal/portal-host.tsx
|
|
38
|
-
import React2, { useCallback, useMemo, useRef as useRef2, useState } from "react";
|
|
39
|
-
import { StyleSheet, View } from "react-native";
|
|
40
|
-
var hostStyles = StyleSheet.create({
|
|
41
|
-
container: {
|
|
42
|
-
flex: 1
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
// src/core/theme-context.tsx
|
|
47
|
-
var XUIThemeContext = createContext2(null);
|
|
48
|
-
|
|
49
|
-
// src/core/theme-hooks.ts
|
|
50
|
-
function useXUITheme() {
|
|
51
|
-
const theme = useContext2(XUIThemeContext);
|
|
52
|
-
if (!theme) {
|
|
53
|
-
throw new Error("useXUITheme must be used within XUIProvider");
|
|
54
|
-
}
|
|
55
|
-
return theme;
|
|
56
|
-
}
|
|
57
|
-
function useBorderRadiusStyles(radius) {
|
|
58
|
-
const theme = useXUITheme();
|
|
59
|
-
const borderRadius = useMemo2(() => {
|
|
60
|
-
const radiusMap = {
|
|
61
|
-
none: theme.borderRadius.none,
|
|
62
|
-
sm: theme.borderRadius.sm,
|
|
63
|
-
md: theme.borderRadius.md,
|
|
64
|
-
lg: theme.borderRadius.lg,
|
|
65
|
-
full: theme.borderRadius.full
|
|
66
|
-
};
|
|
67
|
-
return { borderRadius: radiusMap[radius] };
|
|
68
|
-
}, [radius, theme]);
|
|
69
|
-
return borderRadius;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// src/core/index.ts
|
|
73
|
-
import { defaultDarkTheme, defaultTheme as defaultTheme2 } from "@xaui/core/theme";
|
|
74
|
-
|
|
75
|
-
export {
|
|
76
|
-
Portal,
|
|
77
|
-
useXUITheme,
|
|
78
|
-
useBorderRadiusStyles
|
|
79
|
-
};
|
package/dist/chunk-I4V5Y5GD.js
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
// src/core/portal/portal.tsx
|
|
2
|
-
import { useContext, useEffect, useLayoutEffect, useRef } from "react";
|
|
3
|
-
|
|
4
|
-
// src/core/portal/portal-context.ts
|
|
5
|
-
import { createContext } from "react";
|
|
6
|
-
var PortalContext = createContext(null);
|
|
7
|
-
|
|
8
|
-
// src/core/portal/portal.tsx
|
|
9
|
-
var portalId = 0;
|
|
10
|
-
var Portal = ({ children }) => {
|
|
11
|
-
const context = useContext(PortalContext);
|
|
12
|
-
const keyRef = useRef(`portal-${++portalId}`);
|
|
13
|
-
useLayoutEffect(() => {
|
|
14
|
-
if (!context) return;
|
|
15
|
-
context.addPortal(keyRef.current, children);
|
|
16
|
-
}, [children, context]);
|
|
17
|
-
useEffect(() => {
|
|
18
|
-
if (!context) return;
|
|
19
|
-
const key = keyRef.current;
|
|
20
|
-
return () => {
|
|
21
|
-
context.removePortal(key);
|
|
22
|
-
};
|
|
23
|
-
}, [context]);
|
|
24
|
-
return null;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
// src/core/theme-hooks.ts
|
|
28
|
-
import { useContext as useContext2, useMemo as useMemo2 } from "react";
|
|
29
|
-
import { useColorScheme as useColorScheme2 } from "react-native";
|
|
30
|
-
|
|
31
|
-
// src/core/theme-context.tsx
|
|
32
|
-
import React3, { createContext as createContext2 } from "react";
|
|
33
|
-
import { useColorScheme } from "react-native";
|
|
34
|
-
import { defaultTheme } from "@xaui/core/theme";
|
|
35
|
-
import { colors } from "@xaui/core/palette";
|
|
36
|
-
|
|
37
|
-
// src/core/portal/portal-host.tsx
|
|
38
|
-
import React2, { useCallback, useMemo, useRef as useRef2, useState } from "react";
|
|
39
|
-
import { StyleSheet, View } from "react-native";
|
|
40
|
-
var hostStyles = StyleSheet.create({
|
|
41
|
-
container: {
|
|
42
|
-
flex: 1
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
// src/core/theme-context.tsx
|
|
47
|
-
var XUIThemeContext = createContext2(null);
|
|
48
|
-
|
|
49
|
-
// src/core/theme-hooks.ts
|
|
50
|
-
function useXUITheme() {
|
|
51
|
-
const theme = useContext2(XUIThemeContext);
|
|
52
|
-
if (!theme) {
|
|
53
|
-
throw new Error("useXUITheme must be used within XUIProvider");
|
|
54
|
-
}
|
|
55
|
-
return theme;
|
|
56
|
-
}
|
|
57
|
-
function useBorderRadiusStyles(radius) {
|
|
58
|
-
const theme = useXUITheme();
|
|
59
|
-
const borderRadius = useMemo2(() => {
|
|
60
|
-
const radiusMap = {
|
|
61
|
-
none: theme.borderRadius.none,
|
|
62
|
-
sm: theme.borderRadius.sm,
|
|
63
|
-
md: theme.borderRadius.md,
|
|
64
|
-
lg: theme.borderRadius.lg,
|
|
65
|
-
full: theme.borderRadius.full
|
|
66
|
-
};
|
|
67
|
-
return { borderRadius: radiusMap[radius] };
|
|
68
|
-
}, [radius, theme]);
|
|
69
|
-
return borderRadius;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export {
|
|
73
|
-
Portal,
|
|
74
|
-
useXUITheme,
|
|
75
|
-
useBorderRadiusStyles
|
|
76
|
-
};
|
package/dist/chunk-URBEEDFX.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
// src/core/portal/portal.tsx
|
|
2
|
-
import { useContext, useEffect, useLayoutEffect, useRef } from "react";
|
|
3
|
-
|
|
4
|
-
// src/core/portal/portal-context.ts
|
|
5
|
-
import { createContext } from "react";
|
|
6
|
-
var PortalContext = createContext(null);
|
|
7
|
-
|
|
8
|
-
// src/core/portal/portal.tsx
|
|
9
|
-
var portalId = 0;
|
|
10
|
-
var Portal = ({ children }) => {
|
|
11
|
-
const context = useContext(PortalContext);
|
|
12
|
-
const keyRef = useRef(`portal-${++portalId}`);
|
|
13
|
-
useLayoutEffect(() => {
|
|
14
|
-
if (!context) return;
|
|
15
|
-
context.addPortal(keyRef.current, children);
|
|
16
|
-
}, [children, context]);
|
|
17
|
-
useEffect(() => {
|
|
18
|
-
if (!context) return;
|
|
19
|
-
const key = keyRef.current;
|
|
20
|
-
return () => {
|
|
21
|
-
context.removePortal(key);
|
|
22
|
-
};
|
|
23
|
-
}, [context]);
|
|
24
|
-
return null;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
// src/core/theme-hooks.ts
|
|
28
|
-
import { useContext as useContext2, useMemo as useMemo2 } from "react";
|
|
29
|
-
import { useColorScheme as useColorScheme2 } from "react-native";
|
|
30
|
-
|
|
31
|
-
// src/core/theme-context.tsx
|
|
32
|
-
import React3, { createContext as createContext2 } from "react";
|
|
33
|
-
import { useColorScheme } from "react-native";
|
|
34
|
-
import { defaultTheme } from "@xaui/core/theme";
|
|
35
|
-
import { colors } from "@xaui/core/palette";
|
|
36
|
-
|
|
37
|
-
// src/core/portal/portal-host.tsx
|
|
38
|
-
import React2, { useCallback, useMemo, useRef as useRef2, useState } from "react";
|
|
39
|
-
import { StyleSheet, View } from "react-native";
|
|
40
|
-
var hostStyles = StyleSheet.create({
|
|
41
|
-
container: {
|
|
42
|
-
flex: 1
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
// src/core/theme-context.tsx
|
|
47
|
-
var XUIThemeContext = createContext2(null);
|
|
48
|
-
|
|
49
|
-
// src/core/theme-hooks.ts
|
|
50
|
-
function useXUITheme() {
|
|
51
|
-
const theme = useContext2(XUIThemeContext);
|
|
52
|
-
if (!theme) {
|
|
53
|
-
throw new Error("useXUITheme must be used within XUIProvider");
|
|
54
|
-
}
|
|
55
|
-
return theme;
|
|
56
|
-
}
|
|
57
|
-
function useBorderRadiusStyles(radius) {
|
|
58
|
-
const theme = useXUITheme();
|
|
59
|
-
const borderRadius = useMemo2(() => {
|
|
60
|
-
const radiusMap = {
|
|
61
|
-
none: theme.borderRadius.none,
|
|
62
|
-
sm: theme.borderRadius.sm,
|
|
63
|
-
md: theme.borderRadius.md,
|
|
64
|
-
lg: theme.borderRadius.lg,
|
|
65
|
-
full: theme.borderRadius.full
|
|
66
|
-
};
|
|
67
|
-
return { borderRadius: radiusMap[radius] };
|
|
68
|
-
}, [radius, theme]);
|
|
69
|
-
return borderRadius;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// src/core/index.ts
|
|
73
|
-
import { defaultDarkTheme, defaultTheme as defaultTheme2 } from "@xaui/core/theme";
|
|
74
|
-
|
|
75
|
-
export {
|
|
76
|
-
Portal,
|
|
77
|
-
useXUITheme,
|
|
78
|
-
useBorderRadiusStyles
|
|
79
|
-
};
|