Skip to content

Commit

Permalink
docs(box): simplify component description
Browse files Browse the repository at this point in the history
- provide fuller description for inline prop
- use more realistic example for tag prop
- use Box in Card examples
  • Loading branch information
theetrain committed Nov 9, 2017
1 parent d04d479 commit 3ea7053
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions src/components/Box/Box.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const getBetweenClasses = (betweenSize, inline) => {
}

/**
* Box - apply spacing within or around components
* Apply spacing within or around components
*
* <span class="docs--badge__new">new!</span> <span class="docs--badge__version">v0.29.0</span>
*/
Expand Down Expand Up @@ -60,11 +60,11 @@ const Box = ({

Box.propTypes = {
/**
* If `true`, render a `<span>` instead of `<div>`.
* If `true`, apply inline flexbox styles to all direct children, arranging them as a row. This is used in conjunction with the `between` prop.
*/
inline: PropTypes.bool,
/**
* Specifies which HTML element to render Box as. Example: `"ul"`
* Specifies which HTML element to render Box as. Example: `"section"`.
*/
tag: PropTypes.string,
/**
Expand Down
28 changes: 14 additions & 14 deletions src/components/Card/Card.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ Cards will stretch to fill their container. Wrap the card in another element to

```jsx
<Card>
<Heading level="h2">Need a hand?</Heading>

<div style={{ margin: "1rem 0" }}>
<Box between={3}>
<Heading level="h2">Need a hand?</Heading>
<Paragraph>
Ready to order? Have a question? We'll get back to you, with volume discounts available to larger accounts.
</Paragraph>
</div>
<ButtonLink href="#">Request sales callback</ButtonLink>
<ButtonLink href="#">Request sales callback</ButtonLink>
</Box>
</Card>
```
Expand All @@ -21,21 +21,21 @@ Card also supports a 'grey' or 'lavender' `variant`. These appear flat, while th
```jsx {"props": {"className": "docs__layout-horizontally"}}
<div className="wrapper">
<Card variant="lavender">
<Heading level="h4">Holiday deal</Heading>
<div style={{ margin: "1rem 0" }}>
<Box between={3}>
<Heading level="h4">Holiday deal</Heading>
<Paragraph size="medium">Get a new smartphone for $0<br/>on a 2-year plan.</Paragraph>
</div>
</Box>
</Card>
<Card variant="grey">
<Heading level="h4">Find the right gift</Heading>
<Box between={3}>
<Heading level="h4">Find the right gift</Heading>
<div style={{ margin: "1rem 0" }}>
<Paragraph>Find something they'll love from our<br/>selection of great devices.</Paragraph>
</div>

<ChevronLink variant="primary" href="">Explore latest devices</ChevronLink>
<ChevronLink variant="primary" href="">Explore latest devices</ChevronLink>
</Box>
</Card>
</div>
```

0 comments on commit 3ea7053

Please sign in to comment.