xertica-ui 1.0.0
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/App.tsx +182 -0
- package/README.md +330 -0
- package/assets/xertica-logo.svg +38 -0
- package/assets/xertica-x-logo.svg +21 -0
- package/bin/cli.ts +193 -0
- package/components/AssistenteXertica.tsx +2003 -0
- package/components/AudioPlayer.tsx +203 -0
- package/components/CodeBlock.tsx +242 -0
- package/components/DocumentEditor.tsx +504 -0
- package/components/ForgotPasswordPage.tsx +170 -0
- package/components/FormattedDocument.tsx +87 -0
- package/components/HomeContent.tsx +123 -0
- package/components/HomePage.tsx +70 -0
- package/components/LanguageSelector.tsx +54 -0
- package/components/LoginPage.tsx +199 -0
- package/components/MarkdownMessage.tsx +62 -0
- package/components/ModernChatInput.tsx +502 -0
- package/components/PodcastPlayer.tsx +409 -0
- package/components/ResetPasswordPage.tsx +234 -0
- package/components/Sidebar.tsx +489 -0
- package/components/TemplateContent.tsx +629 -0
- package/components/TemplatePage.tsx +70 -0
- package/components/ThemeToggle.tsx +65 -0
- package/components/VerifyEmailPage.tsx +187 -0
- package/components/XerticaLogo.tsx +69 -0
- package/components/XerticaOrbe.tsx +1339 -0
- package/components/XerticaXLogo.tsx +53 -0
- package/components/examples/DrawingMapExample.tsx +530 -0
- package/components/examples/FilterableMapExample.tsx +380 -0
- package/components/examples/LocationPickerExample.tsx +330 -0
- package/components/examples/MapExamples.tsx +280 -0
- package/components/examples/MapShowcase.tsx +446 -0
- package/components/examples/RouteMapExamples.tsx +329 -0
- package/components/examples/SimpleFilterableMap.tsx +192 -0
- package/components/examples/index.ts +52 -0
- package/components/figma/ImageWithFallback.tsx +27 -0
- package/components/index.ts +44 -0
- package/components/media/AudioPlayer.tsx +278 -0
- package/components/media/FloatingMediaWrapper.tsx +166 -0
- package/components/media/VideoPlayer.tsx +285 -0
- package/components/ui/accordion.tsx +66 -0
- package/components/ui/alert-dialog.tsx +159 -0
- package/components/ui/alert.tsx +91 -0
- package/components/ui/aspect-ratio.tsx +11 -0
- package/components/ui/avatar.tsx +65 -0
- package/components/ui/badge.tsx +55 -0
- package/components/ui/breadcrumb.tsx +109 -0
- package/components/ui/button.tsx +78 -0
- package/components/ui/calendar.tsx +235 -0
- package/components/ui/card.tsx +92 -0
- package/components/ui/carousel.tsx +241 -0
- package/components/ui/chart.tsx +353 -0
- package/components/ui/checkbox.tsx +32 -0
- package/components/ui/collapsible.tsx +33 -0
- package/components/ui/command.tsx +177 -0
- package/components/ui/context-menu.tsx +252 -0
- package/components/ui/dialog.tsx +138 -0
- package/components/ui/drawer.tsx +134 -0
- package/components/ui/dropdown-menu.tsx +257 -0
- package/components/ui/empty.tsx +90 -0
- package/components/ui/file-upload.tsx +152 -0
- package/components/ui/form.tsx +195 -0
- package/components/ui/google-maps-loader.tsx +379 -0
- package/components/ui/hover-card.tsx +44 -0
- package/components/ui/index.ts +242 -0
- package/components/ui/input-otp.tsx +77 -0
- package/components/ui/input.tsx +38 -0
- package/components/ui/label.tsx +24 -0
- package/components/ui/map-config.ts +12 -0
- package/components/ui/map-layers.tsx +129 -0
- package/components/ui/map.exports.ts +31 -0
- package/components/ui/map.tsx +412 -0
- package/components/ui/menubar.tsx +276 -0
- package/components/ui/navigation-menu.tsx +162 -0
- package/components/ui/notification-badge.tsx +61 -0
- package/components/ui/page-header.tsx +229 -0
- package/components/ui/pagination.tsx +127 -0
- package/components/ui/popover.tsx +48 -0
- package/components/ui/progress.tsx +31 -0
- package/components/ui/radio-group.tsx +56 -0
- package/components/ui/rating.tsx +102 -0
- package/components/ui/resizable.tsx +405 -0
- package/components/ui/route-map.tsx +246 -0
- package/components/ui/scroll-area.tsx +58 -0
- package/components/ui/search.tsx +70 -0
- package/components/ui/select.tsx +176 -0
- package/components/ui/separator.tsx +28 -0
- package/components/ui/sheet.tsx +138 -0
- package/components/ui/sidebar.tsx +726 -0
- package/components/ui/simple-map.tsx +92 -0
- package/components/ui/skeleton.tsx +13 -0
- package/components/ui/slider.tsx +58 -0
- package/components/ui/sonner.tsx +77 -0
- package/components/ui/stats-card.tsx +84 -0
- package/components/ui/stepper.tsx +126 -0
- package/components/ui/switch.tsx +34 -0
- package/components/ui/table.tsx +116 -0
- package/components/ui/tabs.tsx +66 -0
- package/components/ui/textarea.tsx +26 -0
- package/components/ui/timeline.tsx +140 -0
- package/components/ui/toggle-group.tsx +71 -0
- package/components/ui/toggle.tsx +46 -0
- package/components/ui/tooltip.tsx +61 -0
- package/components/ui/tree-view.tsx +123 -0
- package/components/ui/use-mobile.ts +24 -0
- package/components/ui/utils.ts +6 -0
- package/components/ui/xertica-assistant.tsx +1420 -0
- package/contexts/ApiKeyContext.tsx +123 -0
- package/contexts/AssistenteContext.tsx +118 -0
- package/contexts/BrandColorsContext.tsx +551 -0
- package/contexts/LanguageContext.tsx +36 -0
- package/contexts/ThemeContext.tsx +85 -0
- package/dist/cli.js +20922 -0
- package/eslint.config.js +41 -0
- package/guidelines/Guidelines.md +61 -0
- package/hooks/useTheme.ts +4 -0
- package/imports/Podcast.tsx +389 -0
- package/imports/XerticaAi.tsx +46 -0
- package/imports/XerticaX.tsx +20 -0
- package/imports/svg-aueiaqngck.ts +11 -0
- package/imports/svg-v9krss1ozd.ts +16 -0
- package/imports/svg-vhrdofe3qe.ts +5 -0
- package/index.css +4448 -0
- package/index.html +14 -0
- package/main.tsx +10 -0
- package/package.json +119 -0
- package/postcss.config.js +6 -0
- package/routes.tsx +33 -0
- package/styles/globals.css +15 -0
- package/styles/xertica/app-overrides/chat.css +61 -0
- package/styles/xertica/app-overrides/scrollbar.css +33 -0
- package/styles/xertica/base.css +70 -0
- package/styles/xertica/integrations/google-maps.css +76 -0
- package/styles/xertica/integrations/sonner.css +73 -0
- package/styles/xertica/theme-map.css +88 -0
- package/styles/xertica/tokens.css +190 -0
- package/tsconfig.json +31 -0
- package/tsconfig.node.json +10 -0
- package/utils/gemini.ts +140 -0
- package/vite-env.d.ts +12 -0
- package/vite.config.ts +36 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { OTPInput, OTPInputContext } from "input-otp";
|
|
5
|
+
import { MinusIcon } from "lucide-react";
|
|
6
|
+
|
|
7
|
+
import { cn } from "./utils";
|
|
8
|
+
|
|
9
|
+
function InputOTP({
|
|
10
|
+
className,
|
|
11
|
+
containerClassName,
|
|
12
|
+
...props
|
|
13
|
+
}: React.ComponentProps<typeof OTPInput> & {
|
|
14
|
+
containerClassName?: string;
|
|
15
|
+
}) {
|
|
16
|
+
return (
|
|
17
|
+
<OTPInput
|
|
18
|
+
data-slot="input-otp"
|
|
19
|
+
containerClassName={cn(
|
|
20
|
+
"flex items-center gap-2 has-disabled:opacity-50",
|
|
21
|
+
containerClassName,
|
|
22
|
+
)}
|
|
23
|
+
className={cn("disabled:cursor-not-allowed", className)}
|
|
24
|
+
{...props}
|
|
25
|
+
/>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function InputOTPGroup({ className, ...props }: React.ComponentProps<"div">) {
|
|
30
|
+
return (
|
|
31
|
+
<div
|
|
32
|
+
data-slot="input-otp-group"
|
|
33
|
+
className={cn("flex items-center gap-1", className)}
|
|
34
|
+
{...props}
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function InputOTPSlot({
|
|
40
|
+
index,
|
|
41
|
+
className,
|
|
42
|
+
...props
|
|
43
|
+
}: React.ComponentProps<"div"> & {
|
|
44
|
+
index: number;
|
|
45
|
+
}) {
|
|
46
|
+
const inputOTPContext = React.useContext(OTPInputContext);
|
|
47
|
+
const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<div
|
|
51
|
+
data-slot="input-otp-slot"
|
|
52
|
+
data-active={isActive}
|
|
53
|
+
className={cn(
|
|
54
|
+
"data-[active=true]:border-primary data-[active=true]:ring-primary/20 data-[active=true]:aria-invalid:ring-destructive/20 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive relative flex h-10 w-10 items-center justify-center border border-border rounded-[var(--radius)] text-base bg-background transition-all outline-none data-[active=true]:z-10 data-[active=true]:ring-2",
|
|
55
|
+
className,
|
|
56
|
+
)}
|
|
57
|
+
{...props}
|
|
58
|
+
>
|
|
59
|
+
{char}
|
|
60
|
+
{hasFakeCaret && (
|
|
61
|
+
<div className="pointer-events-none absolute inset-0 flex items-center justify-center">
|
|
62
|
+
<div className="animate-caret-blink bg-foreground h-4 w-px duration-1000" />
|
|
63
|
+
</div>
|
|
64
|
+
)}
|
|
65
|
+
</div>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function InputOTPSeparator({ ...props }: React.ComponentProps<"div">) {
|
|
70
|
+
return (
|
|
71
|
+
<div data-slot="input-otp-separator" role="separator" {...props}>
|
|
72
|
+
<MinusIcon />
|
|
73
|
+
</div>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
import { cn } from "./utils";
|
|
4
|
+
|
|
5
|
+
interface InputProps extends React.ComponentProps<"input"> {
|
|
6
|
+
size?: "sm" | "md" | "lg";
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
|
10
|
+
({ className, type, size = "md", ...props }, ref) => {
|
|
11
|
+
const sizeClasses = {
|
|
12
|
+
sm: "h-8 px-2 py-1 text-sm",
|
|
13
|
+
md: "h-10 px-3 py-2 text-base",
|
|
14
|
+
lg: "h-12 px-4 py-3 text-base",
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<input
|
|
19
|
+
type={type}
|
|
20
|
+
data-slot="input"
|
|
21
|
+
className={cn(
|
|
22
|
+
"flex w-full min-w-0 bg-background rounded-[var(--radius)] border border-border transition-colors outline-none text-foreground",
|
|
23
|
+
"placeholder:text-muted-foreground",
|
|
24
|
+
"focus:ring-2 focus:ring-primary focus:border-transparent",
|
|
25
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
26
|
+
"file:border-0 file:bg-transparent file:text-sm file:font-medium",
|
|
27
|
+
sizeClasses[size],
|
|
28
|
+
className,
|
|
29
|
+
)}
|
|
30
|
+
ref={ref}
|
|
31
|
+
{...props}
|
|
32
|
+
/>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
Input.displayName = "Input";
|
|
37
|
+
|
|
38
|
+
export { Input };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
5
|
+
|
|
6
|
+
import { cn } from "./utils";
|
|
7
|
+
|
|
8
|
+
function Label({
|
|
9
|
+
className,
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof LabelPrimitive.Root>) {
|
|
12
|
+
return (
|
|
13
|
+
<LabelPrimitive.Root
|
|
14
|
+
data-slot="label"
|
|
15
|
+
className={cn(
|
|
16
|
+
"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
|
|
17
|
+
className,
|
|
18
|
+
)}
|
|
19
|
+
{...props}
|
|
20
|
+
/>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { Label };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configurações globais para Google Maps
|
|
3
|
+
*
|
|
4
|
+
* GOOGLE_MAPS_LIBRARIES: Bibliotecas a serem carregadas
|
|
5
|
+
* - marker: Biblioteca de marcadores avançados (AdvancedMarkerElement)
|
|
6
|
+
* - places: Biblioteca de lugares e autocompletar
|
|
7
|
+
* - geometry: Biblioteca de cálculos geométricos
|
|
8
|
+
*
|
|
9
|
+
* GOOGLE_MAPS_ID: ID único do script para prevenir duplicação
|
|
10
|
+
*/
|
|
11
|
+
export const GOOGLE_MAPS_LIBRARIES: ("marker" | "places" | "geometry" | "drawing")[] = ['marker', 'places', 'geometry', 'drawing'];
|
|
12
|
+
export const GOOGLE_MAPS_ID = 'xertica-google-map-script';
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useEffect, useRef } from 'react';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* MapLayers - Componentes de camadas para Map
|
|
7
|
+
*
|
|
8
|
+
* Camadas nativas do Google Maps que podem ser adicionadas ao mapa.
|
|
9
|
+
* Estas camadas são usadas dentro do componente Map através da prop `layers`.
|
|
10
|
+
*
|
|
11
|
+
* Tipos de camadas disponíveis:
|
|
12
|
+
* - traffic: Camada de tráfego em tempo real
|
|
13
|
+
* - transit: Camada de transporte público
|
|
14
|
+
* - bicycling: Camada de rotas para bicicletas
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
export type MapLayerType = 'traffic' | 'transit' | 'bicycling';
|
|
18
|
+
|
|
19
|
+
export interface MapLayersConfig {
|
|
20
|
+
traffic?: boolean;
|
|
21
|
+
transit?: boolean;
|
|
22
|
+
bicycling?: boolean;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Hook para gerenciar camadas do mapa
|
|
27
|
+
*
|
|
28
|
+
* @param map - Instância do Google Maps
|
|
29
|
+
* @param layers - Configuração das camadas a serem exibidas
|
|
30
|
+
*/
|
|
31
|
+
export function useMapLayers(
|
|
32
|
+
map: google.maps.Map | null,
|
|
33
|
+
layers: MapLayersConfig
|
|
34
|
+
) {
|
|
35
|
+
const trafficLayerRef = useRef<google.maps.TrafficLayer | null>(null);
|
|
36
|
+
const transitLayerRef = useRef<google.maps.TransitLayer | null>(null);
|
|
37
|
+
const bicyclingLayerRef = useRef<google.maps.BicyclingLayer | null>(null);
|
|
38
|
+
|
|
39
|
+
// Traffic Layer
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
if (!map) return;
|
|
42
|
+
|
|
43
|
+
if (layers.traffic) {
|
|
44
|
+
if (!trafficLayerRef.current) {
|
|
45
|
+
trafficLayerRef.current = new google.maps.TrafficLayer();
|
|
46
|
+
}
|
|
47
|
+
trafficLayerRef.current.setMap(map);
|
|
48
|
+
} else {
|
|
49
|
+
if (trafficLayerRef.current) {
|
|
50
|
+
trafficLayerRef.current.setMap(null);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return () => {
|
|
55
|
+
if (trafficLayerRef.current) {
|
|
56
|
+
trafficLayerRef.current.setMap(null);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
}, [map, layers.traffic]);
|
|
60
|
+
|
|
61
|
+
// Transit Layer
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
if (!map) return;
|
|
64
|
+
|
|
65
|
+
if (layers.transit) {
|
|
66
|
+
if (!transitLayerRef.current) {
|
|
67
|
+
transitLayerRef.current = new google.maps.TransitLayer();
|
|
68
|
+
}
|
|
69
|
+
transitLayerRef.current.setMap(map);
|
|
70
|
+
} else {
|
|
71
|
+
if (transitLayerRef.current) {
|
|
72
|
+
transitLayerRef.current.setMap(null);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return () => {
|
|
77
|
+
if (transitLayerRef.current) {
|
|
78
|
+
transitLayerRef.current.setMap(null);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}, [map, layers.transit]);
|
|
82
|
+
|
|
83
|
+
// Bicycling Layer
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
if (!map) return;
|
|
86
|
+
|
|
87
|
+
if (layers.bicycling) {
|
|
88
|
+
if (!bicyclingLayerRef.current) {
|
|
89
|
+
bicyclingLayerRef.current = new google.maps.BicyclingLayer();
|
|
90
|
+
}
|
|
91
|
+
bicyclingLayerRef.current.setMap(map);
|
|
92
|
+
} else {
|
|
93
|
+
if (bicyclingLayerRef.current) {
|
|
94
|
+
bicyclingLayerRef.current.setMap(null);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return () => {
|
|
99
|
+
if (bicyclingLayerRef.current) {
|
|
100
|
+
bicyclingLayerRef.current.setMap(null);
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
}, [map, layers.bicycling]);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Exemplo de uso:
|
|
108
|
+
*
|
|
109
|
+
* ```tsx
|
|
110
|
+
* import { Map } from './ui/map';
|
|
111
|
+
* import { useState } from 'react';
|
|
112
|
+
*
|
|
113
|
+
* function MyMapComponent() {
|
|
114
|
+
* const [layers, setLayers] = useState({
|
|
115
|
+
* traffic: false,
|
|
116
|
+
* transit: false,
|
|
117
|
+
* bicycling: false,
|
|
118
|
+
* });
|
|
119
|
+
*
|
|
120
|
+
* return (
|
|
121
|
+
* <Map
|
|
122
|
+
* center={{ lat: -23.5505, lng: -46.6333 }}
|
|
123
|
+
* zoom={13}
|
|
124
|
+
* layers={layers}
|
|
125
|
+
* />
|
|
126
|
+
* );
|
|
127
|
+
* }
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Map Components - Exports
|
|
3
|
+
*
|
|
4
|
+
* Arquivo central para exportação de todos os componentes relacionados a mapas
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export { Map } from './map';
|
|
8
|
+
export type { MapProps } from './map';
|
|
9
|
+
|
|
10
|
+
export { SimpleMap } from './simple-map';
|
|
11
|
+
|
|
12
|
+
export { RouteMap } from './route-map';
|
|
13
|
+
export type { RouteMapProps } from './route-map';
|
|
14
|
+
|
|
15
|
+
export { GoogleMapsLoaderProvider, useGoogleMapsLoader } from './google-maps-loader';
|
|
16
|
+
|
|
17
|
+
export { useMapLayers } from './map-layers';
|
|
18
|
+
export type { MapLayersConfig, MapLayerType } from './map-layers';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Uso:
|
|
22
|
+
*
|
|
23
|
+
* import { Map, SimpleMap, RouteMap } from './ui/map.exports';
|
|
24
|
+
* import type { MapProps, MapLayersConfig } from './ui/map.exports';
|
|
25
|
+
*
|
|
26
|
+
* ou
|
|
27
|
+
*
|
|
28
|
+
* import { Map } from './ui/map';
|
|
29
|
+
* import { SimpleMap } from './ui/simple-map';
|
|
30
|
+
* import { RouteMap } from './ui/route-map';
|
|
31
|
+
*/
|