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

Shop admin liveview polaris #371

Draft
wants to merge 10 commits into
base: shop_admin_liveview_barebones
Choose a base branch
from

Conversation

Baradoy
Copy link
Contributor

@Baradoy Baradoy commented Oct 3, 2023

This implements the Box and Spinner component from Polaris as Phoenix components.

Box is a complicated component that takes a huge number of attributes.
Spinner on the other hand only takes 3 attributes. This is to demonstrate the difference between those complicated and simple components.

This also adds some of the Polaris Tokens that where relevant to Box. Tokens are part of the Polaris design system the identifies valid values for colours, borders, padding and the like.

@Baradoy Baradoy requested a review from hez October 3, 2023 16:55
## Examples

<.box border_color="border" border_width="4">Content</.box>
<.box background="bg-magic-hover" border_radius="full" padding={[xs: "400"]} width="586px">Content</.box>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For reactive attributes we could take a different approach of padding-xs="400".

On the one hand, that would require an enumeration of each possible breakpoint for that attribute padding-xs="400" padding-md="600" padding-lg="400" ..., but on the other hand, it allows us to enforce tokens better. attr :padding-xs, :string, values: Space.tokens().

Perhaps a macro that enumerates the attributes for us.

@Baradoy Baradoy force-pushed the shop_admin_liveview_barebones branch from ef2b6dc to 889856e Compare October 12, 2023 19:21
@Baradoy Baradoy force-pushed the shop_admin_liveview_polaris branch 2 times, most recently from 75278fe to 75da949 Compare October 18, 2023 13:55
@hez hez force-pushed the shop_admin_liveview_barebones branch from 889856e to 0fe058b Compare February 8, 2024 22:32
@hez hez force-pushed the shop_admin_liveview_polaris branch from 3c23cec to 8b2609a Compare February 8, 2024 22:47
@hez hez force-pushed the shop_admin_liveview_barebones branch from 0fe058b to dab8141 Compare February 8, 2024 23:08
@hez hez force-pushed the shop_admin_liveview_polaris branch from 8b2609a to 32c7c18 Compare February 8, 2024 23:09
@hez hez force-pushed the shop_admin_liveview_polaris branch from 32c7c18 to 033e35a Compare February 15, 2024 23:20
@hez hez force-pushed the shop_admin_liveview_barebones branch from dab8141 to c112f5e Compare February 15, 2024 23:32
@hez hez force-pushed the shop_admin_liveview_polaris branch from 033e35a to 318199f Compare February 15, 2024 23:32
@hez hez force-pushed the shop_admin_liveview_barebones branch from c112f5e to d24ef51 Compare July 5, 2024 17:33
Baradoy and others added 9 commits July 5, 2024 10:34
Tokens are part of the Polaris design system. They enumerate valid values for various options such as colour, border, and spacing.
See https://polaris.shopify.com/tokens
…ke box.

In some Polaris components, `padding="400"` is translated into `--pc-box-background:var(--p-color-bg-magic-hover);--pc-box-border-radius:var(--p-border-radius-full);--pc-box-padding-xs:var(--p-space-400);--pc-box-padding-block-end-xs:var(--p-space-400);--pc-box-padding-block-start-xs:var(--p-space-400);--pc-box-padding-inline-end-xs:var(--p-space-400);--pc-box-padding-inline-start-xs:var(--p-space-400)`. This adds a tool that makesx that task easier.
Adds the Box component as it is supposed to be a building block for other components. It also turned out to be one of the more complicated components from an attribute perspective.
This is an example of a much simpler component and implementation
This makes importing those files cleaner.
Required adding the ShadowBevel component for support.
@hez hez force-pushed the shop_admin_liveview_polaris branch from 318199f to 617a84c Compare July 5, 2024 17:41
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