Better naming for button with spinner
[MAILPOET-2771]
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -75,7 +75,7 @@
|
|||||||
color: $color-secondary;
|
color: $color-secondary;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.mailpoet-button-loading:after {
|
&.mailpoet-button-with-spinner:after {
|
||||||
background-color: rgba($color-secondary-light, .8);
|
background-color: rgba($color-secondary-light, .8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -88,7 +88,7 @@
|
|||||||
background: $color-tertiary-hover;
|
background: $color-tertiary-hover;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.mailpoet-button-loading:after {
|
&.mailpoet-button-with-spinner:after {
|
||||||
background-color: rgba($color-tertiary, .8);
|
background-color: rgba($color-tertiary, .8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -105,7 +105,7 @@
|
|||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.mailpoet-button-loading:after {
|
&.mailpoet-button-with-spinner:after {
|
||||||
background-color: rgba(#fff, .8);
|
background-color: rgba(#fff, .8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -122,12 +122,12 @@
|
|||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.mailpoet-button-loading:after {
|
&.mailpoet-button-with-spinner:after {
|
||||||
background-color: rgba(#fff, .8);
|
background-color: rgba(#fff, .8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.mailpoet-button-loading{
|
.mailpoet-button-with-spinner {
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
|
|
||||||
&:after {
|
&:after {
|
||||||
|
@@ -23,7 +23,7 @@
|
|||||||
// Generic
|
// Generic
|
||||||
|
|
||||||
@import 'generic/buttons';
|
@import 'generic/buttons';
|
||||||
@import 'generic/buttons-loaders';
|
@import 'generic/buttons-spinners';
|
||||||
@import 'generic/helpers';
|
@import 'generic/helpers';
|
||||||
@import 'generic/typography';
|
@import 'generic/typography';
|
||||||
|
|
||||||
|
@@ -122,38 +122,38 @@ export const WithoutIcons = () => (
|
|||||||
</p>
|
</p>
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
<Heading level={3}>Loading buttons</Heading>
|
<Heading level={3}>Buttons with spinner</Heading>
|
||||||
<p>
|
<p>
|
||||||
<Button
|
<Button
|
||||||
onClick={action('light loading')}
|
onClick={action('light spinner')}
|
||||||
isLoading
|
withSpinner
|
||||||
variant="light"
|
variant="light"
|
||||||
>
|
>
|
||||||
Light button
|
Light button
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onClick={action('regular loading')}
|
onClick={action('regular spinner')}
|
||||||
isLoading
|
withSpinner
|
||||||
>
|
>
|
||||||
Regular button
|
Regular button
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onClick={action('dark loading')}
|
onClick={action('dark spinner')}
|
||||||
isLoading
|
withSpinner
|
||||||
variant="dark"
|
variant="dark"
|
||||||
>
|
>
|
||||||
Dark button
|
Dark button
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onClick={action('link loading')}
|
onClick={action('link spinner')}
|
||||||
isLoading
|
withSpinner
|
||||||
variant="link"
|
variant="link"
|
||||||
>
|
>
|
||||||
Link button
|
Link button
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onClick={action('link-dark loading')}
|
onClick={action('link-dark spinner')}
|
||||||
isLoading
|
withSpinner
|
||||||
variant="link-dark"
|
variant="link-dark"
|
||||||
>
|
>
|
||||||
Link dark button
|
Link dark button
|
||||||
|
@@ -153,32 +153,32 @@ export const WithIcons = () => (
|
|||||||
</p>
|
</p>
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
<Heading level={3}>Loading buttons</Heading>
|
<Heading level={3}>Buttons with spinner</Heading>
|
||||||
<p>
|
<p>
|
||||||
<Button
|
<Button
|
||||||
onClick={action('only icon loading')}
|
onClick={action('only icon spinner')}
|
||||||
isLoading
|
withSpinner
|
||||||
variant="light"
|
variant="light"
|
||||||
iconStart={icon}
|
iconStart={icon}
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
onClick={action('icon start loading')}
|
onClick={action('icon start spinner')}
|
||||||
isLoading
|
withSpinner
|
||||||
iconStart={icon}
|
iconStart={icon}
|
||||||
>
|
>
|
||||||
Icon start
|
Icon start
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onClick={action('icon end loading')}
|
onClick={action('icon end spinner')}
|
||||||
isLoading
|
withSpinner
|
||||||
variant="dark"
|
variant="dark"
|
||||||
iconEnd={icon}
|
iconEnd={icon}
|
||||||
>
|
>
|
||||||
Icon end
|
Icon end
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onClick={action('both icons loading')}
|
onClick={action('both icons spinner')}
|
||||||
isLoading
|
withSpinner
|
||||||
variant="light"
|
variant="light"
|
||||||
iconStart={icon}
|
iconStart={icon}
|
||||||
iconEnd={icon}
|
iconEnd={icon}
|
||||||
@@ -186,14 +186,14 @@ export const WithIcons = () => (
|
|||||||
Both icons
|
Both icons
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onClick={action('only icon link loading')}
|
onClick={action('only icon link spinner')}
|
||||||
isLoading
|
withSpinner
|
||||||
variant="link"
|
variant="link"
|
||||||
iconStart={icon}
|
iconStart={icon}
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
onClick={action('icon start link loading')}
|
onClick={action('icon start link spinner')}
|
||||||
isLoading
|
withSpinner
|
||||||
variant="link-dark"
|
variant="link-dark"
|
||||||
iconStart={icon}
|
iconStart={icon}
|
||||||
>
|
>
|
||||||
|
@@ -5,7 +5,7 @@ type Props = {
|
|||||||
children?: React.ReactNode,
|
children?: React.ReactNode,
|
||||||
size?: 'small' | 'large',
|
size?: 'small' | 'large',
|
||||||
variant?: 'light' | 'dark' | 'link' | 'link-dark',
|
variant?: 'light' | 'dark' | 'link' | 'link-dark',
|
||||||
isLoading?: boolean,
|
withSpinner?: boolean,
|
||||||
isFullWidth?: boolean,
|
isFullWidth?: boolean,
|
||||||
iconStart?: JSX.Element,
|
iconStart?: JSX.Element,
|
||||||
iconEnd?: JSX.Element,
|
iconEnd?: JSX.Element,
|
||||||
@@ -17,7 +17,7 @@ const Button = ({
|
|||||||
children,
|
children,
|
||||||
size,
|
size,
|
||||||
variant,
|
variant,
|
||||||
isLoading,
|
withSpinner,
|
||||||
isFullWidth,
|
isFullWidth,
|
||||||
iconStart,
|
iconStart,
|
||||||
iconEnd,
|
iconEnd,
|
||||||
@@ -33,7 +33,7 @@ const Button = ({
|
|||||||
{
|
{
|
||||||
[`mailpoet-button-${size}`]: size,
|
[`mailpoet-button-${size}`]: size,
|
||||||
[`mailpoet-button-${variant}`]: variant,
|
[`mailpoet-button-${variant}`]: variant,
|
||||||
'mailpoet-button-loading': isLoading,
|
'mailpoet-button-with-spinner': withSpinner,
|
||||||
'mailpoet-full-width': isFullWidth,
|
'mailpoet-full-width': isFullWidth,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user