@xaui/native 0.2.4 → 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.
Files changed (95) hide show
  1. package/dist/alert/index.d.cts +1 -1
  2. package/dist/alert/index.d.ts +1 -1
  3. package/dist/app-bar/index.d.cts +1 -1
  4. package/dist/app-bar/index.d.ts +1 -1
  5. package/dist/autocomplete/index.d.cts +1 -1
  6. package/dist/autocomplete/index.d.ts +1 -1
  7. package/dist/avatar/index.d.cts +1 -1
  8. package/dist/avatar/index.d.ts +1 -1
  9. package/dist/badge/index.d.cts +1 -1
  10. package/dist/badge/index.d.ts +1 -1
  11. package/dist/bottom-sheet/index.d.cts +1 -1
  12. package/dist/bottom-sheet/index.d.ts +1 -1
  13. package/dist/bottom-tab-bar/index.d.cts +1 -1
  14. package/dist/bottom-tab-bar/index.d.ts +1 -1
  15. package/dist/button/index.d.cts +1 -1
  16. package/dist/button/index.d.ts +1 -1
  17. package/dist/card/index.d.cts +1 -1
  18. package/dist/card/index.d.ts +1 -1
  19. package/dist/carousel/index.d.cts +1 -1
  20. package/dist/carousel/index.d.ts +1 -1
  21. package/dist/checkbox/index.d.cts +1 -1
  22. package/dist/checkbox/index.d.ts +1 -1
  23. package/dist/chip/index.d.cts +1 -1
  24. package/dist/chip/index.d.ts +1 -1
  25. package/dist/color-picker/index.d.cts +2 -2
  26. package/dist/color-picker/index.d.ts +2 -2
  27. package/dist/datepicker/index.d.cts +1 -1
  28. package/dist/datepicker/index.d.ts +1 -1
  29. package/dist/dialog/index.d.cts +1 -1
  30. package/dist/dialog/index.d.ts +1 -1
  31. package/dist/divider/index.d.cts +1 -1
  32. package/dist/divider/index.d.ts +1 -1
  33. package/dist/drawer/index.d.cts +1 -1
  34. package/dist/drawer/index.d.ts +1 -1
  35. package/dist/fab/index.d.cts +3 -3
  36. package/dist/fab/index.d.ts +3 -3
  37. package/dist/fab-menu/index.d.cts +2 -2
  38. package/dist/fab-menu/index.d.ts +2 -2
  39. package/dist/{fab.type-CgIYqQlT.d.ts → fab.type-CkUHmXU_.d.ts} +1 -1
  40. package/dist/{fab.type-l2vjG8-p.d.cts → fab.type-DN0vtAh6.d.cts} +1 -1
  41. package/dist/feature-discovery/index.d.cts +1 -1
  42. package/dist/feature-discovery/index.d.ts +1 -1
  43. package/dist/indicator/index.d.cts +1 -1
  44. package/dist/indicator/index.d.ts +1 -1
  45. package/dist/input/index.d.cts +10 -9
  46. package/dist/input/index.d.ts +10 -9
  47. package/dist/input-trigger/index.d.cts +3 -3
  48. package/dist/input-trigger/index.d.ts +3 -3
  49. package/dist/{input-trigger.type-DlSqg2eG.d.ts → input-trigger.type-Ba4bM3Qp.d.cts} +1 -1
  50. package/dist/{input-trigger.type-By_1ZjKd.d.cts → input-trigger.type-Ba4bM3Qp.d.ts} +1 -1
  51. package/dist/list/index.d.cts +1 -1
  52. package/dist/list/index.d.ts +1 -1
  53. package/dist/menubox/index.d.cts +1 -1
  54. package/dist/menubox/index.d.ts +1 -1
  55. package/dist/picker/index.d.cts +2 -2
  56. package/dist/picker/index.d.ts +2 -2
  57. package/dist/progress/index.d.cts +1 -1
  58. package/dist/progress/index.d.ts +1 -1
  59. package/dist/radio/index.d.cts +1 -1
  60. package/dist/radio/index.d.ts +1 -1
  61. package/dist/refresh-control/index.d.cts +1 -1
  62. package/dist/refresh-control/index.d.ts +1 -1
  63. package/dist/segment-button/index.d.cts +1 -1
  64. package/dist/segment-button/index.d.ts +1 -1
  65. package/dist/select/index.d.cts +1 -1
  66. package/dist/select/index.d.ts +1 -1
  67. package/dist/skeleton/index.d.cts +1 -1
  68. package/dist/skeleton/index.d.ts +1 -1
  69. package/dist/slider/index.d.cts +1 -1
  70. package/dist/slider/index.d.ts +1 -1
  71. package/dist/snackbar/index.d.cts +1 -1
  72. package/dist/snackbar/index.d.ts +1 -1
  73. package/dist/snippet/index.d.cts +1 -1
  74. package/dist/snippet/index.d.ts +1 -1
  75. package/dist/stepper/index.d.cts +1 -1
  76. package/dist/stepper/index.d.ts +1 -1
  77. package/dist/switch/index.d.cts +1 -1
  78. package/dist/switch/index.d.ts +1 -1
  79. package/dist/tabs/index.d.cts +1 -1
  80. package/dist/tabs/index.d.ts +1 -1
  81. package/dist/timepicker/index.d.cts +1 -1
  82. package/dist/timepicker/index.d.ts +1 -1
  83. package/dist/toolbar/index.d.cts +1 -1
  84. package/dist/toolbar/index.d.ts +1 -1
  85. package/dist/typography/index.d.cts +1 -1
  86. package/dist/typography/index.d.ts +1 -1
  87. package/dist/view/index.cjs +302 -134
  88. package/dist/view/index.d.cts +176 -102
  89. package/dist/view/index.d.ts +176 -102
  90. package/dist/view/index.js +371 -203
  91. package/package.json +4 -5
  92. package/dist/index-BOw6tbkc.d.cts +0 -5
  93. package/dist/index-BOw6tbkc.d.ts +0 -5
  94. package/dist/index-DyU3sW3_.d.cts +0 -4
  95. package/dist/index-DyU3sW3_.d.ts +0 -4
