@umituz/react-native-design-system 1.0.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.
Files changed (80) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +157 -0
  3. package/package.json +43 -0
  4. package/src/index.ts +345 -0
  5. package/src/presentation/atoms/AtomicAvatar.tsx +157 -0
  6. package/src/presentation/atoms/AtomicAvatarGroup.tsx +169 -0
  7. package/src/presentation/atoms/AtomicBadge.tsx +232 -0
  8. package/src/presentation/atoms/AtomicButton.tsx +124 -0
  9. package/src/presentation/atoms/AtomicCard.tsx +112 -0
  10. package/src/presentation/atoms/AtomicChip.tsx +223 -0
  11. package/src/presentation/atoms/AtomicDatePicker.tsx +347 -0
  12. package/src/presentation/atoms/AtomicDivider.tsx +114 -0
  13. package/src/presentation/atoms/AtomicFab.tsx +104 -0
  14. package/src/presentation/atoms/AtomicFilter.tsx +154 -0
  15. package/src/presentation/atoms/AtomicFormError.tsx +105 -0
  16. package/src/presentation/atoms/AtomicIcon.tsx +29 -0
  17. package/src/presentation/atoms/AtomicImage.tsx +149 -0
  18. package/src/presentation/atoms/AtomicInput.tsx +232 -0
  19. package/src/presentation/atoms/AtomicNumberInput.tsx +182 -0
  20. package/src/presentation/atoms/AtomicPicker.tsx +458 -0
  21. package/src/presentation/atoms/AtomicProgress.tsx +143 -0
  22. package/src/presentation/atoms/AtomicSearchBar.tsx +114 -0
  23. package/src/presentation/atoms/AtomicSkeleton.tsx +146 -0
  24. package/src/presentation/atoms/AtomicSort.tsx +145 -0
  25. package/src/presentation/atoms/AtomicSwitch.tsx +166 -0
  26. package/src/presentation/atoms/AtomicText.tsx +50 -0
  27. package/src/presentation/atoms/AtomicTextArea.tsx +198 -0
  28. package/src/presentation/atoms/AtomicTouchable.tsx +233 -0
  29. package/src/presentation/atoms/fab/styles/fabStyles.ts +69 -0
  30. package/src/presentation/atoms/fab/types/index.ts +88 -0
  31. package/src/presentation/atoms/filter/styles/filterStyles.ts +32 -0
  32. package/src/presentation/atoms/filter/types/index.ts +89 -0
  33. package/src/presentation/atoms/index.ts +378 -0
  34. package/src/presentation/atoms/input/hooks/useInputState.ts +15 -0
  35. package/src/presentation/atoms/input/styles/inputStyles.ts +66 -0
  36. package/src/presentation/atoms/input/types/index.ts +25 -0
  37. package/src/presentation/atoms/picker/styles/pickerStyles.ts +200 -0
  38. package/src/presentation/atoms/picker/types/index.ts +40 -0
  39. package/src/presentation/atoms/touchable/styles/touchableStyles.ts +71 -0
  40. package/src/presentation/atoms/touchable/types/index.ts +162 -0
  41. package/src/presentation/hooks/useAppDesignTokens.ts +78 -0
  42. package/src/presentation/hooks/useResponsive.ts +180 -0
  43. package/src/presentation/loading/index.ts +40 -0
  44. package/src/presentation/loading/presentation/components/LoadingSpinner.tsx +116 -0
  45. package/src/presentation/loading/presentation/components/LoadingState.tsx +200 -0
  46. package/src/presentation/loading/presentation/hooks/useLoading.ts +100 -0
  47. package/src/presentation/molecules/AtomicConfirmationModal.tsx +263 -0
  48. package/src/presentation/molecules/EmptyState.tsx +130 -0
  49. package/src/presentation/molecules/FormField.tsx +128 -0
  50. package/src/presentation/molecules/GridContainer.tsx +124 -0
  51. package/src/presentation/molecules/IconContainer.tsx +94 -0
  52. package/src/presentation/molecules/LanguageSwitcher.tsx +42 -0
  53. package/src/presentation/molecules/ListItem.tsx +36 -0
  54. package/src/presentation/molecules/ScreenHeader.tsx +140 -0
  55. package/src/presentation/molecules/SearchBar.tsx +85 -0
  56. package/src/presentation/molecules/SectionCard.tsx +74 -0
  57. package/src/presentation/molecules/SectionContainer.tsx +106 -0
  58. package/src/presentation/molecules/SectionHeader.tsx +125 -0
  59. package/src/presentation/molecules/confirmation-modal/styles/confirmationModalStyles.ts +133 -0
  60. package/src/presentation/molecules/confirmation-modal/types/index.ts +107 -0
  61. package/src/presentation/molecules/index.ts +42 -0
  62. package/src/presentation/molecules/languageswitcher/config/languageSwitcherConfig.ts +5 -0
  63. package/src/presentation/molecules/languageswitcher/hooks/useLanguageNavigation.ts +15 -0
  64. package/src/presentation/molecules/listitem/styles/listItemStyles.ts +19 -0
  65. package/src/presentation/molecules/listitem/types/index.ts +17 -0
  66. package/src/presentation/organisms/AppHeader.tsx +136 -0
  67. package/src/presentation/organisms/FormContainer.tsx +180 -0
  68. package/src/presentation/organisms/ScreenLayout.tsx +209 -0
  69. package/src/presentation/organisms/index.ts +25 -0
  70. package/src/presentation/tokens/AppDesignTokens.ts +57 -0
  71. package/src/presentation/tokens/commonStyles.ts +253 -0
  72. package/src/presentation/tokens/core/BaseTokens.ts +394 -0
  73. package/src/presentation/tokens/core/ColorPalette.ts +398 -0
  74. package/src/presentation/tokens/core/TokenFactory.ts +120 -0
  75. package/src/presentation/utils/platformConstants.ts +124 -0
  76. package/src/presentation/utils/responsive.ts +516 -0
  77. package/src/presentation/utils/variants/compound.ts +29 -0
  78. package/src/presentation/utils/variants/core.ts +39 -0
  79. package/src/presentation/utils/variants/helpers.ts +13 -0
  80. package/src/presentation/utils/variants.ts +3 -0
