@xaui/native 0.9.1-alpha.2 → 0.9.1-alpha.21
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/dist/chunk-2WMVDMFV.cjs +62 -0
- package/dist/chunk-33QILJJH.cjs +143 -0
- package/dist/chunk-4NE3SLTM.cjs +695 -0
- package/dist/{chunk-M7P46XKI.cjs → chunk-57SJ4LJF.cjs} +33 -3
- package/dist/chunk-5LC6KVL3.cjs +68 -0
- package/dist/{chunk-RBNCR5KB.js → chunk-A3EGFI6T.js} +31 -1
- package/dist/chunk-APCBIHLR.cjs +507 -0
- package/dist/chunk-BPBY7ON7.cjs +451 -0
- package/dist/chunk-EVXZGNPA.cjs +303 -0
- package/dist/chunk-EXX6ATAS.js +303 -0
- package/dist/chunk-GGW42MY4.js +20 -0
- package/dist/chunk-IBRVMLUF.js +668 -0
- package/dist/chunk-ISVUXVFL.js +471 -0
- package/dist/chunk-JL27KVRT.js +68 -0
- package/dist/chunk-JXLRHKCQ.js +143 -0
- package/dist/chunk-MC7SY2QH.cjs +20 -0
- package/dist/{chunk-RCP3SD26.js → chunk-N7C4UNUL.js} +2 -126
- package/dist/chunk-RMLFMRWL.js +102 -0
- package/dist/chunk-RRRGLRRP.cjs +28 -0
- package/dist/chunk-SGHP76GU.js +28 -0
- package/dist/{chunk-PBVPOX7D.js → chunk-TUJBDS5M.js} +30 -63
- package/dist/chunk-UBA6AEY6.cjs +102 -0
- package/dist/{chunk-NHPQQQ7P.cjs → chunk-UL263KGM.cjs} +56 -89
- package/dist/{chunk-B755PRVJ.cjs → chunk-UVO4GFSW.cjs} +3 -127
- package/dist/chunk-XHZBXYVU.js +62 -0
- package/dist/chunk-YRCUALUQ.js +451 -0
- package/dist/components/button/index.cjs +17 -0
- package/dist/components/button/index.d.cts +659 -0
- package/dist/components/button/index.d.ts +659 -0
- package/dist/components/button/index.js +17 -0
- package/dist/components/card/index.cjs +20 -0
- package/dist/components/card/index.d.cts +620 -0
- package/dist/components/card/index.d.ts +620 -0
- package/dist/components/card/index.js +20 -0
- package/dist/components/typography/index.cjs +14 -0
- package/dist/components/typography/index.d.cts +116 -0
- package/dist/components/typography/index.d.ts +116 -0
- package/dist/components/typography/index.js +14 -0
- package/dist/components/view/index.cjs +16 -0
- package/dist/components/view/index.d.cts +152 -0
- package/dist/components/view/index.d.ts +152 -0
- package/dist/components/view/index.js +16 -0
- package/dist/create-recipe-CC3NNCqF.d.ts +94 -0
- package/dist/create-recipe-CPBFg7ym.d.cts +94 -0
- package/dist/icon.type-BkcEPJbK.d.ts +73 -0
- package/dist/icon.type-Cs1tMX0W.d.cts +73 -0
- package/dist/index.cjs +167 -5
- package/dist/index.d.cts +79 -4
- package/dist/index.d.ts +79 -4
- package/dist/index.js +171 -9
- package/dist/pressable-feedback.type-DsvWZXWC.d.ts +127 -0
- package/dist/pressable-feedback.type-wfeiJz5m.d.cts +127 -0
- package/dist/style-props.type-B1BG5TCm.d.cts +31 -0
- package/dist/style-props.type-B1BG5TCm.d.ts +31 -0
- package/dist/system/index.cjs +66 -3
- package/dist/system/index.d.cts +301 -75
- package/dist/system/index.d.ts +301 -75
- package/dist/system/index.js +68 -5
- package/dist/theme/index.cjs +4 -3
- package/dist/theme/index.d.cts +27 -15
- package/dist/theme/index.d.ts +27 -15
- package/dist/theme/index.js +7 -6
- package/dist/{theme.type-B3ODSLbB.d.cts → theme.type-C2gNHpEx.d.cts} +8 -2
- package/dist/{theme.type-B3ODSLbB.d.ts → theme.type-C2gNHpEx.d.ts} +8 -2
- package/package.json +74 -18
package/dist/theme/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { i as XAUIThemeSet, h as XAUIThemeConfig,
|
|
4
|
-
export { F as FontSizeKey,
|
|
3
|
+
import { i as XAUIThemeSet, h as XAUIThemeConfig, g as XAUISourceColors, c as XAUIDerivedColors, X as XAUITheme, e as XAUIRadius, C as ColorMode, a as XAUIColors } from '../theme.type-C2gNHpEx.js';
|
|
4
|
+
export { F as FontSizeKey, b as FontWeightKey, R as RadiusKey, S as Size, d as XAUIPrimitiveColors, f as XAUIShadow } from '../theme.type-C2gNHpEx.js';
|
|
5
|
+
import 'react-native';
|
|
5
6
|
|
|
6
7
|
/** `'system'` follows the device; the resolved value is never `'system'`. */
|
|
7
8
|
type ColorModePreference = 'light' | 'dark' | 'system';
|
|
@@ -43,6 +44,17 @@ declare const defaultTheme: XAUIThemeSet;
|
|
|
43
44
|
* These are HeroUI's `color-mix(in oklab, …)` formulas transposed to JS, because React
|
|
44
45
|
* Native has no `color-mix()`. Their `-hover` names became `-pressed`: what they feed is
|
|
45
46
|
* the press overlay, and the web name was a leftover.
|
|
47
|
+
*
|
|
48
|
+
* **One deliberate divergence: a pressed state always moves towards the mode's ink**
|
|
49
|
+
* (P2-API-REVIEW §E). Mixing towards the variant's own foreground — which is what their
|
|
50
|
+
* formula does — makes the direction follow the fill's lightness rather than a decision:
|
|
51
|
+
* `#9333ea` has near-white text and lightened under the finger in light mode, while
|
|
52
|
+
* `#c084fc` has dark text and darkened in dark mode. Same component, opposite gesture,
|
|
53
|
+
* nobody's choice. Towards `foreground` it is one direction — darker in light, lighter in
|
|
54
|
+
* dark — and the label's contrast rises in both instead of falling in one.
|
|
55
|
+
*
|
|
56
|
+
* The neutral fills already did this: `defaultForeground` and `surfaceForeground` *are*
|
|
57
|
+
* the ink, so only the four saturated intents ever flipped.
|
|
46
58
|
*/
|
|
47
59
|
declare function deriveColors(s: XAUISourceColors): XAUIDerivedColors;
|
|
48
60
|
|
|
@@ -388,7 +400,7 @@ declare const tokens: {
|
|
|
388
400
|
readonly foreground: "#18181b";
|
|
389
401
|
readonly surface: "#ffffff";
|
|
390
402
|
readonly surfaceForeground: "#18181b";
|
|
391
|
-
readonly surfaceSecondary: "#
|
|
403
|
+
readonly surfaceSecondary: "#ececee";
|
|
392
404
|
readonly surfaceSecondaryForeground: "#18181b";
|
|
393
405
|
readonly surfaceTertiary: "#e4e4e7";
|
|
394
406
|
readonly surfaceTertiaryForeground: "#18181b";
|
|
@@ -396,7 +408,7 @@ declare const tokens: {
|
|
|
396
408
|
readonly overlayForeground: "#18181b";
|
|
397
409
|
readonly backdrop: "rgba(0, 0, 0, 0.2)";
|
|
398
410
|
readonly muted: "#71717a";
|
|
399
|
-
readonly default: "#
|
|
411
|
+
readonly default: "#e4e4e7";
|
|
400
412
|
readonly defaultForeground: "#18181b";
|
|
401
413
|
readonly accent: "#9333ea";
|
|
402
414
|
readonly accentForeground: "#faf5ff";
|
|
@@ -416,15 +428,15 @@ declare const tokens: {
|
|
|
416
428
|
readonly separator: "#d4d4d8";
|
|
417
429
|
readonly focus: "#9333ea";
|
|
418
430
|
readonly link: "#18181b";
|
|
419
|
-
readonly accentPressed: "#
|
|
420
|
-
readonly successPressed: "#
|
|
421
|
-
readonly warningPressed: "#
|
|
422
|
-
readonly dangerPressed: "#
|
|
423
|
-
readonly defaultPressed: "#
|
|
431
|
+
readonly accentPressed: "#8533d3";
|
|
432
|
+
readonly successPressed: "#1b753a";
|
|
433
|
+
readonly warningPressed: "#a34d13";
|
|
434
|
+
readonly dangerPressed: "#c72927";
|
|
435
|
+
readonly defaultPressed: "#dbdbde";
|
|
424
436
|
readonly surfacePressed: "#eaeaea";
|
|
425
|
-
readonly defaultSoft: "rgba(
|
|
437
|
+
readonly defaultSoft: "rgba(228, 228, 231, 0.5)";
|
|
426
438
|
readonly defaultSoftForeground: "#18181b";
|
|
427
|
-
readonly defaultSoftPressed: "rgba(
|
|
439
|
+
readonly defaultSoftPressed: "rgba(228, 228, 231, 0.6)";
|
|
428
440
|
readonly accentSoft: "rgba(147, 51, 234, 0.15)";
|
|
429
441
|
readonly accentSoftForeground: "#7833bc";
|
|
430
442
|
readonly accentSoftPressed: "rgba(147, 51, 234, 0.2)";
|
|
@@ -486,10 +498,10 @@ declare const tokens: {
|
|
|
486
498
|
readonly separator: "#52525b";
|
|
487
499
|
readonly focus: "#c084fc";
|
|
488
500
|
readonly link: "#fafafa";
|
|
489
|
-
readonly accentPressed: "#
|
|
490
|
-
readonly successPressed: "#
|
|
491
|
-
readonly warningPressed: "#
|
|
492
|
-
readonly dangerPressed: "#
|
|
501
|
+
readonly accentPressed: "#c691fd";
|
|
502
|
+
readonly successPressed: "#64e18d";
|
|
503
|
+
readonly warningPressed: "#fbc54b";
|
|
504
|
+
readonly dangerPressed: "#fa807e";
|
|
493
505
|
readonly defaultPressed: "#2e2e31";
|
|
494
506
|
readonly surfacePressed: "#27272a";
|
|
495
507
|
readonly defaultSoft: "rgba(39, 39, 42, 0.5)";
|
package/dist/theme/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
ThemeContext,
|
|
3
2
|
XAUIProvider,
|
|
4
3
|
buildRadius,
|
|
5
4
|
buildShadows,
|
|
@@ -9,14 +8,16 @@ import {
|
|
|
9
8
|
palette,
|
|
10
9
|
primitives,
|
|
11
10
|
sourceKeys,
|
|
12
|
-
tokens
|
|
11
|
+
tokens
|
|
12
|
+
} from "../chunk-TUJBDS5M.js";
|
|
13
|
+
import {
|
|
14
|
+
ThemeContext,
|
|
15
|
+
deriveTint,
|
|
13
16
|
useColorMode,
|
|
14
17
|
useThemeColor,
|
|
15
18
|
useXAUITheme
|
|
16
|
-
} from "../chunk-
|
|
17
|
-
import
|
|
18
|
-
deriveTint
|
|
19
|
-
} from "../chunk-RBNCR5KB.js";
|
|
19
|
+
} from "../chunk-A3EGFI6T.js";
|
|
20
|
+
import "../chunk-GGW42MY4.js";
|
|
20
21
|
export {
|
|
21
22
|
ThemeContext,
|
|
22
23
|
XAUIProvider,
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { TextStyle } from 'react-native';
|
|
2
|
+
|
|
1
3
|
/** The source layer — the only surface a consumer writes by hand, per mode. */
|
|
2
4
|
type XAUISourceColors = {
|
|
3
5
|
background: string;
|
|
@@ -106,7 +108,11 @@ type XAUITheme = {
|
|
|
106
108
|
};
|
|
107
109
|
fontSizes: Record<FontSizeKey, number>;
|
|
108
110
|
lineHeights: Record<FontSizeKey, number>;
|
|
109
|
-
|
|
111
|
+
/**
|
|
112
|
+
* Typed as RN's own `fontWeight` rather than `string`: a `string` does not assign to
|
|
113
|
+
* it, so every component reading `t.fontWeights.medium` would have needed a cast.
|
|
114
|
+
*/
|
|
115
|
+
fontWeights: Record<FontWeightKey, TextStyle['fontWeight']>;
|
|
110
116
|
fontFamilies: {
|
|
111
117
|
body: string;
|
|
112
118
|
heading: string;
|
|
@@ -150,4 +156,4 @@ type XAUIThemeSet = {
|
|
|
150
156
|
dark: XAUITheme;
|
|
151
157
|
};
|
|
152
158
|
|
|
153
|
-
export type { ColorMode as C, FontSizeKey as F, RadiusKey as R, Size as S,
|
|
159
|
+
export type { ColorMode as C, FontSizeKey as F, RadiusKey as R, Size as S, XAUITheme as X, XAUIColors as a, FontWeightKey as b, XAUIDerivedColors as c, XAUIPrimitiveColors as d, XAUIRadius as e, XAUIShadow as f, XAUISourceColors as g, XAUIThemeConfig as h, XAUIThemeSet as i };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { TextStyle } from 'react-native';
|
|
2
|
+
|
|
1
3
|
/** The source layer — the only surface a consumer writes by hand, per mode. */
|
|
2
4
|
type XAUISourceColors = {
|
|
3
5
|
background: string;
|
|
@@ -106,7 +108,11 @@ type XAUITheme = {
|
|
|
106
108
|
};
|
|
107
109
|
fontSizes: Record<FontSizeKey, number>;
|
|
108
110
|
lineHeights: Record<FontSizeKey, number>;
|
|
109
|
-
|
|
111
|
+
/**
|
|
112
|
+
* Typed as RN's own `fontWeight` rather than `string`: a `string` does not assign to
|
|
113
|
+
* it, so every component reading `t.fontWeights.medium` would have needed a cast.
|
|
114
|
+
*/
|
|
115
|
+
fontWeights: Record<FontWeightKey, TextStyle['fontWeight']>;
|
|
110
116
|
fontFamilies: {
|
|
111
117
|
body: string;
|
|
112
118
|
heading: string;
|
|
@@ -150,4 +156,4 @@ type XAUIThemeSet = {
|
|
|
150
156
|
dark: XAUITheme;
|
|
151
157
|
};
|
|
152
158
|
|
|
153
|
-
export type { ColorMode as C, FontSizeKey as F, RadiusKey as R, Size as S,
|
|
159
|
+
export type { ColorMode as C, FontSizeKey as F, RadiusKey as R, Size as S, XAUITheme as X, XAUIColors as a, FontWeightKey as b, XAUIDerivedColors as c, XAUIPrimitiveColors as d, XAUIRadius as e, XAUIShadow as f, XAUISourceColors as g, XAUIThemeConfig as h, XAUIThemeSet as i };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xaui/native",
|
|
3
|
-
"version": "0.9.1-alpha.
|
|
3
|
+
"version": "0.9.1-alpha.21",
|
|
4
4
|
"description": "Composition-first React Native UI components with native animations powered by Reanimated",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -14,23 +14,78 @@
|
|
|
14
14
|
],
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"type": "module",
|
|
17
|
-
"main": "./dist/index.
|
|
17
|
+
"main": "./dist/index.cjs",
|
|
18
18
|
"types": "./dist/index.d.ts",
|
|
19
19
|
"exports": {
|
|
20
20
|
".": {
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
"import": {
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"default": "./dist/index.js"
|
|
24
|
+
},
|
|
25
|
+
"require": {
|
|
26
|
+
"types": "./dist/index.d.cts",
|
|
27
|
+
"default": "./dist/index.cjs"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"./button": {
|
|
31
|
+
"import": {
|
|
32
|
+
"types": "./dist/components/button/index.d.ts",
|
|
33
|
+
"default": "./dist/components/button/index.js"
|
|
34
|
+
},
|
|
35
|
+
"require": {
|
|
36
|
+
"types": "./dist/components/button/index.d.cts",
|
|
37
|
+
"default": "./dist/components/button/index.cjs"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"./card": {
|
|
41
|
+
"import": {
|
|
42
|
+
"types": "./dist/components/card/index.d.ts",
|
|
43
|
+
"default": "./dist/components/card/index.js"
|
|
44
|
+
},
|
|
45
|
+
"require": {
|
|
46
|
+
"types": "./dist/components/card/index.d.cts",
|
|
47
|
+
"default": "./dist/components/card/index.cjs"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"./typography": {
|
|
51
|
+
"import": {
|
|
52
|
+
"types": "./dist/components/typography/index.d.ts",
|
|
53
|
+
"default": "./dist/components/typography/index.js"
|
|
54
|
+
},
|
|
55
|
+
"require": {
|
|
56
|
+
"types": "./dist/components/typography/index.d.cts",
|
|
57
|
+
"default": "./dist/components/typography/index.cjs"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"./view": {
|
|
61
|
+
"import": {
|
|
62
|
+
"types": "./dist/components/view/index.d.ts",
|
|
63
|
+
"default": "./dist/components/view/index.js"
|
|
64
|
+
},
|
|
65
|
+
"require": {
|
|
66
|
+
"types": "./dist/components/view/index.d.cts",
|
|
67
|
+
"default": "./dist/components/view/index.cjs"
|
|
68
|
+
}
|
|
24
69
|
},
|
|
25
70
|
"./system": {
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
71
|
+
"import": {
|
|
72
|
+
"types": "./dist/system/index.d.ts",
|
|
73
|
+
"default": "./dist/system/index.js"
|
|
74
|
+
},
|
|
75
|
+
"require": {
|
|
76
|
+
"types": "./dist/system/index.d.cts",
|
|
77
|
+
"default": "./dist/system/index.cjs"
|
|
78
|
+
}
|
|
29
79
|
},
|
|
30
80
|
"./theme": {
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
81
|
+
"import": {
|
|
82
|
+
"types": "./dist/theme/index.d.ts",
|
|
83
|
+
"default": "./dist/theme/index.js"
|
|
84
|
+
},
|
|
85
|
+
"require": {
|
|
86
|
+
"types": "./dist/theme/index.d.cts",
|
|
87
|
+
"default": "./dist/theme/index.cjs"
|
|
88
|
+
}
|
|
34
89
|
}
|
|
35
90
|
},
|
|
36
91
|
"files": [
|
|
@@ -67,19 +122,20 @@
|
|
|
67
122
|
}
|
|
68
123
|
},
|
|
69
124
|
"devDependencies": {
|
|
70
|
-
"@types/react": "^19.
|
|
71
|
-
"react": "19.
|
|
72
|
-
"react-native": "0.83.
|
|
125
|
+
"@types/react": "^19.2.0",
|
|
126
|
+
"react": "19.2.0",
|
|
127
|
+
"react-native": "0.83.10",
|
|
73
128
|
"react-native-gesture-handler": "^2.28.0",
|
|
74
|
-
"react-native-reanimated": "
|
|
129
|
+
"react-native-reanimated": "4.2.1",
|
|
75
130
|
"react-native-safe-area-context": "^5.6.0",
|
|
76
|
-
"react-native-svg": "
|
|
77
|
-
"react-native-worklets": "
|
|
131
|
+
"react-native-svg": "15.15.3",
|
|
132
|
+
"react-native-worklets": "0.7.4",
|
|
78
133
|
"tsup": "^8.5.1",
|
|
79
134
|
"typescript": "^5.9.3"
|
|
80
135
|
},
|
|
136
|
+
"module": "./dist/index.js",
|
|
81
137
|
"scripts": {
|
|
82
|
-
"build": "rm -rf dist && tsup --config tsup.config.ts",
|
|
138
|
+
"build": "rm -rf dist && tsup --config tsup.config.ts && node ../../tooling/workletize/workletize.mjs dist",
|
|
83
139
|
"dev": "tsup --config tsup.config.ts --watch",
|
|
84
140
|
"test": "vitest",
|
|
85
141
|
"lint": "eslint src/",
|