diff --git a/CHANGELOG.md b/CHANGELOG.md index 47d69c563..63c4c2e46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### Changed +- Added `disabled` and `isLoading` props to Button component and removed state prop - Rename `isDisabled` property of input components to `disabled` - Bump `ip` library from 2.0.0 to 2.0.1 diff --git a/src/components/button/button.api.ts b/src/components/button/button.api.ts index 6af84e52b..fdaee5a3a 100644 --- a/src/components/button/button.api.ts +++ b/src/components/button/button.api.ts @@ -5,7 +5,6 @@ import type { IconType } from '../icon'; export type ButtonVariant = 'primary' | 'secondary' | 'tertiary' | 'success' | 'warning' | 'critical'; export type ButtonContext = 'default' | 'onlyIcon'; export type ButtonSize = 'lg' | 'md' | 'sm'; -export type ButtonState = 'disabled' | 'loading'; export interface IButtonBaseProps { /** @@ -22,10 +21,6 @@ export interface IButtonBaseProps { * Applies responsiveness to the size of the button. */ responsiveSize?: ResponsiveAttribute; - /** - * State of the button. - */ - state?: ButtonState; /** * Icon displayed on the right side of the button. This icon is hidden in case the button has no children element * set (only-icon variant) and the iconLeft icon is displayed instead. @@ -36,6 +31,14 @@ export interface IButtonBaseProps { * set (only-icon variant) */ iconLeft?: IconType; + /** + * A boolean indicating whether the button is loading. + */ + isLoading?: boolean; + /** + * A boolean indicating whether the button is disabled. + */ + disabled?: boolean; } export type IButtonElementProps = ButtonHTMLAttributes | AnchorHTMLAttributes; diff --git a/src/components/button/button.test.tsx b/src/components/button/button.test.tsx index 0d123250d..7d27b2a80 100644 --- a/src/components/button/button.test.tsx +++ b/src/components/button/button.test.tsx @@ -48,11 +48,10 @@ describe('