Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ v2 is a full rewrite of the library's foundation. The styling stack (MUI + style
- **`PageWithAuth`**: `createNavbarContext` prop removed (cascading from `Page`).
- **`useNavbar()`**: `setSearchFuncion` typo corrected to `setSearchFunction`. `setSideMenuLinks` and `setSearchFunction` now have proper types (`SideMenuLink[]` and `(s: string) => void`) instead of `any`.
- **`Navbar`**: `searchDropdownLabelsList` prop removed (was declared but never consumed). `IconComponent` prop now typed as `ComponentType<{ className?: string }>`.
- **`Footer`**: hard-coded hex colors replaced with design token CSS vars (`bg-cinnamon-footer-bg`, `bg-cinnamon-footer-bar`). `phoneToTel()` helper moved to `src/lib/utils.ts`.
- **`Footer`**: hard-coded hex colors replaced with design token CSS vars (`bg-cinnamon-footer-bg`, `bg-cinnamon-footer-bar`). `phoneToTel()` helper moved to `src/lib/utils.ts`. `copyrightText` is a prop again, with v1's semantics: the bottom-bar line renders when it is passed and is omitted when it is not. The rewrite had hard-coded the string, which the README already documented as configurable.
- **`SideMenu`** — **BREAKING vs v1**: the component was rewritten. The public prop contract is unchanged (`links: SideMenuLink[]`, `top`, `visibility`, `setVisibility`, `linkComponent`), so v1 call sites compile as-is, but the rendering changed: the open drawer now carries an animated accent rail (see _Added_) and pulls in `motion` as a runtime dependency. Consumers that vendored their own copy of the v1 `SideMenu` styles, or relied on the exact prior DOM structure, must revalidate. New optional `activeHref` prop (see _Added_).
- **`IconRenderer` → `Icon`** — **BREAKING**: the component `IconRenderer` and its `IconRendererProps` type were renamed to `Icon` / `IconProps`. `IconComponent` prop now typed as `ComponentType<{ className?: string }>` (was `any`).
- **`ErrorScreen`**: `enum httpErrors` replaced with `const httpErrors as const` + type alias — no runtime JS emitted; same call-site syntax (`httpErrors.NOTFOUND_404`) preserved. Unknown error types now render a generic fallback instead of returning `null`.
Expand Down
2 changes: 1 addition & 1 deletion examples/nextjs15-demo/app/client-page/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default function ClientPage() {
},
],
}}
footer={{}}
footer={{ copyrightText: "CIn UFPE | Todos os direitos reservados" }}
>
<div style={{ padding: "1rem 2rem", background: "#eff6ff", borderBottom: "1px solid #bfdbfe" }}>
<h1 style={{ fontFamily: "system-ui, sans-serif" }}>
Expand Down
2 changes: 1 addition & 1 deletion examples/nextjs15-demo/app/graficos/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default async function GraficosPage() {
permittedRoles: ["admin"],
onUnauthenticated: () => redirect("/login"),
}}
footer={{}}
footer={{ copyrightText: "CIn UFPE | Todos os direitos reservados" }}
// Navbar client com o auth real do Keycloak (o PageServer padrão não tem OidcAuthLike no server).
components={{ navbar: <NavbarClientWrapper session={session} title="Gráficos & Métricas" /> }}
>
Expand Down
2 changes: 1 addition & 1 deletion examples/nextjs15-demo/app/interativo/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export default async function InterativoPage() {
<div style={{ background: "#2563eb", color: "#ffffff", padding: "2px 10px", fontSize: "10px", fontWeight: 700 }}>
🔵 CLIENT COMPONENT: Cinnamon Footer
</div>
<Footer variant="cin" appVersion="0.1.0" />
<Footer variant="cin" appVersion="0.1.0" copyrightText="CIn UFPE | Todos os direitos reservados" />
</div>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion examples/nextjs15-demo/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ export default async function HomePage() {
</ClientBoundary>
</main>

<Footer appVersion="0.1.0" />
<Footer appVersion="0.1.0" copyrightText="CIn UFPE | Todos os direitos reservados" />
</div>
);
}
4 changes: 2 additions & 2 deletions examples/nextjs15-demo/app/server-entry/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default async function ServerEntryPage() {
onUnauthenticated: () => redirect("/login"),
}}
navbar={{ title: "Área autenticada (server)", hiddenUser: true }}
footer={{}}
footer={{ copyrightText: "CIn UFPE | Todos os direitos reservados" }}
>
<p style={{ padding: "1rem" }}>
Conteúdo renderizado no servidor para usuário autenticado. <RenderProbe label="conteúdo" />
Expand All @@ -58,7 +58,7 @@ export default async function ServerEntryPage() {
onUnauthenticated: () => redirect("/login"),
}}
navbar={{ title: "Área admin (server)", hiddenUser: true }}
footer={{}}
footer={{ copyrightText: "CIn UFPE | Todos os direitos reservados" }}
>
<p style={{ padding: "1rem" }}>Visível apenas para admin.</p>
</PageWithAuthServer>
Expand Down
2 changes: 1 addition & 1 deletion examples/nextjs15-demo/app/server-import-client/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default function ServerImportClientPage() {
</section>
</main>

<Footer largeFooter={false} />
<Footer largeFooter={false} copyrightText="CIn UFPE | Todos os direitos reservados" />
</div>
);
}
14 changes: 11 additions & 3 deletions src/lib-components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@
linkColumns?: FooterLinkColumn[];
/** Social row under the brand block. */
socialLinks?: FooterSocialLink[];
/**
* Line in the bottom bar, rendered after the copyright symbol and the
* current year. The line is omitted when this is absent.
*/
copyrightText?: string;
/** Consuming app version, shown next to the Cinnamon version. */
appVersion?: string;
/** Render the brand/support area. When false, only the bottom bar shows. */
Expand Down Expand Up @@ -236,20 +241,21 @@
cin: CIN_PRESET,
};

