@idealyst/components 1.0.24 → 1.0.26

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,131 +1,131 @@
1
- import React, { useState, useEffect } from 'react';
2
- import { getWebProps } from 'react-native-unistyles/web';
3
- import { CheckboxProps } from './types';
4
- import { checkboxStyles, checkboxLabelStyles, checkboxCheckmarkStyles, checkboxHelperStyles } from './Checkbox.styles';
5
-
6
- const Checkbox: React.FC<CheckboxProps> = ({
7
- checked = false,
8
- indeterminate = false,
9
- disabled = false,
10
- onCheckedChange,
11
- size = 'medium',
12
- intent = 'primary',
13
- variant = 'default',
14
- label,
15
- children,
16
- style,
17
- testID,
18
- accessibilityLabel,
19
- required = false,
20
- error,
21
- helperText,
22
- }) => {
23
- const [internalChecked, setInternalChecked] = useState(checked);
24
-
25
- useEffect(() => {
26
- setInternalChecked(checked);
27
- }, [checked]);
28
-
29
- const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
30
- if (disabled) return;
31
-
32
- const newChecked = event.target.checked;
33
- setInternalChecked(newChecked);
34
- onCheckedChange?.(newChecked);
35
- };
36
-
37
- // Apply variants for main checkbox
38
- checkboxStyles.useVariants({
39
- size,
40
- intent,
41
- variant: variant as any,
42
- checked: internalChecked,
43
- disabled,
44
- });
45
-
46
- // Apply variants for label
47
- checkboxLabelStyles.useVariants({
48
- size,
49
- disabled,
50
- });
51
-
52
- // Apply variants for checkmark
53
- checkboxCheckmarkStyles.useVariants({
54
- size,
55
- visible: internalChecked,
56
- });
57
-
58
- // Apply variants for helper text
59
- checkboxHelperStyles.useVariants({
60
- error: !!error,
61
- });
62
-
63
- // Create style arrays
64
- const wrapperStyleArray = [checkboxStyles.wrapper, style];
65
- const containerStyleArray = [checkboxStyles.container];
66
- const checkboxStyleArray = [checkboxStyles.checkbox];
67
- const labelStyleArray = [checkboxLabelStyles.label];
68
- const helperTextStyleArray = [checkboxHelperStyles.helperText];
69
- const checkmarkStyleArray = [checkboxCheckmarkStyles.checkmark];
70
-
71
- // Generate web props
72
- const wrapperProps = getWebProps(wrapperStyleArray);
73
- const containerProps = getWebProps(containerStyleArray);
74
- const checkboxProps = getWebProps(checkboxStyleArray);
75
- const labelProps = getWebProps(labelStyleArray);
76
- const helperTextProps = getWebProps(helperTextStyleArray);
77
- const checkmarkProps = getWebProps(checkmarkStyleArray);
78
-
79
- const labelContent = children || label;
80
- const displayHelperText = error || helperText;
81
-
82
- return (
83
- <div {...wrapperProps}>
84
- <label {...containerProps}>
85
- <div style={{ position: 'relative' }}>
86
- <input
87
- type="checkbox"
88
- checked={internalChecked}
89
- onChange={handleChange}
90
- disabled={disabled}
91
- required={required}
92
- data-testid={testID}
93
- aria-label={accessibilityLabel}
94
- ref={(ref) => {
95
- if (ref) {
96
- ref.indeterminate = indeterminate;
97
- }
98
- }}
99
- style={{
100
- position: 'absolute',
101
- opacity: 0,
102
- width: '100%',
103
- height: '100%',
104
- margin: 0,
105
- cursor: disabled ? 'not-allowed' : 'pointer',
106
- }}
107
- />
108
- <div {...checkboxProps}>
109
- {(internalChecked || indeterminate) && (
110
- <div {...checkmarkProps}>
111
- {indeterminate ? '−' : '✓'}
112
- </div>
113
- )}
114
- </div>
115
- </div>
116
- {labelContent && (
117
- <span {...labelProps}>
118
- {labelContent}
119
- </span>
120
- )}
121
- </label>
122
- {displayHelperText && (
123
- <div {...helperTextProps}>
124
- {error || helperText}
125
- </div>
126
- )}
127
- </div>
128
- );
129
- };
130
-
1
+ import React, { useState, useEffect } from 'react';
2
+ import { getWebProps } from 'react-native-unistyles/web';
3
+ import { CheckboxProps } from './types';
4
+ import { checkboxStyles, checkboxLabelStyles, checkboxCheckmarkStyles, checkboxHelperStyles } from './Checkbox.styles';
5
+
6
+ const Checkbox: React.FC<CheckboxProps> = ({
7
+ checked = false,
8
+ indeterminate = false,
9
+ disabled = false,
10
+ onCheckedChange,
11
+ size = 'medium',
12
+ intent = 'primary',
13
+ variant = 'default',
14
+ label,
15
+ children,
16
+ style,
17
+ testID,
18
+ accessibilityLabel,
19
+ required = false,
20
+ error,
21
+ helperText,
22
+ }) => {
23
+ const [internalChecked, setInternalChecked] = useState(checked);
24
+
25
+ useEffect(() => {
26
+ setInternalChecked(checked);
27
+ }, [checked]);
28
+
29
+ const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
30
+ if (disabled) return;
31
+
32
+ const newChecked = event.target.checked;
33
+ setInternalChecked(newChecked);
34
+ onCheckedChange?.(newChecked);
35
+ };
36
+
37
+ // Apply variants for main checkbox
38
+ checkboxStyles.useVariants({
39
+ size,
40
+ intent,
41
+ variant: variant as any,
42
+ checked: internalChecked,
43
+ disabled,
44
+ });
45
+
46
+ // Apply variants for label
47
+ checkboxLabelStyles.useVariants({
48
+ size,
49
+ disabled,
50
+ });
51
+
52
+ // Apply variants for checkmark
53
+ checkboxCheckmarkStyles.useVariants({
54
+ size,
55
+ visible: internalChecked,
56
+ });
57
+
58
+ // Apply variants for helper text
59
+ checkboxHelperStyles.useVariants({
60
+ error: !!error,
61
+ });
62
+
63
+ // Create style arrays
64
+ const wrapperStyleArray = [checkboxStyles.wrapper, style];
65
+ const containerStyleArray = [checkboxStyles.container];
66
+ const checkboxStyleArray = [checkboxStyles.checkbox];
67
+ const labelStyleArray = [checkboxLabelStyles.label];
68
+ const helperTextStyleArray = [checkboxHelperStyles.helperText];
69
+ const checkmarkStyleArray = [checkboxCheckmarkStyles.checkmark];
70
+
71
+ // Generate web props
72
+ const wrapperProps = getWebProps(wrapperStyleArray);
73
+ const containerProps = getWebProps(containerStyleArray);
74
+ const checkboxProps = getWebProps(checkboxStyleArray);
75
+ const labelProps = getWebProps(labelStyleArray);
76
+ const helperTextProps = getWebProps(helperTextStyleArray);
77
+ const checkmarkProps = getWebProps(checkmarkStyleArray);
78
+
79
+ const labelContent = children || label;
80
+ const displayHelperText = error || helperText;
81
+
82
+ return (
83
+ <div {...wrapperProps}>
84
+ <label {...containerProps}>
85
+ <div style={{ position: 'relative' }}>
86
+ <input
87
+ type="checkbox"
88
+ checked={internalChecked}
89
+ onChange={handleChange}
90
+ disabled={disabled}
91
+ required={required}
92
+ data-testid={testID}
93
+ aria-label={accessibilityLabel}
94
+ ref={(ref) => {
95
+ if (ref) {
96
+ ref.indeterminate = indeterminate;
97
+ }
98
+ }}
99
+ style={{
100
+ position: 'absolute',
101
+ opacity: 0,
102
+ width: '100%',
103
+ height: '100%',
104
+ margin: 0,
105
+ cursor: disabled ? 'not-allowed' : 'pointer',
106
+ }}
107
+ />
108
+ <div {...checkboxProps}>
109
+ {(internalChecked || indeterminate) && (
110
+ <div {...checkmarkProps}>
111
+ {indeterminate ? '−' : '✓'}
112
+ </div>
113
+ )}
114
+ </div>
115
+ </div>
116
+ {labelContent && (
117
+ <span {...labelProps}>
118
+ {labelContent}
119
+ </span>
120
+ )}
121
+ </label>
122
+ {displayHelperText && (
123
+ <div {...helperTextProps}>
124
+ {error || helperText}
125
+ </div>
126
+ )}
127
+ </div>
128
+ );
129
+ };
130
+
131
131
  export default Checkbox;
