Skip to content

Commit

Permalink
feat(components): migrate LoadingButton to TypeScript
Browse files Browse the repository at this point in the history
BREAKING CHANGE:
The LoadingButton's exit animations have been removed. An action's success or error result should be
communicated outside the button.

feature/button-enums

feature/button-enums

HEAD
  • Loading branch information
connor-baer committed May 2, 2020
1 parent 6edb0a1 commit 7bdfaad
Show file tree
Hide file tree
Showing 30 changed files with 719 additions and 2,499 deletions.
459 changes: 137 additions & 322 deletions src/__snapshots__/storyshots.spec.js.snap

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions src/components/Button/Button.docs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ with a primary button for the expected action and a secondary button on its left

## LoadingButton

When the button's action is inputting/saving information or it takes more than 3 seconds to take the user to the next step/page, you can indicate a loading state with `LoadingButton`, as well as visually notify the user of success or an error after loading. You should only use it on primary buttons.
When the button's action is inputting/saving information or it takes more than 3 seconds to take the user to the next step/page, you can indicate a loading state with `LoadingButton`.

<Story id="components-button-loadingbutton--base" />
<Story id="components-button-loadingbutton--success" />
<Story id="components-button-loadingbutton--error" />
<Props of={LoadingButton} />
1 change: 1 addition & 0 deletions src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const baseStyles = ({ theme }: StyleProps) => css`
border-radius: ${theme.borderRadius.giga};
border-width: ${BORDER_WIDTH};
border-style: solid;
transition: opacity ${theme.transitions.default};
&:focus {
${focusOutline({ theme })};
Expand Down
16 changes: 16 additions & 0 deletions src/components/Button/__snapshots__/Button.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ exports[`Button styles should render a disabled button 1`] = `
border-radius: 5px;
border-width: 1px;
border-style: solid;
-webkit-transition: opacity 200ms ease-in-out;
transition: opacity 200ms ease-in-out;
background-color: #3388FF;
border-color: #3388FF;
color: #FFFFFF;
Expand Down Expand Up @@ -92,6 +94,8 @@ exports[`Button styles should render a giga button 1`] = `
border-radius: 5px;
border-width: 1px;
border-style: solid;
-webkit-transition: opacity 200ms ease-in-out;
transition: opacity 200ms ease-in-out;
background-color: #3388FF;
border-color: #3388FF;
color: #FFFFFF;
Expand Down Expand Up @@ -157,6 +161,8 @@ exports[`Button styles should render a kilo button 1`] = `
border-radius: 5px;
border-width: 1px;
border-style: solid;
-webkit-transition: opacity 200ms ease-in-out;
transition: opacity 200ms ease-in-out;
background-color: #3388FF;
border-color: #3388FF;
color: #FFFFFF;
Expand Down Expand Up @@ -222,6 +228,8 @@ exports[`Button styles should render a mega button 1`] = `
border-radius: 5px;
border-width: 1px;
border-style: solid;
-webkit-transition: opacity 200ms ease-in-out;
transition: opacity 200ms ease-in-out;
background-color: #3388FF;
border-color: #3388FF;
color: #FFFFFF;
Expand Down Expand Up @@ -287,6 +295,8 @@ exports[`Button styles should render a primary button by default 1`] = `
border-radius: 5px;
border-width: 1px;
border-style: solid;
-webkit-transition: opacity 200ms ease-in-out;
transition: opacity 200ms ease-in-out;
background-color: #3388FF;
border-color: #3388FF;
color: #FFFFFF;
Expand Down Expand Up @@ -352,6 +362,8 @@ exports[`Button styles should render a secondary button 1`] = `
border-radius: 5px;
border-width: 1px;
border-style: solid;
-webkit-transition: opacity 200ms ease-in-out;
transition: opacity 200ms ease-in-out;
background-color: #FFFFFF;
border-color: #9DA7B1;
color: #323E49;
Expand Down Expand Up @@ -417,6 +429,8 @@ exports[`Button styles should render a stretched button 1`] = `
border-radius: 5px;
border-width: 1px;
border-style: solid;
-webkit-transition: opacity 200ms ease-in-out;
transition: opacity 200ms ease-in-out;
background-color: #3388FF;
border-color: #3388FF;
color: #FFFFFF;
Expand Down Expand Up @@ -483,6 +497,8 @@ exports[`Button styles should render a tertiary button 1`] = `
border-radius: 5px;
border-width: 1px;
border-style: solid;
-webkit-transition: opacity 200ms ease-in-out;
transition: opacity 200ms ease-in-out;
background-color: transparent;
border-color: transparent;
color: #3388FF;
Expand Down
65 changes: 0 additions & 65 deletions src/components/Button/constants.ts

This file was deleted.

8 changes: 8 additions & 0 deletions src/components/Carousel/__snapshots__/Carousel.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,8 @@ exports[`Carousel styles should render with children as a function 1`] = `
border-radius: 5px;
border-width: 1px;
border-style: solid;
-webkit-transition: opacity 200ms ease-in-out;
transition: opacity 200ms ease-in-out;
background-color: #3388FF;
border-color: #3388FF;
color: #FFFFFF;
Expand Down Expand Up @@ -856,6 +858,8 @@ exports[`Carousel styles should render with children as a node 1`] = `
border-radius: 5px;
border-width: 1px;
border-style: solid;
-webkit-transition: opacity 200ms ease-in-out;
transition: opacity 200ms ease-in-out;
background-color: #3388FF;
border-color: #3388FF;
color: #FFFFFF;
Expand Down Expand Up @@ -1378,6 +1382,8 @@ exports[`Carousel styles should render with default paused styles 1`] = `
border-radius: 5px;
border-width: 1px;
border-style: solid;
-webkit-transition: opacity 200ms ease-in-out;
transition: opacity 200ms ease-in-out;
background-color: #3388FF;
border-color: #3388FF;
color: #FFFFFF;
Expand Down Expand Up @@ -1931,6 +1937,8 @@ exports[`Carousel styles should render with default styles 1`] = `
border-radius: 5px;
border-width: 1px;
border-style: solid;
-webkit-transition: opacity 200ms ease-in-out;
transition: opacity 200ms ease-in-out;
background-color: #3388FF;
border-color: #3388FF;
color: #FFFFFF;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ exports[`Buttons styles should render with default styles 1`] = `
border-radius: 5px;
border-width: 1px;
border-style: solid;
-webkit-transition: opacity 200ms ease-in-out;
transition: opacity 200ms ease-in-out;
background-color: #3388FF;
border-color: #3388FF;
color: #FFFFFF;
Expand Down
136 changes: 0 additions & 136 deletions src/components/LoadingButton/LoadingButton.js

This file was deleted.

Loading

0 comments on commit 7bdfaad

Please sign in to comment.