-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: updates Empty States docs pages for Rails and React
- Loading branch information
Showing
7 changed files
with
132 additions
and
65 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
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
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.
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,92 @@ | ||
import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs/blocks'; | ||
import { Button } from '../Button'; | ||
import { SageTokens } from '../configs'; | ||
import { EmptyState } from './EmptyState'; | ||
|
||
<Meta title="Sage/EmptyState" component={EmptyState} /> | ||
|
||
# Empty State | ||
|
||
The Empty State is displayed for main application features that have never been interacted with before. The Empty State is also used for smaller features in the app that primarily focus on data entry and have no data to show. | ||
|
||
## Accessibility | ||
|
||
Ensure images or graphics that are used in the Empty State component *do not* include alt text so that the image remains decorative and invisible to screen readers. | ||
|
||
## Properties | ||
|
||
<ArgsTable story="Default" /> | ||
|
||
## Size | ||
|
||
The Empty State component has two sizes: default and `compact`. The default size is meant to be used for whole-page empty states and is intended to fill the stage. The compact size features a smaller icon and is intended to fill empty states for smaller contexts. | ||
|
||
### Default | ||
|
||
<Canvas> | ||
<Story name="Default"> | ||
<EmptyState | ||
actions={( | ||
<> | ||
<Button>Add Email Campaign</Button> | ||
<Button subtle={true} color={Button.COLORS.SECONDARY}>Link</Button> | ||
</> | ||
)} | ||
icon={SageTokens.ICONS.PEN} | ||
title="Create your first Email Campaign" | ||
titleTag="h1" | ||
text={(<p> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. | ||
Elit arcu volutpat cursus ultricies ac, ultricies. | ||
Platea sed nibh molestie ut. | ||
</p>)} | ||
/> | ||
</Story> | ||
</Canvas> | ||
|
||
### Compact | ||
|
||
<Canvas> | ||
<Story name="Compact"> | ||
<EmptyState | ||
actions={( | ||
<> | ||
<Button>Add Email Campaign</Button> | ||
<Button subtle={true} color={Button.COLORS.SECONDARY}>Link</Button> | ||
</> | ||
)} | ||
icon={SageTokens.ICONS.PEN} | ||
size={EmptyState.SIZES.COMPACT} | ||
title="Create your first Email Campaign" | ||
titleTag="h1" | ||
text={(<p> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. | ||
Elit arcu volutpat cursus ultricies ac, ultricies. | ||
Platea sed nibh molestie ut. | ||
</p>)} | ||
/> | ||
</Story> | ||
</Canvas> | ||
|
||
### With Graphic | ||
|
||
<Canvas> | ||
<Story name="WithGraphic"> | ||
<EmptyState | ||
actions={( | ||
<> | ||
<Button>Add Email Campaign</Button> | ||
<Button subtle={true} color={Button.COLORS.SECONDARY}>Link</Button> | ||
</> | ||
)} | ||
graphic={(<img src="https://unsplash.it/2000/1100" alt="" />)} | ||
title="Create your first Email Campaign" | ||
titleTag="h1" | ||
text={(<p> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. | ||
Elit arcu volutpat cursus ultricies ac, ultricies. | ||
Platea sed nibh molestie ut. | ||
</p>)} | ||
/> | ||
</Story> | ||
</Canvas> |