xertica-ui 2.5.2 → 2.5.3

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.
@@ -1,1354 +1,1353 @@
1
- import React, { useState } from 'react';
2
- import { Link, useNavigate } from 'react-router-dom';
3
- import { Button } from '../../ui/button';
4
- import { Input } from '../../ui/input';
5
- import { Label } from '../../ui/label';
6
- import {
7
- Card,
8
- CardHeader,
9
- CardTitle,
10
- CardDescription,
11
- CardContent,
12
- CardFooter,
13
- } from '../../ui/card';
14
- import { Tabs, TabsContent, TabsList, TabsTrigger } from '../../ui/tabs';
15
- import { Badge } from '../../ui/badge';
16
- import { Alert, AlertDescription, AlertTitle } from '../../ui/alert';
17
- import { Checkbox } from '../../ui/checkbox';
18
- import { RadioGroup, RadioGroupItem } from '../../ui/radio-group';
19
- import { Switch } from '../../ui/switch';
20
- import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../../ui/select';
21
- import { Textarea } from '../../ui/textarea';
22
- import { Progress } from '../../ui/progress';
23
- import { Separator } from '../../ui/separator';
24
- import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '../../ui/table';
25
- import {
26
- Settings,
27
- User,
28
- Mail,
29
- Phone,
30
- Calendar,
31
- Search,
32
- Menu,
33
- ChevronRight,
34
- Home,
35
- Users,
36
- Plus,
37
- Trash2,
38
- Archive,
39
- ArrowRightLeft,
40
- History,
41
- PanelRight,
42
- FileEdit,
43
- Filter,
44
- Clock,
45
- Map,
46
- Bell,
47
- } from 'lucide-react';
48
- import { Slider } from '../../ui/slider';
49
- import { toast } from 'sonner';
50
- import { ScrollArea } from '../../ui/scroll-area';
51
- import { ThemeToggle } from '../../brand/theme-toggle';
52
- import { LanguageSelector } from '../../brand/language-selector';
53
- import { MapShowcase } from '../../examples/MapShowcase';
54
- import { Header } from '../../layout/header';
55
- import { Sidebar } from '../../layout/sidebar';
56
- import {
57
- Dialog,
58
- DialogTrigger,
59
- DialogContent,
60
- DialogHeader,
61
- DialogTitle,
62
- DialogDescription,
63
- DialogFooter,
64
- } from '../../ui/dialog';
65
- import {
66
- AlertDialog,
67
- AlertDialogTrigger,
68
- AlertDialogContent,
69
- AlertDialogHeader,
70
- AlertDialogTitle,
71
- AlertDialogDescription,
72
- AlertDialogFooter,
73
- AlertDialogAction,
74
- AlertDialogCancel,
75
- } from '../../ui/alert-dialog';
76
- import { PageHeader } from '../../ui/page-header';
77
-
78
- import { useOptionalLayout } from '../../../contexts/LayoutContext';
79
- import { useTheme } from '../../../contexts/ThemeContext';
80
- import { useTeamMembers, useDashboardStore } from '../../../features/home';
81
- import { useTranslation } from 'react-i18next';
82
- import { SectionErrorBoundary } from '../../shared/error-boundary';
83
- import { Skeleton } from '../../ui/skeleton';
84
-
85
- /**
86
- * Comprehensive Showcase and Template Content component.
87
- *
88
- * @description
89
- * This component serves as a living kitchen-sink demonstration of the Xertica UI
90
- * Design System. It showcases almost every UI primitive (Cards, Tabs, Forms,
91
- * Tables, Dialogs, etc.) and layout variation (Header flexibility, Sidebar
92
- * toggling). It's primarily used for development, testing, and as a starting
93
- * point for new pages.
94
- *
95
- * @ai-rules
96
- * 1. Reference: Use this component as the primary source of truth for "how to compose" complex layouts in this library.
97
- * 2. Layout: Adjusts its own padding based on the `useLayout` context's sidebar state.
98
- * 3. Interaction: All showcase interactive elements (buttons, forms) use simple `toast` feedback or local state toggles.
99
- */
100
- export function TemplateContent() {
101
- const { t } = useTranslation();
102
- const layout = useOptionalLayout();
103
- const { disableDarkMode } = useTheme();
104
- const [localSidebarExpanded, setLocalSidebarExpanded] = useState(false);
105
- const [localSidebarWidth, setLocalSidebarWidth] = useState(280);
106
- const sidebarExpanded = layout?.sidebarExpanded ?? localSidebarExpanded;
107
- const sidebarWidth = layout?.sidebarWidth ?? localSidebarWidth;
108
- const setSidebarWidth = layout?.setSidebarWidth ?? setLocalSidebarWidth;
109
- const toggleSidebar = layout?.toggleSidebar ?? (() => setLocalSidebarExpanded(value => !value));
110
- const navigate = useNavigate();
111
-
112
- // Server state
113
- const { data: teamMembers = [], isLoading: teamLoading } = useTeamMembers();
114
-
115
- // Client-side UI state (Zustand)
116
- const progress = useDashboardStore(s => s.progress);
117
- const setProgress = useDashboardStore(s => s.setProgress);
118
- const sliderValue = useDashboardStore(s => s.sliderValue);
119
- const setSliderValue = useDashboardStore(s => s.setSliderValue);
120
- const switchEnabled = useDashboardStore(s => s.switchEnabled);
121
- const toggleSwitch = useDashboardStore(s => s.toggleSwitch);
122
-
123
- // Local UI-only toggles (no global relevance)
124
- const [showSidebarUser, setShowSidebarUser] = useState(true);
125
- const [showSidebarSettings, setShowSidebarSettings] = useState(true);
126
- const [showSidebarLogout, setShowSidebarLogout] = useState(true);
127
-
128
- // Header State
129
- const [showHeaderActions, setShowHeaderActions] = useState(true);
130
- const [showHeaderBreadcrumbs, setShowHeaderBreadcrumbs] = useState(true);
131
-
132
- const handleFormSubmit = (e: React.FormEvent) => {
133
- e.preventDefault();
134
- toast.success(t('templates.formSubmitSuccess'));
135
- };
136
-
137
- return (
138
- <div
139
- className="flex-1 flex flex-col overflow-hidden transition-all duration-300"
140
- style={{
141
- paddingLeft: sidebarExpanded ? `${sidebarWidth}px` : '80px',
142
- }}
143
- >
144
- {/* Sticky Header */}
145
- <Header
146
- showThemeToggle={true}
147
- showLanguageSelector={true}
148
- breadcrumbs={[
149
- { label: t('nav.designSystem'), href: '/home', icon: <Home className="w-4 h-4" /> },
150
- { label: t('templates.breadcrumb') },
151
- ]}
152
- renderLink={(href, props) => <Link to={href} {...props} />}
153
- />
154
-
155
- {/* Content area */}
156
- <main className="flex-1 overflow-hidden bg-muted">
157
- <ScrollArea className="h-full">
158
- <div className="p-5 sm:p-4 md:p-6">
159
- <div className="max-w-6xl mx-auto space-y-8">
160
- {/* Page header */}
161
- <PageHeader title={t('templates.title')} subtitle={t('templates.subtitle')} />
162
-
163
- {/* Page Header Example */}
164
- <section>
165
- <h3 className="mb-4">{t('templates.headerWithBreadcrumbs.sectionTitle')}</h3>
166
- <Card>
167
- <CardHeader>
168
- <CardTitle>{t('templates.headerWithBreadcrumbs.cardTitle')}</CardTitle>
169
- <CardDescription>
170
- {t('templates.headerWithBreadcrumbs.cardDescription')}
171
- </CardDescription>
172
- </CardHeader>
173
- <CardContent className="p-0 border-t bg-background overflow-hidden rounded-b-[var(--radius-lg)]">
174
- <Header
175
- className="border-b"
176
- breadcrumbs={[
177
- {
178
- label: t('templates.headerWithBreadcrumbs.breadcrumbs.dashboard'),
179
- href: '#',
180
- icon: <Home className="w-4 h-4" />,
181
- },
182
- {
183
- label: t('templates.headerWithBreadcrumbs.breadcrumbs.settings'),
184
- href: '#',
185
- icon: <Settings className="w-4 h-4" />,
186
- },
187
- {
188
- label: t('templates.headerWithBreadcrumbs.breadcrumbs.users'),
189
- href: '#',
190
- icon: <Users className="w-4 h-4" />,
191
- },
192
- { label: t('templates.headerWithBreadcrumbs.breadcrumbs.accessProfile') },
193
- ]}
194
- showLanguageSelector={true}
195
- showThemeToggle={true}
196
- />
197
- <div className="p-6 min-h-[200px]">
198
- <h4 className="text-lg font-semibold mb-2">
199
- {t('templates.headerWithBreadcrumbs.exampleContentTitle')}
200
- </h4>
201
- <p className="text-muted-foreground">
202
- {t('templates.headerWithBreadcrumbs.exampleContentDescriptionPart1')}
203
- <strong>Header</strong>
204
- {t('templates.headerWithBreadcrumbs.exampleContentDescriptionPart2')}
205
- </p>
206
- </div>
207
- </CardContent>
208
- </Card>
209
- </section>
210
-
211
- <Separator className="my-8" />
212
-
213
- {/* Alert Examples */}
214
- <section>
215
- <h3 className="mb-4">{t('templates.sections.alerts')}</h3>
216
- <div className="grid gap-4 md:grid-cols-2">
217
- <Alert variant="info">
218
- <AlertTitle>{t('templates.alerts.infoTitle')}</AlertTitle>
219
- <AlertDescription>{t('templates.alerts.infoDescription')}</AlertDescription>
220
- </Alert>
221
-
222
- <Alert variant="destructive">
223
- <AlertTitle>{t('templates.alerts.errorTitle')}</AlertTitle>
224
- <AlertDescription>{t('templates.alerts.errorDescription')}</AlertDescription>
225
- </Alert>
226
-
227
- <Alert variant="success">
228
- <AlertTitle>{t('templates.alerts.successTitle')}</AlertTitle>
229
- <AlertDescription>{t('templates.alerts.successDescription')}</AlertDescription>
230
- </Alert>
231
-
232
- <Alert variant="warning">
233
- <AlertTitle>{t('templates.alerts.warningTitle')}</AlertTitle>
234
- <AlertDescription>{t('templates.alerts.warningDescription')}</AlertDescription>
235
- </Alert>
236
- </div>
237
- </section>
238
-
239
- <Separator className="my-8" />
240
-
241
- {/* Cards & Tabs */}
242
- <section>
243
- <h3 className="mb-4">{t('templates.sections.cardsAndTabs')}</h3>
244
-
245
- <Tabs defaultValue="overview" className="w-full">
246
- <TabsList className="grid w-full grid-cols-4">
247
- <TabsTrigger value="overview">{t('templates.tabs.overview')}</TabsTrigger>
248
- <TabsTrigger value="forms">{t('templates.tabs.forms')}</TabsTrigger>
249
- <TabsTrigger value="data">{t('templates.tabs.data')}</TabsTrigger>
250
- <TabsTrigger value="settings">{t('templates.tabs.settings')}</TabsTrigger>
251
- </TabsList>
252
-
253
- {/* Overview Tab */}
254
- <TabsContent value="overview" className="space-y-4">
255
- <div className="grid gap-4 md:grid-cols-3">
256
- <Card>
257
- <CardHeader>
258
- <CardTitle>{t('stats.totalUsers')}</CardTitle>
259
- <CardDescription>{t('stats.last30Days')}</CardDescription>
260
- </CardHeader>
261
- <CardContent>
262
- <div className="text-foreground">
263
- <span className="[font-size:var(--text-stats)] [font-weight:var(--font-weight-bold)]">
264
- 1,234
265
- </span>
266
- <Badge variant="default" className="ml-2">
267
- +12%
268
- </Badge>
269
- </div>
270
- </CardContent>
271
- </Card>
272
-
273
- <Card>
274
- <CardHeader>
275
- <CardTitle>{t('stats.totalRevenue')}</CardTitle>
276
- <CardDescription>{t('stats.currentMonth')}</CardDescription>
277
- </CardHeader>
278
- <CardContent>
279
- <div className="text-foreground">
280
- <span className="[font-size:var(--text-stats)] [font-weight:var(--font-weight-bold)]">
281
- $ 45.2k
282
- </span>
283
- <Badge variant="secondary" className="ml-2">
284
- +8%
285
- </Badge>
286
- </div>
287
- </CardContent>
288
- </Card>
289
-
290
- <Card>
291
- <CardHeader>
292
- <CardTitle>{t('stats.conversionRate')}</CardTitle>
293
- <CardDescription>{t('stats.currentWeek')}</CardDescription>
294
- </CardHeader>
295
- <CardContent>
296
- <div className="text-foreground">
297
- <span className="[font-size:var(--text-stats)] [font-weight:var(--font-weight-bold)]">
298
- 3.2%
299
- </span>
300
- <Badge variant="outline" className="ml-2">
301
- -2%
302
- </Badge>
303
- </div>
304
- </CardContent>
305
- </Card>
306
- </div>
307
-
308
- <Card>
309
- <CardHeader>
310
- <CardTitle>{t('templates.overview.progressTitle')}</CardTitle>
311
- <CardDescription>
312
- {t('templates.overview.progressDescription')}
313
- </CardDescription>
314
- </CardHeader>
315
- <CardContent className="space-y-6">
316
- <div className="space-y-2">
317
- <div className="flex items-center justify-between">
318
- <Label>{t('templates.overview.projectProgress')}</Label>
319
- <span className="[font-size:var(--text-small)] text-muted-foreground">
320
- {progress}%
321
- </span>
322
- </div>
323
- <Progress value={progress} className="w-full" />
324
- <div className="flex gap-2">
325
- <Button
326
- size="sm"
327
- onClick={() => setProgress(Math.max(0, progress - 10))}
328
- >
329
- -10%
330
- </Button>
331
- <Button
332
- size="sm"
333
- onClick={() => setProgress(Math.min(100, progress + 10))}
334
- >
335
- +10%
336
- </Button>
337
- </div>
338
- </div>
339
-
340
- <Separator />
341
-
342
- <div className="space-y-2">
343
- <div className="flex items-center justify-between">
344
- <Label>{t('templates.overview.volume')}</Label>
345
- <span className="[font-size:var(--text-small)] text-muted-foreground">
346
- {sliderValue[0]}%
347
- </span>
348
- </div>
349
- <Slider
350
- value={sliderValue}
351
- onValueChange={setSliderValue}
352
- min={0}
353
- max={100}
354
- step={1}
355
- className="w-full"
356
- aria-label={t('templates.overview.volume')}
357
- />
358
- </div>
359
- </CardContent>
360
- </Card>
361
- </TabsContent>
362
-
363
- {/* Forms Tab */}
364
- <TabsContent value="forms" className="space-y-4">
365
- <Card>
366
- <CardHeader>
367
- <CardTitle>{t('templates.forms.registrationTitle')}</CardTitle>
368
- <CardDescription>
369
- {t('templates.forms.registrationDescription')}
370
- </CardDescription>
371
- </CardHeader>
372
- <CardContent>
373
- <form onSubmit={handleFormSubmit} className="space-y-4">
374
- <div className="grid gap-4 md:grid-cols-2">
375
- <div className="space-y-2">
376
- <Label htmlFor="firstName">{t('templates.forms.firstName')}</Label>
377
- <Input
378
- id="firstName"
379
- placeholder={t('templates.forms.firstNamePlaceholder')}
380
- />
381
- </div>
382
- <div className="space-y-2">
383
- <Label htmlFor="lastName">{t('templates.forms.lastName')}</Label>
384
- <Input
385
- id="lastName"
386
- placeholder={t('templates.forms.lastNamePlaceholder')}
387
- />
388
- </div>
389
- </div>
390
-
391
- <div className="space-y-2">
392
- <Label htmlFor="email">{t('templates.forms.email')}</Label>
393
- <div className="relative">
394
- <Mail className="absolute left-3 top-3 h-4 w-4 text-muted-foreground" />
395
- <Input
396
- id="email"
397
- type="email"
398
- placeholder={t('templates.forms.emailPlaceholder')}
399
- className="pl-10"
400
- />
401
- </div>
402
- </div>
403
-
404
- <div className="space-y-2">
405
- <Label htmlFor="phone">{t('templates.forms.phone')}</Label>
406
- <div className="relative">
407
- <Phone className="absolute left-3 top-3 h-4 w-4 text-muted-foreground" />
408
- <Input
409
- id="phone"
410
- type="tel"
411
- placeholder={t('templates.forms.phonePlaceholder')}
412
- className="pl-10"
413
- />
414
- </div>
415
- </div>
416
-
417
- <div className="space-y-2">
418
- <Label htmlFor="role">{t('templates.forms.role')}</Label>
419
- <Select>
420
- <SelectTrigger id="role">
421
- <SelectValue placeholder={t('templates.forms.rolePlaceholder')} />
422
- </SelectTrigger>
423
- <SelectContent>
424
- <SelectItem value="developer">
425
- {t('templates.forms.roles.developer')}
426
- </SelectItem>
427
- <SelectItem value="designer">
428
- {t('templates.forms.roles.designer')}
429
- </SelectItem>
430
- <SelectItem value="manager">
431
- {t('templates.forms.roles.manager')}
432
- </SelectItem>
433
- <SelectItem value="analyst">
434
- {t('templates.forms.roles.analyst')}
435
- </SelectItem>
436
- </SelectContent>
437
- </Select>
438
- </div>
439
-
440
- <div className="space-y-2">
441
- <Label htmlFor="bio">{t('templates.forms.bio')}</Label>
442
- <Textarea
443
- id="bio"
444
- placeholder={t('templates.forms.bioPlaceholder')}
445
- rows={4}
446
- />
447
- </div>
448
-
449
- <Separator />
450
-
451
- <div className="space-y-4">
452
- <h4>{t('templates.forms.preferences')}</h4>
453
-
454
- <div className="space-y-3">
455
- <div className="flex items-center space-x-2">
456
- <Checkbox id="newsletter" />
457
- <Label htmlFor="newsletter" className="font-normal">
458
- {t('templates.forms.newsletter')}
459
- </Label>
460
- </div>
461
-
462
- <div className="flex items-center space-x-2">
463
- <Checkbox id="notifications" />
464
- <Label htmlFor="notifications" className="font-normal">
465
- {t('templates.forms.pushNotifications')}
466
- </Label>
467
- </div>
468
-
469
- <div className="flex items-center space-x-2">
470
- <Checkbox id="updates" />
471
- <Label htmlFor="updates" className="font-normal">
472
- {t('templates.forms.featureUpdates')}
473
- </Label>
474
- </div>
475
- </div>
476
-
477
- <Separator />
478
-
479
- <div className="space-y-3">
480
- <Label>{t('templates.forms.accountType')}</Label>
481
- <RadioGroup
482
- defaultValue="personal"
483
- aria-label={t('templates.forms.accountType')}
484
- >
485
- <div className="flex items-center space-x-2">
486
- <RadioGroupItem value="personal" id="personal" />
487
- <Label htmlFor="personal" className="font-normal">
488
- {t('templates.forms.accountPersonal')}
489
- </Label>
490
- </div>
491
- <div className="flex items-center space-x-2">
492
- <RadioGroupItem value="business" id="business" />
493
- <Label htmlFor="business" className="font-normal">
494
- {t('templates.forms.accountBusiness')}
495
- </Label>
496
- </div>
497
- <div className="flex items-center space-x-2">
498
- <RadioGroupItem value="enterprise" id="enterprise" />
499
- <Label htmlFor="enterprise" className="font-normal">
500
- {t('templates.forms.accountEnterprise')}
501
- </Label>
502
- </div>
503
- </RadioGroup>
504
- </div>
505
- </div>
506
- </form>
507
- </CardContent>
508
- <CardFooter className="flex justify-between">
509
- <Button variant="outline">{t('templates.forms.cancel')}</Button>
510
- <Button onClick={handleFormSubmit}>
511
- {t('templates.forms.createAccount')}
512
- </Button>
513
- </CardFooter>
514
- </Card>
515
- </TabsContent>
516
-
517
- {/* Data Tab */}
518
- <TabsContent value="data" className="space-y-4">
519
- <SectionErrorBoundary>
520
- <Card>
521
- <CardHeader>
522
- <CardTitle>{t('templates.data.title')}</CardTitle>
523
- <CardDescription>{t('templates.data.description')}</CardDescription>
524
- </CardHeader>
525
- <CardContent>
526
- <div className="mb-4">
527
- <div className="relative">
528
- <Search className="absolute left-3 top-3 h-4 w-4 text-muted-foreground" />
529
- <Input
530
- placeholder={t('templates.data.searchPlaceholder')}
531
- aria-label={t('templates.data.searchPlaceholder')}
532
- className="pl-10"
533
- />
534
- </div>
535
- </div>
536
-
537
- <div className="rounded-[var(--radius-lg)] border border-border overflow-hidden">
538
- <Table>
539
- <TableHeader>
540
- <TableRow>
541
- <TableHead>{t('team.name')}</TableHead>
542
- <TableHead>{t('team.email')}</TableHead>
543
- <TableHead>{t('team.role')}</TableHead>
544
- <TableHead>{t('team.status')}</TableHead>
545
- <TableHead className="text-right">{t('team.actions')}</TableHead>
546
- </TableRow>
547
- </TableHeader>
548
- <TableBody>
549
- {teamLoading ? (
550
- <>
551
- {Array.from({ length: 5 }).map((_, i) => (
552
- <TableRow key={i}>
553
- <TableCell>
554
- <div className="flex items-center gap-2">
555
- <Skeleton className="size-8 rounded-full shrink-0" />
556
- <Skeleton className="h-3.5 w-28" />
557
- </div>
558
- </TableCell>
559
- <TableCell>
560
- <Skeleton className="h-3.5 w-36" />
561
- </TableCell>
562
- <TableCell>
563
- <Skeleton className="h-3.5 w-20" />
564
- </TableCell>
565
- <TableCell>
566
- <Skeleton className="h-5 w-16 rounded-full" />
567
- </TableCell>
568
- <TableCell className="text-right">
569
- <Skeleton className="h-7 w-14 ml-auto" />
570
- </TableCell>
571
- </TableRow>
572
- ))}
573
- </>
574
- ) : (
575
- teamMembers.map(member => (
576
- <TableRow key={member.id}>
577
- <TableCell>{member.name}</TableCell>
578
- <TableCell>{member.email}</TableCell>
579
- <TableCell>{t(`team.roles.${member.role}`)}</TableCell>
580
- <TableCell>
581
- <Badge
582
- variant={
583
- member.status === 'active'
584
- ? 'default'
585
- : member.status === 'away'
586
- ? 'secondary'
587
- : 'outline'
588
- }
589
- >
590
- {t(`common.${member.status}`)}
591
- </Badge>
592
- </TableCell>
593
- <TableCell className="text-right">
594
- <Button variant="ghost" size="sm">
595
- {t('common.edit')}
596
- </Button>
597
- </TableCell>
598
- </TableRow>
599
- ))
600
- )}
601
- </TableBody>
602
- </Table>
603
- </div>
604
- </CardContent>
605
- <CardFooter className="flex justify-between items-center">
606
- <p className="text-muted-foreground">
607
- {t('team.showing', {
608
- count: teamMembers.length,
609
- total: teamMembers.length,
610
- })}
611
- </p>
612
- <div className="flex gap-2">
613
- <Button variant="outline" size="sm">
614
- {t('common.previous')}
615
- </Button>
616
- <Button variant="outline" size="sm">
617
- {t('common.next')}
618
- </Button>
619
- </div>
620
- </CardFooter>
621
- </Card>
622
- </SectionErrorBoundary>
623
- </TabsContent>
624
-
625
- {/* Settings Tab */}
626
- <TabsContent value="settings" className="space-y-4">
627
- <Card>
628
- <CardHeader>
629
- <CardTitle>{t('templates.settings.title')}</CardTitle>
630
- <CardDescription>{t('templates.settings.description')}</CardDescription>
631
- </CardHeader>
632
- <CardContent className="space-y-6">
633
- {!disableDarkMode && (
634
- <>
635
- <div className="flex items-center justify-between">
636
- <div className="space-y-1">
637
- <Label htmlFor="dark-mode">
638
- {t('templates.settings.darkMode')}
639
- </Label>
640
- <p className="text-muted-foreground">
641
- {t('templates.settings.darkModeDescription')}
642
- </p>
643
- </div>
644
- <Switch
645
- id="dark-mode"
646
- checked={switchEnabled}
647
- onCheckedChange={toggleSwitch}
648
- />
649
- </div>
650
-
651
- <Separator />
652
- </>
653
- )}
654
-
655
- <div className="flex items-center justify-between">
656
- <div className="space-y-1">
657
- <Label htmlFor="email-notifications">
658
- {t('templates.settings.emailNotifications')}
659
- </Label>
660
- <p className="text-muted-foreground">
661
- {t('templates.settings.emailNotificationsDescription')}
662
- </p>
663
- </div>
664
- <Switch id="email-notifications" defaultChecked />
665
- </div>
666
-
667
- <Separator />
668
-
669
- <div className="flex items-center justify-between">
670
- <div className="space-y-1">
671
- <Label htmlFor="push-notifications">
672
- {t('templates.settings.pushNotifications')}
673
- </Label>
674
- <p className="text-muted-foreground">
675
- {t('templates.settings.pushNotificationsDescription')}
676
- </p>
677
- </div>
678
- <Switch id="push-notifications" />
679
- </div>
680
-
681
- <Separator />
682
-
683
- <div className="space-y-3">
684
- <Label>{t('templates.settings.language')}</Label>
685
- <Select defaultValue="pt-br">
686
- <SelectTrigger aria-label={t('templates.settings.language')}>
687
- <SelectValue />
688
- </SelectTrigger>
689
- <SelectContent>
690
- <SelectItem value="pt-br">
691
- {t('templates.settings.languages.ptBR')}
692
- </SelectItem>
693
- <SelectItem value="en">
694
- {t('templates.settings.languages.en')}
695
- </SelectItem>
696
- <SelectItem value="es">
697
- {t('templates.settings.languages.es')}
698
- </SelectItem>
699
- </SelectContent>
700
- </Select>
701
- </div>
702
-
703
- <Separator />
704
-
705
- <div className="space-y-3">
706
- <Label>{t('templates.settings.timezone')}</Label>
707
- <Select defaultValue="america-sao-paulo">
708
- <SelectTrigger aria-label={t('templates.settings.timezone')}>
709
- <SelectValue />
710
- </SelectTrigger>
711
- <SelectContent>
712
- <SelectItem value="america-sao-paulo">
713
- {t('templates.settings.timezones.saoPaulo')}
714
- </SelectItem>
715
- <SelectItem value="america-new-york">
716
- {t('templates.settings.timezones.newYork')}
717
- </SelectItem>
718
- <SelectItem value="europe-london">
719
- {t('templates.settings.timezones.london')}
720
- </SelectItem>
721
- </SelectContent>
722
- </Select>
723
- </div>
724
- </CardContent>
725
- <CardFooter className="flex justify-between">
726
- <Button variant="outline">{t('templates.settings.restoreDefaults')}</Button>
727
- <Button>{t('templates.settings.saveChanges')}</Button>
728
- </CardFooter>
729
- </Card>
730
- </TabsContent>
731
- </Tabs>
732
- </section>
733
-
734
- <Separator className="my-8" />
735
-
736
- {/* Button Variants */}
737
- <section>
738
- <h3 className="mb-4">{t('templates.sections.buttons')}</h3>
739
- <Card>
740
- <CardHeader>
741
- <CardTitle>{t('templates.buttons.title')}</CardTitle>
742
- <CardDescription>{t('templates.buttons.description')}</CardDescription>
743
- </CardHeader>
744
- <CardContent className="space-y-6">
745
- <div className="space-y-3">
746
- <Label>{t('templates.buttons.variants')}</Label>
747
- <div className="flex flex-wrap gap-3">
748
- <Button variant="default">Default</Button>
749
- <Button variant="secondary">Secondary</Button>
750
- <Button variant="outline">Outline</Button>
751
- <Button variant="ghost">Ghost</Button>
752
- <Button variant="link">Link</Button>
753
- <Button variant="destructive">Destructive</Button>
754
- </div>
755
- </div>
756
-
757
- <Separator />
758
-
759
- <div className="space-y-3">
760
- <Label>{t('templates.buttons.sizes')}</Label>
761
- <div className="flex flex-wrap items-center gap-3">
762
- <Button size="sm">Small</Button>
763
- <Button size="default">Default</Button>
764
- <Button size="lg">Large</Button>
765
- <Button size="icon" aria-label={t('nav.settings')}>
766
- <Settings className="h-4 w-4" />
767
- </Button>
768
- </div>
769
- </div>
770
-
771
- <Separator />
772
-
773
- <div className="space-y-3">
774
- <Label>{t('templates.buttons.withIcons')}</Label>
775
- <div className="flex flex-wrap gap-3">
776
- <Button>
777
- <User className="mr-2 h-4 w-4" />
778
- {t('templates.buttons.profile')}
779
- </Button>
780
- <Button variant="secondary">
781
- <Mail className="mr-2 h-4 w-4" />
782
- {t('templates.buttons.messages')}
783
- </Button>
784
- <Button variant="outline">
785
- <Calendar className="mr-2 h-4 w-4" />
786
- {t('templates.buttons.schedule')}
787
- </Button>
788
- </div>
789
- </div>
790
-
791
- <Separator />
792
-
793
- <div className="space-y-3">
794
- <Label>{t('templates.buttons.states')}</Label>
795
- <div className="flex flex-wrap gap-3">
796
- <Button disabled>{t('templates.buttons.disabled')}</Button>
797
- <Button variant="outline" disabled>
798
- {t('templates.buttons.outlineDisabled')}
799
- </Button>
800
- </div>
801
- </div>
802
- </CardContent>
803
- </Card>
804
- </section>
805
-
806
- <Separator className="my-8" />
807
-
808
- {/* Badges */}
809
- <section>
810
- <h3 className="mb-4">{t('templates.sections.badges')}</h3>
811
- <Card>
812
- <CardHeader>
813
- <CardTitle>{t('templates.badges.title')}</CardTitle>
814
- <CardDescription>{t('templates.badges.description')}</CardDescription>
815
- </CardHeader>
816
- <CardContent>
817
- <div className="flex flex-wrap gap-3">
818
- <Badge variant="default">Default</Badge>
819
- <Badge variant="secondary">Secondary</Badge>
820
- <Badge variant="outline">Outline</Badge>
821
- <Badge variant="destructive">Destructive</Badge>
822
- <Badge className="bg-success text-success-foreground">Success</Badge>
823
- <Badge className="bg-warning text-warning-foreground">Warning</Badge>
824
- <Badge className="bg-info text-info-foreground">Info</Badge>
825
- </div>
826
- </CardContent>
827
- </Card>
828
- </section>
829
-
830
- <Separator className="my-8" />
831
-
832
- {/* Dialogs */}
833
- <section>
834
- <h3 className="mb-4">{t('templates.sections.dialogs')}</h3>
835
- <div className="grid gap-4 md:grid-cols-2">
836
- <Card>
837
- <CardHeader>
838
- <CardTitle>{t('templates.dialogs.dialogTitle')}</CardTitle>
839
- <CardDescription>{t('templates.dialogs.dialogDescription')}</CardDescription>
840
- </CardHeader>
841
- <CardContent className="flex justify-center py-6">
842
- <Dialog>
843
- <DialogTrigger asChild>
844
- <Button variant="outline">{t('templates.dialogs.editProfile')}</Button>
845
- </DialogTrigger>
846
- <DialogContent className="sm:max-w-[425px]">
847
- <DialogHeader>
848
- <DialogTitle>{t('templates.dialogs.editProfile')}</DialogTitle>
849
- <DialogDescription>
850
- {t('templates.dialogs.editProfileDescription')}
851
- </DialogDescription>
852
- </DialogHeader>
853
- <div className="grid gap-4 py-4">
854
- <div className="grid grid-cols-4 items-center gap-4">
855
- <Label htmlFor="name" className="text-right">
856
- {t('templates.dialogs.name')}
857
- </Label>
858
- <Input id="name" defaultValue="John Doe" className="col-span-3" />
859
- </div>
860
- <div className="grid grid-cols-4 items-center gap-4">
861
- <Label htmlFor="username" className="text-right">
862
- {t('templates.dialogs.username')}
863
- </Label>
864
- <Input id="username" defaultValue="@johndoe" className="col-span-3" />
865
- </div>
866
- </div>
867
- <DialogFooter>
868
- <Button type="submit">{t('templates.dialogs.update')}</Button>
869
- </DialogFooter>
870
- </DialogContent>
871
- </Dialog>
872
- </CardContent>
873
- </Card>
874
-
875
- <Card>
876
- <CardHeader>
877
- <CardTitle>{t('templates.dialogs.alertDialogTitle')}</CardTitle>
878
- <CardDescription>
879
- {t('templates.dialogs.alertDialogDescription')}
880
- </CardDescription>
881
- </CardHeader>
882
- <CardContent className="flex justify-center py-6">
883
- <AlertDialog>
884
- <AlertDialogTrigger asChild>
885
- <Button variant="destructive">
886
- {t('templates.dialogs.deleteAccount')}
887
- </Button>
888
- </AlertDialogTrigger>
889
- <AlertDialogContent className="sm:max-w-[425px]">
890
- <AlertDialogHeader>
891
- <AlertDialogTitle>{t('templates.dialogs.areYouSure')}</AlertDialogTitle>
892
- <AlertDialogDescription>
893
- {t('templates.dialogs.deleteWarning')}
894
- </AlertDialogDescription>
895
- </AlertDialogHeader>
896
- <AlertDialogFooter>
897
- <AlertDialogCancel>{t('templates.dialogs.cancel')}</AlertDialogCancel>
898
- <AlertDialogAction className="bg-destructive text-destructive-foreground hover:bg-destructive/90">
899
- {t('templates.dialogs.continue')}
900
- </AlertDialogAction>
901
- </AlertDialogFooter>
902
- </AlertDialogContent>
903
- </AlertDialog>
904
- </CardContent>
905
- </Card>
906
- </div>
907
- </section>
908
-
909
- <Separator className="my-8" />
910
-
911
- {/* Maps */}
912
- <section>
913
- <MapShowcase />
914
- </section>
915
-
916
- <Separator className="my-8" />
917
-
918
- {/* Header Variations */}
919
- <section>
920
- <h3 className="mb-4">{t('templates.headerVariations.sectionTitle')}</h3>
921
- <Card>
922
- <CardHeader>
923
- <CardTitle>{t('templates.headerVariations.cardTitle')}</CardTitle>
924
- <CardDescription>
925
- {t('templates.headerVariations.cardDescription')}
926
- </CardDescription>
927
- </CardHeader>
928
- <CardContent className="space-y-6">
929
- <div className="p-4 border rounded-[var(--radius-lg)] bg-muted/30">
930
- <h4 className="text-sm font-semibold mb-4">
931
- {t('templates.headerVariations.visibleElements')}
932
- </h4>
933
- <div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-6">
934
- <div className="flex items-center space-x-2">
935
- <Switch
936
- id="header-actions"
937
- checked={showHeaderActions}
938
- onCheckedChange={setShowHeaderActions}
939
- />
940
- <Label htmlFor="header-actions" className="cursor-pointer">
941
- {t('templates.headerVariations.actionButtons')}
942
- </Label>
943
- </div>
944
- <div className="flex items-center space-x-2">
945
- <Switch
946
- id="header-bread"
947
- checked={showHeaderBreadcrumbs}
948
- onCheckedChange={setShowHeaderBreadcrumbs}
949
- />
950
- <Label htmlFor="header-bread" className="cursor-pointer">
951
- {t('templates.headerVariations.breadcrumbsLabel')}
952
- </Label>
953
- </div>
954
- </div>
955
- </div>
956
-
957
- <div className="relative border rounded-[var(--radius-lg)] bg-muted/10 overflow-hidden shadow-inner">
958
- <div className="p-4 bg-background/50 border-b text-xs font-mono text-muted-foreground">
959
- {t('templates.headerVariations.preview')}
960
- </div>
961
- <Header
962
- title={
963
- !showHeaderBreadcrumbs
964
- ? t('templates.headerVariations.currentPage')
965
- : undefined
966
- }
967
- breadcrumbs={
968
- showHeaderBreadcrumbs
969
- ? [
970
- {
971
- label: t('templates.headerVariations.breadcrumbBrand'),
972
- href: '#',
973
- icon: <Home className="w-4 h-4" />,
974
- },
975
- {
976
- label: t('templates.headerVariations.breadcrumbSettings'),
977
- href: '#',
978
- },
979
- { label: t('templates.headerVariations.breadcrumbProfile') },
980
- ]
981
- : undefined
982
- }
983
- actions={
984
- showHeaderActions
985
- ? [
986
- {
987
- id: 'notify',
988
- icon: <Bell className="w-5 h-5" />,
989
- onClick: () =>
990
- toast(t('templates.headerVariations.notificationsOpenedToast')),
991
- },
992
- {
993
- id: 'mail',
994
- label: t('templates.headerVariations.messagesLabel'),
995
- icon: <Mail className="w-5 h-5" />,
996
- onClick: () =>
997
- toast(t('templates.headerVariations.messagesOpenedToast')),
998
- },
999
- ]
1000
- : undefined
1001
- }
1002
- />
1003
- <div className="h-32 flex items-center justify-center text-muted-foreground text-sm italic">
1004
- {t('templates.headerVariations.contentArea')}
1005
- </div>
1006
- </div>
1007
- </CardContent>
1008
- </Card>
1009
- </section>
1010
-
1011
- <Separator className="my-8" />
1012
-
1013
- {/* Sidebar Variations */}
1014
- <section>
1015
- <h3 className="mb-4">{t('templates.sections.sidebarVariations')}</h3>
1016
- <Card>
1017
- <CardHeader>
1018
- <CardTitle>{t('templates.sidebar.title')}</CardTitle>
1019
- <CardDescription>{t('templates.sidebar.description')}</CardDescription>
1020
- </CardHeader>
1021
- <CardContent>
1022
- <Tabs defaultValue="assistant" className="w-full">
1023
- <TabsList className="mb-4">
1024
- <TabsTrigger value="assistant">
1025
- {t('templates.sidebar.assistantMode')}
1026
- </TabsTrigger>
1027
- <TabsTrigger value="default">
1028
- {t('templates.sidebar.defaultMode')}
1029
- </TabsTrigger>
1030
- </TabsList>
1031
-
1032
- <div className="mb-6 p-4 border rounded-[var(--radius-lg)] bg-muted/30">
1033
- <h4 className="text-sm font-semibold mb-4">
1034
- {t('templates.sidebarControls.footerSettings')}
1035
- </h4>
1036
- <div className="flex flex-wrap gap-6 mt-2">
1037
- <div className="flex items-center space-x-2">
1038
- <Switch
1039
- id="show-user"
1040
- checked={showSidebarUser}
1041
- onCheckedChange={setShowSidebarUser}
1042
- />
1043
- <Label htmlFor="show-user" className="cursor-pointer">
1044
- {t('templates.sidebarControls.userProfile')}
1045
- </Label>
1046
- </div>
1047
- <div className="flex items-center space-x-2">
1048
- <Switch
1049
- id="show-settings"
1050
- checked={showSidebarSettings}
1051
- onCheckedChange={setShowSidebarSettings}
1052
- />
1053
- <Label htmlFor="show-settings" className="cursor-pointer">
1054
- {t('templates.sidebarControls.settings')}
1055
- </Label>
1056
- </div>
1057
- <div className="flex items-center space-x-2">
1058
- <Switch
1059
- id="show-logout"
1060
- checked={showSidebarLogout}
1061
- onCheckedChange={setShowSidebarLogout}
1062
- />
1063
- <Label htmlFor="show-logout" className="cursor-pointer">
1064
- {t('templates.sidebarControls.logoutButton')}
1065
- </Label>
1066
- </div>
1067
- </div>
1068
-
1069
- <div className="mt-6 pt-6 border-t">
1070
- <div className="flex items-center justify-between mb-4">
1071
- <h4 className="text-sm font-semibold">
1072
- {t('templates.sidebarControls.sidebarWidthDesktop')}
1073
- </h4>
1074
- <span className="text-xs font-mono bg-muted px-2 py-1 rounded">
1075
- {sidebarWidth}px
1076
- </span>
1077
- </div>
1078
- <div className="flex items-center gap-4">
1079
- <span className="text-xs text-muted-foreground w-12 text-right">
1080
- 240px
1081
- </span>
1082
- <Slider
1083
- value={[sidebarWidth]}
1084
- onValueChange={val => setSidebarWidth(val[0])}
1085
- min={240}
1086
- max={450}
1087
- step={10}
1088
- className="flex-1"
1089
- aria-label={t('templates.sidebarControls.sidebarWidthAriaLabel')}
1090
- />
1091
- <span className="text-xs text-muted-foreground w-12">450px</span>
1092
- </div>
1093
- </div>
1094
- </div>
1095
-
1096
- <TabsContent value="assistant">
1097
- <div
1098
- className="relative h-[600px] border rounded-[var(--radius-lg)] bg-muted/20 overflow-hidden"
1099
- style={{ transform: 'translateZ(0)' }}
1100
- >
1101
- <Sidebar
1102
- expanded={true}
1103
- width={sidebarWidth}
1104
- onToggle={() => {}}
1105
- user={{ email: 'admin@xertica.com' }}
1106
- onLogout={() => toast(t('templates.sidebar.logoutToast'))}
1107
- location={{ pathname: '/assistant/current' }}
1108
- navigate={() => {}}
1109
- variant="assistant"
1110
- search={{
1111
- show: true,
1112
- placeholder: t('templates.sidebar.searchTopicsPlaceholder'),
1113
- filter: {
1114
- show: true,
1115
- content: (
1116
- <div className="p-2 space-y-2">
1117
- <div className="text-xs font-semibold uppercase text-muted-foreground px-2">
1118
- {t('templates.sidebarControls.filterByStatus')}
1119
- </div>
1120
- <div className="flex flex-wrap gap-2 p-1">
1121
- <Badge className="bg-sidebar-foreground/20 text-sidebar-foreground border-none cursor-pointer hover:bg-sidebar-foreground/30">
1122
- {t('templates.sidebarControls.filterActive')}
1123
- </Badge>
1124
- <Badge
1125
- variant="outline"
1126
- className="text-sidebar-foreground/70 border-sidebar-foreground/20 cursor-pointer hover:bg-sidebar-foreground/10"
1127
- >
1128
- {t('templates.sidebarControls.filterArchived')}
1129
- </Badge>
1130
- <Badge
1131
- variant="outline"
1132
- className="text-sidebar-foreground/70 border-sidebar-foreground/20 cursor-pointer hover:bg-sidebar-foreground/10"
1133
- >
1134
- {t('templates.sidebarControls.filterPending')}
1135
- </Badge>
1136
- </div>
1137
- </div>
1138
- ),
1139
- },
1140
- }}
1141
- fixedArea={{
1142
- show: true,
1143
- content: (
1144
- <Button className="w-full bg-sidebar-primary hover:bg-sidebar-primary/90 text-sidebar-primary-foreground shadow-lg font-bold border-none transition-all duration-300 transform hover:scale-[1.02] active:scale-[0.98]">
1145
- <Plus className="w-4 h-4 mr-2" />
1146
- {t('templates.sidebar.newConversation')}
1147
- </Button>
1148
- ),
1149
- }}
1150
- navigationGroups={[
1151
- {
1152
- id: 'recent',
1153
- label: t('templates.sidebar.recent'),
1154
- icon: Clock,
1155
- items: [
1156
- {
1157
- path: '/assistant/refatoracao',
1158
- label: t('templates.sidebar.items.sidebarRefactor'),
1159
- description: t(
1160
- 'templates.sidebar.items.sidebarRefactorDescription'
1161
- ),
1162
- actions: [
1163
- {
1164
- label: t('templates.sidebar.actions.rename'),
1165
- icon: FileEdit,
1166
- onClick: () =>
1167
- toast(t('templates.sidebar.actions.renameToast')),
1168
- },
1169
- {
1170
- label: t('templates.sidebar.actions.move'),
1171
- icon: ArrowRightLeft,
1172
- children: [
1173
- {
1174
- label: t('templates.sidebar.actions.moveActive'),
1175
- onClick: () =>
1176
- toast(t('templates.sidebar.actions.moveActiveToast')),
1177
- },
1178
- {
1179
- label: t('templates.sidebar.actions.moveMonitoring'),
1180
- onClick: () =>
1181
- toast(
1182
- t('templates.sidebar.actions.moveMonitoringToast')
1183
- ),
1184
- },
1185
- {
1186
- label: t('templates.sidebar.actions.moveArchive'),
1187
- onClick: () =>
1188
- toast(
1189
- t('templates.sidebar.actions.moveArchiveToast')
1190
- ),
1191
- },
1192
- ],
1193
- },
1194
- {
1195
- label: t('templates.sidebar.actions.clear'),
1196
- icon: Trash2,
1197
- onClick: () =>
1198
- toast(t('templates.sidebar.actions.clearToast')),
1199
- variant: 'destructive',
1200
- },
1201
- ],
1202
- },
1203
- ],
1204
- },
1205
- {
1206
- id: 'projects',
1207
- label: t('templates.sidebar.constructionMonitoring'),
1208
- icon: Map,
1209
- actions: [
1210
- {
1211
- label: t('templates.sidebar.actions.newCategory'),
1212
- icon: Plus,
1213
- onClick: () =>
1214
- toast(t('templates.sidebar.actions.newCategoryToast')),
1215
- },
1216
- {
1217
- label: t('templates.sidebar.actions.archiveGroup'),
1218
- icon: Archive,
1219
- onClick: () =>
1220
- toast(t('templates.sidebar.actions.archiveGroupToast')),
1221
- },
1222
- ],
1223
- items: [
1224
- {
1225
- path: '/assistant/br163',
1226
- label: t('templates.sidebar.items.br163Restoration'),
1227
- icon: () => (
1228
- <div className="w-2 h-2 rounded-full bg-yellow-500" />
1229
- ),
1230
- description: (
1231
- <div className="space-y-1.5 min-w-[160px]">
1232
- <Progress
1233
- value={67}
1234
- className="h-1.5 bg-sidebar-foreground/10"
1235
- />
1236
- <div className="flex justify-between items-center text-[10px] text-sidebar-foreground/60">
1237
- <span>{t('templates.sidebar.items.br163Location')}</span>
1238
- <span>67%</span>
1239
- </div>
1240
- </div>
1241
- ),
1242
- },
1243
- ],
1244
- },
1245
- ]}
1246
- footer={{
1247
- showUser: showSidebarUser,
1248
- showSettings: showSidebarSettings,
1249
- showLogout: showSidebarLogout,
1250
- }}
1251
- />
1252
- <div
1253
- className="absolute inset-y-0 right-0 p-8 flex items-center justify-center transition-all duration-300"
1254
- style={{ left: `${sidebarWidth}px` }}
1255
- >
1256
- <p className="text-muted-foreground text-center">
1257
- {t('templates.sidebar.assistantContent')}
1258
- </p>
1259
- </div>
1260
- </div>
1261
- </TabsContent>
1262
-
1263
- <TabsContent value="default">
1264
- <div
1265
- className="relative h-[600px] border rounded-[var(--radius-lg)] bg-muted/20 overflow-hidden"
1266
- style={{ transform: 'translateZ(0)' }}
1267
- >
1268
- <Sidebar
1269
- expanded={true}
1270
- width={sidebarWidth}
1271
- onToggle={() => {}}
1272
- user={{
1273
- name: 'Ariel Santos',
1274
- email: 'admin@xertica.com',
1275
- avatar: 'https://github.com/shadcn.png',
1276
- }}
1277
- onLogout={() => toast(t('templates.sidebar.logoutToast'))}
1278
- onSettingsClick={() =>
1279
- toast(t('templates.sidebar.settingsClickedToast'))
1280
- }
1281
- location={{ pathname: '/home' }}
1282
- navigate={() => {}}
1283
- variant="default"
1284
- routes={[
1285
- {
1286
- path: '/home',
1287
- label: t('templates.sidebar.routes.home'),
1288
- icon: Home,
1289
- },
1290
- {
1291
- path: '/dashboard',
1292
- label: t('templates.sidebar.routes.dashboard'),
1293
- icon: Users,
1294
- },
1295
- {
1296
- path: '/settings',
1297
- label: t('templates.sidebar.routes.settings'),
1298
- icon: Settings,
1299
- },
1300
- ]}
1301
- footer={{
1302
- showUser: showSidebarUser,
1303
- showSettings: showSidebarSettings,
1304
- showLogout: showSidebarLogout,
1305
- }}
1306
- />
1307
- <div
1308
- className="absolute inset-y-0 right-0 p-8 flex items-center justify-center transition-all duration-300"
1309
- style={{ left: `${sidebarWidth}px` }}
1310
- >
1311
- <p className="text-muted-foreground text-center">
1312
- {t('templates.sidebar.defaultContent')}
1313
- </p>
1314
- </div>
1315
- </div>
1316
- </TabsContent>
1317
- </Tabs>
1318
- </CardContent>
1319
- </Card>
1320
- </section>
1321
-
1322
- <Separator className="my-8" />
1323
-
1324
- {/* Footer Note */}
1325
- <Card className="mt-8">
1326
- <CardHeader>
1327
- <CardTitle>{t('templates.footer.title')}</CardTitle>
1328
- <CardDescription>{t('templates.footer.subtitle')}</CardDescription>
1329
- </CardHeader>
1330
- <CardContent className="space-y-4">
1331
- <p className="text-muted-foreground">
1332
- {t('templates.footer.descriptionPart1')}
1333
- <code className="bg-muted px-2 py-1 rounded-[var(--radius-sm)] [font-size:var(--text-small)]">
1334
- xertica-ui
1335
- </code>
1336
- {t('templates.footer.descriptionPart2')}
1337
- </p>
1338
- <Alert variant="info">
1339
- <AlertTitle>{t('templates.footer.tipTitle')}</AlertTitle>
1340
- <AlertDescription>
1341
- {t('templates.footer.tipDescriptionPart1')}
1342
- <code className="bg-muted px-1 rounded">styles/xertica/tokens.css</code>
1343
- {t('templates.footer.tipDescriptionPart2')}
1344
- </AlertDescription>
1345
- </Alert>
1346
- </CardContent>
1347
- </Card>
1348
- </div>
1349
- </div>
1350
- </ScrollArea>
1351
- </main>
1352
- </div>
1353
- );
1354
- }
1
+ import React, { useState } from 'react';
2
+ import { Link, useNavigate } from 'react-router-dom';
3
+ import { Button } from '../../ui/button';
4
+ import { Input } from '../../ui/input';
5
+ import { Label } from '../../ui/label';
6
+ import {
7
+ Card,
8
+ CardHeader,
9
+ CardTitle,
10
+ CardDescription,
11
+ CardContent,
12
+ CardFooter,
13
+ } from '../../ui/card';
14
+ import { Tabs, TabsContent, TabsList, TabsTrigger } from '../../ui/tabs';
15
+ import { Badge } from '../../ui/badge';
16
+ import { Alert, AlertDescription, AlertTitle } from '../../ui/alert';
17
+ import { Checkbox } from '../../ui/checkbox';
18
+ import { RadioGroup, RadioGroupItem } from '../../ui/radio-group';
19
+ import { Switch } from '../../ui/switch';
20
+ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../../ui/select';
21
+ import { Textarea } from '../../ui/textarea';
22
+ import { Progress } from '../../ui/progress';
23
+ import { Separator } from '../../ui/separator';
24
+ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '../../ui/table';
25
+ import {
26
+ Settings,
27
+ User,
28
+ Mail,
29
+ Phone,
30
+ Calendar,
31
+ Search,
32
+ Menu,
33
+ ChevronRight,
34
+ Home,
35
+ Users,
36
+ Plus,
37
+ Trash2,
38
+ Archive,
39
+ ArrowRightLeft,
40
+ History,
41
+ PanelRight,
42
+ FileEdit,
43
+ Filter,
44
+ Clock,
45
+ Map,
46
+ Bell,
47
+ } from 'lucide-react';
48
+ import { Slider } from '../../ui/slider';
49
+ import { toast } from 'sonner';
50
+ import { ThemeToggle } from '../../brand/theme-toggle';
51
+ import { LanguageSelector } from '../../brand/language-selector';
52
+ import { MapShowcase } from '../../examples/MapShowcase';
53
+ import { Header } from '../../layout/header';
54
+ import { Sidebar } from '../../layout/sidebar';
55
+ import {
56
+ Dialog,
57
+ DialogTrigger,
58
+ DialogContent,
59
+ DialogHeader,
60
+ DialogTitle,
61
+ DialogDescription,
62
+ DialogFooter,
63
+ } from '../../ui/dialog';
64
+ import {
65
+ AlertDialog,
66
+ AlertDialogTrigger,
67
+ AlertDialogContent,
68
+ AlertDialogHeader,
69
+ AlertDialogTitle,
70
+ AlertDialogDescription,
71
+ AlertDialogFooter,
72
+ AlertDialogAction,
73
+ AlertDialogCancel,
74
+ } from '../../ui/alert-dialog';
75
+ import { PageHeader } from '../../ui/page-header';
76
+
77
+ import { useOptionalLayout } from '../../../contexts/LayoutContext';
78
+ import { useTheme } from '../../../contexts/ThemeContext';
79
+ import { useTeamMembers, useDashboardStore } from '../../../features/home';
80
+ import { useTranslation } from 'react-i18next';
81
+ import { SectionErrorBoundary } from '../../shared/error-boundary';
82
+ import { Skeleton } from '../../ui/skeleton';
83
+
84
+ /**
85
+ * Comprehensive Showcase and Template Content component.
86
+ *
87
+ * @description
88
+ * This component serves as a living kitchen-sink demonstration of the Xertica UI
89
+ * Design System. It showcases almost every UI primitive (Cards, Tabs, Forms,
90
+ * Tables, Dialogs, etc.) and layout variation (Header flexibility, Sidebar
91
+ * toggling). It's primarily used for development, testing, and as a starting
92
+ * point for new pages.
93
+ *
94
+ * @ai-rules
95
+ * 1. Reference: Use this component as the primary source of truth for "how to compose" complex layouts in this library.
96
+ * 2. Layout: Adjusts its own padding based on the `useLayout` context's sidebar state.
97
+ * 3. Interaction: All showcase interactive elements (buttons, forms) use simple `toast` feedback or local state toggles.
98
+ */
99
+ export function TemplateContent() {
100
+ const { t } = useTranslation();
101
+ const layout = useOptionalLayout();
102
+ const { disableDarkMode } = useTheme();
103
+ const [localSidebarExpanded, setLocalSidebarExpanded] = useState(false);
104
+ const [localSidebarWidth, setLocalSidebarWidth] = useState(280);
105
+ const sidebarExpanded = layout?.sidebarExpanded ?? localSidebarExpanded;
106
+ const sidebarWidth = layout?.sidebarWidth ?? localSidebarWidth;
107
+ const setSidebarWidth = layout?.setSidebarWidth ?? setLocalSidebarWidth;
108
+ const toggleSidebar = layout?.toggleSidebar ?? (() => setLocalSidebarExpanded(value => !value));
109
+ const navigate = useNavigate();
110
+
111
+ // Server state
112
+ const { data: teamMembers = [], isLoading: teamLoading } = useTeamMembers();
113
+
114
+ // Client-side UI state (Zustand)
115
+ const progress = useDashboardStore(s => s.progress);
116
+ const setProgress = useDashboardStore(s => s.setProgress);
117
+ const sliderValue = useDashboardStore(s => s.sliderValue);
118
+ const setSliderValue = useDashboardStore(s => s.setSliderValue);
119
+ const switchEnabled = useDashboardStore(s => s.switchEnabled);
120
+ const toggleSwitch = useDashboardStore(s => s.toggleSwitch);
121
+
122
+ // Local UI-only toggles (no global relevance)
123
+ const [showSidebarUser, setShowSidebarUser] = useState(true);
124
+ const [showSidebarSettings, setShowSidebarSettings] = useState(true);
125
+ const [showSidebarLogout, setShowSidebarLogout] = useState(true);
126
+
127
+ // Header State
128
+ const [showHeaderActions, setShowHeaderActions] = useState(true);
129
+ const [showHeaderBreadcrumbs, setShowHeaderBreadcrumbs] = useState(true);
130
+
131
+ const handleFormSubmit = (e: React.FormEvent) => {
132
+ e.preventDefault();
133
+ toast.success(t('templates.formSubmitSuccess'));
134
+ };
135
+
136
+ return (
137
+ <div
138
+ className="flex-1 flex flex-col overflow-hidden transition-all duration-300"
139
+ style={{
140
+ paddingLeft: sidebarExpanded ? `${sidebarWidth}px` : '80px',
141
+ }}
142
+ >
143
+ {/* Sticky Header */}
144
+ <Header
145
+ showThemeToggle={true}
146
+ showLanguageSelector={true}
147
+ breadcrumbs={[
148
+ { label: t('nav.designSystem'), href: '/home', icon: <Home className="w-4 h-4" /> },
149
+ { label: t('templates.breadcrumb') },
150
+ ]}
151
+ renderLink={(href, props) => <Link to={href} {...props} />}
152
+ />
153
+
154
+ {/* Content area */}
155
+ <main className="flex-1 overflow-hidden bg-muted">
156
+ <div className="h-full" style={{ overflowY: 'auto', overflowX: 'hidden' }}>
157
+ <div className="p-5 sm:p-4 md:p-6">
158
+ <div className="max-w-6xl mx-auto space-y-8">
159
+ {/* Page header */}
160
+ <PageHeader title={t('templates.title')} subtitle={t('templates.subtitle')} />
161
+
162
+ {/* Page Header Example */}
163
+ <section>
164
+ <h3 className="mb-4">{t('templates.headerWithBreadcrumbs.sectionTitle')}</h3>
165
+ <Card>
166
+ <CardHeader>
167
+ <CardTitle>{t('templates.headerWithBreadcrumbs.cardTitle')}</CardTitle>
168
+ <CardDescription>
169
+ {t('templates.headerWithBreadcrumbs.cardDescription')}
170
+ </CardDescription>
171
+ </CardHeader>
172
+ <CardContent className="p-0 border-t bg-background overflow-hidden rounded-b-[var(--radius-lg)]">
173
+ <Header
174
+ className="border-b"
175
+ breadcrumbs={[
176
+ {
177
+ label: t('templates.headerWithBreadcrumbs.breadcrumbs.dashboard'),
178
+ href: '#',
179
+ icon: <Home className="w-4 h-4" />,
180
+ },
181
+ {
182
+ label: t('templates.headerWithBreadcrumbs.breadcrumbs.settings'),
183
+ href: '#',
184
+ icon: <Settings className="w-4 h-4" />,
185
+ },
186
+ {
187
+ label: t('templates.headerWithBreadcrumbs.breadcrumbs.users'),
188
+ href: '#',
189
+ icon: <Users className="w-4 h-4" />,
190
+ },
191
+ { label: t('templates.headerWithBreadcrumbs.breadcrumbs.accessProfile') },
192
+ ]}
193
+ showLanguageSelector={true}
194
+ showThemeToggle={true}
195
+ />
196
+ <div className="p-6 min-h-[200px]">
197
+ <h4 className="text-lg font-semibold mb-2">
198
+ {t('templates.headerWithBreadcrumbs.exampleContentTitle')}
199
+ </h4>
200
+ <p className="text-muted-foreground">
201
+ {t('templates.headerWithBreadcrumbs.exampleContentDescriptionPart1')}
202
+ <strong>Header</strong>
203
+ {t('templates.headerWithBreadcrumbs.exampleContentDescriptionPart2')}
204
+ </p>
205
+ </div>
206
+ </CardContent>
207
+ </Card>
208
+ </section>
209
+
210
+ <Separator className="my-8" />
211
+
212
+ {/* Alert Examples */}
213
+ <section>
214
+ <h3 className="mb-4">{t('templates.sections.alerts')}</h3>
215
+ <div className="grid gap-4 md:grid-cols-2">
216
+ <Alert variant="info">
217
+ <AlertTitle>{t('templates.alerts.infoTitle')}</AlertTitle>
218
+ <AlertDescription>{t('templates.alerts.infoDescription')}</AlertDescription>
219
+ </Alert>
220
+
221
+ <Alert variant="destructive">
222
+ <AlertTitle>{t('templates.alerts.errorTitle')}</AlertTitle>
223
+ <AlertDescription>{t('templates.alerts.errorDescription')}</AlertDescription>
224
+ </Alert>
225
+
226
+ <Alert variant="success">
227
+ <AlertTitle>{t('templates.alerts.successTitle')}</AlertTitle>
228
+ <AlertDescription>{t('templates.alerts.successDescription')}</AlertDescription>
229
+ </Alert>
230
+
231
+ <Alert variant="warning">
232
+ <AlertTitle>{t('templates.alerts.warningTitle')}</AlertTitle>
233
+ <AlertDescription>{t('templates.alerts.warningDescription')}</AlertDescription>
234
+ </Alert>
235
+ </div>
236
+ </section>
237
+
238
+ <Separator className="my-8" />
239
+
240
+ {/* Cards & Tabs */}
241
+ <section>
242
+ <h3 className="mb-4">{t('templates.sections.cardsAndTabs')}</h3>
243
+
244
+ <Tabs defaultValue="overview" className="w-full">
245
+ <TabsList className="grid w-full grid-cols-4">
246
+ <TabsTrigger value="overview">{t('templates.tabs.overview')}</TabsTrigger>
247
+ <TabsTrigger value="forms">{t('templates.tabs.forms')}</TabsTrigger>
248
+ <TabsTrigger value="data">{t('templates.tabs.data')}</TabsTrigger>
249
+ <TabsTrigger value="settings">{t('templates.tabs.settings')}</TabsTrigger>
250
+ </TabsList>
251
+
252
+ {/* Overview Tab */}
253
+ <TabsContent value="overview" className="space-y-4">
254
+ <div className="grid gap-4 md:grid-cols-3">
255
+ <Card>
256
+ <CardHeader>
257
+ <CardTitle>{t('stats.totalUsers')}</CardTitle>
258
+ <CardDescription>{t('stats.last30Days')}</CardDescription>
259
+ </CardHeader>
260
+ <CardContent>
261
+ <div className="text-foreground">
262
+ <span className="[font-size:var(--text-stats)] [font-weight:var(--font-weight-bold)]">
263
+ 1,234
264
+ </span>
265
+ <Badge variant="default" className="ml-2">
266
+ +12%
267
+ </Badge>
268
+ </div>
269
+ </CardContent>
270
+ </Card>
271
+
272
+ <Card>
273
+ <CardHeader>
274
+ <CardTitle>{t('stats.totalRevenue')}</CardTitle>
275
+ <CardDescription>{t('stats.currentMonth')}</CardDescription>
276
+ </CardHeader>
277
+ <CardContent>
278
+ <div className="text-foreground">
279
+ <span className="[font-size:var(--text-stats)] [font-weight:var(--font-weight-bold)]">
280
+ $ 45.2k
281
+ </span>
282
+ <Badge variant="secondary" className="ml-2">
283
+ +8%
284
+ </Badge>
285
+ </div>
286
+ </CardContent>
287
+ </Card>
288
+
289
+ <Card>
290
+ <CardHeader>
291
+ <CardTitle>{t('stats.conversionRate')}</CardTitle>
292
+ <CardDescription>{t('stats.currentWeek')}</CardDescription>
293
+ </CardHeader>
294
+ <CardContent>
295
+ <div className="text-foreground">
296
+ <span className="[font-size:var(--text-stats)] [font-weight:var(--font-weight-bold)]">
297
+ 3.2%
298
+ </span>
299
+ <Badge variant="outline" className="ml-2">
300
+ -2%
301
+ </Badge>
302
+ </div>
303
+ </CardContent>
304
+ </Card>
305
+ </div>
306
+
307
+ <Card>
308
+ <CardHeader>
309
+ <CardTitle>{t('templates.overview.progressTitle')}</CardTitle>
310
+ <CardDescription>
311
+ {t('templates.overview.progressDescription')}
312
+ </CardDescription>
313
+ </CardHeader>
314
+ <CardContent className="space-y-6">
315
+ <div className="space-y-2">
316
+ <div className="flex items-center justify-between">
317
+ <Label>{t('templates.overview.projectProgress')}</Label>
318
+ <span className="[font-size:var(--text-small)] text-muted-foreground">
319
+ {progress}%
320
+ </span>
321
+ </div>
322
+ <Progress value={progress} className="w-full" />
323
+ <div className="flex gap-2">
324
+ <Button
325
+ size="sm"
326
+ onClick={() => setProgress(Math.max(0, progress - 10))}
327
+ >
328
+ -10%
329
+ </Button>
330
+ <Button
331
+ size="sm"
332
+ onClick={() => setProgress(Math.min(100, progress + 10))}
333
+ >
334
+ +10%
335
+ </Button>
336
+ </div>
337
+ </div>
338
+
339
+ <Separator />
340
+
341
+ <div className="space-y-2">
342
+ <div className="flex items-center justify-between">
343
+ <Label>{t('templates.overview.volume')}</Label>
344
+ <span className="[font-size:var(--text-small)] text-muted-foreground">
345
+ {sliderValue[0]}%
346
+ </span>
347
+ </div>
348
+ <Slider
349
+ value={sliderValue}
350
+ onValueChange={setSliderValue}
351
+ min={0}
352
+ max={100}
353
+ step={1}
354
+ className="w-full"
355
+ aria-label={t('templates.overview.volume')}
356
+ />
357
+ </div>
358
+ </CardContent>
359
+ </Card>
360
+ </TabsContent>
361
+
362
+ {/* Forms Tab */}
363
+ <TabsContent value="forms" className="space-y-4">
364
+ <Card>
365
+ <CardHeader>
366
+ <CardTitle>{t('templates.forms.registrationTitle')}</CardTitle>
367
+ <CardDescription>
368
+ {t('templates.forms.registrationDescription')}
369
+ </CardDescription>
370
+ </CardHeader>
371
+ <CardContent>
372
+ <form onSubmit={handleFormSubmit} className="space-y-4">
373
+ <div className="grid gap-4 md:grid-cols-2">
374
+ <div className="space-y-2">
375
+ <Label htmlFor="firstName">{t('templates.forms.firstName')}</Label>
376
+ <Input
377
+ id="firstName"
378
+ placeholder={t('templates.forms.firstNamePlaceholder')}
379
+ />
380
+ </div>
381
+ <div className="space-y-2">
382
+ <Label htmlFor="lastName">{t('templates.forms.lastName')}</Label>
383
+ <Input
384
+ id="lastName"
385
+ placeholder={t('templates.forms.lastNamePlaceholder')}
386
+ />
387
+ </div>
388
+ </div>
389
+
390
+ <div className="space-y-2">
391
+ <Label htmlFor="email">{t('templates.forms.email')}</Label>
392
+ <div className="relative">
393
+ <Mail className="absolute left-3 top-3 h-4 w-4 text-muted-foreground" />
394
+ <Input
395
+ id="email"
396
+ type="email"
397
+ placeholder={t('templates.forms.emailPlaceholder')}
398
+ className="pl-10"
399
+ />
400
+ </div>
401
+ </div>
402
+
403
+ <div className="space-y-2">
404
+ <Label htmlFor="phone">{t('templates.forms.phone')}</Label>
405
+ <div className="relative">
406
+ <Phone className="absolute left-3 top-3 h-4 w-4 text-muted-foreground" />
407
+ <Input
408
+ id="phone"
409
+ type="tel"
410
+ placeholder={t('templates.forms.phonePlaceholder')}
411
+ className="pl-10"
412
+ />
413
+ </div>
414
+ </div>
415
+
416
+ <div className="space-y-2">
417
+ <Label htmlFor="role">{t('templates.forms.role')}</Label>
418
+ <Select>
419
+ <SelectTrigger id="role">
420
+ <SelectValue placeholder={t('templates.forms.rolePlaceholder')} />
421
+ </SelectTrigger>
422
+ <SelectContent>
423
+ <SelectItem value="developer">
424
+ {t('templates.forms.roles.developer')}
425
+ </SelectItem>
426
+ <SelectItem value="designer">
427
+ {t('templates.forms.roles.designer')}
428
+ </SelectItem>
429
+ <SelectItem value="manager">
430
+ {t('templates.forms.roles.manager')}
431
+ </SelectItem>
432
+ <SelectItem value="analyst">
433
+ {t('templates.forms.roles.analyst')}
434
+ </SelectItem>
435
+ </SelectContent>
436
+ </Select>
437
+ </div>
438
+
439
+ <div className="space-y-2">
440
+ <Label htmlFor="bio">{t('templates.forms.bio')}</Label>
441
+ <Textarea
442
+ id="bio"
443
+ placeholder={t('templates.forms.bioPlaceholder')}
444
+ rows={4}
445
+ />
446
+ </div>
447
+
448
+ <Separator />
449
+
450
+ <div className="space-y-4">
451
+ <h4>{t('templates.forms.preferences')}</h4>
452
+
453
+ <div className="space-y-3">
454
+ <div className="flex items-center space-x-2">
455
+ <Checkbox id="newsletter" />
456
+ <Label htmlFor="newsletter" className="font-normal">
457
+ {t('templates.forms.newsletter')}
458
+ </Label>
459
+ </div>
460
+
461
+ <div className="flex items-center space-x-2">
462
+ <Checkbox id="notifications" />
463
+ <Label htmlFor="notifications" className="font-normal">
464
+ {t('templates.forms.pushNotifications')}
465
+ </Label>
466
+ </div>
467
+
468
+ <div className="flex items-center space-x-2">
469
+ <Checkbox id="updates" />
470
+ <Label htmlFor="updates" className="font-normal">
471
+ {t('templates.forms.featureUpdates')}
472
+ </Label>
473
+ </div>
474
+ </div>
475
+
476
+ <Separator />
477
+
478
+ <div className="space-y-3">
479
+ <Label>{t('templates.forms.accountType')}</Label>
480
+ <RadioGroup
481
+ defaultValue="personal"
482
+ aria-label={t('templates.forms.accountType')}
483
+ >
484
+ <div className="flex items-center space-x-2">
485
+ <RadioGroupItem value="personal" id="personal" />
486
+ <Label htmlFor="personal" className="font-normal">
487
+ {t('templates.forms.accountPersonal')}
488
+ </Label>
489
+ </div>
490
+ <div className="flex items-center space-x-2">
491
+ <RadioGroupItem value="business" id="business" />
492
+ <Label htmlFor="business" className="font-normal">
493
+ {t('templates.forms.accountBusiness')}
494
+ </Label>
495
+ </div>
496
+ <div className="flex items-center space-x-2">
497
+ <RadioGroupItem value="enterprise" id="enterprise" />
498
+ <Label htmlFor="enterprise" className="font-normal">
499
+ {t('templates.forms.accountEnterprise')}
500
+ </Label>
501
+ </div>
502
+ </RadioGroup>
503
+ </div>
504
+ </div>
505
+ </form>
506
+ </CardContent>
507
+ <CardFooter className="flex justify-between">
508
+ <Button variant="outline">{t('templates.forms.cancel')}</Button>
509
+ <Button onClick={handleFormSubmit}>
510
+ {t('templates.forms.createAccount')}
511
+ </Button>
512
+ </CardFooter>
513
+ </Card>
514
+ </TabsContent>
515
+
516
+ {/* Data Tab */}
517
+ <TabsContent value="data" className="space-y-4">
518
+ <SectionErrorBoundary>
519
+ <Card>
520
+ <CardHeader>
521
+ <CardTitle>{t('templates.data.title')}</CardTitle>
522
+ <CardDescription>{t('templates.data.description')}</CardDescription>
523
+ </CardHeader>
524
+ <CardContent>
525
+ <div className="mb-4">
526
+ <div className="relative">
527
+ <Search className="absolute left-3 top-3 h-4 w-4 text-muted-foreground" />
528
+ <Input
529
+ placeholder={t('templates.data.searchPlaceholder')}
530
+ aria-label={t('templates.data.searchPlaceholder')}
531
+ className="pl-10"
532
+ />
533
+ </div>
534
+ </div>
535
+
536
+ <div className="rounded-[var(--radius-lg)] border border-border overflow-hidden">
537
+ <Table>
538
+ <TableHeader>
539
+ <TableRow>
540
+ <TableHead>{t('team.name')}</TableHead>
541
+ <TableHead>{t('team.email')}</TableHead>
542
+ <TableHead>{t('team.role')}</TableHead>
543
+ <TableHead>{t('team.status')}</TableHead>
544
+ <TableHead className="text-right">{t('team.actions')}</TableHead>
545
+ </TableRow>
546
+ </TableHeader>
547
+ <TableBody>
548
+ {teamLoading ? (
549
+ <>
550
+ {Array.from({ length: 5 }).map((_, i) => (
551
+ <TableRow key={i}>
552
+ <TableCell>
553
+ <div className="flex items-center gap-2">
554
+ <Skeleton className="size-8 rounded-full shrink-0" />
555
+ <Skeleton className="h-3.5 w-28" />
556
+ </div>
557
+ </TableCell>
558
+ <TableCell>
559
+ <Skeleton className="h-3.5 w-36" />
560
+ </TableCell>
561
+ <TableCell>
562
+ <Skeleton className="h-3.5 w-20" />
563
+ </TableCell>
564
+ <TableCell>
565
+ <Skeleton className="h-5 w-16 rounded-full" />
566
+ </TableCell>
567
+ <TableCell className="text-right">
568
+ <Skeleton className="h-7 w-14 ml-auto" />
569
+ </TableCell>
570
+ </TableRow>
571
+ ))}
572
+ </>
573
+ ) : (
574
+ teamMembers.map(member => (
575
+ <TableRow key={member.id}>
576
+ <TableCell>{member.name}</TableCell>
577
+ <TableCell>{member.email}</TableCell>
578
+ <TableCell>{t(`team.roles.${member.role}`)}</TableCell>
579
+ <TableCell>
580
+ <Badge
581
+ variant={
582
+ member.status === 'active'
583
+ ? 'default'
584
+ : member.status === 'away'
585
+ ? 'secondary'
586
+ : 'outline'
587
+ }
588
+ >
589
+ {t(`common.${member.status}`)}
590
+ </Badge>
591
+ </TableCell>
592
+ <TableCell className="text-right">
593
+ <Button variant="ghost" size="sm">
594
+ {t('common.edit')}
595
+ </Button>
596
+ </TableCell>
597
+ </TableRow>
598
+ ))
599
+ )}
600
+ </TableBody>
601
+ </Table>
602
+ </div>
603
+ </CardContent>
604
+ <CardFooter className="flex justify-between items-center">
605
+ <p className="text-muted-foreground">
606
+ {t('team.showing', {
607
+ count: teamMembers.length,
608
+ total: teamMembers.length,
609
+ })}
610
+ </p>
611
+ <div className="flex gap-2">
612
+ <Button variant="outline" size="sm">
613
+ {t('common.previous')}
614
+ </Button>
615
+ <Button variant="outline" size="sm">
616
+ {t('common.next')}
617
+ </Button>
618
+ </div>
619
+ </CardFooter>
620
+ </Card>
621
+ </SectionErrorBoundary>
622
+ </TabsContent>
623
+
624
+ {/* Settings Tab */}
625
+ <TabsContent value="settings" className="space-y-4">
626
+ <Card>
627
+ <CardHeader>
628
+ <CardTitle>{t('templates.settings.title')}</CardTitle>
629
+ <CardDescription>{t('templates.settings.description')}</CardDescription>
630
+ </CardHeader>
631
+ <CardContent className="space-y-6">
632
+ {!disableDarkMode && (
633
+ <>
634
+ <div className="flex items-center justify-between">
635
+ <div className="space-y-1">
636
+ <Label htmlFor="dark-mode">
637
+ {t('templates.settings.darkMode')}
638
+ </Label>
639
+ <p className="text-muted-foreground">
640
+ {t('templates.settings.darkModeDescription')}
641
+ </p>
642
+ </div>
643
+ <Switch
644
+ id="dark-mode"
645
+ checked={switchEnabled}
646
+ onCheckedChange={toggleSwitch}
647
+ />
648
+ </div>
649
+
650
+ <Separator />
651
+ </>
652
+ )}
653
+
654
+ <div className="flex items-center justify-between">
655
+ <div className="space-y-1">
656
+ <Label htmlFor="email-notifications">
657
+ {t('templates.settings.emailNotifications')}
658
+ </Label>
659
+ <p className="text-muted-foreground">
660
+ {t('templates.settings.emailNotificationsDescription')}
661
+ </p>
662
+ </div>
663
+ <Switch id="email-notifications" defaultChecked />
664
+ </div>
665
+
666
+ <Separator />
667
+
668
+ <div className="flex items-center justify-between">
669
+ <div className="space-y-1">
670
+ <Label htmlFor="push-notifications">
671
+ {t('templates.settings.pushNotifications')}
672
+ </Label>
673
+ <p className="text-muted-foreground">
674
+ {t('templates.settings.pushNotificationsDescription')}
675
+ </p>
676
+ </div>
677
+ <Switch id="push-notifications" />
678
+ </div>
679
+
680
+ <Separator />
681
+
682
+ <div className="space-y-3">
683
+ <Label>{t('templates.settings.language')}</Label>
684
+ <Select defaultValue="pt-br">
685
+ <SelectTrigger aria-label={t('templates.settings.language')}>
686
+ <SelectValue />
687
+ </SelectTrigger>
688
+ <SelectContent>
689
+ <SelectItem value="pt-br">
690
+ {t('templates.settings.languages.ptBR')}
691
+ </SelectItem>
692
+ <SelectItem value="en">
693
+ {t('templates.settings.languages.en')}
694
+ </SelectItem>
695
+ <SelectItem value="es">
696
+ {t('templates.settings.languages.es')}
697
+ </SelectItem>
698
+ </SelectContent>
699
+ </Select>
700
+ </div>
701
+
702
+ <Separator />
703
+
704
+ <div className="space-y-3">
705
+ <Label>{t('templates.settings.timezone')}</Label>
706
+ <Select defaultValue="america-sao-paulo">
707
+ <SelectTrigger aria-label={t('templates.settings.timezone')}>
708
+ <SelectValue />
709
+ </SelectTrigger>
710
+ <SelectContent>
711
+ <SelectItem value="america-sao-paulo">
712
+ {t('templates.settings.timezones.saoPaulo')}
713
+ </SelectItem>
714
+ <SelectItem value="america-new-york">
715
+ {t('templates.settings.timezones.newYork')}
716
+ </SelectItem>
717
+ <SelectItem value="europe-london">
718
+ {t('templates.settings.timezones.london')}
719
+ </SelectItem>
720
+ </SelectContent>
721
+ </Select>
722
+ </div>
723
+ </CardContent>
724
+ <CardFooter className="flex justify-between">
725
+ <Button variant="outline">{t('templates.settings.restoreDefaults')}</Button>
726
+ <Button>{t('templates.settings.saveChanges')}</Button>
727
+ </CardFooter>
728
+ </Card>
729
+ </TabsContent>
730
+ </Tabs>
731
+ </section>
732
+
733
+ <Separator className="my-8" />
734
+
735
+ {/* Button Variants */}
736
+ <section>
737
+ <h3 className="mb-4">{t('templates.sections.buttons')}</h3>
738
+ <Card>
739
+ <CardHeader>
740
+ <CardTitle>{t('templates.buttons.title')}</CardTitle>
741
+ <CardDescription>{t('templates.buttons.description')}</CardDescription>
742
+ </CardHeader>
743
+ <CardContent className="space-y-6">
744
+ <div className="space-y-3">
745
+ <Label>{t('templates.buttons.variants')}</Label>
746
+ <div className="flex flex-wrap gap-3">
747
+ <Button variant="default">Default</Button>
748
+ <Button variant="secondary">Secondary</Button>
749
+ <Button variant="outline">Outline</Button>
750
+ <Button variant="ghost">Ghost</Button>
751
+ <Button variant="link">Link</Button>
752
+ <Button variant="destructive">Destructive</Button>
753
+ </div>
754
+ </div>
755
+
756
+ <Separator />
757
+
758
+ <div className="space-y-3">
759
+ <Label>{t('templates.buttons.sizes')}</Label>
760
+ <div className="flex flex-wrap items-center gap-3">
761
+ <Button size="sm">Small</Button>
762
+ <Button size="default">Default</Button>
763
+ <Button size="lg">Large</Button>
764
+ <Button size="icon" aria-label={t('nav.settings')}>
765
+ <Settings className="h-4 w-4" />
766
+ </Button>
767
+ </div>
768
+ </div>
769
+
770
+ <Separator />
771
+
772
+ <div className="space-y-3">
773
+ <Label>{t('templates.buttons.withIcons')}</Label>
774
+ <div className="flex flex-wrap gap-3">
775
+ <Button>
776
+ <User className="mr-2 h-4 w-4" />
777
+ {t('templates.buttons.profile')}
778
+ </Button>
779
+ <Button variant="secondary">
780
+ <Mail className="mr-2 h-4 w-4" />
781
+ {t('templates.buttons.messages')}
782
+ </Button>
783
+ <Button variant="outline">
784
+ <Calendar className="mr-2 h-4 w-4" />
785
+ {t('templates.buttons.schedule')}
786
+ </Button>
787
+ </div>
788
+ </div>
789
+
790
+ <Separator />
791
+
792
+ <div className="space-y-3">
793
+ <Label>{t('templates.buttons.states')}</Label>
794
+ <div className="flex flex-wrap gap-3">
795
+ <Button disabled>{t('templates.buttons.disabled')}</Button>
796
+ <Button variant="outline" disabled>
797
+ {t('templates.buttons.outlineDisabled')}
798
+ </Button>
799
+ </div>
800
+ </div>
801
+ </CardContent>
802
+ </Card>
803
+ </section>
804
+
805
+ <Separator className="my-8" />
806
+
807
+ {/* Badges */}
808
+ <section>
809
+ <h3 className="mb-4">{t('templates.sections.badges')}</h3>
810
+ <Card>
811
+ <CardHeader>
812
+ <CardTitle>{t('templates.badges.title')}</CardTitle>
813
+ <CardDescription>{t('templates.badges.description')}</CardDescription>
814
+ </CardHeader>
815
+ <CardContent>
816
+ <div className="flex flex-wrap gap-3">
817
+ <Badge variant="default">Default</Badge>
818
+ <Badge variant="secondary">Secondary</Badge>
819
+ <Badge variant="outline">Outline</Badge>
820
+ <Badge variant="destructive">Destructive</Badge>
821
+ <Badge className="bg-success text-success-foreground">Success</Badge>
822
+ <Badge className="bg-warning text-warning-foreground">Warning</Badge>
823
+ <Badge className="bg-info text-info-foreground">Info</Badge>
824
+ </div>
825
+ </CardContent>
826
+ </Card>
827
+ </section>
828
+
829
+ <Separator className="my-8" />
830
+
831
+ {/* Dialogs */}
832
+ <section>
833
+ <h3 className="mb-4">{t('templates.sections.dialogs')}</h3>
834
+ <div className="grid gap-4 md:grid-cols-2">
835
+ <Card>
836
+ <CardHeader>
837
+ <CardTitle>{t('templates.dialogs.dialogTitle')}</CardTitle>
838
+ <CardDescription>{t('templates.dialogs.dialogDescription')}</CardDescription>
839
+ </CardHeader>
840
+ <CardContent className="flex justify-center py-6">
841
+ <Dialog>
842
+ <DialogTrigger asChild>
843
+ <Button variant="outline">{t('templates.dialogs.editProfile')}</Button>
844
+ </DialogTrigger>
845
+ <DialogContent className="sm:max-w-[425px]">
846
+ <DialogHeader>
847
+ <DialogTitle>{t('templates.dialogs.editProfile')}</DialogTitle>
848
+ <DialogDescription>
849
+ {t('templates.dialogs.editProfileDescription')}
850
+ </DialogDescription>
851
+ </DialogHeader>
852
+ <div className="grid gap-4 py-4">
853
+ <div className="grid grid-cols-4 items-center gap-4">
854
+ <Label htmlFor="name" className="text-right">
855
+ {t('templates.dialogs.name')}
856
+ </Label>
857
+ <Input id="name" defaultValue="John Doe" className="col-span-3" />
858
+ </div>
859
+ <div className="grid grid-cols-4 items-center gap-4">
860
+ <Label htmlFor="username" className="text-right">
861
+ {t('templates.dialogs.username')}
862
+ </Label>
863
+ <Input id="username" defaultValue="@johndoe" className="col-span-3" />
864
+ </div>
865
+ </div>
866
+ <DialogFooter>
867
+ <Button type="submit">{t('templates.dialogs.update')}</Button>
868
+ </DialogFooter>
869
+ </DialogContent>
870
+ </Dialog>
871
+ </CardContent>
872
+ </Card>
873
+
874
+ <Card>
875
+ <CardHeader>
876
+ <CardTitle>{t('templates.dialogs.alertDialogTitle')}</CardTitle>
877
+ <CardDescription>
878
+ {t('templates.dialogs.alertDialogDescription')}
879
+ </CardDescription>
880
+ </CardHeader>
881
+ <CardContent className="flex justify-center py-6">
882
+ <AlertDialog>
883
+ <AlertDialogTrigger asChild>
884
+ <Button variant="destructive">
885
+ {t('templates.dialogs.deleteAccount')}
886
+ </Button>
887
+ </AlertDialogTrigger>
888
+ <AlertDialogContent className="sm:max-w-[425px]">
889
+ <AlertDialogHeader>
890
+ <AlertDialogTitle>{t('templates.dialogs.areYouSure')}</AlertDialogTitle>
891
+ <AlertDialogDescription>
892
+ {t('templates.dialogs.deleteWarning')}
893
+ </AlertDialogDescription>
894
+ </AlertDialogHeader>
895
+ <AlertDialogFooter>
896
+ <AlertDialogCancel>{t('templates.dialogs.cancel')}</AlertDialogCancel>
897
+ <AlertDialogAction className="bg-destructive text-destructive-foreground hover:bg-destructive/90">
898
+ {t('templates.dialogs.continue')}
899
+ </AlertDialogAction>
900
+ </AlertDialogFooter>
901
+ </AlertDialogContent>
902
+ </AlertDialog>
903
+ </CardContent>
904
+ </Card>
905
+ </div>
906
+ </section>
907
+
908
+ <Separator className="my-8" />
909
+
910
+ {/* Maps */}
911
+ <section>
912
+ <MapShowcase />
913
+ </section>
914
+
915
+ <Separator className="my-8" />
916
+
917
+ {/* Header Variations */}
918
+ <section>
919
+ <h3 className="mb-4">{t('templates.headerVariations.sectionTitle')}</h3>
920
+ <Card>
921
+ <CardHeader>
922
+ <CardTitle>{t('templates.headerVariations.cardTitle')}</CardTitle>
923
+ <CardDescription>
924
+ {t('templates.headerVariations.cardDescription')}
925
+ </CardDescription>
926
+ </CardHeader>
927
+ <CardContent className="space-y-6">
928
+ <div className="p-4 border rounded-[var(--radius-lg)] bg-muted/30">
929
+ <h4 className="text-sm font-semibold mb-4">
930
+ {t('templates.headerVariations.visibleElements')}
931
+ </h4>
932
+ <div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-6">
933
+ <div className="flex items-center space-x-2">
934
+ <Switch
935
+ id="header-actions"
936
+ checked={showHeaderActions}
937
+ onCheckedChange={setShowHeaderActions}
938
+ />
939
+ <Label htmlFor="header-actions" className="cursor-pointer">
940
+ {t('templates.headerVariations.actionButtons')}
941
+ </Label>
942
+ </div>
943
+ <div className="flex items-center space-x-2">
944
+ <Switch
945
+ id="header-bread"
946
+ checked={showHeaderBreadcrumbs}
947
+ onCheckedChange={setShowHeaderBreadcrumbs}
948
+ />
949
+ <Label htmlFor="header-bread" className="cursor-pointer">
950
+ {t('templates.headerVariations.breadcrumbsLabel')}
951
+ </Label>
952
+ </div>
953
+ </div>
954
+ </div>
955
+
956
+ <div className="relative border rounded-[var(--radius-lg)] bg-muted/10 overflow-hidden shadow-inner">
957
+ <div className="p-4 bg-background/50 border-b text-xs font-mono text-muted-foreground">
958
+ {t('templates.headerVariations.preview')}
959
+ </div>
960
+ <Header
961
+ title={
962
+ !showHeaderBreadcrumbs
963
+ ? t('templates.headerVariations.currentPage')
964
+ : undefined
965
+ }
966
+ breadcrumbs={
967
+ showHeaderBreadcrumbs
968
+ ? [
969
+ {
970
+ label: t('templates.headerVariations.breadcrumbBrand'),
971
+ href: '#',
972
+ icon: <Home className="w-4 h-4" />,
973
+ },
974
+ {
975
+ label: t('templates.headerVariations.breadcrumbSettings'),
976
+ href: '#',
977
+ },
978
+ { label: t('templates.headerVariations.breadcrumbProfile') },
979
+ ]
980
+ : undefined
981
+ }
982
+ actions={
983
+ showHeaderActions
984
+ ? [
985
+ {
986
+ id: 'notify',
987
+ icon: <Bell className="w-5 h-5" />,
988
+ onClick: () =>
989
+ toast(t('templates.headerVariations.notificationsOpenedToast')),
990
+ },
991
+ {
992
+ id: 'mail',
993
+ label: t('templates.headerVariations.messagesLabel'),
994
+ icon: <Mail className="w-5 h-5" />,
995
+ onClick: () =>
996
+ toast(t('templates.headerVariations.messagesOpenedToast')),
997
+ },
998
+ ]
999
+ : undefined
1000
+ }
1001
+ />
1002
+ <div className="h-32 flex items-center justify-center text-muted-foreground text-sm italic">
1003
+ {t('templates.headerVariations.contentArea')}
1004
+ </div>
1005
+ </div>
1006
+ </CardContent>
1007
+ </Card>
1008
+ </section>
1009
+
1010
+ <Separator className="my-8" />
1011
+
1012
+ {/* Sidebar Variations */}
1013
+ <section>
1014
+ <h3 className="mb-4">{t('templates.sections.sidebarVariations')}</h3>
1015
+ <Card>
1016
+ <CardHeader>
1017
+ <CardTitle>{t('templates.sidebar.title')}</CardTitle>
1018
+ <CardDescription>{t('templates.sidebar.description')}</CardDescription>
1019
+ </CardHeader>
1020
+ <CardContent>
1021
+ <Tabs defaultValue="assistant" className="w-full">
1022
+ <TabsList className="mb-4">
1023
+ <TabsTrigger value="assistant">
1024
+ {t('templates.sidebar.assistantMode')}
1025
+ </TabsTrigger>
1026
+ <TabsTrigger value="default">
1027
+ {t('templates.sidebar.defaultMode')}
1028
+ </TabsTrigger>
1029
+ </TabsList>
1030
+
1031
+ <div className="mb-6 p-4 border rounded-[var(--radius-lg)] bg-muted/30">
1032
+ <h4 className="text-sm font-semibold mb-4">
1033
+ {t('templates.sidebarControls.footerSettings')}
1034
+ </h4>
1035
+ <div className="flex flex-wrap gap-6 mt-2">
1036
+ <div className="flex items-center space-x-2">
1037
+ <Switch
1038
+ id="show-user"
1039
+ checked={showSidebarUser}
1040
+ onCheckedChange={setShowSidebarUser}
1041
+ />
1042
+ <Label htmlFor="show-user" className="cursor-pointer">
1043
+ {t('templates.sidebarControls.userProfile')}
1044
+ </Label>
1045
+ </div>
1046
+ <div className="flex items-center space-x-2">
1047
+ <Switch
1048
+ id="show-settings"
1049
+ checked={showSidebarSettings}
1050
+ onCheckedChange={setShowSidebarSettings}
1051
+ />
1052
+ <Label htmlFor="show-settings" className="cursor-pointer">
1053
+ {t('templates.sidebarControls.settings')}
1054
+ </Label>
1055
+ </div>
1056
+ <div className="flex items-center space-x-2">
1057
+ <Switch
1058
+ id="show-logout"
1059
+ checked={showSidebarLogout}
1060
+ onCheckedChange={setShowSidebarLogout}
1061
+ />
1062
+ <Label htmlFor="show-logout" className="cursor-pointer">
1063
+ {t('templates.sidebarControls.logoutButton')}
1064
+ </Label>
1065
+ </div>
1066
+ </div>
1067
+
1068
+ <div className="mt-6 pt-6 border-t">
1069
+ <div className="flex items-center justify-between mb-4">
1070
+ <h4 className="text-sm font-semibold">
1071
+ {t('templates.sidebarControls.sidebarWidthDesktop')}
1072
+ </h4>
1073
+ <span className="text-xs font-mono bg-muted px-2 py-1 rounded">
1074
+ {sidebarWidth}px
1075
+ </span>
1076
+ </div>
1077
+ <div className="flex items-center gap-4">
1078
+ <span className="text-xs text-muted-foreground w-12 text-right">
1079
+ 240px
1080
+ </span>
1081
+ <Slider
1082
+ value={[sidebarWidth]}
1083
+ onValueChange={val => setSidebarWidth(val[0])}
1084
+ min={240}
1085
+ max={450}
1086
+ step={10}
1087
+ className="flex-1"
1088
+ aria-label={t('templates.sidebarControls.sidebarWidthAriaLabel')}
1089
+ />
1090
+ <span className="text-xs text-muted-foreground w-12">450px</span>
1091
+ </div>
1092
+ </div>
1093
+ </div>
1094
+
1095
+ <TabsContent value="assistant">
1096
+ <div
1097
+ className="relative h-[600px] border rounded-[var(--radius-lg)] bg-muted/20 overflow-hidden"
1098
+ style={{ transform: 'translateZ(0)' }}
1099
+ >
1100
+ <Sidebar
1101
+ expanded={true}
1102
+ width={sidebarWidth}
1103
+ onToggle={() => {}}
1104
+ user={{ email: 'admin@xertica.com' }}
1105
+ onLogout={() => toast(t('templates.sidebar.logoutToast'))}
1106
+ location={{ pathname: '/assistant/current' }}
1107
+ navigate={() => {}}
1108
+ variant="assistant"
1109
+ search={{
1110
+ show: true,
1111
+ placeholder: t('templates.sidebar.searchTopicsPlaceholder'),
1112
+ filter: {
1113
+ show: true,
1114
+ content: (
1115
+ <div className="p-2 space-y-2">
1116
+ <div className="text-xs font-semibold uppercase text-muted-foreground px-2">
1117
+ {t('templates.sidebarControls.filterByStatus')}
1118
+ </div>
1119
+ <div className="flex flex-wrap gap-2 p-1">
1120
+ <Badge className="bg-sidebar-foreground/20 text-sidebar-foreground border-none cursor-pointer hover:bg-sidebar-foreground/30">
1121
+ {t('templates.sidebarControls.filterActive')}
1122
+ </Badge>
1123
+ <Badge
1124
+ variant="outline"
1125
+ className="text-sidebar-foreground/70 border-sidebar-foreground/20 cursor-pointer hover:bg-sidebar-foreground/10"
1126
+ >
1127
+ {t('templates.sidebarControls.filterArchived')}
1128
+ </Badge>
1129
+ <Badge
1130
+ variant="outline"
1131
+ className="text-sidebar-foreground/70 border-sidebar-foreground/20 cursor-pointer hover:bg-sidebar-foreground/10"
1132
+ >
1133
+ {t('templates.sidebarControls.filterPending')}
1134
+ </Badge>
1135
+ </div>
1136
+ </div>
1137
+ ),
1138
+ },
1139
+ }}
1140
+ fixedArea={{
1141
+ show: true,
1142
+ content: (
1143
+ <Button className="w-full bg-sidebar-primary hover:bg-sidebar-primary/90 text-sidebar-primary-foreground shadow-lg font-bold border-none transition-all duration-300 transform hover:scale-[1.02] active:scale-[0.98]">
1144
+ <Plus className="w-4 h-4 mr-2" />
1145
+ {t('templates.sidebar.newConversation')}
1146
+ </Button>
1147
+ ),
1148
+ }}
1149
+ navigationGroups={[
1150
+ {
1151
+ id: 'recent',
1152
+ label: t('templates.sidebar.recent'),
1153
+ icon: Clock,
1154
+ items: [
1155
+ {
1156
+ path: '/assistant/refatoracao',
1157
+ label: t('templates.sidebar.items.sidebarRefactor'),
1158
+ description: t(
1159
+ 'templates.sidebar.items.sidebarRefactorDescription'
1160
+ ),
1161
+ actions: [
1162
+ {
1163
+ label: t('templates.sidebar.actions.rename'),
1164
+ icon: FileEdit,
1165
+ onClick: () =>
1166
+ toast(t('templates.sidebar.actions.renameToast')),
1167
+ },
1168
+ {
1169
+ label: t('templates.sidebar.actions.move'),
1170
+ icon: ArrowRightLeft,
1171
+ children: [
1172
+ {
1173
+ label: t('templates.sidebar.actions.moveActive'),
1174
+ onClick: () =>
1175
+ toast(t('templates.sidebar.actions.moveActiveToast')),
1176
+ },
1177
+ {
1178
+ label: t('templates.sidebar.actions.moveMonitoring'),
1179
+ onClick: () =>
1180
+ toast(
1181
+ t('templates.sidebar.actions.moveMonitoringToast')
1182
+ ),
1183
+ },
1184
+ {
1185
+ label: t('templates.sidebar.actions.moveArchive'),
1186
+ onClick: () =>
1187
+ toast(
1188
+ t('templates.sidebar.actions.moveArchiveToast')
1189
+ ),
1190
+ },
1191
+ ],
1192
+ },
1193
+ {
1194
+ label: t('templates.sidebar.actions.clear'),
1195
+ icon: Trash2,
1196
+ onClick: () =>
1197
+ toast(t('templates.sidebar.actions.clearToast')),
1198
+ variant: 'destructive',
1199
+ },
1200
+ ],
1201
+ },
1202
+ ],
1203
+ },
1204
+ {
1205
+ id: 'projects',
1206
+ label: t('templates.sidebar.constructionMonitoring'),
1207
+ icon: Map,
1208
+ actions: [
1209
+ {
1210
+ label: t('templates.sidebar.actions.newCategory'),
1211
+ icon: Plus,
1212
+ onClick: () =>
1213
+ toast(t('templates.sidebar.actions.newCategoryToast')),
1214
+ },
1215
+ {
1216
+ label: t('templates.sidebar.actions.archiveGroup'),
1217
+ icon: Archive,
1218
+ onClick: () =>
1219
+ toast(t('templates.sidebar.actions.archiveGroupToast')),
1220
+ },
1221
+ ],
1222
+ items: [
1223
+ {
1224
+ path: '/assistant/br163',
1225
+ label: t('templates.sidebar.items.br163Restoration'),
1226
+ icon: () => (
1227
+ <div className="w-2 h-2 rounded-full bg-yellow-500" />
1228
+ ),
1229
+ description: (
1230
+ <div className="space-y-1.5 min-w-[160px]">
1231
+ <Progress
1232
+ value={67}
1233
+ className="h-1.5 bg-sidebar-foreground/10"
1234
+ />
1235
+ <div className="flex justify-between items-center text-[10px] text-sidebar-foreground/60">
1236
+ <span>{t('templates.sidebar.items.br163Location')}</span>
1237
+ <span>67%</span>
1238
+ </div>
1239
+ </div>
1240
+ ),
1241
+ },
1242
+ ],
1243
+ },
1244
+ ]}
1245
+ footer={{
1246
+ showUser: showSidebarUser,
1247
+ showSettings: showSidebarSettings,
1248
+ showLogout: showSidebarLogout,
1249
+ }}
1250
+ />
1251
+ <div
1252
+ className="absolute inset-y-0 right-0 p-8 flex items-center justify-center transition-all duration-300"
1253
+ style={{ left: `${sidebarWidth}px` }}
1254
+ >
1255
+ <p className="text-muted-foreground text-center">
1256
+ {t('templates.sidebar.assistantContent')}
1257
+ </p>
1258
+ </div>
1259
+ </div>
1260
+ </TabsContent>
1261
+
1262
+ <TabsContent value="default">
1263
+ <div
1264
+ className="relative h-[600px] border rounded-[var(--radius-lg)] bg-muted/20 overflow-hidden"
1265
+ style={{ transform: 'translateZ(0)' }}
1266
+ >
1267
+ <Sidebar
1268
+ expanded={true}
1269
+ width={sidebarWidth}
1270
+ onToggle={() => {}}
1271
+ user={{
1272
+ name: 'Ariel Santos',
1273
+ email: 'admin@xertica.com',
1274
+ avatar: 'https://github.com/shadcn.png',
1275
+ }}
1276
+ onLogout={() => toast(t('templates.sidebar.logoutToast'))}
1277
+ onSettingsClick={() =>
1278
+ toast(t('templates.sidebar.settingsClickedToast'))
1279
+ }
1280
+ location={{ pathname: '/home' }}
1281
+ navigate={() => {}}
1282
+ variant="default"
1283
+ routes={[
1284
+ {
1285
+ path: '/home',
1286
+ label: t('templates.sidebar.routes.home'),
1287
+ icon: Home,
1288
+ },
1289
+ {
1290
+ path: '/dashboard',
1291
+ label: t('templates.sidebar.routes.dashboard'),
1292
+ icon: Users,
1293
+ },
1294
+ {
1295
+ path: '/settings',
1296
+ label: t('templates.sidebar.routes.settings'),
1297
+ icon: Settings,
1298
+ },
1299
+ ]}
1300
+ footer={{
1301
+ showUser: showSidebarUser,
1302
+ showSettings: showSidebarSettings,
1303
+ showLogout: showSidebarLogout,
1304
+ }}
1305
+ />
1306
+ <div
1307
+ className="absolute inset-y-0 right-0 p-8 flex items-center justify-center transition-all duration-300"
1308
+ style={{ left: `${sidebarWidth}px` }}
1309
+ >
1310
+ <p className="text-muted-foreground text-center">
1311
+ {t('templates.sidebar.defaultContent')}
1312
+ </p>
1313
+ </div>
1314
+ </div>
1315
+ </TabsContent>
1316
+ </Tabs>
1317
+ </CardContent>
1318
+ </Card>
1319
+ </section>
1320
+
1321
+ <Separator className="my-8" />
1322
+
1323
+ {/* Footer Note */}
1324
+ <Card className="mt-8">
1325
+ <CardHeader>
1326
+ <CardTitle>{t('templates.footer.title')}</CardTitle>
1327
+ <CardDescription>{t('templates.footer.subtitle')}</CardDescription>
1328
+ </CardHeader>
1329
+ <CardContent className="space-y-4">
1330
+ <p className="text-muted-foreground">
1331
+ {t('templates.footer.descriptionPart1')}
1332
+ <code className="bg-muted px-2 py-1 rounded-[var(--radius-sm)] [font-size:var(--text-small)]">
1333
+ xertica-ui
1334
+ </code>
1335
+ {t('templates.footer.descriptionPart2')}
1336
+ </p>
1337
+ <Alert variant="info">
1338
+ <AlertTitle>{t('templates.footer.tipTitle')}</AlertTitle>
1339
+ <AlertDescription>
1340
+ {t('templates.footer.tipDescriptionPart1')}
1341
+ <code className="bg-muted px-1 rounded">styles/xertica/tokens.css</code>
1342
+ {t('templates.footer.tipDescriptionPart2')}
1343
+ </AlertDescription>
1344
+ </Alert>
1345
+ </CardContent>
1346
+ </Card>
1347
+ </div>
1348
+ </div>
1349
+ </div>
1350
+ </main>
1351
+ </div>
1352
+ );
1353
+ }