diff --git a/packages/ui/src/layout/OpenFooter.tsx b/packages/ui/src/layout/OpenFooter.tsx index 842876b..cf3d08c 100644 --- a/packages/ui/src/layout/OpenFooter.tsx +++ b/packages/ui/src/layout/OpenFooter.tsx @@ -2,15 +2,6 @@ import type { ComponentProps, ReactNode } from 'react'; import { cn } from '../utils/cn.js'; -export interface OpenFooterSocial { - /** Target href. */ - href: string; - /** Icon element (typically an inline SVG or lucide icon). */ - icon: ReactNode; - /** Accessible label for the link. */ - label: string; -} - export interface OpenFooterBrand { /** URL the logo + wordmark link to. */ href: string; @@ -23,28 +14,32 @@ export interface OpenFooterBrand { export interface OpenFooterProps extends Omit, 'children'> { /** "Maintained by" brand block on the left. */ brand: OpenFooterBrand; - /** Disclaimer / legal paragraph rendered at the bottom. */ - disclaimer: ReactNode; + /** GitHub repository URL (rendered as a social icon). */ + githubUrl: string; /** "Maintained by" label. Default: "Mantido por". */ maintainedByLabel?: ReactNode; - /** Social links rendered on the right as round icon buttons. */ - socials?: OpenFooterSocial[]; + /** + * Optional npm package or org URL (rendered as a social icon when set). + * Omit for projects that don't publish to npm yet. + */ + npmUrl?: string; } /** * Footer for the OSS sites (fhir-brasil, medbench-brasil, datasus-brasil). * - * Layout: "Mantido por " on the left + social icon row on the - * right, with a thin divider + full-width disclaimer paragraph below. - * All copy is consumer-provided — the component ships the structure, - * typography and spacing conventions only. + * Layout: "Mantido por " on the left + GitHub (and optional npm) + * social icons on the right, with a thin divider + a shared medical + * disclaimer paragraph below. Icons and disclaimer are intentionally + * baked in — they're identical across the OSS sites — so consumers only + * supply their brand and the per-project repo / npm URLs. */ export function OpenFooter({ brand, className, - disclaimer, + githubUrl, maintainedByLabel = 'Mantido por', - socials, + npmUrl, ...props }: OpenFooterProps) { return ( @@ -81,29 +76,64 @@ export function OpenFooter({ - {socials && socials.length > 0 ? ( - - ) : null} +

- {disclaimer} + {DISCLAIMER}

); } + +function SocialLink({ + children, + href, + label, +}: { + children: ReactNode; + href: string; + label: string; +}) { + return ( + + {children} + + ); +} + +function GitHubIcon() { + return ( + + ); +} + +function NpmIcon() { + return ( + + ); +} + +const DISCLAIMER = + 'Este software é fornecido exclusivamente para fins informativos, de pesquisa e educacionais. Não constitui aconselhamento médico, diagnóstico ou recomendação de tratamento. Os resultados aqui apresentados não substituem a avaliação de um profissional de saúde qualificado. Consulte sempre um profissional de saúde antes de tomar decisões clínicas.'; diff --git a/packages/ui/src/layout/index.ts b/packages/ui/src/layout/index.ts index dc9efff..d0bdcd7 100644 --- a/packages/ui/src/layout/index.ts +++ b/packages/ui/src/layout/index.ts @@ -2,7 +2,7 @@ export type { HeaderProps } from './Header.js'; export { Header } from './Header.js'; export type { MobileDrawerHeader, MobileDrawerItem, MobileDrawerProps } from './MobileDrawer.js'; export { MobileDrawer } from './MobileDrawer.js'; -export type { OpenFooterBrand, OpenFooterProps, OpenFooterSocial } from './OpenFooter.js'; +export type { OpenFooterBrand, OpenFooterProps } from './OpenFooter.js'; export { OpenFooter } from './OpenFooter.js'; export type { PageContainerProps } from './PageContainer.js'; export { PageContainer } from './PageContainer.js';