From cfba537dd0851687bd14d8ef41ffecda46b3455a Mon Sep 17 00:00:00 2001 From: Brooke Scarlett Yalof Date: Wed, 26 Jul 2023 19:56:23 +0200 Subject: [PATCH] Updates Button component `loading` API (#1865) * with changeset * update readme * uncommit loading story * user can pass props to spinner --- .changeset/loud-lies-camp.md | 5 +++ packages/button/README.md | 33 ++++++++++--------- packages/button/package.json | 16 ++++----- packages/button/src/Button.story.tsx | 7 ++-- packages/button/src/Button/Button.spec.tsx | 3 ++ packages/button/src/Button/Button.tsx | 7 +++- .../src/ButtonContent/ButtonContent.tsx | 27 ++++++++++----- packages/button/src/types.ts | 5 +++ 8 files changed, 66 insertions(+), 37 deletions(-) create mode 100644 .changeset/loud-lies-camp.md diff --git a/.changeset/loud-lies-camp.md b/.changeset/loud-lies-camp.md new file mode 100644 index 0000000000..db8ff5f4ae --- /dev/null +++ b/.changeset/loud-lies-camp.md @@ -0,0 +1,5 @@ +--- +'@leafygreen-ui/button': major +--- + +Changes API that supports `isLoading` in Button components. Consuming applications now must pass their own Spinner components through the `loadingIndicator` slot prop diff --git a/packages/button/README.md b/packages/button/README.md index 4d6a9094ea..9f80d939b2 100644 --- a/packages/button/README.md +++ b/packages/button/README.md @@ -80,21 +80,22 @@ npm install @leafygreen-ui/button ## Properties -| Prop | Type | Description | Default | -| -------------- | ------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- | -| `variant` | `'default'`, `'primary'`, `'primaryOutline'`, `'danger'`, `'dangerOutline'`, `'baseGreen'` | Sets the style variant of the button. | `'default'` | -| `darkMode` | `boolean` | Determines if the component renders in dark mode | `false` | -| `size` | `'xsmall'`, `'small'`, `'default'`, `'large'` | Sets the size variant of the button. | `'default'` | -| `children` | `node` | The content that will appear inside of the `