@app-studio/web 0.9.30 → 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.
- package/dist/components/Text/Text/Text.view.d.ts +1 -0
- package/dist/web.cjs.development.js +3 -3
- package/dist/web.cjs.development.js.map +1 -1
- package/dist/web.cjs.production.min.js +1 -1
- package/dist/web.cjs.production.min.js.map +1 -1
- package/dist/web.esm.js +3 -3
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.development.js +3 -3
- package/dist/web.umd.development.js.map +1 -1
- package/dist/web.umd.production.min.js +1 -1
- package/dist/web.umd.production.min.js.map +1 -1
- 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/package.json +1 -1
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
# Table
|
|
2
|
+
|
|
3
|
+
Renders a customizable data table with optional footer and caption.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
| Prop | Type | Description | Default |
|
|
8
|
+
| ---------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ------- |
|
|
9
|
+
| columns | array | Array of column objects, each defining a title and field. | |
|
|
10
|
+
| data | array | Array of data objects to be displayed in the table rows. | |
|
|
11
|
+
| footer | array | Optional array of footer cells to add at the bottom of the table. | |
|
|
12
|
+
| caption | ReactNode | Optional table caption as a React node. | |
|
|
13
|
+
| styles | CSSProperties | Optional custom styles to apply to the table and its elements. | |
|
|
14
|
+
| className | string | Optional className for the table. | |
|
|
15
|
+
|
|
16
|
+
### **Import**
|
|
17
|
+
```tsx
|
|
18
|
+
import { Table } from '@app-studio/web';
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### **Default**
|
|
22
|
+
```tsx
|
|
23
|
+
import React from 'react';
|
|
24
|
+
import {
|
|
25
|
+
TableContainer,
|
|
26
|
+
TableCaption,
|
|
27
|
+
TableHead,
|
|
28
|
+
TableRow,
|
|
29
|
+
TableHeadCell,
|
|
30
|
+
TableBody,
|
|
31
|
+
TableCell,
|
|
32
|
+
} from '../Table/Table.view';
|
|
33
|
+
|
|
34
|
+
export const DefaultDemo = () => {
|
|
35
|
+
interface DataRow {
|
|
36
|
+
invoice: string;
|
|
37
|
+
paymentStatus: string;
|
|
38
|
+
totalAmount: string;
|
|
39
|
+
paymentMethod: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const columns = [
|
|
43
|
+
{ title: 'Invoice', field: 'invoice' },
|
|
44
|
+
{ title: 'Payment Status', field: 'paymentStatus' },
|
|
45
|
+
{ title: 'Total Amount', field: 'totalAmount' },
|
|
46
|
+
{ title: 'Payment Method', field: 'paymentMethod' },
|
|
47
|
+
];
|
|
48
|
+
const data: DataRow[] = [
|
|
49
|
+
{
|
|
50
|
+
invoice: 'INV001',
|
|
51
|
+
paymentStatus: 'Paid',
|
|
52
|
+
totalAmount: '$250.00',
|
|
53
|
+
paymentMethod: 'Credit Card',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
invoice: 'INV002',
|
|
57
|
+
paymentStatus: 'Pending',
|
|
58
|
+
totalAmount: '$150.00',
|
|
59
|
+
paymentMethod: 'PayPal',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
invoice: 'INV003',
|
|
63
|
+
paymentStatus: 'Unpaid',
|
|
64
|
+
totalAmount: '$350.00',
|
|
65
|
+
paymentMethod: 'Bank Transfer',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
invoice: 'INV004',
|
|
69
|
+
paymentStatus: 'Paid',
|
|
70
|
+
totalAmount: '$450.00',
|
|
71
|
+
paymentMethod: 'Credit Card',
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
invoice: 'INV005',
|
|
75
|
+
paymentStatus: 'Paid',
|
|
76
|
+
totalAmount: '$550.00',
|
|
77
|
+
paymentMethod: 'PayPal',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
invoice: 'INV006',
|
|
81
|
+
paymentStatus: 'Pending',
|
|
82
|
+
totalAmount: '$200.00',
|
|
83
|
+
paymentMethod: 'Bank Transfer',
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
invoice: 'INV007',
|
|
87
|
+
paymentStatus: 'Unpaid',
|
|
88
|
+
totalAmount: '$300.00',
|
|
89
|
+
paymentMethod: 'Credit Card',
|
|
90
|
+
},
|
|
91
|
+
];
|
|
92
|
+
return (
|
|
93
|
+
<TableContainer>
|
|
94
|
+
<TableCaption>A list of your recent invoices.</TableCaption>
|
|
95
|
+
<TableHead>
|
|
96
|
+
<TableRow>
|
|
97
|
+
{columns.map((column) => (
|
|
98
|
+
<TableHeadCell key={column.field}>{column.title}</TableHeadCell>
|
|
99
|
+
))}
|
|
100
|
+
</TableRow>
|
|
101
|
+
</TableHead>
|
|
102
|
+
<TableBody>
|
|
103
|
+
{data.map((row, index) => (
|
|
104
|
+
<TableRow key={index}>
|
|
105
|
+
{columns.map((column, columnIndex) => (
|
|
106
|
+
<TableCell key={column.field} isFirstColumn={columnIndex === 0}>
|
|
107
|
+
{row[column.field as keyof DataRow]}
|
|
108
|
+
</TableCell>
|
|
109
|
+
))}
|
|
110
|
+
</TableRow>
|
|
111
|
+
))}
|
|
112
|
+
</TableBody>
|
|
113
|
+
</TableContainer>
|
|
114
|
+
);
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### **data**
|
|
120
|
+
Array of data objects to be displayed in the table rows.
|
|
121
|
+
|
|
122
|
+
```tsx
|
|
123
|
+
import React from 'react';
|
|
124
|
+
import { Table } from '../Table';
|
|
125
|
+
|
|
126
|
+
export const DataDemo = () => {
|
|
127
|
+
const cols = [
|
|
128
|
+
{ title: 'Invoice', field: 'invoice' },
|
|
129
|
+
{ title: 'Payment Status', field: 'paymentStatus' },
|
|
130
|
+
{ title: 'Total Amount', field: 'totalAmount' },
|
|
131
|
+
{ title: 'Payment Method', field: 'paymentMethod' },
|
|
132
|
+
];
|
|
133
|
+
const invoices = [
|
|
134
|
+
{
|
|
135
|
+
invoice: 'INV001',
|
|
136
|
+
paymentStatus: 'Paid',
|
|
137
|
+
totalAmount: '$250.00',
|
|
138
|
+
paymentMethod: 'Credit Card',
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
invoice: 'INV002',
|
|
142
|
+
paymentStatus: 'Pending',
|
|
143
|
+
totalAmount: '$150.00',
|
|
144
|
+
paymentMethod: 'PayPal',
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
invoice: 'INV003',
|
|
148
|
+
paymentStatus: 'Unpaid',
|
|
149
|
+
totalAmount: '$350.00',
|
|
150
|
+
paymentMethod: 'Bank Transfer',
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
invoice: 'INV004',
|
|
154
|
+
paymentStatus: 'Paid',
|
|
155
|
+
totalAmount: '$450.00',
|
|
156
|
+
paymentMethod: 'Credit Card',
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
invoice: 'INV005',
|
|
160
|
+
paymentStatus: 'Paid',
|
|
161
|
+
totalAmount: '$550.00',
|
|
162
|
+
paymentMethod: 'PayPal',
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
invoice: 'INV006',
|
|
166
|
+
paymentStatus: 'Pending',
|
|
167
|
+
totalAmount: '$200.00',
|
|
168
|
+
paymentMethod: 'Bank Transfer',
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
invoice: 'INV007',
|
|
172
|
+
paymentStatus: 'Unpaid',
|
|
173
|
+
totalAmount: '$300.00',
|
|
174
|
+
paymentMethod: 'Credit Card',
|
|
175
|
+
},
|
|
176
|
+
];
|
|
177
|
+
return <Table.Template columns={cols} data={invoices} />;
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### **footer**
|
|
183
|
+
Optional array of footer cells to add at the bottom of the table.
|
|
184
|
+
|
|
185
|
+
```tsx
|
|
186
|
+
import React from 'react';
|
|
187
|
+
import { Table } from '../Table';
|
|
188
|
+
|
|
189
|
+
export const FooterDemo = () => {
|
|
190
|
+
const cols = [
|
|
191
|
+
{ title: 'Invoice', field: 'invoice' },
|
|
192
|
+
{ title: 'Payment Status', field: 'paymentStatus' },
|
|
193
|
+
{ title: 'Total Amount', field: 'totalAmount' },
|
|
194
|
+
{ title: 'Payment Method', field: 'paymentMethod' },
|
|
195
|
+
];
|
|
196
|
+
const invoices = [
|
|
197
|
+
{
|
|
198
|
+
invoice: 'INV001',
|
|
199
|
+
paymentStatus: 'Paid',
|
|
200
|
+
totalAmount: '$250.00',
|
|
201
|
+
paymentMethod: 'Credit Card',
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
invoice: 'INV002',
|
|
205
|
+
paymentStatus: 'Pending',
|
|
206
|
+
totalAmount: '$150.00',
|
|
207
|
+
paymentMethod: 'PayPal',
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
invoice: 'INV003',
|
|
211
|
+
paymentStatus: 'Unpaid',
|
|
212
|
+
totalAmount: '$350.00',
|
|
213
|
+
paymentMethod: 'Bank Transfer',
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
invoice: 'INV004',
|
|
217
|
+
paymentStatus: 'Paid',
|
|
218
|
+
totalAmount: '$450.00',
|
|
219
|
+
paymentMethod: 'Credit Card',
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
invoice: 'INV005',
|
|
223
|
+
paymentStatus: 'Paid',
|
|
224
|
+
totalAmount: '$550.00',
|
|
225
|
+
paymentMethod: 'PayPal',
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
invoice: 'INV006',
|
|
229
|
+
paymentStatus: 'Pending',
|
|
230
|
+
totalAmount: '$200.00',
|
|
231
|
+
paymentMethod: 'Bank Transfer',
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
invoice: 'INV007',
|
|
235
|
+
paymentStatus: 'Unpaid',
|
|
236
|
+
totalAmount: '$300.00',
|
|
237
|
+
paymentMethod: 'Credit Card',
|
|
238
|
+
},
|
|
239
|
+
];
|
|
240
|
+
return (
|
|
241
|
+
<Table
|
|
242
|
+
views={{
|
|
243
|
+
tfoot: {
|
|
244
|
+
borderTop: '1px solid gray',
|
|
245
|
+
borderBottom: '1px solid gray',
|
|
246
|
+
},
|
|
247
|
+
}}
|
|
248
|
+
>
|
|
249
|
+
<Table.Template
|
|
250
|
+
columns={cols}
|
|
251
|
+
data={invoices}
|
|
252
|
+
footer={[
|
|
253
|
+
{
|
|
254
|
+
value: 'Total Amount',
|
|
255
|
+
props: { colspan: 3, style: { fontWeight: 'bold' } },
|
|
256
|
+
},
|
|
257
|
+
{ value: '$2,500.00' },
|
|
258
|
+
]}
|
|
259
|
+
/>
|
|
260
|
+
</Table>
|
|
261
|
+
);
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
### **caption**
|
|
267
|
+
Optional table caption as a React node.
|
|
268
|
+
|
|
269
|
+
```tsx
|
|
270
|
+
import React from 'react';
|
|
271
|
+
import { Table } from '../Table';
|
|
272
|
+
|
|
273
|
+
export const CaptionDemo = () => {
|
|
274
|
+
const cols = [
|
|
275
|
+
{ title: 'Invoice', field: 'invoice' },
|
|
276
|
+
{ title: 'Payment Status', field: 'paymentStatus' },
|
|
277
|
+
{ title: 'Total Amount', field: 'totalAmount' },
|
|
278
|
+
{ title: 'Payment Method', field: 'paymentMethod' },
|
|
279
|
+
];
|
|
280
|
+
const invoices = [
|
|
281
|
+
{
|
|
282
|
+
invoice: 'INV001',
|
|
283
|
+
paymentStatus: 'Paid',
|
|
284
|
+
totalAmount: '$250.00',
|
|
285
|
+
paymentMethod: 'Credit Card',
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
invoice: 'INV002',
|
|
289
|
+
paymentStatus: 'Pending',
|
|
290
|
+
totalAmount: '$150.00',
|
|
291
|
+
paymentMethod: 'PayPal',
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
invoice: 'INV003',
|
|
295
|
+
paymentStatus: 'Unpaid',
|
|
296
|
+
totalAmount: '$350.00',
|
|
297
|
+
paymentMethod: 'Bank Transfer',
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
invoice: 'INV004',
|
|
301
|
+
paymentStatus: 'Paid',
|
|
302
|
+
totalAmount: '$450.00',
|
|
303
|
+
paymentMethod: 'Credit Card',
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
invoice: 'INV005',
|
|
307
|
+
paymentStatus: 'Paid',
|
|
308
|
+
totalAmount: '$550.00',
|
|
309
|
+
paymentMethod: 'PayPal',
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
invoice: 'INV006',
|
|
313
|
+
paymentStatus: 'Pending',
|
|
314
|
+
totalAmount: '$200.00',
|
|
315
|
+
paymentMethod: 'Bank Transfer',
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
invoice: 'INV007',
|
|
319
|
+
paymentStatus: 'Unpaid',
|
|
320
|
+
totalAmount: '$300.00',
|
|
321
|
+
paymentMethod: 'Credit Card',
|
|
322
|
+
},
|
|
323
|
+
];
|
|
324
|
+
return (
|
|
325
|
+
<Table.Template
|
|
326
|
+
caption="A list of your recent invoices."
|
|
327
|
+
columns={cols}
|
|
328
|
+
data={invoices}
|
|
329
|
+
/>
|
|
330
|
+
);
|
|
331
|
+
};
|
|
332
|
+
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
### **styles**
|
|
336
|
+
Optional custom styles to apply to the table and its elements.
|
|
337
|
+
|
|
338
|
+
```tsx
|
|
339
|
+
import React from 'react';
|
|
340
|
+
import { Table } from '../Table';
|
|
341
|
+
|
|
342
|
+
export const StylesDemo = () => {
|
|
343
|
+
const cols = [
|
|
344
|
+
{ title: 'Invoice', field: 'invoice' },
|
|
345
|
+
{ title: 'Payment Status', field: 'paymentStatus' },
|
|
346
|
+
{ title: 'Total Amount', field: 'totalAmount' },
|
|
347
|
+
{ title: 'Payment Method', field: 'paymentMethod' },
|
|
348
|
+
];
|
|
349
|
+
const invoices = [
|
|
350
|
+
{
|
|
351
|
+
invoice: 'INV001',
|
|
352
|
+
paymentStatus: 'Paid',
|
|
353
|
+
totalAmount: '$250.00',
|
|
354
|
+
paymentMethod: 'Credit Card',
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
invoice: 'INV002',
|
|
358
|
+
paymentStatus: 'Pending',
|
|
359
|
+
totalAmount: '$150.00',
|
|
360
|
+
paymentMethod: 'PayPal',
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
invoice: 'INV003',
|
|
364
|
+
paymentStatus: 'Unpaid',
|
|
365
|
+
totalAmount: '$350.00',
|
|
366
|
+
paymentMethod: 'Bank Transfer',
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
invoice: 'INV004',
|
|
370
|
+
paymentStatus: 'Paid',
|
|
371
|
+
totalAmount: '$450.00',
|
|
372
|
+
paymentMethod: 'Credit Card',
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
invoice: 'INV005',
|
|
376
|
+
paymentStatus: 'Paid',
|
|
377
|
+
totalAmount: '$550.00',
|
|
378
|
+
paymentMethod: 'PayPal',
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
invoice: 'INV006',
|
|
382
|
+
paymentStatus: 'Pending',
|
|
383
|
+
totalAmount: '$200.00',
|
|
384
|
+
paymentMethod: 'Bank Transfer',
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
invoice: 'INV007',
|
|
388
|
+
paymentStatus: 'Unpaid',
|
|
389
|
+
totalAmount: '$300.00',
|
|
390
|
+
paymentMethod: 'Credit Card',
|
|
391
|
+
},
|
|
392
|
+
];
|
|
393
|
+
return (
|
|
394
|
+
<Table
|
|
395
|
+
views={{
|
|
396
|
+
table: {
|
|
397
|
+
boxShadow:
|
|
398
|
+
' 0 4px 6px rgba(0, 0, 0, 0.1), 0 5px 15px rgba(0, 0, 0, 0.1)',
|
|
399
|
+
|
|
400
|
+
borderRadius: '1em',
|
|
401
|
+
},
|
|
402
|
+
}}
|
|
403
|
+
>
|
|
404
|
+
<Table.Template columns={cols} data={invoices} />
|
|
405
|
+
</Table>
|
|
406
|
+
);
|
|
407
|
+
};
|
|
408
|
+
|
|
409
|
+
```
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
# Tabs
|
|
2
|
+
|
|
3
|
+
Provides an interactive tab interface for content organization
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
| Prop | Type | Description | Default |
|
|
8
|
+
| ---------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ------- |
|
|
9
|
+
| tabs | {title: string; value: string; content: ReactNode;}[] | An array of tab objects, each defining a title, value, and content. | |
|
|
10
|
+
| styles | TabsStyles | Allows for optional styling to be applied to the tabs via a TabsStyles object. | |
|
|
11
|
+
| className | string | Optional className for the tabs. | |
|
|
12
|
+
|
|
13
|
+
### **Import**
|
|
14
|
+
```tsx
|
|
15
|
+
import { Tabs } from '@app-studio/web';
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### **Default**
|
|
19
|
+
```tsx
|
|
20
|
+
import React from 'react';
|
|
21
|
+
import { Tabs, View, Text } from '../..';
|
|
22
|
+
|
|
23
|
+
export const Default = () => (
|
|
24
|
+
<Tabs
|
|
25
|
+
tabs={[
|
|
26
|
+
{
|
|
27
|
+
title: 'Product',
|
|
28
|
+
value: 'product',
|
|
29
|
+
content: (
|
|
30
|
+
<View
|
|
31
|
+
backgroundColor={'purple'}
|
|
32
|
+
borderRadius={10}
|
|
33
|
+
padding="20px 20px 0"
|
|
34
|
+
>
|
|
35
|
+
<Text heading="h5" color="white">
|
|
36
|
+
Product Tab
|
|
37
|
+
</Text>
|
|
38
|
+
<DummyContent />
|
|
39
|
+
</View>
|
|
40
|
+
),
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
title: 'Services',
|
|
44
|
+
value: 'services',
|
|
45
|
+
content: (
|
|
46
|
+
<View
|
|
47
|
+
backgroundColor={'purple'}
|
|
48
|
+
borderRadius={10}
|
|
49
|
+
padding="20px 20px 0"
|
|
50
|
+
>
|
|
51
|
+
<Text heading="h5" color="white">
|
|
52
|
+
Services tab
|
|
53
|
+
</Text>
|
|
54
|
+
<DummyContent />
|
|
55
|
+
</View>
|
|
56
|
+
),
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
title: 'Playground',
|
|
60
|
+
value: 'playground',
|
|
61
|
+
content: (
|
|
62
|
+
<View
|
|
63
|
+
backgroundColor={'purple'}
|
|
64
|
+
borderRadius={10}
|
|
65
|
+
padding="20px 20px 0"
|
|
66
|
+
>
|
|
67
|
+
<Text heading="h5" color="white">
|
|
68
|
+
Playground tab
|
|
69
|
+
</Text>
|
|
70
|
+
<DummyContent />
|
|
71
|
+
</View>
|
|
72
|
+
),
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
title: 'Content',
|
|
76
|
+
value: 'content',
|
|
77
|
+
content: (
|
|
78
|
+
<View
|
|
79
|
+
backgroundColor={'purple'}
|
|
80
|
+
borderRadius={10}
|
|
81
|
+
padding="20px 20px 0"
|
|
82
|
+
>
|
|
83
|
+
<Text heading="h5" color="white">
|
|
84
|
+
Content tab
|
|
85
|
+
</Text>
|
|
86
|
+
<DummyContent />
|
|
87
|
+
</View>
|
|
88
|
+
),
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
title: 'Random',
|
|
92
|
+
value: 'random',
|
|
93
|
+
content: (
|
|
94
|
+
<View
|
|
95
|
+
backgroundColor={'purple'}
|
|
96
|
+
borderRadius={10}
|
|
97
|
+
padding="20px 20px 0"
|
|
98
|
+
>
|
|
99
|
+
<Text heading="h5" color="white">
|
|
100
|
+
Random tab
|
|
101
|
+
</Text>
|
|
102
|
+
<DummyContent />
|
|
103
|
+
</View>
|
|
104
|
+
),
|
|
105
|
+
},
|
|
106
|
+
]}
|
|
107
|
+
/>
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
const DummyContent = () => {
|
|
111
|
+
return (
|
|
112
|
+
<View
|
|
113
|
+
marginTop="20px"
|
|
114
|
+
borderRadius="8px"
|
|
115
|
+
height="300px"
|
|
116
|
+
backgroundColor={'black'}
|
|
117
|
+
></View>
|
|
118
|
+
);
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### **styles**
|
|
124
|
+
Allows for optional styling to be applied to the tabs via a TabsStyles object.
|
|
125
|
+
|
|
126
|
+
```tsx
|
|
127
|
+
import React from 'react';
|
|
128
|
+
import { Text } from '../../Text/Text';
|
|
129
|
+
import { Tabs } from '../../Tabs/Tabs';
|
|
130
|
+
|
|
131
|
+
export const StylesTabs = () => {
|
|
132
|
+
const tabs = [
|
|
133
|
+
{
|
|
134
|
+
title: 'Product',
|
|
135
|
+
value: 'product',
|
|
136
|
+
content: (
|
|
137
|
+
<Text heading="h5" color="white">
|
|
138
|
+
Product Tab
|
|
139
|
+
</Text>
|
|
140
|
+
),
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
title: 'Services',
|
|
144
|
+
value: 'services',
|
|
145
|
+
content: (
|
|
146
|
+
<Text heading="h5" color="white">
|
|
147
|
+
Services tab
|
|
148
|
+
</Text>
|
|
149
|
+
),
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
title: 'Playground',
|
|
153
|
+
value: 'playground',
|
|
154
|
+
content: (
|
|
155
|
+
<Text heading="h5" color="white">
|
|
156
|
+
Playground tab
|
|
157
|
+
</Text>
|
|
158
|
+
),
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
title: 'Content',
|
|
162
|
+
value: 'content',
|
|
163
|
+
content: (
|
|
164
|
+
<Text heading="h5" color="white">
|
|
165
|
+
Content tab
|
|
166
|
+
</Text>
|
|
167
|
+
),
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
title: 'Random',
|
|
171
|
+
value: 'random',
|
|
172
|
+
content: (
|
|
173
|
+
<Text heading="h5" color="white">
|
|
174
|
+
Random tab
|
|
175
|
+
</Text>
|
|
176
|
+
),
|
|
177
|
+
},
|
|
178
|
+
];
|
|
179
|
+
return (
|
|
180
|
+
<Tabs
|
|
181
|
+
tabs={tabs}
|
|
182
|
+
views={{
|
|
183
|
+
container: { backgroundColor: 'black', borderRadius: '20px' },
|
|
184
|
+
headerTabs: {
|
|
185
|
+
backgroundColor: 'purple',
|
|
186
|
+
width: '100%',
|
|
187
|
+
borderRadius: '20px 20px 0 0',
|
|
188
|
+
padding: '10px 0',
|
|
189
|
+
},
|
|
190
|
+
tab: {
|
|
191
|
+
shape: 'rounded',
|
|
192
|
+
},
|
|
193
|
+
title: {
|
|
194
|
+
color: 'color.white',
|
|
195
|
+
},
|
|
196
|
+
content: {
|
|
197
|
+
height: '300px',
|
|
198
|
+
display: 'flex',
|
|
199
|
+
flexDirection: 'column',
|
|
200
|
+
justifyContent: 'center',
|
|
201
|
+
alignItems: 'center',
|
|
202
|
+
},
|
|
203
|
+
activeTab: {
|
|
204
|
+
variant: 'ghost',
|
|
205
|
+
},
|
|
206
|
+
activeText: {
|
|
207
|
+
weight: 'bold',
|
|
208
|
+
size: 'lg',
|
|
209
|
+
},
|
|
210
|
+
}}
|
|
211
|
+
/>
|
|
212
|
+
);
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
```
|