@idealyst/components 1.0.24 → 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.
Files changed (110) hide show
  1. package/README.md +567 -567
  2. package/package.json +2 -2
  3. package/plugin/web.js +319 -185
  4. package/src/Avatar/Avatar.native.tsx +43 -43
  5. package/src/Avatar/Avatar.styles.tsx +66 -66
  6. package/src/Avatar/Avatar.web.tsx +50 -50
  7. package/src/Avatar/index.native.ts +1 -1
  8. package/src/Avatar/index.ts +1 -1
  9. package/src/Avatar/index.web.ts +1 -1
  10. package/src/Avatar/types.ts +42 -42
  11. package/src/Badge/Badge.native.tsx +42 -42
  12. package/src/Badge/Badge.styles.tsx +153 -153
  13. package/src/Badge/Badge.web.tsx +44 -44
  14. package/src/Badge/index.native.ts +1 -1
  15. package/src/Badge/index.ts +1 -1
  16. package/src/Badge/index.web.ts +1 -1
  17. package/src/Badge/types.ts +33 -33
  18. package/src/Button/Button.native.tsx +38 -38
  19. package/src/Button/Button.styles.tsx +214 -214
  20. package/src/Button/Button.types.ts +11 -11
  21. package/src/Button/Button.web.tsx +55 -55
  22. package/src/Button/index.native.ts +2 -2
  23. package/src/Button/index.ts +4 -4
  24. package/src/Button/index.web.ts +2 -2
  25. package/src/Button/types.ts +48 -48
  26. package/src/Card/Card.native.tsx +51 -51
  27. package/src/Card/Card.styles.tsx +239 -239
  28. package/src/Card/Card.web.tsx +61 -61
  29. package/src/Card/index.native.ts +2 -2
  30. package/src/Card/index.ts +4 -4
  31. package/src/Card/index.web.ts +2 -2
  32. package/src/Card/types.ts +58 -58
  33. package/src/Checkbox/Checkbox.native.tsx +98 -98
  34. package/src/Checkbox/Checkbox.styles.tsx +291 -291
  35. package/src/Checkbox/Checkbox.web.tsx +130 -130
  36. package/src/Checkbox/index.native.ts +2 -2
  37. package/src/Checkbox/index.ts +4 -4
  38. package/src/Checkbox/index.web.ts +2 -2
  39. package/src/Checkbox/types.ts +78 -78
  40. package/src/Divider/Divider.native.tsx +144 -144
  41. package/src/Divider/Divider.styles.tsx +601 -601
  42. package/src/Divider/Divider.web.tsx +72 -72
  43. package/src/Divider/index.native.ts +2 -2
  44. package/src/Divider/index.ts +4 -4
  45. package/src/Divider/index.web.ts +2 -2
  46. package/src/Divider/types.ts +53 -53
  47. package/src/Icon/Icon.native.tsx +38 -38
  48. package/src/Icon/Icon.styles.tsx +49 -49
  49. package/src/Icon/Icon.web.tsx +46 -46
  50. package/src/Icon/icon-types.ts +7452 -7452
  51. package/src/Icon/index.native.ts +2 -2
  52. package/src/Icon/index.ts +4 -4
  53. package/src/Icon/index.web.ts +2 -2
  54. package/src/Icon/types.ts +35 -35
  55. package/src/Input/Input.native.tsx +74 -74
  56. package/src/Input/Input.styles.tsx +176 -176
  57. package/src/Input/Input.web.tsx +70 -70
  58. package/src/Input/index.native.ts +2 -2
  59. package/src/Input/index.ts +4 -4
  60. package/src/Input/index.web.ts +2 -2
  61. package/src/Input/types.ts +68 -68
  62. package/src/Screen/Screen.native.tsx +40 -40
  63. package/src/Screen/Screen.styles.tsx +59 -59
  64. package/src/Screen/Screen.web.tsx +32 -32
  65. package/src/Screen/index.native.ts +1 -1
  66. package/src/Screen/index.ts +1 -1
  67. package/src/Screen/index.web.ts +1 -1
  68. package/src/Screen/types.ts +37 -37
  69. package/src/Text/Text.native.tsx +35 -35
  70. package/src/Text/Text.styles.tsx +66 -66
  71. package/src/Text/Text.web.tsx +40 -40
  72. package/src/Text/index.native.ts +2 -2
  73. package/src/Text/index.ts +4 -4
  74. package/src/Text/index.web.ts +2 -2
  75. package/src/Text/types.ts +38 -38
  76. package/src/View/View.native.tsx +55 -55
  77. package/src/View/View.styles.tsx +102 -102
  78. package/src/View/View.web.tsx +59 -59
  79. package/src/View/index.native.ts +2 -2
  80. package/src/View/index.ts +4 -4
  81. package/src/View/index.web.ts +2 -2
  82. package/src/View/types.ts +72 -72
  83. package/src/examples/AllExamples.tsx +71 -71
  84. package/src/examples/AvatarExamples.tsx +96 -96
  85. package/src/examples/BadgeExamples.tsx +199 -199
  86. package/src/examples/ButtonExamples.tsx +149 -149
  87. package/src/examples/CardExamples.tsx +175 -175
  88. package/src/examples/CheckboxExamples.tsx +216 -216
  89. package/src/examples/DividerExamples.tsx +217 -217
  90. package/src/examples/IconExamples.tsx +341 -341
  91. package/src/examples/InputExamples.tsx +133 -133
  92. package/src/examples/README.md +135 -135
  93. package/src/examples/ScreenExamples.tsx +153 -153
  94. package/src/examples/TextExamples.tsx +88 -88
  95. package/src/examples/ThemeExtensionExamples.tsx +90 -90
  96. package/src/examples/ValidationExamples.tsx +94 -94
  97. package/src/examples/ViewExamples.tsx +128 -128
  98. package/src/examples/extendedTheme.ts +328 -328
  99. package/src/examples/index.ts +14 -14
  100. package/src/index.native.ts +48 -48
  101. package/src/index.ts +47 -47
  102. package/src/theme/breakpoints.ts +8 -8
  103. package/src/theme/colorResolver.ts +217 -217
  104. package/src/theme/colors.ts +314 -314
  105. package/src/theme/defaultThemes.ts +325 -325
  106. package/src/theme/index.ts +187 -187
  107. package/src/theme/themeBuilder.ts +601 -601
  108. package/src/theme/unistyles.d.ts +5 -5
  109. package/src/theme/variantHelpers.ts +583 -583
  110. package/src/theme/variants.ts +55 -55
