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

[ActionList][Item] Allow indentation to be applied to individual items #9820

Merged
merged 8 commits into from
Jul 25, 2023

Conversation

zakwarsame
Copy link
Contributor

@zakwarsame zakwarsame commented Jul 24, 2023

WHY are these changes introduced?

Fixes #0000

Fixes https://github.com/Shopify/polaris-summer-editions/issues/785
Fixes https://github.com/Shopify/core-workflows/issues/1029
Fixes https://github.com/Shopify/polaris-summer-editions/issues/789

Expand to see specifications/designs for this PR:

image

WHAT is this pull request doing?

  • This PR takes an alternative approach to this PR
  • It adds a new prop to ActionList's Item component called indent. This prop adds some space and a border to the left of the individual items.
  • Given that the indentation only applies to Plus stores in the original design, we can simply specify the prop in the consumer.

How to 🎩

Non-Plus: https://admin.web.mn.zakaria-warsame.us.spin.dev/store/shop1
Plus: https://admin.web.mn.zakaria-warsame.us.spin.dev/store/shop2

Ensure the user menu matches the designs

🎩 checklist

@zakwarsame
Copy link
Contributor Author

/snapit

@github-actions
Copy link
Contributor

🫰✨ Thanks @zakwarsame! 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]

@zakwarsame zakwarsame force-pushed the zak/usermenu branch 6 times, most recently from e83fa5e to d9ccc2e Compare July 25, 2023 01:03
@zakwarsame
Copy link
Contributor Author

/snapit

@github-actions
Copy link
Contributor

🫰✨ Thanks @zakwarsame! 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]

