@xaui/native 0.2.5 → 0.2.6
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/view/index.cjs +297 -119
- package/dist/view/index.d.cts +175 -101
- package/dist/view/index.d.ts +175 -101
- package/dist/view/index.js +368 -190
- package/package.json +3 -8
- package/dist/container/index.cjs +0 -203
- package/dist/container/index.d.cts +0 -40
- package/dist/container/index.d.ts +0 -40
- package/dist/container/index.js +0 -203
package/dist/view/index.d.cts
CHANGED
|
@@ -1,7 +1,73 @@
|
|
|
1
1
|
import React, { ReactNode, ReactElement, ComponentType } from 'react';
|
|
2
|
-
import { StyleProp, ViewStyle, ColorValue, ScrollViewProps } from 'react-native';
|
|
2
|
+
import { AccessibilityRole, AccessibilityState, StyleProp, ViewStyle, ColorValue, ScrollViewProps } from 'react-native';
|
|
3
|
+
import { EdgeInsets, Alignment, Border, BorderRadius, ShadowConfig, TransformConfig } from '@xaui/core';
|
|
3
4
|
import { ThemeColor, Radius } from '@xaui/core/types';
|
|
4
5
|
|
|
6
|
+
type ContainerProps = {
|
|
7
|
+
/** Content to render inside the container. */
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
/** Width in logical pixels or percentage string (e.g. `'50%'`). */
|
|
10
|
+
width?: number | `${number}%`;
|
|
11
|
+
/** Height in logical pixels or percentage string (e.g. `'50%'`). */
|
|
12
|
+
height?: number | `${number}%`;
|
|
13
|
+
/** Minimum width constraint in logical pixels. */
|
|
14
|
+
minWidth?: number;
|
|
15
|
+
/** Maximum width constraint in logical pixels. */
|
|
16
|
+
maxWidth?: number;
|
|
17
|
+
/** Minimum height constraint in logical pixels. */
|
|
18
|
+
minHeight?: number;
|
|
19
|
+
/** Maximum height constraint in logical pixels. */
|
|
20
|
+
maxHeight?: number;
|
|
21
|
+
/** Width-to-height aspect ratio (e.g. `16 / 9`). */
|
|
22
|
+
aspectRatio?: number;
|
|
23
|
+
/** Flex grow/shrink factor. */
|
|
24
|
+
flex?: number;
|
|
25
|
+
/** Inner spacing — number for all sides or `{ top, bottom, left, right, horizontal, vertical }`. */
|
|
26
|
+
padding?: EdgeInsets;
|
|
27
|
+
/** Outer spacing — same shape as `padding`. */
|
|
28
|
+
margin?: EdgeInsets;
|
|
29
|
+
/** Alignment of children — named (`'center'`, `'topLeft'`, …) or coordinate `{ x, y }`. */
|
|
30
|
+
alignment?: Alignment;
|
|
31
|
+
/** Background color. */
|
|
32
|
+
color?: string;
|
|
33
|
+
/** Border — uniform `{ width, color, style }` or per-side `{ top, left, … }`. */
|
|
34
|
+
border?: Border;
|
|
35
|
+
/** Corner radius — number for all corners or `{ topLeft, topRight, bottomLeft, bottomRight }`. */
|
|
36
|
+
borderRadius?: BorderRadius;
|
|
37
|
+
/** Drop shadow config — `{ color, offset: { x, y }, blur, opacity, elevation }`. */
|
|
38
|
+
shadow?: ShadowConfig;
|
|
39
|
+
/** Clip children to the container bounds (`overflow: hidden`). */
|
|
40
|
+
clip?: boolean;
|
|
41
|
+
/** CSS / RN transforms — `{ rotate, scale, translateX, translateY, … }`. */
|
|
42
|
+
transform?: TransformConfig;
|
|
43
|
+
/** Opacity from `0` (transparent) to `1` (opaque). */
|
|
44
|
+
opacity?: number;
|
|
45
|
+
/** Tap handler — renders the container as `Pressable` when provided. */
|
|
46
|
+
onPress?: () => void;
|
|
47
|
+
/** Long-press handler (fires after 500 ms). */
|
|
48
|
+
onLongPress?: () => void;
|
|
49
|
+
/** Fired on touch/pointer down. */
|
|
50
|
+
onPressIn?: () => void;
|
|
51
|
+
/** Fired on touch/pointer up. */
|
|
52
|
+
onPressOut?: () => void;
|
|
53
|
+
/** Disables all press handlers when `true`. */
|
|
54
|
+
disabled?: boolean;
|
|
55
|
+
/** Screen reader label. */
|
|
56
|
+
accessibilityLabel?: string;
|
|
57
|
+
/** Accessibility role for assistive technologies. */
|
|
58
|
+
accessibilityRole?: AccessibilityRole;
|
|
59
|
+
/** Accessibility state (disabled, selected, …). */
|
|
60
|
+
accessibilityState?: AccessibilityState;
|
|
61
|
+
/** Whether the element is accessible to assistive technologies. */
|
|
62
|
+
accessible?: boolean;
|
|
63
|
+
/** Test identifier for e2e tests. */
|
|
64
|
+
testID?: string;
|
|
65
|
+
/** Raw style override applied to the underlying View / Pressable. */
|
|
66
|
+
style?: StyleProp<ViewStyle>;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
declare const Container: React.FC<ContainerProps>;
|
|
70
|
+
|
|
5
71
|
type MainAxisAlignment = 'start' | 'center' | 'end' | 'space-between' | 'space-around' | 'space-evenly';
|
|
6
72
|
type CrossAxisAlignment = 'start' | 'center' | 'end' | 'stretch' | 'baseline';
|
|
7
73
|
type RowProps = {
|
|
@@ -65,132 +131,130 @@ type SpacerProps = {
|
|
|
65
131
|
declare const Spacer: React.FC<SpacerProps>;
|
|
66
132
|
|
|
67
133
|
type PaddingProps = {
|
|
134
|
+
/** Content to render inside the padding container. */
|
|
135
|
+
children?: ReactNode;
|
|
136
|
+
/** Padding applied to all sides — number for uniform, or `{ top, bottom, left, right, horizontal, vertical }`. */
|
|
137
|
+
padding: EdgeInsets;
|
|
138
|
+
/** Raw style override applied to the underlying View. */
|
|
139
|
+
style?: StyleProp<ViewStyle>;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
declare const Padding: React.FC<PaddingProps>;
|
|
143
|
+
|
|
144
|
+
type MarginProps = {
|
|
145
|
+
/** Content to render inside the margin container. */
|
|
146
|
+
children?: ReactNode;
|
|
147
|
+
/** Margin applied to all sides — number for uniform, or `{ top, bottom, left, right, horizontal, vertical }`. */
|
|
148
|
+
margin: EdgeInsets;
|
|
149
|
+
/** Raw style override applied to the underlying View. */
|
|
150
|
+
style?: StyleProp<ViewStyle>;
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
declare const Margin: React.FC<MarginProps>;
|
|
154
|
+
|
|
155
|
+
type SizedBoxProps = {
|
|
68
156
|
/**
|
|
69
|
-
*
|
|
70
|
-
*/
|
|
71
|
-
children: ReactNode;
|
|
72
|
-
/**
|
|
73
|
-
* Padding on all sides.
|
|
74
|
-
*/
|
|
75
|
-
all?: number;
|
|
76
|
-
/**
|
|
77
|
-
* Horizontal padding.
|
|
78
|
-
*/
|
|
79
|
-
horizontal?: number;
|
|
80
|
-
/**
|
|
81
|
-
* Vertical padding.
|
|
82
|
-
*/
|
|
83
|
-
vertical?: number;
|
|
84
|
-
/**
|
|
85
|
-
* Top padding.
|
|
86
|
-
*/
|
|
87
|
-
top?: number;
|
|
88
|
-
/**
|
|
89
|
-
* Right padding.
|
|
157
|
+
* Width in logical pixels.
|
|
90
158
|
*/
|
|
91
|
-
|
|
159
|
+
width?: number;
|
|
92
160
|
/**
|
|
93
|
-
*
|
|
161
|
+
* Height in logical pixels.
|
|
94
162
|
*/
|
|
95
|
-
|
|
163
|
+
height?: number;
|
|
96
164
|
/**
|
|
97
|
-
*
|
|
165
|
+
* Fills all available space — equivalent to Flutter's Expanded (flex: 1, alignSelf: 'stretch').
|
|
166
|
+
* @default false
|
|
98
167
|
*/
|
|
99
|
-
|
|
168
|
+
expand?: boolean;
|
|
100
169
|
/**
|
|
101
|
-
*
|
|
170
|
+
* Collapses to zero size — equivalent to Flutter's SizedBox.shrink().
|
|
102
171
|
* @default false
|
|
103
172
|
*/
|
|
104
|
-
|
|
173
|
+
shrink?: boolean;
|
|
105
174
|
/**
|
|
106
|
-
*
|
|
107
|
-
* @default false
|
|
175
|
+
* Content to render inside the box.
|
|
108
176
|
*/
|
|
109
|
-
|
|
177
|
+
children?: ReactNode;
|
|
110
178
|
/**
|
|
111
|
-
*
|
|
179
|
+
* Style override applied to the underlying View.
|
|
112
180
|
*/
|
|
113
181
|
style?: StyleProp<ViewStyle>;
|
|
182
|
+
/**
|
|
183
|
+
* Test identifier for e2e tests.
|
|
184
|
+
*/
|
|
185
|
+
testID?: string;
|
|
114
186
|
};
|
|
115
187
|
|
|
116
|
-
declare const
|
|
188
|
+
declare const SizedBox: React.FC<SizedBoxProps>;
|
|
117
189
|
|
|
118
|
-
type
|
|
190
|
+
type BoxConstraints = {
|
|
119
191
|
/**
|
|
120
|
-
*
|
|
192
|
+
* Minimum width in logical pixels.
|
|
121
193
|
*/
|
|
122
|
-
|
|
194
|
+
minWidth?: number;
|
|
123
195
|
/**
|
|
124
|
-
*
|
|
196
|
+
* Maximum width in logical pixels.
|
|
125
197
|
*/
|
|
126
|
-
|
|
198
|
+
maxWidth?: number;
|
|
127
199
|
/**
|
|
128
|
-
*
|
|
200
|
+
* Minimum height in logical pixels.
|
|
129
201
|
*/
|
|
130
|
-
|
|
202
|
+
minHeight?: number;
|
|
131
203
|
/**
|
|
132
|
-
*
|
|
204
|
+
* Maximum height in logical pixels.
|
|
133
205
|
*/
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
*/
|
|
138
|
-
top?: number;
|
|
139
|
-
/**
|
|
140
|
-
* Right margin.
|
|
141
|
-
*/
|
|
142
|
-
right?: number;
|
|
206
|
+
maxHeight?: number;
|
|
207
|
+
};
|
|
208
|
+
type ConstrainedBoxProps = {
|
|
143
209
|
/**
|
|
144
|
-
*
|
|
210
|
+
* Size constraints to impose on the child — Flutter BoxConstraints equivalent.
|
|
145
211
|
*/
|
|
146
|
-
|
|
212
|
+
constraints: BoxConstraints;
|
|
147
213
|
/**
|
|
148
|
-
*
|
|
149
|
-
*/
|
|
150
|
-
left?: number;
|
|
151
|
-
/**
|
|
152
|
-
* Whether the margin container should take the full width of its parent.
|
|
153
|
-
* @default false
|
|
214
|
+
* Content to render inside the box.
|
|
154
215
|
*/
|
|
155
|
-
|
|
216
|
+
children?: ReactNode;
|
|
156
217
|
/**
|
|
157
|
-
*
|
|
158
|
-
* @default false
|
|
218
|
+
* Style override applied to the underlying View.
|
|
159
219
|
*/
|
|
160
|
-
|
|
220
|
+
style?: StyleProp<ViewStyle>;
|
|
161
221
|
/**
|
|
162
|
-
*
|
|
222
|
+
* Test identifier for e2e tests.
|
|
163
223
|
*/
|
|
164
|
-
|
|
224
|
+
testID?: string;
|
|
165
225
|
};
|
|
166
226
|
|
|
167
|
-
declare const
|
|
227
|
+
declare const ConstrainedBox: React.FC<ConstrainedBoxProps>;
|
|
168
228
|
|
|
169
|
-
type
|
|
229
|
+
type FractionallySizedBoxProps = {
|
|
170
230
|
/**
|
|
171
|
-
*
|
|
231
|
+
* Fraction of the parent's width (0–1). When undefined, the child chooses its own width.
|
|
172
232
|
*/
|
|
173
|
-
|
|
233
|
+
widthFactor?: number;
|
|
174
234
|
/**
|
|
175
|
-
*
|
|
235
|
+
* Fraction of the parent's height (0–1). When undefined, the child chooses its own height.
|
|
176
236
|
*/
|
|
177
|
-
|
|
237
|
+
heightFactor?: number;
|
|
178
238
|
/**
|
|
179
|
-
*
|
|
239
|
+
* How to align the child within the remaining space.
|
|
240
|
+
* @default 'topLeft'
|
|
180
241
|
*/
|
|
181
|
-
|
|
242
|
+
alignment?: Alignment;
|
|
182
243
|
/**
|
|
183
|
-
*
|
|
184
|
-
* @default false
|
|
244
|
+
* Content to render inside the box.
|
|
185
245
|
*/
|
|
186
|
-
|
|
246
|
+
children?: ReactNode;
|
|
187
247
|
/**
|
|
188
|
-
*
|
|
248
|
+
* Style override applied to the underlying View.
|
|
189
249
|
*/
|
|
190
250
|
style?: StyleProp<ViewStyle>;
|
|
251
|
+
/**
|
|
252
|
+
* Test identifier for e2e tests.
|
|
253
|
+
*/
|
|
254
|
+
testID?: string;
|
|
191
255
|
};
|
|
192
256
|
|
|
193
|
-
declare const
|
|
257
|
+
declare const FractionallySizedBox: React.FC<FractionallySizedBoxProps>;
|
|
194
258
|
|
|
195
259
|
type PositionedViewProps = {
|
|
196
260
|
/**
|
|
@@ -300,18 +364,31 @@ declare const RoundedView: React.FC<RoundedViewProps>;
|
|
|
300
364
|
|
|
301
365
|
type AspectRatioProps = {
|
|
302
366
|
/**
|
|
303
|
-
* Content to be displayed inside the aspect ratio container
|
|
367
|
+
* Content to be displayed inside the aspect ratio container.
|
|
304
368
|
*/
|
|
305
|
-
children
|
|
369
|
+
children?: ReactNode;
|
|
306
370
|
/**
|
|
307
|
-
* Aspect ratio as a number (width / height)
|
|
371
|
+
* Aspect ratio as a number (width / height).
|
|
308
372
|
* Examples: 16/9, 4/3, 1, 2/1
|
|
309
373
|
*/
|
|
310
374
|
ratio: number;
|
|
311
375
|
/**
|
|
312
|
-
*
|
|
376
|
+
* How to align the child within the container.
|
|
313
377
|
*/
|
|
314
|
-
|
|
378
|
+
alignment?: Alignment;
|
|
379
|
+
/**
|
|
380
|
+
* Whether to clip content that overflows the container.
|
|
381
|
+
* @default false
|
|
382
|
+
*/
|
|
383
|
+
clip?: boolean;
|
|
384
|
+
/**
|
|
385
|
+
* Style override applied to the underlying View.
|
|
386
|
+
*/
|
|
387
|
+
style?: StyleProp<ViewStyle>;
|
|
388
|
+
/**
|
|
389
|
+
* Test identifier for e2e tests.
|
|
390
|
+
*/
|
|
391
|
+
testID?: string;
|
|
315
392
|
};
|
|
316
393
|
|
|
317
394
|
declare const AspectRatio: React.FC<AspectRatioProps>;
|
|
@@ -378,24 +455,21 @@ type ScreenProps = {
|
|
|
378
455
|
|
|
379
456
|
declare const Screen: React.FC<ScreenProps>;
|
|
380
457
|
|
|
458
|
+
type AlignProps = {
|
|
459
|
+
/** Content to align inside the container. */
|
|
460
|
+
children?: ReactNode;
|
|
461
|
+
/** Alignment of children — named (`'center'`, `'topLeft'`, …) or coordinate `{ x, y }`. */
|
|
462
|
+
alignment: Alignment;
|
|
463
|
+
/** Raw style override applied to the underlying View. */
|
|
464
|
+
style?: StyleProp<ViewStyle>;
|
|
465
|
+
};
|
|
466
|
+
|
|
467
|
+
declare const Align: React.FC<AlignProps>;
|
|
468
|
+
|
|
381
469
|
type CenterProps = {
|
|
382
|
-
/**
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
children: ReactNode;
|
|
386
|
-
/**
|
|
387
|
-
* Whether the centered container should take the full width of its parent.
|
|
388
|
-
* @default false
|
|
389
|
-
*/
|
|
390
|
-
fullWidth?: boolean;
|
|
391
|
-
/**
|
|
392
|
-
* If true, disables automatic growth (e.g. prevents using flex: 1 to fill available space).
|
|
393
|
-
* @default false
|
|
394
|
-
*/
|
|
395
|
-
noGrowth?: boolean;
|
|
396
|
-
/**
|
|
397
|
-
* Additional style for the container.
|
|
398
|
-
*/
|
|
470
|
+
/** Content to center. */
|
|
471
|
+
children?: ReactNode;
|
|
472
|
+
/** Raw style override applied to the underlying View. */
|
|
399
473
|
style?: StyleProp<ViewStyle>;
|
|
400
474
|
};
|
|
401
475
|
|
|
@@ -712,4 +786,4 @@ declare const MasonryGridBuilder: {
|
|
|
712
786
|
displayName: string;
|
|
713
787
|
};
|
|
714
788
|
|
|
715
|
-
export { AspectRatio, type AspectRatioProps, BlurView, type BlurViewProps, Center, type CenterProps, Column, type ColumnProps, ConditionalView, type ConditionalViewAnimation, type ConditionalViewProps, type CrossAxisAlignment, Grid, GridBuilder, type GridBuilderProps, GridItem, type GridItemProps, type GridProps, type MainAxisAlignment, Margin, type MarginProps, MasonryGrid, MasonryGridBuilder, type MasonryGridBuilderProps, MasonryGridItem, type MasonryGridItemProps, type MasonryGridProps, Padding, type PaddingProps, PositionedView, type PositionedViewProps, RoundedView, type RoundedViewProps, Row, type RowProps, Screen, type ScreenProps, SizedBox, type SizedBoxProps, Spacer, type SpacerProps, Surface, type SurfaceProps, type SurfaceThemeColor };
|
|
789
|
+
export { Align, type AlignProps, AspectRatio, type AspectRatioProps, BlurView, type BlurViewProps, type BoxConstraints, Center, type CenterProps, Column, type ColumnProps, ConditionalView, type ConditionalViewAnimation, type ConditionalViewProps, ConstrainedBox, type ConstrainedBoxProps, Container, type ContainerProps, type CrossAxisAlignment, FractionallySizedBox, type FractionallySizedBoxProps, Grid, GridBuilder, type GridBuilderProps, GridItem, type GridItemProps, type GridProps, type MainAxisAlignment, Margin, type MarginProps, MasonryGrid, MasonryGridBuilder, type MasonryGridBuilderProps, MasonryGridItem, type MasonryGridItemProps, type MasonryGridProps, Padding, type PaddingProps, PositionedView, type PositionedViewProps, RoundedView, type RoundedViewProps, Row, type RowProps, Screen, type ScreenProps, SizedBox, type SizedBoxProps, Spacer, type SpacerProps, Surface, type SurfaceProps, type SurfaceThemeColor };
|