{t('action.sign_in_with', { name: localName })}
diff --git a/packages/experience/src/components/Button/index.module.scss b/packages/experience/src/components/Button/index.module.scss
index 67993f96c..ed47d5295 100644
--- a/packages/experience/src/components/Button/index.module.scss
+++ b/packages/experience/src/components/Button/index.module.scss
@@ -16,10 +16,28 @@
user-select: none;
overflow: hidden;
- .icon {
- font-size: 0;
- line-height: normal;
- margin-right: _.unit(2);
+ .content {
+ position: relative;
+ transition: padding-left 0.2s ease;
+
+ .icon {
+ font-size: 0;
+ line-height: normal;
+ position: absolute;
+ pointer-events: none;
+ left: 0;
+ opacity: 0%;
+ transition: opacity 0.2s ease;
+ }
+
+ &.iconVisible {
+ padding-left: _.unit(7);
+
+ .icon {
+ left: 0;
+ opacity: 100%;
+ }
+ }
}
}
@@ -45,6 +63,10 @@
&:active {
background: var(--color-brand-pressed);
}
+
+ &.loading {
+ background-color: var(--color-brand-70);
+ }
}
.secondary {
@@ -74,7 +96,7 @@
outline: 3px solid var(--color-overlay-brand-focused);
}
- &:not(:disabled):not(:active):hover {
+ &:not(:disabled):not(:active):not(.loading):hover {
background: var(--color-brand-hover);
}
}
@@ -84,7 +106,7 @@
outline: 3px solid var(--color-overlay-neutral-focused);
}
- &:not(:disabled):not(:active):hover {
+ &:not(:disabled):not(:active):not(.loading):hover {
background: var(--color-overlay-neutral-hover);
}
}
diff --git a/packages/experience/src/components/Button/index.tsx b/packages/experience/src/components/Button/index.tsx
index 544198975..2166df5c7 100644
--- a/packages/experience/src/components/Button/index.tsx
+++ b/packages/experience/src/components/Button/index.tsx
@@ -1,9 +1,11 @@
import classNames from 'classnames';
import type { TFuncKey } from 'i18next';
-import type { HTMLProps } from 'react';
+import { type HTMLProps } from 'react';
+import { useDebouncedLoader } from 'use-debounced-loader';
import DynamicT from '../DynamicT';
+import RotatingRingIcon from './RotatingRingIcon';
import * as styles from './index.module.scss';
export type ButtonType = 'primary' | 'secondary';
@@ -13,6 +15,7 @@ type BaseProps = Omit
, 'type' | 'size' | 'title'> &
readonly type?: ButtonType;
readonly size?: 'small' | 'large';
readonly isDisabled?: boolean;
+ readonly isLoading?: boolean;
readonly className?: string;
readonly onClick?: React.MouseEventHandler;
};
@@ -31,10 +34,13 @@ const Button = ({
i18nProps,
className,
isDisabled = false,
+ isLoading = false,
icon,
onClick,
...rest
}: Props) => {
+ const isLoadingActive = useDebouncedLoader(isLoading, 300);
+
return (
);
};
diff --git a/packages/experience/src/scss/_colors.scss b/packages/experience/src/scss/_colors.scss
index b1d1e4b00..2952cb391 100644
--- a/packages/experience/src/scss/_colors.scss
+++ b/packages/experience/src/scss/_colors.scss
@@ -38,6 +38,7 @@
--color-brand-30: #4300da;
--color-brand-40: #5d34f2;
--color-brand-50: #7958ff;
+ --color-brand-70: #af9eff;
--color-alert-60: #ca8000;
--color-alert-70: #eb9918;