@@ -0,0 +1,74 @@
1
+ /**
2
+ * SectionCard Molecule Component
3
+ *
4
+ * Reusable section card with title and content area.
5
+ * Used throughout settings screens for consistent grouping.
6
+ *
7
+ * Features:
8
+ * - Automatic theme-aware styling
9
+ * - Uppercase section titles with proper spacing
10
+ * - Built on AtomicCard for consistency
11
+ * - Flexible content area
12
+ *
13
+ * Atomic Design: Molecule (Card + Text)
14
+ */
15
+
16
+ import React from 'react';
17
+ import { View, StyleSheet } from 'react-native';
18
+ import { useAppDesignTokens } from '../hooks/useAppDesignTokens';
19
+ import { AtomicCard } from '../atoms/AtomicCard';
20
+ import { AtomicText } from '../atoms/AtomicText';
21
+
22
+ interface SectionCardProps {
23
+ title: string;
24
+ children: React.ReactNode;
25
+ style?: object;
26
+ contentStyle?: object;
27
+ testID?: string;
28
+ }
29
+
30
+ export const SectionCard: React.FC<SectionCardProps> = ({
31
+ title,
32
+ children,
33
+ style,
34
+ contentStyle,
35
+ testID,
36
+ }) => {
37
+ const tokens = useAppDesignTokens();
38
+ const styles = getStyles(tokens);
39
+
40
+ return (
41
+ <AtomicCard
42
+ variant="outlined"
43
+ style={StyleSheet.flatten([styles.card, style])}
44
+ testID={testID}
45
+ >
46
+ <AtomicText
47
+ type="labelLarge"
48
+ color={tokens.colors.textSecondary}
49
+ style={styles.title}
50
+ >
51
+ {title.toUpperCase()}
52
+ </AtomicText>
53
+ <View style={contentStyle}>
54
+ {children}
55
+ </View>
56
+ </AtomicCard>
57
+ );
58
+ };
59
+
60
+ const getStyles = (tokens: ReturnType<typeof useAppDesignTokens>) => StyleSheet.create({
61
+ card: {
62
+ paddingVertical: tokens.spacing.md,
63
+ paddingHorizontal: 0,
64
+ marginHorizontal: tokens.spacing.md,
65
+ marginBottom: tokens.spacing.lg,
66
+ },
67
+ title: {
68
+ fontSize: tokens.typography.labelLarge.fontSize,
69
+ fontWeight: tokens.typography.labelLarge.fontWeight,
70
+ letterSpacing: 0.5,
71
+ paddingHorizontal: tokens.spacing.md,
72
+ marginBottom: tokens.spacing.sm,
73
+ },
74
+ });
@@ -0,0 +1,106 @@
1
+ /**
2
+ * SectionContainer Molecule - Universal Section Wrapper
3
+ *
4
+ * Provides consistent section layout with optional title
5
+ * Theme: {{THEME_NAME}} ({{CATEGORY}} category)
6
+ *
7
+ * Atomic Design Level: MOLECULE
8
+ * Composition: View + AtomicText + Layout
9
+ *
10
+ * Usage:
11
+ * - Home screen sections
12
+ * - Dashboard sections
13
+ * - Settings groups
14
+ * - Content sections
15
+ */
16
+
17
+ import React from 'react';
18
+ import { View, StyleSheet, ViewStyle, TextStyle } from 'react-native';
19
+ import { AtomicText } from '../atoms/AtomicText';
20
+ import { useAppDesignTokens } from '../hooks/useAppDesignTokens';
21
+
22
+ // =============================================================================
23
+ // TYPE DEFINITIONS
24
+ // =============================================================================
25
+
26
+ export interface SectionContainerProps {
27
+ /** Section title (optional) */
28
+ title?: string;
29
+ /** Section title color (default: textPrimary) */
30
+ titleColor?: string;
31
+ /** Section title style override */
32
+ titleStyle?: TextStyle;
33
+ /** Container style override */
34
+ style?: ViewStyle;
35
+ /** Content to render inside section */
36
+ children: React.ReactNode;
37
+ /** Right action element (e.g., "See All" link) */
38
+ rightAction?: React.ReactNode;
39
+ }
40
+
41
+ // =============================================================================
42
+ // COMPONENT IMPLEMENTATION
43
+ // =============================================================================
44
+
45
+ export const SectionContainer: React.FC<SectionContainerProps> = ({
46
+ title,
47
+ titleColor,
48
+ titleStyle,
49
+ style,
50
+ children,
51
+ rightAction,
52
+ }) => {
53
+ const tokens = useAppDesignTokens();
54
+ const styles = getStyles(tokens);
55
+
56
+ return (
57
+ <View style={[styles.section, style]}>
58
+ {title && (
59
+ <View style={styles.header}>
60
+ <AtomicText
61
+ type="titleLarge"
62
+ color={titleColor || "primary"}
63
+ style={StyleSheet.flatten([
64
+ styles.sectionTitle,
65
+ titleStyle,
66
+ ])}
67
+ >
68
+ {title}
69
+ </AtomicText>
70
+ {rightAction && <View style={styles.rightAction}>{rightAction}</View>}
71
+ </View>
72
+ )}
73
+ {children}
74
+ </View>
75
+ );
76
+ };
77
+
78
+ // =============================================================================
79
+ // STYLES
80
+ // =============================================================================
81
+
82
+ const getStyles = (tokens: ReturnType<typeof useAppDesignTokens>) =>
83
+ StyleSheet.create({
84
+ section: {
85
+ marginBottom: tokens.spacing.lg,
86
+ paddingHorizontal: tokens.spacing.md,
87
+ },
88
+ header: {
89
+ flexDirection: 'row',
90
+ justifyContent: 'space-between',
91
+ alignItems: 'center',
92
+ marginBottom: tokens.spacing.md,
93
+ },
94
+ sectionTitle: {
95
+ fontSize: tokens.typography.titleLarge.fontSize,
96
+ fontWeight: tokens.typography.titleLarge.fontWeight,
97
+ },
98
+ rightAction: {
99
+ marginLeft: tokens.spacing.sm,
100
+ },
101
+ });
102
+
103
+ // =============================================================================
104
+ // EXPORTS
105
+ // =============================================================================
106
+
@@ -0,0 +1,125 @@
1
+ /**
2
+ * SectionHeader Molecule - Universal Section Header
3
+ *
4
+ * Displays section title with optional subtitle
5
+ * Theme: {{THEME_NAME}} ({{CATEGORY}} category)
6
+ *
7
+ * Atomic Design Level: MOLECULE
8
+ * Composition: AtomicText + Layout
9
+ *
10
+ * Usage:
11
+ * - List headers
12
+ * - Grid headers
13
+ * - Section dividers
14
+ * - Screen headers
15
+ */
16
+
17
+ import React from 'react';
18
+ import { View, StyleSheet, ViewStyle, TextStyle } from 'react-native';
19
+ import { AtomicText } from '../atoms/AtomicText';
20
+ import { useAppDesignTokens } from '../hooks/useAppDesignTokens';
21
+
22
+ // =============================================================================
23
+ // TYPE DEFINITIONS
24
+ // =============================================================================
25
+
26
+ export interface SectionHeaderProps {
27
+ /** Main heading text */
28
+ title: string;
29
+ /** Optional subtitle text */
30
+ subtitle?: string;
31
+ /** Custom title color (default: textPrimary) */
32
+ titleColor?: string;
33
+ /** Custom subtitle color (default: textSecondary) */
34
+ subtitleColor?: string;
35
+ /** Container style override */
36
+ style?: ViewStyle;
37
+ /** Title style override */
38
+ titleStyle?: TextStyle;
39
+ /** Subtitle style override */
40
+ subtitleStyle?: TextStyle;
41
+ /** Right action element (e.g., button, icon) */
42
+ rightAction?: React.ReactNode;
43
+ }
44
+
45
+ // =============================================================================
46
+ // COMPONENT IMPLEMENTATION
47
+ // =============================================================================
48
+
49
+ export const SectionHeader: React.FC<SectionHeaderProps> = ({
50
+ title,
51
+ subtitle,
52
+ titleColor,
53
+ subtitleColor,
54
+ style,
55
+ titleStyle,
56
+ subtitleStyle,
57
+ rightAction,
58
+ }) => {
59
+ const tokens = useAppDesignTokens();
60
+ const styles = getStyles(tokens);
61
+
62
+ return (
63
+ <View style={[styles.container, style]}>
64
+ <View style={styles.textContainer}>
65
+ <AtomicText
66
+ type="headlineLarge"
67
+ color={titleColor || "primary"}
68
+ style={StyleSheet.flatten([
69
+ styles.title,
70
+ titleStyle,
71
+ ])}
72
+ >
73
+ {title}
74
+ </AtomicText>
75
+ {subtitle && (
76
+ <AtomicText
77
+ type="bodyMedium"
78
+ color={subtitleColor || "secondary"}
79
+ style={StyleSheet.flatten([
80
+ styles.subtitle,
81
+ subtitleStyle,
82
+ ])}
83
+ >
84
+ {subtitle}
85
+ </AtomicText>
86
+ )}
87
+ </View>
88
+ {rightAction && <View style={styles.rightAction}>{rightAction}</View>}
89
+ </View>
90
+ );
91
+ };
92
+
93
+ // =============================================================================
94
+ // STYLES
95
+ // =============================================================================
96
+
97
+ const getStyles = (tokens: ReturnType<typeof useAppDesignTokens>) =>
98
+ StyleSheet.create({
99
+ container: {
100
+ flexDirection: 'row',
101
+ justifyContent: 'space-between',
102
+ alignItems: 'center',
103
+ paddingHorizontal: tokens.spacing.md,
104
+ paddingVertical: tokens.spacing.sm,
105
+ },
106
+ textContainer: {
107
+ flex: 1,
108
+ },
109
+ title: {
110
+ fontSize: tokens.typography.headlineLarge.fontSize,
111
+ fontWeight: tokens.typography.headlineLarge.fontWeight,
112
+ marginBottom: tokens.spacing.xs,
113
+ },
114
+ subtitle: {
115
+ fontSize: tokens.typography.bodyMedium.fontSize,
116
+ },
117
+ rightAction: {
118
+ marginLeft: tokens.spacing.sm,
119
+ },
120
+ });
121
+
122
+ // =============================================================================
123
+ // EXPORTS
124
+ // =============================================================================
125
+
@@ -0,0 +1,133 @@
1
+ /**
2
+ * AtomicConfirmationModal Style Utilities
3
+ *
4
+ * Styling functions for confirmation modal component
5
+ */
6
+
7
+ import { ViewStyle } from 'react-native';
8
+ import { ConfirmationModalVariant, ConfirmationModalVariantConfig } from '../types';
9
+ import type { DesignTokens } from '../../../tokens/AppDesignTokens';
10
+
11
+ /**
12
+ * Get variant configuration (icon and color only)
13
+ * Note: Confirm text is handled in component with translations
14
+ */
15
+ export const getVariantConfig = (
16
+ variant: ConfirmationModalVariant,
17
+ tokens: DesignTokens
18
+ ): Omit<ConfirmationModalVariantConfig, 'confirmText'> => {
19
+ switch (variant) {
20
+ case 'destructive':
21
+ return {
22
+ icon: 'warning',
23
+ iconColor: 'error',
24
+ };
25
+ case 'warning':
26
+ return {
27
+ icon: 'warning',
28
+ iconColor: 'warning',
29
+ };
30
+ case 'success':
31
+ return {
32
+ icon: 'check-circle',
33
+ iconColor: 'success',
34
+ };
35
+ case 'default':
36
+ default:
37
+ return {
38
+ icon: 'help-circle',
39
+ iconColor: 'primary',
40
+ };
41
+ }
42
+ };
43
+
44
+ /**
45
+ * Get modal overlay style
46
+ */
47
+ export const getModalOverlayStyle = (tokens: DesignTokens): ViewStyle => ({
48
+ flex: 1,
49
+ justifyContent: 'center',
50
+ alignItems: 'center',
51
+ backgroundColor: 'rgba(0, 0, 0, 0.5)',
52
+ });
53
+
54
+ /**
55
+ * Get backdrop style (invisible layer for dismissing)
56
+ */
57
+ export const getBackdropStyle = (): ViewStyle => ({
58
+ position: 'absolute',
59
+ top: 0,
60
+ left: 0,
61
+ right: 0,
62
+ bottom: 0,
63
+ });
64
+
65
+ /**
66
+ * Get modal container style
67
+ */
68
+ export const getModalContainerStyle = (tokens: DesignTokens): ViewStyle => ({
69
+ width: '85%',
70
+ maxWidth: 400,
71
+ backgroundColor: tokens.colors.surface,
72
+ borderRadius: 16,
73
+ padding: 24,
74
+ alignItems: 'center',
75
+ borderWidth: 1,
76
+ borderColor: tokens.colors.outline,
77
+ });
78
+
79
+ /**
80
+ * Get icon container style
81
+ */
82
+ export const getIconContainerStyle = (tokens: DesignTokens): ViewStyle => ({
83
+ marginBottom: 16,
84
+ });
85
+
86
+ /**
87
+ * Get title container style
88
+ */
89
+ export const getTitleContainerStyle = (tokens: DesignTokens): ViewStyle => ({
90
+ marginBottom: 8,
91
+ });
92
+
93
+ /**
94
+ * Get message container style
95
+ */
96
+ export const getMessageContainerStyle = (tokens: DesignTokens): ViewStyle => ({
97
+ marginBottom: 24,
98
+ });
99
+
100
+ /**
101
+ * Get button container style
102
+ */
103
+ export const getButtonContainerStyle = (tokens: DesignTokens): ViewStyle => ({
104
+ flexDirection: 'row',
105
+ gap: 12,
106
+ width: '100%',
107
+ });
108
+
109
+ /**
110
+ * Get button style
111
+ */
112
+ export const getButtonStyle = (): ViewStyle => ({
113
+ flex: 1,
114
+ });
115
+
116
+ /**
117
+ * Get confirm button variant based on modal variant
118
+ */
119
+ export const getConfirmButtonVariant = (
120
+ variant: ConfirmationModalVariant
121
+ ): 'primary' | 'secondary' | 'tertiary' | 'outline' | 'ghost' => {
122
+ switch (variant) {
123
+ case 'destructive':
124
+ return 'primary'; // Will use error color
125
+ case 'warning':
126
+ return 'primary'; // Will use warning color
127
+ case 'success':
128
+ return 'primary'; // Will use success color
129
+ case 'default':
130
+ default:
131
+ return 'primary';
132
+ }
133
+ };
@@ -0,0 +1,107 @@
1
+ /**
2
+ * AtomicConfirmationModal Type Definitions
3
+ *
4
+ * Type-safe interfaces for confirmation modal component
5
+ */
6
+
7
+ import { StyleProp, ViewStyle } from 'react-native';
8
+ import type { AtomicIconColor } from '../../../atoms/AtomicIcon';
9
+
10
+ /**
11
+ * Confirmation modal variant
12
+ * Determines the visual style and default behavior
13
+ */
14
+ export type ConfirmationModalVariant =
15
+ | 'default' // Generic confirmation (blue/primary)
16
+ | 'destructive' // Delete/remove actions (red/error)
17
+ | 'warning' // Warning/caution (orange/warning)
18
+ | 'success'; // Success confirmation (green/success)
19
+
20
+ /**
21
+ * Props for AtomicConfirmationModal component
22
+ */
23
+ export interface AtomicConfirmationModalProps {
24
+ /**
25
+ * Whether the modal is visible
26
+ */
27
+ visible: boolean;
28
+
29
+ /**
30
+ * Modal title (required)
31
+ * e.g., "Delete Item?", "Confirm Action", "Are you sure?"
32
+ */
33
+ title: string;
34
+
35
+ /**
36
+ * Modal message/description (required)
37
+ * e.g., "This action cannot be undone."
38
+ */
39
+ message: string;
40
+
41
+ /**
42
+ * Variant determines visual style
43
+ * @default 'default'
44
+ */
45
+ variant?: ConfirmationModalVariant;
46
+
47
+ /**
48
+ * Confirm button text
49
+ * @default 'Confirm' (or variant-specific default)
50
+ */
51
+ confirmText?: string;
52
+
53
+ /**
54
+ * Cancel button text
55
+ * @default 'Cancel'
56
+ */
57
+ cancelText?: string;
58
+
59
+ /**
60
+ * Icon name to display at top (MaterialIcons name)
61
+ * If not provided, uses variant-specific default icon
62
+ * @see https://fonts.google.com/icons
63
+ */
64
+ icon?: string;
65
+
66
+ /**
67
+ * Callback when user confirms
68
+ */
69
+ onConfirm: () => void;
70
+
71
+ /**
72
+ * Callback when user cancels or dismisses
73
+ */
74
+ onCancel: () => void;
75
+
76
+ /**
77
+ * Whether to show backdrop (tap outside to close)
78
+ * @default true
79
+ */
80
+ showBackdrop?: boolean;
81
+
82
+ /**
83
+ * Whether backdrop is dismissible
84
+ * @default true
85
+ */
86
+ backdropDismissible?: boolean;
87
+
88
+ /**
89
+ * Custom style for modal container
90
+ */
91
+ style?: StyleProp<ViewStyle>;
92
+
93
+ /**
94
+ * Test ID for testing
95
+ */
96
+ testID?: string;
97
+ }
98
+
99
+ /**
100
+ * Variant configuration
101
+ * Maps variant to icon, colors, and default text
102
+ */
103
+ export interface ConfirmationModalVariantConfig {
104
+ icon: string; // MaterialIcons name
105
+ confirmText: string;
106
+ iconColor: AtomicIconColor;
107
+ }
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Molecule Components Export Index
3
+ *
4
+ * Molecules are combinations of atoms that form more complex UI components
5
+ * Theme: {{THEME_NAME}} ({{CATEGORY}} category)
6
+ *
7
+ * Atomic Design Level: MOLECULES
8
+ */
9
+
10
+ // Component exports
11
+ export { FormField } from './FormField';
12
+ export { ListItem } from './ListItem';
13
+ export { SearchBar } from './SearchBar';
14
+ export { LanguageSwitcher } from './LanguageSwitcher';
15
+ export { SectionCard } from './SectionCard';
16
+ export { IconContainer } from './IconContainer';
17
+ export { ScreenHeader } from './ScreenHeader';
18
+ export { AtomicConfirmationModal, useConfirmationModal } from './AtomicConfirmationModal';
19
+
20
+ // SettingItem moved to @domains/settings/presentation/components/SettingItem
21
+ // Import directly: import { SettingItem } from '@domains/settings/presentation/components/SettingItem';
22
+
23
+ // Type exports
24
+ export type { FormFieldProps } from './FormField';
25
+ export type { ListItemProps } from './ListItem';
26
+ export type { SearchBarProps } from './SearchBar';
27
+ export type { ScreenHeaderProps } from './ScreenHeader';
28
+ export type { AtomicConfirmationModalProps, ConfirmationModalVariant } from './AtomicConfirmationModal';
29
+
30
+ // Union type for all molecule props (used for type narrowing)
31
+ import type { FormFieldProps } from './FormField';
32
+ import type { ListItemProps } from './ListItem';
33
+ import type { SearchBarProps } from './SearchBar';
34
+ import type { ScreenHeaderProps } from './ScreenHeader';
35
+ import type { AtomicConfirmationModalProps } from './AtomicConfirmationModal';
36
+
37
+ export type MoleculeComponentProps =
38
+ | FormFieldProps
39
+ | ListItemProps
40
+ | SearchBarProps
41
+ | ScreenHeaderProps
42
+ | AtomicConfirmationModalProps;
@@ -0,0 +1,5 @@
1
+ export const languageSwitcherConfig = {
2
+ defaultIconSize: 20,
3
+ defaultNavigationScreen: 'LanguageSelection',
4
+ hitSlop: { top: 10, bottom: 10, left: 10, right: 10 },
5
+ };
@@ -0,0 +1,15 @@
1
+ import { useNavigation } from '@react-navigation/native';
2
+ import { useLocalization } from '@domains/localization';
3
+ import { getLanguageByCode, getDefaultLanguage } from '@constants/languages';
4
+
5
+ export const useLanguageNavigation = (navigationScreen: string) => {
6
+ const navigation = useNavigation();
7
+ const { currentLanguage } = useLocalization();
8
+ const currentLang = getLanguageByCode(currentLanguage) || getDefaultLanguage();
9
+
10
+ const navigateToLanguageSelection = () => {
11
+ navigation.navigate(navigationScreen as never);
12
+ };
13
+
14
+ return { currentLang, navigateToLanguageSelection };
15
+ };
@@ -0,0 +1,19 @@
1
+ import { ViewStyle } from 'react-native';
2
+ import { useAppDesignTokens } from '../../../hooks/useAppDesignTokens';
3
+
4
+ type DesignTokens = ReturnType<typeof useAppDesignTokens>;
5
+
6
+ export const getListItemStyles = (tokens: DesignTokens) => ({
7
+ container: {
8
+ flexDirection: 'row' as const,
9
+ alignItems: 'center' as const,
10
+ padding: tokens.spacing.md,
11
+ backgroundColor: tokens.colors.surface,
12
+ borderRadius: tokens.borders.radius.lg,
13
+ marginBottom: tokens.spacing.sm,
14
+ } as ViewStyle,
15
+ disabled: { opacity: 0.6 } as ViewStyle,
16
+ iconContainer: { marginHorizontal: tokens.spacing.sm } as ViewStyle,
17
+ content: { flex: 1 } as ViewStyle,
18
+ subtitle: { marginTop: tokens.spacing.xs } as ViewStyle,
19
+ });
@@ -0,0 +1,17 @@
1
+ import { ViewStyle } from 'react-native';
2
+
3
+ /**
4
+ * ListItem component props
5
+ *
6
+ * leftIcon/rightIcon: Any MaterialIcons name
7
+ * @see https://fonts.google.com/icons
8
+ */
9
+ export interface ListItemProps {
10
+ title: string;
11
+ subtitle?: string;
12
+ leftIcon?: string; // MaterialIcons name
13
+ rightIcon?: string; // MaterialIcons name
14
+ onPress?: () => void;
15
+ disabled?: boolean;
16
+ style?: ViewStyle;
17
+ }