@xaui/native 0.9.1-alpha.11 → 0.9.1-alpha.13

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 (31) hide show
  1. package/dist/{chunk-7XGOXTGT.js → chunk-4O3PXFQ7.js} +15 -31
  2. package/dist/{chunk-3QBT3Q65.cjs → chunk-6N5JXRUZ.cjs} +26 -3
  3. package/dist/chunk-B3EAZ2CC.js +1010 -0
  4. package/dist/{chunk-2FEDC7U5.cjs → chunk-DDYMIWLW.cjs} +41 -57
  5. package/dist/chunk-IVVFYUDW.cjs +1044 -0
  6. package/dist/{chunk-6OHFG32Y.cjs → chunk-MLJ543GP.cjs} +41 -53
  7. package/dist/{chunk-NQ5WWF77.js → chunk-RWLODK55.js} +35 -47
  8. package/dist/{chunk-X2K2FX3W.js → chunk-XJARE6SC.js} +24 -1
  9. package/dist/components/button/index.cjs +4 -4
  10. package/dist/components/button/index.d.cts +162 -13
  11. package/dist/components/button/index.d.ts +162 -13
  12. package/dist/components/button/index.js +3 -3
  13. package/dist/{create-recipe-Dn9kj5Rs.d.ts → create-recipe-3OPwcC6P.d.ts} +81 -21
  14. package/dist/{create-recipe-BjSP0zL_.d.cts → create-recipe-oiLAlJ4u.d.cts} +81 -21
  15. package/dist/index.cjs +28 -8
  16. package/dist/index.d.cts +2 -2
  17. package/dist/index.d.ts +2 -2
  18. package/dist/index.js +32 -12
  19. package/dist/system/index.cjs +24 -4
  20. package/dist/system/index.d.cts +160 -35
  21. package/dist/system/index.d.ts +160 -35
  22. package/dist/system/index.js +31 -11
  23. package/dist/theme/index.cjs +3 -3
  24. package/dist/theme/index.d.cts +19 -8
  25. package/dist/theme/index.d.ts +19 -8
  26. package/dist/theme/index.js +2 -2
  27. package/package.json +1 -1
  28. package/dist/chunk-E2UGZJBT.cjs +0 -959
  29. package/dist/chunk-R4HJCQPI.js +0 -889
  30. /package/dist/{chunk-LMUPNKPH.cjs → chunk-2FOEFUPM.cjs} +0 -0
  31. /package/dist/{chunk-3TIDEII6.js → chunk-TO6DAGFB.js} +0 -0
@@ -1,36 +1,20 @@
1
1
  import {
2
2
  ThemeContext,
3
3
  alpha,
4
- mix
5
- } from "./chunk-X2K2FX3W.js";
4
+ mix,
5
+ stableHash
6
+ } from "./chunk-XJARE6SC.js";
6
7
 
7
8
  // src/provider/xaui-provider.tsx
8
9
  import { useColorScheme } from "react-native";
9
10
 
10
- // src/utils/stable-hash.ts
11
- function canonical(value) {
12
- if (value === null || typeof value !== "object") return JSON.stringify(value) ?? "null";
13
- if (Array.isArray(value)) return `[${value.map(canonical).join(",")}]`;
14
- const entries = Object.entries(value).filter(([, v]) => typeof v !== "function").sort(([a], [b]) => a < b ? -1 : 1).map(([k, v]) => `${JSON.stringify(k)}:${canonical(v)}`);
15
- return `{${entries.join(",")}}`;
16
- }
17
- function stableHash(value) {
18
- const input = canonical(value);
19
- let hash = 2166136261;
20
- for (let i = 0; i < input.length; i++) {
21
- hash ^= input.charCodeAt(i);
22
- hash = Math.imul(hash, 16777619) >>> 0;
23
- }
24
- return hash.toString(36);
25
- }
26
-
27
11
  // src/theme/derive-colors.ts
