@umituz/react-native-design-system 2.6.104 → 2.6.105

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-design-system",
3
- "version": "2.6.104",
3
+ "version": "2.6.105",
4
4
  "description": "Universal design system for React Native apps - Consolidated package with atoms, molecules, organisms, theme, typography, responsive and safe area utilities",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -0,0 +1,183 @@
1
+ /**
2
+ * AtomicCard
3
+ *
4
+ * Unified card component that handles base card states, media, info, and glowing effects.
5
+ * Replaces InfoCard, MediaCard, and GlowingCard molecules.
6
+ */
7
+
8
+ import React, { useMemo } from 'react';
9
+ import {
10
+ View,
11
+ Image,
12
+ Pressable,
13
+ type GestureResponderEvent,
14
+ } from 'react-native';
15
+ import { AtomicText } from '../AtomicText';
16
+ import { AtomicIcon } from '../AtomicIcon';
17
+ import { useAppDesignTokens } from '../../theme';
18
+ import { getCardVariantStyles, cardStyles } from './styles/cardStyles';
19
+ import { getCardPadding } from './configs/cardPaddingConfig';
20
+ import type { AtomicCardProps } from './types';
21
+
22
+ export const AtomicCard: React.FC<AtomicCardProps> = ({
23
+ children,
24
+ variant = 'elevated',
25
+ padding = 'md',
26
+ title,
27
+ subtitle,
28
+ description,
29
+ image,
30
+ imageAspectRatio = 1.6,
31
+ badge,
32
+ leftIcon,
33
+ rightIcon,
34
+ selected = false,
35
+ glowColor,
36
+ glowIntensity = 1,
37
+ onPress,
38
+ disabled = false,
39
+ style,
40
+ titleStyle,
41
+ subtitleStyle,
42
+ descriptionStyle,
43
+ testID,
44
+ }) => {
45
+ const tokens = useAppDesignTokens();
46
+
47
+ const variantStyles = useMemo(() => {
48
+ const base = getCardVariantStyles(variant, tokens);
49
+ if (variant === 'glowing' && glowColor) {
50
+ return {
51
+ ...base,
52
+ container: {
53
+ ...base.container,
54
+ borderColor: glowColor,
55
+ borderWidth: 2 * glowIntensity,
56
+ }
57
+ };
58
+ }
59
+ return base;
60
+ }, [variant, tokens, glowColor, glowIntensity]);
61
+
62
+ const paddingValue = getCardPadding(padding, tokens);
63
+
64
+ const containerStyle = [
65
+ cardStyles.container,
66
+ { borderRadius: tokens.borders.radius.lg },
67
+ variantStyles.container,
68
+ selected && { borderColor: tokens.colors.primary, borderWidth: 2 },
69
+ style,
70
+ ];
71
+
72
+ const handlePress = (event: GestureResponderEvent) => {
73
+ if (!disabled && onPress) {
74
+ onPress(event);
75
+ }
76
+ };
77
+
78
+ const renderContent = () => (
79
+ <>
80
+ {/* Badge */}
81
+ {badge && (
82
+ <View style={[cardStyles.badge, { backgroundColor: tokens.colors.primary }]}>
83
+ <AtomicText type="labelSmall" color="onPrimary">
84
+ {badge}
85
+ </AtomicText>
86
+ </View>
87
+ )}
88
+
89
+ {/* Media */}
90
+ {image && (
91
+ <Image
92
+ source={typeof image === 'string' ? { uri: image } : image}
93
+ style={[cardStyles.image, { aspectRatio: imageAspectRatio }]}
94
+ resizeMode="cover"
95
+ />
96
+ )}
97
+
98
+ {/* Selected Indicator */}
99
+ {selected && (
100
+ <View style={cardStyles.selectedOverlay}>
101
+ <AtomicIcon name="checkmark-circle" color="primary" size="md" />
102
+ </View>
103
+ )}
104
+
105
+ {/* Text Content */}
106
+ <View style={{ padding: paddingValue }}>
107
+ {(title || leftIcon || rightIcon) && (
108
+ <View style={cardStyles.header}>
109
+ {leftIcon && (
110
+ <AtomicIcon
111
+ name={leftIcon}
112
+ size="sm"
113
+ color="primary"
114
+ style={{ marginRight: 8 }}
115
+ />
116
+ )}
117
+ <View style={cardStyles.titleContainer}>
118
+ {title && (
119
+ <AtomicText
120
+ type="titleMedium"
121
+ style={[cardStyles.title, titleStyle]}
122
+ >
123
+ {title}
124
+ </AtomicText>
125
+ )}
126
+ {subtitle && (
127
+ <AtomicText
128
+ type="bodySmall"
129
+ color="textSecondary"
130
+ style={[cardStyles.subtitle, subtitleStyle]}
131
+ >
132
+ {subtitle}
133
+ </AtomicText>
134
+ )}
135
+ </View>
136
+ {rightIcon && (
137
+ <AtomicIcon
138
+ name={rightIcon}
139
+ size="sm"
140
+ color="textSecondary"
141
+ style={{ marginLeft: 8 }}
142
+ />
143
+ )}
144
+ </View>
145
+ )}
146
+
147
+ {description && (
148
+ <AtomicText
149
+ type="bodyMedium"
150
+ color="textSecondary"
151
+ style={[cardStyles.description, descriptionStyle]}
152
+ >
153
+ {description}
154
+ </AtomicText>
155
+ )}
156
+
157
+ {children}
158
+ </View>
159
+ </>
160
+ );
161
+
162
+ if (onPress) {
163
+ return (
164
+ <Pressable
165
+ onPress={handlePress}
166
+ disabled={disabled}
167
+ style={({ pressed }) => [
168
+ containerStyle,
169
+ pressed && !disabled && { opacity: 0.9, transform: [{ scale: 0.98 }] },
170
+ ]}
171
+ testID={testID}
172
+ >
173
+ {renderContent()}
174
+ </Pressable>
175
+ );
176
+ }
177
+
178
+ return (
179
+ <View style={containerStyle} testID={testID}>
180
+ {renderContent()}
181
+ </View>
182
+ );
183
+ };
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Card Padding Configurations
3
+ */
4
+
5
+ import type { DesignTokens } from '../../../theme';
6
+ import type { CardPadding } from '../types';
7
+
8
+ export const getCardPadding = (padding: CardPadding, tokens: DesignTokens): number => {
9
+ const paddingValues: Record<CardPadding, number> = {
10
+ none: 0,
11
+ xs: tokens.spacing.xs,
12
+ sm: tokens.spacing.sm,
13
+ md: tokens.spacing.md,
14
+ lg: tokens.spacing.lg,
15
+ xl: tokens.spacing.xl,
16
+ };
17
+
18
+ return paddingValues[padding] ?? tokens.spacing.md;
19
+ };
@@ -0,0 +1,2 @@
1
+ export * from './AtomicCard';
2
+ export * from './types';
@@ -0,0 +1,98 @@
1
+ /**
2
+ * Card Component Styles
3
+ */
4
+
5
+ import { StyleSheet, ViewStyle } from 'react-native';
6
+ import type { DesignTokens } from '../../../theme';
7
+ import type { CardVariant } from '../types';
8
+
9
+ export const getCardVariantStyles = (variant: CardVariant, tokens: DesignTokens) => {
10
+ const styles: Record<CardVariant, { container: ViewStyle }> = {
11
+ elevated: {
12
+ container: {
13
+ backgroundColor: tokens.colors.surface,
14
+ borderWidth: 1,
15
+ borderColor: tokens.colors.outlineVariant || '#E0E0E0',
16
+ },
17
+ },
18
+ outlined: {
19
+ container: {
20
+ backgroundColor: 'transparent',
21
+ borderWidth: 1,
22
+ borderColor: tokens.colors.outline,
23
+ },
24
+ },
25
+ filled: {
26
+ container: {
27
+ backgroundColor: tokens.colors.surfaceVariant,
28
+ borderWidth: 0,
29
+ },
30
+ },
31
+ glass: {
32
+ container: {
33
+ backgroundColor: 'rgba(255, 255, 255, 0.1)',
34
+ borderWidth: 1,
35
+ borderColor: 'rgba(255, 255, 255, 0.2)',
36
+ },
37
+ },
38
+ glowing: {
39
+ container: {
40
+ backgroundColor: tokens.colors.surface,
41
+ borderWidth: 2,
42
+ borderColor: tokens.colors.primary,
43
+ },
44
+ },
45
+ };
46
+
47
+ return styles[variant] || styles.elevated;
48
+ };
49
+
50
+ export const cardStyles = StyleSheet.create({
51
+ container: {
52
+ overflow: 'hidden',
53
+ width: '100%',
54
+ },
55
+ header: {
56
+ flexDirection: 'row',
57
+ alignItems: 'center',
58
+ marginBottom: 8,
59
+ },
60
+ titleContainer: {
61
+ flex: 1,
62
+ },
63
+ title: {
64
+ fontWeight: '700',
65
+ },
66
+ subtitle: {
67
+ marginTop: 2,
68
+ },
69
+ description: {
70
+ marginTop: 8,
71
+ },
72
+ image: {
73
+ width: '100%',
74
+ },
75
+ overlay: {
76
+ position: 'absolute',
77
+ bottom: 0,
78
+ left: 0,
79
+ right: 0,
80
+ backgroundColor: 'rgba(0,0,0,0.5)',
81
+ padding: 12,
82
+ },
83
+ badge: {
84
+ position: 'absolute',
85
+ top: 12,
86
+ right: 12,
87
+ paddingHorizontal: 8,
88
+ paddingVertical: 4,
89
+ borderRadius: 12,
90
+ zIndex: 10,
91
+ },
92
+ selectedOverlay: {
93
+ position: 'absolute',
94
+ top: 8,
95
+ right: 8,
96
+ zIndex: 11,
97
+ },
98
+ });
@@ -0,0 +1,77 @@
1
+ /**
2
+ * AtomicCard Type Definitions
3
+ */
4
+
5
+ import type { ReactNode } from 'react';
6
+ import type { StyleProp, ViewStyle, TextStyle, GestureResponderEvent, ImageSourcePropType } from 'react-native';
7
+
8
+ export type CardVariant = 'elevated' | 'outlined' | 'filled' | 'glass' | 'glowing';
9
+ export type CardPadding = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
10
+
11
+ export interface AtomicCardProps {
12
+ /** Main content of the card */
13
+ readonly children?: ReactNode;
14
+
15
+ /** Visual variant of the card */
16
+ readonly variant?: CardVariant;
17
+
18
+ /** Padding inside the card */
19
+ readonly padding?: CardPadding;
20
+
21
+ /** Optional title text */
22
+ readonly title?: string;
23
+
24
+ /** Optional subtitle text */
25
+ readonly subtitle?: string;
26
+
27
+ /** Optional description/content text */
28
+ readonly description?: string;
29
+
30
+ /** Image source to display */
31
+ readonly image?: string | ImageSourcePropType;
32
+
33
+ /** Whether the text should overlay the image */
34
+ readonly imageOverlay?: boolean;
35
+
36
+ /** Aspect ratio for the image */
37
+ readonly imageAspectRatio?: number;
38
+
39
+ /** Optional badge text displayed on corner */
40
+ readonly badge?: string;
41
+
42
+ /** Icon name to display on the left of title */
43
+ readonly leftIcon?: string;
44
+
45
+ /** Icon name to display on the right of title */
46
+ readonly rightIcon?: string;
47
+
48
+ /** Whether the card is in a selected state */
49
+ readonly selected?: boolean;
50
+
51
+ /** Color for the glow effect if variant is 'glowing' */
52
+ readonly glowColor?: string;
53
+
54
+ /** Intensity of the glow effect (0 to 1) */
55
+ readonly glowIntensity?: number;
56
+
57
+ /** Press handler */
58
+ readonly onPress?: (event: GestureResponderEvent) => void;
59
+
60
+ /** Whether the card is disabled */
61
+ readonly disabled?: boolean;
62
+
63
+ /** Custom container style */
64
+ readonly style?: StyleProp<ViewStyle>;
65
+
66
+ /** Custom title style */
67
+ readonly titleStyle?: StyleProp<TextStyle>;
68
+
69
+ /** Custom subtitle style */
70
+ readonly subtitleStyle?: StyleProp<TextStyle>;
71
+
72
+ /** Custom description style */
73
+ readonly descriptionStyle?: StyleProp<TextStyle>;
74
+
75
+ /** Test ID */
76
+ readonly testID?: string;
77
+ }
@@ -18,9 +18,9 @@ export { AtomicText, type AtomicTextProps } from './AtomicText';
18
18
  export {
19
19
  AtomicCard,
20
20
  type AtomicCardProps,
21
- type AtomicCardVariant,
22
- type AtomicCardPadding,
23
- } from './AtomicCard';
21
+ type CardVariant as AtomicCardVariant,
22
+ type CardPadding as AtomicCardPadding,
23
+ } from './card';
24
24
 
