-
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(site): add components docs (#1556)
- Loading branch information
Showing
261 changed files
with
1,177 additions
and
2,614 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1 @@ | ||
export type ToastPosition = | ||
| 'top-left' | ||
| 'top-center' | ||
| 'top-right' | ||
| 'bottom-left' | ||
| 'bottom-center' | ||
| 'bottom-right' | ||
|
||
export type ToastVariant = 'informational' | 'success' | 'critical' | 'warning' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from 'react' | ||
import { Menu, MenuItem, MenuSeparator } from '@vtex/shoreline' | ||
|
||
export default function Example() { | ||
return ( | ||
<Menu label="Open"> | ||
<MenuItem>New Tab</MenuItem> | ||
<MenuItem>New Item</MenuItem> | ||
<MenuSeparator /> | ||
<MenuItem>Downloads</MenuItem> | ||
</Menu> | ||
) | ||
} |
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,47 @@ | ||
import React, { useState } from 'react' | ||
import { | ||
Button, | ||
Modal, | ||
ModalContent, | ||
ModalDismiss, | ||
ModalFooter, | ||
ModalHeader, | ||
ModalHeading, | ||
} from '@vtex/shoreline' | ||
|
||
export default function Example() { | ||
const [open, setOpen] = useState(false) | ||
|
||
const toggle = () => { | ||
setOpen((o) => !o) | ||
} | ||
|
||
return ( | ||
<> | ||
<Button onClick={toggle}>Open Modal</Button> | ||
<Modal open={open} onClose={toggle}> | ||
<ModalHeader> | ||
<ModalHeading>Heading</ModalHeading> | ||
<ModalDismiss /> | ||
</ModalHeader> | ||
<ModalContent> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do | ||
eiusmod tempor incididunt ut labore et dolore magna aliqua. Elit | ||
scelerisque mauris pellentesque pulvinar pellentesque habitant morbi | ||
tristique senectus. Morbi tristique senectus et netus et. Nec | ||
tincidunt praesent semper feugiat nibh sed pulvinar proin gravida. | ||
Morbi tristique senectus et netus et malesuada fames ac. Ultricies leo | ||
integer malesuada nunc vel risus commodo viverra maecenas. Nunc congue | ||
nisi vitae suscipit tellus mauris a diam maecenas. Dui accumsan sit | ||
amet nulla facilisi morbi tempus. | ||
</ModalContent> | ||
<ModalFooter> | ||
<Button onClick={toggle}>Close</Button> | ||
<Button variant="primary" onClick={toggle}> | ||
Ok | ||
</Button> | ||
</ModalFooter> | ||
</Modal> | ||
</> | ||
) | ||
} |
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,16 @@ | ||
import React from 'react' | ||
import { Page, PageContent, PageHeader, PageHeading } from '@vtex/shoreline' | ||
import { DecorativeBox } from '../components/decorative-box' | ||
|
||
export default function Example() { | ||
return ( | ||
<Page> | ||
<PageHeader> | ||
<PageHeading>Heading</PageHeading> | ||
</PageHeader> | ||
<PageContent> | ||
<DecorativeBox height="200px" /> | ||
</PageContent> | ||
</Page> | ||
) | ||
} |
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 { Search } from '@vtex/shoreline' | ||
|
||
export default function Example() { | ||
return <Search /> | ||
} |
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,13 @@ | ||
import React from 'react' | ||
import { Skeleton } from '@vtex/shoreline' | ||
|
||
export default function Example() { | ||
return ( | ||
<Skeleton | ||
style={{ | ||
width: 100, | ||
height: 100, | ||
}} | ||
/> | ||
) | ||
} |
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 { Spinner } from '@vtex/shoreline' | ||
|
||
export default function Example() { | ||
return <Spinner description="loading" /> | ||
} |
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,24 @@ | ||
import React from 'react' | ||
import { Tab, TabList, TabPanel, TabProvider } from '@vtex/shoreline' | ||
import { DecorativeBox } from '../components/decorative-box' | ||
|
||
export default function Example() { | ||
return ( | ||
<TabProvider> | ||
<TabList> | ||
<Tab>Blue</Tab> | ||
<Tab>Green</Tab> | ||
<Tab>Purple</Tab> | ||
</TabList> | ||
<TabPanel> | ||
<DecorativeBox height="200px" color="blue" /> | ||
</TabPanel> | ||
<TabPanel> | ||
<DecorativeBox height="200px" color="green" /> | ||
</TabPanel> | ||
<TabPanel> | ||
<DecorativeBox height="200px" color="purple" /> | ||
</TabPanel> | ||
</TabProvider> | ||
) | ||
} |
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,62 @@ | ||
import React from 'react' | ||
import { | ||
Table, | ||
TableBody, | ||
TableCell, | ||
TableHeader, | ||
TableHeaderCell, | ||
TableRow, | ||
Tag, | ||
} from '@vtex/shoreline' | ||
|
||
export default function Example() { | ||
return ( | ||
<Table | ||
columnWidths={[ | ||
'minmax(min-content, auto)', | ||
'minmax(min-content, auto)', | ||
'minmax(min-content, auto)', | ||
'minmax(min-content, auto)', | ||
]} | ||
> | ||
<TableHeader> | ||
<TableRow> | ||
<TableHeaderCell>Name</TableHeaderCell> | ||
<TableHeaderCell>Description</TableHeaderCell> | ||
<TableHeaderCell>Brand</TableHeaderCell> | ||
<TableHeaderCell>Category</TableHeaderCell> | ||
</TableRow> | ||
</TableHeader> | ||
<TableBody> | ||
<TableRow> | ||
<TableCell>iPhone 15</TableCell> | ||
<TableCell>A nice phone</TableCell> | ||
<TableCell>Apple</TableCell> | ||
<TableCell> | ||
<Tag variant="secondary">smartphones</Tag> | ||
</TableCell> | ||
</TableRow> | ||
<TableRow> | ||
<TableCell>Aventador SVJ</TableCell> | ||
<TableCell>Good italian car</TableCell> | ||
<TableCell>Lamborghini</TableCell> | ||
<TableCell> | ||
<Tag variant="secondary" color="cyan"> | ||
cars | ||
</Tag> | ||
</TableCell> | ||
</TableRow> | ||
<TableRow> | ||
<TableCell>Uno with stair</TableCell> | ||
<TableCell>Fastest car on earth</TableCell> | ||
<TableCell>Fiat</TableCell> | ||
<TableCell> | ||
<Tag variant="secondary" color="cyan"> | ||
cars | ||
</Tag> | ||
</TableCell> | ||
</TableRow> | ||
</TableBody> | ||
</Table> | ||
) | ||
} |
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 { Tag } from '@vtex/shoreline' | ||
|
||
export default function Example() { | ||
return <Tag>Active</Tag> | ||
} |
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 { Text } from '@vtex/shoreline' | ||
|
||
export default function Example() { | ||
return <Text variant="body">Short text</Text> | ||
} |
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 { Textarea } from '@vtex/shoreline' | ||
|
||
export default function Example() { | ||
return <Textarea maxLength={120} optional resizable={false} /> | ||
} |
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,27 @@ | ||
import React from 'react' | ||
import { Button, ToastStack, toast } from '@vtex/shoreline' | ||
|
||
export default function Example() { | ||
function promiseToResolve() { | ||
return new Promise(function (resolve) { | ||
setTimeout(resolve, 2000) | ||
}) | ||
} | ||
|
||
return ( | ||
<> | ||
<Button | ||
onClick={() => | ||
toast.promise(promiseToResolve(), { | ||
success: 'Resolved', | ||
error: 'Promisse has error', | ||
loading: 'Loading', | ||
}) | ||
} | ||
> | ||
Show toast | ||
</Button> | ||
<ToastStack /> | ||
</> | ||
) | ||
} |
Oops, something went wrong.