Skip to content

Commit

Permalink
DimensionControl: Add __next40pxDefaultSize prop (#56805)
Browse files Browse the repository at this point in the history
* `DimensionControl`: Add __next40pxDefaultSize prop

* Update changelog
  • Loading branch information
brookewp authored Dec 7, 2023
1 parent 72280c1 commit 550966a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- `CheckboxControl`: Add option to not render label ([#56158](https://github.com/WordPress/gutenberg/pull/56158)).
- `PaletteEdit`: Gradient pickers to use same width as color pickers ([#56801](https://github.com/WordPress/gutenberg/pull/56801)).
- `FocalPointPicker`: Add opt-in prop for 40px default size ([#56021](https://github.com/WordPress/gutenberg/pull/56021)).
- `DimensionControl`: Add opt-in prop for 40px default size ([#56805](https://github.com/WordPress/gutenberg/pull/56805)).

### Bug Fix

Expand Down
2 changes: 2 additions & 0 deletions packages/components/src/dimension-control/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import type { SelectControlSingleSelectionProps } from '../select-control/types'
*/
export function DimensionControl( props: DimensionControlProps ) {
const {
__next40pxDefaultSize = false,
label,
value,
sizes = sizesTable,
Expand Down Expand Up @@ -85,6 +86,7 @@ export function DimensionControl( props: DimensionControlProps ) {

return (
<SelectControl
__next40pxDefaultSize={ __next40pxDefaultSize }
className={ classnames(
className,
'block-editor-dimension-control'
Expand Down
6 changes: 6 additions & 0 deletions packages/components/src/dimension-control/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,10 @@ export type DimensionControlProps = {
* @default ''
*/
className?: string;
/**
* Start opting into the larger default height that will become the default size in a future version.
*
* @default false
*/
__next40pxDefaultSize?: boolean;
};

1 comment on commit 550966a

@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 550966a.
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/7123247271
📝 Reported issues:

Please sign in to comment.