@almadar/mobile 1.1.0 → 1.2.3
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/README.md +1 -1
- package/dist/{chunk-S2IT7WZT.js → chunk-5JVEVV74.js} +1 -1
- package/dist/{chunk-DY52O4T3.js → chunk-5U5Z65ZO.js} +46 -83
- package/dist/chunk-5U5Z65ZO.js.map +1 -0
- package/dist/chunk-A56SRZKI.js +59 -0
- package/dist/chunk-A56SRZKI.js.map +1 -0
- package/dist/{chunk-DMLYJFYQ.js → chunk-BFRVXKSP.js} +594 -88
- package/dist/chunk-BFRVXKSP.js.map +1 -0
- package/dist/{chunk-YMJZLYLV.js → chunk-ETD72PHO.js} +1991 -466
- package/dist/chunk-ETD72PHO.js.map +1 -0
- package/dist/{chunk-LFHVNHVA.js → chunk-GMR5FKKB.js} +3 -83
- package/dist/chunk-GMR5FKKB.js.map +1 -0
- package/dist/chunk-K2JGK2QD.js +17 -0
- package/dist/chunk-K2JGK2QD.js.map +1 -0
- package/dist/chunk-MLTSQPVN.js +337 -0
- package/dist/chunk-MLTSQPVN.js.map +1 -0
- package/dist/{chunk-T77JPOTP.js → chunk-PBO6ZN2M.js} +1206 -1269
- package/dist/chunk-PBO6ZN2M.js.map +1 -0
- package/dist/{chunk-7C5JCLLY.js → chunk-QUFLYKWA.js} +125 -45
- package/dist/chunk-QUFLYKWA.js.map +1 -0
- package/dist/chunk-TRYFJDL3.js +7 -0
- package/dist/chunk-TRYFJDL3.js.map +1 -0
- package/dist/components/atoms/AnimatedCounter.d.ts +15 -0
- package/dist/components/atoms/AnimatedCounter.d.ts.map +1 -0
- package/dist/components/atoms/DayCell.d.ts +18 -0
- package/dist/components/atoms/DayCell.d.ts.map +1 -0
- package/dist/components/atoms/InfiniteScrollSentinel.d.ts +14 -0
- package/dist/components/atoms/InfiniteScrollSentinel.d.ts.map +1 -0
- package/dist/components/atoms/RangeSlider.d.ts +20 -0
- package/dist/components/atoms/RangeSlider.d.ts.map +1 -0
- package/dist/components/atoms/StatusDot.d.ts +16 -0
- package/dist/components/atoms/StatusDot.d.ts.map +1 -0
- package/dist/components/atoms/TextHighlight.d.ts +17 -0
- package/dist/components/atoms/TextHighlight.d.ts.map +1 -0
- package/dist/components/atoms/ThemeToggle.d.ts +13 -0
- package/dist/components/atoms/ThemeToggle.d.ts.map +1 -0
- package/dist/components/atoms/TrendIndicator.d.ts +16 -0
- package/dist/components/atoms/TrendIndicator.d.ts.map +1 -0
- package/dist/components/atoms/TypewriterText.d.ts +16 -0
- package/dist/components/atoms/TypewriterText.d.ts.map +1 -0
- package/dist/components/atoms/index.d.ts +18 -0
- package/dist/components/atoms/index.d.ts.map +1 -1
- package/dist/components/atoms/index.js +30 -10
- package/dist/components/index.js +59 -18
- package/dist/components/molecules/Accordion.d.ts +20 -0
- package/dist/components/molecules/Accordion.d.ts.map +1 -0
- package/dist/components/molecules/CalendarGrid.d.ts +22 -0
- package/dist/components/molecules/CalendarGrid.d.ts.map +1 -0
- package/dist/components/molecules/Carousel.d.ts +17 -0
- package/dist/components/molecules/Carousel.d.ts.map +1 -0
- package/dist/components/molecules/DataGrid.d.ts +43 -0
- package/dist/components/molecules/DataGrid.d.ts.map +1 -0
- package/dist/components/molecules/DataList.d.ts +43 -0
- package/dist/components/molecules/DataList.d.ts.map +1 -0
- package/dist/components/molecules/FlipCard.d.ts +16 -0
- package/dist/components/molecules/FlipCard.d.ts.map +1 -0
- package/dist/components/molecules/Lightbox.d.ts +19 -0
- package/dist/components/molecules/Lightbox.d.ts.map +1 -0
- package/dist/components/molecules/NumberStepper.d.ts +19 -0
- package/dist/components/molecules/NumberStepper.d.ts.map +1 -0
- package/dist/components/molecules/PullToRefresh.d.ts +14 -0
- package/dist/components/molecules/PullToRefresh.d.ts.map +1 -0
- package/dist/components/molecules/SortableList.d.ts +17 -0
- package/dist/components/molecules/SortableList.d.ts.map +1 -0
- package/dist/components/molecules/StarRating.d.ts +19 -0
- package/dist/components/molecules/StarRating.d.ts.map +1 -0
- package/dist/components/molecules/SwipeableRow.d.ts +20 -0
- package/dist/components/molecules/SwipeableRow.d.ts.map +1 -0
- package/dist/components/molecules/index.d.ts +24 -0
- package/dist/components/molecules/index.d.ts.map +1 -1
- package/dist/components/molecules/index.js +30 -5
- package/dist/components/organisms/FormSection.d.ts +7 -0
- package/dist/components/organisms/FormSection.d.ts.map +1 -1
- package/dist/components/organisms/index.d.ts +0 -4
- package/dist/components/organisms/index.d.ts.map +1 -1
- package/dist/components/organisms/index.js +4 -8
- package/dist/index.js +72 -26
- package/dist/index.js.map +1 -1
- package/dist/lib/getNestedValue.d.ts +5 -0
- package/dist/lib/getNestedValue.d.ts.map +1 -0
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +6 -2
- package/dist/providers/ThemeProvider.d.ts +7 -0
- package/dist/providers/ThemeProvider.d.ts.map +1 -1
- package/dist/providers/index.d.ts +2 -2
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +8 -4
- package/package.json +31 -30
- package/dist/chunk-6RVITGGH.js +0 -167
- package/dist/chunk-6RVITGGH.js.map +0 -1
- package/dist/chunk-7C5JCLLY.js.map +0 -1
- package/dist/chunk-DMLYJFYQ.js.map +0 -1
- package/dist/chunk-DY52O4T3.js.map +0 -1
- package/dist/chunk-LFHVNHVA.js.map +0 -1
- package/dist/chunk-T77JPOTP.js.map +0 -1
- package/dist/chunk-VLUJ7BXN.js +0 -36
- package/dist/chunk-VLUJ7BXN.js.map +0 -1
- package/dist/chunk-YMJZLYLV.js.map +0 -1
- package/dist/components/organisms/EntityCard.d.ts +0 -11
- package/dist/components/organisms/EntityCard.d.ts.map +0 -1
- package/dist/components/organisms/EntityList.d.ts +0 -17
- package/dist/components/organisms/EntityList.d.ts.map +0 -1
- /package/dist/{chunk-S2IT7WZT.js.map → chunk-5JVEVV74.js.map} +0 -0
|
@@ -1,23 +1,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getNestedValue
|
|
3
|
+
} from "./chunk-K2JGK2QD.js";
|
|
1
4
|
import {
|
|
2
5
|
ControlButton,
|
|
6
|
+
DayCell,
|
|
7
|
+
InfiniteScrollSentinel,
|
|
3
8
|
Label
|
|
4
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-MLTSQPVN.js";
|
|
5
10
|
import {
|
|
6
11
|
EmptyState
|
|
7
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-5U5Z65ZO.js";
|
|
8
13
|
import {
|
|
9
14
|
Badge,
|
|
10
15
|
Button,
|
|
11
16
|
Card,
|
|
17
|
+
Divider,
|
|
12
18
|
ErrorState,
|
|
13
19
|
HStack,
|
|
20
|
+
Icon,
|
|
14
21
|
Input,
|
|
15
22
|
LoadingState,
|
|
16
23
|
ProgressBar,
|
|
17
24
|
Select,
|
|
18
25
|
Typography,
|
|
19
26
|
VStack
|
|
20
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-QUFLYKWA.js";
|
|
21
28
|
import {
|
|
22
29
|
useEventBus
|
|
23
30
|
} from "./chunk-YTVYMEKU.js";
|
|
@@ -25,8 +32,44 @@ import {
|
|
|
25
32
|
useTheme
|
|
26
33
|
} from "./chunk-CUAWHLEK.js";
|
|
27
34
|
|
|
28
|
-
// src/components/molecules/
|
|
35
|
+
// src/components/molecules/List.tsx
|
|
29
36
|
import React from "react";
|
|
37
|
+
import {
|
|
38
|
+
FlatList
|
|
39
|
+
} from "react-native";
|
|
40
|
+
function List({
|
|
41
|
+
data,
|
|
42
|
+
renderItem,
|
|
43
|
+
keyExtractor,
|
|
44
|
+
isLoading,
|
|
45
|
+
isError,
|
|
46
|
+
onRetry,
|
|
47
|
+
emptyMessage = "No items found",
|
|
48
|
+
...flatListProps
|
|
49
|
+
}) {
|
|
50
|
+
if (isLoading) {
|
|
51
|
+
return /* @__PURE__ */ React.createElement(LoadingState, null);
|
|
52
|
+
}
|
|
53
|
+
if (isError) {
|
|
54
|
+
return /* @__PURE__ */ React.createElement(ErrorState, { onRetry });
|
|
55
|
+
}
|
|
56
|
+
if (!data || data.length === 0) {
|
|
57
|
+
return /* @__PURE__ */ React.createElement(EmptyState, { message: emptyMessage });
|
|
58
|
+
}
|
|
59
|
+
return /* @__PURE__ */ React.createElement(
|
|
60
|
+
FlatList,
|
|
61
|
+
{
|
|
62
|
+
data,
|
|
63
|
+
renderItem: ({ item }) => renderItem(item),
|
|
64
|
+
keyExtractor,
|
|
65
|
+
...flatListProps
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
List.displayName = "List";
|
|
70
|
+
|
|
71
|
+
// src/components/molecules/FormField.tsx
|
|
72
|
+
import React2 from "react";
|
|
30
73
|
import { View, StyleSheet } from "react-native";
|
|
31
74
|
var FormField = ({
|
|
32
75
|
label,
|
|
@@ -36,7 +79,7 @@ var FormField = ({
|
|
|
36
79
|
children,
|
|
37
80
|
style
|
|
38
81
|
}) => {
|
|
39
|
-
return /* @__PURE__ */
|
|
82
|
+
return /* @__PURE__ */ React2.createElement(VStack, { spacing: 6, style: [styles.container, style] }, label && /* @__PURE__ */ React2.createElement(View, { style: styles.labelContainer }, /* @__PURE__ */ React2.createElement(Typography, { variant: "label" }, label, required && /* @__PURE__ */ React2.createElement(Typography, { variant: "label", color: "#ef4444" }, " *"))), children, error ? /* @__PURE__ */ React2.createElement(Typography, { variant: "caption", color: "#ef4444" }, error) : helperText ? /* @__PURE__ */ React2.createElement(Typography, { variant: "caption", color: "#6b7280" }, helperText) : null);
|
|
40
83
|
};
|
|
41
84
|
var styles = StyleSheet.create({
|
|
42
85
|
container: {
|
|
@@ -49,7 +92,7 @@ var styles = StyleSheet.create({
|
|
|
49
92
|
FormField.displayName = "FormField";
|
|
50
93
|
|
|
51
94
|
// src/components/molecules/FormSectionHeader.tsx
|
|
52
|
-
import
|
|
95
|
+
import React3 from "react";
|
|
53
96
|
import { View as View2, StyleSheet as StyleSheet2 } from "react-native";
|
|
54
97
|
var FormSectionHeader = ({
|
|
55
98
|
title,
|
|
@@ -60,19 +103,19 @@ var FormSectionHeader = ({
|
|
|
60
103
|
}) => {
|
|
61
104
|
const theme = useTheme();
|
|
62
105
|
if (isLoading) {
|
|
63
|
-
return /* @__PURE__ */
|
|
106
|
+
return /* @__PURE__ */ React3.createElement(View2, { style: [styles2.container, style] }, /* @__PURE__ */ React3.createElement(LoadingState, { message: "Loading..." }));
|
|
64
107
|
}
|
|
65
108
|
if (error) {
|
|
66
|
-
return /* @__PURE__ */
|
|
109
|
+
return /* @__PURE__ */ React3.createElement(View2, { style: [styles2.container, style] }, /* @__PURE__ */ React3.createElement(ErrorState, { message: error.message }));
|
|
67
110
|
}
|
|
68
|
-
return /* @__PURE__ */
|
|
111
|
+
return /* @__PURE__ */ React3.createElement(View2, { style: [styles2.container, style] }, /* @__PURE__ */ React3.createElement(
|
|
69
112
|
Typography,
|
|
70
113
|
{
|
|
71
114
|
variant: "h4",
|
|
72
115
|
style: { color: theme.colors.foreground }
|
|
73
116
|
},
|
|
74
117
|
title
|
|
75
|
-
), subtitle && /* @__PURE__ */
|
|
118
|
+
), subtitle && /* @__PURE__ */ React3.createElement(
|
|
76
119
|
Typography,
|
|
77
120
|
{
|
|
78
121
|
variant: "caption",
|
|
@@ -92,7 +135,7 @@ var styles2 = StyleSheet2.create({
|
|
|
92
135
|
FormSectionHeader.displayName = "FormSectionHeader";
|
|
93
136
|
|
|
94
137
|
// src/components/molecules/InputGroup.tsx
|
|
95
|
-
import
|
|
138
|
+
import React4 from "react";
|
|
96
139
|
import { View as View3, StyleSheet as StyleSheet3 } from "react-native";
|
|
97
140
|
var InputGroup = ({
|
|
98
141
|
label,
|
|
@@ -106,20 +149,20 @@ var InputGroup = ({
|
|
|
106
149
|
}) => {
|
|
107
150
|
const theme = useTheme();
|
|
108
151
|
if (isLoading) {
|
|
109
|
-
return /* @__PURE__ */
|
|
152
|
+
return /* @__PURE__ */ React4.createElement(View3, { style: [styles3.container, style] }, /* @__PURE__ */ React4.createElement(LoadingState, { message: "Loading..." }));
|
|
110
153
|
}
|
|
111
154
|
if (error) {
|
|
112
|
-
return /* @__PURE__ */
|
|
155
|
+
return /* @__PURE__ */ React4.createElement(View3, { style: [styles3.container, style] }, /* @__PURE__ */ React4.createElement(ErrorState, { message: error.message }));
|
|
113
156
|
}
|
|
114
157
|
const errorText = error?.message || errorMessage;
|
|
115
|
-
return /* @__PURE__ */
|
|
158
|
+
return /* @__PURE__ */ React4.createElement(VStack, { spacing: 4, style: [styles3.container, style] }, label && /* @__PURE__ */ React4.createElement(Label, { required }, label), children, errorText ? /* @__PURE__ */ React4.createElement(
|
|
116
159
|
Typography,
|
|
117
160
|
{
|
|
118
161
|
variant: "caption",
|
|
119
162
|
style: { color: theme.colors.error }
|
|
120
163
|
},
|
|
121
164
|
errorText
|
|
122
|
-
) : helperText ? /* @__PURE__ */
|
|
165
|
+
) : helperText ? /* @__PURE__ */ React4.createElement(
|
|
123
166
|
Typography,
|
|
124
167
|
{
|
|
125
168
|
variant: "caption",
|
|
@@ -136,7 +179,7 @@ var styles3 = StyleSheet3.create({
|
|
|
136
179
|
InputGroup.displayName = "InputGroup";
|
|
137
180
|
|
|
138
181
|
// src/components/molecules/Alert.tsx
|
|
139
|
-
import
|
|
182
|
+
import React5 from "react";
|
|
140
183
|
import {
|
|
141
184
|
View as View4,
|
|
142
185
|
TouchableOpacity,
|
|
@@ -186,12 +229,12 @@ var Alert = ({
|
|
|
186
229
|
};
|
|
187
230
|
const { bg, border } = variantStyles[variant];
|
|
188
231
|
if (isLoading) {
|
|
189
|
-
return /* @__PURE__ */
|
|
232
|
+
return /* @__PURE__ */ React5.createElement(View4, { style: [styles4.container, style] }, /* @__PURE__ */ React5.createElement(LoadingState, { message: "Loading..." }));
|
|
190
233
|
}
|
|
191
234
|
if (error) {
|
|
192
|
-
return /* @__PURE__ */
|
|
235
|
+
return /* @__PURE__ */ React5.createElement(View4, { style: [styles4.container, style] }, /* @__PURE__ */ React5.createElement(ErrorState, { message: error.message }));
|
|
193
236
|
}
|
|
194
|
-
return /* @__PURE__ */
|
|
237
|
+
return /* @__PURE__ */ React5.createElement(
|
|
195
238
|
View4,
|
|
196
239
|
{
|
|
197
240
|
style: [
|
|
@@ -204,7 +247,7 @@ var Alert = ({
|
|
|
204
247
|
style
|
|
205
248
|
]
|
|
206
249
|
},
|
|
207
|
-
/* @__PURE__ */
|
|
250
|
+
/* @__PURE__ */ React5.createElement(HStack, { spacing: 12, align: "flex-start" }, /* @__PURE__ */ React5.createElement(View4, { style: [styles4.icon, { backgroundColor: bg }] }, /* @__PURE__ */ React5.createElement(Typography, { variant: "body", style: { color: theme.colors["info-foreground"] } }, variantStyles[variant].icon)), /* @__PURE__ */ React5.createElement(View4, { style: styles4.content }, title && /* @__PURE__ */ React5.createElement(Typography, { variant: "h4", style: { color: theme.colors.foreground } }, title), /* @__PURE__ */ React5.createElement(Typography, { variant: "body", style: { color: theme.colors.foreground } }, message)), dismissible && /* @__PURE__ */ React5.createElement(TouchableOpacity, { onPress: handleDismiss, style: styles4.dismiss }, /* @__PURE__ */ React5.createElement(Typography, { variant: "body", style: { color: theme.colors["muted-foreground"] } }, "\u2715")))
|
|
208
251
|
);
|
|
209
252
|
};
|
|
210
253
|
var styles4 = StyleSheet4.create({
|
|
@@ -230,7 +273,7 @@ var styles4 = StyleSheet4.create({
|
|
|
230
273
|
Alert.displayName = "Alert";
|
|
231
274
|
|
|
232
275
|
// src/components/molecules/Skeleton.tsx
|
|
233
|
-
import
|
|
276
|
+
import React6, { useEffect } from "react";
|
|
234
277
|
import {
|
|
235
278
|
View as View5,
|
|
236
279
|
StyleSheet as StyleSheet5,
|
|
@@ -244,7 +287,7 @@ var Skeleton = ({
|
|
|
244
287
|
style
|
|
245
288
|
}) => {
|
|
246
289
|
const theme = useTheme();
|
|
247
|
-
const shimmer =
|
|
290
|
+
const shimmer = React6.useRef(new Animated.Value(0)).current;
|
|
248
291
|
useEffect(() => {
|
|
249
292
|
const animation = Animated.loop(
|
|
250
293
|
Animated.timing(shimmer, {
|
|
@@ -261,7 +304,7 @@ var Skeleton = ({
|
|
|
261
304
|
inputRange: [0, 1],
|
|
262
305
|
outputRange: [-200, 200]
|
|
263
306
|
});
|
|
264
|
-
return /* @__PURE__ */
|
|
307
|
+
return /* @__PURE__ */ React6.createElement(
|
|
265
308
|
View5,
|
|
266
309
|
{
|
|
267
310
|
style: [
|
|
@@ -275,7 +318,7 @@ var Skeleton = ({
|
|
|
275
318
|
style
|
|
276
319
|
]
|
|
277
320
|
},
|
|
278
|
-
/* @__PURE__ */
|
|
321
|
+
/* @__PURE__ */ React6.createElement(
|
|
279
322
|
Animated.View,
|
|
280
323
|
{
|
|
281
324
|
style: [
|
|
@@ -301,7 +344,7 @@ var styles5 = StyleSheet5.create({
|
|
|
301
344
|
Skeleton.displayName = "Skeleton";
|
|
302
345
|
|
|
303
346
|
// src/components/molecules/SearchInput.tsx
|
|
304
|
-
import
|
|
347
|
+
import React7 from "react";
|
|
305
348
|
import {
|
|
306
349
|
View as View6,
|
|
307
350
|
TextInput,
|
|
@@ -338,12 +381,12 @@ var SearchInput = ({
|
|
|
338
381
|
handleChangeText("");
|
|
339
382
|
};
|
|
340
383
|
if (isLoading) {
|
|
341
|
-
return /* @__PURE__ */
|
|
384
|
+
return /* @__PURE__ */ React7.createElement(View6, { style: [styles6.container, style] }, /* @__PURE__ */ React7.createElement(LoadingState, { message: "Loading..." }));
|
|
342
385
|
}
|
|
343
386
|
if (error) {
|
|
344
|
-
return /* @__PURE__ */
|
|
387
|
+
return /* @__PURE__ */ React7.createElement(View6, { style: [styles6.container, style] }, /* @__PURE__ */ React7.createElement(ErrorState, { message: error.message }));
|
|
345
388
|
}
|
|
346
|
-
return /* @__PURE__ */
|
|
389
|
+
return /* @__PURE__ */ React7.createElement(
|
|
347
390
|
HStack,
|
|
348
391
|
{
|
|
349
392
|
spacing: 8,
|
|
@@ -357,8 +400,8 @@ var SearchInput = ({
|
|
|
357
400
|
style
|
|
358
401
|
]
|
|
359
402
|
},
|
|
360
|
-
/* @__PURE__ */
|
|
361
|
-
/* @__PURE__ */
|
|
403
|
+
/* @__PURE__ */ React7.createElement(Typography, { variant: "body", style: { color: theme.colors["muted-foreground"] } }, "\u{1F50D}"),
|
|
404
|
+
/* @__PURE__ */ React7.createElement(
|
|
362
405
|
TextInput,
|
|
363
406
|
{
|
|
364
407
|
value,
|
|
@@ -374,7 +417,7 @@ var SearchInput = ({
|
|
|
374
417
|
]
|
|
375
418
|
}
|
|
376
419
|
),
|
|
377
|
-
value && value.length > 0 && /* @__PURE__ */
|
|
420
|
+
value && value.length > 0 && /* @__PURE__ */ React7.createElement(TouchableOpacity2, { onPress: handleClear, style: styles6.clear }, /* @__PURE__ */ React7.createElement(Typography, { variant: "body", style: { color: theme.colors["muted-foreground"] } }, "\u2715"))
|
|
378
421
|
);
|
|
379
422
|
};
|
|
380
423
|
var styles6 = StyleSheet6.create({
|
|
@@ -396,7 +439,7 @@ var styles6 = StyleSheet6.create({
|
|
|
396
439
|
SearchInput.displayName = "SearchInput";
|
|
397
440
|
|
|
398
441
|
// src/components/molecules/Tooltip.tsx
|
|
399
|
-
import
|
|
442
|
+
import React8, { useState, useRef } from "react";
|
|
400
443
|
import {
|
|
401
444
|
View as View7,
|
|
402
445
|
Text,
|
|
@@ -425,7 +468,7 @@ var Tooltip = ({
|
|
|
425
468
|
};
|
|
426
469
|
const tooltipY = position.y - 40;
|
|
427
470
|
const centerX = position.x + position.width / 2;
|
|
428
|
-
return /* @__PURE__ */
|
|
471
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement(
|
|
429
472
|
TouchableOpacity3,
|
|
430
473
|
{
|
|
431
474
|
ref: triggerRef,
|
|
@@ -435,7 +478,7 @@ var Tooltip = ({
|
|
|
435
478
|
activeOpacity: 1
|
|
436
479
|
},
|
|
437
480
|
children
|
|
438
|
-
), /* @__PURE__ */
|
|
481
|
+
), /* @__PURE__ */ React8.createElement(
|
|
439
482
|
Modal,
|
|
440
483
|
{
|
|
441
484
|
visible,
|
|
@@ -443,7 +486,7 @@ var Tooltip = ({
|
|
|
443
486
|
animationType: "fade",
|
|
444
487
|
onRequestClose: hideTooltip
|
|
445
488
|
},
|
|
446
|
-
/* @__PURE__ */
|
|
489
|
+
/* @__PURE__ */ React8.createElement(TouchableWithoutFeedback, { onPress: hideTooltip }, /* @__PURE__ */ React8.createElement(View7, { style: styles7.overlay }, /* @__PURE__ */ React8.createElement(
|
|
447
490
|
View7,
|
|
448
491
|
{
|
|
449
492
|
style: [
|
|
@@ -455,8 +498,8 @@ var Tooltip = ({
|
|
|
455
498
|
}
|
|
456
499
|
]
|
|
457
500
|
},
|
|
458
|
-
/* @__PURE__ */
|
|
459
|
-
/* @__PURE__ */
|
|
501
|
+
/* @__PURE__ */ React8.createElement(Text, { style: [styles7.text, { color: theme.colors.background }] }, content),
|
|
502
|
+
/* @__PURE__ */ React8.createElement(
|
|
460
503
|
View7,
|
|
461
504
|
{
|
|
462
505
|
style: [
|
|
@@ -498,7 +541,7 @@ var styles7 = StyleSheet7.create({
|
|
|
498
541
|
Tooltip.displayName = "Tooltip";
|
|
499
542
|
|
|
500
543
|
// src/components/molecules/Popover.tsx
|
|
501
|
-
import
|
|
544
|
+
import React9, { useState as useState2, useRef as useRef2 } from "react";
|
|
502
545
|
import {
|
|
503
546
|
View as View8,
|
|
504
547
|
StyleSheet as StyleSheet8,
|
|
@@ -529,7 +572,7 @@ var Popover = ({
|
|
|
529
572
|
const popoverY = position.y + position.height + 8;
|
|
530
573
|
const showAbove = popoverY > screenHeight * 0.7;
|
|
531
574
|
const finalY = showAbove ? position.y - 200 : popoverY;
|
|
532
|
-
return /* @__PURE__ */
|
|
575
|
+
return /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement(
|
|
533
576
|
TouchableOpacity4,
|
|
534
577
|
{
|
|
535
578
|
ref: triggerRef,
|
|
@@ -537,7 +580,7 @@ var Popover = ({
|
|
|
537
580
|
style
|
|
538
581
|
},
|
|
539
582
|
trigger
|
|
540
|
-
), /* @__PURE__ */
|
|
583
|
+
), /* @__PURE__ */ React9.createElement(
|
|
541
584
|
Modal2,
|
|
542
585
|
{
|
|
543
586
|
visible,
|
|
@@ -545,7 +588,7 @@ var Popover = ({
|
|
|
545
588
|
animationType: "fade",
|
|
546
589
|
onRequestClose: hidePopover
|
|
547
590
|
},
|
|
548
|
-
/* @__PURE__ */
|
|
591
|
+
/* @__PURE__ */ React9.createElement(TouchableWithoutFeedback2, { onPress: hidePopover }, /* @__PURE__ */ React9.createElement(View8, { style: styles8.overlay }, /* @__PURE__ */ React9.createElement(
|
|
549
592
|
View8,
|
|
550
593
|
{
|
|
551
594
|
style: [
|
|
@@ -559,9 +602,9 @@ var Popover = ({
|
|
|
559
602
|
}
|
|
560
603
|
]
|
|
561
604
|
},
|
|
562
|
-
showAbove && /* @__PURE__ */
|
|
563
|
-
/* @__PURE__ */
|
|
564
|
-
!showAbove && /* @__PURE__ */
|
|
605
|
+
showAbove && /* @__PURE__ */ React9.createElement(View8, { style: [styles8.arrowUp, { borderBottomColor: theme.colors.card }] }),
|
|
606
|
+
/* @__PURE__ */ React9.createElement(View8, { style: styles8.content }, content),
|
|
607
|
+
!showAbove && /* @__PURE__ */ React9.createElement(View8, { style: [styles8.arrowDown, { borderTopColor: theme.colors.card }] })
|
|
565
608
|
)))
|
|
566
609
|
));
|
|
567
610
|
};
|
|
@@ -607,7 +650,7 @@ var styles8 = StyleSheet8.create({
|
|
|
607
650
|
Popover.displayName = "Popover";
|
|
608
651
|
|
|
609
652
|
// src/components/molecules/Menu.tsx
|
|
610
|
-
import
|
|
653
|
+
import React10 from "react";
|
|
611
654
|
import {
|
|
612
655
|
View as View9,
|
|
613
656
|
TouchableOpacity as TouchableOpacity5,
|
|
@@ -624,9 +667,9 @@ var Menu = ({
|
|
|
624
667
|
}) => {
|
|
625
668
|
const theme = useTheme();
|
|
626
669
|
const eventBus = useEventBus();
|
|
627
|
-
const [visible, setVisible] =
|
|
628
|
-
const triggerRef =
|
|
629
|
-
const [position, setPosition] =
|
|
670
|
+
const [visible, setVisible] = React10.useState(false);
|
|
671
|
+
const triggerRef = React10.useRef(null);
|
|
672
|
+
const [position, setPosition] = React10.useState({ x: 0, y: 0, width: 0 });
|
|
630
673
|
const showMenu = () => {
|
|
631
674
|
triggerRef.current?.measure((x, y, width, height, pageX, pageY) => {
|
|
632
675
|
setPosition({ x: pageX, y: pageY + height + 4, width });
|
|
@@ -644,7 +687,7 @@ var Menu = ({
|
|
|
644
687
|
onSelect?.(item);
|
|
645
688
|
hideMenu();
|
|
646
689
|
};
|
|
647
|
-
return /* @__PURE__ */
|
|
690
|
+
return /* @__PURE__ */ React10.createElement(React10.Fragment, null, /* @__PURE__ */ React10.createElement(
|
|
648
691
|
TouchableOpacity5,
|
|
649
692
|
{
|
|
650
693
|
ref: triggerRef,
|
|
@@ -652,7 +695,7 @@ var Menu = ({
|
|
|
652
695
|
style
|
|
653
696
|
},
|
|
654
697
|
trigger
|
|
655
|
-
), /* @__PURE__ */
|
|
698
|
+
), /* @__PURE__ */ React10.createElement(
|
|
656
699
|
Modal3,
|
|
657
700
|
{
|
|
658
701
|
visible,
|
|
@@ -660,7 +703,7 @@ var Menu = ({
|
|
|
660
703
|
animationType: "fade",
|
|
661
704
|
onRequestClose: hideMenu
|
|
662
705
|
},
|
|
663
|
-
/* @__PURE__ */
|
|
706
|
+
/* @__PURE__ */ React10.createElement(TouchableWithoutFeedback3, { onPress: hideMenu }, /* @__PURE__ */ React10.createElement(View9, { style: styles9.overlay }, /* @__PURE__ */ React10.createElement(
|
|
664
707
|
View9,
|
|
665
708
|
{
|
|
666
709
|
style: [
|
|
@@ -674,7 +717,7 @@ var Menu = ({
|
|
|
674
717
|
}
|
|
675
718
|
]
|
|
676
719
|
},
|
|
677
|
-
/* @__PURE__ */
|
|
720
|
+
/* @__PURE__ */ React10.createElement(ScrollView, null, items.map((item) => /* @__PURE__ */ React10.createElement(
|
|
678
721
|
TouchableOpacity5,
|
|
679
722
|
{
|
|
680
723
|
key: item.id,
|
|
@@ -685,7 +728,7 @@ var Menu = ({
|
|
|
685
728
|
{ opacity: item.disabled ? 0.5 : 1 }
|
|
686
729
|
]
|
|
687
730
|
},
|
|
688
|
-
/* @__PURE__ */
|
|
731
|
+
/* @__PURE__ */ React10.createElement(HStack, { spacing: 12, align: "center" }, item.icon, /* @__PURE__ */ React10.createElement(
|
|
689
732
|
Typography,
|
|
690
733
|
{
|
|
691
734
|
variant: "body",
|
|
@@ -722,7 +765,7 @@ var styles9 = StyleSheet9.create({
|
|
|
722
765
|
Menu.displayName = "Menu";
|
|
723
766
|
|
|
724
767
|
// src/components/molecules/Breadcrumb.tsx
|
|
725
|
-
import
|
|
768
|
+
import React11 from "react";
|
|
726
769
|
import {
|
|
727
770
|
TouchableOpacity as TouchableOpacity6,
|
|
728
771
|
ScrollView as ScrollView2,
|
|
@@ -741,30 +784,30 @@ var Breadcrumb = ({
|
|
|
741
784
|
}
|
|
742
785
|
onNavigate?.(item, index);
|
|
743
786
|
};
|
|
744
|
-
return /* @__PURE__ */
|
|
787
|
+
return /* @__PURE__ */ React11.createElement(
|
|
745
788
|
ScrollView2,
|
|
746
789
|
{
|
|
747
790
|
horizontal: true,
|
|
748
791
|
showsHorizontalScrollIndicator: false,
|
|
749
792
|
style: [styles10.container, style]
|
|
750
793
|
},
|
|
751
|
-
/* @__PURE__ */
|
|
794
|
+
/* @__PURE__ */ React11.createElement(HStack, { spacing: 4, align: "center" }, items.map((item, index) => {
|
|
752
795
|
const isLast = index === items.length - 1;
|
|
753
|
-
return /* @__PURE__ */
|
|
796
|
+
return /* @__PURE__ */ React11.createElement(HStack, { key: index, spacing: 4, align: "center" }, index > 0 && /* @__PURE__ */ React11.createElement(
|
|
754
797
|
Typography,
|
|
755
798
|
{
|
|
756
799
|
variant: "caption",
|
|
757
800
|
style: { color: theme.colors["muted-foreground"] }
|
|
758
801
|
},
|
|
759
802
|
"/"
|
|
760
|
-
), isLast ? /* @__PURE__ */
|
|
803
|
+
), isLast ? /* @__PURE__ */ React11.createElement(
|
|
761
804
|
Typography,
|
|
762
805
|
{
|
|
763
806
|
variant: "caption",
|
|
764
807
|
style: { color: theme.colors.foreground, fontWeight: "500" }
|
|
765
808
|
},
|
|
766
809
|
item.label
|
|
767
|
-
) : /* @__PURE__ */
|
|
810
|
+
) : /* @__PURE__ */ React11.createElement(TouchableOpacity6, { onPress: () => handlePress(item, index) }, /* @__PURE__ */ React11.createElement(
|
|
768
811
|
Typography,
|
|
769
812
|
{
|
|
770
813
|
variant: "caption",
|
|
@@ -783,7 +826,7 @@ var styles10 = StyleSheet10.create({
|
|
|
783
826
|
Breadcrumb.displayName = "Breadcrumb";
|
|
784
827
|
|
|
785
828
|
// src/components/molecules/ButtonGroup.tsx
|
|
786
|
-
import
|
|
829
|
+
import React12 from "react";
|
|
787
830
|
import {
|
|
788
831
|
TouchableOpacity as TouchableOpacity7,
|
|
789
832
|
StyleSheet as StyleSheet11
|
|
@@ -803,9 +846,9 @@ var ButtonGroup = ({
|
|
|
803
846
|
}
|
|
804
847
|
onChange?.(optionValue);
|
|
805
848
|
};
|
|
806
|
-
return /* @__PURE__ */
|
|
849
|
+
return /* @__PURE__ */ React12.createElement(HStack, { spacing: 4, style: style ? [styles11.container, style] : styles11.container }, options.map((option) => {
|
|
807
850
|
const isSelected = value === option.value;
|
|
808
|
-
return /* @__PURE__ */
|
|
851
|
+
return /* @__PURE__ */ React12.createElement(
|
|
809
852
|
TouchableOpacity7,
|
|
810
853
|
{
|
|
811
854
|
key: option.value,
|
|
@@ -820,7 +863,7 @@ var ButtonGroup = ({
|
|
|
820
863
|
}
|
|
821
864
|
]
|
|
822
865
|
},
|
|
823
|
-
/* @__PURE__ */
|
|
866
|
+
/* @__PURE__ */ React12.createElement(
|
|
824
867
|
Typography,
|
|
825
868
|
{
|
|
826
869
|
variant: "body",
|
|
@@ -847,9 +890,9 @@ var styles11 = StyleSheet11.create({
|
|
|
847
890
|
ButtonGroup.displayName = "ButtonGroup";
|
|
848
891
|
|
|
849
892
|
// src/components/molecules/ErrorBoundary.tsx
|
|
850
|
-
import
|
|
893
|
+
import React13 from "react";
|
|
851
894
|
import { View as View10 } from "react-native";
|
|
852
|
-
var ErrorBoundary = class extends
|
|
895
|
+
var ErrorBoundary = class extends React13.Component {
|
|
853
896
|
constructor(props) {
|
|
854
897
|
super(props);
|
|
855
898
|
this.reset = () => {
|
|
@@ -869,7 +912,7 @@ var ErrorBoundary = class extends React12.Component {
|
|
|
869
912
|
if (error) {
|
|
870
913
|
const fallbackContent = this.renderFallback(error, fallback);
|
|
871
914
|
if (style) {
|
|
872
|
-
return /* @__PURE__ */
|
|
915
|
+
return /* @__PURE__ */ React13.createElement(View10, { style }, fallbackContent);
|
|
873
916
|
}
|
|
874
917
|
return fallbackContent;
|
|
875
918
|
}
|
|
@@ -882,7 +925,7 @@ var ErrorBoundary = class extends React12.Component {
|
|
|
882
925
|
if (fallback) {
|
|
883
926
|
return fallback;
|
|
884
927
|
}
|
|
885
|
-
return /* @__PURE__ */
|
|
928
|
+
return /* @__PURE__ */ React13.createElement(
|
|
886
929
|
ErrorState,
|
|
887
930
|
{
|
|
888
931
|
message: `Something went wrong: ${error.message}`,
|
|
@@ -894,7 +937,7 @@ var ErrorBoundary = class extends React12.Component {
|
|
|
894
937
|
ErrorBoundary.displayName = "ErrorBoundary";
|
|
895
938
|
|
|
896
939
|
// src/components/molecules/FloatingActionButton.tsx
|
|
897
|
-
import
|
|
940
|
+
import React14, { useState as useState3, useRef as useRef3 } from "react";
|
|
898
941
|
import {
|
|
899
942
|
View as View11,
|
|
900
943
|
TouchableOpacity as TouchableOpacity8,
|
|
@@ -964,7 +1007,7 @@ var FloatingActionButton = ({
|
|
|
964
1007
|
}).start();
|
|
965
1008
|
};
|
|
966
1009
|
if (resolvedAction && (!actions || actions.length === 0)) {
|
|
967
|
-
return /* @__PURE__ */
|
|
1010
|
+
return /* @__PURE__ */ React14.createElement(
|
|
968
1011
|
TouchableOpacity8,
|
|
969
1012
|
{
|
|
970
1013
|
onPress: resolvedAction.onPress,
|
|
@@ -976,11 +1019,11 @@ var FloatingActionButton = ({
|
|
|
976
1019
|
],
|
|
977
1020
|
accessibilityLabel: resolvedAction.label || "Action"
|
|
978
1021
|
},
|
|
979
|
-
/* @__PURE__ */
|
|
1022
|
+
/* @__PURE__ */ React14.createElement(Text2, { style: styles12.icon }, resolvedAction.icon || "+")
|
|
980
1023
|
);
|
|
981
1024
|
}
|
|
982
1025
|
if (actions && actions.length > 0) {
|
|
983
|
-
return /* @__PURE__ */
|
|
1026
|
+
return /* @__PURE__ */ React14.createElement(View11, { style: [styles12.container, getPositionStyle(), style] }, isExpanded && actions.length > 1 && /* @__PURE__ */ React14.createElement(View11, { style: styles12.actionsContainer }, actions.map((actionItem, index) => {
|
|
984
1027
|
const translateY = animation.interpolate({
|
|
985
1028
|
inputRange: [0, 1],
|
|
986
1029
|
outputRange: [20 * (actions.length - index), 0]
|
|
@@ -989,7 +1032,7 @@ var FloatingActionButton = ({
|
|
|
989
1032
|
inputRange: [0, 0.5, 1],
|
|
990
1033
|
outputRange: [0, 0, 1]
|
|
991
1034
|
});
|
|
992
|
-
return /* @__PURE__ */
|
|
1035
|
+
return /* @__PURE__ */ React14.createElement(
|
|
993
1036
|
Animated2.View,
|
|
994
1037
|
{
|
|
995
1038
|
key: actionItem.id,
|
|
@@ -998,7 +1041,7 @@ var FloatingActionButton = ({
|
|
|
998
1041
|
{ opacity, transform: [{ translateY }] }
|
|
999
1042
|
]
|
|
1000
1043
|
},
|
|
1001
|
-
/* @__PURE__ */
|
|
1044
|
+
/* @__PURE__ */ React14.createElement(
|
|
1002
1045
|
TouchableOpacity8,
|
|
1003
1046
|
{
|
|
1004
1047
|
onPress: () => {
|
|
@@ -1014,11 +1057,11 @@ var FloatingActionButton = ({
|
|
|
1014
1057
|
{ backgroundColor: getVariantColor(actionItem.variant || "primary") }
|
|
1015
1058
|
]
|
|
1016
1059
|
},
|
|
1017
|
-
/* @__PURE__ */
|
|
1060
|
+
/* @__PURE__ */ React14.createElement(Text2, { style: styles12.icon }, actionItem.icon)
|
|
1018
1061
|
),
|
|
1019
|
-
/* @__PURE__ */
|
|
1062
|
+
/* @__PURE__ */ React14.createElement(View11, { style: styles12.labelContainer }, /* @__PURE__ */ React14.createElement(Text2, { style: styles12.label }, actionItem.label))
|
|
1020
1063
|
);
|
|
1021
|
-
})), /* @__PURE__ */
|
|
1064
|
+
})), /* @__PURE__ */ React14.createElement(
|
|
1022
1065
|
TouchableOpacity8,
|
|
1023
1066
|
{
|
|
1024
1067
|
onPress: () => {
|
|
@@ -1039,7 +1082,7 @@ var FloatingActionButton = ({
|
|
|
1039
1082
|
}
|
|
1040
1083
|
]
|
|
1041
1084
|
},
|
|
1042
|
-
/* @__PURE__ */
|
|
1085
|
+
/* @__PURE__ */ React14.createElement(
|
|
1043
1086
|
Animated2.Text,
|
|
1044
1087
|
{
|
|
1045
1088
|
style: [
|
|
@@ -1115,7 +1158,7 @@ var styles12 = StyleSheet12.create({
|
|
|
1115
1158
|
FloatingActionButton.displayName = "FloatingActionButton";
|
|
1116
1159
|
|
|
1117
1160
|
// src/components/molecules/Flex.tsx
|
|
1118
|
-
import
|
|
1161
|
+
import React15 from "react";
|
|
1119
1162
|
import { View as View12 } from "react-native";
|
|
1120
1163
|
var gapValues = {
|
|
1121
1164
|
none: 0,
|
|
@@ -1154,12 +1197,12 @@ var Flex = ({
|
|
|
1154
1197
|
if (basis !== void 0) {
|
|
1155
1198
|
flexStyle.flexBasis = typeof basis === "number" ? basis : void 0;
|
|
1156
1199
|
}
|
|
1157
|
-
return /* @__PURE__ */
|
|
1200
|
+
return /* @__PURE__ */ React15.createElement(View12, { style: [flexStyle, ...style ? [style] : []] }, children);
|
|
1158
1201
|
};
|
|
1159
1202
|
Flex.displayName = "Flex";
|
|
1160
1203
|
|
|
1161
1204
|
// src/components/molecules/SimpleGrid.tsx
|
|
1162
|
-
import
|
|
1205
|
+
import React16 from "react";
|
|
1163
1206
|
import { View as View13 } from "react-native";
|
|
1164
1207
|
var gapValues2 = {
|
|
1165
1208
|
none: 0,
|
|
@@ -1176,7 +1219,7 @@ var SimpleGrid = ({
|
|
|
1176
1219
|
style,
|
|
1177
1220
|
children
|
|
1178
1221
|
}) => {
|
|
1179
|
-
const childrenArray =
|
|
1222
|
+
const childrenArray = React16.Children.toArray(children);
|
|
1180
1223
|
const gapValue = gapValues2[gap];
|
|
1181
1224
|
if (cols) {
|
|
1182
1225
|
const rowStyle = {
|
|
@@ -1184,7 +1227,7 @@ var SimpleGrid = ({
|
|
|
1184
1227
|
flexWrap: "wrap",
|
|
1185
1228
|
gap: gapValue
|
|
1186
1229
|
};
|
|
1187
|
-
return /* @__PURE__ */
|
|
1230
|
+
return /* @__PURE__ */ React16.createElement(View13, { style: [rowStyle, ...style ? [style] : []] }, childrenArray.map((child, index) => /* @__PURE__ */ React16.createElement(View13, { key: index, style: { flex: 1 / cols, padding: gapValue / 2 } }, child)));
|
|
1188
1231
|
}
|
|
1189
1232
|
const containerStyle = {
|
|
1190
1233
|
flexDirection: "row",
|
|
@@ -1195,12 +1238,12 @@ var SimpleGrid = ({
|
|
|
1195
1238
|
minWidth: minChildWidth,
|
|
1196
1239
|
flex: 1
|
|
1197
1240
|
};
|
|
1198
|
-
return /* @__PURE__ */
|
|
1241
|
+
return /* @__PURE__ */ React16.createElement(View13, { style: [containerStyle, ...style ? [style] : []] }, childrenArray.map((child, index) => /* @__PURE__ */ React16.createElement(View13, { key: index, style: itemStyle }, child)));
|
|
1199
1242
|
};
|
|
1200
1243
|
SimpleGrid.displayName = "SimpleGrid";
|
|
1201
1244
|
|
|
1202
1245
|
// src/components/molecules/Container.tsx
|
|
1203
|
-
import
|
|
1246
|
+
import React17 from "react";
|
|
1204
1247
|
import { View as View14 } from "react-native";
|
|
1205
1248
|
var sizeValues = {
|
|
1206
1249
|
xs: 320,
|
|
@@ -1233,13 +1276,13 @@ var Container = ({
|
|
|
1233
1276
|
paddingHorizontal: paddingValues[padding],
|
|
1234
1277
|
...center && { alignSelf: "center" }
|
|
1235
1278
|
};
|
|
1236
|
-
return /* @__PURE__ */
|
|
1279
|
+
return /* @__PURE__ */ React17.createElement(View14, { style: [containerStyle, ...style ? [style] : []] }, children);
|
|
1237
1280
|
};
|
|
1238
1281
|
Container.displayName = "Container";
|
|
1239
1282
|
|
|
1240
1283
|
// src/components/molecules/Grid.tsx
|
|
1241
|
-
import
|
|
1242
|
-
import { View as View15, FlatList } from "react-native";
|
|
1284
|
+
import React18 from "react";
|
|
1285
|
+
import { View as View15, FlatList as FlatList2 } from "react-native";
|
|
1243
1286
|
var gapValues3 = {
|
|
1244
1287
|
none: 0,
|
|
1245
1288
|
xs: 4,
|
|
@@ -1259,8 +1302,8 @@ function Grid({
|
|
|
1259
1302
|
}) {
|
|
1260
1303
|
const gapValue = gapValues3[gap];
|
|
1261
1304
|
if (data && renderItem) {
|
|
1262
|
-
return /* @__PURE__ */
|
|
1263
|
-
|
|
1305
|
+
return /* @__PURE__ */ React18.createElement(
|
|
1306
|
+
FlatList2,
|
|
1264
1307
|
{
|
|
1265
1308
|
data,
|
|
1266
1309
|
renderItem,
|
|
@@ -1279,8 +1322,8 @@ function Grid({
|
|
|
1279
1322
|
flexWrap: "wrap",
|
|
1280
1323
|
gap: gapValue
|
|
1281
1324
|
};
|
|
1282
|
-
const childrenArray =
|
|
1283
|
-
return /* @__PURE__ */
|
|
1325
|
+
const childrenArray = React18.Children.toArray(children);
|
|
1326
|
+
return /* @__PURE__ */ React18.createElement(View15, { style: [containerStyle, ...style ? [style] : []] }, childrenArray.map((child, index) => /* @__PURE__ */ React18.createElement(
|
|
1284
1327
|
View15,
|
|
1285
1328
|
{
|
|
1286
1329
|
key: index,
|
|
@@ -1295,7 +1338,7 @@ function Grid({
|
|
|
1295
1338
|
Grid.displayName = "Grid";
|
|
1296
1339
|
|
|
1297
1340
|
// src/components/molecules/SidePanel.tsx
|
|
1298
|
-
import
|
|
1341
|
+
import React19 from "react";
|
|
1299
1342
|
import {
|
|
1300
1343
|
View as View16,
|
|
1301
1344
|
StyleSheet as StyleSheet13,
|
|
@@ -1319,10 +1362,10 @@ var SidePanel = ({
|
|
|
1319
1362
|
}) => {
|
|
1320
1363
|
const theme = useTheme();
|
|
1321
1364
|
const eventBus = useEventBus();
|
|
1322
|
-
const translateX =
|
|
1365
|
+
const translateX = React19.useRef(
|
|
1323
1366
|
new Animated3.Value(position === "right" ? SCREEN_WIDTH : -SCREEN_WIDTH)
|
|
1324
1367
|
).current;
|
|
1325
|
-
|
|
1368
|
+
React19.useEffect(() => {
|
|
1326
1369
|
Animated3.timing(translateX, {
|
|
1327
1370
|
toValue: isOpen ? 0 : position === "right" ? width : -width,
|
|
1328
1371
|
duration: 300,
|
|
@@ -1336,14 +1379,14 @@ var SidePanel = ({
|
|
|
1336
1379
|
onClose();
|
|
1337
1380
|
};
|
|
1338
1381
|
if (!isOpen) return null;
|
|
1339
|
-
return /* @__PURE__ */
|
|
1382
|
+
return /* @__PURE__ */ React19.createElement(View16, { style: styles13.overlay }, showOverlay && /* @__PURE__ */ React19.createElement(
|
|
1340
1383
|
TouchableOpacity9,
|
|
1341
1384
|
{
|
|
1342
1385
|
style: styles13.backdrop,
|
|
1343
1386
|
activeOpacity: 1,
|
|
1344
1387
|
onPress: handleClose
|
|
1345
1388
|
}
|
|
1346
|
-
), /* @__PURE__ */
|
|
1389
|
+
), /* @__PURE__ */ React19.createElement(
|
|
1347
1390
|
Animated3.View,
|
|
1348
1391
|
{
|
|
1349
1392
|
style: [
|
|
@@ -1360,7 +1403,7 @@ var SidePanel = ({
|
|
|
1360
1403
|
style
|
|
1361
1404
|
]
|
|
1362
1405
|
},
|
|
1363
|
-
/* @__PURE__ */
|
|
1406
|
+
/* @__PURE__ */ React19.createElement(
|
|
1364
1407
|
View16,
|
|
1365
1408
|
{
|
|
1366
1409
|
style: [
|
|
@@ -1371,10 +1414,10 @@ var SidePanel = ({
|
|
|
1371
1414
|
}
|
|
1372
1415
|
]
|
|
1373
1416
|
},
|
|
1374
|
-
/* @__PURE__ */
|
|
1375
|
-
/* @__PURE__ */
|
|
1417
|
+
/* @__PURE__ */ React19.createElement(Typography, { variant: "h4" }, title),
|
|
1418
|
+
/* @__PURE__ */ React19.createElement(Button, { variant: "ghost", size: "sm", onPress: handleClose }, "\u2715")
|
|
1376
1419
|
),
|
|
1377
|
-
/* @__PURE__ */
|
|
1420
|
+
/* @__PURE__ */ React19.createElement(VStack, { spacing: 0, style: styles13.content }, isLoading ? /* @__PURE__ */ React19.createElement(LoadingState, null) : error ? /* @__PURE__ */ React19.createElement(ErrorState, { message: error.message, onRetry: handleClose }) : children)
|
|
1378
1421
|
));
|
|
1379
1422
|
};
|
|
1380
1423
|
var styles13 = StyleSheet13.create({
|
|
@@ -1419,7 +1462,7 @@ var styles13 = StyleSheet13.create({
|
|
|
1419
1462
|
SidePanel.displayName = "SidePanel";
|
|
1420
1463
|
|
|
1421
1464
|
// src/components/molecules/Navigation.tsx
|
|
1422
|
-
import
|
|
1465
|
+
import React20 from "react";
|
|
1423
1466
|
import {
|
|
1424
1467
|
View as View17,
|
|
1425
1468
|
StyleSheet as StyleSheet14,
|
|
@@ -1475,14 +1518,14 @@ var Navigation = ({
|
|
|
1475
1518
|
return isActive ? theme.colors.primary : theme.colors.foreground;
|
|
1476
1519
|
};
|
|
1477
1520
|
if (isLoading) {
|
|
1478
|
-
return /* @__PURE__ */
|
|
1521
|
+
return /* @__PURE__ */ React20.createElement(View17, { style: [styles14.container, style] }, /* @__PURE__ */ React20.createElement(LoadingState, { message: "Loading navigation..." }));
|
|
1479
1522
|
}
|
|
1480
1523
|
if (error) {
|
|
1481
|
-
return /* @__PURE__ */
|
|
1524
|
+
return /* @__PURE__ */ React20.createElement(View17, { style: [styles14.container, style] }, /* @__PURE__ */ React20.createElement(ErrorState, { message: error.message }));
|
|
1482
1525
|
}
|
|
1483
1526
|
const renderItem = (item) => {
|
|
1484
1527
|
const isActive = item.isActive ?? false;
|
|
1485
|
-
return /* @__PURE__ */
|
|
1528
|
+
return /* @__PURE__ */ React20.createElement(
|
|
1486
1529
|
TouchableOpacity10,
|
|
1487
1530
|
{
|
|
1488
1531
|
key: item.id,
|
|
@@ -1495,11 +1538,11 @@ var Navigation = ({
|
|
|
1495
1538
|
],
|
|
1496
1539
|
activeOpacity: 0.7
|
|
1497
1540
|
},
|
|
1498
|
-
/* @__PURE__ */
|
|
1541
|
+
/* @__PURE__ */ React20.createElement(HStack, { spacing: 8, align: "center" }, item.icon && /* @__PURE__ */ React20.createElement(Typography, { variant: "body", style: { color: getTextColor(isActive) } }, item.icon), /* @__PURE__ */ React20.createElement(Typography, { variant: "body", style: { color: getTextColor(isActive) } }, item.label), item.badge !== void 0 && item.badge > 0 && /* @__PURE__ */ React20.createElement(Badge, { variant: "error", size: "sm" }, item.badge > 99 ? "99+" : item.badge))
|
|
1499
1542
|
);
|
|
1500
1543
|
};
|
|
1501
1544
|
if (orientation === "horizontal") {
|
|
1502
|
-
return /* @__PURE__ */
|
|
1545
|
+
return /* @__PURE__ */ React20.createElement(
|
|
1503
1546
|
ScrollView3,
|
|
1504
1547
|
{
|
|
1505
1548
|
horizontal: true,
|
|
@@ -1509,7 +1552,7 @@ var Navigation = ({
|
|
|
1509
1552
|
items.map(renderItem)
|
|
1510
1553
|
);
|
|
1511
1554
|
}
|
|
1512
|
-
return /* @__PURE__ */
|
|
1555
|
+
return /* @__PURE__ */ React20.createElement(VStack, { spacing: 4, style: [styles14.verticalContainer, ...style ? [style] : []] }, items.map(renderItem));
|
|
1513
1556
|
};
|
|
1514
1557
|
var styles14 = StyleSheet14.create({
|
|
1515
1558
|
container: {
|
|
@@ -1533,14 +1576,14 @@ var styles14 = StyleSheet14.create({
|
|
|
1533
1576
|
Navigation.displayName = "Navigation";
|
|
1534
1577
|
|
|
1535
1578
|
// src/components/molecules/RelationSelect.tsx
|
|
1536
|
-
import
|
|
1579
|
+
import React21, { useState as useState4, useMemo } from "react";
|
|
1537
1580
|
import {
|
|
1538
1581
|
View as View18,
|
|
1539
1582
|
TouchableOpacity as TouchableOpacity11,
|
|
1540
1583
|
Text as Text3,
|
|
1541
1584
|
StyleSheet as StyleSheet15,
|
|
1542
1585
|
Modal as Modal4,
|
|
1543
|
-
FlatList as
|
|
1586
|
+
FlatList as FlatList3,
|
|
1544
1587
|
SafeAreaView
|
|
1545
1588
|
} from "react-native";
|
|
1546
1589
|
var RelationSelect = ({
|
|
@@ -1644,7 +1687,7 @@ var RelationSelect = ({
|
|
|
1644
1687
|
};
|
|
1645
1688
|
const renderOption = ({ item }) => {
|
|
1646
1689
|
const isSelected = selectedValues.includes(item.id);
|
|
1647
|
-
return /* @__PURE__ */
|
|
1690
|
+
return /* @__PURE__ */ React21.createElement(
|
|
1648
1691
|
TouchableOpacity11,
|
|
1649
1692
|
{
|
|
1650
1693
|
style: [
|
|
@@ -1656,7 +1699,7 @@ var RelationSelect = ({
|
|
|
1656
1699
|
],
|
|
1657
1700
|
onPress: () => handleSelect(item.id)
|
|
1658
1701
|
},
|
|
1659
|
-
/* @__PURE__ */
|
|
1702
|
+
/* @__PURE__ */ React21.createElement(HStack, { spacing: 12, align: "center" }, item.avatarUri ? /* @__PURE__ */ React21.createElement(
|
|
1660
1703
|
View18,
|
|
1661
1704
|
{
|
|
1662
1705
|
style: [
|
|
@@ -1666,8 +1709,8 @@ var RelationSelect = ({
|
|
|
1666
1709
|
}
|
|
1667
1710
|
]
|
|
1668
1711
|
},
|
|
1669
|
-
/* @__PURE__ */
|
|
1670
|
-
) : /* @__PURE__ */
|
|
1712
|
+
/* @__PURE__ */ React21.createElement(Text3, { style: { fontSize: 20 } }, "\u{1F464}")
|
|
1713
|
+
) : /* @__PURE__ */ React21.createElement(
|
|
1671
1714
|
View18,
|
|
1672
1715
|
{
|
|
1673
1716
|
style: [
|
|
@@ -1677,8 +1720,8 @@ var RelationSelect = ({
|
|
|
1677
1720
|
}
|
|
1678
1721
|
]
|
|
1679
1722
|
},
|
|
1680
|
-
/* @__PURE__ */
|
|
1681
|
-
), /* @__PURE__ */
|
|
1723
|
+
/* @__PURE__ */ React21.createElement(Text3, { style: { fontSize: 16 } }, item.label.charAt(0).toUpperCase())
|
|
1724
|
+
), /* @__PURE__ */ React21.createElement(VStack, { spacing: 2, style: styles15.optionContent }, /* @__PURE__ */ React21.createElement(
|
|
1682
1725
|
Text3,
|
|
1683
1726
|
{
|
|
1684
1727
|
style: [
|
|
@@ -1691,7 +1734,7 @@ var RelationSelect = ({
|
|
|
1691
1734
|
numberOfLines: 1
|
|
1692
1735
|
},
|
|
1693
1736
|
item.label
|
|
1694
|
-
), item.subtitle && /* @__PURE__ */
|
|
1737
|
+
), item.subtitle && /* @__PURE__ */ React21.createElement(
|
|
1695
1738
|
Text3,
|
|
1696
1739
|
{
|
|
1697
1740
|
style: [
|
|
@@ -1703,7 +1746,7 @@ var RelationSelect = ({
|
|
|
1703
1746
|
numberOfLines: 1
|
|
1704
1747
|
},
|
|
1705
1748
|
item.subtitle
|
|
1706
|
-
)), isSelected && /* @__PURE__ */
|
|
1749
|
+
)), isSelected && /* @__PURE__ */ React21.createElement(
|
|
1707
1750
|
Typography,
|
|
1708
1751
|
{
|
|
1709
1752
|
variant: "body",
|
|
@@ -1711,7 +1754,7 @@ var RelationSelect = ({
|
|
|
1711
1754
|
},
|
|
1712
1755
|
"\u2713"
|
|
1713
1756
|
)),
|
|
1714
|
-
item.metadata && /* @__PURE__ */
|
|
1757
|
+
item.metadata && /* @__PURE__ */ React21.createElement(HStack, { spacing: 8, style: styles15.metadata }, Object.entries(item.metadata).map(([key, val]) => /* @__PURE__ */ React21.createElement(
|
|
1715
1758
|
Badge,
|
|
1716
1759
|
{
|
|
1717
1760
|
key,
|
|
@@ -1723,12 +1766,12 @@ var RelationSelect = ({
|
|
|
1723
1766
|
);
|
|
1724
1767
|
};
|
|
1725
1768
|
if (isLoading) {
|
|
1726
|
-
return /* @__PURE__ */
|
|
1769
|
+
return /* @__PURE__ */ React21.createElement(View18, { style: [styles15.container, style] }, /* @__PURE__ */ React21.createElement(LoadingState, { message: "Loading options..." }));
|
|
1727
1770
|
}
|
|
1728
1771
|
if (error) {
|
|
1729
|
-
return /* @__PURE__ */
|
|
1772
|
+
return /* @__PURE__ */ React21.createElement(View18, { style: [styles15.container, style] }, /* @__PURE__ */ React21.createElement(ErrorState, { message: error.message }));
|
|
1730
1773
|
}
|
|
1731
|
-
return /* @__PURE__ */
|
|
1774
|
+
return /* @__PURE__ */ React21.createElement(View18, { style: [styles15.container, style] }, /* @__PURE__ */ React21.createElement(
|
|
1732
1775
|
TouchableOpacity11,
|
|
1733
1776
|
{
|
|
1734
1777
|
onPress: handleOpen,
|
|
@@ -1743,7 +1786,7 @@ var RelationSelect = ({
|
|
|
1743
1786
|
}
|
|
1744
1787
|
]
|
|
1745
1788
|
},
|
|
1746
|
-
/* @__PURE__ */
|
|
1789
|
+
/* @__PURE__ */ React21.createElement(View18, { style: styles15.buttonContent }, selectedOptions.length === 0 ? /* @__PURE__ */ React21.createElement(
|
|
1747
1790
|
Text3,
|
|
1748
1791
|
{
|
|
1749
1792
|
style: [
|
|
@@ -1756,7 +1799,7 @@ var RelationSelect = ({
|
|
|
1756
1799
|
numberOfLines: 1
|
|
1757
1800
|
},
|
|
1758
1801
|
placeholder
|
|
1759
|
-
) : /* @__PURE__ */
|
|
1802
|
+
) : /* @__PURE__ */ React21.createElement(HStack, { spacing: 8, style: styles15.selectedContainer }, selectedOptions.map((opt) => /* @__PURE__ */ React21.createElement(
|
|
1760
1803
|
View18,
|
|
1761
1804
|
{
|
|
1762
1805
|
key: opt.id,
|
|
@@ -1765,7 +1808,7 @@ var RelationSelect = ({
|
|
|
1765
1808
|
{ backgroundColor: theme.colors.primary }
|
|
1766
1809
|
]
|
|
1767
1810
|
},
|
|
1768
|
-
/* @__PURE__ */
|
|
1811
|
+
/* @__PURE__ */ React21.createElement(
|
|
1769
1812
|
Text3,
|
|
1770
1813
|
{
|
|
1771
1814
|
style: [
|
|
@@ -1776,15 +1819,15 @@ var RelationSelect = ({
|
|
|
1776
1819
|
},
|
|
1777
1820
|
opt.label
|
|
1778
1821
|
)
|
|
1779
|
-
)), multiple && maxSelections && /* @__PURE__ */
|
|
1780
|
-
selectedOptions.length > 0 && !disabled && /* @__PURE__ */
|
|
1822
|
+
)), multiple && maxSelections && /* @__PURE__ */ React21.createElement(Typography, { variant: "caption", style: { color: theme.colors["muted-foreground"] } }, selectedOptions.length, "/", maxSelections))),
|
|
1823
|
+
selectedOptions.length > 0 && !disabled && /* @__PURE__ */ React21.createElement(
|
|
1781
1824
|
TouchableOpacity11,
|
|
1782
1825
|
{
|
|
1783
1826
|
onPress: handleClear,
|
|
1784
1827
|
style: styles15.clearButton,
|
|
1785
1828
|
hitSlop: { top: 10, bottom: 10, left: 10, right: 10 }
|
|
1786
1829
|
},
|
|
1787
|
-
/* @__PURE__ */
|
|
1830
|
+
/* @__PURE__ */ React21.createElement(
|
|
1788
1831
|
Typography,
|
|
1789
1832
|
{
|
|
1790
1833
|
variant: "body",
|
|
@@ -1793,8 +1836,8 @@ var RelationSelect = ({
|
|
|
1793
1836
|
"\u2715"
|
|
1794
1837
|
)
|
|
1795
1838
|
),
|
|
1796
|
-
/* @__PURE__ */
|
|
1797
|
-
), /* @__PURE__ */
|
|
1839
|
+
/* @__PURE__ */ React21.createElement(Text3, { style: [styles15.chevron, { color: theme.colors["muted-foreground"] }] }, "\u25BC")
|
|
1840
|
+
), /* @__PURE__ */ React21.createElement(
|
|
1798
1841
|
Modal4,
|
|
1799
1842
|
{
|
|
1800
1843
|
visible: isOpen,
|
|
@@ -1802,13 +1845,13 @@ var RelationSelect = ({
|
|
|
1802
1845
|
animationType: "slide",
|
|
1803
1846
|
onRequestClose: handleClose
|
|
1804
1847
|
},
|
|
1805
|
-
/* @__PURE__ */
|
|
1848
|
+
/* @__PURE__ */ React21.createElement(
|
|
1806
1849
|
SafeAreaView,
|
|
1807
1850
|
{
|
|
1808
1851
|
style: [styles15.modalContainer, { backgroundColor: theme.colors.background }]
|
|
1809
1852
|
},
|
|
1810
|
-
/* @__PURE__ */
|
|
1811
|
-
searchable && /* @__PURE__ */
|
|
1853
|
+
/* @__PURE__ */ React21.createElement(View18, { style: [styles15.modalHeader, { borderBottomColor: theme.colors.border }] }, /* @__PURE__ */ React21.createElement(Button, { variant: "ghost", onPress: handleClose }, "Cancel"), /* @__PURE__ */ React21.createElement(Typography, { variant: "h4", style: { color: theme.colors.foreground } }, multiple ? "Select Items" : "Select Item"), /* @__PURE__ */ React21.createElement(Button, { variant: "primary", onPress: handleClose }, "Done")),
|
|
1854
|
+
searchable && /* @__PURE__ */ React21.createElement(View18, { style: styles15.searchContainer }, /* @__PURE__ */ React21.createElement(
|
|
1812
1855
|
Input,
|
|
1813
1856
|
{
|
|
1814
1857
|
value: searchQuery,
|
|
@@ -1817,8 +1860,8 @@ var RelationSelect = ({
|
|
|
1817
1860
|
changeEvent: searchEvent
|
|
1818
1861
|
}
|
|
1819
1862
|
)),
|
|
1820
|
-
filteredOptions.length === 0 ? /* @__PURE__ */
|
|
1821
|
-
|
|
1863
|
+
filteredOptions.length === 0 ? /* @__PURE__ */ React21.createElement(EmptyState, { message: "No matching options" }) : /* @__PURE__ */ React21.createElement(
|
|
1864
|
+
FlatList3,
|
|
1822
1865
|
{
|
|
1823
1866
|
data: filteredOptions,
|
|
1824
1867
|
keyExtractor: (item) => item.id,
|
|
@@ -1921,7 +1964,7 @@ var styles15 = StyleSheet15.create({
|
|
|
1921
1964
|
RelationSelect.displayName = "RelationSelect";
|
|
1922
1965
|
|
|
1923
1966
|
// src/components/molecules/FilterGroup.tsx
|
|
1924
|
-
import
|
|
1967
|
+
import React22, { useState as useState5, useCallback } from "react";
|
|
1925
1968
|
import { View as View19, StyleSheet as StyleSheet16, TouchableOpacity as TouchableOpacity12 } from "react-native";
|
|
1926
1969
|
var FilterGroup = ({
|
|
1927
1970
|
entity,
|
|
@@ -1975,15 +2018,15 @@ var FilterGroup = ({
|
|
|
1975
2018
|
];
|
|
1976
2019
|
};
|
|
1977
2020
|
if (variant === "pills") {
|
|
1978
|
-
return /* @__PURE__ */
|
|
2021
|
+
return /* @__PURE__ */ React22.createElement(
|
|
1979
2022
|
HStack,
|
|
1980
2023
|
{
|
|
1981
2024
|
spacing: 16,
|
|
1982
2025
|
align: "center",
|
|
1983
2026
|
style: [styles16.pillsContainer, style ?? {}]
|
|
1984
2027
|
},
|
|
1985
|
-
showIcon && /* @__PURE__ */
|
|
1986
|
-
filters.map((filter) => /* @__PURE__ */
|
|
2028
|
+
showIcon && /* @__PURE__ */ React22.createElement(Typography, { variant: "caption", color: theme.colors["muted-foreground"] }, "\u{1F50D}"),
|
|
2029
|
+
filters.map((filter) => /* @__PURE__ */ React22.createElement(HStack, { key: filter.field, spacing: 8, align: "center" }, /* @__PURE__ */ React22.createElement(
|
|
1987
2030
|
Typography,
|
|
1988
2031
|
{
|
|
1989
2032
|
variant: "caption",
|
|
@@ -1991,7 +2034,7 @@ var FilterGroup = ({
|
|
|
1991
2034
|
},
|
|
1992
2035
|
filter.label,
|
|
1993
2036
|
":"
|
|
1994
|
-
), /* @__PURE__ */
|
|
2037
|
+
), /* @__PURE__ */ React22.createElement(HStack, { spacing: 0, style: styles16.pillGroup }, /* @__PURE__ */ React22.createElement(
|
|
1995
2038
|
TouchableOpacity12,
|
|
1996
2039
|
{
|
|
1997
2040
|
onPress: () => handleFilterSelect(filter.field, null),
|
|
@@ -2003,7 +2046,7 @@ var FilterGroup = ({
|
|
|
2003
2046
|
}
|
|
2004
2047
|
]
|
|
2005
2048
|
},
|
|
2006
|
-
/* @__PURE__ */
|
|
2049
|
+
/* @__PURE__ */ React22.createElement(
|
|
2007
2050
|
Typography,
|
|
2008
2051
|
{
|
|
2009
2052
|
variant: "caption",
|
|
@@ -2013,7 +2056,7 @@ var FilterGroup = ({
|
|
|
2013
2056
|
},
|
|
2014
2057
|
"All"
|
|
2015
2058
|
)
|
|
2016
|
-
), filter.options?.map((option) => /* @__PURE__ */
|
|
2059
|
+
), filter.options?.map((option) => /* @__PURE__ */ React22.createElement(
|
|
2017
2060
|
TouchableOpacity12,
|
|
2018
2061
|
{
|
|
2019
2062
|
key: option,
|
|
@@ -2027,7 +2070,7 @@ var FilterGroup = ({
|
|
|
2027
2070
|
}
|
|
2028
2071
|
]
|
|
2029
2072
|
},
|
|
2030
|
-
/* @__PURE__ */
|
|
2073
|
+
/* @__PURE__ */ React22.createElement(
|
|
2031
2074
|
Typography,
|
|
2032
2075
|
{
|
|
2033
2076
|
variant: "caption",
|
|
@@ -2038,43 +2081,43 @@ var FilterGroup = ({
|
|
|
2038
2081
|
option
|
|
2039
2082
|
)
|
|
2040
2083
|
))))),
|
|
2041
|
-
activeFilterCount > 0 && /* @__PURE__ */
|
|
2084
|
+
activeFilterCount > 0 && /* @__PURE__ */ React22.createElement(Button, { variant: "ghost", size: "sm", onPress: handleClearAll }, "Clear")
|
|
2042
2085
|
);
|
|
2043
2086
|
}
|
|
2044
2087
|
if (variant === "vertical") {
|
|
2045
|
-
return /* @__PURE__ */
|
|
2088
|
+
return /* @__PURE__ */ React22.createElement(VStack, { spacing: 16, style: [styles16.verticalContainer, style ?? {}] }, showIcon && /* @__PURE__ */ React22.createElement(HStack, { spacing: 8, align: "center" }, /* @__PURE__ */ React22.createElement(Typography, { variant: "caption", color: theme.colors["muted-foreground"] }, "\u{1F50D}"), /* @__PURE__ */ React22.createElement(
|
|
2046
2089
|
Typography,
|
|
2047
2090
|
{
|
|
2048
2091
|
variant: "label",
|
|
2049
2092
|
color: theme.colors["muted-foreground"]
|
|
2050
2093
|
},
|
|
2051
2094
|
"Filters"
|
|
2052
|
-
)), filters.map((filter) => /* @__PURE__ */
|
|
2095
|
+
)), filters.map((filter) => /* @__PURE__ */ React22.createElement(VStack, { key: filter.field, spacing: 4 }, /* @__PURE__ */ React22.createElement(
|
|
2053
2096
|
Typography,
|
|
2054
2097
|
{
|
|
2055
2098
|
variant: "label",
|
|
2056
2099
|
color: theme.colors["muted-foreground"]
|
|
2057
2100
|
},
|
|
2058
2101
|
filter.label
|
|
2059
|
-
), /* @__PURE__ */
|
|
2102
|
+
), /* @__PURE__ */ React22.createElement(
|
|
2060
2103
|
Select,
|
|
2061
2104
|
{
|
|
2062
2105
|
value: selectedValues[filter.field] || "all",
|
|
2063
2106
|
onChange: (newValue) => handleFilterSelect(filter.field, newValue),
|
|
2064
2107
|
options: buildSelectOptions(filter)
|
|
2065
2108
|
}
|
|
2066
|
-
))), activeFilterCount > 0 && /* @__PURE__ */
|
|
2109
|
+
))), activeFilterCount > 0 && /* @__PURE__ */ React22.createElement(Button, { variant: "ghost", size: "sm", onPress: handleClearAll }, "Clear all"));
|
|
2067
2110
|
}
|
|
2068
2111
|
if (variant === "compact") {
|
|
2069
|
-
return /* @__PURE__ */
|
|
2112
|
+
return /* @__PURE__ */ React22.createElement(
|
|
2070
2113
|
HStack,
|
|
2071
2114
|
{
|
|
2072
2115
|
spacing: 12,
|
|
2073
2116
|
align: "center",
|
|
2074
2117
|
style: [styles16.compactContainer, style ?? {}]
|
|
2075
2118
|
},
|
|
2076
|
-
showIcon && /* @__PURE__ */
|
|
2077
|
-
filters.map((filter) => /* @__PURE__ */
|
|
2119
|
+
showIcon && /* @__PURE__ */ React22.createElement(Typography, { variant: "caption", color: theme.colors["muted-foreground"] }, "\u{1F50D}"),
|
|
2120
|
+
filters.map((filter) => /* @__PURE__ */ React22.createElement(View19, { key: filter.field, style: styles16.compactSelect }, /* @__PURE__ */ React22.createElement(
|
|
2078
2121
|
Select,
|
|
2079
2122
|
{
|
|
2080
2123
|
value: selectedValues[filter.field] || "all",
|
|
@@ -2088,20 +2131,20 @@ var FilterGroup = ({
|
|
|
2088
2131
|
]
|
|
2089
2132
|
}
|
|
2090
2133
|
))),
|
|
2091
|
-
activeFilterCount > 0 && /* @__PURE__ */
|
|
2134
|
+
activeFilterCount > 0 && /* @__PURE__ */ React22.createElement(React22.Fragment, null, Object.entries(selectedValues).map(([field, value]) => {
|
|
2092
2135
|
const filterDef = filters.find((f) => f.field === field);
|
|
2093
|
-
return /* @__PURE__ */
|
|
2136
|
+
return /* @__PURE__ */ React22.createElement(
|
|
2094
2137
|
TouchableOpacity12,
|
|
2095
2138
|
{
|
|
2096
2139
|
key: field,
|
|
2097
2140
|
onPress: () => handleFilterSelect(field, null)
|
|
2098
2141
|
},
|
|
2099
|
-
/* @__PURE__ */
|
|
2142
|
+
/* @__PURE__ */ React22.createElement(Badge, { variant: "primary", size: "md" }, filterDef?.label, ": ", value, " \u2715")
|
|
2100
2143
|
);
|
|
2101
|
-
}), /* @__PURE__ */
|
|
2144
|
+
}), /* @__PURE__ */ React22.createElement(Button, { variant: "ghost", size: "sm", onPress: handleClearAll }, "Clear all"))
|
|
2102
2145
|
);
|
|
2103
2146
|
}
|
|
2104
|
-
return /* @__PURE__ */
|
|
2147
|
+
return /* @__PURE__ */ React22.createElement(
|
|
2105
2148
|
View19,
|
|
2106
2149
|
{
|
|
2107
2150
|
style: [
|
|
@@ -2113,28 +2156,28 @@ var FilterGroup = ({
|
|
|
2113
2156
|
style
|
|
2114
2157
|
]
|
|
2115
2158
|
},
|
|
2116
|
-
/* @__PURE__ */
|
|
2159
|
+
/* @__PURE__ */ React22.createElement(HStack, { spacing: 16, align: "center", style: styles16.defaultContent }, showIcon && /* @__PURE__ */ React22.createElement(HStack, { spacing: 8, align: "center" }, /* @__PURE__ */ React22.createElement(Typography, { variant: "caption", color: theme.colors["muted-foreground"] }, "\u{1F50D}"), /* @__PURE__ */ React22.createElement(
|
|
2117
2160
|
Typography,
|
|
2118
2161
|
{
|
|
2119
2162
|
variant: "label",
|
|
2120
2163
|
color: theme.colors["muted-foreground"]
|
|
2121
2164
|
},
|
|
2122
2165
|
"Filters"
|
|
2123
|
-
)), filters.map((filter) => /* @__PURE__ */
|
|
2166
|
+
)), filters.map((filter) => /* @__PURE__ */ React22.createElement(VStack, { key: filter.field, spacing: 4 }, /* @__PURE__ */ React22.createElement(
|
|
2124
2167
|
Typography,
|
|
2125
2168
|
{
|
|
2126
2169
|
variant: "label",
|
|
2127
2170
|
color: theme.colors["muted-foreground"]
|
|
2128
2171
|
},
|
|
2129
2172
|
filter.label
|
|
2130
|
-
), /* @__PURE__ */
|
|
2173
|
+
), /* @__PURE__ */ React22.createElement(
|
|
2131
2174
|
Select,
|
|
2132
2175
|
{
|
|
2133
2176
|
value: selectedValues[filter.field] || "all",
|
|
2134
2177
|
onChange: (newValue) => handleFilterSelect(filter.field, newValue),
|
|
2135
2178
|
options: buildSelectOptions(filter)
|
|
2136
2179
|
}
|
|
2137
|
-
))), activeFilterCount > 0 && /* @__PURE__ */
|
|
2180
|
+
))), activeFilterCount > 0 && /* @__PURE__ */ React22.createElement(HStack, { spacing: 12, align: "center", style: styles16.clearSection }, /* @__PURE__ */ React22.createElement(Badge, { variant: "primary", size: "md" }, activeFilterCount, " active"), /* @__PURE__ */ React22.createElement(Button, { variant: "ghost", size: "sm", onPress: handleClearAll }, "Clear all")))
|
|
2138
2181
|
);
|
|
2139
2182
|
};
|
|
2140
2183
|
var styles16 = StyleSheet16.create({
|
|
@@ -2177,7 +2220,7 @@ var styles16 = StyleSheet16.create({
|
|
|
2177
2220
|
FilterGroup.displayName = "FilterGroup";
|
|
2178
2221
|
|
|
2179
2222
|
// src/components/molecules/Meter.tsx
|
|
2180
|
-
import
|
|
2223
|
+
import React23, { useMemo as useMemo2, useCallback as useCallback2 } from "react";
|
|
2181
2224
|
import { View as View20, StyleSheet as StyleSheet17, TouchableOpacity as TouchableOpacity13 } from "react-native";
|
|
2182
2225
|
var getDefaultThresholds = (theme) => [
|
|
2183
2226
|
{ value: 30, color: theme.colors.error },
|
|
@@ -2243,21 +2286,21 @@ var Meter = ({
|
|
|
2243
2286
|
return unit ? `${formatted}${unit}` : formatted;
|
|
2244
2287
|
}, [value, unit]);
|
|
2245
2288
|
if (isLoading) {
|
|
2246
|
-
return /* @__PURE__ */
|
|
2289
|
+
return /* @__PURE__ */ React23.createElement(Card, { style: [styles17.container, style ?? {}] }, /* @__PURE__ */ React23.createElement(LoadingState, { message: "Loading meter..." }));
|
|
2247
2290
|
}
|
|
2248
2291
|
if (error) {
|
|
2249
|
-
return /* @__PURE__ */
|
|
2292
|
+
return /* @__PURE__ */ React23.createElement(Card, { style: [styles17.container, style ?? {}] }, /* @__PURE__ */ React23.createElement(ErrorState, { message: error.message }));
|
|
2250
2293
|
}
|
|
2251
2294
|
if (variant === "segmented") {
|
|
2252
2295
|
const activeSegments = Math.round(percentage / 100 * segments);
|
|
2253
|
-
return /* @__PURE__ */
|
|
2296
|
+
return /* @__PURE__ */ React23.createElement(Card, { style: [styles17.container, style ?? {}] }, /* @__PURE__ */ React23.createElement(VStack, { spacing: 8 }, (label || showValue) && /* @__PURE__ */ React23.createElement(HStack, { justify: "space-between", align: "center" }, label && /* @__PURE__ */ React23.createElement(
|
|
2254
2297
|
Typography,
|
|
2255
2298
|
{
|
|
2256
2299
|
variant: "caption",
|
|
2257
2300
|
color: theme.colors["muted-foreground"]
|
|
2258
2301
|
},
|
|
2259
2302
|
label
|
|
2260
|
-
), showValue && /* @__PURE__ */
|
|
2303
|
+
), showValue && /* @__PURE__ */ React23.createElement(Typography, { variant: "body", style: { fontWeight: "600" } }, displayValue)), /* @__PURE__ */ React23.createElement(HStack, { spacing: 4, style: styles17.segmentsContainer }, Array.from({ length: segments }).map((_, idx) => {
|
|
2261
2304
|
const isActive = idx < activeSegments;
|
|
2262
2305
|
const segColor = isActive ? getColorForValue(
|
|
2263
2306
|
(idx + 1) / segments * max,
|
|
@@ -2265,7 +2308,7 @@ var Meter = ({
|
|
|
2265
2308
|
thresholds,
|
|
2266
2309
|
theme
|
|
2267
2310
|
) : void 0;
|
|
2268
|
-
return /* @__PURE__ */
|
|
2311
|
+
return /* @__PURE__ */ React23.createElement(
|
|
2269
2312
|
View20,
|
|
2270
2313
|
{
|
|
2271
2314
|
key: idx,
|
|
@@ -2277,7 +2320,7 @@ var Meter = ({
|
|
|
2277
2320
|
]
|
|
2278
2321
|
}
|
|
2279
2322
|
);
|
|
2280
|
-
})), thresholds.some((t) => t.label) && /* @__PURE__ */
|
|
2323
|
+
})), thresholds.some((t) => t.label) && /* @__PURE__ */ React23.createElement(HStack, { justify: "space-between", style: styles17.thresholdLabels }, thresholds.map((t, idx) => /* @__PURE__ */ React23.createElement(
|
|
2281
2324
|
Typography,
|
|
2282
2325
|
{
|
|
2283
2326
|
key: idx,
|
|
@@ -2285,7 +2328,7 @@ var Meter = ({
|
|
|
2285
2328
|
color: theme.colors["muted-foreground"]
|
|
2286
2329
|
},
|
|
2287
2330
|
t.label || ""
|
|
2288
|
-
))), actions && actions.length > 0 && /* @__PURE__ */
|
|
2331
|
+
))), actions && actions.length > 0 && /* @__PURE__ */ React23.createElement(HStack, { spacing: 8, style: styles17.actionsContainer }, actions.map((action, idx) => /* @__PURE__ */ React23.createElement(TouchableOpacity13, { key: idx, onPress: onActionPress(action) }, /* @__PURE__ */ React23.createElement(
|
|
2289
2332
|
Badge,
|
|
2290
2333
|
{
|
|
2291
2334
|
variant: action.variant ?? "default",
|
|
@@ -2294,14 +2337,14 @@ var Meter = ({
|
|
|
2294
2337
|
action.label
|
|
2295
2338
|
))))));
|
|
2296
2339
|
}
|
|
2297
|
-
return /* @__PURE__ */
|
|
2340
|
+
return /* @__PURE__ */ React23.createElement(Card, { style: [styles17.container, style ?? {}] }, /* @__PURE__ */ React23.createElement(VStack, { spacing: 8 }, (label || showValue) && /* @__PURE__ */ React23.createElement(HStack, { justify: "space-between", align: "center" }, label && /* @__PURE__ */ React23.createElement(
|
|
2298
2341
|
Typography,
|
|
2299
2342
|
{
|
|
2300
2343
|
variant: "caption",
|
|
2301
2344
|
color: theme.colors["muted-foreground"]
|
|
2302
2345
|
},
|
|
2303
2346
|
label
|
|
2304
|
-
), showValue && /* @__PURE__ */
|
|
2347
|
+
), showValue && /* @__PURE__ */ React23.createElement(Typography, { variant: "body", style: { fontWeight: "600" } }, displayValue)), /* @__PURE__ */ React23.createElement(
|
|
2305
2348
|
View20,
|
|
2306
2349
|
{
|
|
2307
2350
|
style: [
|
|
@@ -2311,7 +2354,7 @@ var Meter = ({
|
|
|
2311
2354
|
}
|
|
2312
2355
|
]
|
|
2313
2356
|
},
|
|
2314
|
-
/* @__PURE__ */
|
|
2357
|
+
/* @__PURE__ */ React23.createElement(
|
|
2315
2358
|
View20,
|
|
2316
2359
|
{
|
|
2317
2360
|
style: [
|
|
@@ -2323,7 +2366,7 @@ var Meter = ({
|
|
|
2323
2366
|
]
|
|
2324
2367
|
}
|
|
2325
2368
|
)
|
|
2326
|
-
), /* @__PURE__ */
|
|
2369
|
+
), /* @__PURE__ */ React23.createElement(HStack, { justify: "space-between", style: styles17.rangeLabels }, /* @__PURE__ */ React23.createElement(Typography, { variant: "caption", color: theme.colors["muted-foreground"] }, min, unit ? ` ${unit}` : ""), /* @__PURE__ */ React23.createElement(Typography, { variant: "caption", color: theme.colors["muted-foreground"] }, max, unit ? ` ${unit}` : "")), actions && actions.length > 0 && /* @__PURE__ */ React23.createElement(HStack, { spacing: 8, style: styles17.actionsContainer }, actions.map((action, idx) => /* @__PURE__ */ React23.createElement(TouchableOpacity13, { key: idx, onPress: onActionPress(action) }, /* @__PURE__ */ React23.createElement(
|
|
2327
2370
|
Badge,
|
|
2328
2371
|
{
|
|
2329
2372
|
variant: action.variant ?? "default",
|
|
@@ -2368,7 +2411,7 @@ var styles17 = StyleSheet17.create({
|
|
|
2368
2411
|
Meter.displayName = "Meter";
|
|
2369
2412
|
|
|
2370
2413
|
// src/components/molecules/Pagination.tsx
|
|
2371
|
-
import
|
|
2414
|
+
import React24 from "react";
|
|
2372
2415
|
import { View as View21, TouchableOpacity as TouchableOpacity14, StyleSheet as StyleSheet18 } from "react-native";
|
|
2373
2416
|
var Pagination = ({
|
|
2374
2417
|
currentPage,
|
|
@@ -2395,10 +2438,10 @@ var Pagination = ({
|
|
|
2395
2438
|
onPageChange?.(page);
|
|
2396
2439
|
};
|
|
2397
2440
|
if (isLoading) {
|
|
2398
|
-
return /* @__PURE__ */
|
|
2441
|
+
return /* @__PURE__ */ React24.createElement(View21, { style: [styles18.container, style] }, /* @__PURE__ */ React24.createElement(LoadingState, { message: "Loading pages..." }));
|
|
2399
2442
|
}
|
|
2400
2443
|
if (error) {
|
|
2401
|
-
return /* @__PURE__ */
|
|
2444
|
+
return /* @__PURE__ */ React24.createElement(View21, { style: [styles18.container, style] }, /* @__PURE__ */ React24.createElement(ErrorState, { message: error.message }));
|
|
2402
2445
|
}
|
|
2403
2446
|
if (totalPages <= 1) {
|
|
2404
2447
|
return null;
|
|
@@ -2419,7 +2462,7 @@ var Pagination = ({
|
|
|
2419
2462
|
const visiblePages = getVisiblePages();
|
|
2420
2463
|
const canGoPrev = currentPage > 1;
|
|
2421
2464
|
const canGoNext = currentPage < totalPages;
|
|
2422
|
-
return /* @__PURE__ */
|
|
2465
|
+
return /* @__PURE__ */ React24.createElement(HStack, { spacing: 4, align: "center", justify: "center", style: [styles18.container, style || {}] }, showFirstLast && /* @__PURE__ */ React24.createElement(
|
|
2423
2466
|
Button,
|
|
2424
2467
|
{
|
|
2425
2468
|
variant: "ghost",
|
|
@@ -2428,7 +2471,7 @@ var Pagination = ({
|
|
|
2428
2471
|
onPress: () => handlePageChange(1)
|
|
2429
2472
|
},
|
|
2430
2473
|
"<<"
|
|
2431
|
-
), /* @__PURE__ */
|
|
2474
|
+
), /* @__PURE__ */ React24.createElement(
|
|
2432
2475
|
Button,
|
|
2433
2476
|
{
|
|
2434
2477
|
variant: "secondary",
|
|
@@ -2437,9 +2480,9 @@ var Pagination = ({
|
|
|
2437
2480
|
onPress: () => handlePageChange(currentPage - 1)
|
|
2438
2481
|
},
|
|
2439
2482
|
prevLabel
|
|
2440
|
-
), visiblePages[0] > 1 && /* @__PURE__ */
|
|
2483
|
+
), visiblePages[0] > 1 && /* @__PURE__ */ React24.createElement(View21, { style: styles18.ellipsis }, /* @__PURE__ */ React24.createElement(Typography, { variant: "body", color: theme.colors["muted-foreground"] }, "...")), visiblePages.map((page) => {
|
|
2441
2484
|
const isActive = page === currentPage;
|
|
2442
|
-
return /* @__PURE__ */
|
|
2485
|
+
return /* @__PURE__ */ React24.createElement(
|
|
2443
2486
|
TouchableOpacity14,
|
|
2444
2487
|
{
|
|
2445
2488
|
key: page,
|
|
@@ -2452,7 +2495,7 @@ var Pagination = ({
|
|
|
2452
2495
|
}
|
|
2453
2496
|
]
|
|
2454
2497
|
},
|
|
2455
|
-
/* @__PURE__ */
|
|
2498
|
+
/* @__PURE__ */ React24.createElement(
|
|
2456
2499
|
Typography,
|
|
2457
2500
|
{
|
|
2458
2501
|
variant: "body",
|
|
@@ -2463,7 +2506,7 @@ var Pagination = ({
|
|
|
2463
2506
|
page
|
|
2464
2507
|
)
|
|
2465
2508
|
);
|
|
2466
|
-
}), visiblePages[visiblePages.length - 1] < totalPages && /* @__PURE__ */
|
|
2509
|
+
}), visiblePages[visiblePages.length - 1] < totalPages && /* @__PURE__ */ React24.createElement(View21, { style: styles18.ellipsis }, /* @__PURE__ */ React24.createElement(Typography, { variant: "body", color: theme.colors["muted-foreground"] }, "...")), /* @__PURE__ */ React24.createElement(
|
|
2467
2510
|
Button,
|
|
2468
2511
|
{
|
|
2469
2512
|
variant: "secondary",
|
|
@@ -2472,7 +2515,7 @@ var Pagination = ({
|
|
|
2472
2515
|
onPress: () => handlePageChange(currentPage + 1)
|
|
2473
2516
|
},
|
|
2474
2517
|
nextLabel
|
|
2475
|
-
), showFirstLast && /* @__PURE__ */
|
|
2518
|
+
), showFirstLast && /* @__PURE__ */ React24.createElement(
|
|
2476
2519
|
Button,
|
|
2477
2520
|
{
|
|
2478
2521
|
variant: "ghost",
|
|
@@ -2507,7 +2550,7 @@ var styles18 = StyleSheet18.create({
|
|
|
2507
2550
|
Pagination.displayName = "Pagination";
|
|
2508
2551
|
|
|
2509
2552
|
// src/components/molecules/MarkdownContent.tsx
|
|
2510
|
-
import
|
|
2553
|
+
import React25 from "react";
|
|
2511
2554
|
import { View as View22, StyleSheet as StyleSheet19 } from "react-native";
|
|
2512
2555
|
var parseMarkdown = (content) => {
|
|
2513
2556
|
const elements = [];
|
|
@@ -2643,14 +2686,14 @@ var renderInlineContent = (content, theme) => {
|
|
|
2643
2686
|
if (earliestMatch) {
|
|
2644
2687
|
if (earliestMatch.index > 0) {
|
|
2645
2688
|
parts.push(
|
|
2646
|
-
/* @__PURE__ */
|
|
2689
|
+
/* @__PURE__ */ React25.createElement(Typography, { key: key++, variant: "body" }, remaining.slice(0, earliestMatch.index))
|
|
2647
2690
|
);
|
|
2648
2691
|
}
|
|
2649
2692
|
const content2 = earliestMatch.match[1];
|
|
2650
2693
|
switch (earliestMatch.type) {
|
|
2651
2694
|
case "code":
|
|
2652
2695
|
parts.push(
|
|
2653
|
-
/* @__PURE__ */
|
|
2696
|
+
/* @__PURE__ */ React25.createElement(
|
|
2654
2697
|
Typography,
|
|
2655
2698
|
{
|
|
2656
2699
|
key: key++,
|
|
@@ -2669,7 +2712,7 @@ var renderInlineContent = (content, theme) => {
|
|
|
2669
2712
|
break;
|
|
2670
2713
|
case "bold":
|
|
2671
2714
|
parts.push(
|
|
2672
|
-
/* @__PURE__ */
|
|
2715
|
+
/* @__PURE__ */ React25.createElement(
|
|
2673
2716
|
Typography,
|
|
2674
2717
|
{
|
|
2675
2718
|
key: key++,
|
|
@@ -2682,7 +2725,7 @@ var renderInlineContent = (content, theme) => {
|
|
|
2682
2725
|
break;
|
|
2683
2726
|
case "italic":
|
|
2684
2727
|
parts.push(
|
|
2685
|
-
/* @__PURE__ */
|
|
2728
|
+
/* @__PURE__ */ React25.createElement(
|
|
2686
2729
|
Typography,
|
|
2687
2730
|
{
|
|
2688
2731
|
key: key++,
|
|
@@ -2697,7 +2740,7 @@ var renderInlineContent = (content, theme) => {
|
|
|
2697
2740
|
remaining = remaining.slice(earliestMatch.index + earliestMatch.match[0].length);
|
|
2698
2741
|
} else {
|
|
2699
2742
|
parts.push(
|
|
2700
|
-
/* @__PURE__ */
|
|
2743
|
+
/* @__PURE__ */ React25.createElement(Typography, { key: key++, variant: "body" }, remaining)
|
|
2701
2744
|
);
|
|
2702
2745
|
break;
|
|
2703
2746
|
}
|
|
@@ -2712,12 +2755,12 @@ var MarkdownContent = ({
|
|
|
2712
2755
|
padding = "md"
|
|
2713
2756
|
}) => {
|
|
2714
2757
|
const theme = useTheme();
|
|
2715
|
-
const elements =
|
|
2758
|
+
const elements = React25.useMemo(() => parseMarkdown(content), [content]);
|
|
2716
2759
|
if (isLoading) {
|
|
2717
|
-
return /* @__PURE__ */
|
|
2760
|
+
return /* @__PURE__ */ React25.createElement(Card, { style: [styles19.container, style || {}] }, /* @__PURE__ */ React25.createElement(LoadingState, { message: "Loading content..." }));
|
|
2718
2761
|
}
|
|
2719
2762
|
if (error) {
|
|
2720
|
-
return /* @__PURE__ */
|
|
2763
|
+
return /* @__PURE__ */ React25.createElement(Card, { style: [styles19.container, style || {}] }, /* @__PURE__ */ React25.createElement(ErrorState, { message: error.message }));
|
|
2721
2764
|
}
|
|
2722
2765
|
const paddingStyles = {
|
|
2723
2766
|
none: { padding: 0 },
|
|
@@ -2736,7 +2779,7 @@ var MarkdownContent = ({
|
|
|
2736
2779
|
5: "body",
|
|
2737
2780
|
6: "body"
|
|
2738
2781
|
};
|
|
2739
|
-
return /* @__PURE__ */
|
|
2782
|
+
return /* @__PURE__ */ React25.createElement(
|
|
2740
2783
|
Typography,
|
|
2741
2784
|
{
|
|
2742
2785
|
key: index,
|
|
@@ -2749,9 +2792,9 @@ var MarkdownContent = ({
|
|
|
2749
2792
|
element.content
|
|
2750
2793
|
);
|
|
2751
2794
|
case "paragraph":
|
|
2752
|
-
return /* @__PURE__ */
|
|
2795
|
+
return /* @__PURE__ */ React25.createElement(View22, { key: index, style: styles19.paragraph }, renderInlineContent(element.content, theme));
|
|
2753
2796
|
case "code":
|
|
2754
|
-
return /* @__PURE__ */
|
|
2797
|
+
return /* @__PURE__ */ React25.createElement(
|
|
2755
2798
|
View22,
|
|
2756
2799
|
{
|
|
2757
2800
|
key: index,
|
|
@@ -2760,7 +2803,7 @@ var MarkdownContent = ({
|
|
|
2760
2803
|
{ backgroundColor: theme.colors.muted }
|
|
2761
2804
|
]
|
|
2762
2805
|
},
|
|
2763
|
-
element.language && /* @__PURE__ */
|
|
2806
|
+
element.language && /* @__PURE__ */ React25.createElement(
|
|
2764
2807
|
Typography,
|
|
2765
2808
|
{
|
|
2766
2809
|
variant: "caption",
|
|
@@ -2772,7 +2815,7 @@ var MarkdownContent = ({
|
|
|
2772
2815
|
},
|
|
2773
2816
|
element.language
|
|
2774
2817
|
),
|
|
2775
|
-
/* @__PURE__ */
|
|
2818
|
+
/* @__PURE__ */ React25.createElement(
|
|
2776
2819
|
Typography,
|
|
2777
2820
|
{
|
|
2778
2821
|
variant: "body",
|
|
@@ -2785,7 +2828,7 @@ var MarkdownContent = ({
|
|
|
2785
2828
|
)
|
|
2786
2829
|
);
|
|
2787
2830
|
case "blockquote":
|
|
2788
|
-
return /* @__PURE__ */
|
|
2831
|
+
return /* @__PURE__ */ React25.createElement(
|
|
2789
2832
|
View22,
|
|
2790
2833
|
{
|
|
2791
2834
|
key: index,
|
|
@@ -2797,7 +2840,7 @@ var MarkdownContent = ({
|
|
|
2797
2840
|
}
|
|
2798
2841
|
]
|
|
2799
2842
|
},
|
|
2800
|
-
/* @__PURE__ */
|
|
2843
|
+
/* @__PURE__ */ React25.createElement(
|
|
2801
2844
|
Typography,
|
|
2802
2845
|
{
|
|
2803
2846
|
variant: "body",
|
|
@@ -2807,7 +2850,7 @@ var MarkdownContent = ({
|
|
|
2807
2850
|
)
|
|
2808
2851
|
);
|
|
2809
2852
|
case "list":
|
|
2810
|
-
return /* @__PURE__ */
|
|
2853
|
+
return /* @__PURE__ */ React25.createElement(View22, { key: index, style: styles19.list }, element.items.map((item, itemIndex) => /* @__PURE__ */ React25.createElement(View22, { key: itemIndex, style: styles19.listItem }, /* @__PURE__ */ React25.createElement(
|
|
2811
2854
|
Typography,
|
|
2812
2855
|
{
|
|
2813
2856
|
variant: "body",
|
|
@@ -2817,9 +2860,9 @@ var MarkdownContent = ({
|
|
|
2817
2860
|
]
|
|
2818
2861
|
},
|
|
2819
2862
|
element.ordered ? `${itemIndex + 1}.` : "\u2022"
|
|
2820
|
-
), /* @__PURE__ */
|
|
2863
|
+
), /* @__PURE__ */ React25.createElement(View22, { style: styles19.listItemContent }, renderInlineContent(item, theme)))));
|
|
2821
2864
|
case "horizontalRule":
|
|
2822
|
-
return /* @__PURE__ */
|
|
2865
|
+
return /* @__PURE__ */ React25.createElement(
|
|
2823
2866
|
View22,
|
|
2824
2867
|
{
|
|
2825
2868
|
key: index,
|
|
@@ -2833,7 +2876,7 @@ var MarkdownContent = ({
|
|
|
2833
2876
|
return null;
|
|
2834
2877
|
}
|
|
2835
2878
|
};
|
|
2836
|
-
return /* @__PURE__ */
|
|
2879
|
+
return /* @__PURE__ */ React25.createElement(Card, { style: [styles19.container, style || {}], padding: "none" }, /* @__PURE__ */ React25.createElement(VStack, { spacing: 12, style: [styles19.content, paddingStyles[padding]] }, elements.map((element, index) => renderElement(element, index))));
|
|
2837
2880
|
};
|
|
2838
2881
|
var styles19 = StyleSheet19.create({
|
|
2839
2882
|
container: {
|
|
@@ -2882,7 +2925,7 @@ var styles19 = StyleSheet19.create({
|
|
|
2882
2925
|
MarkdownContent.displayName = "MarkdownContent";
|
|
2883
2926
|
|
|
2884
2927
|
// src/components/molecules/WizardNavigation.tsx
|
|
2885
|
-
import
|
|
2928
|
+
import React26 from "react";
|
|
2886
2929
|
import {
|
|
2887
2930
|
View as View23,
|
|
2888
2931
|
StyleSheet as StyleSheet20
|
|
@@ -2935,13 +2978,13 @@ var WizardNavigation = ({
|
|
|
2935
2978
|
}
|
|
2936
2979
|
};
|
|
2937
2980
|
if (isLoading) {
|
|
2938
|
-
return /* @__PURE__ */
|
|
2981
|
+
return /* @__PURE__ */ React26.createElement(View23, { style: [styles20.container, style] }, /* @__PURE__ */ React26.createElement(LoadingState, { message: "Loading..." }));
|
|
2939
2982
|
}
|
|
2940
2983
|
if (error) {
|
|
2941
|
-
return /* @__PURE__ */
|
|
2984
|
+
return /* @__PURE__ */ React26.createElement(View23, { style: [styles20.container, style] }, /* @__PURE__ */ React26.createElement(ErrorState, { message: error.message }));
|
|
2942
2985
|
}
|
|
2943
2986
|
const visibleCustomActions = customActions?.filter((action) => !action.hidden) || [];
|
|
2944
|
-
return /* @__PURE__ */
|
|
2987
|
+
return /* @__PURE__ */ React26.createElement(HStack, { spacing: 12, justify: "space-between", style: [styles20.container, style] }, /* @__PURE__ */ React26.createElement(HStack, { spacing: 8 }, isFirstStep && showCancel || !isFirstStep ? /* @__PURE__ */ React26.createElement(
|
|
2945
2988
|
Button,
|
|
2946
2989
|
{
|
|
2947
2990
|
variant: "ghost",
|
|
@@ -2950,7 +2993,7 @@ var WizardNavigation = ({
|
|
|
2950
2993
|
action: isFirstStep ? "WIZARD_CANCEL" : "WIZARD_BACK"
|
|
2951
2994
|
},
|
|
2952
2995
|
isFirstStep ? cancelLabel : backLabel
|
|
2953
|
-
) : null, visibleCustomActions.map((action, index) => /* @__PURE__ */
|
|
2996
|
+
) : null, visibleCustomActions.map((action, index) => /* @__PURE__ */ React26.createElement(
|
|
2954
2997
|
Button,
|
|
2955
2998
|
{
|
|
2956
2999
|
key: `${action.label}-${index}`,
|
|
@@ -2960,7 +3003,7 @@ var WizardNavigation = ({
|
|
|
2960
3003
|
action: action.event
|
|
2961
3004
|
},
|
|
2962
3005
|
action.label
|
|
2963
|
-
))), /* @__PURE__ */
|
|
3006
|
+
))), /* @__PURE__ */ React26.createElement(
|
|
2964
3007
|
Button,
|
|
2965
3008
|
{
|
|
2966
3009
|
variant: "primary",
|
|
@@ -2980,7 +3023,7 @@ var styles20 = StyleSheet20.create({
|
|
|
2980
3023
|
WizardNavigation.displayName = "WizardNavigation";
|
|
2981
3024
|
|
|
2982
3025
|
// src/components/molecules/WizardProgress.tsx
|
|
2983
|
-
import
|
|
3026
|
+
import React27 from "react";
|
|
2984
3027
|
import {
|
|
2985
3028
|
View as View24,
|
|
2986
3029
|
TouchableOpacity as TouchableOpacity15,
|
|
@@ -3037,16 +3080,16 @@ var WizardProgress = ({
|
|
|
3037
3080
|
}
|
|
3038
3081
|
};
|
|
3039
3082
|
if (isLoading) {
|
|
3040
|
-
return /* @__PURE__ */
|
|
3083
|
+
return /* @__PURE__ */ React27.createElement(View24, { style: [styles21.container, style] }, /* @__PURE__ */ React27.createElement(LoadingState, { message: "Loading..." }));
|
|
3041
3084
|
}
|
|
3042
3085
|
if (error) {
|
|
3043
|
-
return /* @__PURE__ */
|
|
3086
|
+
return /* @__PURE__ */ React27.createElement(View24, { style: [styles21.container, style] }, /* @__PURE__ */ React27.createElement(ErrorState, { message: error.message }));
|
|
3044
3087
|
}
|
|
3045
|
-
const renderDots = () => /* @__PURE__ */
|
|
3088
|
+
const renderDots = () => /* @__PURE__ */ React27.createElement(HStack, { spacing: 8, justify: "center", style: styles21.dotsContainer }, steps.map((step, index) => {
|
|
3046
3089
|
const status = getStepStatus(index);
|
|
3047
3090
|
const colors = getStepColor(status);
|
|
3048
3091
|
const canPress = allowNavigation && index <= currentStep;
|
|
3049
|
-
return /* @__PURE__ */
|
|
3092
|
+
return /* @__PURE__ */ React27.createElement(
|
|
3050
3093
|
TouchableOpacity15,
|
|
3051
3094
|
{
|
|
3052
3095
|
key: step.id,
|
|
@@ -3062,14 +3105,14 @@ var WizardProgress = ({
|
|
|
3062
3105
|
],
|
|
3063
3106
|
activeOpacity: 0.8
|
|
3064
3107
|
},
|
|
3065
|
-
status === "completed" ? /* @__PURE__ */
|
|
3108
|
+
status === "completed" ? /* @__PURE__ */ React27.createElement(Typography, { variant: "caption", style: { color: colors.text, fontWeight: "700" } }, "\u2713") : /* @__PURE__ */ React27.createElement(View24, { style: [styles21.dotInner, { backgroundColor: colors.background }] })
|
|
3066
3109
|
);
|
|
3067
3110
|
}));
|
|
3068
|
-
const renderNumbers = () => /* @__PURE__ */
|
|
3111
|
+
const renderNumbers = () => /* @__PURE__ */ React27.createElement(HStack, { spacing: 12, justify: "center", style: styles21.numbersContainer }, steps.map((step, index) => {
|
|
3069
3112
|
const status = getStepStatus(index);
|
|
3070
3113
|
const colors = getStepColor(status);
|
|
3071
3114
|
const canPress = allowNavigation && index <= currentStep;
|
|
3072
|
-
return /* @__PURE__ */
|
|
3115
|
+
return /* @__PURE__ */ React27.createElement(
|
|
3073
3116
|
TouchableOpacity15,
|
|
3074
3117
|
{
|
|
3075
3118
|
key: step.id,
|
|
@@ -3078,7 +3121,7 @@ var WizardProgress = ({
|
|
|
3078
3121
|
activeOpacity: 0.8,
|
|
3079
3122
|
style: styles21.numberStepContainer
|
|
3080
3123
|
},
|
|
3081
|
-
/* @__PURE__ */
|
|
3124
|
+
/* @__PURE__ */ React27.createElement(VStack, { align: "center", spacing: 4 }, /* @__PURE__ */ React27.createElement(
|
|
3082
3125
|
View24,
|
|
3083
3126
|
{
|
|
3084
3127
|
style: [
|
|
@@ -3090,8 +3133,8 @@ var WizardProgress = ({
|
|
|
3090
3133
|
canPress && styles21.clickableNumber
|
|
3091
3134
|
]
|
|
3092
3135
|
},
|
|
3093
|
-
/* @__PURE__ */
|
|
3094
|
-
), showLabels && /* @__PURE__ */
|
|
3136
|
+
/* @__PURE__ */ React27.createElement(Typography, { variant: "body", style: { color: colors.text, fontWeight: "600" } }, status === "completed" ? "\u2713" : index + 1)
|
|
3137
|
+
), showLabels && /* @__PURE__ */ React27.createElement(
|
|
3095
3138
|
Typography,
|
|
3096
3139
|
{
|
|
3097
3140
|
variant: "caption",
|
|
@@ -3104,7 +3147,7 @@ var WizardProgress = ({
|
|
|
3104
3147
|
numberOfLines: 1
|
|
3105
3148
|
},
|
|
3106
3149
|
step.title
|
|
3107
|
-
), showDescriptions && step.description && /* @__PURE__ */
|
|
3150
|
+
), showDescriptions && step.description && /* @__PURE__ */ React27.createElement(
|
|
3108
3151
|
Typography,
|
|
3109
3152
|
{
|
|
3110
3153
|
variant: "caption",
|
|
@@ -3117,7 +3160,7 @@ var WizardProgress = ({
|
|
|
3117
3160
|
numberOfLines: 1
|
|
3118
3161
|
},
|
|
3119
3162
|
step.description
|
|
3120
|
-
), step.optional && /* @__PURE__ */
|
|
3163
|
+
), step.optional && /* @__PURE__ */ React27.createElement(
|
|
3121
3164
|
Typography,
|
|
3122
3165
|
{
|
|
3123
3166
|
variant: "caption",
|
|
@@ -3131,14 +3174,14 @@ var WizardProgress = ({
|
|
|
3131
3174
|
))
|
|
3132
3175
|
);
|
|
3133
3176
|
}));
|
|
3134
|
-
const renderBar = () => /* @__PURE__ */
|
|
3177
|
+
const renderBar = () => /* @__PURE__ */ React27.createElement(VStack, { spacing: 8, style: styles21.barContainer }, /* @__PURE__ */ React27.createElement(ProgressBar, { progress, showLabel: false, size: "md" }), showLabels && /* @__PURE__ */ React27.createElement(HStack, { justify: "space-between" }, /* @__PURE__ */ React27.createElement(Typography, { variant: "caption", style: { color: theme.colors["muted-foreground"] } }, "Step ", currentStep + 1, " of ", steps.length), /* @__PURE__ */ React27.createElement(Typography, { variant: "caption", style: { color: theme.colors["muted-foreground"] } }, Math.round(progress), "%")), showLabels && /* @__PURE__ */ React27.createElement(
|
|
3135
3178
|
Typography,
|
|
3136
3179
|
{
|
|
3137
3180
|
variant: "body",
|
|
3138
3181
|
style: { color: theme.colors.foreground, textAlign: "center", marginTop: 4 }
|
|
3139
3182
|
},
|
|
3140
3183
|
steps[currentStep]?.title
|
|
3141
|
-
), showDescriptions && steps[currentStep]?.description && /* @__PURE__ */
|
|
3184
|
+
), showDescriptions && steps[currentStep]?.description && /* @__PURE__ */ React27.createElement(
|
|
3142
3185
|
Typography,
|
|
3143
3186
|
{
|
|
3144
3187
|
variant: "caption",
|
|
@@ -3146,7 +3189,7 @@ var WizardProgress = ({
|
|
|
3146
3189
|
},
|
|
3147
3190
|
steps[currentStep].description
|
|
3148
3191
|
));
|
|
3149
|
-
return /* @__PURE__ */
|
|
3192
|
+
return /* @__PURE__ */ React27.createElement(View24, { style: [styles21.container, style] }, variant === "dots" && renderDots(), variant === "numbers" && renderNumbers(), variant === "bar" && renderBar());
|
|
3150
3193
|
};
|
|
3151
3194
|
var styles21 = StyleSheet21.create({
|
|
3152
3195
|
container: {
|
|
@@ -3196,7 +3239,7 @@ var styles21 = StyleSheet21.create({
|
|
|
3196
3239
|
WizardProgress.displayName = "WizardProgress";
|
|
3197
3240
|
|
|
3198
3241
|
// src/components/molecules/QuizBlock.tsx
|
|
3199
|
-
import
|
|
3242
|
+
import React28 from "react";
|
|
3200
3243
|
import {
|
|
3201
3244
|
View as View25,
|
|
3202
3245
|
TouchableOpacity as TouchableOpacity16,
|
|
@@ -3223,12 +3266,12 @@ var QuizBlock = ({
|
|
|
3223
3266
|
}) => {
|
|
3224
3267
|
const theme = useTheme();
|
|
3225
3268
|
const eventBus = useEventBus();
|
|
3226
|
-
const [selected, setSelected] =
|
|
3227
|
-
const [isAnswered, setIsAnswered] =
|
|
3228
|
-
|
|
3269
|
+
const [selected, setSelected] = React28.useState(selectedValues);
|
|
3270
|
+
const [isAnswered, setIsAnswered] = React28.useState(false);
|
|
3271
|
+
React28.useEffect(() => {
|
|
3229
3272
|
setSelected(selectedValues);
|
|
3230
3273
|
}, [selectedValues]);
|
|
3231
|
-
const shuffledOptions =
|
|
3274
|
+
const shuffledOptions = React28.useMemo(() => {
|
|
3232
3275
|
if (!shuffle) return options;
|
|
3233
3276
|
return [...options].sort(() => Math.random() - 0.5);
|
|
3234
3277
|
}, [options, shuffle]);
|
|
@@ -3298,15 +3341,15 @@ var QuizBlock = ({
|
|
|
3298
3341
|
return option?.correct;
|
|
3299
3342
|
}) && selected.length === options.filter((o) => o.correct).length;
|
|
3300
3343
|
if (isLoading) {
|
|
3301
|
-
return /* @__PURE__ */
|
|
3344
|
+
return /* @__PURE__ */ React28.createElement(View25, { style: [styles22.container, style] }, /* @__PURE__ */ React28.createElement(LoadingState, { message: "Loading question..." }));
|
|
3302
3345
|
}
|
|
3303
3346
|
if (error) {
|
|
3304
|
-
return /* @__PURE__ */
|
|
3347
|
+
return /* @__PURE__ */ React28.createElement(View25, { style: [styles22.container, style] }, /* @__PURE__ */ React28.createElement(ErrorState, { message: error.message }));
|
|
3305
3348
|
}
|
|
3306
|
-
return /* @__PURE__ */
|
|
3349
|
+
return /* @__PURE__ */ React28.createElement(Card, { style: [styles22.container, style], padding: "lg" }, /* @__PURE__ */ React28.createElement(VStack, { spacing: 16 }, /* @__PURE__ */ React28.createElement(HStack, { justify: "space-between", align: "center" }, (questionNumber !== void 0 || category) && /* @__PURE__ */ React28.createElement(HStack, { spacing: 8, align: "center" }, questionNumber !== void 0 && totalQuestions !== void 0 && /* @__PURE__ */ React28.createElement(Badge, { variant: "secondary", size: "sm" }, questionNumber, " / ", totalQuestions), category && /* @__PURE__ */ React28.createElement(Badge, { variant: "default", size: "sm" }, category)), difficulty && /* @__PURE__ */ React28.createElement(Badge, { variant: getDifficultyColor(), size: "sm" }, difficulty)), /* @__PURE__ */ React28.createElement(Typography, { variant: "h4", style: { color: theme.colors.foreground } }, question), allowMultiple && /* @__PURE__ */ React28.createElement(Typography, { variant: "caption", style: { color: theme.colors["muted-foreground"] } }, "Select all that apply"), /* @__PURE__ */ React28.createElement(VStack, { spacing: 8 }, shuffledOptions.map((option) => {
|
|
3307
3350
|
const style2 = getOptionStyle(option);
|
|
3308
3351
|
const isSelected = selected.includes(option.value);
|
|
3309
|
-
return /* @__PURE__ */
|
|
3352
|
+
return /* @__PURE__ */ React28.createElement(
|
|
3310
3353
|
TouchableOpacity16,
|
|
3311
3354
|
{
|
|
3312
3355
|
key: option.id,
|
|
@@ -3320,7 +3363,7 @@ var QuizBlock = ({
|
|
|
3320
3363
|
}
|
|
3321
3364
|
]
|
|
3322
3365
|
},
|
|
3323
|
-
/* @__PURE__ */
|
|
3366
|
+
/* @__PURE__ */ React28.createElement(HStack, { spacing: 12, align: "center" }, /* @__PURE__ */ React28.createElement(
|
|
3324
3367
|
View25,
|
|
3325
3368
|
{
|
|
3326
3369
|
style: [
|
|
@@ -3332,10 +3375,10 @@ var QuizBlock = ({
|
|
|
3332
3375
|
allowMultiple ? styles22.checkboxSquare : styles22.checkboxCircle
|
|
3333
3376
|
]
|
|
3334
3377
|
},
|
|
3335
|
-
isSelected && /* @__PURE__ */
|
|
3336
|
-
), /* @__PURE__ */
|
|
3378
|
+
isSelected && /* @__PURE__ */ React28.createElement(Typography, { variant: "caption", style: { color: style2.backgroundColor, fontWeight: "700" } }, "\u2713")
|
|
3379
|
+
), /* @__PURE__ */ React28.createElement(Typography, { variant: "body", style: { color: style2.textColor, flex: 1 } }, option.label), showCorrectAnswer && isAnswered && option.correct && /* @__PURE__ */ React28.createElement(Badge, { variant: "success", size: "sm" }, "Correct"))
|
|
3337
3380
|
);
|
|
3338
|
-
})), showCorrectAnswer && isAnswered && /* @__PURE__ */
|
|
3381
|
+
})), showCorrectAnswer && isAnswered && /* @__PURE__ */ React28.createElement(View25, { style: styles22.resultContainer }, /* @__PURE__ */ React28.createElement(Badge, { variant: isCorrect ? "success" : "error", size: "md" }, isCorrect ? "Correct!" : "Incorrect")), (showExplanation || showCorrectAnswer && isAnswered) && (explanation || options.some((o) => o.explanation && selected.includes(o.value))) && /* @__PURE__ */ React28.createElement(View25, { style: [styles22.explanationContainer, { backgroundColor: theme.colors.muted }] }, /* @__PURE__ */ React28.createElement(Typography, { variant: "caption", style: { color: theme.colors["muted-foreground"] } }, explanation || options.find((o) => o.explanation && selected.includes(o.value))?.explanation))));
|
|
3339
3382
|
};
|
|
3340
3383
|
var styles22 = StyleSheet22.create({
|
|
3341
3384
|
container: {
|
|
@@ -3372,7 +3415,7 @@ var styles22 = StyleSheet22.create({
|
|
|
3372
3415
|
QuizBlock.displayName = "QuizBlock";
|
|
3373
3416
|
|
|
3374
3417
|
// src/components/molecules/game/ActionButtons.tsx
|
|
3375
|
-
import
|
|
3418
|
+
import React29, { useState as useState6, useCallback as useCallback3 } from "react";
|
|
3376
3419
|
import { View as View26, StyleSheet as StyleSheet23 } from "react-native";
|
|
3377
3420
|
var sizeMap = {
|
|
3378
3421
|
sm: "sm",
|
|
@@ -3413,7 +3456,7 @@ var ActionButtons = ({
|
|
|
3413
3456
|
const buttonSize = sizeMap[size] ?? "md";
|
|
3414
3457
|
if (layout === "diamond" && buttons.length === 4) {
|
|
3415
3458
|
const [top, right, bottom, left] = buttons;
|
|
3416
|
-
return /* @__PURE__ */
|
|
3459
|
+
return /* @__PURE__ */ React29.createElement(View26, { style: [styles23.diamondContainer, style] }, /* @__PURE__ */ React29.createElement(View26, { style: styles23.diamondRow }, /* @__PURE__ */ React29.createElement(View26, { style: styles23.diamondEmpty }), /* @__PURE__ */ React29.createElement(
|
|
3417
3460
|
ControlButton,
|
|
3418
3461
|
{
|
|
3419
3462
|
icon: top.icon,
|
|
@@ -3425,7 +3468,7 @@ var ActionButtons = ({
|
|
|
3425
3468
|
onRelease: () => handleRelease(top.id),
|
|
3426
3469
|
disabled
|
|
3427
3470
|
}
|
|
3428
|
-
), /* @__PURE__ */
|
|
3471
|
+
), /* @__PURE__ */ React29.createElement(View26, { style: styles23.diamondEmpty })), /* @__PURE__ */ React29.createElement(View26, { style: styles23.diamondRow }, /* @__PURE__ */ React29.createElement(
|
|
3429
3472
|
ControlButton,
|
|
3430
3473
|
{
|
|
3431
3474
|
icon: left.icon,
|
|
@@ -3437,7 +3480,7 @@ var ActionButtons = ({
|
|
|
3437
3480
|
onRelease: () => handleRelease(left.id),
|
|
3438
3481
|
disabled
|
|
3439
3482
|
}
|
|
3440
|
-
), /* @__PURE__ */
|
|
3483
|
+
), /* @__PURE__ */ React29.createElement(View26, { style: styles23.diamondCenter }), /* @__PURE__ */ React29.createElement(
|
|
3441
3484
|
ControlButton,
|
|
3442
3485
|
{
|
|
3443
3486
|
icon: right.icon,
|
|
@@ -3449,7 +3492,7 @@ var ActionButtons = ({
|
|
|
3449
3492
|
onRelease: () => handleRelease(right.id),
|
|
3450
3493
|
disabled
|
|
3451
3494
|
}
|
|
3452
|
-
)), /* @__PURE__ */
|
|
3495
|
+
)), /* @__PURE__ */ React29.createElement(View26, { style: styles23.diamondRow }, /* @__PURE__ */ React29.createElement(View26, { style: styles23.diamondEmpty }), /* @__PURE__ */ React29.createElement(
|
|
3453
3496
|
ControlButton,
|
|
3454
3497
|
{
|
|
3455
3498
|
icon: bottom.icon,
|
|
@@ -3461,10 +3504,10 @@ var ActionButtons = ({
|
|
|
3461
3504
|
onRelease: () => handleRelease(bottom.id),
|
|
3462
3505
|
disabled
|
|
3463
3506
|
}
|
|
3464
|
-
), /* @__PURE__ */
|
|
3507
|
+
), /* @__PURE__ */ React29.createElement(View26, { style: styles23.diamondEmpty })));
|
|
3465
3508
|
}
|
|
3466
3509
|
const containerStyle = layout === "vertical" ? styles23.verticalContainer : styles23.horizontalContainer;
|
|
3467
|
-
return /* @__PURE__ */
|
|
3510
|
+
return /* @__PURE__ */ React29.createElement(View26, { style: [containerStyle, style] }, buttons.map((button) => /* @__PURE__ */ React29.createElement(
|
|
3468
3511
|
ControlButton,
|
|
3469
3512
|
{
|
|
3470
3513
|
key: button.id,
|
|
@@ -3513,7 +3556,7 @@ var styles23 = StyleSheet23.create({
|
|
|
3513
3556
|
ActionButtons.displayName = "ActionButtons";
|
|
3514
3557
|
|
|
3515
3558
|
// src/components/molecules/game/DPad.tsx
|
|
3516
|
-
import
|
|
3559
|
+
import React30, { useState as useState7, useCallback as useCallback4 } from "react";
|
|
3517
3560
|
import { View as View27, StyleSheet as StyleSheet24 } from "react-native";
|
|
3518
3561
|
var sizeMap2 = {
|
|
3519
3562
|
sm: { button: "sm", containerWidth: 112 },
|
|
@@ -3558,7 +3601,7 @@ var DPad = ({
|
|
|
3558
3601
|
},
|
|
3559
3602
|
[directionEvent, eventBus, onDirection]
|
|
3560
3603
|
);
|
|
3561
|
-
const createButton = (direction) => /* @__PURE__ */
|
|
3604
|
+
const createButton = (direction) => /* @__PURE__ */ React30.createElement(
|
|
3562
3605
|
ControlButton,
|
|
3563
3606
|
{
|
|
3564
3607
|
key: direction,
|
|
@@ -3571,7 +3614,7 @@ var DPad = ({
|
|
|
3571
3614
|
disabled
|
|
3572
3615
|
}
|
|
3573
3616
|
);
|
|
3574
|
-
return /* @__PURE__ */
|
|
3617
|
+
return /* @__PURE__ */ React30.createElement(View27, { style: [styles24.container, { width: sizes.containerWidth }, style] }, /* @__PURE__ */ React30.createElement(View27, { style: styles24.row }, /* @__PURE__ */ React30.createElement(View27, { style: styles24.empty }), createButton("up"), /* @__PURE__ */ React30.createElement(View27, { style: styles24.empty })), /* @__PURE__ */ React30.createElement(View27, { style: styles24.row }, createButton("left"), /* @__PURE__ */ React30.createElement(View27, { style: styles24.center }, /* @__PURE__ */ React30.createElement(View27, { style: styles24.centerDot })), createButton("right")), /* @__PURE__ */ React30.createElement(View27, { style: styles24.row }, /* @__PURE__ */ React30.createElement(View27, { style: styles24.empty }), createButton("down"), /* @__PURE__ */ React30.createElement(View27, { style: styles24.empty })));
|
|
3575
3618
|
};
|
|
3576
3619
|
var styles24 = StyleSheet24.create({
|
|
3577
3620
|
container: {
|
|
@@ -3605,7 +3648,7 @@ var styles24 = StyleSheet24.create({
|
|
|
3605
3648
|
DPad.displayName = "DPad";
|
|
3606
3649
|
|
|
3607
3650
|
// src/components/molecules/RepeatableFormSection.tsx
|
|
3608
|
-
import
|
|
3651
|
+
import React31, { useState as useState8, useCallback as useCallback5 } from "react";
|
|
3609
3652
|
import { View as View28, StyleSheet as StyleSheet25 } from "react-native";
|
|
3610
3653
|
var RepeatableFormSection = ({
|
|
3611
3654
|
style,
|
|
@@ -3686,12 +3729,12 @@ var RepeatableFormSection = ({
|
|
|
3686
3729
|
const canAdd = items.length < maxItems;
|
|
3687
3730
|
const canRemove = items.length > minItems;
|
|
3688
3731
|
if (isLoading) {
|
|
3689
|
-
return /* @__PURE__ */
|
|
3732
|
+
return /* @__PURE__ */ React31.createElement(View28, { style: { ...styles25.container, ...style || {} } }, /* @__PURE__ */ React31.createElement(LoadingState, { message: "Loading section..." }));
|
|
3690
3733
|
}
|
|
3691
3734
|
if (error) {
|
|
3692
|
-
return /* @__PURE__ */
|
|
3735
|
+
return /* @__PURE__ */ React31.createElement(View28, { style: { ...styles25.container, ...style || {} } }, /* @__PURE__ */ React31.createElement(ErrorState, { message: error.message }));
|
|
3693
3736
|
}
|
|
3694
|
-
return /* @__PURE__ */
|
|
3737
|
+
return /* @__PURE__ */ React31.createElement(Card, { style: { ...styles25.container, ...style || {} }, padding: "lg" }, /* @__PURE__ */ React31.createElement(VStack, { spacing: 24 }, (title || description) && /* @__PURE__ */ React31.createElement(VStack, { spacing: 4 }, title && /* @__PURE__ */ React31.createElement(Typography, { variant: "h4", style: { color: theme.colors.foreground } }, title), description && /* @__PURE__ */ React31.createElement(Typography, { variant: "body", color: theme.colors["muted-foreground"] }, description)), items.length === 0 ? /* @__PURE__ */ React31.createElement(EmptyState, { message: "No items yet. Click add to create one." }) : /* @__PURE__ */ React31.createElement(VStack, { spacing: 16 }, items.map((item, index) => /* @__PURE__ */ React31.createElement(
|
|
3695
3738
|
View28,
|
|
3696
3739
|
{
|
|
3697
3740
|
key: item.id,
|
|
@@ -3700,7 +3743,7 @@ var RepeatableFormSection = ({
|
|
|
3700
3743
|
borderColor: theme.colors.border
|
|
3701
3744
|
}
|
|
3702
3745
|
},
|
|
3703
|
-
/* @__PURE__ */
|
|
3746
|
+
/* @__PURE__ */ React31.createElement(VStack, { spacing: 12 }, /* @__PURE__ */ React31.createElement(HStack, { justify: "space-between", align: "center" }, /* @__PURE__ */ React31.createElement(Typography, { variant: "label", color: theme.colors["muted-foreground"] }, "Item ", index + 1), canRemove && /* @__PURE__ */ React31.createElement(
|
|
3704
3747
|
Button,
|
|
3705
3748
|
{
|
|
3706
3749
|
variant: "ghost",
|
|
@@ -3720,7 +3763,7 @@ var RepeatableFormSection = ({
|
|
|
3720
3763
|
remove: () => handleRemoveItem(index),
|
|
3721
3764
|
update: (data) => handleUpdateItem(index, data)
|
|
3722
3765
|
}))
|
|
3723
|
-
))), canAdd && /* @__PURE__ */
|
|
3766
|
+
))), canAdd && /* @__PURE__ */ React31.createElement(
|
|
3724
3767
|
Button,
|
|
3725
3768
|
{
|
|
3726
3769
|
variant: "secondary",
|
|
@@ -3733,7 +3776,7 @@ var RepeatableFormSection = ({
|
|
|
3733
3776
|
},
|
|
3734
3777
|
"+ ",
|
|
3735
3778
|
addButtonLabel
|
|
3736
|
-
), /* @__PURE__ */
|
|
3779
|
+
), /* @__PURE__ */ React31.createElement(
|
|
3737
3780
|
Typography,
|
|
3738
3781
|
{
|
|
3739
3782
|
variant: "caption",
|
|
@@ -3758,223 +3801,1692 @@ var styles25 = StyleSheet25.create({
|
|
|
3758
3801
|
});
|
|
3759
3802
|
RepeatableFormSection.displayName = "RepeatableFormSection";
|
|
3760
3803
|
|
|
3761
|
-
// src/components/molecules/
|
|
3762
|
-
import
|
|
3763
|
-
import {
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3804
|
+
// src/components/molecules/NumberStepper.tsx
|
|
3805
|
+
import React32, { useState as useState9 } from "react";
|
|
3806
|
+
import { Pressable, StyleSheet as StyleSheet26 } from "react-native";
|
|
3807
|
+
var NumberStepper = ({
|
|
3808
|
+
value: controlledValue,
|
|
3809
|
+
min = 0,
|
|
3810
|
+
max = 99,
|
|
3811
|
+
step = 1,
|
|
3812
|
+
action,
|
|
3813
|
+
actionPayload,
|
|
3814
|
+
onChange,
|
|
3815
|
+
disabled = false,
|
|
3816
|
+
label,
|
|
3773
3817
|
style,
|
|
3774
3818
|
isLoading,
|
|
3775
|
-
error
|
|
3776
|
-
entity,
|
|
3777
|
-
children,
|
|
3778
|
-
contentWidth = 800,
|
|
3779
|
-
contentHeight = 600,
|
|
3780
|
-
width = SCREEN_WIDTH2 - 32,
|
|
3781
|
-
height = 400,
|
|
3782
|
-
initialScale = 1,
|
|
3783
|
-
minScale = 0.5,
|
|
3784
|
-
maxScale = 3,
|
|
3785
|
-
enablePan = true,
|
|
3786
|
-
enableZoom = true,
|
|
3787
|
-
showControls = true,
|
|
3788
|
-
title,
|
|
3789
|
-
enableDoubleTap = true,
|
|
3790
|
-
eventPrefix = "DIAGRAM"
|
|
3819
|
+
error
|
|
3791
3820
|
}) => {
|
|
3792
3821
|
const theme = useTheme();
|
|
3793
3822
|
const eventBus = useEventBus();
|
|
3794
|
-
const
|
|
3795
|
-
const
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
const
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
const scaledHeight = contentHeight * newScale;
|
|
3805
|
-
const maxX = Math.max(0, (scaledWidth - width) / 2);
|
|
3806
|
-
const maxY = Math.max(0, (scaledHeight - height) / 2);
|
|
3807
|
-
return { maxX, maxY };
|
|
3808
|
-
}, [contentWidth, contentHeight, width, height]);
|
|
3809
|
-
const handleZoomIn = useCallback6(() => {
|
|
3810
|
-
if (!enableZoom) return;
|
|
3811
|
-
const newScale = clamp(currentScale * 1.25, minScale, maxScale);
|
|
3812
|
-
setCurrentScale(newScale);
|
|
3813
|
-
Animated4.spring(scale, {
|
|
3814
|
-
toValue: newScale,
|
|
3815
|
-
useNativeDriver: true,
|
|
3816
|
-
friction: 8
|
|
3817
|
-
}).start();
|
|
3818
|
-
eventBus.emit(`UI:${eventPrefix}_ZOOM_IN`, {
|
|
3819
|
-
entity,
|
|
3820
|
-
scale: newScale
|
|
3821
|
-
});
|
|
3822
|
-
}, [currentScale, minScale, maxScale, enableZoom, entity, eventPrefix, scale, eventBus, clamp]);
|
|
3823
|
-
const handleZoomOut = useCallback6(() => {
|
|
3824
|
-
if (!enableZoom) return;
|
|
3825
|
-
const newScale = clamp(currentScale / 1.25, minScale, maxScale);
|
|
3826
|
-
setCurrentScale(newScale);
|
|
3827
|
-
if (newScale <= initialScale) {
|
|
3828
|
-
lastTranslate.current = { x: 0, y: 0 };
|
|
3829
|
-
Animated4.parallel([
|
|
3830
|
-
Animated4.spring(translateX, {
|
|
3831
|
-
toValue: 0,
|
|
3832
|
-
useNativeDriver: true,
|
|
3833
|
-
friction: 8
|
|
3834
|
-
}),
|
|
3835
|
-
Animated4.spring(translateY, {
|
|
3836
|
-
toValue: 0,
|
|
3837
|
-
useNativeDriver: true,
|
|
3838
|
-
friction: 8
|
|
3839
|
-
})
|
|
3840
|
-
]).start();
|
|
3841
|
-
}
|
|
3842
|
-
Animated4.spring(scale, {
|
|
3843
|
-
toValue: newScale,
|
|
3844
|
-
useNativeDriver: true,
|
|
3845
|
-
friction: 8
|
|
3846
|
-
}).start();
|
|
3847
|
-
eventBus.emit(`UI:${eventPrefix}_ZOOM_OUT`, {
|
|
3848
|
-
entity,
|
|
3849
|
-
scale: newScale
|
|
3850
|
-
});
|
|
3851
|
-
}, [currentScale, minScale, maxScale, initialScale, enableZoom, entity, eventPrefix, scale, translateX, translateY, eventBus, clamp]);
|
|
3852
|
-
const handleReset = useCallback6(() => {
|
|
3853
|
-
setCurrentScale(initialScale);
|
|
3854
|
-
lastTranslate.current = { x: 0, y: 0 };
|
|
3855
|
-
Animated4.parallel([
|
|
3856
|
-
Animated4.spring(scale, {
|
|
3857
|
-
toValue: initialScale,
|
|
3858
|
-
useNativeDriver: true,
|
|
3859
|
-
friction: 8
|
|
3860
|
-
}),
|
|
3861
|
-
Animated4.spring(translateX, {
|
|
3862
|
-
toValue: 0,
|
|
3863
|
-
useNativeDriver: true,
|
|
3864
|
-
friction: 8
|
|
3865
|
-
}),
|
|
3866
|
-
Animated4.spring(translateY, {
|
|
3867
|
-
toValue: 0,
|
|
3868
|
-
useNativeDriver: true,
|
|
3869
|
-
friction: 8
|
|
3870
|
-
})
|
|
3871
|
-
]).start();
|
|
3872
|
-
eventBus.emit(`UI:${eventPrefix}_RESET`, {
|
|
3873
|
-
entity,
|
|
3874
|
-
scale: initialScale
|
|
3875
|
-
});
|
|
3876
|
-
}, [initialScale, entity, eventPrefix, scale, translateX, translateY, eventBus]);
|
|
3877
|
-
const handleDoubleTap = useCallback6(() => {
|
|
3878
|
-
if (!enableDoubleTap) return;
|
|
3879
|
-
if (currentScale > initialScale) {
|
|
3880
|
-
handleReset();
|
|
3881
|
-
} else {
|
|
3882
|
-
const newScale = clamp(currentScale * 2, minScale, maxScale);
|
|
3883
|
-
setCurrentScale(newScale);
|
|
3884
|
-
Animated4.spring(scale, {
|
|
3885
|
-
toValue: newScale,
|
|
3886
|
-
useNativeDriver: true,
|
|
3887
|
-
friction: 8
|
|
3888
|
-
}).start();
|
|
3823
|
+
const [internalValue, setInternalValue] = useState9(controlledValue ?? min);
|
|
3824
|
+
const currentValue = controlledValue ?? internalValue;
|
|
3825
|
+
if (isLoading) return /* @__PURE__ */ React32.createElement(LoadingState, { message: "Loading..." });
|
|
3826
|
+
if (error) return /* @__PURE__ */ React32.createElement(ErrorState, { message: error.message });
|
|
3827
|
+
const handleChange = (newValue) => {
|
|
3828
|
+
const clamped = Math.max(min, Math.min(max, newValue));
|
|
3829
|
+
setInternalValue(clamped);
|
|
3830
|
+
onChange?.(clamped);
|
|
3831
|
+
if (action) {
|
|
3832
|
+
eventBus.emit(`UI:${action}`, { ...actionPayload, value: clamped });
|
|
3889
3833
|
}
|
|
3890
|
-
}, [currentScale, initialScale, enableDoubleTap, minScale, maxScale, handleReset, scale, clamp]);
|
|
3891
|
-
const panResponder = useRef4(
|
|
3892
|
-
PanResponder.create({
|
|
3893
|
-
onStartShouldSetPanResponder: () => enablePan,
|
|
3894
|
-
onMoveShouldSetPanResponder: () => enablePan && currentScale > 1,
|
|
3895
|
-
onPanResponderGrant: () => {
|
|
3896
|
-
lastTranslate.current = {
|
|
3897
|
-
x: 0,
|
|
3898
|
-
y: 0
|
|
3899
|
-
};
|
|
3900
|
-
},
|
|
3901
|
-
onPanResponderMove: (_event, gestureState) => {
|
|
3902
|
-
if (!enablePan || currentScale <= 1) return;
|
|
3903
|
-
const { maxX, maxY } = getBounds(currentScale);
|
|
3904
|
-
const newX = clamp(
|
|
3905
|
-
gestureState.dx,
|
|
3906
|
-
-maxX - lastTranslate.current.x,
|
|
3907
|
-
maxX - lastTranslate.current.x
|
|
3908
|
-
);
|
|
3909
|
-
const newY = clamp(
|
|
3910
|
-
gestureState.dy,
|
|
3911
|
-
-maxY - lastTranslate.current.y,
|
|
3912
|
-
maxY - lastTranslate.current.y
|
|
3913
|
-
);
|
|
3914
|
-
translateX.setValue(newX);
|
|
3915
|
-
translateY.setValue(newY);
|
|
3916
|
-
},
|
|
3917
|
-
onPanResponderRelease: (_event, gestureState) => {
|
|
3918
|
-
if (!enablePan || currentScale <= 1) return;
|
|
3919
|
-
const { maxX, maxY } = getBounds(currentScale);
|
|
3920
|
-
lastTranslate.current.x = clamp(
|
|
3921
|
-
lastTranslate.current.x + gestureState.dx,
|
|
3922
|
-
-maxX,
|
|
3923
|
-
maxX
|
|
3924
|
-
);
|
|
3925
|
-
lastTranslate.current.y = clamp(
|
|
3926
|
-
lastTranslate.current.y + gestureState.dy,
|
|
3927
|
-
-maxY,
|
|
3928
|
-
maxY
|
|
3929
|
-
);
|
|
3930
|
-
translateX.setOffset(lastTranslate.current.x);
|
|
3931
|
-
translateX.setValue(0);
|
|
3932
|
-
translateY.setOffset(lastTranslate.current.y);
|
|
3933
|
-
translateY.setValue(0);
|
|
3934
|
-
eventBus.emit(`UI:${eventPrefix}_PAN`, {
|
|
3935
|
-
entity,
|
|
3936
|
-
x: lastTranslate.current.x,
|
|
3937
|
-
y: lastTranslate.current.y,
|
|
3938
|
-
scale: currentScale
|
|
3939
|
-
});
|
|
3940
|
-
}
|
|
3941
|
-
})
|
|
3942
|
-
).current;
|
|
3943
|
-
if (isLoading) {
|
|
3944
|
-
return /* @__PURE__ */ React31.createElement(Card, { style: { ...styles26.container, width, height, ...style || {} }, padding: "lg" }, /* @__PURE__ */ React31.createElement(LoadingState, { message: "Loading diagram..." }));
|
|
3945
|
-
}
|
|
3946
|
-
if (error) {
|
|
3947
|
-
return /* @__PURE__ */ React31.createElement(Card, { style: { ...styles26.container, width, height, ...style || {} }, padding: "lg" }, /* @__PURE__ */ React31.createElement(ErrorState, { message: error.message }));
|
|
3948
|
-
}
|
|
3949
|
-
if (!children) {
|
|
3950
|
-
return /* @__PURE__ */ React31.createElement(Card, { style: { ...styles26.container, width, height, ...style || {} }, padding: "lg" }, /* @__PURE__ */ React31.createElement(EmptyState, { message: "No diagram content" }));
|
|
3951
|
-
}
|
|
3952
|
-
const animatedStyle = {
|
|
3953
|
-
transform: [
|
|
3954
|
-
{ scale },
|
|
3955
|
-
{ translateX },
|
|
3956
|
-
{ translateY }
|
|
3957
|
-
]
|
|
3958
3834
|
};
|
|
3959
|
-
|
|
3960
|
-
|
|
3835
|
+
const canDecrement = currentValue > min;
|
|
3836
|
+
const canIncrement = currentValue < max;
|
|
3837
|
+
return /* @__PURE__ */ React32.createElement(HStack, { spacing: theme.spacing[3], align: "center", style }, label && /* @__PURE__ */ React32.createElement(Typography, { variant: "label", style: { color: theme.colors.foreground, flex: 1 } }, label), /* @__PURE__ */ React32.createElement(HStack, { spacing: 0, align: "center" }, /* @__PURE__ */ React32.createElement(
|
|
3838
|
+
Pressable,
|
|
3961
3839
|
{
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3840
|
+
onPress: () => handleChange(currentValue - step),
|
|
3841
|
+
disabled: disabled || !canDecrement,
|
|
3842
|
+
style: [
|
|
3843
|
+
styles26.button,
|
|
3844
|
+
{
|
|
3845
|
+
backgroundColor: theme.colors.secondary,
|
|
3846
|
+
borderTopLeftRadius: theme.borderRadius.md,
|
|
3847
|
+
borderBottomLeftRadius: theme.borderRadius.md,
|
|
3848
|
+
borderWidth: 1,
|
|
3849
|
+
borderColor: theme.colors.border
|
|
3850
|
+
},
|
|
3851
|
+
(disabled || !canDecrement) && styles26.buttonDisabled
|
|
3852
|
+
]
|
|
3966
3853
|
},
|
|
3967
|
-
"\u2212"
|
|
3968
|
-
), /* @__PURE__ */
|
|
3969
|
-
|
|
3854
|
+
/* @__PURE__ */ React32.createElement(Typography, { variant: "body", style: { color: theme.colors.foreground, fontWeight: "600" } }, "\u2212")
|
|
3855
|
+
), /* @__PURE__ */ React32.createElement(
|
|
3856
|
+
Pressable,
|
|
3970
3857
|
{
|
|
3971
|
-
|
|
3858
|
+
style: [
|
|
3859
|
+
styles26.valueContainer,
|
|
3860
|
+
{
|
|
3861
|
+
borderTopWidth: 1,
|
|
3862
|
+
borderBottomWidth: 1,
|
|
3863
|
+
borderColor: theme.colors.border,
|
|
3864
|
+
backgroundColor: theme.colors.card
|
|
3865
|
+
}
|
|
3866
|
+
]
|
|
3867
|
+
},
|
|
3868
|
+
/* @__PURE__ */ React32.createElement(Typography, { variant: "body", style: { color: theme.colors.foreground, fontWeight: "500" } }, currentValue)
|
|
3869
|
+
), /* @__PURE__ */ React32.createElement(
|
|
3870
|
+
Pressable,
|
|
3871
|
+
{
|
|
3872
|
+
onPress: () => handleChange(currentValue + step),
|
|
3873
|
+
disabled: disabled || !canIncrement,
|
|
3874
|
+
style: [
|
|
3875
|
+
styles26.button,
|
|
3876
|
+
{
|
|
3877
|
+
backgroundColor: theme.colors.secondary,
|
|
3878
|
+
borderTopRightRadius: theme.borderRadius.md,
|
|
3879
|
+
borderBottomRightRadius: theme.borderRadius.md,
|
|
3880
|
+
borderWidth: 1,
|
|
3881
|
+
borderColor: theme.colors.border
|
|
3882
|
+
},
|
|
3883
|
+
(disabled || !canIncrement) && styles26.buttonDisabled
|
|
3884
|
+
]
|
|
3885
|
+
},
|
|
3886
|
+
/* @__PURE__ */ React32.createElement(Typography, { variant: "body", style: { color: theme.colors.foreground, fontWeight: "600" } }, "+")
|
|
3887
|
+
)));
|
|
3888
|
+
};
|
|
3889
|
+
var styles26 = StyleSheet26.create({
|
|
3890
|
+
button: {
|
|
3891
|
+
width: 40,
|
|
3892
|
+
height: 40,
|
|
3893
|
+
alignItems: "center",
|
|
3894
|
+
justifyContent: "center"
|
|
3895
|
+
},
|
|
3896
|
+
buttonDisabled: {
|
|
3897
|
+
opacity: 0.4
|
|
3898
|
+
},
|
|
3899
|
+
valueContainer: {
|
|
3900
|
+
minWidth: 48,
|
|
3901
|
+
height: 40,
|
|
3902
|
+
alignItems: "center",
|
|
3903
|
+
justifyContent: "center",
|
|
3904
|
+
paddingHorizontal: 12
|
|
3905
|
+
}
|
|
3906
|
+
});
|
|
3907
|
+
NumberStepper.displayName = "NumberStepper";
|
|
3908
|
+
|
|
3909
|
+
// src/components/molecules/StarRating.tsx
|
|
3910
|
+
import React33, { useState as useState10 } from "react";
|
|
3911
|
+
import { Pressable as Pressable2, StyleSheet as StyleSheet27 } from "react-native";
|
|
3912
|
+
var StarRating = ({
|
|
3913
|
+
value: controlledValue,
|
|
3914
|
+
max = 5,
|
|
3915
|
+
readOnly = false,
|
|
3916
|
+
precision = "full",
|
|
3917
|
+
size = 28,
|
|
3918
|
+
action,
|
|
3919
|
+
actionPayload,
|
|
3920
|
+
onChange,
|
|
3921
|
+
style,
|
|
3922
|
+
isLoading,
|
|
3923
|
+
error
|
|
3924
|
+
}) => {
|
|
3925
|
+
const theme = useTheme();
|
|
3926
|
+
const eventBus = useEventBus();
|
|
3927
|
+
const [internalValue, setInternalValue] = useState10(controlledValue ?? 0);
|
|
3928
|
+
const currentValue = controlledValue ?? internalValue;
|
|
3929
|
+
if (isLoading) return /* @__PURE__ */ React33.createElement(LoadingState, { message: "Loading..." });
|
|
3930
|
+
if (error) return /* @__PURE__ */ React33.createElement(ErrorState, { message: error.message });
|
|
3931
|
+
const handlePress = (starIndex) => {
|
|
3932
|
+
if (readOnly) return;
|
|
3933
|
+
const newValue = starIndex + 1;
|
|
3934
|
+
setInternalValue(newValue);
|
|
3935
|
+
onChange?.(newValue);
|
|
3936
|
+
if (action) {
|
|
3937
|
+
eventBus.emit(`UI:${action}`, { ...actionPayload, value: newValue });
|
|
3938
|
+
}
|
|
3939
|
+
};
|
|
3940
|
+
const handleHalfPress = (starIndex) => {
|
|
3941
|
+
if (readOnly || precision !== "half") return;
|
|
3942
|
+
const newValue = starIndex + 0.5;
|
|
3943
|
+
setInternalValue(newValue);
|
|
3944
|
+
onChange?.(newValue);
|
|
3945
|
+
if (action) {
|
|
3946
|
+
eventBus.emit(`UI:${action}`, { ...actionPayload, value: newValue });
|
|
3947
|
+
}
|
|
3948
|
+
};
|
|
3949
|
+
const stars = [];
|
|
3950
|
+
for (let i = 0; i < max; i++) {
|
|
3951
|
+
const filled = currentValue >= i + 1;
|
|
3952
|
+
const halfFilled = !filled && currentValue >= i + 0.5;
|
|
3953
|
+
const starChar = filled ? "\u2605" : halfFilled ? "\u2BEA" : "\u2606";
|
|
3954
|
+
const starColor = filled || halfFilled ? theme.colors.warning : theme.colors.border;
|
|
3955
|
+
stars.push(
|
|
3956
|
+
/* @__PURE__ */ React33.createElement(
|
|
3957
|
+
Pressable2,
|
|
3958
|
+
{
|
|
3959
|
+
key: i,
|
|
3960
|
+
onPress: () => handlePress(i),
|
|
3961
|
+
onLongPress: () => handleHalfPress(i),
|
|
3962
|
+
disabled: readOnly,
|
|
3963
|
+
style: styles27.star
|
|
3964
|
+
},
|
|
3965
|
+
/* @__PURE__ */ React33.createElement(
|
|
3966
|
+
Typography,
|
|
3967
|
+
{
|
|
3968
|
+
variant: "body",
|
|
3969
|
+
style: {
|
|
3970
|
+
color: starColor,
|
|
3971
|
+
fontSize: size,
|
|
3972
|
+
lineHeight: size * 1.2
|
|
3973
|
+
}
|
|
3974
|
+
},
|
|
3975
|
+
starChar
|
|
3976
|
+
)
|
|
3977
|
+
)
|
|
3978
|
+
);
|
|
3979
|
+
}
|
|
3980
|
+
return /* @__PURE__ */ React33.createElement(HStack, { spacing: 4, align: "center", style }, stars);
|
|
3981
|
+
};
|
|
3982
|
+
var styles27 = StyleSheet27.create({
|
|
3983
|
+
star: {
|
|
3984
|
+
padding: 2
|
|
3985
|
+
}
|
|
3986
|
+
});
|
|
3987
|
+
StarRating.displayName = "StarRating";
|
|
3988
|
+
|
|
3989
|
+
// src/components/molecules/Accordion.tsx
|
|
3990
|
+
import React34, { useState as useState11, useCallback as useCallback6 } from "react";
|
|
3991
|
+
import { Pressable as Pressable3, LayoutAnimation, StyleSheet as StyleSheet28, View as View29 } from "react-native";
|
|
3992
|
+
var Accordion = ({
|
|
3993
|
+
items,
|
|
3994
|
+
multiple = false,
|
|
3995
|
+
defaultOpenItems = [],
|
|
3996
|
+
toggleEvent,
|
|
3997
|
+
style,
|
|
3998
|
+
isLoading,
|
|
3999
|
+
error
|
|
4000
|
+
}) => {
|
|
4001
|
+
const theme = useTheme();
|
|
4002
|
+
const eventBus = useEventBus();
|
|
4003
|
+
const [openItems, setOpenItems] = useState11(new Set(defaultOpenItems));
|
|
4004
|
+
if (isLoading) return /* @__PURE__ */ React34.createElement(LoadingState, { message: "Loading..." });
|
|
4005
|
+
if (error) return /* @__PURE__ */ React34.createElement(ErrorState, { message: error.message });
|
|
4006
|
+
const handleToggle = useCallback6((id) => {
|
|
4007
|
+
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
|
|
4008
|
+
setOpenItems((prev) => {
|
|
4009
|
+
const next = new Set(prev);
|
|
4010
|
+
if (next.has(id)) {
|
|
4011
|
+
next.delete(id);
|
|
4012
|
+
} else {
|
|
4013
|
+
if (!multiple) next.clear();
|
|
4014
|
+
next.add(id);
|
|
4015
|
+
}
|
|
4016
|
+
return next;
|
|
4017
|
+
});
|
|
4018
|
+
if (toggleEvent) {
|
|
4019
|
+
eventBus.emit(`UI:${toggleEvent}`, { itemId: id });
|
|
4020
|
+
}
|
|
4021
|
+
}, [multiple, toggleEvent, eventBus]);
|
|
4022
|
+
return /* @__PURE__ */ React34.createElement(VStack, { spacing: 0, style: [styles28.container, { borderColor: theme.colors.border, borderWidth: 1, borderRadius: theme.borderRadius.lg }, style] }, items.map((item, index) => {
|
|
4023
|
+
const isOpen = openItems.has(item.id);
|
|
4024
|
+
const isLast = index === items.length - 1;
|
|
4025
|
+
return /* @__PURE__ */ React34.createElement(View29, { key: item.id }, /* @__PURE__ */ React34.createElement(
|
|
4026
|
+
Pressable3,
|
|
4027
|
+
{
|
|
4028
|
+
onPress: () => !item.disabled && handleToggle(item.id),
|
|
4029
|
+
disabled: item.disabled,
|
|
4030
|
+
style: [
|
|
4031
|
+
styles28.header,
|
|
4032
|
+
{
|
|
4033
|
+
backgroundColor: theme.colors.card,
|
|
4034
|
+
padding: theme.spacing[4]
|
|
4035
|
+
},
|
|
4036
|
+
item.disabled && { opacity: 0.5 },
|
|
4037
|
+
index === 0 && { borderTopLeftRadius: theme.borderRadius.lg, borderTopRightRadius: theme.borderRadius.lg },
|
|
4038
|
+
isLast && !isOpen && { borderBottomLeftRadius: theme.borderRadius.lg, borderBottomRightRadius: theme.borderRadius.lg }
|
|
4039
|
+
]
|
|
4040
|
+
},
|
|
4041
|
+
/* @__PURE__ */ React34.createElement(HStack, { spacing: theme.spacing[2], align: "center", style: styles28.headerRow }, /* @__PURE__ */ React34.createElement(Typography, { variant: "body", style: { color: theme.colors.foreground, fontWeight: "500", flex: 1 } }, item.title), /* @__PURE__ */ React34.createElement(
|
|
4042
|
+
Icon,
|
|
4043
|
+
{
|
|
4044
|
+
name: isOpen ? "chevron-up" : "chevron-down",
|
|
4045
|
+
size: 18,
|
|
4046
|
+
color: theme.colors["muted-foreground"]
|
|
4047
|
+
}
|
|
4048
|
+
))
|
|
4049
|
+
), isOpen && /* @__PURE__ */ React34.createElement(
|
|
4050
|
+
View29,
|
|
4051
|
+
{
|
|
4052
|
+
style: [
|
|
4053
|
+
styles28.content,
|
|
4054
|
+
{
|
|
4055
|
+
backgroundColor: theme.colors.card,
|
|
4056
|
+
padding: theme.spacing[4],
|
|
4057
|
+
paddingTop: 0
|
|
4058
|
+
},
|
|
4059
|
+
isLast && { borderBottomLeftRadius: theme.borderRadius.lg, borderBottomRightRadius: theme.borderRadius.lg }
|
|
4060
|
+
]
|
|
4061
|
+
},
|
|
4062
|
+
item.content
|
|
4063
|
+
), !isLast && /* @__PURE__ */ React34.createElement(Divider, null));
|
|
4064
|
+
}));
|
|
4065
|
+
};
|
|
4066
|
+
var styles28 = StyleSheet28.create({
|
|
4067
|
+
container: {
|
|
4068
|
+
overflow: "hidden"
|
|
4069
|
+
},
|
|
4070
|
+
header: {},
|
|
4071
|
+
headerRow: {
|
|
4072
|
+
justifyContent: "space-between"
|
|
4073
|
+
},
|
|
4074
|
+
content: {}
|
|
4075
|
+
});
|
|
4076
|
+
Accordion.displayName = "Accordion";
|
|
4077
|
+
|
|
4078
|
+
// src/components/molecules/DataList.tsx
|
|
4079
|
+
import React35, { useState as useState12 } from "react";
|
|
4080
|
+
import { FlatList as FlatList4, View as View30, StyleSheet as StyleSheet29 } from "react-native";
|
|
4081
|
+
function fieldLabel(key) {
|
|
4082
|
+
return key.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[_-]/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
|
|
4083
|
+
}
|
|
4084
|
+
function statusVariant(value) {
|
|
4085
|
+
const v = value.toLowerCase();
|
|
4086
|
+
if (["active", "completed", "done", "approved", "published", "resolved", "open", "online"].includes(v)) return "success";
|
|
4087
|
+
if (["pending", "in_progress", "in-progress", "review", "draft", "processing", "warning"].includes(v)) return "warning";
|
|
4088
|
+
if (["inactive", "deleted", "rejected", "failed", "error", "blocked", "closed", "offline"].includes(v)) return "error";
|
|
4089
|
+
return "default";
|
|
4090
|
+
}
|
|
4091
|
+
function formatDate(value) {
|
|
4092
|
+
if (!value) return "";
|
|
4093
|
+
const d = new Date(String(value));
|
|
4094
|
+
if (isNaN(d.getTime())) return String(value);
|
|
4095
|
+
return d.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" });
|
|
4096
|
+
}
|
|
4097
|
+
function formatValue(value, format) {
|
|
4098
|
+
if (value === void 0 || value === null) return "";
|
|
4099
|
+
switch (format) {
|
|
4100
|
+
case "date":
|
|
4101
|
+
return formatDate(value);
|
|
4102
|
+
case "currency":
|
|
4103
|
+
return typeof value === "number" ? `$${value.toFixed(2)}` : String(value);
|
|
4104
|
+
case "number":
|
|
4105
|
+
return typeof value === "number" ? value.toLocaleString() : String(value);
|
|
4106
|
+
case "percent":
|
|
4107
|
+
return typeof value === "number" ? `${Math.round(value)}%` : String(value);
|
|
4108
|
+
case "boolean":
|
|
4109
|
+
return value ? "Yes" : "No";
|
|
4110
|
+
default:
|
|
4111
|
+
return String(value);
|
|
4112
|
+
}
|
|
4113
|
+
}
|
|
4114
|
+
function groupData(items, field) {
|
|
4115
|
+
const groups = /* @__PURE__ */ new Map();
|
|
4116
|
+
for (const item of items) {
|
|
4117
|
+
const key = String(getNestedValue(item, field) ?? "");
|
|
4118
|
+
const group = groups.get(key);
|
|
4119
|
+
if (group) group.push(item);
|
|
4120
|
+
else groups.set(key, [item]);
|
|
4121
|
+
}
|
|
4122
|
+
return Array.from(groups.entries()).map(([label, groupItems]) => ({ label, items: groupItems }));
|
|
4123
|
+
}
|
|
4124
|
+
var gapValues4 = {
|
|
4125
|
+
none: 0,
|
|
4126
|
+
sm: 4,
|
|
4127
|
+
md: 8,
|
|
4128
|
+
lg: 16
|
|
4129
|
+
};
|
|
4130
|
+
var DataList = ({
|
|
4131
|
+
entity,
|
|
4132
|
+
fields: fieldsProp,
|
|
4133
|
+
columns: columnsProp,
|
|
4134
|
+
itemActions,
|
|
4135
|
+
gap = "none",
|
|
4136
|
+
variant = "default",
|
|
4137
|
+
groupBy,
|
|
4138
|
+
senderField,
|
|
4139
|
+
currentUser,
|
|
4140
|
+
style,
|
|
4141
|
+
isLoading = false,
|
|
4142
|
+
error = null,
|
|
4143
|
+
infiniteScroll,
|
|
4144
|
+
loadMoreEvent,
|
|
4145
|
+
hasMore,
|
|
4146
|
+
children,
|
|
4147
|
+
pageSize = 5
|
|
4148
|
+
}) => {
|
|
4149
|
+
const theme = useTheme();
|
|
4150
|
+
const eventBus = useEventBus();
|
|
4151
|
+
const [visibleCount, setVisibleCount] = useState12(pageSize || Infinity);
|
|
4152
|
+
const fields = fieldsProp ?? columnsProp ?? [];
|
|
4153
|
+
const allData = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
4154
|
+
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
4155
|
+
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
4156
|
+
const titleField = fields.find((f) => f.variant === "h3" || f.variant === "h4") ?? fields[0];
|
|
4157
|
+
const badgeFields = fields.filter((f) => f.variant === "badge" && f !== titleField);
|
|
4158
|
+
const progressFields = fields.filter((f) => f.variant === "progress");
|
|
4159
|
+
const bodyFields = fields.filter(
|
|
4160
|
+
(f) => f !== titleField && !badgeFields.includes(f) && !progressFields.includes(f)
|
|
4161
|
+
);
|
|
4162
|
+
if (isLoading) return /* @__PURE__ */ React35.createElement(LoadingState, { message: "Loading..." });
|
|
4163
|
+
if (error) return /* @__PURE__ */ React35.createElement(ErrorState, { message: error.message });
|
|
4164
|
+
if (data.length === 0) return /* @__PURE__ */ React35.createElement(EmptyState, { message: "No items found" });
|
|
4165
|
+
const handleAction = (action, itemData) => {
|
|
4166
|
+
eventBus.emit(`UI:${action.event}`, { id: itemData.id, row: itemData });
|
|
4167
|
+
};
|
|
4168
|
+
const isCard = variant === "card";
|
|
4169
|
+
const isCompact = variant === "compact";
|
|
4170
|
+
const isMessage = variant === "message";
|
|
4171
|
+
if (isMessage) {
|
|
4172
|
+
const groups2 = groupBy ? groupData(data, groupBy) : [{ label: "", items: data }];
|
|
4173
|
+
const contentField = titleField?.name ?? fields[0]?.name ?? "";
|
|
4174
|
+
return /* @__PURE__ */ React35.createElement(VStack, { spacing: theme.spacing[2], style }, groups2.map((group, gi) => /* @__PURE__ */ React35.createElement(React35.Fragment, { key: gi }, group.label !== "" && /* @__PURE__ */ React35.createElement(VStack, { spacing: 4 }, /* @__PURE__ */ React35.createElement(Typography, { variant: "caption", style: { color: theme.colors["muted-foreground"], fontWeight: "600" } }, group.label), /* @__PURE__ */ React35.createElement(Divider, null)), group.items.map((itemData, index) => {
|
|
4175
|
+
const id = String(itemData.id ?? `${gi}-${index}`);
|
|
4176
|
+
const sender = senderField ? String(getNestedValue(itemData, senderField) ?? "") : "";
|
|
4177
|
+
const isSent = Boolean(currentUser && sender === currentUser);
|
|
4178
|
+
const content = getNestedValue(itemData, contentField);
|
|
4179
|
+
const timestampField = fields.find((f) => f.format === "date");
|
|
4180
|
+
const timestamp = timestampField ? getNestedValue(itemData, timestampField.name) : null;
|
|
4181
|
+
return /* @__PURE__ */ React35.createElement(
|
|
4182
|
+
View30,
|
|
4183
|
+
{
|
|
4184
|
+
key: id,
|
|
4185
|
+
style: [
|
|
4186
|
+
styles29.messageRow,
|
|
4187
|
+
{ justifyContent: isSent ? "flex-end" : "flex-start" }
|
|
4188
|
+
]
|
|
4189
|
+
},
|
|
4190
|
+
/* @__PURE__ */ React35.createElement(
|
|
4191
|
+
View30,
|
|
4192
|
+
{
|
|
4193
|
+
style: [
|
|
4194
|
+
styles29.messageBubble,
|
|
4195
|
+
{
|
|
4196
|
+
backgroundColor: isSent ? theme.colors.primary : theme.colors.muted,
|
|
4197
|
+
borderBottomRightRadius: isSent ? 4 : 16,
|
|
4198
|
+
borderBottomLeftRadius: isSent ? 16 : 4
|
|
4199
|
+
}
|
|
4200
|
+
]
|
|
4201
|
+
},
|
|
4202
|
+
!isSent && senderField && /* @__PURE__ */ React35.createElement(Typography, { variant: "caption", style: { color: isSent ? theme.colors["primary-foreground"] : theme.colors.foreground, fontWeight: "600" } }, sender),
|
|
4203
|
+
/* @__PURE__ */ React35.createElement(Typography, { variant: "body", style: { color: isSent ? theme.colors["primary-foreground"] : theme.colors.foreground } }, content !== void 0 && content !== null ? String(content) : ""),
|
|
4204
|
+
timestamp != null && /* @__PURE__ */ React35.createElement(Typography, { variant: "caption", style: { color: isSent ? theme.colors["primary-foreground"] : theme.colors["muted-foreground"], opacity: 0.7, marginTop: 2, fontSize: 10 } }, formatDate(timestamp))
|
|
4205
|
+
)
|
|
4206
|
+
);
|
|
4207
|
+
}))));
|
|
4208
|
+
}
|
|
4209
|
+
const hasRenderProp = typeof children === "function";
|
|
4210
|
+
const groups = groupBy ? groupData(data, groupBy) : [{ label: "", items: data }];
|
|
4211
|
+
const renderItem = (itemData, index) => {
|
|
4212
|
+
if (hasRenderProp) {
|
|
4213
|
+
return /* @__PURE__ */ React35.createElement(
|
|
4214
|
+
View30,
|
|
4215
|
+
{
|
|
4216
|
+
style: [
|
|
4217
|
+
styles29.row,
|
|
4218
|
+
{ padding: isCompact ? theme.spacing[2] : theme.spacing[4] }
|
|
4219
|
+
]
|
|
4220
|
+
},
|
|
4221
|
+
children(itemData, index),
|
|
4222
|
+
itemActions && itemActions.length > 0 && /* @__PURE__ */ React35.createElement(HStack, { spacing: theme.spacing[2], style: styles29.actions }, itemActions.map((action) => /* @__PURE__ */ React35.createElement(
|
|
4223
|
+
Button,
|
|
4224
|
+
{
|
|
4225
|
+
key: action.event,
|
|
4226
|
+
variant: action.variant === "danger" ? "destructive" : action.variant ?? "ghost",
|
|
4227
|
+
size: "sm",
|
|
4228
|
+
onPress: () => handleAction(action, itemData)
|
|
4229
|
+
},
|
|
4230
|
+
action.label
|
|
4231
|
+
)))
|
|
4232
|
+
);
|
|
4233
|
+
}
|
|
4234
|
+
const titleValue = getNestedValue(itemData, titleField?.name ?? "");
|
|
4235
|
+
return /* @__PURE__ */ React35.createElement(
|
|
4236
|
+
View30,
|
|
4237
|
+
{
|
|
4238
|
+
style: [
|
|
4239
|
+
styles29.row,
|
|
4240
|
+
{ padding: isCompact ? theme.spacing[2] : theme.spacing[4] },
|
|
4241
|
+
isCard && {
|
|
4242
|
+
backgroundColor: theme.colors.card,
|
|
4243
|
+
borderRadius: theme.borderRadius.lg,
|
|
4244
|
+
borderWidth: 1,
|
|
4245
|
+
borderColor: theme.colors.border,
|
|
4246
|
+
marginBottom: theme.spacing[2],
|
|
4247
|
+
...theme.shadows.sm
|
|
4248
|
+
}
|
|
4249
|
+
]
|
|
4250
|
+
},
|
|
4251
|
+
/* @__PURE__ */ React35.createElement(HStack, { spacing: theme.spacing[2], align: "center" }, titleValue !== void 0 && titleValue !== null && /* @__PURE__ */ React35.createElement(
|
|
4252
|
+
Typography,
|
|
4253
|
+
{
|
|
4254
|
+
variant: titleField?.variant === "h3" ? "h3" : "h4",
|
|
4255
|
+
style: { flex: 1, color: theme.colors.foreground, fontWeight: "600" }
|
|
4256
|
+
},
|
|
4257
|
+
String(titleValue)
|
|
4258
|
+
), badgeFields.map((field) => {
|
|
4259
|
+
const val = getNestedValue(itemData, field.name);
|
|
4260
|
+
if (val === void 0 || val === null) return null;
|
|
4261
|
+
return /* @__PURE__ */ React35.createElement(Badge, { key: field.name, variant: statusVariant(String(val)) }, String(val));
|
|
4262
|
+
})),
|
|
4263
|
+
bodyFields.length > 0 && !isCompact && /* @__PURE__ */ React35.createElement(HStack, { spacing: theme.spacing[3], style: { marginTop: theme.spacing[2], flexWrap: "wrap" } }, bodyFields.map((field) => {
|
|
4264
|
+
const value = getNestedValue(itemData, field.name);
|
|
4265
|
+
if (value === void 0 || value === null || value === "") return null;
|
|
4266
|
+
return /* @__PURE__ */ React35.createElement(HStack, { key: field.name, spacing: theme.spacing[1], align: "center" }, /* @__PURE__ */ React35.createElement(Typography, { variant: "caption", style: { color: theme.colors["muted-foreground"] } }, field.label ?? fieldLabel(field.name), ":"), /* @__PURE__ */ React35.createElement(Typography, { variant: "body", style: { color: theme.colors.foreground, fontSize: theme.typography.sizes.sm } }, formatValue(value, field.format)));
|
|
4267
|
+
})),
|
|
4268
|
+
progressFields.map((field) => {
|
|
4269
|
+
const value = getNestedValue(itemData, field.name);
|
|
4270
|
+
if (typeof value !== "number") return null;
|
|
4271
|
+
return /* @__PURE__ */ React35.createElement(View30, { key: field.name, style: { marginTop: theme.spacing[2], maxWidth: 200 } }, /* @__PURE__ */ React35.createElement(Typography, { variant: "caption", style: { color: theme.colors["muted-foreground"], marginBottom: 4 } }, field.label ?? fieldLabel(field.name)), /* @__PURE__ */ React35.createElement(ProgressBar, { progress: value }));
|
|
4272
|
+
}),
|
|
4273
|
+
itemActions && itemActions.length > 0 && /* @__PURE__ */ React35.createElement(HStack, { spacing: theme.spacing[2], style: [styles29.actions, { marginTop: theme.spacing[2] }] }, itemActions.map((action) => /* @__PURE__ */ React35.createElement(
|
|
4274
|
+
Button,
|
|
4275
|
+
{
|
|
4276
|
+
key: action.event,
|
|
4277
|
+
variant: action.variant === "danger" ? "destructive" : action.variant ?? "ghost",
|
|
4278
|
+
size: "sm",
|
|
4279
|
+
onPress: () => handleAction(action, itemData)
|
|
4280
|
+
},
|
|
4281
|
+
action.label
|
|
4282
|
+
)))
|
|
4283
|
+
);
|
|
4284
|
+
};
|
|
4285
|
+
const flatItems = [];
|
|
4286
|
+
let globalIndex = 0;
|
|
4287
|
+
for (const group of groups) {
|
|
4288
|
+
if (group.label) flatItems.push({ type: "header", label: group.label });
|
|
4289
|
+
for (const item of group.items) {
|
|
4290
|
+
flatItems.push({ type: "item", data: item, index: globalIndex++ });
|
|
4291
|
+
}
|
|
4292
|
+
}
|
|
4293
|
+
return /* @__PURE__ */ React35.createElement(VStack, { spacing: 0, style }, /* @__PURE__ */ React35.createElement(
|
|
4294
|
+
FlatList4,
|
|
4295
|
+
{
|
|
4296
|
+
data: flatItems,
|
|
4297
|
+
keyExtractor: (entry, i) => {
|
|
4298
|
+
if (entry.type === "header") return `header-${i}`;
|
|
4299
|
+
return String(entry.data.id ?? entry.index);
|
|
4300
|
+
},
|
|
4301
|
+
renderItem: ({ item: entry, index: flatIndex }) => {
|
|
4302
|
+
if (entry.type === "header") {
|
|
4303
|
+
return /* @__PURE__ */ React35.createElement(VStack, { spacing: 4 }, /* @__PURE__ */ React35.createElement(Typography, { variant: "caption", style: { color: theme.colors["muted-foreground"], fontWeight: "600" } }, entry.label), /* @__PURE__ */ React35.createElement(Divider, null));
|
|
4304
|
+
}
|
|
4305
|
+
return /* @__PURE__ */ React35.createElement(View30, null, renderItem(entry.data, entry.index), !isCard && flatIndex < flatItems.length - 1 && /* @__PURE__ */ React35.createElement(Divider, null));
|
|
4306
|
+
},
|
|
4307
|
+
ItemSeparatorComponent: null,
|
|
4308
|
+
style: { gap: gapValues4[gap] }
|
|
4309
|
+
}
|
|
4310
|
+
), hasMoreLocal && /* @__PURE__ */ React35.createElement(
|
|
4311
|
+
Button,
|
|
4312
|
+
{
|
|
4313
|
+
variant: "ghost",
|
|
4314
|
+
size: "sm",
|
|
4315
|
+
onPress: () => setVisibleCount((prev) => prev + (pageSize || 5)),
|
|
4316
|
+
style: { alignSelf: "center", marginTop: theme.spacing[3] }
|
|
4317
|
+
},
|
|
4318
|
+
"Show More (",
|
|
4319
|
+
allData.length - visibleCount,
|
|
4320
|
+
" remaining)"
|
|
4321
|
+
), infiniteScroll && loadMoreEvent && /* @__PURE__ */ React35.createElement(
|
|
4322
|
+
InfiniteScrollSentinel,
|
|
4323
|
+
{
|
|
4324
|
+
loadMoreEvent,
|
|
4325
|
+
isLoading,
|
|
4326
|
+
hasMore
|
|
4327
|
+
}
|
|
4328
|
+
));
|
|
4329
|
+
};
|
|
4330
|
+
var styles29 = StyleSheet29.create({
|
|
4331
|
+
row: {},
|
|
4332
|
+
messageRow: {
|
|
4333
|
+
flexDirection: "row",
|
|
4334
|
+
paddingHorizontal: 16
|
|
4335
|
+
},
|
|
4336
|
+
messageBubble: {
|
|
4337
|
+
maxWidth: "75%",
|
|
4338
|
+
paddingHorizontal: 16,
|
|
4339
|
+
paddingVertical: 8,
|
|
4340
|
+
borderRadius: 16
|
|
4341
|
+
},
|
|
4342
|
+
actions: {
|
|
4343
|
+
justifyContent: "flex-end"
|
|
4344
|
+
}
|
|
4345
|
+
});
|
|
4346
|
+
DataList.displayName = "DataList";
|
|
4347
|
+
|
|
4348
|
+
// src/components/molecules/DataGrid.tsx
|
|
4349
|
+
import React36, { useState as useState13, useCallback as useCallback7 } from "react";
|
|
4350
|
+
import { FlatList as FlatList5, View as View31, Image, Pressable as Pressable4, StyleSheet as StyleSheet30, Dimensions as Dimensions3 } from "react-native";
|
|
4351
|
+
function fieldLabel2(key) {
|
|
4352
|
+
return key.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[_-]/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
|
|
4353
|
+
}
|
|
4354
|
+
function statusVariant2(value) {
|
|
4355
|
+
const v = value.toLowerCase();
|
|
4356
|
+
if (["active", "completed", "done", "approved", "published", "resolved", "open", "online"].includes(v)) return "success";
|
|
4357
|
+
if (["pending", "in_progress", "in-progress", "review", "draft", "processing", "warning"].includes(v)) return "warning";
|
|
4358
|
+
if (["inactive", "deleted", "rejected", "failed", "error", "blocked", "closed", "offline"].includes(v)) return "error";
|
|
4359
|
+
return "default";
|
|
4360
|
+
}
|
|
4361
|
+
function formatValue2(value, format) {
|
|
4362
|
+
if (value === void 0 || value === null) return "";
|
|
4363
|
+
switch (format) {
|
|
4364
|
+
case "date": {
|
|
4365
|
+
if (!value) return "";
|
|
4366
|
+
const d = new Date(String(value));
|
|
4367
|
+
if (isNaN(d.getTime())) return String(value);
|
|
4368
|
+
return d.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" });
|
|
4369
|
+
}
|
|
4370
|
+
case "currency":
|
|
4371
|
+
return typeof value === "number" ? `$${value.toFixed(2)}` : String(value);
|
|
4372
|
+
case "number":
|
|
4373
|
+
return typeof value === "number" ? value.toLocaleString() : String(value);
|
|
4374
|
+
case "percent":
|
|
4375
|
+
return typeof value === "number" ? `${Math.round(value)}%` : String(value);
|
|
4376
|
+
case "boolean":
|
|
4377
|
+
return value ? "Yes" : "No";
|
|
4378
|
+
default:
|
|
4379
|
+
return String(value);
|
|
4380
|
+
}
|
|
4381
|
+
}
|
|
4382
|
+
var gapValues5 = {
|
|
4383
|
+
none: 0,
|
|
4384
|
+
sm: 8,
|
|
4385
|
+
md: 12,
|
|
4386
|
+
lg: 16
|
|
4387
|
+
};
|
|
4388
|
+
var DataGrid = ({
|
|
4389
|
+
entity,
|
|
4390
|
+
fields: fieldsProp,
|
|
4391
|
+
columns: columnsProp,
|
|
4392
|
+
itemActions,
|
|
4393
|
+
cols = 2,
|
|
4394
|
+
gap = "md",
|
|
4395
|
+
style,
|
|
4396
|
+
isLoading = false,
|
|
4397
|
+
error = null,
|
|
4398
|
+
imageField,
|
|
4399
|
+
selectable = false,
|
|
4400
|
+
selectionEvent,
|
|
4401
|
+
infiniteScroll,
|
|
4402
|
+
loadMoreEvent,
|
|
4403
|
+
hasMore,
|
|
4404
|
+
children,
|
|
4405
|
+
pageSize = 0
|
|
4406
|
+
}) => {
|
|
4407
|
+
const theme = useTheme();
|
|
4408
|
+
const eventBus = useEventBus();
|
|
4409
|
+
const [selectedIds, setSelectedIds] = useState13(/* @__PURE__ */ new Set());
|
|
4410
|
+
const [visibleCount, setVisibleCount] = useState13(pageSize || Infinity);
|
|
4411
|
+
const fields = fieldsProp ?? columnsProp ?? [];
|
|
4412
|
+
const allData = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
4413
|
+
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
4414
|
+
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
4415
|
+
const titleField = fields.find((f) => f.variant === "h3" || f.variant === "h4") ?? fields[0];
|
|
4416
|
+
const badgeFields = fields.filter((f) => f.variant === "badge" && f !== titleField);
|
|
4417
|
+
const bodyFields = fields.filter((f) => f !== titleField && !badgeFields.includes(f));
|
|
4418
|
+
const primaryActions = itemActions?.filter((a) => a.variant !== "danger") ?? [];
|
|
4419
|
+
const dangerActions = itemActions?.filter((a) => a.variant === "danger") ?? [];
|
|
4420
|
+
const toggleSelection = useCallback7((id) => {
|
|
4421
|
+
setSelectedIds((prev) => {
|
|
4422
|
+
const next = new Set(prev);
|
|
4423
|
+
if (next.has(id)) next.delete(id);
|
|
4424
|
+
else next.add(id);
|
|
4425
|
+
if (selectionEvent) {
|
|
4426
|
+
eventBus.emit(`UI:${selectionEvent}`, { selectedIds: Array.from(next) });
|
|
4427
|
+
}
|
|
4428
|
+
return next;
|
|
4429
|
+
});
|
|
4430
|
+
}, [selectionEvent, eventBus]);
|
|
4431
|
+
if (isLoading) return /* @__PURE__ */ React36.createElement(LoadingState, { message: "Loading..." });
|
|
4432
|
+
if (error) return /* @__PURE__ */ React36.createElement(ErrorState, { message: error.message });
|
|
4433
|
+
if (data.length === 0) return /* @__PURE__ */ React36.createElement(EmptyState, { message: "No items found" });
|
|
4434
|
+
const hasRenderProp = typeof children === "function";
|
|
4435
|
+
const screenWidth = Dimensions3.get("window").width;
|
|
4436
|
+
const gapSize = gapValues5[gap];
|
|
4437
|
+
const cardWidth = (screenWidth - gapSize * (cols + 1)) / cols;
|
|
4438
|
+
const handleAction = (action, itemData) => {
|
|
4439
|
+
eventBus.emit(`UI:${action.event}`, { id: itemData.id, row: itemData });
|
|
4440
|
+
};
|
|
4441
|
+
const renderCard = ({ item: itemData, index }) => {
|
|
4442
|
+
const id = String(itemData.id ?? index);
|
|
4443
|
+
const isSelected = selectedIds.has(id);
|
|
4444
|
+
const selectedStyle = isSelected ? { borderColor: theme.colors.primary, borderWidth: 2 } : {};
|
|
4445
|
+
const baseCardStyle = [
|
|
4446
|
+
styles30.card,
|
|
4447
|
+
{ width: cardWidth, margin: gapSize / 2 },
|
|
4448
|
+
selectedStyle
|
|
4449
|
+
];
|
|
4450
|
+
if (hasRenderProp) {
|
|
4451
|
+
return /* @__PURE__ */ React36.createElement(Card, { style: baseCardStyle }, children(itemData, index));
|
|
4452
|
+
}
|
|
4453
|
+
const titleValue = getNestedValue(itemData, titleField?.name ?? "");
|
|
4454
|
+
return /* @__PURE__ */ React36.createElement(Card, { style: baseCardStyle }, imageField && (() => {
|
|
4455
|
+
const imgUrl = getNestedValue(itemData, imageField);
|
|
4456
|
+
if (!imgUrl || typeof imgUrl !== "string") return null;
|
|
4457
|
+
return /* @__PURE__ */ React36.createElement(
|
|
4458
|
+
Image,
|
|
4459
|
+
{
|
|
4460
|
+
source: { uri: imgUrl },
|
|
4461
|
+
style: [styles30.cardImage, { width: cardWidth - 2 }],
|
|
4462
|
+
resizeMode: "cover"
|
|
4463
|
+
}
|
|
4464
|
+
);
|
|
4465
|
+
})(), /* @__PURE__ */ React36.createElement(View31, { style: [styles30.cardHeader, { padding: theme.spacing[3] }] }, /* @__PURE__ */ React36.createElement(HStack, { spacing: theme.spacing[2], align: "flex-start" }, selectable && /* @__PURE__ */ React36.createElement(Pressable4, { onPress: () => toggleSelection(id), style: styles30.checkbox }, /* @__PURE__ */ React36.createElement(
|
|
4466
|
+
View31,
|
|
4467
|
+
{
|
|
4468
|
+
style: [
|
|
4469
|
+
styles30.checkboxBox,
|
|
4470
|
+
{
|
|
4471
|
+
borderColor: isSelected ? theme.colors.primary : theme.colors.border,
|
|
4472
|
+
backgroundColor: isSelected ? theme.colors.primary : "transparent"
|
|
4473
|
+
}
|
|
4474
|
+
]
|
|
4475
|
+
},
|
|
4476
|
+
isSelected && /* @__PURE__ */ React36.createElement(Typography, { variant: "caption", style: { color: theme.colors["primary-foreground"], fontSize: 10 } }, "\u2713")
|
|
4477
|
+
)), /* @__PURE__ */ React36.createElement(VStack, { spacing: theme.spacing[1], style: { flex: 1 } }, titleValue !== void 0 && titleValue !== null && /* @__PURE__ */ React36.createElement(
|
|
4478
|
+
Typography,
|
|
4479
|
+
{
|
|
4480
|
+
variant: titleField?.variant === "h3" ? "h3" : "h4",
|
|
4481
|
+
style: { color: theme.colors.foreground, fontWeight: "600" }
|
|
4482
|
+
},
|
|
4483
|
+
String(titleValue)
|
|
4484
|
+
), badgeFields.length > 0 && /* @__PURE__ */ React36.createElement(HStack, { spacing: theme.spacing[1], style: { flexWrap: "wrap" } }, badgeFields.map((field) => {
|
|
4485
|
+
const val = getNestedValue(itemData, field.name);
|
|
4486
|
+
if (val === void 0 || val === null) return null;
|
|
4487
|
+
return /* @__PURE__ */ React36.createElement(Badge, { key: field.name, variant: statusVariant2(String(val)), size: "sm" }, String(val));
|
|
4488
|
+
}))), dangerActions.length > 0 && /* @__PURE__ */ React36.createElement(HStack, { spacing: 4 }, dangerActions.map((action) => /* @__PURE__ */ React36.createElement(
|
|
4489
|
+
Button,
|
|
4490
|
+
{
|
|
4491
|
+
key: action.event,
|
|
4492
|
+
variant: "ghost",
|
|
4493
|
+
size: "sm",
|
|
4494
|
+
onPress: () => handleAction(action, itemData),
|
|
4495
|
+
textStyle: { color: theme.colors.error }
|
|
4496
|
+
},
|
|
4497
|
+
action.label
|
|
4498
|
+
))))), bodyFields.length > 0 && /* @__PURE__ */ React36.createElement(View31, { style: [styles30.cardBody, { paddingHorizontal: theme.spacing[3], paddingBottom: theme.spacing[2] }] }, /* @__PURE__ */ React36.createElement(VStack, { spacing: theme.spacing[1] }, bodyFields.map((field) => {
|
|
4499
|
+
const value = getNestedValue(itemData, field.name);
|
|
4500
|
+
if (value === void 0 || value === null || value === "") return null;
|
|
4501
|
+
if (field.format === "boolean") {
|
|
4502
|
+
return /* @__PURE__ */ React36.createElement(HStack, { key: field.name, spacing: theme.spacing[2], align: "center", style: { justifyContent: "space-between" } }, /* @__PURE__ */ React36.createElement(Typography, { variant: "caption", style: { color: theme.colors["muted-foreground"] } }, field.label ?? fieldLabel2(field.name)), /* @__PURE__ */ React36.createElement(Badge, { variant: value ? "success" : "default", size: "sm" }, value ? "Yes" : "No"));
|
|
4503
|
+
}
|
|
4504
|
+
if (field.variant === "progress" && typeof value === "number") {
|
|
4505
|
+
return /* @__PURE__ */ React36.createElement(View31, { key: field.name }, /* @__PURE__ */ React36.createElement(Typography, { variant: "caption", style: { color: theme.colors["muted-foreground"], marginBottom: 4 } }, field.label ?? fieldLabel2(field.name)), /* @__PURE__ */ React36.createElement(ProgressBar, { progress: value }));
|
|
4506
|
+
}
|
|
4507
|
+
return /* @__PURE__ */ React36.createElement(HStack, { key: field.name, spacing: theme.spacing[2], align: "center", style: { justifyContent: "space-between" } }, /* @__PURE__ */ React36.createElement(Typography, { variant: "caption", style: { color: theme.colors["muted-foreground"] } }, field.label ?? fieldLabel2(field.name)), /* @__PURE__ */ React36.createElement(Typography, { variant: "body", style: { color: theme.colors.foreground, fontSize: theme.typography.sizes.sm } }, formatValue2(value, field.format)));
|
|
4508
|
+
}))), primaryActions.length > 0 && /* @__PURE__ */ React36.createElement(
|
|
4509
|
+
View31,
|
|
4510
|
+
{
|
|
4511
|
+
style: [
|
|
4512
|
+
styles30.cardFooter,
|
|
4513
|
+
{
|
|
4514
|
+
borderTopWidth: 1,
|
|
4515
|
+
borderTopColor: theme.colors.border,
|
|
4516
|
+
padding: theme.spacing[3]
|
|
4517
|
+
}
|
|
4518
|
+
]
|
|
4519
|
+
},
|
|
4520
|
+
/* @__PURE__ */ React36.createElement(HStack, { spacing: theme.spacing[2], style: { justifyContent: "flex-end" } }, primaryActions.map((action) => /* @__PURE__ */ React36.createElement(
|
|
4521
|
+
Button,
|
|
4522
|
+
{
|
|
4523
|
+
key: action.event,
|
|
4524
|
+
variant: action.variant === "primary" ? "primary" : "ghost",
|
|
4525
|
+
size: "sm",
|
|
4526
|
+
onPress: () => handleAction(action, itemData)
|
|
4527
|
+
},
|
|
4528
|
+
action.label
|
|
4529
|
+
)))
|
|
4530
|
+
));
|
|
4531
|
+
};
|
|
4532
|
+
return /* @__PURE__ */ React36.createElement(VStack, { spacing: 0, style }, selectable && selectedIds.size > 0 && /* @__PURE__ */ React36.createElement(
|
|
4533
|
+
HStack,
|
|
4534
|
+
{
|
|
4535
|
+
spacing: theme.spacing[2],
|
|
4536
|
+
align: "center",
|
|
4537
|
+
style: {
|
|
4538
|
+
paddingVertical: theme.spacing[2],
|
|
4539
|
+
paddingHorizontal: theme.spacing[3],
|
|
4540
|
+
backgroundColor: theme.colors.muted,
|
|
4541
|
+
borderRadius: theme.borderRadius.sm,
|
|
4542
|
+
marginBottom: theme.spacing[2]
|
|
4543
|
+
}
|
|
4544
|
+
},
|
|
4545
|
+
/* @__PURE__ */ React36.createElement(Typography, { variant: "caption", style: { color: theme.colors.foreground, fontWeight: "600" } }, selectedIds.size, " selected")
|
|
4546
|
+
), /* @__PURE__ */ React36.createElement(
|
|
4547
|
+
FlatList5,
|
|
4548
|
+
{
|
|
4549
|
+
data,
|
|
4550
|
+
numColumns: cols,
|
|
4551
|
+
keyExtractor: (item, index) => String(item.id ?? index),
|
|
4552
|
+
renderItem: renderCard,
|
|
4553
|
+
contentContainerStyle: { paddingHorizontal: gapSize / 2 },
|
|
4554
|
+
columnWrapperStyle: cols > 1 ? { justifyContent: "flex-start" } : void 0
|
|
4555
|
+
}
|
|
4556
|
+
), hasMoreLocal && /* @__PURE__ */ React36.createElement(
|
|
4557
|
+
Button,
|
|
4558
|
+
{
|
|
4559
|
+
variant: "ghost",
|
|
4560
|
+
size: "sm",
|
|
4561
|
+
onPress: () => setVisibleCount((prev) => prev + (pageSize || 5)),
|
|
4562
|
+
style: { alignSelf: "center", marginTop: theme.spacing[3] }
|
|
4563
|
+
},
|
|
4564
|
+
"Show More (",
|
|
4565
|
+
allData.length - visibleCount,
|
|
4566
|
+
" remaining)"
|
|
4567
|
+
), infiniteScroll && loadMoreEvent && /* @__PURE__ */ React36.createElement(
|
|
4568
|
+
InfiniteScrollSentinel,
|
|
4569
|
+
{
|
|
4570
|
+
loadMoreEvent,
|
|
4571
|
+
isLoading,
|
|
4572
|
+
hasMore
|
|
4573
|
+
}
|
|
4574
|
+
));
|
|
4575
|
+
};
|
|
4576
|
+
var styles30 = StyleSheet30.create({
|
|
4577
|
+
card: {
|
|
4578
|
+
overflow: "hidden",
|
|
4579
|
+
padding: 0
|
|
4580
|
+
},
|
|
4581
|
+
cardImage: {
|
|
4582
|
+
height: 140
|
|
4583
|
+
},
|
|
4584
|
+
cardHeader: {},
|
|
4585
|
+
cardBody: {},
|
|
4586
|
+
cardFooter: {},
|
|
4587
|
+
checkbox: {
|
|
4588
|
+
marginTop: 2
|
|
4589
|
+
},
|
|
4590
|
+
checkboxBox: {
|
|
4591
|
+
width: 18,
|
|
4592
|
+
height: 18,
|
|
4593
|
+
borderWidth: 2,
|
|
4594
|
+
borderRadius: 4,
|
|
4595
|
+
alignItems: "center",
|
|
4596
|
+
justifyContent: "center"
|
|
4597
|
+
}
|
|
4598
|
+
});
|
|
4599
|
+
DataGrid.displayName = "DataGrid";
|
|
4600
|
+
|
|
4601
|
+
// src/components/molecules/Carousel.tsx
|
|
4602
|
+
import React37, { useRef as useRef4, useState as useState14, useCallback as useCallback8 } from "react";
|
|
4603
|
+
import {
|
|
4604
|
+
FlatList as FlatList6,
|
|
4605
|
+
View as View32,
|
|
4606
|
+
Dimensions as Dimensions4,
|
|
4607
|
+
StyleSheet as StyleSheet31
|
|
4608
|
+
} from "react-native";
|
|
4609
|
+
var Carousel = ({
|
|
4610
|
+
items,
|
|
4611
|
+
renderItem,
|
|
4612
|
+
autoPlay = false,
|
|
4613
|
+
autoPlayInterval = 3e3,
|
|
4614
|
+
showDots = true,
|
|
4615
|
+
itemWidth,
|
|
4616
|
+
style,
|
|
4617
|
+
isLoading,
|
|
4618
|
+
error
|
|
4619
|
+
}) => {
|
|
4620
|
+
const theme = useTheme();
|
|
4621
|
+
const flatListRef = useRef4(null);
|
|
4622
|
+
const [activeIndex, setActiveIndex] = useState14(0);
|
|
4623
|
+
const screenWidth = Dimensions4.get("window").width;
|
|
4624
|
+
const width = itemWidth ?? screenWidth;
|
|
4625
|
+
if (isLoading) return /* @__PURE__ */ React37.createElement(LoadingState, { message: "Loading..." });
|
|
4626
|
+
if (error) return /* @__PURE__ */ React37.createElement(ErrorState, { message: error.message });
|
|
4627
|
+
const handleScroll = useCallback8(
|
|
4628
|
+
(event) => {
|
|
4629
|
+
const offset = event.nativeEvent.contentOffset.x;
|
|
4630
|
+
const index = Math.round(offset / width);
|
|
4631
|
+
setActiveIndex(index);
|
|
4632
|
+
},
|
|
4633
|
+
[width]
|
|
4634
|
+
);
|
|
4635
|
+
React37.useEffect(() => {
|
|
4636
|
+
if (!autoPlay || items.length <= 1) return;
|
|
4637
|
+
const interval = setInterval(() => {
|
|
4638
|
+
const nextIndex = (activeIndex + 1) % items.length;
|
|
4639
|
+
flatListRef.current?.scrollToIndex({ index: nextIndex, animated: true });
|
|
4640
|
+
setActiveIndex(nextIndex);
|
|
4641
|
+
}, autoPlayInterval);
|
|
4642
|
+
return () => clearInterval(interval);
|
|
4643
|
+
}, [autoPlay, autoPlayInterval, activeIndex, items.length]);
|
|
4644
|
+
return /* @__PURE__ */ React37.createElement(View32, { style: [styles31.container, style] }, /* @__PURE__ */ React37.createElement(
|
|
4645
|
+
FlatList6,
|
|
4646
|
+
{
|
|
4647
|
+
ref: flatListRef,
|
|
4648
|
+
data: items,
|
|
4649
|
+
horizontal: true,
|
|
4650
|
+
pagingEnabled: true,
|
|
4651
|
+
showsHorizontalScrollIndicator: false,
|
|
4652
|
+
onScroll: handleScroll,
|
|
4653
|
+
scrollEventThrottle: 16,
|
|
4654
|
+
keyExtractor: (_, index) => String(index),
|
|
4655
|
+
getItemLayout: (_, index) => ({
|
|
4656
|
+
length: width,
|
|
4657
|
+
offset: width * index,
|
|
4658
|
+
index
|
|
4659
|
+
}),
|
|
4660
|
+
renderItem: ({ item, index }) => /* @__PURE__ */ React37.createElement(View32, { style: { width } }, renderItem(item, index))
|
|
4661
|
+
}
|
|
4662
|
+
), showDots && items.length > 1 && /* @__PURE__ */ React37.createElement(View32, { style: styles31.dotsContainer }, items.map((_, index) => /* @__PURE__ */ React37.createElement(
|
|
4663
|
+
View32,
|
|
4664
|
+
{
|
|
4665
|
+
key: index,
|
|
4666
|
+
style: [
|
|
4667
|
+
styles31.dot,
|
|
4668
|
+
{
|
|
4669
|
+
backgroundColor: index === activeIndex ? theme.colors.primary : theme.colors.border
|
|
4670
|
+
}
|
|
4671
|
+
]
|
|
4672
|
+
}
|
|
4673
|
+
))));
|
|
4674
|
+
};
|
|
4675
|
+
var styles31 = StyleSheet31.create({
|
|
4676
|
+
container: {},
|
|
4677
|
+
dotsContainer: {
|
|
4678
|
+
flexDirection: "row",
|
|
4679
|
+
justifyContent: "center",
|
|
4680
|
+
alignItems: "center",
|
|
4681
|
+
paddingVertical: 12,
|
|
4682
|
+
gap: 8
|
|
4683
|
+
},
|
|
4684
|
+
dot: {
|
|
4685
|
+
width: 8,
|
|
4686
|
+
height: 8,
|
|
4687
|
+
borderRadius: 4
|
|
4688
|
+
}
|
|
4689
|
+
});
|
|
4690
|
+
Carousel.displayName = "Carousel";
|
|
4691
|
+
|
|
4692
|
+
// src/components/molecules/FlipCard.tsx
|
|
4693
|
+
import React38, { useEffect as useEffect2, useRef as useRef5, useState as useState15 } from "react";
|
|
4694
|
+
import { Animated as Animated4, Pressable as Pressable5, StyleSheet as StyleSheet32 } from "react-native";
|
|
4695
|
+
var FlipCard = ({
|
|
4696
|
+
front,
|
|
4697
|
+
back,
|
|
4698
|
+
flipped: controlledFlipped,
|
|
4699
|
+
onFlip,
|
|
4700
|
+
duration = 400,
|
|
4701
|
+
disabled = false,
|
|
4702
|
+
style
|
|
4703
|
+
}) => {
|
|
4704
|
+
const theme = useTheme();
|
|
4705
|
+
const [internalFlipped, setInternalFlipped] = useState15(false);
|
|
4706
|
+
const isFlipped = controlledFlipped ?? internalFlipped;
|
|
4707
|
+
const flipAnim = useRef5(new Animated4.Value(isFlipped ? 1 : 0)).current;
|
|
4708
|
+
useEffect2(() => {
|
|
4709
|
+
Animated4.timing(flipAnim, {
|
|
4710
|
+
toValue: isFlipped ? 1 : 0,
|
|
4711
|
+
duration,
|
|
4712
|
+
useNativeDriver: true
|
|
4713
|
+
}).start();
|
|
4714
|
+
}, [isFlipped, duration, flipAnim]);
|
|
4715
|
+
const handleFlip = () => {
|
|
4716
|
+
if (disabled) return;
|
|
4717
|
+
const nextFlipped = !isFlipped;
|
|
4718
|
+
setInternalFlipped(nextFlipped);
|
|
4719
|
+
onFlip?.(nextFlipped);
|
|
4720
|
+
};
|
|
4721
|
+
const frontRotateY = flipAnim.interpolate({
|
|
4722
|
+
inputRange: [0, 1],
|
|
4723
|
+
outputRange: ["0deg", "180deg"]
|
|
4724
|
+
});
|
|
4725
|
+
const backRotateY = flipAnim.interpolate({
|
|
4726
|
+
inputRange: [0, 1],
|
|
4727
|
+
outputRange: ["180deg", "360deg"]
|
|
4728
|
+
});
|
|
4729
|
+
return /* @__PURE__ */ React38.createElement(Pressable5, { onPress: handleFlip, disabled, style: [styles32.container, style] }, /* @__PURE__ */ React38.createElement(
|
|
4730
|
+
Animated4.View,
|
|
4731
|
+
{
|
|
4732
|
+
style: [
|
|
4733
|
+
styles32.face,
|
|
4734
|
+
{
|
|
4735
|
+
backgroundColor: theme.colors.card,
|
|
4736
|
+
borderRadius: theme.borderRadius.lg,
|
|
4737
|
+
...theme.shadows.sm,
|
|
4738
|
+
transform: [{ rotateY: frontRotateY }]
|
|
4739
|
+
}
|
|
4740
|
+
]
|
|
4741
|
+
},
|
|
4742
|
+
front
|
|
4743
|
+
), /* @__PURE__ */ React38.createElement(
|
|
4744
|
+
Animated4.View,
|
|
4745
|
+
{
|
|
4746
|
+
style: [
|
|
4747
|
+
styles32.face,
|
|
4748
|
+
styles32.backFace,
|
|
4749
|
+
{
|
|
4750
|
+
backgroundColor: theme.colors.card,
|
|
4751
|
+
borderRadius: theme.borderRadius.lg,
|
|
4752
|
+
...theme.shadows.sm,
|
|
4753
|
+
transform: [{ rotateY: backRotateY }]
|
|
4754
|
+
}
|
|
4755
|
+
]
|
|
4756
|
+
},
|
|
4757
|
+
back
|
|
4758
|
+
));
|
|
4759
|
+
};
|
|
4760
|
+
var styles32 = StyleSheet32.create({
|
|
4761
|
+
container: {},
|
|
4762
|
+
face: {
|
|
4763
|
+
backfaceVisibility: "hidden",
|
|
4764
|
+
padding: 16
|
|
4765
|
+
},
|
|
4766
|
+
backFace: {
|
|
4767
|
+
position: "absolute",
|
|
4768
|
+
top: 0,
|
|
4769
|
+
left: 0,
|
|
4770
|
+
right: 0,
|
|
4771
|
+
bottom: 0
|
|
4772
|
+
}
|
|
4773
|
+
});
|
|
4774
|
+
FlipCard.displayName = "FlipCard";
|
|
4775
|
+
|
|
4776
|
+
// src/components/molecules/PullToRefresh.tsx
|
|
4777
|
+
import React39, { useState as useState16, useCallback as useCallback9 } from "react";
|
|
4778
|
+
import { ScrollView as ScrollView4, RefreshControl, StyleSheet as StyleSheet33 } from "react-native";
|
|
4779
|
+
var PullToRefresh = ({
|
|
4780
|
+
refreshEvent,
|
|
4781
|
+
refreshPayload,
|
|
4782
|
+
onRefresh,
|
|
4783
|
+
children,
|
|
4784
|
+
style
|
|
4785
|
+
}) => {
|
|
4786
|
+
const theme = useTheme();
|
|
4787
|
+
const eventBus = useEventBus();
|
|
4788
|
+
const [refreshing, setRefreshing] = useState16(false);
|
|
4789
|
+
const handleRefresh = useCallback9(async () => {
|
|
4790
|
+
setRefreshing(true);
|
|
4791
|
+
if (refreshEvent) {
|
|
4792
|
+
eventBus.emit(`UI:${refreshEvent}`, refreshPayload);
|
|
4793
|
+
}
|
|
4794
|
+
if (onRefresh) {
|
|
4795
|
+
await onRefresh();
|
|
4796
|
+
}
|
|
4797
|
+
setRefreshing(false);
|
|
4798
|
+
}, [refreshEvent, refreshPayload, onRefresh, eventBus]);
|
|
4799
|
+
return /* @__PURE__ */ React39.createElement(
|
|
4800
|
+
ScrollView4,
|
|
4801
|
+
{
|
|
4802
|
+
style: [styles33.container, style],
|
|
4803
|
+
refreshControl: /* @__PURE__ */ React39.createElement(
|
|
4804
|
+
RefreshControl,
|
|
4805
|
+
{
|
|
4806
|
+
refreshing,
|
|
4807
|
+
onRefresh: handleRefresh,
|
|
4808
|
+
tintColor: theme.colors.primary,
|
|
4809
|
+
colors: [theme.colors.primary]
|
|
4810
|
+
}
|
|
4811
|
+
)
|
|
4812
|
+
},
|
|
4813
|
+
children
|
|
4814
|
+
);
|
|
4815
|
+
};
|
|
4816
|
+
var styles33 = StyleSheet33.create({
|
|
4817
|
+
container: {
|
|
4818
|
+
flex: 1
|
|
4819
|
+
}
|
|
4820
|
+
});
|
|
4821
|
+
PullToRefresh.displayName = "PullToRefresh";
|
|
4822
|
+
|
|
4823
|
+
// src/components/molecules/SwipeableRow.tsx
|
|
4824
|
+
import React40, { useRef as useRef6 } from "react";
|
|
4825
|
+
import {
|
|
4826
|
+
View as View33,
|
|
4827
|
+
Animated as Animated5,
|
|
4828
|
+
PanResponder,
|
|
4829
|
+
Pressable as Pressable6,
|
|
4830
|
+
StyleSheet as StyleSheet34,
|
|
4831
|
+
Dimensions as Dimensions5
|
|
4832
|
+
} from "react-native";
|
|
4833
|
+
var ACTION_WIDTH = 80;
|
|
4834
|
+
var SwipeableRow = ({
|
|
4835
|
+
leftActions = [],
|
|
4836
|
+
rightActions = [],
|
|
4837
|
+
threshold = 0.3,
|
|
4838
|
+
children,
|
|
4839
|
+
style
|
|
4840
|
+
}) => {
|
|
4841
|
+
const theme = useTheme();
|
|
4842
|
+
const eventBus = useEventBus();
|
|
4843
|
+
const translateX = useRef6(new Animated5.Value(0)).current;
|
|
4844
|
+
const screenWidth = Dimensions5.get("window").width;
|
|
4845
|
+
const leftWidth = leftActions.length * ACTION_WIDTH;
|
|
4846
|
+
const rightWidth = rightActions.length * ACTION_WIDTH;
|
|
4847
|
+
const panResponder = useRef6(
|
|
4848
|
+
PanResponder.create({
|
|
4849
|
+
onMoveShouldSetPanResponder: (_, gestureState) => Math.abs(gestureState.dx) > 10 && Math.abs(gestureState.dy) < 10,
|
|
4850
|
+
onPanResponderMove: (_, gestureState) => {
|
|
4851
|
+
const maxLeft = leftWidth;
|
|
4852
|
+
const maxRight = -rightWidth;
|
|
4853
|
+
const dx = Math.max(maxRight, Math.min(maxLeft, gestureState.dx));
|
|
4854
|
+
translateX.setValue(dx);
|
|
4855
|
+
},
|
|
4856
|
+
onPanResponderRelease: (_, gestureState) => {
|
|
4857
|
+
const swipeThreshold = screenWidth * threshold;
|
|
4858
|
+
let toValue = 0;
|
|
4859
|
+
if (gestureState.dx > swipeThreshold && leftActions.length > 0) {
|
|
4860
|
+
toValue = leftWidth;
|
|
4861
|
+
} else if (gestureState.dx < -swipeThreshold && rightActions.length > 0) {
|
|
4862
|
+
toValue = -rightWidth;
|
|
4863
|
+
}
|
|
4864
|
+
Animated5.spring(translateX, {
|
|
4865
|
+
toValue,
|
|
4866
|
+
useNativeDriver: true,
|
|
4867
|
+
friction: 8
|
|
4868
|
+
}).start();
|
|
4869
|
+
}
|
|
4870
|
+
})
|
|
4871
|
+
).current;
|
|
4872
|
+
const handleAction = (action) => {
|
|
4873
|
+
eventBus.emit(`UI:${action.event}`, action.payload);
|
|
4874
|
+
Animated5.spring(translateX, {
|
|
4875
|
+
toValue: 0,
|
|
4876
|
+
useNativeDriver: true,
|
|
4877
|
+
friction: 8
|
|
4878
|
+
}).start();
|
|
4879
|
+
};
|
|
4880
|
+
return /* @__PURE__ */ React40.createElement(View33, { style: [styles34.container, style] }, leftActions.length > 0 && /* @__PURE__ */ React40.createElement(View33, { style: [styles34.actionsLeft, { width: leftWidth }] }, leftActions.map((action) => /* @__PURE__ */ React40.createElement(
|
|
4881
|
+
Pressable6,
|
|
4882
|
+
{
|
|
4883
|
+
key: action.event,
|
|
4884
|
+
onPress: () => handleAction(action),
|
|
4885
|
+
style: [styles34.actionButton, { backgroundColor: action.color }]
|
|
4886
|
+
},
|
|
4887
|
+
/* @__PURE__ */ React40.createElement(Typography, { variant: "caption", style: { color: theme.colors["primary-foreground"], fontWeight: "600" } }, action.label)
|
|
4888
|
+
))), rightActions.length > 0 && /* @__PURE__ */ React40.createElement(View33, { style: [styles34.actionsRight, { width: rightWidth }] }, rightActions.map((action) => /* @__PURE__ */ React40.createElement(
|
|
4889
|
+
Pressable6,
|
|
4890
|
+
{
|
|
4891
|
+
key: action.event,
|
|
4892
|
+
onPress: () => handleAction(action),
|
|
4893
|
+
style: [styles34.actionButton, { backgroundColor: action.color }]
|
|
4894
|
+
},
|
|
4895
|
+
/* @__PURE__ */ React40.createElement(Typography, { variant: "caption", style: { color: theme.colors["primary-foreground"], fontWeight: "600" } }, action.label)
|
|
4896
|
+
))), /* @__PURE__ */ React40.createElement(
|
|
4897
|
+
Animated5.View,
|
|
4898
|
+
{
|
|
4899
|
+
style: [
|
|
4900
|
+
styles34.content,
|
|
4901
|
+
{
|
|
4902
|
+
backgroundColor: theme.colors.card,
|
|
4903
|
+
transform: [{ translateX }]
|
|
4904
|
+
}
|
|
4905
|
+
],
|
|
4906
|
+
...panResponder.panHandlers
|
|
4907
|
+
},
|
|
4908
|
+
children
|
|
4909
|
+
));
|
|
4910
|
+
};
|
|
4911
|
+
var styles34 = StyleSheet34.create({
|
|
4912
|
+
container: {
|
|
4913
|
+
overflow: "hidden"
|
|
4914
|
+
},
|
|
4915
|
+
actionsLeft: {
|
|
4916
|
+
position: "absolute",
|
|
4917
|
+
left: 0,
|
|
4918
|
+
top: 0,
|
|
4919
|
+
bottom: 0,
|
|
4920
|
+
flexDirection: "row"
|
|
4921
|
+
},
|
|
4922
|
+
actionsRight: {
|
|
4923
|
+
position: "absolute",
|
|
4924
|
+
right: 0,
|
|
4925
|
+
top: 0,
|
|
4926
|
+
bottom: 0,
|
|
4927
|
+
flexDirection: "row"
|
|
4928
|
+
},
|
|
4929
|
+
actionButton: {
|
|
4930
|
+
width: ACTION_WIDTH,
|
|
4931
|
+
alignItems: "center",
|
|
4932
|
+
justifyContent: "center"
|
|
4933
|
+
},
|
|
4934
|
+
content: {}
|
|
4935
|
+
});
|
|
4936
|
+
SwipeableRow.displayName = "SwipeableRow";
|
|
4937
|
+
|
|
4938
|
+
// src/components/molecules/SortableList.tsx
|
|
4939
|
+
import React41, { useState as useState17, useCallback as useCallback10 } from "react";
|
|
4940
|
+
import {
|
|
4941
|
+
View as View34,
|
|
4942
|
+
FlatList as FlatList7,
|
|
4943
|
+
Pressable as Pressable7,
|
|
4944
|
+
LayoutAnimation as LayoutAnimation2,
|
|
4945
|
+
StyleSheet as StyleSheet35
|
|
4946
|
+
} from "react-native";
|
|
4947
|
+
var SortableList = ({
|
|
4948
|
+
items: initialItems,
|
|
4949
|
+
renderItem,
|
|
4950
|
+
keyExtractor,
|
|
4951
|
+
reorderEvent,
|
|
4952
|
+
dragHandlePosition = "left",
|
|
4953
|
+
onReorder,
|
|
4954
|
+
style,
|
|
4955
|
+
isLoading,
|
|
4956
|
+
error
|
|
4957
|
+
}) => {
|
|
4958
|
+
const theme = useTheme();
|
|
4959
|
+
const eventBus = useEventBus();
|
|
4960
|
+
const [items, setItems] = useState17(initialItems);
|
|
4961
|
+
const [dragIndex] = useState17(null);
|
|
4962
|
+
React41.useEffect(() => {
|
|
4963
|
+
setItems(initialItems);
|
|
4964
|
+
}, [initialItems]);
|
|
4965
|
+
if (isLoading) return /* @__PURE__ */ React41.createElement(LoadingState, { message: "Loading..." });
|
|
4966
|
+
if (error) return /* @__PURE__ */ React41.createElement(ErrorState, { message: error.message });
|
|
4967
|
+
const moveItem = useCallback10((fromIndex, toIndex) => {
|
|
4968
|
+
if (fromIndex === toIndex) return;
|
|
4969
|
+
LayoutAnimation2.configureNext(LayoutAnimation2.Presets.easeInEaseOut);
|
|
4970
|
+
setItems((prev) => {
|
|
4971
|
+
const next = [...prev];
|
|
4972
|
+
const [moved] = next.splice(fromIndex, 1);
|
|
4973
|
+
next.splice(toIndex, 0, moved);
|
|
4974
|
+
onReorder?.(next);
|
|
4975
|
+
if (reorderEvent) {
|
|
4976
|
+
eventBus.emit(`UI:${reorderEvent}`, { items: next, fromIndex, toIndex });
|
|
4977
|
+
}
|
|
4978
|
+
return next;
|
|
4979
|
+
});
|
|
4980
|
+
}, [onReorder, reorderEvent, eventBus]);
|
|
4981
|
+
const handleMoveUp = (index) => {
|
|
4982
|
+
if (index > 0) moveItem(index, index - 1);
|
|
4983
|
+
};
|
|
4984
|
+
const handleMoveDown = (index) => {
|
|
4985
|
+
if (index < items.length - 1) moveItem(index, index + 1);
|
|
4986
|
+
};
|
|
4987
|
+
const dragHandle = (index) => /* @__PURE__ */ React41.createElement(View34, { style: styles35.handleContainer }, /* @__PURE__ */ React41.createElement(Pressable7, { onPress: () => handleMoveUp(index), disabled: index === 0 }, /* @__PURE__ */ React41.createElement(Icon, { name: "chevron-up", size: 18, color: index === 0 ? theme.colors.border : theme.colors["muted-foreground"] })), /* @__PURE__ */ React41.createElement(Icon, { name: "menu", size: 18, color: dragIndex === index ? theme.colors.primary : theme.colors["muted-foreground"] }), /* @__PURE__ */ React41.createElement(Pressable7, { onPress: () => handleMoveDown(index), disabled: index === items.length - 1 }, /* @__PURE__ */ React41.createElement(Icon, { name: "chevron-down", size: 18, color: index === items.length - 1 ? theme.colors.border : theme.colors["muted-foreground"] })));
|
|
4988
|
+
return /* @__PURE__ */ React41.createElement(
|
|
4989
|
+
FlatList7,
|
|
4990
|
+
{
|
|
4991
|
+
data: items,
|
|
4992
|
+
keyExtractor,
|
|
4993
|
+
style,
|
|
4994
|
+
renderItem: ({ item, index }) => /* @__PURE__ */ React41.createElement(
|
|
4995
|
+
View34,
|
|
4996
|
+
{
|
|
4997
|
+
style: [
|
|
4998
|
+
styles35.row,
|
|
4999
|
+
{
|
|
5000
|
+
backgroundColor: dragIndex === index ? theme.colors.muted : theme.colors.card,
|
|
5001
|
+
borderBottomWidth: 1,
|
|
5002
|
+
borderBottomColor: theme.colors.border
|
|
5003
|
+
}
|
|
5004
|
+
]
|
|
5005
|
+
},
|
|
5006
|
+
dragHandlePosition === "left" && dragHandle(index),
|
|
5007
|
+
/* @__PURE__ */ React41.createElement(View34, { style: styles35.content }, renderItem(item, index)),
|
|
5008
|
+
dragHandlePosition === "right" && dragHandle(index)
|
|
5009
|
+
)
|
|
5010
|
+
}
|
|
5011
|
+
);
|
|
5012
|
+
};
|
|
5013
|
+
var styles35 = StyleSheet35.create({
|
|
5014
|
+
row: {
|
|
5015
|
+
flexDirection: "row",
|
|
5016
|
+
alignItems: "center"
|
|
5017
|
+
},
|
|
5018
|
+
content: {
|
|
5019
|
+
flex: 1
|
|
5020
|
+
},
|
|
5021
|
+
handleContainer: {
|
|
5022
|
+
width: 36,
|
|
5023
|
+
alignItems: "center",
|
|
5024
|
+
justifyContent: "center",
|
|
5025
|
+
paddingVertical: 4
|
|
5026
|
+
}
|
|
5027
|
+
});
|
|
5028
|
+
SortableList.displayName = "SortableList";
|
|
5029
|
+
|
|
5030
|
+
// src/components/molecules/CalendarGrid.tsx
|
|
5031
|
+
import React42, { useState as useState18, useMemo as useMemo3 } from "react";
|
|
5032
|
+
import { View as View35, ScrollView as ScrollView5, Pressable as Pressable8, StyleSheet as StyleSheet36 } from "react-native";
|
|
5033
|
+
var DAY_LABELS_SUN = ["S", "M", "T", "W", "T", "F", "S"];
|
|
5034
|
+
var DAY_LABELS_MON = ["M", "T", "W", "T", "F", "S", "S"];
|
|
5035
|
+
var CalendarGrid = ({
|
|
5036
|
+
weekStart = 0,
|
|
5037
|
+
events = [],
|
|
5038
|
+
onSlotClick,
|
|
5039
|
+
slotClickEvent,
|
|
5040
|
+
initialMonth,
|
|
5041
|
+
initialYear,
|
|
5042
|
+
style,
|
|
5043
|
+
isLoading,
|
|
5044
|
+
error
|
|
5045
|
+
}) => {
|
|
5046
|
+
const theme = useTheme();
|
|
5047
|
+
const eventBus = useEventBus();
|
|
5048
|
+
const now = /* @__PURE__ */ new Date();
|
|
5049
|
+
const [month, setMonth] = useState18(initialMonth ?? now.getMonth());
|
|
5050
|
+
const [year, setYear] = useState18(initialYear ?? now.getFullYear());
|
|
5051
|
+
const [selectedDate, setSelectedDate] = useState18(null);
|
|
5052
|
+
if (isLoading) return /* @__PURE__ */ React42.createElement(LoadingState, { message: "Loading..." });
|
|
5053
|
+
if (error) return /* @__PURE__ */ React42.createElement(ErrorState, { message: error.message });
|
|
5054
|
+
const dayLabels = weekStart === 1 ? DAY_LABELS_MON : DAY_LABELS_SUN;
|
|
5055
|
+
const calendarDays = useMemo3(() => {
|
|
5056
|
+
const firstDay = new Date(year, month, 1);
|
|
5057
|
+
const lastDay = new Date(year, month + 1, 0);
|
|
5058
|
+
const daysInMonth = lastDay.getDate();
|
|
5059
|
+
let startOffset = firstDay.getDay() - weekStart;
|
|
5060
|
+
if (startOffset < 0) startOffset += 7;
|
|
5061
|
+
const days = [];
|
|
5062
|
+
for (let i = 0; i < startOffset; i++) days.push(null);
|
|
5063
|
+
for (let d = 1; d <= daysInMonth; d++) days.push(d);
|
|
5064
|
+
while (days.length % 7 !== 0) days.push(null);
|
|
5065
|
+
return days;
|
|
5066
|
+
}, [year, month, weekStart]);
|
|
5067
|
+
const eventDates = useMemo3(() => {
|
|
5068
|
+
const set = /* @__PURE__ */ new Set();
|
|
5069
|
+
events.forEach((e) => {
|
|
5070
|
+
const d = new Date(e.date);
|
|
5071
|
+
if (d.getMonth() === month && d.getFullYear() === year) {
|
|
5072
|
+
set.add(d.getDate());
|
|
5073
|
+
}
|
|
5074
|
+
});
|
|
5075
|
+
return set;
|
|
5076
|
+
}, [events, month, year]);
|
|
5077
|
+
const handleDayPress = (day) => {
|
|
5078
|
+
const dateStr = `${year}-${String(month + 1).padStart(2, "0")}-${String(day).padStart(2, "0")}`;
|
|
5079
|
+
setSelectedDate(dateStr);
|
|
5080
|
+
onSlotClick?.(dateStr);
|
|
5081
|
+
if (slotClickEvent) {
|
|
5082
|
+
eventBus.emit(`UI:${slotClickEvent}`, { date: dateStr });
|
|
5083
|
+
}
|
|
5084
|
+
};
|
|
5085
|
+
const goToPrevMonth = () => {
|
|
5086
|
+
if (month === 0) {
|
|
5087
|
+
setMonth(11);
|
|
5088
|
+
setYear((y) => y - 1);
|
|
5089
|
+
} else {
|
|
5090
|
+
setMonth((m) => m - 1);
|
|
5091
|
+
}
|
|
5092
|
+
};
|
|
5093
|
+
const goToNextMonth = () => {
|
|
5094
|
+
if (month === 11) {
|
|
5095
|
+
setMonth(0);
|
|
5096
|
+
setYear((y) => y + 1);
|
|
5097
|
+
} else {
|
|
5098
|
+
setMonth((m) => m + 1);
|
|
5099
|
+
}
|
|
5100
|
+
};
|
|
5101
|
+
const monthNames = [
|
|
5102
|
+
"January",
|
|
5103
|
+
"February",
|
|
5104
|
+
"March",
|
|
5105
|
+
"April",
|
|
5106
|
+
"May",
|
|
5107
|
+
"June",
|
|
5108
|
+
"July",
|
|
5109
|
+
"August",
|
|
5110
|
+
"September",
|
|
5111
|
+
"October",
|
|
5112
|
+
"November",
|
|
5113
|
+
"December"
|
|
5114
|
+
];
|
|
5115
|
+
const today = now.getDate();
|
|
5116
|
+
const isCurrentMonth = now.getMonth() === month && now.getFullYear() === year;
|
|
5117
|
+
const weeks = [];
|
|
5118
|
+
for (let i = 0; i < calendarDays.length; i += 7) {
|
|
5119
|
+
weeks.push(calendarDays.slice(i, i + 7));
|
|
5120
|
+
}
|
|
5121
|
+
return /* @__PURE__ */ React42.createElement(VStack, { spacing: theme.spacing[3], style }, /* @__PURE__ */ React42.createElement(HStack, { spacing: theme.spacing[2], align: "center", style: styles36.header }, /* @__PURE__ */ React42.createElement(Pressable8, { onPress: goToPrevMonth, style: styles36.navButton }, /* @__PURE__ */ React42.createElement(Icon, { name: "chevron-left", size: 20, color: theme.colors.foreground })), /* @__PURE__ */ React42.createElement(Typography, { variant: "h4", style: { color: theme.colors.foreground, flex: 1, textAlign: "center" } }, monthNames[month], " ", year), /* @__PURE__ */ React42.createElement(Pressable8, { onPress: goToNextMonth, style: styles36.navButton }, /* @__PURE__ */ React42.createElement(Icon, { name: "chevron-right", size: 20, color: theme.colors.foreground }))), /* @__PURE__ */ React42.createElement(HStack, { spacing: 0, align: "center", style: styles36.dayLabelsRow }, dayLabels.map((label, i) => /* @__PURE__ */ React42.createElement(View35, { key: i, style: styles36.dayLabelCell }, /* @__PURE__ */ React42.createElement(Typography, { variant: "caption", style: { color: theme.colors["muted-foreground"], textAlign: "center", fontWeight: "600" } }, label)))), /* @__PURE__ */ React42.createElement(ScrollView5, null, weeks.map((week, wi) => /* @__PURE__ */ React42.createElement(HStack, { key: wi, spacing: 0, align: "center" }, week.map((day, di) => /* @__PURE__ */ React42.createElement(View35, { key: di, style: styles36.cellWrapper }, day !== null ? /* @__PURE__ */ React42.createElement(
|
|
5122
|
+
DayCell,
|
|
5123
|
+
{
|
|
5124
|
+
date: day,
|
|
5125
|
+
isToday: isCurrentMonth && day === today,
|
|
5126
|
+
isSelected: selectedDate === `${year}-${String(month + 1).padStart(2, "0")}-${String(day).padStart(2, "0")}`,
|
|
5127
|
+
hasEvents: eventDates.has(day),
|
|
5128
|
+
onClick: () => handleDayPress(day)
|
|
5129
|
+
}
|
|
5130
|
+
) : /* @__PURE__ */ React42.createElement(View35, { style: styles36.emptyCell })))))));
|
|
5131
|
+
};
|
|
5132
|
+
var styles36 = StyleSheet36.create({
|
|
5133
|
+
header: {
|
|
5134
|
+
justifyContent: "space-between",
|
|
5135
|
+
paddingHorizontal: 4
|
|
5136
|
+
},
|
|
5137
|
+
navButton: {
|
|
5138
|
+
padding: 8
|
|
5139
|
+
},
|
|
5140
|
+
dayLabelsRow: {
|
|
5141
|
+
justifyContent: "space-around"
|
|
5142
|
+
},
|
|
5143
|
+
dayLabelCell: {
|
|
5144
|
+
flex: 1,
|
|
5145
|
+
alignItems: "center",
|
|
5146
|
+
paddingVertical: 4
|
|
5147
|
+
},
|
|
5148
|
+
cellWrapper: {
|
|
5149
|
+
flex: 1,
|
|
5150
|
+
alignItems: "center",
|
|
5151
|
+
paddingVertical: 2
|
|
5152
|
+
},
|
|
5153
|
+
emptyCell: {
|
|
5154
|
+
width: 40,
|
|
5155
|
+
height: 40
|
|
5156
|
+
}
|
|
5157
|
+
});
|
|
5158
|
+
CalendarGrid.displayName = "CalendarGrid";
|
|
5159
|
+
|
|
5160
|
+
// src/components/molecules/Lightbox.tsx
|
|
5161
|
+
import React43, { useRef as useRef7, useState as useState19, useCallback as useCallback11 } from "react";
|
|
5162
|
+
import {
|
|
5163
|
+
Modal as Modal5,
|
|
5164
|
+
View as View36,
|
|
5165
|
+
FlatList as FlatList8,
|
|
5166
|
+
Image as Image2,
|
|
5167
|
+
Pressable as Pressable9,
|
|
5168
|
+
Dimensions as Dimensions6,
|
|
5169
|
+
StyleSheet as StyleSheet37
|
|
5170
|
+
} from "react-native";
|
|
5171
|
+
var Lightbox = ({
|
|
5172
|
+
images,
|
|
5173
|
+
currentIndex = 0,
|
|
5174
|
+
isOpen,
|
|
5175
|
+
closeAction,
|
|
5176
|
+
onClose,
|
|
5177
|
+
style
|
|
5178
|
+
}) => {
|
|
5179
|
+
const eventBus = useEventBus();
|
|
5180
|
+
const flatListRef = useRef7(null);
|
|
5181
|
+
const [activeIndex, setActiveIndex] = useState19(currentIndex);
|
|
5182
|
+
const { width: screenWidth, height: screenHeight } = Dimensions6.get("window");
|
|
5183
|
+
const handleClose = () => {
|
|
5184
|
+
if (closeAction) {
|
|
5185
|
+
eventBus.emit(`UI:${closeAction}`, {});
|
|
5186
|
+
}
|
|
5187
|
+
onClose?.();
|
|
5188
|
+
};
|
|
5189
|
+
const handleScroll = useCallback11(
|
|
5190
|
+
(event) => {
|
|
5191
|
+
const offset = event.nativeEvent.contentOffset.x;
|
|
5192
|
+
const index = Math.round(offset / screenWidth);
|
|
5193
|
+
setActiveIndex(index);
|
|
5194
|
+
},
|
|
5195
|
+
[screenWidth]
|
|
5196
|
+
);
|
|
5197
|
+
React43.useEffect(() => {
|
|
5198
|
+
if (isOpen && flatListRef.current && currentIndex >= 0) {
|
|
5199
|
+
setTimeout(() => {
|
|
5200
|
+
flatListRef.current?.scrollToIndex({ index: currentIndex, animated: false });
|
|
5201
|
+
setActiveIndex(currentIndex);
|
|
5202
|
+
}, 100);
|
|
5203
|
+
}
|
|
5204
|
+
}, [isOpen, currentIndex]);
|
|
5205
|
+
return /* @__PURE__ */ React43.createElement(
|
|
5206
|
+
Modal5,
|
|
5207
|
+
{
|
|
5208
|
+
visible: isOpen,
|
|
5209
|
+
transparent: true,
|
|
5210
|
+
animationType: "fade",
|
|
5211
|
+
onRequestClose: handleClose
|
|
5212
|
+
},
|
|
5213
|
+
/* @__PURE__ */ React43.createElement(View36, { style: [styles37.overlay, { backgroundColor: "rgba(0,0,0,0.95)" }, style] }, /* @__PURE__ */ React43.createElement(View36, { style: styles37.header }, /* @__PURE__ */ React43.createElement(Typography, { variant: "body", style: { color: "#fff" } }, activeIndex + 1, " / ", images.length), /* @__PURE__ */ React43.createElement(Pressable9, { onPress: handleClose, style: styles37.closeButton }, /* @__PURE__ */ React43.createElement(Icon, { name: "x", size: 28, color: "#fff" }))), /* @__PURE__ */ React43.createElement(
|
|
5214
|
+
FlatList8,
|
|
5215
|
+
{
|
|
5216
|
+
ref: flatListRef,
|
|
5217
|
+
data: images,
|
|
5218
|
+
horizontal: true,
|
|
5219
|
+
pagingEnabled: true,
|
|
5220
|
+
showsHorizontalScrollIndicator: false,
|
|
5221
|
+
onScroll: handleScroll,
|
|
5222
|
+
scrollEventThrottle: 16,
|
|
5223
|
+
keyExtractor: (_, index) => String(index),
|
|
5224
|
+
getItemLayout: (_, index) => ({
|
|
5225
|
+
length: screenWidth,
|
|
5226
|
+
offset: screenWidth * index,
|
|
5227
|
+
index
|
|
5228
|
+
}),
|
|
5229
|
+
renderItem: ({ item }) => /* @__PURE__ */ React43.createElement(View36, { style: [styles37.imageContainer, { width: screenWidth, height: screenHeight * 0.75 }] }, /* @__PURE__ */ React43.createElement(
|
|
5230
|
+
Image2,
|
|
5231
|
+
{
|
|
5232
|
+
source: { uri: item.uri },
|
|
5233
|
+
style: styles37.image,
|
|
5234
|
+
resizeMode: "contain"
|
|
5235
|
+
}
|
|
5236
|
+
), item.alt && /* @__PURE__ */ React43.createElement(Typography, { variant: "caption", style: styles37.caption }, item.alt))
|
|
5237
|
+
}
|
|
5238
|
+
))
|
|
5239
|
+
);
|
|
5240
|
+
};
|
|
5241
|
+
var styles37 = StyleSheet37.create({
|
|
5242
|
+
overlay: {
|
|
5243
|
+
flex: 1,
|
|
5244
|
+
justifyContent: "center"
|
|
5245
|
+
},
|
|
5246
|
+
header: {
|
|
5247
|
+
flexDirection: "row",
|
|
5248
|
+
justifyContent: "space-between",
|
|
5249
|
+
alignItems: "center",
|
|
5250
|
+
paddingHorizontal: 16,
|
|
5251
|
+
paddingTop: 48,
|
|
5252
|
+
paddingBottom: 12
|
|
5253
|
+
},
|
|
5254
|
+
closeButton: {
|
|
5255
|
+
padding: 8
|
|
5256
|
+
},
|
|
5257
|
+
imageContainer: {
|
|
5258
|
+
alignItems: "center",
|
|
5259
|
+
justifyContent: "center"
|
|
5260
|
+
},
|
|
5261
|
+
image: {
|
|
5262
|
+
width: "100%",
|
|
5263
|
+
height: "100%"
|
|
5264
|
+
},
|
|
5265
|
+
caption: {
|
|
5266
|
+
color: "rgba(255,255,255,0.8)",
|
|
5267
|
+
textAlign: "center",
|
|
5268
|
+
marginTop: 12
|
|
5269
|
+
}
|
|
5270
|
+
});
|
|
5271
|
+
Lightbox.displayName = "Lightbox";
|
|
5272
|
+
|
|
5273
|
+
// src/components/molecules/ScaledDiagram.tsx
|
|
5274
|
+
import React44, { useRef as useRef8, useState as useState20, useCallback as useCallback12 } from "react";
|
|
5275
|
+
import {
|
|
5276
|
+
View as View37,
|
|
5277
|
+
StyleSheet as StyleSheet38,
|
|
5278
|
+
Animated as Animated6,
|
|
5279
|
+
PanResponder as PanResponder2,
|
|
5280
|
+
Dimensions as Dimensions7,
|
|
5281
|
+
TouchableOpacity as TouchableOpacity17
|
|
5282
|
+
} from "react-native";
|
|
5283
|
+
var { width: SCREEN_WIDTH2 } = Dimensions7.get("window");
|
|
5284
|
+
var ScaledDiagram = ({
|
|
5285
|
+
style,
|
|
5286
|
+
isLoading,
|
|
5287
|
+
error,
|
|
5288
|
+
entity,
|
|
5289
|
+
children,
|
|
5290
|
+
contentWidth = 800,
|
|
5291
|
+
contentHeight = 600,
|
|
5292
|
+
width = SCREEN_WIDTH2 - 32,
|
|
5293
|
+
height = 400,
|
|
5294
|
+
initialScale = 1,
|
|
5295
|
+
minScale = 0.5,
|
|
5296
|
+
maxScale = 3,
|
|
5297
|
+
enablePan = true,
|
|
5298
|
+
enableZoom = true,
|
|
5299
|
+
showControls = true,
|
|
5300
|
+
title,
|
|
5301
|
+
enableDoubleTap = true,
|
|
5302
|
+
eventPrefix = "DIAGRAM"
|
|
5303
|
+
}) => {
|
|
5304
|
+
const theme = useTheme();
|
|
5305
|
+
const eventBus = useEventBus();
|
|
5306
|
+
const scale = useRef8(new Animated6.Value(initialScale)).current;
|
|
5307
|
+
const translateX = useRef8(new Animated6.Value(0)).current;
|
|
5308
|
+
const translateY = useRef8(new Animated6.Value(0)).current;
|
|
5309
|
+
const [currentScale, setCurrentScale] = useState20(initialScale);
|
|
5310
|
+
const lastTranslate = useRef8({ x: 0, y: 0 });
|
|
5311
|
+
const clamp = useCallback12((value, min, max) => {
|
|
5312
|
+
return Math.min(Math.max(value, min), max);
|
|
5313
|
+
}, []);
|
|
5314
|
+
const getBounds = useCallback12((newScale) => {
|
|
5315
|
+
const scaledWidth = contentWidth * newScale;
|
|
5316
|
+
const scaledHeight = contentHeight * newScale;
|
|
5317
|
+
const maxX = Math.max(0, (scaledWidth - width) / 2);
|
|
5318
|
+
const maxY = Math.max(0, (scaledHeight - height) / 2);
|
|
5319
|
+
return { maxX, maxY };
|
|
5320
|
+
}, [contentWidth, contentHeight, width, height]);
|
|
5321
|
+
const handleZoomIn = useCallback12(() => {
|
|
5322
|
+
if (!enableZoom) return;
|
|
5323
|
+
const newScale = clamp(currentScale * 1.25, minScale, maxScale);
|
|
5324
|
+
setCurrentScale(newScale);
|
|
5325
|
+
Animated6.spring(scale, {
|
|
5326
|
+
toValue: newScale,
|
|
5327
|
+
useNativeDriver: true,
|
|
5328
|
+
friction: 8
|
|
5329
|
+
}).start();
|
|
5330
|
+
eventBus.emit(`UI:${eventPrefix}_ZOOM_IN`, {
|
|
5331
|
+
entity,
|
|
5332
|
+
scale: newScale
|
|
5333
|
+
});
|
|
5334
|
+
}, [currentScale, minScale, maxScale, enableZoom, entity, eventPrefix, scale, eventBus, clamp]);
|
|
5335
|
+
const handleZoomOut = useCallback12(() => {
|
|
5336
|
+
if (!enableZoom) return;
|
|
5337
|
+
const newScale = clamp(currentScale / 1.25, minScale, maxScale);
|
|
5338
|
+
setCurrentScale(newScale);
|
|
5339
|
+
if (newScale <= initialScale) {
|
|
5340
|
+
lastTranslate.current = { x: 0, y: 0 };
|
|
5341
|
+
Animated6.parallel([
|
|
5342
|
+
Animated6.spring(translateX, {
|
|
5343
|
+
toValue: 0,
|
|
5344
|
+
useNativeDriver: true,
|
|
5345
|
+
friction: 8
|
|
5346
|
+
}),
|
|
5347
|
+
Animated6.spring(translateY, {
|
|
5348
|
+
toValue: 0,
|
|
5349
|
+
useNativeDriver: true,
|
|
5350
|
+
friction: 8
|
|
5351
|
+
})
|
|
5352
|
+
]).start();
|
|
5353
|
+
}
|
|
5354
|
+
Animated6.spring(scale, {
|
|
5355
|
+
toValue: newScale,
|
|
5356
|
+
useNativeDriver: true,
|
|
5357
|
+
friction: 8
|
|
5358
|
+
}).start();
|
|
5359
|
+
eventBus.emit(`UI:${eventPrefix}_ZOOM_OUT`, {
|
|
5360
|
+
entity,
|
|
5361
|
+
scale: newScale
|
|
5362
|
+
});
|
|
5363
|
+
}, [currentScale, minScale, maxScale, initialScale, enableZoom, entity, eventPrefix, scale, translateX, translateY, eventBus, clamp]);
|
|
5364
|
+
const handleReset = useCallback12(() => {
|
|
5365
|
+
setCurrentScale(initialScale);
|
|
5366
|
+
lastTranslate.current = { x: 0, y: 0 };
|
|
5367
|
+
Animated6.parallel([
|
|
5368
|
+
Animated6.spring(scale, {
|
|
5369
|
+
toValue: initialScale,
|
|
5370
|
+
useNativeDriver: true,
|
|
5371
|
+
friction: 8
|
|
5372
|
+
}),
|
|
5373
|
+
Animated6.spring(translateX, {
|
|
5374
|
+
toValue: 0,
|
|
5375
|
+
useNativeDriver: true,
|
|
5376
|
+
friction: 8
|
|
5377
|
+
}),
|
|
5378
|
+
Animated6.spring(translateY, {
|
|
5379
|
+
toValue: 0,
|
|
5380
|
+
useNativeDriver: true,
|
|
5381
|
+
friction: 8
|
|
5382
|
+
})
|
|
5383
|
+
]).start();
|
|
5384
|
+
eventBus.emit(`UI:${eventPrefix}_RESET`, {
|
|
5385
|
+
entity,
|
|
5386
|
+
scale: initialScale
|
|
5387
|
+
});
|
|
5388
|
+
}, [initialScale, entity, eventPrefix, scale, translateX, translateY, eventBus]);
|
|
5389
|
+
const handleDoubleTap = useCallback12(() => {
|
|
5390
|
+
if (!enableDoubleTap) return;
|
|
5391
|
+
if (currentScale > initialScale) {
|
|
5392
|
+
handleReset();
|
|
5393
|
+
} else {
|
|
5394
|
+
const newScale = clamp(currentScale * 2, minScale, maxScale);
|
|
5395
|
+
setCurrentScale(newScale);
|
|
5396
|
+
Animated6.spring(scale, {
|
|
5397
|
+
toValue: newScale,
|
|
5398
|
+
useNativeDriver: true,
|
|
5399
|
+
friction: 8
|
|
5400
|
+
}).start();
|
|
5401
|
+
}
|
|
5402
|
+
}, [currentScale, initialScale, enableDoubleTap, minScale, maxScale, handleReset, scale, clamp]);
|
|
5403
|
+
const panResponder = useRef8(
|
|
5404
|
+
PanResponder2.create({
|
|
5405
|
+
onStartShouldSetPanResponder: () => enablePan,
|
|
5406
|
+
onMoveShouldSetPanResponder: () => enablePan && currentScale > 1,
|
|
5407
|
+
onPanResponderGrant: () => {
|
|
5408
|
+
lastTranslate.current = {
|
|
5409
|
+
x: 0,
|
|
5410
|
+
y: 0
|
|
5411
|
+
};
|
|
5412
|
+
},
|
|
5413
|
+
onPanResponderMove: (_event, gestureState) => {
|
|
5414
|
+
if (!enablePan || currentScale <= 1) return;
|
|
5415
|
+
const { maxX, maxY } = getBounds(currentScale);
|
|
5416
|
+
const newX = clamp(
|
|
5417
|
+
gestureState.dx,
|
|
5418
|
+
-maxX - lastTranslate.current.x,
|
|
5419
|
+
maxX - lastTranslate.current.x
|
|
5420
|
+
);
|
|
5421
|
+
const newY = clamp(
|
|
5422
|
+
gestureState.dy,
|
|
5423
|
+
-maxY - lastTranslate.current.y,
|
|
5424
|
+
maxY - lastTranslate.current.y
|
|
5425
|
+
);
|
|
5426
|
+
translateX.setValue(newX);
|
|
5427
|
+
translateY.setValue(newY);
|
|
5428
|
+
},
|
|
5429
|
+
onPanResponderRelease: (_event, gestureState) => {
|
|
5430
|
+
if (!enablePan || currentScale <= 1) return;
|
|
5431
|
+
const { maxX, maxY } = getBounds(currentScale);
|
|
5432
|
+
lastTranslate.current.x = clamp(
|
|
5433
|
+
lastTranslate.current.x + gestureState.dx,
|
|
5434
|
+
-maxX,
|
|
5435
|
+
maxX
|
|
5436
|
+
);
|
|
5437
|
+
lastTranslate.current.y = clamp(
|
|
5438
|
+
lastTranslate.current.y + gestureState.dy,
|
|
5439
|
+
-maxY,
|
|
5440
|
+
maxY
|
|
5441
|
+
);
|
|
5442
|
+
translateX.setOffset(lastTranslate.current.x);
|
|
5443
|
+
translateX.setValue(0);
|
|
5444
|
+
translateY.setOffset(lastTranslate.current.y);
|
|
5445
|
+
translateY.setValue(0);
|
|
5446
|
+
eventBus.emit(`UI:${eventPrefix}_PAN`, {
|
|
5447
|
+
entity,
|
|
5448
|
+
x: lastTranslate.current.x,
|
|
5449
|
+
y: lastTranslate.current.y,
|
|
5450
|
+
scale: currentScale
|
|
5451
|
+
});
|
|
5452
|
+
}
|
|
5453
|
+
})
|
|
5454
|
+
).current;
|
|
5455
|
+
if (isLoading) {
|
|
5456
|
+
return /* @__PURE__ */ React44.createElement(Card, { style: { ...styles38.container, width, height, ...style || {} }, padding: "lg" }, /* @__PURE__ */ React44.createElement(LoadingState, { message: "Loading diagram..." }));
|
|
5457
|
+
}
|
|
5458
|
+
if (error) {
|
|
5459
|
+
return /* @__PURE__ */ React44.createElement(Card, { style: { ...styles38.container, width, height, ...style || {} }, padding: "lg" }, /* @__PURE__ */ React44.createElement(ErrorState, { message: error.message }));
|
|
5460
|
+
}
|
|
5461
|
+
if (!children) {
|
|
5462
|
+
return /* @__PURE__ */ React44.createElement(Card, { style: { ...styles38.container, width, height, ...style || {} }, padding: "lg" }, /* @__PURE__ */ React44.createElement(EmptyState, { message: "No diagram content" }));
|
|
5463
|
+
}
|
|
5464
|
+
const animatedStyle = {
|
|
5465
|
+
transform: [
|
|
5466
|
+
{ scale },
|
|
5467
|
+
{ translateX },
|
|
5468
|
+
{ translateY }
|
|
5469
|
+
]
|
|
5470
|
+
};
|
|
5471
|
+
return /* @__PURE__ */ React44.createElement(Card, { style: { ...styles38.container, width, ...style || {} }, padding: "md" }, /* @__PURE__ */ React44.createElement(VStack, { spacing: 12 }, (title || showControls) && /* @__PURE__ */ React44.createElement(HStack, { justify: "space-between", align: "center" }, title && /* @__PURE__ */ React44.createElement(Typography, { variant: "h4", style: { color: theme.colors.foreground } }, title), showControls && /* @__PURE__ */ React44.createElement(HStack, { spacing: 8 }, /* @__PURE__ */ React44.createElement(
|
|
5472
|
+
Button,
|
|
5473
|
+
{
|
|
5474
|
+
variant: "ghost",
|
|
5475
|
+
size: "sm",
|
|
5476
|
+
onPress: handleZoomOut,
|
|
5477
|
+
disabled: !enableZoom || currentScale <= minScale
|
|
5478
|
+
},
|
|
5479
|
+
"\u2212"
|
|
5480
|
+
), /* @__PURE__ */ React44.createElement(Typography, { variant: "body", style: { minWidth: 50, textAlign: "center" } }, Math.round(currentScale * 100), "%"), /* @__PURE__ */ React44.createElement(
|
|
5481
|
+
Button,
|
|
5482
|
+
{
|
|
5483
|
+
variant: "ghost",
|
|
3972
5484
|
size: "sm",
|
|
3973
5485
|
onPress: handleZoomIn,
|
|
3974
5486
|
disabled: !enableZoom || currentScale >= maxScale
|
|
3975
5487
|
},
|
|
3976
5488
|
"+"
|
|
3977
|
-
), /* @__PURE__ */
|
|
5489
|
+
), /* @__PURE__ */ React44.createElement(
|
|
3978
5490
|
Button,
|
|
3979
5491
|
{
|
|
3980
5492
|
variant: "ghost",
|
|
@@ -3982,11 +5494,11 @@ var ScaledDiagram = ({
|
|
|
3982
5494
|
onPress: handleReset
|
|
3983
5495
|
},
|
|
3984
5496
|
"\u27F2"
|
|
3985
|
-
))), /* @__PURE__ */
|
|
3986
|
-
|
|
5497
|
+
))), /* @__PURE__ */ React44.createElement(
|
|
5498
|
+
View37,
|
|
3987
5499
|
{
|
|
3988
5500
|
style: [
|
|
3989
|
-
|
|
5501
|
+
styles38.diagramContainer,
|
|
3990
5502
|
{
|
|
3991
5503
|
width,
|
|
3992
5504
|
height,
|
|
@@ -3994,18 +5506,18 @@ var ScaledDiagram = ({
|
|
|
3994
5506
|
}
|
|
3995
5507
|
]
|
|
3996
5508
|
},
|
|
3997
|
-
/* @__PURE__ */
|
|
5509
|
+
/* @__PURE__ */ React44.createElement(
|
|
3998
5510
|
TouchableOpacity17,
|
|
3999
5511
|
{
|
|
4000
5512
|
activeOpacity: 1,
|
|
4001
5513
|
onPress: handleDoubleTap,
|
|
4002
|
-
style:
|
|
5514
|
+
style: styles38.touchable
|
|
4003
5515
|
},
|
|
4004
|
-
/* @__PURE__ */
|
|
4005
|
-
|
|
5516
|
+
/* @__PURE__ */ React44.createElement(
|
|
5517
|
+
Animated6.View,
|
|
4006
5518
|
{
|
|
4007
5519
|
style: [
|
|
4008
|
-
|
|
5520
|
+
styles38.content,
|
|
4009
5521
|
{
|
|
4010
5522
|
width: contentWidth,
|
|
4011
5523
|
height: contentHeight
|
|
@@ -4017,7 +5529,7 @@ var ScaledDiagram = ({
|
|
|
4017
5529
|
children
|
|
4018
5530
|
)
|
|
4019
5531
|
)
|
|
4020
|
-
), /* @__PURE__ */
|
|
5532
|
+
), /* @__PURE__ */ React44.createElement(
|
|
4021
5533
|
Typography,
|
|
4022
5534
|
{
|
|
4023
5535
|
variant: "caption",
|
|
@@ -4030,7 +5542,7 @@ var ScaledDiagram = ({
|
|
|
4030
5542
|
currentScale > initialScale ? "reset" : "zoom"
|
|
4031
5543
|
)));
|
|
4032
5544
|
};
|
|
4033
|
-
var
|
|
5545
|
+
var styles38 = StyleSheet38.create({
|
|
4034
5546
|
container: {
|
|
4035
5547
|
overflow: "hidden"
|
|
4036
5548
|
},
|
|
@@ -4051,6 +5563,7 @@ var styles26 = StyleSheet26.create({
|
|
|
4051
5563
|
ScaledDiagram.displayName = "ScaledDiagram";
|
|
4052
5564
|
|
|
4053
5565
|
export {
|
|
5566
|
+
List,
|
|
4054
5567
|
FormField,
|
|
4055
5568
|
FormSectionHeader,
|
|
4056
5569
|
InputGroup,
|
|
@@ -4081,6 +5594,18 @@ export {
|
|
|
4081
5594
|
ActionButtons,
|
|
4082
5595
|
DPad,
|
|
4083
5596
|
RepeatableFormSection,
|
|
5597
|
+
NumberStepper,
|
|
5598
|
+
StarRating,
|
|
5599
|
+
Accordion,
|
|
5600
|
+
DataList,
|
|
5601
|
+
DataGrid,
|
|
5602
|
+
Carousel,
|
|
5603
|
+
FlipCard,
|
|
5604
|
+
PullToRefresh,
|
|
5605
|
+
SwipeableRow,
|
|
5606
|
+
SortableList,
|
|
5607
|
+
CalendarGrid,
|
|
5608
|
+
Lightbox,
|
|
4084
5609
|
ScaledDiagram
|
|
4085
5610
|
};
|
|
4086
|
-
//# sourceMappingURL=chunk-
|
|
5611
|
+
//# sourceMappingURL=chunk-ETD72PHO.js.map
|