Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/lazy-jokes-invent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/polaris': minor
---

Added storybook example for `AlphaCard` with subdued section
51 changes: 47 additions & 4 deletions polaris-react/src/components/AlphaCard/AlphaCard.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import type {ComponentMeta} from '@storybook/react';
import {AlphaCard, AlphaStack, Text} from '@shopify/polaris';
import {AlphaCard, AlphaStack, Bleed, Box, List, Text} from '@shopify/polaris';

export default {
component: AlphaCard,
Expand All @@ -13,7 +13,9 @@ export function Default() {
<Text as="h3" variant="headingMd">
Online store dashboard
</Text>
<p>View a summary of your online store’s performance.</p>
<Text variant="bodyMd" as="p">
View a summary of your online store’s performance.
</Text>
</AlphaStack>
</AlphaCard>
);
Expand All @@ -26,7 +28,9 @@ export function WithBackgroundSubdued() {
<Text as="h3" variant="headingMd">
Online store dashboard
</Text>
<p>View a summary of your online store’s performance.</p>
<Text variant="bodyMd" as="p">
View a summary of your online store’s performance.
</Text>
</AlphaStack>
</AlphaCard>
);
Expand All @@ -39,8 +43,47 @@ export function WithBorderRadiusRoundedAbove() {
<Text as="h3" variant="headingMd">
Online store dashboard
</Text>
<p>View a summary of your online store’s performance.</p>
<Text variant="bodyMd" as="p">
View a summary of your online store’s performance.
</Text>
</AlphaStack>
</AlphaCard>
);
}

export function WithSubduedSection() {
return (
<AlphaCard roundedAbove="sm">
<AlphaStack gap="5">
<Text as="h3" variant="headingMd">
Staff accounts
</Text>
<Box paddingBlockEnd="5">
<List>
<List.Item>Felix Crafford</List.Item>
<List.Item>Ezequiel Manno</List.Item>
</List>
</Box>
</AlphaStack>
<Bleed marginBlockEnd="5">
<Box
background="surface-subdued"
borderBlockStart="divider"
borderRadiusEndStart="2"
borderRadiusEndEnd="2"
padding="5"
>
<AlphaStack gap="2">
<Text variant="headingSm" as="h3">
Deactivated staff accounts
</Text>
<List>
<List.Item>Felix Crafford</List.Item>
<List.Item>Ezequiel Manno</List.Item>
</List>
</AlphaStack>
</Box>
</Bleed>
</AlphaCard>
);
}