@@ -26,7 +26,7 @@ export const CustomerEditorSkeleton = () => {
{t("update.loading")}
-
- >
+
+
);
};
diff --git a/modules/customers/src/web/create/ui/pages/customer-create-page.tsx b/modules/customers/src/web/create/ui/pages/customer-create-page.tsx
index 06713c2e..49d5a1f4 100644
--- a/modules/customers/src/web/create/ui/pages/customer-create-page.tsx
+++ b/modules/customers/src/web/create/ui/pages/customer-create-page.tsx
@@ -1,6 +1,6 @@
import { ErrorAlert } from "@erp/core/components";
import { UnsavedChangesProvider, useReturnToNavigation } from "@erp/core/hooks";
-import { RdxEditorPageLayout } from "@repo/rdx-ui/components";
+import { RdxEditorLayout, RdxPageContainer, RdxPageFrame } from "@repo/rdx-ui/components";
import { FormProvider } from "react-hook-form";
import { useTranslation } from "../../../i18n";
@@ -19,32 +19,35 @@ export const CustomerCreatePage = () => {
const handleCancel = () => navigateBack();
return (
-
-
-
-
-
-
-
+
+
+
+ }
+ >
+
+
{createCtrl.isCreateError ? (
@@ -65,10 +68,10 @@ export const CustomerCreatePage = () => {
/>
-
-
-
-
-
+
+
+
+
+
);
};
diff --git a/modules/customers/src/web/customer-routes.tsx b/modules/customers/src/web/customer-routes.tsx
index e54c33c6..0602dda5 100644
--- a/modules/customers/src/web/customer-routes.tsx
+++ b/modules/customers/src/web/customer-routes.tsx
@@ -2,10 +2,6 @@ import type { ModuleClientParams } from "@erp/core/client";
import { lazy } from "react";
import { Outlet, type RouteObject } from "react-router-dom";
-// Lazy load components
-const CustomerLayout = lazy(() =>
- import("./shared/ui").then((m) => ({ default: m.CustomerLayout }))
-);
const CustomersListPage = lazy(() =>
import("./list").then((m) => ({ default: m.ListCustomersPage }))
);
@@ -28,11 +24,7 @@ export const CustomerRoutes = (params: ModuleClientParams): RouteObject[] => {
layout: "app-sidebar",
protected: true,
},
- element: (
-
-
-
- ),
+ element:
,
children: [
{
index: true,
@@ -51,11 +43,7 @@ export const CustomerRoutes = (params: ModuleClientParams): RouteObject[] => {
layout: "app-fullscreen",
protected: true,
},
- element: (
-
-
-
- ),
+ element:
,
},
{
@@ -64,11 +52,7 @@ export const CustomerRoutes = (params: ModuleClientParams): RouteObject[] => {
layout: "app-fullscreen",
protected: true,
},
- element: (
-
-
-
- ),
+ element:
,
},
{
@@ -77,11 +61,7 @@ export const CustomerRoutes = (params: ModuleClientParams): RouteObject[] => {
layout: "app-fullscreen",
protected: true,
},
- element: (
-
-
-
- ),
+ element:
,
},
/*
diff --git a/modules/customers/src/web/list/ui/pages/list-customers-page-view.tsx b/modules/customers/src/web/list/ui/pages/list-customers-page-view.tsx
index 262306dd..7d00e22b 100644
--- a/modules/customers/src/web/list/ui/pages/list-customers-page-view.tsx
+++ b/modules/customers/src/web/list/ui/pages/list-customers-page-view.tsx
@@ -2,6 +2,7 @@ import { ErrorAlert } from "@erp/core/components";
import {
RdxPageActions,
RdxPageContainer,
+ RdxPageFrame,
RdxPageHeader,
RdxPageStack,
} from "@repo/rdx-ui/components";
@@ -30,22 +31,24 @@ export const ListCustomersPageView = ({
dialogs,
}: ListCustomersPageViewProps) => {
return (
-
-
- : undefined}
- description={description}
- title={title}
- />
+
+
+
+ : undefined}
+ description={description}
+ title={title}
+ />
- {refreshError ? (
-
- ) : null}
+ {refreshError ? (
+
+ ) : null}
- {content}
-
+ {content}
+
- {dialogs}
-
+ {dialogs}
+
+
);
};
diff --git a/modules/customers/src/web/list/ui/pages/list-customers-page.tsx b/modules/customers/src/web/list/ui/pages/list-customers-page.tsx
index 33f712fa..054ef8df 100644
--- a/modules/customers/src/web/list/ui/pages/list-customers-page.tsx
+++ b/modules/customers/src/web/list/ui/pages/list-customers-page.tsx
@@ -1,6 +1,6 @@
import { PageErrorState, SimpleSearchInput } from "@erp/core/components";
import { useReturnToNavigation } from "@erp/core/hooks";
-import { RdxPageContainer } from "@repo/rdx-ui/components";
+import { RdxPageContainer, RdxPageFrame } from "@repo/rdx-ui/components";
import {
Button,
ResizableHandle,
@@ -14,6 +14,7 @@ import { createSearchParams, useNavigate } from "react-router-dom";
import { useTranslation } from "../../../i18n";
import { useListCustomersPageController } from "../../controllers";
import { CustomerSummaryPanel, CustomersGrid, useCustomersGridColumns } from "../blocks";
+
import { ListCustomersPageView } from "./list-customers-page-view";
export const ListCustomersPage = () => {
@@ -90,8 +91,8 @@ export const ListCustomersPage = () => {
if (pageError) {
return (
-
-
+
+
{
title={pageError.title}
variant={pageError.variant}
/>
-
-
+
+
);
}
@@ -157,14 +158,14 @@ export const ListCustomersPage = () => {
}
description={t("list.description")}
primaryAction={
-
+
}
refreshError={refreshError}
title={t("list.title")}
diff --git a/modules/customers/src/web/shared/ui/blocks/customer-layout.tsx b/modules/customers/src/web/shared/ui/blocks/customer-layout.tsx
deleted file mode 100644
index 8bd08331..00000000
--- a/modules/customers/src/web/shared/ui/blocks/customer-layout.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import type { PropsWithChildren } from "react";
-
-export const CustomerLayout = ({ children }: PropsWithChildren) => {
- return (
-
- {children}
-
- );
-};
diff --git a/modules/customers/src/web/shared/ui/blocks/index.ts b/modules/customers/src/web/shared/ui/blocks/index.ts
index 7f780d43..e69de29b 100644
--- a/modules/customers/src/web/shared/ui/blocks/index.ts
+++ b/modules/customers/src/web/shared/ui/blocks/index.ts
@@ -1 +0,0 @@
-export * from "./customer-layout";
diff --git a/modules/customers/src/web/update/ui/blocks/customer-update-header.tsx b/modules/customers/src/web/update/ui/blocks/customer-update-header.tsx
index 0cd0fc0b..32066e12 100644
--- a/modules/customers/src/web/update/ui/blocks/customer-update-header.tsx
+++ b/modules/customers/src/web/update/ui/blocks/customer-update-header.tsx
@@ -1,9 +1,10 @@
-import { PageFormHeader, PageKeyboardShortcutsButton } from "@erp/core/components";
+import { PageKeyboardShortcutsButton } from "@erp/core/components";
import {
CancelActionButton,
FormActionsBar,
type FormSecondaryAction,
FormSecondaryActionsMenu,
+ RdxEditorHeader,
RhfSubmitActionButton,
} from "@repo/rdx-ui/components";
import type { ReactNode } from "react";
@@ -75,7 +76,7 @@ export const CustomerUpdateHeader = ({
];
return (
-
{children}
-
+
);
};
diff --git a/modules/customers/src/web/update/ui/components/customer-editor-skeleton.tsx b/modules/customers/src/web/update/ui/components/customer-editor-skeleton.tsx
index 2e2320e9..d7082324 100644
--- a/modules/customers/src/web/update/ui/components/customer-editor-skeleton.tsx
+++ b/modules/customers/src/web/update/ui/components/customer-editor-skeleton.tsx
@@ -1,4 +1,4 @@
-import { AppContent, BackHistoryButton } from "@repo/rdx-ui/components";
+import { BackHistoryButton, RdxPageContainer, RdxPageFrame } from "@repo/rdx-ui/components";
import { Button } from "@repo/shadcn-ui/components";
import { useTranslation } from "../../../i18n";
@@ -6,8 +6,8 @@ import { useTranslation } from "../../../i18n";
export const CustomerEditorSkeleton = () => {
const { t } = useTranslation();
return (
- <>
-
+
+
@@ -26,7 +26,7 @@ export const CustomerEditorSkeleton = () => {
{t("update.loading")}
-
- >
+
+
);
};
diff --git a/modules/customers/src/web/update/ui/pages/customer-update-page.tsx b/modules/customers/src/web/update/ui/pages/customer-update-page.tsx
index 6fda97da..2f7131d4 100644
--- a/modules/customers/src/web/update/ui/pages/customer-update-page.tsx
+++ b/modules/customers/src/web/update/ui/pages/customer-update-page.tsx
@@ -1,6 +1,6 @@
import { ErrorAlert, PageErrorState } from "@erp/core/components";
import { UnsavedChangesProvider, useReturnToNavigation } from "@erp/core/hooks";
-import { RdxEditorPageLayout } from "@repo/rdx-ui/components";
+import { RdxEditorLayout, RdxPageContainer, RdxPageFrame } from "@repo/rdx-ui/components";
import { FormProvider } from "react-hook-form";
import { useTranslation } from "../../../i18n";
@@ -26,8 +26,8 @@ export const CustomerUpdatePage = () => {
if (ctrl.pageError) {
return (
-
-
+
+
{
title={ctrl.pageError.title}
variant={ctrl.pageError.variant}
/>
-
-
+
+
);
}
return (
-
-
-
-
-
-
-
+
+
+
+ }
+ >
+
+
{updateCtrl.isUpdateError ? (
@@ -121,10 +124,10 @@ export const CustomerUpdatePage = () => {
/>
-
-
-
-
-
+
+
+
+
+
);
};
diff --git a/modules/customers/src/web/view/ui/blocks/customer-view-header.tsx b/modules/customers/src/web/view/ui/blocks/customer-view-header.tsx
index de353ebe..d8b01aae 100644
--- a/modules/customers/src/web/view/ui/blocks/customer-view-header.tsx
+++ b/modules/customers/src/web/view/ui/blocks/customer-view-header.tsx
@@ -1,9 +1,10 @@
-import { PageFormHeader, PageKeyboardShortcutsButton } from "@erp/core/components";
+import { PageKeyboardShortcutsButton } from "@erp/core/components";
import {
CancelActionButton,
FormActionsBar,
type FormSecondaryAction,
FormSecondaryActionsMenu,
+ RdxEditorHeader,
} from "@repo/rdx-ui/components";
import type { ReactNode } from "react";
@@ -70,7 +71,7 @@ export const CustomerViewHeader = ({
];
return (
-
{children}
-
+
);
};
diff --git a/modules/customers/src/web/view/ui/pages/customer-view-page.tsx b/modules/customers/src/web/view/ui/pages/customer-view-page.tsx
index 5b9c9efd..e14dff99 100644
--- a/modules/customers/src/web/view/ui/pages/customer-view-page.tsx
+++ b/modules/customers/src/web/view/ui/pages/customer-view-page.tsx
@@ -1,5 +1,6 @@
import { PageErrorState } from "@erp/core/components";
import { useReturnToNavigation } from "@erp/core/hooks";
+import { RdxPageContainer, RdxPageFrame } from "@repo/rdx-ui/components";
import { Card, CardContent, CardHeader, CardTitle } from "@repo/shadcn-ui/components";
import {
Banknote,
@@ -35,8 +36,8 @@ export const CustomerViewPage = () => {
if (ctrl.pageError) {
return (
-
-
+
+
{
title={ctrl.pageError.title}
variant={ctrl.pageError.variant}
/>
-
-
+
+
);
}
return (
-
-
-
-
+
+ }
+ >
+
{/* Información Básica */}
@@ -369,7 +372,7 @@ export const CustomerViewPage = () => {
-
-
+
+
);
};
diff --git a/modules/identity/src/web/account/ui/pages/account-page.tsx b/modules/identity/src/web/account/ui/pages/account-page.tsx
index b5ce7d00..70ba63af 100644
--- a/modules/identity/src/web/account/ui/pages/account-page.tsx
+++ b/modules/identity/src/web/account/ui/pages/account-page.tsx
@@ -1,8 +1,9 @@
-import { ErrorAlert, PageErrorState, PageFormHeader } from "@erp/core/components";
+import { ErrorAlert, PageErrorState } from "@erp/core/components";
import { UnsavedChangesProvider, useReturnToNavigation } from "@erp/core/hooks";
import {
CancelActionButton,
RdxEditorActionBar,
+ RdxEditorHeader,
RdxEditorPageLayout,
RdxPanel,
RhfSubmitActionButton,
@@ -252,7 +253,7 @@ export const AccountPage = () => {
return (
-
{
});
return (
-
-
-
-
-
-
+
+
+
+ }
+ >
+
+
{controller.mutation.isError ? (
@@ -51,10 +55,10 @@ export const SupplierCreatePage = () => {
/>
-
-
-
-
-
+
+
+
+
+
);
};
diff --git a/modules/suppliers/src/web/list/ui/suppliers-list-page.tsx b/modules/suppliers/src/web/list/ui/suppliers-list-page.tsx
index c8741476..2991d972 100644
--- a/modules/suppliers/src/web/list/ui/suppliers-list-page.tsx
+++ b/modules/suppliers/src/web/list/ui/suppliers-list-page.tsx
@@ -2,6 +2,7 @@ import { PageErrorState, SimpleSearchInput } from "@erp/core/components";
import {
RdxPageActions,
RdxPageContainer,
+ RdxPageFrame,
RdxPageHeader,
RdxPageStack,
} from "@repo/rdx-ui/components";
@@ -36,63 +37,67 @@ export const SuppliersListPage = () => {
if (controller.isError && controller.data.items.length === 0) {
return (
-
- {
- await controller.refetch();
- },
- }}
- title={t("list.error.title")}
- variant="unknown"
- />
-
+
+
+ {
+ await controller.refetch();
+ },
+ }}
+ title={t("list.error.title")}
+ variant="unknown"
+ />
+
+
);
}
return (
-
-
- navigate("/suppliers/create")}>
-
- {t("common.actions.create")}
-
- }
- />
- }
- description={t("list.description")}
- title={t("list.title")}
- />
-
- }
- />
-
-
+
+
+
+ navigate("/suppliers/create")}>
+
+ {t("common.actions.create")}
+
+ }
+ />
+ }
+ description={t("list.description")}
+ title={t("list.title")}
+ />
+
+ }
+ />
+
+
+
);
};
diff --git a/modules/suppliers/src/web/shared/ui/index.ts b/modules/suppliers/src/web/shared/ui/index.ts
index 08cb83ad..b1d3c434 100644
--- a/modules/suppliers/src/web/shared/ui/index.ts
+++ b/modules/suppliers/src/web/shared/ui/index.ts
@@ -1,5 +1,4 @@
export * from "./supplier-editor-form";
export * from "./supplier-editor-header";
export * from "./supplier-editor-skeleton";
-export * from "./supplier-layout";
export * from "./supplier-status-badge";
diff --git a/modules/suppliers/src/web/shared/ui/supplier-editor-header.tsx b/modules/suppliers/src/web/shared/ui/supplier-editor-header.tsx
index 5cbf8f73..1c80b864 100644
--- a/modules/suppliers/src/web/shared/ui/supplier-editor-header.tsx
+++ b/modules/suppliers/src/web/shared/ui/supplier-editor-header.tsx
@@ -1,5 +1,10 @@
-import { PageFormHeader, PageKeyboardShortcutsButton } from "@erp/core/components";
-import { CancelActionButton, FormActionsBar, RhfSubmitActionButton } from "@repo/rdx-ui/components";
+import { PageKeyboardShortcutsButton } from "@erp/core/components";
+import {
+ CancelActionButton,
+ FormActionsBar,
+ RdxEditorHeader,
+ RhfSubmitActionButton,
+} from "@repo/rdx-ui/components";
import { useTranslation } from "../../i18n";
@@ -19,7 +24,7 @@ export const SupplierEditorHeader = ({
const { t } = useTranslation();
return (
-
);
diff --git a/modules/suppliers/src/web/shared/ui/supplier-editor-skeleton.tsx b/modules/suppliers/src/web/shared/ui/supplier-editor-skeleton.tsx
index 12ffe076..ad7fb8a2 100644
--- a/modules/suppliers/src/web/shared/ui/supplier-editor-skeleton.tsx
+++ b/modules/suppliers/src/web/shared/ui/supplier-editor-skeleton.tsx
@@ -1,4 +1,4 @@
-import { AppContent } from "@repo/rdx-ui/components";
+import { RdxPageContainer, RdxPageFrame } from "@repo/rdx-ui/components";
import { useTranslation } from "../../i18n";
@@ -17,16 +17,18 @@ export const SupplierEditorSkeleton = () => {
const { t } = useTranslation();
return (
-
-
-
-
- {SKELETON_FIELDS.map((field) => (
-
- ))}
+
+
+
+
+
+ {SKELETON_FIELDS.map((field) => (
+
+ ))}
+
-
-
{t("common.loading")}
-
+
{t("common.loading")}
+
+
);
};
diff --git a/modules/suppliers/src/web/shared/ui/supplier-layout.tsx b/modules/suppliers/src/web/shared/ui/supplier-layout.tsx
deleted file mode 100644
index 7025473f..00000000
--- a/modules/suppliers/src/web/shared/ui/supplier-layout.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import type { PropsWithChildren } from "react";
-
-export const SupplierLayout = ({ children }: PropsWithChildren) => (
-
- {children}
-
-);
diff --git a/modules/suppliers/src/web/supplier-routes.tsx b/modules/suppliers/src/web/supplier-routes.tsx
index 43c70e23..0c5e2e1a 100644
--- a/modules/suppliers/src/web/supplier-routes.tsx
+++ b/modules/suppliers/src/web/supplier-routes.tsx
@@ -2,9 +2,6 @@ import type { ModuleClientParams } from "@erp/core/client";
import { lazy } from "react";
import { Outlet, type RouteObject } from "react-router-dom";
-const SupplierLayout = lazy(() =>
- import("./shared/ui").then((module) => ({ default: module.SupplierLayout }))
-);
const SuppliersListPage = lazy(() =>
import("./list").then((module) => ({ default: module.SuppliersListPage }))
);
@@ -22,38 +19,22 @@ export const SupplierRoutes = (params: ModuleClientParams): RouteObject[] => [
{
path: "suppliers",
handle: { layout: "app-sidebar", protected: true },
- element: (
-
-
-
- ),
+ element:
,
children: [{ index: true, element:
}],
},
{
path: "suppliers/create",
handle: { layout: "app-fullscreen", protected: true },
- element: (
-
-
-
- ),
+ element:
,
},
{
path: "suppliers/:id/edit",
handle: { layout: "app-fullscreen", protected: true },
- element: (
-
-
-
- ),
+ element:
,
},
{
path: "suppliers/:id",
handle: { layout: "app-fullscreen", protected: true },
- element: (
-
-
-
- ),
+ element:
,
},
];
diff --git a/modules/suppliers/src/web/update/supplier-update-page.tsx b/modules/suppliers/src/web/update/supplier-update-page.tsx
index b8c3b068..ca8e2a0d 100644
--- a/modules/suppliers/src/web/update/supplier-update-page.tsx
+++ b/modules/suppliers/src/web/update/supplier-update-page.tsx
@@ -1,6 +1,6 @@
import { ErrorAlert, PageErrorState } from "@erp/core/components";
import { UnsavedChangesProvider, useReturnToNavigation } from "@erp/core/hooks";
-import { RdxEditorPageLayout, RdxPageContainer } from "@repo/rdx-ui/components";
+import { RdxEditorLayout, RdxPageContainer, RdxPageFrame } from "@repo/rdx-ui/components";
import { FormProvider } from "react-hook-form";
import { createSearchParams, useNavigate, useParams, useSearchParams } from "react-router-dom";
@@ -28,36 +28,42 @@ export const SupplierUpdatePage = () => {
if (controller.query.isError || !controller.query.data) {
return (
-
- {
- await controller.query.refetch();
- },
- }}
- secondaryAction={{ label: t("common.actions.back"), onClick: navigateBack }}
- title={t("detail.error.title")}
- variant="notFound"
- />
-
+
+
+ {
+ await controller.query.refetch();
+ },
+ }}
+ secondaryAction={{ label: t("common.actions.back"), onClick: navigateBack }}
+ title={t("detail.error.title")}
+ variant="notFound"
+ />
+
+
);
}
return (
-
-
-
-
-
-
+
+
+
+ }
+ >
+
+
{controller.mutation.isError ? (
@@ -73,10 +79,10 @@ export const SupplierUpdatePage = () => {
/>
-
-
-
-
-
+
+
+
+
+
);
};
diff --git a/modules/suppliers/src/web/view/supplier-detail-page.tsx b/modules/suppliers/src/web/view/supplier-detail-page.tsx
index ad1c9f4a..7d2922c9 100644
--- a/modules/suppliers/src/web/view/supplier-detail-page.tsx
+++ b/modules/suppliers/src/web/view/supplier-detail-page.tsx
@@ -3,6 +3,7 @@ import { useReturnToNavigation } from "@erp/core/hooks";
import {
RdxPageActions,
RdxPageContainer,
+ RdxPageFrame,
RdxPageHeader,
RdxPageStack,
} from "@repo/rdx-ui/components";
@@ -35,20 +36,22 @@ export const SupplierDetailPage = () => {
if (query.isError || !query.data) {
return (
-
- {
- await query.refetch();
- },
- }}
- secondaryAction={{ label: t("common.actions.back"), onClick: navigateBack }}
- title={t("detail.error.title")}
- variant="notFound"
- />
-
+
+
+ {
+ await query.refetch();
+ },
+ }}
+ secondaryAction={{ label: t("common.actions.back"), onClick: navigateBack }}
+ title={t("detail.error.title")}
+ variant="notFound"
+ />
+
+
);
}
@@ -56,121 +59,133 @@ export const SupplierDetailPage = () => {
const context = supplier.reference || supplier.tin || supplier.tradeName || "-";
return (
-
-
-
- navigate({
- pathname: `/suppliers/${supplier.id}/edit`,
- search: createSearchParams({ returnTo }).toString(),
- })
- }
- >
-
- {t("common.actions.edit")}
-
- }
- secondary={
-
- }
- />
- }
- description={context}
- title={
-
- {supplier.name}
-
-
- }
- />
+
+
+ navigate({
+ pathname: `/suppliers/${supplier.id}/edit`,
+ search: createSearchParams({ returnTo }).toString(),
+ })
+ }
+ >
+
+ {t("common.actions.edit")}
+
+ }
+ secondary={
+
+ }
+ />
+ }
+ description={context}
+ title={
+
+ {supplier.name}
+
+
+ }
+ />
+
+ }
+ >
+
+
+
+
+
+
+
+ {t("detail.sections.identity")}
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
- {t("detail.sections.identity")}
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+ {t("detail.sections.contact")}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
- {t("detail.sections.contact")}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+ {t("detail.sections.address")}
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
- {t("detail.sections.address")}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {t("detail.sections.preferences")}
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+ {t("detail.sections.preferences")}
+
+
+
+
+
+
+
+
+
+
+
+
+
);
};
diff --git a/packages/rdx-ui/src/components/editor-page/index.ts b/packages/rdx-ui/src/components/editor-page/index.ts
index 7e621d5c..d5836766 100644
--- a/packages/rdx-ui/src/components/editor-page/index.ts
+++ b/packages/rdx-ui/src/components/editor-page/index.ts
@@ -1,4 +1,5 @@
export * from "./rdx-editor-action-bar.tsx";
+export * from "./rdx-editor-header.tsx";
export * from "./rdx-editor-layout.tsx";
export * from "./rdx-editor-page-layout.tsx";
export * from "./rdx-panel.tsx";
diff --git a/packages/rdx-ui/src/components/editor-page/rdx-editor-foundations.test.tsx b/packages/rdx-ui/src/components/editor-page/rdx-editor-foundations.test.tsx
index 7902632f..c90ad484 100644
--- a/packages/rdx-ui/src/components/editor-page/rdx-editor-foundations.test.tsx
+++ b/packages/rdx-ui/src/components/editor-page/rdx-editor-foundations.test.tsx
@@ -6,6 +6,7 @@ import { renderToStaticMarkup } from "react-dom/server";
import { RdxFormGrid } from "../form/rdx-form-grid.tsx";
import { RdxEditorActionBar } from "./rdx-editor-action-bar.tsx";
+import { RdxEditorHeader } from "./rdx-editor-header.tsx";
import { RdxEditorLayout } from "./rdx-editor-layout.tsx";
import { RdxEditorPageLayout } from "./rdx-editor-page-layout.tsx";
@@ -20,6 +21,33 @@ test("RdxEditorLayout only distributes main content and an optional aside", () =
assert.doesNotMatch(html, /px-4/);
});
+test("RdxEditorHeader renderiza navegación, título, estado, acciones y contenido contextual", () => {
+ const html = renderToStaticMarkup(
+
Actions}
+ backLabel="Volver"
+ onBack={() => undefined}
+ status="Modificada"
+ title="Editar proforma"
+ >
+ Secondary content
+
+ );
+
+ assert.match(html, /aria-label="Volver"/);
+ assert.match(html, /
]*>Editar proforma<\/h1>/);
+ assert.match(html, /Modificada/);
+ assert.match(html, /Actions/);
+ assert.match(html, /Secondary content/);
+ assert.doesNotMatch(html, /sticky top-0/);
+});
+
+test("RdxEditorHeader no renderiza back sin callback", () => {
+ const html = renderToStaticMarkup();
+
+ assert.doesNotMatch(html, /aria-label="Volver"/);
+});
+
import { RdxPanel } from "./rdx-panel.tsx";
test("RdxEditorPageLayout aplica complejidad simple por defecto y renderiza children", () => {
diff --git a/modules/core/src/web/components/form/form-actions/page-form-header.tsx b/packages/rdx-ui/src/components/editor-page/rdx-editor-header.tsx
similarity index 52%
rename from modules/core/src/web/components/form/form-actions/page-form-header.tsx
rename to packages/rdx-ui/src/components/editor-page/rdx-editor-header.tsx
index a71a1284..806d8883 100644
--- a/modules/core/src/web/components/form/form-actions/page-form-header.tsx
+++ b/packages/rdx-ui/src/components/editor-page/rdx-editor-header.tsx
@@ -1,74 +1,75 @@
-import { RdxBadge } from "@repo/rdx-ui/components";
import { Button } from "@repo/shadcn-ui/components";
import { cn } from "@repo/shadcn-ui/lib/utils";
import { ArrowLeftIcon } from "lucide-react";
-import type { ReactNode } from "react";
+import type { ComponentPropsWithoutRef, ReactNode } from "react";
-export interface PageFormHeaderProps {
- title: string | ReactNode;
-
- backLabel: string;
- onBack?: () => void;
-
- statusLabel?: string;
- showStatus?: boolean;
+import { RdxBadge } from "../rdx-badge.tsx";
+export interface RdxEditorHeaderProps
+ extends Omit, "children" | "title"> {
+ title: ReactNode;
actions?: ReactNode;
+ backLabel?: string;
+ onBack?: () => void;
+ status?: ReactNode;
+ showStatus?: boolean;
children?: ReactNode;
-
- className?: string;
contentClassName?: string;
}
-export const PageFormHeader = ({
+/**
+ * Cabecera compacta para páginas fullscreen.
+ * Presenta navegación de retorno, título, estado y acciones.
+ */
+export const RdxEditorHeader = ({
title,
+ actions,
backLabel,
onBack,
- statusLabel,
- showStatus = false,
- actions,
+ status,
+ showStatus = true,
children,
- className,
contentClassName,
-}: PageFormHeaderProps) => {
+ className,
+ ...props
+}: RdxEditorHeaderProps) => {
return (
-
+ {onBack ? (
+
+ ) : null}
{title}
- {statusLabel ? (
+ {status ? (
- {statusLabel}
+ {status}
) : null}
diff --git a/packages/rdx-ui/src/components/layout/rdx-page-foundations.test.tsx b/packages/rdx-ui/src/components/layout/rdx-page-foundations.test.tsx
index 4668b59a..ab5796a8 100644
--- a/packages/rdx-ui/src/components/layout/rdx-page-foundations.test.tsx
+++ b/packages/rdx-ui/src/components/layout/rdx-page-foundations.test.tsx
@@ -106,29 +106,6 @@ test("RdxPageHeader omits optional wrappers when content is absent", () => {
assert.doesNotMatch(html, /Metadata/);
});
-test("RdxPageHeader soporta el modo sticky de editor con navegación, estado y contenido secundario", () => {
- const html = renderToStaticMarkup(
-
Actions}
- backLabel="Volver"
- onBack={() => undefined}
- showStatus
- statusLabel="Modificada"
- sticky
- title="Editar proforma"
- >
- Secondary content
-
- );
-
- assert.match(html, /sticky top-0/);
- assert.match(html, /aria-label="Volver"/);
- assert.match(html, /Editar proforma/);
- assert.match(html, /Modificada/);
- assert.match(html, /Actions/);
- assert.match(html, /Secondary content/);
-});
-
test("RdxPageActions renders only populated regions in the expected order", () => {
const html = renderToStaticMarkup(
, "children" | "title"> {
title: ReactNode;
@@ -12,27 +8,13 @@ export interface RdxPageHeaderProps
leading?: ReactNode;
metadata?: ReactNode;
actions?: ReactNode;
- backLabel?: string;
- onBack?: () => void;
- statusLabel?: ReactNode;
- showStatus?: boolean;
- sticky?: boolean;
- contentClassName?: string;
children?: ReactNode;
}
/**
* Cabecera estándar de una página.
*
- * Muestra:
- * - navegación de retorno opcional
- * - título
- * - descripción o metadata opcional
- * - estado opcional
- * - acciones de página
- *
- * Puede permanecer fija dentro de un contenedor scrollable
- * mediante `sticky`.
+ * Presenta título, descripción, metadata y acciones.
*/
export const RdxPageHeader = ({
@@ -41,73 +23,10 @@ export const RdxPageHeader = ({
leading,
metadata,
actions,
- backLabel,
- onBack,
- statusLabel,
- showStatus = false,
- sticky = false,
- contentClassName,
children,
className,
...props
}: RdxPageHeaderProps) => {
- if (sticky) {
- const shouldRenderBackButton = Boolean(backLabel || onBack);
-
- return (
-
-
-
- {shouldRenderBackButton ? (
-
- ) : null}
-
-
-
- {title}
-
-
- {statusLabel ? (
-
- {statusLabel}
-
- ) : null}
-
-
-
- {actions ?
{actions}
: null}
-
-
- {children}
-
- );
- }
-
return (