Skip to content

Commit 0eb43a9

Browse files
authored
[AlphaCard] Add subdued section storybook example (#7788)
### WHY are these changes introduced? Resolves #7743. Adds storybook example for an `AlphaCard` with subdued section. ### WHAT is this pull request doing? Creates a subdued section for `AlphaCard.stories.tsx`. <details> <summary>AlphaCard with subdued section</summary> <img src="https://user-images.githubusercontent.com/26749317/203336031-f6a609c5-048c-466d-bea5-04ff5ac1aabc.png" alt="AlphaCard with subdued section"> </details> <!-- ℹ️ Delete the following for small / trivial changes --> ### How to 🎩 [Storybook](https://5d559397bae39100201eedc1-emxlehaerg.chromatic.com/?path=/story/all-components-alphacard--with-subdued-section). 🖥 [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) <!-- Give as much information as needed to experiment with the component in the playground. --> ### 🎩 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) - [ ] 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
1 parent 7c0a4b6 commit 0eb43a9

File tree

2 files changed

+52
-4
lines changed

2 files changed

+52
-4
lines changed

.changeset/lazy-jokes-invent.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@shopify/polaris': minor
3+
---
4+
5+
Added storybook example for `AlphaCard` with subdued section

polaris-react/src/components/AlphaCard/AlphaCard.stories.tsx

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import type {ComponentMeta} from '@storybook/react';
3-
import {AlphaCard, AlphaStack, Text} from '@shopify/polaris';
3+
import {AlphaCard, AlphaStack, Bleed, Box, List, Text} from '@shopify/polaris';
44

55
export default {
66
component: AlphaCard,
@@ -13,7 +13,9 @@ export function Default() {
1313
<Text as="h3" variant="headingMd">
1414
Online store dashboard
1515
</Text>
16-
<p>View a summary of your online store’s performance.</p>
16+
<Text variant="bodyMd" as="p">
17+
View a summary of your online store’s performance.
18+
</Text>
1719
</AlphaStack>
1820
</AlphaCard>
1921
);
@@ -26,7 +28,9 @@ export function WithBackgroundSubdued() {
2628
<Text as="h3" variant="headingMd">
2729
Online store dashboard
2830
</Text>
29-
<p>View a summary of your online store’s performance.</p>
31+
<Text variant="bodyMd" as="p">
32+
View a summary of your online store’s performance.
33+
</Text>
3034
</AlphaStack>
3135
</AlphaCard>
3236
);
@@ -39,8 +43,47 @@ export function WithBorderRadiusRoundedAbove() {
3943
<Text as="h3" variant="headingMd">
4044
Online store dashboard
4145
</Text>
42-
<p>View a summary of your online store’s performance.</p>
46+
<Text variant="bodyMd" as="p">
47+
View a summary of your online store’s performance.
48+
</Text>
49+
</AlphaStack>
50+
</AlphaCard>
51+
);
52+
}
53+
54+
export function WithSubduedSection() {
55+
return (
56+
<AlphaCard roundedAbove="sm">
57+
<AlphaStack gap="5">
58+
<Text as="h3" variant="headingMd">
59+
Staff accounts
60+
</Text>
61+
<Box paddingBlockEnd="5">
62+
<List>
63+
<List.Item>Felix Crafford</List.Item>
64+
<List.Item>Ezequiel Manno</List.Item>
65+
</List>
66+
</Box>
4367
</AlphaStack>
68+
<Bleed marginBlockEnd="5">
69+
<Box
70+
background="surface-subdued"
71+
borderBlockStart="divider"
72+
borderRadiusEndStart="2"
73+
borderRadiusEndEnd="2"
74+
padding="5"
75+
>
76+
<AlphaStack gap="2">
77+
<Text variant="headingSm" as="h3">
78+
Deactivated staff accounts
79+
</Text>
80+
<List>
81+
<List.Item>Felix Crafford</List.Item>
82+
<List.Item>Ezequiel Manno</List.Item>
83+
</List>
84+
</AlphaStack>
85+
</Box>
86+
</Bleed>
4487
</AlphaCard>
4588
);
4689
}

0 commit comments

Comments
 (0)