import type { Styles } from '@cleartrip/ct-design-types'; export interface IAccordionStyleConfig { /** * Styles for the outermost accordion root. */ root?: Styles[]; /** * Styles for the clickable label row that holds `label` and the expand icon. */ label?: Styles[]; /** * Styles for the (animated) icon wrapper. On native this receives the * rotation animated style internally; overrides merge on top of it. */ icon?: Styles[]; /** * Styles for the container that wraps the collapsible children. */ childrenContainer?: Styles[]; } export interface IAccordionProps { /** * @default false * @description Disables interaction with the accordion. */ disabled?: boolean; /** * @default false * @description Whether the accordion is currently expanded. */ expanded?: boolean; /** * The accordion header/label content (always visible). */ label: React.ReactNode; /** * Click handler fired when the label row is tapped. On web it receives the * click event. Not fired when `disabled` is true. */ onClick?: () => void; /** * Collapsible content that is revealed when `expanded` is true. */ children: React.ReactNode; /** * Optional indicative icon rendered next to the label; rotated 180° when * the accordion is expanded. */ expandIcon?: React.ReactNode; /** * Style configuration overrides for each internal container. */ styleConfig?: IAccordionStyleConfig; /** * @default false * @description Internal flag used by AccordionGroup — should not be set by consumers. */ isWrappedInAccordionGroup?: boolean; /** * Internal callback used by AccordionGroup when an item is toggled — should * not be supplied by consumers. */ onAccordionGroupClick?: () => void; } /** * @deprecated Kept for backward compatibility; prefer `IAccordionProps`. */ export type IAccordion = IAccordionProps; export interface IAccordionIconProps { styleConfig?: { root?: Styles[]; }; children?: React.ReactNode; } export interface IAccordionContentProps { styleConfig?: { root?: Styles[]; }; children: React.ReactNode; }