Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Props documentation #255

Merged
merged 52 commits into from
Sep 14, 2018
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
1c5407c
Getting started on docs
jonrohan Sep 6, 2018
d7460ad
Merge branch 'master' into doc-brown
jonrohan Sep 7, 2018
7ecc07d
width 100% on doc
jonrohan Sep 7, 2018
2183cba
update BranchName docs
Sep 13, 2018
8306f2d
update Box docs
Sep 13, 2018
c496b06
update BorderBox docs
Sep 13, 2018
676d04f
add Required column
Sep 13, 2018
23f4883
update Button docs
Sep 13, 2018
a7b5145
avatar and branchname tweaks
Sep 13, 2018
851ab59
set defualt size of CircleBadge to medium
Sep 13, 2018
8114d48
update CircleBadge docs
Sep 13, 2018
14737c9
CircleOcticon docs
Sep 13, 2018
61dfbab
fix system props docs
Sep 13, 2018
154b393
add CounterLabel prop docs
Sep 13, 2018
868c837
add Details props docs
Sep 14, 2018
df866b2
Donut chart system props
Sep 14, 2018
34206ee
Dropdown system props docs
Sep 14, 2018
fd6c282
FilterList system props docs
Sep 14, 2018
17290cd
Flash system props doccs
Sep 14, 2018
d31e2b3
flex system props docs
Sep 14, 2018
0183ecc
heading system props docs
Sep 14, 2018
5361bb7
Label system props docs
Sep 14, 2018
1b6288c
Link system props docs
Sep 14, 2018
a6060a3
MergeStatus system props docs
Sep 14, 2018
7408e86
PointerBox system props docs
Sep 14, 2018
fe829bf
Position system props docs
Sep 14, 2018
38e352a
add code quotes
Sep 14, 2018
9ef50ce
Text system props docs
Sep 14, 2018
170aecb
TextInput system props docs
Sep 14, 2018
798bf6f
tooltip system props docs
Sep 14, 2018
6332ec5
underlinenav system props docs
Sep 14, 2018
e11dcc5
docs tweaks
Sep 14, 2018
a597196
add component props docs for DonutChart
Sep 14, 2018
4b65a7d
add Dropdown component props
Sep 14, 2018
a3ba7f5
add FilterList component props
Sep 14, 2018
dca747e
add Flash component prop docs
Sep 14, 2018
64cb4d5
Flex component props docs
Sep 14, 2018
01abd52
Heading component props docs
Sep 14, 2018
c4b9ae8
Label component props docs
Sep 14, 2018
fc605e8
add Link component prop docs
Sep 14, 2018
9c2ca03
MergeStatus component prop docs
Sep 14, 2018
8418f11
PointerBox component props docs
Sep 14, 2018
006b4ad
Position component props docs
Sep 14, 2018
f8e0c16
StateLabel component docs
Sep 14, 2018
e6e9c72
Text component prop docs
Sep 14, 2018
794a085
TextInput component prop docs
Sep 14, 2018
bf5f18f
Add tooltip component prop docs
Sep 14, 2018
8b958a9
UnderlineNav component prop docs
Sep 14, 2018
73db4c1
update snaps
Sep 14, 2018
b16b05d
Revert "update snaps"
Sep 14, 2018
531fda8
update CircleBadge snap
Sep 14, 2018
21e5e33
update snap
Sep 14, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default class MyApp extends App {
<Header />
<FlexContainer>
<SideNav />
<Box maxWidth={1012} my={6} mx={'auto'} px={6} className="markdown-body">
<Box maxWidth={1012} width={'100%'} my={6} mx={'auto'} px={6} className="markdown-body">
<Component {...page} />
</Box>
</FlexContainer>
Expand Down
18 changes: 17 additions & 1 deletion pages/components/docs/Avatar.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@

# Avatar

Avatars are images that users can set as their profile picture. On GitHub, they're always going to be rounded squares. They can be custom photos, uploaded by users, or generated as Identicons as a placeholder.

## Default example

```.jsx
<Avatar src="https://avatars.githubusercontent.com/primer?v=3&s=128" size={128} username="primer" />
<Avatar src="https://avatars.githubusercontent.com/primer?v=3&s=128" size={128} />
```

## System props

Avatar components get `COMMON` system props. Read our [System Props](/system-props) doc page for a full list of available props.

## Component props

| Prop name | Type | Description
| :- | :- | :- |
| alt | String | Passed through to alt on img tag
| isChild | Boolean | adds the `avatar-child` class if present
| size | Number | default: 20, adds the `avatar-small` class if less than 24
| src | String | The source url of the avatar image

export const meta = {
displayName: 'Avatar'
Expand Down
17 changes: 11 additions & 6 deletions pages/components/docs/BorderBox.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# BorderBox

## Default example

```.jsx
<BorderBox>This is a BorderBox</BorderBox>
<BorderBox p={2}>This is a BorderBox with padding.</BorderBox>
<BorderBox boxShadow="small" m={4} p={2}>This is a BorderBox with shadow.</BorderBox>
<BorderBox boxShadow="medium" m={4} p={2}>This is a BorderBox with a medium shadow.</BorderBox>
<BorderBox boxShadow="large" m={4} p={2}>This is a BorderBox with a large shadow.</BorderBox>
<BorderBox boxShadow="extra-large" m={4} p={2}>This is a BorderBox with an extra-large shadow.</BorderBox>
<BorderBox borderColor="green.5" p={2}>This is a BorderBox with a green border.</BorderBox>
```

## System props

BorderBox components get `COMMON` and `LAYOUT` system props. Read our [System Props](/system-props) doc page for a full list of available props.

## Component props

BorderBox does not get any additional props other than the system props mentioned above.

export const meta = { displayName: 'BorderBox'}
66 changes: 0 additions & 66 deletions pages/components/docs/Box.js

This file was deleted.

19 changes: 19 additions & 0 deletions pages/components/docs/Box.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Box

## Default example

```.jsx
<Box>This is a Box</Box>
```

## System props

Box components get `COMMON` and `LAYOUT` system props. Read our [System Props](/system-props) doc page for a full list of available props.

## Component props

| Prop name | Type | Description |
| :- | :- | :- |
| is | String | sets the HTML tag for the component |

export const meta = {displayName: 'Box'}
23 changes: 12 additions & 11 deletions pages/components/docs/BranchName.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@

# BranchName

## Default example

```.jsx
<BranchName>a_new_feature_branch</BranchName>
```

<ExampleHeading mt={3}>BranchName with Octicon</ExampleHeading>
<BranchName>
<Octicon icon={GitBranch} />
a_new_feature_branch
</BranchName>
## System props

<ExampleHeading mt={3}>Linked BranchName</ExampleHeading>
<BranchName is="a" href="/">
a_new_feature_branch
</BranchName>
```
BranchName components get `COMMON` system props. Read our [System Props](/system-props) doc page for a full list of available props.

## Component props

| Prop name | Type | Description |
| :- | :- | :- |
| is | String | sets the HTML tag for the component |
| href | String | a URL to link the component to |

export const meta = {displayName: 'BranchName'}
28 changes: 28 additions & 0 deletions pages/components/docs/Button.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Buttons

## Default examples

```.jsx
<Button>Button</Button>
<ButtonDanger>Button Danger</ButtonDanger>
<ButtonLink>Button Link</ButtonLink>
<ButtonOutline>Button Outline</ButtonOutline>
<ButtonPrimary>Button Primary</ButtonPrimary>
```

## System props

Button components get `COMMON` system props. Read our [System Props](/system-props) doc page for a full list of available props.

## Component props

| Prop name | Type | Description |
| :- | :- | :- |
| is | String | sets the HTML tag for the component, defaults to `button` |
| block | Boolean | adds `display: block` to the component |
| disabled | Boolean | sets the `disabled` attribute on the Button |
| grouped | Boolean | allows you to use Button in a line of Buttons without duplicate borders |
| onClick | Function | function to be called when Button is clicked |
| size | String | use `sm` for a small Button, or `large` for a large Button

export const meta = {displayName: 'Button'}
33 changes: 0 additions & 33 deletions pages/components/docs/Buttons.md

This file was deleted.

31 changes: 17 additions & 14 deletions pages/components/docs/CircleBadge.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@

# CircleBadge

## Default example

```.jsx
<Heading fontSize={3}>Small, medium & large</Heading>
<CircleBadge bg="blue.5" size="small"><img src="https://avatars0.githubusercontent.com/t/1929972?s=280&v=4"/></CircleBadge>
<CircleBadge bg="blue.5" size="medium"><img src="https://avatars0.githubusercontent.com/t/1929972?s=280&v=4"/></CircleBadge>
<CircleBadge bg="blue.5" size="large"><img src="https://avatars0.githubusercontent.com/t/1929972?s=280&v=4"/></CircleBadge>
<CircleBadge>
<Octicon icon={Zap} />
</CircleBadge>
```

<Heading fontSize={3}>With custom width & height</Heading>
<CircleBadge bg="blue.5" size={40}><img src="https://avatars0.githubusercontent.com/t/1929972?s=280&v=4"/></CircleBadge>
## System props

<Heading fontSize={3}>{`With <img> as a child & bg prop`}</Heading>
<CircleBadge bg="blue.5" size="small"><img src="https://avatars0.githubusercontent.com/t/1929972?s=280&v=4"/></CircleBadge>
CircleBadge components get `COMMON` system props. Read our [System Props](/system-props) doc page for a full list of available props.

## Component props

| Prop name | Type | Description |
| :- | :- | :- |
| is | String | sets the HTML tag for the component, defaults to `button` |
| alt | String | alt tag |
| size | String or Number | Use `small`, `medium`, or `large` for default sizes, or provide a custom size |
| src | String | URL for image used in badge if `is` is set to `img` |

<Heading fontSize={3}>With Octicon as child</Heading>
<CircleBadge size="medium">
<Octicon icon={Zap}/>
</CircleBadge>
```

export const meta = {displayName: 'CircleBadge'}
21 changes: 16 additions & 5 deletions pages/components/docs/CircleOcticon.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@

# CircleOcticon

## Default example

```.jsx
<FlexContainer>
<CircleOcticon icon={Check} size={32} bg="green.5" color="white" mr={2} />
<CircleOcticon icon={Zap} size={48} bg="blue.5" color="white" mr={2} />
<CircleOcticon icon={X} size={64} bg="red.5" color="white" mr={2} />
</FlexContainer>
<CircleOcticon icon={Check} size={32} bg="green.5" color="white"/>
```

## System props

CircleOcticon components get `COMMON` system props. Read our [System Props](/system-props) doc page for a full list of available props.

## Component props

| Prop name | Type | Description |
| :- | :- | :- |
| icon | Octicon | Octicon component used in the component |
| size | Number | used to set the width and height of the component |


export const meta = {displayName: 'CircleOcticon'}
11 changes: 11 additions & 0 deletions pages/components/docs/CounterLabel.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@

# CounterLabel

## Default example
```.jsx
<CounterLabel>12</CounterLabel>
<CounterLabel scheme={'gray'}>13</CounterLabel>
<CounterLabel scheme={'gray-light'}>13</CounterLabel>
```

## System props

CounterLabel components get `COMMON` system props. Read our [System Props](/system-props) doc page for a full list of available props.

## Component props

| Prop name | Type | Description |
| :- | :- | :- |
| scheme | String | Pass in 'gray' for a gray background and white text, or 'gray-light' for a lighter gray background and dark text. Omitting the scheme prop renders the default counter scheme |

export const meta = {displayName: 'CounterLabel'}
12 changes: 12 additions & 0 deletions pages/components/docs/Details.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,16 @@
<ExampleHeading>With render prop</ExampleHeading>
<Details render={() => 'hi'} />
```

## System props

Details components get `COMMON` system props. Read our [System Props](/system-props) doc page for a full list of available props.

## Component props

| Prop name | Type | Description |
| :- | :- | :- |
| open | Boolean | Sets the open/closed state of the Details component |
| render | Function | Optional render function as a prop, to allow you to handle toggling and open/closed state within a container component

export const meta = {displayName: 'Details'}
Loading