@umituz/react-native-design-system 1.4.2 → 1.5.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/README.md +0 -1
- package/lib/index.d.ts +0 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -6
- package/lib/index.js.map +1 -1
- package/lib/presentation/atoms/AtomicButton.d.ts +0 -1
- package/lib/presentation/atoms/AtomicButton.d.ts.map +1 -1
- package/lib/presentation/atoms/AtomicButton.js +6 -9
- package/lib/presentation/atoms/AtomicButton.js.map +1 -1
- package/lib/presentation/atoms/AtomicFab.d.ts +0 -1
- package/lib/presentation/atoms/AtomicFab.d.ts.map +1 -1
- package/lib/presentation/atoms/AtomicFab.js +4 -5
- package/lib/presentation/atoms/AtomicFab.js.map +1 -1
- package/lib/presentation/atoms/AtomicProgress.d.ts +0 -3
- package/lib/presentation/atoms/AtomicProgress.d.ts.map +1 -1
- package/lib/presentation/atoms/AtomicProgress.js +1 -2
- package/lib/presentation/atoms/AtomicProgress.js.map +1 -1
- package/lib/presentation/atoms/AtomicTouchable.d.ts +1 -11
- package/lib/presentation/atoms/AtomicTouchable.d.ts.map +1 -1
- package/lib/presentation/atoms/AtomicTouchable.js +6 -19
- package/lib/presentation/atoms/AtomicTouchable.js.map +1 -1
- package/lib/presentation/atoms/fab/types/index.d.ts +0 -5
- package/lib/presentation/atoms/fab/types/index.d.ts.map +1 -1
- package/lib/presentation/atoms/index.d.ts +1 -4
- package/lib/presentation/atoms/index.d.ts.map +1 -1
- package/lib/presentation/atoms/index.js +0 -3
- package/lib/presentation/atoms/index.js.map +1 -1
- package/lib/presentation/atoms/touchable/styles/touchableStyles.d.ts +0 -5
- package/lib/presentation/atoms/touchable/styles/touchableStyles.d.ts.map +1 -1
- package/lib/presentation/atoms/touchable/styles/touchableStyles.js +0 -8
- package/lib/presentation/atoms/touchable/styles/touchableStyles.js.map +1 -1
- package/lib/presentation/atoms/touchable/types/index.d.ts +1 -7
- package/lib/presentation/atoms/touchable/types/index.d.ts.map +1 -1
- package/lib/presentation/molecules/AtomicConfirmationModal.d.ts +2 -2
- package/lib/presentation/molecules/AtomicConfirmationModal.d.ts.map +1 -1
- package/lib/presentation/molecules/AtomicConfirmationModal.js +2 -21
- package/lib/presentation/molecules/AtomicConfirmationModal.js.map +1 -1
- package/lib/presentation/molecules/confirmation-modal/types/index.d.ts +4 -6
- package/lib/presentation/molecules/confirmation-modal/types/index.d.ts.map +1 -1
- package/lib/presentation/molecules/index.d.ts +0 -1
- package/lib/presentation/molecules/index.d.ts.map +1 -1
- package/lib/presentation/molecules/index.js +0 -1
- package/lib/presentation/molecules/index.js.map +1 -1
- package/lib/presentation/tokens/commonStyles.d.ts +1 -1
- package/lib/presentation/tokens/commonStyles.js +1 -1
- package/lib/presentation/tokens/core/BaseTokens.d.ts.map +1 -1
- package/lib/presentation/tokens/core/BaseTokens.js +0 -3
- package/lib/presentation/tokens/core/BaseTokens.js.map +1 -1
- package/package.json +2 -6
- package/src/index.ts +1 -10
- package/src/presentation/atoms/AtomicButton.tsx +5 -16
- package/src/presentation/atoms/AtomicFab.tsx +3 -9
- package/src/presentation/atoms/AtomicProgress.tsx +0 -4
- package/src/presentation/atoms/AtomicTouchable.tsx +3 -27
- package/src/presentation/atoms/fab/types/index.ts +0 -6
- package/src/presentation/atoms/index.ts +0 -12
- package/src/presentation/atoms/touchable/styles/touchableStyles.ts +0 -9
- package/src/presentation/atoms/touchable/types/index.ts +1 -8
- package/src/presentation/molecules/AtomicConfirmationModal.tsx +4 -25
- package/src/presentation/molecules/confirmation-modal/types/index.ts +4 -6
- package/src/presentation/molecules/index.ts +0 -1
- package/src/presentation/tokens/commonStyles.ts +1 -1
- package/src/presentation/tokens/core/BaseTokens.ts +0 -4
- package/lib/presentation/atoms/AtomicSkeleton.d.ts +0 -37
- package/lib/presentation/atoms/AtomicSkeleton.d.ts.map +0 -1
- package/lib/presentation/atoms/AtomicSkeleton.js +0 -53
- package/lib/presentation/atoms/AtomicSkeleton.js.map +0 -1
- package/lib/presentation/molecules/LanguageSwitcher.d.ts +0 -10
- package/lib/presentation/molecules/LanguageSwitcher.d.ts.map +0 -1
- package/lib/presentation/molecules/LanguageSwitcher.js +0 -24
- package/lib/presentation/molecules/LanguageSwitcher.js.map +0 -1
- package/lib/presentation/molecules/languageswitcher/config/languageSwitcherConfig.d.ts +0 -11
- package/lib/presentation/molecules/languageswitcher/config/languageSwitcherConfig.d.ts.map +0 -1
- package/lib/presentation/molecules/languageswitcher/config/languageSwitcherConfig.js +0 -6
- package/lib/presentation/molecules/languageswitcher/config/languageSwitcherConfig.js.map +0 -1
- package/lib/presentation/molecules/languageswitcher/hooks/useLanguageNavigation.d.ts +0 -5
- package/lib/presentation/molecules/languageswitcher/hooks/useLanguageNavigation.d.ts.map +0 -1
- package/lib/presentation/molecules/languageswitcher/hooks/useLanguageNavigation.js +0 -14
- package/lib/presentation/molecules/languageswitcher/hooks/useLanguageNavigation.js.map +0 -1
- package/src/presentation/atoms/AtomicSkeleton.tsx +0 -95
- package/src/presentation/molecules/LanguageSwitcher.tsx +0 -42
- package/src/presentation/molecules/languageswitcher/config/languageSwitcherConfig.ts +0 -5
- package/src/presentation/molecules/languageswitcher/hooks/useLanguageNavigation.ts +0 -16
|
@@ -40,8 +40,6 @@
|
|
|
40
40
|
import React from 'react';
|
|
41
41
|
import { View, Modal, TouchableOpacity } from 'react-native';
|
|
42
42
|
import { useAppDesignTokens } from '../hooks/useAppDesignTokens';
|
|
43
|
-
// @ts-ignore - Optional peer dependency
|
|
44
|
-
import { useLocalization } from '@umituz/react-native-localization';
|
|
45
43
|
import { AtomicText } from '../atoms/AtomicText';
|
|
46
44
|
import { AtomicButton } from '../atoms/AtomicButton';
|
|
47
45
|
import { AtomicIcon } from '../atoms/AtomicIcon';
|
|
@@ -80,29 +78,10 @@ export const AtomicConfirmationModal: React.FC<AtomicConfirmationModalProps> = (
|
|
|
80
78
|
testID = 'atomic-confirmation-modal',
|
|
81
79
|
}) => {
|
|
82
80
|
const tokens = useAppDesignTokens();
|
|
83
|
-
const { t } = useLocalization();
|
|
84
81
|
|
|
85
82
|
// Get variant-specific configuration (icon and color only)
|
|
86
83
|
const variantConfig = getVariantConfig(variant as 'default' | 'destructive' | 'warning' | 'success', tokens);
|
|
87
84
|
|
|
88
|
-
// Get locale-aware default text based on variant
|
|
89
|
-
const getDefaultConfirmText = (): string => {
|
|
90
|
-
switch (variant) {
|
|
91
|
-
case 'destructive':
|
|
92
|
-
return t('general.delete');
|
|
93
|
-
case 'warning':
|
|
94
|
-
return t('general.continue');
|
|
95
|
-
case 'success':
|
|
96
|
-
case 'default':
|
|
97
|
-
default:
|
|
98
|
-
return t('general.confirm');
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
// Determine final text values
|
|
103
|
-
const finalConfirmText = confirmText || getDefaultConfirmText();
|
|
104
|
-
const finalCancelText = cancelText || t('general.cancel');
|
|
105
|
-
|
|
106
85
|
// Determine final icon
|
|
107
86
|
const finalIcon = icon || variantConfig.icon;
|
|
108
87
|
|
|
@@ -185,7 +164,7 @@ export const AtomicConfirmationModal: React.FC<AtomicConfirmationModalProps> = (
|
|
|
185
164
|
style={getButtonStyle()}
|
|
186
165
|
testID={`${testID}-cancel-button`}
|
|
187
166
|
>
|
|
188
|
-
{
|
|
167
|
+
{cancelText}
|
|
189
168
|
</AtomicButton>
|
|
190
169
|
|
|
191
170
|
{/* Confirm Button */}
|
|
@@ -201,7 +180,7 @@ export const AtomicConfirmationModal: React.FC<AtomicConfirmationModalProps> = (
|
|
|
201
180
|
]}
|
|
202
181
|
testID={`${testID}-confirm-button`}
|
|
203
182
|
>
|
|
204
|
-
{
|
|
183
|
+
{confirmText}
|
|
205
184
|
</AtomicButton>
|
|
206
185
|
</View>
|
|
207
186
|
</View>
|
|
@@ -231,8 +210,8 @@ export const useConfirmationModal = (config: {
|
|
|
231
210
|
title: string;
|
|
232
211
|
message: string;
|
|
233
212
|
variant?: ConfirmationModalVariant;
|
|
234
|
-
confirmText
|
|
235
|
-
cancelText
|
|
213
|
+
confirmText: string;
|
|
214
|
+
cancelText: string;
|
|
236
215
|
onConfirm: () => void;
|
|
237
216
|
}) => {
|
|
238
217
|
const [visible, setVisible] = React.useState(false);
|
|
@@ -45,16 +45,14 @@ export interface AtomicConfirmationModalProps {
|
|
|
45
45
|
variant?: ConfirmationModalVariant;
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
|
-
* Confirm button text
|
|
49
|
-
* @default 'Confirm' (or variant-specific default)
|
|
48
|
+
* Confirm button text (required)
|
|
50
49
|
*/
|
|
51
|
-
confirmText
|
|
50
|
+
confirmText: string;
|
|
52
51
|
|
|
53
52
|
/**
|
|
54
|
-
* Cancel button text
|
|
55
|
-
* @default 'Cancel'
|
|
53
|
+
* Cancel button text (required)
|
|
56
54
|
*/
|
|
57
|
-
cancelText
|
|
55
|
+
cancelText: string;
|
|
58
56
|
|
|
59
57
|
/**
|
|
60
58
|
* Icon name to display at top (MaterialIcons name)
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
export { FormField } from './FormField';
|
|
12
12
|
export { ListItem } from './ListItem';
|
|
13
13
|
export { SearchBar } from './SearchBar';
|
|
14
|
-
export { LanguageSwitcher } from './LanguageSwitcher';
|
|
15
14
|
export { SectionCard } from './SectionCard';
|
|
16
15
|
export { IconContainer } from './IconContainer';
|
|
17
16
|
export { ScreenHeader } from './ScreenHeader';
|
|
@@ -219,10 +219,6 @@ export const typography = {
|
|
|
219
219
|
} as TextStyle,
|
|
220
220
|
} as const;
|
|
221
221
|
|
|
222
|
-
// =============================================================================
|
|
223
|
-
// ANIMATION TOKENS - REMOVED (moved to separate package)
|
|
224
|
-
// =============================================================================
|
|
225
|
-
|
|
226
222
|
// =============================================================================
|
|
227
223
|
// OPACITY TOKENS
|
|
228
224
|
// =============================================================================
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AtomicSkeleton - Universal Skeleton Loading Component
|
|
3
|
-
*
|
|
4
|
-
* Displays skeleton placeholders for loading states
|
|
5
|
-
* Theme: {{THEME_NAME}} ({{CATEGORY}} category)
|
|
6
|
-
*
|
|
7
|
-
* Atomic Design Level: ATOM
|
|
8
|
-
* Purpose: Loading state placeholder
|
|
9
|
-
*
|
|
10
|
-
* Usage:
|
|
11
|
-
* - Content loading placeholders
|
|
12
|
-
* - List item skeletons
|
|
13
|
-
* - Card skeletons
|
|
14
|
-
* - Text line skeletons
|
|
15
|
-
* - Image placeholders
|
|
16
|
-
*/
|
|
17
|
-
import React from 'react';
|
|
18
|
-
import { ViewStyle } from 'react-native';
|
|
19
|
-
export interface AtomicSkeletonProps {
|
|
20
|
-
/** Skeleton width */
|
|
21
|
-
width?: number | string;
|
|
22
|
-
/** Skeleton height */
|
|
23
|
-
height?: number | string;
|
|
24
|
-
/** Skeleton shape */
|
|
25
|
-
shape?: 'rectangle' | 'circle' | 'rounded';
|
|
26
|
-
/** Border radius for rounded shapes */
|
|
27
|
-
borderRadius?: number;
|
|
28
|
-
/** Skeleton color */
|
|
29
|
-
color?: string;
|
|
30
|
-
/** Style overrides */
|
|
31
|
-
style?: ViewStyle;
|
|
32
|
-
/** Test ID for testing */
|
|
33
|
-
testID?: string;
|
|
34
|
-
}
|
|
35
|
-
export declare const AtomicSkeleton: React.FC<AtomicSkeletonProps>;
|
|
36
|
-
export default AtomicSkeleton;
|
|
37
|
-
//# sourceMappingURL=AtomicSkeleton.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AtomicSkeleton.d.ts","sourceRoot":"","sources":["../../../src/presentation/atoms/AtomicSkeleton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAoB,SAAS,EAAkB,MAAM,cAAc,CAAC;AAO3E,MAAM,WAAW,mBAAmB;IAClC,qBAAqB;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,sBAAsB;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,qBAAqB;IACrB,KAAK,CAAC,EAAE,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAC;IAC3C,uCAAuC;IACvC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qBAAqB;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sBAAsB;IACtB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,0BAA0B;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAMD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA0CxD,CAAC;AAMF,eAAe,cAAc,CAAC"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AtomicSkeleton - Universal Skeleton Loading Component
|
|
3
|
-
*
|
|
4
|
-
* Displays skeleton placeholders for loading states
|
|
5
|
-
* Theme: {{THEME_NAME}} ({{CATEGORY}} category)
|
|
6
|
-
*
|
|
7
|
-
* Atomic Design Level: ATOM
|
|
8
|
-
* Purpose: Loading state placeholder
|
|
9
|
-
*
|
|
10
|
-
* Usage:
|
|
11
|
-
* - Content loading placeholders
|
|
12
|
-
* - List item skeletons
|
|
13
|
-
* - Card skeletons
|
|
14
|
-
* - Text line skeletons
|
|
15
|
-
* - Image placeholders
|
|
16
|
-
*/
|
|
17
|
-
import React from 'react';
|
|
18
|
-
import { View } from 'react-native';
|
|
19
|
-
import { useAppDesignTokens } from '../hooks/useAppDesignTokens';
|
|
20
|
-
// =============================================================================
|
|
21
|
-
// COMPONENT IMPLEMENTATION
|
|
22
|
-
// =============================================================================
|
|
23
|
-
export const AtomicSkeleton = ({ width = '100%', height = 20, shape = 'rectangle', borderRadius, color, style, testID, }) => {
|
|
24
|
-
const tokens = useAppDesignTokens();
|
|
25
|
-
// Default values
|
|
26
|
-
const skeletonColor = color || tokens.colors.surfaceVariant;
|
|
27
|
-
// Calculate border radius based on shape
|
|
28
|
-
const getBorderRadius = () => {
|
|
29
|
-
if (borderRadius !== undefined)
|
|
30
|
-
return borderRadius;
|
|
31
|
-
switch (shape) {
|
|
32
|
-
case 'circle':
|
|
33
|
-
return typeof height === 'number' ? height / 2 : 20;
|
|
34
|
-
case 'rounded':
|
|
35
|
-
return tokens.borders.radius.md;
|
|
36
|
-
case 'rectangle':
|
|
37
|
-
default:
|
|
38
|
-
return tokens.borders.radius.sm;
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
const skeletonStyle = {
|
|
42
|
-
width: width,
|
|
43
|
-
height: height,
|
|
44
|
-
backgroundColor: skeletonColor,
|
|
45
|
-
borderRadius: getBorderRadius(),
|
|
46
|
-
};
|
|
47
|
-
return (<View style={[skeletonStyle, style]} testID={testID}/>);
|
|
48
|
-
};
|
|
49
|
-
// =============================================================================
|
|
50
|
-
// EXPORTS
|
|
51
|
-
// =============================================================================
|
|
52
|
-
export default AtomicSkeleton;
|
|
53
|
-
//# sourceMappingURL=AtomicSkeleton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AtomicSkeleton.js","sourceRoot":"","sources":["../../../src/presentation/atoms/AtomicSkeleton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAyC,MAAM,cAAc,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAuBjE,gFAAgF;AAChF,2BAA2B;AAC3B,gFAAgF;AAEhF,MAAM,CAAC,MAAM,cAAc,GAAkC,CAAC,EAC5D,KAAK,GAAG,MAAM,EACd,MAAM,GAAG,EAAE,EACX,KAAK,GAAG,WAAW,EACnB,YAAY,EACZ,KAAK,EACL,KAAK,EACL,MAAM,GACP,EAAE,EAAE;IACH,MAAM,MAAM,GAAG,kBAAkB,EAAE,CAAC;IAEpC,iBAAiB;IACjB,MAAM,aAAa,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC;IAE5D,yCAAyC;IACzC,MAAM,eAAe,GAAG,GAAW,EAAE;QACnC,IAAI,YAAY,KAAK,SAAS;YAAE,OAAO,YAAY,CAAC;QAEpD,QAAQ,KAAK,EAAE,CAAC;YACd,KAAK,QAAQ;gBACX,OAAO,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACtD,KAAK,SAAS;gBACZ,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YAClC,KAAK,WAAW,CAAC;YACjB;gBACE,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACpC,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,aAAa,GAAc;QAC/B,KAAK,EAAE,KAAuB;QAC9B,MAAM,EAAE,MAAwB;QAChC,eAAe,EAAE,aAAa;QAC9B,YAAY,EAAE,eAAe,EAAE;KAChC,CAAC;IAEF,OAAO,CACL,CAAC,IAAI,CACH,KAAK,CAAC,CAAC,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC,CAC9B,MAAM,CAAC,CAAC,MAAM,CAAC,EACf,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,gFAAgF;AAChF,UAAU;AACV,gFAAgF;AAEhF,eAAe,cAAc,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface LanguageSwitcherProps {
|
|
3
|
-
showName?: boolean;
|
|
4
|
-
showFlag?: boolean;
|
|
5
|
-
color?: string;
|
|
6
|
-
navigationScreen?: string;
|
|
7
|
-
}
|
|
8
|
-
export declare const LanguageSwitcher: React.FC<LanguageSwitcherProps>;
|
|
9
|
-
export default LanguageSwitcher;
|
|
10
|
-
//# sourceMappingURL=LanguageSwitcher.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LanguageSwitcher.d.ts","sourceRoot":"","sources":["../../../src/presentation/molecules/LanguageSwitcher.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,UAAU,qBAAqB;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAmB5D,CAAC;AAQF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { TouchableOpacity } from 'react-native';
|
|
3
|
-
import { AtomicText, AtomicIcon } from '../atoms';
|
|
4
|
-
import { useAppDesignTokens } from '../hooks/useAppDesignTokens';
|
|
5
|
-
import { useLanguageNavigation } from './languageswitcher/hooks/useLanguageNavigation';
|
|
6
|
-
import { languageSwitcherConfig } from './languageswitcher/config/languageSwitcherConfig';
|
|
7
|
-
export const LanguageSwitcher = ({ showName = false, showFlag = true, color, navigationScreen = languageSwitcherConfig.defaultNavigationScreen, }) => {
|
|
8
|
-
const tokens = useAppDesignTokens();
|
|
9
|
-
const { currentLang, navigateToLanguageSelection } = useLanguageNavigation(navigationScreen);
|
|
10
|
-
const iconColor = color || tokens.colors.textPrimary;
|
|
11
|
-
const styles = getStyles(tokens);
|
|
12
|
-
return (<TouchableOpacity style={styles.container} onPress={navigateToLanguageSelection} activeOpacity={0.7} hitSlop={languageSwitcherConfig.hitSlop}>
|
|
13
|
-
{showFlag && <AtomicText type="headlineSmall" style={styles.flag}>{currentLang.flag}</AtomicText>}
|
|
14
|
-
{showName && <AtomicText type="bodySmall" color={iconColor} style={styles.languageName}>{currentLang.nativeName}</AtomicText>}
|
|
15
|
-
{!showName && !showFlag && <AtomicIcon name="Languages" color="primary"/>}
|
|
16
|
-
</TouchableOpacity>);
|
|
17
|
-
};
|
|
18
|
-
const getStyles = (tokens) => ({
|
|
19
|
-
container: { flexDirection: 'row', alignItems: 'center', gap: tokens.spacing.sm, paddingHorizontal: tokens.spacing.xs },
|
|
20
|
-
flag: { fontSize: tokens.typography.headingSmall.fontSize },
|
|
21
|
-
languageName: { fontSize: tokens.typography.bodySmall.fontSize, fontWeight: tokens.typography.semibold },
|
|
22
|
-
});
|
|
23
|
-
export default LanguageSwitcher;
|
|
24
|
-
//# sourceMappingURL=LanguageSwitcher.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LanguageSwitcher.js","sourceRoot":"","sources":["../../../src/presentation/molecules/LanguageSwitcher.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAc,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AACvF,OAAO,EAAE,sBAAsB,EAAE,MAAM,kDAAkD,CAAC;AAS1F,MAAM,CAAC,MAAM,gBAAgB,GAAoC,CAAC,EAChE,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,IAAI,EACf,KAAK,EACL,gBAAgB,GAAG,sBAAsB,CAAC,uBAAuB,GAClE,EAAE,EAAE;IACH,MAAM,MAAM,GAAG,kBAAkB,EAAE,CAAC;IACpC,MAAM,EAAE,WAAW,EAAE,2BAA2B,EAAE,GAAG,qBAAqB,CAAC,gBAAgB,CAAC,CAAC;IAC7F,MAAM,SAAS,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC;IAErD,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;IAEjC,OAAO,CACL,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,2BAA2B,CAAC,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAC3I;MAAA,CAAC,QAAQ,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,CACjG;MAAA,CAAC,QAAQ,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE,UAAU,CAAC,CAC7H;MAAA,CAAC,CAAC,QAAQ,IAAI,CAAC,QAAQ,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,SAAS,EAAG,CAC5E;IAAA,EAAE,gBAAgB,CAAC,CACpB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,MAA6C,EAAE,EAAE,CAAC,CAAC;IACpE,SAAS,EAAE,EAAE,aAAa,EAAE,KAAc,EAAE,UAAU,EAAE,QAAiB,EAAE,GAAG,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE,EAAE,iBAAiB,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE,EAAE;IACzI,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC,QAAQ,EAAE;IAC3D,YAAY,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,QAAQ,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE;CACzG,CAAC,CAAC;AAEH,eAAe,gBAAgB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"languageSwitcherConfig.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/molecules/languageswitcher/config/languageSwitcherConfig.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB;;;;;;;;;CAIlC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"languageSwitcherConfig.js","sourceRoot":"","sources":["../../../../../src/presentation/molecules/languageswitcher/config/languageSwitcherConfig.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,eAAe,EAAE,EAAE;IACnB,uBAAuB,EAAE,mBAAmB;IAC5C,OAAO,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;CACtD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useLanguageNavigation.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/molecules/languageswitcher/hooks/useLanguageNavigation.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,qBAAqB,GAAI,kBAAkB,MAAM;;;CAU7D,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// @ts-ignore - Optional peer dependency
|
|
2
|
-
import { useNavigation } from '@react-navigation/native';
|
|
3
|
-
// @ts-ignore - Optional peer dependency
|
|
4
|
-
import { useLocalization, getLanguageByCode, getDefaultLanguage } from '@umituz/react-native-localization';
|
|
5
|
-
export const useLanguageNavigation = (navigationScreen) => {
|
|
6
|
-
const navigation = useNavigation();
|
|
7
|
-
const { currentLanguage } = useLocalization();
|
|
8
|
-
const currentLang = getLanguageByCode(currentLanguage) || getDefaultLanguage();
|
|
9
|
-
const navigateToLanguageSelection = () => {
|
|
10
|
-
navigation.navigate(navigationScreen);
|
|
11
|
-
};
|
|
12
|
-
return { currentLang, navigateToLanguageSelection };
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=useLanguageNavigation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useLanguageNavigation.js","sourceRoot":"","sources":["../../../../../src/presentation/molecules/languageswitcher/hooks/useLanguageNavigation.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,wCAAwC;AACxC,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAE3G,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,gBAAwB,EAAE,EAAE;IAChE,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IACnC,MAAM,EAAE,eAAe,EAAE,GAAG,eAAe,EAAE,CAAC;IAC9C,MAAM,WAAW,GAAG,iBAAiB,CAAC,eAAe,CAAC,IAAI,kBAAkB,EAAE,CAAC;IAE/E,MAAM,2BAA2B,GAAG,GAAG,EAAE;QACvC,UAAU,CAAC,QAAQ,CAAC,gBAAyB,CAAC,CAAC;IACjD,CAAC,CAAC;IAEF,OAAO,EAAE,WAAW,EAAE,2BAA2B,EAAE,CAAC;AACtD,CAAC,CAAC"}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AtomicSkeleton - Universal Skeleton Loading Component
|
|
3
|
-
*
|
|
4
|
-
* Displays skeleton placeholders for loading states
|
|
5
|
-
* Theme: {{THEME_NAME}} ({{CATEGORY}} category)
|
|
6
|
-
*
|
|
7
|
-
* Atomic Design Level: ATOM
|
|
8
|
-
* Purpose: Loading state placeholder
|
|
9
|
-
*
|
|
10
|
-
* Usage:
|
|
11
|
-
* - Content loading placeholders
|
|
12
|
-
* - List item skeletons
|
|
13
|
-
* - Card skeletons
|
|
14
|
-
* - Text line skeletons
|
|
15
|
-
* - Image placeholders
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
import React from 'react';
|
|
19
|
-
import { View, StyleSheet, ViewStyle, DimensionValue } from 'react-native';
|
|
20
|
-
import { useAppDesignTokens } from '../hooks/useAppDesignTokens';
|
|
21
|
-
|
|
22
|
-
// =============================================================================
|
|
23
|
-
// TYPE DEFINITIONS
|
|
24
|
-
// =============================================================================
|
|
25
|
-
|
|
26
|
-
export interface AtomicSkeletonProps {
|
|
27
|
-
/** Skeleton width */
|
|
28
|
-
width?: number | string;
|
|
29
|
-
/** Skeleton height */
|
|
30
|
-
height?: number | string;
|
|
31
|
-
/** Skeleton shape */
|
|
32
|
-
shape?: 'rectangle' | 'circle' | 'rounded';
|
|
33
|
-
/** Border radius for rounded shapes */
|
|
34
|
-
borderRadius?: number;
|
|
35
|
-
/** Skeleton color */
|
|
36
|
-
color?: string;
|
|
37
|
-
/** Style overrides */
|
|
38
|
-
style?: ViewStyle;
|
|
39
|
-
/** Test ID for testing */
|
|
40
|
-
testID?: string;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// =============================================================================
|
|
44
|
-
// COMPONENT IMPLEMENTATION
|
|
45
|
-
// =============================================================================
|
|
46
|
-
|
|
47
|
-
export const AtomicSkeleton: React.FC<AtomicSkeletonProps> = ({
|
|
48
|
-
width = '100%',
|
|
49
|
-
height = 20,
|
|
50
|
-
shape = 'rectangle',
|
|
51
|
-
borderRadius,
|
|
52
|
-
color,
|
|
53
|
-
style,
|
|
54
|
-
testID,
|
|
55
|
-
}) => {
|
|
56
|
-
const tokens = useAppDesignTokens();
|
|
57
|
-
|
|
58
|
-
// Default values
|
|
59
|
-
const skeletonColor = color || tokens.colors.surfaceVariant;
|
|
60
|
-
|
|
61
|
-
// Calculate border radius based on shape
|
|
62
|
-
const getBorderRadius = (): number => {
|
|
63
|
-
if (borderRadius !== undefined) return borderRadius;
|
|
64
|
-
|
|
65
|
-
switch (shape) {
|
|
66
|
-
case 'circle':
|
|
67
|
-
return typeof height === 'number' ? height / 2 : 20;
|
|
68
|
-
case 'rounded':
|
|
69
|
-
return tokens.borders.radius.md;
|
|
70
|
-
case 'rectangle':
|
|
71
|
-
default:
|
|
72
|
-
return tokens.borders.radius.sm;
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
const skeletonStyle: ViewStyle = {
|
|
77
|
-
width: width as DimensionValue,
|
|
78
|
-
height: height as DimensionValue,
|
|
79
|
-
backgroundColor: skeletonColor,
|
|
80
|
-
borderRadius: getBorderRadius(),
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
return (
|
|
84
|
-
<View
|
|
85
|
-
style={[skeletonStyle, style]}
|
|
86
|
-
testID={testID}
|
|
87
|
-
/>
|
|
88
|
-
);
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
// =============================================================================
|
|
92
|
-
// EXPORTS
|
|
93
|
-
// =============================================================================
|
|
94
|
-
|
|
95
|
-
export default AtomicSkeleton;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { TouchableOpacity, StyleSheet } from 'react-native';
|
|
3
|
-
import { AtomicText, AtomicIcon } from '../atoms';
|
|
4
|
-
import { useAppDesignTokens } from '../hooks/useAppDesignTokens';
|
|
5
|
-
import { useLanguageNavigation } from './languageswitcher/hooks/useLanguageNavigation';
|
|
6
|
-
import { languageSwitcherConfig } from './languageswitcher/config/languageSwitcherConfig';
|
|
7
|
-
|
|
8
|
-
interface LanguageSwitcherProps {
|
|
9
|
-
showName?: boolean;
|
|
10
|
-
showFlag?: boolean;
|
|
11
|
-
color?: string;
|
|
12
|
-
navigationScreen?: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export const LanguageSwitcher: React.FC<LanguageSwitcherProps> = ({
|
|
16
|
-
showName = false,
|
|
17
|
-
showFlag = true,
|
|
18
|
-
color,
|
|
19
|
-
navigationScreen = languageSwitcherConfig.defaultNavigationScreen,
|
|
20
|
-
}) => {
|
|
21
|
-
const tokens = useAppDesignTokens();
|
|
22
|
-
const { currentLang, navigateToLanguageSelection } = useLanguageNavigation(navigationScreen);
|
|
23
|
-
const iconColor = color || tokens.colors.textPrimary;
|
|
24
|
-
|
|
25
|
-
const styles = getStyles(tokens);
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<TouchableOpacity style={styles.container} onPress={navigateToLanguageSelection} activeOpacity={0.7} hitSlop={languageSwitcherConfig.hitSlop}>
|
|
29
|
-
{showFlag && <AtomicText type="headlineSmall" style={styles.flag}>{currentLang.flag}</AtomicText>}
|
|
30
|
-
{showName && <AtomicText type="bodySmall" color={iconColor} style={styles.languageName}>{currentLang.nativeName}</AtomicText>}
|
|
31
|
-
{!showName && !showFlag && <AtomicIcon name="Languages" color="primary" />}
|
|
32
|
-
</TouchableOpacity>
|
|
33
|
-
);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
const getStyles = (tokens: ReturnType<typeof useAppDesignTokens>) => ({
|
|
37
|
-
container: { flexDirection: 'row' as const, alignItems: 'center' as const, gap: tokens.spacing.sm, paddingHorizontal: tokens.spacing.xs },
|
|
38
|
-
flag: { fontSize: tokens.typography.headingSmall.fontSize },
|
|
39
|
-
languageName: { fontSize: tokens.typography.bodySmall.fontSize, fontWeight: tokens.typography.semibold },
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
export default LanguageSwitcher;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// @ts-ignore - Optional peer dependency
|
|
2
|
-
import { useNavigation } from '@react-navigation/native';
|
|
3
|
-
// @ts-ignore - Optional peer dependency
|
|
4
|
-
import { useLocalization, getLanguageByCode, getDefaultLanguage } from '@umituz/react-native-localization';
|
|
5
|
-
|
|
6
|
-
export const useLanguageNavigation = (navigationScreen: string) => {
|
|
7
|
-
const navigation = useNavigation();
|
|
8
|
-
const { currentLanguage } = useLocalization();
|
|
9
|
-
const currentLang = getLanguageByCode(currentLanguage) || getDefaultLanguage();
|
|
10
|
-
|
|
11
|
-
const navigateToLanguageSelection = () => {
|
|
12
|
-
navigation.navigate(navigationScreen as never);
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
return { currentLang, navigateToLanguageSelection };
|
|
16
|
-
};
|