import React, { useId } from "react"; import { filterAttrs } from "@arc-ui/community-utils/filter-attrs"; import { Heading, type HeadingProps, type HeadingLevel, } from "@arc-ui/components/Heading"; import { Text } from "@arc-ui/components/Text"; import { Rule } from "@arc-ui/components/Rule"; import { VerticalSpace, type VerticalSpaceProps, } from "@arc-ui/components/VerticalSpace"; import { Columns, ColumnsCol } from "@arc-ui/components/Columns"; import { PartnerLogoSubgroup, type PartnerLogosSubgroup, } from "./components/PartnerLogoSubgroup"; import styles from "./PartnerBrandLogos.module.css"; export type { LogoTileItem, PartnerLogosSubgroup, } from "./components/PartnerLogoSubgroup"; const getSubheadingLevel = ( parentLevel: HeadingLevel, subLevel?: HeadingLevel, ): HeadingLevel => subLevel ?? (String(Math.min(Number(parentLevel) + 1, 6)) as HeadingLevel); export const PartnerBrandLogos: React.FC = ({ heading, headingProps, headingLevel = "2", content, id, rulerTopPadding = { size: "32" }, rulerBottomPadding = { size: "32" }, subgroups, ...props }) => { const componentId = useId(); const { size: headingSize = "l", isResponsive: headingIsResponsive = true, ...restHeadingProps } = headingProps ?? {}; return (
{heading} {content && ( <> {content .split(/\\n|\n/) .filter((p) => p.trim()) .map((paragraph, i) => ( {i > 0 && } {paragraph} ))} )}
    {subgroups.map((subgroup, i) => (
  • ))}
); }; /** * Props for the `PartnerBrandLogos` page section component. Renders a heading, * optional content, a padded ruler, and a list of partner logo subgroups. */ export interface PartnerBrandLogosProps { /** Main section heading text. */ heading: string; /** * Additional Arc Heading properties (e.g. `size`, `fontStyle`, `color`, * `isWordWrap`, `casing`, `isResponsive`). Defaults to size "l", responsive. */ headingProps?: Omit; /** * Semantic heading level for the main heading. Subgroup headings are * automatically derived relative to this value. * @default "2" */ headingLevel?: HeadingLevel; /** Supporting content text below the heading. Supports paragraph breaks via `\n`. */ content?: string; /** HTML `id` attribute applied to the main heading element. */ id?: string; /** * Vertical padding above the ruler. Accepts all VerticalSpace props. * @default { size: "32" } */ rulerTopPadding?: VerticalSpaceProps; /** * Vertical padding below the ruler. Accepts all VerticalSpace props. * @default { size: "32" } */ rulerBottomPadding?: VerticalSpaceProps; /** Array of partner logo subgroups. */ subgroups: PartnerLogosSubgroup[]; }