{"version":3,"file":"PopoverHeader.types.cjs","sourceRoot":"","sources":["../../../src/components/PopoverHeader/PopoverHeader.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.Sm), 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 PopoverHeaderButtonProps = 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 PopoverHeaderBackProps =\n  | { onBack?: undefined; backButtonProps?: undefined }\n  | { onBack: () => void; backButtonProps: PopoverHeaderButtonProps };\n\n/**\n * Discriminated pair: `onClose` and `closeButtonProps` are co-required. Same\n * shape and rationale as `PopoverHeaderBackProps`.\n */\ntype PopoverHeaderCloseProps =\n  | { onClose?: undefined; closeButtonProps?: undefined }\n  | { onClose: () => void; closeButtonProps: PopoverHeaderButtonProps };\n\nexport type PopoverHeaderProps = Omit<ComponentProps<'header'>, 'children'> &\n  PopoverHeaderBackProps &\n  PopoverHeaderCloseProps & {\n    /**\n     * Header title content. When a string, it is auto-wrapped in a\n     * `Text` with `TextVariant.HeadingSm`, `TextAlign.Center`, and\n     * `TextColor.Inherit` so the title picks up the popover surface color.\n     * When a `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 override for additional CSS classes applied to the\n     * PopoverHeader root. Merged with the component's defaults via `twMerge`.\n     */\n    className?: string;\n  };\n"]}