25
25
  // Input
26
26
  export {
@@ -42,7 +42,6 @@ export {
42
42
  type IconName,
43
43
  } from './AtomicIcon';
44
44
 
45
- export * from './AtomicIcon.types';
46
45
 
47
46
  // Avatar
48
47
  export { AtomicAvatar, type AtomicAvatarProps } from './AtomicAvatar';
@@ -23,11 +23,7 @@ export {
23
23
  type AvatarShape,
24
24
  type AvatarConfig,
25
25
  type AvatarType,
26
- // Media Card
27
- MediaCard,
28
- type MediaCardProps,
29
- type MediaCardSize,
30
- type MediaCardOverlayPosition,
26
+
31
27
  // Bottom Sheet
32
28
  BottomSheet,
33
29
  BottomSheetModal,
@@ -165,9 +161,7 @@ export {
165
161
  type SplashColors,
166
162
  type UseSplashFlowOptions,
167
163
  type UseSplashFlowResult,
168
- // GlowingCard
169
- GlowingCard,
170
- type GlowingCardProps,
164
+
171
165
  // Filter Group
172
166
  FilterGroup,
173
167
  type FilterGroupProps,
@@ -175,9 +169,7 @@ export {
175
169
  // Action Footer
176
170
  ActionFooter,
177
171
  type ActionFooterProps,
178
- // Info Card
179
- InfoCard,
180
- type InfoCardProps,
172
+
181
173
  // Hero Section
182
174
  HeroSection,
183
175
  type HeroSectionProps,
@@ -1,5 +1,5 @@
1
1
 
2
- import React from 'react';
2
+
3
3
  import { ViewStyle, StyleProp } from 'react-native';
4
4
 
5
5
  export interface ActionFooterProps {
@@ -1,6 +1,6 @@
1
1
 
2
2
  import React from 'react';
3
- import { ScrollView, StyleSheet, ViewStyle } from 'react-native';
3
+ import { ScrollView, StyleSheet } from 'react-native';
4
4
  import { AtomicChip } from '../../atoms/chip';
5
5
  import { useAppDesignTokens } from '../../theme';
6
6
  import type { FilterGroupProps } from './types';
@@ -1,5 +1,5 @@
1
1
 
2
- import React from 'react';
2
+
3
3
  import { ViewStyle, StyleProp, ImageSourcePropType } from 'react-native';
4
4
 
5
5
  export interface HeroSectionProps {
@@ -9,13 +9,7 @@ export * from './bottom-sheet';
9
9
  export { FormField, type FormFieldProps } from './FormField';
10
10
  export { ListItem, type ListItemProps } from './ListItem';
11
11
 
12
- // Media Card
13
- export { MediaCard } from './media-card';
14
- export type {
15
- MediaCardProps,
16
- MediaCardSize,
17
- MediaCardOverlayPosition,
18
- } from './media-card';
12
+
19
13
  export { SearchBar, type SearchBarProps } from './SearchBar';
20
14
  export { IconContainer } from './IconContainer';
21
15
  export { BaseModal, type BaseModalProps } from './BaseModal';
@@ -62,11 +56,10 @@ export * from './countdown';
62
56
  // Splash
63
57
  export * from './splash';
64
58
 
65
- // GlowingCard
66
- export { GlowingCard, type GlowingCardProps } from './GlowingCard';
59
+
67
60
  export * from './filter-group';
68
61
  export * from './action-footer';
69
- export * from './info-card';
62
+
70
63
  export * from './hero-section';
71
64
  export * from './info-grid';
72
65
 
@@ -1,10 +1,10 @@
1
1
 
2
2
  import React from 'react';
3
- import { View, StyleSheet, StyleProp, ViewStyle } from 'react-native';
3
+ import { View, StyleSheet } from 'react-native';
4
4
  import { AtomicText } from '../../atoms/AtomicText';
5
5
  import { AtomicIcon } from '../../atoms/AtomicIcon';
6
6
  import { useAppDesignTokens } from '../../theme';
7
- import type { InfoGridProps, InfoGridItem } from './types';
7
+ import type { InfoGridProps } from './types';
8
8
 
9
9
  export const InfoGrid: React.FC<InfoGridProps> = ({
10
10
  title,
@@ -9,7 +9,6 @@ import type { CustomThemeColors } from '../../core/CustomColors';
9
9
  import { SplashScreen } from '../../../molecules/splash';
10
10
  import type { SplashScreenProps } from '../../../molecules/splash/types';
11
11
 
12
- declare const __DEV__: boolean;
13
12
 
14
13
  interface DesignSystemProviderProps {
15
14
  /** App content */
@@ -1,104 +0,0 @@
1
- /**
2
- * AtomicCard Component
3
- *
4
- * A simple, styled card container component
5
- */
6
-
7
- import React from 'react';
8
- import {
9
- View,
10
- Pressable,
11
- StyleSheet,
12
- type ViewStyle,
13
- type StyleProp,
14
- type GestureResponderEvent,
15
- } from 'react-native';
16
- import { useAppDesignTokens } from '../theme';
17
-
18
- export type AtomicCardVariant = 'elevated' | 'outlined' | 'filled';
19
- export type AtomicCardPadding = 'none' | 'sm' | 'md' | 'lg';
20
-
21
- export interface AtomicCardProps {
22
- children: React.ReactNode;
23
- variant?: AtomicCardVariant;
24
- padding?: AtomicCardPadding;
25
- style?: StyleProp<ViewStyle>;
26
- testID?: string;
27
- onPress?: (event: GestureResponderEvent) => void;
28
- disabled?: boolean;
29
- }
30
-
31
- export const AtomicCard: React.FC<AtomicCardProps> = ({
32
- children,
33
- variant = 'elevated',
34
- padding = 'md',
35
- style,
36
- testID,
37
- onPress,
38
- disabled,
39
- }) => {
40
- const tokens = useAppDesignTokens();
41
-
42
- const paddingValues: Record<AtomicCardPadding, number> = {
43
- none: 0,
44
- sm: tokens.spacing.sm,
45
- md: tokens.spacing.md,
46
- lg: tokens.spacing.lg,
47
- };
48
-
49
- const getVariantStyle = (): ViewStyle => {
50
- switch (variant) {
51
- case 'elevated':
52
- return {
53
- backgroundColor: tokens.colors.surface,
54
- borderWidth: 1,
55
- borderColor: tokens.colors.outlineVariant || tokens.colors.outline,
56
- };
57
- case 'outlined':
58
- return {
59
- backgroundColor: tokens.colors.surface,
60
- borderWidth: 1,
61
- borderColor: tokens.colors.outline,
62
- };
63
- case 'filled':
64
- return {
65
- backgroundColor: tokens.colors.surfaceVariant,
66
- };
67
- default:
68
- return {};
69
- }
70
- };
71
-
72
- const cardStyle = [
73
- styles.card,
74
- { borderRadius: tokens.borders.radius.md },
75
- { padding: paddingValues[padding] },
76
- getVariantStyle(),
77
- style,
78
- ];
79
-
80
- if (onPress) {
81
- return (
82
- <Pressable
83
- style={cardStyle}
84
- testID={testID}
85
- onPress={onPress}
86
- disabled={disabled}
87
- >
88
- {children}
89
- </Pressable>
90
- );
91
- }
92
-
93
- return (
94
- <View style={cardStyle} testID={testID}>
95
- {children}
96
- </View>
97
- );
98
- };
99
-
100
- const styles = StyleSheet.create({
101
- card: {
102
- overflow: 'hidden',
103
- },
104
- });