@umituz/react-native-design-system 1.5.7 → 1.5.9
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 +3 -8
- package/src/presentation/atoms/AtomicPicker.tsx +2 -2
- package/lib/index.d.ts +0 -61
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -101
- package/lib/index.js.map +0 -1
- package/lib/presentation/atoms/AtomicAvatar.d.ts +0 -48
- package/lib/presentation/atoms/AtomicAvatar.d.ts.map +0 -1
- package/lib/presentation/atoms/AtomicAvatar.js +0 -85
- package/lib/presentation/atoms/AtomicAvatar.js.map +0 -1
- package/lib/presentation/atoms/AtomicAvatarGroup.d.ts +0 -56
- package/lib/presentation/atoms/AtomicAvatarGroup.d.ts.map +0 -1
- package/lib/presentation/atoms/AtomicAvatarGroup.js +0 -83
- package/lib/presentation/atoms/AtomicAvatarGroup.js.map +0 -1
- package/lib/presentation/atoms/AtomicBadge.d.ts +0 -42
- package/lib/presentation/atoms/AtomicBadge.d.ts.map +0 -1
- package/lib/presentation/atoms/AtomicBadge.js +0 -168
- package/lib/presentation/atoms/AtomicBadge.js.map +0 -1
- package/lib/presentation/atoms/AtomicButton.d.ts +0 -21
- package/lib/presentation/atoms/AtomicButton.d.ts.map +0 -1
- package/lib/presentation/atoms/AtomicButton.js +0 -172
- package/lib/presentation/atoms/AtomicButton.js.map +0 -1
- package/lib/presentation/atoms/AtomicCard.d.ts +0 -15
- package/lib/presentation/atoms/AtomicCard.d.ts.map +0 -1
- package/lib/presentation/atoms/AtomicCard.js +0 -70
- package/lib/presentation/atoms/AtomicCard.js.map +0 -1
- package/lib/presentation/atoms/AtomicChip.d.ts +0 -53
- package/lib/presentation/atoms/AtomicChip.d.ts.map +0 -1
- package/lib/presentation/atoms/AtomicChip.js +0 -131
- package/lib/presentation/atoms/AtomicChip.js.map +0 -1
- package/lib/presentation/atoms/AtomicDatePicker.d.ts +0 -75
- package/lib/presentation/atoms/AtomicDatePicker.d.ts.map +0 -1
- package/lib/presentation/atoms/AtomicDatePicker.js +0 -246
- package/lib/presentation/atoms/AtomicDatePicker.js.map +0 -1
- package/lib/presentation/atoms/AtomicDivider.d.ts +0 -45
- package/lib/presentation/atoms/AtomicDivider.d.ts.map +0 -1
- package/lib/presentation/atoms/AtomicDivider.js +0 -58
- package/lib/presentation/atoms/AtomicDivider.js.map +0 -1
- package/lib/presentation/atoms/AtomicFab.d.ts +0 -37
- package/lib/presentation/atoms/AtomicFab.d.ts.map +0 -1
- package/lib/presentation/atoms/AtomicFab.js +0 -68
- package/lib/presentation/atoms/AtomicFab.js.map +0 -1
- package/lib/presentation/atoms/AtomicFilter.d.ts +0 -37
- package/lib/presentation/atoms/AtomicFilter.d.ts.map +0 -1
- package/lib/presentation/atoms/AtomicFilter.js +0 -104
- package/lib/presentation/atoms/AtomicFilter.js.map +0 -1
- package/lib/presentation/atoms/AtomicFormError.d.ts +0 -30
- package/lib/presentation/atoms/AtomicFormError.d.ts.map +0 -1
- package/lib/presentation/atoms/AtomicFormError.js +0 -64
- package/lib/presentation/atoms/AtomicFormError.js.map +0 -1
- package/lib/presentation/atoms/AtomicIcon.d.ts +0 -35
- package/lib/presentation/atoms/AtomicIcon.d.ts.map +0 -1
- package/lib/presentation/atoms/AtomicIcon.js +0 -30
- package/lib/presentation/atoms/AtomicIcon.js.map +0 -1
- package/lib/presentation/atoms/AtomicImage.d.ts +0 -40
- package/lib/presentation/atoms/AtomicImage.d.ts.map +0 -1
- package/lib/presentation/atoms/AtomicImage.js +0 -92
- package/lib/presentation/atoms/AtomicImage.js.map +0 -1
- package/lib/presentation/atoms/AtomicInput.d.ts +0 -71
- package/lib/presentation/atoms/AtomicInput.d.ts.map +0 -1
- package/lib/presentation/atoms/AtomicInput.js +0 -196
- package/lib/presentation/atoms/AtomicInput.js.map +0 -1
- package/lib/presentation/atoms/AtomicNumberInput.d.ts +0 -69
- package/lib/presentation/atoms/AtomicNumberInput.d.ts.map +0 -1
- package/lib/presentation/atoms/AtomicNumberInput.js +0 -125
- package/lib/presentation/atoms/AtomicNumberInput.js.map +0 -1
- package/lib/presentation/atoms/AtomicPicker.d.ts +0 -52
- package/lib/presentation/atoms/AtomicPicker.d.ts.map +0 -1
- package/lib/presentation/atoms/AtomicPicker.js +0 -299
- package/lib/presentation/atoms/AtomicPicker.js.map +0 -1
- package/lib/presentation/atoms/AtomicProgress.d.ts +0 -44
- package/lib/presentation/atoms/AtomicProgress.d.ts.map +0 -1
- package/lib/presentation/atoms/AtomicProgress.js +0 -80
- package/lib/presentation/atoms/AtomicProgress.js.map +0 -1
- package/lib/presentation/atoms/AtomicSearchBar.d.ts +0 -19
- package/lib/presentation/atoms/AtomicSearchBar.d.ts.map +0 -1
- package/lib/presentation/atoms/AtomicSearchBar.js +0 -46
- package/lib/presentation/atoms/AtomicSearchBar.js.map +0 -1
- package/lib/presentation/atoms/AtomicSort.d.ts +0 -72
- package/lib/presentation/atoms/AtomicSort.d.ts.map +0 -1
- package/lib/presentation/atoms/AtomicSort.js +0 -77
- package/lib/presentation/atoms/AtomicSort.js.map +0 -1
- package/lib/presentation/atoms/AtomicSwitch.d.ts +0 -43
- package/lib/presentation/atoms/AtomicSwitch.d.ts.map +0 -1
- package/lib/presentation/atoms/AtomicSwitch.js +0 -104
- package/lib/presentation/atoms/AtomicSwitch.js.map +0 -1
- package/lib/presentation/atoms/AtomicText.d.ts +0 -34
- package/lib/presentation/atoms/AtomicText.d.ts.map +0 -1
- package/lib/presentation/atoms/AtomicText.js +0 -59
- package/lib/presentation/atoms/AtomicText.js.map +0 -1
- package/lib/presentation/atoms/AtomicTextArea.d.ts +0 -85
- package/lib/presentation/atoms/AtomicTextArea.d.ts.map +0 -1
- package/lib/presentation/atoms/AtomicTextArea.js +0 -196
- package/lib/presentation/atoms/AtomicTextArea.js.map +0 -1
- package/lib/presentation/atoms/AtomicTouchable.d.ts +0 -77
- package/lib/presentation/atoms/AtomicTouchable.d.ts.map +0 -1
- package/lib/presentation/atoms/AtomicTouchable.js +0 -138
- package/lib/presentation/atoms/AtomicTouchable.js.map +0 -1
- package/lib/presentation/atoms/fab/styles/fabStyles.d.ts +0 -23
- package/lib/presentation/atoms/fab/styles/fabStyles.d.ts.map +0 -1
- package/lib/presentation/atoms/fab/styles/fabStyles.js +0 -63
- package/lib/presentation/atoms/fab/styles/fabStyles.js.map +0 -1
- package/lib/presentation/atoms/fab/types/index.d.ts +0 -71
- package/lib/presentation/atoms/fab/types/index.d.ts.map +0 -1
- package/lib/presentation/atoms/fab/types/index.js +0 -2
- package/lib/presentation/atoms/fab/types/index.js.map +0 -1
- package/lib/presentation/atoms/filter/styles/filterStyles.d.ts +0 -15
- package/lib/presentation/atoms/filter/styles/filterStyles.d.ts.map +0 -1
- package/lib/presentation/atoms/filter/styles/filterStyles.js +0 -29
- package/lib/presentation/atoms/filter/styles/filterStyles.js.map +0 -1
- package/lib/presentation/atoms/filter/types/index.d.ts +0 -76
- package/lib/presentation/atoms/filter/types/index.d.ts.map +0 -1
- package/lib/presentation/atoms/filter/types/index.js +0 -2
- package/lib/presentation/atoms/filter/types/index.js.map +0 -1
- package/lib/presentation/atoms/index.d.ts +0 -273
- package/lib/presentation/atoms/index.d.ts.map +0 -1
- package/lib/presentation/atoms/index.js +0 -146
- package/lib/presentation/atoms/index.js.map +0 -1
- package/lib/presentation/atoms/input/hooks/useInputState.d.ts +0 -7
- package/lib/presentation/atoms/input/hooks/useInputState.d.ts.map +0 -1
- package/lib/presentation/atoms/input/hooks/useInputState.js +0 -13
- package/lib/presentation/atoms/input/hooks/useInputState.js.map +0 -1
- package/lib/presentation/atoms/input/styles/inputStyles.d.ts +0 -13
- package/lib/presentation/atoms/input/styles/inputStyles.d.ts.map +0 -1
- package/lib/presentation/atoms/input/styles/inputStyles.js +0 -59
- package/lib/presentation/atoms/input/styles/inputStyles.js.map +0 -1
- package/lib/presentation/atoms/input/types/index.d.ts +0 -24
- package/lib/presentation/atoms/input/types/index.d.ts.map +0 -1
- package/lib/presentation/atoms/input/types/index.js +0 -2
- package/lib/presentation/atoms/input/types/index.js.map +0 -1
- package/lib/presentation/atoms/picker/styles/pickerStyles.d.ts +0 -85
- package/lib/presentation/atoms/picker/styles/pickerStyles.d.ts.map +0 -1
- package/lib/presentation/atoms/picker/styles/pickerStyles.js +0 -177
- package/lib/presentation/atoms/picker/styles/pickerStyles.js.map +0 -1
- package/lib/presentation/atoms/picker/types/index.d.ts +0 -38
- package/lib/presentation/atoms/picker/types/index.d.ts.map +0 -1
- package/lib/presentation/atoms/picker/types/index.js +0 -2
- package/lib/presentation/atoms/picker/types/index.js.map +0 -1
- package/lib/presentation/atoms/touchable/styles/touchableStyles.d.ts +0 -31
- package/lib/presentation/atoms/touchable/styles/touchableStyles.d.ts.map +0 -1
- package/lib/presentation/atoms/touchable/styles/touchableStyles.js +0 -54
- package/lib/presentation/atoms/touchable/styles/touchableStyles.js.map +0 -1
- package/lib/presentation/atoms/touchable/types/index.d.ts +0 -134
- package/lib/presentation/atoms/touchable/types/index.d.ts.map +0 -1
- package/lib/presentation/atoms/touchable/types/index.js +0 -2
- package/lib/presentation/atoms/touchable/types/index.js.map +0 -1
- package/lib/presentation/hooks/useResponsive.d.ts +0 -80
- package/lib/presentation/hooks/useResponsive.d.ts.map +0 -1
- package/lib/presentation/hooks/useResponsive.js +0 -82
- package/lib/presentation/hooks/useResponsive.js.map +0 -1
- package/lib/presentation/molecules/AtomicConfirmationModal.d.ts +0 -73
- package/lib/presentation/molecules/AtomicConfirmationModal.d.ts.map +0 -1
- package/lib/presentation/molecules/AtomicConfirmationModal.js +0 -154
- package/lib/presentation/molecules/AtomicConfirmationModal.js.map +0 -1
- package/lib/presentation/molecules/EmptyState.d.ts +0 -41
- package/lib/presentation/molecules/EmptyState.d.ts.map +0 -1
- package/lib/presentation/molecules/EmptyState.js +0 -68
- package/lib/presentation/molecules/EmptyState.js.map +0 -1
- package/lib/presentation/molecules/FormField.d.ts +0 -22
- package/lib/presentation/molecules/FormField.d.ts.map +0 -1
- package/lib/presentation/molecules/FormField.js +0 -76
- package/lib/presentation/molecules/FormField.js.map +0 -1
- package/lib/presentation/molecules/GridContainer.d.ts +0 -40
- package/lib/presentation/molecules/GridContainer.d.ts.map +0 -1
- package/lib/presentation/molecules/GridContainer.js +0 -77
- package/lib/presentation/molecules/GridContainer.js.map +0 -1
- package/lib/presentation/molecules/IconContainer.d.ts +0 -29
- package/lib/presentation/molecules/IconContainer.d.ts.map +0 -1
- package/lib/presentation/molecules/IconContainer.js +0 -60
- package/lib/presentation/molecules/IconContainer.js.map +0 -1
- package/lib/presentation/molecules/ListItem.d.ts +0 -5
- package/lib/presentation/molecules/ListItem.d.ts.map +0 -1
- package/lib/presentation/molecules/ListItem.js +0 -24
- package/lib/presentation/molecules/ListItem.js.map +0 -1
- package/lib/presentation/molecules/ScreenHeader.d.ts +0 -55
- package/lib/presentation/molecules/ScreenHeader.d.ts.map +0 -1
- package/lib/presentation/molecules/ScreenHeader.js +0 -94
- package/lib/presentation/molecules/ScreenHeader.js.map +0 -1
- package/lib/presentation/molecules/SearchBar.d.ts +0 -18
- package/lib/presentation/molecules/SearchBar.d.ts.map +0 -1
- package/lib/presentation/molecules/SearchBar.js +0 -47
- package/lib/presentation/molecules/SearchBar.js.map +0 -1
- package/lib/presentation/molecules/SectionCard.d.ts +0 -25
- package/lib/presentation/molecules/SectionCard.d.ts.map +0 -1
- package/lib/presentation/molecules/SectionCard.js +0 -47
- package/lib/presentation/molecules/SectionCard.js.map +0 -1
- package/lib/presentation/molecules/SectionContainer.d.ts +0 -33
- package/lib/presentation/molecules/SectionContainer.d.ts.map +0 -1
- package/lib/presentation/molecules/SectionContainer.js +0 -64
- package/lib/presentation/molecules/SectionContainer.js.map +0 -1
- package/lib/presentation/molecules/SectionHeader.d.ts +0 -37
- package/lib/presentation/molecules/SectionHeader.d.ts.map +0 -1
- package/lib/presentation/molecules/SectionHeader.js +0 -73
- package/lib/presentation/molecules/SectionHeader.js.map +0 -1
- package/lib/presentation/molecules/confirmation-modal/styles/confirmationModalStyles.d.ts +0 -50
- package/lib/presentation/molecules/confirmation-modal/styles/confirmationModalStyles.d.ts.map +0 -1
- package/lib/presentation/molecules/confirmation-modal/styles/confirmationModalStyles.js +0 -115
- package/lib/presentation/molecules/confirmation-modal/styles/confirmationModalStyles.js.map +0 -1
- package/lib/presentation/molecules/confirmation-modal/types/index.d.ts +0 -86
- package/lib/presentation/molecules/confirmation-modal/types/index.d.ts.map +0 -1
- package/lib/presentation/molecules/confirmation-modal/types/index.js +0 -7
- package/lib/presentation/molecules/confirmation-modal/types/index.js.map +0 -1
- package/lib/presentation/molecules/index.d.ts +0 -27
- package/lib/presentation/molecules/index.d.ts.map +0 -1
- package/lib/presentation/molecules/index.js +0 -17
- package/lib/presentation/molecules/index.js.map +0 -1
- package/lib/presentation/molecules/listitem/styles/listItemStyles.d.ts +0 -12
- package/lib/presentation/molecules/listitem/styles/listItemStyles.d.ts.map +0 -1
- package/lib/presentation/molecules/listitem/styles/listItemStyles.js +0 -15
- package/lib/presentation/molecules/listitem/styles/listItemStyles.js.map +0 -1
- package/lib/presentation/molecules/listitem/types/index.d.ts +0 -17
- package/lib/presentation/molecules/listitem/types/index.d.ts.map +0 -1
- package/lib/presentation/molecules/listitem/types/index.js +0 -2
- package/lib/presentation/molecules/listitem/types/index.js.map +0 -1
- package/lib/presentation/organisms/AppHeader.d.ts +0 -31
- package/lib/presentation/organisms/AppHeader.d.ts.map +0 -1
- package/lib/presentation/organisms/AppHeader.js +0 -78
- package/lib/presentation/organisms/AppHeader.js.map +0 -1
- package/lib/presentation/organisms/FormContainer.d.ts +0 -76
- package/lib/presentation/organisms/FormContainer.d.ts.map +0 -1
- package/lib/presentation/organisms/FormContainer.js +0 -127
- package/lib/presentation/organisms/FormContainer.js.map +0 -1
- package/lib/presentation/organisms/ScreenLayout.d.ts +0 -84
- package/lib/presentation/organisms/ScreenLayout.d.ts.map +0 -1
- package/lib/presentation/organisms/ScreenLayout.js +0 -69
- package/lib/presentation/organisms/ScreenLayout.js.map +0 -1
- package/lib/presentation/organisms/index.d.ts +0 -16
- package/lib/presentation/organisms/index.d.ts.map +0 -1
- package/lib/presentation/organisms/index.js +0 -14
- package/lib/presentation/organisms/index.js.map +0 -1
- package/lib/presentation/tokens/commonStyles.d.ts +0 -122
- package/lib/presentation/tokens/commonStyles.d.ts.map +0 -1
- package/lib/presentation/tokens/commonStyles.js +0 -220
- package/lib/presentation/tokens/commonStyles.js.map +0 -1
- package/lib/presentation/utils/platformConstants.d.ts +0 -100
- package/lib/presentation/utils/platformConstants.d.ts.map +0 -1
- package/lib/presentation/utils/platformConstants.js +0 -114
- package/lib/presentation/utils/platformConstants.js.map +0 -1
- package/lib/presentation/utils/responsive.d.ts +0 -218
- package/lib/presentation/utils/responsive.d.ts.map +0 -1
- package/lib/presentation/utils/responsive.js +0 -452
- package/lib/presentation/utils/responsive.js.map +0 -1
- package/lib/presentation/utils/variants/compound.d.ts +0 -10
- package/lib/presentation/utils/variants/compound.d.ts.map +0 -1
- package/lib/presentation/utils/variants/compound.js +0 -16
- package/lib/presentation/utils/variants/compound.js.map +0 -1
- package/lib/presentation/utils/variants/core.d.ts +0 -15
- package/lib/presentation/utils/variants/core.d.ts.map +0 -1
- package/lib/presentation/utils/variants/core.js +0 -23
- package/lib/presentation/utils/variants/core.js.map +0 -1
- package/lib/presentation/utils/variants/helpers.d.ts +0 -5
- package/lib/presentation/utils/variants/helpers.d.ts.map +0 -1
- package/lib/presentation/utils/variants/helpers.js +0 -10
- package/lib/presentation/utils/variants/helpers.js.map +0 -1
- package/lib/presentation/utils/variants.d.ts +0 -4
- package/lib/presentation/utils/variants.d.ts.map +0 -1
- package/lib/presentation/utils/variants.js +0 -4
- package/lib/presentation/utils/variants.js.map +0 -1
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AtomicBadge - Universal Badge Component
|
|
3
|
-
*
|
|
4
|
-
* Provides consistent badge/notification count display
|
|
5
|
-
* Theme: {{THEME_NAME}} ({{CATEGORY}} category)
|
|
6
|
-
*
|
|
7
|
-
* Atomic Design Level: ATOM
|
|
8
|
-
* Purpose: Display counts, notifications, status indicators
|
|
9
|
-
*
|
|
10
|
-
* Usage:
|
|
11
|
-
* - Notification counts
|
|
12
|
-
* - Cart item counts
|
|
13
|
-
* - Status indicators
|
|
14
|
-
* - Achievement badges
|
|
15
|
-
*/
|
|
16
|
-
import React from 'react';
|
|
17
|
-
import { View, StyleSheet } from 'react-native';
|
|
18
|
-
import { AtomicText } from './AtomicText';
|
|
19
|
-
import { useAppDesignTokens } from '@umituz/react-native-theme';
|
|
20
|
-
// =============================================================================
|
|
21
|
-
// SIZE CONFIGURATION
|
|
22
|
-
// =============================================================================
|
|
23
|
-
const getSizeConfig = (tokens) => ({
|
|
24
|
-
xs: {
|
|
25
|
-
minHeight: tokens.spacing.sm,
|
|
26
|
-
paddingHorizontal: tokens.spacing.xs,
|
|
27
|
-
fontSize: tokens.typography.labelSmall.fontSize,
|
|
28
|
-
borderRadius: tokens.borders.radius.sm,
|
|
29
|
-
},
|
|
30
|
-
sm: {
|
|
31
|
-
minHeight: tokens.spacing.md,
|
|
32
|
-
paddingHorizontal: tokens.spacing.sm,
|
|
33
|
-
fontSize: tokens.typography.bodySmall.fontSize,
|
|
34
|
-
borderRadius: tokens.borders.radius.md,
|
|
35
|
-
},
|
|
36
|
-
md: {
|
|
37
|
-
minHeight: tokens.spacing.lg,
|
|
38
|
-
paddingHorizontal: tokens.spacing.sm,
|
|
39
|
-
fontSize: tokens.typography.bodyMedium.fontSize,
|
|
40
|
-
borderRadius: tokens.borders.radius.md,
|
|
41
|
-
},
|
|
42
|
-
lg: {
|
|
43
|
-
minHeight: tokens.spacing.xl,
|
|
44
|
-
paddingHorizontal: tokens.spacing.md,
|
|
45
|
-
fontSize: tokens.typography.bodyLarge.fontSize,
|
|
46
|
-
borderRadius: tokens.borders.radius.lg,
|
|
47
|
-
},
|
|
48
|
-
});
|
|
49
|
-
// =============================================================================
|
|
50
|
-
// COMPONENT IMPLEMENTATION
|
|
51
|
-
// =============================================================================
|
|
52
|
-
export const AtomicBadge = ({ children, size = 'md', variant = 'primary', shape = 'circle', max, showZero = false, style, textStyle, minWidth, maxWidth, }) => {
|
|
53
|
-
const tokens = useAppDesignTokens();
|
|
54
|
-
const styles = getStyles(tokens);
|
|
55
|
-
const sizeConfig = getSizeConfig(tokens)[size];
|
|
56
|
-
const colors = getVariantColors(tokens, variant);
|
|
57
|
-
const borderRadius = getBorderRadius(shape, sizeConfig.borderRadius, tokens);
|
|
58
|
-
// Handle max value display
|
|
59
|
-
const displayValue = React.useMemo(() => {
|
|
60
|
-
if (typeof children === 'number') {
|
|
61
|
-
if (max && children > max) {
|
|
62
|
-
return `${max}+`;
|
|
63
|
-
}
|
|
64
|
-
return children.toString();
|
|
65
|
-
}
|
|
66
|
-
return children;
|
|
67
|
-
}, [children, max]);
|
|
68
|
-
// Don't render if count is 0 and showZero is false
|
|
69
|
-
if (typeof children === 'number' && children === 0 && !showZero) {
|
|
70
|
-
return null;
|
|
71
|
-
}
|
|
72
|
-
const containerStyle = [
|
|
73
|
-
styles.container,
|
|
74
|
-
{
|
|
75
|
-
minHeight: sizeConfig.minHeight,
|
|
76
|
-
paddingHorizontal: sizeConfig.paddingHorizontal,
|
|
77
|
-
borderRadius,
|
|
78
|
-
backgroundColor: colors.background,
|
|
79
|
-
minWidth: minWidth || sizeConfig.minHeight,
|
|
80
|
-
maxWidth,
|
|
81
|
-
},
|
|
82
|
-
style,
|
|
83
|
-
];
|
|
84
|
-
const textStyleFinal = StyleSheet.flatten([
|
|
85
|
-
styles.text,
|
|
86
|
-
{
|
|
87
|
-
fontSize: sizeConfig.fontSize,
|
|
88
|
-
},
|
|
89
|
-
textStyle,
|
|
90
|
-
]);
|
|
91
|
-
return (<View style={containerStyle}>
|
|
92
|
-
<AtomicText type="bodySmall" color={colors.text} style={textStyleFinal} numberOfLines={1}>
|
|
93
|
-
{displayValue}
|
|
94
|
-
</AtomicText>
|
|
95
|
-
</View>);
|
|
96
|
-
};
|
|
97
|
-
// =============================================================================
|
|
98
|
-
// HELPER FUNCTIONS
|
|
99
|
-
// =============================================================================
|
|
100
|
-
const getVariantColors = (tokens, variant) => {
|
|
101
|
-
switch (variant) {
|
|
102
|
-
case 'primary':
|
|
103
|
-
return {
|
|
104
|
-
background: tokens.colors.primary,
|
|
105
|
-
text: tokens.colors.textInverse,
|
|
106
|
-
};
|
|
107
|
-
case 'secondary':
|
|
108
|
-
return {
|
|
109
|
-
background: tokens.colors.secondary,
|
|
110
|
-
text: tokens.colors.textInverse,
|
|
111
|
-
};
|
|
112
|
-
case 'success':
|
|
113
|
-
return {
|
|
114
|
-
background: tokens.colors.success,
|
|
115
|
-
text: tokens.colors.textInverse,
|
|
116
|
-
};
|
|
117
|
-
case 'warning':
|
|
118
|
-
return {
|
|
119
|
-
background: tokens.colors.warning,
|
|
120
|
-
text: tokens.colors.textInverse,
|
|
121
|
-
};
|
|
122
|
-
case 'error':
|
|
123
|
-
return {
|
|
124
|
-
background: tokens.colors.error,
|
|
125
|
-
text: tokens.colors.textInverse,
|
|
126
|
-
};
|
|
127
|
-
case 'info':
|
|
128
|
-
return {
|
|
129
|
-
background: tokens.colors.info,
|
|
130
|
-
text: tokens.colors.textInverse,
|
|
131
|
-
};
|
|
132
|
-
default:
|
|
133
|
-
return {
|
|
134
|
-
background: tokens.colors.primary,
|
|
135
|
-
text: tokens.colors.textInverse,
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
const getBorderRadius = (shape, defaultRadius, tokens) => {
|
|
140
|
-
switch (shape) {
|
|
141
|
-
case 'circle':
|
|
142
|
-
return tokens.borders.radius.full; // Very large radius for circle
|
|
143
|
-
case 'square':
|
|
144
|
-
return tokens.borders.radius.sm;
|
|
145
|
-
case 'rounded':
|
|
146
|
-
default:
|
|
147
|
-
return defaultRadius;
|
|
148
|
-
}
|
|
149
|
-
};
|
|
150
|
-
// =============================================================================
|
|
151
|
-
// STYLES
|
|
152
|
-
// =============================================================================
|
|
153
|
-
const getStyles = (tokens) => StyleSheet.create({
|
|
154
|
-
container: {
|
|
155
|
-
justifyContent: 'center',
|
|
156
|
-
alignItems: 'center',
|
|
157
|
-
alignSelf: 'flex-start',
|
|
158
|
-
},
|
|
159
|
-
text: {
|
|
160
|
-
fontWeight: tokens.typography.semibold,
|
|
161
|
-
textAlign: 'center',
|
|
162
|
-
},
|
|
163
|
-
});
|
|
164
|
-
// =============================================================================
|
|
165
|
-
// EXPORTS
|
|
166
|
-
// =============================================================================
|
|
167
|
-
export default AtomicBadge;
|
|
168
|
-
//# sourceMappingURL=AtomicBadge.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AtomicBadge.js","sourceRoot":"","sources":["../../../src/presentation/atoms/AtomicBadge.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,UAAU,EAAmC,MAAM,cAAc,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AA8BhE,gFAAgF;AAChF,qBAAqB;AACrB,gFAAgF;AAEhF,MAAM,aAAa,GAAG,CAAC,MAAoB,EAAE,EAAE,CAAC,CAAC;IAC/C,EAAE,EAAE;QACF,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE;QAC5B,iBAAiB,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE;QACpC,QAAQ,EAAE,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ;QAC/C,YAAY,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;KACvC;IACD,EAAE,EAAE;QACF,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE;QAC5B,iBAAiB,EAAE,MAAM,CAA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GAAG,CAAC,KAAgC,EAAE,aAAqB,EAAE,MAA6C,EAAU,EAAE;IACzI,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,QAAQ;YACX,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,+BAA+B;QACpE,KAAK,QAAQ;YACX,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAClC,KAAK,SAAS,CAAC;QACf;YACE,OAAO,aAAa,CAAC;IACzB,CAAC;AACH,CAAC,CAAC;AAEF,gFAAgF;AAChF,SAAS;AACT,gFAAgF;AAEhF,MAAM,SAAS,GAAG,CAAC,MAA6C,EAAE,EAAE,CAClE,UAAU,CAAC,MAAM,CAAC;IAChB,SAAS,EAAE;QACT,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;QACpB,SAAS,EAAE,YAAY;KACxB;IACD,IAAI,EAAE;QACJ,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,QAAQ;QACtC,SAAS,EAAE,QAAQ;KACpB;CACF,CAAC,CAAC;AAEL,gFAAgF;AAChF,UAAU;AACV,gFAAgF;AAEhF,eAAe,WAAW,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { StyleProp, ViewStyle, TextStyle } from 'react-native';
|
|
3
|
-
import type { IconName } from '@umituz/react-native-icon';
|
|
4
|
-
export type ButtonVariant = 'primary' | 'secondary' | 'outline' | 'text' | 'danger';
|
|
5
|
-
export type ButtonSize = 'sm' | 'md' | 'lg';
|
|
6
|
-
export interface AtomicButtonProps {
|
|
7
|
-
title?: string;
|
|
8
|
-
children?: React.ReactNode;
|
|
9
|
-
onPress: () => void;
|
|
10
|
-
variant?: ButtonVariant;
|
|
11
|
-
size?: ButtonSize;
|
|
12
|
-
disabled?: boolean;
|
|
13
|
-
icon?: IconName;
|
|
14
|
-
fullWidth?: boolean;
|
|
15
|
-
style?: StyleProp<ViewStyle>;
|
|
16
|
-
textStyle?: StyleProp<TextStyle>;
|
|
17
|
-
testID?: string;
|
|
18
|
-
}
|
|
19
|
-
export declare const AtomicButton: React.FC<AtomicButtonProps>;
|
|
20
|
-
export type { AtomicButtonProps as ButtonProps };
|
|
21
|
-
//# sourceMappingURL=AtomicButton.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AtomicButton.d.ts","sourceRoot":"","sources":["../../../src/presentation/atoms/AtomicButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAc,SAAS,EAAE,SAAS,EAAE,SAAS,EAA0B,MAAM,cAAc,CAAC;AAInG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAE1D,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;AACpF,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE5C,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAwLpD,CAAC;AA2BF,YAAY,EAAE,iBAAiB,IAAI,WAAW,EAAE,CAAC"}
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { StyleSheet, TouchableOpacity, View } from 'react-native';
|
|
3
|
-
import { AtomicText } from './AtomicText';
|
|
4
|
-
import { Icon } from '@umituz/react-native-icon';
|
|
5
|
-
import { useAppDesignTokens } from '@umituz/react-native-theme';
|
|
6
|
-
export const AtomicButton = ({ title, children, onPress, variant = 'primary', size = 'md', disabled = false, icon, fullWidth = false, style, textStyle, testID, }) => {
|
|
7
|
-
const tokens = useAppDesignTokens();
|
|
8
|
-
const handlePress = () => {
|
|
9
|
-
if (!disabled) {
|
|
10
|
-
onPress();
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
// Size configurations
|
|
14
|
-
const sizeConfig = {
|
|
15
|
-
sm: {
|
|
16
|
-
paddingVertical: tokens.spacing.xs,
|
|
17
|
-
paddingHorizontal: tokens.spacing.sm,
|
|
18
|
-
fontSize: tokens.typography.bodySmall.fontSize,
|
|
19
|
-
iconSize: 16,
|
|
20
|
-
minHeight: 32,
|
|
21
|
-
},
|
|
22
|
-
md: {
|
|
23
|
-
paddingVertical: tokens.spacing.sm,
|
|
24
|
-
paddingHorizontal: tokens.spacing.md,
|
|
25
|
-
fontSize: tokens.typography.bodyMedium.fontSize,
|
|
26
|
-
iconSize: 20,
|
|
27
|
-
minHeight: 44,
|
|
28
|
-
},
|
|
29
|
-
lg: {
|
|
30
|
-
paddingVertical: tokens.spacing.md,
|
|
31
|
-
paddingHorizontal: tokens.spacing.lg,
|
|
32
|
-
fontSize: tokens.typography.bodyLarge.fontSize,
|
|
33
|
-
iconSize: 24,
|
|
34
|
-
minHeight: 52,
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
const config = sizeConfig[size];
|
|
38
|
-
// Variant styles
|
|
39
|
-
const getVariantStyles = () => {
|
|
40
|
-
const baseStyle = {
|
|
41
|
-
backgroundColor: tokens.colors.primary,
|
|
42
|
-
borderWidth: 0,
|
|
43
|
-
};
|
|
44
|
-
const baseTextStyle = {
|
|
45
|
-
color: tokens.colors.textInverse,
|
|
46
|
-
};
|
|
47
|
-
switch (variant) {
|
|
48
|
-
case 'primary':
|
|
49
|
-
return {
|
|
50
|
-
container: {
|
|
51
|
-
...baseStyle,
|
|
52
|
-
backgroundColor: tokens.colors.primary,
|
|
53
|
-
},
|
|
54
|
-
text: {
|
|
55
|
-
...baseTextStyle,
|
|
56
|
-
color: tokens.colors.textInverse,
|
|
57
|
-
},
|
|
58
|
-
};
|
|
59
|
-
case 'secondary':
|
|
60
|
-
return {
|
|
61
|
-
container: {
|
|
62
|
-
...baseStyle,
|
|
63
|
-
backgroundColor: tokens.colors.surfaceSecondary,
|
|
64
|
-
},
|
|
65
|
-
text: {
|
|
66
|
-
...baseTextStyle,
|
|
67
|
-
color: tokens.colors.textPrimary,
|
|
68
|
-
},
|
|
69
|
-
};
|
|
70
|
-
case 'outline':
|
|
71
|
-
return {
|
|
72
|
-
container: {
|
|
73
|
-
...baseStyle,
|
|
74
|
-
backgroundColor: 'transparent',
|
|
75
|
-
borderWidth: 1,
|
|
76
|
-
borderColor: tokens.colors.border,
|
|
77
|
-
},
|
|
78
|
-
text: {
|
|
79
|
-
...baseTextStyle,
|
|
80
|
-
color: tokens.colors.textPrimary,
|
|
81
|
-
},
|
|
82
|
-
};
|
|
83
|
-
case 'text':
|
|
84
|
-
return {
|
|
85
|
-
container: {
|
|
86
|
-
...baseStyle,
|
|
87
|
-
backgroundColor: 'transparent',
|
|
88
|
-
},
|
|
89
|
-
text: {
|
|
90
|
-
...baseTextStyle,
|
|
91
|
-
color: tokens.colors.primary,
|
|
92
|
-
},
|
|
93
|
-
};
|
|
94
|
-
case 'danger':
|
|
95
|
-
return {
|
|
96
|
-
container: {
|
|
97
|
-
...baseStyle,
|
|
98
|
-
backgroundColor: tokens.colors.error,
|
|
99
|
-
},
|
|
100
|
-
text: {
|
|
101
|
-
...baseTextStyle,
|
|
102
|
-
color: tokens.colors.textInverse,
|
|
103
|
-
},
|
|
104
|
-
};
|
|
105
|
-
default:
|
|
106
|
-
return {
|
|
107
|
-
container: baseStyle,
|
|
108
|
-
text: baseTextStyle,
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
const variantStyles = getVariantStyles();
|
|
113
|
-
const containerStyle = [
|
|
114
|
-
styles.button,
|
|
115
|
-
{
|
|
116
|
-
paddingVertical: config.paddingVertical,
|
|
117
|
-
paddingHorizontal: config.paddingHorizontal,
|
|
118
|
-
minHeight: config.minHeight,
|
|
119
|
-
borderRadius: tokens.borders.radius.md,
|
|
120
|
-
},
|
|
121
|
-
variantStyles.container,
|
|
122
|
-
fullWidth ? styles.fullWidth : undefined,
|
|
123
|
-
disabled ? styles.disabled : undefined,
|
|
124
|
-
style,
|
|
125
|
-
];
|
|
126
|
-
const buttonTextStyle = [
|
|
127
|
-
{
|
|
128
|
-
fontSize: config.fontSize,
|
|
129
|
-
fontWeight: '600',
|
|
130
|
-
},
|
|
131
|
-
variantStyles.text,
|
|
132
|
-
disabled ? styles.disabledText : undefined,
|
|
133
|
-
textStyle,
|
|
134
|
-
];
|
|
135
|
-
const buttonText = title || children;
|
|
136
|
-
const showIcon = icon;
|
|
137
|
-
const iconColor = variantStyles.text.color;
|
|
138
|
-
return (<TouchableOpacity style={containerStyle} onPress={handlePress} activeOpacity={0.8} disabled={disabled} testID={testID}>
|
|
139
|
-
<View style={styles.content}>
|
|
140
|
-
{showIcon ? (<Icon name={icon} customSize={config.iconSize} customColor={typeof iconColor === 'string' ? iconColor : undefined} style={styles.icon}/>) : null}
|
|
141
|
-
|
|
142
|
-
<AtomicText style={buttonTextStyle}>
|
|
143
|
-
{buttonText}
|
|
144
|
-
</AtomicText>
|
|
145
|
-
</View>
|
|
146
|
-
</TouchableOpacity>);
|
|
147
|
-
};
|
|
148
|
-
const styles = StyleSheet.create({
|
|
149
|
-
button: {
|
|
150
|
-
alignItems: 'center',
|
|
151
|
-
justifyContent: 'center',
|
|
152
|
-
flexDirection: 'row',
|
|
153
|
-
},
|
|
154
|
-
content: {
|
|
155
|
-
flexDirection: 'row',
|
|
156
|
-
alignItems: 'center',
|
|
157
|
-
justifyContent: 'center',
|
|
158
|
-
},
|
|
159
|
-
fullWidth: {
|
|
160
|
-
width: '100%',
|
|
161
|
-
},
|
|
162
|
-
disabled: {
|
|
163
|
-
opacity: 0.5,
|
|
164
|
-
},
|
|
165
|
-
disabledText: {
|
|
166
|
-
opacity: 0.7,
|
|
167
|
-
},
|
|
168
|
-
icon: {
|
|
169
|
-
marginRight: 8,
|
|
170
|
-
},
|
|
171
|
-
});
|
|
172
|
-
//# sourceMappingURL=AtomicButton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AtomicButton.js","sourceRoot":"","sources":["../../../src/presentation/atoms/AtomicButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAmC,gBAAgB,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACnG,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAoBhE,MAAM,CAAC,MAAM,YAAY,GAAgC,CAAC,EACxD,KAAK,EACL,QAAQ,EACR,OAAO,EACP,OAAO,GAAG,SAAS,EACnB,IAAI,GAAG,IAAI,EACX,QAAQ,GAAG,KAAK,EAChB,IAAI,EACJ,SAAS,GAAG,KAAK,EACjB,KAAK,EACL,SAAS,EACT,MAAM,GACP,EAAE,EAAE;IACH,MAAM,MAAM,GAAG,kBAAkB,EAAE,CAAC;IAEpC,MAAM,WAAW,GAAG,GAAG,EAAE;QACvB,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC,CAAC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,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CACnE,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EACnB,CACH,CAAC,CAAC,CAAC,IAAI,CAER;;QAAA,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,eAAe,CAAC,CACjC;UAAA,CAAC,UAAU,CACb;QAAA,EAAE,UAAU,CACd;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,gBAAgB,CAAC,CACpB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,MAAM,EAAE;QACN,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;QACxB,aAAa,EAAE,KAAK;KACrB;IACD,OAAO,EAAE;QACP,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;KACzB;IACD,SAAS,EAAE;QACT,KAAK,EAAE,MAAM;KACd;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,GAAG;KACb;IACD,YAAY,EAAE;QACZ,OAAO,EAAE,GAAG;KACb;IACD,IAAI,EAAE;QACJ,WAAW,EAAE,CAAC;KACf;CACF,CAAC,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
-
export type AtomicCardVariant = 'flat' | 'elevated' | 'outlined';
|
|
4
|
-
export type AtomicCardPadding = 'none' | 'sm' | 'md' | 'lg' | 'xl';
|
|
5
|
-
export interface AtomicCardProps {
|
|
6
|
-
variant?: AtomicCardVariant;
|
|
7
|
-
padding?: AtomicCardPadding;
|
|
8
|
-
onPress?: () => void;
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
style?: StyleProp<ViewStyle>;
|
|
11
|
-
children?: React.ReactNode;
|
|
12
|
-
testID?: string;
|
|
13
|
-
}
|
|
14
|
-
export declare const AtomicCard: React.FC<AtomicCardProps>;
|
|
15
|
-
//# sourceMappingURL=AtomicCard.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AtomicCard.d.ts","sourceRoot":"","sources":["../../../src/presentation/atoms/AtomicCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAQ,SAAS,EAAE,SAAS,EAAa,MAAM,cAAc,CAAC;AAGrE,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,CAAC;AACjE,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEnE,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAGD,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAwFhD,CAAC"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { View, Pressable } from 'react-native';
|
|
3
|
-
import { useAppDesignTokens } from '@umituz/react-native-theme';
|
|
4
|
-
export const AtomicCard = ({ variant = 'elevated', padding = 'md', onPress, disabled = false, style, children, testID, }) => {
|
|
5
|
-
const tokens = useAppDesignTokens();
|
|
6
|
-
const handlePress = () => {
|
|
7
|
-
if (onPress && !disabled) {
|
|
8
|
-
onPress();
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
// Map padding to token values
|
|
12
|
-
const getPaddingValue = () => {
|
|
13
|
-
const paddingMap = {
|
|
14
|
-
none: 0,
|
|
15
|
-
sm: tokens.spacing.sm,
|
|
16
|
-
md: tokens.spacing.md,
|
|
17
|
-
lg: tokens.spacing.lg,
|
|
18
|
-
xl: tokens.spacing.xl,
|
|
19
|
-
};
|
|
20
|
-
return paddingMap[padding];
|
|
21
|
-
};
|
|
22
|
-
// Get variant styles
|
|
23
|
-
const getVariantStyle = () => {
|
|
24
|
-
const baseStyle = {
|
|
25
|
-
backgroundColor: tokens.colors.surface,
|
|
26
|
-
borderRadius: tokens.borders.radius.md,
|
|
27
|
-
};
|
|
28
|
-
switch (variant) {
|
|
29
|
-
case 'elevated':
|
|
30
|
-
return {
|
|
31
|
-
...baseStyle,
|
|
32
|
-
borderWidth: 1,
|
|
33
|
-
borderColor: tokens.colors.border,
|
|
34
|
-
};
|
|
35
|
-
case 'outlined':
|
|
36
|
-
return {
|
|
37
|
-
...baseStyle,
|
|
38
|
-
borderWidth: 1,
|
|
39
|
-
borderColor: tokens.colors.border,
|
|
40
|
-
};
|
|
41
|
-
case 'flat':
|
|
42
|
-
return {
|
|
43
|
-
...baseStyle,
|
|
44
|
-
borderWidth: 0,
|
|
45
|
-
};
|
|
46
|
-
default:
|
|
47
|
-
return baseStyle;
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
const cardStyle = [
|
|
51
|
-
getVariantStyle(),
|
|
52
|
-
{
|
|
53
|
-
padding: getPaddingValue(),
|
|
54
|
-
opacity: disabled ? 0.5 : 1,
|
|
55
|
-
},
|
|
56
|
-
style,
|
|
57
|
-
];
|
|
58
|
-
const cardContent = (<View style={cardStyle} testID={testID}>
|
|
59
|
-
{children}
|
|
60
|
-
</View>);
|
|
61
|
-
// If onPress provided, wrap with pressable
|
|
62
|
-
if (onPress && !disabled) {
|
|
63
|
-
return (<Pressable onPress={handlePress}>
|
|
64
|
-
{cardContent}
|
|
65
|
-
</Pressable>);
|
|
66
|
-
}
|
|
67
|
-
// Otherwise just return static card
|
|
68
|
-
return cardContent;
|
|
69
|
-
};
|
|
70
|
-
//# sourceMappingURL=AtomicCard.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AtomicCard.js","sourceRoot":"","sources":["../../../src/presentation/atoms/AtomicCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAwB,SAAS,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAgBhE,MAAM,CAAC,MAAM,UAAU,GAA8B,CAAC,EACpD,OAAO,GAAG,UAAU,EACpB,OAAO,GAAG,IAAI,EACd,OAAO,EACP,QAAQ,GAAG,KAAK,EAChB,KAAK,EACL,QAAQ,EACR,MAAM,GACP,EAAE,EAAE;IACH,MAAM,MAAM,GAAG,kBAAkB,EAAE,CAAC;IAEpC,MAAM,WAAW,GAAG,GAAG,EAAE;QACvB,IAAI,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;YACzB,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC,CAAC;IAEF,8BAA8B;IAC9B,MAAM,eAAe,GAAG,GAAW,EAAE;QACnC,MAAM,UAAU,GAAG;YACjB,IAAI,EAAE,CAAC;YACP,EAAE,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE;YACrB,EAAE,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE;YACrB,EAAE,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE;YACrB,EAAE,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE;SACtB,CAAC;QACF,OAAO,UAAU,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC,CAAC;IAEF,qBAAqB;IACrB,MAAM,eAAe,GAAG,GAAc,EAAE;QACtC,MAAM,SAAS,GAAc;YAC3B,eAAe,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO;YACtC,YAAY,EAAE,MAAM,CAAC,OAAO,CAAC,MAA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5
|
-
* Theme: {{THEME_NAME}} ({{CATEGORY}} category)
|
|
6
|
-
*
|
|
7
|
-
* Atomic Design Level: ATOM
|
|
8
|
-
* Purpose: Tag and label display
|
|
9
|
-
*
|
|
10
|
-
* Usage:
|
|
11
|
-
* - Category tags
|
|
12
|
-
* - Status indicators
|
|
13
|
-
* - Filter chips
|
|
14
|
-
* - Skill labels
|
|
15
|
-
* - Badge displays
|
|
16
|
-
*/
|
|
17
|
-
import React from 'react';
|
|
18
|
-
import { ViewStyle } from 'react-native';
|
|
19
|
-
export interface AtomicChipProps {
|
|
20
|
-
/** Text content of the chip */
|
|
21
|
-
children: React.ReactNode;
|
|
22
|
-
/** Chip variant */
|
|
23
|
-
variant?: 'filled' | 'outlined' | 'soft';
|
|
24
|
-
/** Chip size */
|
|
25
|
-
size?: 'sm' | 'md' | 'lg';
|
|
26
|
-
/** Chip color theme */
|
|
27
|
-
color?: 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'info';
|
|
28
|
-
/** Custom background color */
|
|
29
|
-
backgroundColor?: string;
|
|
30
|
-
/** Custom text color */
|
|
31
|
-
textColor?: string;
|
|
32
|
-
/** Custom border color */
|
|
33
|
-
borderColor?: string;
|
|
34
|
-
/** Leading icon */
|
|
35
|
-
leadingIcon?: string;
|
|
36
|
-
/** Trailing icon */
|
|
37
|
-
trailingIcon?: string;
|
|
38
|
-
/** Whether the chip is clickable */
|
|
39
|
-
clickable?: boolean;
|
|
40
|
-
/** Click handler */
|
|
41
|
-
onPress?: () => void;
|
|
42
|
-
/** Whether the chip is selected */
|
|
43
|
-
selected?: boolean;
|
|
44
|
-
/** Whether the chip is disabled */
|
|
45
|
-
disabled?: boolean;
|
|
46
|
-
/** Style overrides */
|
|
47
|
-
style?: ViewStyle;
|
|
48
|
-
/** Test ID for testing */
|
|
49
|
-
testID?: string;
|
|
50
|
-
}
|
|
51
|
-
export declare const AtomicChip: React.FC<AtomicChipProps>;
|
|
52
|
-
export default AtomicChip;
|
|
53
|
-
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C,EAAE,CAAC,eAAe,CAwJhD,CAAC;AAMF,eAAe,UAAU,CAAC"}
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AtomicChip - Universal Chip/Tag Component
|
|
3
|
-
*
|
|
4
|
-
* Displays small tags, labels, or status indicators
|
|
5
|
-
* Theme: {{THEME_NAME}} ({{CATEGORY}} category)
|
|
6
|
-
*
|
|
7
|
-
* Atomic Design Level: ATOM
|
|
8
|
-
* Purpose: Tag and label display
|
|
9
|
-
*
|
|
10
|
-
* Usage:
|
|
11
|
-
* - Category tags
|
|
12
|
-
* - Status indicators
|
|
13
|
-
* - Filter chips
|
|
14
|
-
* - Skill labels
|
|
15
|
-
* - Badge displays
|
|
16
|
-
*/
|
|
17
|
-
import React from 'react';
|
|
18
|
-
import { View, TouchableOpacity } from 'react-native';
|
|
19
|
-
import { AtomicText } from './AtomicText';
|
|
20
|
-
import { AtomicIcon } from './AtomicIcon';
|
|
21
|
-
import { useAppDesignTokens } from '@umituz/react-native-theme';
|
|
22
|
-
// =============================================================================
|
|
23
|
-
// COMPONENT IMPLEMENTATION
|
|
24
|
-
// =============================================================================
|
|
25
|
-
export const AtomicChip = ({ children, variant = 'filled', size = 'md', color = 'primary', backgroundColor, textColor, borderColor, leadingIcon, trailingIcon, clickable = false, onPress, selected = false, disabled = false, style, testID, }) => {
|
|
26
|
-
const tokens = useAppDesignTokens();
|
|
27
|
-
// Size mapping
|
|
28
|
-
const sizeMap = {
|
|
29
|
-
sm: {
|
|
30
|
-
paddingHorizontal: tokens.spacing.sm,
|
|
31
|
-
paddingVertical: tokens.spacing.xs,
|
|
32
|
-
fontSize: tokens.typography.bodySmall.fontSize,
|
|
33
|
-
iconSize: 'xs'
|
|
34
|
-
},
|
|
35
|
-
md: {
|
|
36
|
-
paddingHorizontal: tokens.spacing.md,
|
|
37
|
-
paddingVertical: tokens.spacing.sm,
|
|
38
|
-
fontSize: tokens.typography.bodyMedium.fontSize,
|
|
39
|
-
iconSize: 'sm'
|
|
40
|
-
},
|
|
41
|
-
lg: {
|
|
42
|
-
paddingHorizontal: tokens.spacing.md,
|
|
43
|
-
paddingVertical: tokens.spacing.sm,
|
|
44
|
-
fontSize: tokens.typography.bodyLarge.fontSize,
|
|
45
|
-
iconSize: 'sm'
|
|
46
|
-
},
|
|
47
|
-
};
|
|
48
|
-
const sizeConfig = sizeMap[size];
|
|
49
|
-
// Color mapping
|
|
50
|
-
const colorMap = {
|
|
51
|
-
primary: {
|
|
52
|
-
filled: { bg: tokens.colors.primary, text: tokens.colors.onPrimary, border: tokens.colors.primary },
|
|
53
|
-
outlined: { bg: 'transparent', text: tokens.colors.primary, border: tokens.colors.primary },
|
|
54
|
-
soft: { bg: tokens.colors.primaryContainer, text: tokens.colors.onPrimaryContainer, border: 'transparent' },
|
|
55
|
-
},
|
|
56
|
-
secondary: {
|
|
57
|
-
filled: { bg: tokens.colors.secondary, text: tokens.colors.onSecondary, border: tokens.colors.secondary },
|
|
58
|
-
outlined: { bg: 'transparent', text: tokens.colors.secondary, border: tokens.colors.secondary },
|
|
59
|
-
soft: { bg: tokens.colors.secondaryContainer, text: tokens.colors.onSecondaryContainer, border: 'transparent' },
|
|
60
|
-
},
|
|
61
|
-
success: {
|
|
62
|
-
filled: { bg: tokens.colors.success, text: tokens.colors.onSuccess, border: tokens.colors.success },
|
|
63
|
-
outlined: { bg: 'transparent', text: tokens.colors.success, border: tokens.colors.success },
|
|
64
|
-
soft: { bg: tokens.colors.successContainer, text: tokens.colors.onSuccessContainer, border: 'transparent' },
|
|
65
|
-
},
|
|
66
|
-
warning: {
|
|
67
|
-
filled: { bg: tokens.colors.warning, text: tokens.colors.onWarning, border: tokens.colors.warning },
|
|
68
|
-
outlined: { bg: 'transparent', text: tokens.colors.warning, border: tokens.colors.warning },
|
|
69
|
-
soft: { bg: tokens.colors.warningContainer, text: tokens.colors.onWarningContainer, border: 'transparent' },
|
|
70
|
-
},
|
|
71
|
-
error: {
|
|
72
|
-
filled: { bg: tokens.colors.error, text: tokens.colors.onError, border: tokens.colors.error },
|
|
73
|
-
outlined: { bg: 'transparent', text: tokens.colors.error, border: tokens.colors.error },
|
|
74
|
-
soft: { bg: tokens.colors.errorContainer, text: tokens.colors.onErrorContainer, border: 'transparent' },
|
|
75
|
-
},
|
|
76
|
-
info: {
|
|
77
|
-
filled: { bg: tokens.colors.info, text: tokens.colors.onInfo, border: tokens.colors.info },
|
|
78
|
-
outlined: { bg: 'transparent', text: tokens.colors.info, border: tokens.colors.info },
|
|
79
|
-
soft: { bg: tokens.colors.infoContainer, text: tokens.colors.onInfoContainer, border: 'transparent' },
|
|
80
|
-
},
|
|
81
|
-
};
|
|
82
|
-
const colorConfig = colorMap[color][variant];
|
|
83
|
-
// Apply custom colors if provided
|
|
84
|
-
const finalBackgroundColor = backgroundColor || colorConfig.bg;
|
|
85
|
-
const finalTextColor = textColor || colorConfig.text;
|
|
86
|
-
const finalBorderColor = borderColor || colorConfig.border;
|
|
87
|
-
// Handle disabled state
|
|
88
|
-
const isDisabled = disabled || (!clickable && !onPress);
|
|
89
|
-
const opacity = isDisabled ? 0.5 : 1;
|
|
90
|
-
// Handle selected state
|
|
91
|
-
const selectedStyle = selected ? {
|
|
92
|
-
borderWidth: tokens.borders.width.medium,
|
|
93
|
-
borderColor: tokens.colors.primary,
|
|
94
|
-
} : {};
|
|
95
|
-
const chipStyle = {
|
|
96
|
-
flexDirection: 'row',
|
|
97
|
-
alignItems: 'center',
|
|
98
|
-
justifyContent: 'center',
|
|
99
|
-
paddingHorizontal: sizeConfig.paddingHorizontal,
|
|
100
|
-
paddingVertical: sizeConfig.paddingVertical,
|
|
101
|
-
backgroundColor: finalBackgroundColor,
|
|
102
|
-
borderRadius: tokens.borders.radius.xl,
|
|
103
|
-
borderWidth: variant === 'outlined' ? 1 : 0,
|
|
104
|
-
borderColor: finalBorderColor,
|
|
105
|
-
opacity,
|
|
106
|
-
...selectedStyle,
|
|
107
|
-
};
|
|
108
|
-
const textStyle = {
|
|
109
|
-
fontSize: sizeConfig.fontSize,
|
|
110
|
-
fontWeight: tokens.typography.medium,
|
|
111
|
-
};
|
|
112
|
-
const iconColor = finalTextColor;
|
|
113
|
-
const content = (<View style={[chipStyle, style]} testID={testID}>
|
|
114
|
-
{leadingIcon && (<AtomicIcon name={leadingIcon} size={sizeConfig.iconSize} customColor={iconColor} style={{ marginRight: tokens.spacing.xs }}/>)}
|
|
115
|
-
<AtomicText type="labelMedium" color={finalTextColor} style={textStyle}>
|
|
116
|
-
{children}
|
|
117
|
-
</AtomicText>
|
|
118
|
-
{trailingIcon && (<AtomicIcon name={trailingIcon} size={sizeConfig.iconSize} customColor={iconColor} style={{ marginLeft: tokens.spacing.xs }}/>)}
|
|
119
|
-
</View>);
|
|
120
|
-
if (clickable && onPress && !disabled) {
|
|
121
|
-
return (<TouchableOpacity onPress={onPress} activeOpacity={0.7}>
|
|
122
|
-
{content}
|
|
123
|
-
</TouchableOpacity>);
|
|
124
|
-
}
|
|
125
|
-
return content;
|
|
126
|
-
};
|
|
127
|
-
// =============================================================================
|
|
128
|
-
// EXPORTS
|
|
129
|
-
// =============================================================================
|
|
130
|
-
export default AtomicChip;
|
|
131
|
-
//# sourceMappingURL=AtomicChip.js.map
|