-
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.
### WHY are these changes introduced? We want to encourage the use of icons only for commonly used buttons as stated in the Patterns section, and also encourage more use of icons in buttons with text to show what the verb of the button does. <!-- Context about the problem that’s being addressed. --> ### WHAT is this pull request doing? This PR adds some extra examples and changes others to encourage use of icons in Page and Card actions. <!-- Summary of the changes committed. Before / after screenshots are appreciated for UI changes. Make sure to include alt text that describes the screenshot. Include a video if your changes include interactive content. 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> --> ### How to 🎩 🖥 [Local development instructions](https://github.com/Shopify/polaris/blob/main/README.md#install-dependencies-and-build-workspaces) 🗒 [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 - [ ] Tested a [snapshot](https://github.com/Shopify/polaris/blob/main/documentation/Releasing.md#-snapshot-releases) - [ ] 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) - [x] Tested for [accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md) - [x] 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: Lo Kim <lo.kim@shopify.com>
- Loading branch information
1 parent
4fffc2d
commit 86a6ba4
Showing
8 changed files
with
78 additions
and
14 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': minor | ||
--- | ||
|
||
Added examples for `Card` and `Page` with icon actions |
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 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
28 changes: 28 additions & 0 deletions
28
polaris.shopify.com/pages/examples/card-with-header-icon-actions.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,28 @@ | ||
import React from 'react'; | ||
import {BlockStack, Button, Card, InlineGrid, Text} from '@shopify/polaris'; | ||
import {withPolarisExample} from '../../src/components/PolarisExampleWrapper'; | ||
import {ExportIcon} from '@shopify/polaris-icons'; | ||
|
||
function CardWithHeaderIconActions() { | ||
return ( | ||
<Card roundedAbove="sm"> | ||
<BlockStack gap="200"> | ||
<InlineGrid columns="1fr auto"> | ||
<Text as="h2" variant="headingSm"> | ||
Variants | ||
</Text> | ||
<Button | ||
onClick={() => {}} | ||
accessibilityLabel="Export variants" | ||
icon={ExportIcon} | ||
/> | ||
</InlineGrid> | ||
<Text as="p" variant="bodyMd"> | ||
Export variants | ||
</Text> | ||
</BlockStack> | ||
</Card> | ||
); | ||
} | ||
|
||
export default withPolarisExample(CardWithHeaderIconActions); |
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
5 changes: 4 additions & 1 deletion
5
polaris.shopify.com/pages/examples/page-with-destructive-secondary-action.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