padding={polarisSummerEditions2023 ? '1_5-experimental' : '2'}
{...(hasMultipleSections && {paddingBlockStart: '0'})}
{...(sectionRole && {role: sectionRole})}
tabIndex={!hasMultipleSections ? -1 : undefined}
>
{actionMarkup}
{polarisSummerEditions2023 ? (
<VerticalStack gap="1">{actionMarkup}</VerticalStack>
Copy link
Contributor Author

@zakwarsame zakwarsame Jul 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Outside indentation, this is the change from our designs that will affect all items. It provide a gap to list items:

Before

Screenshot 2023-07-24 at 9 42 21 PM

After

Screenshot 2023-07-24 at 9 41 44 PM

@zakwarsame zakwarsame marked this pull request as ready for review July 25, 2023 02:06
Copy link
Member

@sam-b-rose sam-b-rose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This approach looks excellent! Very composable and simple API for toggling the indentation style.

The examples in the spin link look good. I just noticed one spacing issue where the selected Store has a different horizontal margin than the other items. Though I'm not sure if that is an issue within Polaris or in the consumer implementation

Screenshot 2023-07-25 at 7 57 29 AM

.changeset/angry-mirrors-explode.md Outdated Show resolved Hide resolved
polaris-react/src/components/TopBar/TopBar.stories.tsx Outdated Show resolved Hide resolved
Copy link
Member

@kyledurand kyledurand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

@chrisblinstrub
Copy link
Contributor

Hey @zakwarsame, not sure if these items are relevant to this specific PR (apologies if they aren't!), but I noticed three things:

  1. In the Non-Plus link, the store icons for the non-active store are 20x20 when they should be 24x24. You'll see how Shop 3 and Shop 4 are further to the left than Shop 1:

  1. In the Non-Plus link, the icon for the "All Stores" link is sitting in a 20x20 container when it should be 24x24. This is causing similar alignment issues as above screenshot.

  1. This may be the same thing as item 2, but in the Plus link the icon for the "Switch organization" link is sitting in a 20x20 container when it should be 24x24.

@Shopify Shopify deleted a comment from github-actions bot Jul 25, 2023
@Shopify Shopify deleted a comment from github-actions bot Jul 25, 2023
@zakwarsame
Copy link
Contributor Author

/snapit

@Shopify Shopify deleted a comment from github-actions bot Jul 25, 2023
@github-actions
Copy link
Contributor

🫰✨ Thanks @zakwarsame! 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]

@zakwarsame
Copy link
Contributor Author

/snapit

@Shopify Shopify deleted a comment from github-actions bot Jul 25, 2023
@github-actions
Copy link
Contributor

🫰✨ Thanks @zakwarsame! 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]

Copy link
Member

@sam-b-rose sam-b-rose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢 👍

@sam-b-rose sam-b-rose merged commit 5fe84e3 into main Jul 25, 2023
10 checks passed
@sam-b-rose sam-b-rose deleted the zak/usermenu branch July 25, 2023 17:55
sam-b-rose pushed a commit that referenced this pull request Jul 25, 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

- [#9820](#9820)
[`5fe84e33b`](5fe84e3)
Thanks [@zakwarsame](https://github.com/zakwarsame)! - Added a `variant`
prop to ActionList for applying avatar size and left indentation space
and border to items

### Patch Changes

- [#9773](#9773)
[`a5f68c9a5`](a5f68c9)
Thanks [@jesstelford](https://github.com/jesstelford)! - [Scrollable]
shadow overlays scrollable content correctly.


- [#9764](#9764)
[`d3315de2e`](d3315de)
Thanks [@andy-schneidr](https://github.com/andy-schneidr)! - Wrap
SkeletonBodyText lines in a div (width 100%)


- [#9831](#9831)
[`078bddad1`](078bdda)
Thanks [@zakwarsame](https://github.com/zakwarsame)! - Updated the user
menu's avatar to include `name`


- [#9828](#9828)
[`80c87bb1a`](80c87bb)
Thanks [@felipeleusin](https://github.com/felipeleusin)! - [Frame]
Applies margin to Content when using sidebar

## @shopify/[email protected]



## [email protected]

### Patch Changes

- Updated dependencies
\[[`5fe84e33b`](5fe84e3),
[`a5f68c9a5`](a5f68c9),
[`d3315de2e`](d3315de),
[`078bddad1`](078bdda),
[`80c87bb1a`](80c87bb)]:
    -   @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
Shopify#9820)

<!--
  ☝️How to write a good PR title:
- Prefix it with [ComponentName] (if applicable), for example: [Button]
  - Start with a verb, for example: Add, Delete, Improve, Fix…
  - Give as much context as necessary and as little as possible
  - Prefix it with [WIP] while it’s a work in progress
-->

### WHY are these changes introduced?

Fixes #0000 <!-- link to issue if one exists -->

Fixes https://github.com/Shopify/polaris-summer-editions/issues/785
Fixes https://github.com/Shopify/core-workflows/issues/1029
Fixes https://github.com/Shopify/polaris-summer-editions/issues/789

<!--
  Context about the problem that’s being addressed.
-->

<details>
<summary> Expand to see specifications/designs for this PR: </summary>


![image](https://github.com/Shopify/polaris/assets/42528878/752f0a05-ffad-4361-b84e-db96cdf8ec84)

</details>



### WHAT is this pull request doing?

<!--
  Summary of the changes committed.

Before / after screenshots are appreciated for UI changes. Make sure to
include alt text that describes the screenshot.

If you include an animated gif showing your change, wrapping it in a
details tag is recommended. Gifs usually autoplay, which can cause
accessibility issues for people reviewing your PR:

    <details>
      <summary>Summary of your gif(s)</summary>
      <img src="..." alt="Description of what the gif shows">
    </details>
-->

<!-- ℹ️ Delete the following for small / trivial changes -->

- This PR takes an alternative approach to [this
PR](Shopify#9771)
- It adds a new prop to `ActionList`'s `Item` component called `indent`.
This prop adds some space and a border to the left of the individual
items.
- Given that the indentation only applies to `Plus` stores in the
original design, we can simply specify the prop in the consumer.

### How to 🎩

Non-Plus: https://admin.web.mn.zakaria-warsame.us.spin.dev/store/shop1
Plus: https://admin.web.mn.zakaria-warsame.us.spin.dev/store/shop2

Ensure the user menu matches the designs

### 🎩 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~
- [x] [Tophatted
documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md)
changes in the style guide

---------

Co-authored-by: Sam Rose <[email protected]>
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#9820](Shopify#9820)
[`5fe84e33b`](Shopify@5fe84e3)
Thanks [@zakwarsame](https://github.com/zakwarsame)! - Added a `variant`
prop to ActionList for applying avatar size and left indentation space
and border to items

### Patch Changes

- [Shopify#9773](Shopify#9773)
[`a5f68c9a5`](Shopify@a5f68c9)
Thanks [@jesstelford](https://github.com/jesstelford)! - [Scrollable]
shadow overlays scrollable content correctly.


- [Shopify#9764](Shopify#9764)
[`d3315de2e`](Shopify@d3315de)
Thanks [@andy-schneidr](https://github.com/andy-schneidr)! - Wrap
SkeletonBodyText lines in a div (width 100%)


- [Shopify#9831](Shopify#9831)
[`078bddad1`](Shopify@078bdda)
Thanks [@zakwarsame](https://github.com/zakwarsame)! - Updated the user
menu's avatar to include `name`


- [Shopify#9828](Shopify#9828)
[`80c87bb1a`](Shopify@80c87bb)
Thanks [@felipeleusin](https://github.com/felipeleusin)! - [Frame]
Applies margin to Content when using sidebar

## @shopify/[email protected]



## [email protected]

### Patch Changes

- Updated dependencies
\[[`5fe84e33b`](Shopify@5fe84e3),
[`a5f68c9a5`](Shopify@a5f68c9),
[`d3315de2e`](Shopify@d3315de),
[`078bddad1`](Shopify@078bdda),
[`80c87bb1a`](Shopify@80c87bb)]:
    -   @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
Shopify#9820)

<!--
  ☝️How to write a good PR title:
- Prefix it with [ComponentName] (if applicable), for example: [Button]
  - Start with a verb, for example: Add, Delete, Improve, Fix…
  - Give as much context as necessary and as little as possible
  - Prefix it with [WIP] while it’s a work in progress
-->

### WHY are these changes introduced?

Fixes #0000 <!-- link to issue if one exists -->

Fixes Shopify/archive-polaris-backlog-2024#785
Fixes Shopify/core-workflows#1029
Fixes Shopify/archive-polaris-backlog-2024#789

<!--
  Context about the problem that’s being addressed.
-->

<details>
<summary> Expand to see specifications/designs for this PR: </summary>


![image](https://github.com/Shopify/polaris/assets/42528878/752f0a05-ffad-4361-b84e-db96cdf8ec84)

</details>



### WHAT is this pull request doing?

<!--
  Summary of the changes committed.

Before / after screenshots are appreciated for UI changes. Make sure to
include alt text that describes the screenshot.

If you include an animated gif showing your change, wrapping it in a
details tag is recommended. Gifs usually autoplay, which can cause
accessibility issues for people reviewing your PR:

    <details>
      <summary>Summary of your gif(s)</summary>
      <img src="..." alt="Description of what the gif shows">
    </details>
-->

<!-- ℹ️ Delete the following for small / trivial changes -->

- This PR takes an alternative approach to [this
PR](Shopify#9771)
- It adds a new prop to `ActionList`'s `Item` component called `indent`.
This prop adds some space and a border to the left of the individual
items.
- Given that the indentation only applies to `Plus` stores in the
original design, we can simply specify the prop in the consumer.

### How to 🎩

Non-Plus: https://admin.web.mn.zakaria-warsame.us.spin.dev/store/shop1
Plus: https://admin.web.mn.zakaria-warsame.us.spin.dev/store/shop2

Ensure the user menu matches the designs

### 🎩 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~
- [x] [Tophatted
documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md)
changes in the style guide

---------

Co-authored-by: Sam Rose <[email protected]>
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.

4 participants