diff --git a/js/dist-typings/admin/components/UploadImageButton.d.ts b/js/dist-typings/admin/components/UploadImageButton.d.ts index 2977bfe02..dfa1de784 100644 --- a/js/dist-typings/admin/components/UploadImageButton.d.ts +++ b/js/dist-typings/admin/components/UploadImageButton.d.ts @@ -1,4 +1,5 @@ -export default class UploadImageButton extends Button { +export default class UploadImageButton extends Button { + constructor(); loading: boolean; /** * Prompt the user to upload an image. diff --git a/js/dist-typings/common/components/Button.d.ts b/js/dist-typings/common/components/Button.d.ts index 22b856af5..897c77a5d 100644 --- a/js/dist-typings/common/components/Button.d.ts +++ b/js/dist-typings/common/components/Button.d.ts @@ -1,29 +1,69 @@ +import type Mithril from 'mithril'; +import Component, { ComponentAttrs } from '../Component'; +export interface IButtonAttrs extends ComponentAttrs { + /** + * Class(es) of an optional icon to be rendered within the button. + * + * If provided, the button will gain a `has-icon` class. + */ + icon?: string; + /** + * Disables button from user input. + * + * Default: `false` + */ + disabled?: boolean; + /** + * Show a loading spinner within the button. + * + * If `true`, also disables the button. + * + * Default: `false` + */ + loading?: boolean; + /** + * **DEPRECATED:** Please use the `aria-label` attribute instead. For tooltips, use + * the `` component. + * + * Accessible text for the button. This should always be present if the button only + * contains an icon. + * + * The textual content of this attribute is passed to the DOM element as `aria-label`. + * + * @deprecated + */ + title?: string | Mithril.ChildArray; + /** + * Accessible text for the button. This should always be present if the button only + * contains an icon. + * + * The textual content of this attribute is passed to the DOM element as `aria-label`. + */ + 'aria-label'?: string | Mithril.ChildArray; + /** + * Button type. + * + * Default: `"button"` + * + * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type + */ + type?: string; +} /** * The `Button` component defines an element which, when clicked, performs an * action. * - * ### Attrs - * - * - `icon` The name of the icon class. If specified, the button will be given a - * 'has-icon' class name. - * - `disabled` Whether or not the button is disabled. If truthy, the button - * will be given a 'disabled' class name, and any `onclick` handler will be - * removed. - * - `loading` Whether or not the button should be in a disabled loading state. - * - * All other attrs will be assigned as attributes on the button element. + * Other attrs will be assigned as attributes on the `