@xaui/native 0.2.5 → 0.2.6
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 +297 -119
- package/dist/view/index.d.cts +175 -101
- package/dist/view/index.d.ts +175 -101
- package/dist/view/index.js +368 -190
- package/package.json +3 -8
- package/dist/container/index.cjs +0 -203
- package/dist/container/index.d.cts +0 -40
- package/dist/container/index.d.ts +0 -40
- package/dist/container/index.js +0 -203
package/dist/view/index.js
CHANGED
|
@@ -4,9 +4,210 @@ import {
|
|
|
4
4
|
useXUITheme
|
|
5
5
|
} from "../chunk-RBSA4NH4.js";
|
|
6
6
|
|
|
7
|
-
// src/components/view/
|
|
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
|
+
|
|
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;
|
|
33
|
+
};
|
|
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" }
|
|
44
|
+
};
|
|
45
|
+
var toFlexPosition = (v) => {
|
|
46
|
+
if (v <= 0) return "flex-start";
|
|
47
|
+
if (v >= 1) return "flex-end";
|
|
48
|
+
return "center";
|
|
49
|
+
};
|
|
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;
|
|
134
|
+
};
|
|
135
|
+
|
|
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 && { transform: resolveTransform(props.transform) }
|
|
156
|
+
});
|
|
157
|
+
var Container = (props) => {
|
|
158
|
+
const {
|
|
159
|
+
children,
|
|
160
|
+
onPress,
|
|
161
|
+
onLongPress,
|
|
162
|
+
onPressIn,
|
|
163
|
+
onPressOut,
|
|
164
|
+
disabled = false,
|
|
165
|
+
accessibilityLabel,
|
|
166
|
+
accessibilityRole,
|
|
167
|
+
accessibilityState,
|
|
168
|
+
accessible,
|
|
169
|
+
testID,
|
|
170
|
+
style
|
|
171
|
+
} = props;
|
|
172
|
+
const containerStyle = buildStyle(props);
|
|
173
|
+
const isInteractive = !!(onPress ?? onLongPress ?? onPressIn ?? onPressOut);
|
|
174
|
+
if (isInteractive) {
|
|
175
|
+
return /* @__PURE__ */ React.createElement(
|
|
176
|
+
Pressable,
|
|
177
|
+
{
|
|
178
|
+
onPress: disabled ? void 0 : onPress,
|
|
179
|
+
onLongPress: disabled ? void 0 : onLongPress,
|
|
180
|
+
onPressIn: disabled ? void 0 : onPressIn,
|
|
181
|
+
onPressOut: disabled ? void 0 : onPressOut,
|
|
182
|
+
disabled,
|
|
183
|
+
accessibilityLabel,
|
|
184
|
+
accessibilityRole,
|
|
185
|
+
accessibilityState,
|
|
186
|
+
accessible,
|
|
187
|
+
testID,
|
|
188
|
+
style: [containerStyle, style]
|
|
189
|
+
},
|
|
190
|
+
children
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
return /* @__PURE__ */ React.createElement(
|
|
194
|
+
View,
|
|
195
|
+
{
|
|
196
|
+
accessibilityLabel,
|
|
197
|
+
accessibilityRole,
|
|
198
|
+
accessibilityState,
|
|
199
|
+
accessible,
|
|
200
|
+
testID,
|
|
201
|
+
style: [containerStyle, style]
|
|
202
|
+
},
|
|
203
|
+
children
|
|
204
|
+
);
|
|
205
|
+
};
|
|
206
|
+
Container.displayName = "Container";
|
|
207
|
+
|
|
208
|
+
// src/components/view/column/column.tsx
|
|
209
|
+
import React2 from "react";
|
|
210
|
+
import { View as View2 } from "react-native";
|
|
10
211
|
|
|
11
212
|
// src/components/view/layout-utils.ts
|
|
12
213
|
var MAIN_AXIS_JUSTIFY_MAP = {
|
|
@@ -44,8 +245,8 @@ var Column = ({
|
|
|
44
245
|
}) => {
|
|
45
246
|
const gapStyle = spacing === void 0 ? void 0 : { gap: spacing };
|
|
46
247
|
const fullWidthStyle = fullWidth ? { width: "100%" } : void 0;
|
|
47
|
-
return /* @__PURE__ */
|
|
48
|
-
|
|
248
|
+
return /* @__PURE__ */ React2.createElement(
|
|
249
|
+
View2,
|
|
49
250
|
{
|
|
50
251
|
style: [
|
|
51
252
|
{
|
|
@@ -64,8 +265,8 @@ var Column = ({
|
|
|
64
265
|
};
|
|
65
266
|
|
|
66
267
|
// src/components/view/row/row.tsx
|
|
67
|
-
import
|
|
68
|
-
import { View as
|
|
268
|
+
import React3 from "react";
|
|
269
|
+
import { View as View3 } from "react-native";
|
|
69
270
|
var Row = ({
|
|
70
271
|
children,
|
|
71
272
|
mainAxisAlignment,
|
|
@@ -77,8 +278,8 @@ var Row = ({
|
|
|
77
278
|
}) => {
|
|
78
279
|
const gapStyle = spacing === void 0 ? void 0 : { gap: spacing };
|
|
79
280
|
const fullWidthStyle = fullWidth ? { flexShrink: 1, flexBasis: "auto", width: "100%" } : void 0;
|
|
80
|
-
return /* @__PURE__ */
|
|
81
|
-
|
|
281
|
+
return /* @__PURE__ */ React3.createElement(
|
|
282
|
+
View3,
|
|
82
283
|
{
|
|
83
284
|
style: [
|
|
84
285
|
{
|
|
@@ -96,11 +297,11 @@ var Row = ({
|
|
|
96
297
|
};
|
|
97
298
|
|
|
98
299
|
// src/components/view/spacer/spacer.tsx
|
|
99
|
-
import
|
|
100
|
-
import { View as
|
|
300
|
+
import React4 from "react";
|
|
301
|
+
import { View as View4 } from "react-native";
|
|
101
302
|
var Spacer = ({ flex = 1, style }) => {
|
|
102
|
-
return /* @__PURE__ */
|
|
103
|
-
|
|
303
|
+
return /* @__PURE__ */ React4.createElement(
|
|
304
|
+
View4,
|
|
104
305
|
{
|
|
105
306
|
style: [
|
|
106
307
|
{
|
|
@@ -116,116 +317,87 @@ var Spacer = ({ flex = 1, style }) => {
|
|
|
116
317
|
Spacer.displayName = "Spacer";
|
|
117
318
|
|
|
118
319
|
// src/components/view/padding/padding.tsx
|
|
119
|
-
import
|
|
120
|
-
import { View as
|
|
121
|
-
var Padding = ({
|
|
122
|
-
children,
|
|
123
|
-
all,
|
|
124
|
-
horizontal,
|
|
125
|
-
vertical,
|
|
126
|
-
top,
|
|
127
|
-
right,
|
|
128
|
-
bottom,
|
|
129
|
-
left,
|
|
130
|
-
fullWidth,
|
|
131
|
-
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
|
-
};
|
|
320
|
+
import React5 from "react";
|
|
321
|
+
import { View as View5 } from "react-native";
|
|
322
|
+
var Padding = ({ children, padding, style }) => /* @__PURE__ */ React5.createElement(View5, { style: [resolveEdgeInsets(padding, "padding"), style] }, children);
|
|
156
323
|
Padding.displayName = "Padding";
|
|
157
324
|
|
|
158
325
|
// src/components/view/margin/margin.tsx
|
|
159
|
-
import
|
|
160
|
-
import { View as
|
|
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
|
-
};
|
|
326
|
+
import React6 from "react";
|
|
327
|
+
import { View as View6 } from "react-native";
|
|
328
|
+
var Margin = ({ children, margin, style }) => /* @__PURE__ */ React6.createElement(View6, { style: [resolveEdgeInsets(margin, "margin"), style] }, children);
|
|
196
329
|
Margin.displayName = "Margin";
|
|
197
330
|
|
|
198
331
|
// src/components/view/sized-box/sized-box.tsx
|
|
199
|
-
import
|
|
200
|
-
import { View as
|
|
332
|
+
import React7 from "react";
|
|
333
|
+
import { View as View7 } from "react-native";
|
|
201
334
|
var SizedBox = ({
|
|
202
335
|
children,
|
|
203
336
|
width,
|
|
204
337
|
height,
|
|
205
|
-
|
|
206
|
-
|
|
338
|
+
expand,
|
|
339
|
+
shrink,
|
|
340
|
+
style,
|
|
341
|
+
testID
|
|
207
342
|
}) => {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
height
|
|
216
|
-
},
|
|
217
|
-
fullWidthStyle,
|
|
218
|
-
style
|
|
219
|
-
]
|
|
220
|
-
},
|
|
221
|
-
children
|
|
222
|
-
);
|
|
343
|
+
if (shrink) {
|
|
344
|
+
return /* @__PURE__ */ React7.createElement(View7, { testID, style: [{ width: 0, height: 0, overflow: "hidden" }, style] }, children);
|
|
345
|
+
}
|
|
346
|
+
if (expand) {
|
|
347
|
+
return /* @__PURE__ */ React7.createElement(View7, { testID, style: [{ flex: 1, alignSelf: "stretch" }, style] }, children);
|
|
348
|
+
}
|
|
349
|
+
return /* @__PURE__ */ React7.createElement(View7, { testID, style: [{ width, height }, style] }, children);
|
|
223
350
|
};
|
|
224
351
|
SizedBox.displayName = "SizedBox";
|
|
225
352
|
|
|
353
|
+
// src/components/view/constrained-box/constrained-box.tsx
|
|
354
|
+
import React8 from "react";
|
|
355
|
+
import { View as View8 } from "react-native";
|
|
356
|
+
var ConstrainedBox = ({
|
|
357
|
+
children,
|
|
358
|
+
constraints,
|
|
359
|
+
style,
|
|
360
|
+
testID
|
|
361
|
+
}) => /* @__PURE__ */ React8.createElement(
|
|
362
|
+
View8,
|
|
363
|
+
{
|
|
364
|
+
testID,
|
|
365
|
+
style: [
|
|
366
|
+
{
|
|
367
|
+
minWidth: constraints.minWidth,
|
|
368
|
+
maxWidth: constraints.maxWidth,
|
|
369
|
+
minHeight: constraints.minHeight,
|
|
370
|
+
maxHeight: constraints.maxHeight
|
|
371
|
+
},
|
|
372
|
+
style
|
|
373
|
+
]
|
|
374
|
+
},
|
|
375
|
+
children
|
|
376
|
+
);
|
|
377
|
+
ConstrainedBox.displayName = "ConstrainedBox";
|
|
378
|
+
|
|
379
|
+
// src/components/view/fractionally-sized-box/fractionally-sized-box.tsx
|
|
380
|
+
import React9 from "react";
|
|
381
|
+
import { View as View9 } from "react-native";
|
|
382
|
+
var FractionallySizedBox = ({
|
|
383
|
+
children,
|
|
384
|
+
widthFactor,
|
|
385
|
+
heightFactor,
|
|
386
|
+
alignment,
|
|
387
|
+
style,
|
|
388
|
+
testID
|
|
389
|
+
}) => {
|
|
390
|
+
const sizedStyle = {};
|
|
391
|
+
if (widthFactor !== void 0) sizedStyle.width = `${widthFactor * 100}%`;
|
|
392
|
+
if (heightFactor !== void 0) sizedStyle.height = `${heightFactor * 100}%`;
|
|
393
|
+
const alignStyle = alignment ? resolveAlignment(alignment) : {};
|
|
394
|
+
return /* @__PURE__ */ React9.createElement(View9, { testID, style: [sizedStyle, alignStyle, style] }, children);
|
|
395
|
+
};
|
|
396
|
+
FractionallySizedBox.displayName = "FractionallySizedBox";
|
|
397
|
+
|
|
226
398
|
// src/components/view/positioned-view/positioned-view.tsx
|
|
227
|
-
import
|
|
228
|
-
import { View as
|
|
399
|
+
import React10 from "react";
|
|
400
|
+
import { View as View10 } from "react-native";
|
|
229
401
|
var PositionedView = ({
|
|
230
402
|
children,
|
|
231
403
|
top,
|
|
@@ -235,8 +407,8 @@ var PositionedView = ({
|
|
|
235
407
|
zIndex,
|
|
236
408
|
style
|
|
237
409
|
}) => {
|
|
238
|
-
return /* @__PURE__ */
|
|
239
|
-
|
|
410
|
+
return /* @__PURE__ */ React10.createElement(
|
|
411
|
+
View10,
|
|
240
412
|
{
|
|
241
413
|
style: [
|
|
242
414
|
{
|
|
@@ -256,8 +428,8 @@ var PositionedView = ({
|
|
|
256
428
|
PositionedView.displayName = "PositionedView";
|
|
257
429
|
|
|
258
430
|
// src/components/view/blur-view/blur-view.tsx
|
|
259
|
-
import
|
|
260
|
-
import { Animated, StyleSheet, View as
|
|
431
|
+
import React11, { useEffect, useRef } from "react";
|
|
432
|
+
import { Animated, StyleSheet, View as View11 } from "react-native";
|
|
261
433
|
var styles = StyleSheet.create({
|
|
262
434
|
container: {
|
|
263
435
|
position: "relative"
|
|
@@ -297,20 +469,20 @@ var BlurView = ({
|
|
|
297
469
|
overlayAnim.setValue(overlayOpacity);
|
|
298
470
|
scaleAnim.setValue(0.98);
|
|
299
471
|
}, [overlayAnim, overlayOpacity, scaleAnim, unlockable]);
|
|
300
|
-
return /* @__PURE__ */
|
|
472
|
+
return /* @__PURE__ */ React11.createElement(View11, { style: [styles.container, style] }, /* @__PURE__ */ React11.createElement(Animated.View, { style: { transform: [{ scale: scaleAnim }] } }, children), /* @__PURE__ */ React11.createElement(
|
|
301
473
|
Animated.View,
|
|
302
474
|
{
|
|
303
475
|
pointerEvents: unlockable ? "none" : "auto",
|
|
304
476
|
style: [styles.overlay, { opacity: overlayAnim }]
|
|
305
477
|
},
|
|
306
|
-
/* @__PURE__ */
|
|
478
|
+
/* @__PURE__ */ React11.createElement(View11, { style: [styles.overlay, { backgroundColor: overlayColor }] })
|
|
307
479
|
));
|
|
308
480
|
};
|
|
309
481
|
BlurView.displayName = "BlurView";
|
|
310
482
|
|
|
311
483
|
// src/components/view/rounded-view/rounded-view.tsx
|
|
312
|
-
import
|
|
313
|
-
import { View as
|
|
484
|
+
import React12 from "react";
|
|
485
|
+
import { View as View12 } from "react-native";
|
|
314
486
|
|
|
315
487
|
// src/components/view/rounded-view/rounded-view.hook.ts
|
|
316
488
|
import { useMemo } from "react";
|
|
@@ -364,8 +536,8 @@ var RoundedView = ({
|
|
|
364
536
|
bottomLeft,
|
|
365
537
|
bottomRight
|
|
366
538
|
});
|
|
367
|
-
return /* @__PURE__ */
|
|
368
|
-
|
|
539
|
+
return /* @__PURE__ */ React12.createElement(
|
|
540
|
+
View12,
|
|
369
541
|
{
|
|
370
542
|
style: [
|
|
371
543
|
borderRadiusStyle,
|
|
@@ -380,19 +552,38 @@ var RoundedView = ({
|
|
|
380
552
|
};
|
|
381
553
|
|
|
382
554
|
// src/components/view/aspect-ratio/aspect-ratio.tsx
|
|
383
|
-
import
|
|
384
|
-
import { View as
|
|
555
|
+
import React13 from "react";
|
|
556
|
+
import { View as View13 } from "react-native";
|
|
385
557
|
var AspectRatio = ({
|
|
386
558
|
children,
|
|
387
559
|
ratio,
|
|
388
|
-
|
|
560
|
+
alignment,
|
|
561
|
+
clip,
|
|
562
|
+
style,
|
|
563
|
+
testID
|
|
389
564
|
}) => {
|
|
390
|
-
|
|
565
|
+
const alignStyle = alignment ? resolveAlignment(alignment) : {};
|
|
566
|
+
return /* @__PURE__ */ React13.createElement(
|
|
567
|
+
View13,
|
|
568
|
+
{
|
|
569
|
+
testID,
|
|
570
|
+
style: [
|
|
571
|
+
{
|
|
572
|
+
aspectRatio: ratio,
|
|
573
|
+
overflow: clip ? "hidden" : "visible"
|
|
574
|
+
},
|
|
575
|
+
alignStyle,
|
|
576
|
+
style
|
|
577
|
+
]
|
|
578
|
+
},
|
|
579
|
+
children
|
|
580
|
+
);
|
|
391
581
|
};
|
|
582
|
+
AspectRatio.displayName = "AspectRatio";
|
|
392
583
|
|
|
393
584
|
// src/components/view/surface/surface.tsx
|
|
394
|
-
import
|
|
395
|
-
import { View as
|
|
585
|
+
import React14 from "react";
|
|
586
|
+
import { View as View14 } from "react-native";
|
|
396
587
|
import { getSafeThemeColor } from "@xaui/core";
|
|
397
588
|
var resolveBackgroundColor = (color, theme) => {
|
|
398
589
|
if (color === "background" || color === "foreground") {
|
|
@@ -412,8 +603,8 @@ var Surface = ({
|
|
|
412
603
|
const theme = useXUITheme();
|
|
413
604
|
const radiusStyle = useBorderRadiusStyles(radius);
|
|
414
605
|
const background = resolveBackgroundColor(themeColor, theme);
|
|
415
|
-
return /* @__PURE__ */
|
|
416
|
-
|
|
606
|
+
return /* @__PURE__ */ React14.createElement(
|
|
607
|
+
View14,
|
|
417
608
|
{
|
|
418
609
|
style: [
|
|
419
610
|
radiusStyle,
|
|
@@ -431,8 +622,8 @@ var Surface = ({
|
|
|
431
622
|
Surface.displayName = "Surface";
|
|
432
623
|
|
|
433
624
|
// src/components/view/screen/screen.tsx
|
|
434
|
-
import
|
|
435
|
-
import { View as
|
|
625
|
+
import React15 from "react";
|
|
626
|
+
import { View as View15 } from "react-native";
|
|
436
627
|
import { SafeAreaView } from "react-native-safe-area-context";
|
|
437
628
|
var Screen = ({
|
|
438
629
|
children,
|
|
@@ -445,51 +636,34 @@ var Screen = ({
|
|
|
445
636
|
const resolvedBackgroundColor = backgroundColor ?? theme.colors.background;
|
|
446
637
|
const containerStyle = [{ flex: 1, backgroundColor: resolvedBackgroundColor, padding }, style];
|
|
447
638
|
if (safeArea) {
|
|
448
|
-
return /* @__PURE__ */
|
|
639
|
+
return /* @__PURE__ */ React15.createElement(SafeAreaView, { style: containerStyle }, children);
|
|
449
640
|
}
|
|
450
|
-
return /* @__PURE__ */
|
|
641
|
+
return /* @__PURE__ */ React15.createElement(View15, { style: containerStyle }, children);
|
|
451
642
|
};
|
|
452
643
|
Screen.displayName = "Screen";
|
|
453
644
|
|
|
645
|
+
// src/components/view/align/align.tsx
|
|
646
|
+
import React16 from "react";
|
|
647
|
+
import { View as View16 } from "react-native";
|
|
648
|
+
var Align = ({ children, alignment, style }) => /* @__PURE__ */ React16.createElement(View16, { style: [{ flex: 1 }, resolveAlignment(alignment), style] }, children);
|
|
649
|
+
Align.displayName = "Align";
|
|
650
|
+
|
|
454
651
|
// src/components/view/center/center.tsx
|
|
455
|
-
import
|
|
456
|
-
|
|
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
|
-
};
|
|
652
|
+
import React17 from "react";
|
|
653
|
+
var Center = ({ children, style }) => /* @__PURE__ */ React17.createElement(Align, { alignment: "center", style }, children);
|
|
480
654
|
Center.displayName = "Center";
|
|
481
655
|
|
|
482
656
|
// src/components/view/grid/grid.tsx
|
|
483
|
-
import
|
|
657
|
+
import React19, { useMemo as useMemo2, useState } from "react";
|
|
484
658
|
import {
|
|
485
|
-
View as
|
|
659
|
+
View as View18
|
|
486
660
|
} from "react-native";
|
|
487
661
|
|
|
488
662
|
// src/components/view/grid/grid-item.tsx
|
|
489
|
-
import
|
|
490
|
-
import { View as
|
|
663
|
+
import React18 from "react";
|
|
664
|
+
import { View as View17 } from "react-native";
|
|
491
665
|
var GridItem = ({ children, style }) => {
|
|
492
|
-
return /* @__PURE__ */
|
|
666
|
+
return /* @__PURE__ */ React18.createElement(View17, { style }, children);
|
|
493
667
|
};
|
|
494
668
|
GridItem.displayName = "GridItem";
|
|
495
669
|
|
|
@@ -503,7 +677,7 @@ var getSafeSpan = (span, columns) => {
|
|
|
503
677
|
return Math.min(Math.floor(span), columns);
|
|
504
678
|
};
|
|
505
679
|
var isGridItemElement = (child) => {
|
|
506
|
-
if (!
|
|
680
|
+
if (!React19.isValidElement(child)) return false;
|
|
507
681
|
if (child.type === GridItem) return true;
|
|
508
682
|
const displayName = child.type.displayName;
|
|
509
683
|
return displayName === "GridItem";
|
|
@@ -522,15 +696,15 @@ var Grid = ({
|
|
|
522
696
|
const resolvedRowSpacing = rowSpacing ?? spacing ?? 0;
|
|
523
697
|
const resolvedColumnSpacing = columnSpacing ?? spacing ?? 0;
|
|
524
698
|
const itemWidth = `${100 / safeColumns}%`;
|
|
525
|
-
const items =
|
|
699
|
+
const items = React19.Children.toArray(children);
|
|
526
700
|
const totalColumnGap = resolvedColumnSpacing * (safeColumns - 1);
|
|
527
701
|
const baseItemWidth = useMemo2(() => {
|
|
528
702
|
if (!containerWidth) return void 0;
|
|
529
703
|
return (containerWidth - totalColumnGap) / safeColumns;
|
|
530
704
|
}, [containerWidth, safeColumns, totalColumnGap]);
|
|
531
705
|
let currentColumn = 0;
|
|
532
|
-
return /* @__PURE__ */
|
|
533
|
-
|
|
706
|
+
return /* @__PURE__ */ React19.createElement(
|
|
707
|
+
View18,
|
|
534
708
|
{
|
|
535
709
|
style: [
|
|
536
710
|
{
|
|
@@ -547,7 +721,7 @@ var Grid = ({
|
|
|
547
721
|
}
|
|
548
722
|
},
|
|
549
723
|
items.map((child, index) => {
|
|
550
|
-
const key =
|
|
724
|
+
const key = React19.isValidElement(child) && child.key ? child.key : `grid-${index}`;
|
|
551
725
|
const span = isGridItemElement(child) ? getSafeSpan(child.props.span, safeColumns) : 1;
|
|
552
726
|
const spanWidth = baseItemWidth === void 0 ? `${100 / safeColumns * span}%` : baseItemWidth * span + resolvedColumnSpacing * (span - 1);
|
|
553
727
|
if (currentColumn + span > safeColumns) {
|
|
@@ -567,7 +741,7 @@ var Grid = ({
|
|
|
567
741
|
itemStyle,
|
|
568
742
|
child.props.style
|
|
569
743
|
];
|
|
570
|
-
const element2 =
|
|
744
|
+
const element2 = React19.cloneElement(child, {
|
|
571
745
|
key,
|
|
572
746
|
style: mergedStyle
|
|
573
747
|
});
|
|
@@ -575,8 +749,8 @@ var Grid = ({
|
|
|
575
749
|
return element2;
|
|
576
750
|
}
|
|
577
751
|
const defaultItemWidth = baseItemWidth === void 0 ? itemWidth : baseItemWidth;
|
|
578
|
-
const element = /* @__PURE__ */
|
|
579
|
-
|
|
752
|
+
const element = /* @__PURE__ */ React19.createElement(
|
|
753
|
+
View18,
|
|
580
754
|
{
|
|
581
755
|
key,
|
|
582
756
|
style: [
|
|
@@ -599,11 +773,11 @@ var Grid = ({
|
|
|
599
773
|
};
|
|
600
774
|
|
|
601
775
|
// src/components/view/grid/grid-builder.tsx
|
|
602
|
-
import
|
|
776
|
+
import React20, { useMemo as useMemo3 } from "react";
|
|
603
777
|
import {
|
|
604
778
|
FlatList,
|
|
605
779
|
StyleSheet as StyleSheet2,
|
|
606
|
-
View as
|
|
780
|
+
View as View19
|
|
607
781
|
} from "react-native";
|
|
608
782
|
var getSafeColumns2 = (columns) => {
|
|
609
783
|
if (!columns || columns <= 0) return 1;
|
|
@@ -690,7 +864,7 @@ var GridBuilder = ({
|
|
|
690
864
|
},
|
|
691
865
|
itemStyle
|
|
692
866
|
];
|
|
693
|
-
return /* @__PURE__ */
|
|
867
|
+
return /* @__PURE__ */ React20.createElement(View19, { style: placeholderStyle, pointerEvents: "none" });
|
|
694
868
|
}
|
|
695
869
|
const element = resolvedRenderer({ item: item.item, index: item.index });
|
|
696
870
|
if (element === null) return null;
|
|
@@ -706,7 +880,7 @@ var GridBuilder = ({
|
|
|
706
880
|
},
|
|
707
881
|
itemStyle
|
|
708
882
|
];
|
|
709
|
-
return /* @__PURE__ */
|
|
883
|
+
return /* @__PURE__ */ React20.createElement(View19, { style: wrapperStyle }, element);
|
|
710
884
|
};
|
|
711
885
|
const flattenedStyle = StyleSheet2.flatten(style) ?? {};
|
|
712
886
|
const {
|
|
@@ -727,7 +901,7 @@ var GridBuilder = ({
|
|
|
727
901
|
...columnGap !== void 0 ? { columnGap } : {}
|
|
728
902
|
};
|
|
729
903
|
const hasLayoutStyle = Object.keys(layoutStyle).length > 0;
|
|
730
|
-
return /* @__PURE__ */
|
|
904
|
+
return /* @__PURE__ */ React20.createElement(
|
|
731
905
|
FlatList,
|
|
732
906
|
{
|
|
733
907
|
data: paddedData,
|
|
@@ -747,7 +921,7 @@ var GridBuilder = ({
|
|
|
747
921
|
GridBuilder.displayName = "GridBuilder";
|
|
748
922
|
|
|
749
923
|
// src/components/view/conditional/conditional-view.tsx
|
|
750
|
-
import
|
|
924
|
+
import React21, { useEffect as useEffect2, useMemo as useMemo4, useRef as useRef2, useState as useState2 } from "react";
|
|
751
925
|
import { Animated as Animated3 } from "react-native";
|
|
752
926
|
|
|
753
927
|
// src/components/view/conditional/conditional-view.utils.ts
|
|
@@ -899,18 +1073,18 @@ var ConditionalView = ({
|
|
|
899
1073
|
if (!shouldRender) {
|
|
900
1074
|
return null;
|
|
901
1075
|
}
|
|
902
|
-
return /* @__PURE__ */
|
|
1076
|
+
return /* @__PURE__ */ React21.createElement(Animated3.View, { style: animatedStyle }, children);
|
|
903
1077
|
};
|
|
904
1078
|
|
|
905
1079
|
// src/components/view/masonry-grid/masonry-grid.tsx
|
|
906
|
-
import
|
|
907
|
-
import { View as
|
|
1080
|
+
import React22, { useMemo as useMemo5, useRef as useRef3, useState as useState3 } from "react";
|
|
1081
|
+
import { View as View20 } from "react-native";
|
|
908
1082
|
var getSafeColumns3 = (columns) => {
|
|
909
1083
|
if (!columns || columns <= 0) return 1;
|
|
910
1084
|
return Math.floor(columns);
|
|
911
1085
|
};
|
|
912
1086
|
var getItemKey = (child, index) => {
|
|
913
|
-
return
|
|
1087
|
+
return React22.isValidElement(child) && child.key ? String(child.key) : `masonry-${index}`;
|
|
914
1088
|
};
|
|
915
1089
|
var MasonryGrid = ({
|
|
916
1090
|
children,
|
|
@@ -933,7 +1107,7 @@ var MasonryGrid = ({
|
|
|
933
1107
|
return (containerWidth - totalColumnGap) / safeColumns;
|
|
934
1108
|
}, [containerWidth, safeColumns, totalColumnGap]);
|
|
935
1109
|
const items = useMemo5(
|
|
936
|
-
() =>
|
|
1110
|
+
() => React22.Children.toArray(children).map((child, index) => ({
|
|
937
1111
|
key: getItemKey(child, index),
|
|
938
1112
|
element: child
|
|
939
1113
|
})),
|
|
@@ -950,8 +1124,8 @@ var MasonryGrid = ({
|
|
|
950
1124
|
});
|
|
951
1125
|
return buckets;
|
|
952
1126
|
}, [items, layoutVersion, resolvedRowSpacing, safeColumns]);
|
|
953
|
-
return /* @__PURE__ */
|
|
954
|
-
|
|
1127
|
+
return /* @__PURE__ */ React22.createElement(
|
|
1128
|
+
View20,
|
|
955
1129
|
{
|
|
956
1130
|
style: [
|
|
957
1131
|
{
|
|
@@ -974,10 +1148,10 @@ var MasonryGrid = ({
|
|
|
974
1148
|
},
|
|
975
1149
|
columnStyle
|
|
976
1150
|
];
|
|
977
|
-
return /* @__PURE__ */
|
|
1151
|
+
return /* @__PURE__ */ React22.createElement(View20, { key: `masonry-col-${columnIndex}`, style: columnStyles }, column.map((item, index) => {
|
|
978
1152
|
const isLastRow = index === column.length - 1;
|
|
979
|
-
return /* @__PURE__ */
|
|
980
|
-
|
|
1153
|
+
return /* @__PURE__ */ React22.createElement(
|
|
1154
|
+
View20,
|
|
981
1155
|
{
|
|
982
1156
|
key: item.key,
|
|
983
1157
|
style: { marginBottom: isLastRow ? 0 : resolvedRowSpacing },
|
|
@@ -996,18 +1170,18 @@ var MasonryGrid = ({
|
|
|
996
1170
|
};
|
|
997
1171
|
|
|
998
1172
|
// src/components/view/masonry-grid/masonry-grid-item.tsx
|
|
999
|
-
import
|
|
1000
|
-
import { View as
|
|
1173
|
+
import React23 from "react";
|
|
1174
|
+
import { View as View21 } from "react-native";
|
|
1001
1175
|
var MasonryGridItem = ({
|
|
1002
1176
|
children,
|
|
1003
1177
|
style
|
|
1004
1178
|
}) => {
|
|
1005
|
-
return /* @__PURE__ */
|
|
1179
|
+
return /* @__PURE__ */ React23.createElement(View21, { style }, children);
|
|
1006
1180
|
};
|
|
1007
1181
|
MasonryGridItem.displayName = "MasonryGridItem";
|
|
1008
1182
|
|
|
1009
1183
|
// src/components/view/masonry-grid/masonry-grid-builder.tsx
|
|
1010
|
-
import
|
|
1184
|
+
import React24, { useMemo as useMemo6, useRef as useRef4 } from "react";
|
|
1011
1185
|
import {
|
|
1012
1186
|
ScrollView
|
|
1013
1187
|
} from "react-native";
|
|
@@ -1067,7 +1241,7 @@ var MasonryGridBuilder = ({
|
|
|
1067
1241
|
onEndReached();
|
|
1068
1242
|
}
|
|
1069
1243
|
};
|
|
1070
|
-
return /* @__PURE__ */
|
|
1244
|
+
return /* @__PURE__ */ React24.createElement(
|
|
1071
1245
|
ScrollView,
|
|
1072
1246
|
{
|
|
1073
1247
|
scrollEventThrottle: 16,
|
|
@@ -1079,7 +1253,7 @@ var MasonryGridBuilder = ({
|
|
|
1079
1253
|
onScroll: handleScroll
|
|
1080
1254
|
},
|
|
1081
1255
|
header,
|
|
1082
|
-
/* @__PURE__ */
|
|
1256
|
+
/* @__PURE__ */ React24.createElement(
|
|
1083
1257
|
MasonryGrid,
|
|
1084
1258
|
{
|
|
1085
1259
|
columns,
|
|
@@ -1089,18 +1263,22 @@ var MasonryGridBuilder = ({
|
|
|
1089
1263
|
style: [{ width: "100%" }, style],
|
|
1090
1264
|
columnStyle
|
|
1091
1265
|
},
|
|
1092
|
-
resolvedData.map((item, index) => /* @__PURE__ */
|
|
1266
|
+
resolvedData.map((item, index) => /* @__PURE__ */ React24.createElement(MasonryGridItem, { key: resolvedKeyExtractor(item, index) }, resolvedRenderer({ item, index })))
|
|
1093
1267
|
),
|
|
1094
1268
|
footer
|
|
1095
1269
|
);
|
|
1096
1270
|
};
|
|
1097
1271
|
MasonryGridBuilder.displayName = "MasonryGridBuilder";
|
|
1098
1272
|
export {
|
|
1273
|
+
Align,
|
|
1099
1274
|
AspectRatio,
|
|
1100
1275
|
BlurView,
|
|
1101
1276
|
Center,
|
|
1102
1277
|
Column,
|
|
1103
1278
|
ConditionalView,
|
|
1279
|
+
ConstrainedBox,
|
|
1280
|
+
Container,
|
|
1281
|
+
FractionallySizedBox,
|
|
1104
1282
|
Grid,
|
|
1105
1283
|
GridBuilder,
|
|
1106
1284
|
GridItem,
|