Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ToolbarButton: Set size to "compact" #67440

Merged
merged 4 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -25,6 +25,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
Loading