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

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.
@@ -0,0 +1,153 @@
1
+ /** The source layer — the only surface a consumer writes by hand, per mode. */
2
+ type XAUISourceColors = {
3
+ background: string;
4
+ foreground: string;
5
+ surface: string;
6
+ surfaceForeground: string;
7
+ surfaceSecondary: string;
8
+ surfaceSecondaryForeground: string;
9
+ surfaceTertiary: string;
10
+ surfaceTertiaryForeground: string;
11
+ overlay: string;
12
+ overlayForeground: string;
13
+ backdrop: string;
14
+ muted: string;
15
+ default: string;
16
+ defaultForeground: string;
17
+ accent: string;
18
+ accentForeground: string;
19
+ fieldBackground: string;
20
+ fieldForeground: string;
21
+ fieldPlaceholder: string;
22
+ fieldBorder: string;
23
+ success: string;
24
+ successForeground: string;
25
+ warning: string;
26
+ warningForeground: string;
27
+ danger: string;
28
+ dangerForeground: string;
29
+ segment: string;
30
+ segmentForeground: string;
31
+ border: string;
32
+ separator: string;
33
+ focus: string;
34
+ link: string;
35
+ };
36
+ /** The derived layer — computed by `deriveColors`, never written by hand. */
37
+ type XAUIDerivedColors = {
38
+ accentPressed: string;
39
+ successPressed: string;
40
+ warningPressed: string;
41
+ dangerPressed: string;
42
+ defaultPressed: string;
43
+ surfacePressed: string;
44
+ defaultSoft: string;
45
+ defaultSoftForeground: string;
46
+ defaultSoftPressed: string;
47
+ accentSoft: string;
48
+ accentSoftForeground: string;
49
+ accentSoftPressed: string;
50
+ successSoft: string;
51
+ successSoftForeground: string;
52
+ successSoftPressed: string;
53
+ warningSoft: string;
54
+ warningSoftForeground: string;
55
+ warningSoftPressed: string;
56
+ dangerSoft: string;
57
+ dangerSoftForeground: string;
58
+ dangerSoftPressed: string;
59
+ backgroundSecondary: string;
60
+ backgroundTertiary: string;
61
+ backgroundInverse: string;
62
+ borderSecondary: string;
63
+ borderTertiary: string;
64
+ separatorSecondary: string;
65
+ separatorTertiary: string;
66
+ fieldPressed: string;
67
+ fieldFocus: string;
68
+ fieldBorderPressed: string;
69
+ fieldBorderFocus: string;
70
+ };
71
+ /** Constant across both modes. */
72
+ type XAUIPrimitiveColors = {
73
+ white: string;
74
+ black: string;
75
+ snow: string;
76
+ eclipse: string;
77
+ };
78
+ /** Everything a component reads, flattened. */
79
+ type XAUIColors = XAUISourceColors & XAUIDerivedColors & XAUIPrimitiveColors;
80
+ type ColorMode = 'light' | 'dark';
81
+ type Size = 'xs' | 'sm' | 'md' | 'lg';
82
+ type RadiusKey = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | 'field' | 'full';
83
+ type FontSizeKey = Size | 'xl' | '2xl' | '3xl' | '4xl';
84
+ type FontWeightKey = 'regular' | 'medium' | 'semibold' | 'bold';
85
+ type XAUIRadius = Record<RadiusKey, number>;
86
+ type XAUIShadow = {
87
+ shadowColor: string;
88
+ shadowOffset: {
89
+ width: number;
90
+ height: number;
91
+ };
92
+ shadowOpacity: number;
93
+ shadowRadius: number;
94
+ elevation: number;
95
+ };
96
+ type XAUITheme = {
97
+ id: string;
98
+ mode: ColorMode;
99
+ colors: XAUIColors;
100
+ /** Base 4 — `spacing(3) === 12`. A function, so there is no "what do we call 12px". */
101
+ spacing: (steps: number) => number;
102
+ radius: XAUIRadius;
103
+ borderWidth: {
104
+ default: number;
105
+ field: number;
106
+ };
107
+ fontSizes: Record<FontSizeKey, number>;
108
+ lineHeights: Record<FontSizeKey, number>;
109
+ fontWeights: Record<FontWeightKey, string>;
110
+ fontFamilies: {
111
+ body: string;
112
+ heading: string;
113
+ mono: string;
114
+ };
115
+ /** Semantic roles, not a scale: dark mode drops the surface shadow entirely. */
116
+ shadows: {
117
+ surface: XAUIShadow;
118
+ overlay: XAUIShadow;
119
+ field: XAUIShadow;
120
+ };
121
+ opacity: {
122
+ disabled: number;
123
+ };
124
+ controlHeights: Record<Size, number>;
125
+ };
126
+ type XAUIThemeConfig = {
127
+ colors?: {
128
+ light?: Partial<XAUISourceColors & XAUIDerivedColors>;
129
+ dark?: Partial<XAUISourceColors & XAUIDerivedColors>;
130
+ };
131
+ /** The single base the whole radius scale derives from. */
132
+ radius?: number;
133
+ spacingUnit?: number;
134
+ borderWidth?: Partial<XAUITheme['borderWidth']>;
135
+ fontSizes?: Partial<XAUITheme['fontSizes']>;
136
+ lineHeights?: Partial<XAUITheme['lineHeights']>;
137
+ fontWeights?: Partial<XAUITheme['fontWeights']>;
138
+ fontFamilies?: Partial<XAUITheme['fontFamilies']>;
139
+ /** Per role, and `shadowOffset` is replaced whole — a half-set offset is not a shadow. */
140
+ shadows?: {
141
+ [K in keyof XAUITheme['shadows']]?: Partial<XAUIShadow>;
142
+ };
143
+ opacity?: Partial<XAUITheme['opacity']>;
144
+ controlHeights?: Partial<XAUITheme['controlHeights']>;
145
+ };
146
+ /** What `createTheme` returns: both modes, resolved, sharing one id. */
147
+ type XAUIThemeSet = {
148
+ id: string;
149
+ light: XAUITheme;
150
+ dark: XAUITheme;
151
+ };
152
+
153
+ export type { ColorMode as C, FontSizeKey as F, RadiusKey as R, Size as S, XAUIColors as X, FontWeightKey as a, XAUIDerivedColors as b, XAUIPrimitiveColors as c, XAUIRadius as d, XAUIShadow as e, XAUISourceColors as f, XAUITheme as g, XAUIThemeConfig as h, XAUIThemeSet as i };
@@ -0,0 +1,153 @@
1
+ /** The source layer — the only surface a consumer writes by hand, per mode. */
2
+ type XAUISourceColors = {
3
+ background: string;
4
+ foreground: string;
5
+ surface: string;
6
+ surfaceForeground: string;
7
+ surfaceSecondary: string;
8
+ surfaceSecondaryForeground: string;
9
+ surfaceTertiary: string;
10
+ surfaceTertiaryForeground: string;
11
+ overlay: string;
12
+ overlayForeground: string;
13
+ backdrop: string;
14
+ muted: string;
15
+ default: string;
16
+ defaultForeground: string;
17
+ accent: string;
18
+ accentForeground: string;
19
+ fieldBackground: string;
20
+ fieldForeground: string;
21
+ fieldPlaceholder: string;
22
+ fieldBorder: string;
23
+ success: string;
24
+ successForeground: string;
25
+ warning: string;
26
+ warningForeground: string;
27
+ danger: string;
28
+ dangerForeground: string;
29
+ segment: string;
30
+ segmentForeground: string;
31
+ border: string;
32
+ separator: string;
33
+ focus: string;
34
+ link: string;
35
+ };
36
+ /** The derived layer — computed by `deriveColors`, never written by hand. */
37
+ type XAUIDerivedColors = {
38
+ accentPressed: string;
39
+ successPressed: string;
40
+ warningPressed: string;
41
+ dangerPressed: string;
42
+ defaultPressed: string;
43
+ surfacePressed: string;
44
+ defaultSoft: string;
45
+ defaultSoftForeground: string;
46
+ defaultSoftPressed: string;
47
+ accentSoft: string;
48
+ accentSoftForeground: string;
49
+ accentSoftPressed: string;
50
+ successSoft: string;
51
+ successSoftForeground: string;
52
+ successSoftPressed: string;
53
+ warningSoft: string;
54
+ warningSoftForeground: string;
55
+ warningSoftPressed: string;
56
+ dangerSoft: string;
57
+ dangerSoftForeground: string;
58
+ dangerSoftPressed: string;
59
+ backgroundSecondary: string;
60
+ backgroundTertiary: string;
61
+ backgroundInverse: string;
62
+ borderSecondary: string;
63
+ borderTertiary: string;
64
+ separatorSecondary: string;
65
+ separatorTertiary: string;
66
+ fieldPressed: string;
67
+ fieldFocus: string;
68
+ fieldBorderPressed: string;
69
+ fieldBorderFocus: string;
70
+ };
71
+ /** Constant across both modes. */
72
+ type XAUIPrimitiveColors = {
73
+ white: string;
74
+ black: string;
75
+ snow: string;
76
+ eclipse: string;
77
+ };
78
+ /** Everything a component reads, flattened. */
79
+ type XAUIColors = XAUISourceColors & XAUIDerivedColors & XAUIPrimitiveColors;
80
+ type ColorMode = 'light' | 'dark';
81
+ type Size = 'xs' | 'sm' | 'md' | 'lg';
82
+ type RadiusKey = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | 'field' | 'full';
83
+ type FontSizeKey = Size | 'xl' | '2xl' | '3xl' | '4xl';
84
+ type FontWeightKey = 'regular' | 'medium' | 'semibold' | 'bold';
85
+ type XAUIRadius = Record<RadiusKey, number>;
86
+ type XAUIShadow = {
87
+ shadowColor: string;
88
+ shadowOffset: {
89
+ width: number;
90
+ height: number;
91
+ };
92
+ shadowOpacity: number;
93
+ shadowRadius: number;
94
+ elevation: number;
95
+ };
96
+ type XAUITheme = {
97
+ id: string;
98
+ mode: ColorMode;
99
+ colors: XAUIColors;
100
+ /** Base 4 — `spacing(3) === 12`. A function, so there is no "what do we call 12px". */
101
+ spacing: (steps: number) => number;
102
+ radius: XAUIRadius;
103
+ borderWidth: {
104
+ default: number;
105
+ field: number;
106
+ };
107
+ fontSizes: Record<FontSizeKey, number>;
108
+ lineHeights: Record<FontSizeKey, number>;
109
+ fontWeights: Record<FontWeightKey, string>;
110
+ fontFamilies: {
111
+ body: string;
112
+ heading: string;
113
+ mono: string;
114
+ };
115
+ /** Semantic roles, not a scale: dark mode drops the surface shadow entirely. */
116
+ shadows: {
117
+ surface: XAUIShadow;
118
+ overlay: XAUIShadow;
119
+ field: XAUIShadow;
120
+ };
121
+ opacity: {
122
+ disabled: number;
123
+ };
124
+ controlHeights: Record<Size, number>;
125
+ };
126
+ type XAUIThemeConfig = {
127
+ colors?: {
128
+ light?: Partial<XAUISourceColors & XAUIDerivedColors>;
129
+ dark?: Partial<XAUISourceColors & XAUIDerivedColors>;
130
+ };
131
+ /** The single base the whole radius scale derives from. */
132
+ radius?: number;
133
+ spacingUnit?: number;
134
+ borderWidth?: Partial<XAUITheme['borderWidth']>;
135
+ fontSizes?: Partial<XAUITheme['fontSizes']>;
136
+ lineHeights?: Partial<XAUITheme['lineHeights']>;
137
+ fontWeights?: Partial<XAUITheme['fontWeights']>;
138
+ fontFamilies?: Partial<XAUITheme['fontFamilies']>;
139
+ /** Per role, and `shadowOffset` is replaced whole — a half-set offset is not a shadow. */
140
+ shadows?: {
141
+ [K in keyof XAUITheme['shadows']]?: Partial<XAUIShadow>;
142
+ };
143
+ opacity?: Partial<XAUITheme['opacity']>;
144
+ controlHeights?: Partial<XAUITheme['controlHeights']>;
145
+ };
146
+ /** What `createTheme` returns: both modes, resolved, sharing one id. */
147
+ type XAUIThemeSet = {
148
+ id: string;
149
+ light: XAUITheme;
150
+ dark: XAUITheme;
151
+ };
152
+
153
+ export type { ColorMode as C, FontSizeKey as F, RadiusKey as R, Size as S, XAUIColors as X, FontWeightKey as a, XAUIDerivedColors as b, XAUIPrimitiveColors as c, XAUIRadius as d, XAUIShadow as e, XAUISourceColors as f, XAUITheme 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.0",
3
+ "version": "0.9.1-alpha.2",
4
4
  "description": "Composition-first React Native UI components with native animations powered by Reanimated",
5
5
  "keywords": [
6
6
  "react-native",
@@ -22,6 +22,11 @@
22
22
  "import": "./dist/index.js",
23
23
  "require": "./dist/index.js"
24
24
  },
25
+ "./system": {
26
+ "types": "./dist/system/index.d.ts",
27
+ "import": "./dist/system/index.js",
28
+ "require": "./dist/system/index.js"
29
+ },
25
30
  "./theme": {
26
31
  "types": "./dist/theme/index.d.ts",
27
32
  "import": "./dist/theme/index.js",