import React from "react"; import { useMediaQuery } from "@arc-ui/components/use-media-query"; import { ButtonV2, type ButtonV2Props } from "@arc-ui/components/ButtonV2"; import { VerticalSpace } from "@arc-ui/components/VerticalSpace"; import { BtIconArrowRightFill } from "@arc-ui/icons/BtIconArrowRightFill"; import { SectionHeading, type SectionHeadingProps } from "../SectionHeading"; import { HighlightList } from "./components/HighlightList/HighlightList"; import { type HighlightListItem } from "./types"; import { filterAttrs } from "@arc-ui/community-utils/filter-attrs"; /** * Use `Highlights` to give supporting information about a page or proposition. I * t can be used to call out key benefits in bullet points, or link. * Both two and three column options are available. */ export const Highlights: React.FC = ({ heading, headingLevel, id, isHeadingWordWrap, content, listItems, columns = "2", cta, ...props }) => { const isMaxWidthArcBreakpointXs = useMediaQuery("(max-width: 767px)"); return (
{cta && ( <> )}
); }; export interface HighlightsProps extends Omit { /** * List items for `Highlights`. * List length should be a minimum of 2 and a maximum of 6. */ listItems: HighlightListItem[]; /** * Number of columns for option desktop & tablet breakpoints only. */ columns?: "2" | "3"; /** * Optional CTA rendered at the end of Highlights. * Only ONE CTA is allowed. */ cta?: HighlightsCTAProps; } /** * CTA configuration for Highlights */ export type HighlightsCTAProps = Pick< ButtonV2Props, "label" | "href" | "onClick" | "iconPosition" | "ariaLabel" | "target" > & { /** * Allowed button styles only. * Primary is intentionally NOT supported. */ buttonStyle: "secondary" | "compact"; /** * Icon override & Active icon override * - undefined → uses default BtIconArrowRightFill for compact style * - null → icon disabled * - string → custom icon */ icon?: string | null; iconActive?: string | null; };