diff --git a/src/components/Button/Button.module.css b/src/components/Button/Button.module.css index d59bedcf7..f14308b54 100644 --- a/src/components/Button/Button.module.css +++ b/src/components/Button/Button.module.css @@ -68,25 +68,8 @@ } /** - * Loading icon rotiation style + * Loading icon rotation style */ -.eds-is-loading svg { - animation: rotateIcon 2s linear infinite; - overflow: visible; - - @media screen and (prefers-reduced-motion) { - animation: none; - } -} - -/** - * Loading icon rotation animation - */ -@keyframes rotateIcon { - 0% { - transform: rotate(0deg); - } - 100% { - transform: rotate(360deg); - } +.button.eds-is-loading svg path { + stroke: var(--eds-theme-color-text-disabled); } diff --git a/src/components/Button/Button.tsx b/src/components/Button/Button.tsx index 82d83b6fd..d7cb16331 100644 --- a/src/components/Button/Button.tsx +++ b/src/components/Button/Button.tsx @@ -3,7 +3,8 @@ import type { ReactNode } from 'react'; import React, { forwardRef } from 'react'; import ClickableStyle from '../ClickableStyle'; import type { ClickableStyleProps, VariantStatus } from '../ClickableStyle'; -import Icon from '../Icon'; +import LoadingIndicator from '../LoadingIndicator'; + import styles from './Button.module.css'; type ButtonHTMLElementProps = React.ButtonHTMLAttributes; @@ -25,6 +26,7 @@ export type ButtonProps = ButtonHTMLElementProps & { disabled?: boolean; /** * Loading state passed down from higher level used to trigger loader and text change + * @deprecated - This will be removed in a future release */ loading?: boolean; /** @@ -93,16 +95,7 @@ export const Button = forwardRef( variant={variant} {...other} > - {loading && ( - - )} - + {loading && } {children} ); diff --git a/src/components/Button/__snapshots__/Button.test.tsx.snap b/src/components/Button/__snapshots__/Button.test.tsx.snap index 651219edf..8b2569df4 100644 --- a/src/components/Button/__snapshots__/Button.test.tsx.snap +++ b/src/components/Button/__snapshots__/Button.test.tsx.snap @@ -332,23 +332,54 @@ exports[` `;