@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.
Files changed (112) hide show
  1. package/README.md +568 -0
  2. package/package.json +107 -0
  3. package/plugin/web.js +186 -0
  4. package/src/Avatar/Avatar.native.tsx +44 -0
  5. package/src/Avatar/Avatar.styles.tsx +67 -0
  6. package/src/Avatar/Avatar.web.tsx +51 -0
  7. package/src/Avatar/index.native.ts +2 -0
  8. package/src/Avatar/index.ts +2 -0
  9. package/src/Avatar/index.web.ts +2 -0
  10. package/src/Avatar/types.ts +43 -0
  11. package/src/Badge/Badge.native.tsx +43 -0
  12. package/src/Badge/Badge.styles.tsx +154 -0
  13. package/src/Badge/Badge.web.tsx +45 -0
  14. package/src/Badge/index.native.ts +2 -0
  15. package/src/Badge/index.ts +2 -0
  16. package/src/Badge/index.web.ts +2 -0
  17. package/src/Badge/types.ts +34 -0
  18. package/src/Button/Button.native.tsx +39 -0
  19. package/src/Button/Button.styles.tsx +215 -0
  20. package/src/Button/Button.types.ts +12 -0
  21. package/src/Button/Button.web.tsx +56 -0
  22. package/src/Button/index.native.ts +3 -0
  23. package/src/Button/index.ts +5 -0
  24. package/src/Button/index.web.ts +3 -0
  25. package/src/Button/types.ts +49 -0
  26. package/src/Card/Card.native.tsx +52 -0
  27. package/src/Card/Card.styles.tsx +240 -0
  28. package/src/Card/Card.web.tsx +62 -0
  29. package/src/Card/index.native.ts +3 -0
  30. package/src/Card/index.ts +5 -0
  31. package/src/Card/index.web.ts +3 -0
  32. package/src/Card/types.ts +59 -0
  33. package/src/Checkbox/Checkbox.native.tsx +99 -0
  34. package/src/Checkbox/Checkbox.styles.tsx +292 -0
  35. package/src/Checkbox/Checkbox.web.tsx +131 -0
  36. package/src/Checkbox/index.native.ts +3 -0
  37. package/src/Checkbox/index.ts +5 -0
  38. package/src/Checkbox/index.web.ts +3 -0
  39. package/src/Checkbox/types.ts +79 -0
  40. package/src/Divider/Divider.native.tsx +145 -0
  41. package/src/Divider/Divider.styles.tsx +602 -0
  42. package/src/Divider/Divider.web.tsx +73 -0
  43. package/src/Divider/index.native.ts +3 -0
  44. package/src/Divider/index.ts +5 -0
  45. package/src/Divider/index.web.ts +3 -0
  46. package/src/Divider/types.ts +54 -0
  47. package/src/Icon/Icon.native.tsx +39 -0
  48. package/src/Icon/Icon.styles.tsx +50 -0
  49. package/src/Icon/Icon.web.tsx +47 -0
  50. package/src/Icon/icon-types.ts +7452 -0
  51. package/src/Icon/index.native.ts +3 -0
  52. package/src/Icon/index.ts +5 -0
  53. package/src/Icon/index.web.ts +3 -0
  54. package/src/Icon/types.ts +36 -0
  55. package/src/Input/Input.native.tsx +75 -0
  56. package/src/Input/Input.styles.tsx +177 -0
  57. package/src/Input/Input.web.tsx +71 -0
  58. package/src/Input/index.native.ts +3 -0
  59. package/src/Input/index.ts +5 -0
  60. package/src/Input/index.web.ts +3 -0
  61. package/src/Input/types.ts +69 -0
  62. package/src/Screen/Screen.native.tsx +41 -0
  63. package/src/Screen/Screen.styles.tsx +60 -0
  64. package/src/Screen/Screen.web.tsx +33 -0
  65. package/src/Screen/index.native.ts +2 -0
  66. package/src/Screen/index.ts +2 -0
  67. package/src/Screen/index.web.ts +2 -0
  68. package/src/Screen/types.ts +38 -0
  69. package/src/Text/Text.native.tsx +36 -0
  70. package/src/Text/Text.styles.tsx +67 -0
  71. package/src/Text/Text.web.tsx +41 -0
  72. package/src/Text/index.native.ts +3 -0
  73. package/src/Text/index.ts +5 -0
  74. package/src/Text/index.web.ts +3 -0
  75. package/src/Text/types.ts +39 -0
  76. package/src/View/View.native.tsx +56 -0
  77. package/src/View/View.styles.tsx +103 -0
  78. package/src/View/View.web.tsx +60 -0
  79. package/src/View/index.native.ts +3 -0
  80. package/src/View/index.ts +5 -0
  81. package/src/View/index.web.ts +3 -0
  82. package/src/View/types.ts +73 -0
  83. package/src/examples/AllExamples.tsx +72 -0
  84. package/src/examples/AvatarExamples.tsx +97 -0
  85. package/src/examples/BadgeExamples.tsx +200 -0
  86. package/src/examples/ButtonExamples.tsx +150 -0
  87. package/src/examples/CardExamples.tsx +176 -0
  88. package/src/examples/CheckboxExamples.tsx +217 -0
  89. package/src/examples/DividerExamples.tsx +218 -0
  90. package/src/examples/IconExamples.tsx +342 -0
  91. package/src/examples/InputExamples.tsx +134 -0
  92. package/src/examples/README.md +136 -0
  93. package/src/examples/ScreenExamples.tsx +154 -0
  94. package/src/examples/TextExamples.tsx +89 -0
  95. package/src/examples/ThemeExtensionExamples.tsx +91 -0
  96. package/src/examples/ValidationExamples.tsx +95 -0
  97. package/src/examples/ViewExamples.tsx +129 -0
  98. package/src/examples/extendedTheme.ts +331 -0
  99. package/src/examples/index.ts +15 -0
  100. package/src/index.native.ts +52 -0
  101. package/src/index.ts +48 -0
  102. package/src/theme/breakpoints.ts +8 -0
  103. package/src/theme/colorResolver.ts +218 -0
  104. package/src/theme/colors.ts +315 -0
  105. package/src/theme/defaultThemes.ts +326 -0
  106. package/src/theme/index.ts +188 -0
  107. package/src/theme/themeBuilder.ts +602 -0
  108. package/src/theme/unistyles.d.ts +6 -0
  109. package/src/theme/variantHelpers.ts +584 -0
  110. package/src/theme/variants.ts +56 -0
  111. package/src/unistyles.d.ts +108 -0
  112. package/src/unistyles.ts +43 -0
