@umituz/react-native-ai-generation-content 1.6.0 → 1.7.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-ai-generation-content",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "description": "Provider-agnostic AI generation orchestration for React Native",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -4,7 +4,13 @@
4
4
  */
5
5
 
6
6
  import React from "react";
7
- import { Modal, View, Text, StyleSheet } from "react-native";
7
+ import {
8
+ Modal,
9
+ View,
10
+ Text,
11
+ TouchableOpacity,
12
+ StyleSheet,
13
+ } from "react-native";
8
14
 
9
15
  export interface GenerationProgressModalProps {
10
16
  visible: boolean;
@@ -12,11 +18,14 @@ export interface GenerationProgressModalProps {
12
18
  title?: string;
13
19
  message?: string;
14
20
  hint?: string;
21
+ dismissLabel?: string;
22
+ onDismiss?: () => void;
15
23
  overlayColor?: string;
16
24
  modalBackgroundColor?: string;
17
25
  textColor?: string;
18
26
  progressColor?: string;
19
27
  progressBackgroundColor?: string;
28
+ dismissButtonColor?: string;
20
29
  renderContent?: (props: GenerationProgressRenderProps) => React.ReactNode;
21
30
  }
22
31
 
@@ -25,6 +34,7 @@ export interface GenerationProgressRenderProps {
25
34
  title?: string;
26
35
  message?: string;
27
36
  hint?: string;
37
+ onDismiss?: () => void;
28
38
  }
29
39
 
30
40
  export const GenerationProgressModal: React.FC<
@@ -35,11 +45,14 @@ export const GenerationProgressModal: React.FC<
35
45
  title,
36
46
  message,
37
47
  hint,
48
+ dismissLabel = "Got it",
49
+ onDismiss,
38
50
  overlayColor = "rgba(0, 0, 0, 0.7)",
39
51
  modalBackgroundColor = "#1C1C1E",
40
52
  textColor = "#FFFFFF",
41
53
  progressColor = "#007AFF",
42
54
  progressBackgroundColor = "#3A3A3C",
55
+ dismissButtonColor = "#007AFF",
43
56
  renderContent,
44
57
  }) => {
45
58
  const clampedProgress = Math.max(0, Math.min(100, progress));
@@ -53,7 +66,13 @@ export const GenerationProgressModal: React.FC<
53
66
  statusBarTranslucent
54
67
  >
55
68
  <View style={[styles.overlay, { backgroundColor: overlayColor }]}>
56
- {renderContent({ progress: clampedProgress, title, message, hint })}
69
+ {renderContent({
70
+ progress: clampedProgress,
71
+ title,
72
+ message,
73
+ hint,
74
+ onDismiss,
75
+ })}
57
76
  </View>
58
77
  </Modal>
59
78
  );
@@ -105,6 +124,18 @@ export const GenerationProgressModal: React.FC<
105
124
  {hint && (
106
125
  <Text style={[styles.hint, { color: textColor }]}>{hint}</Text>
107
126
  )}
127
+
128
+ {onDismiss && (
129
+ <TouchableOpacity
130
+ style={[
131
+ styles.dismissButton,
132
+ { backgroundColor: dismissButtonColor },
133
+ ]}
134
+ onPress={onDismiss}
135
+ >
136
+ <Text style={styles.dismissText}>{dismissLabel}</Text>
137
+ </TouchableOpacity>
138
+ )}
108
139
  </View>
109
140
  </View>
110
141
  </Modal>
@@ -162,5 +193,19 @@ const styles = StyleSheet.create({
162
193
  textAlign: "center",
163
194
  fontStyle: "italic",
164
195
  opacity: 0.6,
196
+ marginBottom: 16,
197
+ },
198
+ dismissButton: {
199
+ marginTop: 8,
200
+ paddingVertical: 14,
201
+ paddingHorizontal: 32,
202
+ borderRadius: 12,
203
+ minWidth: 140,
204
+ alignItems: "center",
205
+ },
206
+ dismissText: {
207
+ color: "#FFFFFF",
208
+ fontSize: 16,
209
+ fontWeight: "600",
165
210
  },
166
211
  });