@xaui/native 0.9.1-alpha.2 → 0.9.1-alpha.20

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 (53) hide show
  1. package/dist/chunk-2WMVDMFV.cjs +62 -0
  2. package/dist/chunk-33QILJJH.cjs +143 -0
  3. package/dist/chunk-4EPS7UBO.js +496 -0
  4. package/dist/{chunk-M7P46XKI.cjs → chunk-57SJ4LJF.cjs} +33 -3
  5. package/dist/chunk-6ARON3XT.cjs +534 -0
  6. package/dist/{chunk-RBNCR5KB.js → chunk-A3EGFI6T.js} +31 -1
  7. package/dist/chunk-A4VD4MHK.cjs +757 -0
  8. package/dist/{chunk-NHPQQQ7P.cjs → chunk-BHTFIZTQ.cjs} +55 -88
  9. package/dist/chunk-EVXZGNPA.cjs +303 -0
  10. package/dist/chunk-EXX6ATAS.js +303 -0
  11. package/dist/chunk-GGW42MY4.js +20 -0
  12. package/dist/chunk-JXLRHKCQ.js +143 -0
  13. package/dist/chunk-MC7SY2QH.cjs +20 -0
  14. package/dist/{chunk-PBVPOX7D.js → chunk-MWXE7D4L.js} +29 -62
  15. package/dist/{chunk-RCP3SD26.js → chunk-N7C4UNUL.js} +2 -126
  16. package/dist/chunk-RMLFMRWL.js +102 -0
  17. package/dist/chunk-UBA6AEY6.cjs +102 -0
  18. package/dist/{chunk-B755PRVJ.cjs → chunk-UVO4GFSW.cjs} +3 -127
  19. package/dist/chunk-WXAME7KB.js +728 -0
  20. package/dist/chunk-XHZBXYVU.js +62 -0
  21. package/dist/components/button/index.cjs +15 -0
  22. package/dist/components/button/index.d.cts +658 -0
  23. package/dist/components/button/index.d.ts +658 -0
  24. package/dist/components/button/index.js +15 -0
  25. package/dist/components/typography/index.cjs +14 -0
  26. package/dist/components/typography/index.d.cts +116 -0
  27. package/dist/components/typography/index.d.ts +116 -0
  28. package/dist/components/typography/index.js +14 -0
  29. package/dist/components/view/index.cjs +16 -0
  30. package/dist/components/view/index.d.cts +152 -0
  31. package/dist/components/view/index.d.ts +152 -0
  32. package/dist/components/view/index.js +16 -0
  33. package/dist/create-recipe-C0XXjuow.d.cts +89 -0
  34. package/dist/create-recipe-CPXFo2rk.d.ts +89 -0
  35. package/dist/index.cjs +151 -5
  36. package/dist/index.d.cts +77 -4
  37. package/dist/index.d.ts +77 -4
  38. package/dist/index.js +155 -9
  39. package/dist/pressable-feedback.type-1K8YEOb8.d.cts +195 -0
  40. package/dist/pressable-feedback.type-BwkKLQlX.d.ts +195 -0
  41. package/dist/style-props.type-B1BG5TCm.d.cts +31 -0
  42. package/dist/style-props.type-B1BG5TCm.d.ts +31 -0
  43. package/dist/system/index.cjs +64 -3
  44. package/dist/system/index.d.cts +299 -75
  45. package/dist/system/index.d.ts +299 -75
  46. package/dist/system/index.js +66 -5
  47. package/dist/theme/index.cjs +4 -3
  48. package/dist/theme/index.d.cts +26 -14
  49. package/dist/theme/index.d.ts +26 -14
  50. package/dist/theme/index.js +7 -6
  51. package/dist/{theme.type-B3ODSLbB.d.cts → theme.type-C2gNHpEx.d.cts} +8 -2
  52. package/dist/{theme.type-B3ODSLbB.d.ts → theme.type-C2gNHpEx.d.ts} +8 -2
  53. package/package.json +64 -18
@@ -0,0 +1,62 @@
1
+ import {
2
+ useStyleProps
3
+ } from "./chunk-EXX6ATAS.js";
4
+
5
+ // src/system/portal/portal.tsx
6
+ import { useContext, useId, useLayoutEffect } from "react";
7
+
8
+ // src/system/portal/portal-context.ts
9
+ import { createContext } from "react";
10
+ var PortalContext = createContext(null);
11
+
12
+ // src/system/portal/portal.tsx
13
+ function Portal({ children }) {
14
+ const context = useContext(PortalContext);
15
+ const key = useId();
16
+ useLayoutEffect(() => {
17
+ context?.addPortal(key, children);
18
+ }, [children, context, key]);
19
+ useLayoutEffect(() => {
20
+ return () => context?.removePortal(key);
21
+ }, [context, key]);
22
+ return null;
23
+ }
24
+ Portal.displayName = "XAUI.Portal";
25
+
26
+ // src/system/portal/portal-host.tsx
27
+ import { Fragment, useCallback, useMemo, useState } from "react";
28
+ import { StyleSheet, View } from "react-native";
29
+ import { jsx, jsxs } from "react/jsx-runtime";
30
+ var styles = StyleSheet.create({
31
+ container: { flex: 1 }
32
+ });
33
+ function PortalHost({ children, ...props }) {
34
+ const [styleProps] = useStyleProps(props);
35
+ const [portals, setPortals] = useState(/* @__PURE__ */ new Map());
36
+ const addPortal = useCallback((key, element) => {
37
+ setPortals((current) => new Map(current).set(key, element));
38
+ }, []);
39
+ const removePortal = useCallback((key) => {
40
+ setPortals((current) => {
41
+ if (!current.has(key)) return current;
42
+ const next = new Map(current);
43
+ next.delete(key);
44
+ return next;
45
+ });
46
+ }, []);
47
+ const methods = useMemo(
48
+ () => ({ addPortal, removePortal }),
49
+ [addPortal, removePortal]
50
+ );
51
+ return /* @__PURE__ */ jsx(PortalContext.Provider, { value: methods, children: /* @__PURE__ */ jsxs(View, { style: [styles.container, styleProps], children: [
52
+ children,
53
+ Array.from(portals, ([key, element]) => /* @__PURE__ */ jsx(Fragment, { children: element }, key))
54
+ ] }) });
55
+ }
56
+ PortalHost.displayName = "XAUI.PortalHost";
57
+
58
+ export {
59
+ PortalContext,
60
+ Portal,
61
+ PortalHost
62
+ };
@@ -0,0 +1,15 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+ var _chunk6ARON3XTcjs = require('../../chunk-6ARON3XT.cjs');
6
+ require('../../chunk-A4VD4MHK.cjs');
7
+ require('../../chunk-UVO4GFSW.cjs');
8
+ require('../../chunk-EVXZGNPA.cjs');
9
+ require('../../chunk-57SJ4LJF.cjs');
10
+ require('../../chunk-MC7SY2QH.cjs');
11
+
12
+
13
+
14
+
15
+ exports.Button = _chunk6ARON3XTcjs.Button; exports.buttonRecipe = _chunk6ARON3XTcjs.buttonRecipe; exports.useButton = _chunk6ARON3XTcjs.useButton;