@xaui/native 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/view/index.cjs +16 -6
- package/dist/view/index.d.cts +23 -3
- package/dist/view/index.d.ts +23 -3
- package/dist/view/index.js +16 -6
- package/package.json +1 -1
package/dist/view/index.cjs
CHANGED
|
@@ -38,9 +38,11 @@ var Column = ({
|
|
|
38
38
|
crossAxisAlignment,
|
|
39
39
|
spacing,
|
|
40
40
|
reverse = false,
|
|
41
|
+
fullWidth,
|
|
41
42
|
style
|
|
42
43
|
}) => {
|
|
43
44
|
const gapStyle = spacing === void 0 ? void 0 : { gap: spacing };
|
|
45
|
+
const fullWidthStyle = fullWidth ? { width: "100%" } : void 0;
|
|
44
46
|
return /* @__PURE__ */ _react2.default.createElement(
|
|
45
47
|
_reactnative.View,
|
|
46
48
|
{
|
|
@@ -51,6 +53,7 @@ var Column = ({
|
|
|
51
53
|
justifyContent: resolveMainAxisAlignment(mainAxisAlignment),
|
|
52
54
|
alignItems: resolveCrossAxisAlignment(crossAxisAlignment)
|
|
53
55
|
},
|
|
56
|
+
fullWidthStyle,
|
|
54
57
|
gapStyle,
|
|
55
58
|
style
|
|
56
59
|
]
|
|
@@ -123,8 +126,10 @@ var Padding = ({
|
|
|
123
126
|
right,
|
|
124
127
|
bottom,
|
|
125
128
|
left,
|
|
129
|
+
fullWidth,
|
|
126
130
|
style
|
|
127
131
|
}) => {
|
|
132
|
+
const fullWidthStyle = fullWidth ? { width: "100%" } : void 0;
|
|
128
133
|
return /* @__PURE__ */ _react2.default.createElement(
|
|
129
134
|
_reactnative.View,
|
|
130
135
|
{
|
|
@@ -139,6 +144,7 @@ var Padding = ({
|
|
|
139
144
|
paddingBottom: bottom,
|
|
140
145
|
paddingLeft: left
|
|
141
146
|
},
|
|
147
|
+
fullWidthStyle,
|
|
142
148
|
style
|
|
143
149
|
]
|
|
144
150
|
},
|
|
@@ -159,8 +165,10 @@ var Margin = ({
|
|
|
159
165
|
right,
|
|
160
166
|
bottom,
|
|
161
167
|
left,
|
|
168
|
+
fullWidth,
|
|
162
169
|
style
|
|
163
170
|
}) => {
|
|
171
|
+
const fullWidthStyle = fullWidth ? { width: "100%" } : void 0;
|
|
164
172
|
return /* @__PURE__ */ _react2.default.createElement(
|
|
165
173
|
_reactnative.View,
|
|
166
174
|
{
|
|
@@ -175,6 +183,7 @@ var Margin = ({
|
|
|
175
183
|
marginBottom: bottom,
|
|
176
184
|
marginLeft: left
|
|
177
185
|
},
|
|
186
|
+
fullWidthStyle,
|
|
178
187
|
style
|
|
179
188
|
]
|
|
180
189
|
},
|
|
@@ -190,8 +199,10 @@ var SizedBox = ({
|
|
|
190
199
|
children,
|
|
191
200
|
width,
|
|
192
201
|
height,
|
|
202
|
+
fullWidth,
|
|
193
203
|
style
|
|
194
204
|
}) => {
|
|
205
|
+
const fullWidthStyle = fullWidth ? { width: "100%" } : void 0;
|
|
195
206
|
return /* @__PURE__ */ _react2.default.createElement(
|
|
196
207
|
_reactnative.View,
|
|
197
208
|
{
|
|
@@ -200,6 +211,7 @@ var SizedBox = ({
|
|
|
200
211
|
width,
|
|
201
212
|
height
|
|
202
213
|
},
|
|
214
|
+
fullWidthStyle,
|
|
203
215
|
style
|
|
204
216
|
]
|
|
205
217
|
},
|
|
@@ -408,11 +420,7 @@ var Surface = ({
|
|
|
408
420
|
{
|
|
409
421
|
style: [
|
|
410
422
|
radiusStyle,
|
|
411
|
-
fullWidth && {
|
|
412
|
-
flexShrink: 1,
|
|
413
|
-
flexBasis: "auto",
|
|
414
|
-
width: "100%"
|
|
415
|
-
},
|
|
423
|
+
fullWidth && { flexShrink: 1, flexBasis: "auto", width: "100%" },
|
|
416
424
|
{
|
|
417
425
|
backgroundColor: background,
|
|
418
426
|
padding
|
|
@@ -428,7 +436,8 @@ Surface.displayName = "Surface";
|
|
|
428
436
|
// src/components/view/center/center.tsx
|
|
429
437
|
|
|
430
438
|
|
|
431
|
-
var Center = ({ children, style }) => {
|
|
439
|
+
var Center = ({ children, fullWidth, style }) => {
|
|
440
|
+
const fullWidthStyle = fullWidth ? { width: "100%" } : void 0;
|
|
432
441
|
return /* @__PURE__ */ _react2.default.createElement(
|
|
433
442
|
_reactnative.View,
|
|
434
443
|
{
|
|
@@ -438,6 +447,7 @@ var Center = ({ children, style }) => {
|
|
|
438
447
|
alignItems: "center",
|
|
439
448
|
justifyContent: "center"
|
|
440
449
|
},
|
|
450
|
+
fullWidthStyle,
|
|
441
451
|
style
|
|
442
452
|
]
|
|
443
453
|
},
|
package/dist/view/index.d.cts
CHANGED
|
@@ -38,7 +38,7 @@ type RowProps = {
|
|
|
38
38
|
*/
|
|
39
39
|
style?: ViewStyle;
|
|
40
40
|
};
|
|
41
|
-
type ColumnProps =
|
|
41
|
+
type ColumnProps = RowProps;
|
|
42
42
|
|
|
43
43
|
declare const Column: React.FC<ColumnProps>;
|
|
44
44
|
|
|
@@ -91,6 +91,11 @@ 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;
|
|
94
99
|
/**
|
|
95
100
|
* Custom style for the padding container.
|
|
96
101
|
*/
|
|
@@ -132,6 +137,11 @@ type MarginProps = {
|
|
|
132
137
|
* Left margin.
|
|
133
138
|
*/
|
|
134
139
|
left?: number;
|
|
140
|
+
/**
|
|
141
|
+
* Whether the margin container should take the full width of its parent.
|
|
142
|
+
* @default false
|
|
143
|
+
*/
|
|
144
|
+
fullWidth?: boolean;
|
|
135
145
|
/**
|
|
136
146
|
* Custom style for the margin container.
|
|
137
147
|
*/
|
|
@@ -148,11 +158,16 @@ type SizedBoxProps = {
|
|
|
148
158
|
/**
|
|
149
159
|
* Width of the box.
|
|
150
160
|
*/
|
|
151
|
-
width?:
|
|
161
|
+
width?: ViewStyle['width'];
|
|
152
162
|
/**
|
|
153
163
|
* Height of the box.
|
|
154
164
|
*/
|
|
155
|
-
height?:
|
|
165
|
+
height?: ViewStyle['height'];
|
|
166
|
+
/**
|
|
167
|
+
* Whether the box should take the full width of its parent.
|
|
168
|
+
* @default false
|
|
169
|
+
*/
|
|
170
|
+
fullWidth?: boolean;
|
|
156
171
|
/**
|
|
157
172
|
* Custom style for the box.
|
|
158
173
|
*/
|
|
@@ -320,6 +335,11 @@ type CenterProps = {
|
|
|
320
335
|
* Content to render inside the centered container.
|
|
321
336
|
*/
|
|
322
337
|
children: ReactNode;
|
|
338
|
+
/**
|
|
339
|
+
* Whether the centered container should take the full width of its parent.
|
|
340
|
+
* @default false
|
|
341
|
+
*/
|
|
342
|
+
fullWidth?: boolean;
|
|
323
343
|
/**
|
|
324
344
|
* Additional style for the container.
|
|
325
345
|
*/
|
package/dist/view/index.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ type RowProps = {
|
|
|
38
38
|
*/
|
|
39
39
|
style?: ViewStyle;
|
|
40
40
|
};
|
|
41
|
-
type ColumnProps =
|
|
41
|
+
type ColumnProps = RowProps;
|
|
42
42
|
|
|
43
43
|
declare const Column: React.FC<ColumnProps>;
|
|
44
44
|
|
|
@@ -91,6 +91,11 @@ 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;
|
|
94
99
|
/**
|
|
95
100
|
* Custom style for the padding container.
|
|
96
101
|
*/
|
|
@@ -132,6 +137,11 @@ type MarginProps = {
|
|
|
132
137
|
* Left margin.
|
|
133
138
|
*/
|
|
134
139
|
left?: number;
|
|
140
|
+
/**
|
|
141
|
+
* Whether the margin container should take the full width of its parent.
|
|
142
|
+
* @default false
|
|
143
|
+
*/
|
|
144
|
+
fullWidth?: boolean;
|
|
135
145
|
/**
|
|
136
146
|
* Custom style for the margin container.
|
|
137
147
|
*/
|
|
@@ -148,11 +158,16 @@ type SizedBoxProps = {
|
|
|
148
158
|
/**
|
|
149
159
|
* Width of the box.
|
|
150
160
|
*/
|
|
151
|
-
width?:
|
|
161
|
+
width?: ViewStyle['width'];
|
|
152
162
|
/**
|
|
153
163
|
* Height of the box.
|
|
154
164
|
*/
|
|
155
|
-
height?:
|
|
165
|
+
height?: ViewStyle['height'];
|
|
166
|
+
/**
|
|
167
|
+
* Whether the box should take the full width of its parent.
|
|
168
|
+
* @default false
|
|
169
|
+
*/
|
|
170
|
+
fullWidth?: boolean;
|
|
156
171
|
/**
|
|
157
172
|
* Custom style for the box.
|
|
158
173
|
*/
|
|
@@ -320,6 +335,11 @@ type CenterProps = {
|
|
|
320
335
|
* Content to render inside the centered container.
|
|
321
336
|
*/
|
|
322
337
|
children: ReactNode;
|
|
338
|
+
/**
|
|
339
|
+
* Whether the centered container should take the full width of its parent.
|
|
340
|
+
* @default false
|
|
341
|
+
*/
|
|
342
|
+
fullWidth?: boolean;
|
|
323
343
|
/**
|
|
324
344
|
* Additional style for the container.
|
|
325
345
|
*/
|
package/dist/view/index.js
CHANGED
|
@@ -38,9 +38,11 @@ var Column = ({
|
|
|
38
38
|
crossAxisAlignment,
|
|
39
39
|
spacing,
|
|
40
40
|
reverse = false,
|
|
41
|
+
fullWidth,
|
|
41
42
|
style
|
|
42
43
|
}) => {
|
|
43
44
|
const gapStyle = spacing === void 0 ? void 0 : { gap: spacing };
|
|
45
|
+
const fullWidthStyle = fullWidth ? { width: "100%" } : void 0;
|
|
44
46
|
return /* @__PURE__ */ React.createElement(
|
|
45
47
|
View,
|
|
46
48
|
{
|
|
@@ -51,6 +53,7 @@ var Column = ({
|
|
|
51
53
|
justifyContent: resolveMainAxisAlignment(mainAxisAlignment),
|
|
52
54
|
alignItems: resolveCrossAxisAlignment(crossAxisAlignment)
|
|
53
55
|
},
|
|
56
|
+
fullWidthStyle,
|
|
54
57
|
gapStyle,
|
|
55
58
|
style
|
|
56
59
|
]
|
|
@@ -123,8 +126,10 @@ var Padding = ({
|
|
|
123
126
|
right,
|
|
124
127
|
bottom,
|
|
125
128
|
left,
|
|
129
|
+
fullWidth,
|
|
126
130
|
style
|
|
127
131
|
}) => {
|
|
132
|
+
const fullWidthStyle = fullWidth ? { width: "100%" } : void 0;
|
|
128
133
|
return /* @__PURE__ */ React4.createElement(
|
|
129
134
|
View4,
|
|
130
135
|
{
|
|
@@ -139,6 +144,7 @@ var Padding = ({
|
|
|
139
144
|
paddingBottom: bottom,
|
|
140
145
|
paddingLeft: left
|
|
141
146
|
},
|
|
147
|
+
fullWidthStyle,
|
|
142
148
|
style
|
|
143
149
|
]
|
|
144
150
|
},
|
|
@@ -159,8 +165,10 @@ var Margin = ({
|
|
|
159
165
|
right,
|
|
160
166
|
bottom,
|
|
161
167
|
left,
|
|
168
|
+
fullWidth,
|
|
162
169
|
style
|
|
163
170
|
}) => {
|
|
171
|
+
const fullWidthStyle = fullWidth ? { width: "100%" } : void 0;
|
|
164
172
|
return /* @__PURE__ */ React5.createElement(
|
|
165
173
|
View5,
|
|
166
174
|
{
|
|
@@ -175,6 +183,7 @@ var Margin = ({
|
|
|
175
183
|
marginBottom: bottom,
|
|
176
184
|
marginLeft: left
|
|
177
185
|
},
|
|
186
|
+
fullWidthStyle,
|
|
178
187
|
style
|
|
179
188
|
]
|
|
180
189
|
},
|
|
@@ -190,8 +199,10 @@ var SizedBox = ({
|
|
|
190
199
|
children,
|
|
191
200
|
width,
|
|
192
201
|
height,
|
|
202
|
+
fullWidth,
|
|
193
203
|
style
|
|
194
204
|
}) => {
|
|
205
|
+
const fullWidthStyle = fullWidth ? { width: "100%" } : void 0;
|
|
195
206
|
return /* @__PURE__ */ React6.createElement(
|
|
196
207
|
View6,
|
|
197
208
|
{
|
|
@@ -200,6 +211,7 @@ var SizedBox = ({
|
|
|
200
211
|
width,
|
|
201
212
|
height
|
|
202
213
|
},
|
|
214
|
+
fullWidthStyle,
|
|
203
215
|
style
|
|
204
216
|
]
|
|
205
217
|
},
|
|
@@ -408,11 +420,7 @@ var Surface = ({
|
|
|
408
420
|
{
|
|
409
421
|
style: [
|
|
410
422
|
radiusStyle,
|
|
411
|
-
fullWidth && {
|
|
412
|
-
flexShrink: 1,
|
|
413
|
-
flexBasis: "auto",
|
|
414
|
-
width: "100%"
|
|
415
|
-
},
|
|
423
|
+
fullWidth && { flexShrink: 1, flexBasis: "auto", width: "100%" },
|
|
416
424
|
{
|
|
417
425
|
backgroundColor: background,
|
|
418
426
|
padding
|
|
@@ -428,7 +436,8 @@ Surface.displayName = "Surface";
|
|
|
428
436
|
// src/components/view/center/center.tsx
|
|
429
437
|
import React12 from "react";
|
|
430
438
|
import { View as View12 } from "react-native";
|
|
431
|
-
var Center = ({ children, style }) => {
|
|
439
|
+
var Center = ({ children, fullWidth, style }) => {
|
|
440
|
+
const fullWidthStyle = fullWidth ? { width: "100%" } : void 0;
|
|
432
441
|
return /* @__PURE__ */ React12.createElement(
|
|
433
442
|
View12,
|
|
434
443
|
{
|
|
@@ -438,6 +447,7 @@ var Center = ({ children, style }) => {
|
|
|
438
447
|
alignItems: "center",
|
|
439
448
|
justifyContent: "center"
|
|
440
449
|
},
|
|
450
|
+
fullWidthStyle,
|
|
441
451
|
style
|
|
442
452
|
]
|
|
443
453
|
},
|