From 515b09e2f74a6f8e565d3f17c9d4e9121c870d8e Mon Sep 17 00:00:00 2001 From: david Date: Sun, 12 Apr 2026 12:07:15 +0200 Subject: [PATCH] Cambios App web --- apps/web/package.json | 45 +- apps/web/src/app.css | 0 apps/web/src/app.tsx | 7 +- apps/web/src/lib/token.ts | 12 +- apps/web/src/pages/shadcn-ui-page.tsx | 295 ++++++++++++ apps/web/src/pages/tailwindcss-page.tsx | 608 ++++++++++++++++++++++++ apps/web/src/routes/app-routes.tsx | 6 + apps/web/vite.config.mts | 5 +- 8 files changed, 946 insertions(+), 32 deletions(-) delete mode 100644 apps/web/src/app.css create mode 100644 apps/web/src/pages/shadcn-ui-page.tsx create mode 100644 apps/web/src/pages/tailwindcss-page.tsx diff --git a/apps/web/package.json b/apps/web/package.json index 0d53ce8b..06c51be4 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -15,38 +15,43 @@ "format": "biome format --write" }, "devDependencies": { - "@biomejs/biome": "^2.3.1", - "@tanstack/react-query-devtools": "^5.74.11", - "@types/dinero.js": "^1.9.4", - "@types/node": "^22.15.12", - "@types/react": "^19.1.2", - "@types/react-dom": "^19.1.3", - "@vitejs/plugin-react": "^4.4.1", - "react": "^19.1.0", - "react-dom": "^19.1.0", - "typescript": "~5.8.3", - "vite": "^6.3.5" + "@biomejs/biome": "^2.4.11", + "@tanstack/react-query-devtools": "^5.98.0", + "@tailwindcss/postcss": "^4.1.5", + "@types/dinero.js": "^2.0.0", + "@types/node": "^25.6.0", + "@types/react": "^19.2.14", + "@types/react-dom": "^19.2.3", + "@vitejs/plugin-react": "^6.0.1", + "date-fns": "^4.1.0", + "typescript": "~6.0.2", + "vite": "^8.0.8" }, "dependencies": { "@erp/auth": "workspace:*", "@erp/core": "workspace:*", "@erp/customer-invoices": "workspace:*", "@erp/customers": "workspace:*", + "@fontsource-variable/geist": "^5.2.8", + "@fontsource-variable/geist-mono": "^5.2.7", "@repo/i18next": "workspace:*", "@repo/rdx-ui": "workspace:*", "@repo/shadcn-ui": "workspace:*", - "@tailwindcss/vite": "^4.1.11", - "@tanstack/react-query": "^5.90.6", - "axios": "^1.14.0", - "dinero.js": "^1.9.1", - "react-error-boundary": "^6.0.0", + "@tailwindcss/vite": "^4.2.2", + "@tanstack/react-query": "^5.98.0", + "axios": "^1.15.0", + "dinero.js": "1.9.1", + "lucide-react": "^1.8.0", + "react": "^19.2.5", + "react-dom": "^19.2.5", + "react-error-boundary": "^6.1.1", "react-hook-form": "^7.72.1", - "react-i18next": "^15.0.1", - "react-router-dom": "^6.26.0", + "react-i18next": "^17.0.2", + "react-router-dom": "^7.14.0", "react-secure-storage": "^1.3.2", "sequelize": "^6.37.8", - "tailwindcss": "^4.1.10", - "tw-animate-css": "^1.2.9", + "tailwindcss": "^4.2.2", + "tw-animate-css": "^1.4.0", "vite-plugin-html": "^3.2.2" } } \ No newline at end of file diff --git a/apps/web/src/app.css b/apps/web/src/app.css deleted file mode 100644 index e69de29b..00000000 diff --git a/apps/web/src/app.tsx b/apps/web/src/app.tsx index 8c2475a1..51929c33 100644 --- a/apps/web/src/app.tsx +++ b/apps/web/src/app.tsx @@ -1,6 +1,7 @@ import { AuthProvider, createAuthService } from "@erp/auth/client"; import { createAxiosDataSource, createAxiosInstance } from "@erp/core/client"; import { DataSourceProvider } from "@erp/core/hooks"; +import { i18n } from "@repo/i18next"; import { LoadingOverlay } from "@repo/rdx-ui/components"; import { Toaster, TooltipProvider } from "@repo/shadcn-ui/components"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; @@ -13,10 +14,6 @@ import { RouterProvider } from "react-router-dom"; import { clearAccessToken, getAccessToken, setAccessToken } from "./lib"; import { getAppRouter } from "./routes"; -import "./app.css"; - -import { i18n } from "@repo/i18next"; - export const App = () => { DineroFactory.globalLocale = "es-ES"; @@ -56,7 +53,7 @@ export const App = () => { authService: createAuthService(), }} > - + {/* Fallback Route */} }> diff --git a/apps/web/src/lib/token.ts b/apps/web/src/lib/token.ts index 251cc458..f154d543 100644 --- a/apps/web/src/lib/token.ts +++ b/apps/web/src/lib/token.ts @@ -1,10 +1,12 @@ -import secureLocalStorage from "react-secure-storage"; +import secureLocalStorageImport from "react-secure-storage"; /** * Servicio para manejar la obtención del token JWT desde el almacenamiento local. * Este archivo puede evolucionar a un AuthService más completo en el futuro. */ +const secureLocalStorage = (secureLocalStorageImport as any)?.default ?? secureLocalStorageImport; + /** * Clave utilizada en el almacenamiento local para el token JWT. */ @@ -17,7 +19,7 @@ const TOKEN_STORAGE_KEY = "factuges.auth"; * @returns El token como string, o null si no está disponible. */ export const getAccessToken = (): string | null => { - const authInfo = secureLocalStorage.getItem(TOKEN_STORAGE_KEY) as { token?: string } | null; + const authInfo = secureLocalStorage?.getItem?.(TOKEN_STORAGE_KEY) as { token?: string } | null; return typeof authInfo?.token === "string" ? authInfo.token : null; }; @@ -27,14 +29,12 @@ export const getAccessToken = (): string | null => { * @params El token como string. */ export const setAccessToken = (token: string): void => { - secureLocalStorage.setItem(TOKEN_STORAGE_KEY, token); + secureLocalStorage?.setItem?.(TOKEN_STORAGE_KEY, token); }; -setAccessToken; - /** * Limpia el token JWT del almacenamiento local. */ export const clearAccessToken = (): void => { - secureLocalStorage.removeItem(TOKEN_STORAGE_KEY); + secureLocalStorage?.removeItem?.(TOKEN_STORAGE_KEY); }; diff --git a/apps/web/src/pages/shadcn-ui-page.tsx b/apps/web/src/pages/shadcn-ui-page.tsx new file mode 100644 index 00000000..19829213 --- /dev/null +++ b/apps/web/src/pages/shadcn-ui-page.tsx @@ -0,0 +1,295 @@ +import { + AlertDialog, + AlertDialogAction, + AlertDialogCancel, + AlertDialogContent, + AlertDialogDescription, + AlertDialogFooter, + AlertDialogHeader, + AlertDialogTitle, + AlertDialogTrigger, + Badge, + Button, + ButtonGroup, + Card, + CardContent, + CardDescription, + CardHeader, + CardTitle, + Checkbox, + DropdownMenu, + DropdownMenuContent, + DropdownMenuGroup, + DropdownMenuItem, + DropdownMenuLabel, + DropdownMenuSeparator, + DropdownMenuTrigger, + Field, + FieldGroup, + InputGroup, + InputGroupAddon, + InputGroupInput, + InputGroupText, + Item, + ItemActions, + ItemContent, + ItemDescription, + ItemTitle, + RadioGroup, + RadioGroupItem, + Slider, + Switch, + Textarea, +} from "@repo/shadcn-ui/components"; +import { + ArrowLeftIcon, + ArrowRightIcon, + CheckIcon, + ChevronDownIcon, + ChevronRightIcon, + ChevronUpIcon, + CircleAlertIcon, + CopyIcon, + Loader2Icon, + MinusIcon, + MoreHorizontalIcon, + PlusIcon, + SearchIcon, + SettingsIcon, + ShareIcon, + ShoppingBagIcon, + TrashIcon, +} from "lucide-react"; +import * as React from "react"; + +export default function ShadcnShowcasePage() { + const [sliderValue, setSliderValue] = React.useState([500]); + const handleSliderValueChange = React.useCallback((value: number[]) => { + setSliderValue(value); + }, []); + + return ( +
+
+
+ + + Style Overview + + Designers love packing quirky glyphs into test phrases. This is a preview of the + typography styles. + + + +
+ {[ + "--background", + "--foreground", + "--primary", + "--secondary", + "--muted", + "--accent", + "--border", + "--chart-1", + "--chart-2", + "--chart-3", + "--chart-4", + "--chart-5", + ].map((variant) => ( +
+
+
+ {variant} +
+
+ ))} +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+ + +
+
+ + + + +
+ + + Two-factor authentication + + Verify via email or phone number. + + + + + + +
+ + + + + + + + + + + + + +