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

BorderBoxControl: Suppress redundant warnings for deprecated 36px size #67213

Merged
merged 3 commits into from
Nov 25, 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
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
- `SlotFill`: fix dependencies of `Fill` registration effects ([#67071](https://github.com/WordPress/gutenberg/pull/67071)).
- `SlotFill`: rewrite the `Slot` component from class component to functional ([#67153](https://github.com/WordPress/gutenberg/pull/67153)).
- `Menu.ItemHelpText`: Fix text wrapping to prevent unintended word breaks ([#67011](https://github.com/WordPress/gutenberg/pull/67011)).
- `BorderBoxControl`: Suppress redundant warnings for deprecated 36px size ([#67213](https://github.com/WordPress/gutenberg/pull/67213)).

## 28.12.0 (2024-11-16)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ const BorderBoxControlSplitControls = (
isCompact: true,
__experimentalIsRenderedInSidebar,
size,
__shouldNotWarnDeprecated36pxSize: true,
};

const mergedRef = useMergeRefs( [ setPopoverAnchor, forwardedRef ] );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ const UnconnectedBorderBoxControl = (
__experimentalIsRenderedInSidebar={
__experimentalIsRenderedInSidebar
}
__shouldNotWarnDeprecated36pxSize
size={ size }
/>
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@ export function useBorderControl(
width,
__experimentalIsRenderedInSidebar = false,
__next40pxDefaultSize,
__shouldNotWarnDeprecated36pxSize,
...otherProps
} = useContextSystem( props, 'BorderControl' );

maybeWarnDeprecated36pxSize( {
componentName: 'BorderControl',
__next40pxDefaultSize,
size,
__shouldNotWarnDeprecated36pxSize,
} );

const computedSize =
Expand Down
7 changes: 7 additions & 0 deletions packages/components/src/border-control/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,13 @@ export type BorderControlProps = ColorProps &
* @default false
*/
__next40pxDefaultSize?: boolean;
/**
* Do not throw a warning for the deprecated 36px default size.
* For internal components of other components that already throw the warning.
*
* @ignore
*/
__shouldNotWarnDeprecated36pxSize?: boolean;
};

export type DropdownProps = ColorProps &
Expand Down
Loading