@xaui/native 0.9.1-alpha.36 → 0.9.1-alpha.37

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 (141) hide show
  1. package/dist/{chunk-V5IVMZQJ.js → chunk-2PMXMKS5.js} +13 -8
  2. package/dist/{chunk-FVKIQBHS.cjs → chunk-3P6M2R4S.cjs} +6 -6
  3. package/dist/{chunk-RPOKLFRB.cjs → chunk-437QULXO.cjs} +7 -7
  4. package/dist/{chunk-BAPXLO5N.js → chunk-4PTWZCOK.js} +9 -9
  5. package/dist/{chunk-E5ZW7MBW.js → chunk-5PPNDKRX.js} +16 -16
  6. package/dist/{chunk-K7GAHNMJ.js → chunk-6G3XWPNP.js} +5 -5
  7. package/dist/{chunk-ISPOIMGX.cjs → chunk-7B3UBUC6.cjs} +3 -3
  8. package/dist/{chunk-5GMU7ESV.js → chunk-7LSY4WFL.js} +2 -2
  9. package/dist/{chunk-HQVVQGYV.cjs → chunk-ACAPTWE3.cjs} +16 -12
  10. package/dist/{chunk-2L7FOIWY.cjs → chunk-AP6RVIIK.cjs} +21 -21
  11. package/dist/{chunk-SAGMDVFU.js → chunk-BORJJYDW.js} +4 -4
  12. package/dist/{chunk-ADQVA2FQ.cjs → chunk-C5VDFRAD.cjs} +3 -3
  13. package/dist/{chunk-FYCDRRJ2.cjs → chunk-CUQTAPBU.cjs} +22 -22
  14. package/dist/{chunk-GPZSTEEI.cjs → chunk-DKH6BNPF.cjs} +15 -15
  15. package/dist/{chunk-2SCE7TFZ.cjs → chunk-DRMT346W.cjs} +64 -64
  16. package/dist/chunk-DVDQSW7U.cjs +1006 -0
  17. package/dist/{chunk-U3HFQHGZ.js → chunk-E3X5ODKQ.js} +3 -3
  18. package/dist/{chunk-RSGIJ6RI.js → chunk-EOJ5MYAQ.js} +5 -5
  19. package/dist/{chunk-MFXZHLOU.cjs → chunk-FTQHDJYL.cjs} +14 -14
  20. package/dist/{chunk-GHKJ6MUH.cjs → chunk-GTT4NHS2.cjs} +11 -11
  21. package/dist/{chunk-OWE5IID7.js → chunk-HXW4ANVB.js} +3 -3
  22. package/dist/{chunk-N2U63JUX.cjs → chunk-IGLKACSR.cjs} +7 -7
  23. package/dist/{chunk-VWATEE5O.js → chunk-IKJVLJKT.js} +15 -15
  24. package/dist/{chunk-AZRMOWRG.cjs → chunk-ITURCQMQ.cjs} +7 -7
  25. package/dist/{chunk-PGQWUASE.cjs → chunk-JB5LGQ54.cjs} +3 -3
  26. package/dist/{chunk-4XFEEBPU.js → chunk-JDSE4TQL.js} +1 -1
  27. package/dist/{chunk-6U5IUUAR.js → chunk-JXNFOOKC.js} +7 -7
  28. package/dist/{chunk-6N5ZCEAB.cjs → chunk-LEWW24RQ.cjs} +7 -7
  29. package/dist/{chunk-OSCW7I4H.js → chunk-M63GFNKV.js} +19 -4
  30. package/dist/chunk-MESKS6AI.js +0 -0
  31. package/dist/{chunk-CVCE7TW5.js → chunk-NKPTXTTS.js} +3 -3
  32. package/dist/{chunk-2LNE4PWB.cjs → chunk-NTD3NPRX.cjs} +3 -3
  33. package/dist/{chunk-2OZPOWFB.js → chunk-O3A3DBSZ.js} +3 -3
  34. package/dist/chunk-OJCCV65P.cjs +1 -0
  35. package/dist/{chunk-B6OKVLC7.js → chunk-OULTSBKU.js} +3 -3
  36. package/dist/{chunk-TE7KVFE4.cjs → chunk-P747CRAY.cjs} +9 -9
  37. package/dist/{chunk-DL2PGB5G.js → chunk-RGKWNK4T.js} +58 -58
  38. package/dist/{chunk-DOLWSO7A.js → chunk-RVRVGG73.js} +4 -4
  39. package/dist/{chunk-3YZSUDZ2.js → chunk-SMW6ZWMH.js} +3 -3
  40. package/dist/{chunk-AQXNEV6J.cjs → chunk-SNIHUKDA.cjs} +16 -16
  41. package/dist/{chunk-OMV5MUTM.js → chunk-SO5UAGIU.js} +15 -15
  42. package/dist/{chunk-KZVHC4FL.js → chunk-TDYPY2J7.js} +8 -8
  43. package/dist/{chunk-QZO57TPX.js → chunk-TJHYSSBZ.js} +3 -3
  44. package/dist/{chunk-K3AVOT6L.cjs → chunk-TK44VBIE.cjs} +22 -7
  45. package/dist/{chunk-ZU3XQZ63.cjs → chunk-UBOXW5WO.cjs} +63 -63
  46. package/dist/{chunk-UCW25LL6.js → chunk-UGF35NSE.js} +75 -75
  47. package/dist/{chunk-LCDHTLSG.cjs → chunk-VFTT3Q4B.cjs} +4 -4
  48. package/dist/{chunk-5BNIIDQD.cjs → chunk-WDDXU3OH.cjs} +14 -9
  49. package/dist/{chunk-JB5XANQY.js → chunk-WKCQ6VGW.js} +15 -11
  50. package/dist/{chunk-XARBUUIE.cjs → chunk-WVLSQO6K.cjs} +9 -9
  51. package/dist/chunk-XWY4DF37.js +1143 -0
  52. package/dist/{chunk-EFPWXJAJ.cjs → chunk-ZJWEVFAO.cjs} +12 -12
  53. package/dist/components/alert/index.cjs +7 -8
  54. package/dist/components/alert/index.d.cts +1 -1
  55. package/dist/components/alert/index.d.ts +1 -1
  56. package/dist/components/alert/index.js +6 -7
  57. package/dist/components/avatar/index.cjs +4 -5
  58. package/dist/components/avatar/index.d.cts +3 -3
  59. package/dist/components/avatar/index.d.ts +3 -3
  60. package/dist/components/avatar/index.js +3 -4
  61. package/dist/components/badge/index.cjs +3 -4
  62. package/dist/components/badge/index.d.cts +1 -1
  63. package/dist/components/badge/index.d.ts +1 -1
  64. package/dist/components/badge/index.js +2 -3
  65. package/dist/components/button/index.cjs +6 -7
  66. package/dist/components/button/index.d.cts +168 -168
  67. package/dist/components/button/index.d.ts +168 -168
  68. package/dist/components/button/index.js +5 -6
  69. package/dist/components/card/index.cjs +5 -6
  70. package/dist/components/card/index.d.cts +169 -169
  71. package/dist/components/card/index.d.ts +169 -169
  72. package/dist/components/card/index.js +4 -5
  73. package/dist/components/checkbox/index.cjs +5 -6
  74. package/dist/components/checkbox/index.d.cts +336 -336
  75. package/dist/components/checkbox/index.d.ts +336 -336
  76. package/dist/components/checkbox/index.js +4 -5
  77. package/dist/components/chip/index.cjs +7 -8
  78. package/dist/components/chip/index.d.cts +169 -169
  79. package/dist/components/chip/index.d.ts +169 -169
  80. package/dist/components/chip/index.js +6 -7
  81. package/dist/components/divider/index.cjs +3 -4
  82. package/dist/components/divider/index.d.cts +1 -1
  83. package/dist/components/divider/index.d.ts +1 -1
  84. package/dist/components/divider/index.js +2 -3
  85. package/dist/components/field-group/index.cjs +5 -6
  86. package/dist/components/field-group/index.d.cts +6 -6
  87. package/dist/components/field-group/index.d.ts +6 -6
  88. package/dist/components/field-group/index.js +4 -5
  89. package/dist/components/input-otp/index.cjs +3 -4
  90. package/dist/components/input-otp/index.d.cts +1 -1
  91. package/dist/components/input-otp/index.d.ts +1 -1
  92. package/dist/components/input-otp/index.js +2 -3
  93. package/dist/components/radio/index.cjs +5 -6
  94. package/dist/components/radio/index.d.cts +336 -336
  95. package/dist/components/radio/index.d.ts +336 -336
  96. package/dist/components/radio/index.js +4 -5
  97. package/dist/components/select/index.cjs +47 -0
  98. package/dist/components/select/index.d.cts +519 -0
  99. package/dist/components/select/index.d.ts +519 -0
  100. package/dist/components/select/index.js +47 -0
  101. package/dist/components/skeleton/index.cjs +3 -4
  102. package/dist/components/skeleton/index.d.cts +1 -1
  103. package/dist/components/skeleton/index.d.ts +1 -1
  104. package/dist/components/skeleton/index.js +2 -3
  105. package/dist/components/spinner/index.cjs +4 -5
  106. package/dist/components/spinner/index.d.cts +1 -1
  107. package/dist/components/spinner/index.d.ts +1 -1
  108. package/dist/components/spinner/index.js +3 -4
  109. package/dist/components/switch/index.cjs +5 -6
  110. package/dist/components/switch/index.d.cts +338 -338
  111. package/dist/components/switch/index.d.ts +338 -338
  112. package/dist/components/switch/index.js +4 -5
  113. package/dist/components/text-area/index.cjs +4 -5
  114. package/dist/components/text-area/index.js +3 -4
  115. package/dist/components/text-field/index.cjs +3 -4
  116. package/dist/components/text-field/index.d.cts +3 -3
  117. package/dist/components/text-field/index.d.ts +3 -3
  118. package/dist/components/text-field/index.js +2 -3
  119. package/dist/components/typography/index.cjs +3 -4
  120. package/dist/components/typography/index.d.cts +2 -2
  121. package/dist/components/typography/index.d.ts +2 -2
  122. package/dist/components/typography/index.js +2 -3
  123. package/dist/components/view/index.cjs +3 -4
  124. package/dist/components/view/index.d.cts +6 -6
  125. package/dist/components/view/index.d.ts +6 -6
  126. package/dist/components/view/index.js +2 -3
  127. package/dist/index.cjs +64 -28
  128. package/dist/index.d.cts +1 -0
  129. package/dist/index.d.ts +1 -0
  130. package/dist/index.js +80 -44
  131. package/dist/system/index.cjs +10 -10
  132. package/dist/system/index.d.cts +15 -2
  133. package/dist/system/index.d.ts +15 -2
  134. package/dist/system/index.js +8 -8
  135. package/dist/theme/index.cjs +4 -3
  136. package/dist/theme/index.d.cts +21 -1
  137. package/dist/theme/index.d.ts +21 -1
  138. package/dist/theme/index.js +3 -2
  139. package/package.json +11 -1
  140. package/dist/chunk-FJ5TLRT3.js +0 -21
  141. package/dist/chunk-HT7H35GU.cjs +0 -21
