Skip to content

Commit

Permalink
Button: refactor Storybook to controls and align docs (#44105)
Browse files Browse the repository at this point in the history
* Button: Add 'isBusy' state knobs to the Storybook

* Convert knobs to controls

* Remove multiple buttons story

* Add missing props and descriptions

* Update packages/components/src/button/stories/index.js

Co-authored-by: Marco Ciampini <marco.ciampo@gmail.com>

* Update packages/components/src/button/stories/index.js

Co-authored-by: Marco Ciampini <marco.ciampo@gmail.com>

* Remove defaults from README and stories

* Add 'href' and 'target'

* Remove default value for __experimentalIsFocusable

* Add changelong entry

Co-authored-by: Marco Ciampini <marco.ciampo@gmail.com>
  • Loading branch information
Mamaduka and ciampo committed Oct 21, 2022
1 parent 7be4f38 commit 0ad21d5
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 193 deletions.
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
### Internal

- `AnglePickerControl`: Set Storybook Label control type to 'text' ([#45122](https://github.com/WordPress/gutenberg/pull/45122)).
- `Button`: Refactor Storybook to controls and align docs ([#44105](https://github.com/WordPress/gutenberg/pull/44105)).

## 21.3.0 (2022-10-19)

Expand Down
17 changes: 2 additions & 15 deletions packages/components/src/button/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,63 +127,55 @@ Whether the button is disabled. If `true`, this will force a `button` element to

- Type: `Boolean`
- Required: No
- Default: `false`

#### href

If provided, renders `a` instead of `button`.

- Type: `String`
- Required: No
- Default: `undefined`

#### variant

Specifies the button's style. The accepted values are `'primary'` (the primary button styles), `'secondary'` (the default button styles), `'tertiary'` (the text-based button styles), and `'link'` (the link button styles).

- Type: `String`
- Required: No
- Default: `undefined`

#### isDestructive

Renders a red text-based button style to indicate destructive behavior.

- Type: `Boolean`
- Required: No
- Default: `false`

#### isSmall

Decreases the size of the button.

- Type: `Boolean`
- Required: No
- Default: `false`

#### isPressed

Renders a pressed button style.

- Type: `Boolean`
- Required: No
- Default: `false`

#### isBusy

Indicates activity while a action is being performed.

- Type: `Boolean`
- Required: No
- Default: `false`

#### focus

Whether the button is focused.

- Type: `Boolean`
- Required: No
- Default: `false`

#### target

Expand All @@ -205,15 +197,13 @@ If provided, renders an [Icon](/packages/components/src/icon/README.md) componen

- Type: `String|Function|WPComponent|null`
- Required: No
- Default: `null`

#### iconSize

If provided with `icon`, sets the icon size.
If provided with `icon`, sets the icon size. Please refer to the [Icon](/packages/components/src/icon/README.md) component for more details regarding the default value of its `size` prop.

- Type: `Number`
- Required: No
- Default: `20 when a Dashicon is rendered, 24 for all other icons.`

#### iconPosition

Expand All @@ -236,23 +226,20 @@ If provided, renders a [Tooltip](/packages/components/src/tooltip/README.md) com

- Type: `Boolean`
- Required: No
- Default: `false`

#### tooltipPosition

If provided with`showTooltip`, sets the position of the tooltip.
If provided with`showTooltip`, sets the position of the tooltip. Please refer to the [Tooltip](/packages/components/src/tooltip/README.md) component for more details regarding the defaults.

- Type: `String`
- Require: No
- Default:`top center`

#### shortcut

If provided with `showTooltip`, appends the Shortcut label to the tooltip content. If an `Object` is provided, it should contain `display` and `ariaLabel` keys.

- Type: `String|Object`
- Required: No
- Default: `undefined`

#### label

Expand Down
Loading

0 comments on commit 0ad21d5

Please sign in to comment.