Skip to content

Commit

Permalink
ToolbarButton: Set size to "compact" (#67440)
Browse files Browse the repository at this point in the history
* ToolbarButton: Set size to "compact"

* Add changelog

* Update snapshots

Co-authored-by: mirka <[email protected]>
Co-authored-by: tyxla <[email protected]>
  • Loading branch information
3 people authored Dec 2, 2024
1 parent 8d80471 commit fe8e832
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ exports[`AlignmentUI should allow custom alignment controls to be specified 1`]
align="custom-left"
aria-label="My custom left"
aria-pressed="false"
class="components-button components-toolbar__control has-icon"
class="components-button components-toolbar__control is-compact has-icon"
data-toolbar-item="true"
type="button"
>
Expand All @@ -35,7 +35,7 @@ exports[`AlignmentUI should allow custom alignment controls to be specified 1`]
align="custom-right"
aria-label="My custom right"
aria-pressed="true"
class="components-button components-toolbar__control is-pressed has-icon"
class="components-button components-toolbar__control is-compact is-pressed has-icon"
data-toolbar-item="true"
type="button"
>
Expand Down Expand Up @@ -100,7 +100,7 @@ exports[`AlignmentUI should match snapshot when controls are visible 1`] = `
align="left"
aria-label="Align text left"
aria-pressed="true"
class="components-button components-toolbar__control is-pressed has-icon"
class="components-button components-toolbar__control is-compact is-pressed has-icon"
data-toolbar-item="true"
type="button"
>
Expand All @@ -123,7 +123,7 @@ exports[`AlignmentUI should match snapshot when controls are visible 1`] = `
align="center"
aria-label="Align text center"
aria-pressed="false"
class="components-button components-toolbar__control has-icon"
class="components-button components-toolbar__control is-compact has-icon"
data-toolbar-item="true"
type="button"
>
Expand All @@ -146,7 +146,7 @@ exports[`AlignmentUI should match snapshot when controls are visible 1`] = `
align="right"
aria-label="Align text right"
aria-pressed="false"
class="components-button components-toolbar__control has-icon"
class="components-button components-toolbar__control is-compact has-icon"
data-toolbar-item="true"
type="button"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ exports[`BlockAlignmentUI should match snapshot when controls are visible 1`] =
<button
aria-label="None"
aria-pressed="false"
class="components-button components-toolbar__control has-icon"
class="components-button components-toolbar__control is-compact has-icon"
data-toolbar-item="true"
type="button"
>
Expand All @@ -64,7 +64,7 @@ exports[`BlockAlignmentUI should match snapshot when controls are visible 1`] =
<button
aria-label="Align left"
aria-pressed="true"
class="components-button components-toolbar__control is-pressed has-icon"
class="components-button components-toolbar__control is-compact is-pressed has-icon"
data-toolbar-item="true"
type="button"
>
Expand All @@ -86,7 +86,7 @@ exports[`BlockAlignmentUI should match snapshot when controls are visible 1`] =
<button
aria-label="Align center"
aria-pressed="false"
class="components-button components-toolbar__control has-icon"
class="components-button components-toolbar__control is-compact has-icon"
data-toolbar-item="true"
type="button"
>
Expand All @@ -108,7 +108,7 @@ exports[`BlockAlignmentUI should match snapshot when controls are visible 1`] =
<button
aria-label="Align right"
aria-pressed="false"
class="components-button components-toolbar__control has-icon"
class="components-button components-toolbar__control is-compact has-icon"
data-toolbar-item="true"
type="button"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ exports[`BlockVerticalAlignmentUI should match snapshot when controls are visibl
<button
aria-label="Align top"
aria-pressed="true"
class="components-button components-toolbar__control is-pressed has-icon"
class="components-button components-toolbar__control is-compact is-pressed has-icon"
data-toolbar-item="true"
type="button"
>
Expand All @@ -64,7 +64,7 @@ exports[`BlockVerticalAlignmentUI should match snapshot when controls are visibl
<button
aria-label="Align middle"
aria-pressed="false"
class="components-button components-toolbar__control has-icon"
class="components-button components-toolbar__control is-compact has-icon"
data-toolbar-item="true"
type="button"
>
Expand All @@ -86,7 +86,7 @@ exports[`BlockVerticalAlignmentUI should match snapshot when controls are visibl
<button
aria-label="Align bottom"
aria-pressed="false"
class="components-button components-toolbar__control has-icon"
class="components-button components-toolbar__control is-compact has-icon"
data-toolbar-item="true"
type="button"
>
Expand Down
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

- Upgraded `@ariakit/react` (v0.4.13) and `@ariakit/test` (v0.4.5) ([#65907](https://github.com/WordPress/gutenberg/pull/65907)).
- Upgraded `@ariakit/react` (v0.4.15) and `@ariakit/test` (v0.4.7) ([#67404](https://github.com/WordPress/gutenberg/pull/67404)).
- `ToolbarButton`: Set size to "compact" ([#67440](https://github.com/WordPress/gutenberg/pull/67440)).
- Exported the `WPCompleter` type as it was being used in block-editor/autocompleters ([#67410](https://github.com/WordPress/gutenberg/pull/67410)).
- `SlotFill`: remove manual rerenders from the portal `Fill` component ([#67471](https://github.com/WordPress/gutenberg/pull/67471)).

Expand Down
2 changes: 2 additions & 0 deletions packages/components/src/toolbar/toolbar-button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ function UnforwardedToolbarButton(
<Button
ref={ ref }
icon={ restProps.icon }
size="compact"
label={ title }
shortcut={ restProps.shortcut }
data-subscript={ restProps.subscript }
Expand Down Expand Up @@ -97,6 +98,7 @@ function UnforwardedToolbarButton(
>
{ ( toolbarItemProps ) => (
<Button
size="compact"
label={ title }
isPressed={ isActive }
{ ...toolbarItemProps }
Expand Down

1 comment on commit fe8e832

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in fe8e832.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12125327662
📝 Reported issues:

Please sign in to comment.