Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TopBar] grid alignment and center search (#9765)
### WHY are these changes introduced? Updates the `TopBar` component, so that the search field sits center of the viewport with large screens. It becomes slightly offset and expands to fill its column at smaller viewports. Note: after additional review there are adjustments within this PR that are not represented within the illustrated specification. Those adjustments are listed below. - Without editions, the search field will have a max-width of 580px - With editions, the search field will have a max-width of 480px - Search field remains centered, but collapses to account for left and right content - At medium breakpoint and above, 24px gap between columns - Below medium breakpoint, 4px gap between columns <details> <summary>Specifications</summary> ![image](https://github.com/Shopify/polaris/assets/86790511/b7423c80-a9ca-4989-84e8-2997835ed9ed) </details> ### WHAT is this pull request doing? Switches the `TopBar` to a grid layout, which adjusts the column configuration based on breakpoint. Additionally, the `TopBar` takes responsibility for managing the width of the search field rather than the search field itself. The search field will just need to expand (i.e. width 100%) to fill its container within the `TopBar` component. This places the `TopBar` in finer control of the layout of the `TopBar`, specifically with regards to alignment of the search field. ### How to 🎩 - [Storybook](https://storybook.web.polaris-top-bar.matt-kubej.us.spin.dev/?path=/story/all-components-topbar--default) - [Spin web](https://admin.web.polaris-top-bar.matt-kubej.us.spin.dev/store/shop1) (associated [PR](Shopify/web#98702) containing required web changes) 1. Validate the `TopBar` aligns with the specifications at various viewports 2. Repeat step 1 with editions enabled. ### 🎩 checklist - [x] Tested on [mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing) - [x] Tested on [multiple browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers) - [x] Tested for [accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md) - [ ] ~~Updated the component's `README.md` with documentation changes~~ (component does not have a README) - [x] [Tophatted documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md) changes in the style guide
- Loading branch information