@@ -1,15 +1,13 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkK3AVOT6Lcjs = require('./chunk-K3AVOT6L.cjs');
4
-
5
- // src/system/portal/portal.tsx
6
- var _react = require('react');
3
+ var _chunkTK44VBIEcjs = require('./chunk-TK44VBIE.cjs');
7
4
 
8
5
  // src/system/portal/portal-context.ts
9
-
6
+ var _react = require('react');
10
7
  var PortalContext = _react.createContext.call(void 0, null);
11
8
 
12
9
  // src/system/portal/portal.tsx
10
+
13
11
  function Portal({ children }) {
14
12
  const context = _react.useContext.call(void 0, PortalContext);
15
13
  const key = _react.useId.call(void 0, );
@@ -31,8 +29,15 @@ var styles = _reactnative.StyleSheet.create({
31
29
  container: { flex: 1 }
32
30
  });
33
31
  function PortalHost({ children, ...props }) {
34
- const [styleProps] = _chunkK3AVOT6Lcjs.useStyleProps.call(void 0, props);
32
+ const [styleProps] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
35
33
  const [portals, setPortals] = _react.useState.call(void 0, /* @__PURE__ */ new Map());
34
+ const [origin, setOrigin] = _react.useState.call(void 0, { x: 0, y: 0 });
35
+ const node = _react.useRef.call(void 0, null);
36
+ const measure = _react.useCallback.call(void 0, (_event) => {
37
+ _optionalChain([node, 'access', _5 => _5.current, 'optionalAccess', _6 => _6.measureInWindow, 'call', _7 => _7((x, y) => {
38
+ setOrigin((current) => current.x === x && current.y === y ? current : { x, y });
39
+ })]);
40
+ }, []);
36
41
  const addPortal = _react.useCallback.call(void 0, (key, element) => {
37
42
  setPortals((current) => new Map(current).set(key, element));
38
43
  }, []);
@@ -45,10 +50,10 @@ function PortalHost({ children, ...props }) {
45
50
  });
46
51
  }, []);
