@uipath/apollo-wind 0.8.1 → 0.9.1

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 (34) hide show
  1. package/dist/archived-ui-path.svg +3 -0
  2. package/dist/components/ui/index.cjs +2 -2
  3. package/dist/examples/admin-layout-example.cjs +490 -0
  4. package/dist/examples/admin-layout-example.js +411 -0
  5. package/dist/examples/app-shell-example.cjs +452 -0
  6. package/dist/examples/app-shell-example.js +418 -0
  7. package/dist/examples/dashboard-example.cjs +590 -0
  8. package/dist/examples/dashboard-example.js +556 -0
  9. package/dist/examples/data-management-example.cjs +584 -0
  10. package/dist/examples/data-management-example.js +550 -0
  11. package/dist/examples/flow-editor-layout-example.cjs +309 -0
  12. package/dist/examples/flow-editor-layout-example.js +269 -0
  13. package/dist/examples/flow-start-example.cjs +467 -0
  14. package/dist/examples/flow-start-example.js +433 -0
  15. package/dist/examples/form-builder-example.cjs +674 -0
  16. package/dist/examples/form-builder-example.js +640 -0
  17. package/dist/examples/new-project-example.cjs +550 -0
  18. package/dist/examples/new-project-example.js +516 -0
  19. package/dist/examples/settings-example.cjs +864 -0
  20. package/dist/examples/settings-example.js +830 -0
  21. package/dist/examples/vscode-example.cjs +340 -0
  22. package/dist/examples/vscode-example.js +270 -0
  23. package/dist/templates/admin-layout-example.d.ts +92 -0
  24. package/dist/templates/app-shell-example.d.ts +52 -0
  25. package/dist/templates/dashboard-example.d.ts +11 -0
  26. package/dist/templates/data-management-example.d.ts +1 -0
  27. package/dist/templates/flow-editor-layout-example.d.ts +22 -0
  28. package/dist/templates/flow-start-example.d.ts +30 -0
  29. package/dist/templates/form-builder-example.d.ts +1 -0
  30. package/dist/templates/new-project-example.d.ts +30 -0
  31. package/dist/templates/settings-example.d.ts +1 -0
  32. package/dist/templates/vscode-example.d.ts +80 -0
  33. package/dist/ui-path.svg +11 -0
  34. package/package.json +1 -1