@@ -1,6 +1,72 @@
1
1
  import React, { ReactNode, ReactElement, ComponentType } from 'react';
2
- import { StyleProp, ViewStyle, ColorValue, ScrollViewProps } from 'react-native';
3
- import { T as ThemeColor, R as Radius } from '../index-BOw6tbkc.js';
2
+ import { AccessibilityRole, AccessibilityState, StyleProp, ViewStyle, ColorValue, ScrollViewProps } from 'react-native';
3
+ import { EdgeInsets, Alignment, Border, BorderRadius, ShadowConfig, TransformConfig } from '@xaui/core';
4
+ import { ThemeColor, Radius } from '@xaui/core/types';
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>;
4
70
 
5
71
  type MainAxisAlignment = 'start' | 'center' | 'end' | 'space-between' | 'space-around' | 'space-evenly';
6
72
  type CrossAxisAlignment = 'start' | 'center' | 'end' | 'stretch' | 'baseline';
@@ -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
- * Content to render inside the padding container.
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
- right?: number;
159
+ width?: number;
92
160
  /**
93
- * Bottom padding.
161
+ * Height in logical pixels.
94
162
  */
95
- bottom?: number;
163
+ height?: number;
96
164
  /**
97
- * Left padding.
165
+ * Fills all available space — equivalent to Flutter's Expanded (flex: 1, alignSelf: 'stretch').
166
+ * @default false
98
167
  */
99
- left?: number;
168
+ expand?: boolean;
100
169
  /**
101
- * Whether the padding container should take the full width of its parent.
170
+ * Collapses to zero size equivalent to Flutter's SizedBox.shrink().
102
171
  * @default false
103
172
  */
