@app-studio/web 0.9.31 → 0.9.32

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 (60) 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/package.json +1 -1
@@ -0,0 +1,219 @@
1
+ # ContextMenu
2
+
3
+ A context menu component that appears when right-clicking on an element.
4
+
5
+ ### **Import**
6
+ ```tsx
7
+ import { ContextMenu } from '@app-studio/web';
8
+ ```
9
+
10
+ ### **Default**
11
+ ```tsx
12
+ import React from 'react';
13
+ import { ContextMenu } from '../ContextMenu';
14
+ import { View, Text } from 'app-studio';
15
+ import { CopyIcon, EditIcon, DeleteIcon } from '../../Icon/Icon';
16
+
17
+ export const DefaultContextMenu = () => {
18
+ const items = [
19
+ {
20
+ id: 'copy',
21
+ label: 'Copy',
22
+ icon: <CopyIcon widthHeight={16} />,
23
+ onClick: () => alert('Copy clicked')
24
+ },
25
+ {
26
+ id: 'edit',
27
+ label: 'Edit',
28
+ icon: <EditIcon widthHeight={16} />,
29
+ onClick: () => alert('Edit clicked')
30
+ },
31
+ {
32
+ id: 'divider-1',
33
+ divider: true
34
+ },
35
+ {
36
+ id: 'delete',
37
+ label: 'Delete',
38
+ icon: <DeleteIcon widthHeight={16} />,
39
+ onClick: () => alert('Delete clicked')
40
+ }
41
+ ];
42
+
43
+ return (
44
+ <ContextMenu items={items}>
45
+ <View
46
+ padding={20}
47
+ backgroundColor="color.gray.100"
48
+ borderRadius={8}
49
+ textAlign="center"
50
+ cursor="context-menu"
51
+ >
52
+ <Text>Right-click here to open the context menu</Text>
53
+ </View>
54
+ </ContextMenu>
55
+ );
56
+ };
57
+ ```
58
+
59
+ ### **Submenu**
60
+ Create nested context menus with submenus.
61
+
62
+ ```tsx
63
+ import React from 'react';
64
+ import { ContextMenu } from '../ContextMenu';
65
+ import { View, Text } from 'app-studio';
66
+ import {
67
+ CopyIcon,
68
+ EditIcon,
69
+ DownloadIcon,
70
+ ShareIcon
71
+ } from '../../Icon/Icon';
72
+
73
+ export const SubmenuContextMenu = () => {
74
+ const items = [
75
+ {
76
+ id: 'copy',
77
+ label: 'Copy',
78
+ icon: <CopyIcon widthHeight={16} />,
79
+ onClick: () => alert('Copy clicked')
80
+ },
81
+ {
82
+ id: 'edit',
83
+ label: 'Edit',
84
+ icon: <EditIcon widthHeight={16} />,
85
+ onClick: () => alert('Edit clicked')
86
+ },
87
+ {
88
+ id: 'more',
89
+ label: 'More Options',
90
+ items: [
91
+ {
92
+ id: 'download',
93
+ label: 'Download',
94
+ icon: <DownloadIcon widthHeight={16} />,
95
+ onClick: () => alert('Download clicked')
96
+ },
97
+ {
98
+ id: 'share',
99
+ label: 'Share',
100
+ icon: <ShareIcon widthHeight={16} />,
101
+ onClick: () => alert('Share clicked')
102
+ }
103
+ ]
104
+ }
105
+ ];
106
+
107
+ return (
108
+ <ContextMenu items={items}>
109
+ <View
110
+ padding={20}
111
+ backgroundColor="color.gray.100"
112
+ borderRadius={8}
113
+ textAlign="center"
114
+ cursor="context-menu"
115
+ >
116
+ <Text>Right-click here to open the context menu with submenu</Text>
117
+ </View>
118
+ </ContextMenu>
119
+ );
120
+ };
121
+ ```
122
+
123
+ ### **Variants**
124
+ Different visual styles for the context menu.
125
+
126
+ ```tsx
127
+ import React from 'react';
128
+ import { ContextMenu } from '../ContextMenu';
129
+ import { View, Text } from 'app-studio';
130
+ import { CopyIcon, EditIcon } from '../../Icon/Icon';
131
+
132
+ export const ContextMenuVariants = () => {
133
+ const items = [
134
+ {
135
+ id: 'copy',
136
+ label: 'Copy',
137
+ icon: <CopyIcon widthHeight={16} />,
138
+ onClick: () => alert('Copy clicked')
139
+ },
140
+ {
141
+ id: 'edit',
142
+ label: 'Edit',
143
+ icon: <EditIcon widthHeight={16} />,
144
+ onClick: () => alert('Edit clicked')
145
+ }
146
+ ];
147
+
148
+ return (
149
+ <>
150
+ <ContextMenu items={items} variant="default">
151
+ <Text>Default Variant</Text>
152
+ </ContextMenu>
153
+
154
+ <ContextMenu items={items} variant="filled">
155
+ <Text>Filled Variant</Text>
156
+ </ContextMenu>
157
+
158
+ <ContextMenu items={items} variant="outline">
159
+ <Text>Outline Variant</Text>
160
+ </ContextMenu>
161
+ </>
162
+ );
163
+ };
164
+ ```
165
+
166
+ ### **Custom Styling**
167
+ Customize the appearance of the context menu.
168
+
169
+ ```tsx
170
+ import React from 'react';
171
+ import { ContextMenu } from '../ContextMenu';
172
+ import { View, Text } from 'app-studio';
173
+ import { CopyIcon, EditIcon } from '../../Icon/Icon';
174
+
175
+ export const CustomContextMenu = () => {
176
+ const items = [
177
+ {
178
+ id: 'copy',
179
+ label: 'Copy',
180
+ icon: <CopyIcon widthHeight={16} />,
181
+ onClick: () => alert('Copy clicked')
182
+ },
183
+ {
184
+ id: 'edit',
185
+ label: 'Edit',
186
+ icon: <EditIcon widthHeight={16} />,
187
+ onClick: () => alert('Edit clicked')
188
+ }
189
+ ];
190
+
191
+ return (
192
+ <ContextMenu
193
+ items={items}
194
+ views={{
195
+ menu: {
196
+ backgroundColor: 'color.blue',
197
+ color: 'color.white',
198
+ borderRadius: '8px',
199
+ },
200
+ item: {
201
+ _hover: {
202
+ backgroundColor: 'rgba(255, 255, 255, 0.1)',
203
+ }
204
+ }
205
+ }}
206
+ >
207
+ <View
208
+ padding={20}
209
+ backgroundColor="color.blue.100"
210
+ borderRadius={8}
211
+ textAlign="center"
212
+ cursor="context-menu"
213
+ >
214
+ <Text>Right-click here for custom styled menu</Text>
215
+ </View>
216
+ </ContextMenu>
217
+ );
218
+ };
219
+ ```
@@ -0,0 +1,123 @@
1
+ # CountryPicker
2
+
3
+ Enables users to select a country from a dropdown list with various styling options.
4
+
5
+ ### **Import**
6
+ ```tsx
7
+ import { CountryPicker } from '@app-studio/web';
8
+ ```
9
+
10
+ ### **Default**
11
+ ```tsx
12
+ import React from 'react';
13
+ import { CountryPicker } from '../../../Form/CountryPicker/CountryPicker';
14
+
15
+ export const DefaultCountryPicker = () => <CountryPicker label="Country" />;
16
+
17
+ ```
18
+
19
+ ### **error**
20
+ Optional error flag to indicate validation state
21
+
22
+ ```tsx
23
+ import React from 'react';
24
+ import { CountryPicker } from '../../../Form/CountryPicker/CountryPicker';
25
+
26
+ export const ErrorCountryPicker = () => (
27
+ <CountryPicker id="error" label="Country" error />
28
+ );
29
+
30
+ ```
31
+
32
+ ### **helperText**
33
+ Optional helper text for guiding the user
34
+
35
+ ```tsx
36
+ import React from 'react';
37
+
38
+ import { CountryPicker } from '../CountryPicker';
39
+
40
+ export const HelperTextCountryPicker = () => (
41
+ <CountryPicker helperText="CountryPicker one item!" error />
42
+ );
43
+
44
+ ```
45
+
46
+ ## Props
47
+
48
+ | Prop | Type | Description | Default |
49
+ | ----------- | ------------- | ------------------------------------------------------------------------ | ------- |
50
+ | label | string | The label text for the country picker. | |
51
+ | error | boolean | Flag to indicate validation state. | false |
52
+ | helperText | string | Helper text for guiding the user. | |
53
+ | shape | Shape | Shape of the CountryPicker for visual views. | |
54
+ | variant | Variant | Variant for different visual types of CountryPicker. | |
55
+ | shadow | Shadow/Elevation | Shadow or Elevation styles for visual depth and perspective. | |
56
+ | styles | CSSProperties | Optional custom styles for the CountryPicker (container, input, label). | |
57
+ | className | string | Optional className for the CountryPicker container. | |
58
+ | placeholder | string | Placeholder text when no country is selected. | |
59
+
60
+ ### **shape**
61
+ Optional shape of the CountryPicker for visual styles
62
+
63
+ ```tsx
64
+ import React from 'react';
65
+ import { CountryPicker } from '../../../Form/CountryPicker/CountryPicker';
66
+
67
+ import { Vertical } from 'app-studio';
68
+
69
+ import { Shape } from '../CountryPicker/CountryPicker.type';
70
+
71
+ export const ShapeCountryPicker = () => (
72
+ <Vertical gap={10}>
73
+ {['default', 'sharp', 'rounded', 'pillShaped'].map((shape) => (
74
+ <CountryPicker
75
+ key={shape}
76
+ label={shape}
77
+ shape={shape as Shape}
78
+ placeholder="Select a country..."
79
+ />
80
+ ))}
81
+ </Vertical>
82
+ );
83
+
84
+ ```
85
+
86
+ ### **variant**
87
+ Variant for different visual types of CountryPicker
88
+
89
+ ```tsx
90
+ import React from 'react';
91
+ import { CountryPicker } from '../../../Form/CountryPicker/CountryPicker';
92
+
93
+ import { Vertical } from 'app-studio';
94
+
95
+ import { Variant } from '../CountryPicker/CountryPicker.type';
96
+
97
+ export const VariantCountryPicker = () => (
98
+ <Vertical gap={10}>
99
+ {['outline', 'default', 'none'].map((variant) => (
100
+ <CountryPicker
101
+ key={variant}
102
+ variant={variant as Variant}
103
+ label={variant}
104
+ placeholder="Select a country..."
105
+ />
106
+ ))}
107
+ </Vertical>
108
+ );
109
+
110
+ ```
111
+
112
+ ### **shadow**
113
+ Shadow or Elevation styles for visual depth and perspective
114
+
115
+ ```tsx
116
+ import React from 'react';
117
+ import { CountryPicker } from '../../../Form/CountryPicker/CountryPicker';
118
+
119
+ export const ShadowCountryPicker = () => (
120
+ <CountryPicker shadow={{ boxShadow: 'rgba(0, 0, 0, 0.20) 0px 3px 8px' }} />
121
+ );
122
+
123
+ ```
@@ -0,0 +1,77 @@
1
+ # DatePicker
2
+
3
+ A customizable date selection input for user interfaces.
4
+
5
+ ### **Import**
6
+ ```tsx
7
+ import { DatePicker } from '@app-studio/web';
8
+ ```
9
+
10
+ ### **Default**
11
+ ```tsx
12
+ import React from 'react';
13
+ import { DatePicker } from '../../../Form/DatePicker/DatePicker';
14
+
15
+ export const DefaultDatePicker = () => <DatePicker label="Select a date" />;
16
+
17
+ ```
18
+
19
+ ### **colorScheme**
20
+ The color scheme that changes the background color of the DatePicker.
21
+
22
+ ```tsx
23
+ import React from 'react';
24
+ import { Vertical } from 'app-studio';
25
+
26
+ import { DatePicker } from '../DatePicker';
27
+
28
+ export const ColorDatePicker = () => (
29
+ <Vertical gap={15}>
30
+ {[
31
+ 'theme.primary',
32
+ 'theme.secondary',
33
+ 'theme.error',
34
+ 'theme.success',
35
+ 'theme.warning',
36
+ ].map((color) => (
37
+ <DatePicker
38
+ key={color}
39
+ name="name"
40
+ colorScheme={color}
41
+ label="Select a date:"
42
+ />
43
+ ))}
44
+ </Vertical>
45
+ );
46
+
47
+ ```
48
+
49
+ ### **shadow**
50
+ Adds a shadow effect to the DatePicker.
51
+
52
+ ```tsx
53
+ import React from 'react';
54
+ import { DatePicker } from '../../../Form/DatePicker/DatePicker';
55
+
56
+ export const ShadowDatePicker = () => (
57
+ <DatePicker
58
+ shadow={{
59
+ boxShadow: 'rgba(0, 0, 0, 0.20) 0px 3px 8px',
60
+ }}
61
+ />
62
+ );
63
+
64
+ ```
65
+
66
+ ## Props
67
+
68
+ | Prop | Type | Description | Default |
69
+ | ------------ | ------------- | ------------------------------------------------------------------------ | ----------- |
70
+ | label | string | The label text for the date picker. | |
71
+ | colorScheme | string | The color scheme that changes the background color. | |
72
+ | shadow | Shadow/Elevation | Adds a shadow effect to the DatePicker. | |
73
+ | styles | CSSProperties | Optional custom styles for the DatePicker (container, input, calendar). | |
74
+ | className | string | Optional className for the DatePicker container. | |
75
+ | placeholder | string | Placeholder text when no date is selected. | |
76
+ | selectedDate | Date | The currently selected date (controlled component). | |
77
+ | onChange | function | Callback function when the selected date changes. | |