-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #138 from wpmudev/selector-documentation
Selector
- Loading branch information
Showing
22 changed files
with
2,901 additions
and
28 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
557 changes: 557 additions & 0 deletions
557
packages/components/selector/stories/images/forminator.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
343 changes: 343 additions & 0 deletions
343
packages/components/selector/stories/images/on-modal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
179 changes: 179 additions & 0 deletions
179
packages/components/selector/stories/images/on-settings.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions
22
packages/components/selector/stories/images/pro-selector.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
170 changes: 170 additions & 0 deletions
170
packages/components/selector/stories/images/remove-process.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
210 changes: 210 additions & 0 deletions
210
packages/components/selector/stories/images/spacing.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
220 changes: 220 additions & 0 deletions
220
packages/components/selector/stories/images/variations.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,13 +1,24 @@ | ||
import { Page, Section } from '@wpmudev/storybook'; | ||
import { Unstyled } from '@storybook/blocks'; | ||
import { Page } from "@wpmudev/storybook" | ||
import { Unstyled } from "@storybook/blocks" | ||
|
||
import TabUsage from "./tabs/TabUsage.mdx" | ||
import TabCode from "./tabs/TabCode.mdx" | ||
import TabExamples from "./tabs/TabExamples.mdx" | ||
|
||
<Unstyled> | ||
<Section title="Shhh... Not much to see here at the moment, but stay tuned!" contained={true}> | ||
<p> | ||
Quiet for now, but get ready! Exciting stuff is coming. Our developers are working really hard behind the scenes to make it happen. Stay curious and excited! 🌟👷 | ||
</p> | ||
<p> | ||
In the meantime, feel free to explore our demo page for this component. | ||
</p> | ||
</Section> | ||
<Page.Tabs | ||
title="Selector" | ||
subtitle="The selector is a block that provides organised options to users." | ||
status="draft" | ||
> | ||
<div id="usage" label="Usage"> | ||
<TabUsage /> | ||
</div> | ||
<div id="code" label="Code"> | ||
<TabCode /> | ||
</div> | ||
<div id="examples" label="Examples"> | ||
<TabExamples /> | ||
</div> | ||
</Page.Tabs> | ||
</Unstyled> |
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
41 changes: 41 additions & 0 deletions
41
packages/components/selector/stories/tabs/Examples/Alignment.mdx
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,41 @@ | ||
import { Section, Preview, Snippet } from "@wpmudev/storybook" | ||
import { Selector } from "../../../src" | ||
import dedent from "dedent" | ||
|
||
export const leftCode = dedent` | ||
<Selector alignment="left" title="Option 1" iconOrBrandUrl="Bell" /> | ||
` | ||
|
||
export const centerCode = dedent` | ||
<Selector alignment="center" title="Option 1" iconOrBrandUrl="Bell" /> | ||
` | ||
|
||
<Section | ||
title="Left" | ||
contained={true} | ||
border={true} | ||
style={{ paddingRight: 0, paddingLeft: 0 }} | ||
> | ||
<Preview wrapper={true}> | ||
<div style={{ padding: 50 }}> | ||
<Selector alignment="left" title="Option 1" iconOrBrandUrl="Bell" /> | ||
</div> | ||
</Preview> | ||
<Snippet language="js">{leftCode}</Snippet> | ||
|
||
</Section> | ||
|
||
<Section | ||
title="Center" | ||
contained={true} | ||
border={true} | ||
style={{ paddingRight: 0, paddingLeft: 0 }} | ||
> | ||
<Preview wrapper={true}> | ||
<div style={{ padding: 50 }}> | ||
<Selector alignment="center" title="Option 1" iconOrBrandUrl="Bell" /> | ||
</div> | ||
</Preview> | ||
<Snippet language="js">{centerCode}</Snippet> | ||
|
||
</Section> |
125 changes: 125 additions & 0 deletions
125
packages/components/selector/stories/tabs/Examples/States.mdx
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,125 @@ | ||
import { Section, Preview, Snippet, Code } from "@wpmudev/storybook" | ||
import { Selector } from "../../../src" | ||
import dedent from "dedent" | ||
|
||
export const disabledCode = dedent` | ||
<Selector | ||
isDisabled={true} | ||
variation="compound" | ||
title="Option 1" | ||
description="Lorem ipsum dolor sit amet, consectetur adipisicing elit." | ||
iconOrBrandUrl="Bell" | ||
/> | ||
` | ||
|
||
export const allowRemoveCode = dedent` | ||
<Selector | ||
allowRemove={true} | ||
variation="compound" | ||
title="Option 1" | ||
description="Lorem ipsum dolor sit amet, consectetur adipisicing elit." | ||
iconOrBrandUrl="Bell" | ||
/> | ||
` | ||
|
||
export const proVersion = dedent` | ||
<Selector | ||
isPro={true} | ||
variation="compound" | ||
title="Option 1" | ||
description="Lorem ipsum dolor sit amet, consectetur adipisicing elit." | ||
iconOrBrandUrl="Bell" | ||
/> | ||
` | ||
|
||
export const customTagCode = dedent` | ||
<Selector | ||
tag="New" | ||
tagColor="green" | ||
variation="compound" | ||
title="Option 1" | ||
description="Lorem ipsum dolor sit amet, consectetur adipisicing elit." | ||
iconOrBrandUrl="Bell" | ||
/> | ||
` | ||
|
||
<Section | ||
title="Disabled" | ||
contained={true} | ||
border={true} | ||
style={{ paddingRight: 0, paddingLeft: 0 }} | ||
> | ||
<Preview wrapper={true}> | ||
<Selector | ||
isDisabled={true} | ||
variation="compound" | ||
title="Option 1" | ||
description="Lorem ipsum dolor sit amet, consectetur adipisicing elit." | ||
iconOrBrandUrl="Bell" | ||
/> | ||
</Preview> | ||
<Snippet language="js">{disabledCode}</Snippet> | ||
</Section> | ||
|
||
<Section | ||
title="Allow Remove" | ||
contained={true} | ||
border={true} | ||
style={{ paddingRight: 0, paddingLeft: 0 }} | ||
> | ||
<p> | ||
When <Code small={true}>allowRemove</Code> is set to{" "} | ||
<Code small={true}>true</Code>, a button for deletion will appear on hover | ||
</p> | ||
<Preview wrapper={true}> | ||
<Selector | ||
allowRemove={true} | ||
variation="compound" | ||
title="Option 1" | ||
description="Lorem ipsum dolor sit amet, consectetur adipisicing elit." | ||
iconOrBrandUrl="Bell" | ||
/> | ||
</Preview> | ||
<Snippet language="js">{allowRemoveCode}</Snippet> | ||
</Section> | ||
|
||
<Section | ||
title="Pro Version" | ||
contained={true} | ||
border={true} | ||
style={{ paddingRight: 0, paddingLeft: 0 }} | ||
> | ||
<Preview wrapper={true}> | ||
<Selector | ||
isPro={true} | ||
variation="compound" | ||
title="Option 1" | ||
description="Lorem ipsum dolor sit amet, consectetur adipisicing elit." | ||
iconOrBrandUrl="Bell" | ||
/> | ||
</Preview> | ||
<Snippet language="js">{proVersion}</Snippet> | ||
</Section> | ||
|
||
<Section | ||
title="Custom Tag" | ||
contained={true} | ||
border={true} | ||
style={{ paddingRight: 0, paddingLeft: 0 }} | ||
> | ||
<p>Use the prop <Code small={true}>tag</Code> to add a custom text displayed in a tag</p> | ||
<p>You can also use the prop <Code small={true}>tagColor</Code> to customize its color</p> | ||
|
||
<Preview wrapper={true}> | ||
<Selector | ||
tag="New" | ||
tagColor="green" | ||
variation="compound" | ||
title="Option 1" | ||
description="Lorem ipsum dolor sit amet, consectetur adipisicing elit." | ||
iconOrBrandUrl="Bell" | ||
/> | ||
</Preview> | ||
<Snippet language="js">{customTagCode}</Snippet> | ||
|
||
</Section> |
Oops, something went wrong.