@xaui/native 0.1.1 → 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%", flexGrow: 1 } : { flexGrow: 1 };
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
  ]
@@ -74,7 +72,7 @@ var Row = ({
74
72
  style
75
73
  }) => {
76
74
  const gapStyle = spacing === void 0 ? void 0 : { gap: spacing };
77
- const fullWidthStyle = fullWidth ? { flexGrow: 1, flexShrink: 1, flexBasis: "auto", width: "100%" } : void 0;
75
+ const fullWidthStyle = fullWidth ? { flexShrink: 1, flexBasis: "auto", width: "100%" } : void 0;
78
76
  return /* @__PURE__ */ _react2.default.createElement(
79
77
  _reactnative.View,
80
78
  {
@@ -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 ? { flexGrow: 1, flexShrink: 1, flexBasis: "auto", width: "100%" } : { flexGrow: 1 };
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 ? { flexGrow: 1, flexShrink: 1, flexBasis: "auto", width: "100%" } : { flexGrow: 1 };
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
  },
@@ -417,8 +411,7 @@ var Surface = ({
417
411
  fullWidth && {
418
412
  flexShrink: 1,
419
413
  flexBasis: "auto",
420
- width: "100%",
421
- flexGrow: 1
414
+ width: "100%"
422
415
  },
423
416
  {
424
417
  backgroundColor: background,
@@ -435,21 +428,16 @@ Surface.displayName = "Surface";
435
428
  // src/components/view/center/center.tsx
436
429
 
437
430
 
438
- var Center = ({
439
- children,
440
- fullWidth = false,
441
- style
442
- }) => {
443
- const fullWidthStyle = fullWidth ? { flexGrow: 1, flexShrink: 1, flexBasis: "auto", width: "100%" } : { flexGrow: 1 };
431
+ var Center = ({ children, style }) => {
444
432
  return /* @__PURE__ */ _react2.default.createElement(
445
433
  _reactnative.View,
446
434
  {
447
435
  style: [
448
436
  {
437
+ flex: 1,
449
438
  alignItems: "center",
450
439
  justifyContent: "center"
451
440
  },
452
- fullWidthStyle,
453
441
  style
454
442
  ]
455
443
  },
@@ -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
  */
@@ -330,11 +320,6 @@ type CenterProps = {
330
320
  * Content to render inside the centered container.
331
321
  */
332
322
  children: ReactNode;
333
- /**
334
- * Force the container to take the full width.
335
- * @default false
336
- */
337
- fullWidth?: boolean;
338
323
  /**
339
324
  * Additional style for the container.
340
325
  */
@@ -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
  */
@@ -330,11 +320,6 @@ type CenterProps = {
330
320
  * Content to render inside the centered container.
331
321
  */
332
322
  children: ReactNode;
333
- /**
334
- * Force the container to take the full width.
335
- * @default false
336
- */
337
- fullWidth?: boolean;
338
323
  /**
339
324
  * Additional style for the container.
340
325
  */
@@ -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%", flexGrow: 1 } : { flexGrow: 1 };
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
  ]
@@ -74,7 +72,7 @@ var Row = ({
74
72
  style
75
73
  }) => {
76
74
  const gapStyle = spacing === void 0 ? void 0 : { gap: spacing };
77
- const fullWidthStyle = fullWidth ? { flexGrow: 1, flexShrink: 1, flexBasis: "auto", width: "100%" } : void 0;
75
+ const fullWidthStyle = fullWidth ? { flexShrink: 1, flexBasis: "auto", width: "100%" } : void 0;
78
76
  return /* @__PURE__ */ React2.createElement(
79
77
  View2,
80
78
  {
@@ -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 ? { flexGrow: 1, flexShrink: 1, flexBasis: "auto", width: "100%" } : { flexGrow: 1 };
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 ? { flexGrow: 1, flexShrink: 1, flexBasis: "auto", width: "100%" } : { flexGrow: 1 };
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
  },
@@ -417,8 +411,7 @@ var Surface = ({
417
411
  fullWidth && {
418
412
  flexShrink: 1,
419
413
  flexBasis: "auto",
420
- width: "100%",
421
- flexGrow: 1
414
+ width: "100%"
422
415
  },
423
416
  {
424
417
  backgroundColor: background,
@@ -435,21 +428,16 @@ Surface.displayName = "Surface";
435
428
  // src/components/view/center/center.tsx
436
429
  import React12 from "react";
437
430
  import { View as View12 } from "react-native";
438
- var Center = ({
439
- children,
440
- fullWidth = false,
441
- style
442
- }) => {
443
- const fullWidthStyle = fullWidth ? { flexGrow: 1, flexShrink: 1, flexBasis: "auto", width: "100%" } : { flexGrow: 1 };
431
+ var Center = ({ children, style }) => {
444
432
  return /* @__PURE__ */ React12.createElement(
445
433
  View12,
446
434
  {
447
435
  style: [
448
436
  {
437
+ flex: 1,
449
438
  alignItems: "center",
450
439
  justifyContent: "center"
451
440
  },
452
- fullWidthStyle,
453
441
  style
454
442
  ]
455
443
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xaui/native",
3
- "version": "0.1.1",
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",