|
|
@ -22,6 +22,7 @@ export type ButtonVariant =
|
|
|
|
type Props = Readonly<{
|
|
|
|
type Props = Readonly<{
|
|
|
|
addonPosition?: ButtonAddOnPosition;
|
|
|
|
addonPosition?: ButtonAddOnPosition;
|
|
|
|
'aria-controls'?: string;
|
|
|
|
'aria-controls'?: string;
|
|
|
|
|
|
|
|
'aria-label'?: string;
|
|
|
|
className?: string;
|
|
|
|
className?: string;
|
|
|
|
disabled?: boolean;
|
|
|
|
disabled?: boolean;
|
|
|
|
display?: ButtonDisplay;
|
|
|
|
display?: ButtonDisplay;
|
|
|
@ -106,6 +107,7 @@ const variantDisabledClasses: Record<ButtonVariant, string> = {
|
|
|
|
export default function Button({
|
|
|
|
export default function Button({
|
|
|
|
addonPosition = 'end',
|
|
|
|
addonPosition = 'end',
|
|
|
|
'aria-controls': ariaControls,
|
|
|
|
'aria-controls': ariaControls,
|
|
|
|
|
|
|
|
'aria-label': ariaLabel,
|
|
|
|
className,
|
|
|
|
className,
|
|
|
|
display = 'inline',
|
|
|
|
display = 'inline',
|
|
|
|
href,
|
|
|
|
href,
|
|
|
@ -148,7 +150,7 @@ export default function Button({
|
|
|
|
|
|
|
|
|
|
|
|
const commonProps = {
|
|
|
|
const commonProps = {
|
|
|
|
'aria-controls': ariaControls ?? undefined,
|
|
|
|
'aria-controls': ariaControls ?? undefined,
|
|
|
|
'aria-label': isLabelHidden ? label : undefined,
|
|
|
|
'aria-label': isLabelHidden ? ariaLabel ?? label : undefined,
|
|
|
|
children,
|
|
|
|
children,
|
|
|
|
className: clsx(
|
|
|
|
className: clsx(
|
|
|
|
display === 'block' ? 'flex w-full justify-center' : 'inline-flex',
|
|
|
|
display === 'block' ? 'flex w-full justify-center' : 'inline-flex',
|
|
|
|