{"version":3,"file":"ModalHeader.types.cjs","sourceRoot":"","sources":["../../../src/components/ModalHeader/ModalHeader.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ReactNode } from 'react';\n\nimport type { ButtonIconProps } from '../ButtonIcon';\n\n/**\n * Props accepted by the auto-rendered back / close `ButtonIcon`. The\n * component owns `iconName` (ArrowLeft / Close) and `size`\n * (ButtonIconSize.Md), so consumers cannot override them. The `data-*` index\n * signature lets test ids and other dataset attributes pass through\n * `Partial`/`Omit` indirection.\n *\n * `ariaLabel` is preserved as **required** (it is required on\n * `ButtonIconProps`). The component does not pull from any i18n context, so\n * consumers must pass a localized label explicitly:\n *\n * ```tsx\n * closeButtonProps={{ ariaLabel: t('close') }}\n * ```\n */\ntype ModalHeaderButtonProps = Omit<\n  ButtonIconProps,\n  'iconName' | 'size' | 'onClick'\n> & {\n  [key: `data-${string}`]: string | undefined;\n};\n\n/**\n * Discriminated pair: `onBack` and `backButtonProps` are co-required. If\n * `onBack` is set, the consumer must also provide `backButtonProps` with a\n * (required) `ariaLabel`. This enforces the no-i18n-fallback contract at\n * compile time without an internal English default.\n */\ntype ModalHeaderBackProps =\n  | { onBack?: undefined; backButtonProps?: undefined }\n  | { onBack: () => void; backButtonProps: ModalHeaderButtonProps };\n\n/**\n * Discriminated pair: `onClose` and `closeButtonProps` are co-required. Same\n * shape and rationale as `ModalHeaderBackProps`.\n */\ntype ModalHeaderCloseProps =\n  | { onClose?: undefined; closeButtonProps?: undefined }\n  | { onClose: () => void; closeButtonProps: ModalHeaderButtonProps };\n\nexport type ModalHeaderProps = Omit<ComponentProps<'header'>, 'children'> &\n  ModalHeaderBackProps &\n  ModalHeaderCloseProps & {\n    /**\n     * Header title content. When a string, it is auto-wrapped in a\n     * `Text` with `TextVariant.HeadingSm` and `TextAlign.Center`. When a\n     * `ReactNode`, it is rendered as-is.\n     */\n    children?: ReactNode;\n    /**\n     * Optional override for the start (left in LTR) slot. When provided, it\n     * replaces the auto-rendered back button — even if `onBack` is set.\n     */\n    startAccessory?: ReactNode;\n    /**\n     * Optional override for the end (right in LTR) slot. When provided, it\n     * replaces the auto-rendered close button — even if `onClose` is set.\n     */\n    endAccessory?: ReactNode;\n    /**\n     * Optional prop for additional CSS classes to be applied to the\n     * ModalHeader root. Merged with the component's defaults via `twMerge`.\n     */\n    className?: string;\n  };\n"]}