-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Layout foundations] Update
AlphaCard
component docs and guidance (#…
…7568) <!-- ☝️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 #6905 <!-- link to issue if one exists --> <!-- Context about the problem that’s being addressed. --> ### WHAT is this pull request doing? Updates the `AlphaCard` component docs and guidance <details> <summary>AlphaCard style guide</summary> <img src="https://user-images.githubusercontent.com/59836805/198679436-320894fa-017d-4a0c-bb14-3fd8b1cc4c77.gif" alt="AlphaCard styleguide" width="600"> </details> <!-- 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 --> ### 🎩 checklist - [ ] Tested on [mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing) - [ ] Tested on [multiple browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers) - [ ] 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 Co-authored-by: Lo Kim <[email protected]>
- Loading branch information
Showing
8 changed files
with
105 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'polaris.shopify.com': patch | ||
--- | ||
|
||
Updated `AlphaCard` component guidance and examples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
polaris.shopify.com/pages/examples/alpha-card-with-rounded-corners.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import {AlphaCard, Text} from '@shopify/polaris'; | ||
import React from 'react'; | ||
import {withPolarisExample} from '../../src/components/PolarisExampleWrapper'; | ||
|
||
function AlphaCardExample() { | ||
return ( | ||
<AlphaCard roundedAbove="md"> | ||
<Text as="h2" variant="bodyMd"> | ||
Content inside a card | ||
</Text> | ||
</AlphaCard> | ||
); | ||
} | ||
|
||
export default withPolarisExample(AlphaCardExample); |
15 changes: 15 additions & 0 deletions
15
polaris.shopify.com/pages/examples/alpha-card-with-subdued-background.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import {AlphaCard, Text} from '@shopify/polaris'; | ||
import React from 'react'; | ||
import {withPolarisExample} from '../../src/components/PolarisExampleWrapper'; | ||
|
||
function AlphaCardExample() { | ||
return ( | ||
<AlphaCard background="surface-subdued"> | ||
<Text as="h2" variant="bodyMd"> | ||
Content inside a card | ||
</Text> | ||
</AlphaCard> | ||
); | ||
} | ||
|
||
export default withPolarisExample(AlphaCardExample); |
46 changes: 46 additions & 0 deletions
46
polaris.shopify.com/pages/examples/alpha-card-with-varying-padding.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import {AlphaCard, Text, AlphaStack} from '@shopify/polaris'; | ||
import React from 'react'; | ||
import {withPolarisExample} from '../../src/components/PolarisExampleWrapper'; | ||
|
||
function AlphaCardExample() { | ||
return ( | ||
<AlphaStack spacing="4" fullWidth> | ||
<AlphaCard> | ||
<Placeholder label="Content inside a card" /> | ||
</AlphaCard> | ||
<AlphaCard padding="4"> | ||
<Placeholder label="Content inside a card" /> | ||
</AlphaCard> | ||
<AlphaCard padding="2"> | ||
<Placeholder label="Content inside a card" /> | ||
</AlphaCard> | ||
<AlphaCard padding="0"> | ||
<Placeholder label="Content inside a card" /> | ||
</AlphaCard> | ||
</AlphaStack> | ||
); | ||
} | ||
|
||
const Placeholder = ({label = '', height = 'auto', width = 'auto'}) => { | ||
return ( | ||
<div | ||
style={{ | ||
background: '#7B47F1', | ||
height: height, | ||
width: width, | ||
}} | ||
> | ||
<div | ||
style={{ | ||
color: '#FFFFFF', | ||
}} | ||
> | ||
<Text as="h2" variant="bodyMd"> | ||
{label} | ||
</Text> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default withPolarisExample(AlphaCardExample); |
28 changes: 0 additions & 28 deletions
28
polaris.shopify.com/pages/examples/alpha-card-without-border-radius.tsx
This file was deleted.
Oops, something went wrong.