28
12
  function deriveColors(s) {
29
13
  return {
30
- accentPressed: mix(s.accent, s.accentForeground, 0.1),
31
- successPressed: mix(s.success, s.successForeground, 0.1),
32
- warningPressed: mix(s.warning, s.warningForeground, 0.1),
33
- dangerPressed: mix(s.danger, s.dangerForeground, 0.1),
14
+ accentPressed: mix(s.accent, s.foreground, 0.1),
15
+ successPressed: mix(s.success, s.foreground, 0.1),
16
+ warningPressed: mix(s.warning, s.foreground, 0.1),
17
+ dangerPressed: mix(s.danger, s.foreground, 0.1),
34
18
  defaultPressed: mix(s.default, s.defaultForeground, 0.04),
35
19
  surfacePressed: mix(s.surface, s.surfaceForeground, 0.08),
36
20
  defaultSoft: alpha(s.default, 0.5),
@@ -199,10 +183,10 @@ var tokens = {
199
183
  separator: "#d4d4d8",
200
184
  focus: "#9333ea",
201
185
  link: "#18181b",
202
- accentPressed: "#9c4eee",
203
- successPressed: "#378c50",
204
- warningPressed: "#bd642f",
205
- dangerPressed: "#e2473f",
186
+ accentPressed: "#8533d3",
187
+ successPressed: "#1b753a",
188
+ warningPressed: "#a34d13",
189
+ dangerPressed: "#c72927",
206
190
  defaultPressed: "#eaeaeb",
207
191
  surfacePressed: "#eaeaea",
208
192
  defaultSoft: "rgba(244, 244, 245, 0.5)",
@@ -269,10 +253,10 @@ var tokens = {
269
253
  separator: "#52525b",
270
254
  focus: "#c084fc",
271
255
  link: "#fafafa",
272
- accentPressed: "#ad78e3",
273
- successPressed: "#47c875",
274
- warningPressed: "#e1ac2b",
275
- dangerPressed: "#df6868",
256
+ accentPressed: "#c691fd",
257
+ successPressed: "#64e18d",
258
+ warningPressed: "#fbc54b",
259
+ dangerPressed: "#fa807e",
276
260
  defaultPressed: "#2e2e31",
277
261
  surfacePressed: "#27272a",
278
262
  defaultSoft: "rgba(39, 39, 42, 0.5)",
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/theme/theme-context.ts
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }// src/theme/theme-context.ts
2
2
  var _react = require('react');
3
3
  var ThemeContext = _react.createContext.call(void 0, null);
4
4
 
@@ -107,13 +107,36 @@ function deriveTint(tint, theme) {
107
107
  foreground,
108
108
  soft: alpha(tint, 0.15),
109
109
  softForeground: mix(tint, theme.colors.foreground, 0.2),
110
- pressed: mix(tint, foreground, 0.1),
110
+ // Towards the mode's ink, not the tint's own foreground — the same single direction
111
+ // the token layer takes (P2-API-REVIEW §E). A raw tint has to behave like `accent`
112
+ // under the finger as much as it does at rest.
113
+ pressed: mix(tint, theme.colors.foreground, 0.1),
111
114
  softPressed: alpha(tint, 0.2)
112
115
  };
113
116
  cache.set(key, derived);
114
117
  return derived;
115
118
  }
116
119
 
120
+ // src/utils/stable-hash.ts
121
+ function canonical(value) {
122
+ if (value === null || typeof value !== "object") return _nullishCoalesce(JSON.stringify(value), () => ( "null"));
123
+ if (Array.isArray(value)) return `[${value.map(canonical).join(",")}]`;
124
+ const entries = Object.entries(value).filter(([, v]) => typeof v !== "function").sort(([a], [b]) => a < b ? -1 : 1).map(([k, v]) => `${JSON.stringify(k)}:${canonical(v)}`);
125
+ return `{${entries.join(",")}}`;
126
+ }
127
+ function stableHash(value) {
128
+ const input = canonical(value);
129
+ let hash = 2166136261;
130
+ for (let i = 0; i < input.length; i++) {
131
+ hash ^= input.charCodeAt(i);
132
+ hash = Math.imul(hash, 16777619) >>> 0;
133
+ }
134
+ return hash.toString(36);
135
+ }
136
+
137
+
138
+
139
+
117
140
 
118
141
 
119
142
 
@@ -122,4 +145,4 @@ function deriveTint(tint, theme) {
122
145
 
123
146
 
124
147
 
125
- exports.ThemeContext = ThemeContext; exports.useXAUITheme = useXAUITheme; exports.useColorMode = useColorMode; exports.useThemeColor = useThemeColor; exports.mix = mix; exports.alpha = alpha; exports.deriveTint = deriveTint;
148
+ exports.ThemeContext = ThemeContext; exports.useXAUITheme = useXAUITheme; exports.useColorMode = useColorMode; exports.useThemeColor = useThemeColor; exports.stableHash = stableHash; exports.isHex = isHex; exports.mix = mix; exports.alpha = alpha; exports.contrastOn = contrastOn; exports.deriveTint = deriveTint;