47
52
  const methods = _react.useMemo.call(void 0,
48
- () => ({ addPortal, removePortal }),
49
- [addPortal, removePortal]
53
+ () => ({ addPortal, removePortal, origin }),
54
+ [addPortal, removePortal, origin]
50
55
  );
51
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PortalContext.Provider, { value: methods, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [styles.container, styleProps], children: [
56
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PortalContext.Provider, { value: methods, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { ref: node, onLayout: measure, style: [styles.container, styleProps], children: [
52
57
  children,
53
58
  Array.from(portals, ([key, element]) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.Fragment, { children: element }, key))
54
59
  ] }) });
@@ -1,3 +1,6 @@
1
+ import {
2
+ PortalHost
3
+ } from "./chunk-2PMXMKS5.js";
1
4
  import {
2
5
  ThemeContext,
3
6
  alpha,
@@ -5,7 +8,7 @@ import {
5
8
  } from "./chunk-A3EGFI6T.js";
6
9
  import {
7
10
  stableHash
8
- } from "./chunk-FJ5TLRT3.js";
11
+ } from "./chunk-M63GFNKV.js";
9
12
 
10
13
  // src/provider/xaui-provider.tsx
11
14
  import { useColorScheme } from "react-native";
@@ -130,10 +133,10 @@ function buildShadows(mode) {
130
133
  surface: noShadow,
131
134
  overlay: {
132
135
  shadowColor: "#000000",
133
- shadowOffset: { width: 0, height: 8 },
134
- shadowOpacity: 0.6,
135
- shadowRadius: 24,
136
- elevation: 16
136
+ shadowOffset: { width: 0, height: 4 },
137
+ shadowOpacity: 0.45,
138
+ shadowRadius: 16,
139
+ elevation: 8
137
140
  },
138
141
  field: noShadow
139
142
  };
