@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,217 @@
1
+ import React, { useState } from 'react';
2
+ import { Screen, View, Text, Checkbox } from '../index';
3
+
4
+ export const CheckboxExamples = () => {
5
+ const [basicChecked, setBasicChecked] = useState(false);
6
+ const [primaryChecked, setPrimaryChecked] = useState(true);
7
+ const [successChecked, setSuccessChecked] = useState(false);
8
+ const [errorChecked, setErrorChecked] = useState(false);
9
+ const [indeterminateChecked, setIndeterminateChecked] = useState(false);
10
+
11
+ return (
12
+ <Screen background="primary" padding="lg">
13
+ <View spacing="none">
14
+ <Text size="large" weight="bold" align="center">
15
+ Checkbox Examples
16
+ </Text>
17
+
18
+ {/* Basic Checkbox */}
19
+ <View spacing="md">
20
+ <Text size="medium" weight="semibold">Basic Checkbox</Text>
21
+ <View spacing="sm" style={{ gap: 10 }}>
22
+ <Checkbox
23
+ checked={basicChecked}
24
+ onCheckedChange={setBasicChecked}
25
+ label="Basic checkbox"
26
+ />
27
+ <Checkbox
28
+ checked={true}
29
+ onCheckedChange={() => {}}
30
+ label="Checked checkbox"
31
+ />
32
+ <Checkbox
33
+ checked={false}
34
+ onCheckedChange={() => {}}
35
+ label="Unchecked checkbox"
36
+ />
37
+ </View>
38
+ </View>
39
+
40
+ {/* Checkbox Sizes */}
41
+ <View spacing="md">
42
+ <Text size="medium" weight="semibold">Sizes</Text>
43
+ <View spacing="sm" style={{ gap: 10 }}>
44
+ <Checkbox
45
+ size="small"
46
+ checked={true}
47
+ onCheckedChange={() => {}}
48
+ label="Small checkbox"
49
+ />
50
+ <Checkbox
51
+ size="medium"
52
+ checked={true}
53
+ onCheckedChange={() => {}}
54
+ label="Medium checkbox"
55
+ />
56
+ <Checkbox
57
+ size="large"
58
+ checked={true}
59
+ onCheckedChange={() => {}}
60
+ label="Large checkbox"
61
+ />
62
+ </View>
63
+ </View>
64
+
65
+ {/* Checkbox Intents */}
66
+ <View spacing="md">
67
+ <Text size="medium" weight="semibold">Intents</Text>
68
+ <View spacing="sm" style={{ gap: 10 }}>
69
+ <Checkbox
70
+ intent="primary"
71
+ checked={primaryChecked}
72
+ onCheckedChange={setPrimaryChecked}
73
+ label="Primary checkbox"
74
+ />
75
+ <Checkbox
76
+ intent="neutral"
77
+ checked={true}
78
+ onCheckedChange={() => {}}
79
+ label="Neutral checkbox"
80
+ />
81
+ <Checkbox
82
+ intent="success"
83
+ checked={successChecked}
84
+ onCheckedChange={setSuccessChecked}
85
+ label="Success checkbox"
86
+ />
87
+ <Checkbox
88
+ intent="error"
89
+ checked={errorChecked}
90
+ onCheckedChange={setErrorChecked}
91
+ label="Error checkbox"
92
+ />
93
+ <Checkbox
94
+ intent="warning"
95
+ checked={true}
96
+ onCheckedChange={() => {}}
97
+ label="Warning checkbox"
98
+ />
99
+ <Checkbox
100
+ intent="info"
101
+ checked={true}
102
+ onCheckedChange={() => {}}
103
+ label="Info checkbox"
104
+ />
105
+ </View>
106
+ </View>
107
+
108
+ {/* Checkbox Variants */}
109
+ <View spacing="md">
110
+ <Text size="medium" weight="semibold">Variants</Text>
111
+ <View spacing="sm" style={{ gap: 10 }}>
112
+ <Checkbox
113
+ variant="default"
114
+ checked={true}
115
+ onCheckedChange={() => {}}
116
+ label="Default variant"
117
+ />
118
+ <Checkbox
119
+ variant="outlined"
120
+ checked={true}
121
+ onCheckedChange={() => {}}
122
+ label="Outlined variant"
123
+ />
124
+ </View>
125
+ </View>
126
+
127
+ {/* Checkbox States */}
128
+ <View spacing="md">
129
+ <Text size="medium" weight="semibold">States</Text>
130
+ <View spacing="sm" style={{ gap: 10 }}>
131
+ <Checkbox
132
+ checked={false}
133
+ onCheckedChange={() => {}}
134
+ label="Normal state"
135
+ />
136
+ <Checkbox
137
+ checked={true}
138
+ onCheckedChange={() => {}}
139
+ label="Checked state"
140
+ />
141
+ <Checkbox
142
+ indeterminate={true}
143
+ checked={indeterminateChecked}
144
+ onCheckedChange={setIndeterminateChecked}
145
+ label="Indeterminate state"
146
+ />
147
+ <Checkbox
148
+ checked={true}
149
+ disabled
150
+ onCheckedChange={() => {}}
151
+ label="Disabled checked"
152
+ />
153
+ <Checkbox
154
+ checked={false}
155
+ disabled
156
+ onCheckedChange={() => {}}
157
+ label="Disabled unchecked"
158
+ />
159
+ </View>
160
+ </View>
161
+
162
+ {/* Checkbox with Custom Children */}
163
+ <View spacing="md">
164
+ <Text size="medium" weight="semibold">Custom Content</Text>
165
+ <View spacing="sm" style={{ gap: 10 }}>
166
+ <Checkbox
167
+ checked={true}
168
+ onCheckedChange={() => {}}
169
+ >
170
+ <Text>Custom label with </Text>
171
+ <Text weight="bold" color="primary">styled text</Text>
172
+ </Checkbox>
173
+
174
+ <Checkbox
175
+ checked={false}
176
+ onCheckedChange={() => {}}
177
+ >
178
+ <View>
179
+ <Text weight="semibold">Multi-line Label</Text>
180
+ <Text size="small" color="secondary">
181
+ This checkbox has a more complex label with multiple lines
182
+ </Text>
183
+ </View>
184
+ </Checkbox>
185
+ </View>
186
+ </View>
187
+
188
+ {/* Checkbox with Helper Text and Errors */}
189
+ <View spacing="md">
190
+ <Text size="medium" weight="semibold">With Helper Text</Text>
191
+ <View spacing="sm" style={{ gap: 10 }}>
192
+ <Checkbox
193
+ checked={true}
194
+ onCheckedChange={() => {}}
195
+ label="Checkbox with helper text"
196
+ helperText="This is some helpful information"
197
+ />
198
+ <Checkbox
199
+ checked={false}
200
+ onCheckedChange={() => {}}
201
+ label="Checkbox with error"
202
+ error="This field is required"
203
+ intent="error"
204
+ />
205
+ <Checkbox
206
+ checked={false}
207
+ onCheckedChange={() => {}}
208
+ label="Required checkbox"
209
+ required
210
+ helperText="This checkbox is required"
211
+ />
212
+ </View>
213
+ </View>
214
+ </View>
215
+ </Screen>
216
+ );
217
+ };
@@ -0,0 +1,218 @@
1
+ import React from 'react';
2
+ import { Screen, View, Text, Divider, Card } from '../index';
3
+
4
+ export const DividerExamples = () => {
5
+ return (
6
+ <Screen background="primary" padding="lg">
7
+ <View spacing="none">
8
+ <Text size="large" weight="bold" align="center">
9
+ Divider Examples
10
+ </Text>
11
+
12
+ {/* Horizontal Dividers */}
13
+ <View spacing="md">
14
+ <Text size="medium" weight="semibold">Horizontal Dividers</Text>
15
+ <View style={{ gap: 10 }}>
16
+ <Card variant="outlined" padding="medium">
17
+ <Text>Content above</Text>
18
+ <Divider orientation="horizontal" />
19
+ <Text>Content below</Text>
20
+ </Card>
21
+ <Card variant="outlined" padding="medium">
22
+ <Text>Content above</Text>
23
+ <Divider orientation="horizontal" variant="dashed" />
24
+ <Text>Content below</Text>
25
+ </Card>
26
+ <Card variant="outlined" padding="medium">
27
+ <Text>Content above</Text>
28
+ <Divider orientation="horizontal" variant="dotted" />
29
+ <Text>Content below</Text>
30
+ </Card>
31
+ </View>
32
+ </View>
33
+
34
+ {/* Divider Variants */}
35
+ <View spacing="md">
36
+ <Text size="medium" weight="semibold">Variants</Text>
37
+ <View style={{ gap: 10 }}>
38
+ <Card variant="outlined" padding="medium">
39
+ <Text>Solid divider</Text>
40
+ <Divider variant="solid" />
41
+ <Text>Content below</Text>
42
+ </Card>
43
+ <Card variant="outlined" padding="medium">
44
+ <Text>Dashed divider</Text>
45
+ <Divider variant="dashed" />
46
+ <Text>Content below</Text>
47
+ </Card>
48
+ <Card variant="outlined" padding="medium">
49
+ <Text>Dotted divider</Text>
50
+ <Divider variant="dotted" />
51
+ <Text>Content below</Text>
52
+ </Card>
53
+ </View>
54
+ </View>
55
+
56
+ {/* Divider Thickness */}
57
+ <View spacing="md">
58
+ <Text size="medium" weight="semibold">Thickness</Text>
59
+ <View style={{ gap: 10 }}>
60
+ <Card variant="outlined" padding="medium">
61
+ <Text>Thin divider</Text>
62
+ <Divider thickness="thin" />
63
+ <Text>Content below</Text>
64
+ </Card>
65
+ <Card variant="outlined" padding="medium">
66
+ <Text>Medium divider</Text>
67
+ <Divider thickness="medium" />
68
+ <Text>Content below</Text>
69
+ </Card>
70
+ <Card variant="outlined" padding="medium">
71
+ <Text>Thick divider</Text>
72
+ <Divider thickness="thick" />
73
+ <Text>Content below</Text>
74
+ </Card>
75
+ </View>
76
+ </View>
77
+
78
+ {/* Divider Intents */}
79
+ <View spacing="md">
80
+ <Text size="medium" weight="semibold">Intents</Text>
81
+ <View style={{ gap: 10 }}>
82
+ <Card variant="outlined" padding="medium">
83
+ <Text>Primary divider</Text>
84
+ <Divider intent="primary" />
85
+ <Text>Content below</Text>
86
+ </Card>
87
+
88
+ <Card variant="outlined" padding="medium">
89
+ <Text>Neutral divider</Text>
90
+ <Divider intent="neutral" />
91
+ <Text>Content below</Text>
92
+ </Card>
93
+
94
+ <Card variant="outlined" padding="medium">
95
+ <Text>Neutral divider</Text>
96
+ <Divider intent="neutral" />
97
+ <Text>Content below</Text>
98
+ </Card>
99
+
100
+ <Card variant="outlined" padding="medium">
101
+ <Text>Success divider</Text>
102
+ <Divider intent="success" />
103
+ <Text>Content below</Text>
104
+ </Card>
105
+
106
+ <Card variant="outlined" padding="medium">
107
+ <Text>Error divider</Text>
108
+ <Divider intent="error" />
109
+ <Text>Content below</Text>
110
+ </Card>
111
+
112
+ <Card variant="outlined" padding="medium">
113
+ <Text>Warning divider</Text>
114
+ <Divider intent="warning" />
115
+ <Text>Content below</Text>
116
+ </Card>
117
+
118
+ <Card variant="outlined" padding="medium">
119
+ <Text>Info divider</Text>
120
+ <Divider intent="info" />
121
+ <Text>Content below</Text>
122
+ </Card>
123
+ </View>
124
+ </View>
125
+
126
+ {/* Divider Spacing */}
127
+ <View spacing="md">
128
+ <Text size="medium" weight="semibold">Spacing</Text>
129
+ <View style={{ gap: 10 }}>
130
+ <Card variant="outlined" padding="medium">
131
+ <Text>No spacing</Text>
132
+ <Divider spacing="none" />
133
+ <Text>Content immediately after</Text>
134
+ </Card>
135
+
136
+ <Card variant="outlined" padding="medium">
137
+ <Text>Small spacing</Text>
138
+ <Divider spacing="small" />
139
+ <Text>Content with small spacing</Text>
140
+ </Card>
141
+
142
+ <Card variant="outlined" padding="medium">
143
+ <Text>Medium spacing</Text>
144
+ <Divider spacing="medium" />
145
+ <Text>Content with medium spacing</Text>
146
+ </Card>
147
+
148
+ <Card variant="outlined" padding="medium">
149
+ <Text>Large spacing</Text>
150
+ <Divider spacing="large" />
151
+ <Text>Content with large spacing</Text>
152
+ </Card>
153
+ </View>
154
+ </View>
155
+
156
+ {/* Divider with Content */}
157
+ <View spacing="md">
158
+ <Text size="medium" weight="semibold">With Content</Text>
159
+ <View style={{ gap: 10 }}>
160
+ <Card variant="outlined" padding="medium">
161
+ <Text>Content above</Text>
162
+ <Divider spacing="medium">
163
+ <Text size="small" color="secondary">OR</Text>
164
+ </Divider>
165
+ <Text>Content below</Text>
166
+ </Card>
167
+
168
+ <Card variant="outlined" padding="medium">
169
+ <Text>Content above</Text>
170
+ <Divider spacing="medium" intent="primary">
171
+ <Text size="small" color="primary" weight="semibold">SECTION</Text>
172
+ </Divider>
173
+ <Text>Content below</Text>
174
+ </Card>
175
+ </View>
176
+ </View>
177
+
178
+ {/* Vertical Dividers */}
179
+ <View spacing="md">
180
+ <Text size="medium" weight="semibold">Vertical Dividers</Text>
181
+ <Card variant="outlined" padding="medium">
182
+ <View style={{ flexDirection: 'row', alignItems: 'center', gap: 8 }}>
183
+ <Text>Left</Text>
184
+ <Divider orientation="vertical" />
185
+ <Text>Center</Text>
186
+ <Divider orientation="vertical" variant="dashed" />
187
+ <Text>Right</Text>
188
+ </View>
189
+ </Card>
190
+ </View>
191
+
192
+ {/* Custom Length */}
193
+ <View spacing="md">
194
+ <Text size="medium" weight="semibold">Custom Length</Text>
195
+ <View style={{ gap: 10 }}>
196
+ <Card variant="outlined" padding="medium">
197
+ <Text>Auto length</Text>
198
+ <Divider length="auto" />
199
+ <Text>Content below</Text>
200
+ </Card>
201
+
202
+ <Card variant="outlined" padding="medium">
203
+ <Text>Full length</Text>
204
+ <Divider length="full" />
205
+ <Text>Content below</Text>
206
+ </Card>
207
+
208
+ <Card variant="outlined" padding="medium">
209
+ <Text>50% length</Text>
210
+ <Divider length={50} />
211
+ <Text>Content below</Text>
212
+ </Card>
213
+ </View>
214
+ </View>
215
+ </View>
216
+ </Screen>
217
+ );
218
+ };