Skip to content

Commit

Permalink
SearchControl: remove margin overrides and add new opt-in prop (#46081)
Browse files Browse the repository at this point in the history
* SearchControl: remove margin overrides and add new opt-in prop

* remove extra line and padding from TemplatePartSelectionModal to match approved proposed solution
  • Loading branch information
brookewp authored Nov 30, 2022
1 parent 8d66bee commit 51f0b77
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ function PatternsExplorerSearch( { filterValue, setFilterValue } ) {
return (
<div className={ baseClassName }>
<SearchControl
__nextHasNoMarginBottom
onChange={ setFilterValue }
value={ filterValue }
label={ __( 'Search for patterns' ) }
Expand Down
1 change: 1 addition & 0 deletions packages/block-editor/src/components/inserter/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ function InserterMenu(
} ) }
>
<SearchControl
__nextHasNoMarginBottom
className="block-editor-inserter__search"
onChange={ ( value ) => {
if ( hoveredItem ) setHoveredItem( null );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export default function QuickInserter( {
>
{ showSearch && (
<SearchControl
__nextHasNoMarginBottom
className="block-editor-inserter__search"
value={ filterValue }
onChange={ ( value ) => {
Expand Down
4 changes: 0 additions & 4 deletions packages/block-editor/src/components/inserter/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,6 @@ $block-inserter-tabs-height: 44px;
.components-search-control__icon {
right: $grid-unit-10 + ($grid-unit-60 - $icon-size) * 0.5;
}

.components-base-control__field {
margin-bottom: 0;
}
}

.block-editor-inserter__tabs {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export default function TemplatePartSelectionModal( {
<div className="block-library-template-part__selection-content">
<div className="block-library-template-part__selection-search">
<SearchControl
__nextHasNoMarginBottom
onChange={ setSearchValue }
value={ searchValue }
label={ __( 'Search for replacements' ) }
Expand Down
1 change: 1 addition & 0 deletions packages/edit-post/src/components/block-manager/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ function BlockManager( {
</div>
) }
<SearchControl
__nextHasNoMarginBottom
label={ __( 'Search for a block' ) }
placeholder={ __( 'Search for a block' ) }
value={ search }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ function SuggestionList( { entityForSuggestions, onSelect } ) {
<>
{ showSearchControl && (
<SearchControl
__nextHasNoMarginBottom
onChange={ setSearch }
value={ search }
label={ labels.search_items }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ function ScreenBlockList() {
) }
/>
<SearchControl
__nextHasNoMarginBottom
className="edit-site-block-types-search"
onChange={ setFilterValue }
value={ filterValue }
Expand Down
6 changes: 5 additions & 1 deletion packages/edit-site/src/components/global-styles/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,12 @@
}
}

.edit-site-global-styles-header__description,
.edit-site-global-styles-header__description {
padding: 0 $grid-unit-20;
}

.edit-site-block-types-search {
margin-bottom: $grid-unit-10;
padding: 0 $grid-unit-20;
}

Expand Down

0 comments on commit 51f0b77

Please sign in to comment.