Skip to content

Commit

Permalink
CustomSelectControl: Add lint rule for 40px size prop usage (#64559)
Browse files Browse the repository at this point in the history
* Fix in DateFormatPicker

* Make explicit in FontAppearanceControl

* Add lint rule

Co-authored-by: mirka <[email protected]>
Co-authored-by: tyxla <[email protected]>
Co-authored-by: ciampo <[email protected]>
  • Loading branch information
4 people authored Aug 16, 2024
1 parent 42db13f commit 65da212
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ module.exports = {
...[
'BorderBoxControl',
'BorderControl',
'CustomSelectControl',
'DimensionControl',
'FontSizePicker',
'ToggleGroupControl',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ function NonDefaultControls( { format, onChange } ) {
return (
<VStack>
<CustomSelectControl
__next40pxDefaultSize
label={ __( 'Choose a format' ) }
options={ [ ...suggestedOptions, customOption ] }
value={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ const getFontAppearanceLabel = ( hasFontStyles, hasFontWeights ) => {
*/
export default function FontAppearanceControl( props ) {
const {
/** Start opting into the larger default height that will become the default size in a future version. */
__next40pxDefaultSize = false,
onChange,
hasFontStyles = true,
hasFontWeights = true,
Expand Down Expand Up @@ -150,6 +152,7 @@ export default function FontAppearanceControl( props ) {
<CustomSelectControl
{ ...otherProps }
className="components-font-appearance-control"
__next40pxDefaultSize={ __next40pxDefaultSize }
label={ label }
describedBy={ getDescribedBy() }
options={ selectOptions }
Expand Down

0 comments on commit 65da212

Please sign in to comment.