export function Footer({
variant = "cincoders",
logoUrl,
logoAlt,
logoClassName,
description,
contact,
contactPlacement,
support,
linkColumns,
socialLinks,
copyrightText,
appVersion,
largeFooter = true,
}: FooterProps) {

Check warning on line 258 in src/lib-components/Footer/Footer.tsx

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Mark the props of the component as read-only.

See more on https://sonarcloud.io/project/issues?id=CinCoders_cinnamon&issues=AaCSUVFRDjwnR7299_Qq&open=AaCSUVFRDjwnR7299_Qq&pullRequest=113
const preset = PRESETS[variant];
const styles = footer();

Expand Down Expand Up @@ -422,9 +428,11 @@

<div className={styles.strip()}>
<div className={styles.bar()}>
<span>
© {new Date().getFullYear()} CIn UFPE | Todos os direitos reservados
</span>
{copyrightText && (
<span>
© {new Date().getFullYear()} {copyrightText}
</span>
)}

<span className="flex flex-wrap items-center justify-center gap-x-4 gap-y-1">
<span className="text-cinnamon-primary">
Expand Down
6 changes: 6 additions & 0 deletions src/stories/Footer.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const meta = {
parameters: { docs: { page: null }, layout: "fullscreen" },
args: {
appVersion: "2.2.2",
copyrightText: "CIn UFPE | Todos os direitos reservados",
},
} satisfies Meta<typeof Footer>;

Expand Down Expand Up @@ -46,6 +47,11 @@ export const NoSupport: Story = {
args: { variant: "cin", support: null },
};

/** The bottom-bar line is configurable. Pass `null` to drop it entirely. */
export const CustomCopyright: Story = {
args: { copyrightText: "CIn UFPE | All rights reserved" },
};

export const Compact: Story = {
args: { largeFooter: false },
};
2 changes: 1 addition & 1 deletion src/stories/Page.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const meta: Meta<PageStoryArgs> = {
footerSupportTitle: "Suporte Técnico",
footerTelephone: "(81) 2126-8430",
footerEmail: "helpdesk@cin.ufpe.br",
footerCopyrightText: "CIn UFPE | All rights reserved",
footerCopyrightText: "CIn UFPE | Todos os direitos reservados",
footerAppVersion: "1.4.0",
},
};
Expand Down