import React from "react"; import clsx from "clsx"; import { Divider } from "../../components/Divider"; import { PageGrid, PageGridRow, PageGridCol } from "../../components/PageGrid"; import { ButtonGroup } from "../ButtonGroup/ButtonGroup"; import type { CarouselFeaturedBackground, CarouselFeaturedProps, CarouselSlide, } from "../CarouselFeatured/CarouselFeatured"; /** * Props for a single panel in the PanelStack component. * Extends CarouselSlide but makes heading optional since PanelStack * can display a single heading above all panels. */ export interface PanelStackPanel extends Omit { /** Optional heading for this specific panel. If omitted, only the component-level heading is shown. */ heading?: string; } /** * Background color options for PanelStack. * Same variants as CarouselFeatured; each adapts to light/dark mode. */ export type PanelStackBackground = CarouselFeaturedBackground; /** * Props for the PanelStack pattern component. * Matches CarouselFeatured, minus carousel-only behavior. */ export interface PanelStackProps extends Omit { /** Array of panels to display. Heading is optional for each panel. */ slides: readonly PanelStackPanel[]; /** Background color variant. Defaults to 'grey'. */ background?: PanelStackBackground; /** Optional heading text displayed above all panels */ heading?: string; /** Optional description text displayed below the heading */ description?: string; } /** * PanelStack Pattern Component * * Statically stacks featured panels vertically using the same two-column * slide layout as CarouselFeatured (image left / content right on desktop; * content top / image bottom on tablet and mobile). There is no carousel * track, navigation, or other interaction. * * @example * ```tsx * * ``` */ export const PanelStack = React.forwardRef( (props, ref) => { const { slides, background = "grey", heading, description, className, children, ...rest } = props; if (slides.length === 0) { console.warn("PanelStack: No slides provided"); return null; } return (
{heading && (

{heading}

{description &&

{description}

}
)} {slides.map((slide, index) => (
{slide.heading && (

{slide.heading}

)}
    {slide.features.map((feature, featureIndex) => (
  • {feature.title}
    {feature.description}
  • ))}
{slide.buttons && slide.buttons.length > 0 && ( )}
{slide.imageAlt}
))} {children}
); }, ); PanelStack.displayName = "PanelStack"; export default PanelStack;