@umituz/react-native-ai-generation-content 1.17.46 → 1.17.48

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.
Files changed (25) hide show
  1. package/package.json +1 -1
  2. package/src/features/image-to-video/presentation/components/index.ts +3 -3
  3. package/src/features/text-to-image/presentation/components/index.ts +15 -29
  4. package/src/features/text-to-voice/presentation/components/index.ts +5 -5
  5. package/src/index.ts +4 -0
  6. package/src/presentation/components/PromptInput.tsx +41 -13
  7. package/src/presentation/components/buttons/GenerateButton.tsx +93 -42
  8. package/src/presentation/components/index.ts +10 -0
  9. package/src/{features/text-to-image/presentation/components → presentation/components/modals}/SettingsSheet.tsx +10 -8
  10. package/src/presentation/components/selectors/AspectRatioSelector.tsx +2 -2
  11. package/src/presentation/components/selectors/GridSelector.tsx +5 -3
  12. package/src/features/image-to-video/presentation/components/GenerateButton.tsx +0 -95
  13. package/src/features/text-to-image/presentation/components/AspectRatioSelector.tsx +0 -98
  14. package/src/features/text-to-image/presentation/components/ExamplePrompts.tsx +0 -88
  15. package/src/features/text-to-image/presentation/components/ImageSizeSelector.tsx +0 -98
  16. package/src/features/text-to-image/presentation/components/NumImagesSelector.tsx +0 -93
  17. package/src/features/text-to-image/presentation/components/OutputFormatSelector.tsx +0 -98
  18. package/src/features/text-to-image/presentation/components/StyleSelector.tsx +0 -110
  19. package/src/features/text-to-image/presentation/components/TextToImageGenerateButton.tsx +0 -84
  20. package/src/features/text-to-image/presentation/components/TextToImagePromptInput.tsx +0 -90
  21. package/src/features/text-to-voice/presentation/components/TextToVoiceErrorMessage.tsx +0 -57
  22. package/src/features/text-to-voice/presentation/components/TextToVoiceExamplePrompts.tsx +0 -77
  23. package/src/features/text-to-voice/presentation/components/TextToVoiceGenerateButton.tsx +0 -87
  24. package/src/features/text-to-voice/presentation/components/TextToVoiceOptionalInput.tsx +0 -73
  25. package/src/features/text-to-voice/presentation/components/TextToVoiceTextInput.tsx +0 -85
