import { cloneElement, ComponentProps, Fragment, ReactElement, useRef } from 'react'; import useIsParagraph from './BannerSlim/useIsParagraph'; import Box from './Box'; import Button from './Button'; import ButtonLink from './ButtonLink'; import { useDefaultLabelContext } from './contexts/DefaultLabelProvider'; import Flex from './Flex'; import Icon from './Icon'; import IconButton from './IconButton'; import Link from './Link'; import MESSAGING_TYPE_ATTRIBUTES from './MESSAGING_TYPE_ATTRIBUTES'; import Text from './Text'; import useExperimentalTheme from './utils/useExperimentalTheme'; type HelperLinkType = { accessibilityLabel: string; href: string; onClick?: (arg1: { event: React.MouseEvent | React.KeyboardEvent; dangerouslyDisableOnNavigation: () => void; }) => void; target?: null | 'self' | 'blank'; text: string; }; function HelperLink({ accessibilityLabel, href, onClick, target, text }: HelperLinkType) { return ( {text} ); } type PrimaryActionType = | { accessibilityLabel: string; disabled?: boolean; href: string; label: string; onClick?: ComponentProps['onClick']; rel?: 'none' | 'nofollow'; role: 'link'; target?: null | 'self' | 'blank'; isInVRExperiment?: boolean; } | { accessibilityLabel: string; isInVRExperiment?: boolean; disabled?: boolean; label: string; onClick: ComponentProps['onClick']; role?: 'button'; }; function PrimaryAction({ accessibilityLabel, disabled, label, isInVRExperiment, ...props }: PrimaryActionType) { return props.role === 'link' ? ( ) : (