@@ -1,73 +1,73 @@
1
- import React from 'react';
2
- import { getWebProps } from 'react-native-unistyles/web';
3
- import { DividerProps } from './types';
4
- import { dividerStyles } from './Divider.styles';
5
-
6
- const Divider: React.FC<DividerProps> = ({
7
- orientation = 'horizontal',
8
- variant = 'solid',
9
- thickness = 'thin',
10
- intent = 'neutral',
11
- length = 'full',
12
- spacing = 'medium',
13
- children,
14
- style,
15
- testID,
16
- accessibilityLabel,
17
- }) => {
18
- // Apply variants for main divider
19
- dividerStyles.useVariants({
20
- orientation,
21
- thickness,
22
- variant: variant as any,
23
- intent,
24
- length: typeof length === 'number' ? 'auto' : length,
25
- spacing,
26
- });
27
-
28
- // Create style arrays
29
- const dividerStyleArray = [
30
- dividerStyles.divider,
31
- style,
32
- ].filter(Boolean);
33
-
34
- const containerStyleArray = [dividerStyles.container];
35
- const contentStyleArray = [dividerStyles.content];
36
- const lineStyleArray = [dividerStyles.line];
37
-
38
- // Generate web props
39
- const dividerProps = getWebProps(dividerStyleArray);
40
- const containerProps = getWebProps(containerStyleArray);
41
- const contentProps = getWebProps(contentStyleArray);
42
- const lineProps = getWebProps(lineStyleArray);
43
-
44
- // If no children, render simple divider
45
- if (!children) {
46
- return (
47
- <div
48
- {...dividerProps}
49
- data-testid={testID}
50
- aria-label={accessibilityLabel}
51
- role="separator"
52
- />
53
- );
54
- }
55
-
56
- // If has children, render divider with content
57
- return (
58
- <div
59
- {...containerProps}
60
- data-testid={testID}
61
- aria-label={accessibilityLabel}
62
- role="separator"
63
- >
64
- <div {...lineProps} />
65
- <span {...contentProps}>
66
- {children}
67
- </span>
68
- <div {...lineProps} />
69
- </div>
70
- );
71
- };
72
-
1
+ import React from 'react';
2
+ import { getWebProps } from 'react-native-unistyles/web';
3
+ import { DividerProps } from './types';
4
+ import { dividerStyles } from './Divider.styles';
5
+
6
+ const Divider: React.FC<DividerProps> = ({
7
+ orientation = 'horizontal',
8
+ variant = 'solid',
9
+ thickness = 'thin',
10
+ intent = 'neutral',
11
+ length = 'full',
12
+ spacing = 'medium',
13
+ children,
14
+ style,
15
+ testID,
16
+ accessibilityLabel,
17
+ }) => {
18
+ // Apply variants for main divider
19
+ dividerStyles.useVariants({
20
+ orientation,
21
+ thickness,
22
+ variant: variant as any,
23
+ intent,
24
+ length: typeof length === 'number' ? 'auto' : length,
25
+ spacing,
26
+ });
27
+
28
+ // Create style arrays
29
+ const dividerStyleArray = [
30
+ dividerStyles.divider,
31
+ style,
32
+ ].filter(Boolean);
33
+
34
+ const containerStyleArray = [dividerStyles.container];
35
+ const contentStyleArray = [dividerStyles.content];
36
+ const lineStyleArray = [dividerStyles.line];
37
+
38
+ // Generate web props
39
+ const dividerProps = getWebProps(dividerStyleArray);
40
+ const containerProps = getWebProps(containerStyleArray);
41
+ const contentProps = getWebProps(contentStyleArray);
42
+ const lineProps = getWebProps(lineStyleArray);
43
+
44
+ // If no children, render simple divider
45
+ if (!children) {
46
+ return (
47
+ <div
48
+ {...dividerProps}
49
+ data-testid={testID}
50
+ aria-label={accessibilityLabel}
51
+ role="separator"
52
+ />
53
+ );
54
+ }
55
+
56
+ // If has children, render divider with content
57
+ return (
58
+ <div
59
+ {...containerProps}
60
+ data-testid={testID}
61
+ aria-label={accessibilityLabel}
62
+ role="separator"
63
+ >
64
+ <div {...lineProps} />
65
+ <span {...contentProps}>
66
+ {children}
67
+ </span>
68
+ <div {...lineProps} />
69
+ </div>
70
+ );
71
+ };
72
+
73
73
  export default Divider;
@@ -1,3 +1,3 @@
1
- // React Native-specific Divider export
2
- export { default } from './Divider.native';
1
+ // React Native-specific Divider export
2
+ export { default } from './Divider.native';
3
3
  export * from './types';
@@ -1,5 +1,5 @@
1
- // Platform-agnostic Divider 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 './Divider.web';
1
+ // Platform-agnostic Divider 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 './Divider.web';
5
5
  export * from './types';
@@ -1,3 +1,3 @@
1
- // Web-specific Divider export
2
- export { default } from './Divider.web';
1
+ // Web-specific Divider export
2
+ export { default } from './Divider.web';
3
3
  export * from './types';
@@ -1,54 +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;
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
54
  }
@@ -1,39 +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
-
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
39
  export default Icon;
@@ -1,50 +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
-
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
50
  export default iconStyles;
@@ -1,47 +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
-
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
47
  export default Icon;