@idealyst/components 1.0.23 → 1.0.25
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 +567 -567
- package/package.json +2 -6
- package/plugin/web.js +319 -185
- package/src/Avatar/Avatar.native.tsx +43 -43
- package/src/Avatar/Avatar.styles.tsx +66 -66
- package/src/Avatar/Avatar.web.tsx +50 -50
- package/src/Avatar/index.native.ts +1 -1
- package/src/Avatar/index.ts +1 -1
- package/src/Avatar/index.web.ts +1 -1
- package/src/Avatar/types.ts +42 -42
- package/src/Badge/Badge.native.tsx +42 -42
- package/src/Badge/Badge.styles.tsx +153 -153
- package/src/Badge/Badge.web.tsx +44 -44
- package/src/Badge/index.native.ts +1 -1
- package/src/Badge/index.ts +1 -1
- package/src/Badge/index.web.ts +1 -1
- package/src/Badge/types.ts +33 -33
- package/src/Button/Button.native.tsx +38 -38
- package/src/Button/Button.styles.tsx +214 -214
- package/src/Button/Button.types.ts +11 -11
- package/src/Button/Button.web.tsx +55 -55
- package/src/Button/index.native.ts +2 -2
- package/src/Button/index.ts +4 -4
- package/src/Button/index.web.ts +2 -2
- package/src/Button/types.ts +48 -48
- package/src/Card/Card.native.tsx +51 -51
- package/src/Card/Card.styles.tsx +239 -239
- package/src/Card/Card.web.tsx +61 -61
- package/src/Card/index.native.ts +2 -2
- package/src/Card/index.ts +4 -4
- package/src/Card/index.web.ts +2 -2
- package/src/Card/types.ts +58 -58
- package/src/Checkbox/Checkbox.native.tsx +98 -98
- package/src/Checkbox/Checkbox.styles.tsx +291 -291
- package/src/Checkbox/Checkbox.web.tsx +130 -130
- package/src/Checkbox/index.native.ts +2 -2
- package/src/Checkbox/index.ts +4 -4
- package/src/Checkbox/index.web.ts +2 -2
- package/src/Checkbox/types.ts +78 -78
- package/src/Divider/Divider.native.tsx +144 -144
- package/src/Divider/Divider.styles.tsx +601 -601
- package/src/Divider/Divider.web.tsx +72 -72
- package/src/Divider/index.native.ts +2 -2
- package/src/Divider/index.ts +4 -4
- package/src/Divider/index.web.ts +2 -2
- package/src/Divider/types.ts +53 -53
- package/src/Icon/Icon.native.tsx +38 -38
- package/src/Icon/Icon.styles.tsx +49 -49
- package/src/Icon/Icon.web.tsx +46 -46
- package/src/Icon/icon-types.ts +7452 -7452
- package/src/Icon/index.native.ts +2 -2
- package/src/Icon/index.ts +4 -4
- package/src/Icon/index.web.ts +2 -2
- package/src/Icon/types.ts +35 -35
- package/src/Input/Input.native.tsx +74 -74
- package/src/Input/Input.styles.tsx +176 -176
- package/src/Input/Input.web.tsx +70 -70
- package/src/Input/index.native.ts +2 -2
- package/src/Input/index.ts +4 -4
- package/src/Input/index.web.ts +2 -2
- package/src/Input/types.ts +68 -68
- package/src/Screen/Screen.native.tsx +40 -40
- package/src/Screen/Screen.styles.tsx +59 -59
- package/src/Screen/Screen.web.tsx +32 -32
- package/src/Screen/index.native.ts +1 -1
- package/src/Screen/index.ts +1 -1
- package/src/Screen/index.web.ts +1 -1
- package/src/Screen/types.ts +37 -37
- package/src/Text/Text.native.tsx +35 -35
- package/src/Text/Text.styles.tsx +66 -66
- package/src/Text/Text.web.tsx +40 -40
- package/src/Text/index.native.ts +2 -2
- package/src/Text/index.ts +4 -4
- package/src/Text/index.web.ts +2 -2
- package/src/Text/types.ts +38 -38
- package/src/View/View.native.tsx +55 -55
- package/src/View/View.styles.tsx +102 -102
- package/src/View/View.web.tsx +59 -59
- package/src/View/index.native.ts +2 -2
- package/src/View/index.ts +4 -4
- package/src/View/index.web.ts +2 -2
- package/src/View/types.ts +72 -72
- package/src/examples/AllExamples.tsx +71 -71
- package/src/examples/AvatarExamples.tsx +96 -96
- package/src/examples/BadgeExamples.tsx +199 -199
- package/src/examples/ButtonExamples.tsx +149 -149
- package/src/examples/CardExamples.tsx +175 -175
- package/src/examples/CheckboxExamples.tsx +216 -216
- package/src/examples/DividerExamples.tsx +217 -217
- package/src/examples/IconExamples.tsx +341 -341
- package/src/examples/InputExamples.tsx +133 -133
- package/src/examples/README.md +135 -135
- package/src/examples/ScreenExamples.tsx +153 -153
- package/src/examples/TextExamples.tsx +88 -88
- package/src/examples/ThemeExtensionExamples.tsx +90 -90
- package/src/examples/ValidationExamples.tsx +94 -94
- package/src/examples/ViewExamples.tsx +128 -128
- package/src/examples/extendedTheme.ts +328 -328
- package/src/examples/index.ts +14 -14
- package/src/index.native.ts +48 -48
- package/src/index.ts +47 -47
- package/src/theme/breakpoints.ts +8 -8
- package/src/theme/colorResolver.ts +217 -217
- package/src/theme/colors.ts +314 -314
- package/src/theme/defaultThemes.ts +325 -325
- package/src/theme/index.ts +187 -187
- package/src/theme/themeBuilder.ts +601 -601
- package/src/theme/unistyles.d.ts +5 -5
- package/src/theme/variantHelpers.ts +583 -583
- package/src/theme/variants.ts +55 -55
package/src/Button/types.ts
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import type { IntentVariant } from '../theme/variants';
|
|
3
|
-
|
|
4
|
-
export interface ButtonProps {
|
|
5
|
-
/**
|
|
6
|
-
* The text or content to display inside the button
|
|
7
|
-
*/
|
|
8
|
-
children?: ReactNode;
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* The text title to display inside the button (for web)
|
|
12
|
-
*/
|
|
13
|
-
title?: string;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Called when the button is pressed
|
|
17
|
-
*/
|
|
18
|
-
onPress?: () => void;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Whether the button is disabled
|
|
22
|
-
*/
|
|
23
|
-
disabled?: boolean;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* The visual style variant of the button
|
|
27
|
-
*/
|
|
28
|
-
variant?: 'contained' | 'outlined' | 'text';
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* The intent/color scheme of the button
|
|
32
|
-
*/
|
|
33
|
-
intent?: IntentVariant;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* The size of the button
|
|
37
|
-
*/
|
|
38
|
-
size?: 'small' | 'medium' | 'large';
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Additional styles (platform-specific)
|
|
42
|
-
*/
|
|
43
|
-
style?: any;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Test ID for testing
|
|
47
|
-
*/
|
|
48
|
-
testID?: string;
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import type { IntentVariant } from '../theme/variants';
|
|
3
|
+
|
|
4
|
+
export interface ButtonProps {
|
|
5
|
+
/**
|
|
6
|
+
* The text or content to display inside the button
|
|
7
|
+
*/
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The text title to display inside the button (for web)
|
|
12
|
+
*/
|
|
13
|
+
title?: string;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Called when the button is pressed
|
|
17
|
+
*/
|
|
18
|
+
onPress?: () => void;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Whether the button is disabled
|
|
22
|
+
*/
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The visual style variant of the button
|
|
27
|
+
*/
|
|
28
|
+
variant?: 'contained' | 'outlined' | 'text';
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* The intent/color scheme of the button
|
|
32
|
+
*/
|
|
33
|
+
intent?: IntentVariant;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The size of the button
|
|
37
|
+
*/
|
|
38
|
+
size?: 'small' | 'medium' | 'large';
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Additional styles (platform-specific)
|
|
42
|
+
*/
|
|
43
|
+
style?: any;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Test ID for testing
|
|
47
|
+
*/
|
|
48
|
+
testID?: string;
|
|
49
49
|
}
|
package/src/Card/Card.native.tsx
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { View, Pressable } from 'react-native';
|
|
3
|
-
import { CardProps } from './types';
|
|
4
|
-
import { cardStyles } from './Card.styles';
|
|
5
|
-
|
|
6
|
-
const Card: React.FC<CardProps> = ({
|
|
7
|
-
children,
|
|
8
|
-
variant = 'default',
|
|
9
|
-
padding = 'medium',
|
|
10
|
-
radius = 'medium',
|
|
11
|
-
intent = 'neutral',
|
|
12
|
-
clickable = false,
|
|
13
|
-
onPress,
|
|
14
|
-
disabled = false,
|
|
15
|
-
style,
|
|
16
|
-
testID,
|
|
17
|
-
accessibilityLabel,
|
|
18
|
-
}) => {
|
|
19
|
-
// Apply variants
|
|
20
|
-
cardStyles.useVariants({
|
|
21
|
-
variant: variant as any,
|
|
22
|
-
padding,
|
|
23
|
-
radius,
|
|
24
|
-
intent,
|
|
25
|
-
clickable,
|
|
26
|
-
disabled,
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
// Use appropriate component based on clickable state
|
|
30
|
-
const Component = clickable ? Pressable : View;
|
|
31
|
-
|
|
32
|
-
const componentProps = {
|
|
33
|
-
style: [cardStyles.card, style],
|
|
34
|
-
testID,
|
|
35
|
-
accessibilityLabel,
|
|
36
|
-
// Only use button role for clickable cards in React Native
|
|
37
|
-
...(clickable && { accessibilityRole: 'button' as const }),
|
|
38
|
-
...(clickable && {
|
|
39
|
-
onPress: disabled ? undefined : onPress,
|
|
40
|
-
disabled,
|
|
41
|
-
android_ripple: { color: 'rgba(0, 0, 0, 0.1)' },
|
|
42
|
-
}),
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
return (
|
|
46
|
-
<Component {...componentProps}>
|
|
47
|
-
{children}
|
|
48
|
-
</Component>
|
|
49
|
-
);
|
|
50
|
-
};
|
|
51
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, Pressable } from 'react-native';
|
|
3
|
+
import { CardProps } from './types';
|
|
4
|
+
import { cardStyles } from './Card.styles';
|
|
5
|
+
|
|
6
|
+
const Card: React.FC<CardProps> = ({
|
|
7
|
+
children,
|
|
8
|
+
variant = 'default',
|
|
9
|
+
padding = 'medium',
|
|
10
|
+
radius = 'medium',
|
|
11
|
+
intent = 'neutral',
|
|
12
|
+
clickable = false,
|
|
13
|
+
onPress,
|
|
14
|
+
disabled = false,
|
|
15
|
+
style,
|
|
16
|
+
testID,
|
|
17
|
+
accessibilityLabel,
|
|
18
|
+
}) => {
|
|
19
|
+
// Apply variants
|
|
20
|
+
cardStyles.useVariants({
|
|
21
|
+
variant: variant as any,
|
|
22
|
+
padding,
|
|
23
|
+
radius,
|
|
24
|
+
intent,
|
|
25
|
+
clickable,
|
|
26
|
+
disabled,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
// Use appropriate component based on clickable state
|
|
30
|
+
const Component = clickable ? Pressable : View;
|
|
31
|
+
|
|
32
|
+
const componentProps = {
|
|
33
|
+
style: [cardStyles.card, style],
|
|
34
|
+
testID,
|
|
35
|
+
accessibilityLabel,
|
|
36
|
+
// Only use button role for clickable cards in React Native
|
|
37
|
+
...(clickable && { accessibilityRole: 'button' as const }),
|
|
38
|
+
...(clickable && {
|
|
39
|
+
onPress: disabled ? undefined : onPress,
|
|
40
|
+
disabled,
|
|
41
|
+
android_ripple: { color: 'rgba(0, 0, 0, 0.1)' },
|
|
42
|
+
}),
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<Component {...componentProps}>
|
|
47
|
+
{children}
|
|
48
|
+
</Component>
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
52
|
export default Card;
|
package/src/Card/Card.styles.tsx
CHANGED
|
@@ -1,240 +1,240 @@
|
|
|
1
|
-
import { StyleSheet } from 'react-native-unistyles';
|
|
2
|
-
|
|
3
|
-
export const cardStyles = StyleSheet.create((theme) => ({
|
|
4
|
-
card: {
|
|
5
|
-
backgroundColor: theme.colors?.surface?.primary || '#ffffff',
|
|
6
|
-
position: 'relative',
|
|
7
|
-
overflow: 'hidden',
|
|
8
|
-
|
|
9
|
-
variants: {
|
|
10
|
-
variant: {
|
|
11
|
-
default: {
|
|
12
|
-
backgroundColor: theme.colors?.surface?.primary || '#ffffff',
|
|
13
|
-
// React Native border properties
|
|
14
|
-
borderWidth: 1,
|
|
15
|
-
borderColor: theme.colors?.border?.primary || theme.palettes?.gray?.[200] || '#e5e7eb',
|
|
16
|
-
// Web-specific border override
|
|
17
|
-
_web: {
|
|
18
|
-
border: `1px solid ${theme.colors?.border?.primary || theme.palettes?.gray?.[200] || '#e5e7eb'}`,
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
outlined: {
|
|
22
|
-
backgroundColor: 'transparent',
|
|
23
|
-
// React Native border properties
|
|
24
|
-
borderWidth: 1,
|
|
25
|
-
borderColor: theme.colors?.border?.primary || theme.palettes?.gray?.[300] || '#d1d5db',
|
|
26
|
-
// Web-specific border override
|
|
27
|
-
_web: {
|
|
28
|
-
border: `1px solid ${theme.colors?.border?.primary || theme.palettes?.gray?.[300] || '#d1d5db'}`,
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
elevated: {
|
|
32
|
-
backgroundColor: theme.colors?.surface?.primary || '#ffffff',
|
|
33
|
-
borderWidth: 0,
|
|
34
|
-
_web: {
|
|
35
|
-
border: 'none',
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
filled: {
|
|
39
|
-
backgroundColor: theme.colors?.surface?.secondary || theme.palettes?.gray?.[50] || '#f9fafb',
|
|
40
|
-
borderWidth: 0,
|
|
41
|
-
_web: {
|
|
42
|
-
border: 'none',
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
padding: {
|
|
47
|
-
none: {
|
|
48
|
-
padding: 0,
|
|
49
|
-
},
|
|
50
|
-
small: {
|
|
51
|
-
padding: theme.spacing?.sm || 8,
|
|
52
|
-
},
|
|
53
|
-
medium: {
|
|
54
|
-
padding: theme.spacing?.md || 12,
|
|
55
|
-
},
|
|
56
|
-
large: {
|
|
57
|
-
padding: theme.spacing?.lg || 16,
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
radius: {
|
|
61
|
-
none: {
|
|
62
|
-
borderRadius: 0,
|
|
63
|
-
},
|
|
64
|
-
small: {
|
|
65
|
-
borderRadius: theme.borderRadius?.sm || 4,
|
|
66
|
-
},
|
|
67
|
-
medium: {
|
|
68
|
-
borderRadius: theme.borderRadius?.md || 8,
|
|
69
|
-
},
|
|
70
|
-
large: {
|
|
71
|
-
borderRadius: theme.borderRadius?.lg || 12,
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
intent: {
|
|
75
|
-
neutral: {
|
|
76
|
-
// Default colors handled by variant
|
|
77
|
-
},
|
|
78
|
-
primary: {
|
|
79
|
-
// Intent colors applied via compound variants
|
|
80
|
-
},
|
|
81
|
-
success: {
|
|
82
|
-
// Intent colors applied via compound variants
|
|
83
|
-
},
|
|
84
|
-
error: {
|
|
85
|
-
// Intent colors applied via compound variants
|
|
86
|
-
},
|
|
87
|
-
warning: {
|
|
88
|
-
// Intent colors applied via compound variants
|
|
89
|
-
},
|
|
90
|
-
info: {
|
|
91
|
-
// Intent colors applied via compound variants
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
clickable: {
|
|
95
|
-
true: {
|
|
96
|
-
cursor: 'pointer',
|
|
97
|
-
transition: 'all 0.2s ease',
|
|
98
|
-
},
|
|
99
|
-
false: {
|
|
100
|
-
cursor: 'default',
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
disabled: {
|
|
104
|
-
true: {
|
|
105
|
-
opacity: 0.6,
|
|
106
|
-
cursor: 'not-allowed',
|
|
107
|
-
},
|
|
108
|
-
false: {
|
|
109
|
-
opacity: 1,
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
|
|
114
|
-
compoundVariants: [
|
|
115
|
-
// Elevated variant with shadows
|
|
116
|
-
{
|
|
117
|
-
variant: 'elevated',
|
|
118
|
-
styles: {
|
|
119
|
-
shadowColor: theme.shadows?.md?.shadowColor || '#000',
|
|
120
|
-
shadowOffset: theme.shadows?.md?.shadowOffset || { width: 0, height: 4 },
|
|
121
|
-
shadowOpacity: theme.shadows?.md?.shadowOpacity || 0.1,
|
|
122
|
-
shadowRadius: theme.shadows?.md?.shadowRadius || 8,
|
|
123
|
-
elevation: theme.shadows?.md?.elevation || 4,
|
|
124
|
-
// More subtle shadow for web
|
|
125
|
-
_web: {
|
|
126
|
-
boxShadow: '0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04)',
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
// Intent color combinations for outlined variant
|
|
131
|
-
{
|
|
132
|
-
variant: 'outlined',
|
|
133
|
-
intent: 'primary',
|
|
134
|
-
styles: {
|
|
135
|
-
borderColor: theme.intents?.primary?.main || '#3b82f6',
|
|
136
|
-
_web: {
|
|
137
|
-
border: `1px solid ${theme.intents?.primary?.main || '#3b82f6'}`,
|
|
138
|
-
},
|
|
139
|
-
},
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
variant: 'outlined',
|
|
143
|
-
intent: 'success',
|
|
144
|
-
styles: {
|
|
145
|
-
borderColor: theme.intents?.success?.main || '#22c55e',
|
|
146
|
-
_web: {
|
|
147
|
-
border: `1px solid ${theme.intents?.success?.main || '#22c55e'}`,
|
|
148
|
-
},
|
|
149
|
-
},
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
variant: 'outlined',
|
|
153
|
-
intent: 'error',
|
|
154
|
-
styles: {
|
|
155
|
-
borderColor: theme.intents?.error?.main || '#ef4444',
|
|
156
|
-
_web: {
|
|
157
|
-
border: `1px solid ${theme.intents?.error?.main || '#ef4444'}`,
|
|
158
|
-
},
|
|
159
|
-
},
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
variant: 'outlined',
|
|
163
|
-
intent: 'warning',
|
|
164
|
-
styles: {
|
|
165
|
-
borderColor: theme.intents?.warning?.main || '#f59e0b',
|
|
166
|
-
_web: {
|
|
167
|
-
border: `1px solid ${theme.intents?.warning?.main || '#f59e0b'}`,
|
|
168
|
-
},
|
|
169
|
-
},
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
variant: 'outlined',
|
|
173
|
-
intent: 'info',
|
|
174
|
-
styles: {
|
|
175
|
-
borderColor: theme.intents?.info?.main || '#06b6d4',
|
|
176
|
-
_web: {
|
|
177
|
-
border: `1px solid ${theme.intents?.info?.main || '#06b6d4'}`,
|
|
178
|
-
},
|
|
179
|
-
},
|
|
180
|
-
},
|
|
181
|
-
// Intent color combinations for filled variant
|
|
182
|
-
{
|
|
183
|
-
variant: 'filled',
|
|
184
|
-
intent: 'primary',
|
|
185
|
-
styles: {
|
|
186
|
-
backgroundColor: theme.intents?.primary?.container || theme.palettes?.blue?.[50] || '#eff6ff',
|
|
187
|
-
},
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
variant: 'filled',
|
|
191
|
-
intent: 'success',
|
|
192
|
-
styles: {
|
|
193
|
-
backgroundColor: theme.intents?.success?.container || theme.palettes?.green?.[50] || '#f0fdf4',
|
|
194
|
-
},
|
|
195
|
-
},
|
|
196
|
-
{
|
|
197
|
-
variant: 'filled',
|
|
198
|
-
intent: 'error',
|
|
199
|
-
styles: {
|
|
200
|
-
backgroundColor: theme.intents?.error?.container || theme.palettes?.red?.[50] || '#fef2f2',
|
|
201
|
-
},
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
variant: 'filled',
|
|
205
|
-
intent: 'warning',
|
|
206
|
-
styles: {
|
|
207
|
-
backgroundColor: theme.intents?.warning?.container || theme.palettes?.amber?.[50] || '#fffbeb',
|
|
208
|
-
},
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
variant: 'filled',
|
|
212
|
-
intent: 'info',
|
|
213
|
-
styles: {
|
|
214
|
-
backgroundColor: theme.intents?.info?.container || theme.palettes?.cyan?.[50] || '#ecfeff',
|
|
215
|
-
},
|
|
216
|
-
},
|
|
217
|
-
],
|
|
218
|
-
|
|
219
|
-
_web: {
|
|
220
|
-
display: 'flex',
|
|
221
|
-
flexDirection: 'column',
|
|
222
|
-
boxSizing: 'border-box',
|
|
223
|
-
_hover: {
|
|
224
|
-
// Hover effects for clickable cards
|
|
225
|
-
},
|
|
226
|
-
},
|
|
227
|
-
},
|
|
228
|
-
}));
|
|
229
|
-
|
|
230
|
-
// Add hover effects for clickable cards
|
|
231
|
-
export const cardHoverStyles = StyleSheet.create((theme) => ({
|
|
232
|
-
clickableHover: {
|
|
233
|
-
_web: {
|
|
234
|
-
_hover: {
|
|
235
|
-
transform: 'translateY(-2px)',
|
|
236
|
-
boxShadow: '0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.06)',
|
|
237
|
-
},
|
|
238
|
-
},
|
|
239
|
-
},
|
|
1
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
2
|
+
|
|
3
|
+
export const cardStyles = StyleSheet.create((theme) => ({
|
|
4
|
+
card: {
|
|
5
|
+
backgroundColor: theme.colors?.surface?.primary || '#ffffff',
|
|
6
|
+
position: 'relative',
|
|
7
|
+
overflow: 'hidden',
|
|
8
|
+
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default: {
|
|
12
|
+
backgroundColor: theme.colors?.surface?.primary || '#ffffff',
|
|
13
|
+
// React Native border properties
|
|
14
|
+
borderWidth: 1,
|
|
15
|
+
borderColor: theme.colors?.border?.primary || theme.palettes?.gray?.[200] || '#e5e7eb',
|
|
16
|
+
// Web-specific border override
|
|
17
|
+
_web: {
|
|
18
|
+
border: `1px solid ${theme.colors?.border?.primary || theme.palettes?.gray?.[200] || '#e5e7eb'}`,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
outlined: {
|
|
22
|
+
backgroundColor: 'transparent',
|
|
23
|
+
// React Native border properties
|
|
24
|
+
borderWidth: 1,
|
|
25
|
+
borderColor: theme.colors?.border?.primary || theme.palettes?.gray?.[300] || '#d1d5db',
|
|
26
|
+
// Web-specific border override
|
|
27
|
+
_web: {
|
|
28
|
+
border: `1px solid ${theme.colors?.border?.primary || theme.palettes?.gray?.[300] || '#d1d5db'}`,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
elevated: {
|
|
32
|
+
backgroundColor: theme.colors?.surface?.primary || '#ffffff',
|
|
33
|
+
borderWidth: 0,
|
|
34
|
+
_web: {
|
|
35
|
+
border: 'none',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
filled: {
|
|
39
|
+
backgroundColor: theme.colors?.surface?.secondary || theme.palettes?.gray?.[50] || '#f9fafb',
|
|
40
|
+
borderWidth: 0,
|
|
41
|
+
_web: {
|
|
42
|
+
border: 'none',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
padding: {
|
|
47
|
+
none: {
|
|
48
|
+
padding: 0,
|
|
49
|
+
},
|
|
50
|
+
small: {
|
|
51
|
+
padding: theme.spacing?.sm || 8,
|
|
52
|
+
},
|
|
53
|
+
medium: {
|
|
54
|
+
padding: theme.spacing?.md || 12,
|
|
55
|
+
},
|
|
56
|
+
large: {
|
|
57
|
+
padding: theme.spacing?.lg || 16,
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
radius: {
|
|
61
|
+
none: {
|
|
62
|
+
borderRadius: 0,
|
|
63
|
+
},
|
|
64
|
+
small: {
|
|
65
|
+
borderRadius: theme.borderRadius?.sm || 4,
|
|
66
|
+
},
|
|
67
|
+
medium: {
|
|
68
|
+
borderRadius: theme.borderRadius?.md || 8,
|
|
69
|
+
},
|
|
70
|
+
large: {
|
|
71
|
+
borderRadius: theme.borderRadius?.lg || 12,
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
intent: {
|
|
75
|
+
neutral: {
|
|
76
|
+
// Default colors handled by variant
|
|
77
|
+
},
|
|
78
|
+
primary: {
|
|
79
|
+
// Intent colors applied via compound variants
|
|
80
|
+
},
|
|
81
|
+
success: {
|
|
82
|
+
// Intent colors applied via compound variants
|
|
83
|
+
},
|
|
84
|
+
error: {
|
|
85
|
+
// Intent colors applied via compound variants
|
|
86
|
+
},
|
|
87
|
+
warning: {
|
|
88
|
+
// Intent colors applied via compound variants
|
|
89
|
+
},
|
|
90
|
+
info: {
|
|
91
|
+
// Intent colors applied via compound variants
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
clickable: {
|
|
95
|
+
true: {
|
|
96
|
+
cursor: 'pointer',
|
|
97
|
+
transition: 'all 0.2s ease',
|
|
98
|
+
},
|
|
99
|
+
false: {
|
|
100
|
+
cursor: 'default',
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
disabled: {
|
|
104
|
+
true: {
|
|
105
|
+
opacity: 0.6,
|
|
106
|
+
cursor: 'not-allowed',
|
|
107
|
+
},
|
|
108
|
+
false: {
|
|
109
|
+
opacity: 1,
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
compoundVariants: [
|
|
115
|
+
// Elevated variant with shadows
|
|
116
|
+
{
|
|
117
|
+
variant: 'elevated',
|
|
118
|
+
styles: {
|
|
119
|
+
shadowColor: theme.shadows?.md?.shadowColor || '#000',
|
|
120
|
+
shadowOffset: theme.shadows?.md?.shadowOffset || { width: 0, height: 4 },
|
|
121
|
+
shadowOpacity: theme.shadows?.md?.shadowOpacity || 0.1,
|
|
122
|
+
shadowRadius: theme.shadows?.md?.shadowRadius || 8,
|
|
123
|
+
elevation: theme.shadows?.md?.elevation || 4,
|
|
124
|
+
// More subtle shadow for web
|
|
125
|
+
_web: {
|
|
126
|
+
boxShadow: '0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04)',
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
// Intent color combinations for outlined variant
|
|
131
|
+
{
|
|
132
|
+
variant: 'outlined',
|
|
133
|
+
intent: 'primary',
|
|
134
|
+
styles: {
|
|
135
|
+
borderColor: theme.intents?.primary?.main || '#3b82f6',
|
|
136
|
+
_web: {
|
|
137
|
+
border: `1px solid ${theme.intents?.primary?.main || '#3b82f6'}`,
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
variant: 'outlined',
|
|
143
|
+
intent: 'success',
|
|
144
|
+
styles: {
|
|
145
|
+
borderColor: theme.intents?.success?.main || '#22c55e',
|
|
146
|
+
_web: {
|
|
147
|
+
border: `1px solid ${theme.intents?.success?.main || '#22c55e'}`,
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
variant: 'outlined',
|
|
153
|
+
intent: 'error',
|
|
154
|
+
styles: {
|
|
155
|
+
borderColor: theme.intents?.error?.main || '#ef4444',
|
|
156
|
+
_web: {
|
|
157
|
+
border: `1px solid ${theme.intents?.error?.main || '#ef4444'}`,
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
variant: 'outlined',
|
|
163
|
+
intent: 'warning',
|
|
164
|
+
styles: {
|
|
165
|
+
borderColor: theme.intents?.warning?.main || '#f59e0b',
|
|
166
|
+
_web: {
|
|
167
|
+
border: `1px solid ${theme.intents?.warning?.main || '#f59e0b'}`,
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
variant: 'outlined',
|
|
173
|
+
intent: 'info',
|
|
174
|
+
styles: {
|
|
175
|
+
borderColor: theme.intents?.info?.main || '#06b6d4',
|
|
176
|
+
_web: {
|
|
177
|
+
border: `1px solid ${theme.intents?.info?.main || '#06b6d4'}`,
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
// Intent color combinations for filled variant
|
|
182
|
+
{
|
|
183
|
+
variant: 'filled',
|
|
184
|
+
intent: 'primary',
|
|
185
|
+
styles: {
|
|
186
|
+
backgroundColor: theme.intents?.primary?.container || theme.palettes?.blue?.[50] || '#eff6ff',
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
variant: 'filled',
|
|
191
|
+
intent: 'success',
|
|
192
|
+
styles: {
|
|
193
|
+
backgroundColor: theme.intents?.success?.container || theme.palettes?.green?.[50] || '#f0fdf4',
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
variant: 'filled',
|
|
198
|
+
intent: 'error',
|
|
199
|
+
styles: {
|
|
200
|
+
backgroundColor: theme.intents?.error?.container || theme.palettes?.red?.[50] || '#fef2f2',
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
variant: 'filled',
|
|
205
|
+
intent: 'warning',
|
|
206
|
+
styles: {
|
|
207
|
+
backgroundColor: theme.intents?.warning?.container || theme.palettes?.amber?.[50] || '#fffbeb',
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
variant: 'filled',
|
|
212
|
+
intent: 'info',
|
|
213
|
+
styles: {
|
|
214
|
+
backgroundColor: theme.intents?.info?.container || theme.palettes?.cyan?.[50] || '#ecfeff',
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
],
|
|
218
|
+
|
|
219
|
+
_web: {
|
|
220
|
+
display: 'flex',
|
|
221
|
+
flexDirection: 'column',
|
|
222
|
+
boxSizing: 'border-box',
|
|
223
|
+
_hover: {
|
|
224
|
+
// Hover effects for clickable cards
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
}));
|
|
229
|
+
|
|
230
|
+
// Add hover effects for clickable cards
|
|
231
|
+
export const cardHoverStyles = StyleSheet.create((theme) => ({
|
|
232
|
+
clickableHover: {
|
|
233
|
+
_web: {
|
|
234
|
+
_hover: {
|
|
235
|
+
transform: 'translateY(-2px)',
|
|
236
|
+
boxShadow: '0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.06)',
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
240
|
}));
|