Skip to content

Commit

Permalink
Notice: Add appropriate size props to Buttons (#66593)
Browse files Browse the repository at this point in the history
* Notice: Add appropriate size props to Buttons

* Add size prop to reset Button in story

* Add changelog

* Update snapshot

Co-authored-by: mirka <[email protected]>
Co-authored-by: tyxla <[email protected]>
Co-authored-by: jameskoster <[email protected]>
  • Loading branch information
4 people authored Oct 30, 2024
1 parent 8a11ce4 commit d2b3c1f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- `Guide`: Use small size button for page controls ([#66607](https://github.com/WordPress/gutenberg/pull/66607)).
- `PaletteEdit`: Add appropriate size props to Buttons ([#66590](https://github.com/WordPress/gutenberg/pull/66590)).
- `Notice`: Add appropriate size props to Buttons ([#66593](https://github.com/WordPress/gutenberg/pull/66593)).

### Internal

Expand Down
2 changes: 2 additions & 0 deletions packages/components/src/notice/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ function Notice( {

return (
<Button
__next40pxDefaultSize
key={ index }
href={ url }
variant={ computedVariant }
Expand All @@ -160,6 +161,7 @@ function Notice( {
</div>
{ isDismissible && (
<Button
size="small"
className="components-notice__dismiss"
icon={ close }
label={ __( 'Close' ) }
Expand Down
6 changes: 5 additions & 1 deletion packages/components/src/notice/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@ export const NoticeListSubcomponent: StoryFn< typeof NoticeList > = () => {
return (
<>
<NoticeList notices={ notices } onRemove={ removeNotice } />
<Button variant="primary" onClick={ resetNotices }>
<Button
__next40pxDefaultSize
variant="primary"
onClick={ resetNotices }
>
Reset Notices
</Button>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ exports[`Notice should match snapshot 1`] = `
class="components-notice__actions"
>
<a
class="components-button components-notice__action is-link"
class="components-button components-notice__action is-next-40px-default-size is-link"
href="https://example.com"
>
More information
</a>
<button
class="components-button components-notice__action is-secondary"
class="components-button components-notice__action is-next-40px-default-size is-secondary"
type="button"
>
Cancel
</button>
<button
class="components-button components-notice__action is-primary"
class="components-button components-notice__action is-next-40px-default-size is-primary"
type="button"
>
Submit
Expand All @@ -42,7 +42,7 @@ exports[`Notice should match snapshot 1`] = `
</div>
<button
aria-label="Close"
class="components-button components-notice__dismiss has-icon"
class="components-button components-notice__dismiss is-small has-icon"
type="button"
>
<svg
Expand Down

1 comment on commit d2b3c1f

@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 d2b3c1f.
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/11599416726
📝 Reported issues:

Please sign in to comment.