@@ -148,10 +151,10 @@ function buildShadows(mode) {
148
151
  },
149
152
  overlay: {
150
153
  shadowColor: "#000000",
151
- shadowOffset: { width: 0, height: 8 },
152
- shadowOpacity: 0.14,
153
- shadowRadius: 24,
154
- elevation: 16
154
+ shadowOffset: { width: 0, height: 4 },
155
+ shadowOpacity: 0.1,
156
+ shadowRadius: 16,
157
+ elevation: 8
155
158
  },
156
159
  field: {
157
160
  shadowColor: "#000000",
@@ -390,11 +393,12 @@ import { jsx } from "react/jsx-runtime";
390
393
  function XAUIProvider({
391
394
  children,
392
395
  theme = defaultTheme,
393
- colorMode = "system"
396
+ colorMode = "system",
397
+ hasPortalHost = true
394
398
  }) {
395
399
  const scheme = useColorScheme();
396
400
  const resolved = colorMode === "system" ? scheme === "dark" ? "dark" : "light" : colorMode;
397
- return /* @__PURE__ */ jsx(ThemeContext.Provider, { value: theme[resolved], children });
401
+ return /* @__PURE__ */ jsx(ThemeContext.Provider, { value: theme[resolved], children: hasPortalHost ? /* @__PURE__ */ jsx(PortalHost, { children }) : children });
398
402
  }
399
403
 
400
404
  // src/theme/palette.ts
@@ -1,17 +1,17 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
3
 
4
- var _chunk6N5ZCEABcjs = require('./chunk-6N5ZCEAB.cjs');
4
+ var _chunkLEWW24RQcjs = require('./chunk-LEWW24RQ.cjs');
5
5
 
6
6
 
7
- var _chunkISPOIMGXcjs = require('./chunk-ISPOIMGX.cjs');
7
+ var _chunk7B3UBUC6cjs = require('./chunk-7B3UBUC6.cjs');
8
8
 
9
9
 
10
10
 
11
11
  var _chunk54FJOKANcjs = require('./chunk-54FJOKAN.cjs');
12
12
 
13
13
 
14
- var _chunkK3AVOT6Lcjs = require('./chunk-K3AVOT6L.cjs');
14
+ var _chunkTK44VBIEcjs = require('./chunk-TK44VBIE.cjs');
15
15
 
16
16
  // src/components/field-group/field-group-field.tsx
17
17
  var _react = require('react');
@@ -36,7 +36,7 @@ var FieldGroupField = _react.forwardRef.call(void 0,
36
36
  () => decoratorPadding(prefixWidth, suffixWidth),
37
37
  [prefixWidth, suffixWidth]
38
38
  );
39
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6N5ZCEABcjs.TextFieldField, { ref, ...props, style: [padding, style] });
39
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLEWW24RQcjs.TextFieldField, { ref, ...props, style: [padding, style] });
40
40
  }
