@app-studio/web 0.9.31 → 0.9.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/docs/components/Accordion.mdx +158 -0
  2. package/docs/components/Alert.mdx +123 -0
  3. package/docs/components/AspectRatio.mdx +55 -0
  4. package/docs/components/Avatar.mdx +85 -0
  5. package/docs/components/Background.mdx +522 -0
  6. package/docs/components/Badge.mdx +220 -0
  7. package/docs/components/Button.mdx +272 -0
  8. package/docs/components/Calendar.mdx +274 -0
  9. package/docs/components/Card.mdx +341 -0
  10. package/docs/components/Carousel.mdx +411 -0
  11. package/docs/components/Center.mdx +474 -0
  12. package/docs/components/Chart.mdx +232 -0
  13. package/docs/components/ChatInput.mdx +373 -0
  14. package/docs/components/Checkbox.mdx +66 -0
  15. package/docs/components/ColorInput.mdx +209 -0
  16. package/docs/components/ComboBox.mdx +364 -0
  17. package/docs/components/Command.mdx +252 -0
  18. package/docs/components/ContextMenu.mdx +219 -0
  19. package/docs/components/CountryPicker.mdx +123 -0
  20. package/docs/components/DatePicker.mdx +77 -0
  21. package/docs/components/DragAndDrop.mdx +539 -0
  22. package/docs/components/DropdownMenu.mdx +205 -0
  23. package/docs/components/File.mdx +8 -0
  24. package/docs/components/Flow.mdx +257 -0
  25. package/docs/components/Form.mdx +681 -0
  26. package/docs/components/Formik.mdx +621 -0
  27. package/docs/components/Gradient.mdx +271 -0
  28. package/docs/components/Horizontal.mdx +40 -0
  29. package/docs/components/HoverCard.mdx +140 -0
  30. package/docs/components/Icon.mdx +438 -0
  31. package/docs/components/Label.mdx +438 -0
  32. package/docs/components/Link.mdx +83 -0
  33. package/docs/components/Loader.mdx +527 -0
  34. package/docs/components/Menubar.mdx +124 -0
  35. package/docs/components/Message.mdx +571 -0
  36. package/docs/components/Modal.mdx +533 -0
  37. package/docs/components/NavigationMenu.mdx +165 -0
  38. package/docs/components/Pagination.mdx +150 -0
  39. package/docs/components/Password.mdx +121 -0
  40. package/docs/components/Resizable.mdx +148 -0
  41. package/docs/components/Select.mdx +126 -0
  42. package/docs/components/Separator.mdx +121 -0
  43. package/docs/components/Sidebar.mdx +147 -0
  44. package/docs/components/Slider.mdx +232 -0
  45. package/docs/components/Switch.mdx +62 -0
  46. package/docs/components/Table.mdx +409 -0
  47. package/docs/components/Tabs.mdx +215 -0
  48. package/docs/components/TagInput.mdx +528 -0
  49. package/docs/components/Text.mdx +163 -0
  50. package/docs/components/TextArea.mdx +136 -0
  51. package/docs/components/TextField.mdx +225 -0
  52. package/docs/components/Title.mdx +535 -0
  53. package/docs/components/Toast.mdx +165 -0
  54. package/docs/components/Toggle.mdx +141 -0
  55. package/docs/components/ToggleGroup.mdx +165 -0
  56. package/docs/components/Tooltip.mdx +191 -0
  57. package/docs/components/Tree.mdx +340 -0
  58. package/docs/components/Uploader.mdx +426 -0
  59. package/docs/components/Vertical.mdx +566 -0
  60. package/docs/components.md +285 -0
  61. package/package.json +1 -1
