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.
@@ -23,7 +23,6 @@ import {
23
23
  DropdownMenuSubContent,
24
24
  DropdownMenuPortal,
25
25
  } from '../../ui/dropdown-menu';
26
- import { ScrollArea } from '../../ui/scroll-area';
27
26
  import { Input } from '../../ui/input';
28
27
  import { Search as SearchIcon } from 'lucide-react';
29
28
  import { cn } from '../../shared/utils';
@@ -926,9 +925,12 @@ function SidebarNav({
926
925
  if (variant === 'assistant') {
927
926
  return (
928
927
  <div className="flex-1 min-h-0 overflow-hidden">
929
- <ScrollArea className="h-full px-4">
928
+ <div
929
+ className="h-full px-4"
930
+ style={{ overflowY: 'auto', overflowX: 'hidden' }}
931
+ >
930
932
  {navigationGroups.map(group => renderAssistantGroup(group))}
931
- </ScrollArea>
933
+ </div>
932
934
  </div>
933
935
  );
934
936
  }
@@ -936,7 +938,10 @@ function SidebarNav({
936
938
  if (isMobileViewport && isOverflowAccordionOpen) {
937
939
  return (
938
940
  <div className="flex-1 min-h-0 overflow-hidden">
939
- <ScrollArea className="h-full">
941
+ <div
942
+ className="h-full"
943
+ style={{ overflowY: 'auto', overflowX: 'hidden' }}
944
+ >
940
945
  <nav
941
946
  id="sidebar-nav"
942
947
  aria-label={t('sidebar.mainNavigation')}
@@ -1008,7 +1013,7 @@ function SidebarNav({
1008
1013
  </div>
1009
1014
  )}
1010
1015
  </nav>
1011
- </ScrollArea>
1016
+ </div>
1012
1017
  </div>
1013
1018
  );
1014
1019
  }
@@ -1,120 +1,119 @@
1
- import React from 'react';
2
- import { Card, CardContent, CardFooter, CardHeader, CardTitle } from '../../ui/card';
3
- import { Header } from '../../layout/header';
4
- import { Button } from '../../ui/button';
5
- import { FileText } from 'lucide-react';
6
- import { ScrollArea } from '../../ui/scroll-area';
7
- import { useLocation, useNavigate, Link } from 'react-router-dom';
8
- import { Badge } from '../../ui/badge';
9
- import { PageHeader } from '../../ui/page-header';
10
- import { useOptionalLayout } from '../../../contexts/LayoutContext';
11
- import { SIDEBAR_EXPANDED_WIDTH, SIDEBAR_COLLAPSED_WIDTH } from '../../shared/layout-constants';
12
- import { useFeatureCards } from '../../../features/home';
13
- import { useTranslation } from 'react-i18next';
14
- import { SectionErrorBoundary } from '../../shared/error-boundary';
15
- import { FeatureCardSkeleton } from '../../blocks/card-patterns/FeatureCardSkeleton';
16
-
17
- /**
18
- * Main dashboard content area for the landing page.
19
- *
20
- * @description
21
- * Fetches feature cards via `useFeatureCards` (React Query). All UI strings are
22
- * translated via `useTranslation()` — change language via `LanguageSelector`.
23
- *
24
- * @ai-rules
25
- * 1. Data: Feature cards come from `useFeatureCards()` — never hardcode them here.
26
- * 2. i18n: Use `t('home.*')` for all UI strings never hardcode text in JSX.
27
- * 3. Loading: Renders a skeleton card while the query is in-flight.
28
- */
29
- export function HomeContent() {
30
- const { t } = useTranslation();
31
- const layout = useOptionalLayout();
32
- const sidebarExpanded = layout?.sidebarExpanded ?? false;
33
- const sidebarWidth = layout?.sidebarWidth ?? 256;
34
- const navigate = useNavigate();
35
-
36
- const { data: featureCards = [], isLoading } = useFeatureCards();
37
-
38
- return (
39
- <div
40
- style={{
41
- paddingLeft: sidebarExpanded ? `${sidebarWidth}px` : SIDEBAR_COLLAPSED_WIDTH,
42
- }}
43
- className="flex-1 flex flex-col overflow-hidden transition-all duration-300"
44
- >
45
- <Header
46
- showThemeToggle={true}
47
- showLanguageSelector={true}
48
- breadcrumbs={[{ label: t('nav.designSystem'), href: '/home' }, { label: t('nav.home') }]}
49
- renderLink={(href, props) => <Link to={href} {...props} />}
50
- />
51
-
52
- <main className="flex-1 overflow-hidden bg-muted">
53
- <ScrollArea className="h-full">
54
- <div className="p-5 sm:p-4 md:p-6">
55
- <div className="max-w-6xl mx-auto space-y-8">
56
- <PageHeader title={t('home.welcome')} subtitle={t('home.subtitle')} />
57
-
58
- <SectionErrorBoundary>
59
- <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
60
- {isLoading ? (
61
- <>
62
- <FeatureCardSkeleton showAction />
63
- <FeatureCardSkeleton showAction />
64
- <FeatureCardSkeleton showAction />
65
- </>
66
- ) : (
67
- featureCards.map(card => (
68
- <Card
69
- key={card.id}
70
- className="hover:shadow-xl transition-shadow duration-200 flex flex-col h-full"
71
- >
72
- <CardHeader>
73
- <div className="flex items-center gap-3">
74
- <div className="p-2 bg-[var(--chart-2)]/20 rounded-[var(--radius)]">
75
- <FileText className="w-6 h-6 text-[var(--chart-2)]" />
76
- </div>
77
- <div className="flex items-center gap-2">
78
- <CardTitle className="text-sm">
79
- {t(`home.${card.id.replace(/-/g, '')}Title`, {
80
- defaultValue: card.title,
81
- })}
82
- </CardTitle>
83
- {card.badge && (
84
- <Badge variant="default" className="text-xs">
85
- {t(`home.${card.id.replace(/-/g, '')}badge`, {
86
- defaultValue: card.badge,
87
- })}
88
- </Badge>
89
- )}
90
- </div>
91
- </div>
92
- </CardHeader>
93
- <CardContent className="flex-1">
94
- <p className="text-muted-foreground">
95
- {t(`home.${card.id.replace(/-/g, '')}Description`, {
96
- defaultValue: card.description,
97
- })}
98
- </p>
99
- </CardContent>
100
- <CardFooter>
101
- <Button
102
- variant="outline"
103
- className="w-full"
104
- onClick={() => navigate(card.href)}
105
- >
106
- {t('common.view')}
107
- </Button>
108
- </CardFooter>
109
- </Card>
110
- ))
111
- )}
112
- </div>
113
- </SectionErrorBoundary>
114
- </div>
115
- </div>
116
- </ScrollArea>
117
- </main>
118
- </div>
119
- );
120
- }
1
+ import React from 'react';
2
+ import { Card, CardContent, CardFooter, CardHeader, CardTitle } from '../../ui/card';
3
+ import { Header } from '../../layout/header';
4
+ import { Button } from '../../ui/button';
5
+ import { FileText } from 'lucide-react';
6
+ import { useLocation, useNavigate, Link } from 'react-router-dom';
7
+ import { Badge } from '../../ui/badge';
8
+ import { PageHeader } from '../../ui/page-header';
9
+ import { useOptionalLayout } from '../../../contexts/LayoutContext';
10
+ import { SIDEBAR_EXPANDED_WIDTH, SIDEBAR_COLLAPSED_WIDTH } from '../../shared/layout-constants';
11
+ import { useFeatureCards } from '../../../features/home';
12
+ import { useTranslation } from 'react-i18next';
13
+ import { SectionErrorBoundary } from '../../shared/error-boundary';
14
+ import { FeatureCardSkeleton } from '../../blocks/card-patterns/FeatureCardSkeleton';
15
+
16
+ /**
17
+ * Main dashboard content area for the landing page.
18
+ *
19
+ * @description
20
+ * Fetches feature cards via `useFeatureCards` (React Query). All UI strings are
21
+ * translated via `useTranslation()` change language via `LanguageSelector`.
22
+ *
23
+ * @ai-rules
24
+ * 1. Data: Feature cards come from `useFeatureCards()` — never hardcode them here.
25
+ * 2. i18n: Use `t('home.*')` for all UI strings — never hardcode text in JSX.
26
+ * 3. Loading: Renders a skeleton card while the query is in-flight.
27
+ */
28
+ export function HomeContent() {
29
+ const { t } = useTranslation();
30
+ const layout = useOptionalLayout();
31
+ const sidebarExpanded = layout?.sidebarExpanded ?? false;
32
+ const sidebarWidth = layout?.sidebarWidth ?? 256;
33
+ const navigate = useNavigate();
34
+
35
+ const { data: featureCards = [], isLoading } = useFeatureCards();
36
+
37
+ return (
38
+ <div
39
+ style={{
40
+ paddingLeft: sidebarExpanded ? `${sidebarWidth}px` : SIDEBAR_COLLAPSED_WIDTH,
41
+ }}
42
+ className="flex-1 flex flex-col overflow-hidden transition-all duration-300"
43
+ >
44
+ <Header
45
+ showThemeToggle={true}
46
+ showLanguageSelector={true}
47
+ breadcrumbs={[{ label: t('nav.designSystem'), href: '/home' }, { label: t('nav.home') }]}
48
+ renderLink={(href, props) => <Link to={href} {...props} />}
49
+ />
50
+
51
+ <main className="flex-1 overflow-hidden bg-muted">
52
+ <div className="h-full" style={{ overflowY: 'auto', overflowX: 'hidden' }}>
53
+ <div className="p-5 sm:p-4 md:p-6">
54
+ <div className="max-w-6xl mx-auto space-y-8">
55
+ <PageHeader title={t('home.welcome')} subtitle={t('home.subtitle')} />
56
+
57
+ <SectionErrorBoundary>
58
+ <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
59
+ {isLoading ? (
60
+ <>
61
+ <FeatureCardSkeleton showAction />
62
+ <FeatureCardSkeleton showAction />
63
+ <FeatureCardSkeleton showAction />
64
+ </>
65
+ ) : (
66
+ featureCards.map(card => (
67
+ <Card
68
+ key={card.id}
69
+ className="hover:shadow-xl transition-shadow duration-200 flex flex-col h-full"
70
+ >
71
+ <CardHeader>
72
+ <div className="flex items-center gap-3">
73
+ <div className="p-2 bg-[var(--chart-2)]/20 rounded-[var(--radius)]">
74
+ <FileText className="w-6 h-6 text-[var(--chart-2)]" />
75
+ </div>
76
+ <div className="flex items-center gap-2">
77
+ <CardTitle className="text-sm">
78
+ {t(`home.${card.id.replace(/-/g, '')}Title`, {
79
+ defaultValue: card.title,
80
+ })}
81
+ </CardTitle>
82
+ {card.badge && (
83
+ <Badge variant="default" className="text-xs">
84
+ {t(`home.${card.id.replace(/-/g, '')}badge`, {
85
+ defaultValue: card.badge,
86
+ })}
87
+ </Badge>
88
+ )}
89
+ </div>
90
+ </div>
91
+ </CardHeader>
92
+ <CardContent className="flex-1">
93
+ <p className="text-muted-foreground">
94
+ {t(`home.${card.id.replace(/-/g, '')}Description`, {
95
+ defaultValue: card.description,
96
+ })}
97
+ </p>
98
+ </CardContent>
99
+ <CardFooter>
100
+ <Button
101
+ variant="outline"
102
+ className="w-full"
103
+ onClick={() => navigate(card.href)}
104
+ >
105
+ {t('common.view')}
106
+ </Button>
107
+ </CardFooter>
108
+ </Card>
109
+ ))
110
+ )}
111
+ </div>
112
+ </SectionErrorBoundary>
113
+ </div>
114
+ </div>
115
+ </div>
116
+ </main>
117
+ </div>
118
+ );
119
+ }