From 89ab94bb95df5301ab8d6a424fdd442e3eaa4d44 Mon Sep 17 00:00:00 2001 From: david Date: Thu, 9 Apr 2026 22:14:20 +0200 Subject: [PATCH] pruebas --- apps/web/src/global.css | 14 ++ .../core/src/web/components/page-header.tsx | 10 +- .../components/form-commit-button-group.tsx | 2 +- .../list/ui/pages/list-proformas-page.tsx | 1 + .../shared/ui/blocks/proforma-layout.tsx | 2 +- .../ui/blocks/proforma-header-form-grid.tsx | 7 +- .../ui/blocks/proforma-section-card.tsx | 17 +- .../ui/blocks/proforma-update-editor-form.tsx | 8 +- .../editors/proforma-update-header-editor.tsx | 104 +++----- .../update/ui/pages/proforma-update-page.tsx | 5 +- .../src/components/form/form-field-label.tsx | 9 +- .../rdx-ui/src/components/form/text-field.tsx | 10 + .../src/components/layout/app-content.tsx | 5 +- .../src/components/layout/app-header.tsx | 9 +- .../src/components/layout/app-layout.tsx | 11 +- .../src/components/layout/app-sidebar.tsx | 220 ++++++---------- .../src/components/layout/site-header.tsx | 235 ++++++++++++++++++ packages/shadcn-ui/src/styles/globals.css | 5 + 18 files changed, 413 insertions(+), 261 deletions(-) create mode 100644 packages/rdx-ui/src/components/layout/site-header.tsx diff --git a/apps/web/src/global.css b/apps/web/src/global.css index a51ba69c..6af137b4 100644 --- a/apps/web/src/global.css +++ b/apps/web/src/global.css @@ -16,3 +16,17 @@ @source '../node_modules/@repo/shadcn-ui'; @source '../node_modules/@repo/rdx-ui'; */ + +@theme inline { + --sidebar-width: calc(var(--spacing) * 64); + --sidebar-width-icon: 3rem; + --header-height: calc(var(--spacing) * 14); + --content-padding: calc(var(--spacing) * 4); + --content-margin: calc(var(--spacing) * 1.5); + --content-full-height: calc( + 100vh - + var(--header-height) - + (var(--content-padding) * 2) - + (var(--content-margin) * 2) + ); +} diff --git a/modules/core/src/web/components/page-header.tsx b/modules/core/src/web/components/page-header.tsx index 71fe7c00..9c1ac7f5 100644 --- a/modules/core/src/web/components/page-header.tsx +++ b/modules/core/src/web/components/page-header.tsx @@ -21,7 +21,7 @@ export function PageHeader({ className, }: PageHeaderProps) { return ( -
+
{/* Lado izquierdo */}
@@ -29,17 +29,17 @@ export function PageHeader({ )}
-

+

{title} -

+ {description &&
{description}
}
diff --git a/modules/core/src/web/hooks/use-unsaved-changes-notifier/components/form-commit-button-group.tsx b/modules/core/src/web/hooks/use-unsaved-changes-notifier/components/form-commit-button-group.tsx index 534b500f..b9910e32 100644 --- a/modules/core/src/web/hooks/use-unsaved-changes-notifier/components/form-commit-button-group.tsx +++ b/modules/core/src/web/hooks/use-unsaved-changes-notifier/components/form-commit-button-group.tsx @@ -94,8 +94,8 @@ export const UpdateCommitButtonGroup = ({ className )} > - {submit && } {showCancel && } + {submit && } {/* Menú de acciones adicionales */} {hasSecondaryActions && ( diff --git a/modules/customer-invoices/src/web/proformas/list/ui/pages/list-proformas-page.tsx b/modules/customer-invoices/src/web/proformas/list/ui/pages/list-proformas-page.tsx index 89057141..18a7bb58 100644 --- a/modules/customer-invoices/src/web/proformas/list/ui/pages/list-proformas-page.tsx +++ b/modules/customer-invoices/src/web/proformas/list/ui/pages/list-proformas-page.tsx @@ -105,6 +105,7 @@ export const ListProformasPage = () => {
diff --git a/modules/customer-invoices/src/web/proformas/update/ui/editors/proforma-update-header-editor.tsx b/modules/customer-invoices/src/web/proformas/update/ui/editors/proforma-update-header-editor.tsx index c07f0acd..fe1d2ed2 100644 --- a/modules/customer-invoices/src/web/proformas/update/ui/editors/proforma-update-header-editor.tsx +++ b/modules/customer-invoices/src/web/proformas/update/ui/editors/proforma-update-header-editor.tsx @@ -1,3 +1,4 @@ +import { DatePickerField, TextField } from "@repo/rdx-ui/components"; import { Input, Select, @@ -58,82 +59,43 @@ export const ProformaUpdateHeaderEditor = ({ title={t("proformas.update.sections.document")} > - - - + - - - + /> - - - + - - ( - - )} - /> - + - - - + diff --git a/modules/customer-invoices/src/web/proformas/update/ui/pages/proforma-update-page.tsx b/modules/customer-invoices/src/web/proformas/update/ui/pages/proforma-update-page.tsx index a31b8738..656b76c8 100644 --- a/modules/customer-invoices/src/web/proformas/update/ui/pages/proforma-update-page.tsx +++ b/modules/customer-invoices/src/web/proformas/update/ui/pages/proforma-update-page.tsx @@ -54,7 +54,7 @@ export const ProformaUpdatePage = () => { return ( - + { title={t("pages.update.title")} /> - + {/* Alerta de error de actualización (si ha fallado el último intento) */} {updateCtrl.isUpdateError && ( { {!updateCtrl.isLoading && ( { required?: boolean; @@ -14,18 +13,14 @@ export const FormFieldLabel = ({ ...props }: FormFieldLabelProps) => { return ( - + {children} {required ? ( - ); }; diff --git a/packages/rdx-ui/src/components/form/text-field.tsx b/packages/rdx-ui/src/components/form/text-field.tsx index 85f78c0f..49e6b5cb 100644 --- a/packages/rdx-ui/src/components/form/text-field.tsx +++ b/packages/rdx-ui/src/components/form/text-field.tsx @@ -14,6 +14,16 @@ import { FormFieldLabel } from "./form-field-label.tsx"; import { type TextFieldTypePreset, getInputPresetProps } from "./text-field-presets.tsx"; import type { NativeInputProps } from "./types.ts"; +export type ProformaFieldSpan = "xs" | "sm" | "md" | "lg" | "full"; + +const fieldSpanClasses: Record = { + xs: "md:col-span-2", + sm: "md:col-span-3", + md: "md:col-span-4", + lg: "md:col-span-6", + full: "md:col-span-12", +}; + type TextFieldProps = Omit & { name: FieldPath; diff --git a/packages/rdx-ui/src/components/layout/app-content.tsx b/packages/rdx-ui/src/components/layout/app-content.tsx index e6e3b55c..8f39a708 100644 --- a/packages/rdx-ui/src/components/layout/app-content.tsx +++ b/packages/rdx-ui/src/components/layout/app-content.tsx @@ -7,10 +7,7 @@ export const AppContent = ({ ...props }: PropsWithChildren<{ className?: string }>) => { return ( -
+
{children}
); diff --git a/packages/rdx-ui/src/components/layout/app-header.tsx b/packages/rdx-ui/src/components/layout/app-header.tsx index c04bfc77..35515a17 100644 --- a/packages/rdx-ui/src/components/layout/app-header.tsx +++ b/packages/rdx-ui/src/components/layout/app-header.tsx @@ -7,14 +7,7 @@ export const AppHeader = ({ ...props }: PropsWithChildren<{ className?: string }>) => { return ( -
+
{children}
); diff --git a/packages/rdx-ui/src/components/layout/app-layout.tsx b/packages/rdx-ui/src/components/layout/app-layout.tsx index 7cfc7672..b93c12cb 100644 --- a/packages/rdx-ui/src/components/layout/app-layout.tsx +++ b/packages/rdx-ui/src/components/layout/app-layout.tsx @@ -2,11 +2,11 @@ import { SidebarInset, SidebarProvider } from "@repo/shadcn-ui/components"; import { Outlet } from "react-router"; import { AppSidebar } from "./app-sidebar.tsx"; +import { SiteHeader } from "./site-header.tsx"; export const AppLayout = () => { return ( { > {/* Aquí está el MAIN */} - - + + +
+
+ +
+
); diff --git a/packages/rdx-ui/src/components/layout/app-sidebar.tsx b/packages/rdx-ui/src/components/layout/app-sidebar.tsx index 3b1fb192..29118d24 100644 --- a/packages/rdx-ui/src/components/layout/app-sidebar.tsx +++ b/packages/rdx-ui/src/components/layout/app-sidebar.tsx @@ -3,66 +3,71 @@ import { SidebarContent, SidebarFooter, SidebarHeader, - SidebarRail, + SidebarMenu, + SidebarMenuButton, + SidebarMenuItem, } from "@repo/shadcn-ui/components"; import { - BarChartIcon, CameraIcon, - ClipboardListIcon, - DatabaseIcon, - FileCheckIcon, - FileCodeIcon, - FileIcon, - FileTextIcon, - FolderIcon, - Frame, - GalleryVerticalEnd, - HelpCircleIcon, - LayoutDashboardIcon, - ListIcon, - MapIcon, - PieChart, + CircleIcon, + FileBoxIcon, + HomeIcon, + LogInIcon, + Package2Icon, + PackageIcon, SettingsIcon, + TextCursorIcon, + UserPlusIcon, UsersIcon, } from "lucide-react"; import type * as React from "react"; import { NavMain } from "./nav-main.tsx"; import { NavSecondary } from "./nav-secondary.tsx"; -import { TeamSwitcher } from "./team-switcher.tsx"; +import { NavUser } from "./nav-user.tsx"; const data = { user: { - name: "shadcn", + name: "Toby Belhome", email: "m@example.com", - avatar: "/avatars/shadcn.jpg", + avatar: "https://www.tobybelhome.com/toby-belhome.png", }, navMain: [ { title: "Dashboard", - url: "#", - icon: LayoutDashboardIcon, + url: "/dashboard", + icon: HomeIcon, }, { - title: "Lifecycle", - url: "#", - icon: ListIcon, - }, - { - title: "Analytics", - url: "#", - icon: BarChartIcon, - }, - { - title: "Projects", - url: "#", - icon: FolderIcon, - }, - { - title: "Team", - url: "#", + title: "Users", + url: "/dashboard/users", icon: UsersIcon, }, + { + title: "Settings", + url: "/dashboard/settings", + icon: SettingsIcon, + }, + { + title: "Login", + url: "/login", + icon: LogInIcon, + }, + { + title: "Register", + url: "/register", + icon: UserPlusIcon, + }, + { + title: "404 Page", + url: "/404-page", + icon: PackageIcon, + }, + { + title: "500 Page", + url: "/500-page", + icon: Package2Icon, + }, ], navClouds: [ { @@ -83,7 +88,7 @@ const data = { }, { title: "Proposal", - icon: FileTextIcon, + icon: FileBoxIcon, url: "#", items: [ { @@ -98,7 +103,7 @@ const data = { }, { title: "Prompts", - icon: FileCodeIcon, + icon: TextCursorIcon, url: "#", items: [ { @@ -114,111 +119,19 @@ const data = { ], navSecondary: [ { - title: "Ajustes", - url: "#", - icon: SettingsIcon, + title: "Get Pro", + url: "https://shadcnuikit.com/pricing", + icon: CircleIcon, }, { - title: "Soporte", - url: "#", - icon: HelpCircleIcon, - }, - ], - documents: [ - { - name: "Data Library", - url: "#", - icon: DatabaseIcon, + title: "Shadcn UI Kit", + url: "https://shadcnuikit.com/", + icon: CircleIcon, }, { - name: "Reports", - url: "#", - icon: ClipboardListIcon, - }, - { - name: "Word Assistant", - url: "#", - icon: FileIcon, - }, - ], -}; - -// This is sample data. -const data2 = { - user: { - name: "shadcn", - email: "m@example.com", - avatar: "/avatars/shadcn.jpg", - }, - teams: [ - { - name: "Acme Inc", - logo: GalleryVerticalEnd, - plan: "Enterprise", - }, - ], - navMain: [ - /*{ - title: "Inicio", - url: "/", - icon: HomeIcon, - isActive: true, - },*/ - { - title: "Clientes", - icon: UsersIcon, - isActive: true, - items: [ - { - title: "Listado de clientes", - url: "/customers", - }, - /*{ - title: "Añadir un cliente", - url: "/customers/create", - },*/ - ], - }, - { - title: "Facturas proforma", - icon: FileTextIcon, - items: [ - { - title: "Listado de proformas", - url: "/proformas", - }, - /*{ - title: "Enviar a Veri*Factu", - url: "#", - },*/ - ], - }, - { - title: "Facturas de cliente", - icon: FileCheckIcon, - items: [ - { - title: "Listado de facturas", - url: "/customer-invoices", - }, - ], - }, - ], - projects: [ - { - name: "Design Engineering", - url: "#", - icon: Frame, - }, - { - name: "Sales & Marketing", - url: "#", - icon: PieChart, - }, - { - name: "Travel", - url: "#", - icon: MapIcon, + title: "Bundui Component", + url: "https://bundui.io", + icon: CircleIcon, }, ], }; @@ -226,18 +139,29 @@ const data2 = { export function AppSidebar({ ...props }: React.ComponentProps) { return ( - - - {/**/} + + + + + + shadcn ui kit svg logo + Shadcn UI Kit + + + + - + + - - {/**/} + - ); } diff --git a/packages/rdx-ui/src/components/layout/site-header.tsx b/packages/rdx-ui/src/components/layout/site-header.tsx new file mode 100644 index 00000000..b5b80559 --- /dev/null +++ b/packages/rdx-ui/src/components/layout/site-header.tsx @@ -0,0 +1,235 @@ +import { Button, Separator, SidebarTrigger } from "@repo/shadcn-ui/components"; +import { Link } from "react-router-dom"; + +export function SiteHeader() { + return ( +
+
+ + +
+
+ + + +
+ + k +
+
+
+ +
+ +
+

+ Command Palette +

+

+ Search for a command to run... +

+
+
+
+ +
+ +
+ + Get Pro + + + + +
+ +
+
+
+ ); +} diff --git a/packages/shadcn-ui/src/styles/globals.css b/packages/shadcn-ui/src/styles/globals.css index c88d5ebe..3d01cca3 100644 --- a/packages/shadcn-ui/src/styles/globals.css +++ b/packages/shadcn-ui/src/styles/globals.css @@ -89,6 +89,11 @@ color utility to any element that depends on these defaults. */ @layer base { + button:not(:disabled), + [role="button"]:not(:disabled) { + cursor: pointer; + } + *, ::after, ::before,