@@ -0,0 +1,3 @@
1
+ // React Native-specific Icon export
2
+ export { default } from './Icon.native';
3
+ export * from './types';
@@ -0,0 +1,5 @@
1
+ // Platform-agnostic Icon export
2
+ // Metro will resolve to index.native.ts for React Native
3
+ // This file serves as fallback for web environments
4
+ export { default } from './Icon.web';
5
+ export * from './types';
@@ -0,0 +1,3 @@
1
+ // Web-specific Icon export
2
+ export { default } from './Icon.web';
3
+ export * from './types';
@@ -0,0 +1,36 @@
1
+ import { IconName } from "./icon-types";
2
+ import type { DisplayColorVariant } from '../theme/variants';
3
+
4
+ export type IconSizeVariant = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
5
+
6
+ export interface IconProps {
7
+ /**
8
+ * The name of the icon to display
9
+ */
10
+ name: IconName;
11
+
12
+ /**
13
+ * The size variant of the icon
14
+ */
15
+ size?: IconSizeVariant;
16
+
17
+ /**
18
+ * Predefined color variant based on theme
19
+ */
20
+ color?: DisplayColorVariant;
21
+
22
+ /**
23
+ * Additional styles (platform-specific)
24
+ */
25
+ style?: any;
26
+
27
+ /**
28
+ * Test ID for testing
29
+ */
30
+ testID?: string;
31
+
32
+ /**
33
+ * Accessibility label for screen readers
34
+ */
35
+ accessibilityLabel?: string;
36
+ }
@@ -0,0 +1,75 @@
1
+ import React, { useState } from 'react';
2
+ import { TextInput } from 'react-native';
3
+ import { InputProps } from './types';
4
+ import { inputStyles } from './Input.styles';
5
+
6
+ const Input: React.FC<InputProps> = ({
7
+ value,
8
+ onChangeText,
9
+ placeholder,
10
+ disabled = false,
11
+ inputType = 'text',
12
+ secureTextEntry = false,
13
+ autoCapitalize = 'sentences',
14
+ size = 'medium',
15
+ variant = 'default',
16
+ hasError = false,
17
+ style,
18
+ testID,
19
+ }) => {
20
+ const [isFocused, setIsFocused] = useState(false);
21
+
22
+ const getKeyboardType = () => {
23
+ switch (inputType) {
24
+ case 'email':
25
+ return 'email-address';
26
+ case 'number':
27
+ return 'numeric';
28
+ case 'password':
29
+ case 'text':
30
+ default:
31
+ return 'default';
32
+ }
33
+ };
34
+
35
+ const handleFocus = () => {
36
+ setIsFocused(true);
37
+ };
38
+
39
+ const handleBlur = () => {
40
+ setIsFocused(false);
41
+ };
42
+
43
+ // Apply variants to the stylesheet
44
+ inputStyles.useVariants({
45
+ size,
46
+ variant,
47
+ focused: isFocused,
48
+ });
49
+
50
+ const inputStyleArray = [
51
+ inputStyles.input,
52
+ disabled && inputStyles.disabled,
53
+ hasError && inputStyles.error,
54
+ style,
55
+ ];
56
+
57
+ return (
58
+ <TextInput
59
+ value={value}
60
+ onChangeText={onChangeText}
61
+ placeholder={placeholder}
62
+ editable={!disabled}
63
+ keyboardType={getKeyboardType()}
64
+ secureTextEntry={secureTextEntry || inputType === 'password'}
65
+ autoCapitalize={autoCapitalize}
66
+ onFocus={handleFocus}
67
+ onBlur={handleBlur}
68
+ style={inputStyleArray}
69
+ testID={testID}
70
+ placeholderTextColor="#999999"
71
+ />
72
+ );
73
+ };
74
+
75
+ export default Input;
@@ -0,0 +1,177 @@
1
+ import { StyleSheet } from 'react-native-unistyles';
2
+
3
+ export const inputStyles = StyleSheet.create((theme) => ({
4
+ input: {
5
+ variants: {
6
+ size: {
7
+ small: {
8
+ height: 36,
9
+ paddingHorizontal: theme.spacing?.sm || 8,
10
+ paddingVertical: theme.spacing?.xs || 4,
11
+ fontSize: theme.typography?.fontSize?.sm || 14,
12
+ },
13
+ medium: {
14
+ height: 44,
15
+ paddingHorizontal: theme.spacing?.md || 12,
16
+ paddingVertical: theme.spacing?.sm || 8,
17
+ fontSize: theme.typography?.fontSize?.md || 16,
18
+ },
19
+ large: {
20
+ height: 52,
21
+ paddingHorizontal: theme.spacing?.lg || 16,
22
+ paddingVertical: theme.spacing?.md || 12,
23
+ fontSize: theme.typography?.fontSize?.lg || 18,
24
+ },
25
+ },
26
+ variant: {
27
+ default: {
28
+ backgroundColor: theme.colors?.surface?.primary || '#ffffff',
29
+ borderWidth: 1,
30
+ borderColor: theme.colors?.border?.primary || '#e5e7eb',
31
+ borderStyle: 'solid',
32
+ color: theme.colors?.text?.primary || '#000000',
33
+
34
+ _web: {
35
+ border: `1px solid ${theme.colors?.border?.primary || '#e5e7eb'}`,
36
+ },
37
+ },
38
+ outlined: {
39
+ backgroundColor: 'transparent',
40
+ borderWidth: 1,
41
+ borderColor: theme.intents?.primary?.main || '#3b82f6',
42
+ borderStyle: 'solid',
43
+ color: theme.colors?.text?.primary || '#000000',
44
+
45
+ _web: {
46
+ border: `1px solid ${theme.intents?.primary?.main || '#3b82f6'}`,
47
+ },
48
+ },
49
+ filled: {
50
+ backgroundColor: theme.colors?.surface?.secondary || '#f9fafb',
51
+ borderWidth: 0,
52
+ borderColor: 'transparent',
53
+ color: theme.colors?.text?.primary || '#000000',
54
+
55
+ _web: {
56
+ border: 'none',
57
+ },
58
+ },
59
+ },
60
+ focused: {
61
+ true: {
62
+ // Base focused styles - will be overridden by compound variants
63
+ },
64
+ false: {
65
+ // No additional styles when not focused
66
+ },
67
+ },
68
+ },
69
+
70
+ compoundVariants: [
71
+ // Default variant focus
72
+ {
73
+ variant: 'default',
74
+ focused: true,
75
+ styles: {
76
+ borderColor: theme.intents?.primary?.main || '#3b82f6',
77
+ shadowColor: theme.intents?.primary?.main || '#3b82f6',
78
+ shadowOffset: { width: 0, height: 0 },
79
+ shadowOpacity: 0.1,
80
+ shadowRadius: 2,
81
+ elevation: 1,
82
+ },
83
+ },
84
+ // Outlined variant focus
85
+ {
86
+ variant: 'outlined',
87
+ focused: true,
88
+ styles: {
89
+ backgroundColor: 'transparent',
90
+ borderWidth: 1,
91
+ borderColor: theme.intents?.primary?.main || '#3b82f6',
92
+ borderStyle: 'solid',
93
+ },
94
+ },
95
+ // Filled variant focus
96
+ {
97
+ variant: 'filled',
98
+ focused: true,
99
+ styles: {
100
+ backgroundColor: theme.colors?.surface?.secondary || '#f3f4f6',
101
+ borderWidth: 0,
102
+ shadowColor: theme.intents?.primary?.main || '#3b82f6',
103
+ shadowOffset: { width: 0, height: 0 },
104
+ shadowOpacity: 0.05,
105
+ shadowRadius: 1,
106
+ elevation: 0.5,
107
+ },
108
+ },
109
+ ],
110
+
111
+ borderRadius: theme.borderRadius?.md || 8,
112
+ fontWeight: theme.typography?.fontWeight?.regular || '400',
113
+ // Web-specific styles
114
+ _web: {
115
+ boxSizing: 'border-box',
116
+ outline: 'none',
117
+ transition: 'border-color 0.2s ease, box-shadow 0.2s ease',
118
+ fontFamily: 'inherit',
119
+ _focus: {
120
+ borderColor: theme.intents?.primary?.main || '#3b82f6',
121
+ },
122
+ _hover: {
123
+ borderColor: theme.intents?.primary?.main || '#3b82f6',
124
+ },
125
+ },
126
+ },
127
+ disabled: {
128
+ opacity: 0.6,
129
+ backgroundColor: theme.colors?.surface?.secondary || '#f3f4f6',
130
+ color: theme.colors?.text?.disabled || '#9ca3af',
131
+ _web: {
132
+ cursor: 'not-allowed',
133
+ },
134
+ },
135
+ error: {
136
+ borderWidth: 1,
137
+ borderColor: theme.intents?.error?.main || '#ef4444',
138
+ borderStyle: 'solid',
139
+
140
+ variants: {
141
+ focused: {
142
+ true: {
143
+ shadowColor: theme.intents?.error?.main || '#ef4444',
144
+ shadowOffset: { width: 0, height: 0 },
145
+ shadowOpacity: 0.1,
146
+ shadowRadius: 2,
147
+ elevation: 1,
148
+ },
149
+ false: {
150
+ // No additional styles when not focused
151
+ },
152
+ },
153
+ variant: {
154
+ default: {
155
+ // Use default error styles
156
+ },
157
+ outlined: {
158
+ // Override outlined styles for error
159
+ borderColor: theme.intents?.error?.main || '#ef4444',
160
+ },
161
+ filled: {
162
+ // Add border for error even in filled variant
163
+ borderWidth: 1,
164
+ borderColor: theme.intents?.error?.main || '#ef4444',
165
+ },
166
+ },
167
+ },
168
+
169
+ _web: {
170
+ border: `1px solid ${theme.intents?.error?.main || '#ef4444'}`,
171
+ _focus: {
172
+ borderColor: theme.intents?.error?.main || '#ef4444',
173
+ boxShadow: `0 0 0 2px ${theme.intents?.error?.main || '#ef4444'}20`,
174
+ },
175
+ },
176
+ },
177
+ }));
@@ -0,0 +1,71 @@
1
+ import React from 'react';
2
+ import { getWebProps } from 'react-native-unistyles/web';
3
+ import { InputProps } from './types';
4
+ import { inputStyles } from './Input.styles';
5
+
6
+ const Input: React.FC<InputProps> = ({
7
+ value,
8
+ onChangeText,
9
+ placeholder,
10
+ disabled = false,
11
+ inputType = 'text',
12
+ secureTextEntry = false,
13
+ autoCapitalize = 'sentences',
14
+ size = 'medium',
15
+ variant = 'default',
16
+ hasError = false,
17
+ style,
18
+ testID,
19
+ }) => {
20
+ const getInputType = () => {
21
+ switch (inputType) {
22
+ case 'email':
23
+ return 'email';
24
+ case 'number':
25
+ return 'number';
26
+ case 'password':
27
+ return 'password';
28
+ case 'text':
29
+ default:
30
+ return 'text';
31
+ }
32
+ };
33
+
34
+ const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
35
+ if (onChangeText) {
36
+ onChangeText(e.target.value);
37
+ }
38
+ };
39
+
40
+ // Apply variants using the correct Unistyles 3.0 pattern
41
+ inputStyles.useVariants({
42
+ size: size as 'small' | 'medium' | 'large',
43
+ variant: variant as 'default' | 'outlined' | 'filled',
44
+ });
45
+
46
+ // Create the style array following the official documentation pattern
47
+ const inputStyleArray = [
48
+ inputStyles.input,
49
+ disabled && inputStyles.disabled,
50
+ hasError && inputStyles.error,
51
+ style,
52
+ ].filter(Boolean);
53
+
54
+ // Use getWebProps to generate className and ref for web
55
+ const webProps = getWebProps(inputStyleArray);
56
+
57
+ return (
58
+ <input
59
+ {...webProps}
60
+ type={secureTextEntry ? 'password' : getInputType()}
61
+ value={value}
62
+ onChange={handleChange}
63
+ placeholder={placeholder}
64
+ disabled={disabled}
65
+ autoCapitalize={autoCapitalize}
66
+ data-testid={testID}
67
+ />
68
+ );
69
+ };
70
+
71
+ export default Input;
@@ -0,0 +1,3 @@
1
+ // React Native-specific Input export
2
+ export { default } from './Input.native';
3
+ export * from './types';
@@ -0,0 +1,5 @@
1
+ // Platform-agnostic Input export
2
+ // Bundlers will resolve to index.web.ts (web) or index.native.ts (React Native)
3
+ // This file serves as fallback for web environments
4
+ export { default } from './Input.web';
5
+ export * from './types';
@@ -0,0 +1,3 @@
1
+ // Web-specific Input export
2
+ export { default } from './Input.web';
3
+ export * from './types';
@@ -0,0 +1,69 @@
1
+ import type { IntentVariant } from '../theme/variants';
2
+
3
+ export interface InputProps {
4
+ /**
5
+ * The current value of the input
6
+ */
7
+ value?: string;
8
+
9
+ /**
10
+ * Called when the text changes
11
+ */
12
+ onChangeText?: (text: string) => void;
13
+
14
+ /**
15
+ * Placeholder text
16
+ */
17
+ placeholder?: string;
18
+
19
+ /**
20
+ * Whether the input is disabled
21
+ */
22
+ disabled?: boolean;
23
+
24
+ /**
25
+ * The type of input (affects keyboard type on mobile)
26
+ */
27
+ inputType?: 'text' | 'email' | 'password' | 'number';
28
+
29
+ /**
30
+ * Whether to show the password
31
+ */
32
+ secureTextEntry?: boolean;
33
+
34
+ /**
35
+ * Auto-capitalization behavior
36
+ */
37
+ autoCapitalize?: 'none' | 'sentences' | 'words' | 'characters';
38
+
39
+ /**
40
+ * Size variant of the input
41
+ */
42
+ size?: 'small' | 'medium' | 'large';
43
+
44
+ /**
45
+ * Style variant of the input
46
+ */
47
+ variant?: 'default' | 'outlined' | 'filled';
48
+
49
+ /**
50
+ * The intent/color scheme of the input (for focus states, validation, etc.)
51
+ */
52
+ intent?: IntentVariant;
53
+
54
+ /**
55
+ * Whether the input has an error state
56
+ * @deprecated Use intent="error" instead
57
+ */
58
+ hasError?: boolean;
59
+
60
+ /**
61
+ * Additional styles (platform-specific)
62
+ */
63
+ style?: any;
64
+
65
+ /**
66
+ * Test ID for testing
67
+ */
68
+ testID?: string;
69
+ }
@@ -0,0 +1,41 @@
1
+ import React from 'react';
2
+ import { View as RNView, ScrollView as RNScrollView } from 'react-native';
3
+ import { ScreenProps } from './types';
4
+ import { screenStyles } from './Screen.styles';
5
+
6
+ const Screen: React.FC<ScreenProps> = ({
7
+ children,
8
+ background = 'primary',
9
+ padding = 'md',
10
+ safeArea = false,
11
+ scrollable = true,
12
+ style,
13
+ testID,
14
+ }) => {
15
+ screenStyles.useVariants({
16
+ background,
17
+ padding,
18
+ safeArea,
19
+ });
20
+
21
+ const screenStyleArray = [
22
+ screenStyles.screen,
23
+ style,
24
+ ];
25
+
26
+ if (scrollable) {
27
+ return (
28
+ <RNScrollView style={screenStyleArray} testID={testID}>
29
+ {children}
30
+ </RNScrollView>
31
+ );
32
+ }
33
+
34
+ return (
35
+ <RNView style={screenStyleArray} testID={testID}>
36
+ {children}
37
+ </RNView>
38
+ );
39
+ };
40
+
41
+ export default Screen;
@@ -0,0 +1,60 @@
1
+ import { StyleSheet } from 'react-native-unistyles';
2
+
3
+ export const screenStyles = StyleSheet.create((theme) => ({
4
+ screen: {
5
+ flex: 1,
6
+ // Default background color as fallback
7
+ backgroundColor: theme.colors.surface.primary,
8
+ variants: {
9
+ background: {
10
+ primary: {
11
+ backgroundColor: theme.colors.surface.primary,
12
+ },
13
+ secondary: {
14
+ backgroundColor: theme.colors.surface.secondary,
15
+ },
16
+ tertiary: {
17
+ backgroundColor: theme.colors.surface.tertiary,
18
+ },
19
+ inverse: {
20
+ backgroundColor: theme.colors.surface.inverse,
21
+ },
22
+ },
23
+ padding: {
24
+ none: {
25
+ padding: 0,
26
+ },
27
+ sm: {
28
+ padding: theme.spacing.sm,
29
+ },
30
+ md: {
31
+ padding: theme.spacing.md,
32
+ },
33
+ lg: {
34
+ padding: theme.spacing.lg,
35
+ },
36
+ xl: {
37
+ padding: theme.spacing.xl,
38
+ },
39
+ },
40
+ safeArea: {
41
+ true: {
42
+ paddingTop: theme.spacing.lg, // Safe area top
43
+ paddingBottom: theme.spacing.lg, // Safe area bottom
44
+ },
45
+ false: {
46
+ paddingTop: 0,
47
+ paddingBottom: 0,
48
+ },
49
+ },
50
+ },
51
+ // Web-specific styles
52
+ _web: {
53
+ overflow: 'auto',
54
+ display: 'flex',
55
+ flexDirection: 'column',
56
+ minHeight: '100%',
57
+ boxSizing: 'border-box',
58
+ },
59
+ },
60
+ }));
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+ import { getWebProps } from 'react-native-unistyles/web';
3
+ import { ScreenProps } from './types';
4
+ import { screenStyles } from './Screen.styles';
5
+
6
+ const Screen: React.FC<ScreenProps> = ({
7
+ children,
8
+ background = 'primary',
9
+ padding = 'md',
10
+ safeArea = false,
11
+ style,
12
+ testID,
13
+ }) => {
14
+ screenStyles.useVariants({
15
+ background,
16
+ padding,
17
+ safeArea,
18
+ });
19
+
20
+ // Use getWebProps to generate className and ref for web
21
+ const webProps = getWebProps([screenStyles.screen, style]);
22
+
23
+ return (
24
+ <div
25
+ {...webProps}
26
+ data-testid={testID}
27
+ >
28
+ {children}
29
+ </div>
30
+ );
31
+ };
32
+
33
+ export default Screen;
@@ -0,0 +1,2 @@
1
+ export { default } from './Screen.native';
2
+ export * from './types';
@@ -0,0 +1,2 @@
1
+ export { default } from './Screen.web';
2
+ export * from './types';
@@ -0,0 +1,2 @@
1
+ export { default } from './Screen.web';
2
+ export * from './types';
@@ -0,0 +1,38 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ export interface ScreenProps {
4
+ /**
5
+ * The content to display inside the screen
6
+ */
7
+ children?: ReactNode;
8
+
9
+ /**
10
+ * Background variant - controls the background color
11
+ */
12
+ background?: 'primary' | 'secondary' | 'tertiary' | 'inverse';
13
+
14
+ /**
15
+ * Screen padding variant
16
+ */
17
+ padding?: 'none' | 'sm' | 'md' | 'lg' | 'xl';
18
+
19
+ /**
20
+ * Safe area padding for mobile devices
21
+ */
22
+ safeArea?: boolean;
23
+
24
+ /**
25
+ * Additional styles (platform-specific)
26
+ */
27
+ style?: any;
28
+
29
+ /**
30
+ * Test ID for testing
31
+ */
32
+ testID?: string;
33
+
34
+ /**
35
+ * Scrollable content
36
+ */
37
+ scrollable?: boolean;
38
+ }
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+ import { StyleSheet } from 'react-native-unistyles';
3
+ import { Text as RNText } from 'react-native';
4
+ import { TextProps } from './types';
5
+ import textStyles from './Text.styles';
6
+
7
+ const Text: React.FC<TextProps> = ({
8
+ children,
9
+ size = 'medium',
10
+ weight = 'normal',
11
+ color,
12
+ align = 'left',
13
+ style,
14
+ testID,
15
+ }) => {
16
+ textStyles.useVariants({
17
+ size,
18
+ weight,
19
+ align,
20
+ color: color
21
+ });
22
+
23
+ return (
24
+ <RNText
25
+ style={[
26
+ textStyles.text,
27
+ style,
28
+ ]}
29
+ testID={testID}
30
+ >
31
+ {children}
32
+ </RNText>
33
+ );
34
+ };
35
+
36
+ export default Text;