@idealyst/components 1.0.38 → 1.0.40
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/CLAUDE.md +173 -0
- package/LLM-ACCESS-GUIDE.md +143 -0
- package/README.md +66 -145
- package/package.json +7 -3
- package/src/Avatar/README.md +139 -0
- package/src/Badge/README.md +170 -0
- package/src/Button/README.md +262 -0
- package/src/Card/README.md +258 -0
- package/src/Checkbox/README.md +102 -0
- package/src/Divider/README.md +108 -0
- package/src/Icon/README.md +81 -0
- package/src/Input/README.md +100 -0
- package/src/Screen/README.md +86 -0
- package/src/Text/README.md +94 -0
- package/src/View/README.md +107 -0
- package/src/index.ts +1 -1
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
# Card Component
|
|
2
|
+
|
|
3
|
+
A flexible container component for displaying content in a visually grouped format with various styling options.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- ✅ Cross-platform (React & React Native)
|
|
8
|
+
- ✅ Multiple variants (default, outlined, elevated, filled)
|
|
9
|
+
- ✅ Configurable padding and border radius
|
|
10
|
+
- ✅ Intent-based color schemes
|
|
11
|
+
- ✅ Clickable/interactive support
|
|
12
|
+
- ✅ Disabled state handling
|
|
13
|
+
- ✅ Accessible with proper ARIA attributes
|
|
14
|
+
- ✅ TypeScript support
|
|
15
|
+
|
|
16
|
+
## Basic Usage
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
import { Card, Text } from '@idealyst/components';
|
|
20
|
+
|
|
21
|
+
// Basic card
|
|
22
|
+
<Card>
|
|
23
|
+
<Text size="large" weight="bold">Card Title</Text>
|
|
24
|
+
<Text>Card content goes here</Text>
|
|
25
|
+
</Card>
|
|
26
|
+
|
|
27
|
+
// Clickable card
|
|
28
|
+
<Card
|
|
29
|
+
clickable
|
|
30
|
+
onPress={() => console.log('Card pressed!')}
|
|
31
|
+
>
|
|
32
|
+
<Text>Click me!</Text>
|
|
33
|
+
</Card>
|
|
34
|
+
|
|
35
|
+
// Elevated card with custom styling
|
|
36
|
+
<Card
|
|
37
|
+
variant="elevated"
|
|
38
|
+
padding="large"
|
|
39
|
+
radius="large"
|
|
40
|
+
>
|
|
41
|
+
<Text>Elevated card content</Text>
|
|
42
|
+
</Card>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Props
|
|
46
|
+
|
|
47
|
+
| Prop | Type | Default | Description |
|
|
48
|
+
|------|------|---------|-------------|
|
|
49
|
+
| `children` | `ReactNode` | - | Content to display inside the card |
|
|
50
|
+
| `variant` | `'default' \| 'outlined' \| 'elevated' \| 'filled'` | `'default'` | Visual style variant |
|
|
51
|
+
| `padding` | `'none' \| 'small' \| 'medium' \| 'large'` | `'medium'` | Internal padding size |
|
|
52
|
+
| `radius` | `'none' \| 'small' \| 'medium' \| 'large'` | `'medium'` | Border radius size |
|
|
53
|
+
| `intent` | `IntentVariant` | `'neutral'` | Color scheme/intent |
|
|
54
|
+
| `clickable` | `boolean` | `false` | Whether the card is interactive |
|
|
55
|
+
| `onPress` | `() => void` | - | Function called when card is pressed (requires clickable) |
|
|
56
|
+
| `disabled` | `boolean` | `false` | Whether the card is disabled |
|
|
57
|
+
| `style` | `ViewStyle` | - | Additional custom styles |
|
|
58
|
+
| `testID` | `string` | - | Test identifier for testing |
|
|
59
|
+
| `accessibilityLabel` | `string` | - | Accessibility label for screen readers |
|
|
60
|
+
|
|
61
|
+
## Variants
|
|
62
|
+
|
|
63
|
+
### Default Card
|
|
64
|
+
Basic card with subtle background.
|
|
65
|
+
|
|
66
|
+
```tsx
|
|
67
|
+
<Card variant="default">
|
|
68
|
+
<Text>Default card content</Text>
|
|
69
|
+
</Card>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Outlined Card
|
|
73
|
+
Card with border and transparent background.
|
|
74
|
+
|
|
75
|
+
```tsx
|
|
76
|
+
<Card variant="outlined">
|
|
77
|
+
<Text>Outlined card content</Text>
|
|
78
|
+
</Card>
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Elevated Card
|
|
82
|
+
Card with shadow/elevation for depth.
|
|
83
|
+
|
|
84
|
+
```tsx
|
|
85
|
+
<Card variant="elevated">
|
|
86
|
+
<Text>Elevated card content</Text>
|
|
87
|
+
</Card>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Filled Card
|
|
91
|
+
Card with solid background color.
|
|
92
|
+
|
|
93
|
+
```tsx
|
|
94
|
+
<Card variant="filled" intent="primary">
|
|
95
|
+
<Text>Filled card content</Text>
|
|
96
|
+
</Card>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Padding Options
|
|
100
|
+
|
|
101
|
+
| Padding | Value | Use Case |
|
|
102
|
+
|---------|-------|----------|
|
|
103
|
+
| `none` | 0px | Custom content padding |
|
|
104
|
+
| `small` | 8px | Compact cards |
|
|
105
|
+
| `medium` | 16px | Standard cards |
|
|
106
|
+
| `large` | 24px | Spacious cards |
|
|
107
|
+
|
|
108
|
+
```tsx
|
|
109
|
+
<Card padding="none">No padding</Card>
|
|
110
|
+
<Card padding="small">Small padding</Card>
|
|
111
|
+
<Card padding="medium">Medium padding</Card>
|
|
112
|
+
<Card padding="large">Large padding</Card>
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Border Radius Options
|
|
116
|
+
|
|
117
|
+
| Radius | Value | Use Case |
|
|
118
|
+
|--------|-------|----------|
|
|
119
|
+
| `none` | 0px | Sharp corners |
|
|
120
|
+
| `small` | 4px | Subtle rounding |
|
|
121
|
+
| `medium` | 8px | Standard rounding |
|
|
122
|
+
| `large` | 16px | Prominent rounding |
|
|
123
|
+
|
|
124
|
+
```tsx
|
|
125
|
+
<Card radius="none">Sharp corners</Card>
|
|
126
|
+
<Card radius="small">Subtle corners</Card>
|
|
127
|
+
<Card radius="medium">Standard corners</Card>
|
|
128
|
+
<Card radius="large">Rounded corners</Card>
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Intent Colors
|
|
132
|
+
|
|
133
|
+
```tsx
|
|
134
|
+
<Card intent="primary">Primary themed card</Card>
|
|
135
|
+
<Card intent="neutral">Neutral themed card</Card>
|
|
136
|
+
<Card intent="success">Success themed card</Card>
|
|
137
|
+
<Card intent="error">Error themed card</Card>
|
|
138
|
+
<Card intent="warning">Warning themed card</Card>
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Interactive Cards
|
|
142
|
+
|
|
143
|
+
### Clickable Cards
|
|
144
|
+
```tsx
|
|
145
|
+
<Card
|
|
146
|
+
clickable
|
|
147
|
+
onPress={() => navigation.navigate('Details')}
|
|
148
|
+
accessibilityLabel="Navigate to details"
|
|
149
|
+
>
|
|
150
|
+
<Text size="large" weight="bold">Product Title</Text>
|
|
151
|
+
<Text>Tap to view details</Text>
|
|
152
|
+
</Card>
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Disabled Cards
|
|
156
|
+
```tsx
|
|
157
|
+
<Card
|
|
158
|
+
clickable
|
|
159
|
+
disabled
|
|
160
|
+
onPress={() => {}}
|
|
161
|
+
>
|
|
162
|
+
<Text>This card is disabled</Text>
|
|
163
|
+
</Card>
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Common Use Cases
|
|
167
|
+
|
|
168
|
+
### Content Cards
|
|
169
|
+
```tsx
|
|
170
|
+
<Card variant="outlined" padding="large">
|
|
171
|
+
<Text size="large" weight="bold">Article Title</Text>
|
|
172
|
+
<Text size="small" color="secondary">Published 2 hours ago</Text>
|
|
173
|
+
<Text style={{ marginTop: 8 }}>
|
|
174
|
+
Article content preview...
|
|
175
|
+
</Text>
|
|
176
|
+
</Card>
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Action Cards
|
|
180
|
+
```tsx
|
|
181
|
+
<Card
|
|
182
|
+
variant="elevated"
|
|
183
|
+
clickable
|
|
184
|
+
onPress={handleAction}
|
|
185
|
+
style={{ alignItems: 'center' }}
|
|
186
|
+
>
|
|
187
|
+
<Icon name="plus" size={32} />
|
|
188
|
+
<Text weight="medium">Add New Item</Text>
|
|
189
|
+
</Card>
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### Status Cards
|
|
193
|
+
```tsx
|
|
194
|
+
<Card variant="filled" intent="success" padding="small">
|
|
195
|
+
<View style={{ flexDirection: 'row', alignItems: 'center', gap: 8 }}>
|
|
196
|
+
<Icon name="check" color="white" />
|
|
197
|
+
<Text color="white" weight="medium">Task Completed</Text>
|
|
198
|
+
</View>
|
|
199
|
+
</Card>
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### Grid Layout
|
|
203
|
+
```tsx
|
|
204
|
+
<View style={{ flexDirection: 'row', gap: 16, flexWrap: 'wrap' }}>
|
|
205
|
+
<Card
|
|
206
|
+
variant="outlined"
|
|
207
|
+
style={{ flex: 1, minWidth: 200 }}
|
|
208
|
+
clickable
|
|
209
|
+
onPress={() => {}}
|
|
210
|
+
>
|
|
211
|
+
<Text weight="bold">Card 1</Text>
|
|
212
|
+
<Text>Content 1</Text>
|
|
213
|
+
</Card>
|
|
214
|
+
<Card
|
|
215
|
+
variant="outlined"
|
|
216
|
+
style={{ flex: 1, minWidth: 200 }}
|
|
217
|
+
clickable
|
|
218
|
+
onPress={() => {}}
|
|
219
|
+
>
|
|
220
|
+
<Text weight="bold">Card 2</Text>
|
|
221
|
+
<Text>Content 2</Text>
|
|
222
|
+
</Card>
|
|
223
|
+
</View>
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
## Accessibility
|
|
227
|
+
|
|
228
|
+
- Automatically uses appropriate HTML elements (`div` vs `button`)
|
|
229
|
+
- Proper ARIA roles and labels
|
|
230
|
+
- Keyboard navigation support for clickable cards
|
|
231
|
+
- Focus management and visual indicators
|
|
232
|
+
- Screen reader compatibility
|
|
233
|
+
|
|
234
|
+
## Styling
|
|
235
|
+
|
|
236
|
+
```tsx
|
|
237
|
+
// Custom card styling
|
|
238
|
+
<Card
|
|
239
|
+
variant="outlined"
|
|
240
|
+
style={{
|
|
241
|
+
borderColor: '#007AFF',
|
|
242
|
+
borderWidth: 2,
|
|
243
|
+
backgroundColor: '#F0F9FF',
|
|
244
|
+
}}
|
|
245
|
+
>
|
|
246
|
+
<Text>Custom styled card</Text>
|
|
247
|
+
</Card>
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
## Best Practices
|
|
251
|
+
|
|
252
|
+
1. **Use consistent variants** - Stick to one variant family in a section
|
|
253
|
+
2. **Mind content hierarchy** - Use padding and spacing to create visual hierarchy
|
|
254
|
+
3. **Consider interaction** - Make clickable cards visually distinct
|
|
255
|
+
4. **Accessibility first** - Always provide proper labels for interactive cards
|
|
256
|
+
5. **Performance** - Avoid complex nested structures in large lists
|
|
257
|
+
6. **Responsive design** - Test cards across different screen sizes
|
|
258
|
+
7. **Intent consistency** - Use intent colors meaningfully, not decoratively
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# Checkbox Component
|
|
2
|
+
|
|
3
|
+
A customizable checkbox component with label support and theme integration.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- ✅ Cross-platform (React & React Native)
|
|
8
|
+
- ✅ Multiple sizes (small, medium, large)
|
|
9
|
+
- ✅ Intent-based color schemes
|
|
10
|
+
- ✅ Label support with custom positioning
|
|
11
|
+
- ✅ Disabled state handling
|
|
12
|
+
- ✅ Accessible with proper ARIA attributes
|
|
13
|
+
- ✅ TypeScript support
|
|
14
|
+
|
|
15
|
+
## Basic Usage
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { Checkbox } from '@idealyst/components';
|
|
19
|
+
|
|
20
|
+
// Basic checkbox
|
|
21
|
+
<Checkbox
|
|
22
|
+
checked={isChecked}
|
|
23
|
+
onPress={() => setIsChecked(!isChecked)}
|
|
24
|
+
/>
|
|
25
|
+
|
|
26
|
+
// Checkbox with label
|
|
27
|
+
<Checkbox
|
|
28
|
+
checked={isAgreed}
|
|
29
|
+
onPress={() => setIsAgreed(!isAgreed)}
|
|
30
|
+
label="I agree to the terms and conditions"
|
|
31
|
+
/>
|
|
32
|
+
|
|
33
|
+
// Colored checkbox
|
|
34
|
+
<Checkbox
|
|
35
|
+
checked={isSelected}
|
|
36
|
+
onPress={() => setIsSelected(!isSelected)}
|
|
37
|
+
label="Enable notifications"
|
|
38
|
+
intent="success"
|
|
39
|
+
size="large"
|
|
40
|
+
/>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Props
|
|
44
|
+
|
|
45
|
+
| Prop | Type | Default | Description |
|
|
46
|
+
|------|------|---------|-------------|
|
|
47
|
+
| `checked` | `boolean` | `false` | Whether the checkbox is checked |
|
|
48
|
+
| `onPress` | `() => void` | **Required** | Function called when checkbox is pressed |
|
|
49
|
+
| `label` | `string` | - | Text label to display next to checkbox |
|
|
50
|
+
| `disabled` | `boolean` | `false` | Whether the checkbox is disabled |
|
|
51
|
+
| `size` | `'small' \| 'medium' \| 'large'` | `'medium'` | Size of the checkbox |
|
|
52
|
+
| `intent` | `IntentVariant` | `'primary'` | Color scheme/intent |
|
|
53
|
+
| `labelPosition` | `'left' \| 'right'` | `'right'` | Position of label relative to checkbox |
|
|
54
|
+
| `style` | `ViewStyle` | - | Additional custom styles |
|
|
55
|
+
| `testID` | `string` | - | Test identifier for testing |
|
|
56
|
+
|
|
57
|
+
## Examples
|
|
58
|
+
|
|
59
|
+
### Different Sizes
|
|
60
|
+
```tsx
|
|
61
|
+
<Checkbox size="small" checked={small} onPress={() => setSmall(!small)} label="Small" />
|
|
62
|
+
<Checkbox size="medium" checked={medium} onPress={() => setMedium(!medium)} label="Medium" />
|
|
63
|
+
<Checkbox size="large" checked={large} onPress={() => setLarge(!large)} label="Large" />
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Intent Colors
|
|
67
|
+
```tsx
|
|
68
|
+
<Checkbox intent="primary" checked={primary} onPress={() => setPrimary(!primary)} label="Primary" />
|
|
69
|
+
<Checkbox intent="success" checked={success} onPress={() => setSuccess(!success)} label="Success" />
|
|
70
|
+
<Checkbox intent="error" checked={error} onPress={() => setError(!error)} label="Error" />
|
|
71
|
+
<Checkbox intent="warning" checked={warning} onPress={() => setWarning(!warning)} label="Warning" />
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Label Positioning
|
|
75
|
+
```tsx
|
|
76
|
+
<Checkbox
|
|
77
|
+
labelPosition="left"
|
|
78
|
+
checked={leftLabel}
|
|
79
|
+
onPress={() => setLeftLabel(!leftLabel)}
|
|
80
|
+
label="Label on left"
|
|
81
|
+
/>
|
|
82
|
+
<Checkbox
|
|
83
|
+
labelPosition="right"
|
|
84
|
+
checked={rightLabel}
|
|
85
|
+
onPress={() => setRightLabel(!rightLabel)}
|
|
86
|
+
label="Label on right"
|
|
87
|
+
/>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Disabled State
|
|
91
|
+
```tsx
|
|
92
|
+
<Checkbox disabled checked={true} label="Disabled (checked)" />
|
|
93
|
+
<Checkbox disabled checked={false} label="Disabled (unchecked)" />
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Best Practices
|
|
97
|
+
|
|
98
|
+
1. **Provide clear labels** - Use descriptive text that explains what checking means
|
|
99
|
+
2. **Group related checkboxes** - Use consistent spacing and alignment
|
|
100
|
+
3. **Handle accessibility** - Ensure proper focus and screen reader support
|
|
101
|
+
4. **Use appropriate intents** - Match colors to the action's semantic meaning
|
|
102
|
+
5. **Test touch targets** - Ensure checkboxes are large enough for easy interaction
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# Divider Component
|
|
2
|
+
|
|
3
|
+
A flexible separator component for creating visual divisions between content sections.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- ✅ Cross-platform (React & React Native)
|
|
8
|
+
- ✅ Horizontal and vertical orientations
|
|
9
|
+
- ✅ Spacing variants (small, medium, large)
|
|
10
|
+
- ✅ Intent-based color schemes
|
|
11
|
+
- ✅ Optional content/children support
|
|
12
|
+
- ✅ TypeScript support
|
|
13
|
+
|
|
14
|
+
## Basic Usage
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
import { Divider, Text } from '@idealyst/components';
|
|
18
|
+
|
|
19
|
+
// Basic horizontal divider
|
|
20
|
+
<Divider />
|
|
21
|
+
|
|
22
|
+
// Divider with spacing
|
|
23
|
+
<Divider spacing="large" />
|
|
24
|
+
|
|
25
|
+
// Vertical divider
|
|
26
|
+
<Divider orientation="vertical" />
|
|
27
|
+
|
|
28
|
+
// Divider with content
|
|
29
|
+
<Divider spacing="medium">
|
|
30
|
+
<Text size="small" color="secondary">OR</Text>
|
|
31
|
+
</Divider>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Props
|
|
35
|
+
|
|
36
|
+
| Prop | Type | Default | Description |
|
|
37
|
+
|------|------|---------|-------------|
|
|
38
|
+
| `children` | `ReactNode` | - | Optional content to display in the divider |
|
|
39
|
+
| `orientation` | `'horizontal' \| 'vertical'` | `'horizontal'` | Direction of the divider |
|
|
40
|
+
| `spacing` | `'small' \| 'medium' \| 'large'` | `'medium'` | Spacing around the divider |
|
|
41
|
+
| `intent` | `IntentVariant` | `'neutral'` | Color scheme of the divider |
|
|
42
|
+
| `variant` | `'solid' \| 'dashed' \| 'dotted'` | `'solid'` | Visual style of the line |
|
|
43
|
+
| `thickness` | `'thin' \| 'medium' \| 'thick'` | `'thin'` | Thickness of the divider line |
|
|
44
|
+
| `style` | `ViewStyle` | - | Additional custom styles |
|
|
45
|
+
| `testID` | `string` | - | Test identifier for testing |
|
|
46
|
+
|
|
47
|
+
## Examples
|
|
48
|
+
|
|
49
|
+
### Basic Dividers
|
|
50
|
+
```tsx
|
|
51
|
+
<View>
|
|
52
|
+
<Text>Content above</Text>
|
|
53
|
+
<Divider />
|
|
54
|
+
<Text>Content below</Text>
|
|
55
|
+
</View>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Spacing Variants
|
|
59
|
+
```tsx
|
|
60
|
+
<View>
|
|
61
|
+
<Text>Small spacing</Text>
|
|
62
|
+
<Divider spacing="small" />
|
|
63
|
+
<Text>Medium spacing</Text>
|
|
64
|
+
<Divider spacing="medium" />
|
|
65
|
+
<Text>Large spacing</Text>
|
|
66
|
+
<Divider spacing="large" />
|
|
67
|
+
<Text>End content</Text>
|
|
68
|
+
</View>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Vertical Dividers
|
|
72
|
+
```tsx
|
|
73
|
+
<View style={{ flexDirection: 'row', alignItems: 'center', height: 40 }}>
|
|
74
|
+
<Text>Left</Text>
|
|
75
|
+
<Divider orientation="vertical" spacing="medium" />
|
|
76
|
+
<Text>Middle</Text>
|
|
77
|
+
<Divider orientation="vertical" spacing="medium" />
|
|
78
|
+
<Text>Right</Text>
|
|
79
|
+
</View>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Dividers with Content
|
|
83
|
+
```tsx
|
|
84
|
+
<View>
|
|
85
|
+
<Text>Sign in with your account</Text>
|
|
86
|
+
<Divider spacing="large">
|
|
87
|
+
<Text size="small" color="secondary">OR</Text>
|
|
88
|
+
</Divider>
|
|
89
|
+
<Text>Continue with social login</Text>
|
|
90
|
+
</View>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Styled Dividers
|
|
94
|
+
```tsx
|
|
95
|
+
<View>
|
|
96
|
+
<Divider variant="solid" intent="neutral" />
|
|
97
|
+
<Divider variant="dashed" intent="primary" />
|
|
98
|
+
<Divider variant="dotted" intent="secondary" />
|
|
99
|
+
</View>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Best Practices
|
|
103
|
+
|
|
104
|
+
1. **Use appropriate spacing** - Match divider spacing to your content hierarchy
|
|
105
|
+
2. **Consider orientation** - Use vertical dividers in horizontal layouts
|
|
106
|
+
3. **Keep content minimal** - If using children, keep text short and meaningful
|
|
107
|
+
4. **Maintain consistency** - Use the same divider style throughout your app
|
|
108
|
+
5. **Accessibility** - Ensure dividers don't interfere with screen reader flow
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Icon Component
|
|
2
|
+
|
|
3
|
+
A versatile icon component with extensive icon library and theming support.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- ✅ Cross-platform (React & React Native)
|
|
8
|
+
- ✅ Extensive icon library
|
|
9
|
+
- ✅ Multiple sizes and color options
|
|
10
|
+
- ✅ Intent-based color schemes
|
|
11
|
+
- ✅ TypeScript support with icon name validation
|
|
12
|
+
|
|
13
|
+
## Basic Usage
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { Icon } from '@idealyst/components';
|
|
17
|
+
|
|
18
|
+
// Basic icon
|
|
19
|
+
<Icon name="heart" />
|
|
20
|
+
|
|
21
|
+
// Sized and colored icon
|
|
22
|
+
<Icon
|
|
23
|
+
name="star"
|
|
24
|
+
size={24}
|
|
25
|
+
color="primary"
|
|
26
|
+
/>
|
|
27
|
+
|
|
28
|
+
// Icon with intent color
|
|
29
|
+
<Icon
|
|
30
|
+
name="check-circle"
|
|
31
|
+
size="large"
|
|
32
|
+
intent="success"
|
|
33
|
+
/>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Props
|
|
37
|
+
|
|
38
|
+
| Prop | Type | Default | Description |
|
|
39
|
+
|------|------|---------|-------------|
|
|
40
|
+
| `name` | `IconName` | **Required** | Name of the icon to display |
|
|
41
|
+
| `size` | `number \| 'small' \| 'medium' \| 'large' \| 'xlarge'` | `'medium'` | Size of the icon |
|
|
42
|
+
| `color` | `string \| ColorVariant` | - | Color of the icon |
|
|
43
|
+
| `intent` | `IntentVariant` | - | Intent-based color scheme |
|
|
44
|
+
| `style` | `ViewStyle` | - | Additional custom styles |
|
|
45
|
+
| `testID` | `string` | - | Test identifier for testing |
|
|
46
|
+
|
|
47
|
+
## Size Options
|
|
48
|
+
|
|
49
|
+
| Size | Value | Use Case |
|
|
50
|
+
|------|-------|----------|
|
|
51
|
+
| `small` | 16px | Inline text, compact UI |
|
|
52
|
+
| `medium` | 20px | Standard buttons, form elements |
|
|
53
|
+
| `large` | 24px | Section headers, prominent actions |
|
|
54
|
+
| `xlarge` | 32px | Feature highlights, empty states |
|
|
55
|
+
|
|
56
|
+
## Common Icons
|
|
57
|
+
|
|
58
|
+
Popular icon names include:
|
|
59
|
+
- `heart`, `star`, `bookmark`
|
|
60
|
+
- `check`, `x`, `plus`, `minus`
|
|
61
|
+
- `chevron-left`, `chevron-right`, `chevron-up`, `chevron-down`
|
|
62
|
+
- `home`, `user`, `settings`, `search`
|
|
63
|
+
- `bell`, `mail`, `calendar`, `file`
|
|
64
|
+
- `edit`, `delete`, `copy`, `share`
|
|
65
|
+
|
|
66
|
+
## Examples
|
|
67
|
+
|
|
68
|
+
### Button Icons
|
|
69
|
+
```tsx
|
|
70
|
+
<Button>
|
|
71
|
+
<Icon name="plus" size="small" color="white" />
|
|
72
|
+
Add Item
|
|
73
|
+
</Button>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Status Icons
|
|
77
|
+
```tsx
|
|
78
|
+
<Icon name="check-circle" intent="success" size="large" />
|
|
79
|
+
<Icon name="x-circle" intent="error" size="large" />
|
|
80
|
+
<Icon name="alert-triangle" intent="warning" size="large" />
|
|
81
|
+
```
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Input Component
|
|
2
|
+
|
|
3
|
+
A text input component with consistent styling and form integration.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- ✅ Cross-platform (React & React Native)
|
|
8
|
+
- ✅ Multiple sizes and variants
|
|
9
|
+
- ✅ Label and helper text support
|
|
10
|
+
- ✅ Error state handling
|
|
11
|
+
- ✅ Placeholder and validation
|
|
12
|
+
- ✅ TypeScript support
|
|
13
|
+
|
|
14
|
+
## Basic Usage
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
import { Input } from '@idealyst/components';
|
|
18
|
+
|
|
19
|
+
// Basic input
|
|
20
|
+
<Input
|
|
21
|
+
value={value}
|
|
22
|
+
onChangeText={setValue}
|
|
23
|
+
placeholder="Enter text..."
|
|
24
|
+
/>
|
|
25
|
+
|
|
26
|
+
// Input with label
|
|
27
|
+
<Input
|
|
28
|
+
label="Email Address"
|
|
29
|
+
value={email}
|
|
30
|
+
onChangeText={setEmail}
|
|
31
|
+
placeholder="you@example.com"
|
|
32
|
+
keyboardType="email-address"
|
|
33
|
+
/>
|
|
34
|
+
|
|
35
|
+
// Input with error
|
|
36
|
+
<Input
|
|
37
|
+
label="Password"
|
|
38
|
+
value={password}
|
|
39
|
+
onChangeText={setPassword}
|
|
40
|
+
error={passwordError}
|
|
41
|
+
secureTextEntry
|
|
42
|
+
/>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Props
|
|
46
|
+
|
|
47
|
+
| Prop | Type | Default | Description |
|
|
48
|
+
|------|------|---------|-------------|
|
|
49
|
+
| `value` | `string` | **Required** | Current input value |
|
|
50
|
+
| `onChangeText` | `(text: string) => void` | **Required** | Called when text changes |
|
|
51
|
+
| `label` | `string` | - | Label text to display above input |
|
|
52
|
+
| `placeholder` | `string` | - | Placeholder text |
|
|
53
|
+
| `error` | `string` | - | Error message to display |
|
|
54
|
+
| `helperText` | `string` | - | Helper text below input |
|
|
55
|
+
| `disabled` | `boolean` | `false` | Whether input is disabled |
|
|
56
|
+
| `size` | `'small' \| 'medium' \| 'large'` | `'medium'` | Size of the input |
|
|
57
|
+
| `variant` | `'outlined' \| 'filled'` | `'outlined'` | Visual style variant |
|
|
58
|
+
| `required` | `boolean` | `false` | Whether input is required |
|
|
59
|
+
| `multiline` | `boolean` | `false` | Allow multiple lines |
|
|
60
|
+
| `style` | `ViewStyle` | - | Additional custom styles |
|
|
61
|
+
|
|
62
|
+
## Examples
|
|
63
|
+
|
|
64
|
+
### Form Inputs
|
|
65
|
+
```tsx
|
|
66
|
+
<View style={{ gap: 16 }}>
|
|
67
|
+
<Input
|
|
68
|
+
label="Full Name"
|
|
69
|
+
value={name}
|
|
70
|
+
onChangeText={setName}
|
|
71
|
+
required
|
|
72
|
+
/>
|
|
73
|
+
<Input
|
|
74
|
+
label="Email"
|
|
75
|
+
value={email}
|
|
76
|
+
onChangeText={setEmail}
|
|
77
|
+
keyboardType="email-address"
|
|
78
|
+
error={emailError}
|
|
79
|
+
/>
|
|
80
|
+
<Input
|
|
81
|
+
label="Password"
|
|
82
|
+
value={password}
|
|
83
|
+
onChangeText={setPassword}
|
|
84
|
+
secureTextEntry
|
|
85
|
+
helperText="Must be at least 8 characters"
|
|
86
|
+
/>
|
|
87
|
+
</View>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Multiline Input
|
|
91
|
+
```tsx
|
|
92
|
+
<Input
|
|
93
|
+
label="Description"
|
|
94
|
+
value={description}
|
|
95
|
+
onChangeText={setDescription}
|
|
96
|
+
multiline
|
|
97
|
+
numberOfLines={4}
|
|
98
|
+
placeholder="Enter description..."
|
|
99
|
+
/>
|
|
100
|
+
```
|