@@ -0,0 +1,220 @@
1
+ # Badge
2
+
3
+ Displays a visual badge for labeling or highlighting items
4
+
5
+ ### **Import**
6
+ ```tsx
7
+ import { Badge } from '@app-studio/web';
8
+ ```
9
+
10
+ ### **Default**
11
+ ```tsx
12
+ import React from 'react';
13
+ import { Badge } from '../Badge';
14
+
15
+ export const DefaultDemo = () => <Badge content="default" />;
16
+
17
+ ```
18
+
19
+ ### **content**
20
+ The content displayed in the Badge component.
21
+
22
+ ```tsx
23
+ import React from 'react';
24
+ import { Badge } from '../Badge';
25
+
26
+ export const ContentDemo = () => <Badge content="content" />;
27
+
28
+ ```
29
+
30
+ ### **variant**
31
+ Determines the Badge's style variant.
32
+
33
+ ```tsx
34
+ import React from 'react';
35
+ import { Vertical } from 'app-studio';
36
+
37
+ import { Badge } from '../Badge';
38
+ import { Variant } from '../Badge/Badge.type';
39
+ import { View } from 'app-studio';
40
+ export const VariantDemo = () => (
41
+ <Vertical gap={15}>
42
+ {['filled', 'outline', 'link', 'ghost'].map((variant, index) => (
43
+ <View position={'relative'} key={index}>
44
+ <Badge
45
+ content={variant}
46
+ variant={variant as Variant}
47
+ colorScheme="theme.primary"
48
+ />
49
+ </View>
50
+ ))}
51
+ </Vertical>
52
+ );
53
+
54
+ ```
55
+
56
+ ### **colorScheme**
57
+ Specifies a custom color scheme for the Badge.
58
+
59
+ ```tsx
60
+ import React from 'react';
61
+ import { Badge } from '../Badge';
62
+ import { Horizontal } from 'app-studio';
63
+
64
+ export const ColorSchemeDemo = () => (
65
+ <Horizontal gap={10}>
66
+ {[
67
+ 'theme.primary',
68
+ 'theme.secondary',
69
+ 'theme.warning',
70
+ 'theme.success',
71
+ 'theme.error',
72
+ ].map((color, index) => (
73
+ <Badge key={index} colorScheme={color} isAuto content={color} />
74
+ ))}
75
+ </Horizontal>
76
+ );
77
+
78
+ ```
79
+
80
+ ### **position**
81
+ Defines the position of the Badge relative to its container.
82
+
83
+ ```tsx
84
+ import React from 'react';
85
+ import { Badge } from '../Badge';
86
+ import { View } from 'app-studio';
87
+ import { Horizontal } from 'app-studio';
88
+ import { Position } from '../Badge/Badge.type';
89
+
90
+ export const PositionDemo = () => (
91
+ <Horizontal gap={10}>
92
+ {['top-right', 'top-left', 'bottom-right', 'bottom-left'].map(
93
+ (position, index) => (
94
+ <View
95
+ key={index}
96
+ position="relative"
97
+ height="100px"
98
+ width="200px"
99
+ backgroundColor="#F2EFE5"
100
+ >
101
+ <Badge position={position as Position} content={position} />
102
+ </View>
103
+ )
104
+ )}
105
+ </Horizontal>
106
+ );
107
+
108
+ ```
109
+
110
+ ### **size**
111
+ Determines the size of the Badge.
112
+
113
+ ```tsx
114
+ import React from 'react';
115
+ import { Vertical } from 'app-studio';
116
+
117
+ import { Badge } from '../Badge';
118
+ import { Size } from '../Badge/Badge.type';
119
+ import { View } from 'app-studio';
120
+ export const SizeDemo = () => (
121
+ <Vertical gap={10}>
122
+ {['xs', 'sm', 'md', 'lg', 'xl'].map((size, index) => (
123
+ <View position="relative" key={index}>
124
+ <Badge content={size} size={size as Size} />
125
+ </View>
126
+ ))}
127
+ </Vertical>
128
+ );
129
+
130
+ ```
131
+
132
+ ### **shape**
133
+ Specifies the shape of the Badge.
134
+
135
+ ```tsx
136
+ import React from 'react';
137
+ import { Horizontal } from 'app-studio';
138
+ import { Badge } from '../Badge';
139
+ import { Shape } from '../Badge/Badge.type';
140
+ import { View } from 'app-studio';
141
+ export const ShapeDemo = () => (
142
+ <Horizontal gap={15}>
143
+ {['sharp', 'rounded', 'pillShaped'].map((border, index) => (
144
+ <View position="relative" key={index}>
145
+ <Badge content={border} shape={border as Shape} />
146
+ </View>
147
+ ))}
148
+ </Horizontal>
149
+ );
150
+
151
+ ```
152
+
153
+ ### **styles**
154
+ Custom styling that overrides default views.
155
+
156
+ ```tsx
157
+ import React from 'react';
158
+ import { Badge } from '../Badge';
159
+
160
+ export const StylesDemo = () => {
161
+ return (
162
+ <Badge
163
+ content="styles"
164
+ views={{
165
+ container: {
166
+ backgroundColor: 'transparent',
167
+ },
168
+ text: {
169
+ color: 'purple',
170
+ },
171
+ }}
172
+ />
173
+ );
174
+ };
175
+
176
+ ```
177
+
178
+ ### **Theme Mode Support**
179
+ The Badge component supports both light and dark themes through the `themeMode` prop.
180
+
181
+ ```tsx
182
+ import React from 'react';
183
+ import { Badge } from '../Badge';
184
+ import { Vertical, Horizontal } from 'app-studio';
185
+ import { Text } from '../../Text/Text';
186
+ import { Variant } from '../Badge/Badge.type';
187
+
188
+ export const DarkModeDemo = () => {
189
+ const variants: Variant[] = ['filled', 'outline', 'link', 'ghost'];
190
+
191
+ return (
192
+ <Vertical gap={24}>
193
+ <Text fontSize={20} fontWeight="bold">Light Mode Badges</Text>
194
+ <Horizontal gap={16} alignItems="center">
195
+ {variants.map((variant) => (
196
+ <Badge
197
+ key={variant}
198
+ content={variant}
199
+ variant={variant}
200
+ themeMode="light"
201
+ />
202
+ ))}
203
+ </Horizontal>
204
+
205
+ <Text fontSize={20} fontWeight="bold" marginTop={40}>Dark Mode Badges</Text>
206
+ <Horizontal gap={16} alignItems="center">
207
+ {variants.map((variant) => (
208
+ <Badge
209
+ key={variant}
210
+ content={variant}
211
+ variant={variant}
212
+ themeMode="dark"
213
+ />
214
+ ))}
215
+ </Horizontal>
216
+ </Vertical>
217
+ );
218
+ };
219
+ ```
220
+
@@ -0,0 +1,272 @@
1
+ # Button
2
+
3
+ Customizable button for user interaction
4
+
5
+ ### **Import**
6
+ ```tsx
7
+ import { Button } from '@app-studio/web';
8
+ ```
9
+
10
+ ### **Default**
11
+ ```tsx
12
+ import React from 'react';
13
+ import { Button } from '../Button';
14
+
15
+ export const DefaultButton = () => (
16
+ <Button onClick={() => alert('Hello, World!')}>Default</Button>
17
+ );
18
+
19
+ ```
20
+
21
+ ### **colorScheme**
22
+ Optional string to define the color scheme of the button.
23
+
24
+ ```tsx
25
+ import React from 'react';
26
+ import { Button } from '../Button';
27
+ import { Horizontal } from 'app-studio';
28
+
29
+ export const ColoredButtons = () => (
30
+ <Horizontal gap={10}>
31
+ {[
32
+ 'theme.primary',
33
+ 'theme.secondary',
34
+ 'theme.warning',
35
+ 'theme.success',
36
+ 'theme.error',
37
+ ].map((color, index) => (
38
+ <Button key={index} colorScheme={color} isAuto>
39
+ {color}
40
+ </Button>
41
+ ))}
42
+ </Horizontal>
43
+ );
44
+
45
+ ```
46
+
47
+ ### **loaderProps**
48
+ Optional LoaderProps object to configure the appearance and behavior of the loader animation.
49
+
50
+ ```tsx
51
+ import React from 'react';
52
+ import { Button } from '../Button';
53
+ import { Vertical } from 'app-studio';
54
+
55
+ export const LoaderButtons = () => (
56
+ <Vertical gap={15}>
57
+ <Button isLoading isFilled>
58
+ Submitting
59
+ </Button>
60
+ <Button
61
+ isLoading
62
+ loaderProps={{
63
+ type: 'dotted',
64
+ views: {
65
+ loader: { color: 'color.white' },
66
+ text: {
67
+ color: 'color.black',
68
+ },
69
+ },
70
+ }}
71
+ isFilled
72
+ >
73
+ Submitting
74
+ </Button>
75
+ <Button
76
+ isLoading
77
+ loaderPosition="right"
78
+ loaderProps={{
79
+ type: 'quarter',
80
+ views: {
81
+ loader: { color: 'color.black' },
82
+ text: { color: 'color.black' },
83
+ },
84
+ }}
85
+ isFilled
86
+ >
87
+ Submitting
88
+ </Button>
89
+ </Vertical>
90
+ );
91
+
92
+ ```
93
+
94
+ ### **icon**
95
+ Optional React node(s) defining the icon to be displayed within the button.
96
+
97
+ ```tsx
98
+ import React from 'react';
99
+ import { Button } from '../Button';
100
+ import { Center } from 'app-studio';
101
+
102
+ import { DustBinIcon } from '../../Icon/Icon';
103
+
104
+ import { Shape } from '../Button/Button.type';
105
+
106
+ export const IconButtons = () => (
107
+ <Center gap={15}>
108
+ <Button icon={<DustBinIcon size={16} />} height={48}>
109
+ Delete
110
+ </Button>
111
+ <Button
112
+ height={48}
113
+ icon={<DustBinIcon size={16} />}
114
+ shape={'pillShaped' as Shape}
115
+ iconPosition="right"
116
+ colorScheme="theme.secondary"
117
+ >
118
+ Delete
119
+ </Button>
120
+ <Button
121
+ icon={<DustBinIcon size={16} />}
122
+ colorScheme="theme.primary"
123
+ isIconRounded
124
+ isAuto
125
+ />
126
+ </Center>
127
+ );
128
+
129
+ ```
130
+
131
+ ### **isDisabled**
132
+ Optional boolean to indicate if the button is non-interactive/disabled.
133
+
134
+ ```tsx
135
+ import React from 'react';
136
+ import { Button } from '../Button';
137
+
138
+ export const DisabledButton = () => (
139
+ <Button
140
+ onClick={() => {
141
+ alert('Disabled');
142
+ }}
143
+ isDisabled
144
+ >
145
+ Disabled
146
+ </Button>
147
+ );
148
+
149
+ ```
150
+
151
+ ### **isAuto**
152
+ Optional boolean indicating if the button size should automatically adjust to its content.
153
+
154
+ ```tsx
155
+ import React from 'react';
156
+ import { Button } from '../Button';
157
+ import { Horizontal } from 'app-studio';
158
+
159
+ import { Shape } from '../Button/Button.type';
160
+
161
+ export const BorderedButtons = () => (
162
+ <Horizontal gap={15}>
163
+ {['sharp', 'rounded', 'pillShaped'].map((border, index) => (
164
+ <Button key={index} shape={border as Shape} isAuto>
165
+ {border}
166
+ </Button>
167
+ ))}
168
+ </Horizontal>
169
+ );
170
+
171
+ ```
172
+
173
+ ### **size**
174
+ Optional Size to specify the size of the button.
175
+
176
+ ```tsx
177
+ import React from 'react';
178
+ import { Button } from '../Button';
179
+ import { Vertical } from 'app-studio';
180
+
181
+ import { Size } from '../Button/Button.type';
182
+
183
+ export const ButtonSizes = () => (
184
+ <Vertical gap={10}>
185
+ {['xs', 'sm', 'md', 'lg', 'xl'].map((size, index) => (
186
+ <Button key={index} size={size as Size}>
187
+ Button
188
+ </Button>
189
+ ))}
190
+ </Vertical>
191
+ );
192
+
193
+ ```
194
+
195
+ ### **shadow**
196
+ Optional shadow property that can be a predefined Shadow, Elevation value or custom CSSProperties to apply shadow effects to the button.
197
+
198
+ ```tsx
199
+ import React from 'react';
200
+ import { Button } from '../Button';
201
+
202
+ export const ShadowButton = () => (
203
+ <Button shadow={{ boxShadow: 'rgb(249, 115, 22) 0px 4px 14px 0px' }}>
204
+ Click Me
205
+ </Button>
206
+ );
207
+
208
+ ```
209
+
210
+ ### **variant**
211
+ Optional Variant to define the stylistic variation of the button.
212
+
213
+ ```tsx
214
+ import React from 'react';
215
+ import { Button } from '../Button';
216
+ import { Vertical } from 'app-studio';
217
+
218
+ import { Variant } from '../Button/Button.type';
219
+
220
+ export const VariantButtons = () => (
221
+ <Vertical gap={15}>
222
+ {['filled', 'outline', 'link', 'ghost'].map((variant, index) => (
223
+ <Button
224
+ key={index}
225
+ to="https://www.npmjs.com/package/app-studio"
226
+ variant={variant as Variant}
227
+ colorScheme="theme.primary"
228
+ isFilled
229
+ >
230
+ {variant}
231
+ </Button>
232
+ ))}
233
+ {['filled', 'outline', 'link', 'ghost'].map((variant, index) => (
234
+ <Button
235
+ key={index}
236
+ to="https://www.npmjs.com/package/app-studio"
237
+ variant={variant as Variant}
238
+ isFilled
239
+ >
240
+ {variant}
241
+ </Button>
242
+ ))}
243
+ </Vertical>
244
+ );
245
+
246
+ ```
247
+
248
+ ### **effect**
249
+ Optional effect to apply interactive effects (e.g., ripple) to the button.
250
+
251
+ ```tsx
252
+ import React from 'react';
253
+ import { Button } from '../../Button/Button';
254
+ import { Horizontal } from 'app-studio';
255
+
256
+ export const EffectButton = () => (
257
+ <Horizontal gap={10}>
258
+ <Button effect="hover">Hover</Button>
259
+ <Button colorScheme="theme.error" variant="ghost" effect="hover">
260
+ Hover
261
+ </Button>
262
+ <Button colorScheme="theme.secondary" variant="outline" effect="reverse">
263
+ Reverse
264
+ </Button>
265
+ <Button colorScheme="theme.warning" variant="link" effect="reverse">
266
+ Reverse
267
+ </Button>
268
+ </Horizontal>
269
+ );
270
+
271
+ ```
272
+