@xaui/native 0.1.0 → 0.1.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.
@@ -38,21 +38,19 @@ var Column = ({
38
38
  crossAxisAlignment,
39
39
  spacing,
40
40
  reverse = false,
41
- fullWidth,
42
41
  style
43
42
  }) => {
44
43
  const gapStyle = spacing === void 0 ? void 0 : { gap: spacing };
45
- const fullWidthStyle = fullWidth ? { flexShrink: 1, flexBasis: "auto", width: "100%" } : void 0;
46
44
  return /* @__PURE__ */ _react2.default.createElement(
47
45
  _reactnative.View,
48
46
  {
49
47
  style: [
50
48
  {
49
+ flex: 1,
51
50
  flexDirection: reverse ? "column-reverse" : "column",
52
51
  justifyContent: resolveMainAxisAlignment(mainAxisAlignment),
53
52
  alignItems: resolveCrossAxisAlignment(crossAxisAlignment)
54
53
  },
55
- fullWidthStyle,
56
54
  gapStyle,
57
55
  style
58
56
  ]
@@ -125,15 +123,14 @@ var Padding = ({
125
123
  right,
126
124
  bottom,
127
125
  left,
128
- fullWidth,
129
126
  style
130
127
  }) => {
131
- const fullWidthStyle = fullWidth ? { flexShrink: 1, flexBasis: "auto", width: "100%" } : void 0;
132
128
  return /* @__PURE__ */ _react2.default.createElement(
133
129
  _reactnative.View,
134
130
  {
135
131
  style: [
136
132
  {
133
+ flex: 1,
137
134
  padding: all,
138
135
  paddingHorizontal: horizontal,
139
136
  paddingVertical: vertical,
@@ -142,7 +139,6 @@ var Padding = ({
142
139
  paddingBottom: bottom,
143
140
  paddingLeft: left
144
141
  },
145
- fullWidthStyle,
146
142
  style
147
143
  ]
148
144
  },
@@ -163,15 +159,14 @@ var Margin = ({
163
159
  right,
164
160
  bottom,
165
161
  left,
166
- fullWidth,
167
162
  style
168
163
  }) => {
169
- const fullWidthStyle = fullWidth ? { flexShrink: 1, flexBasis: "auto", width: "100%" } : void 0;
170
164
  return /* @__PURE__ */ _react2.default.createElement(
171
165
  _reactnative.View,
172
166
  {
173
167
  style: [
174
168
  {
169
+ flex: 1,
175
170
  margin: all,
176
171
  marginHorizontal: horizontal,
177
172
  marginVertical: vertical,
@@ -180,7 +175,6 @@ var Margin = ({
180
175
  marginBottom: bottom,
181
176
  marginLeft: left
182
177
  },
183
- fullWidthStyle,
184
178
  style
185
179
  ]
186
180
  },
@@ -369,6 +363,9 @@ var RoundedView = ({
369
363
  };
370
364
  var styles2 = _reactnative.StyleSheet.create({
371
365
  fullWidth: {
366
+ flexGrow: 1,
367
+ flexShrink: 1,
368
+ flexBasis: "auto",
372
369
  width: "100%"
373
370
  }
374
371
  });
@@ -400,6 +397,7 @@ var Surface = ({
400
397
  themeColor = "background",
401
398
  padding,
402
399
  radius = "none",
400
+ fullWidth = false,
403
401
  style
404
402
  }) => {
405
403
  const theme = _chunkRZJFCDFScjs.useXUITheme.call(void 0, );
@@ -410,8 +408,12 @@ var Surface = ({
410
408
  {
411
409
  style: [
412
410
  radiusStyle,
411
+ fullWidth && {
412
+ flexShrink: 1,
413
+ flexBasis: "auto",
414
+ width: "100%"
415
+ },
413
416
  {
414
- flex: 1,
415
417
  backgroundColor: background,
416
418
  padding
417
419
  },
@@ -423,6 +425,27 @@ var Surface = ({
423
425
  };
424
426
  Surface.displayName = "Surface";
425
427
 
428
+ // src/components/view/center/center.tsx
429
+
430
+
431
+ var Center = ({ children, style }) => {
432
+ return /* @__PURE__ */ _react2.default.createElement(
433
+ _reactnative.View,
434
+ {
435
+ style: [
436
+ {
437
+ flex: 1,
438
+ alignItems: "center",
439
+ justifyContent: "center"
440
+ },
441
+ style
442
+ ]
443
+ },
444
+ children
445
+ );
446
+ };
447
+ Center.displayName = "Center";
448
+
426
449
  // src/components/view/grid/grid.tsx
427
450
 
428
451
 
@@ -1058,4 +1081,5 @@ MasonryGridBuilder.displayName = "MasonryGridBuilder";
1058
1081
 
1059
1082
 
1060
1083
 
1061
- exports.AspectRatio = AspectRatio; exports.BlurView = BlurView; exports.Column = Column; exports.ConditionalView = ConditionalView; exports.Grid = Grid; exports.GridBuilder = GridBuilder; exports.GridItem = GridItem; exports.Margin = Margin; exports.MasonryGrid = MasonryGrid; exports.MasonryGridBuilder = MasonryGridBuilder; exports.MasonryGridItem = MasonryGridItem; exports.Padding = Padding; exports.PositionedView = PositionedView; exports.RoundedView = RoundedView; exports.Row = Row; exports.SizedBox = SizedBox; exports.Spacer = Spacer; exports.Surface = Surface;
1084
+
1085
+ exports.AspectRatio = AspectRatio; exports.BlurView = BlurView; exports.Center = Center; exports.Column = Column; exports.ConditionalView = ConditionalView; exports.Grid = Grid; exports.GridBuilder = GridBuilder; exports.GridItem = GridItem; exports.Margin = Margin; exports.MasonryGrid = MasonryGrid; exports.MasonryGridBuilder = MasonryGridBuilder; exports.MasonryGridItem = MasonryGridItem; exports.Padding = Padding; exports.PositionedView = PositionedView; exports.RoundedView = RoundedView; exports.Row = Row; exports.SizedBox = SizedBox; exports.Spacer = Spacer; exports.Surface = Surface;
@@ -38,7 +38,7 @@ type RowProps = {
38
38
  */
39
39
  style?: ViewStyle;
40
40
  };
41
- type ColumnProps = RowProps;
41
+ type ColumnProps = Omit<RowProps, 'fullWidth'>;
42
42
 
43
43
  declare const Column: React.FC<ColumnProps>;
44
44
 
@@ -91,11 +91,6 @@ type PaddingProps = {
91
91
  * Left padding.
92
92
  */
93
93
  left?: number;
94
- /**
95
- * Whether the padding container should take the full width of its parent.
96
- * @default false
97
- */
98
- fullWidth?: boolean;
99
94
  /**
100
95
  * Custom style for the padding container.
101
96
  */
@@ -137,11 +132,6 @@ type MarginProps = {
137
132
  * Left margin.
138
133
  */
139
134
  left?: number;
140
- /**
141
- * Whether the margin container should take the full width of its parent.
142
- * @default false
143
- */
144
- fullWidth?: boolean;
145
135
  /**
146
136
  * Custom style for the margin container.
147
137
  */
@@ -312,6 +302,11 @@ type SurfaceProps = {
312
302
  * @default 'none'
313
303
  */
314
304
  radius?: Radius;
305
+ /**
306
+ * Force the surface to take the full width.
307
+ * @default false
308
+ */
309
+ fullWidth?: boolean;
315
310
  /**
316
311
  * Additional container styles.
317
312
  */
@@ -320,6 +315,19 @@ type SurfaceProps = {
320
315
 
321
316
  declare const Surface: React.FC<SurfaceProps>;
322
317
 
318
+ type CenterProps = {
319
+ /**
320
+ * Content to render inside the centered container.
321
+ */
322
+ children: ReactNode;
323
+ /**
324
+ * Additional style for the container.
325
+ */
326
+ style?: StyleProp<ViewStyle>;
327
+ };
328
+
329
+ declare const Center: React.FC<CenterProps>;
330
+
323
331
  type GridProps = {
324
332
  /**
325
333
  * The grid items to render.
@@ -631,4 +639,4 @@ declare const MasonryGridBuilder: {
631
639
  displayName: string;
632
640
  };
633
641
 
634
- export { AspectRatio, type AspectRatioProps, BlurView, type BlurViewProps, 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, SizedBox, type SizedBoxProps, Spacer, type SpacerProps, Surface, type SurfaceProps, type SurfaceThemeColor };
642
+ 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, SizedBox, type SizedBoxProps, Spacer, type SpacerProps, Surface, type SurfaceProps, type SurfaceThemeColor };
@@ -38,7 +38,7 @@ type RowProps = {
38
38
  */
39
39
  style?: ViewStyle;
40
40
  };
41
- type ColumnProps = RowProps;
41
+ type ColumnProps = Omit<RowProps, 'fullWidth'>;
42
42
 
43
43
  declare const Column: React.FC<ColumnProps>;
44
44
 
@@ -91,11 +91,6 @@ type PaddingProps = {
91
91
  * Left padding.
92
92
  */
93
93
  left?: number;
94
- /**
95
- * Whether the padding container should take the full width of its parent.
96
- * @default false
97
- */
98
- fullWidth?: boolean;
99
94
  /**
100
95
  * Custom style for the padding container.
101
96
  */
@@ -137,11 +132,6 @@ type MarginProps = {
137
132
  * Left margin.
138
133
  */
139
134
  left?: number;
140
- /**
141
- * Whether the margin container should take the full width of its parent.
142
- * @default false
143
- */
144
- fullWidth?: boolean;
145
135
  /**
146
136
  * Custom style for the margin container.
147
137
  */
@@ -312,6 +302,11 @@ type SurfaceProps = {
312
302
  * @default 'none'
313
303
  */
314
304
  radius?: Radius;
305
+ /**
306
+ * Force the surface to take the full width.
307
+ * @default false
308
+ */
309
+ fullWidth?: boolean;
315
310
  /**
316
311
  * Additional container styles.
317
312
  */
@@ -320,6 +315,19 @@ type SurfaceProps = {
320
315
 
321
316
  declare const Surface: React.FC<SurfaceProps>;
322
317
 
318
+ type CenterProps = {
319
+ /**
320
+ * Content to render inside the centered container.
321
+ */
322
+ children: ReactNode;
323
+ /**
324
+ * Additional style for the container.
325
+ */
326
+ style?: StyleProp<ViewStyle>;
327
+ };
328
+
329
+ declare const Center: React.FC<CenterProps>;
330
+
323
331
  type GridProps = {
324
332
  /**
325
333
  * The grid items to render.
@@ -631,4 +639,4 @@ declare const MasonryGridBuilder: {
631
639
  displayName: string;
632
640
  };
633
641
 
634
- export { AspectRatio, type AspectRatioProps, BlurView, type BlurViewProps, 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, SizedBox, type SizedBoxProps, Spacer, type SpacerProps, Surface, type SurfaceProps, type SurfaceThemeColor };
642
+ 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, SizedBox, type SizedBoxProps, Spacer, type SpacerProps, Surface, type SurfaceProps, type SurfaceThemeColor };
@@ -38,21 +38,19 @@ var Column = ({
38
38
  crossAxisAlignment,
39
39
  spacing,
40
40
  reverse = false,
41
- fullWidth,
42
41
  style
43
42
  }) => {
44
43
  const gapStyle = spacing === void 0 ? void 0 : { gap: spacing };
45
- const fullWidthStyle = fullWidth ? { flexShrink: 1, flexBasis: "auto", width: "100%" } : void 0;
46
44
  return /* @__PURE__ */ React.createElement(
47
45
  View,
48
46
  {
49
47
  style: [
50
48
  {
49
+ flex: 1,
51
50
  flexDirection: reverse ? "column-reverse" : "column",
52
51
  justifyContent: resolveMainAxisAlignment(mainAxisAlignment),
53
52
  alignItems: resolveCrossAxisAlignment(crossAxisAlignment)
54
53
  },
55
- fullWidthStyle,
56
54
  gapStyle,
57
55
  style
58
56
  ]
@@ -125,15 +123,14 @@ var Padding = ({
125
123
  right,
126
124
  bottom,
127
125
  left,
128
- fullWidth,
129
126
  style
130
127
  }) => {
131
- const fullWidthStyle = fullWidth ? { flexShrink: 1, flexBasis: "auto", width: "100%" } : void 0;
132
128
  return /* @__PURE__ */ React4.createElement(
133
129
  View4,
134
130
  {
135
131
  style: [
136
132
  {
133
+ flex: 1,
137
134
  padding: all,
138
135
  paddingHorizontal: horizontal,
139
136
  paddingVertical: vertical,
@@ -142,7 +139,6 @@ var Padding = ({
142
139
  paddingBottom: bottom,
143
140
  paddingLeft: left
144
141
  },
145
- fullWidthStyle,
146
142
  style
147
143
  ]
148
144
  },
@@ -163,15 +159,14 @@ var Margin = ({
163
159
  right,
164
160
  bottom,
165
161
  left,
166
- fullWidth,
167
162
  style
168
163
  }) => {
169
- const fullWidthStyle = fullWidth ? { flexShrink: 1, flexBasis: "auto", width: "100%" } : void 0;
170
164
  return /* @__PURE__ */ React5.createElement(
171
165
  View5,
172
166
  {
173
167
  style: [
174
168
  {
169
+ flex: 1,
175
170
  margin: all,
176
171
  marginHorizontal: horizontal,
177
172
  marginVertical: vertical,
@@ -180,7 +175,6 @@ var Margin = ({
180
175
  marginBottom: bottom,
181
176
  marginLeft: left
182
177
  },
183
- fullWidthStyle,
184
178
  style
185
179
  ]
186
180
  },
@@ -369,6 +363,9 @@ var RoundedView = ({
369
363
  };
370
364
  var styles2 = StyleSheet2.create({
371
365
  fullWidth: {
366
+ flexGrow: 1,
367
+ flexShrink: 1,
368
+ flexBasis: "auto",
372
369
  width: "100%"
373
370
  }
374
371
  });
@@ -400,6 +397,7 @@ var Surface = ({
400
397
  themeColor = "background",
401
398
  padding,
402
399
  radius = "none",
400
+ fullWidth = false,
403
401
  style
404
402
  }) => {
405
403
  const theme = useXUITheme();
@@ -410,8 +408,12 @@ var Surface = ({
410
408
  {
411
409
  style: [
412
410
  radiusStyle,
411
+ fullWidth && {
412
+ flexShrink: 1,
413
+ flexBasis: "auto",
414
+ width: "100%"
415
+ },
413
416
  {
414
- flex: 1,
415
417
  backgroundColor: background,
416
418
  padding
417
419
  },
@@ -423,17 +425,38 @@ var Surface = ({
423
425
  };
424
426
  Surface.displayName = "Surface";
425
427
 
428
+ // src/components/view/center/center.tsx
429
+ import React12 from "react";
430
+ import { View as View12 } from "react-native";
431
+ var Center = ({ children, style }) => {
432
+ return /* @__PURE__ */ React12.createElement(
433
+ View12,
434
+ {
435
+ style: [
436
+ {
437
+ flex: 1,
438
+ alignItems: "center",
439
+ justifyContent: "center"
440
+ },
441
+ style
442
+ ]
443
+ },
444
+ children
445
+ );
446
+ };
447
+ Center.displayName = "Center";
448
+
426
449
  // src/components/view/grid/grid.tsx
427
- import React13, { useMemo as useMemo2, useState } from "react";
450
+ import React14, { useMemo as useMemo2, useState } from "react";
428
451
  import {
429
- View as View13
452
+ View as View14
430
453
  } from "react-native";
431
454
 
432
455
  // src/components/view/grid/grid-item.tsx
433
- import React12 from "react";
434
- import { View as View12 } from "react-native";
456
+ import React13 from "react";
457
+ import { View as View13 } from "react-native";
435
458
  var GridItem = ({ children, style }) => {
436
- return /* @__PURE__ */ React12.createElement(View12, { style }, children);
459
+ return /* @__PURE__ */ React13.createElement(View13, { style }, children);
437
460
  };
438
461
  GridItem.displayName = "GridItem";
439
462
 
@@ -447,7 +470,7 @@ var getSafeSpan = (span, columns) => {
447
470
  return Math.min(Math.floor(span), columns);
448
471
  };
449
472
  var isGridItemElement = (child) => {
450
- if (!React13.isValidElement(child)) return false;
473
+ if (!React14.isValidElement(child)) return false;
451
474
  if (child.type === GridItem) return true;
452
475
  const displayName = child.type.displayName;
453
476
  return displayName === "GridItem";
@@ -466,15 +489,15 @@ var Grid = ({
466
489
  const resolvedRowSpacing = rowSpacing ?? spacing ?? 0;
467
490
  const resolvedColumnSpacing = columnSpacing ?? spacing ?? 0;
468
491
  const itemWidth = `${100 / safeColumns}%`;
469
- const items = React13.Children.toArray(children);
492
+ const items = React14.Children.toArray(children);
470
493
  const totalColumnGap = resolvedColumnSpacing * (safeColumns - 1);
471
494
  const baseItemWidth = useMemo2(() => {
472
495
  if (!containerWidth) return void 0;
473
496
  return (containerWidth - totalColumnGap) / safeColumns;
474
497
  }, [containerWidth, safeColumns, totalColumnGap]);
475
498
  let currentColumn = 0;
476
- return /* @__PURE__ */ React13.createElement(
477
- View13,
499
+ return /* @__PURE__ */ React14.createElement(
500
+ View14,
478
501
  {
479
502
  style: [
480
503
  {
@@ -491,7 +514,7 @@ var Grid = ({
491
514
  }
492
515
  },
493
516
  items.map((child, index) => {
494
- const key = React13.isValidElement(child) && child.key ? child.key : `grid-${index}`;
517
+ const key = React14.isValidElement(child) && child.key ? child.key : `grid-${index}`;
495
518
  const span = isGridItemElement(child) ? getSafeSpan(child.props.span, safeColumns) : 1;
496
519
  const spanWidth = baseItemWidth === void 0 ? `${100 / safeColumns * span}%` : baseItemWidth * span + resolvedColumnSpacing * (span - 1);
497
520
  if (currentColumn + span > safeColumns) {
@@ -511,7 +534,7 @@ var Grid = ({
511
534
  itemStyle,
512
535
  child.props.style
513
536
  ];
514
- const element2 = React13.cloneElement(child, {
537
+ const element2 = React14.cloneElement(child, {
515
538
  key,
516
539
  style: mergedStyle
517
540
  });
@@ -519,8 +542,8 @@ var Grid = ({
519
542
  return element2;
520
543
  }
521
544
  const defaultItemWidth = baseItemWidth === void 0 ? itemWidth : baseItemWidth;
522
- const element = /* @__PURE__ */ React13.createElement(
523
- View13,
545
+ const element = /* @__PURE__ */ React14.createElement(
546
+ View14,
524
547
  {
525
548
  key,
526
549
  style: [
@@ -543,11 +566,11 @@ var Grid = ({
543
566
  };
544
567
 
545
568
  // src/components/view/grid/grid-builder.tsx
546
- import React14, { useMemo as useMemo3 } from "react";
569
+ import React15, { useMemo as useMemo3 } from "react";
547
570
  import {
548
571
  FlatList,
549
572
  StyleSheet as StyleSheet3,
550
- View as View14
573
+ View as View15
551
574
  } from "react-native";
552
575
  var getSafeColumns2 = (columns) => {
553
576
  if (!columns || columns <= 0) return 1;
@@ -634,7 +657,7 @@ var GridBuilder = ({
634
657
  },
635
658
  itemStyle
636
659
  ];
637
- return /* @__PURE__ */ React14.createElement(View14, { style: placeholderStyle, pointerEvents: "none" });
660
+ return /* @__PURE__ */ React15.createElement(View15, { style: placeholderStyle, pointerEvents: "none" });
638
661
  }
639
662
  const element = resolvedRenderer({ item: item.item, index: item.index });
640
663
  if (element === null) return null;
@@ -650,7 +673,7 @@ var GridBuilder = ({
650
673
  },
651
674
  itemStyle
652
675
  ];
653
- return /* @__PURE__ */ React14.createElement(View14, { style: wrapperStyle }, element);
676
+ return /* @__PURE__ */ React15.createElement(View15, { style: wrapperStyle }, element);
654
677
  };
655
678
  const flattenedStyle = StyleSheet3.flatten(style) ?? {};
656
679
  const {
@@ -671,7 +694,7 @@ var GridBuilder = ({
671
694
  ...columnGap !== void 0 ? { columnGap } : {}
672
695
  };
673
696
  const hasLayoutStyle = Object.keys(layoutStyle).length > 0;
674
- return /* @__PURE__ */ React14.createElement(
697
+ return /* @__PURE__ */ React15.createElement(
675
698
  FlatList,
676
699
  {
677
700
  data: paddedData,
@@ -691,7 +714,7 @@ var GridBuilder = ({
691
714
  GridBuilder.displayName = "GridBuilder";
692
715
 
693
716
  // src/components/view/conditional/conditional-view.tsx
694
- import React15, { useEffect as useEffect2, useMemo as useMemo4, useRef as useRef2, useState as useState2 } from "react";
717
+ import React16, { useEffect as useEffect2, useMemo as useMemo4, useRef as useRef2, useState as useState2 } from "react";
695
718
  import { Animated as Animated3 } from "react-native";
696
719
 
697
720
  // src/components/view/conditional/conditional-view.utils.ts
@@ -843,18 +866,18 @@ var ConditionalView = ({
843
866
  if (!shouldRender) {
844
867
  return null;
845
868
  }
846
- return /* @__PURE__ */ React15.createElement(Animated3.View, { style: animatedStyle }, children);
869
+ return /* @__PURE__ */ React16.createElement(Animated3.View, { style: animatedStyle }, children);
847
870
  };
848
871
 
849
872
  // src/components/view/masonry-grid/masonry-grid.tsx
850
- import React16, { useMemo as useMemo5, useRef as useRef3, useState as useState3 } from "react";
851
- import { View as View15 } from "react-native";
873
+ import React17, { useMemo as useMemo5, useRef as useRef3, useState as useState3 } from "react";
874
+ import { View as View16 } from "react-native";
852
875
  var getSafeColumns3 = (columns) => {
853
876
  if (!columns || columns <= 0) return 1;
854
877
  return Math.floor(columns);
855
878
  };
856
879
  var getItemKey = (child, index) => {
857
- return React16.isValidElement(child) && child.key ? String(child.key) : `masonry-${index}`;
880
+ return React17.isValidElement(child) && child.key ? String(child.key) : `masonry-${index}`;
858
881
  };
859
882
  var MasonryGrid = ({
860
883
  children,
@@ -877,7 +900,7 @@ var MasonryGrid = ({
877
900
  return (containerWidth - totalColumnGap) / safeColumns;
878
901
  }, [containerWidth, safeColumns, totalColumnGap]);
879
902
  const items = useMemo5(
880
- () => React16.Children.toArray(children).map((child, index) => ({
903
+ () => React17.Children.toArray(children).map((child, index) => ({
881
904
  key: getItemKey(child, index),
882
905
  element: child
883
906
  })),
@@ -894,8 +917,8 @@ var MasonryGrid = ({
894
917
  });
895
918
  return buckets;
896
919
  }, [items, layoutVersion, resolvedRowSpacing, safeColumns]);
897
- return /* @__PURE__ */ React16.createElement(
898
- View15,
920
+ return /* @__PURE__ */ React17.createElement(
921
+ View16,
899
922
  {
900
923
  style: [
901
924
  {
@@ -918,10 +941,10 @@ var MasonryGrid = ({
918
941
  },
919
942
  columnStyle
920
943
  ];
921
- return /* @__PURE__ */ React16.createElement(View15, { key: `masonry-col-${columnIndex}`, style: columnStyles }, column.map((item, index) => {
944
+ return /* @__PURE__ */ React17.createElement(View16, { key: `masonry-col-${columnIndex}`, style: columnStyles }, column.map((item, index) => {
922
945
  const isLastRow = index === column.length - 1;
923
- return /* @__PURE__ */ React16.createElement(
924
- View15,
946
+ return /* @__PURE__ */ React17.createElement(
947
+ View16,
925
948
  {
926
949
  key: item.key,
927
950
  style: { marginBottom: isLastRow ? 0 : resolvedRowSpacing },
@@ -940,18 +963,18 @@ var MasonryGrid = ({
940
963
  };
941
964
 
942
965
  // src/components/view/masonry-grid/masonry-grid-item.tsx
943
- import React17 from "react";
944
- import { View as View16 } from "react-native";
966
+ import React18 from "react";
967
+ import { View as View17 } from "react-native";
945
968
  var MasonryGridItem = ({
946
969
  children,
947
970
  style
948
971
  }) => {
949
- return /* @__PURE__ */ React17.createElement(View16, { style }, children);
972
+ return /* @__PURE__ */ React18.createElement(View17, { style }, children);
950
973
  };
951
974
  MasonryGridItem.displayName = "MasonryGridItem";
952
975
 
953
976
  // src/components/view/masonry-grid/masonry-grid-builder.tsx
954
- import React18, { useMemo as useMemo6, useRef as useRef4 } from "react";
977
+ import React19, { useMemo as useMemo6, useRef as useRef4 } from "react";
955
978
  import {
956
979
  ScrollView
957
980
  } from "react-native";
@@ -1011,7 +1034,7 @@ var MasonryGridBuilder = ({
1011
1034
  onEndReached();
1012
1035
  }
1013
1036
  };
1014
- return /* @__PURE__ */ React18.createElement(
1037
+ return /* @__PURE__ */ React19.createElement(
1015
1038
  ScrollView,
1016
1039
  {
1017
1040
  scrollEventThrottle: 16,
@@ -1023,7 +1046,7 @@ var MasonryGridBuilder = ({
1023
1046
  onScroll: handleScroll
1024
1047
  },
1025
1048
  header,
1026
- /* @__PURE__ */ React18.createElement(
1049
+ /* @__PURE__ */ React19.createElement(
1027
1050
  MasonryGrid,
1028
1051
  {
1029
1052
  columns,
@@ -1033,7 +1056,7 @@ var MasonryGridBuilder = ({
1033
1056
  style: [{ width: "100%" }, style],
1034
1057
  columnStyle
1035
1058
  },
1036
- resolvedData.map((item, index) => /* @__PURE__ */ React18.createElement(MasonryGridItem, { key: resolvedKeyExtractor(item, index) }, resolvedRenderer({ item, index })))
1059
+ resolvedData.map((item, index) => /* @__PURE__ */ React19.createElement(MasonryGridItem, { key: resolvedKeyExtractor(item, index) }, resolvedRenderer({ item, index })))
1037
1060
  ),
1038
1061
  footer
1039
1062
  );
@@ -1042,6 +1065,7 @@ MasonryGridBuilder.displayName = "MasonryGridBuilder";
1042
1065
  export {
1043
1066
  AspectRatio,
1044
1067
  BlurView,
1068
+ Center,
1045
1069
  Column,
1046
1070
  ConditionalView,
1047
1071
  Grid,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xaui/native",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Flutter-inspired React Native UI components with native animations powered by React Native Reanimated",
5
5
  "keywords": [
6
6
  "react-native",