Compare commits

..

No commits in common. "35dca3954df94e30a09273c6b9a5f36af5c93a2d" and "902f7806ed8a525af29e9e1b4b157a2384abff24" have entirely different histories.

17 changed files with 297 additions and 334 deletions

View File

@ -24,13 +24,13 @@ export const SettingsLayout = ({ sections }: SettingsLayoutProps) => {
return ( return (
<RdxPageFrame> <RdxPageFrame>
<RdxPageContainer width="full"> <RdxPageContainer className="space-y-6" width="full">
<RdxPageContent spacing="default">
<RdxPageHeader <RdxPageHeader
description={t("web.settings.description")} description={t("web.settings.description")}
title={t("web.settings.title")} title={t("web.settings.title")}
/> />
<RdxPageContent spacing="default">
<div className="grid gap-6 lg:grid-cols-[18rem_minmax(0,1fr)]"> <div className="grid gap-6 lg:grid-cols-[18rem_minmax(0,1fr)]">
<aside className="min-w-0 lg:sticky lg:top-6 lg:self-start"> <aside className="min-w-0 lg:sticky lg:top-6 lg:self-start">
<SettingsNavigation sections={sections} /> <SettingsNavigation sections={sections} />

View File

@ -82,7 +82,7 @@ RdxPageContent
→ composición de los hijos principales → composición de los hijos principales
``` ```
Regla: Las Pages no deben reconstruir estas responsabilidades con wrappers HTML locales. En Create/Update, Detail/Show y LIST, la composición canónica es RdxPageFrame → RdxPageContainer → RdxPageContent: errores, alertas, secciones semánticas y contenido funcional son hijos directos de RdxPageContent; los dialogs son hermanos del frame; RdxPanel se reserva para secciones semánticas reales. Regla: Las Pages no deben reconstruir estas responsabilidades con wrappers HTML locales. En Create/Update y Detail/Show, la composición canónica es RdxPageFrame → RdxPageContainer → RdxPageContent: errores, alertas, secciones semánticas y contenido funcional son hijos directos de RdxPageContent; los dialogs son hermanos del frame; RdxPanel se reserva para secciones semánticas reales.
## 6. Identity y sesión ## 6. Identity y sesión

View File

@ -22,18 +22,6 @@ Los componentes aquí citados se definen en `ui-system.md`; este documento expli
</RdxPageFrame> </RdxPageFrame>
``` ```
El error inicial bloqueante conserva el mismo shell:
```tsx
<RdxPageFrame>
<RdxPageContainer width="content">
<RdxPageContent>
<PageErrorState />
</RdxPageContent>
</RdxPageContainer>
</RdxPageFrame>
```
- El CTA de creación permanece durante loading, empty y errores de refresh; puede desaparecer ante error inicial bloqueante. - El CTA de creación permanece durante loading, empty y errores de refresh; puede desaparecer ante error inicial bloqueante.
- Búsqueda, filtros y controles viven en `DataTable.topContent`. - Búsqueda, filtros y controles viven en `DataTable.topContent`.
- TanStack Query conserva los datos remotos y la paginación server-side. - TanStack Query conserva los datos remotos y la paginación server-side.
@ -41,7 +29,6 @@ El error inicial bloqueante conserva el mismo shell:
- No se calculan contadores globales a partir de una página parcial. - No se calculan contadores globales a partir de una página parcial.
- El click de fila recibe la fila; la página/controller usa explícitamente `row.id`. - El click de fila recibe la fila; la página/controller usa explícitamente `row.id`.
- Una vista de composición de dominio puede encapsular el shell si permanece pura. - Una vista de composición de dominio puede encapsular el shell si permanece pura.
- Los listados no reconstruyen con HTML local las responsabilidades de Frame, Container o Content. Search, filtros, tabs, tabla y paginación son contenido funcional de `RdxPageContent`; el scroll interno de una tabla o grid es legítimo y no sustituye el scroll de página.
El controller de página concentra URL, filtros, consulta, estados y navegación. La Page define columnas y conecta callbacks; no reproduce reglas de dominio. El controller de página concentra URL, filtros, consulta, estados y navegación. La Page define columnas y conecta callbacks; no reproduce reglas de dominio.

View File

@ -152,8 +152,6 @@ Excepción: un detalle documental puede configurar el contenido del frame con `o
Los avisos, errores inline, secciones y contenido funcional deben ser hijos directos cuando pertenezcan al mismo nivel visual. Los avisos, errores inline, secciones y contenido funcional deben ser hijos directos cuando pertenezcan al mismo nivel visual.
`RdxPanel` no es un wrapper genérico. Se usa únicamente cuando existe una sección con identidad visual o semántica propia. `RdxPanel` no es un wrapper genérico. Se usa únicamente cuando existe una sección con identidad visual o semántica propia.
En LIST, toolbar, búsqueda, filtros, tabs, tabla/lista/grid y paginación son bloques funcionales de `RdxPageContent`. Una tabla no implica un `RdxPanel`, y su scroll horizontal, virtualizado o interno es legítimo: no sustituye el scroll estructural de `RdxPageFrame`. No se anidan containers ni contents para filtros, alertas o paginación.
```tsx ```tsx
<RdxPageContent> <RdxPageContent>
{error ? <ErrorAlert /> : null} {error ? <ErrorAlert /> : null}

View File

@ -36,7 +36,6 @@ export const AuditPage = () => {
return ( return (
<RdxPageFrame> <RdxPageFrame>
<RdxPageContainer width="content"> <RdxPageContainer width="content">
<RdxPageContent>
<PageErrorState <PageErrorState
description={t("audit.error.load")} description={t("audit.error.load")}
primaryAction={{ primaryAction={{
@ -47,7 +46,6 @@ export const AuditPage = () => {
title={t("audit.error.load")} title={t("audit.error.load")}
variant="unknown" variant="unknown"
/> />
</RdxPageContent>
</RdxPageContainer> </RdxPageContainer>
</RdxPageFrame> </RdxPageFrame>
); );
@ -98,9 +96,9 @@ export const AuditPage = () => {
)} )}
</div> </div>
</div> </div>
<AuditEntrySheet entryId={controller.entry} onClose={controller.closeEntry} />
</RdxPageContent> </RdxPageContent>
</RdxPageContainer> </RdxPageContainer>
<AuditEntrySheet entryId={controller.entry} onClose={controller.closeEntry} />
</RdxPageFrame> </RdxPageFrame>
); );
}; };

View File

@ -1,5 +1,5 @@
import { PageErrorState } from "@erp/core/components"; import { PageErrorState } from "@erp/core/components";
import { RdxBadge } from "@repo/rdx-ui/components"; import { RdxBadge, RdxPageContainer } from "@repo/rdx-ui/components";
import { import {
Button, Button,
Card, Card,
@ -30,6 +30,8 @@ export const PaymentMethodsSettingsPage = () => {
if (ctrl.pageError) { if (ctrl.pageError) {
return ( return (
<RdxPageContainer width="full">
<div className="mx-auto w-full max-w-3xl">
<PageErrorState <PageErrorState
description={ctrl.pageError.description} description={ctrl.pageError.description}
primaryAction={ primaryAction={
@ -47,6 +49,8 @@ export const PaymentMethodsSettingsPage = () => {
title={ctrl.pageError.title} title={ctrl.pageError.title}
variant={ctrl.pageError.variant} variant={ctrl.pageError.variant}
/> />
</div>
</RdxPageContainer>
); );
} }

View File

@ -1,4 +1,5 @@
import { PageErrorState } from "@erp/core/components"; import { PageErrorState } from "@erp/core/components";
import { RdxPageContainer } from "@repo/rdx-ui/components";
import { import {
Button, Button,
Card, Card,
@ -37,6 +38,8 @@ export const PaymentTermsSettingsPage = () => {
if (ctrl.pageError) { if (ctrl.pageError) {
return ( return (
<RdxPageContainer width="full">
<div className="mx-auto w-full max-w-3xl">
<PageErrorState <PageErrorState
description={ctrl.pageError.description} description={ctrl.pageError.description}
primaryAction={ primaryAction={
@ -54,6 +57,8 @@ export const PaymentTermsSettingsPage = () => {
title={ctrl.pageError.title} title={ctrl.pageError.title}
variant={ctrl.pageError.variant} variant={ctrl.pageError.variant}
/> />
</div>
</RdxPageContainer>
); );
} }

View File

@ -1,5 +1,5 @@
import { PageErrorState } from "@erp/core/components"; import { PageErrorState } from "@erp/core/components";
import { RdxBadge } from "@repo/rdx-ui/components"; import { RdxBadge, RdxPageContainer } from "@repo/rdx-ui/components";
import { Button, Card, CardContent, CardHeader } from "@repo/shadcn-ui/components"; import { Button, Card, CardContent, CardHeader } from "@repo/shadcn-ui/components";
import { cn } from "@repo/shadcn-ui/lib/utils"; import { cn } from "@repo/shadcn-ui/lib/utils";
import { CircleIcon, LandmarkIcon, PlusIcon } from "lucide-react"; import { CircleIcon, LandmarkIcon, PlusIcon } from "lucide-react";
@ -23,6 +23,8 @@ export const TaxRegimesSettingsPage = () => {
if (ctrl.pageError) { if (ctrl.pageError) {
return ( return (
<RdxPageContainer width="full">
<div className="mx-auto w-full max-w-3xl">
<PageErrorState <PageErrorState
description={ctrl.pageError.description} description={ctrl.pageError.description}
primaryAction={ primaryAction={
@ -40,6 +42,8 @@ export const TaxRegimesSettingsPage = () => {
title={ctrl.pageError.title} title={ctrl.pageError.title}
variant={ctrl.pageError.variant} variant={ctrl.pageError.variant}
/> />
</div>
</RdxPageContainer>
); );
} }

View File

@ -127,8 +127,7 @@ export const IssuedInvoicesStatusSegmentedFilter = ({
}: IssuedInvoicesStatusSegmentedFilterProps) => { }: IssuedInvoicesStatusSegmentedFilterProps) => {
const { t } = useTranslation(); const { t } = useTranslation();
const handleValueChange = (nextValues: string[]) => { const handleValueChange = (nextValue: string) => {
const nextValue = nextValues[0];
if (!(nextValue && isIssuedInvoiceStatusFilter(nextValue)) || nextValue === value) { if (!(nextValue && isIssuedInvoiceStatusFilter(nextValue)) || nextValue === value) {
return; return;
} }
@ -139,22 +138,21 @@ export const IssuedInvoicesStatusSegmentedFilter = ({
return ( return (
<ToggleGroup <ToggleGroup
aria-label={t("pages.issued_invoices.list.filters.status.label", "Filtrar por estado")} aria-label={t("pages.issued_invoices.list.filters.status.label", "Filtrar por estado")}
className="flex w-full flex-wrap justify-start gap-4" className="flex w-full flex-wrap justify-start gap-1"
disabled={disabled} disabled={disabled}
multiple={false}
onValueChange={handleValueChange} onValueChange={handleValueChange}
size="sm" size="sm"
spacing={1} spacing={1}
value={[value]} type="single"
value={value}
variant="outline" variant="outline"
> >
{ISSUED_INVOICE_STATUS_FILTER_OPTIONS.map((option) => ( {ISSUED_INVOICE_STATUS_FILTER_OPTIONS.map((option) => (
<ToggleGroupItem <ToggleGroupItem
className={cn( className={cn(
"group h-auto min-w-fit rounded-md border-transparent px-3 py-2 text-xs sm:text-sm shadow-none transition-colors", "group h-auto min-w-fit rounded-full border-transparent px-3 py-2 text-xs shadow-none transition-colors sm:text-sm",
"text-muted-foreground hover:border-border hover:bg-muted/60 hover:text-foreground", "text-muted-foreground hover:border-border hover:bg-muted/60 hover:text-foreground",
"data-[state=on]:shadow-none", "data-[state=on]:shadow-none",
option.activeClassName option.activeClassName
)} )}
key={option.value} key={option.value}
@ -166,7 +164,7 @@ export const IssuedInvoicesStatusSegmentedFilter = ({
value={option.value} value={option.value}
> >
<span className="flex items-center gap-2"> <span className="flex items-center gap-2">
{option.icon ? <option.icon className="size-4" /> : null} {option.icon ? <option.icon className="size-3.5" /> : null}
<span> <span>
{t( {t(
`catalog.issued_invoices.status.${option.value.toLowerCase()}.label`, `catalog.issued_invoices.status.${option.value.toLowerCase()}.label`,

View File

@ -3,7 +3,6 @@ import { useReturnToNavigation } from "@erp/core/hooks";
import { import {
LogoVerifactu, LogoVerifactu,
RdxPageContainer, RdxPageContainer,
RdxPageContent,
RdxPageFrame, RdxPageFrame,
RdxPageHeader, RdxPageHeader,
} from "@repo/rdx-ui/components"; } from "@repo/rdx-ui/components";
@ -66,7 +65,6 @@ export const ListIssuedInvoicesPage = () => {
return ( return (
<RdxPageFrame> <RdxPageFrame>
<RdxPageContainer width="content"> <RdxPageContainer width="content">
<RdxPageContent>
<PageErrorState <PageErrorState
description={pageError.description} description={pageError.description}
primaryAction={ primaryAction={
@ -95,7 +93,6 @@ export const ListIssuedInvoicesPage = () => {
title={pageError.title} title={pageError.title}
variant={pageError.variant} variant={pageError.variant}
/> />
</RdxPageContent>
</RdxPageContainer> </RdxPageContainer>
</RdxPageFrame> </RdxPageFrame>
); );
@ -103,8 +100,7 @@ export const ListIssuedInvoicesPage = () => {
return ( return (
<RdxPageFrame> <RdxPageFrame>
<RdxPageContainer width="full"> <RdxPageContainer className="space-y-6" width="full">
<RdxPageContent>
<RdxPageHeader <RdxPageHeader
actions={ actions={
<Button <Button
@ -120,7 +116,7 @@ export const ListIssuedInvoicesPage = () => {
title={t("pages.issued_invoices.list.title")} title={t("pages.issued_invoices.list.title")}
/> />
<div className="space-y-4"> <div className="mx-auto w-full space-y-4">
{hasRefreshError && refreshError ? ( {hasRefreshError && refreshError ? (
<ErrorAlert message={refreshError.message} title={refreshError.title} /> <ErrorAlert message={refreshError.message} title={refreshError.title} />
) : null} ) : null}
@ -176,7 +172,6 @@ export const ListIssuedInvoicesPage = () => {
{listCtrl.data.totalItems === 0 ? <IssuedInvoicesEmptyGrid /> : null} {listCtrl.data.totalItems === 0 ? <IssuedInvoicesEmptyGrid /> : null}
</div> </div>
</RdxPageContent>
</RdxPageContainer> </RdxPageContainer>
</RdxPageFrame> </RdxPageFrame>
); );

View File

@ -11,8 +11,7 @@ import {
import type { ElementType } from "react"; import type { ElementType } from "react";
import { useTranslation } from "../../../../i18n"; import { useTranslation } from "../../../../i18n";
import { getProformaStatusDisplayIcon } from "../../../change-status/helpers"; import type { ProformaStatusCounts } from "../../../shared";
import type { ProformaStatus, ProformaStatusCounts } from "../../../shared";
import type { ProformaListStatusFilter } from "../../types/proforma-list-filters"; import type { ProformaListStatusFilter } from "../../types/proforma-list-filters";
export type ProformaStatusFilter = ProformaListStatusFilter; export type ProformaStatusFilter = ProformaListStatusFilter;
@ -93,9 +92,7 @@ export const ProformaStatusSegmentedFilter = ({
}: ProformaStatusSegmentedFilterProps) => { }: ProformaStatusSegmentedFilterProps) => {
const { t } = useTranslation(); const { t } = useTranslation();
const handleValueChange = (nextValues: string[]) => { const handleValueChange = (nextValue: string) => {
const nextValue = nextValues[0];
if (!(nextValue && isProformaStatusFilter(nextValue)) || nextValue === value) { if (!(nextValue && isProformaStatusFilter(nextValue)) || nextValue === value) {
return; return;
} }
@ -106,28 +103,21 @@ export const ProformaStatusSegmentedFilter = ({
return ( return (
<ToggleGroup <ToggleGroup
aria-label={t("pages.proformas.list.filters.status.label")} aria-label={t("pages.proformas.list.filters.status.label")}
className="w-full flex-wrap justify-start gap-4" className="w-full flex-wrap justify-start gap-1"
disabled={disabled} disabled={disabled}
multiple={false}
onValueChange={handleValueChange} onValueChange={handleValueChange}
size="sm" size="sm"
spacing={1} spacing={1}
value={[value]} type="single"
value={value}
variant="outline" variant="outline"
> >
{PROFORMA_STATUS_FILTER_OPTIONS.map((option) => { {PROFORMA_STATUS_FILTER_OPTIONS.map((option) => (
const normalizedStatus = option.value.toLowerCase() as ProformaStatus;
const Icon = getProformaStatusDisplayIcon(normalizedStatus);
const disabled =
"text-muted-foreground hover:border-border hover:bg-muted/60 hover:text-foreground";
return (
<ToggleGroupItem <ToggleGroupItem
className={cn( className={cn(
"group h-auto min-w-fit rounded-md border-none px-3 py-2 text-xs sm:text-sm shadow-none transition-colors", "group h-auto min-w-fit rounded-md border-transparent px-3 py-2 text-xs sm:text-sm shadow-none transition-colors",
"text-muted-foreground hover:border-border hover:bg-muted/60 hover:text-foreground",
"data-[state=on]:shadow-none", "data-[state=on]:shadow-none",
disabled,
option.activeClassName option.activeClassName
)} )}
key={option.value} key={option.value}
@ -139,7 +129,7 @@ export const ProformaStatusSegmentedFilter = ({
value={option.value} value={option.value}
> >
<span className="flex items-center gap-2"> <span className="flex items-center gap-2">
{option.icon ? <option.icon className="size-4" /> : null} {option.icon ? <option.icon className="size-3.5" /> : null}
<span>{t(option.labelKey)}</span> <span>{t(option.labelKey)}</span>
<RdxBadge <RdxBadge
className={cn( className={cn(
@ -153,8 +143,7 @@ export const ProformaStatusSegmentedFilter = ({
</RdxBadge> </RdxBadge>
</span> </span>
</ToggleGroupItem> </ToggleGroupItem>
); ))}
})}
</ToggleGroup> </ToggleGroup>
); );
}; };

View File

@ -1,11 +1,6 @@
import { PageErrorState, SimpleSearchInput } from "@erp/core/components"; import { PageErrorState, SimpleSearchInput } from "@erp/core/components";
import { useDataSource, useReturnToNavigation } from "@erp/core/hooks"; import { useDataSource, useReturnToNavigation } from "@erp/core/hooks";
import { import { type DataTableMeta, RdxPageContainer } from "@repo/rdx-ui/components";
type DataTableMeta,
RdxPageContainer,
RdxPageContent,
RdxPageFrame,
} from "@repo/rdx-ui/components";
import { showErrorToast, showSuccessToast } from "@repo/rdx-ui/helpers"; import { showErrorToast, showSuccessToast } from "@repo/rdx-ui/helpers";
import { import {
Button, Button,
@ -463,9 +458,8 @@ const ScopedListProformasPage = ({ scope }: ScopedListProformasPageProps) => {
if (pageError) { if (pageError) {
return ( return (
<RdxPageFrame> <RdxPageContainer width="full">
<RdxPageContainer width="content"> <div className="mx-auto w-full max-w-3xl">
<RdxPageContent>
<PageErrorState <PageErrorState
description={pageError.description} description={pageError.description}
primaryAction={ primaryAction={
@ -486,9 +480,8 @@ const ScopedListProformasPage = ({ scope }: ScopedListProformasPageProps) => {
title={pageError.title} title={pageError.title}
variant={pageError.variant} variant={pageError.variant}
/> />
</RdxPageContent> </div>
</RdxPageContainer> </RdxPageContainer>
</RdxPageFrame>
); );
} }

View File

@ -46,9 +46,9 @@ export const ScopedListProformasPageView = ({
{content} {content}
</RdxPageContent> </RdxPageContent>
</RdxPageContainer>
{dialogs} {dialogs}
</RdxPageContainer>
</RdxPageFrame> </RdxPageFrame>
); );
}; };

View File

@ -4,8 +4,6 @@ import {
DataTableColumnHeader, DataTableColumnHeader,
RdxBadge, RdxBadge,
RdxPageContainer, RdxPageContainer,
RdxPageContent,
RdxPageFrame,
type RdxRowAction, type RdxRowAction,
RdxRowActions, RdxRowActions,
SkeletonDataTable, SkeletonDataTable,
@ -269,9 +267,8 @@ export const ListRecurringProformasPage = () => {
if (hasBlockingError && pageError) { if (hasBlockingError && pageError) {
return ( return (
<RdxPageFrame> <RdxPageContainer width="full">
<RdxPageContainer width="content"> <div className="mx-auto w-full max-w-3xl">
<RdxPageContent>
<PageErrorState <PageErrorState
description={pageError.description} description={pageError.description}
primaryAction={{ primaryAction={{
@ -282,9 +279,8 @@ export const ListRecurringProformasPage = () => {
title={pageError.title} title={pageError.title}
variant="unknown" variant="unknown"
/> />
</RdxPageContent> </div>
</RdxPageContainer> </RdxPageContainer>
</RdxPageFrame>
); );
} }

View File

@ -46,9 +46,9 @@ export const ListCustomersPageView = ({
{content} {content}
</RdxPageContent> </RdxPageContent>
</RdxPageContainer>
{dialogs} {dialogs}
</RdxPageContainer>
</RdxPageFrame> </RdxPageFrame>
); );
}; };

View File

@ -1,6 +1,6 @@
import { PageErrorState, SimpleSearchInput } from "@erp/core/components"; import { PageErrorState, SimpleSearchInput } from "@erp/core/components";
import { useReturnToNavigation } from "@erp/core/hooks"; import { useReturnToNavigation } from "@erp/core/hooks";
import { RdxPageContainer, RdxPageContent, RdxPageFrame } from "@repo/rdx-ui/components"; import { RdxPageContainer, RdxPageFrame } from "@repo/rdx-ui/components";
import { import {
Button, Button,
ResizableHandle, ResizableHandle,
@ -93,7 +93,6 @@ export const ListCustomersPage = () => {
return ( return (
<RdxPageFrame> <RdxPageFrame>
<RdxPageContainer width="content"> <RdxPageContainer width="content">
<RdxPageContent>
<PageErrorState <PageErrorState
description={pageError.description} description={pageError.description}
primaryAction={ primaryAction={
@ -112,7 +111,6 @@ export const ListCustomersPage = () => {
title={pageError.title} title={pageError.title}
variant={pageError.variant} variant={pageError.variant}
/> />
</RdxPageContent>
</RdxPageContainer> </RdxPageContainer>
</RdxPageFrame> </RdxPageFrame>
); );

View File

@ -39,7 +39,6 @@ export const SuppliersListPage = () => {
return ( return (
<RdxPageFrame> <RdxPageFrame>
<RdxPageContainer width="content"> <RdxPageContainer width="content">
<RdxPageContent>
<PageErrorState <PageErrorState
description={t("list.error.description")} description={t("list.error.description")}
primaryAction={{ primaryAction={{
@ -51,7 +50,6 @@ export const SuppliersListPage = () => {
title={t("list.error.title")} title={t("list.error.title")}
variant="unknown" variant="unknown"
/> />
</RdxPageContent>
</RdxPageContainer> </RdxPageContainer>
</RdxPageFrame> </RdxPageFrame>
); );