@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,54 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import type { IntentVariant } from '../theme/variants';
|
|
3
|
+
|
|
4
|
+
export interface DividerProps {
|
|
5
|
+
/**
|
|
6
|
+
* The orientation of the divider
|
|
7
|
+
*/
|
|
8
|
+
orientation?: 'horizontal' | 'vertical';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The visual style variant of the divider
|
|
12
|
+
*/
|
|
13
|
+
variant?: 'solid' | 'dashed' | 'dotted';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The thickness of the divider
|
|
17
|
+
*/
|
|
18
|
+
thickness?: 'thin' | 'medium' | 'thick';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The color intent of the divider
|
|
22
|
+
*/
|
|
23
|
+
intent?: IntentVariant;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The length of the divider (percentage or fixed)
|
|
27
|
+
*/
|
|
28
|
+
length?: 'full' | 'auto' | number;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Spacing around the divider
|
|
32
|
+
*/
|
|
33
|
+
spacing?: 'none' | 'small' | 'medium' | 'large';
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Content to display in the center of the divider (for horizontal dividers)
|
|
37
|
+
*/
|
|
38
|
+
children?: ReactNode;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Additional styles (platform-specific)
|
|
42
|
+
*/
|
|
43
|
+
style?: any;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Test ID for testing
|
|
47
|
+
*/
|
|
48
|
+
testID?: string;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Accessibility label
|
|
52
|
+
*/
|
|
53
|
+
accessibilityLabel?: string;
|
|
54
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
|
|
3
|
+
import { IconProps } from './types';
|
|
4
|
+
import iconStyles from './Icon.styles';
|
|
5
|
+
|
|
6
|
+
const Icon: React.FC<IconProps> = ({
|
|
7
|
+
name,
|
|
8
|
+
size = 'md',
|
|
9
|
+
color,
|
|
10
|
+
style,
|
|
11
|
+
testID,
|
|
12
|
+
accessibilityLabel,
|
|
13
|
+
}: IconProps) => {
|
|
14
|
+
|
|
15
|
+
// Use Unistyles v3 with color and size variants
|
|
16
|
+
const styles = iconStyles.useVariants({ color, size });
|
|
17
|
+
|
|
18
|
+
// Map size variants to pixel values
|
|
19
|
+
const sizeMap = {
|
|
20
|
+
xs: 12,
|
|
21
|
+
sm: 16,
|
|
22
|
+
md: 24,
|
|
23
|
+
lg: 32,
|
|
24
|
+
xl: 48,
|
|
25
|
+
};
|
|
26
|
+
const iconSize = sizeMap[size];
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<MaterialCommunityIcons
|
|
30
|
+
name={name}
|
|
31
|
+
size={iconSize}
|
|
32
|
+
style={[styles.icon, style]}
|
|
33
|
+
testID={testID}
|
|
34
|
+
accessibilityLabel={accessibilityLabel}
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export default Icon;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
2
|
+
import { generateColorVariants } from '../theme/variantHelpers';
|
|
3
|
+
|
|
4
|
+
const iconStyles = StyleSheet.create((theme) => ({
|
|
5
|
+
icon: {
|
|
6
|
+
// Default size (medium)
|
|
7
|
+
width: 24,
|
|
8
|
+
height: 24,
|
|
9
|
+
|
|
10
|
+
// Default theme-based color
|
|
11
|
+
color: theme.colors?.text || '#000000',
|
|
12
|
+
|
|
13
|
+
// Variants for different color schemes and sizes
|
|
14
|
+
variants: {
|
|
15
|
+
// Dynamically generated color variants using generateColorVariants helper
|
|
16
|
+
color: generateColorVariants(theme),
|
|
17
|
+
size: {
|
|
18
|
+
xs: {
|
|
19
|
+
width: 12,
|
|
20
|
+
height: 12,
|
|
21
|
+
},
|
|
22
|
+
sm: {
|
|
23
|
+
width: 16,
|
|
24
|
+
height: 16,
|
|
25
|
+
},
|
|
26
|
+
md: {
|
|
27
|
+
width: 24,
|
|
28
|
+
height: 24,
|
|
29
|
+
},
|
|
30
|
+
lg: {
|
|
31
|
+
width: 32,
|
|
32
|
+
height: 32,
|
|
33
|
+
},
|
|
34
|
+
xl: {
|
|
35
|
+
width: 48,
|
|
36
|
+
height: 48,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
// Web-specific styles
|
|
42
|
+
_web: {
|
|
43
|
+
display: 'inline-block',
|
|
44
|
+
verticalAlign: 'middle',
|
|
45
|
+
flexShrink: 0,
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
}));
|
|
49
|
+
|
|
50
|
+
export default iconStyles;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import MdiIcon from '@mdi/react';
|
|
3
|
+
import { IconProps } from './types';
|
|
4
|
+
import iconStyles from './Icon.styles';
|
|
5
|
+
import { getWebProps } from 'react-native-unistyles/web';
|
|
6
|
+
|
|
7
|
+
// Internal props that include the transformed path from Babel plugin
|
|
8
|
+
interface InternalIconProps extends IconProps {
|
|
9
|
+
path?: string; // Added by Babel plugin transformation
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const Icon: React.FC<IconProps> = (props: InternalIconProps) => {
|
|
13
|
+
const {
|
|
14
|
+
name,
|
|
15
|
+
size = 'md',
|
|
16
|
+
color,
|
|
17
|
+
style,
|
|
18
|
+
testID,
|
|
19
|
+
accessibilityLabel,
|
|
20
|
+
...restProps
|
|
21
|
+
} = props;
|
|
22
|
+
|
|
23
|
+
// Use Unistyles v3 with color and size variants
|
|
24
|
+
const styles = iconStyles.useVariants({ color, size });
|
|
25
|
+
console.log(styles);
|
|
26
|
+
|
|
27
|
+
// Check if we have a path prop (from Babel plugin transformation)
|
|
28
|
+
const { path } = restProps as { path?: string };
|
|
29
|
+
const iconProps = getWebProps(styles.icon);
|
|
30
|
+
|
|
31
|
+
// Use MDI React icon when path is provided (transformed by Babel plugin)
|
|
32
|
+
return (
|
|
33
|
+
<div
|
|
34
|
+
{...iconProps}>
|
|
35
|
+
<MdiIcon
|
|
36
|
+
path={path}
|
|
37
|
+
size={'100%'}
|
|
38
|
+
color={'currentColor'}
|
|
39
|
+
data-testid={testID}
|
|
40
|
+
aria-label={accessibilityLabel || name}
|
|
41
|
+
/>
|
|
42
|
+
</div>
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export default Icon;
|