104
- fullWidth?: boolean;
173
+ shrink?: boolean;
105
174
  /**
106
- * If true, the padding container will grow to fill available space.
107
- * @default false
175
+ * Content to render inside the box.
108
176
  */
109
- noGrowth?: boolean;
177
+ children?: ReactNode;
110
178
  /**
111
- * Custom style for the padding container.
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 Padding: React.FC<PaddingProps>;
188
+ declare const SizedBox: React.FC<SizedBoxProps>;
117
189
 
118
- type MarginProps = {
190
+ type BoxConstraints = {
119
191
  /**
120
- * Content to render inside the margin container.
192
+ * Minimum width in logical pixels.
121
193
  */
122
- children: ReactNode;
194
+ minWidth?: number;
123
195
  /**
124
- * Margin on all sides.
196
+ * Maximum width in logical pixels.
125
197
  */
126
- all?: number;
198
+ maxWidth?: number;
127
199
  /**
128
- * Horizontal margin.
200
+ * Minimum height in logical pixels.
129
201
  */
130
- horizontal?: number;
202
+ minHeight?: number;
131
203
  /**
132
- * Vertical margin.
204
+ * Maximum height in logical pixels.
133
205
  */
134
- vertical?: number;
135
- /**
136
- * Top margin.
137
- */
138
- top?: number;
139
- /**
140
- * Right margin.
141
- */
142
- right?: number;
206
+ maxHeight?: number;
207
+ };
208
+ type ConstrainedBoxProps = {
143
209
  /**
144
- * Bottom margin.
210
+ * Size constraints to impose on the child — Flutter BoxConstraints equivalent.
145
211
  */
146
- bottom?: number;
212
+ constraints: BoxConstraints;
147
213
  /**
148
- * Left margin.
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
- fullWidth?: boolean;
216
+ children?: ReactNode;
156
217
  /**
157
- * If true, the margin container will grow to fill available space.
158
- * @default false
218
+ * Style override applied to the underlying View.
159
219
  */
160
- noGrowth?: boolean;
220
+ style?: StyleProp<ViewStyle>;
161
221
  /**
162
- * Custom style for the margin container.
222
+ * Test identifier for e2e tests.
163
223
  */
164
- style?: StyleProp<ViewStyle>;
224
+ testID?: string;
165
225
  };
166
226
 
167
- declare const Margin: React.FC<MarginProps>;
227
+ declare const ConstrainedBox: React.FC<ConstrainedBoxProps>;
168
228
 
169
- type SizedBoxProps = {
229
+ type FractionallySizedBoxProps = {
170
230
  /**
171
- * Content to render inside the box.
231
+ * Fraction of the parent's width (0–1). When undefined, the child chooses its own width.
172
232
  */
173
- children?: ReactNode;
233
+ widthFactor?: number;
174
234
  /**
175
- * Width of the box.
235
+ * Fraction of the parent's height (0–1). When undefined, the child chooses its own height.
176
236
  */
177
- width?: ViewStyle['width'];
237
+ heightFactor?: number;
178
238
  /**
179
- * Height of the box.
239
+ * How to align the child within the remaining space.
240
+ * @default 'topLeft'
180
241
  */
181
- height?: ViewStyle['height'];
242
+ alignment?: Alignment;
182
243
  /**
183
- * Whether the box should take the full width of its parent.
184
- * @default false
244
+ * Content to render inside the box.
185
245
  */
186
- fullWidth?: boolean;
246
+ children?: ReactNode;
187
247
  /**
188
- * Custom style for the box.
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 SizedBox: React.FC<SizedBoxProps>;
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: ReactNode;
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
- * Custom style for the container
376
+ * How to align the child within the container.
313
377
  */
314
- style?: ViewStyle;
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
- * Content to render inside the centered container.
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 };