@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,98 +0,0 @@
1
- /**
2
- * Aspect Ratio Selector Component
3
- * Button group for selecting image aspect ratio
4
- */
5
-
6
- import React from "react";
7
- import { View, TouchableOpacity, StyleSheet } from "react-native";
8
- import {
9
- AtomicText,
10
- useAppDesignTokens,
11
- } from "@umituz/react-native-design-system";
12
- import type { AspectRatio } from "../../domain/types/form.types";
13
-
14
- export interface AspectRatioOption {
15
- value: AspectRatio;
16
- label: string;
17
- }
18
-
19
- export interface AspectRatioSelectorProps {
20
- value: AspectRatio;
21
- onChange: (ratio: AspectRatio) => void;
22
- options: AspectRatioOption[];
23
- label: string;
24
- }
25
-
26
- export const AspectRatioSelector: React.FC<AspectRatioSelectorProps> = ({
27
- value,
28
- onChange,
29
- options,
30
- label,
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
- <View style={styles.optionsRow}>
43
- {options.map((option) => {
44
- const isSelected = value === option.value;
45
- return (
46
- <TouchableOpacity
47
- key={option.value}
48
- style={[
49
- styles.option,
50
- {
51
- backgroundColor: isSelected
52
- ? tokens.colors.primary
53
- : tokens.colors.surface,
54
- borderColor: isSelected
55
- ? tokens.colors.primary
56
- : tokens.colors.borderLight,
57
- },
58
- ]}
59
- onPress={() => onChange(option.value)}
60
- activeOpacity={0.7}
61
- >
62
- <AtomicText
63
- type="bodySmall"
64
- style={{
65
- color: isSelected ? "#FFFFFF" : tokens.colors.textPrimary,
66
- fontWeight: isSelected ? "600" : "400",
67
- }}
68
- >
69
- {option.label}
70
- </AtomicText>
71
- </TouchableOpacity>
72
- );
73
- })}
74
- </View>
75
- </View>
76
- );
77
- };
78
-
79
- const styles = StyleSheet.create({
80
- container: {
81
- marginBottom: 20,
82
- },
83
- label: {
84
- fontWeight: "600",
85
- marginBottom: 12,
86
- },
87
- optionsRow: {
88
- flexDirection: "row",
89
- gap: 8,
90
- },
91
- option: {
92
- flex: 1,
93
- padding: 12,
94
- borderRadius: 8,
95
- borderWidth: 1,
96
- alignItems: "center",
97
- },
98
- });
@@ -1,88 +0,0 @@
1
- /**
2
- * Example Prompts Component
3
- * Horizontal scrollable list of example prompts
4
- */
5
-
6
- import React from "react";
7
- import { View, ScrollView, TouchableOpacity, StyleSheet } from "react-native";
8
- import {
9
- AtomicText,
10
- useAppDesignTokens,
11
- } from "@umituz/react-native-design-system";
12
-
13
- export interface ExamplePromptsProps {
14
- prompts: string[];
15
- onSelectPrompt: (prompt: string) => void;
16
- label: string;
17
- cardWidth?: number;
18
- }
19
-
20
- export const ExamplePrompts: React.FC<ExamplePromptsProps> = ({
21
- prompts,
22
- onSelectPrompt,
23
- label,
24
- cardWidth = 180,
25
- }) => {
26
- const tokens = useAppDesignTokens();
27
-
28
- if (prompts.length === 0) {
29
- return null;
30
- }
31
-
32
- return (
33
- <View style={styles.container}>
34
- <AtomicText
35
- type="bodyMedium"
36
- style={[styles.label, { color: tokens.colors.textPrimary }]}
37
- >
38
- {label}
39
- </AtomicText>
40
- <ScrollView
41
- horizontal
42
- showsHorizontalScrollIndicator={false}
43
- contentContainerStyle={styles.scrollContent}
44
- >
45
- {prompts.map((prompt, index) => (
46
- <TouchableOpacity
47
- key={`prompt-${index}`}
48
- style={[
49
- styles.card,
50
- {
51
- backgroundColor: tokens.colors.surface,
52
- width: cardWidth,
53
- },
54
- ]}
55
- onPress={() => onSelectPrompt(prompt)}
56
- activeOpacity={0.7}
57
- >
58
- <AtomicText
59
- type="bodySmall"
60
- style={{ color: tokens.colors.textPrimary }}
61
- numberOfLines={2}
62
- >
63
- {prompt}
64
- </AtomicText>
65
- </TouchableOpacity>
66
- ))}
67
- </ScrollView>
68
- </View>
69
- );
70
- };
71
-
72
- const styles = StyleSheet.create({
73
- container: {
74
- marginBottom: 24,
75
- },
76
- label: {
77
- fontWeight: "600",
78
- marginBottom: 12,
79
- },
80
- scrollContent: {
81
- paddingRight: 16,
82
- },
83
- card: {
84
- padding: 12,
85
- borderRadius: 8,
86
- marginRight: 12,
87
- },
88
- });
@@ -1,98 +0,0 @@
1
- /**
2
- * Image Size Selector Component
3
- * Selection for image output size
4
- */
5
-
6
- import React from "react";
7
- import { View, TouchableOpacity, StyleSheet } from "react-native";
8
- import {
9
- AtomicText,
10
- useAppDesignTokens,
11
- } from "@umituz/react-native-design-system";
12
- import type { ImageSize } from "../../domain/types/form.types";
13
-
14
- export interface ImageSizeOption {
15
- value: ImageSize;
16
- label: string;
17
- }
18
-
19
- export interface ImageSizeSelectorProps {
20
- value: ImageSize;
21
- onChange: (size: ImageSize) => void;
22
- options: ImageSizeOption[];
23
- label: string;
24
- }
25
-
26
- export const ImageSizeSelector: React.FC<ImageSizeSelectorProps> = ({
27
- value,
28
- onChange,
29
- options,
30
- label,
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
- <View style={styles.optionsGrid}>
43
- {options.map((option) => {
44
- const isSelected = value === option.value;
45
- return (
46
- <TouchableOpacity
47
- key={option.value}
48
- style={[
49
- styles.option,
50
- {
51
- backgroundColor: isSelected
52
- ? tokens.colors.primary
53
- : tokens.colors.surface,
54
- borderColor: isSelected
55
- ? tokens.colors.primary
56
- : tokens.colors.borderLight,
57
- },
58
- ]}
59
- onPress={() => onChange(option.value)}
60
- activeOpacity={0.7}
61
- >
62
- <AtomicText
63
- type="bodySmall"
64
- style={{
65
- color: isSelected ? "#FFFFFF" : tokens.colors.textPrimary,
66
- fontWeight: isSelected ? "600" : "400",
67
- }}
68
- >
69
- {option.label}
70
- </AtomicText>
71
- </TouchableOpacity>
72
- );
73
- })}
74
- </View>
75
- </View>
76
- );
77
- };
78
-
79
- const styles = StyleSheet.create({
80
- container: {
81
- marginBottom: 20,
82
- },
83
- label: {
84
- fontWeight: "600",
85
- marginBottom: 12,
86
- },
87
- optionsGrid: {
88
- flexDirection: "row",
89
- flexWrap: "wrap",
90
- gap: 8,
91
- },
92
- option: {
93
- paddingHorizontal: 16,
94
- paddingVertical: 10,
95
- borderRadius: 8,
96
- borderWidth: 1,
97
- },
98
- });
@@ -1,93 +0,0 @@
1
- /**
2
- * Number of Images Selector Component
3
- * Grid of buttons to select number of images to generate
4
- */
5
-
6
- import React from "react";
7
- import { View, TouchableOpacity, StyleSheet } from "react-native";
8
- import {
9
- AtomicText,
10
- useAppDesignTokens,
11
- } from "@umituz/react-native-design-system";
12
- import type { NumImages } from "../../domain/types/form.types";
13
-
14
- export interface NumImagesSelectorProps {
15
- value: NumImages;
16
- onChange: (num: NumImages) => void;
17
- options: NumImages[];
18
- label: string;
19
- }
20
-
21
- export const NumImagesSelector: React.FC<NumImagesSelectorProps> = ({
22
- value,
23
- onChange,
24
- options,
25
- label,
26
- }) => {
27
- const tokens = useAppDesignTokens();
28
-
29
- return (
30
- <View style={styles.container}>
31
- <AtomicText
32
- type="bodyMedium"
33
- style={[styles.label, { color: tokens.colors.textPrimary }]}
34
- >
35
- {label}
36
- </AtomicText>
37
- <View style={styles.grid}>
38
- {options.map((num) => {
39
- const isSelected = value === num;
40
- return (
41
- <TouchableOpacity
42
- key={num}
43
- style={[
44
- styles.button,
45
- {
46
- backgroundColor: isSelected
47
- ? tokens.colors.primary
48
- : tokens.colors.surface,
49
- borderColor: isSelected
50
- ? tokens.colors.primary
51
- : tokens.colors.borderLight,
52
- },
53
- ]}
54
- onPress={() => onChange(num)}
55
- activeOpacity={0.7}
56
- >
57
- <AtomicText
58
- type="bodyLarge"
59
- style={{
60
- color: isSelected ? "#FFFFFF" : tokens.colors.textPrimary,
61
- fontWeight: isSelected ? "700" : "400",
62
- }}
63
- >
64
- {num}
65
- </AtomicText>
66
- </TouchableOpacity>
67
- );
68
- })}
69
- </View>
70
- </View>
71
- );
72
- };
73
-
74
- const styles = StyleSheet.create({
75
- container: {
76
- marginBottom: 24,
77
- },
78
- label: {
79
- fontWeight: "600",
80
- marginBottom: 12,
81
- },
82
- grid: {
83
- flexDirection: "row",
84
- gap: 12,
85
- },
86
- button: {
87
- flex: 1,
88
- padding: 16,
89
- borderRadius: 12,
90
- borderWidth: 2,
91
- alignItems: "center",
92
- },
93
- });
@@ -1,98 +0,0 @@
1
- /**
2
- * Output Format Selector Component
3
- * Selection for image output format
4
- */
5
-
6
- import React from "react";
7
- import { View, TouchableOpacity, StyleSheet } from "react-native";
8
- import {
9
- AtomicText,
10
- useAppDesignTokens,
11
- } from "@umituz/react-native-design-system";
12
- import type { OutputFormat } from "../../domain/types/form.types";
13
-
14
- export interface OutputFormatOption {
15
- value: OutputFormat;
16
- label: string;
17
- }
18
-
19
- export interface OutputFormatSelectorProps {
20
- value: OutputFormat;
21
- onChange: (format: OutputFormat) => void;
22
- options: OutputFormatOption[];
23
- label: string;
24
- }
25
-
26
- export const OutputFormatSelector: React.FC<OutputFormatSelectorProps> = ({
27
- value,
28
- onChange,
29
- options,
30
- label,
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
- <View style={styles.optionsRow}>
43
- {options.map((option) => {
44
- const isSelected = value === option.value;
45
- return (
46
- <TouchableOpacity
47
- key={option.value}
48
- style={[
49
- styles.option,
50
- {
51
- backgroundColor: isSelected
52
- ? tokens.colors.primary
53
- : tokens.colors.surface,
54
- borderColor: isSelected
55
- ? tokens.colors.primary
56
- : tokens.colors.borderLight,
57
- },
58
- ]}
59
- onPress={() => onChange(option.value)}
60
- activeOpacity={0.7}
61
- >
62
- <AtomicText
63
- type="bodyMedium"
64
- style={{
65
- color: isSelected ? "#FFFFFF" : tokens.colors.textPrimary,
66
- fontWeight: isSelected ? "600" : "400",
67
- }}
68
- >
69
- {option.label}
70
- </AtomicText>
71
- </TouchableOpacity>
72
- );
73
- })}
74
- </View>
75
- </View>
76
- );
77
- };
78
-
79
- const styles = StyleSheet.create({
80
- container: {
81
- marginBottom: 20,
82
- },
83
- label: {
84
- fontWeight: "600",
85
- marginBottom: 12,
86
- },
87
- optionsRow: {
88
- flexDirection: "row",
89
- gap: 12,
90
- },
91
- option: {
92
- flex: 1,
93
- padding: 14,
94
- borderRadius: 8,
95
- borderWidth: 1,
96
- alignItems: "center",
97
- },
98
- });
@@ -1,110 +0,0 @@
1
- /**
2
- * Style Selector Component
3
- * Horizontal scrollable list of style options
4
- */
5
-
6
- import React from "react";
7
- import { View, ScrollView, TouchableOpacity, StyleSheet } from "react-native";
8
- import {
9
- AtomicText,
10
- useAppDesignTokens,
11
- } from "@umituz/react-native-design-system";
12
- import type { StyleOption } from "../../domain/types/form.types";
13
-
14
- export interface StyleSelectorProps {
15
- options: StyleOption[];
16
- value: string;
17
- onChange: (styleId: string) => void;
18
- label: string;
19
- }
20
-
21
- export const StyleSelector: React.FC<StyleSelectorProps> = ({
22
- options,
23
- value,
24
- onChange,
25
- label,
26
- }) => {
27
- const tokens = useAppDesignTokens();
28
-
29
- return (
30
- <View style={styles.container}>
31
- <AtomicText
32
- type="bodyMedium"
33
- style={[styles.label, { color: tokens.colors.textPrimary }]}
34
- >
35
- {label}
36
- </AtomicText>
37
- <ScrollView
38
- horizontal
39
- showsHorizontalScrollIndicator={false}
40
- contentContainerStyle={styles.scrollContent}
41
- >
42
- {options.map((style) => {
43
- const isSelected = value === style.id;
44
- return (
45
- <TouchableOpacity
46
- key={style.id}
47
- style={[
48
- styles.card,
49
- {
50
- backgroundColor: isSelected
51
- ? tokens.colors.primary
52
- : tokens.colors.surface,
53
- borderColor: isSelected
54
- ? tokens.colors.primary
55
- : tokens.colors.borderLight,
56
- },
57
- ]}
58
- onPress={() => onChange(style.id)}
59
- activeOpacity={0.7}
60
- >
61
- <AtomicText
62
- type="bodyMedium"
63
- style={{
64
- color: isSelected ? "#FFFFFF" : tokens.colors.textPrimary,
65
- fontWeight: isSelected ? "600" : "400",
66
- }}
67
- >
68
- {style.name}
69
- </AtomicText>
70
- {style.description && (
71
- <AtomicText
72
- type="labelSmall"
73
- style={{
74
- color: isSelected
75
- ? "rgba(255,255,255,0.8)"
76
- : tokens.colors.textSecondary,
77
- marginTop: 4,
78
- }}
79
- numberOfLines={1}
80
- >
81
- {style.description}
82
- </AtomicText>
83
- )}
84
- </TouchableOpacity>
85
- );
86
- })}
87
- </ScrollView>
88
- </View>
89
- );
90
- };
91
-
92
- const styles = StyleSheet.create({
93
- container: {
94
- marginBottom: 24,
95
- },
96
- label: {
97
- fontWeight: "600",
98
- marginBottom: 12,
99
- },
100
- scrollContent: {
101
- paddingRight: 16,
102
- },
103
- card: {
104
- padding: 12,
105
- borderRadius: 12,
106
- borderWidth: 2,
107
- marginRight: 12,
108
- minWidth: 100,
109
- },
110
- });
@@ -1,84 +0,0 @@
1
- /**
2
- * Text-to-Image Generate Button Component
3
- * Button to trigger image generation with cost display
4
- */
5
-
6
- import React from "react";
7
- import { View, StyleSheet } from "react-native";
8
- import {
9
- AtomicText,
10
- AtomicButton,
11
- AtomicIcon,
12
- } from "@umituz/react-native-design-system";
13
-
14
- export interface TextToImageGenerateButtonProps {
15
- onPress: () => void;
16
- onSettingsPress?: () => void;
17
- disabled: boolean;
18
- label: string;
19
- costLabel?: string;
20
- showSettings?: boolean;
21
- }
22
-
23
- export const TextToImageGenerateButton: React.FC<TextToImageGenerateButtonProps> = ({
24
- onPress,
25
- onSettingsPress,
26
- disabled,
27
- label,
28
- costLabel,
29
- showSettings = true,
30
- }) => {
31
-
32
- return (
33
- <View style={styles.container}>
34
- <View style={styles.buttonRow}>
35
- <AtomicButton
36
- onPress={onPress}
37
- disabled={disabled}
38
- variant="primary"
39
- size="md"
40
- style={styles.generateButton}
41
- >
42
- <AtomicText type="bodyLarge" style={styles.buttonText}>
43
- {label}
44
- {costLabel && ` (${costLabel})`}
45
- </AtomicText>
46
- </AtomicButton>
47
-
48
- {showSettings && onSettingsPress && (
49
- <AtomicButton
50
- onPress={onSettingsPress}
51
- variant="secondary"
52
- size="md"
53
- style={styles.settingsButton}
54
- >
55
- <AtomicIcon name="settings-outline" size="md" color="primary" />
56
- </AtomicButton>
57
- )}
58
- </View>
59
- </View>
60
- );
61
- };
62
-
63
- const styles = StyleSheet.create({
64
- container: {
65
- marginBottom: 24,
66
- },
67
- buttonRow: {
68
- flexDirection: "row",
69
- gap: 12,
70
- },
71
- generateButton: {
72
- flex: 1,
73
- paddingVertical: 16,
74
- },
75
- buttonText: {
76
- color: "#FFFFFF",
77
- fontWeight: "600",
78
- },
79
- settingsButton: {
80
- width: 56,
81
- justifyContent: "center",
82
- alignItems: "center",
83
- },
84
- });