From 880c9e6ea85f50173d7a24498b47659279c2737e Mon Sep 17 00:00:00 2001 From: Lena Morita Date: Thu, 18 Jul 2024 02:35:00 +0900 Subject: [PATCH] Add margin-bottom lint rules for CheckboxControl, ComboboxControl, SearchControl --- .eslintrc.js | 3 +++ .../src/components/inserter/media-tab/media-panel.js | 1 + packages/block-editor/src/components/inserter/style.scss | 4 ++-- packages/block-library/src/form-input/edit.js | 2 ++ packages/block-library/src/page-list/edit.js | 1 + packages/components/src/checkbox-control/README.md | 8 ++++++++ packages/components/src/checkbox-control/index.tsx | 1 + packages/components/src/combobox-control/README.md | 9 +++++++++ packages/components/src/combobox-control/index.tsx | 1 + 9 files changed, 28 insertions(+), 2 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index c15afbcf02aa9..4385f528f44db 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -290,7 +290,10 @@ module.exports = { ...restrictedSyntax, ...restrictedSyntaxComponents, ...[ + 'CheckboxControl', + 'ComboboxControl', 'FocalPointPicker', + 'SearchControl', 'TextareaControl', 'TreeSelect', ].map( ( componentName ) => ( { diff --git a/packages/block-editor/src/components/inserter/media-tab/media-panel.js b/packages/block-editor/src/components/inserter/media-tab/media-panel.js index 9a55bd5ef99ce..cc19403f9d947 100644 --- a/packages/block-editor/src/components/inserter/media-tab/media-panel.js +++ b/packages/block-editor/src/components/inserter/media-tab/media-panel.js @@ -25,6 +25,7 @@ export function MediaCategoryPanel( { rootClientId, onInsert, category } ) { return (
{ 'checkbox' !== type && ( { @@ -48,6 +49,7 @@ function InputFieldBlock( { attributes, setAttributes, className } ) { /> ) } { diff --git a/packages/block-library/src/page-list/edit.js b/packages/block-library/src/page-list/edit.js index fca8096ac05d4..2b7f31c3c7c5e 100644 --- a/packages/block-library/src/page-list/edit.js +++ b/packages/block-library/src/page-list/edit.js @@ -319,6 +319,7 @@ export default function PageListEdit( { { pagesTree.length > 0 && ( { const [ isChecked, setChecked ] = useState( true ); return ( ReactNode` - Required: No +#### __nextHasNoMarginBottom + +Start opting into the new margin-free styles that will become the default in a future version. + +- Type: `Boolean` +- Required: No +- Default: `false` + ## Related components - Like this component, but without a search input, the [`CustomSelectControl`](https://developer.wordpress.org/block-editor/reference-guides/components/custom-select-control/) component. diff --git a/packages/components/src/combobox-control/index.tsx b/packages/components/src/combobox-control/index.tsx index a39a5dc1fc541..e3b1434be8c7c 100644 --- a/packages/components/src/combobox-control/index.tsx +++ b/packages/components/src/combobox-control/index.tsx @@ -92,6 +92,7 @@ const getIndexOfMatchingSuggestion = ( * const [ filteredOptions, setFilteredOptions ] = useState( options ); * return ( *