@idealyst/components 1.2.29 → 1.2.31
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/README.md +3 -3
- package/package.json +4 -4
- package/plugin/__tests__/web.test.ts +2 -2
- package/plugin/web.js +2 -0
- package/src/Accordion/Accordion.native.tsx +3 -2
- package/src/ActivityIndicator/ActivityIndicator.native.tsx +4 -2
- package/src/ActivityIndicator/ActivityIndicator.styles.tsx +22 -27
- package/src/ActivityIndicator/ActivityIndicator.web.tsx +17 -29
- package/src/Alert/Alert.native.tsx +20 -10
- package/src/Alert/Alert.styles.tsx +173 -86
- package/src/Alert/Alert.web.tsx +34 -30
- package/src/Alert/types.ts +53 -3
- package/src/Avatar/Avatar.native.tsx +3 -2
- package/src/Avatar/Avatar.web.tsx +2 -1
- package/src/Avatar/types.ts +1 -1
- package/src/Badge/Badge.native.tsx +18 -6
- package/src/Badge/Badge.styles.tsx +22 -5
- package/src/Badge/Badge.web.tsx +12 -4
- package/src/Badge/types.ts +14 -2
- package/src/Breadcrumb/Breadcrumb.native.tsx +3 -2
- package/src/Button/Button.native.tsx +16 -6
- package/src/Button/Button.styles.tsx +2 -2
- package/src/Button/Button.web.tsx +19 -15
- package/src/Button/types.ts +6 -10
- package/src/Card/Card.native.tsx +27 -3
- package/src/Card/Card.web.tsx +30 -4
- package/src/Card/types.ts +15 -0
- package/src/Checkbox/Checkbox.native.tsx +5 -4
- package/src/Checkbox/Checkbox.styles.tsx +62 -52
- package/src/Checkbox/Checkbox.web.tsx +4 -3
- package/src/Checkbox/types.ts +1 -1
- package/src/Chip/Chip.native.tsx +30 -7
- package/src/Chip/Chip.web.tsx +28 -5
- package/src/Chip/types.ts +15 -0
- package/src/Dialog/Dialog.native.tsx +6 -6
- package/src/Dialog/Dialog.web.tsx +5 -5
- package/src/Dialog/types.ts +2 -2
- package/src/Divider/Divider.native.tsx +20 -17
- package/src/Divider/Divider.styles.tsx +51 -29
- package/src/Divider/Divider.web.tsx +5 -4
- package/src/Divider/types.ts +3 -3
- package/src/Icon/Icon.native.tsx +3 -2
- package/src/Icon/Icon.web.tsx +2 -1
- package/src/Icon/IconSvg/IconSvg.native.tsx +3 -2
- package/src/IconButton/IconButton.native.tsx +219 -0
- package/src/IconButton/IconButton.styles.tsx +127 -0
- package/src/IconButton/IconButton.web.tsx +198 -0
- package/src/IconButton/index.native.ts +5 -0
- package/src/IconButton/index.ts +5 -0
- package/src/IconButton/index.web.ts +5 -0
- package/src/IconButton/types.ts +84 -0
- package/src/Image/Image.native.tsx +3 -2
- package/src/Input/Input.native.tsx +42 -290
- package/src/Input/Input.styles.tsx +1 -1
- package/src/Input/Input.web.tsx +37 -288
- package/src/Input/index.native.ts +9 -2
- package/src/Input/index.ts +8 -1
- package/src/Input/index.web.ts +8 -1
- package/src/Input/types.ts +1 -1
- package/src/List/List.native.tsx +3 -2
- package/src/List/ListItem.native.tsx +3 -2
- package/src/List/ListSection.native.tsx +3 -2
- package/src/Menu/Menu.native.tsx +2 -1
- package/src/Menu/Menu.styles.tsx +79 -29
- package/src/Menu/Menu.web.tsx +2 -1
- package/src/Menu/MenuItem.native.tsx +4 -3
- package/src/Menu/MenuItem.styles.tsx +81 -32
- package/src/Menu/MenuItem.web.tsx +2 -1
- package/src/Menu/docs.ts +1 -1
- package/src/Popover/Popover.native.tsx +2 -1
- package/src/Popover/Popover.web.tsx +2 -1
- package/src/Popover/types.ts +15 -4
- package/src/Pressable/Pressable.native.tsx +3 -2
- package/src/Pressable/Pressable.web.tsx +3 -5
- package/src/Progress/Progress.native.tsx +5 -4
- package/src/Progress/Progress.web.tsx +3 -3
- package/src/Progress/types.ts +3 -3
- package/src/RadioButton/RadioButton.native.tsx +4 -3
- package/src/RadioButton/RadioButton.styles.tsx +53 -33
- package/src/RadioButton/RadioGroup.native.tsx +3 -2
- package/src/SVGImage/SVGImage.native.tsx +5 -4
- package/src/SVGImage/SVGImage.styles.tsx +44 -10
- package/src/SVGImage/SVGImage.web.tsx +2 -1
- package/src/Screen/Screen.native.tsx +2 -1
- package/src/Screen/Screen.web.tsx +2 -1
- package/src/Select/Select.native.tsx +6 -5
- package/src/Select/Select.styles.tsx +1 -1
- package/src/Select/Select.web.tsx +4 -3
- package/src/Select/types.ts +1 -1
- package/src/Skeleton/Skeleton.native.tsx +2 -1
- package/src/Skeleton/Skeleton.web.tsx +1 -1
- package/src/Slider/Slider.native.tsx +9 -8
- package/src/Slider/Slider.web.tsx +10 -9
- package/src/Slider/types.ts +9 -2
- package/src/Switch/Switch.native.tsx +7 -6
- package/src/Switch/Switch.styles.tsx +52 -17
- package/src/Switch/Switch.web.tsx +15 -16
- package/src/Switch/types.ts +44 -4
- package/src/TabBar/TabBar.native.tsx +3 -2
- package/src/Text/Text.native.tsx +3 -2
- package/src/Text/Text.web.tsx +2 -1
- package/src/TextArea/TextArea.native.tsx +3 -2
- package/src/TextArea/TextArea.styles.tsx +2 -2
- package/src/TextArea/TextArea.web.tsx +2 -1
- package/src/TextInput/TextInput.native.tsx +300 -0
- package/src/TextInput/TextInput.styles.tsx +207 -0
- package/src/TextInput/TextInput.web.tsx +301 -0
- package/src/TextInput/index.native.ts +3 -0
- package/src/TextInput/index.ts +5 -0
- package/src/TextInput/index.web.ts +5 -0
- package/src/TextInput/types.ts +163 -0
- package/src/Tooltip/Tooltip.native.tsx +3 -2
- package/src/Video/Video.native.tsx +4 -3
- package/src/View/View.native.tsx +2 -1
- package/src/View/View.styles.tsx +1 -0
- package/src/View/View.web.tsx +9 -2
- package/src/examples/ActivityIndicatorExamples.tsx +177 -0
- package/src/examples/AlertExamples.tsx +5 -5
- package/src/examples/ButtonExamples.tsx +12 -12
- package/src/examples/CardExamples.tsx +1 -1
- package/src/examples/CheckboxExamples.tsx +2 -2
- package/src/examples/ChipExamples.tsx +6 -6
- package/src/examples/DialogExamples.tsx +1 -1
- package/src/examples/DividerExamples.tsx +1 -1
- package/src/examples/InputExamples.tsx +1 -1
- package/src/examples/LinkExamples.tsx +1 -1
- package/src/examples/ListExamples.tsx +1 -1
- package/src/examples/MenuExamples.tsx +2 -2
- package/src/examples/ProgressExamples.tsx +1 -1
- package/src/examples/RadioButtonExamples.tsx +5 -5
- package/src/examples/SVGImageExamples.tsx +1 -1
- package/src/examples/SelectExamples.tsx +1 -1
- package/src/examples/SliderExamples.tsx +5 -5
- package/src/examples/SwitchExamples.tsx +26 -26
- package/src/examples/TableExamples.tsx +1 -1
- package/src/examples/TooltipExamples.tsx +2 -2
- package/src/examples/index.ts +1 -0
- package/src/extensions/index.ts +1 -0
- package/src/extensions/types.ts +22 -3
- package/src/index.native.ts +4 -0
- package/src/index.ts +27 -2
- package/src/utils/index.ts +12 -0
- package/src/utils/refTypes.ts +50 -0
|
@@ -3,6 +3,7 @@ import { View } from 'react-native';
|
|
|
3
3
|
import { videoStyles } from './Video.styles';
|
|
4
4
|
import type { VideoProps } from './types';
|
|
5
5
|
import { getNativeAccessibilityProps } from '../utils/accessibility';
|
|
6
|
+
import type { IdealystElement } from '../utils/refTypes';
|
|
6
7
|
|
|
7
8
|
// Import react-native-video - it's a peer dependency
|
|
8
9
|
let RNVideo: any;
|
|
@@ -14,7 +15,7 @@ try {
|
|
|
14
15
|
console.warn('react-native-video not installed. Video component will not work on native.');
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
const Video = React.forwardRef<
|
|
18
|
+
const Video = React.forwardRef<IdealystElement, VideoProps>(({
|
|
18
19
|
source,
|
|
19
20
|
poster,
|
|
20
21
|
width: _width,
|
|
@@ -52,7 +53,7 @@ const Video = React.forwardRef<View, VideoProps>(({
|
|
|
52
53
|
|
|
53
54
|
if (!RNVideo) {
|
|
54
55
|
return (
|
|
55
|
-
<View ref={ref} nativeID={id} style={[videoStyles.container, { aspectRatio, borderRadius }, style]} testID={testID} {...nativeA11yProps}>
|
|
56
|
+
<View ref={ref as any} nativeID={id} style={[videoStyles.container, { aspectRatio, borderRadius }, style]} testID={testID} {...nativeA11yProps}>
|
|
56
57
|
<View style={videoStyles.fallback}>
|
|
57
58
|
{/* Fallback when react-native-video is not installed */}
|
|
58
59
|
</View>
|
|
@@ -95,7 +96,7 @@ const Video = React.forwardRef<View, VideoProps>(({
|
|
|
95
96
|
};
|
|
96
97
|
|
|
97
98
|
return (
|
|
98
|
-
<View ref={ref} nativeID={id} style={containerStyle} testID={testID} {...nativeA11yProps}>
|
|
99
|
+
<View ref={ref as any} nativeID={id} style={containerStyle} testID={testID} {...nativeA11yProps}>
|
|
99
100
|
<RNVideo
|
|
100
101
|
source={videoSource}
|
|
101
102
|
poster={poster}
|
package/src/View/View.native.tsx
CHANGED
|
@@ -3,6 +3,7 @@ import { View as RNView, ScrollView as RNScrollView, ViewStyle, StyleSheet } fro
|
|
|
3
3
|
import { useResponsiveStyle, ResponsiveStyle } from '@idealyst/theme';
|
|
4
4
|
import { ViewProps } from './types';
|
|
5
5
|
import { viewStyles } from './View.styles';
|
|
6
|
+
import type { IdealystElement } from '../utils/refTypes';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Check if a style object contains any responsive values
|
|
@@ -22,7 +23,7 @@ function hasResponsiveValues(style: any): style is ResponsiveStyle {
|
|
|
22
23
|
return false;
|
|
23
24
|
}
|
|
24
25
|
|
|
25
|
-
const View = forwardRef<
|
|
26
|
+
const View = forwardRef<IdealystElement, ViewProps>(({
|
|
26
27
|
children,
|
|
27
28
|
background = 'transparent',
|
|
28
29
|
radius = 'none',
|
package/src/View/View.styles.tsx
CHANGED
package/src/View/View.web.tsx
CHANGED
|
@@ -3,12 +3,13 @@ import { getWebProps } from 'react-native-unistyles/web';
|
|
|
3
3
|
import { ViewProps } from './types';
|
|
4
4
|
import { viewStyles } from './View.styles';
|
|
5
5
|
import useMergeRefs from '../hooks/useMergeRefs';
|
|
6
|
+
import type { IdealystElement } from '../utils/refTypes';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Fundamental layout container with background, border, and spacing options.
|
|
9
10
|
* The base building block for composing UI layouts.
|
|
10
11
|
*/
|
|
11
|
-
const View = forwardRef<
|
|
12
|
+
const View = forwardRef<IdealystElement, ViewProps>(({
|
|
12
13
|
children,
|
|
13
14
|
background = 'transparent',
|
|
14
15
|
radius = 'none',
|
|
@@ -72,6 +73,9 @@ const View = forwardRef<HTMLDivElement, ViewProps>(({
|
|
|
72
73
|
flexShrink,
|
|
73
74
|
flexBasis,
|
|
74
75
|
alignSelf,
|
|
76
|
+
// Flex content alignment - goes to content (for aligning children)
|
|
77
|
+
alignItems,
|
|
78
|
+
justifyContent,
|
|
75
79
|
// Margin - goes to wrapper (positioning in parent)
|
|
76
80
|
margin,
|
|
77
81
|
marginTop,
|
|
@@ -123,6 +127,9 @@ const View = forwardRef<HTMLDivElement, ViewProps>(({
|
|
|
123
127
|
inset: 0,
|
|
124
128
|
overflow: 'auto',
|
|
125
129
|
boxSizing: 'border-box',
|
|
130
|
+
// Flex alignment for children
|
|
131
|
+
...(alignItems !== undefined && { alignItems }),
|
|
132
|
+
...(justifyContent !== undefined && { justifyContent }),
|
|
126
133
|
// User's visual styles
|
|
127
134
|
...contentStyles,
|
|
128
135
|
}}
|
|
@@ -138,8 +145,8 @@ const View = forwardRef<HTMLDivElement, ViewProps>(({
|
|
|
138
145
|
|
|
139
146
|
return (
|
|
140
147
|
<div
|
|
141
|
-
style={style as any}
|
|
142
148
|
{...webProps}
|
|
149
|
+
style={style as any}
|
|
143
150
|
ref={mergedRef}
|
|
144
151
|
id={id}
|
|
145
152
|
data-testid={testID}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Screen, View, Text, Button } from '@idealyst/components';
|
|
3
|
+
import ActivityIndicator from '../ActivityIndicator';
|
|
4
|
+
|
|
5
|
+
export const ActivityIndicatorExamples: React.FC = () => {
|
|
6
|
+
const [isAnimating, setIsAnimating] = useState(true);
|
|
7
|
+
|
|
8
|
+
return (
|
|
9
|
+
<Screen background="primary" padding="lg">
|
|
10
|
+
<View gap="lg">
|
|
11
|
+
<Text typography="h3">ActivityIndicator Examples</Text>
|
|
12
|
+
|
|
13
|
+
<View gap="md">
|
|
14
|
+
<Text typography="h5">Basic</Text>
|
|
15
|
+
<View gap="sm" style={{ flexDirection: 'row', alignItems: 'center', gap: 16 }}>
|
|
16
|
+
<ActivityIndicator />
|
|
17
|
+
</View>
|
|
18
|
+
</View>
|
|
19
|
+
|
|
20
|
+
<View gap="md">
|
|
21
|
+
<Text typography="h5">Sizes</Text>
|
|
22
|
+
<View gap="sm" style={{ flexDirection: 'row', alignItems: 'center', gap: 24 }}>
|
|
23
|
+
<View style={{ alignItems: 'center', gap: 8 }}>
|
|
24
|
+
<ActivityIndicator size="xs" />
|
|
25
|
+
<Text typography="caption">xs</Text>
|
|
26
|
+
</View>
|
|
27
|
+
<View style={{ alignItems: 'center', gap: 8 }}>
|
|
28
|
+
<ActivityIndicator size="sm" />
|
|
29
|
+
<Text typography="caption">sm</Text>
|
|
30
|
+
</View>
|
|
31
|
+
<View style={{ alignItems: 'center', gap: 8 }}>
|
|
32
|
+
<ActivityIndicator size="md" />
|
|
33
|
+
<Text typography="caption">md</Text>
|
|
34
|
+
</View>
|
|
35
|
+
<View style={{ alignItems: 'center', gap: 8 }}>
|
|
36
|
+
<ActivityIndicator size="lg" />
|
|
37
|
+
<Text typography="caption">lg</Text>
|
|
38
|
+
</View>
|
|
39
|
+
<View style={{ alignItems: 'center', gap: 8 }}>
|
|
40
|
+
<ActivityIndicator size="xl" />
|
|
41
|
+
<Text typography="caption">xl</Text>
|
|
42
|
+
</View>
|
|
43
|
+
</View>
|
|
44
|
+
</View>
|
|
45
|
+
|
|
46
|
+
<View gap="md">
|
|
47
|
+
<Text typography="h5">Intent Colors</Text>
|
|
48
|
+
<View gap="sm" style={{ flexDirection: 'row', alignItems: 'center', gap: 24 }}>
|
|
49
|
+
<View style={{ alignItems: 'center', gap: 8 }}>
|
|
50
|
+
<ActivityIndicator intent="primary" />
|
|
51
|
+
<Text typography="caption">primary</Text>
|
|
52
|
+
</View>
|
|
53
|
+
<View style={{ alignItems: 'center', gap: 8 }}>
|
|
54
|
+
<ActivityIndicator intent="success" />
|
|
55
|
+
<Text typography="caption">success</Text>
|
|
56
|
+
</View>
|
|
57
|
+
<View style={{ alignItems: 'center', gap: 8 }}>
|
|
58
|
+
<ActivityIndicator intent="warning" />
|
|
59
|
+
<Text typography="caption">warning</Text>
|
|
60
|
+
</View>
|
|
61
|
+
<View style={{ alignItems: 'center', gap: 8 }}>
|
|
62
|
+
<ActivityIndicator intent="danger" />
|
|
63
|
+
<Text typography="caption">danger</Text>
|
|
64
|
+
</View>
|
|
65
|
+
<View style={{ alignItems: 'center', gap: 8 }}>
|
|
66
|
+
<ActivityIndicator intent="neutral" />
|
|
67
|
+
<Text typography="caption">neutral</Text>
|
|
68
|
+
</View>
|
|
69
|
+
</View>
|
|
70
|
+
</View>
|
|
71
|
+
|
|
72
|
+
<View gap="md">
|
|
73
|
+
<Text typography="h5">Custom Color</Text>
|
|
74
|
+
<View gap="sm" style={{ flexDirection: 'row', alignItems: 'center', gap: 24 }}>
|
|
75
|
+
<ActivityIndicator color="#9333ea" />
|
|
76
|
+
<ActivityIndicator color="#ec4899" />
|
|
77
|
+
<ActivityIndicator color="#06b6d4" />
|
|
78
|
+
<ActivityIndicator color="#f97316" />
|
|
79
|
+
</View>
|
|
80
|
+
</View>
|
|
81
|
+
|
|
82
|
+
<View gap="md">
|
|
83
|
+
<Text typography="h5">Toggle Animation</Text>
|
|
84
|
+
<View gap="sm" style={{ flexDirection: 'row', alignItems: 'center', gap: 16 }}>
|
|
85
|
+
<ActivityIndicator animating={isAnimating} hidesWhenStopped={false} />
|
|
86
|
+
<Button size="sm" onPress={() => setIsAnimating(!isAnimating)}>
|
|
87
|
+
{isAnimating ? 'Stop' : 'Start'}
|
|
88
|
+
</Button>
|
|
89
|
+
</View>
|
|
90
|
+
<Text typography="caption" color="secondary">
|
|
91
|
+
hidesWhenStopped=false keeps the indicator visible when stopped
|
|
92
|
+
</Text>
|
|
93
|
+
</View>
|
|
94
|
+
|
|
95
|
+
<View gap="md">
|
|
96
|
+
<Text typography="h5">Hides When Stopped (default)</Text>
|
|
97
|
+
<View gap="sm" style={{ flexDirection: 'row', alignItems: 'center', gap: 16 }}>
|
|
98
|
+
<View style={{ width: 32, height: 32, alignItems: 'center', justifyContent: 'center' }}>
|
|
99
|
+
<ActivityIndicator animating={isAnimating} />
|
|
100
|
+
</View>
|
|
101
|
+
<Text typography="body2">
|
|
102
|
+
{isAnimating ? 'Visible (animating)' : 'Hidden (stopped)'}
|
|
103
|
+
</Text>
|
|
104
|
+
</View>
|
|
105
|
+
</View>
|
|
106
|
+
|
|
107
|
+
<View gap="md">
|
|
108
|
+
<Text typography="h5">Loading States</Text>
|
|
109
|
+
<View gap="sm">
|
|
110
|
+
<View
|
|
111
|
+
style={{
|
|
112
|
+
flexDirection: 'row',
|
|
113
|
+
alignItems: 'center',
|
|
114
|
+
gap: 12,
|
|
115
|
+
padding: 16,
|
|
116
|
+
backgroundColor: 'rgba(0,0,0,0.05)',
|
|
117
|
+
borderRadius: 8,
|
|
118
|
+
}}
|
|
119
|
+
>
|
|
120
|
+
<ActivityIndicator size="sm" />
|
|
121
|
+
<Text>Loading data...</Text>
|
|
122
|
+
</View>
|
|
123
|
+
<View
|
|
124
|
+
style={{
|
|
125
|
+
alignItems: 'center',
|
|
126
|
+
justifyContent: 'center',
|
|
127
|
+
padding: 32,
|
|
128
|
+
backgroundColor: 'rgba(0,0,0,0.05)',
|
|
129
|
+
borderRadius: 8,
|
|
130
|
+
}}
|
|
131
|
+
>
|
|
132
|
+
<ActivityIndicator size="lg" />
|
|
133
|
+
<Text typography="body2" color="secondary" style={{ marginTop: 12 }}>
|
|
134
|
+
Please wait...
|
|
135
|
+
</Text>
|
|
136
|
+
</View>
|
|
137
|
+
</View>
|
|
138
|
+
</View>
|
|
139
|
+
|
|
140
|
+
<View gap="md">
|
|
141
|
+
<Text typography="h5">Inline with Text</Text>
|
|
142
|
+
<View gap="sm">
|
|
143
|
+
<View style={{ flexDirection: 'row', alignItems: 'center', gap: 8 }}>
|
|
144
|
+
<Text>Saving</Text>
|
|
145
|
+
<ActivityIndicator size="xs" />
|
|
146
|
+
</View>
|
|
147
|
+
<View style={{ flexDirection: 'row', alignItems: 'center', gap: 8 }}>
|
|
148
|
+
<Text>Processing request</Text>
|
|
149
|
+
<ActivityIndicator size="sm" intent="success" />
|
|
150
|
+
</View>
|
|
151
|
+
</View>
|
|
152
|
+
</View>
|
|
153
|
+
|
|
154
|
+
<View gap="md">
|
|
155
|
+
<Text typography="h5">On Dark Background</Text>
|
|
156
|
+
<View
|
|
157
|
+
style={{
|
|
158
|
+
flexDirection: 'row',
|
|
159
|
+
alignItems: 'center',
|
|
160
|
+
gap: 24,
|
|
161
|
+
padding: 24,
|
|
162
|
+
backgroundColor: '#1f2937',
|
|
163
|
+
borderRadius: 8,
|
|
164
|
+
}}
|
|
165
|
+
>
|
|
166
|
+
<ActivityIndicator color="#ffffff" />
|
|
167
|
+
<ActivityIndicator color="#60a5fa" />
|
|
168
|
+
<ActivityIndicator color="#34d399" />
|
|
169
|
+
<ActivityIndicator color="#fbbf24" />
|
|
170
|
+
</View>
|
|
171
|
+
</View>
|
|
172
|
+
</View>
|
|
173
|
+
</Screen>
|
|
174
|
+
);
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
export default ActivityIndicatorExamples;
|
|
@@ -26,7 +26,7 @@ export const AlertExamples = () => {
|
|
|
26
26
|
/>
|
|
27
27
|
|
|
28
28
|
<Alert
|
|
29
|
-
intent="
|
|
29
|
+
intent="danger"
|
|
30
30
|
title="Error"
|
|
31
31
|
message="There was an error processing your request."
|
|
32
32
|
/>
|
|
@@ -139,7 +139,7 @@ export const AlertExamples = () => {
|
|
|
139
139
|
{errorVisible && (
|
|
140
140
|
<Alert
|
|
141
141
|
type="outlined"
|
|
142
|
-
intent="
|
|
142
|
+
intent="danger"
|
|
143
143
|
title="Dismissible Error"
|
|
144
144
|
message="This outlined alert can also be dismissed."
|
|
145
145
|
dismissible
|
|
@@ -234,7 +234,7 @@ export const AlertExamples = () => {
|
|
|
234
234
|
<Text typography="h5">All Intent Colors (Soft Variant)</Text>
|
|
235
235
|
|
|
236
236
|
<View gap="sm">
|
|
237
|
-
{(['primary', 'success', '
|
|
237
|
+
{(['primary', 'success', 'danger', 'warning', 'info', 'neutral'] as const).map((intent) => (
|
|
238
238
|
<Alert
|
|
239
239
|
key={intent}
|
|
240
240
|
type="soft"
|
|
@@ -249,7 +249,7 @@ export const AlertExamples = () => {
|
|
|
249
249
|
<Text typography="h5">All Intent Colors (Outlined Variant)</Text>
|
|
250
250
|
|
|
251
251
|
<View gap="sm">
|
|
252
|
-
{(['primary', 'success', '
|
|
252
|
+
{(['primary', 'success', 'danger', 'warning', 'info', 'neutral'] as const).map((intent) => (
|
|
253
253
|
<Alert
|
|
254
254
|
key={intent}
|
|
255
255
|
type="outlined"
|
|
@@ -264,7 +264,7 @@ export const AlertExamples = () => {
|
|
|
264
264
|
<Text typography="h5">All Intent Colors (Filled Variant)</Text>
|
|
265
265
|
|
|
266
266
|
<View gap="sm">
|
|
267
|
-
{(['primary', 'success', '
|
|
267
|
+
{(['primary', 'success', 'danger', 'warning', 'info', 'neutral'] as const).map((intent) => (
|
|
268
268
|
<Alert
|
|
269
269
|
key={intent}
|
|
270
270
|
type="filled"
|
|
@@ -117,12 +117,12 @@ export const ButtonExamples = () => {
|
|
|
117
117
|
>
|
|
118
118
|
Success
|
|
119
119
|
</Button>
|
|
120
|
-
<Button
|
|
121
|
-
intent="
|
|
120
|
+
<Button
|
|
121
|
+
intent="danger"
|
|
122
122
|
type="contained"
|
|
123
|
-
onPress={() => handlePress('
|
|
123
|
+
onPress={() => handlePress('danger')}
|
|
124
124
|
>
|
|
125
|
-
|
|
125
|
+
Danger
|
|
126
126
|
</Button>
|
|
127
127
|
<Button
|
|
128
128
|
intent="warning"
|
|
@@ -187,7 +187,7 @@ export const ButtonExamples = () => {
|
|
|
187
187
|
</Button>
|
|
188
188
|
<Button
|
|
189
189
|
type="contained"
|
|
190
|
-
intent="
|
|
190
|
+
intent="danger"
|
|
191
191
|
leftIcon="delete"
|
|
192
192
|
rightIcon="alert"
|
|
193
193
|
onPress={() => handlePress('icon-both')}
|
|
@@ -246,7 +246,7 @@ export const ButtonExamples = () => {
|
|
|
246
246
|
/>
|
|
247
247
|
<Button
|
|
248
248
|
type="text"
|
|
249
|
-
intent="
|
|
249
|
+
intent="danger"
|
|
250
250
|
leftIcon="close-circle"
|
|
251
251
|
onPress={() => handlePress('icon-only-text')}
|
|
252
252
|
/>
|
|
@@ -283,11 +283,11 @@ export const ButtonExamples = () => {
|
|
|
283
283
|
</Button>
|
|
284
284
|
<Button
|
|
285
285
|
type="contained"
|
|
286
|
-
intent="
|
|
286
|
+
intent="danger"
|
|
287
287
|
leftIcon="alert-circle"
|
|
288
|
-
onPress={() => handlePress('
|
|
288
|
+
onPress={() => handlePress('danger')}
|
|
289
289
|
>
|
|
290
|
-
|
|
290
|
+
Danger
|
|
291
291
|
</Button>
|
|
292
292
|
</View>
|
|
293
293
|
</View>
|
|
@@ -344,7 +344,7 @@ export const ButtonExamples = () => {
|
|
|
344
344
|
</Button>
|
|
345
345
|
<Button
|
|
346
346
|
type="contained"
|
|
347
|
-
intent="
|
|
347
|
+
intent="danger"
|
|
348
348
|
gradient="darken"
|
|
349
349
|
onPress={() => handlePress('gradient-error')}
|
|
350
350
|
>
|
|
@@ -394,7 +394,7 @@ export const ButtonExamples = () => {
|
|
|
394
394
|
</Button>
|
|
395
395
|
<Button
|
|
396
396
|
type="contained"
|
|
397
|
-
intent="
|
|
397
|
+
intent="danger"
|
|
398
398
|
gradient="darken"
|
|
399
399
|
leftIcon="delete"
|
|
400
400
|
onPress={() => handlePress('gradient-icon-delete')}
|
|
@@ -457,7 +457,7 @@ export const ButtonExamples = () => {
|
|
|
457
457
|
</Button>
|
|
458
458
|
<Button
|
|
459
459
|
type="contained"
|
|
460
|
-
intent="
|
|
460
|
+
intent="danger"
|
|
461
461
|
loading
|
|
462
462
|
onPress={() => handlePress('loading-error')}
|
|
463
463
|
>
|
|
@@ -85,7 +85,7 @@ export const CheckboxExamples = () => {
|
|
|
85
85
|
label="Success checkbox"
|
|
86
86
|
/>
|
|
87
87
|
<Checkbox
|
|
88
|
-
intent="
|
|
88
|
+
intent="danger"
|
|
89
89
|
checked={errorChecked}
|
|
90
90
|
onCheckedChange={setErrorChecked}
|
|
91
91
|
label="Error checkbox"
|
|
@@ -200,7 +200,7 @@ export const CheckboxExamples = () => {
|
|
|
200
200
|
onCheckedChange={() => {}}
|
|
201
201
|
label="Checkbox with error"
|
|
202
202
|
error="This field is required"
|
|
203
|
-
intent="
|
|
203
|
+
intent="danger"
|
|
204
204
|
/>
|
|
205
205
|
<Checkbox
|
|
206
206
|
checked={false}
|
|
@@ -31,7 +31,7 @@ export const ChipExamples = () => {
|
|
|
31
31
|
<Chip label="Default" />
|
|
32
32
|
<Chip label="Primary" intent="primary" />
|
|
33
33
|
<Chip label="Success" intent="success" />
|
|
34
|
-
<Chip label="Error" intent="
|
|
34
|
+
<Chip label="Error" intent="danger" />
|
|
35
35
|
<Chip label="Warning" intent="warning" />
|
|
36
36
|
<Chip label="Neutral" intent="neutral" />
|
|
37
37
|
</View>
|
|
@@ -43,21 +43,21 @@ export const ChipExamples = () => {
|
|
|
43
43
|
<View style={{ flexDirection: 'row', flexWrap: 'wrap', gap: 8 }}>
|
|
44
44
|
<Chip label="Filled Primary" type="filled" intent="primary" />
|
|
45
45
|
<Chip label="Filled Success" type="filled" intent="success" />
|
|
46
|
-
<Chip label="Filled Error" type="filled" intent="
|
|
46
|
+
<Chip label="Filled Error" type="filled" intent="danger" />
|
|
47
47
|
</View>
|
|
48
48
|
|
|
49
49
|
<Text typography="subtitle1">Outlined</Text>
|
|
50
50
|
<View style={{ flexDirection: 'row', flexWrap: 'wrap', gap: 8 }}>
|
|
51
51
|
<Chip label="Outlined Primary" type="outlined" intent="primary" />
|
|
52
52
|
<Chip label="Outlined Success" type="outlined" intent="success" />
|
|
53
|
-
<Chip label="Outlined Error" type="outlined" intent="
|
|
53
|
+
<Chip label="Outlined Error" type="outlined" intent="danger" />
|
|
54
54
|
</View>
|
|
55
55
|
|
|
56
56
|
<Text typography="subtitle1">Soft</Text>
|
|
57
57
|
<View style={{ flexDirection: 'row', flexWrap: 'wrap', gap: 8 }}>
|
|
58
58
|
<Chip label="Soft Primary" type="soft" intent="primary" />
|
|
59
59
|
<Chip label="Soft Success" type="soft" intent="success" />
|
|
60
|
-
<Chip label="Soft Error" type="soft" intent="
|
|
60
|
+
<Chip label="Soft Error" type="soft" intent="danger" />
|
|
61
61
|
</View>
|
|
62
62
|
|
|
63
63
|
<Divider spacing="md" />
|
|
@@ -74,7 +74,7 @@ export const ChipExamples = () => {
|
|
|
74
74
|
|
|
75
75
|
<View style={{ flexDirection: 'row', flexWrap: 'wrap', gap: 8 }}>
|
|
76
76
|
<Chip label="Star" icon="star" />
|
|
77
|
-
<Chip label="Heart" icon="heart" intent="
|
|
77
|
+
<Chip label="Heart" icon="heart" intent="danger" />
|
|
78
78
|
<Chip label="Check" icon="check" intent="success" />
|
|
79
79
|
<Chip label="Info" icon="information" type="outlined" />
|
|
80
80
|
</View>
|
|
@@ -188,7 +188,7 @@ export const ChipExamples = () => {
|
|
|
188
188
|
<Chip label="Design" type="soft" intent="primary" size="sm" />
|
|
189
189
|
<Chip label="Development" type="soft" intent="success" size="sm" />
|
|
190
190
|
<Chip label="Marketing" type="soft" intent="warning" size="sm" />
|
|
191
|
-
<Chip label="Sales" type="soft" intent="
|
|
191
|
+
<Chip label="Sales" type="soft" intent="danger" size="sm" />
|
|
192
192
|
<Chip label="Support" type="soft" intent="neutral" size="sm" />
|
|
193
193
|
</View>
|
|
194
194
|
</View>
|
|
@@ -221,7 +221,7 @@ export const InputExamples = () => {
|
|
|
221
221
|
<Text
|
|
222
222
|
id="password-helper"
|
|
223
223
|
typography="caption"
|
|
224
|
-
color={passwordValue.length > 0 && passwordValue.length < 8 ? '
|
|
224
|
+
color={passwordValue.length > 0 && passwordValue.length < 8 ? 'danger' : 'muted'}
|
|
225
225
|
>
|
|
226
226
|
{passwordValue.length > 0 && passwordValue.length < 8
|
|
227
227
|
? 'Password must be at least 8 characters'
|
|
@@ -96,7 +96,7 @@ export const LinkExamples = () => {
|
|
|
96
96
|
</Link>
|
|
97
97
|
<Link to="/favorites" onPress={() => handlePress('favorites')}>
|
|
98
98
|
<View style={{ flexDirection: 'row', alignItems: 'center', gap: 8 }}>
|
|
99
|
-
<Icon name="heart" size={20} intent="
|
|
99
|
+
<Icon name="heart" size={20} intent="danger" />
|
|
100
100
|
<Text color="primary">Favorites</Text>
|
|
101
101
|
</View>
|
|
102
102
|
</Link>
|
|
@@ -21,13 +21,13 @@ export const MenuExamples: React.FC = () => {
|
|
|
21
21
|
{ id: 'edit', label: 'Edit', icon: 'pencil', onClick: () => setSelectedAction('Edit') },
|
|
22
22
|
{ id: 'copy', label: 'Copy', icon: 'content-copy', onClick: () => setSelectedAction('Copy') },
|
|
23
23
|
{ id: 'share', label: 'Share', icon: 'share-variant', onClick: () => setSelectedAction('Share'), intent: 'primary' },
|
|
24
|
-
{ id: 'delete', label: 'Delete', icon: 'delete', onClick: () => setSelectedAction('Delete'), intent: '
|
|
24
|
+
{ id: 'delete', label: 'Delete', icon: 'delete', onClick: () => setSelectedAction('Delete'), intent: 'danger' },
|
|
25
25
|
];
|
|
26
26
|
|
|
27
27
|
const intentItems: MenuItem[] = [
|
|
28
28
|
{ id: 'save', label: 'Save', intent: 'success', onClick: () => setSelectedAction('Save') },
|
|
29
29
|
{ id: 'cancel', label: 'Cancel', intent: 'neutral', onClick: () => setSelectedAction('Cancel') },
|
|
30
|
-
{ id: 'delete', label: 'Delete', intent: '
|
|
30
|
+
{ id: 'delete', label: 'Delete', intent: 'danger', onClick: () => setSelectedAction('Delete') },
|
|
31
31
|
{ id: 'warn', label: 'Warning Action', intent: 'warning', onClick: () => setSelectedAction('Warning') },
|
|
32
32
|
];
|
|
33
33
|
|
|
@@ -43,7 +43,7 @@ export const ProgressExamples: React.FC = () => {
|
|
|
43
43
|
<Progress value={70} intent="primary" />
|
|
44
44
|
<Progress value={70} intent="success" />
|
|
45
45
|
<Progress value={70} intent="warning" />
|
|
46
|
-
<Progress value={70} intent="
|
|
46
|
+
<Progress value={70} intent="danger" />
|
|
47
47
|
<Progress value={70} intent="neutral" />
|
|
48
48
|
</View>
|
|
49
49
|
</View>
|
|
@@ -101,11 +101,11 @@ export const RadioButtonExamples: React.FC = () => {
|
|
|
101
101
|
onPress={() => setSelectedIntent('success')}
|
|
102
102
|
/>
|
|
103
103
|
<RadioButton
|
|
104
|
-
value="
|
|
105
|
-
label="
|
|
106
|
-
intent="
|
|
107
|
-
checked={selectedIntent === '
|
|
108
|
-
onPress={() => setSelectedIntent('
|
|
104
|
+
value="danger"
|
|
105
|
+
label="Danger"
|
|
106
|
+
intent="danger"
|
|
107
|
+
checked={selectedIntent === 'danger'}
|
|
108
|
+
onPress={() => setSelectedIntent('danger')}
|
|
109
109
|
/>
|
|
110
110
|
<RadioButton
|
|
111
111
|
value="warning"
|
|
@@ -16,7 +16,7 @@ export const SliderExamples: React.FC = () => {
|
|
|
16
16
|
<Text typography="h5">Basic Slider</Text>
|
|
17
17
|
<Slider
|
|
18
18
|
value={basicValue}
|
|
19
|
-
|
|
19
|
+
onChange={setBasicValue}
|
|
20
20
|
showValue
|
|
21
21
|
/>
|
|
22
22
|
<Text typography="caption" color="secondary">Value: {basicValue}</Text>
|
|
@@ -53,7 +53,7 @@ export const SliderExamples: React.FC = () => {
|
|
|
53
53
|
</View>
|
|
54
54
|
<View gap="xs">
|
|
55
55
|
<Text typography="body2">Error</Text>
|
|
56
|
-
<Slider defaultValue={60} intent="
|
|
56
|
+
<Slider defaultValue={60} intent="danger" />
|
|
57
57
|
</View>
|
|
58
58
|
<View gap="xs">
|
|
59
59
|
<Text typography="body2">Warning</Text>
|
|
@@ -122,7 +122,7 @@ export const SliderExamples: React.FC = () => {
|
|
|
122
122
|
<Text typography="h5">Volume Control</Text>
|
|
123
123
|
<Slider
|
|
124
124
|
value={volumeValue}
|
|
125
|
-
|
|
125
|
+
onChange={setVolumeValue}
|
|
126
126
|
min={0}
|
|
127
127
|
max={100}
|
|
128
128
|
showValue
|
|
@@ -163,7 +163,7 @@ export const SliderExamples: React.FC = () => {
|
|
|
163
163
|
min={10}
|
|
164
164
|
max={30}
|
|
165
165
|
icon="thermometer"
|
|
166
|
-
intent="
|
|
166
|
+
intent="danger"
|
|
167
167
|
showMinMax
|
|
168
168
|
/>
|
|
169
169
|
</View>
|
|
@@ -174,7 +174,7 @@ export const SliderExamples: React.FC = () => {
|
|
|
174
174
|
<Text typography="h5">Temperature Control</Text>
|
|
175
175
|
<Slider
|
|
176
176
|
value={temperatureValue}
|
|
177
|
-
|
|
177
|
+
onChange={setTemperatureValue}
|
|
178
178
|
min={10}
|
|
179
179
|
max={30}
|
|
180
180
|
step={0.5}
|