Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SearchControl: remove margin overrides and add new opt-in prop #46081

Merged
merged 2 commits into from
Nov 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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