@@ -1,3 +1,3 @@
1
- // React Native-specific Checkbox export
2
- export { default } from './Checkbox.native';
1
+ // React Native-specific Checkbox export
2
+ export { default } from './Checkbox.native';
3
3
  export * from './types';
@@ -1,5 +1,5 @@
1
- // Platform-agnostic Checkbox 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 './Checkbox.web';
1
+ // Platform-agnostic Checkbox 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 './Checkbox.web';
5
5
  export * from './types';
@@ -1,3 +1,3 @@
1
- // Web-specific Checkbox export
2
- export { default } from './Checkbox.web';
1
+ // Web-specific Checkbox export
2
+ export { default } from './Checkbox.web';
3
3
  export * from './types';
@@ -1,79 +1,79 @@
1
- import { ReactNode } from 'react';
2
- import type { IntentVariant } from '../theme/variants';
3
-
4
- export interface CheckboxProps {
5
- /**
6
- * Whether the checkbox is checked
7
- */
8
- checked?: boolean;
9
-
10
- /**
11
- * Whether the checkbox is in an indeterminate state
12
- */
13
- indeterminate?: boolean;
14
-
15
- /**
16
- * Whether the checkbox is disabled
17
- */
18
- disabled?: boolean;
19
-
20
- /**
21
- * Called when the checkbox state changes
22
- */
23
- onCheckedChange?: (checked: boolean) => void;
24
-
25
- /**
26
- * The size of the checkbox
27
- */
28
- size?: 'small' | 'medium' | 'large';
29
-
30
- /**
31
- * The intent/color scheme of the checkbox
32
- */
33
- intent?: IntentVariant;
34
-
35
- /**
36
- * The visual style variant of the checkbox
37
- */
38
- variant?: 'default' | 'outlined';
39
-
40
- /**
41
- * Label text to display next to the checkbox
42
- */
43
- label?: string;
44
-
45
- /**
46
- * Custom label content (ReactNode)
47
- */
48
- children?: ReactNode;
49
-
50
- /**
51
- * Additional styles (platform-specific)
52
- */
53
- style?: any;
54
-
55
- /**
56
- * Test ID for testing
57
- */
58
- testID?: string;
59
-
60
- /**
61
- * Accessibility label
62
- */
63
- accessibilityLabel?: string;
64
-
65
- /**
66
- * Whether the checkbox is required
67
- */
68
- required?: boolean;
69
-
70
- /**
71
- * Error message to display
72
- */
73
- error?: string;
74
-
75
- /**
76
- * Helper text to display
77
- */
78
- helperText?: string;
1
+ import { ReactNode } from 'react';
2
+ import type { IntentVariant } from '../theme/variants';
3
+
4
+ export interface CheckboxProps {
5
+ /**
6
+ * Whether the checkbox is checked
7
+ */
8
+ checked?: boolean;
9
+
10
+ /**
11
+ * Whether the checkbox is in an indeterminate state
12
+ */
13
+ indeterminate?: boolean;
14
+
15
+ /**
16
+ * Whether the checkbox is disabled
17
+ */
18
+ disabled?: boolean;
19
+
20
+ /**
21
+ * Called when the checkbox state changes
22
+ */
23
+ onCheckedChange?: (checked: boolean) => void;
24
+
25
+ /**
26
+ * The size of the checkbox
27
+ */
28
+ size?: 'small' | 'medium' | 'large';
29
+
30
+ /**
31
+ * The intent/color scheme of the checkbox
32
+ */
33
+ intent?: IntentVariant;
34
+
35
+ /**
36
+ * The visual style variant of the checkbox
37
+ */
38
+ variant?: 'default' | 'outlined';
39
+
40
+ /**
41
+ * Label text to display next to the checkbox
42
+ */
43
+ label?: string;
44
+
45
+ /**
46
+ * Custom label content (ReactNode)
47
+ */
48
+ children?: ReactNode;
49
+
50
+ /**
51
+ * Additional styles (platform-specific)
52
+ */
53
+ style?: any;
54
+
55
+ /**
56
+ * Test ID for testing
57
+ */
58
+ testID?: string;
59
+
60
+ /**
61
+ * Accessibility label
62
+ */
63
+ accessibilityLabel?: string;
64
+
65
+ /**
66
+ * Whether the checkbox is required
67
+ */
68
+ required?: boolean;
69
+
70
+ /**
71
+ * Error message to display
72
+ */
73
+ error?: string;
74
+
75
+ /**
76
+ * Helper text to display
77
+ */
78
+ helperText?: string;
79
79
  }