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.
Files changed (141) hide show
  1. package/App.tsx +182 -0
  2. package/README.md +330 -0
  3. package/assets/xertica-logo.svg +38 -0
  4. package/assets/xertica-x-logo.svg +21 -0
  5. package/bin/cli.ts +193 -0
  6. package/components/AssistenteXertica.tsx +2003 -0
  7. package/components/AudioPlayer.tsx +203 -0
  8. package/components/CodeBlock.tsx +242 -0
  9. package/components/DocumentEditor.tsx +504 -0
  10. package/components/ForgotPasswordPage.tsx +170 -0
  11. package/components/FormattedDocument.tsx +87 -0
  12. package/components/HomeContent.tsx +123 -0
  13. package/components/HomePage.tsx +70 -0
  14. package/components/LanguageSelector.tsx +54 -0
  15. package/components/LoginPage.tsx +199 -0
  16. package/components/MarkdownMessage.tsx +62 -0
  17. package/components/ModernChatInput.tsx +502 -0
  18. package/components/PodcastPlayer.tsx +409 -0
  19. package/components/ResetPasswordPage.tsx +234 -0
  20. package/components/Sidebar.tsx +489 -0
  21. package/components/TemplateContent.tsx +629 -0
  22. package/components/TemplatePage.tsx +70 -0
  23. package/components/ThemeToggle.tsx +65 -0
  24. package/components/VerifyEmailPage.tsx +187 -0
  25. package/components/XerticaLogo.tsx +69 -0
  26. package/components/XerticaOrbe.tsx +1339 -0
  27. package/components/XerticaXLogo.tsx +53 -0
  28. package/components/examples/DrawingMapExample.tsx +530 -0
  29. package/components/examples/FilterableMapExample.tsx +380 -0
  30. package/components/examples/LocationPickerExample.tsx +330 -0
  31. package/components/examples/MapExamples.tsx +280 -0
  32. package/components/examples/MapShowcase.tsx +446 -0
  33. package/components/examples/RouteMapExamples.tsx +329 -0
  34. package/components/examples/SimpleFilterableMap.tsx +192 -0
  35. package/components/examples/index.ts +52 -0
  36. package/components/figma/ImageWithFallback.tsx +27 -0
  37. package/components/index.ts +44 -0
  38. package/components/media/AudioPlayer.tsx +278 -0
  39. package/components/media/FloatingMediaWrapper.tsx +166 -0
  40. package/components/media/VideoPlayer.tsx +285 -0
  41. package/components/ui/accordion.tsx +66 -0
  42. package/components/ui/alert-dialog.tsx +159 -0
  43. package/components/ui/alert.tsx +91 -0
  44. package/components/ui/aspect-ratio.tsx +11 -0
  45. package/components/ui/avatar.tsx +65 -0
  46. package/components/ui/badge.tsx +55 -0
  47. package/components/ui/breadcrumb.tsx +109 -0
  48. package/components/ui/button.tsx +78 -0
  49. package/components/ui/calendar.tsx +235 -0
  50. package/components/ui/card.tsx +92 -0
  51. package/components/ui/carousel.tsx +241 -0
  52. package/components/ui/chart.tsx +353 -0
  53. package/components/ui/checkbox.tsx +32 -0
  54. package/components/ui/collapsible.tsx +33 -0
  55. package/components/ui/command.tsx +177 -0
  56. package/components/ui/context-menu.tsx +252 -0
  57. package/components/ui/dialog.tsx +138 -0
  58. package/components/ui/drawer.tsx +134 -0
  59. package/components/ui/dropdown-menu.tsx +257 -0
  60. package/components/ui/empty.tsx +90 -0
  61. package/components/ui/file-upload.tsx +152 -0
  62. package/components/ui/form.tsx +195 -0
  63. package/components/ui/google-maps-loader.tsx +379 -0
  64. package/components/ui/hover-card.tsx +44 -0
  65. package/components/ui/index.ts +242 -0
  66. package/components/ui/input-otp.tsx +77 -0
  67. package/components/ui/input.tsx +38 -0
  68. package/components/ui/label.tsx +24 -0
  69. package/components/ui/map-config.ts +12 -0
  70. package/components/ui/map-layers.tsx +129 -0
  71. package/components/ui/map.exports.ts +31 -0
  72. package/components/ui/map.tsx +412 -0
  73. package/components/ui/menubar.tsx +276 -0
  74. package/components/ui/navigation-menu.tsx +162 -0
  75. package/components/ui/notification-badge.tsx +61 -0
  76. package/components/ui/page-header.tsx +229 -0
  77. package/components/ui/pagination.tsx +127 -0
  78. package/components/ui/popover.tsx +48 -0
  79. package/components/ui/progress.tsx +31 -0
  80. package/components/ui/radio-group.tsx +56 -0
  81. package/components/ui/rating.tsx +102 -0
  82. package/components/ui/resizable.tsx +405 -0
  83. package/components/ui/route-map.tsx +246 -0
  84. package/components/ui/scroll-area.tsx +58 -0
  85. package/components/ui/search.tsx +70 -0
  86. package/components/ui/select.tsx +176 -0
  87. package/components/ui/separator.tsx +28 -0
  88. package/components/ui/sheet.tsx +138 -0
  89. package/components/ui/sidebar.tsx +726 -0
  90. package/components/ui/simple-map.tsx +92 -0
  91. package/components/ui/skeleton.tsx +13 -0
  92. package/components/ui/slider.tsx +58 -0
  93. package/components/ui/sonner.tsx +77 -0
  94. package/components/ui/stats-card.tsx +84 -0
  95. package/components/ui/stepper.tsx +126 -0
  96. package/components/ui/switch.tsx +34 -0
  97. package/components/ui/table.tsx +116 -0
  98. package/components/ui/tabs.tsx +66 -0
  99. package/components/ui/textarea.tsx +26 -0
  100. package/components/ui/timeline.tsx +140 -0
  101. package/components/ui/toggle-group.tsx +71 -0
  102. package/components/ui/toggle.tsx +46 -0
  103. package/components/ui/tooltip.tsx +61 -0
  104. package/components/ui/tree-view.tsx +123 -0
  105. package/components/ui/use-mobile.ts +24 -0
  106. package/components/ui/utils.ts +6 -0
  107. package/components/ui/xertica-assistant.tsx +1420 -0
  108. package/contexts/ApiKeyContext.tsx +123 -0
  109. package/contexts/AssistenteContext.tsx +118 -0
  110. package/contexts/BrandColorsContext.tsx +551 -0
  111. package/contexts/LanguageContext.tsx +36 -0
  112. package/contexts/ThemeContext.tsx +85 -0
  113. package/dist/cli.js +20922 -0
  114. package/eslint.config.js +41 -0
  115. package/guidelines/Guidelines.md +61 -0
  116. package/hooks/useTheme.ts +4 -0
  117. package/imports/Podcast.tsx +389 -0
  118. package/imports/XerticaAi.tsx +46 -0
  119. package/imports/XerticaX.tsx +20 -0
  120. package/imports/svg-aueiaqngck.ts +11 -0
  121. package/imports/svg-v9krss1ozd.ts +16 -0
  122. package/imports/svg-vhrdofe3qe.ts +5 -0
  123. package/index.css +4448 -0
  124. package/index.html +14 -0
  125. package/main.tsx +10 -0
  126. package/package.json +119 -0
  127. package/postcss.config.js +6 -0
  128. package/routes.tsx +33 -0
  129. package/styles/globals.css +15 -0
  130. package/styles/xertica/app-overrides/chat.css +61 -0
  131. package/styles/xertica/app-overrides/scrollbar.css +33 -0
  132. package/styles/xertica/base.css +70 -0
  133. package/styles/xertica/integrations/google-maps.css +76 -0
  134. package/styles/xertica/integrations/sonner.css +73 -0
  135. package/styles/xertica/theme-map.css +88 -0
  136. package/styles/xertica/tokens.css +190 -0
  137. package/tsconfig.json +31 -0
  138. package/tsconfig.node.json +10 -0
  139. package/utils/gemini.ts +140 -0
  140. package/vite-env.d.ts +12 -0
  141. 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
+ */