@xaui/native 0.2.1 → 0.2.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.
- package/dist/view/index.cjs +20 -18
- package/dist/view/index.d.cts +27 -1
- package/dist/view/index.d.ts +27 -1
- package/dist/view/index.js +23 -21
- package/package.json +1 -1
package/dist/view/index.cjs
CHANGED
|
@@ -39,7 +39,8 @@ var Column = ({
|
|
|
39
39
|
spacing,
|
|
40
40
|
reverse = false,
|
|
41
41
|
fullWidth,
|
|
42
|
-
style
|
|
42
|
+
style,
|
|
43
|
+
noGrowth = false
|
|
43
44
|
}) => {
|
|
44
45
|
const gapStyle = spacing === void 0 ? void 0 : { gap: spacing };
|
|
45
46
|
const fullWidthStyle = fullWidth ? { width: "100%" } : void 0;
|
|
@@ -48,7 +49,7 @@ var Column = ({
|
|
|
48
49
|
{
|
|
49
50
|
style: [
|
|
50
51
|
{
|
|
51
|
-
flex: 1,
|
|
52
|
+
flex: noGrowth ? void 0 : 1,
|
|
52
53
|
flexDirection: reverse ? "column-reverse" : "column",
|
|
53
54
|
justifyContent: resolveMainAxisAlignment(mainAxisAlignment),
|
|
54
55
|
alignItems: resolveCrossAxisAlignment(crossAxisAlignment)
|
|
@@ -127,7 +128,8 @@ var Padding = ({
|
|
|
127
128
|
bottom,
|
|
128
129
|
left,
|
|
129
130
|
fullWidth,
|
|
130
|
-
style
|
|
131
|
+
style,
|
|
132
|
+
noGrowth = false
|
|
131
133
|
}) => {
|
|
132
134
|
const fullWidthStyle = fullWidth ? { width: "100%" } : void 0;
|
|
133
135
|
return /* @__PURE__ */ _react2.default.createElement(
|
|
@@ -135,7 +137,7 @@ var Padding = ({
|
|
|
135
137
|
{
|
|
136
138
|
style: [
|
|
137
139
|
{
|
|
138
|
-
flex: 1,
|
|
140
|
+
flex: noGrowth ? void 0 : 1,
|
|
139
141
|
padding: all,
|
|
140
142
|
paddingHorizontal: horizontal,
|
|
141
143
|
paddingVertical: vertical,
|
|
@@ -166,7 +168,8 @@ var Margin = ({
|
|
|
166
168
|
bottom,
|
|
167
169
|
left,
|
|
168
170
|
fullWidth,
|
|
169
|
-
style
|
|
171
|
+
style,
|
|
172
|
+
noGrowth = false
|
|
170
173
|
}) => {
|
|
171
174
|
const fullWidthStyle = fullWidth ? { width: "100%" } : void 0;
|
|
172
175
|
return /* @__PURE__ */ _react2.default.createElement(
|
|
@@ -174,7 +177,7 @@ var Margin = ({
|
|
|
174
177
|
{
|
|
175
178
|
style: [
|
|
176
179
|
{
|
|
177
|
-
flex: 1,
|
|
180
|
+
flex: noGrowth ? void 0 : 1,
|
|
178
181
|
margin: all,
|
|
179
182
|
marginHorizontal: horizontal,
|
|
180
183
|
marginVertical: vertical,
|
|
@@ -347,7 +350,8 @@ var RoundedView = ({
|
|
|
347
350
|
bottomRight,
|
|
348
351
|
fullWidth = false,
|
|
349
352
|
backgroundColor,
|
|
350
|
-
style
|
|
353
|
+
style,
|
|
354
|
+
noGrowth = false
|
|
351
355
|
}) => {
|
|
352
356
|
const borderRadiusStyle = useRoundedViewStyle({
|
|
353
357
|
all,
|
|
@@ -365,7 +369,8 @@ var RoundedView = ({
|
|
|
365
369
|
{
|
|
366
370
|
style: [
|
|
367
371
|
borderRadiusStyle,
|
|
368
|
-
fullWidth &&
|
|
372
|
+
fullWidth && { width: "100%" },
|
|
373
|
+
noGrowth ? void 0 : { flex: 1 },
|
|
369
374
|
backgroundColor && { backgroundColor },
|
|
370
375
|
style
|
|
371
376
|
]
|
|
@@ -373,14 +378,6 @@ var RoundedView = ({
|
|
|
373
378
|
children
|
|
374
379
|
);
|
|
375
380
|
};
|
|
376
|
-
var styles2 = _reactnative.StyleSheet.create({
|
|
377
|
-
fullWidth: {
|
|
378
|
-
flexGrow: 1,
|
|
379
|
-
flexShrink: 1,
|
|
380
|
-
flexBasis: "auto",
|
|
381
|
-
width: "100%"
|
|
382
|
-
}
|
|
383
|
-
});
|
|
384
381
|
|
|
385
382
|
// src/components/view/aspect-ratio/aspect-ratio.tsx
|
|
386
383
|
|
|
@@ -436,14 +433,19 @@ Surface.displayName = "Surface";
|
|
|
436
433
|
// src/components/view/center/center.tsx
|
|
437
434
|
|
|
438
435
|
|
|
439
|
-
var Center = ({
|
|
436
|
+
var Center = ({
|
|
437
|
+
children,
|
|
438
|
+
fullWidth,
|
|
439
|
+
style,
|
|
440
|
+
noGrowth = false
|
|
441
|
+
}) => {
|
|
440
442
|
const fullWidthStyle = fullWidth ? { width: "100%" } : void 0;
|
|
441
443
|
return /* @__PURE__ */ _react2.default.createElement(
|
|
442
444
|
_reactnative.View,
|
|
443
445
|
{
|
|
444
446
|
style: [
|
|
445
447
|
{
|
|
446
|
-
flex: 1,
|
|
448
|
+
flex: noGrowth ? void 0 : 1,
|
|
447
449
|
alignItems: "center",
|
|
448
450
|
justifyContent: "center"
|
|
449
451
|
},
|
package/dist/view/index.d.cts
CHANGED
|
@@ -38,7 +38,13 @@ type RowProps = {
|
|
|
38
38
|
*/
|
|
39
39
|
style?: ViewStyle;
|
|
40
40
|
};
|
|
41
|
-
type ColumnProps = RowProps
|
|
41
|
+
type ColumnProps = RowProps & {
|
|
42
|
+
/**
|
|
43
|
+
* If true, the container will grow to fill available space.
|
|
44
|
+
* @default false
|
|
45
|
+
*/
|
|
46
|
+
noGrowth?: boolean;
|
|
47
|
+
};
|
|
42
48
|
|
|
43
49
|
declare const Column: React.FC<ColumnProps>;
|
|
44
50
|
|
|
@@ -96,6 +102,11 @@ type PaddingProps = {
|
|
|
96
102
|
* @default false
|
|
97
103
|
*/
|
|
98
104
|
fullWidth?: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* If true, the padding container will grow to fill available space.
|
|
107
|
+
* @default false
|
|
108
|
+
*/
|
|
109
|
+
noGrowth?: boolean;
|
|
99
110
|
/**
|
|
100
111
|
* Custom style for the padding container.
|
|
101
112
|
*/
|
|
@@ -142,6 +153,11 @@ type MarginProps = {
|
|
|
142
153
|
* @default false
|
|
143
154
|
*/
|
|
144
155
|
fullWidth?: boolean;
|
|
156
|
+
/**
|
|
157
|
+
* If true, the margin container will grow to fill available space.
|
|
158
|
+
* @default false
|
|
159
|
+
*/
|
|
160
|
+
noGrowth?: boolean;
|
|
145
161
|
/**
|
|
146
162
|
* Custom style for the margin container.
|
|
147
163
|
*/
|
|
@@ -269,6 +285,11 @@ type RoundedViewProps = {
|
|
|
269
285
|
* Background color of the view
|
|
270
286
|
*/
|
|
271
287
|
backgroundColor?: string;
|
|
288
|
+
/**
|
|
289
|
+
* If true, the view will NOT automatically grow to fill available space (e.g., via flex: 1).
|
|
290
|
+
* @default false
|
|
291
|
+
*/
|
|
292
|
+
noGrowth?: boolean;
|
|
272
293
|
/**
|
|
273
294
|
* Custom style for the view
|
|
274
295
|
*/
|
|
@@ -340,6 +361,11 @@ type CenterProps = {
|
|
|
340
361
|
* @default false
|
|
341
362
|
*/
|
|
342
363
|
fullWidth?: boolean;
|
|
364
|
+
/**
|
|
365
|
+
* If true, disables automatic growth (e.g. prevents using flex: 1 to fill available space).
|
|
366
|
+
* @default false
|
|
367
|
+
*/
|
|
368
|
+
noGrowth?: boolean;
|
|
343
369
|
/**
|
|
344
370
|
* Additional style for the container.
|
|
345
371
|
*/
|
package/dist/view/index.d.ts
CHANGED
|
@@ -38,7 +38,13 @@ type RowProps = {
|
|
|
38
38
|
*/
|
|
39
39
|
style?: ViewStyle;
|
|
40
40
|
};
|
|
41
|
-
type ColumnProps = RowProps
|
|
41
|
+
type ColumnProps = RowProps & {
|
|
42
|
+
/**
|
|
43
|
+
* If true, the container will grow to fill available space.
|
|
44
|
+
* @default false
|
|
45
|
+
*/
|
|
46
|
+
noGrowth?: boolean;
|
|
47
|
+
};
|
|
42
48
|
|
|
43
49
|
declare const Column: React.FC<ColumnProps>;
|
|
44
50
|
|
|
@@ -96,6 +102,11 @@ type PaddingProps = {
|
|
|
96
102
|
* @default false
|
|
97
103
|
*/
|
|
98
104
|
fullWidth?: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* If true, the padding container will grow to fill available space.
|
|
107
|
+
* @default false
|
|
108
|
+
*/
|
|
109
|
+
noGrowth?: boolean;
|
|
99
110
|
/**
|
|
100
111
|
* Custom style for the padding container.
|
|
101
112
|
*/
|
|
@@ -142,6 +153,11 @@ type MarginProps = {
|
|
|
142
153
|
* @default false
|
|
143
154
|
*/
|
|
144
155
|
fullWidth?: boolean;
|
|
156
|
+
/**
|
|
157
|
+
* If true, the margin container will grow to fill available space.
|
|
158
|
+
* @default false
|
|
159
|
+
*/
|
|
160
|
+
noGrowth?: boolean;
|
|
145
161
|
/**
|
|
146
162
|
* Custom style for the margin container.
|
|
147
163
|
*/
|
|
@@ -269,6 +285,11 @@ type RoundedViewProps = {
|
|
|
269
285
|
* Background color of the view
|
|
270
286
|
*/
|
|
271
287
|
backgroundColor?: string;
|
|
288
|
+
/**
|
|
289
|
+
* If true, the view will NOT automatically grow to fill available space (e.g., via flex: 1).
|
|
290
|
+
* @default false
|
|
291
|
+
*/
|
|
292
|
+
noGrowth?: boolean;
|
|
272
293
|
/**
|
|
273
294
|
* Custom style for the view
|
|
274
295
|
*/
|
|
@@ -340,6 +361,11 @@ type CenterProps = {
|
|
|
340
361
|
* @default false
|
|
341
362
|
*/
|
|
342
363
|
fullWidth?: boolean;
|
|
364
|
+
/**
|
|
365
|
+
* If true, disables automatic growth (e.g. prevents using flex: 1 to fill available space).
|
|
366
|
+
* @default false
|
|
367
|
+
*/
|
|
368
|
+
noGrowth?: boolean;
|
|
343
369
|
/**
|
|
344
370
|
* Additional style for the container.
|
|
345
371
|
*/
|
package/dist/view/index.js
CHANGED
|
@@ -39,7 +39,8 @@ var Column = ({
|
|
|
39
39
|
spacing,
|
|
40
40
|
reverse = false,
|
|
41
41
|
fullWidth,
|
|
42
|
-
style
|
|
42
|
+
style,
|
|
43
|
+
noGrowth = false
|
|
43
44
|
}) => {
|
|
44
45
|
const gapStyle = spacing === void 0 ? void 0 : { gap: spacing };
|
|
45
46
|
const fullWidthStyle = fullWidth ? { width: "100%" } : void 0;
|
|
@@ -48,7 +49,7 @@ var Column = ({
|
|
|
48
49
|
{
|
|
49
50
|
style: [
|
|
50
51
|
{
|
|
51
|
-
flex: 1,
|
|
52
|
+
flex: noGrowth ? void 0 : 1,
|
|
52
53
|
flexDirection: reverse ? "column-reverse" : "column",
|
|
53
54
|
justifyContent: resolveMainAxisAlignment(mainAxisAlignment),
|
|
54
55
|
alignItems: resolveCrossAxisAlignment(crossAxisAlignment)
|
|
@@ -127,7 +128,8 @@ var Padding = ({
|
|
|
127
128
|
bottom,
|
|
128
129
|
left,
|
|
129
130
|
fullWidth,
|
|
130
|
-
style
|
|
131
|
+
style,
|
|
132
|
+
noGrowth = false
|
|
131
133
|
}) => {
|
|
132
134
|
const fullWidthStyle = fullWidth ? { width: "100%" } : void 0;
|
|
133
135
|
return /* @__PURE__ */ React4.createElement(
|
|
@@ -135,7 +137,7 @@ var Padding = ({
|
|
|
135
137
|
{
|
|
136
138
|
style: [
|
|
137
139
|
{
|
|
138
|
-
flex: 1,
|
|
140
|
+
flex: noGrowth ? void 0 : 1,
|
|
139
141
|
padding: all,
|
|
140
142
|
paddingHorizontal: horizontal,
|
|
141
143
|
paddingVertical: vertical,
|
|
@@ -166,7 +168,8 @@ var Margin = ({
|
|
|
166
168
|
bottom,
|
|
167
169
|
left,
|
|
168
170
|
fullWidth,
|
|
169
|
-
style
|
|
171
|
+
style,
|
|
172
|
+
noGrowth = false
|
|
170
173
|
}) => {
|
|
171
174
|
const fullWidthStyle = fullWidth ? { width: "100%" } : void 0;
|
|
172
175
|
return /* @__PURE__ */ React5.createElement(
|
|
@@ -174,7 +177,7 @@ var Margin = ({
|
|
|
174
177
|
{
|
|
175
178
|
style: [
|
|
176
179
|
{
|
|
177
|
-
flex: 1,
|
|
180
|
+
flex: noGrowth ? void 0 : 1,
|
|
178
181
|
margin: all,
|
|
179
182
|
marginHorizontal: horizontal,
|
|
180
183
|
marginVertical: vertical,
|
|
@@ -307,7 +310,7 @@ BlurView.displayName = "BlurView";
|
|
|
307
310
|
|
|
308
311
|
// src/components/view/rounded-view/rounded-view.tsx
|
|
309
312
|
import React9 from "react";
|
|
310
|
-
import { View as View9
|
|
313
|
+
import { View as View9 } from "react-native";
|
|
311
314
|
|
|
312
315
|
// src/components/view/rounded-view/rounded-view.hook.ts
|
|
313
316
|
import { useMemo } from "react";
|
|
@@ -347,7 +350,8 @@ var RoundedView = ({
|
|
|
347
350
|
bottomRight,
|
|
348
351
|
fullWidth = false,
|
|
349
352
|
backgroundColor,
|
|
350
|
-
style
|
|
353
|
+
style,
|
|
354
|
+
noGrowth = false
|
|
351
355
|
}) => {
|
|
352
356
|
const borderRadiusStyle = useRoundedViewStyle({
|
|
353
357
|
all,
|
|
@@ -365,7 +369,8 @@ var RoundedView = ({
|
|
|
365
369
|
{
|
|
366
370
|
style: [
|
|
367
371
|
borderRadiusStyle,
|
|
368
|
-
fullWidth &&
|
|
372
|
+
fullWidth && { width: "100%" },
|
|
373
|
+
noGrowth ? void 0 : { flex: 1 },
|
|
369
374
|
backgroundColor && { backgroundColor },
|
|
370
375
|
style
|
|
371
376
|
]
|
|
@@ -373,14 +378,6 @@ var RoundedView = ({
|
|
|
373
378
|
children
|
|
374
379
|
);
|
|
375
380
|
};
|
|
376
|
-
var styles2 = StyleSheet2.create({
|
|
377
|
-
fullWidth: {
|
|
378
|
-
flexGrow: 1,
|
|
379
|
-
flexShrink: 1,
|
|
380
|
-
flexBasis: "auto",
|
|
381
|
-
width: "100%"
|
|
382
|
-
}
|
|
383
|
-
});
|
|
384
381
|
|
|
385
382
|
// src/components/view/aspect-ratio/aspect-ratio.tsx
|
|
386
383
|
import React10 from "react";
|
|
@@ -436,14 +433,19 @@ Surface.displayName = "Surface";
|
|
|
436
433
|
// src/components/view/center/center.tsx
|
|
437
434
|
import React12 from "react";
|
|
438
435
|
import { View as View12 } from "react-native";
|
|
439
|
-
var Center = ({
|
|
436
|
+
var Center = ({
|
|
437
|
+
children,
|
|
438
|
+
fullWidth,
|
|
439
|
+
style,
|
|
440
|
+
noGrowth = false
|
|
441
|
+
}) => {
|
|
440
442
|
const fullWidthStyle = fullWidth ? { width: "100%" } : void 0;
|
|
441
443
|
return /* @__PURE__ */ React12.createElement(
|
|
442
444
|
View12,
|
|
443
445
|
{
|
|
444
446
|
style: [
|
|
445
447
|
{
|
|
446
|
-
flex: 1,
|
|
448
|
+
flex: noGrowth ? void 0 : 1,
|
|
447
449
|
alignItems: "center",
|
|
448
450
|
justifyContent: "center"
|
|
449
451
|
},
|
|
@@ -579,7 +581,7 @@ var Grid = ({
|
|
|
579
581
|
import React15, { useMemo as useMemo3 } from "react";
|
|
580
582
|
import {
|
|
581
583
|
FlatList,
|
|
582
|
-
StyleSheet as
|
|
584
|
+
StyleSheet as StyleSheet2,
|
|
583
585
|
View as View15
|
|
584
586
|
} from "react-native";
|
|
585
587
|
var getSafeColumns2 = (columns) => {
|
|
@@ -685,7 +687,7 @@ var GridBuilder = ({
|
|
|
685
687
|
];
|
|
686
688
|
return /* @__PURE__ */ React15.createElement(View15, { style: wrapperStyle }, element);
|
|
687
689
|
};
|
|
688
|
-
const flattenedStyle =
|
|
690
|
+
const flattenedStyle = StyleSheet2.flatten(style) ?? {};
|
|
689
691
|
const {
|
|
690
692
|
alignItems,
|
|
691
693
|
justifyContent,
|