41
41
  );
42
42
  FieldGroupField.displayName = "XAUI.FieldGroup.Field";
@@ -44,8 +44,8 @@ FieldGroupField.displayName = "XAUI.FieldGroup.Field";
44
44
  // src/components/field-group/field-group-icon.tsx
45
45
 
46
46
  function FieldGroupIcon({ size, color, ...rest }) {
47
- const { icon } = _chunk6N5ZCEABcjs.useTextField.call(void 0, );
48
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkISPOIMGXcjs.Icon, { size: _nullishCoalesce(size, () => ( icon.size)), color: _nullishCoalesce(color, () => ( icon.color)), ...rest });
47
+ const { icon } = _chunkLEWW24RQcjs.useTextField.call(void 0, );
48
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7B3UBUC6cjs.Icon, { size: _nullishCoalesce(size, () => ( icon.size)), color: _nullishCoalesce(color, () => ( icon.color)), ...rest });
49
49
  }
50
50
  FieldGroupIcon.displayName = "XAUI.FieldGroup.Icon";
51
51
 
@@ -58,9 +58,9 @@ var _reactnative = require('react-native');
58
58
 
59
59
  var FieldGroupDecorator = _react.forwardRef.call(void 0,
60
60
  function FieldGroupDecorator2({ side, children, isDecorative = false, onLayout, style, ...props }, ref) {
61
- const { prefixStyle, suffixStyle, isDisabled } = _chunk6N5ZCEABcjs.useTextField.call(void 0, );
61
+ const { prefixStyle, suffixStyle, isDisabled } = _chunkLEWW24RQcjs.useTextField.call(void 0, );
62
62
  const { setPrefixWidth, setSuffixWidth } = useFieldGroup();
63
- const [styleProps, rest] = _chunkK3AVOT6Lcjs.useStyleProps.call(void 0, props);
63
+ const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
64
64
  const report = side === "prefix" ? setPrefixWidth : setSuffixWidth;
65
65
  const handleLayout = _react.useCallback.call(void 0,
66
66
  (event) => {
@@ -111,7 +111,7 @@ FieldGroupSuffix.displayName = "XAUI.FieldGroup.Suffix";
111
111
 
112
112
 
113
113
  var FieldGroupRoot = _react.forwardRef.call(void 0, function FieldGroup({ children, asChild = false, style, ...props }, ref) {
114
- const [styleProps, rest] = _chunkK3AVOT6Lcjs.useStyleProps.call(void 0, props);
114
+ const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
115
115
  const [prefixWidth, setPrefixWidth] = _react.useState.call(void 0, 0);
116
116
  const [suffixWidth, setSuffixWidth] = _react.useState.call(void 0, 0);
117
117
  const context = _react.useMemo.call(void 0,