Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/components/Button/Button.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ const meta = {
children: { description: 'The content within the button.' },
className: { description: 'Additional CSS classes.' },
disabled: { description: 'Disabled state.' },
role: { description: 'The ARIA role.' },
testId: { description: 'Unit test identifier.' },
title: { description: 'HTML Element title.' },
type: { description: 'The type of button.' },
variant: {
control: 'select',
options: [ButtonVariant.Primary, ButtonVariant.Secondary, ButtonVariant.Text],
Expand Down
19 changes: 4 additions & 15 deletions src/components/Button/Button.types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AriaRole, MouseEventHandler, PropsWithChildren } from 'react';
import { PropsWithClassName, PropsWithTestId } from '../../utils/types';
import { ButtonHTMLAttributes } from 'react';
import { PropsWithTestId } from '../../utils/types';

/**
* The `ButtonVariant` enumerates types of Buttons.
Expand All @@ -12,21 +12,10 @@ export enum ButtonVariant {

/**
* Properties for the `Button` component.
* @param {boolean} [disabled] - Optional. The button disabled state. Default: `false`
* @param {MouseEventHandler<HTMLButtonElement>} [onClick] - Optional. A function invoked when the button is clicked.
* @param {AriaRole} [role] - Optional. An Aria role value. Default: `button`
* @param {string} [title] - Optional. The title attribute of the HTML button element.
* @param {string} [type] - Optional. The type attribute of the HTML button element. Default: `button`
* @param {ButtonVariant} [variant] - Optional. The type of Button. Default: `Primary`
* @see {@link PropsWithClassName}
* @see {@link ButtonHTMLAttributes}
* @see {@link PropsWithTestId}
* @see {@link PropsWithChildren}
*/
export interface ButtonProps extends PropsWithChildren, PropsWithClassName, PropsWithTestId {
disabled?: boolean;
onClick?: MouseEventHandler<HTMLButtonElement>;
role?: AriaRole;
title?: string;
type?: 'button' | 'submit' | 'reset';
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, PropsWithTestId {
variant?: ButtonVariant;
}