This repository has been archived by the owner on Mar 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(button): added 'icon' prop for Button component (#13)
- Loading branch information
Alexandru Buliga
authored
Jul 31, 2018
1 parent
953674c
commit 6795a5d
Showing
24 changed files
with
324 additions
and
57 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
7 changes: 6 additions & 1 deletion
7
docs/src/examples/components/Button/Types/ButtonExample.shorthand.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 |
---|---|---|
@@ -1,6 +1,11 @@ | ||
import React from 'react' | ||
import { Button } from '@stardust-ui/react' | ||
|
||
const ButtonExample = () => <Button content="Click here" /> | ||
const ButtonExample = () => ( | ||
<div> | ||
<Button content="Click here" /> | ||
<Button content="See how this very long text shows up on the button" /> | ||
</div> | ||
) | ||
|
||
export default ButtonExample |
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,6 +1,11 @@ | ||
import React from 'react' | ||
import { Button } from '@stardust-ui/react' | ||
|
||
const ButtonExample = () => <Button>Click here</Button> | ||
const ButtonExample = () => ( | ||
<div> | ||
<Button>Click here</Button> | ||
<Button>See how this very long text shows up on the button</Button> | ||
</div> | ||
) | ||
|
||
export default ButtonExample |
11 changes: 11 additions & 0 deletions
11
docs/src/examples/components/Button/Types/ButtonExampleContentAndIcon.shorthand.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,11 @@ | ||
import React from 'react' | ||
import { Button } from '@stardust-ui/react' | ||
|
||
const ButtonExampleContentAndIcon = () => ( | ||
<div> | ||
<Button type="primary" icon="book" content="Click me before" iconPosition="before" /> | ||
<Button type="secondary" icon="coffee" content="Click me after" iconPosition="after" /> | ||
</div> | ||
) | ||
|
||
export default ButtonExampleContentAndIcon |
17 changes: 17 additions & 0 deletions
17
docs/src/examples/components/Button/Types/ButtonExampleContentAndIcon.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,17 @@ | ||
import React from 'react' | ||
import { Button, Icon, Text } from '@stardust-ui/react' | ||
|
||
const ButtonExampleContentAndIcon = () => ( | ||
<div> | ||
<Button type="primary" icon iconPosition="before"> | ||
<Icon name="book" color="white" xSpacing="after" /> | ||
<Text content="Click me before" /> | ||
</Button> | ||
<Button type="secondary" icon iconPosition="after"> | ||
<Text content="Click me after" /> | ||
<Icon name="coffee" xSpacing="before" /> | ||
</Button> | ||
</div> | ||
) | ||
|
||
export default ButtonExampleContentAndIcon |
11 changes: 11 additions & 0 deletions
11
docs/src/examples/components/Button/Types/ButtonExampleEmphasis.shorthand.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,11 @@ | ||
import React from 'react' | ||
import { Button } from '@stardust-ui/react' | ||
|
||
const ButtonExampleEmphasis = () => ( | ||
<div> | ||
<Button type="primary" content="Primary" /> | ||
<Button type="secondary" content="Secondary" /> | ||
</div> | ||
) | ||
|
||
export default ButtonExampleEmphasis |
6 changes: 6 additions & 0 deletions
6
docs/src/examples/components/Button/Types/ButtonExampleIcon.shorthand.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,6 @@ | ||
import React from 'react' | ||
import { Button } from '@stardust-ui/react' | ||
|
||
const ButtonExampleIcon = () => <Button type="primary" icon="book" /> | ||
|
||
export default ButtonExampleIcon |
10 changes: 10 additions & 0 deletions
10
docs/src/examples/components/Button/Types/ButtonExampleIcon.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,10 @@ | ||
import React from 'react' | ||
import { Button, Icon } from '@stardust-ui/react' | ||
|
||
const ButtonExampleIcon = () => ( | ||
<Button type="primary" icon> | ||
<Icon name="book" color="white" xSpacing="none" /> | ||
</Button> | ||
) | ||
|
||
export default ButtonExampleIcon |
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
8 changes: 6 additions & 2 deletions
8
docs/src/examples/components/Button/Variations/ButtonExampleCircular.shorthand.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 |
---|---|---|
@@ -1,6 +1,10 @@ | ||
import React from 'react' | ||
import { Button } from '@stardust-ui/react' | ||
|
||
const ButtonExampleCircular = () => <Button circular content="C" /> | ||
|
||
const ButtonExampleCircular = () => ( | ||
<div> | ||
<Button circular content="C" /> | ||
<Button circular icon="book" /> | ||
</div> | ||
) | ||
export default ButtonExampleCircular |
11 changes: 9 additions & 2 deletions
11
docs/src/examples/components/Button/Variations/ButtonExampleCircular.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 |
---|---|---|
@@ -1,6 +1,13 @@ | ||
import React from 'react' | ||
import { Button } from '@stardust-ui/react' | ||
import { Button, Icon } from '@stardust-ui/react' | ||
|
||
const ButtonExampleCircular = () => <Button circular>C</Button> | ||
const ButtonExampleCircular = () => ( | ||
<div> | ||
<Button circular>C</Button> | ||
<Button circular icon> | ||
<Icon name="book" xSpacing="none" /> | ||
</Button> | ||
</div> | ||
) | ||
|
||
export default ButtonExampleCircular |
11 changes: 11 additions & 0 deletions
11
docs/src/examples/components/Button/Variations/ButtonExampleEmphasisCircular.shorthand.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,11 @@ | ||
import React from 'react' | ||
import { Button } from '@stardust-ui/react' | ||
|
||
const ButtonExampleEmphasisCircular = () => ( | ||
<div> | ||
<Button type="primary" circular icon="coffee" /> | ||
<Button type="secondary" circular icon="book" /> | ||
</div> | ||
) | ||
|
||
export default ButtonExampleEmphasisCircular |
10 changes: 5 additions & 5 deletions
10
docs/src/examples/components/Button/Variations/ButtonExampleEmphasisCircular.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
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
22 changes: 22 additions & 0 deletions
22
docs/src/examples/components/Text/States/TextExampleTruncated.shorthand.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,22 @@ | ||
import React from 'react' | ||
import { Text } from '@stardust-ui/react' | ||
|
||
const [notTruncatedText, truncatedText] = [ | ||
'Some long text here to see how it looks when not truncated', | ||
'Some long text here to see how it looks truncated', | ||
].map(text => | ||
Array(5) | ||
.fill(text) | ||
.join('. '), | ||
) | ||
|
||
const TextExampleTruncated = () => ( | ||
<div style={{ overflow: 'hidden', textOverflow: 'ellipsis' }}> | ||
<Text content={notTruncatedText} /> | ||
<br /> | ||
<br /> | ||
<Text truncated content={truncatedText} /> | ||
</div> | ||
) | ||
|
||
export default TextExampleTruncated |
22 changes: 22 additions & 0 deletions
22
docs/src/examples/components/Text/States/TextExampleTruncated.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,22 @@ | ||
import React from 'react' | ||
import { Text } from '@stardust-ui/react' | ||
|
||
const [notTruncatedText, truncatedText] = [ | ||
'Some long text here to see how it looks when not truncated', | ||
'Some long text here to see how it looks truncated', | ||
].map(text => | ||
Array(5) | ||
.fill(text) | ||
.join('. '), | ||
) | ||
|
||
const TextExampleTruncated = () => ( | ||
<div style={{ overflow: 'hidden', textOverflow: 'ellipsis' }}> | ||
<Text>{notTruncatedText}</Text> | ||
<br /> | ||
<br /> | ||
<Text truncated>{truncatedText}</Text> | ||
</div> | ||
) | ||
|
||
export default TextExampleTruncated |
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
31 changes: 24 additions & 7 deletions
31
docs/src/examples/components/Text/Types/TextSizesExample.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 |
---|---|---|
@@ -1,15 +1,32 @@ | ||
import React from 'react' | ||
import { Text } from '@stardust-ui/react' | ||
|
||
const sizes = ['xs', 'sm', 'md', 'lg', 'xl', '2x', '3x', '4x'] | ||
|
||
const TextSizesExample = () => ( | ||
<div> | ||
{sizes.map(value => ( | ||
<div> | ||
<Text size={value}>Dicta voluptatum dolorem.</Text> | ||
</div> | ||
))} | ||
<div> | ||
<Text size="xs">Dicta voluptatum dolorem.</Text> | ||
</div> | ||
<div> | ||
<Text size="sm">Dicta voluptatum dolorem.</Text> | ||
</div> | ||
<div> | ||
<Text size="md">Dicta voluptatum dolorem.</Text> | ||
</div> | ||
<div> | ||
<Text size="lg">Dicta voluptatum dolorem.</Text> | ||
</div> | ||
<div> | ||
<Text size="xl">Dicta voluptatum dolorem.</Text> | ||
</div> | ||
<div> | ||
<Text size="2x">Dicta voluptatum dolorem.</Text> | ||
</div> | ||
<div> | ||
<Text size="3x">Dicta voluptatum dolorem.</Text> | ||
</div> | ||
<div> | ||
<Text size="4x">Dicta voluptatum dolorem.</Text> | ||
</div> | ||
</div> | ||
) | ||
export default TextSizesExample |
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
Oops, something went wrong.