@@ -0,0 +1,550 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { useMemo, useState } from "react";
3
+ import { Download, Filter, MoreHorizontal, Plus, RefreshCw, Upload } from "lucide-react";
4
+ import { Badge } from "../components/ui/badge.js";
5
+ import { Button } from "../components/ui/button.js";
6
+ import { DataTable, DataTableColumnHeader, DataTableSelectColumn } from "../components/ui/data-table.js";
7
+ import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "../components/ui/dialog.js";
8
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from "../components/ui/dropdown-menu.js";
9
+ import { Input } from "../components/ui/input.js";
10
+ import { Label } from "../components/ui/label.js";
11
+ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../components/ui/select.js";
12
+ import { Tabs, TabsList, TabsTrigger } from "../components/ui/tabs.js";
13
+ import { Column, Grid, Row } from "../components/ui/layout/index.js";
14
+ const products = [
15
+ {
16
+ id: '1',
17
+ name: 'Wireless Headphones',
18
+ sku: 'WH-001',
19
+ category: 'Electronics',
20
+ price: 99.99,
21
+ stock: 150,
22
+ status: 'active',
23
+ createdAt: '2024-01-10'
24
+ },
25
+ {
26
+ id: '2',
27
+ name: 'USB-C Cable',
28
+ sku: 'UC-002',
29
+ category: 'Accessories',
30
+ price: 12.99,
31
+ stock: 500,
32
+ status: 'active',
33
+ createdAt: '2024-01-09'
34
+ },
35
+ {
36
+ id: '3',
37
+ name: 'Laptop Stand',
38
+ sku: 'LS-003',
39
+ category: 'Accessories',
40
+ price: 49.99,
41
+ stock: 75,
42
+ status: 'active',
43
+ createdAt: '2024-01-08'
44
+ },
45
+ {
46
+ id: '4',
47
+ name: 'Mechanical Keyboard',
48
+ sku: 'MK-004',
49
+ category: 'Electronics',
50
+ price: 149.99,
51
+ stock: 0,
52
+ status: 'draft',
53
+ createdAt: '2024-01-07'
54
+ },
55
+ {
56
+ id: '5',
57
+ name: 'Monitor Light Bar',
58
+ sku: 'ML-005',
59
+ category: 'Electronics',
60
+ price: 59.99,
61
+ stock: 200,
62
+ status: 'active',
63
+ createdAt: '2024-01-06'
64
+ },
65
+ {
66
+ id: '6',
67
+ name: 'Webcam HD',
68
+ sku: 'WC-006',
69
+ category: 'Electronics',
70
+ price: 79.99,
71
+ stock: 45,
72
+ status: 'active',
73
+ createdAt: '2024-01-05'
74
+ },
75
+ {
76
+ id: '7',
77
+ name: 'Mouse Pad XL',
78
+ sku: 'MP-007',
79
+ category: 'Accessories',
80
+ price: 24.99,
81
+ stock: 300,
82
+ status: 'active',
83
+ createdAt: '2024-01-04'
84
+ },
85
+ {
86
+ id: '8',
87
+ name: 'Phone Holder',
88
+ sku: 'PH-008',
89
+ category: 'Accessories',
90
+ price: 19.99,
91
+ stock: 0,
92
+ status: 'archived',
93
+ createdAt: '2024-01-03'
94
+ },
95
+ {
96
+ id: '9',
97
+ name: 'Bluetooth Speaker',
98
+ sku: 'BS-009',
99
+ category: 'Electronics',
100
+ price: 39.99,
101
+ stock: 120,
102
+ status: 'active',
103
+ createdAt: '2024-01-02'
104
+ },
105
+ {
106
+ id: '10',
107
+ name: 'Screen Protector',
108
+ sku: 'SP-010',
109
+ category: 'Accessories',
110
+ price: 9.99,
111
+ stock: 1000,
112
+ status: 'active',
113
+ createdAt: '2024-01-01'
114
+ }
115
+ ];
116
+ const columns = [
117
+ DataTableSelectColumn(),
118
+ {
119
+ accessorKey: 'name',
120
+ header: ({ column })=>/*#__PURE__*/ jsx(DataTableColumnHeader, {
121
+ column: column,
122
+ title: "Product"
123
+ }),
124
+ cell: ({ row })=>/*#__PURE__*/ jsxs("div", {
125
+ children: [
126
+ /*#__PURE__*/ jsx("div", {
127
+ className: "font-medium",
128
+ children: row.original.name
129
+ }),
130
+ /*#__PURE__*/ jsx("div", {
131
+ className: "text-xs text-muted-foreground",
132
+ children: row.original.sku
133
+ })
134
+ ]
135
+ })
136
+ },
137
+ {
138
+ accessorKey: 'category',
139
+ header: ({ column })=>/*#__PURE__*/ jsx(DataTableColumnHeader, {
140
+ column: column,
141
+ title: "Category"
142
+ })
143
+ },
144
+ {
145
+ accessorKey: 'price',
146
+ header: ({ column })=>/*#__PURE__*/ jsx(DataTableColumnHeader, {
147
+ column: column,
148
+ title: "Price"
149
+ }),
150
+ cell: ({ row })=>{
151
+ const price = parseFloat(row.getValue('price'));
152
+ return new Intl.NumberFormat('en-US', {
153
+ style: 'currency',
154
+ currency: 'USD'
155
+ }).format(price);
156
+ }
157
+ },
158
+ {
159
+ accessorKey: 'stock',
160
+ header: ({ column })=>/*#__PURE__*/ jsx(DataTableColumnHeader, {
161
+ column: column,
162
+ title: "Stock"
163
+ }),
164
+ cell: ({ row })=>{
165
+ const stock = row.getValue('stock');
166
+ return /*#__PURE__*/ jsx("span", {
167
+ className: 0 === stock ? 'text-destructive font-medium' : '',
168
+ children: 0 === stock ? 'Out of stock' : stock
169
+ });
170
+ }
171
+ },
172
+ {
173
+ accessorKey: 'status',
174
+ header: ({ column })=>/*#__PURE__*/ jsx(DataTableColumnHeader, {
175
+ column: column,
176
+ title: "Status"
177
+ }),
178
+ cell: ({ row })=>{
179
+ const status = row.getValue('status');
180
+ return /*#__PURE__*/ jsx(Badge, {
181
+ variant: 'active' === status ? 'default' : 'draft' === status ? 'secondary' : 'outline',
182
+ children: status
183
+ });
184
+ }
185
+ },
186
+ {
187
+ accessorKey: 'createdAt',
188
+ header: ({ column })=>/*#__PURE__*/ jsx(DataTableColumnHeader, {
189
+ column: column,
190
+ title: "Created"
191
+ })
192
+ },
193
+ {
194
+ id: 'actions',
195
+ cell: ()=>/*#__PURE__*/ jsxs(DropdownMenu, {
196
+ children: [
197
+ /*#__PURE__*/ jsx(DropdownMenuTrigger, {
198
+ asChild: true,
199
+ children: /*#__PURE__*/ jsx(Button, {
200
+ variant: "ghost",
201
+ size: "icon",
202
+ className: "h-8 w-8",
203
+ children: /*#__PURE__*/ jsx(MoreHorizontal, {
204
+ className: "h-4 w-4"
205
+ })
206
+ })
207
+ }),
208
+ /*#__PURE__*/ jsxs(DropdownMenuContent, {
209
+ align: "end",
210
+ children: [
211
+ /*#__PURE__*/ jsx(DropdownMenuItem, {
212
+ children: "Edit"
213
+ }),
214
+ /*#__PURE__*/ jsx(DropdownMenuItem, {
215
+ children: "Duplicate"
216
+ }),
217
+ /*#__PURE__*/ jsx(DropdownMenuSeparator, {}),
218
+ /*#__PURE__*/ jsx(DropdownMenuItem, {
219
+ className: "text-destructive",
220
+ children: "Delete"
221
+ })
222
+ ]
223
+ })
224
+ ]
225
+ })
226
+ }
227
+ ];
228
+ function DataManagementExample() {
229
+ const [activeTab, setActiveTab] = useState('all');
230
+ const [categoryFilter, setCategoryFilter] = useState('all');
231
+ const [isCreateDialogOpen, setIsCreateDialogOpen] = useState(false);
232
+ const filteredProducts = useMemo(()=>{
233
+ let filtered = products;
234
+ if ('all' !== activeTab) filtered = filtered.filter((p)=>p.status === activeTab);
235
+ if ('all' !== categoryFilter) filtered = filtered.filter((p)=>p.category === categoryFilter);
236
+ return filtered;
237
+ }, [
238
+ activeTab,
239
+ categoryFilter
240
+ ]);
241
+ const categories = [
242
+ ...new Set(products.map((p)=>p.category))
243
+ ];
244
+ return /*#__PURE__*/ jsxs(Column, {
245
+ minH: "screen",
246
+ className: "bg-background",
247
+ children: [
248
+ /*#__PURE__*/ jsx("header", {
249
+ className: "border-b",
250
+ children: /*#__PURE__*/ jsxs(Row, {
251
+ h: 14,
252
+ justify: "between",
253
+ align: "center",
254
+ className: "container mx-auto px-4",
255
+ children: [
256
+ /*#__PURE__*/ jsx(Column, {
257
+ gap: 0,
258
+ children: /*#__PURE__*/ jsx("h1", {
259
+ className: "text-lg font-semibold",
260
+ children: "Products"
261
+ })
262
+ }),
263
+ /*#__PURE__*/ jsxs(Row, {
264
+ gap: 2,
265
+ align: "center",
266
+ children: [
267
+ /*#__PURE__*/ jsxs(Button, {
268
+ variant: "outline",
269
+ size: "sm",
270
+ children: [
271
+ /*#__PURE__*/ jsx(Upload, {
272
+ className: "mr-2 h-4 w-4"
273
+ }),
274
+ "Import"
275
+ ]
276
+ }),
277
+ /*#__PURE__*/ jsxs(Button, {
278
+ variant: "outline",
279
+ size: "sm",
280
+ children: [
281
+ /*#__PURE__*/ jsx(Download, {
282
+ className: "mr-2 h-4 w-4"
283
+ }),
284
+ "Export"
285
+ ]
286
+ }),
287
+ /*#__PURE__*/ jsxs(Dialog, {
288
+ open: isCreateDialogOpen,
289
+ onOpenChange: setIsCreateDialogOpen,
290
+ children: [
291
+ /*#__PURE__*/ jsx(DialogTrigger, {
292
+ asChild: true,
293
+ children: /*#__PURE__*/ jsxs(Button, {
294
+ size: "sm",
295
+ children: [
296
+ /*#__PURE__*/ jsx(Plus, {
297
+ className: "mr-2 h-4 w-4"
298
+ }),
299
+ "Add Product"
300
+ ]
301
+ })
302
+ }),
303
+ /*#__PURE__*/ jsxs(DialogContent, {
304
+ children: [
305
+ /*#__PURE__*/ jsxs(DialogHeader, {
306
+ children: [
307
+ /*#__PURE__*/ jsx(DialogTitle, {
308
+ children: "Add New Product"
309
+ }),
310
+ /*#__PURE__*/ jsx(DialogDescription, {
311
+ children: "Enter the details for the new product."
312
+ })
313
+ ]
314
+ }),
315
+ /*#__PURE__*/ jsxs(Column, {
316
+ gap: 4,
317
+ className: "py-4",
318
+ children: [
319
+ /*#__PURE__*/ jsxs(Column, {
320
+ gap: 2,
321
+ children: [
322
+ /*#__PURE__*/ jsx(Label, {
323
+ htmlFor: "productName",
324
+ children: "Product name"
325
+ }),
326
+ /*#__PURE__*/ jsx(Input, {
327
+ id: "productName",
328
+ placeholder: "Enter product name"
329
+ })
330
+ ]
331
+ }),
332
+ /*#__PURE__*/ jsxs(Grid, {
333
+ cols: 2,
334
+ gap: 4,
335
+ children: [
336
+ /*#__PURE__*/ jsxs(Column, {
337
+ gap: 2,
338
+ children: [
339
+ /*#__PURE__*/ jsx(Label, {
340
+ htmlFor: "sku",
341
+ children: "SKU"
342
+ }),
343
+ /*#__PURE__*/ jsx(Input, {
344
+ id: "sku",
345
+ placeholder: "XX-000"
346
+ })
347
+ ]
348
+ }),
349
+ /*#__PURE__*/ jsxs(Column, {
350
+ gap: 2,
351
+ children: [
352
+ /*#__PURE__*/ jsx(Label, {
353
+ htmlFor: "price",
354
+ children: "Price"
355
+ }),
356
+ /*#__PURE__*/ jsx(Input, {
357
+ id: "price",
358
+ type: "number",
359
+ placeholder: "0.00"
360
+ })
361
+ ]
362
+ })
363
+ ]
364
+ }),
365
+ /*#__PURE__*/ jsxs(Column, {
366
+ gap: 2,
367
+ children: [
368
+ /*#__PURE__*/ jsx(Label, {
369
+ htmlFor: "category",
370
+ children: "Category"
371
+ }),
372
+ /*#__PURE__*/ jsxs(Select, {
373
+ children: [
374
+ /*#__PURE__*/ jsx(SelectTrigger, {
375
+ id: "category",
376
+ children: /*#__PURE__*/ jsx(SelectValue, {
377
+ placeholder: "Select category"
378
+ })
379
+ }),
380
+ /*#__PURE__*/ jsx(SelectContent, {
381
+ children: categories.map((cat)=>/*#__PURE__*/ jsx(SelectItem, {
382
+ value: cat,
383
+ children: cat
384
+ }, cat))
385
+ })
386
+ ]
387
+ })
388
+ ]
389
+ }),
390
+ /*#__PURE__*/ jsxs(Column, {
391
+ gap: 2,
392
+ children: [
393
+ /*#__PURE__*/ jsx(Label, {
394
+ htmlFor: "stock",
395
+ children: "Initial stock"
396
+ }),
397
+ /*#__PURE__*/ jsx(Input, {
398
+ id: "stock",
399
+ type: "number",
400
+ placeholder: "0"
401
+ })
402
+ ]
403
+ })
404
+ ]
405
+ }),
406
+ /*#__PURE__*/ jsxs(DialogFooter, {
407
+ children: [
408
+ /*#__PURE__*/ jsx(Button, {
409
+ variant: "outline",
410
+ onClick: ()=>setIsCreateDialogOpen(false),
411
+ children: "Cancel"
412
+ }),
413
+ /*#__PURE__*/ jsx(Button, {
414
+ onClick: ()=>setIsCreateDialogOpen(false),
415
+ children: "Create product"
416
+ })
417
+ ]
418
+ })
419
+ ]
420
+ })
421
+ ]
422
+ })
423
+ ]
424
+ })
425
+ ]
426
+ })
427
+ }),
428
+ /*#__PURE__*/ jsxs("main", {
429
+ className: "container mx-auto p-4 md:p-6",
430
+ children: [
431
+ /*#__PURE__*/ jsxs(Row, {
432
+ gap: 4,
433
+ justify: "between",
434
+ align: "center",
435
+ className: "mb-4 flex-col sm:flex-row sm:items-center",
436
+ children: [
437
+ /*#__PURE__*/ jsx(Tabs, {
438
+ value: activeTab,
439
+ onValueChange: setActiveTab,
440
+ children: /*#__PURE__*/ jsxs(TabsList, {
441
+ children: [
442
+ /*#__PURE__*/ jsxs(TabsTrigger, {
443
+ value: "all",
444
+ children: [
445
+ "All",
446
+ ' ',
447
+ /*#__PURE__*/ jsx(Badge, {
448
+ variant: "secondary",
449
+ className: "ml-2",
450
+ children: products.length
451
+ })
452
+ ]
453
+ }),
454
+ /*#__PURE__*/ jsxs(TabsTrigger, {
455
+ value: "active",
456
+ children: [
457
+ "Active",
458
+ ' ',
459
+ /*#__PURE__*/ jsx(Badge, {
460
+ variant: "secondary",
461
+ className: "ml-2",
462
+ children: products.filter((p)=>'active' === p.status).length
463
+ })
464
+ ]
465
+ }),
466
+ /*#__PURE__*/ jsxs(TabsTrigger, {
467
+ value: "draft",
468
+ children: [
469
+ "Draft",
470
+ ' ',
471
+ /*#__PURE__*/ jsx(Badge, {
472
+ variant: "secondary",
473
+ className: "ml-2",
474
+ children: products.filter((p)=>'draft' === p.status).length
475
+ })
476
+ ]
477
+ }),
478
+ /*#__PURE__*/ jsxs(TabsTrigger, {
479
+ value: "archived",
480
+ children: [
481
+ "Archived",
482
+ ' ',
483
+ /*#__PURE__*/ jsx(Badge, {
484
+ variant: "secondary",
485
+ className: "ml-2",
486
+ children: products.filter((p)=>'archived' === p.status).length
487
+ })
488
+ ]
489
+ })
490
+ ]
491
+ })
492
+ }),
493
+ /*#__PURE__*/ jsxs(Row, {
494
+ gap: 2,
495
+ align: "center",
496
+ children: [
497
+ /*#__PURE__*/ jsxs(Select, {
498
+ value: categoryFilter,
499
+ onValueChange: setCategoryFilter,
500
+ children: [
501
+ /*#__PURE__*/ jsxs(SelectTrigger, {
502
+ className: "w-[150px]",
503
+ children: [
504
+ /*#__PURE__*/ jsx(Filter, {
505
+ className: "mr-2 h-4 w-4"
506
+ }),
507
+ /*#__PURE__*/ jsx(SelectValue, {
508
+ placeholder: "Category"
509
+ })
510
+ ]
511
+ }),
512
+ /*#__PURE__*/ jsxs(SelectContent, {
513
+ children: [
514
+ /*#__PURE__*/ jsx(SelectItem, {
515
+ value: "all",
516
+ children: "All categories"
517
+ }),
518
+ categories.map((cat)=>/*#__PURE__*/ jsx(SelectItem, {
519
+ value: cat,
520
+ children: cat
521
+ }, cat))
522
+ ]
523
+ })
524
+ ]
525
+ }),
526
+ /*#__PURE__*/ jsx(Button, {
527
+ variant: "outline",
528
+ size: "icon",
529
+ children: /*#__PURE__*/ jsx(RefreshCw, {
530
+ className: "h-4 w-4"
531
+ })
532
+ })
533
+ ]
534
+ })
535
+ ]
536
+ }),
537
+ /*#__PURE__*/ jsx(DataTable, {
538
+ columns: columns,
539
+ data: filteredProducts,
540
+ searchKey: "name",
541
+ searchPlaceholder: "Search products...",
542
+ resizable: true,
543
+ compact: true
544
+ })
545
+ ]
546
+ })
547
+ ]
548
+ });
549
+ }
550
+ export { DataManagementExample };