@@ -1,90 +0,0 @@
1
- /**
2
- * Text-to-Image Prompt Input Component
3
- * Text input for entering generation prompts
4
- */
5
-
6
- import React from "react";
7
- import { View, TextInput, StyleSheet } from "react-native";
8
- import {
9
- AtomicText,
10
- useAppDesignTokens,
11
- } from "@umituz/react-native-design-system";
12
-
13
- export interface TextToImagePromptInputProps {
14
- value: string;
15
- onChangeText: (text: string) => void;
16
- label: string;
17
- placeholder: string;
18
- characterCountLabel?: string;
19
- minHeight?: number;
20
- maxLength?: number;
21
- }
22
-
23
- export const TextToImagePromptInput: React.FC<TextToImagePromptInputProps> = ({
24
- value,
25
- onChangeText,
26
- label,
27
- placeholder,
28
- characterCountLabel,
29
- minHeight = 100,
30
- maxLength,
31
- }) => {
32
- const tokens = useAppDesignTokens();
33
-
34
- return (
35
- <View style={styles.container}>
36
- <AtomicText
37
- type="bodyMedium"
38
- style={[styles.label, { color: tokens.colors.textPrimary }]}
39
- >
40
- {label}
41
- </AtomicText>
42
- <TextInput
43
- style={[
44
- styles.input,
45
- {
46
- backgroundColor: tokens.colors.surface,
47
- color: tokens.colors.textPrimary,
48
- borderColor: tokens.colors.borderLight,
49
- minHeight,
50
- },
51
- ]}
52
- placeholder={placeholder}
53
- placeholderTextColor={tokens.colors.textSecondary}
54
- value={value}
55
- onChangeText={onChangeText}
56
- multiline
57
- numberOfLines={4}
58
- textAlignVertical="top"
59
- maxLength={maxLength}
60
- />
61
- {characterCountLabel && (
62
- <AtomicText
63
- type="labelSmall"
64
- style={[styles.charCount, { color: tokens.colors.textSecondary }]}
65
- >
66
- {characterCountLabel}
67
- </AtomicText>
68
- )}
69
- </View>
70
- );
71
- };
72
-
73
- const styles = StyleSheet.create({
74
- container: {
75
- marginBottom: 24,
76
- },
77
- label: {
78
- fontWeight: "600",
79
- marginBottom: 12,
80
- },
81
- input: {
82
- borderWidth: 1,
83
- borderRadius: 12,
84
- padding: 16,
85
- fontSize: 16,
86
- },
87
- charCount: {
88
- marginTop: 8,
89
- },
90
- });
@@ -1,57 +0,0 @@
1
- /**
2
- * TextToVoiceErrorMessage Component
3
- * Error message display
4
- */
5
-
6
- import React from "react";
7
- import { View, StyleSheet } from "react-native";
8
- import {
9
- AtomicText,
10
- AtomicIcon,
11
- useAppDesignTokens,
12
- } from "@umituz/react-native-design-system";
13
- import type { TextToVoiceErrorMessageProps } from "../../domain/types";
14
-
15
- export const TextToVoiceErrorMessage: React.FC<TextToVoiceErrorMessageProps> = ({
16
- message,
17
- style,
18
- }) => {
19
- const tokens = useAppDesignTokens();
20
-
21
- return (
22
- <View
23
- style={[
24
- styles.errorCard,
25
- {
26
- backgroundColor: `${tokens.colors.error}20`,
27
- borderColor: tokens.colors.error,
28
- },
29
- style,
30
- ]}
31
- >
32
- <AtomicIcon name="alert-circle-outline" size="sm" color="error" />
33
- <AtomicText
34
- type="bodySmall"
35
- style={[styles.errorText, { color: tokens.colors.error }]}
36
- >
37
- {message}
38
- </AtomicText>
39
- </View>
40
- );
41
- };
42
-
43
- const styles = StyleSheet.create({
44
- errorCard: {
45
- flexDirection: "row",
46
- alignItems: "center",
47
- margin: 16,
48
- marginTop: 0,
49
- padding: 12,
50
- borderRadius: 8,
51
- borderWidth: 1,
52
- },
53
- errorText: {
54
- marginLeft: 8,
55
- flex: 1,
56
- },
57
- });
@@ -1,77 +0,0 @@
1
- /**
2
- * TextToVoiceExamplePrompts Component
3
- * Horizontal scrolling example prompts
4
- */
5
-
6
- import React from "react";
7
- import { View, ScrollView, TouchableOpacity, StyleSheet } from "react-native";
8
- import { useLocalization } from "@umituz/react-native-localization";
9
- import {
10
- AtomicText,
11
- useAppDesignTokens,
12
- } from "@umituz/react-native-design-system";
13
- import type { TextToVoiceExamplePromptsProps } from "../../domain/types";
14
-
15
- export const TextToVoiceExamplePrompts: React.FC<
16
- TextToVoiceExamplePromptsProps
17
- > = ({ prompts, onSelectPrompt, labelKey, style }) => {
18
- const { t } = useLocalization();
19
- const tokens = useAppDesignTokens();
20
-
21
- if (prompts.length === 0) {
22
- return null;
23
- }
24
-
25
- return (
26
- <View style={[styles.section, style]}>
27
- <AtomicText
28
- type="bodyMedium"
29
- style={[styles.label, { color: tokens.colors.textPrimary }]}
30
- >
31
- {t(labelKey)}
32
- </AtomicText>
33
- <ScrollView
34
- horizontal
35
- showsHorizontalScrollIndicator={false}
36
- style={styles.scrollView}
37
- >
38
- {prompts.map((prompt, index) => (
39
- <TouchableOpacity
40
- key={index}
41
- style={[styles.promptCard, { backgroundColor: tokens.colors.surface }]}
42
- onPress={() => onSelectPrompt(prompt)}
43
- >
44
- <AtomicText
45
- type="bodySmall"
46
- style={{ color: tokens.colors.textPrimary }}
47
- numberOfLines={2}
48
- >
49
- {prompt}
50
- </AtomicText>
51
- </TouchableOpacity>
52
- ))}
53
- </ScrollView>
54
- </View>
55
- );
56
- };
57
-
58
- const styles = StyleSheet.create({
59
- section: {
60
- marginBottom: 24,
61
- },
62
- label: {
63
- fontWeight: "600",
64
- marginBottom: 12,
65
- },
66
- scrollView: {
67
- marginHorizontal: -16,
68
- paddingHorizontal: 16,
69
- },
70
- promptCard: {
71
- padding: 12,
72
- borderRadius: 8,
73
- marginRight: 12,
74
- minWidth: 150,
75
- maxWidth: 200,
76
- },
77
- });
@@ -1,87 +0,0 @@
1
- /**
2
- * TextToVoiceGenerateButton Component
3
- * Generate button with loading state
4
- */
5
-
6
- import React from "react";
7
- import { TouchableOpacity, ActivityIndicator, StyleSheet } from "react-native";
8
- import {
9
- AtomicText,
10
- AtomicIcon,
11
- useAppDesignTokens,
12
- } from "@umituz/react-native-design-system";
13
- import { useLocalization } from "@umituz/react-native-localization";
14
- import type { TextToVoiceGenerateButtonProps } from "../../domain/types";
15
-
16
- export const TextToVoiceGenerateButton: React.FC<
17
- TextToVoiceGenerateButtonProps
18
- > = ({
19
- isGenerating,
20
- progress,
21
- disabled,
22
- onPress,
23
- buttonTextKey,
24
- generatingTextKey,
25
- style,
26
- }) => {
27
- const { t } = useLocalization();
28
- const tokens = useAppDesignTokens();
29
-
30
- return (
31
- <TouchableOpacity
32
- style={[
33
- styles.button,
34
- {
35
- backgroundColor: tokens.colors.primary,
36
- opacity: disabled ? 0.6 : 1,
37
- },
38
- style,
39
- ]}
40
- onPress={onPress}
41
- disabled={disabled}
42
- >
43
- {isGenerating ? (
44
- <>
45
- <ActivityIndicator
46
- color={tokens.colors.onPrimary}
47
- style={styles.loader}
48
- />
49
- <AtomicText
50
- type="bodyMedium"
51
- style={[styles.buttonText, { color: tokens.colors.onPrimary }]}
52
- >
53
- {t(generatingTextKey)} {progress.toFixed(0)}%
54
- </AtomicText>
55
- </>
56
- ) : (
57
- <>
58
- <AtomicIcon name="Volume2" size="md" color="onPrimary" />
59
- <AtomicText
60
- type="bodyMedium"
61
- style={[styles.buttonText, { color: tokens.colors.onPrimary }]}
62
- >
63
- {t(buttonTextKey)}
64
- </AtomicText>
65
- </>
66
- )}
67
- </TouchableOpacity>
68
- );
69
- };
70
-
71
- const styles = StyleSheet.create({
72
- button: {
73
- flexDirection: "row",
74
- alignItems: "center",
75
- justifyContent: "center",
76
- marginHorizontal: 16,
77
- padding: 16,
78
- borderRadius: 12,
79
- },
80
- loader: {
81
- marginRight: 8,
82
- },
83
- buttonText: {
84
- fontWeight: "600",
85
- marginLeft: 8,
86
- },
87
- });
@@ -1,73 +0,0 @@
1
- /**
2
- * TextToVoiceOptionalInput Component
3
- * Optional text input with hint
4
- */
5
-
6
- import React from "react";
7
- import { View, TextInput, StyleSheet } from "react-native";
8
- import {
9
- AtomicText,
10
- useAppDesignTokens,
11
- } from "@umituz/react-native-design-system";
12
- import type { TextToVoiceOptionalInputProps } from "../../domain/types";
13
-
14
- export const TextToVoiceOptionalInput: React.FC<
15
- TextToVoiceOptionalInputProps
16
- > = ({ title, value, onChangeText, placeholder, hint, style }) => {
17
- const tokens = useAppDesignTokens();
18
-
19
- return (
20
- <View
21
- style={[styles.card, { backgroundColor: tokens.colors.surface }, style]}
22
- >
23
- <AtomicText
24
- type="bodyMedium"
25
- style={[styles.label, { color: tokens.colors.textPrimary }]}
26
- >
27
- {title}
28
- </AtomicText>
29
- <TextInput
30
- style={[
31
- styles.textInput,
32
- {
33
- backgroundColor: tokens.colors.backgroundPrimary,
34
- color: tokens.colors.textPrimary,
35
- borderColor: tokens.colors.borderLight,
36
- },
37
- ]}
38
- value={value}
39
- onChangeText={onChangeText}
40
- placeholder={placeholder}
41
- placeholderTextColor={tokens.colors.textTertiary}
42
- />
43
- <AtomicText
44
- type="bodySmall"
45
- style={[styles.hint, { color: tokens.colors.textTertiary }]}
46
- >
47
- {hint}
48
- </AtomicText>
49
- </View>
50
- );
51
- };
52
-
53
- const styles = StyleSheet.create({
54
- card: {
55
- margin: 16,
56
- marginTop: 0,
57
- padding: 16,
58
- borderRadius: 12,
59
- },
60
- label: {
61
- fontWeight: "600",
62
- marginBottom: 8,
63
- },
64
- textInput: {
65
- borderWidth: 1,
66
- borderRadius: 8,
67
- padding: 12,
68
- minHeight: 44,
69
- },
70
- hint: {
71
- marginTop: 4,
72
- },
73
- });
@@ -1,85 +0,0 @@
1
- /**
2
- * TextToVoiceTextInput Component
3
- * Text input for voice generation with character count
4
- */
5
-
6
- import React from "react";
7
- import { View, TextInput, StyleSheet } from "react-native";
8
- import {
9
- AtomicText,
10
- useAppDesignTokens,
11
- } from "@umituz/react-native-design-system";
12
- import { useLocalization } from "@umituz/react-native-localization";
13
- import type { TextToVoiceTextInputProps } from "../../domain/types";
14
-
15
- export const TextToVoiceTextInput: React.FC<TextToVoiceTextInputProps> = ({
16
- value,
17
- onChangeText,
18
- maxLength = 5000,
19
- labelKey,
20
- placeholderKey,
21
- characterCountKey,
22
- style,
23
- }) => {
24
- const { t } = useLocalization();
25
- const tokens = useAppDesignTokens();
26
-
27
- return (
28
- <View
29
- style={[styles.card, { backgroundColor: tokens.colors.surface }, style]}
30
- >
31
- <AtomicText
32
- type="bodyMedium"
33
- style={[styles.label, { color: tokens.colors.textPrimary }]}
34
- >
35
- {t(labelKey)}
36
- </AtomicText>
37
- <TextInput
38
- style={[
39
- styles.textInput,
40
- {
41
- backgroundColor: tokens.colors.backgroundPrimary,
42
- color: tokens.colors.textPrimary,
43
- borderColor: tokens.colors.borderLight,
44
- },
45
- ]}
46
- value={value}
47
- onChangeText={onChangeText}
48
- placeholder={t(placeholderKey)}
49
- placeholderTextColor={tokens.colors.textTertiary}
50
- multiline
51
- numberOfLines={6}
52
- maxLength={maxLength}
53
- />
54
- <AtomicText
55
- type="bodySmall"
56
- style={[styles.characterCount, { color: tokens.colors.textTertiary }]}
57
- >
58
- {t(characterCountKey, { count: value.length, max: maxLength })}
59
- </AtomicText>
60
- </View>
61
- );
62
- };
63
-
64
- const styles = StyleSheet.create({
65
- card: {
66
- margin: 16,
67
- marginTop: 0,
68
- padding: 16,
69
- borderRadius: 12,
70
- },
71
- label: {
72
- fontWeight: "600",
73
- marginBottom: 8,
74
- },
75
- textInput: {
76
- borderWidth: 1,
77
- borderRadius: 8,
78
- padding: 12,
79
- minHeight: 120,
80
- textAlignVertical: "top",
81
- },
82
- characterCount: {
83
- marginTop: 4,
84
- },
85
- });