Skip to content

Commit

Permalink
Data views: Update search appearance in narrow containers (#64681)
Browse files Browse the repository at this point in the history
Co-authored-by: jameskoster <[email protected]>
Co-authored-by: youknowriad <[email protected]>
  • Loading branch information
3 people authored Aug 21, 2024
1 parent be2d49f commit e6bc14c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
4 changes: 4 additions & 0 deletions packages/dataviews/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
- Filters no longer display the elements' description. ([#64674](https://github.com/WordPress/gutenberg/pull/64674))


## Enhancements

- Adjust layout of filter / actions row, increase width of search control when the container is narrower. ([#64681](https://github.com/WordPress/gutenberg/pull/64681)).

## 4.1.0 (2024-08-07)

## Internal
Expand Down
10 changes: 7 additions & 3 deletions packages/dataviews/src/components/dataviews/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,15 @@ export default function DataViews< Item >( {
<div className="dataviews-wrapper">
<HStack
alignment="top"
justify="start"
justify="space-between"
className="dataviews__view-actions"
spacing={ 1 }
>
<HStack justify="start" wrap>
<HStack
justify="start"
expanded={ false }
className="dataviews__search"
>
{ search && <DataViewsSearch label={ searchLabel } /> }
<FilterVisibilityToggle
filters={ filters }
Expand All @@ -133,12 +137,12 @@ export default function DataViews< Item >( {
isShowingFilter={ isShowingFilter }
/>
</HStack>
<DataViewsBulkActions />
<HStack
spacing={ 1 }
expanded={ false }
style={ { flexShrink: 0 } }
>
<DataViewsBulkActions />
<DataViewsViewConfig
defaultLayouts={ defaultLayouts }
density={ density }
Expand Down
12 changes: 0 additions & 12 deletions packages/dataviews/src/components/dataviews/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@
left: 0;
transition: padding ease-out 0.1s;
@include reduce-motion("transition");

.components-search-control {
.components-base-control__field {
max-width: 240px;
}
}
}

.dataviews-view-list__primary-field,
Expand Down Expand Up @@ -82,12 +76,6 @@
.dataviews__view-actions,
.dataviews-filters__container {
padding: $grid-unit-15 $grid-unit-30;

.components-search-control {
.components-base-control__field {
max-width: 112px;
}
}
}

.dataviews-view-grid,
Expand Down

0 comments on commit e6bc14c

Please sign in to comment.