Skip to content

Conversation

@aveline
Copy link
Contributor

@aveline aveline commented Nov 17, 2022

WHY are these changes introduced?

Resolves #7354

WHAT is this pull request doing?

  • Refactored ChoiceList to use primitive Layout components
  • Added support for legend element to Box
  • Add support for fieldset element to AlphaStack

How to 🎩

There is only one small visual change for ChoiceLists with Help text on small screens only. There is space-1 additional spacing between items which is margin on Help Text that long longer overlaps into the space between Choices now that the space is set with gap in AlphaStack. Previously it was set with margin so they overlapped.

Screenshot 2022-11-17 at 8 48 15 AM

Otherwise there should be no visual changes.

aveline and others added 15 commits October 28, 2022 09:11
### WHY are these changes introduced?

Fixes #7341  <!-- link to issue if one exists -->
### WHY are these changes introduced?

Fixes #7358 

### WHAT is this pull request doing?

Refactors `Banner` component to use new layout primitive components
### WHY are these changes introduced?

Resolves #7340.
Refactors `Modal` and its child components to use our layout primitives.

### WHAT is this pull request doing?
[Storybook
URL](https://5d559397bae39100201eedc1-nrruulmwsh.chromatic.com/?path=/story/all-components-modal--default).
Refactors `Modal`, `Modal.Section`, `Modal.Header`, and `Modal.Footer`
to use our layout primitives and remove css.

### How to 🎩

[Storybook
URL](https://5d559397bae39100201eedc1-nrruulmwsh.chromatic.com/?path=/story/all-components-modal--default).
I've tophatted all of our stories as well as the UI for all of our
breakpoints.

🖥 [Local development
instructions](https://github.com/Shopify/polaris/blob/main/README.md#local-development)
🗒 [General tophatting
guidelines](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md)
📄 [Changelog
guidelines](https://github.com/Shopify/polaris/blob/main/.github/CONTRIBUTING.md#changelog)

### 🎩 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
- [ ] [Tophatted
documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md)
changes in the style guide
I'm still of the opinion that our layout components should have some
defaults and the ones we have on bleed may not be right but we need to
use it in more places to figure out what those defaults should be.

For now, this fixes regressions to Banner that were introduced in
#7644
@github-actions
Copy link
Contributor

github-actions bot commented Nov 17, 2022

size-limit report 📦

Path Size
polaris-react-cjs 210.78 KB (+0.04% 🔺)
polaris-react-esm 136.15 KB (+0.04% 🔺)
polaris-react-esnext 191.11 KB (-0.03% 🔽)
polaris-react-css 41.68 KB (-0.22% 🔽)

@aveline aveline marked this pull request as draft November 17, 2022 18:54
@aveline aveline marked this pull request as ready for review November 21, 2022 23:12
Copy link
Contributor

@laurkim laurkim left a comment

Choose a reason for hiding this comment

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

Nice! 💯

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.

👏

Co-authored-by: Lo Kim <lo.kim@shopify.com>
Copy link
Contributor

@sarahill sarahill left a comment

Choose a reason for hiding this comment

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

@aveline this looks ok. I would prefer to keep spacing between 16px instead of the 20px due to the space-1 but I understand why that's there. A potential alternative is to make the spacing on the help text responsive too but it may not be worth adding that complexity for this. Thoughts?

@aveline
Copy link
Contributor Author

aveline commented Nov 22, 2022

@sarahill the help text is part of Choice, not ChoiceList so it's hard to make the change only in ChoiceList and not create some unexpected changes when Choice is used standalone or in different contexts.

But you did give me an idea, maybe I can add a responsive Bleed to handle that spacing in ChoiceList I will give it a try. It's probably not a great pattern but good exploration in terms of stress testing these layout primitives.

@sarahill
Copy link
Contributor

Cool I'll trust your judgement on using Bleed. If we would rather not I'm ok with that. Thanks for talking it out

@sarahill sarahill self-requested a review November 22, 2022 16:06
@laurkim laurkim force-pushed the layout-components-beta branch from 8e25493 to 54cdf64 Compare November 23, 2022 14:23
@aveline aveline self-assigned this Nov 23, 2022
@aveline aveline merged commit eebe9a8 into layout-components-beta Nov 24, 2022
@aveline aveline deleted the layout-choice-list branch November 24, 2022 00:09
chazdean pushed a commit that referenced this pull request Nov 28, 2022
Resolves #7354

- Refactored `ChoiceList` to use primitive Layout components
- Added support for `legend` element to `Box`
- Add support for `fieldset` element to `AlphaStack`

There should be no visual changes.

Co-authored-by: Lo Kim <lo.kim@shopify.com>
Co-authored-by: Kyle Durand <kyledurand@users.noreply.github.com>
laurkim added a commit that referenced this pull request Dec 5, 2022
Resolves #7354

- Refactored `ChoiceList` to use primitive Layout components
- Added support for `legend` element to `Box`
- Add support for `fieldset` element to `AlphaStack`

There should be no visual changes.

Co-authored-by: Lo Kim <lo.kim@shopify.com>
Co-authored-by: Kyle Durand <kyledurand@users.noreply.github.com>
laurkim added a commit that referenced this pull request Dec 7, 2022
Resolves #7354

- Refactored `ChoiceList` to use primitive Layout components
- Added support for `legend` element to `Box`
- Add support for `fieldset` element to `AlphaStack`

There should be no visual changes.

Co-authored-by: Lo Kim <lo.kim@shopify.com>
Co-authored-by: Kyle Durand <kyledurand@users.noreply.github.com>
laurkim added a commit that referenced this pull request Dec 9, 2022
Resolves #7354

- Refactored `ChoiceList` to use primitive Layout components
- Added support for `legend` element to `Box`
- Add support for `fieldset` element to `AlphaStack`

There should be no visual changes.

Co-authored-by: Lo Kim <lo.kim@shopify.com>
Co-authored-by: Kyle Durand <kyledurand@users.noreply.github.com>
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