xertica-ui 1.4.7 → 1.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/HomeContent.tsx +4 -1
- package/components/TemplateContent.tsx +6 -30
- package/components/XerticaProvider.tsx +16 -2
- package/components/index.ts +2 -0
- package/contexts/BrandColorsContext.tsx +36 -4
- package/dist/components/XerticaProvider.d.ts +3 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/contexts/BrandColorsContext.d.ts +2 -0
- package/dist/index.es.js +134 -102
- package/dist/index.umd.js +133 -101
- package/dist/xertica-ui.css +2 -1
- package/package.json +1 -2
- package/templates/index.css +59 -4
- package/templates/package.json +2 -2
- package/templates/src/content/HomeContent.tsx +6 -1
- package/templates/src/main.tsx +1 -1
|
@@ -47,7 +47,10 @@ export function HomeContent({ }: HomeContentProps) {
|
|
|
47
47
|
className={`flex-1 flex flex-col overflow-hidden transition-all duration-300`}
|
|
48
48
|
>
|
|
49
49
|
<Header
|
|
50
|
-
|
|
50
|
+
breadcrumbs={[
|
|
51
|
+
{ label: 'Xertica UI', },
|
|
52
|
+
{ label: 'Início' },
|
|
53
|
+
]}
|
|
51
54
|
/>
|
|
52
55
|
|
|
53
56
|
{/* Área de conteúdo */}
|
|
@@ -66,36 +66,12 @@ export function TemplateContent({ }: TemplateContentProps) {
|
|
|
66
66
|
}`}
|
|
67
67
|
>
|
|
68
68
|
{/* Header fixo */}
|
|
69
|
-
<
|
|
70
|
-
|
|
71
|
-
<
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
size="sm"
|
|
76
|
-
onClick={toggleSidebar}
|
|
77
|
-
className="md:hidden mr-2 p-2"
|
|
78
|
-
>
|
|
79
|
-
<Menu className="w-5 h-5" />
|
|
80
|
-
</Button>
|
|
81
|
-
<span className="text-primary [font-weight:var(--font-weight-medium)]">Xertica.ai</span>
|
|
82
|
-
<ChevronRight className="w-4 h-4" />
|
|
83
|
-
<span className="text-foreground [font-weight:var(--font-weight-medium)]">Template Page</span>
|
|
84
|
-
</div>
|
|
85
|
-
|
|
86
|
-
{/* Controles do usuário */}
|
|
87
|
-
<div className="flex items-center gap-3">
|
|
88
|
-
{/* Badge de versão */}
|
|
89
|
-
<Badge variant="default" className="hidden sm:flex">v1.0.0</Badge>
|
|
90
|
-
|
|
91
|
-
{/* Seletor de idioma */}
|
|
92
|
-
<LanguageSelector variant="minimal" showIcon={false} className="hidden sm:flex" />
|
|
93
|
-
|
|
94
|
-
{/* Toggle de tema */}
|
|
95
|
-
<ThemeToggle className="hover:bg-accent" />
|
|
96
|
-
</div>
|
|
97
|
-
</div>
|
|
98
|
-
</header>
|
|
69
|
+
<Header
|
|
70
|
+
breadcrumbs={[
|
|
71
|
+
{ label: 'Xertica UI', href: '/home', icon: <Home className="w-4 h-4" /> },
|
|
72
|
+
{ label: 'Template Page' },
|
|
73
|
+
]}
|
|
74
|
+
/>
|
|
99
75
|
|
|
100
76
|
{/* Área de conteúdo */}
|
|
101
77
|
<main className="flex-1 overflow-hidden bg-muted">
|
|
@@ -14,10 +14,20 @@ interface XerticaProviderProps {
|
|
|
14
14
|
apiKey?: string; // Optional Gemini API Key
|
|
15
15
|
googleMapsApiKey?: string; // Optional Maps API Key
|
|
16
16
|
defaultBrandTheme?: string;
|
|
17
|
+
primaryColor?: string; // Add this
|
|
18
|
+
useCustomTokens?: boolean; // Add this
|
|
17
19
|
disableDarkMode?: boolean;
|
|
18
20
|
}
|
|
19
21
|
|
|
20
|
-
export function XerticaProvider({
|
|
22
|
+
export function XerticaProvider({
|
|
23
|
+
children,
|
|
24
|
+
apiKey,
|
|
25
|
+
googleMapsApiKey,
|
|
26
|
+
defaultBrandTheme,
|
|
27
|
+
primaryColor,
|
|
28
|
+
useCustomTokens,
|
|
29
|
+
disableDarkMode
|
|
30
|
+
}: XerticaProviderProps) {
|
|
21
31
|
// Note: ApiKeyProvider and GoogleMapsLoaderProvider might need props for keys if not handling internals
|
|
22
32
|
// Currently ApiKeyProvider seems to manage key internally or via props? logic check needed.
|
|
23
33
|
// Assuming default behavior for now, but ideally we pass keys here.
|
|
@@ -26,7 +36,11 @@ export function XerticaProvider({ children, apiKey, googleMapsApiKey, defaultBra
|
|
|
26
36
|
<ApiKeyProvider>
|
|
27
37
|
<GoogleMapsLoaderProvider>
|
|
28
38
|
<LanguageProvider>
|
|
29
|
-
<BrandColorsProvider
|
|
39
|
+
<BrandColorsProvider
|
|
40
|
+
defaultTheme={defaultBrandTheme}
|
|
41
|
+
primaryColor={primaryColor}
|
|
42
|
+
useCustomTokens={useCustomTokens}
|
|
43
|
+
>
|
|
30
44
|
<ThemeProvider disableDarkMode={disableDarkMode}>
|
|
31
45
|
<AssistenteProvider>
|
|
32
46
|
<LayoutProvider>
|
package/components/index.ts
CHANGED
|
@@ -21,28 +21,58 @@ const BrandColorsContext = createContext<BrandColorsContextType | undefined>(und
|
|
|
21
21
|
interface BrandColorsProviderProps {
|
|
22
22
|
children: React.ReactNode;
|
|
23
23
|
defaultTheme?: string;
|
|
24
|
+
primaryColor?: string;
|
|
25
|
+
useCustomTokens?: boolean;
|
|
24
26
|
}
|
|
25
27
|
|
|
26
|
-
export const BrandColorsProvider: React.FC<BrandColorsProviderProps> = ({
|
|
28
|
+
export const BrandColorsProvider: React.FC<BrandColorsProviderProps> = ({
|
|
29
|
+
children,
|
|
30
|
+
defaultTheme,
|
|
31
|
+
primaryColor,
|
|
32
|
+
useCustomTokens = false
|
|
33
|
+
}) => {
|
|
27
34
|
const [currentTheme, setCurrentTheme] = useState<string>(() => {
|
|
28
|
-
//
|
|
29
|
-
|
|
35
|
+
// Se primaryColor for passado, ignoramos o nome do tema
|
|
36
|
+
if (primaryColor) return 'custom';
|
|
30
37
|
return defaultTheme || 'xertica-original';
|
|
31
38
|
});
|
|
32
39
|
|
|
33
40
|
const [radius, setRadius] = useState<number>(0.5);
|
|
34
41
|
|
|
35
42
|
const [colors, setColors] = useState<BrandColors>(() => {
|
|
43
|
+
if (primaryColor) {
|
|
44
|
+
// Criar um tema sob demanda baseado na cor primária
|
|
45
|
+
return {
|
|
46
|
+
...colorThemes[0].colors,
|
|
47
|
+
primary: primaryColor,
|
|
48
|
+
primaryDarkMode: primaryColor,
|
|
49
|
+
sidebarLight: primaryColor,
|
|
50
|
+
sidebarDark: primaryColor,
|
|
51
|
+
chart1: primaryColor,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
36
54
|
const theme = colorThemes.find(t => t.id === currentTheme);
|
|
37
55
|
return theme?.colors || colorThemes[0].colors;
|
|
38
56
|
});
|
|
39
57
|
|
|
40
58
|
useEffect(() => {
|
|
59
|
+
if (primaryColor) {
|
|
60
|
+
setColors({
|
|
61
|
+
...colorThemes[0].colors,
|
|
62
|
+
primary: primaryColor,
|
|
63
|
+
primaryDarkMode: primaryColor,
|
|
64
|
+
sidebarLight: primaryColor,
|
|
65
|
+
sidebarDark: primaryColor,
|
|
66
|
+
chart1: primaryColor,
|
|
67
|
+
});
|
|
68
|
+
setCurrentTheme('custom');
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
41
71
|
const theme = colorThemes.find(t => t.id === currentTheme);
|
|
42
72
|
if (theme) {
|
|
43
73
|
setColors(theme.colors);
|
|
44
74
|
}
|
|
45
|
-
}, [currentTheme]);
|
|
75
|
+
}, [currentTheme, primaryColor]);
|
|
46
76
|
|
|
47
77
|
// Função auxiliar para converter hex para rgb
|
|
48
78
|
const hexToRgb = (hex: string): { r: number; g: number; b: number } | null => {
|
|
@@ -58,6 +88,8 @@ export const BrandColorsProvider: React.FC<BrandColorsProviderProps> = ({ childr
|
|
|
58
88
|
|
|
59
89
|
// Função para aplicar as cores baseadas no modo atual e tema
|
|
60
90
|
const applyColors = React.useCallback(() => {
|
|
91
|
+
if (useCustomTokens) return; // Skip if user wants to use local tokens.css
|
|
92
|
+
|
|
61
93
|
const root = document.documentElement;
|
|
62
94
|
const isDark = root.classList.contains('dark');
|
|
63
95
|
|
|
@@ -4,7 +4,9 @@ interface XerticaProviderProps {
|
|
|
4
4
|
apiKey?: string;
|
|
5
5
|
googleMapsApiKey?: string;
|
|
6
6
|
defaultBrandTheme?: string;
|
|
7
|
+
primaryColor?: string;
|
|
8
|
+
useCustomTokens?: boolean;
|
|
7
9
|
disableDarkMode?: boolean;
|
|
8
10
|
}
|
|
9
|
-
export declare function XerticaProvider({ children, apiKey, googleMapsApiKey, defaultBrandTheme, disableDarkMode }: XerticaProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function XerticaProvider({ children, apiKey, googleMapsApiKey, defaultBrandTheme, primaryColor, useCustomTokens, disableDarkMode }: XerticaProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
10
12
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import '../index.css';
|
|
1
2
|
export { XerticaAssistant } from './ui/xertica-assistant';
|
|
2
3
|
export { XerticaProvider } from './XerticaProvider';
|
|
3
4
|
export type { XerticaAssistantProps, Message, Conversation, Suggestion, SearchResult, SearchSource, SearchCommand, MessageType, AttachmentType, SearchResultType, AssistantMode, AssistantTab } from './ui/xertica-assistant';
|
|
@@ -11,6 +11,8 @@ interface BrandColorsContextType {
|
|
|
11
11
|
interface BrandColorsProviderProps {
|
|
12
12
|
children: React.ReactNode;
|
|
13
13
|
defaultTheme?: string;
|
|
14
|
+
primaryColor?: string;
|
|
15
|
+
useCustomTokens?: boolean;
|
|
14
16
|
}
|
|
15
17
|
export declare const BrandColorsProvider: React.FC<BrandColorsProviderProps>;
|
|
16
18
|
export declare const useBrandColors: () => BrandColorsContextType;
|
package/dist/index.es.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import React__default, { useState, useRef, useEffect, createContext, useContext, useCallback, useMemo } from "react";
|
|
4
4
|
import { AnimatePresence, motion } from "framer-motion";
|
|
5
|
-
import { XIcon, CheckIcon, CircleIcon, ChevronRightIcon, Loader2, ChevronUp, ChevronDown, X, Plus, FileText, Radio, Search as Search$1, Paperclip, Mic, Send, BarChart3, ImageIcon, Table as Table$1, Maximize2, ChevronRight, PanelRight, MessageSquare, Heart, History, MoreHorizontal, ChevronLeft, Download, Edit, Music, Image, AlertCircle, FolderOpen, Folder, Users, ExternalLink, Clock, ThumbsUp, ThumbsDown, Check, Copy, ArrowLeft, Menu, Settings, LogOut, XCircle, AlertTriangle, Info, CheckCircle,
|
|
5
|
+
import { XIcon, CheckIcon, CircleIcon, ChevronRightIcon, Loader2, ChevronUp, ChevronDown, X, Plus, FileText, Radio, Search as Search$1, Paperclip, Mic, Send, BarChart3, ImageIcon, Table as Table$1, Maximize2, ChevronRight, PanelRight, MessageSquare, Heart, History, MoreHorizontal, ChevronLeft, Download, Edit, Music, Image, AlertCircle, FolderOpen, Folder, Users, ExternalLink, Clock, ThumbsUp, ThumbsDown, Check, Copy, ArrowLeft, Menu, Settings, LogOut, XCircle, AlertTriangle, Info, CheckCircle, Coffee, ShoppingBag, Landmark, Hotel, Utensils, MapPin, Filter, MousePointer2, Circle, Square, Hexagon, Undo, Trash2, Save, Pencil, Layers, Sun, Moon, Globe, Home, Mail, Phone, User, Calendar as Calendar$1, GripVerticalIcon, ChevronDownIcon, PanelLeftIcon, MoreHorizontalIcon, ChevronLeftIcon, MinusIcon, SearchIcon, TrendingUp, TrendingDown, Minus, ArrowRight, Upload, FileIcon, Star, Redo, Bold, Italic, Type, List, ListOrdered, GripHorizontal, Minimize2, Play, Pause, VolumeX, Volume2, Maximize, PictureInPicture, PauseCircle, PlayCircle, RotateCcw, Gauge, RefreshCw } from "lucide-react";
|
|
6
6
|
import * as RechartsPrimitive from "recharts";
|
|
7
7
|
import { BarChart, CartesianGrid, XAxis, Bar } from "recharts";
|
|
8
8
|
import { clsx } from "clsx";
|
|
@@ -4527,21 +4527,49 @@ const colorThemes = [
|
|
|
4527
4527
|
}
|
|
4528
4528
|
];
|
|
4529
4529
|
const BrandColorsContext = createContext(void 0);
|
|
4530
|
-
const BrandColorsProvider = ({
|
|
4530
|
+
const BrandColorsProvider = ({
|
|
4531
|
+
children,
|
|
4532
|
+
defaultTheme,
|
|
4533
|
+
primaryColor,
|
|
4534
|
+
useCustomTokens = false
|
|
4535
|
+
}) => {
|
|
4531
4536
|
const [currentTheme, setCurrentTheme] = useState(() => {
|
|
4537
|
+
if (primaryColor) return "custom";
|
|
4532
4538
|
return defaultTheme || "xertica-original";
|
|
4533
4539
|
});
|
|
4534
4540
|
const [radius, setRadius] = useState(0.5);
|
|
4535
4541
|
const [colors, setColors] = useState(() => {
|
|
4542
|
+
if (primaryColor) {
|
|
4543
|
+
return {
|
|
4544
|
+
...colorThemes[0].colors,
|
|
4545
|
+
primary: primaryColor,
|
|
4546
|
+
primaryDarkMode: primaryColor,
|
|
4547
|
+
sidebarLight: primaryColor,
|
|
4548
|
+
sidebarDark: primaryColor,
|
|
4549
|
+
chart1: primaryColor
|
|
4550
|
+
};
|
|
4551
|
+
}
|
|
4536
4552
|
const theme = colorThemes.find((t) => t.id === currentTheme);
|
|
4537
4553
|
return (theme == null ? void 0 : theme.colors) || colorThemes[0].colors;
|
|
4538
4554
|
});
|
|
4539
4555
|
useEffect(() => {
|
|
4556
|
+
if (primaryColor) {
|
|
4557
|
+
setColors({
|
|
4558
|
+
...colorThemes[0].colors,
|
|
4559
|
+
primary: primaryColor,
|
|
4560
|
+
primaryDarkMode: primaryColor,
|
|
4561
|
+
sidebarLight: primaryColor,
|
|
4562
|
+
sidebarDark: primaryColor,
|
|
4563
|
+
chart1: primaryColor
|
|
4564
|
+
});
|
|
4565
|
+
setCurrentTheme("custom");
|
|
4566
|
+
return;
|
|
4567
|
+
}
|
|
4540
4568
|
const theme = colorThemes.find((t) => t.id === currentTheme);
|
|
4541
4569
|
if (theme) {
|
|
4542
4570
|
setColors(theme.colors);
|
|
4543
4571
|
}
|
|
4544
|
-
}, [currentTheme]);
|
|
4572
|
+
}, [currentTheme, primaryColor]);
|
|
4545
4573
|
const hexToRgb = (hex) => {
|
|
4546
4574
|
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
4547
4575
|
return result ? {
|
|
@@ -4551,6 +4579,7 @@ const BrandColorsProvider = ({ children, defaultTheme }) => {
|
|
|
4551
4579
|
} : null;
|
|
4552
4580
|
};
|
|
4553
4581
|
const applyColors = React__default.useCallback(() => {
|
|
4582
|
+
if (useCustomTokens) return;
|
|
4554
4583
|
const root = document.documentElement;
|
|
4555
4584
|
const isDark = root.classList.contains("dark");
|
|
4556
4585
|
const primary = isDark ? colors.primaryDarkMode : colors.primary;
|
|
@@ -4969,11 +4998,27 @@ const Toaster = ({ theme, ...props }) => {
|
|
|
4969
4998
|
}
|
|
4970
4999
|
);
|
|
4971
5000
|
};
|
|
4972
|
-
function XerticaProvider({
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
5001
|
+
function XerticaProvider({
|
|
5002
|
+
children,
|
|
5003
|
+
apiKey,
|
|
5004
|
+
googleMapsApiKey,
|
|
5005
|
+
defaultBrandTheme,
|
|
5006
|
+
primaryColor,
|
|
5007
|
+
useCustomTokens,
|
|
5008
|
+
disableDarkMode
|
|
5009
|
+
}) {
|
|
5010
|
+
return /* @__PURE__ */ jsx(ApiKeyProvider, { children: /* @__PURE__ */ jsx(GoogleMapsLoaderProvider, { children: /* @__PURE__ */ jsx(LanguageProvider, { children: /* @__PURE__ */ jsx(
|
|
5011
|
+
BrandColorsProvider,
|
|
5012
|
+
{
|
|
5013
|
+
defaultTheme: defaultBrandTheme,
|
|
5014
|
+
primaryColor,
|
|
5015
|
+
useCustomTokens,
|
|
5016
|
+
children: /* @__PURE__ */ jsx(ThemeProvider, { disableDarkMode, children: /* @__PURE__ */ jsx(AssistenteProvider, { children: /* @__PURE__ */ jsx(LayoutProvider, { children: /* @__PURE__ */ jsxs(TooltipProvider, { children: [
|
|
5017
|
+
children,
|
|
5018
|
+
/* @__PURE__ */ jsx(Toaster, { position: "top-right", richColors: true })
|
|
5019
|
+
] }) }) }) })
|
|
5020
|
+
}
|
|
5021
|
+
) }) }) });
|
|
4977
5022
|
}
|
|
4978
5023
|
/**
|
|
4979
5024
|
* react-router v7.13.0
|
|
@@ -7998,78 +8043,6 @@ const Slider = React.forwardRef(({ className, ...props }, ref) => {
|
|
|
7998
8043
|
);
|
|
7999
8044
|
});
|
|
8000
8045
|
Slider.displayName = SliderPrimitive.Root.displayName;
|
|
8001
|
-
function ThemeToggle({
|
|
8002
|
-
size = "md",
|
|
8003
|
-
variant = "ghost",
|
|
8004
|
-
className = "",
|
|
8005
|
-
showLabel = false
|
|
8006
|
-
}) {
|
|
8007
|
-
const { theme, toggleTheme, isDark, disableDarkMode } = useTheme();
|
|
8008
|
-
if (disableDarkMode) return null;
|
|
8009
|
-
const getSizeClasses = () => {
|
|
8010
|
-
switch (size) {
|
|
8011
|
-
case "sm":
|
|
8012
|
-
return "h-8 w-8 p-0";
|
|
8013
|
-
case "lg":
|
|
8014
|
-
return "h-12 w-12 p-0";
|
|
8015
|
-
default:
|
|
8016
|
-
return "h-9 w-9 p-0";
|
|
8017
|
-
}
|
|
8018
|
-
};
|
|
8019
|
-
const getIconSize = () => {
|
|
8020
|
-
switch (size) {
|
|
8021
|
-
case "sm":
|
|
8022
|
-
return "h-3 w-3";
|
|
8023
|
-
case "lg":
|
|
8024
|
-
return "h-6 w-6";
|
|
8025
|
-
default:
|
|
8026
|
-
return "h-4 w-4";
|
|
8027
|
-
}
|
|
8028
|
-
};
|
|
8029
|
-
const buttonClasses = showLabel ? "flex items-center gap-2 px-3 py-2" : getSizeClasses();
|
|
8030
|
-
return /* @__PURE__ */ jsx(
|
|
8031
|
-
Button,
|
|
8032
|
-
{
|
|
8033
|
-
variant,
|
|
8034
|
-
onClick: toggleTheme,
|
|
8035
|
-
className: `group ${buttonClasses} transition-all duration-200 hover:scale-105 ${className}`,
|
|
8036
|
-
title: isDark ? "Alternar para tema claro" : "Alternar para tema escuro",
|
|
8037
|
-
children: isDark ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8038
|
-
/* @__PURE__ */ jsx(Sun, { className: `${getIconSize()} text-[var(--primary)] group-hover:opacity-80` }),
|
|
8039
|
-
showLabel && /* @__PURE__ */ jsx("span", { children: "Tema Claro" })
|
|
8040
|
-
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8041
|
-
/* @__PURE__ */ jsx(Moon, { className: `${getIconSize()} text-muted-foreground group-hover:text-foreground` }),
|
|
8042
|
-
showLabel && /* @__PURE__ */ jsx("span", { children: "Tema Escuro" })
|
|
8043
|
-
] })
|
|
8044
|
-
}
|
|
8045
|
-
);
|
|
8046
|
-
}
|
|
8047
|
-
function LanguageSelector({
|
|
8048
|
-
variant = "default",
|
|
8049
|
-
showIcon = true,
|
|
8050
|
-
className = ""
|
|
8051
|
-
}) {
|
|
8052
|
-
const { language, setLanguage } = useLanguage();
|
|
8053
|
-
const languages = [
|
|
8054
|
-
{ value: "pt", label: "Português", flag: "🇧🇷" },
|
|
8055
|
-
{ value: "en", label: "English", flag: "🇺🇸" },
|
|
8056
|
-
{ value: "es", label: "Español", flag: "🇪🇸" }
|
|
8057
|
-
];
|
|
8058
|
-
const currentLanguage = languages.find((lang) => lang.value === language);
|
|
8059
|
-
return /* @__PURE__ */ jsxs("div", { className: `flex items-center gap-2 ${className}`, children: [
|
|
8060
|
-
showIcon && variant === "default" && /* @__PURE__ */ jsx(Globe, { className: "w-4 h-4 text-muted-foreground" }),
|
|
8061
|
-
/* @__PURE__ */ jsxs(Select, { value: language, onValueChange: setLanguage, children: [
|
|
8062
|
-
/* @__PURE__ */ jsx(SelectTrigger, { className: variant === "minimal" ? "w-auto border-none shadow-none bg-transparent" : "w-full", children: /* @__PURE__ */ jsx(SelectValue, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
8063
|
-
/* @__PURE__ */ jsx("span", { children: currentLanguage == null ? void 0 : currentLanguage.flag }),
|
|
8064
|
-
/* @__PURE__ */ jsx("span", { children: currentLanguage == null ? void 0 : currentLanguage.label })
|
|
8065
|
-
] }) }) }),
|
|
8066
|
-
/* @__PURE__ */ jsx(SelectContent, { children: languages.map((lang) => /* @__PURE__ */ jsx(SelectItem, { value: lang.value, children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
8067
|
-
/* @__PURE__ */ jsx("span", { children: lang.flag }),
|
|
8068
|
-
/* @__PURE__ */ jsx("span", { children: lang.label })
|
|
8069
|
-
] }) }, lang.value)) })
|
|
8070
|
-
] })
|
|
8071
|
-
] });
|
|
8072
|
-
}
|
|
8073
8046
|
function useMapLayers(map, layers) {
|
|
8074
8047
|
const trafficLayerRef = useRef(null);
|
|
8075
8048
|
const transitLayerRef = useRef(null);
|
|
@@ -9619,6 +9592,78 @@ function MapShowcase() {
|
|
|
9619
9592
|
] })
|
|
9620
9593
|
] });
|
|
9621
9594
|
}
|
|
9595
|
+
function ThemeToggle({
|
|
9596
|
+
size = "md",
|
|
9597
|
+
variant = "ghost",
|
|
9598
|
+
className = "",
|
|
9599
|
+
showLabel = false
|
|
9600
|
+
}) {
|
|
9601
|
+
const { theme, toggleTheme, isDark, disableDarkMode } = useTheme();
|
|
9602
|
+
if (disableDarkMode) return null;
|
|
9603
|
+
const getSizeClasses = () => {
|
|
9604
|
+
switch (size) {
|
|
9605
|
+
case "sm":
|
|
9606
|
+
return "h-8 w-8 p-0";
|
|
9607
|
+
case "lg":
|
|
9608
|
+
return "h-12 w-12 p-0";
|
|
9609
|
+
default:
|
|
9610
|
+
return "h-9 w-9 p-0";
|
|
9611
|
+
}
|
|
9612
|
+
};
|
|
9613
|
+
const getIconSize = () => {
|
|
9614
|
+
switch (size) {
|
|
9615
|
+
case "sm":
|
|
9616
|
+
return "h-3 w-3";
|
|
9617
|
+
case "lg":
|
|
9618
|
+
return "h-6 w-6";
|
|
9619
|
+
default:
|
|
9620
|
+
return "h-4 w-4";
|
|
9621
|
+
}
|
|
9622
|
+
};
|
|
9623
|
+
const buttonClasses = showLabel ? "flex items-center gap-2 px-3 py-2" : getSizeClasses();
|
|
9624
|
+
return /* @__PURE__ */ jsx(
|
|
9625
|
+
Button,
|
|
9626
|
+
{
|
|
9627
|
+
variant,
|
|
9628
|
+
onClick: toggleTheme,
|
|
9629
|
+
className: `group ${buttonClasses} transition-all duration-200 hover:scale-105 ${className}`,
|
|
9630
|
+
title: isDark ? "Alternar para tema claro" : "Alternar para tema escuro",
|
|
9631
|
+
children: isDark ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9632
|
+
/* @__PURE__ */ jsx(Sun, { className: `${getIconSize()} text-[var(--primary)] group-hover:opacity-80` }),
|
|
9633
|
+
showLabel && /* @__PURE__ */ jsx("span", { children: "Tema Claro" })
|
|
9634
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9635
|
+
/* @__PURE__ */ jsx(Moon, { className: `${getIconSize()} text-muted-foreground group-hover:text-foreground` }),
|
|
9636
|
+
showLabel && /* @__PURE__ */ jsx("span", { children: "Tema Escuro" })
|
|
9637
|
+
] })
|
|
9638
|
+
}
|
|
9639
|
+
);
|
|
9640
|
+
}
|
|
9641
|
+
function LanguageSelector({
|
|
9642
|
+
variant = "default",
|
|
9643
|
+
showIcon = true,
|
|
9644
|
+
className = ""
|
|
9645
|
+
}) {
|
|
9646
|
+
const { language, setLanguage } = useLanguage();
|
|
9647
|
+
const languages = [
|
|
9648
|
+
{ value: "pt", label: "Português", flag: "🇧🇷" },
|
|
9649
|
+
{ value: "en", label: "English", flag: "🇺🇸" },
|
|
9650
|
+
{ value: "es", label: "Español", flag: "🇪🇸" }
|
|
9651
|
+
];
|
|
9652
|
+
const currentLanguage = languages.find((lang) => lang.value === language);
|
|
9653
|
+
return /* @__PURE__ */ jsxs("div", { className: `flex items-center gap-2 ${className}`, children: [
|
|
9654
|
+
showIcon && variant === "default" && /* @__PURE__ */ jsx(Globe, { className: "w-4 h-4 text-muted-foreground" }),
|
|
9655
|
+
/* @__PURE__ */ jsxs(Select, { value: language, onValueChange: setLanguage, children: [
|
|
9656
|
+
/* @__PURE__ */ jsx(SelectTrigger, { className: variant === "minimal" ? "w-auto border-none shadow-none bg-transparent" : "w-full", children: /* @__PURE__ */ jsx(SelectValue, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
9657
|
+
/* @__PURE__ */ jsx("span", { children: currentLanguage == null ? void 0 : currentLanguage.flag }),
|
|
9658
|
+
/* @__PURE__ */ jsx("span", { children: currentLanguage == null ? void 0 : currentLanguage.label })
|
|
9659
|
+
] }) }) }),
|
|
9660
|
+
/* @__PURE__ */ jsx(SelectContent, { children: languages.map((lang) => /* @__PURE__ */ jsx(SelectItem, { value: lang.value, children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
9661
|
+
/* @__PURE__ */ jsx("span", { children: lang.flag }),
|
|
9662
|
+
/* @__PURE__ */ jsx("span", { children: lang.label })
|
|
9663
|
+
] }) }, lang.value)) })
|
|
9664
|
+
] })
|
|
9665
|
+
] });
|
|
9666
|
+
}
|
|
9622
9667
|
function Breadcrumb({ ...props }) {
|
|
9623
9668
|
return /* @__PURE__ */ jsx("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...props });
|
|
9624
9669
|
}
|
|
@@ -9894,28 +9939,15 @@ function TemplateContent({}) {
|
|
|
9894
9939
|
{
|
|
9895
9940
|
className: `flex-1 flex flex-col overflow-hidden transition-all duration-300 ${sidebarExpanded ? "md:pl-64" : "md:pl-20"}`,
|
|
9896
9941
|
children: [
|
|
9897
|
-
/* @__PURE__ */ jsx(
|
|
9898
|
-
|
|
9899
|
-
|
|
9900
|
-
|
|
9901
|
-
{
|
|
9902
|
-
|
|
9903
|
-
|
|
9904
|
-
|
|
9905
|
-
|
|
9906
|
-
children: /* @__PURE__ */ jsx(Menu, { className: "w-5 h-5" })
|
|
9907
|
-
}
|
|
9908
|
-
),
|
|
9909
|
-
/* @__PURE__ */ jsx("span", { className: "text-primary [font-weight:var(--font-weight-medium)]", children: "Xertica.ai" }),
|
|
9910
|
-
/* @__PURE__ */ jsx(ChevronRight, { className: "w-4 h-4" }),
|
|
9911
|
-
/* @__PURE__ */ jsx("span", { className: "text-foreground [font-weight:var(--font-weight-medium)]", children: "Template Page" })
|
|
9912
|
-
] }),
|
|
9913
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
9914
|
-
/* @__PURE__ */ jsx(Badge, { variant: "default", className: "hidden sm:flex", children: "v1.0.0" }),
|
|
9915
|
-
/* @__PURE__ */ jsx(LanguageSelector, { variant: "minimal", showIcon: false, className: "hidden sm:flex" }),
|
|
9916
|
-
/* @__PURE__ */ jsx(ThemeToggle, { className: "hover:bg-accent" })
|
|
9917
|
-
] })
|
|
9918
|
-
] }) }),
|
|
9942
|
+
/* @__PURE__ */ jsx(
|
|
9943
|
+
Header,
|
|
9944
|
+
{
|
|
9945
|
+
breadcrumbs: [
|
|
9946
|
+
{ label: "Xertica UI", href: "/home", icon: /* @__PURE__ */ jsx(Home, { className: "w-4 h-4" }) },
|
|
9947
|
+
{ label: "Template Page" }
|
|
9948
|
+
]
|
|
9949
|
+
}
|
|
9950
|
+
),
|
|
9919
9951
|
/* @__PURE__ */ jsx("main", { className: "flex-1 overflow-hidden bg-muted", children: /* @__PURE__ */ jsx(ScrollArea, { className: "h-full", children: /* @__PURE__ */ jsx("div", { className: "p-2 sm:p-4 md:p-6", children: /* @__PURE__ */ jsxs("div", { className: "max-w-6xl mx-auto space-y-8", children: [
|
|
9920
9952
|
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
9921
9953
|
/* @__PURE__ */ jsx("h2", { children: "Template Page" }),
|
package/dist/index.umd.js
CHANGED
|
@@ -4528,21 +4528,49 @@ ${colorConfig.map(([key, itemConfig]) => {
|
|
|
4528
4528
|
}
|
|
4529
4529
|
];
|
|
4530
4530
|
const BrandColorsContext = React.createContext(void 0);
|
|
4531
|
-
const BrandColorsProvider = ({
|
|
4531
|
+
const BrandColorsProvider = ({
|
|
4532
|
+
children,
|
|
4533
|
+
defaultTheme,
|
|
4534
|
+
primaryColor,
|
|
4535
|
+
useCustomTokens = false
|
|
4536
|
+
}) => {
|
|
4532
4537
|
const [currentTheme, setCurrentTheme] = React.useState(() => {
|
|
4538
|
+
if (primaryColor) return "custom";
|
|
4533
4539
|
return defaultTheme || "xertica-original";
|
|
4534
4540
|
});
|
|
4535
4541
|
const [radius, setRadius] = React.useState(0.5);
|
|
4536
4542
|
const [colors, setColors] = React.useState(() => {
|
|
4543
|
+
if (primaryColor) {
|
|
4544
|
+
return {
|
|
4545
|
+
...colorThemes[0].colors,
|
|
4546
|
+
primary: primaryColor,
|
|
4547
|
+
primaryDarkMode: primaryColor,
|
|
4548
|
+
sidebarLight: primaryColor,
|
|
4549
|
+
sidebarDark: primaryColor,
|
|
4550
|
+
chart1: primaryColor
|
|
4551
|
+
};
|
|
4552
|
+
}
|
|
4537
4553
|
const theme = colorThemes.find((t) => t.id === currentTheme);
|
|
4538
4554
|
return (theme == null ? void 0 : theme.colors) || colorThemes[0].colors;
|
|
4539
4555
|
});
|
|
4540
4556
|
React.useEffect(() => {
|
|
4557
|
+
if (primaryColor) {
|
|
4558
|
+
setColors({
|
|
4559
|
+
...colorThemes[0].colors,
|
|
4560
|
+
primary: primaryColor,
|
|
4561
|
+
primaryDarkMode: primaryColor,
|
|
4562
|
+
sidebarLight: primaryColor,
|
|
4563
|
+
sidebarDark: primaryColor,
|
|
4564
|
+
chart1: primaryColor
|
|
4565
|
+
});
|
|
4566
|
+
setCurrentTheme("custom");
|
|
4567
|
+
return;
|
|
4568
|
+
}
|
|
4541
4569
|
const theme = colorThemes.find((t) => t.id === currentTheme);
|
|
4542
4570
|
if (theme) {
|
|
4543
4571
|
setColors(theme.colors);
|
|
4544
4572
|
}
|
|
4545
|
-
}, [currentTheme]);
|
|
4573
|
+
}, [currentTheme, primaryColor]);
|
|
4546
4574
|
const hexToRgb = (hex) => {
|
|
4547
4575
|
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
4548
4576
|
return result ? {
|
|
@@ -4552,6 +4580,7 @@ ${colorConfig.map(([key, itemConfig]) => {
|
|
|
4552
4580
|
} : null;
|
|
4553
4581
|
};
|
|
4554
4582
|
const applyColors = React.useCallback(() => {
|
|
4583
|
+
if (useCustomTokens) return;
|
|
4555
4584
|
const root = document.documentElement;
|
|
4556
4585
|
const isDark = root.classList.contains("dark");
|
|
4557
4586
|
const primary = isDark ? colors.primaryDarkMode : colors.primary;
|
|
@@ -4970,11 +4999,27 @@ ${colorConfig.map(([key, itemConfig]) => {
|
|
|
4970
4999
|
}
|
|
4971
5000
|
);
|
|
4972
5001
|
};
|
|
4973
|
-
function XerticaProvider({
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
|
|
5002
|
+
function XerticaProvider({
|
|
5003
|
+
children,
|
|
5004
|
+
apiKey,
|
|
5005
|
+
googleMapsApiKey,
|
|
5006
|
+
defaultBrandTheme,
|
|
5007
|
+
primaryColor,
|
|
5008
|
+
useCustomTokens,
|
|
5009
|
+
disableDarkMode
|
|
5010
|
+
}) {
|
|
5011
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ApiKeyProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(GoogleMapsLoaderProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(LanguageProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5012
|
+
BrandColorsProvider,
|
|
5013
|
+
{
|
|
5014
|
+
defaultTheme: defaultBrandTheme,
|
|
5015
|
+
primaryColor,
|
|
5016
|
+
useCustomTokens,
|
|
5017
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ThemeProvider, { disableDarkMode, children: /* @__PURE__ */ jsxRuntime.jsx(AssistenteProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(LayoutProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(TooltipProvider, { children: [
|
|
5018
|
+
children,
|
|
5019
|
+
/* @__PURE__ */ jsxRuntime.jsx(Toaster, { position: "top-right", richColors: true })
|
|
5020
|
+
] }) }) }) })
|
|
5021
|
+
}
|
|
5022
|
+
) }) }) });
|
|
4978
5023
|
}
|
|
4979
5024
|
/**
|
|
4980
5025
|
* react-router v7.13.0
|
|
@@ -7999,78 +8044,6 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
|
|
|
7999
8044
|
);
|
|
8000
8045
|
});
|
|
8001
8046
|
Slider.displayName = SliderPrimitive__namespace.Root.displayName;
|
|
8002
|
-
function ThemeToggle({
|
|
8003
|
-
size = "md",
|
|
8004
|
-
variant = "ghost",
|
|
8005
|
-
className = "",
|
|
8006
|
-
showLabel = false
|
|
8007
|
-
}) {
|
|
8008
|
-
const { theme, toggleTheme, isDark, disableDarkMode } = useTheme();
|
|
8009
|
-
if (disableDarkMode) return null;
|
|
8010
|
-
const getSizeClasses = () => {
|
|
8011
|
-
switch (size) {
|
|
8012
|
-
case "sm":
|
|
8013
|
-
return "h-8 w-8 p-0";
|
|
8014
|
-
case "lg":
|
|
8015
|
-
return "h-12 w-12 p-0";
|
|
8016
|
-
default:
|
|
8017
|
-
return "h-9 w-9 p-0";
|
|
8018
|
-
}
|
|
8019
|
-
};
|
|
8020
|
-
const getIconSize = () => {
|
|
8021
|
-
switch (size) {
|
|
8022
|
-
case "sm":
|
|
8023
|
-
return "h-3 w-3";
|
|
8024
|
-
case "lg":
|
|
8025
|
-
return "h-6 w-6";
|
|
8026
|
-
default:
|
|
8027
|
-
return "h-4 w-4";
|
|
8028
|
-
}
|
|
8029
|
-
};
|
|
8030
|
-
const buttonClasses = showLabel ? "flex items-center gap-2 px-3 py-2" : getSizeClasses();
|
|
8031
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8032
|
-
Button,
|
|
8033
|
-
{
|
|
8034
|
-
variant,
|
|
8035
|
-
onClick: toggleTheme,
|
|
8036
|
-
className: `group ${buttonClasses} transition-all duration-200 hover:scale-105 ${className}`,
|
|
8037
|
-
title: isDark ? "Alternar para tema claro" : "Alternar para tema escuro",
|
|
8038
|
-
children: isDark ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
8039
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Sun, { className: `${getIconSize()} text-[var(--primary)] group-hover:opacity-80` }),
|
|
8040
|
-
showLabel && /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Tema Claro" })
|
|
8041
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
8042
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Moon, { className: `${getIconSize()} text-muted-foreground group-hover:text-foreground` }),
|
|
8043
|
-
showLabel && /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Tema Escuro" })
|
|
8044
|
-
] })
|
|
8045
|
-
}
|
|
8046
|
-
);
|
|
8047
|
-
}
|
|
8048
|
-
function LanguageSelector({
|
|
8049
|
-
variant = "default",
|
|
8050
|
-
showIcon = true,
|
|
8051
|
-
className = ""
|
|
8052
|
-
}) {
|
|
8053
|
-
const { language, setLanguage } = useLanguage();
|
|
8054
|
-
const languages = [
|
|
8055
|
-
{ value: "pt", label: "Português", flag: "🇧🇷" },
|
|
8056
|
-
{ value: "en", label: "English", flag: "🇺🇸" },
|
|
8057
|
-
{ value: "es", label: "Español", flag: "🇪🇸" }
|
|
8058
|
-
];
|
|
8059
|
-
const currentLanguage = languages.find((lang) => lang.value === language);
|
|
8060
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `flex items-center gap-2 ${className}`, children: [
|
|
8061
|
-
showIcon && variant === "default" && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Globe, { className: "w-4 h-4 text-muted-foreground" }),
|
|
8062
|
-
/* @__PURE__ */ jsxRuntime.jsxs(Select, { value: language, onValueChange: setLanguage, children: [
|
|
8063
|
-
/* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { className: variant === "minimal" ? "w-auto border-none shadow-none bg-transparent" : "w-full", children: /* @__PURE__ */ jsxRuntime.jsx(SelectValue, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
8064
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: currentLanguage == null ? void 0 : currentLanguage.flag }),
|
|
8065
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: currentLanguage == null ? void 0 : currentLanguage.label })
|
|
8066
|
-
] }) }) }),
|
|
8067
|
-
/* @__PURE__ */ jsxRuntime.jsx(SelectContent, { children: languages.map((lang) => /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: lang.value, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
8068
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: lang.flag }),
|
|
8069
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: lang.label })
|
|
8070
|
-
] }) }, lang.value)) })
|
|
8071
|
-
] })
|
|
8072
|
-
] });
|
|
8073
|
-
}
|
|
8074
8047
|
function useMapLayers(map, layers) {
|
|
8075
8048
|
const trafficLayerRef = React.useRef(null);
|
|
8076
8049
|
const transitLayerRef = React.useRef(null);
|
|
@@ -9620,6 +9593,78 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
|
|
|
9620
9593
|
] })
|
|
9621
9594
|
] });
|
|
9622
9595
|
}
|
|
9596
|
+
function ThemeToggle({
|
|
9597
|
+
size = "md",
|
|
9598
|
+
variant = "ghost",
|
|
9599
|
+
className = "",
|
|
9600
|
+
showLabel = false
|
|
9601
|
+
}) {
|
|
9602
|
+
const { theme, toggleTheme, isDark, disableDarkMode } = useTheme();
|
|
9603
|
+
if (disableDarkMode) return null;
|
|
9604
|
+
const getSizeClasses = () => {
|
|
9605
|
+
switch (size) {
|
|
9606
|
+
case "sm":
|
|
9607
|
+
return "h-8 w-8 p-0";
|
|
9608
|
+
case "lg":
|
|
9609
|
+
return "h-12 w-12 p-0";
|
|
9610
|
+
default:
|
|
9611
|
+
return "h-9 w-9 p-0";
|
|
9612
|
+
}
|
|
9613
|
+
};
|
|
9614
|
+
const getIconSize = () => {
|
|
9615
|
+
switch (size) {
|
|
9616
|
+
case "sm":
|
|
9617
|
+
return "h-3 w-3";
|
|
9618
|
+
case "lg":
|
|
9619
|
+
return "h-6 w-6";
|
|
9620
|
+
default:
|
|
9621
|
+
return "h-4 w-4";
|
|
9622
|
+
}
|
|
9623
|
+
};
|
|
9624
|
+
const buttonClasses = showLabel ? "flex items-center gap-2 px-3 py-2" : getSizeClasses();
|
|
9625
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9626
|
+
Button,
|
|
9627
|
+
{
|
|
9628
|
+
variant,
|
|
9629
|
+
onClick: toggleTheme,
|
|
9630
|
+
className: `group ${buttonClasses} transition-all duration-200 hover:scale-105 ${className}`,
|
|
9631
|
+
title: isDark ? "Alternar para tema claro" : "Alternar para tema escuro",
|
|
9632
|
+
children: isDark ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
9633
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Sun, { className: `${getIconSize()} text-[var(--primary)] group-hover:opacity-80` }),
|
|
9634
|
+
showLabel && /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Tema Claro" })
|
|
9635
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
9636
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Moon, { className: `${getIconSize()} text-muted-foreground group-hover:text-foreground` }),
|
|
9637
|
+
showLabel && /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Tema Escuro" })
|
|
9638
|
+
] })
|
|
9639
|
+
}
|
|
9640
|
+
);
|
|
9641
|
+
}
|
|
9642
|
+
function LanguageSelector({
|
|
9643
|
+
variant = "default",
|
|
9644
|
+
showIcon = true,
|
|
9645
|
+
className = ""
|
|
9646
|
+
}) {
|
|
9647
|
+
const { language, setLanguage } = useLanguage();
|
|
9648
|
+
const languages = [
|
|
9649
|
+
{ value: "pt", label: "Português", flag: "🇧🇷" },
|
|
9650
|
+
{ value: "en", label: "English", flag: "🇺🇸" },
|
|
9651
|
+
{ value: "es", label: "Español", flag: "🇪🇸" }
|
|
9652
|
+
];
|
|
9653
|
+
const currentLanguage = languages.find((lang) => lang.value === language);
|
|
9654
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `flex items-center gap-2 ${className}`, children: [
|
|
9655
|
+
showIcon && variant === "default" && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Globe, { className: "w-4 h-4 text-muted-foreground" }),
|
|
9656
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Select, { value: language, onValueChange: setLanguage, children: [
|
|
9657
|
+
/* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { className: variant === "minimal" ? "w-auto border-none shadow-none bg-transparent" : "w-full", children: /* @__PURE__ */ jsxRuntime.jsx(SelectValue, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
9658
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: currentLanguage == null ? void 0 : currentLanguage.flag }),
|
|
9659
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: currentLanguage == null ? void 0 : currentLanguage.label })
|
|
9660
|
+
] }) }) }),
|
|
9661
|
+
/* @__PURE__ */ jsxRuntime.jsx(SelectContent, { children: languages.map((lang) => /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: lang.value, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
9662
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: lang.flag }),
|
|
9663
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: lang.label })
|
|
9664
|
+
] }) }, lang.value)) })
|
|
9665
|
+
] })
|
|
9666
|
+
] });
|
|
9667
|
+
}
|
|
9623
9668
|
function Breadcrumb({ ...props }) {
|
|
9624
9669
|
return /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...props });
|
|
9625
9670
|
}
|
|
@@ -9895,28 +9940,15 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
|
|
|
9895
9940
|
{
|
|
9896
9941
|
className: `flex-1 flex flex-col overflow-hidden transition-all duration-300 ${sidebarExpanded ? "md:pl-64" : "md:pl-20"}`,
|
|
9897
9942
|
children: [
|
|
9898
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9899
|
-
|
|
9900
|
-
|
|
9901
|
-
|
|
9902
|
-
{
|
|
9903
|
-
|
|
9904
|
-
|
|
9905
|
-
|
|
9906
|
-
|
|
9907
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Menu, { className: "w-5 h-5" })
|
|
9908
|
-
}
|
|
9909
|
-
),
|
|
9910
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary [font-weight:var(--font-weight-medium)]", children: "Xertica.ai" }),
|
|
9911
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "w-4 h-4" }),
|
|
9912
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground [font-weight:var(--font-weight-medium)]", children: "Template Page" })
|
|
9913
|
-
] }),
|
|
9914
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
9915
|
-
/* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "default", className: "hidden sm:flex", children: "v1.0.0" }),
|
|
9916
|
-
/* @__PURE__ */ jsxRuntime.jsx(LanguageSelector, { variant: "minimal", showIcon: false, className: "hidden sm:flex" }),
|
|
9917
|
-
/* @__PURE__ */ jsxRuntime.jsx(ThemeToggle, { className: "hover:bg-accent" })
|
|
9918
|
-
] })
|
|
9919
|
-
] }) }),
|
|
9943
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9944
|
+
Header,
|
|
9945
|
+
{
|
|
9946
|
+
breadcrumbs: [
|
|
9947
|
+
{ label: "Xertica UI", href: "/home", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Home, { className: "w-4 h-4" }) },
|
|
9948
|
+
{ label: "Template Page" }
|
|
9949
|
+
]
|
|
9950
|
+
}
|
|
9951
|
+
),
|
|
9920
9952
|
/* @__PURE__ */ jsxRuntime.jsx("main", { className: "flex-1 overflow-hidden bg-muted", children: /* @__PURE__ */ jsxRuntime.jsx(ScrollArea, { className: "h-full", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-2 sm:p-4 md:p-6", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "max-w-6xl mx-auto space-y-8", children: [
|
|
9921
9953
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
9922
9954
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { children: "Template Page" }),
|
package/dist/xertica-ui.css
CHANGED
|
@@ -451,7 +451,6 @@
|
|
|
451
451
|
iframe,
|
|
452
452
|
embed,
|
|
453
453
|
object {
|
|
454
|
-
vertical-align: middle;
|
|
455
454
|
display: block;
|
|
456
455
|
}
|
|
457
456
|
|
|
@@ -930,6 +929,7 @@
|
|
|
930
929
|
|
|
931
930
|
.line-clamp-2 {
|
|
932
931
|
-webkit-line-clamp: 2;
|
|
932
|
+
line-clamp: 2;
|
|
933
933
|
-webkit-box-orient: vertical;
|
|
934
934
|
display: -webkit-box;
|
|
935
935
|
overflow: hidden;
|
|
@@ -3487,6 +3487,7 @@
|
|
|
3487
3487
|
|
|
3488
3488
|
:is(.\*\:data-\[slot\=select-value\]\:line-clamp-1 > *)[data-slot="select-value"] {
|
|
3489
3489
|
-webkit-line-clamp: 1;
|
|
3490
|
+
line-clamp: 1;
|
|
3490
3491
|
-webkit-box-orient: vertical;
|
|
3491
3492
|
display: -webkit-box;
|
|
3492
3493
|
overflow: hidden;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xertica-ui",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.9",
|
|
4
4
|
"description": "Xertica UI - Design System completo com componentes React e Tailwind CSS",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.umd.js",
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
},
|
|
17
17
|
"bin": "./dist/cli.js",
|
|
18
18
|
"scripts": {
|
|
19
|
-
"dev": "vite",
|
|
20
19
|
"build": "vite build --sourcemap=false --minify=false",
|
|
21
20
|
"build:production": "npm run build",
|
|
22
21
|
"build:types": "tsc -p tsconfig.build.json",
|
package/templates/index.css
CHANGED
|
@@ -1,10 +1,65 @@
|
|
|
1
1
|
@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;600;700;800&display=swap");
|
|
2
2
|
|
|
3
|
-
/* Xertica UI compiled styles (includes Tailwind v4 base + all component styles) */
|
|
4
|
-
@import 'xertica-ui/style.css';
|
|
5
|
-
|
|
6
3
|
/* Your project's theme tokens (generated by CLI, customize here) */
|
|
7
4
|
@import './styles/xertica/tokens.css';
|
|
8
5
|
|
|
6
|
+
/* Xertica UI compiled styles (includes Tailwind v4 base + all component styles) */
|
|
7
|
+
@import 'xertica-ui/style.css';
|
|
8
|
+
|
|
9
9
|
/* Tell Tailwind v4 to scan xertica-ui for class names */
|
|
10
|
-
@source '
|
|
10
|
+
@source './node_modules/xertica-ui';
|
|
11
|
+
|
|
12
|
+
@theme {
|
|
13
|
+
--shadow-elevation-sm: 0px 0px 48px 0px rgba(0, 0, 0, 0.1);
|
|
14
|
+
|
|
15
|
+
/* Map CSS Variables to Tailwind Theme Tokens (Required for Tailwind v4) */
|
|
16
|
+
--color-background: var(--background);
|
|
17
|
+
--color-foreground: var(--foreground);
|
|
18
|
+
|
|
19
|
+
--color-card: var(--card);
|
|
20
|
+
--color-card-foreground: var(--card-foreground);
|
|
21
|
+
|
|
22
|
+
--color-popover: var(--popover);
|
|
23
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
24
|
+
|
|
25
|
+
--color-primary: var(--primary);
|
|
26
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
27
|
+
|
|
28
|
+
--color-secondary: var(--secondary);
|
|
29
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
30
|
+
|
|
31
|
+
--color-muted: var(--muted);
|
|
32
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
33
|
+
|
|
34
|
+
--color-accent: var(--accent);
|
|
35
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
36
|
+
|
|
37
|
+
--color-destructive: var(--destructive);
|
|
38
|
+
--color-destructive-foreground: var(--destructive-foreground);
|
|
39
|
+
|
|
40
|
+
--color-border: var(--border);
|
|
41
|
+
--color-input: var(--input);
|
|
42
|
+
--color-ring: var(--ring);
|
|
43
|
+
|
|
44
|
+
--radius-lg: var(--radius);
|
|
45
|
+
--radius-md: calc(var(--radius) - 2px);
|
|
46
|
+
--radius-sm: calc(var(--radius) - 4px);
|
|
47
|
+
|
|
48
|
+
/* Animations for shadcn/ui */
|
|
49
|
+
--animate-in: enter 200ms ease-out;
|
|
50
|
+
--animate-out: exit 200ms ease-in;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@keyframes enter {
|
|
54
|
+
from {
|
|
55
|
+
opacity: var(--tw-enter-opacity, 1);
|
|
56
|
+
transform: translate3d(var(--tw-enter-translate-x, 0), var(--tw-enter-translate-y, 0), 0) scale3d(var(--tw-enter-scale, 1), var(--tw-enter-scale, 1), var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@keyframes exit {
|
|
61
|
+
to {
|
|
62
|
+
opacity: var(--tw-exit-opacity, 1);
|
|
63
|
+
transform: translate3d(var(--tw-exit-translate-x, 0), var(--tw-exit-translate-y, 0), 0) scale3d(var(--tw-exit-scale, 1), var(--tw-exit-scale, 1), var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0));
|
|
64
|
+
}
|
|
65
|
+
}
|
package/templates/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"type-check": "tsc --noEmit"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"xertica-ui": "^1.4.
|
|
14
|
+
"xertica-ui": "^1.4.9",
|
|
15
15
|
"react": "^18.3.1",
|
|
16
16
|
"react-dom": "^18.3.1",
|
|
17
17
|
"react-router-dom": "^7.1.3",
|
|
@@ -37,4 +37,4 @@
|
|
|
37
37
|
"autoprefixer": "^10.4.20",
|
|
38
38
|
"postcss": "^8.4.49"
|
|
39
39
|
}
|
|
40
|
-
}
|
|
40
|
+
}
|
|
@@ -37,7 +37,12 @@ export function HomeContent() {
|
|
|
37
37
|
}}
|
|
38
38
|
className="flex-1 flex flex-col overflow-hidden transition-all duration-300"
|
|
39
39
|
>
|
|
40
|
-
<Header
|
|
40
|
+
<Header
|
|
41
|
+
breadcrumbs={[
|
|
42
|
+
{ label: 'Xertica UI', },
|
|
43
|
+
{ label: 'Início' },
|
|
44
|
+
]}
|
|
45
|
+
/>
|
|
41
46
|
|
|
42
47
|
<main className="flex-1 overflow-hidden bg-muted">
|
|
43
48
|
<ScrollArea className="h-full">
|