-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FormTokenField, ComboboxControl: Add opt-in prop for next 40px defaul…
…t size (#50261) * FormTokenField: Add opt-in prop for next 40px default size * ComboboxControl: Add opt-in prop for next 40px default size * Update changelog
- Loading branch information
Showing
9 changed files
with
85 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import deprecated from '@wordpress/deprecated'; | ||
|
||
export function useDeprecated36pxDefaultSizeProp< | ||
P extends Record< string, any > & { | ||
__next36pxDefaultSize?: boolean; | ||
__next40pxDefaultSize?: boolean; | ||
} | ||
>( | ||
props: P, | ||
/** The component identifier in dot notation, e.g. `wp.components.ComponentName`. */ | ||
componentIdentifier: string | ||
) { | ||
const { __next36pxDefaultSize, __next40pxDefaultSize, ...otherProps } = | ||
props; | ||
if ( typeof __next36pxDefaultSize !== 'undefined' ) { | ||
deprecated( '`__next36pxDefaultSize` prop in ' + componentIdentifier, { | ||
alternative: '`__next40pxDefaultSize`', | ||
since: '6.3', | ||
} ); | ||
} | ||
|
||
return { | ||
...otherProps, | ||
__next40pxDefaultSize: __next40pxDefaultSize ?? __next36pxDefaultSize, | ||
}; | ||
} |