{"version":3,"file":"button.types.mjs","names":[],"sources":["../../../../package/common/button/button.types.ts"],"sourcesContent":["import type React from 'react';\nimport type { CSSProperties } from 'react';\nimport type { IconContent } from '../types/icon.types';\nimport type { SlotClassNames, SlotStyles, DataProps } from '../types/slots.types';\nimport type { ColorValue } from '../themeProvider/color.types';\n\n/** How much the button stands out. Independent of its colour. */\nexport enum ButtonStyleType {\n  /** Solid fill, for the one main action. */\n  Filled = 'filled',\n  /** A light tint of the colour behind text in the colour. */\n  Light = 'light',\n  /** Border and text in the colour, no fill. The default. */\n  Outlined = 'outlined',\n  /** Text in the colour, no fill and no border. For toolbar, icon and close buttons. */\n  Plain = 'plain',\n}\n\nexport enum ButtonSize {\n  Small = 'small',\n  /** The default. */\n  Medium = 'medium',\n  Large = 'large',\n  /** Square, padding-free button for a lone icon. Give it its own width/height. */\n  Icon = 'icon',\n}\n\nexport enum ButtonType {\n  Button = 'button',\n  Reset = 'reset',\n  Submit = 'submit',\n}\n\nexport type ButtonSlots = 'background' | 'content' | 'loadingContainer' | 'label' | 'shortcut';\n\ninterface ButtonOwnProps extends DataProps {\n  className?: string;\n  style?: CSSProperties;\n  /** Emphasis: `Filled`, `Light`, `Outlined` (default) or `Plain`. */\n  styleType?: ButtonStyleType;\n  /** A `ThemeColor` (default `Primary`) or any CSS colour, such as `'var(--brand)'`. */\n  color?: ColorValue;\n  size?: ButtonSize;\n  children?: React.ReactNode;\n  icon?: IconContent;\n  /**\n   * A shortcut drawn after the label, in `useHotkeys` spelling (`'mod+s'`): `⌘S` on Apple\n   * platforms, `Ctrl+S` elsewhere. Drawn only; bind it with `useHotkeys`.\n   */\n  shortcut?: string;\n  isLoading?: boolean;\n  disabled?: boolean;\n  title?: string;\n  classNames?: SlotClassNames<ButtonSlots>;\n  styles?: SlotStyles<ButtonSlots>;\n}\n\n/**\n * A Button without `href`, a `<button>`. `DataProps` supplies the `data-*` index signature, which\n * `ButtonHTMLAttributes` doesn't cover. `type` and `onClick` narrow their native counterparts.\n */\nexport interface ButtonElementProps\n  extends\n    ButtonOwnProps,\n    Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof ButtonOwnProps | 'type' | 'onClick'> {\n  href?: undefined;\n  type?: ButtonType;\n  onClick?: (event: React.MouseEvent<HTMLButtonElement>) => Promise<void> | void;\n  ref?: React.Ref<HTMLButtonElement>;\n}\n\n/** A Button with `href`, an `<a>`: `target`, `rel` and `download` are the native ones. */\nexport interface ButtonLinkProps\n  extends\n    ButtonOwnProps,\n    Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, keyof ButtonOwnProps | 'type' | 'onClick' | 'href'> {\n  /**\n   * Renders the button as a link, so a long press, Ctrl/⌘-click and a middle click work as on any\n   * other: `tel:`, `mailto:`, a maps URL, a page of the app. A plain click on a page of the app goes\n   * through `ConfigProvider`'s `navigate` when it is set.\n   */\n  href: string;\n  type?: undefined;\n  onClick?: (event: React.MouseEvent<HTMLAnchorElement>) => Promise<void> | void;\n  ref?: React.Ref<HTMLAnchorElement>;\n}\n\nexport type ButtonProps = ButtonElementProps | ButtonLinkProps;\n"],"mappings":"aAOA,IAAY,EAAL,SAAA,EAAA,OAEL,GAAA,OAAA,SAEA,EAAA,MAAA,QAEA,EAAA,SAAA,WAEA,EAAA,MAAA,SACF,EAAA,CAAA,CAAA,EAEY,EAAL,SAAA,EAAA,OACL,GAAA,MAAA,QAEA,EAAA,OAAA,SACA,EAAA,MAAA,QAEA,EAAA,KAAA,QACF,EAAA,CAAA,CAAA,EAEY,EAAL,SAAA,EAAA,OACL,GAAA,OAAA,SACA,EAAA,MAAA,QACA,EAAA,OAAA,UACF,EAAA,CAAA,CAAA"}