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

[TopBar] grid alignment and center search #9765

Merged
merged 1 commit into from
Jul 21, 2023

Conversation

mattkubej
Copy link
Contributor

@mattkubej mattkubej commented Jul 19, 2023

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
Specifications

image

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 🎩

  1. Validate the TopBar aligns with the specifications at various viewports
  2. Repeat step 1 with editions enabled.

🎩 checklist

@mattkubej
Copy link
Contributor Author

/snapit

@github-actions
Copy link
Contributor

🫰✨ Thanks @mattkubej! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

yarn add @shopify/[email protected]
yarn add @shopify/[email protected]
yarn add @shopify/[email protected]
yarn add @shopify/[email protected]
yarn add @shopify/[email protected]
yarn add @shopify/[email protected]
yarn add @shopify/[email protected]

@mattkubej
Copy link
Contributor Author

/snapit

@github-actions
Copy link
Contributor

🫰✨ Thanks @mattkubej! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

yarn add @shopify/[email protected]
yarn add @shopify/[email protected]
yarn add @shopify/[email protected]
yarn add @shopify/[email protected]
yarn add @shopify/[email protected]
yarn add @shopify/[email protected]
yarn add @shopify/[email protected]

@mattkubej mattkubej force-pushed the top-bar/grid-alignment-center-search branch 2 times, most recently from ddc37ac to f3653a7 Compare July 20, 2023 01:38
@mattkubej
Copy link
Contributor Author

/snapit

@github-actions
Copy link
Contributor

🫰✨ Thanks @mattkubej! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

yarn add @shopify/[email protected]
yarn add @shopify/[email protected]
yarn add @shopify/[email protected]
yarn add @shopify/[email protected]
yarn add @shopify/[email protected]
yarn add @shopify/[email protected]
yarn add @shopify/[email protected]

@mattkubej mattkubej marked this pull request as ready for review July 20, 2023 02:34
@mattkubej
Copy link
Contributor Author

/snapit

@github-actions
Copy link
Contributor

🫰✨ Thanks @mattkubej! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

yarn add @shopify/[email protected]
yarn add @shopify/[email protected]
yarn add @shopify/[email protected]
yarn add @shopify/[email protected]
yarn add @shopify/[email protected]
yarn add @shopify/[email protected]
yarn add @shopify/[email protected]

@mattkubej
Copy link
Contributor Author

/snapit

@mattkubej mattkubej force-pushed the top-bar/grid-alignment-center-search branch 2 times, most recently from bb56785 to f84237c Compare July 20, 2023 22:58
@github-actions
Copy link
Contributor

🫰✨ Thanks @mattkubej! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

yarn add @shopify/[email protected]
yarn add @shopify/[email protected]
yarn add @shopify/[email protected]
yarn add @shopify/[email protected]
yarn add @shopify/[email protected]
yarn add @shopify/[email protected]
yarn add @shopify/[email protected]

@mattkubej
Copy link
Contributor Author

/snapit

@github-actions
Copy link
Contributor

🫰✨ Thanks @mattkubej! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

yarn add @shopify/[email protected]
yarn add @shopify/[email protected]
yarn add @shopify/[email protected]
yarn add @shopify/[email protected]
yarn add @shopify/[email protected]
yarn add @shopify/[email protected]
yarn add @shopify/[email protected]

@mattkubej mattkubej force-pushed the top-bar/grid-alignment-center-search branch from f84237c to 07e9ac0 Compare July 20, 2023 23:07
@mattkubej
Copy link
Contributor Author

/snapit

@github-actions
Copy link
Contributor

🫰✨ Thanks @mattkubej! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

yarn add @shopify/[email protected]
yarn add @shopify/[email protected]

@mattkubej mattkubej merged commit 541e592 into main Jul 21, 2023
10 checks passed
@mattkubej mattkubej deleted the top-bar/grid-alignment-center-search branch July 21, 2023 15:20
mattkubej pushed a commit that referenced this pull request Jul 21, 2023
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @shopify/[email protected]

### Minor Changes

- [#9777](#9777)
[`8228de0f6`](8228de0)
Thanks [@heyjoethomas](https://github.com/heyjoethomas)! - Added social
media icons

## @shopify/[email protected]

### Minor Changes

- [#9761](#9761)
[`ce3e516a2`](ce3e516)
Thanks [@aveline](https://github.com/aveline)! - Added `readOnly` prop
to `Labelled` component


- [#9770](#9770)
[`571acc166`](571acc1)
Thanks [@zaquille-oneil](https://github.com/zaquille-oneil)! - Updating
TextField to support ArrowUp and ArrowDown keypresses for "integer" type

### Patch Changes

- [#9765](#9765)
[`541e5920b`](541e592)
Thanks [@mattkubej](https://github.com/mattkubej)! - [TopBar] convert to
grid and center align search field

- Updated dependencies
\[[`8228de0f6`](8228de0)]:
    -   @shopify/[email protected]

## @shopify/[email protected]



## [email protected]

### Patch Changes

- Updated dependencies
\[[`ce3e516a2`](ce3e516),
[`8228de0f6`](8228de0),
[`571acc166`](571acc1),
[`541e5920b`](541e592)]:
    -   @shopify/[email protected]
    -   @shopify/[email protected]

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
juzser pushed a commit to juzser/polaris that referenced this pull request Jul 27, 2023
### 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](https://github.com/Shopify/web/pull/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
juzser pushed a commit to juzser/polaris that referenced this pull request Jul 27, 2023
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @shopify/[email protected]

### Minor Changes

- [Shopify#9777](Shopify#9777)
[`8228de0f6`](Shopify@8228de0)
Thanks [@heyjoethomas](https://github.com/heyjoethomas)! - Added social
media icons

## @shopify/[email protected]

### Minor Changes

- [Shopify#9761](Shopify#9761)
[`ce3e516a2`](Shopify@ce3e516)
Thanks [@aveline](https://github.com/aveline)! - Added `readOnly` prop
to `Labelled` component


- [Shopify#9770](Shopify#9770)
[`571acc166`](Shopify@571acc1)
Thanks [@zaquille-oneil](https://github.com/zaquille-oneil)! - Updating
TextField to support ArrowUp and ArrowDown keypresses for "integer" type

### Patch Changes

- [Shopify#9765](Shopify#9765)
[`541e5920b`](Shopify@541e592)
Thanks [@mattkubej](https://github.com/mattkubej)! - [TopBar] convert to
grid and center align search field

- Updated dependencies
\[[`8228de0f6`](Shopify@8228de0)]:
    -   @shopify/[email protected]

## @shopify/[email protected]



## [email protected]

### Patch Changes

- Updated dependencies
\[[`ce3e516a2`](Shopify@ce3e516),
[`8228de0f6`](Shopify@8228de0),
[`571acc166`](Shopify@571acc1),
[`541e5920b`](Shopify@541e592)]:
    -   @shopify/[email protected]
    -   @shopify/[email protected]

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
AnnaCheba pushed a commit to AnnaCheba/polaris that referenced this pull request Apr 22, 2024
### 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants