@xaui/native 0.2.5 → 0.2.7

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.
@@ -4,103 +4,321 @@ import {
4
4
  useXUITheme
5
5
  } from "../chunk-RBSA4NH4.js";
6
6
 
7
- // src/components/view/column/column.tsx
7
+ // src/components/view/container/container.tsx
8
8
  import React from "react";
9
- import { View } from "react-native";
9
+ import { View, Pressable } from "react-native";
10
10
 
11
- // src/components/view/layout-utils.ts
12
- var MAIN_AXIS_JUSTIFY_MAP = {
13
- start: "flex-start",
14
- center: "center",
15
- end: "flex-end",
16
- "space-between": "space-between",
17
- "space-around": "space-around",
18
- "space-evenly": "space-evenly"
11
+ // src/components/view/container/container.utils.ts
12
+ var resolveEdgeInsets = (value, prefix) => {
13
+ if (typeof value === "number") {
14
+ return prefix === "padding" ? { padding: value } : { margin: value };
15
+ }
16
+ const style = {};
17
+ if (prefix === "padding") {
18
+ if (value.horizontal !== void 0) style.paddingHorizontal = value.horizontal;
19
+ if (value.vertical !== void 0) style.paddingVertical = value.vertical;
20
+ if (value.top !== void 0) style.paddingTop = value.top;
21
+ if (value.bottom !== void 0) style.paddingBottom = value.bottom;
22
+ if (value.left !== void 0) style.paddingLeft = value.left;
23
+ if (value.right !== void 0) style.paddingRight = value.right;
24
+ } else {
25
+ if (value.horizontal !== void 0) style.marginHorizontal = value.horizontal;
26
+ if (value.vertical !== void 0) style.marginVertical = value.vertical;
27
+ if (value.top !== void 0) style.marginTop = value.top;
28
+ if (value.bottom !== void 0) style.marginBottom = value.bottom;
29
+ if (value.left !== void 0) style.marginLeft = value.left;
30
+ if (value.right !== void 0) style.marginRight = value.right;
31
+ }
32
+ return style;
19
33
  };
20
- var CROSS_AXIS_ALIGN_MAP = {
21
- start: "flex-start",
22
- center: "center",
23
- end: "flex-end",
24
- stretch: "stretch",
25
- baseline: "baseline"
34
+ var ALIGNMENT_MAP = {
35
+ topLeft: { justifyContent: "flex-start", alignItems: "flex-start" },
36
+ topCenter: { justifyContent: "flex-start", alignItems: "center" },
37
+ topRight: { justifyContent: "flex-start", alignItems: "flex-end" },
38
+ centerLeft: { justifyContent: "center", alignItems: "flex-start" },
39
+ center: { justifyContent: "center", alignItems: "center" },
40
+ centerRight: { justifyContent: "center", alignItems: "flex-end" },
41
+ bottomLeft: { justifyContent: "flex-end", alignItems: "flex-start" },
42
+ bottomCenter: { justifyContent: "flex-end", alignItems: "center" },
43
+ bottomRight: { justifyContent: "flex-end", alignItems: "flex-end" }
26
44
  };
27
- var resolveMainAxisAlignment = (alignment) => {
28
- return MAIN_AXIS_JUSTIFY_MAP[alignment ?? "start"];
45
+ var toFlexPosition = (v) => {
46
+ if (v <= 0) return "flex-start";
47
+ if (v >= 1) return "flex-end";
48
+ return "center";
29
49
  };
30
- var resolveCrossAxisAlignment = (alignment) => {
31
- return CROSS_AXIS_ALIGN_MAP[alignment ?? "center"];
50
+ var resolveAlignment = (value) => {
51
+ if (typeof value === "object") {
52
+ return {
53
+ justifyContent: toFlexPosition(value.y),
54
+ alignItems: toFlexPosition(value.x)
55
+ };
56
+ }
57
+ return ALIGNMENT_MAP[value] ?? {
58
+ justifyContent: "flex-start",
59
+ alignItems: "flex-start"
60
+ };
61
+ };
62
+ var resolveBorderRadius = (value) => {
63
+ if (typeof value === "number") {
64
+ return { borderRadius: value };
65
+ }
66
+ const style = {};
67
+ if (value.topLeft !== void 0) style.borderTopLeftRadius = value.topLeft;
68
+ if (value.topRight !== void 0) style.borderTopRightRadius = value.topRight;
69
+ if (value.bottomLeft !== void 0) style.borderBottomLeftRadius = value.bottomLeft;
70
+ if (value.bottomRight !== void 0)
71
+ style.borderBottomRightRadius = value.bottomRight;
72
+ return style;
73
+ };
74
+ var resolveBorderSide = (side, position) => {
75
+ const style = {};
76
+ if (position === "") {
77
+ if (side.width !== void 0) style.borderWidth = side.width;
78
+ if (side.color !== void 0) style.borderColor = side.color;
79
+ if (side.style !== void 0) style.borderStyle = side.style;
80
+ return style;
81
+ }
82
+ if (position === "Top") {
83
+ if (side.width !== void 0) style.borderTopWidth = side.width;
84
+ if (side.color !== void 0) style.borderTopColor = side.color;
85
+ } else if (position === "Bottom") {
86
+ if (side.width !== void 0) style.borderBottomWidth = side.width;
87
+ if (side.color !== void 0) style.borderBottomColor = side.color;
88
+ } else if (position === "Left") {
89
+ if (side.width !== void 0) style.borderLeftWidth = side.width;
90
+ if (side.color !== void 0) style.borderLeftColor = side.color;
91
+ } else {
92
+ if (side.width !== void 0) style.borderRightWidth = side.width;
93
+ if (side.color !== void 0) style.borderRightColor = side.color;
94
+ }
95
+ return style;
96
+ };
97
+ var resolveBorder = (value) => {
98
+ const dir = value;
99
+ if (dir.top !== void 0 || dir.bottom !== void 0 || dir.left !== void 0 || dir.right !== void 0) {
100
+ return {
101
+ ...dir.top ? resolveBorderSide(dir.top, "Top") : {},
102
+ ...dir.bottom ? resolveBorderSide(dir.bottom, "Bottom") : {},
103
+ ...dir.left ? resolveBorderSide(dir.left, "Left") : {},
104
+ ...dir.right ? resolveBorderSide(dir.right, "Right") : {}
105
+ };
106
+ }
107
+ return resolveBorderSide(value, "");
108
+ };
109
+ var resolveShadow = (value) => ({
110
+ shadowColor: value.color ?? "#000000",
111
+ shadowOffset: {
112
+ width: value.offset?.x ?? 0,
113
+ height: value.offset?.y ?? 4
114
+ },
115
+ shadowOpacity: value.opacity ?? 0.1,
116
+ shadowRadius: value.blur ?? 4,
117
+ elevation: value.elevation ?? 2
118
+ });
119
+ var resolveTransform = (value) => {
120
+ const transforms = [];
121
+ if (value.rotate !== void 0) transforms.push({ rotate: value.rotate });
122
+ if (value.rotateX !== void 0) transforms.push({ rotateX: value.rotateX });
123
+ if (value.rotateY !== void 0) transforms.push({ rotateY: value.rotateY });
124
+ if (value.scale !== void 0) transforms.push({ scale: value.scale });
125
+ if (value.scaleX !== void 0) transforms.push({ scaleX: value.scaleX });
126
+ if (value.scaleY !== void 0) transforms.push({ scaleY: value.scaleY });
127
+ if (value.translateX !== void 0)
128
+ transforms.push({ translateX: value.translateX });
129
+ if (value.translateY !== void 0)
130
+ transforms.push({ translateY: value.translateY });
131
+ if (value.skewX !== void 0) transforms.push({ skewX: value.skewX });
132
+ if (value.skewY !== void 0) transforms.push({ skewY: value.skewY });
133
+ return transforms;
32
134
  };
33
135
 
34
- // src/components/view/column/column.tsx
35
- var Column = ({
36
- children,
37
- mainAxisAlignment,
38
- crossAxisAlignment,
39
- spacing,
40
- reverse = false,
41
- fullWidth,
42
- style,
43
- noGrowth = false
44
- }) => {
45
- const gapStyle = spacing === void 0 ? void 0 : { gap: spacing };
46
- const fullWidthStyle = fullWidth ? { width: "100%" } : void 0;
136
+ // src/components/view/container/container.tsx
137
+ var buildStyle = (props) => ({
138
+ ...props.width !== void 0 && { width: props.width },
139
+ ...props.height !== void 0 && { height: props.height },
140
+ ...props.minWidth !== void 0 && { minWidth: props.minWidth },
141
+ ...props.maxWidth !== void 0 && { maxWidth: props.maxWidth },
142
+ ...props.minHeight !== void 0 && { minHeight: props.minHeight },
143
+ ...props.maxHeight !== void 0 && { maxHeight: props.maxHeight },
144
+ ...props.aspectRatio !== void 0 && { aspectRatio: props.aspectRatio },
145
+ ...props.flex !== void 0 && { flex: props.flex },
146
+ ...props.color !== void 0 && { backgroundColor: props.color },
147
+ ...props.clip && { overflow: "hidden" },
148
+ ...props.opacity !== void 0 && { opacity: props.opacity },
149
+ ...props.padding !== void 0 && resolveEdgeInsets(props.padding, "padding"),
150
+ ...props.margin !== void 0 && resolveEdgeInsets(props.margin, "margin"),
151
+ ...props.alignment !== void 0 && resolveAlignment(props.alignment),
152
+ ...props.borderRadius !== void 0 && resolveBorderRadius(props.borderRadius),
153
+ ...props.border !== void 0 && resolveBorder(props.border),
154
+ ...props.shadow !== void 0 && resolveShadow(props.shadow),
155
+ ...props.transform !== void 0 && {
156
+ transform: resolveTransform(props.transform)
157
+ }
158
+ });
159
+ var Container = (props) => {
160
+ const {
161
+ children,
162
+ onPress,
163
+ onLongPress,
164
+ onPressIn,
165
+ onPressOut,
166
+ disabled = false,
167
+ accessibilityLabel,
168
+ accessibilityRole,
169
+ accessibilityState,
170
+ accessible,
171
+ testID,
172
+ style
173
+ } = props;
174
+ const containerStyle = buildStyle(props);
175
+ const isInteractive = !!(onPress ?? onLongPress ?? onPressIn ?? onPressOut);
176
+ if (isInteractive) {
177
+ return /* @__PURE__ */ React.createElement(
178
+ Pressable,
179
+ {
180
+ onPress: disabled ? void 0 : onPress,
181
+ onLongPress: disabled ? void 0 : onLongPress,
182
+ onPressIn: disabled ? void 0 : onPressIn,
183
+ onPressOut: disabled ? void 0 : onPressOut,
184
+ disabled,
185
+ accessibilityLabel,
186
+ accessibilityRole,
187
+ accessibilityState,
188
+ accessible,
189
+ testID,
190
+ style: [containerStyle, style]
191
+ },
192
+ children
193
+ );
194
+ }
47
195
  return /* @__PURE__ */ React.createElement(
48
196
  View,
49
197
  {
50
- style: [
51
- {
52
- flex: noGrowth ? void 0 : 1,
53
- flexDirection: reverse ? "column-reverse" : "column",
54
- justifyContent: resolveMainAxisAlignment(mainAxisAlignment),
55
- alignItems: resolveCrossAxisAlignment(crossAxisAlignment)
56
- },
57
- fullWidthStyle,
58
- gapStyle,
59
- style
60
- ]
198
+ accessibilityLabel,
199
+ accessibilityRole,
200
+ accessibilityState,
201
+ accessible,
202
+ testID,
203
+ style: [containerStyle, style]
61
204
  },
62
205
  children
63
206
  );
64
207
  };
208
+ Container.displayName = "Container";
65
209
 
66
- // src/components/view/row/row.tsx
210
+ // src/components/view/flex/flex.tsx
67
211
  import React2 from "react";
68
212
  import { View as View2 } from "react-native";
69
- var Row = ({
213
+
214
+ // src/components/view/layout-utils.ts
215
+ var MAIN_AXIS_JUSTIFY_MAP = {
216
+ start: "flex-start",
217
+ center: "center",
218
+ end: "flex-end",
219
+ spaceBetween: "space-between",
220
+ spaceAround: "space-around",
221
+ spaceEvenly: "space-evenly"
222
+ };
223
+ var CROSS_AXIS_ALIGN_MAP = {
224
+ start: "flex-start",
225
+ center: "center",
226
+ end: "flex-end",
227
+ stretch: "stretch"
228
+ };
229
+ var resolveMainAxisAlignment = (alignment) => MAIN_AXIS_JUSTIFY_MAP[alignment ?? "start"];
230
+ var resolveCrossAxisAlignment = (alignment) => CROSS_AXIS_ALIGN_MAP[alignment ?? "center"];
231
+ var resolveMainAxisSize = (size = "max", direction) => {
232
+ if (size === "min") return {};
233
+ return direction === "vertical" ? { flex: 1 } : { width: "100%" };
234
+ };
235
+
236
+ // src/components/view/flex/flex.tsx
237
+ var Flex = ({
70
238
  children,
239
+ direction,
71
240
  mainAxisAlignment,
72
241
  crossAxisAlignment,
73
- spacing,
74
- reverse = false,
75
- fullWidth,
76
- style
242
+ mainAxisSize,
243
+ wrap = false,
244
+ gap,
245
+ reversed = false,
246
+ flex,
247
+ style,
248
+ testID
77
249
  }) => {
78
- const gapStyle = spacing === void 0 ? void 0 : { gap: spacing };
79
- const fullWidthStyle = fullWidth ? { flexShrink: 1, flexBasis: "auto", width: "100%" } : void 0;
250
+ const flexDir = direction === "horizontal" ? reversed ? "row-reverse" : "row" : reversed ? "column-reverse" : "column";
80
251
  return /* @__PURE__ */ React2.createElement(
81
252
  View2,
82
253
  {
254
+ testID,
83
255
  style: [
256
+ resolveMainAxisSize(mainAxisSize, direction),
84
257
  {
85
- flexDirection: reverse ? "row-reverse" : "row",
258
+ flexDirection: flexDir,
86
259
  justifyContent: resolveMainAxisAlignment(mainAxisAlignment),
87
- alignItems: resolveCrossAxisAlignment(crossAxisAlignment)
260
+ alignItems: resolveCrossAxisAlignment(crossAxisAlignment),
261
+ flexWrap: wrap ? "wrap" : "nowrap",
262
+ ...gap !== void 0 && { gap },
263
+ ...flex !== void 0 && { flex }
88
264
  },
89
- fullWidthStyle,
90
- gapStyle,
91
265
  style
92
266
  ]
93
267
  },
94
268
  children
95
269
  );
96
270
  };
271
+ Flex.displayName = "Flex";
97
272
 
98
- // src/components/view/spacer/spacer.tsx
273
+ // src/components/view/column/column.tsx
99
274
  import React3 from "react";
275
+ var Column = (props) => /* @__PURE__ */ React3.createElement(Flex, { ...props, direction: "vertical" });
276
+ Column.displayName = "Column";
277
+
278
+ // src/components/view/row/row.tsx
279
+ import React4 from "react";
280
+ var Row = (props) => /* @__PURE__ */ React4.createElement(Flex, { ...props, direction: "horizontal" });
281
+ Row.displayName = "Row";
282
+
283
+ // src/components/view/expanded/expanded.tsx
284
+ import React5 from "react";
100
285
  import { View as View3 } from "react-native";
286
+ var Expanded = ({
287
+ children,
288
+ flex = 1,
289
+ style,
290
+ testID
291
+ }) => /* @__PURE__ */ React5.createElement(View3, { testID, style: [{ flex }, style] }, children);
292
+ Expanded.displayName = "Expanded";
293
+
294
+ // src/components/view/flexible/flexible.tsx
295
+ import React6 from "react";
296
+ import { View as View4 } from "react-native";
297
+ var Flexible = ({
298
+ children,
299
+ flex = 1,
300
+ fit = "loose",
301
+ style,
302
+ testID
303
+ }) => /* @__PURE__ */ React6.createElement(
304
+ View4,
305
+ {
306
+ testID,
307
+ style: [
308
+ fit === "tight" ? { flex } : { flexGrow: flex, flexShrink: 1, flexBasis: "auto" },
309
+ style
310
+ ]
311
+ },
312
+ children
313
+ );
314
+ Flexible.displayName = "Flexible";
315
+
316
+ // src/components/view/spacer/spacer.tsx
317
+ import React7 from "react";
318
+ import { View as View5 } from "react-native";
101
319
  var Spacer = ({ flex = 1, style }) => {
102
- return /* @__PURE__ */ React3.createElement(
103
- View3,
320
+ return /* @__PURE__ */ React7.createElement(
321
+ View5,
104
322
  {
105
323
  style: [
106
324
  {
@@ -115,117 +333,128 @@ var Spacer = ({ flex = 1, style }) => {
115
333
  };
116
334
  Spacer.displayName = "Spacer";
117
335
 
118
- // src/components/view/padding/padding.tsx
119
- import React4 from "react";
120
- import { View as View4 } from "react-native";
121
- var Padding = ({
336
+ // src/components/view/wrap/wrap.tsx
337
+ import React8 from "react";
338
+ import { View as View6 } from "react-native";
339
+ var Wrap = ({
122
340
  children,
123
- all,
124
- horizontal,
125
- vertical,
126
- top,
127
- right,
128
- bottom,
129
- left,
130
- fullWidth,
341
+ direction = "horizontal",
342
+ alignment,
343
+ runAlignment,
344
+ spacing = 0,
345
+ runSpacing = 0,
131
346
  style,
132
- noGrowth = false
133
- }) => {
134
- const fullWidthStyle = fullWidth ? { width: "100%" } : void 0;
135
- return /* @__PURE__ */ React4.createElement(
136
- View4,
137
- {
138
- style: [
139
- {
140
- flex: noGrowth ? void 0 : 1,
141
- padding: all,
142
- paddingHorizontal: horizontal,
143
- paddingVertical: vertical,
144
- paddingTop: top,
145
- paddingRight: right,
146
- paddingBottom: bottom,
147
- paddingLeft: left
148
- },
149
- fullWidthStyle,
150
- style
151
- ]
152
- },
153
- children
154
- );
155
- };
347
+ testID
348
+ }) => /* @__PURE__ */ React8.createElement(
349
+ View6,
350
+ {
351
+ testID,
352
+ style: [
353
+ {
354
+ flexDirection: direction === "horizontal" ? "row" : "column",
355
+ flexWrap: "wrap",
356
+ justifyContent: resolveMainAxisAlignment(alignment),
357
+ alignContent: resolveMainAxisAlignment(runAlignment),
358
+ gap: spacing,
359
+ rowGap: direction === "horizontal" ? runSpacing : spacing,
360
+ columnGap: direction === "horizontal" ? spacing : runSpacing
361
+ },
362
+ style
363
+ ]
364
+ },
365
+ children
366
+ );
367
+ Wrap.displayName = "Wrap";
368
+
369
+ // src/components/view/padding/padding.tsx
370
+ import React9 from "react";
371
+ import { View as View7 } from "react-native";
372
+ var Padding = ({ children, padding, style }) => /* @__PURE__ */ React9.createElement(View7, { style: [resolveEdgeInsets(padding, "padding"), style] }, children);
156
373
  Padding.displayName = "Padding";
157
374
 
158
375
  // src/components/view/margin/margin.tsx
159
- import React5 from "react";
160
- import { View as View5 } from "react-native";
161
- var Margin = ({
162
- children,
163
- all,
164
- horizontal,
165
- vertical,
166
- top,
167
- right,
168
- bottom,
169
- left,
170
- fullWidth,
171
- style,
172
- noGrowth = false
173
- }) => {
174
- const fullWidthStyle = fullWidth ? { width: "100%" } : void 0;
175
- return /* @__PURE__ */ React5.createElement(
176
- View5,
177
- {
178
- style: [
179
- {
180
- flex: noGrowth ? void 0 : 1,
181
- margin: all,
182
- marginHorizontal: horizontal,
183
- marginVertical: vertical,
184
- marginTop: top,
185
- marginRight: right,
186
- marginBottom: bottom,
187
- marginLeft: left
188
- },
189
- fullWidthStyle,
190
- style
191
- ]
192
- },
193
- children
194
- );
195
- };
376
+ import React10 from "react";
377
+ import { View as View8 } from "react-native";
378
+ var Margin = ({ children, margin, style }) => /* @__PURE__ */ React10.createElement(View8, { style: [resolveEdgeInsets(margin, "margin"), style] }, children);
196
379
  Margin.displayName = "Margin";
197
380
 
198
381
  // src/components/view/sized-box/sized-box.tsx
199
- import React6 from "react";
200
- import { View as View6 } from "react-native";
382
+ import React11 from "react";
383
+ import { View as View9 } from "react-native";
201
384
  var SizedBox = ({
202
385
  children,
203
386
  width,
204
387
  height,
205
- fullWidth,
206
- style
388
+ expand,
389
+ shrink,
390
+ style,
391
+ testID
207
392
  }) => {
208
- const fullWidthStyle = fullWidth ? { width: "100%" } : void 0;
209
- return /* @__PURE__ */ React6.createElement(
210
- View6,
211
- {
212
- style: [
213
- {
214
- width,
215
- height
216
- },
217
- fullWidthStyle,
218
- style
219
- ]
220
- },
221
- children
222
- );
393
+ if (shrink) {
394
+ return /* @__PURE__ */ React11.createElement(
395
+ View9,
396
+ {
397
+ testID,
398
+ style: [{ width: 0, height: 0, overflow: "hidden" }, style]
399
+ },
400
+ children
401
+ );
402
+ }
403
+ if (expand) {
404
+ return /* @__PURE__ */ React11.createElement(View9, { testID, style: [{ flex: 1, alignSelf: "stretch" }, style] }, children);
405
+ }
406
+ return /* @__PURE__ */ React11.createElement(View9, { testID, style: [{ width, height }, style] }, children);
223
407
  };
224
408
  SizedBox.displayName = "SizedBox";
225
409
 
410
+ // src/components/view/constrained-box/constrained-box.tsx
411
+ import React12 from "react";
412
+ import { View as View10 } from "react-native";
413
+ var ConstrainedBox = ({
414
+ children,
415
+ constraints,
416
+ style,
417
+ testID
418
+ }) => /* @__PURE__ */ React12.createElement(
419
+ View10,
420
+ {
421
+ testID,
422
+ style: [
423
+ {
424
+ minWidth: constraints.minWidth,
425
+ maxWidth: constraints.maxWidth,
426
+ minHeight: constraints.minHeight,
427
+ maxHeight: constraints.maxHeight
428
+ },
429
+ style
430
+ ]
431
+ },
432
+ children
433
+ );
434
+ ConstrainedBox.displayName = "ConstrainedBox";
435
+
436
+ // src/components/view/fractionally-sized-box/fractionally-sized-box.tsx
437
+ import React13 from "react";
438
+ import { View as View11 } from "react-native";
439
+ var FractionallySizedBox = ({
440
+ children,
441
+ widthFactor,
442
+ heightFactor,
443
+ alignment,
444
+ style,
445
+ testID
446
+ }) => {
447
+ const sizedStyle = {};
448
+ if (widthFactor !== void 0) sizedStyle.width = `${widthFactor * 100}%`;
449
+ if (heightFactor !== void 0) sizedStyle.height = `${heightFactor * 100}%`;
450
+ const alignStyle = alignment ? resolveAlignment(alignment) : {};
451
+ return /* @__PURE__ */ React13.createElement(View11, { testID, style: [sizedStyle, alignStyle, style] }, children);
452
+ };
453
+ FractionallySizedBox.displayName = "FractionallySizedBox";
454
+
226
455
  // src/components/view/positioned-view/positioned-view.tsx
227
- import React7 from "react";
228
- import { View as View7 } from "react-native";
456
+ import React14 from "react";
457
+ import { View as View12 } from "react-native";
229
458
  var PositionedView = ({
230
459
  children,
231
460
  top,
@@ -235,8 +464,8 @@ var PositionedView = ({
235
464
  zIndex,
236
465
  style
237
466
  }) => {
238
- return /* @__PURE__ */ React7.createElement(
239
- View7,
467
+ return /* @__PURE__ */ React14.createElement(
468
+ View12,
240
469
  {
241
470
  style: [
242
471
  {
@@ -256,8 +485,8 @@ var PositionedView = ({
256
485
  PositionedView.displayName = "PositionedView";
257
486
 
258
487
  // src/components/view/blur-view/blur-view.tsx
259
- import React8, { useEffect, useRef } from "react";
260
- import { Animated, StyleSheet, View as View8 } from "react-native";
488
+ import React15, { useEffect, useRef } from "react";
489
+ import { Animated, StyleSheet, View as View13 } from "react-native";
261
490
  var styles = StyleSheet.create({
262
491
  container: {
263
492
  position: "relative"
@@ -297,20 +526,20 @@ var BlurView = ({
297
526
  overlayAnim.setValue(overlayOpacity);
298
527
  scaleAnim.setValue(0.98);
299
528
  }, [overlayAnim, overlayOpacity, scaleAnim, unlockable]);
300
- return /* @__PURE__ */ React8.createElement(View8, { style: [styles.container, style] }, /* @__PURE__ */ React8.createElement(Animated.View, { style: { transform: [{ scale: scaleAnim }] } }, children), /* @__PURE__ */ React8.createElement(
529
+ return /* @__PURE__ */ React15.createElement(View13, { style: [styles.container, style] }, /* @__PURE__ */ React15.createElement(Animated.View, { style: { transform: [{ scale: scaleAnim }] } }, children), /* @__PURE__ */ React15.createElement(
301
530
  Animated.View,
302
531
  {
303
532
  pointerEvents: unlockable ? "none" : "auto",
304
533
  style: [styles.overlay, { opacity: overlayAnim }]
305
534
  },
306
- /* @__PURE__ */ React8.createElement(View8, { style: [styles.overlay, { backgroundColor: overlayColor }] })
535
+ /* @__PURE__ */ React15.createElement(View13, { style: [styles.overlay, { backgroundColor: overlayColor }] })
307
536
  ));
308
537
  };
309
538
  BlurView.displayName = "BlurView";
310
539
 
311
540
  // src/components/view/rounded-view/rounded-view.tsx
312
- import React9 from "react";
313
- import { View as View9 } from "react-native";
541
+ import React16 from "react";
542
+ import { View as View14 } from "react-native";
314
543
 
315
544
  // src/components/view/rounded-view/rounded-view.hook.ts
316
545
  import { useMemo } from "react";
@@ -364,8 +593,8 @@ var RoundedView = ({
364
593
  bottomLeft,
365
594
  bottomRight
366
595
  });
367
- return /* @__PURE__ */ React9.createElement(
368
- View9,
596
+ return /* @__PURE__ */ React16.createElement(
597
+ View14,
369
598
  {
370
599
  style: [
371
600
  borderRadiusStyle,
@@ -380,19 +609,38 @@ var RoundedView = ({
380
609
  };
381
610
 
382
611
  // src/components/view/aspect-ratio/aspect-ratio.tsx
383
- import React10 from "react";
384
- import { View as View10 } from "react-native";
612
+ import React17 from "react";
613
+ import { View as View15 } from "react-native";
385
614
  var AspectRatio = ({
386
615
  children,
387
616
  ratio,
388
- style
617
+ alignment,
618
+ clip,
619
+ style,
620
+ testID
389
621
  }) => {
390
- return /* @__PURE__ */ React10.createElement(View10, { style: [{ aspectRatio: ratio }, style] }, children);
622
+ const alignStyle = alignment ? resolveAlignment(alignment) : {};
623
+ return /* @__PURE__ */ React17.createElement(
624
+ View15,
625
+ {
626
+ testID,
627
+ style: [
628
+ {
629
+ aspectRatio: ratio,
630
+ overflow: clip ? "hidden" : "visible"
631
+ },
632
+ alignStyle,
633
+ style
634
+ ]
635
+ },
636
+ children
637
+ );
391
638
  };
639
+ AspectRatio.displayName = "AspectRatio";
392
640
 
393
641
  // src/components/view/surface/surface.tsx
394
- import React11 from "react";
395
- import { View as View11 } from "react-native";
642
+ import React18 from "react";
643
+ import { View as View16 } from "react-native";
396
644
  import { getSafeThemeColor } from "@xaui/core";
397
645
  var resolveBackgroundColor = (color, theme) => {
398
646
  if (color === "background" || color === "foreground") {
@@ -412,8 +660,8 @@ var Surface = ({
412
660
  const theme = useXUITheme();
413
661
  const radiusStyle = useBorderRadiusStyles(radius);
414
662
  const background = resolveBackgroundColor(themeColor, theme);
415
- return /* @__PURE__ */ React11.createElement(
416
- View11,
663
+ return /* @__PURE__ */ React18.createElement(
664
+ View16,
417
665
  {
418
666
  style: [
419
667
  radiusStyle,
@@ -431,8 +679,8 @@ var Surface = ({
431
679
  Surface.displayName = "Surface";
432
680
 
433
681
  // src/components/view/screen/screen.tsx
434
- import React12 from "react";
435
- import { View as View12 } from "react-native";
682
+ import React19 from "react";
683
+ import { View as View17 } from "react-native";
436
684
  import { SafeAreaView } from "react-native-safe-area-context";
437
685
  var Screen = ({
438
686
  children,
@@ -443,53 +691,39 @@ var Screen = ({
443
691
  }) => {
444
692
  const theme = useXUITheme();
445
693
  const resolvedBackgroundColor = backgroundColor ?? theme.colors.background;
446
- const containerStyle = [{ flex: 1, backgroundColor: resolvedBackgroundColor, padding }, style];
694
+ const containerStyle = [
695
+ { flex: 1, backgroundColor: resolvedBackgroundColor, padding },
696
+ style
697
+ ];
447
698
  if (safeArea) {
448
- return /* @__PURE__ */ React12.createElement(SafeAreaView, { style: containerStyle }, children);
699
+ return /* @__PURE__ */ React19.createElement(SafeAreaView, { style: containerStyle }, children);
449
700
  }
450
- return /* @__PURE__ */ React12.createElement(View12, { style: containerStyle }, children);
701
+ return /* @__PURE__ */ React19.createElement(View17, { style: containerStyle }, children);
451
702
  };
452
703
  Screen.displayName = "Screen";
453
704
 
705
+ // src/components/view/align/align.tsx
706
+ import React20 from "react";
707
+ import { View as View18 } from "react-native";
708
+ var Align = ({ children, alignment, style }) => /* @__PURE__ */ React20.createElement(View18, { style: [{ flex: 1 }, resolveAlignment(alignment), style] }, children);
709
+ Align.displayName = "Align";
710
+
454
711
  // src/components/view/center/center.tsx
455
- import React13 from "react";
456
- import { View as View13 } from "react-native";
457
- var Center = ({
458
- children,
459
- fullWidth,
460
- style,
461
- noGrowth = false
462
- }) => {
463
- const fullWidthStyle = fullWidth ? { width: "100%" } : void 0;
464
- return /* @__PURE__ */ React13.createElement(
465
- View13,
466
- {
467
- style: [
468
- {
469
- flex: noGrowth ? void 0 : 1,
470
- alignItems: "center",
471
- justifyContent: "center"
472
- },
473
- fullWidthStyle,
474
- style
475
- ]
476
- },
477
- children
478
- );
479
- };
712
+ import React21 from "react";
713
+ var Center = ({ children, style }) => /* @__PURE__ */ React21.createElement(Align, { alignment: "center", style }, children);
480
714
  Center.displayName = "Center";
481
715
 
482
716
  // src/components/view/grid/grid.tsx
483
- import React15, { useMemo as useMemo2, useState } from "react";
717
+ import React23, { useMemo as useMemo2, useState } from "react";
484
718
  import {
485
- View as View15
719
+ View as View20
486
720
  } from "react-native";
487
721
 
488
722
  // src/components/view/grid/grid-item.tsx
489
- import React14 from "react";
490
- import { View as View14 } from "react-native";
723
+ import React22 from "react";
724
+ import { View as View19 } from "react-native";
491
725
  var GridItem = ({ children, style }) => {
492
- return /* @__PURE__ */ React14.createElement(View14, { style }, children);
726
+ return /* @__PURE__ */ React22.createElement(View19, { style }, children);
493
727
  };
494
728
  GridItem.displayName = "GridItem";
495
729
 
@@ -503,7 +737,7 @@ var getSafeSpan = (span, columns) => {
503
737
  return Math.min(Math.floor(span), columns);
504
738
  };
505
739
  var isGridItemElement = (child) => {
506
- if (!React15.isValidElement(child)) return false;
740
+ if (!React23.isValidElement(child)) return false;
507
741
  if (child.type === GridItem) return true;
508
742
  const displayName = child.type.displayName;
509
743
  return displayName === "GridItem";
@@ -522,15 +756,15 @@ var Grid = ({
522
756
  const resolvedRowSpacing = rowSpacing ?? spacing ?? 0;
523
757
  const resolvedColumnSpacing = columnSpacing ?? spacing ?? 0;
524
758
  const itemWidth = `${100 / safeColumns}%`;
525
- const items = React15.Children.toArray(children);
759
+ const items = React23.Children.toArray(children);
526
760
  const totalColumnGap = resolvedColumnSpacing * (safeColumns - 1);
527
761
  const baseItemWidth = useMemo2(() => {
528
762
  if (!containerWidth) return void 0;
529
763
  return (containerWidth - totalColumnGap) / safeColumns;
530
764
  }, [containerWidth, safeColumns, totalColumnGap]);
531
765
  let currentColumn = 0;
532
- return /* @__PURE__ */ React15.createElement(
533
- View15,
766
+ return /* @__PURE__ */ React23.createElement(
767
+ View20,
534
768
  {
535
769
  style: [
536
770
  {
@@ -547,7 +781,7 @@ var Grid = ({
547
781
  }
548
782
  },
549
783
  items.map((child, index) => {
550
- const key = React15.isValidElement(child) && child.key ? child.key : `grid-${index}`;
784
+ const key = React23.isValidElement(child) && child.key ? child.key : `grid-${index}`;
551
785
  const span = isGridItemElement(child) ? getSafeSpan(child.props.span, safeColumns) : 1;
552
786
  const spanWidth = baseItemWidth === void 0 ? `${100 / safeColumns * span}%` : baseItemWidth * span + resolvedColumnSpacing * (span - 1);
553
787
  if (currentColumn + span > safeColumns) {
@@ -567,7 +801,7 @@ var Grid = ({
567
801
  itemStyle,
568
802
  child.props.style
569
803
  ];
570
- const element2 = React15.cloneElement(child, {
804
+ const element2 = React23.cloneElement(child, {
571
805
  key,
572
806
  style: mergedStyle
573
807
  });
@@ -575,8 +809,8 @@ var Grid = ({
575
809
  return element2;
576
810
  }
577
811
  const defaultItemWidth = baseItemWidth === void 0 ? itemWidth : baseItemWidth;
578
- const element = /* @__PURE__ */ React15.createElement(
579
- View15,
812
+ const element = /* @__PURE__ */ React23.createElement(
813
+ View20,
580
814
  {
581
815
  key,
582
816
  style: [
@@ -599,11 +833,11 @@ var Grid = ({
599
833
  };
600
834
 
601
835
  // src/components/view/grid/grid-builder.tsx
602
- import React16, { useMemo as useMemo3 } from "react";
836
+ import React24, { useMemo as useMemo3 } from "react";
603
837
  import {
604
838
  FlatList,
605
839
  StyleSheet as StyleSheet2,
606
- View as View16
840
+ View as View21
607
841
  } from "react-native";
608
842
  var getSafeColumns2 = (columns) => {
609
843
  if (!columns || columns <= 0) return 1;
@@ -690,7 +924,7 @@ var GridBuilder = ({
690
924
  },
691
925
  itemStyle
692
926
  ];
693
- return /* @__PURE__ */ React16.createElement(View16, { style: placeholderStyle, pointerEvents: "none" });
927
+ return /* @__PURE__ */ React24.createElement(View21, { style: placeholderStyle, pointerEvents: "none" });
694
928
  }
695
929
  const element = resolvedRenderer({ item: item.item, index: item.index });
696
930
  if (element === null) return null;
@@ -706,7 +940,7 @@ var GridBuilder = ({
706
940
  },
707
941
  itemStyle
708
942
  ];
709
- return /* @__PURE__ */ React16.createElement(View16, { style: wrapperStyle }, element);
943
+ return /* @__PURE__ */ React24.createElement(View21, { style: wrapperStyle }, element);
710
944
  };
711
945
  const flattenedStyle = StyleSheet2.flatten(style) ?? {};
712
946
  const {
@@ -727,7 +961,7 @@ var GridBuilder = ({
727
961
  ...columnGap !== void 0 ? { columnGap } : {}
728
962
  };
729
963
  const hasLayoutStyle = Object.keys(layoutStyle).length > 0;
730
- return /* @__PURE__ */ React16.createElement(
964
+ return /* @__PURE__ */ React24.createElement(
731
965
  FlatList,
732
966
  {
733
967
  data: paddedData,
@@ -747,7 +981,7 @@ var GridBuilder = ({
747
981
  GridBuilder.displayName = "GridBuilder";
748
982
 
749
983
  // src/components/view/conditional/conditional-view.tsx
750
- import React17, { useEffect as useEffect2, useMemo as useMemo4, useRef as useRef2, useState as useState2 } from "react";
984
+ import React25, { useEffect as useEffect2, useMemo as useMemo4, useRef as useRef2, useState as useState2 } from "react";
751
985
  import { Animated as Animated3 } from "react-native";
752
986
 
753
987
  // src/components/view/conditional/conditional-view.utils.ts
@@ -899,18 +1133,18 @@ var ConditionalView = ({
899
1133
  if (!shouldRender) {
900
1134
  return null;
901
1135
  }
902
- return /* @__PURE__ */ React17.createElement(Animated3.View, { style: animatedStyle }, children);
1136
+ return /* @__PURE__ */ React25.createElement(Animated3.View, { style: animatedStyle }, children);
903
1137
  };
904
1138
 
905
1139
  // src/components/view/masonry-grid/masonry-grid.tsx
906
- import React18, { useMemo as useMemo5, useRef as useRef3, useState as useState3 } from "react";
907
- import { View as View17 } from "react-native";
1140
+ import React26, { useMemo as useMemo5, useRef as useRef3, useState as useState3 } from "react";
1141
+ import { View as View22 } from "react-native";
908
1142
  var getSafeColumns3 = (columns) => {
909
1143
  if (!columns || columns <= 0) return 1;
910
1144
  return Math.floor(columns);
911
1145
  };
912
1146
  var getItemKey = (child, index) => {
913
- return React18.isValidElement(child) && child.key ? String(child.key) : `masonry-${index}`;
1147
+ return React26.isValidElement(child) && child.key ? String(child.key) : `masonry-${index}`;
914
1148
  };
915
1149
  var MasonryGrid = ({
916
1150
  children,
@@ -933,7 +1167,7 @@ var MasonryGrid = ({
933
1167
  return (containerWidth - totalColumnGap) / safeColumns;
934
1168
  }, [containerWidth, safeColumns, totalColumnGap]);
935
1169
  const items = useMemo5(
936
- () => React18.Children.toArray(children).map((child, index) => ({
1170
+ () => React26.Children.toArray(children).map((child, index) => ({
937
1171
  key: getItemKey(child, index),
938
1172
  element: child
939
1173
  })),
@@ -950,8 +1184,8 @@ var MasonryGrid = ({
950
1184
  });
951
1185
  return buckets;
952
1186
  }, [items, layoutVersion, resolvedRowSpacing, safeColumns]);
953
- return /* @__PURE__ */ React18.createElement(
954
- View17,
1187
+ return /* @__PURE__ */ React26.createElement(
1188
+ View22,
955
1189
  {
956
1190
  style: [
957
1191
  {
@@ -974,10 +1208,10 @@ var MasonryGrid = ({
974
1208
  },
975
1209
  columnStyle
976
1210
  ];
977
- return /* @__PURE__ */ React18.createElement(View17, { key: `masonry-col-${columnIndex}`, style: columnStyles }, column.map((item, index) => {
1211
+ return /* @__PURE__ */ React26.createElement(View22, { key: `masonry-col-${columnIndex}`, style: columnStyles }, column.map((item, index) => {
978
1212
  const isLastRow = index === column.length - 1;
979
- return /* @__PURE__ */ React18.createElement(
980
- View17,
1213
+ return /* @__PURE__ */ React26.createElement(
1214
+ View22,
981
1215
  {
982
1216
  key: item.key,
983
1217
  style: { marginBottom: isLastRow ? 0 : resolvedRowSpacing },
@@ -996,18 +1230,18 @@ var MasonryGrid = ({
996
1230
  };
997
1231
 
998
1232
  // src/components/view/masonry-grid/masonry-grid-item.tsx
999
- import React19 from "react";
1000
- import { View as View18 } from "react-native";
1233
+ import React27 from "react";
1234
+ import { View as View23 } from "react-native";
1001
1235
  var MasonryGridItem = ({
1002
1236
  children,
1003
1237
  style
1004
1238
  }) => {
1005
- return /* @__PURE__ */ React19.createElement(View18, { style }, children);
1239
+ return /* @__PURE__ */ React27.createElement(View23, { style }, children);
1006
1240
  };
1007
1241
  MasonryGridItem.displayName = "MasonryGridItem";
1008
1242
 
1009
1243
  // src/components/view/masonry-grid/masonry-grid-builder.tsx
1010
- import React20, { useMemo as useMemo6, useRef as useRef4 } from "react";
1244
+ import React28, { useMemo as useMemo6, useRef as useRef4 } from "react";
1011
1245
  import {
1012
1246
  ScrollView
1013
1247
  } from "react-native";
@@ -1067,7 +1301,7 @@ var MasonryGridBuilder = ({
1067
1301
  onEndReached();
1068
1302
  }
1069
1303
  };
1070
- return /* @__PURE__ */ React20.createElement(
1304
+ return /* @__PURE__ */ React28.createElement(
1071
1305
  ScrollView,
1072
1306
  {
1073
1307
  scrollEventThrottle: 16,
@@ -1079,7 +1313,7 @@ var MasonryGridBuilder = ({
1079
1313
  onScroll: handleScroll
1080
1314
  },
1081
1315
  header,
1082
- /* @__PURE__ */ React20.createElement(
1316
+ /* @__PURE__ */ React28.createElement(
1083
1317
  MasonryGrid,
1084
1318
  {
1085
1319
  columns,
@@ -1089,18 +1323,25 @@ var MasonryGridBuilder = ({
1089
1323
  style: [{ width: "100%" }, style],
1090
1324
  columnStyle
1091
1325
  },
1092
- resolvedData.map((item, index) => /* @__PURE__ */ React20.createElement(MasonryGridItem, { key: resolvedKeyExtractor(item, index) }, resolvedRenderer({ item, index })))
1326
+ resolvedData.map((item, index) => /* @__PURE__ */ React28.createElement(MasonryGridItem, { key: resolvedKeyExtractor(item, index) }, resolvedRenderer({ item, index })))
1093
1327
  ),
1094
1328
  footer
1095
1329
  );
1096
1330
  };
1097
1331
  MasonryGridBuilder.displayName = "MasonryGridBuilder";
1098
1332
  export {
1333
+ Align,
1099
1334
  AspectRatio,
1100
1335
  BlurView,
1101
1336
  Center,
1102
1337
  Column,
1103
1338
  ConditionalView,
1339
+ ConstrainedBox,
1340
+ Container,
1341
+ Expanded,
1342
+ Flex,
1343
+ Flexible,
1344
+ FractionallySizedBox,
1104
1345
  Grid,
1105
1346
  GridBuilder,
1106
1347
  GridItem,
@@ -1115,5 +1356,6 @@ export {
1115
1356
  Screen,
1116
1357
  SizedBox,
1117
1358
  Spacer,
1118
- Surface
1359
+ Surface,
1360
+ Wrap
1119
1361
  };