@idealyst/components 1.0.99 → 1.1.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/package.json +4 -4
- package/src/Accordion/Accordion.native.tsx +15 -0
- package/src/Accordion/Accordion.styles.tsx +17 -0
- package/src/Accordion/Accordion.web.tsx +15 -0
- package/src/Accordion/types.ts +2 -1
- package/src/Button/Button.native.tsx +55 -2
- package/src/Button/Button.styles.tsx +22 -0
- package/src/Button/Button.web.tsx +6 -2
- package/src/Button/types.ts +15 -0
- package/src/Card/Card.native.tsx +18 -5
- package/src/Card/Card.styles.tsx +123 -131
- package/src/Card/Card.web.tsx +17 -4
- package/src/Card/types.ts +3 -8
- package/src/Checkbox/Checkbox.native.tsx +7 -0
- package/src/Checkbox/Checkbox.styles.tsx +11 -0
- package/src/Checkbox/Checkbox.web.tsx +7 -0
- package/src/Checkbox/types.ts +2 -1
- package/src/Input/Input.native.tsx +7 -0
- package/src/Input/Input.styles.tsx +9 -0
- package/src/Input/Input.web.tsx +7 -0
- package/src/Input/types.ts +2 -1
- package/src/List/List.native.tsx +15 -0
- package/src/List/List.styles.tsx +17 -0
- package/src/List/List.web.tsx +15 -0
- package/src/List/types.ts +2 -1
- package/src/Pressable/Pressable.native.tsx +13 -1
- package/src/Pressable/Pressable.styles.tsx +24 -0
- package/src/Pressable/Pressable.web.tsx +24 -6
- package/src/Pressable/types.ts +3 -2
- package/src/RadioButton/RadioButton.native.tsx +7 -0
- package/src/RadioButton/RadioButton.styles.tsx +9 -0
- package/src/RadioButton/RadioButton.web.tsx +7 -0
- package/src/RadioButton/types.ts +2 -1
- package/src/Screen/Screen.native.tsx +25 -12
- package/src/Screen/Screen.styles.tsx +28 -16
- package/src/Screen/Screen.web.tsx +16 -3
- package/src/Screen/types.ts +4 -8
- package/src/Select/Select.native.tsx +7 -0
- package/src/Select/Select.styles.tsx +11 -0
- package/src/Select/Select.web.tsx +7 -0
- package/src/Select/types.ts +2 -1
- package/src/Slider/Slider.native.tsx +7 -0
- package/src/Slider/Slider.styles.tsx +11 -0
- package/src/Slider/Slider.web.tsx +7 -0
- package/src/Slider/types.ts +2 -1
- package/src/Switch/Switch.native.tsx +7 -0
- package/src/Switch/Switch.styles.tsx +11 -0
- package/src/Switch/Switch.web.tsx +7 -0
- package/src/Switch/types.ts +2 -1
- package/src/TabBar/TabBar.native.tsx +19 -1
- package/src/TabBar/TabBar.styles.tsx +17 -0
- package/src/TabBar/TabBar.web.tsx +20 -1
- package/src/TabBar/types.ts +2 -1
- package/src/Table/Table.native.tsx +15 -0
- package/src/Table/Table.styles.tsx +27 -0
- package/src/Table/Table.web.tsx +15 -0
- package/src/Table/types.ts +2 -1
- package/src/Text/Text.native.tsx +14 -3
- package/src/Text/Text.styles.tsx +36 -12
- package/src/Text/Text.web.tsx +15 -4
- package/src/Text/types.ts +15 -4
- package/src/TextArea/TextArea.native.tsx +7 -0
- package/src/TextArea/TextArea.styles.tsx +11 -0
- package/src/TextArea/TextArea.web.tsx +7 -0
- package/src/TextArea/types.ts +2 -1
- package/src/View/View.native.tsx +35 -12
- package/src/View/View.styles.tsx +78 -75
- package/src/View/View.web.tsx +18 -9
- package/src/View/types.ts +8 -23
- package/src/examples/AccordionExamples.tsx +32 -32
- package/src/examples/AlertExamples.tsx +42 -42
- package/src/examples/AvatarExamples.tsx +18 -18
- package/src/examples/BadgeExamples.tsx +30 -30
- package/src/examples/BreadcrumbExamples.tsx +64 -64
- package/src/examples/ButtonExamples.tsx +128 -16
- package/src/examples/CardExamples.tsx +28 -28
- package/src/examples/CheckboxExamples.tsx +25 -25
- package/src/examples/ChipExamples.tsx +17 -17
- package/src/examples/DialogExamples.tsx +17 -17
- package/src/examples/DividerExamples.tsx +21 -21
- package/src/examples/IconExamples.tsx +113 -113
- package/src/examples/ImageExamples.tsx +34 -34
- package/src/examples/InputExamples.tsx +20 -20
- package/src/examples/LinkExamples.tsx +23 -23
- package/src/examples/ListExamples.tsx +42 -42
- package/src/examples/MenuExamples.tsx +15 -15
- package/src/examples/PopoverExamples.tsx +23 -23
- package/src/examples/ProgressExamples.tsx +41 -41
- package/src/examples/RadioButtonExamples.tsx +21 -21
- package/src/examples/SVGImageExamples.tsx +25 -25
- package/src/examples/ScreenExamples.tsx +41 -41
- package/src/examples/SelectExamples.tsx +59 -59
- package/src/examples/SkeletonExamples.tsx +30 -30
- package/src/examples/SliderExamples.tsx +54 -54
- package/src/examples/SwitchExamples.tsx +20 -20
- package/src/examples/TabBarExamples.tsx +26 -26
- package/src/examples/TableExamples.tsx +36 -36
- package/src/examples/TextAreaExamples.tsx +25 -25
- package/src/examples/TextExamples.tsx +61 -66
- package/src/examples/ThemeExtensionExamples.tsx +12 -12
- package/src/examples/TooltipExamples.tsx +21 -21
- package/src/examples/VideoExamples.tsx +28 -28
- package/src/examples/ViewExamples.tsx +59 -59
- package/src/index.ts +4 -0
- package/src/utils/buildViewStyleVariants.ts +148 -0
- package/src/utils/viewStyleProps.ts +63 -0
package/src/View/types.ts
CHANGED
|
@@ -1,29 +1,19 @@
|
|
|
1
1
|
import { Size, Surface } from '@idealyst/theme';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
3
|
import type { StyleProp, ViewStyle } from 'react-native';
|
|
4
|
+
import { ContainerStyleProps } from '../utils/viewStyleProps';
|
|
4
5
|
|
|
5
6
|
// Component-specific type aliases for future extensibility
|
|
6
7
|
export type ViewBackgroundVariant = Surface | 'transparent';
|
|
7
|
-
export type ViewSpacingVariant = Size | 'none';
|
|
8
8
|
export type ViewRadiusVariant = Size | 'none';
|
|
9
9
|
export type ViewBorderVariant = 'none' | 'thin' | 'thick';
|
|
10
10
|
|
|
11
|
-
export interface ViewProps {
|
|
11
|
+
export interface ViewProps extends ContainerStyleProps {
|
|
12
12
|
/**
|
|
13
13
|
* The content to display inside the view
|
|
14
14
|
*/
|
|
15
15
|
children?: ReactNode;
|
|
16
16
|
|
|
17
|
-
/**
|
|
18
|
-
* Padding/spacing variant
|
|
19
|
-
*/
|
|
20
|
-
spacing?: ViewSpacingVariant;
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Margin variant
|
|
24
|
-
*/
|
|
25
|
-
marginVariant?: ViewSpacingVariant;
|
|
26
|
-
|
|
27
17
|
/**
|
|
28
18
|
* Background variant
|
|
29
19
|
*/
|
|
@@ -44,16 +34,6 @@ export interface ViewProps {
|
|
|
44
34
|
*/
|
|
45
35
|
backgroundColor?: string;
|
|
46
36
|
|
|
47
|
-
/**
|
|
48
|
-
* Custom padding (overrides spacing variant)
|
|
49
|
-
*/
|
|
50
|
-
padding?: number;
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Custom margin (overrides marginVariant)
|
|
54
|
-
*/
|
|
55
|
-
margin?: number;
|
|
56
|
-
|
|
57
37
|
/**
|
|
58
38
|
* Custom border radius (overrides radius variant)
|
|
59
39
|
*/
|
|
@@ -74,8 +54,13 @@ export interface ViewProps {
|
|
|
74
54
|
*/
|
|
75
55
|
style?: React.CSSProperties | StyleProp<ViewStyle>;
|
|
76
56
|
|
|
57
|
+
/**
|
|
58
|
+
* Enable scrollable content (uses ScrollView on native, overflow:auto on web)
|
|
59
|
+
*/
|
|
60
|
+
scrollable?: boolean;
|
|
61
|
+
|
|
77
62
|
/**
|
|
78
63
|
* Test ID for testing
|
|
79
64
|
*/
|
|
80
65
|
testID?: string;
|
|
81
|
-
}
|
|
66
|
+
}
|
|
@@ -27,7 +27,7 @@ export const AccordionExamples: React.FC = () => {
|
|
|
27
27
|
id: 'rich1',
|
|
28
28
|
title: 'Rich Content Example',
|
|
29
29
|
content: (
|
|
30
|
-
<View
|
|
30
|
+
<View gap="sm">
|
|
31
31
|
<Text weight="semibold">Features:</Text>
|
|
32
32
|
<Text>• Cross-platform support</Text>
|
|
33
33
|
<Text>• Type-safe styling</Text>
|
|
@@ -39,7 +39,7 @@ export const AccordionExamples: React.FC = () => {
|
|
|
39
39
|
id: 'rich2',
|
|
40
40
|
title: 'Another Section',
|
|
41
41
|
content: (
|
|
42
|
-
<View>
|
|
42
|
+
<View gap="xl">
|
|
43
43
|
<Text>This section contains rich content with multiple paragraphs.</Text>
|
|
44
44
|
<Text style={{ marginTop: 8 }}>You can include any React components here.</Text>
|
|
45
45
|
</View>
|
|
@@ -55,67 +55,67 @@ export const AccordionExamples: React.FC = () => {
|
|
|
55
55
|
|
|
56
56
|
return (
|
|
57
57
|
<Screen background="primary" padding="lg">
|
|
58
|
-
<View
|
|
59
|
-
<Text
|
|
58
|
+
<View gap="lg">
|
|
59
|
+
<Text typography="h3">Accordion Examples</Text>
|
|
60
60
|
|
|
61
|
-
<View
|
|
62
|
-
<Text
|
|
61
|
+
<View gap="md">
|
|
62
|
+
<Text typography="h5">Basic Accordion</Text>
|
|
63
63
|
<Accordion items={basicItems} />
|
|
64
64
|
</View>
|
|
65
65
|
|
|
66
|
-
<View
|
|
67
|
-
<Text
|
|
66
|
+
<View gap="md">
|
|
67
|
+
<Text typography="h5">Allow Multiple Expanded</Text>
|
|
68
68
|
<Accordion items={basicItems} allowMultiple />
|
|
69
69
|
</View>
|
|
70
70
|
|
|
71
|
-
<View
|
|
72
|
-
<Text
|
|
71
|
+
<View gap="md">
|
|
72
|
+
<Text typography="h5">Default Expanded</Text>
|
|
73
73
|
<Accordion items={basicItems} defaultExpanded={['item1', 'item2']} allowMultiple />
|
|
74
74
|
</View>
|
|
75
75
|
|
|
76
|
-
<View
|
|
77
|
-
<Text
|
|
78
|
-
<View
|
|
79
|
-
<View
|
|
80
|
-
<Text
|
|
76
|
+
<View gap="md">
|
|
77
|
+
<Text typography="h5">Variants</Text>
|
|
78
|
+
<View gap="sm">
|
|
79
|
+
<View gap="xs">
|
|
80
|
+
<Text typography="body2">Default</Text>
|
|
81
81
|
<Accordion items={basicItems} type="standard" />
|
|
82
82
|
</View>
|
|
83
|
-
<View
|
|
84
|
-
<Text
|
|
83
|
+
<View gap="xs">
|
|
84
|
+
<Text typography="body2">Separated</Text>
|
|
85
85
|
<Accordion items={basicItems} type="separated" />
|
|
86
86
|
</View>
|
|
87
|
-
<View
|
|
88
|
-
<Text
|
|
87
|
+
<View gap="xs">
|
|
88
|
+
<Text typography="body2">Bordered</Text>
|
|
89
89
|
<Accordion items={basicItems} type="bordered" />
|
|
90
90
|
</View>
|
|
91
91
|
</View>
|
|
92
92
|
</View>
|
|
93
93
|
|
|
94
|
-
<View
|
|
95
|
-
<Text
|
|
96
|
-
<View
|
|
97
|
-
<View
|
|
98
|
-
<Text
|
|
94
|
+
<View gap="md">
|
|
95
|
+
<Text typography="h5">Sizes</Text>
|
|
96
|
+
<View gap="sm">
|
|
97
|
+
<View gap="xs">
|
|
98
|
+
<Text typography="body2">Small</Text>
|
|
99
99
|
<Accordion items={basicItems} size="sm" type="separated" />
|
|
100
100
|
</View>
|
|
101
|
-
<View
|
|
102
|
-
<Text
|
|
101
|
+
<View gap="xs">
|
|
102
|
+
<Text typography="body2">Medium (default)</Text>
|
|
103
103
|
<Accordion items={basicItems} size="md" type="separated" />
|
|
104
104
|
</View>
|
|
105
|
-
<View
|
|
106
|
-
<Text
|
|
105
|
+
<View gap="xs">
|
|
106
|
+
<Text typography="body2">Large</Text>
|
|
107
107
|
<Accordion items={basicItems} size="lg" type="separated" />
|
|
108
108
|
</View>
|
|
109
109
|
</View>
|
|
110
110
|
</View>
|
|
111
111
|
|
|
112
|
-
<View
|
|
113
|
-
<Text
|
|
112
|
+
<View gap="md">
|
|
113
|
+
<Text typography="h5">Rich Content</Text>
|
|
114
114
|
<Accordion items={richContentItems} type="bordered" />
|
|
115
115
|
</View>
|
|
116
116
|
|
|
117
|
-
<View
|
|
118
|
-
<Text
|
|
117
|
+
<View gap="md">
|
|
118
|
+
<Text typography="h5">Disabled Items</Text>
|
|
119
119
|
<Accordion items={disabledItems} type="separated" />
|
|
120
120
|
</View>
|
|
121
121
|
</View>
|
|
@@ -6,13 +6,13 @@ export const AlertExamples = () => {
|
|
|
6
6
|
|
|
7
7
|
return (
|
|
8
8
|
<Screen background="primary" safeArea>
|
|
9
|
-
<View
|
|
10
|
-
<Text
|
|
9
|
+
<View gap="lg" style={{ maxWidth: 800, width: '100%', paddingHorizontal: 16, marginHorizontal: 'auto' }}>
|
|
10
|
+
<Text typography="h3">Alert Examples</Text>
|
|
11
11
|
|
|
12
|
-
<View
|
|
13
|
-
<Text
|
|
12
|
+
<View gap="md">
|
|
13
|
+
<Text typography="h5">Intent Variants</Text>
|
|
14
14
|
|
|
15
|
-
<View
|
|
15
|
+
<View gap="sm">
|
|
16
16
|
<Alert
|
|
17
17
|
intent="primary"
|
|
18
18
|
title="Primary"
|
|
@@ -51,11 +51,11 @@ export const AlertExamples = () => {
|
|
|
51
51
|
</View>
|
|
52
52
|
</View>
|
|
53
53
|
|
|
54
|
-
<View
|
|
55
|
-
<Text
|
|
54
|
+
<View gap="md">
|
|
55
|
+
<Text typography="h5">Style Variants</Text>
|
|
56
56
|
|
|
57
|
-
<View
|
|
58
|
-
<Text
|
|
57
|
+
<View gap="sm">
|
|
58
|
+
<Text typography="subtitle1">Filled</Text>
|
|
59
59
|
<Alert
|
|
60
60
|
type="filled"
|
|
61
61
|
intent="primary"
|
|
@@ -64,8 +64,8 @@ export const AlertExamples = () => {
|
|
|
64
64
|
/>
|
|
65
65
|
</View>
|
|
66
66
|
|
|
67
|
-
<View
|
|
68
|
-
<Text
|
|
67
|
+
<View gap="sm">
|
|
68
|
+
<Text typography="subtitle1">Outlined</Text>
|
|
69
69
|
<Alert
|
|
70
70
|
type="outlined"
|
|
71
71
|
intent="primary"
|
|
@@ -74,8 +74,8 @@ export const AlertExamples = () => {
|
|
|
74
74
|
/>
|
|
75
75
|
</View>
|
|
76
76
|
|
|
77
|
-
<View
|
|
78
|
-
<Text
|
|
77
|
+
<View gap="sm">
|
|
78
|
+
<Text typography="subtitle1">Soft (Default)</Text>
|
|
79
79
|
<Alert
|
|
80
80
|
type="soft"
|
|
81
81
|
intent="primary"
|
|
@@ -85,8 +85,8 @@ export const AlertExamples = () => {
|
|
|
85
85
|
</View>
|
|
86
86
|
</View>
|
|
87
87
|
|
|
88
|
-
<View
|
|
89
|
-
<Text
|
|
88
|
+
<View gap="md">
|
|
89
|
+
<Text typography="h5">Without Icons</Text>
|
|
90
90
|
|
|
91
91
|
<Alert
|
|
92
92
|
intent="success"
|
|
@@ -96,10 +96,10 @@ export const AlertExamples = () => {
|
|
|
96
96
|
/>
|
|
97
97
|
</View>
|
|
98
98
|
|
|
99
|
-
<View
|
|
100
|
-
<Text
|
|
99
|
+
<View gap="md">
|
|
100
|
+
<Text typography="h5">Custom Icons</Text>
|
|
101
101
|
|
|
102
|
-
<View
|
|
102
|
+
<View gap="sm">
|
|
103
103
|
<Alert
|
|
104
104
|
intent="info"
|
|
105
105
|
title="Custom Icon"
|
|
@@ -116,10 +116,10 @@ export const AlertExamples = () => {
|
|
|
116
116
|
</View>
|
|
117
117
|
</View>
|
|
118
118
|
|
|
119
|
-
<View
|
|
120
|
-
<Text
|
|
119
|
+
<View gap="md">
|
|
120
|
+
<Text typography="h5">Dismissible Alerts</Text>
|
|
121
121
|
|
|
122
|
-
<View
|
|
122
|
+
<View gap="sm">
|
|
123
123
|
{successVisible && (
|
|
124
124
|
<Alert
|
|
125
125
|
intent="success"
|
|
@@ -155,10 +155,10 @@ export const AlertExamples = () => {
|
|
|
155
155
|
</View>
|
|
156
156
|
</View>
|
|
157
157
|
|
|
158
|
-
<View
|
|
159
|
-
<Text
|
|
158
|
+
<View gap="md">
|
|
159
|
+
<Text typography="h5">With Actions</Text>
|
|
160
160
|
|
|
161
|
-
<View
|
|
161
|
+
<View gap="sm">
|
|
162
162
|
<Alert
|
|
163
163
|
intent="warning"
|
|
164
164
|
title="Unsaved Changes"
|
|
@@ -189,26 +189,26 @@ export const AlertExamples = () => {
|
|
|
189
189
|
</View>
|
|
190
190
|
</View>
|
|
191
191
|
|
|
192
|
-
<View
|
|
193
|
-
<Text
|
|
192
|
+
<View gap="md">
|
|
193
|
+
<Text typography="h5">With Children</Text>
|
|
194
194
|
|
|
195
195
|
<Alert
|
|
196
196
|
intent="info"
|
|
197
197
|
title="Custom Content"
|
|
198
198
|
>
|
|
199
|
-
<View
|
|
200
|
-
<Text
|
|
199
|
+
<View gap="sm">
|
|
200
|
+
<Text typography="body2">You can use children to add custom content:</Text>
|
|
201
201
|
<View style={{ paddingLeft: 16 }}>
|
|
202
|
-
<Text
|
|
203
|
-
<Text
|
|
204
|
-
<Text
|
|
202
|
+
<Text typography="body2">• Custom formatted text</Text>
|
|
203
|
+
<Text typography="body2">• Lists and structured content</Text>
|
|
204
|
+
<Text typography="body2">• Any React components</Text>
|
|
205
205
|
</View>
|
|
206
206
|
</View>
|
|
207
207
|
</Alert>
|
|
208
208
|
</View>
|
|
209
209
|
|
|
210
|
-
<View
|
|
211
|
-
<Text
|
|
210
|
+
<View gap="md">
|
|
211
|
+
<Text typography="h5">Complex Example</Text>
|
|
212
212
|
|
|
213
213
|
<Alert
|
|
214
214
|
type="filled"
|
|
@@ -230,10 +230,10 @@ export const AlertExamples = () => {
|
|
|
230
230
|
/>
|
|
231
231
|
</View>
|
|
232
232
|
|
|
233
|
-
<View
|
|
234
|
-
<Text
|
|
233
|
+
<View gap="md">
|
|
234
|
+
<Text typography="h5">All Intent Colors (Soft Variant)</Text>
|
|
235
235
|
|
|
236
|
-
<View
|
|
236
|
+
<View gap="sm">
|
|
237
237
|
{(['primary', 'success', 'error', 'warning', 'info', 'neutral'] as const).map((intent) => (
|
|
238
238
|
<Alert
|
|
239
239
|
key={intent}
|
|
@@ -245,10 +245,10 @@ export const AlertExamples = () => {
|
|
|
245
245
|
</View>
|
|
246
246
|
</View>
|
|
247
247
|
|
|
248
|
-
<View
|
|
249
|
-
<Text
|
|
248
|
+
<View gap="md">
|
|
249
|
+
<Text typography="h5">All Intent Colors (Outlined Variant)</Text>
|
|
250
250
|
|
|
251
|
-
<View
|
|
251
|
+
<View gap="sm">
|
|
252
252
|
{(['primary', 'success', 'error', 'warning', 'info', 'neutral'] as const).map((intent) => (
|
|
253
253
|
<Alert
|
|
254
254
|
key={intent}
|
|
@@ -260,10 +260,10 @@ export const AlertExamples = () => {
|
|
|
260
260
|
</View>
|
|
261
261
|
</View>
|
|
262
262
|
|
|
263
|
-
<View
|
|
264
|
-
<Text
|
|
263
|
+
<View gap="md">
|
|
264
|
+
<Text typography="h5">All Intent Colors (Filled Variant)</Text>
|
|
265
265
|
|
|
266
|
-
<View
|
|
266
|
+
<View gap="sm">
|
|
267
267
|
{(['primary', 'success', 'error', 'warning', 'info', 'neutral'] as const).map((intent) => (
|
|
268
268
|
<Alert
|
|
269
269
|
key={intent}
|
|
@@ -4,14 +4,14 @@ import { Screen, View, Text, Avatar } from '../index';
|
|
|
4
4
|
export const AvatarExamples = () => {
|
|
5
5
|
return (
|
|
6
6
|
<Screen background="primary" padding="lg">
|
|
7
|
-
<View
|
|
8
|
-
<Text
|
|
7
|
+
<View gap="xl">
|
|
8
|
+
<Text typography="h4" align="center">
|
|
9
9
|
Avatar Examples
|
|
10
10
|
</Text>
|
|
11
11
|
|
|
12
12
|
{/* Avatar Sizes */}
|
|
13
|
-
<View
|
|
14
|
-
<Text
|
|
13
|
+
<View gap="md">
|
|
14
|
+
<Text typography="subtitle1">Sizes</Text>
|
|
15
15
|
<View style={{ flexDirection: 'row', gap: 12, flexWrap: 'wrap', alignItems: 'center' }}>
|
|
16
16
|
<Avatar size="sm" fallback="S" />
|
|
17
17
|
<Avatar size="md" fallback="M" />
|
|
@@ -21,8 +21,8 @@ export const AvatarExamples = () => {
|
|
|
21
21
|
</View>
|
|
22
22
|
|
|
23
23
|
{/* Avatar Shapes */}
|
|
24
|
-
<View
|
|
25
|
-
<Text
|
|
24
|
+
<View gap="md">
|
|
25
|
+
<Text typography="subtitle1">Shapes</Text>
|
|
26
26
|
<View style={{ flexDirection: 'row', gap: 12, flexWrap: 'wrap', alignItems: 'center' }}>
|
|
27
27
|
<Avatar shape="circle" fallback="C" size="lg" />
|
|
28
28
|
<Avatar shape="square" fallback="S" size="lg" />
|
|
@@ -30,8 +30,8 @@ export const AvatarExamples = () => {
|
|
|
30
30
|
</View>
|
|
31
31
|
|
|
32
32
|
{/* Avatar with Fallbacks */}
|
|
33
|
-
<View
|
|
34
|
-
<Text
|
|
33
|
+
<View gap="md">
|
|
34
|
+
<Text typography="subtitle1">Fallback Text</Text>
|
|
35
35
|
<View style={{ flexDirection: 'row', gap: 12, flexWrap: 'wrap', alignItems: 'center' }}>
|
|
36
36
|
<Avatar fallback="JD" alt="John Doe" />
|
|
37
37
|
<Avatar fallback="AB" alt="Alice Brown" />
|
|
@@ -41,8 +41,8 @@ export const AvatarExamples = () => {
|
|
|
41
41
|
</View>
|
|
42
42
|
|
|
43
43
|
{/* Avatar with Images */}
|
|
44
|
-
<View
|
|
45
|
-
<Text
|
|
44
|
+
<View gap="md">
|
|
45
|
+
<Text typography="subtitle1">With Images</Text>
|
|
46
46
|
<View style={{ flexDirection: 'row', gap: 12, flexWrap: 'wrap', alignItems: 'center' }}>
|
|
47
47
|
<Avatar
|
|
48
48
|
src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?w=150&h=150&fit=crop&crop=face"
|
|
@@ -63,8 +63,8 @@ export const AvatarExamples = () => {
|
|
|
63
63
|
</View>
|
|
64
64
|
|
|
65
65
|
{/* Avatar Group */}
|
|
66
|
-
<View
|
|
67
|
-
<Text
|
|
66
|
+
<View gap="md">
|
|
67
|
+
<Text typography="subtitle1">Avatar Group</Text>
|
|
68
68
|
<View style={{ flexDirection: 'row', gap: -8, alignItems: 'center' }}>
|
|
69
69
|
<Avatar fallback="JD" size="md" />
|
|
70
70
|
<Avatar fallback="AB" size="md" />
|
|
@@ -74,20 +74,20 @@ export const AvatarExamples = () => {
|
|
|
74
74
|
</View>
|
|
75
75
|
|
|
76
76
|
{/* Different Size Combinations */}
|
|
77
|
-
<View
|
|
78
|
-
<Text
|
|
79
|
-
<View
|
|
77
|
+
<View gap="md">
|
|
78
|
+
<Text typography="subtitle1">Size Combinations</Text>
|
|
79
|
+
<View gap="sm">
|
|
80
80
|
<View style={{ flexDirection: 'row', gap: 8, alignItems: 'center' }}>
|
|
81
81
|
<Avatar size="sm" fallback="S" />
|
|
82
|
-
<Text
|
|
82
|
+
<Text typography="body2">Small avatar with text</Text>
|
|
83
83
|
</View>
|
|
84
84
|
<View style={{ flexDirection: 'row', gap: 8, alignItems: 'center' }}>
|
|
85
85
|
<Avatar size="md" fallback="M" />
|
|
86
|
-
<Text
|
|
86
|
+
<Text typography="body1">Medium avatar with text</Text>
|
|
87
87
|
</View>
|
|
88
88
|
<View style={{ flexDirection: 'row', gap: 8, alignItems: 'center' }}>
|
|
89
89
|
<Avatar size="lg" fallback="L" />
|
|
90
|
-
<Text
|
|
90
|
+
<Text typography="h5">Large avatar with text</Text>
|
|
91
91
|
</View>
|
|
92
92
|
</View>
|
|
93
93
|
</View>
|
|
@@ -4,14 +4,14 @@ import { Screen, View, Text, Badge, Button } from '../index';
|
|
|
4
4
|
export const BadgeExamples = () => {
|
|
5
5
|
return (
|
|
6
6
|
<Screen background="primary" padding="lg">
|
|
7
|
-
<View
|
|
8
|
-
<Text
|
|
7
|
+
<View gap="md">
|
|
8
|
+
<Text typography="h4" align="center">
|
|
9
9
|
Badge Examples
|
|
10
10
|
</Text>
|
|
11
11
|
|
|
12
12
|
{/* Badge Variants */}
|
|
13
|
-
<View
|
|
14
|
-
<Text
|
|
13
|
+
<View gap="xs">
|
|
14
|
+
<Text typography="subtitle1">Variants</Text>
|
|
15
15
|
<View style={{ flexDirection: 'row', gap: 12, flexWrap: 'wrap', alignItems: 'center' }}>
|
|
16
16
|
<Badge type="filled" color="blue">
|
|
17
17
|
Filled
|
|
@@ -24,8 +24,8 @@ export const BadgeExamples = () => {
|
|
|
24
24
|
</View>
|
|
25
25
|
|
|
26
26
|
{/* Badge Sizes */}
|
|
27
|
-
<View
|
|
28
|
-
<Text
|
|
27
|
+
<View gap="sm">
|
|
28
|
+
<Text typography="subtitle1">Sizes</Text>
|
|
29
29
|
<View style={{ flexDirection: 'row', gap: 12, flexWrap: 'wrap', alignItems: 'center' }}>
|
|
30
30
|
<Badge size="sm" color="blue">
|
|
31
31
|
Small
|
|
@@ -40,8 +40,8 @@ export const BadgeExamples = () => {
|
|
|
40
40
|
</View>
|
|
41
41
|
|
|
42
42
|
{/* Badge Colors */}
|
|
43
|
-
<View
|
|
44
|
-
<Text
|
|
43
|
+
<View gap="sm">
|
|
44
|
+
<Text typography="subtitle1">Colors</Text>
|
|
45
45
|
<View style={{ flexDirection: 'row', gap: 12, flexWrap: 'wrap', alignItems: 'center' }}>
|
|
46
46
|
<Badge color="blue">
|
|
47
47
|
Blue
|
|
@@ -65,8 +65,8 @@ export const BadgeExamples = () => {
|
|
|
65
65
|
</View>
|
|
66
66
|
|
|
67
67
|
{/* Badge Color Shades */}
|
|
68
|
-
<View
|
|
69
|
-
<Text
|
|
68
|
+
<View gap="sm">
|
|
69
|
+
<Text typography="subtitle1">Color Shades</Text>
|
|
70
70
|
<View style={{ flexDirection: 'row', gap: 12, flexWrap: 'wrap', alignItems: 'center' }}>
|
|
71
71
|
<Badge color="blue.200">
|
|
72
72
|
Blue 200
|
|
@@ -92,8 +92,8 @@ export const BadgeExamples = () => {
|
|
|
92
92
|
</View>
|
|
93
93
|
|
|
94
94
|
{/* Dot Badges */}
|
|
95
|
-
<View
|
|
96
|
-
<Text
|
|
95
|
+
<View gap="sm">
|
|
96
|
+
<Text typography="subtitle1">Dot Badges</Text>
|
|
97
97
|
<View style={{ flexDirection: 'row', gap: 12, flexWrap: 'wrap', alignItems: 'center' }}>
|
|
98
98
|
<Badge type="dot" color="blue" size="sm" />
|
|
99
99
|
<Badge type="dot" color="green" size="md" />
|
|
@@ -104,8 +104,8 @@ export const BadgeExamples = () => {
|
|
|
104
104
|
</View>
|
|
105
105
|
|
|
106
106
|
{/* Number Badges */}
|
|
107
|
-
<View
|
|
108
|
-
<Text
|
|
107
|
+
<View gap="sm">
|
|
108
|
+
<Text typography="subtitle1">Number Badges</Text>
|
|
109
109
|
<View style={{ flexDirection: 'row', gap: 12, flexWrap: 'wrap', alignItems: 'center' }}>
|
|
110
110
|
<Badge color="red" size="sm">
|
|
111
111
|
1
|
|
@@ -123,8 +123,8 @@ export const BadgeExamples = () => {
|
|
|
123
123
|
</View>
|
|
124
124
|
|
|
125
125
|
{/* Status Badges */}
|
|
126
|
-
<View
|
|
127
|
-
<Text
|
|
126
|
+
<View gap="sm">
|
|
127
|
+
<Text typography="subtitle1">Status Badges</Text>
|
|
128
128
|
<View style={{ flexDirection: 'row', gap: 12, flexWrap: 'wrap', alignItems: 'center' }}>
|
|
129
129
|
<Badge color="green" type="filled">
|
|
130
130
|
ACTIVE
|
|
@@ -145,9 +145,9 @@ export const BadgeExamples = () => {
|
|
|
145
145
|
</View>
|
|
146
146
|
|
|
147
147
|
{/* Combined with Other Components */}
|
|
148
|
-
<View
|
|
149
|
-
<Text
|
|
150
|
-
<View
|
|
148
|
+
<View gap="sm">
|
|
149
|
+
<Text typography="subtitle1">With Other Components</Text>
|
|
150
|
+
<View gap="sm">
|
|
151
151
|
<View style={{ flexDirection: 'row', alignItems: 'center', gap: 8 }}>
|
|
152
152
|
<Text>Notifications</Text>
|
|
153
153
|
<Badge color="red" size="sm">3</Badge>
|
|
@@ -161,7 +161,7 @@ export const BadgeExamples = () => {
|
|
|
161
161
|
<View style={{ flexDirection: 'row', alignItems: 'center', gap: 8 }}>
|
|
162
162
|
<Text>Status</Text>
|
|
163
163
|
<Badge color="green" type="dot" />
|
|
164
|
-
<Text
|
|
164
|
+
<Text typography="caption" color="secondary">Online</Text>
|
|
165
165
|
</View>
|
|
166
166
|
|
|
167
167
|
<View style={{ flexDirection: 'row', alignItems: 'center', gap: 8 }}>
|
|
@@ -174,8 +174,8 @@ export const BadgeExamples = () => {
|
|
|
174
174
|
</View>
|
|
175
175
|
|
|
176
176
|
{/* Category Badges */}
|
|
177
|
-
<View
|
|
178
|
-
<Text
|
|
177
|
+
<View gap="sm">
|
|
178
|
+
<Text typography="subtitle1">Category Badges</Text>
|
|
179
179
|
<View style={{ flexDirection: 'row', gap: 8, flexWrap: 'wrap' }}>
|
|
180
180
|
<Badge color="blue" type="outlined">
|
|
181
181
|
React
|
|
@@ -196,8 +196,8 @@ export const BadgeExamples = () => {
|
|
|
196
196
|
</View>
|
|
197
197
|
|
|
198
198
|
{/* Badges with Icons */}
|
|
199
|
-
<View
|
|
200
|
-
<Text
|
|
199
|
+
<View gap="sm">
|
|
200
|
+
<Text typography="subtitle1">Badges with Icons</Text>
|
|
201
201
|
<View style={{ flexDirection: 'row', gap: 12, flexWrap: 'wrap', alignItems: 'center' }}>
|
|
202
202
|
<Badge color="blue" icon="information">
|
|
203
203
|
Info
|
|
@@ -215,8 +215,8 @@ export const BadgeExamples = () => {
|
|
|
215
215
|
</View>
|
|
216
216
|
|
|
217
217
|
{/* Icon-only Badges */}
|
|
218
|
-
<View
|
|
219
|
-
<Text
|
|
218
|
+
<View gap="sm">
|
|
219
|
+
<Text typography="subtitle1">Icon-only Badges</Text>
|
|
220
220
|
<View style={{ flexDirection: 'row', gap: 12, flexWrap: 'wrap', alignItems: 'center' }}>
|
|
221
221
|
<Badge color="blue" icon="star" size="sm" />
|
|
222
222
|
<Badge color="green" icon="heart" size="md" />
|
|
@@ -226,8 +226,8 @@ export const BadgeExamples = () => {
|
|
|
226
226
|
</View>
|
|
227
227
|
|
|
228
228
|
{/* Status Badges with Icons */}
|
|
229
|
-
<View
|
|
230
|
-
<Text
|
|
229
|
+
<View gap="sm">
|
|
230
|
+
<Text typography="subtitle1">Status with Icons</Text>
|
|
231
231
|
<View style={{ flexDirection: 'row', gap: 12, flexWrap: 'wrap', alignItems: 'center' }}>
|
|
232
232
|
<Badge color="green" icon="check">
|
|
233
233
|
VERIFIED
|
|
@@ -245,8 +245,8 @@ export const BadgeExamples = () => {
|
|
|
245
245
|
</View>
|
|
246
246
|
|
|
247
247
|
{/* Outlined Badges with Icons */}
|
|
248
|
-
<View
|
|
249
|
-
<Text
|
|
248
|
+
<View gap="sm">
|
|
249
|
+
<Text typography="subtitle1">Outlined with Icons</Text>
|
|
250
250
|
<View style={{ flexDirection: 'row', gap: 12, flexWrap: 'wrap', alignItems: 'center' }}>
|
|
251
251
|
<Badge color="blue" type="outlined" icon="download">
|
|
252
252
|
Download
|