import { KdsIconName } from '../accessories/Icon/types';
import { KdsSize } from '../types';
import { kdsButtonVariants, kdsToggleButtonVariants } from './constants';
export type KdsButtonVariant = (typeof kdsButtonVariants)[number];
export type KdsToggleButtonVariant = (typeof kdsToggleButtonVariants)[number];
/**
 * Properties common to all button components
 */
type CommonProps = {
    size?: KdsSize;
    disabled?: boolean;
    title?: string;
};
/**
 * Helper types
 */
type LabelAndIcons = {
    label: string;
    leadingIcon?: KdsIconName;
    trailingIcon?: KdsIconName;
    ariaLabel?: never;
};
type LeadingIconOnly = {
    label?: never;
    leadingIcon: KdsIconName;
    trailingIcon?: never;
    ariaLabel: string;
};
/**
 * Composable button types
 */
type WithVariant<TVariant> = {
    variant: TVariant;
};
type WithLabelAndIcons = LabelAndIcons | LeadingIconOnly;
type WithDestructive = {
    /**
     * If set to true, the button will prominently warn the user of a destructive action.
     */
    destructive?: boolean;
};
type WithSuccess = {
    /**
     * If set to true, the button will be styled as a success/positive action.
     */
    success?: boolean;
};
type WithError = {
    /**
     * If set to true, the button will be styled as an error/negative action.
     */
    error?: boolean;
};
export type WithRouterNavigation = {
    /**
     * Route Location the link should navigate to when clicked on; passed to RouterLink/NuxtLink component if globally available
     */
    to: string | Record<string, unknown>;
};
export type WithAnchorElementAttributes = {
    /**
     * If set to true, the link will be downloaded instead of navigating to it.
     */
    download?: boolean;
    /**
     * Where to display the linked URL, as the name for a browsing context.
     */
    target?: "_blank" | "_parent" | "_self" | "_top" | string | null;
    /**
     * A rel attribute value to apply on the link. In Nuxt, defaults to "noopener noreferrer" for external links.
     */
    rel?: "noopener" | "noreferrer" | "nofollow" | "sponsored" | "ugc" | string | null;
};
type WithToggled = {
    /**
     * Represents the button's toggled state
     */
    toggled?: boolean;
};
/**
 * Prefixed versions of composable types for use in composite components
 * Pre-computed here to avoid Vue SFC compiler issues with mapped types
 */
type PrefixedCommonProps = {
    buttonSize?: CommonProps["size"];
    buttonDisabled?: CommonProps["disabled"];
    buttonTitle?: CommonProps["title"];
};
type PrefixedLabelAndIcons = {
    buttonLabel: string;
    buttonLeadingIcon?: LabelAndIcons["leadingIcon"];
    buttonTrailingIcon?: LabelAndIcons["trailingIcon"];
    buttonAriaLabel?: never;
};
type PrefixedLeadingIconOnly = {
    buttonLabel?: never;
    buttonLeadingIcon: LeadingIconOnly["leadingIcon"];
    buttonTrailingIcon?: never;
    buttonAriaLabel: string;
};
type PrefixedWithLabelAndIcons = PrefixedLabelAndIcons | PrefixedLeadingIconOnly;
type PrefixedWithVariant = {
    buttonVariant?: KdsButtonVariant;
};
type PrefixedWithDestructive = {
    buttonDestructive?: WithDestructive["destructive"];
};
type PrefixedWithRouterNavigation = {
    buttonTo: WithRouterNavigation["to"];
};
type PrefixedWithAnchorElementAttributes = {
    buttonDownload?: WithAnchorElementAttributes["download"];
    buttonTarget?: WithAnchorElementAttributes["target"];
    buttonRel?: WithAnchorElementAttributes["rel"];
};
/**
 * Type for BaseButton component which supports all behaviors
 */
export type BaseButtonProps = CommonProps & WithVariant<KdsButtonVariant> & WithLabelAndIcons & WithDestructive & WithSuccess & WithError & WithToggled;
/**
 * Component types
 */
export type KdsButtonProps = CommonProps & Partial<WithVariant<KdsButtonVariant>> & WithLabelAndIcons & WithDestructive;
export type KdsLinkButtonProps = CommonProps & Partial<WithVariant<KdsButtonVariant>> & WithLabelAndIcons & WithDestructive & WithRouterNavigation & WithAnchorElementAttributes;
export type KdsToggleButtonProps = CommonProps & Partial<WithVariant<KdsToggleButtonVariant>> & WithLabelAndIcons;
export type KdsVariableToggleButtonProps = KdsInfoToggleButtonProps & {
    /**
     * If set to true, indicates that an input flow variable is configured.
     */
    inSet?: boolean;
    /**
     * If set to true, indicates that an output flow variable is configured.
     */
    outSet?: boolean;
    /**
     * If set to true, the button indicates an error state.
     */
    error?: boolean;
};
export type KdsInfoToggleButtonProps = {
    disabled?: boolean;
    /**
     * If set to true, the button is visible even when not focused.
     */
    hidden?: boolean;
};
/**
 * Progress button types
 */
export type KdsProgressButtonState = "default" | "progress" | "success" | "error";
type KdsProgressButtonCommonProps = {
    size?: KdsSize;
    variant?: KdsButtonVariant;
    disabled?: boolean;
};
type KdsProgressButtonIconWithLabel = {
    label: string;
    leadingIcon: KdsIconName;
    ariaLabel?: never;
};
type KdsProgressButtonIconOnly = {
    label?: never;
    leadingIcon: KdsIconName;
    ariaLabel: string;
};
export type KdsProgressButtonProps = KdsProgressButtonCommonProps & (KdsProgressButtonIconWithLabel | KdsProgressButtonIconOnly);
/**
 * Prefixed component types for use in composite components
 * Pre-computed here to avoid Vue SFC compiler issues with mapped types
 */
export type PrefixedKdsButtonProps = PrefixedCommonProps & PrefixedWithVariant & PrefixedWithLabelAndIcons & PrefixedWithDestructive;
export type PrefixedKdsLinkButtonProps = PrefixedCommonProps & PrefixedWithVariant & PrefixedWithLabelAndIcons & PrefixedWithDestructive & PrefixedWithRouterNavigation & PrefixedWithAnchorElementAttributes;
/**
 * Helper types for excluding button props in composite components
 * These represent the negation of prefixed button props
 */
export type PrefixedButtonPropsAsNever = {
    buttonLabel?: never;
    buttonLeadingIcon?: never;
    buttonTrailingIcon?: never;
    buttonAriaLabel?: never;
    buttonSize?: never;
    buttonDisabled?: never;
    buttonTitle?: never;
    buttonVariant?: never;
    buttonDestructive?: never;
    buttonTo?: never;
    buttonDownload?: never;
    buttonTarget?: never;
    buttonRel?: never;
};
export type PrefixedAnchorAttributesAsNever = {
    buttonDownload?: never;
    buttonTarget?: never;
    buttonRel?: never;
};
export type PrefixedRouterNavigationAsNever = {
    buttonTo?: never;
};
export {};
//# sourceMappingURL=types.d.ts.map