@idealyst/components 1.0.99 → 1.1.1
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
|
@@ -5,11 +5,11 @@ import Image from '../Image';
|
|
|
5
5
|
export const ImageExamples: React.FC = () => {
|
|
6
6
|
return (
|
|
7
7
|
<Screen background="primary" padding="lg">
|
|
8
|
-
<View
|
|
9
|
-
<Text
|
|
8
|
+
<View gap="lg">
|
|
9
|
+
<Text typography="h3">Image Examples</Text>
|
|
10
10
|
|
|
11
|
-
<View
|
|
12
|
-
<Text
|
|
11
|
+
<View gap="md">
|
|
12
|
+
<Text typography="h5">Basic Image</Text>
|
|
13
13
|
<Image
|
|
14
14
|
source="https://picsum.photos/400/300"
|
|
15
15
|
alt="Random placeholder image"
|
|
@@ -18,10 +18,10 @@ export const ImageExamples: React.FC = () => {
|
|
|
18
18
|
/>
|
|
19
19
|
</View>
|
|
20
20
|
|
|
21
|
-
<View
|
|
22
|
-
<Text
|
|
23
|
-
<View
|
|
24
|
-
<Text
|
|
21
|
+
<View gap="md">
|
|
22
|
+
<Text typography="h5">Object Fit Variants</Text>
|
|
23
|
+
<View gap="sm">
|
|
24
|
+
<Text typography="body2">Cover (default)</Text>
|
|
25
25
|
<Image
|
|
26
26
|
source="https://picsum.photos/800/400"
|
|
27
27
|
alt="Cover example"
|
|
@@ -30,7 +30,7 @@ export const ImageExamples: React.FC = () => {
|
|
|
30
30
|
objectFit="cover"
|
|
31
31
|
/>
|
|
32
32
|
|
|
33
|
-
<Text
|
|
33
|
+
<Text typography="body2">Contain</Text>
|
|
34
34
|
<Image
|
|
35
35
|
source="https://picsum.photos/800/400"
|
|
36
36
|
alt="Contain example"
|
|
@@ -39,7 +39,7 @@ export const ImageExamples: React.FC = () => {
|
|
|
39
39
|
objectFit="contain"
|
|
40
40
|
/>
|
|
41
41
|
|
|
42
|
-
<Text
|
|
42
|
+
<Text typography="body2">Fill</Text>
|
|
43
43
|
<Image
|
|
44
44
|
source="https://picsum.photos/800/400"
|
|
45
45
|
alt="Fill example"
|
|
@@ -50,10 +50,10 @@ export const ImageExamples: React.FC = () => {
|
|
|
50
50
|
</View>
|
|
51
51
|
</View>
|
|
52
52
|
|
|
53
|
-
<View
|
|
54
|
-
<Text
|
|
55
|
-
<View
|
|
56
|
-
<Text
|
|
53
|
+
<View gap="md">
|
|
54
|
+
<Text typography="h5">Aspect Ratio</Text>
|
|
55
|
+
<View gap="sm">
|
|
56
|
+
<Text typography="body2">16:9 Aspect Ratio</Text>
|
|
57
57
|
<Image
|
|
58
58
|
source="https://picsum.photos/1600/900"
|
|
59
59
|
alt="16:9 aspect ratio"
|
|
@@ -61,7 +61,7 @@ export const ImageExamples: React.FC = () => {
|
|
|
61
61
|
aspectRatio={16 / 9}
|
|
62
62
|
/>
|
|
63
63
|
|
|
64
|
-
<Text
|
|
64
|
+
<Text typography="body2">1:1 Square</Text>
|
|
65
65
|
<Image
|
|
66
66
|
source="https://picsum.photos/600/600"
|
|
67
67
|
alt="Square aspect ratio"
|
|
@@ -71,11 +71,11 @@ export const ImageExamples: React.FC = () => {
|
|
|
71
71
|
</View>
|
|
72
72
|
</View>
|
|
73
73
|
|
|
74
|
-
<View
|
|
75
|
-
<Text
|
|
74
|
+
<View gap="md">
|
|
75
|
+
<Text typography="h5">Border Radius</Text>
|
|
76
76
|
<View style={{ flexDirection: 'row', gap: 16, flexWrap: 'wrap' }}>
|
|
77
|
-
<View
|
|
78
|
-
<Text
|
|
77
|
+
<View gap="xs">
|
|
78
|
+
<Text typography="body2">Rounded (8px)</Text>
|
|
79
79
|
<Image
|
|
80
80
|
source="https://picsum.photos/200/200?random=1"
|
|
81
81
|
alt="Rounded corners"
|
|
@@ -85,8 +85,8 @@ export const ImageExamples: React.FC = () => {
|
|
|
85
85
|
/>
|
|
86
86
|
</View>
|
|
87
87
|
|
|
88
|
-
<View
|
|
89
|
-
<Text
|
|
88
|
+
<View gap="xs">
|
|
89
|
+
<Text typography="body2">Very Rounded (24px)</Text>
|
|
90
90
|
<Image
|
|
91
91
|
source="https://picsum.photos/200/200?random=2"
|
|
92
92
|
alt="Very rounded corners"
|
|
@@ -96,8 +96,8 @@ export const ImageExamples: React.FC = () => {
|
|
|
96
96
|
/>
|
|
97
97
|
</View>
|
|
98
98
|
|
|
99
|
-
<View
|
|
100
|
-
<Text
|
|
99
|
+
<View gap="xs">
|
|
100
|
+
<Text typography="body2">Circle (50%)</Text>
|
|
101
101
|
<Image
|
|
102
102
|
source="https://picsum.photos/200/200?random=3"
|
|
103
103
|
alt="Circle"
|
|
@@ -109,10 +109,10 @@ export const ImageExamples: React.FC = () => {
|
|
|
109
109
|
</View>
|
|
110
110
|
</View>
|
|
111
111
|
|
|
112
|
-
<View
|
|
113
|
-
<Text
|
|
114
|
-
<Text
|
|
115
|
-
<View
|
|
112
|
+
<View gap="md">
|
|
113
|
+
<Text typography="h5">Lazy Loading</Text>
|
|
114
|
+
<Text typography="caption" color="secondary">Images load as they scroll into view</Text>
|
|
115
|
+
<View gap="sm">
|
|
116
116
|
{[1, 2, 3, 4, 5].map((i) => (
|
|
117
117
|
<Image
|
|
118
118
|
key={i}
|
|
@@ -126,8 +126,8 @@ export const ImageExamples: React.FC = () => {
|
|
|
126
126
|
</View>
|
|
127
127
|
</View>
|
|
128
128
|
|
|
129
|
-
<View
|
|
130
|
-
<Text
|
|
129
|
+
<View gap="md">
|
|
130
|
+
<Text typography="h5">With Custom Placeholder</Text>
|
|
131
131
|
<Image
|
|
132
132
|
source="https://picsum.photos/400/300?random=20"
|
|
133
133
|
alt="Custom placeholder"
|
|
@@ -141,9 +141,9 @@ export const ImageExamples: React.FC = () => {
|
|
|
141
141
|
/>
|
|
142
142
|
</View>
|
|
143
143
|
|
|
144
|
-
<View
|
|
145
|
-
<Text
|
|
146
|
-
<Text
|
|
144
|
+
<View gap="md">
|
|
145
|
+
<Text typography="h5">Error Handling</Text>
|
|
146
|
+
<Text typography="caption" color="secondary">Image with broken URL shows fallback</Text>
|
|
147
147
|
<Image
|
|
148
148
|
source="https://broken-url-that-does-not-exist.com/image.jpg"
|
|
149
149
|
alt="Broken image"
|
|
@@ -157,8 +157,8 @@ export const ImageExamples: React.FC = () => {
|
|
|
157
157
|
/>
|
|
158
158
|
</View>
|
|
159
159
|
|
|
160
|
-
<View
|
|
161
|
-
<Text
|
|
160
|
+
<View gap="md">
|
|
161
|
+
<Text typography="h5">Responsive Width</Text>
|
|
162
162
|
<Image
|
|
163
163
|
source="https://picsum.photos/1200/400"
|
|
164
164
|
alt="Responsive image"
|
|
@@ -11,15 +11,15 @@ export const InputExamples = () => {
|
|
|
11
11
|
|
|
12
12
|
return (
|
|
13
13
|
<Screen background="primary" padding="lg">
|
|
14
|
-
<View
|
|
15
|
-
<Text
|
|
14
|
+
<View gap="xl">
|
|
15
|
+
<Text typography="h4" align="center">
|
|
16
16
|
Input Examples
|
|
17
17
|
</Text>
|
|
18
18
|
|
|
19
19
|
{/* With Icons */}
|
|
20
|
-
<View
|
|
21
|
-
<Text
|
|
22
|
-
<View
|
|
20
|
+
<View gap="md">
|
|
21
|
+
<Text typography="subtitle1">With Icons</Text>
|
|
22
|
+
<View gap="sm" style={{ gap: 10 }}>
|
|
23
23
|
<Input
|
|
24
24
|
leftIcon="email"
|
|
25
25
|
value={emailValue}
|
|
@@ -61,9 +61,9 @@ export const InputExamples = () => {
|
|
|
61
61
|
</View>
|
|
62
62
|
|
|
63
63
|
{/* Input Types */}
|
|
64
|
-
<View
|
|
65
|
-
<Text
|
|
66
|
-
<View
|
|
64
|
+
<View gap="md">
|
|
65
|
+
<Text typography="subtitle1">Input Types</Text>
|
|
66
|
+
<View gap="sm" style={{ gap: 10 }}>
|
|
67
67
|
<Input
|
|
68
68
|
value={textValue}
|
|
69
69
|
onChangeText={setTextValue}
|
|
@@ -95,9 +95,9 @@ export const InputExamples = () => {
|
|
|
95
95
|
</View>
|
|
96
96
|
|
|
97
97
|
{/* Input Sizes */}
|
|
98
|
-
<View
|
|
99
|
-
<Text
|
|
100
|
-
<View
|
|
98
|
+
<View gap="md">
|
|
99
|
+
<Text typography="subtitle1">Sizes</Text>
|
|
100
|
+
<View gap="sm" style={{ gap: 10 }}>
|
|
101
101
|
<Input
|
|
102
102
|
leftIcon="email"
|
|
103
103
|
placeholder="Small input"
|
|
@@ -117,9 +117,9 @@ export const InputExamples = () => {
|
|
|
117
117
|
</View>
|
|
118
118
|
|
|
119
119
|
{/* Input Variants */}
|
|
120
|
-
<View
|
|
121
|
-
<Text
|
|
122
|
-
<View
|
|
120
|
+
<View gap="md">
|
|
121
|
+
<Text typography="subtitle1">Variants</Text>
|
|
122
|
+
<View gap="sm" style={{ gap: 10 }}>
|
|
123
123
|
<Input
|
|
124
124
|
leftIcon="magnify"
|
|
125
125
|
placeholder="Outlined variant"
|
|
@@ -139,9 +139,9 @@ export const InputExamples = () => {
|
|
|
139
139
|
</View>
|
|
140
140
|
|
|
141
141
|
{/* Input States */}
|
|
142
|
-
<View
|
|
143
|
-
<Text
|
|
144
|
-
<View
|
|
142
|
+
<View gap="md">
|
|
143
|
+
<Text typography="subtitle1">States</Text>
|
|
144
|
+
<View gap="sm" style={{ gap: 10 }}>
|
|
145
145
|
<Input
|
|
146
146
|
leftIcon="account"
|
|
147
147
|
placeholder="Normal state"
|
|
@@ -165,9 +165,9 @@ export const InputExamples = () => {
|
|
|
165
165
|
</View>
|
|
166
166
|
|
|
167
167
|
{/* Auto-capitalization Examples */}
|
|
168
|
-
<View
|
|
169
|
-
<Text
|
|
170
|
-
<View
|
|
168
|
+
<View gap="md">
|
|
169
|
+
<Text typography="subtitle1">Auto-capitalization</Text>
|
|
170
|
+
<View gap="sm" style={{ gap: 10 }}>
|
|
171
171
|
<Input
|
|
172
172
|
placeholder="No capitalization"
|
|
173
173
|
autoCapitalize="none"
|
|
@@ -8,14 +8,14 @@ export const LinkExamples = () => {
|
|
|
8
8
|
|
|
9
9
|
return (
|
|
10
10
|
<Screen background="primary">
|
|
11
|
-
<View
|
|
12
|
-
<Text
|
|
11
|
+
<View gap="xl">
|
|
12
|
+
<Text typography="h4" align="center">
|
|
13
13
|
Link Examples
|
|
14
14
|
</Text>
|
|
15
15
|
|
|
16
16
|
{/* Basic Text Links */}
|
|
17
|
-
<View
|
|
18
|
-
<Text
|
|
17
|
+
<View gap="md">
|
|
18
|
+
<Text typography="subtitle1">Basic Text Links</Text>
|
|
19
19
|
<View style={{ flexDirection: 'row', gap: 16, flexWrap: 'wrap' }}>
|
|
20
20
|
<Link to="/home" onPress={() => handlePress('home')}>
|
|
21
21
|
<Text color="primary">Go to Home</Text>
|
|
@@ -30,8 +30,8 @@ export const LinkExamples = () => {
|
|
|
30
30
|
</View>
|
|
31
31
|
|
|
32
32
|
{/* Links with Path Variables */}
|
|
33
|
-
<View
|
|
34
|
-
<Text
|
|
33
|
+
<View gap="md">
|
|
34
|
+
<Text typography="subtitle1">Links with Path Variables</Text>
|
|
35
35
|
<View style={{ flexDirection: 'column', gap: 8 }}>
|
|
36
36
|
<Link
|
|
37
37
|
to="/user/:id"
|
|
@@ -58,8 +58,8 @@ export const LinkExamples = () => {
|
|
|
58
58
|
</View>
|
|
59
59
|
|
|
60
60
|
{/* Links Wrapping Buttons */}
|
|
61
|
-
<View
|
|
62
|
-
<Text
|
|
61
|
+
<View gap="md">
|
|
62
|
+
<Text typography="subtitle1">Links Wrapping Buttons</Text>
|
|
63
63
|
<View style={{ flexDirection: 'row', gap: 12, flexWrap: 'wrap' }}>
|
|
64
64
|
<Link to="/dashboard" onPress={() => handlePress('dashboard-btn')}>
|
|
65
65
|
<Button type="contained" intent="primary">
|
|
@@ -80,8 +80,8 @@ export const LinkExamples = () => {
|
|
|
80
80
|
</View>
|
|
81
81
|
|
|
82
82
|
{/* Links with Icons and Text */}
|
|
83
|
-
<View
|
|
84
|
-
<Text
|
|
83
|
+
<View gap="md">
|
|
84
|
+
<Text typography="subtitle1">Links with Icons</Text>
|
|
85
85
|
<View style={{ flexDirection: 'column', gap: 12 }}>
|
|
86
86
|
<Link to="/notifications" onPress={() => handlePress('notifications')}>
|
|
87
87
|
<View style={{ flexDirection: 'row', alignItems: 'center', gap: 8 }}>
|
|
@@ -105,8 +105,8 @@ export const LinkExamples = () => {
|
|
|
105
105
|
</View>
|
|
106
106
|
|
|
107
107
|
{/* Disabled Links */}
|
|
108
|
-
<View
|
|
109
|
-
<Text
|
|
108
|
+
<View gap="md">
|
|
109
|
+
<Text typography="subtitle1">Disabled Links</Text>
|
|
110
110
|
<View style={{ flexDirection: 'column', gap: 12 }}>
|
|
111
111
|
<Link to="/restricted" disabled onPress={() => handlePress('disabled-text')}>
|
|
112
112
|
<Text color="secondary">Restricted Area (Disabled)</Text>
|
|
@@ -120,13 +120,13 @@ export const LinkExamples = () => {
|
|
|
120
120
|
</View>
|
|
121
121
|
|
|
122
122
|
{/* Links Wrapping Cards */}
|
|
123
|
-
<View
|
|
124
|
-
<Text
|
|
123
|
+
<View gap="md">
|
|
124
|
+
<Text typography="subtitle1">Clickable Cards (Links)</Text>
|
|
125
125
|
<View style={{ flexDirection: 'column', gap: 12 }}>
|
|
126
126
|
<Link to="/article/1" onPress={() => handlePress('card-1')}>
|
|
127
127
|
<Card type="outlined" padding="md">
|
|
128
|
-
<Text
|
|
129
|
-
<Text
|
|
128
|
+
<Text typography="subtitle1">Article Title</Text>
|
|
129
|
+
<Text typography="caption" color="secondary">
|
|
130
130
|
Click this card to read the full article...
|
|
131
131
|
</Text>
|
|
132
132
|
</Card>
|
|
@@ -136,8 +136,8 @@ export const LinkExamples = () => {
|
|
|
136
136
|
<View style={{ flexDirection: 'row', alignItems: 'center', gap: 12 }}>
|
|
137
137
|
<Icon name="file-document" size={24} intent="primary" />
|
|
138
138
|
<View style={{ flex: 1 }}>
|
|
139
|
-
<Text
|
|
140
|
-
<Text
|
|
139
|
+
<Text typography="subtitle1">Documentation</Text>
|
|
140
|
+
<Text typography="caption" color="secondary">
|
|
141
141
|
View the complete documentation
|
|
142
142
|
</Text>
|
|
143
143
|
</View>
|
|
@@ -149,9 +149,9 @@ export const LinkExamples = () => {
|
|
|
149
149
|
</View>
|
|
150
150
|
|
|
151
151
|
{/* Navigation Menu Style */}
|
|
152
|
-
<View
|
|
153
|
-
<Text
|
|
154
|
-
<Card type="filled"
|
|
152
|
+
<View gap="md">
|
|
153
|
+
<Text typography="subtitle1">Navigation Menu Style</Text>
|
|
154
|
+
<Card type="filled">
|
|
155
155
|
<Link to="/menu/home" onPress={() => handlePress('menu-home')}>
|
|
156
156
|
<View style={{ flexDirection: 'row', alignItems: 'center', padding: 16, gap: 12 }}>
|
|
157
157
|
<Icon name="home" size={20} intent="primary" />
|
|
@@ -177,8 +177,8 @@ export const LinkExamples = () => {
|
|
|
177
177
|
</View>
|
|
178
178
|
|
|
179
179
|
{/* Styled Links */}
|
|
180
|
-
<View
|
|
181
|
-
<Text
|
|
180
|
+
<View gap="md">
|
|
181
|
+
<Text typography="subtitle1">Custom Styled Links</Text>
|
|
182
182
|
<View style={{ flexDirection: 'row', gap: 12, flexWrap: 'wrap' }}>
|
|
183
183
|
<Link
|
|
184
184
|
to="/styled/1"
|
|
@@ -8,11 +8,11 @@ export const ListExamples: React.FC = () => {
|
|
|
8
8
|
|
|
9
9
|
return (
|
|
10
10
|
<Screen background="primary" padding="lg">
|
|
11
|
-
<View
|
|
12
|
-
<Text
|
|
11
|
+
<View gap="lg">
|
|
12
|
+
<Text typography="h3">List Examples</Text>
|
|
13
13
|
|
|
14
|
-
<View
|
|
15
|
-
<Text
|
|
14
|
+
<View gap="md">
|
|
15
|
+
<Text typography="h5">Basic List</Text>
|
|
16
16
|
<List type="divided">
|
|
17
17
|
<ListItem label="Item 1" />
|
|
18
18
|
<ListItem label="Item 2" />
|
|
@@ -20,27 +20,27 @@ export const ListExamples: React.FC = () => {
|
|
|
20
20
|
</List>
|
|
21
21
|
</View>
|
|
22
22
|
|
|
23
|
-
<View
|
|
24
|
-
<Text
|
|
25
|
-
<View
|
|
26
|
-
<View
|
|
27
|
-
<Text
|
|
23
|
+
<View gap="md">
|
|
24
|
+
<Text typography="h5">Variants</Text>
|
|
25
|
+
<View gap="sm">
|
|
26
|
+
<View gap="xs">
|
|
27
|
+
<Text typography="body2">Default</Text>
|
|
28
28
|
<List type="default">
|
|
29
29
|
<ListItem label="Item 1" />
|
|
30
30
|
<ListItem label="Item 2" />
|
|
31
31
|
<ListItem label="Item 3" />
|
|
32
32
|
</List>
|
|
33
33
|
</View>
|
|
34
|
-
<View
|
|
35
|
-
<Text
|
|
34
|
+
<View gap="xs">
|
|
35
|
+
<Text typography="body2">Bordered</Text>
|
|
36
36
|
<List type="bordered">
|
|
37
37
|
<ListItem label="Item 1" />
|
|
38
38
|
<ListItem label="Item 2" />
|
|
39
39
|
<ListItem label="Item 3" />
|
|
40
40
|
</List>
|
|
41
41
|
</View>
|
|
42
|
-
<View
|
|
43
|
-
<Text
|
|
42
|
+
<View gap="xs">
|
|
43
|
+
<Text typography="body2">Divided</Text>
|
|
44
44
|
<List type="divided">
|
|
45
45
|
<ListItem label="Item 1" />
|
|
46
46
|
<ListItem label="Item 2" />
|
|
@@ -50,9 +50,9 @@ export const ListExamples: React.FC = () => {
|
|
|
50
50
|
</View>
|
|
51
51
|
</View>
|
|
52
52
|
|
|
53
|
-
<View
|
|
54
|
-
<Text
|
|
55
|
-
<View
|
|
53
|
+
<View gap="md">
|
|
54
|
+
<Text typography="h5">Sizes</Text>
|
|
55
|
+
<View gap="sm">
|
|
56
56
|
<List type="bordered" size="sm">
|
|
57
57
|
<ListItem label="Small Item" />
|
|
58
58
|
<ListItem label="Small Item" />
|
|
@@ -68,8 +68,8 @@ export const ListExamples: React.FC = () => {
|
|
|
68
68
|
</View>
|
|
69
69
|
</View>
|
|
70
70
|
|
|
71
|
-
<View
|
|
72
|
-
<Text
|
|
71
|
+
<View gap="md">
|
|
72
|
+
<Text typography="h5">Clickable List</Text>
|
|
73
73
|
<List type="bordered">
|
|
74
74
|
<ListItem
|
|
75
75
|
label="Home"
|
|
@@ -87,13 +87,13 @@ export const ListExamples: React.FC = () => {
|
|
|
87
87
|
onPress={() => setSelectedItem('profile')}
|
|
88
88
|
/>
|
|
89
89
|
</List>
|
|
90
|
-
<Text
|
|
90
|
+
<Text typography="caption" color="secondary">
|
|
91
91
|
Selected: {selectedItem}
|
|
92
92
|
</Text>
|
|
93
93
|
</View>
|
|
94
94
|
|
|
95
|
-
<View
|
|
96
|
-
<Text
|
|
95
|
+
<View gap="md">
|
|
96
|
+
<Text typography="h5">With Leading Elements</Text>
|
|
97
97
|
<List type="divided">
|
|
98
98
|
<ListItem
|
|
99
99
|
label="Dashboard"
|
|
@@ -113,8 +113,8 @@ export const ListExamples: React.FC = () => {
|
|
|
113
113
|
</List>
|
|
114
114
|
</View>
|
|
115
115
|
|
|
116
|
-
<View
|
|
117
|
-
<Text
|
|
116
|
+
<View gap="md">
|
|
117
|
+
<Text typography="h5">With Trailing Elements</Text>
|
|
118
118
|
<List type="bordered">
|
|
119
119
|
<ListItem
|
|
120
120
|
label="Notifications"
|
|
@@ -129,13 +129,13 @@ export const ListExamples: React.FC = () => {
|
|
|
129
129
|
<ListItem
|
|
130
130
|
label="Updates"
|
|
131
131
|
leading="refresh"
|
|
132
|
-
trailing={<Text
|
|
132
|
+
trailing={<Text typography="caption" color="secondary">New</Text>}
|
|
133
133
|
/>
|
|
134
134
|
</List>
|
|
135
135
|
</View>
|
|
136
136
|
|
|
137
|
-
<View
|
|
138
|
-
<Text
|
|
137
|
+
<View gap="md">
|
|
138
|
+
<Text typography="h5">Navigation Sidebar</Text>
|
|
139
139
|
<List type="bordered">
|
|
140
140
|
<ListItem
|
|
141
141
|
label="Dashboard"
|
|
@@ -164,8 +164,8 @@ export const ListExamples: React.FC = () => {
|
|
|
164
164
|
</List>
|
|
165
165
|
</View>
|
|
166
166
|
|
|
167
|
-
<View
|
|
168
|
-
<Text
|
|
167
|
+
<View gap="md">
|
|
168
|
+
<Text typography="h5">With Sections</Text>
|
|
169
169
|
<List type="divided">
|
|
170
170
|
<ListSection title="Main">
|
|
171
171
|
<ListItem
|
|
@@ -206,8 +206,8 @@ export const ListExamples: React.FC = () => {
|
|
|
206
206
|
</List>
|
|
207
207
|
</View>
|
|
208
208
|
|
|
209
|
-
<View
|
|
210
|
-
<Text
|
|
209
|
+
<View gap="md">
|
|
210
|
+
<Text typography="h5">Indented Items</Text>
|
|
211
211
|
<List type="bordered">
|
|
212
212
|
<ListItem label="Parent Item 1" />
|
|
213
213
|
<ListItem label="Child Item 1.1" indent={1} />
|
|
@@ -218,8 +218,8 @@ export const ListExamples: React.FC = () => {
|
|
|
218
218
|
</List>
|
|
219
219
|
</View>
|
|
220
220
|
|
|
221
|
-
<View
|
|
222
|
-
<Text
|
|
221
|
+
<View gap="md">
|
|
222
|
+
<Text typography="h5">Disabled Items</Text>
|
|
223
223
|
<List type="bordered">
|
|
224
224
|
<ListItem
|
|
225
225
|
label="Enabled Item"
|
|
@@ -237,32 +237,32 @@ export const ListExamples: React.FC = () => {
|
|
|
237
237
|
</List>
|
|
238
238
|
</View>
|
|
239
239
|
|
|
240
|
-
<View
|
|
241
|
-
<Text
|
|
240
|
+
<View gap="md">
|
|
241
|
+
<Text typography="h5">Rich Content</Text>
|
|
242
242
|
<List type="bordered">
|
|
243
243
|
<ListItem
|
|
244
244
|
leading="account-circle"
|
|
245
|
-
trailing={<Text
|
|
245
|
+
trailing={<Text typography="caption" color="secondary">Admin</Text>}
|
|
246
246
|
>
|
|
247
|
-
<View>
|
|
247
|
+
<View gap="xl">
|
|
248
248
|
<Text weight="semibold">John Doe</Text>
|
|
249
|
-
<Text
|
|
249
|
+
<Text typography="caption" color="secondary">john.doe@example.com</Text>
|
|
250
250
|
</View>
|
|
251
251
|
</ListItem>
|
|
252
252
|
<ListItem
|
|
253
253
|
leading="account-circle"
|
|
254
|
-
trailing={<Text
|
|
254
|
+
trailing={<Text typography="caption" color="secondary">User</Text>}
|
|
255
255
|
>
|
|
256
|
-
<View>
|
|
256
|
+
<View gap="xl">
|
|
257
257
|
<Text weight="semibold">Jane Smith</Text>
|
|
258
|
-
<Text
|
|
258
|
+
<Text typography="caption" color="secondary">jane.smith@example.com</Text>
|
|
259
259
|
</View>
|
|
260
260
|
</ListItem>
|
|
261
261
|
</List>
|
|
262
262
|
</View>
|
|
263
263
|
|
|
264
|
-
<View
|
|
265
|
-
<Text
|
|
264
|
+
<View gap="md">
|
|
265
|
+
<Text typography="h5">Active States</Text>
|
|
266
266
|
<List type="bordered">
|
|
267
267
|
<ListItem
|
|
268
268
|
label="Normal Item"
|
|
@@ -49,17 +49,17 @@ export const MenuExamples: React.FC = () => {
|
|
|
49
49
|
|
|
50
50
|
return (
|
|
51
51
|
<Screen background="primary" padding="lg">
|
|
52
|
-
<View
|
|
53
|
-
<Text
|
|
52
|
+
<View gap="lg">
|
|
53
|
+
<Text typography="h3">Menu Examples</Text>
|
|
54
54
|
|
|
55
55
|
{selectedAction && (
|
|
56
|
-
<View
|
|
56
|
+
<View gap="sm" style={{ padding: 12, backgroundColor: '#f0f0f0', borderRadius: 8 }}>
|
|
57
57
|
<Text>Last selected action: <Text weight="bold">{selectedAction}</Text></Text>
|
|
58
58
|
</View>
|
|
59
59
|
)}
|
|
60
60
|
|
|
61
|
-
<View
|
|
62
|
-
<Text
|
|
61
|
+
<View gap="md">
|
|
62
|
+
<Text typography="h5">Basic Menu</Text>
|
|
63
63
|
<Menu
|
|
64
64
|
items={basicItems}
|
|
65
65
|
open={basicMenuOpen}
|
|
@@ -71,8 +71,8 @@ export const MenuExamples: React.FC = () => {
|
|
|
71
71
|
</Menu>
|
|
72
72
|
</View>
|
|
73
73
|
|
|
74
|
-
<View
|
|
75
|
-
<Text
|
|
74
|
+
<View gap="md">
|
|
75
|
+
<Text typography="h5">Placement Options</Text>
|
|
76
76
|
<Menu
|
|
77
77
|
items={basicItems}
|
|
78
78
|
open={placementMenuOpen}
|
|
@@ -85,8 +85,8 @@ export const MenuExamples: React.FC = () => {
|
|
|
85
85
|
</Menu>
|
|
86
86
|
</View>
|
|
87
87
|
|
|
88
|
-
<View
|
|
89
|
-
<Text
|
|
88
|
+
<View gap="md">
|
|
89
|
+
<Text typography="h5">With Icons</Text>
|
|
90
90
|
<Menu
|
|
91
91
|
items={iconNameItems}
|
|
92
92
|
open={iconNameMenuOpen}
|
|
@@ -98,8 +98,8 @@ export const MenuExamples: React.FC = () => {
|
|
|
98
98
|
</Menu>
|
|
99
99
|
</View>
|
|
100
100
|
|
|
101
|
-
<View
|
|
102
|
-
<Text
|
|
101
|
+
<View gap="md">
|
|
102
|
+
<Text typography="h5">Intent Colors</Text>
|
|
103
103
|
<Menu
|
|
104
104
|
items={intentItems}
|
|
105
105
|
open={intentMenuOpen}
|
|
@@ -111,8 +111,8 @@ export const MenuExamples: React.FC = () => {
|
|
|
111
111
|
</Menu>
|
|
112
112
|
</View>
|
|
113
113
|
|
|
114
|
-
<View
|
|
115
|
-
<Text
|
|
114
|
+
<View gap="md">
|
|
115
|
+
<Text typography="h5">With Separators</Text>
|
|
116
116
|
<Menu
|
|
117
117
|
items={separatorItems}
|
|
118
118
|
open={separatorMenuOpen}
|
|
@@ -124,8 +124,8 @@ export const MenuExamples: React.FC = () => {
|
|
|
124
124
|
</Menu>
|
|
125
125
|
</View>
|
|
126
126
|
|
|
127
|
-
<View
|
|
128
|
-
<Text
|
|
127
|
+
<View gap="md">
|
|
128
|
+
<Text typography="h5">Disabled Items</Text>
|
|
129
129
|
<Menu
|
|
130
130
|
items={disabledItems}
|
|
131
131
|
open={disabledMenuOpen}
|