@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,150 @@
|
|
|
1
|
+
# Pagination
|
|
2
|
+
|
|
3
|
+
A flexible pagination component for navigating through pages of content.
|
|
4
|
+
|
|
5
|
+
### **Import**
|
|
6
|
+
```tsx
|
|
7
|
+
import { Pagination } from '@app-studio/web';
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
### **Default**
|
|
11
|
+
```tsx
|
|
12
|
+
import React, { useState } from 'react';
|
|
13
|
+
import { Pagination } from '../Pagination';
|
|
14
|
+
|
|
15
|
+
export const DefaultPagination = () => {
|
|
16
|
+
const [currentPage, setCurrentPage] = useState(1);
|
|
17
|
+
const totalPages = 10;
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<Pagination
|
|
21
|
+
currentPage={currentPage}
|
|
22
|
+
totalPages={totalPages}
|
|
23
|
+
onPageChange={setCurrentPage}
|
|
24
|
+
/>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### **Variants**
|
|
30
|
+
The Pagination component supports different visual variants:
|
|
31
|
+
|
|
32
|
+
```tsx
|
|
33
|
+
<Pagination
|
|
34
|
+
currentPage={currentPage}
|
|
35
|
+
totalPages={totalPages}
|
|
36
|
+
onPageChange={setCurrentPage}
|
|
37
|
+
variant="default"
|
|
38
|
+
/>
|
|
39
|
+
|
|
40
|
+
<Pagination
|
|
41
|
+
currentPage={currentPage}
|
|
42
|
+
totalPages={totalPages}
|
|
43
|
+
onPageChange={setCurrentPage}
|
|
44
|
+
variant="filled"
|
|
45
|
+
/>
|
|
46
|
+
|
|
47
|
+
<Pagination
|
|
48
|
+
currentPage={currentPage}
|
|
49
|
+
totalPages={totalPages}
|
|
50
|
+
onPageChange={setCurrentPage}
|
|
51
|
+
variant="outline"
|
|
52
|
+
/>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### **Sizes**
|
|
56
|
+
The Pagination component supports different sizes:
|
|
57
|
+
|
|
58
|
+
```tsx
|
|
59
|
+
<Pagination
|
|
60
|
+
currentPage={currentPage}
|
|
61
|
+
totalPages={totalPages}
|
|
62
|
+
onPageChange={setCurrentPage}
|
|
63
|
+
size="sm"
|
|
64
|
+
/>
|
|
65
|
+
|
|
66
|
+
<Pagination
|
|
67
|
+
currentPage={currentPage}
|
|
68
|
+
totalPages={totalPages}
|
|
69
|
+
onPageChange={setCurrentPage}
|
|
70
|
+
size="md"
|
|
71
|
+
/>
|
|
72
|
+
|
|
73
|
+
<Pagination
|
|
74
|
+
currentPage={currentPage}
|
|
75
|
+
totalPages={totalPages}
|
|
76
|
+
onPageChange={setCurrentPage}
|
|
77
|
+
size="lg"
|
|
78
|
+
/>
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### **Shapes**
|
|
82
|
+
The Pagination component supports different button shapes:
|
|
83
|
+
|
|
84
|
+
```tsx
|
|
85
|
+
<Pagination
|
|
86
|
+
currentPage={currentPage}
|
|
87
|
+
totalPages={totalPages}
|
|
88
|
+
onPageChange={setCurrentPage}
|
|
89
|
+
shape="rounded"
|
|
90
|
+
/>
|
|
91
|
+
|
|
92
|
+
<Pagination
|
|
93
|
+
currentPage={currentPage}
|
|
94
|
+
totalPages={totalPages}
|
|
95
|
+
onPageChange={setCurrentPage}
|
|
96
|
+
shape="square"
|
|
97
|
+
/>
|
|
98
|
+
|
|
99
|
+
<Pagination
|
|
100
|
+
currentPage={currentPage}
|
|
101
|
+
totalPages={totalPages}
|
|
102
|
+
onPageChange={setCurrentPage}
|
|
103
|
+
shape="circular"
|
|
104
|
+
/>
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### **Advanced Usage**
|
|
108
|
+
The Pagination component can be customized with additional features:
|
|
109
|
+
|
|
110
|
+
```tsx
|
|
111
|
+
<Pagination
|
|
112
|
+
currentPage={currentPage}
|
|
113
|
+
totalPages={totalPages}
|
|
114
|
+
onPageChange={setCurrentPage}
|
|
115
|
+
pageSize={pageSize}
|
|
116
|
+
onPageSizeChange={setPageSize}
|
|
117
|
+
showPageSizeSelector={true}
|
|
118
|
+
showFirstLastButtons={true}
|
|
119
|
+
maxPageButtons={7}
|
|
120
|
+
variant="outline"
|
|
121
|
+
/>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### **Table Integration**
|
|
125
|
+
The Pagination component can be integrated with the Table component:
|
|
126
|
+
|
|
127
|
+
```tsx
|
|
128
|
+
<Table.Template
|
|
129
|
+
columns={columns}
|
|
130
|
+
data={getCurrentPageData()}
|
|
131
|
+
/>
|
|
132
|
+
|
|
133
|
+
<View marginTop={16} display="flex" justifyContent="space-between" alignItems="center">
|
|
134
|
+
<Text>
|
|
135
|
+
Showing {(currentPage - 1) * pageSize + 1} to {Math.min(currentPage * pageSize, totalItems)} of {totalItems} entries
|
|
136
|
+
</Text>
|
|
137
|
+
|
|
138
|
+
<Pagination
|
|
139
|
+
currentPage={currentPage}
|
|
140
|
+
totalPages={totalPages}
|
|
141
|
+
onPageChange={setCurrentPage}
|
|
142
|
+
pageSize={pageSize}
|
|
143
|
+
onPageSizeChange={setPageSize}
|
|
144
|
+
showPageSizeSelector={true}
|
|
145
|
+
showPageInfo={false}
|
|
146
|
+
variant="outline"
|
|
147
|
+
size="sm"
|
|
148
|
+
/>
|
|
149
|
+
</View>
|
|
150
|
+
```
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
### **Import**
|
|
2
|
+
|
|
3
|
+
```tsx
|
|
4
|
+
import { Password } from "@app-studio/web";
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
|
|
9
|
+
| Prop | Type | Description | Default |
|
|
10
|
+
| ---------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ------- |
|
|
11
|
+
| visibleIcon | ReactNode | Icon to display when the password is visible. | |
|
|
12
|
+
| hiddenIcon | ReactNode | Icon to display when the password is hidden. | |
|
|
13
|
+
| isClearable | boolean | Indicates whether the input is clearable. | false |
|
|
14
|
+
| isDisabled | boolean | Makes the field unusable. | false |
|
|
15
|
+
| error | boolean | Indicates that the text field value failed the validation criteria. | false |
|
|
16
|
+
| helperText | string | Text used to inform the user that the content of the field is invalid. | |
|
|
17
|
+
| styles | TextFieldStyles | Optional custom styles for the TextField. | |
|
|
18
|
+
| className | string | Optional className for the TextField. | |
|
|
19
|
+
|
|
20
|
+
### **Default**
|
|
21
|
+
|
|
22
|
+
It has type equals to “password” and isClearable set to false. It has all the props of the TextField component.
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
<Password label="Password" value="123456" />
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### **Disabled**
|
|
29
|
+
|
|
30
|
+
“**_isDisabled_**” makes the field unusable.
|
|
31
|
+
|
|
32
|
+
```tsx
|
|
33
|
+
<Password value="password" isDisabled />
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### **Icon**
|
|
37
|
+
|
|
38
|
+
“**_visibleIcon_**” and “**_hiddenIcon_**” are icons indicating whether the password is visible or hidden.
|
|
39
|
+
|
|
40
|
+
```tsx
|
|
41
|
+
import { OpenEyeIcon } from "../../Icon/OpenEye";
|
|
42
|
+
import { CloseEyeIcon } from "../../Icon/CloseEye";
|
|
43
|
+
|
|
44
|
+
<Password
|
|
45
|
+
visibleIcon={<OpenEyeIcon size={14} />}
|
|
46
|
+
hiddenIcon={<CloseEyeIcon size={14} />}
|
|
47
|
+
/>;
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### **Error**
|
|
51
|
+
|
|
52
|
+
“**_error_**” if true, indicates that the text field value failed the validation criteria.
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
import { Vertical } from "app-studio";
|
|
56
|
+
import { Button } from "../../Button/Button";
|
|
57
|
+
import { OpenEyeIcon } from "../../Icon/OpenEye";
|
|
58
|
+
import { CloseEyeIcon } from "../../Icon/CloseEye";
|
|
59
|
+
|
|
60
|
+
<Password
|
|
61
|
+
placeholder="Password"
|
|
62
|
+
colorScheme="theme.secondary"
|
|
63
|
+
visibleIcon={<OpenEyeIcon size={14} />}
|
|
64
|
+
hiddenIcon={<CloseEyeIcon size={14} />}
|
|
65
|
+
error
|
|
66
|
+
/>;
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### **HelperText**
|
|
70
|
+
|
|
71
|
+
“**_helperText_**” is a string text used to inform the user that the content of the field is invalid.
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
import { Vertical } from "app-studio";
|
|
75
|
+
import { Button } from "../../Button/Button";
|
|
76
|
+
import { OpenEyeIcon } from "../../Icon/OpenEye";
|
|
77
|
+
import { CloseEyeIcon } from "../../Icon/CloseEye";
|
|
78
|
+
|
|
79
|
+
<Password
|
|
80
|
+
placeholder="Password"
|
|
81
|
+
helperText="Incorrect password"
|
|
82
|
+
visibleIcon={<OpenEyeIcon size={14} />}
|
|
83
|
+
hiddenIcon={<CloseEyeIcon size={14} />}
|
|
84
|
+
error
|
|
85
|
+
/>;
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## **Default Values**
|
|
89
|
+
|
|
90
|
+
```tsx
|
|
91
|
+
const Shapes: Record<Shape, number | string> = {
|
|
92
|
+
default: "6px 6px 0 0",
|
|
93
|
+
sharp: 0,
|
|
94
|
+
rounded: 4,
|
|
95
|
+
pillShaped: 24,
|
|
96
|
+
};
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Types
|
|
100
|
+
|
|
101
|
+
```tsx
|
|
102
|
+
type Variant = "outline" | "default" | "none";
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
```tsx
|
|
106
|
+
type Shape = "default" | "sharp" | "rounded" | "pillShaped";
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
```tsx
|
|
110
|
+
type Size = "xs" | "sm" | "md" | "lg" | "xl";
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
```tsx
|
|
114
|
+
type TextFieldStyles = {
|
|
115
|
+
container?: CSSProperties;
|
|
116
|
+
field?: CSSProperties;
|
|
117
|
+
label?: CSSProperties;
|
|
118
|
+
helperText?: CSSProperties;
|
|
119
|
+
text?: CSSProperties;
|
|
120
|
+
};
|
|
121
|
+
```
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# Resizable
|
|
2
|
+
|
|
3
|
+
An accessible resizable panel group component for creating flexible layouts with resizable panels.
|
|
4
|
+
|
|
5
|
+
### **Import**
|
|
6
|
+
```tsx
|
|
7
|
+
import { Resizable } from '@app-studio/web';
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
### **Default**
|
|
11
|
+
```tsx
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import { Resizable } from '@app-studio/web';
|
|
14
|
+
import { View } from '@app-studio/web';
|
|
15
|
+
import { Text } from '@app-studio/web';
|
|
16
|
+
|
|
17
|
+
export const DefaultResizable = () => {
|
|
18
|
+
return (
|
|
19
|
+
<View height="400px" width="100%">
|
|
20
|
+
<Resizable>
|
|
21
|
+
<Resizable.Panel id="panel1" defaultSize="30%">
|
|
22
|
+
<View padding="16px" height="100%" backgroundColor="color.blue.50">
|
|
23
|
+
<Text fontWeight="bold">Panel 1</Text>
|
|
24
|
+
<Text>This is the first panel. Drag the handle to resize.</Text>
|
|
25
|
+
</View>
|
|
26
|
+
</Resizable.Panel>
|
|
27
|
+
|
|
28
|
+
<Resizable.Handle id="handle1" withVisualIndicator />
|
|
29
|
+
|
|
30
|
+
<Resizable.Panel id="panel2" defaultSize="40%">
|
|
31
|
+
<View padding="16px" height="100%" backgroundColor="color.green.50">
|
|
32
|
+
<Text fontWeight="bold">Panel 2</Text>
|
|
33
|
+
<Text>This is the second panel. Drag the handle to resize.</Text>
|
|
34
|
+
</View>
|
|
35
|
+
</Resizable.Panel>
|
|
36
|
+
|
|
37
|
+
<Resizable.Handle id="handle2" withVisualIndicator />
|
|
38
|
+
|
|
39
|
+
<Resizable.Panel id="panel3" defaultSize="30%">
|
|
40
|
+
<View padding="16px" height="100%" backgroundColor="color.purple.50">
|
|
41
|
+
<Text fontWeight="bold">Panel 3</Text>
|
|
42
|
+
<Text>This is the third panel. Drag the handle to resize.</Text>
|
|
43
|
+
</View>
|
|
44
|
+
</Resizable.Panel>
|
|
45
|
+
</Resizable>
|
|
46
|
+
</View>
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### **Orientation**
|
|
52
|
+
The Resizable component supports both horizontal and vertical orientations:
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
// Horizontal (default)
|
|
56
|
+
<Resizable orientation="horizontal">
|
|
57
|
+
{/* Panels and handles */}
|
|
58
|
+
</Resizable>
|
|
59
|
+
|
|
60
|
+
// Vertical
|
|
61
|
+
<Resizable orientation="vertical">
|
|
62
|
+
{/* Panels and handles */}
|
|
63
|
+
</Resizable>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### **Nested Layouts**
|
|
67
|
+
The Resizable component can be nested to create complex layouts:
|
|
68
|
+
|
|
69
|
+
```tsx
|
|
70
|
+
<Resizable>
|
|
71
|
+
<Resizable.Panel id="left" defaultSize="30%">
|
|
72
|
+
{/* Left panel content */}
|
|
73
|
+
</Resizable.Panel>
|
|
74
|
+
|
|
75
|
+
<Resizable.Handle id="handle1" />
|
|
76
|
+
|
|
77
|
+
<Resizable.Panel id="right" defaultSize="70%">
|
|
78
|
+
{/* Nested vertical resizable */}
|
|
79
|
+
<Resizable orientation="vertical">
|
|
80
|
+
<Resizable.Panel id="top" defaultSize="50%">
|
|
81
|
+
{/* Top right panel content */}
|
|
82
|
+
</Resizable.Panel>
|
|
83
|
+
|
|
84
|
+
<Resizable.Handle id="handle2" />
|
|
85
|
+
|
|
86
|
+
<Resizable.Panel id="bottom" defaultSize="50%">
|
|
87
|
+
{/* Bottom right panel content */}
|
|
88
|
+
</Resizable.Panel>
|
|
89
|
+
</Resizable>
|
|
90
|
+
</Resizable.Panel>
|
|
91
|
+
</Resizable>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### **Handle Variants**
|
|
95
|
+
The Resizable component supports different handle variants:
|
|
96
|
+
|
|
97
|
+
```tsx
|
|
98
|
+
<Resizable variant="default">
|
|
99
|
+
{/* Panels and handles */}
|
|
100
|
+
</Resizable>
|
|
101
|
+
|
|
102
|
+
<Resizable variant="subtle">
|
|
103
|
+
{/* Panels and handles */}
|
|
104
|
+
</Resizable>
|
|
105
|
+
|
|
106
|
+
<Resizable variant="prominent">
|
|
107
|
+
{/* Panels and handles */}
|
|
108
|
+
</Resizable>
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### **Handle Sizes**
|
|
112
|
+
The Resizable component supports different handle sizes:
|
|
113
|
+
|
|
114
|
+
```tsx
|
|
115
|
+
<Resizable size="sm">
|
|
116
|
+
{/* Panels and handles */}
|
|
117
|
+
</Resizable>
|
|
118
|
+
|
|
119
|
+
<Resizable size="md">
|
|
120
|
+
{/* Panels and handles */}
|
|
121
|
+
</Resizable>
|
|
122
|
+
|
|
123
|
+
<Resizable size="lg">
|
|
124
|
+
{/* Panels and handles */}
|
|
125
|
+
</Resizable>
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### **Controlled Resizing**
|
|
129
|
+
The Resizable component can be controlled externally:
|
|
130
|
+
|
|
131
|
+
```tsx
|
|
132
|
+
const [sizes, setSizes] = useState([33.33, 33.33, 33.33]);
|
|
133
|
+
|
|
134
|
+
const handleSizesChange = (newSizes) => {
|
|
135
|
+
setSizes(newSizes);
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
<Resizable defaultSizes={sizes} onSizesChange={handleSizesChange}>
|
|
139
|
+
{/* Panels and handles */}
|
|
140
|
+
</Resizable>
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### **Accessibility**
|
|
144
|
+
The Resizable component is fully accessible:
|
|
145
|
+
|
|
146
|
+
- Handles have proper ARIA attributes
|
|
147
|
+
- Keyboard navigation is supported (arrow keys to resize, Enter to start resizing, Escape to cancel)
|
|
148
|
+
- Focus management for keyboard users
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# Select
|
|
2
|
+
|
|
3
|
+
A customizable UI component for selecting from a list of options.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
| Prop | Type | Description | Default |
|
|
8
|
+
| ---------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ------- |
|
|
9
|
+
| options | { label: string; value: string }[] | Array of options for the select box. | |
|
|
10
|
+
| label | string | Label for the select box. | |
|
|
11
|
+
| placeholder | string | Placeholder text for the select box. | |
|
|
12
|
+
| error | boolean | Flag to indicate if the select has an error state. | false |
|
|
13
|
+
| helperText | string | Helper text that appears below the select box. | |
|
|
14
|
+
| shadow | Shadow | Determines the shadow property of the select component. | |
|
|
15
|
+
| styles | CSSProperties | Optional custom styles for the select component. | |
|
|
16
|
+
| className | string | Optional className for the select component. | |
|
|
17
|
+
| isScrollable | boolean | Boolean to control whether the select options are scrollable | true |
|
|
18
|
+
|
|
19
|
+
### **Import**
|
|
20
|
+
```tsx
|
|
21
|
+
import { Select } from '@app-studio/web';
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### **Default**
|
|
25
|
+
```tsx
|
|
26
|
+
import React from 'react';
|
|
27
|
+
import { Select } from '../Select';
|
|
28
|
+
|
|
29
|
+
export const DefaultSelect = () => (
|
|
30
|
+
<Select
|
|
31
|
+
options={[
|
|
32
|
+
{ label: 'Item1', value: '1' },
|
|
33
|
+
{ label: 'Item2', value: '2' },
|
|
34
|
+
{ label: 'Item3', value: '3' },
|
|
35
|
+
]}
|
|
36
|
+
label="Select an item"
|
|
37
|
+
/>
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### **error**
|
|
43
|
+
Flag to indicate if the select has an error state
|
|
44
|
+
|
|
45
|
+
```tsx
|
|
46
|
+
import React from 'react';
|
|
47
|
+
import { Select } from '../Select';
|
|
48
|
+
|
|
49
|
+
export const ErrorSelect = () => (
|
|
50
|
+
<Select
|
|
51
|
+
id="error"
|
|
52
|
+
name="error"
|
|
53
|
+
error
|
|
54
|
+
options={[
|
|
55
|
+
{ label: 'Item1', value: '1' },
|
|
56
|
+
{ label: 'Item2', value: '2' },
|
|
57
|
+
{ label: 'Item3', value: '3' },
|
|
58
|
+
]}
|
|
59
|
+
/>
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### **helperText**
|
|
65
|
+
Helper text that appears below the select box
|
|
66
|
+
|
|
67
|
+
```tsx
|
|
68
|
+
import React from 'react';
|
|
69
|
+
|
|
70
|
+
import { Select } from '../Select';
|
|
71
|
+
|
|
72
|
+
export const HelperTextSelect = () => (
|
|
73
|
+
<Select
|
|
74
|
+
options={[
|
|
75
|
+
{ label: 'Item1', value: '1' },
|
|
76
|
+
{ label: 'Item2', value: '2' },
|
|
77
|
+
{ label: 'Item3', value: '3' },
|
|
78
|
+
]}
|
|
79
|
+
helperText="select one item!"
|
|
80
|
+
error
|
|
81
|
+
/>
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### **shadow**
|
|
87
|
+
Determines the shadow property of the select component
|
|
88
|
+
|
|
89
|
+
```tsx
|
|
90
|
+
import React from 'react';
|
|
91
|
+
import { Select } from '../../../Form/Select/Select';
|
|
92
|
+
|
|
93
|
+
export const ShadowSelect = () => (
|
|
94
|
+
<Select
|
|
95
|
+
shadow={{
|
|
96
|
+
boxShadow:
|
|
97
|
+
'rgb(204, 219, 232) 3px 3px 6px 0px inset, rgba(255, 255, 255, 0.5) -3px -3px 6px 1px inset',
|
|
98
|
+
}}
|
|
99
|
+
options={[
|
|
100
|
+
{ label: 'Item1', value: '1' },
|
|
101
|
+
{ label: 'Item2', value: '2' },
|
|
102
|
+
{ label: 'Item3', value: '3' },
|
|
103
|
+
]}
|
|
104
|
+
/>
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### **isScrollable**
|
|
110
|
+
Boolean to control whether the select options are scrollable
|
|
111
|
+
|
|
112
|
+
```tsx
|
|
113
|
+
import React from 'react';
|
|
114
|
+
import { Select } from '../Select';
|
|
115
|
+
|
|
116
|
+
export const IsScrollableDemo = () => {
|
|
117
|
+
const timeZones = [
|
|
118
|
+
{ label: 'Item1', value: '1' },
|
|
119
|
+
{ label: 'Item2', value: '2' },
|
|
120
|
+
{ label: 'Item3', value: '3' },
|
|
121
|
+
];
|
|
122
|
+
|
|
123
|
+
return <Select options={timeZones} />;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
```
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# Separator
|
|
2
|
+
|
|
3
|
+
A flexible separator component for visually or semantically separating content.
|
|
4
|
+
|
|
5
|
+
### **Import**
|
|
6
|
+
```tsx
|
|
7
|
+
import { Separator } from '@app-studio/web';
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
### **Default**
|
|
11
|
+
```tsx
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import { Separator } from '@app-studio/web';
|
|
14
|
+
import { Text } from '@app-studio/web';
|
|
15
|
+
|
|
16
|
+
export const DefaultSeparator = () => {
|
|
17
|
+
return (
|
|
18
|
+
<>
|
|
19
|
+
<Text>
|
|
20
|
+
This is some text above the separator. The separator helps to visually
|
|
21
|
+
divide content sections.
|
|
22
|
+
</Text>
|
|
23
|
+
<Separator />
|
|
24
|
+
<Text>
|
|
25
|
+
This is some text below the separator. Notice how the separator creates a
|
|
26
|
+
clear visual distinction between content areas.
|
|
27
|
+
</Text>
|
|
28
|
+
</>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### **Variants**
|
|
34
|
+
The Separator component supports different visual variants:
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
<Separator variant="solid" />
|
|
38
|
+
<Separator variant="dashed" />
|
|
39
|
+
<Separator variant="dotted" />
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### **Thicknesses**
|
|
43
|
+
The Separator component supports different thicknesses:
|
|
44
|
+
|
|
45
|
+
```tsx
|
|
46
|
+
<Separator thickness="thin" />
|
|
47
|
+
<Separator thickness="medium" />
|
|
48
|
+
<Separator thickness="thick" />
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### **Orientations**
|
|
52
|
+
The Separator component supports horizontal and vertical orientations:
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
<Separator orientation="horizontal" />
|
|
56
|
+
|
|
57
|
+
<Horizontal height={100} alignItems="center">
|
|
58
|
+
<Text>Left Content</Text>
|
|
59
|
+
<Separator orientation="vertical" />
|
|
60
|
+
<Text>Right Content</Text>
|
|
61
|
+
</Horizontal>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### **Colors**
|
|
65
|
+
The Separator component can be customized with different colors:
|
|
66
|
+
|
|
67
|
+
```tsx
|
|
68
|
+
<Separator color="color.gray.200" />
|
|
69
|
+
<Separator color="color.blue.500" />
|
|
70
|
+
<Separator color="color.green.500" />
|
|
71
|
+
<Separator color="color.red.500" />
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### **With Label**
|
|
75
|
+
The Separator component can include a label in the middle:
|
|
76
|
+
|
|
77
|
+
```tsx
|
|
78
|
+
<Separator label="OR" />
|
|
79
|
+
|
|
80
|
+
<Separator
|
|
81
|
+
label="SECTION DIVIDER"
|
|
82
|
+
views={{
|
|
83
|
+
label: {
|
|
84
|
+
fontWeight: 'bold',
|
|
85
|
+
color: 'color.blue.500',
|
|
86
|
+
textTransform: 'uppercase',
|
|
87
|
+
}
|
|
88
|
+
}}
|
|
89
|
+
/>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### **In Card**
|
|
93
|
+
The Separator component can be used within cards to separate content sections:
|
|
94
|
+
|
|
95
|
+
```tsx
|
|
96
|
+
<Card variant="outlined" shape="rounded">
|
|
97
|
+
<Card.Header>
|
|
98
|
+
<Text fontWeight="bold" size="lg">Card Title</Text>
|
|
99
|
+
</Card.Header>
|
|
100
|
+
<Card.Content>
|
|
101
|
+
<Text>
|
|
102
|
+
This is the first section of content in the card.
|
|
103
|
+
</Text>
|
|
104
|
+
<Separator spacing="8px" />
|
|
105
|
+
<Text>
|
|
106
|
+
This is the second section of content.
|
|
107
|
+
</Text>
|
|
108
|
+
<Separator label="ADDITIONAL INFORMATION" spacing="8px" />
|
|
109
|
+
<Text>
|
|
110
|
+
This is the third section with additional information.
|
|
111
|
+
</Text>
|
|
112
|
+
</Card.Content>
|
|
113
|
+
</Card>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### **Accessibility**
|
|
117
|
+
By default, the Separator component has a semantic role of `separator`. If the separator is purely decorative, you can set the `decorative` prop to `true` to hide it from screen readers:
|
|
118
|
+
|
|
119
|
+
```tsx
|
|
120
|
+
<Separator decorative={true} />
|
|
121
|
+
```
|