@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.
- package/docs/components/Accordion.mdx +158 -0
- package/docs/components/Alert.mdx +123 -0
- package/docs/components/AspectRatio.mdx +55 -0
- package/docs/components/Avatar.mdx +85 -0
- package/docs/components/Background.mdx +522 -0
- package/docs/components/Badge.mdx +220 -0
- package/docs/components/Button.mdx +272 -0
- package/docs/components/Calendar.mdx +274 -0
- package/docs/components/Card.mdx +341 -0
- package/docs/components/Carousel.mdx +411 -0
- package/docs/components/Center.mdx +474 -0
- package/docs/components/Chart.mdx +232 -0
- package/docs/components/ChatInput.mdx +373 -0
- package/docs/components/Checkbox.mdx +66 -0
- package/docs/components/ColorInput.mdx +209 -0
- package/docs/components/ComboBox.mdx +364 -0
- package/docs/components/Command.mdx +252 -0
- package/docs/components/ContextMenu.mdx +219 -0
- package/docs/components/CountryPicker.mdx +123 -0
- package/docs/components/DatePicker.mdx +77 -0
- package/docs/components/DragAndDrop.mdx +539 -0
- package/docs/components/DropdownMenu.mdx +205 -0
- package/docs/components/File.mdx +8 -0
- package/docs/components/Flow.mdx +257 -0
- package/docs/components/Form.mdx +681 -0
- package/docs/components/Formik.mdx +621 -0
- package/docs/components/Gradient.mdx +271 -0
- package/docs/components/Horizontal.mdx +40 -0
- package/docs/components/HoverCard.mdx +140 -0
- package/docs/components/Icon.mdx +438 -0
- package/docs/components/Label.mdx +438 -0
- package/docs/components/Link.mdx +83 -0
- package/docs/components/Loader.mdx +527 -0
- package/docs/components/Menubar.mdx +124 -0
- package/docs/components/Message.mdx +571 -0
- package/docs/components/Modal.mdx +533 -0
- package/docs/components/NavigationMenu.mdx +165 -0
- package/docs/components/Pagination.mdx +150 -0
- package/docs/components/Password.mdx +121 -0
- package/docs/components/Resizable.mdx +148 -0
- package/docs/components/Select.mdx +126 -0
- package/docs/components/Separator.mdx +121 -0
- package/docs/components/Sidebar.mdx +147 -0
- package/docs/components/Slider.mdx +232 -0
- package/docs/components/Switch.mdx +62 -0
- package/docs/components/Table.mdx +409 -0
- package/docs/components/Tabs.mdx +215 -0
- package/docs/components/TagInput.mdx +528 -0
- package/docs/components/Text.mdx +163 -0
- package/docs/components/TextArea.mdx +136 -0
- package/docs/components/TextField.mdx +225 -0
- package/docs/components/Title.mdx +535 -0
- package/docs/components/Toast.mdx +165 -0
- package/docs/components/Toggle.mdx +141 -0
- package/docs/components/ToggleGroup.mdx +165 -0
- package/docs/components/Tooltip.mdx +191 -0
- package/docs/components/Tree.mdx +340 -0
- package/docs/components/Uploader.mdx +426 -0
- package/docs/components/Vertical.mdx +566 -0
- package/docs/components.md +285 -0
- package/package.json +1 -1
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
# App Studio Component Library
|
|
2
|
+
|
|
3
|
+
This document provides an overview of the core components available in the App Studio library. Each component is designed to be composable, themeable, and consistent.
|
|
4
|
+
|
|
5
|
+
For detailed rules on creating or modifying components, please refer to the [App Studio Rules](./app-studio.md).
|
|
6
|
+
|
|
7
|
+
## I. Layout Components
|
|
8
|
+
|
|
9
|
+
Layout components are the foundation for building consistent user interfaces. They provide powerful and simple abstractions over CSS Flexbox.
|
|
10
|
+
|
|
11
|
+
### View
|
|
12
|
+
|
|
13
|
+
The most fundamental layout component. It's a simple block element that can be customized with style props.
|
|
14
|
+
|
|
15
|
+
**Example:**
|
|
16
|
+
```tsx
|
|
17
|
+
import { View, Text } from '@app-studio';
|
|
18
|
+
|
|
19
|
+
const MyComponent = () => (
|
|
20
|
+
<View style={{ padding: 16, backgroundColor: '#f0f0f0', borderRadius: 8 }}>
|
|
21
|
+
<Text>This is a View component.</Text>
|
|
22
|
+
</View>
|
|
23
|
+
);
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Horizontal
|
|
27
|
+
|
|
28
|
+
A `View` component with `flexDirection: 'row'`. It arranges its children in a horizontal line.
|
|
29
|
+
|
|
30
|
+
**Example:**
|
|
31
|
+
```tsx
|
|
32
|
+
import { Horizontal, Button, Icon } from '@app-studio';
|
|
33
|
+
|
|
34
|
+
const ActionBar = () => (
|
|
35
|
+
<Horizontal gap={8} alignItems="center">
|
|
36
|
+
<Button variant="primary">Save</Button>
|
|
37
|
+
<Button>Cancel</Button>
|
|
38
|
+
<Icon name="Settings" />
|
|
39
|
+
</Horizontal>
|
|
40
|
+
);
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Vertical
|
|
44
|
+
|
|
45
|
+
A `View` component with `flexDirection: 'column'`. It stacks its children vertically.
|
|
46
|
+
|
|
47
|
+
**Example:**
|
|
48
|
+
```tsx
|
|
49
|
+
import { Vertical, Text, TextField } from '@app-studio';
|
|
50
|
+
|
|
51
|
+
const UserProfile = () => (
|
|
52
|
+
<Vertical gap={12}>
|
|
53
|
+
<Text variant="heading">User Profile</Text>
|
|
54
|
+
<TextField label="Name" />
|
|
55
|
+
<TextField label="Email" />
|
|
56
|
+
</Vertical>
|
|
57
|
+
);
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Center
|
|
61
|
+
|
|
62
|
+
A `View` component that centers its children both horizontally and vertically.
|
|
63
|
+
|
|
64
|
+
**Example:**
|
|
65
|
+
```tsx
|
|
66
|
+
import { Center, Loader } from '@app-studio';
|
|
67
|
+
|
|
68
|
+
const LoadingScreen = () => (
|
|
69
|
+
<Center style={{ height: '100vh' }}>
|
|
70
|
+
<Loader size="lg" />
|
|
71
|
+
</Center>
|
|
72
|
+
);
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## II. General Components
|
|
76
|
+
|
|
77
|
+
### Button
|
|
78
|
+
|
|
79
|
+
A standard button component with multiple variants, sizes, and states.
|
|
80
|
+
|
|
81
|
+
**Example:**
|
|
82
|
+
```tsx
|
|
83
|
+
import { Button, Horizontal } from '@app-studio';
|
|
84
|
+
|
|
85
|
+
const ButtonExamples = () => (
|
|
86
|
+
<Horizontal gap={8} alignItems="center">
|
|
87
|
+
<Button variant="primary" size="md">Primary</Button>
|
|
88
|
+
<Button variant="secondary" size="sm">Secondary</Button>
|
|
89
|
+
<Button isLoading>Loading</Button>
|
|
90
|
+
<Button isDisabled>Disabled</Button>
|
|
91
|
+
</Horizontal>
|
|
92
|
+
);
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Icon
|
|
96
|
+
|
|
97
|
+
Renders an SVG icon from the library's icon set. It can be customized with props for size, color, and more.
|
|
98
|
+
|
|
99
|
+
**Example:**
|
|
100
|
+
```tsx
|
|
101
|
+
import { Icon, Horizontal, useTheme } from '@app-studio';
|
|
102
|
+
|
|
103
|
+
const IconExamples = () => {
|
|
104
|
+
const { theme } = useTheme();
|
|
105
|
+
return (
|
|
106
|
+
<Horizontal gap={16} alignItems="center">
|
|
107
|
+
<Icon name="Home" size={24} />
|
|
108
|
+
<Icon name="User" size={24} color={theme.primary} />
|
|
109
|
+
<Icon name="CheckCircle" size={24} color="green" filled />
|
|
110
|
+
</Horizontal>
|
|
111
|
+
);
|
|
112
|
+
};
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Text
|
|
116
|
+
|
|
117
|
+
A component for rendering text with consistent typography based on the theme.
|
|
118
|
+
|
|
119
|
+
**Example:**
|
|
120
|
+
```tsx
|
|
121
|
+
import { Text, Vertical } from '@app-studio';
|
|
122
|
+
|
|
123
|
+
const TextExamples = () => (
|
|
124
|
+
<Vertical gap={4}>
|
|
125
|
+
<Text variant="heading">This is a Heading</Text>
|
|
126
|
+
<Text>This is standard body text.</Text>
|
|
127
|
+
<Text variant="label" color="gray">This is a label.</Text>
|
|
128
|
+
</Vertical>
|
|
129
|
+
);
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## III. Form Components
|
|
133
|
+
|
|
134
|
+
### TextField
|
|
135
|
+
|
|
136
|
+
A complete text input field component including a label, helper text, and error handling.
|
|
137
|
+
|
|
138
|
+
**Example:**
|
|
139
|
+
```tsx
|
|
140
|
+
import { TextField } from '@app-studio';
|
|
141
|
+
|
|
142
|
+
const FormExample = () => (
|
|
143
|
+
<TextField
|
|
144
|
+
label="Email Address"
|
|
145
|
+
name="email"
|
|
146
|
+
placeholder="you@example.com"
|
|
147
|
+
helperText="We'll never share your email."
|
|
148
|
+
/>
|
|
149
|
+
);
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### FormikTextField
|
|
153
|
+
|
|
154
|
+
A wrapper around `TextField` that integrates seamlessly with Formik. It automatically handles value, `onChange`, `onBlur`, and error display.
|
|
155
|
+
|
|
156
|
+
**Example:**
|
|
157
|
+
```tsx
|
|
158
|
+
import { FormikTextField } from '@app-studio';
|
|
159
|
+
import { Formik, Form } from 'formik';
|
|
160
|
+
|
|
161
|
+
const MyForm = () => (
|
|
162
|
+
<Formik initialValues={{ email: '' }} onSubmit={() => {}}>
|
|
163
|
+
<Form>
|
|
164
|
+
<FormikTextField
|
|
165
|
+
label="Email Address"
|
|
166
|
+
name="email"
|
|
167
|
+
type="email"
|
|
168
|
+
placeholder="you@example.com"
|
|
169
|
+
/>
|
|
170
|
+
</Form>
|
|
171
|
+
</Formik>
|
|
172
|
+
);
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## IV. Feedback Components
|
|
176
|
+
|
|
177
|
+
### Alert
|
|
178
|
+
|
|
179
|
+
A component to display important, contextual messages to the user.
|
|
180
|
+
|
|
181
|
+
**Example:**
|
|
182
|
+
```tsx
|
|
183
|
+
import { Alert } from '@app-studio';
|
|
184
|
+
|
|
185
|
+
const AlertExample = () => (
|
|
186
|
+
<Alert
|
|
187
|
+
status="warning"
|
|
188
|
+
title="Attention Required"
|
|
189
|
+
description="Your session is about to expire. Please save your work."
|
|
190
|
+
/>
|
|
191
|
+
);
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### Modal
|
|
195
|
+
|
|
196
|
+
A dialog window that overlays the main content.
|
|
197
|
+
|
|
198
|
+
**Example:**
|
|
199
|
+
```tsx
|
|
200
|
+
import { Modal, Button, useModal } from '@app-studio';
|
|
201
|
+
|
|
202
|
+
const MyModal = () => {
|
|
203
|
+
const { openModal } = useModal();
|
|
204
|
+
return (
|
|
205
|
+
<>
|
|
206
|
+
<Button onClick={() => openModal('my-modal-id')}>Open Modal</Button>
|
|
207
|
+
<Modal id="my-modal-id" title="My Modal">
|
|
208
|
+
<p>This is the modal content.</p>
|
|
209
|
+
</Modal>
|
|
210
|
+
</>
|
|
211
|
+
);
|
|
212
|
+
};
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### Toast
|
|
216
|
+
|
|
217
|
+
A small, non-intrusive notification that appears temporarily.
|
|
218
|
+
|
|
219
|
+
**Example:**
|
|
220
|
+
```tsx
|
|
221
|
+
import { Button, showToast } from '@app-studio';
|
|
222
|
+
|
|
223
|
+
const ToastButton = () => (
|
|
224
|
+
<Button onClick={() => showToast('success', 'Success!', 'Your action was successful.')}>
|
|
225
|
+
Show Success Toast
|
|
226
|
+
</Button>
|
|
227
|
+
);
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### Tooltip
|
|
231
|
+
|
|
232
|
+
A small pop-up that displays information when a user hovers over an element.
|
|
233
|
+
|
|
234
|
+
**Example:**
|
|
235
|
+
```tsx
|
|
236
|
+
import { Tooltip, Button } from '@app-studio';
|
|
237
|
+
|
|
238
|
+
const TooltipExample = () => (
|
|
239
|
+
<Tooltip label="This is a tooltip">
|
|
240
|
+
<Button>Hover me</Button>
|
|
241
|
+
</Tooltip>
|
|
242
|
+
);
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## V. Data Display Components
|
|
246
|
+
|
|
247
|
+
### Calendar
|
|
248
|
+
|
|
249
|
+
A component for displaying dates and allowing users to select a single date or a date range.
|
|
250
|
+
|
|
251
|
+
**Example:**
|
|
252
|
+
```tsx
|
|
253
|
+
import { Calendar } from '@app-studio';
|
|
254
|
+
import { useState } from 'react';
|
|
255
|
+
|
|
256
|
+
const CalendarExample = () => {
|
|
257
|
+
const [selectedDate, setSelectedDate] = useState(new Date());
|
|
258
|
+
|
|
259
|
+
return (
|
|
260
|
+
<Calendar
|
|
261
|
+
value={selectedDate}
|
|
262
|
+
onChange={setSelectedDate}
|
|
263
|
+
/>
|
|
264
|
+
);
|
|
265
|
+
};
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### Kanban Card
|
|
269
|
+
|
|
270
|
+
A draggable card component designed for use within a Kanban board. It displays key information and can be customized.
|
|
271
|
+
|
|
272
|
+
**Example:**
|
|
273
|
+
```tsx
|
|
274
|
+
import { KanbanCard } from '@app-studio';
|
|
275
|
+
|
|
276
|
+
const KanbanCardExample = () => (
|
|
277
|
+
<KanbanCard
|
|
278
|
+
id="task-1"
|
|
279
|
+
title="Design the new dashboard"
|
|
280
|
+
description="Create mockups in Figma for the v2 dashboard."
|
|
281
|
+
tags={[{ label: 'UI/UX', color: 'blue' }, { label: 'High Priority', color: 'red' }]}
|
|
282
|
+
assignee={{ name: 'Jane Doe', avatarUrl: '/avatars/jane.png' }}
|
|
283
|
+
/>
|
|
284
|
+
);
|
|
285
|
+
```
|