@idealyst/components 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +568 -0
- package/package.json +107 -0
- package/plugin/web.js +186 -0
- package/src/Avatar/Avatar.native.tsx +44 -0
- package/src/Avatar/Avatar.styles.tsx +67 -0
- package/src/Avatar/Avatar.web.tsx +51 -0
- package/src/Avatar/index.native.ts +2 -0
- package/src/Avatar/index.ts +2 -0
- package/src/Avatar/index.web.ts +2 -0
- package/src/Avatar/types.ts +43 -0
- package/src/Badge/Badge.native.tsx +43 -0
- package/src/Badge/Badge.styles.tsx +154 -0
- package/src/Badge/Badge.web.tsx +45 -0
- package/src/Badge/index.native.ts +2 -0
- package/src/Badge/index.ts +2 -0
- package/src/Badge/index.web.ts +2 -0
- package/src/Badge/types.ts +34 -0
- package/src/Button/Button.native.tsx +39 -0
- package/src/Button/Button.styles.tsx +215 -0
- package/src/Button/Button.types.ts +12 -0
- package/src/Button/Button.web.tsx +56 -0
- package/src/Button/index.native.ts +3 -0
- package/src/Button/index.ts +5 -0
- package/src/Button/index.web.ts +3 -0
- package/src/Button/types.ts +49 -0
- package/src/Card/Card.native.tsx +52 -0
- package/src/Card/Card.styles.tsx +240 -0
- package/src/Card/Card.web.tsx +62 -0
- package/src/Card/index.native.ts +3 -0
- package/src/Card/index.ts +5 -0
- package/src/Card/index.web.ts +3 -0
- package/src/Card/types.ts +59 -0
- package/src/Checkbox/Checkbox.native.tsx +99 -0
- package/src/Checkbox/Checkbox.styles.tsx +292 -0
- package/src/Checkbox/Checkbox.web.tsx +131 -0
- package/src/Checkbox/index.native.ts +3 -0
- package/src/Checkbox/index.ts +5 -0
- package/src/Checkbox/index.web.ts +3 -0
- package/src/Checkbox/types.ts +79 -0
- package/src/Divider/Divider.native.tsx +145 -0
- package/src/Divider/Divider.styles.tsx +602 -0
- package/src/Divider/Divider.web.tsx +73 -0
- package/src/Divider/index.native.ts +3 -0
- package/src/Divider/index.ts +5 -0
- package/src/Divider/index.web.ts +3 -0
- package/src/Divider/types.ts +54 -0
- package/src/Icon/Icon.native.tsx +39 -0
- package/src/Icon/Icon.styles.tsx +50 -0
- package/src/Icon/Icon.web.tsx +47 -0
- package/src/Icon/icon-types.ts +7452 -0
- package/src/Icon/index.native.ts +3 -0
- package/src/Icon/index.ts +5 -0
- package/src/Icon/index.web.ts +3 -0
- package/src/Icon/types.ts +36 -0
- package/src/Input/Input.native.tsx +75 -0
- package/src/Input/Input.styles.tsx +177 -0
- package/src/Input/Input.web.tsx +71 -0
- package/src/Input/index.native.ts +3 -0
- package/src/Input/index.ts +5 -0
- package/src/Input/index.web.ts +3 -0
- package/src/Input/types.ts +69 -0
- package/src/Screen/Screen.native.tsx +41 -0
- package/src/Screen/Screen.styles.tsx +60 -0
- package/src/Screen/Screen.web.tsx +33 -0
- package/src/Screen/index.native.ts +2 -0
- package/src/Screen/index.ts +2 -0
- package/src/Screen/index.web.ts +2 -0
- package/src/Screen/types.ts +38 -0
- package/src/Text/Text.native.tsx +36 -0
- package/src/Text/Text.styles.tsx +67 -0
- package/src/Text/Text.web.tsx +41 -0
- package/src/Text/index.native.ts +3 -0
- package/src/Text/index.ts +5 -0
- package/src/Text/index.web.ts +3 -0
- package/src/Text/types.ts +39 -0
- package/src/View/View.native.tsx +56 -0
- package/src/View/View.styles.tsx +103 -0
- package/src/View/View.web.tsx +60 -0
- package/src/View/index.native.ts +3 -0
- package/src/View/index.ts +5 -0
- package/src/View/index.web.ts +3 -0
- package/src/View/types.ts +73 -0
- package/src/examples/AllExamples.tsx +72 -0
- package/src/examples/AvatarExamples.tsx +97 -0
- package/src/examples/BadgeExamples.tsx +200 -0
- package/src/examples/ButtonExamples.tsx +150 -0
- package/src/examples/CardExamples.tsx +176 -0
- package/src/examples/CheckboxExamples.tsx +217 -0
- package/src/examples/DividerExamples.tsx +218 -0
- package/src/examples/IconExamples.tsx +342 -0
- package/src/examples/InputExamples.tsx +134 -0
- package/src/examples/README.md +136 -0
- package/src/examples/ScreenExamples.tsx +154 -0
- package/src/examples/TextExamples.tsx +89 -0
- package/src/examples/ThemeExtensionExamples.tsx +91 -0
- package/src/examples/ValidationExamples.tsx +95 -0
- package/src/examples/ViewExamples.tsx +129 -0
- package/src/examples/extendedTheme.ts +331 -0
- package/src/examples/index.ts +15 -0
- package/src/index.native.ts +52 -0
- package/src/index.ts +48 -0
- package/src/theme/breakpoints.ts +8 -0
- package/src/theme/colorResolver.ts +218 -0
- package/src/theme/colors.ts +315 -0
- package/src/theme/defaultThemes.ts +326 -0
- package/src/theme/index.ts +188 -0
- package/src/theme/themeBuilder.ts +602 -0
- package/src/theme/unistyles.d.ts +6 -0
- package/src/theme/variantHelpers.ts +584 -0
- package/src/theme/variants.ts +56 -0
- package/src/unistyles.d.ts +108 -0
- package/src/unistyles.ts +43 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { StyleSheet } from "react-native-unistyles";
|
|
2
|
+
import { generateColorVariants } from "../theme/variantHelpers";
|
|
3
|
+
|
|
4
|
+
const textStyles = StyleSheet.create((theme) => ({
|
|
5
|
+
text: {
|
|
6
|
+
variants: {
|
|
7
|
+
size: {
|
|
8
|
+
small: {
|
|
9
|
+
fontSize: theme.typography.fontSize.xs,
|
|
10
|
+
lineHeight: theme.typography.fontSize.xs * 1.33,
|
|
11
|
+
},
|
|
12
|
+
medium: {
|
|
13
|
+
fontSize: theme.typography.fontSize.md,
|
|
14
|
+
lineHeight: theme.typography.fontSize.md * 1.5,
|
|
15
|
+
},
|
|
16
|
+
large: {
|
|
17
|
+
fontSize: theme.typography.fontSize.lg,
|
|
18
|
+
lineHeight: theme.typography.fontSize.lg * 1.4,
|
|
19
|
+
},
|
|
20
|
+
xlarge: {
|
|
21
|
+
fontSize: theme.typography.fontSize.xl,
|
|
22
|
+
lineHeight: theme.typography.fontSize.xl * 1.33,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
weight: {
|
|
26
|
+
light: {
|
|
27
|
+
fontWeight: theme.typography.fontWeight.light,
|
|
28
|
+
},
|
|
29
|
+
normal: {
|
|
30
|
+
fontWeight: theme.typography.fontWeight.regular,
|
|
31
|
+
},
|
|
32
|
+
medium: {
|
|
33
|
+
fontWeight: theme.typography.fontWeight.medium,
|
|
34
|
+
},
|
|
35
|
+
semibold: {
|
|
36
|
+
fontWeight: theme.typography.fontWeight.semibold,
|
|
37
|
+
},
|
|
38
|
+
bold: {
|
|
39
|
+
fontWeight: theme.typography.fontWeight.bold,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
align: {
|
|
43
|
+
left: {
|
|
44
|
+
textAlign: 'left',
|
|
45
|
+
},
|
|
46
|
+
center: {
|
|
47
|
+
textAlign: 'center',
|
|
48
|
+
},
|
|
49
|
+
right: {
|
|
50
|
+
textAlign: 'right',
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
// Dynamically generated color variants
|
|
54
|
+
color: generateColorVariants(theme),
|
|
55
|
+
},
|
|
56
|
+
color: theme.colors.text.primary, // Default text color
|
|
57
|
+
margin: 0,
|
|
58
|
+
padding: 0,
|
|
59
|
+
// Web-specific styles
|
|
60
|
+
_web: {
|
|
61
|
+
fontFamily: 'inherit',
|
|
62
|
+
lineHeight: 'inherit',
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
}));
|
|
66
|
+
|
|
67
|
+
export default textStyles;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { getWebProps } from 'react-native-unistyles/web';
|
|
3
|
+
import { TextProps } from './types';
|
|
4
|
+
import textStyles from './Text.styles';
|
|
5
|
+
|
|
6
|
+
const Text: React.FC<TextProps> = ({
|
|
7
|
+
children,
|
|
8
|
+
size = 'medium',
|
|
9
|
+
weight = 'normal',
|
|
10
|
+
color,
|
|
11
|
+
align = 'left',
|
|
12
|
+
style,
|
|
13
|
+
testID,
|
|
14
|
+
}) => {
|
|
15
|
+
textStyles.useVariants({
|
|
16
|
+
size,
|
|
17
|
+
weight,
|
|
18
|
+
align,
|
|
19
|
+
color: color
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
// Create the style array following the official documentation pattern
|
|
23
|
+
const textStyleArray = [
|
|
24
|
+
textStyles.text,
|
|
25
|
+
style,
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
// Use getWebProps to generate className and ref for web
|
|
29
|
+
const webProps = getWebProps(textStyleArray);
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<span
|
|
33
|
+
{...webProps}
|
|
34
|
+
data-testid={testID}
|
|
35
|
+
>
|
|
36
|
+
{children}
|
|
37
|
+
</span>
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export default Text;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import type { DisplayColorVariant } from '../theme/variants';
|
|
3
|
+
|
|
4
|
+
export interface TextProps {
|
|
5
|
+
/**
|
|
6
|
+
* The text content to display
|
|
7
|
+
*/
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The size variant of the text
|
|
12
|
+
*/
|
|
13
|
+
size?: 'small' | 'medium' | 'large' | 'xlarge';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The weight of the text
|
|
17
|
+
*/
|
|
18
|
+
weight?: 'light' | 'normal' | 'medium' | 'semibold' | 'bold';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The color of the text
|
|
22
|
+
*/
|
|
23
|
+
color?: DisplayColorVariant;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Text alignment
|
|
27
|
+
*/
|
|
28
|
+
align?: 'left' | 'center' | 'right';
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Additional styles (platform-specific)
|
|
32
|
+
*/
|
|
33
|
+
style?: any;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Test ID for testing
|
|
37
|
+
*/
|
|
38
|
+
testID?: string;
|
|
39
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View as RNView } from 'react-native';
|
|
3
|
+
import { ViewProps } from './types';
|
|
4
|
+
import viewStyles from './View.styles';
|
|
5
|
+
|
|
6
|
+
const View: React.FC<ViewProps> = ({
|
|
7
|
+
children,
|
|
8
|
+
spacing = 'none',
|
|
9
|
+
marginVariant = 'none',
|
|
10
|
+
background = 'transparent',
|
|
11
|
+
radius = 'none',
|
|
12
|
+
border = 'none',
|
|
13
|
+
backgroundColor,
|
|
14
|
+
padding,
|
|
15
|
+
margin,
|
|
16
|
+
borderRadius,
|
|
17
|
+
borderWidth,
|
|
18
|
+
borderColor,
|
|
19
|
+
style,
|
|
20
|
+
testID,
|
|
21
|
+
}) => {
|
|
22
|
+
viewStyles.useVariants({
|
|
23
|
+
spacing,
|
|
24
|
+
margin: marginVariant,
|
|
25
|
+
background,
|
|
26
|
+
radius,
|
|
27
|
+
border,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const getStyles = (): ViewStyle => {
|
|
31
|
+
const baseStyles: ViewStyle = {};
|
|
32
|
+
|
|
33
|
+
if (backgroundColor) baseStyles.backgroundColor = backgroundColor;
|
|
34
|
+
if (padding !== undefined) baseStyles.padding = padding;
|
|
35
|
+
if (margin !== undefined) baseStyles.margin = margin;
|
|
36
|
+
if (borderRadius !== undefined) baseStyles.borderRadius = borderRadius;
|
|
37
|
+
if (borderWidth !== undefined) baseStyles.borderWidth = borderWidth;
|
|
38
|
+
if (borderColor) baseStyles.borderColor = borderColor;
|
|
39
|
+
|
|
40
|
+
return baseStyles;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const viewStyleArray = [
|
|
44
|
+
viewStyles.view,
|
|
45
|
+
getStyles(),
|
|
46
|
+
style,
|
|
47
|
+
];
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<RNView style={viewStyleArray} testID={testID}>
|
|
51
|
+
{children}
|
|
52
|
+
</RNView>
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export default View;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { StyleSheet } from "react-native-unistyles";
|
|
2
|
+
|
|
3
|
+
const viewStyles = StyleSheet.create((theme) => ({
|
|
4
|
+
view: {
|
|
5
|
+
variants: {
|
|
6
|
+
spacing: {
|
|
7
|
+
none: {
|
|
8
|
+
padding: 0,
|
|
9
|
+
},
|
|
10
|
+
xs: {
|
|
11
|
+
padding: theme.spacing.xs,
|
|
12
|
+
},
|
|
13
|
+
sm: {
|
|
14
|
+
padding: theme.spacing.sm,
|
|
15
|
+
},
|
|
16
|
+
md: {
|
|
17
|
+
padding: theme.spacing.md,
|
|
18
|
+
},
|
|
19
|
+
lg: {
|
|
20
|
+
padding: theme.spacing.lg,
|
|
21
|
+
},
|
|
22
|
+
xl: {
|
|
23
|
+
padding: theme.spacing.xl,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
margin: {
|
|
27
|
+
none: {
|
|
28
|
+
margin: 0,
|
|
29
|
+
},
|
|
30
|
+
xs: {
|
|
31
|
+
margin: theme.spacing.xs,
|
|
32
|
+
},
|
|
33
|
+
sm: {
|
|
34
|
+
margin: theme.spacing.sm,
|
|
35
|
+
},
|
|
36
|
+
md: {
|
|
37
|
+
margin: theme.spacing.md,
|
|
38
|
+
},
|
|
39
|
+
lg: {
|
|
40
|
+
margin: theme.spacing.lg,
|
|
41
|
+
},
|
|
42
|
+
xl: {
|
|
43
|
+
margin: theme.spacing.xl,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
background: {
|
|
47
|
+
transparent: {
|
|
48
|
+
backgroundColor: 'transparent',
|
|
49
|
+
},
|
|
50
|
+
surface: {
|
|
51
|
+
backgroundColor: theme.colors.surface,
|
|
52
|
+
},
|
|
53
|
+
primary: {
|
|
54
|
+
backgroundColor: theme.colors.primary,
|
|
55
|
+
},
|
|
56
|
+
secondary: {
|
|
57
|
+
backgroundColor: theme.colors.secondary,
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
radius: {
|
|
61
|
+
none: {
|
|
62
|
+
borderRadius: 0,
|
|
63
|
+
},
|
|
64
|
+
xs: {
|
|
65
|
+
borderRadius: theme.borderRadius.xs,
|
|
66
|
+
},
|
|
67
|
+
sm: {
|
|
68
|
+
borderRadius: theme.borderRadius.sm,
|
|
69
|
+
},
|
|
70
|
+
md: {
|
|
71
|
+
borderRadius: theme.borderRadius.md,
|
|
72
|
+
},
|
|
73
|
+
lg: {
|
|
74
|
+
borderRadius: theme.borderRadius.lg,
|
|
75
|
+
},
|
|
76
|
+
xl: {
|
|
77
|
+
borderRadius: theme.borderRadius.xl,
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
border: {
|
|
81
|
+
none: {
|
|
82
|
+
borderWidth: 0,
|
|
83
|
+
},
|
|
84
|
+
thin: {
|
|
85
|
+
borderWidth: 1,
|
|
86
|
+
borderColor: theme.colors.border,
|
|
87
|
+
},
|
|
88
|
+
thick: {
|
|
89
|
+
borderWidth: 2,
|
|
90
|
+
borderColor: theme.colors.border,
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
// Web-specific styles
|
|
95
|
+
_web: {
|
|
96
|
+
display: 'flex',
|
|
97
|
+
flexDirection: 'column',
|
|
98
|
+
boxSizing: 'border-box',
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
}));
|
|
102
|
+
|
|
103
|
+
export default viewStyles;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { getWebProps } from 'react-native-unistyles/web';
|
|
3
|
+
import { ViewProps } from './types';
|
|
4
|
+
import viewStyles from './View.styles';
|
|
5
|
+
|
|
6
|
+
const View: React.FC<ViewProps> = ({
|
|
7
|
+
children,
|
|
8
|
+
spacing = 'none',
|
|
9
|
+
marginVariant = 'none',
|
|
10
|
+
background = 'transparent',
|
|
11
|
+
radius = 'none',
|
|
12
|
+
border = 'none',
|
|
13
|
+
backgroundColor,
|
|
14
|
+
padding,
|
|
15
|
+
margin,
|
|
16
|
+
borderRadius,
|
|
17
|
+
borderWidth,
|
|
18
|
+
borderColor,
|
|
19
|
+
style,
|
|
20
|
+
testID,
|
|
21
|
+
}) => {
|
|
22
|
+
viewStyles.useVariants({
|
|
23
|
+
spacing,
|
|
24
|
+
margin: marginVariant,
|
|
25
|
+
background,
|
|
26
|
+
radius,
|
|
27
|
+
border,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
// Create dynamic styles based on custom props (overrides variants)
|
|
31
|
+
const dynamicStyles: any = {};
|
|
32
|
+
|
|
33
|
+
if (backgroundColor) dynamicStyles.backgroundColor = backgroundColor;
|
|
34
|
+
if (padding !== undefined) dynamicStyles.padding = padding;
|
|
35
|
+
if (margin !== undefined) dynamicStyles.margin = margin;
|
|
36
|
+
if (borderRadius !== undefined) dynamicStyles.borderRadius = borderRadius;
|
|
37
|
+
if (borderWidth !== undefined) dynamicStyles.borderWidth = borderWidth;
|
|
38
|
+
if (borderColor) dynamicStyles.borderColor = borderColor;
|
|
39
|
+
|
|
40
|
+
// Create the style array following the official documentation pattern
|
|
41
|
+
const viewStyleArray = [
|
|
42
|
+
viewStyles.view,
|
|
43
|
+
dynamicStyles,
|
|
44
|
+
style,
|
|
45
|
+
];
|
|
46
|
+
|
|
47
|
+
// Use getWebProps to generate className and ref for web
|
|
48
|
+
const webProps = getWebProps(viewStyleArray);
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<div
|
|
52
|
+
{...webProps}
|
|
53
|
+
data-testid={testID}
|
|
54
|
+
>
|
|
55
|
+
{children}
|
|
56
|
+
</div>
|
|
57
|
+
);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export default View;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface ViewProps {
|
|
4
|
+
/**
|
|
5
|
+
* The content to display inside the view
|
|
6
|
+
*/
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Padding variant
|
|
11
|
+
*/
|
|
12
|
+
spacing?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Margin variant
|
|
16
|
+
*/
|
|
17
|
+
marginVariant?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Background variant
|
|
21
|
+
*/
|
|
22
|
+
background?: 'transparent' | 'surface' | 'primary' | 'secondary';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Border radius variant
|
|
26
|
+
*/
|
|
27
|
+
radius?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Border variant
|
|
31
|
+
*/
|
|
32
|
+
border?: 'none' | 'thin' | 'thick';
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Custom background color (overrides background variant)
|
|
36
|
+
*/
|
|
37
|
+
backgroundColor?: string;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Custom padding (overrides spacing variant)
|
|
41
|
+
*/
|
|
42
|
+
padding?: number;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Custom margin (overrides marginVariant)
|
|
46
|
+
*/
|
|
47
|
+
margin?: number;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Custom border radius (overrides radius variant)
|
|
51
|
+
*/
|
|
52
|
+
borderRadius?: number;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Custom border width (overrides border variant)
|
|
56
|
+
*/
|
|
57
|
+
borderWidth?: number;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Custom border color
|
|
61
|
+
*/
|
|
62
|
+
borderColor?: string;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Additional styles (platform-specific)
|
|
66
|
+
*/
|
|
67
|
+
style?: any;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Test ID for testing
|
|
71
|
+
*/
|
|
72
|
+
testID?: string;
|
|
73
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Screen, View, Text, Divider } from '../index';
|
|
3
|
+
import { ButtonExamples } from './ButtonExamples';
|
|
4
|
+
import { TextExamples } from './TextExamples';
|
|
5
|
+
import { ViewExamples } from './ViewExamples';
|
|
6
|
+
import { InputExamples } from './InputExamples';
|
|
7
|
+
import { IconExamples } from './IconExamples';
|
|
8
|
+
import { CardExamples } from './CardExamples';
|
|
9
|
+
import { CheckboxExamples } from './CheckboxExamples';
|
|
10
|
+
import { DividerExamples } from './DividerExamples';
|
|
11
|
+
import { BadgeExamples } from './BadgeExamples';
|
|
12
|
+
import { AvatarExamples } from './AvatarExamples';
|
|
13
|
+
import { ScreenExamples } from './ScreenExamples';
|
|
14
|
+
import { ThemeExtensionExamples } from './ThemeExtensionExamples';
|
|
15
|
+
|
|
16
|
+
export const AllExamples = () => {
|
|
17
|
+
return (
|
|
18
|
+
<Screen background="primary" padding="xl">
|
|
19
|
+
<View spacing="none" style={{ maxWidth: 800, alignSelf: 'center' }}>
|
|
20
|
+
<Text size="xlarge" weight="bold" align="center" color="primary">
|
|
21
|
+
Idealyst Component Library Examples
|
|
22
|
+
</Text>
|
|
23
|
+
<Text size="medium" align="center" color="secondary">
|
|
24
|
+
Comprehensive showcase of all available components
|
|
25
|
+
</Text>
|
|
26
|
+
|
|
27
|
+
<Divider spacing="large" intent="primary">
|
|
28
|
+
<Text size="small" weight="semibold" color="primary">COMPONENTS</Text>
|
|
29
|
+
</Divider>
|
|
30
|
+
|
|
31
|
+
<ButtonExamples />
|
|
32
|
+
<Divider spacing="medium" />
|
|
33
|
+
|
|
34
|
+
<TextExamples />
|
|
35
|
+
<Divider spacing="medium" />
|
|
36
|
+
|
|
37
|
+
<ViewExamples />
|
|
38
|
+
<Divider spacing="medium" />
|
|
39
|
+
|
|
40
|
+
<InputExamples />
|
|
41
|
+
<Divider spacing="medium" />
|
|
42
|
+
|
|
43
|
+
<IconExamples />
|
|
44
|
+
<Divider spacing="medium" />
|
|
45
|
+
|
|
46
|
+
<CardExamples />
|
|
47
|
+
<Divider spacing="medium" />
|
|
48
|
+
|
|
49
|
+
<CheckboxExamples />
|
|
50
|
+
<Divider spacing="medium" />
|
|
51
|
+
|
|
52
|
+
<DividerExamples />
|
|
53
|
+
<Divider spacing="medium" />
|
|
54
|
+
|
|
55
|
+
<BadgeExamples />
|
|
56
|
+
<Divider spacing="medium" />
|
|
57
|
+
|
|
58
|
+
<AvatarExamples />
|
|
59
|
+
<Divider spacing="medium" />
|
|
60
|
+
|
|
61
|
+
<ScreenExamples />
|
|
62
|
+
<Divider spacing="medium" />
|
|
63
|
+
|
|
64
|
+
<Divider spacing="large" intent="success">
|
|
65
|
+
<Text size="small" weight="semibold" color="green">THEME SYSTEM</Text>
|
|
66
|
+
</Divider>
|
|
67
|
+
|
|
68
|
+
<ThemeExtensionExamples />
|
|
69
|
+
</View>
|
|
70
|
+
</Screen>
|
|
71
|
+
);
|
|
72
|
+
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Screen, View, Text, Avatar } from '../index';
|
|
3
|
+
|
|
4
|
+
export const AvatarExamples = () => {
|
|
5
|
+
return (
|
|
6
|
+
<Screen background="primary" padding="lg">
|
|
7
|
+
<View spacing="none">
|
|
8
|
+
<Text size="large" weight="bold" align="center">
|
|
9
|
+
Avatar Examples
|
|
10
|
+
</Text>
|
|
11
|
+
|
|
12
|
+
{/* Avatar Sizes */}
|
|
13
|
+
<View spacing="md">
|
|
14
|
+
<Text size="medium" weight="semibold">Sizes</Text>
|
|
15
|
+
<View style={{ flexDirection: 'row', gap: 12, flexWrap: 'wrap', alignItems: 'center' }}>
|
|
16
|
+
<Avatar size="small" fallback="S" />
|
|
17
|
+
<Avatar size="medium" fallback="M" />
|
|
18
|
+
<Avatar size="large" fallback="L" />
|
|
19
|
+
<Avatar size="xlarge" fallback="XL" />
|
|
20
|
+
</View>
|
|
21
|
+
</View>
|
|
22
|
+
|
|
23
|
+
{/* Avatar Shapes */}
|
|
24
|
+
<View spacing="md">
|
|
25
|
+
<Text size="medium" weight="semibold">Shapes</Text>
|
|
26
|
+
<View style={{ flexDirection: 'row', gap: 12, flexWrap: 'wrap', alignItems: 'center' }}>
|
|
27
|
+
<Avatar shape="circle" fallback="C" size="large" />
|
|
28
|
+
<Avatar shape="square" fallback="S" size="large" />
|
|
29
|
+
</View>
|
|
30
|
+
</View>
|
|
31
|
+
|
|
32
|
+
{/* Avatar with Fallbacks */}
|
|
33
|
+
<View spacing="md">
|
|
34
|
+
<Text size="medium" weight="semibold">Fallback Text</Text>
|
|
35
|
+
<View style={{ flexDirection: 'row', gap: 12, flexWrap: 'wrap', alignItems: 'center' }}>
|
|
36
|
+
<Avatar fallback="JD" alt="John Doe" />
|
|
37
|
+
<Avatar fallback="AB" alt="Alice Brown" />
|
|
38
|
+
<Avatar fallback="MJ" alt="Michael Johnson" />
|
|
39
|
+
<Avatar fallback="LW" alt="Lisa Wilson" />
|
|
40
|
+
</View>
|
|
41
|
+
</View>
|
|
42
|
+
|
|
43
|
+
{/* Avatar with Images */}
|
|
44
|
+
<View spacing="md">
|
|
45
|
+
<Text size="medium" weight="semibold">With Images</Text>
|
|
46
|
+
<View style={{ flexDirection: 'row', gap: 12, flexWrap: 'wrap', alignItems: 'center' }}>
|
|
47
|
+
<Avatar
|
|
48
|
+
src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?w=150&h=150&fit=crop&crop=face"
|
|
49
|
+
alt="Profile 1"
|
|
50
|
+
fallback="P1"
|
|
51
|
+
/>
|
|
52
|
+
<Avatar
|
|
53
|
+
src="https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=150&h=150&fit=crop&crop=face"
|
|
54
|
+
alt="Profile 2"
|
|
55
|
+
fallback="P2"
|
|
56
|
+
/>
|
|
57
|
+
<Avatar
|
|
58
|
+
src="https://images.unsplash.com/photo-1494790108755-2616b9b5a24f?w=150&h=150&fit=crop&crop=face"
|
|
59
|
+
alt="Profile 3"
|
|
60
|
+
fallback="P3"
|
|
61
|
+
/>
|
|
62
|
+
</View>
|
|
63
|
+
</View>
|
|
64
|
+
|
|
65
|
+
{/* Avatar Group */}
|
|
66
|
+
<View spacing="md">
|
|
67
|
+
<Text size="medium" weight="semibold">Avatar Group</Text>
|
|
68
|
+
<View style={{ flexDirection: 'row', gap: -8, alignItems: 'center' }}>
|
|
69
|
+
<Avatar fallback="JD" size="medium" />
|
|
70
|
+
<Avatar fallback="AB" size="medium" />
|
|
71
|
+
<Avatar fallback="MJ" size="medium" />
|
|
72
|
+
<Avatar fallback="+3" size="medium" />
|
|
73
|
+
</View>
|
|
74
|
+
</View>
|
|
75
|
+
|
|
76
|
+
{/* Different Size Combinations */}
|
|
77
|
+
<View spacing="md">
|
|
78
|
+
<Text size="medium" weight="semibold">Size Combinations</Text>
|
|
79
|
+
<View spacing="sm">
|
|
80
|
+
<View style={{ flexDirection: 'row', gap: 8, alignItems: 'center' }}>
|
|
81
|
+
<Avatar size="small" fallback="S" />
|
|
82
|
+
<Text size="small">Small avatar with text</Text>
|
|
83
|
+
</View>
|
|
84
|
+
<View style={{ flexDirection: 'row', gap: 8, alignItems: 'center' }}>
|
|
85
|
+
<Avatar size="medium" fallback="M" />
|
|
86
|
+
<Text size="medium">Medium avatar with text</Text>
|
|
87
|
+
</View>
|
|
88
|
+
<View style={{ flexDirection: 'row', gap: 8, alignItems: 'center' }}>
|
|
89
|
+
<Avatar size="large" fallback="L" />
|
|
90
|
+
<Text size="large">Large avatar with text</Text>
|
|
91
|
+
</View>
|
|
92
|
+
</View>
|
|
93
|
+
</View>
|
|
94
|
+
</View>
|
|
95
|
+
</Screen>
|
|
96
|
+
);
|
|
97
|
+
};
|