Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
187 commits
Select commit Hold shift + click to select a range
6b786fd
Switch to usage of variant for StateLabel and remove theme calls
tiaanduplessis Apr 13, 2020
07c0944
Update styled-components and add @styled-system/css
BinaryMuse Apr 13, 2020
fd5fbe5
Get styled-components from the root project
BinaryMuse Apr 13, 2020
39af9e7
Add withSx Hoc
BinaryMuse Apr 13, 2020
c98df7c
Wrap Heading in withSx
BinaryMuse Apr 13, 2020
c5145bd
Refactor sx prop
BinaryMuse Apr 14, 2020
bcaa4c0
Update components from withSx => sx.styled
BinaryMuse Apr 14, 2020
9ef246f
Remove temporary variable
BinaryMuse Apr 14, 2020
7bec957
:art:
BinaryMuse Apr 14, 2020
512df86
Revert styled-component update
BinaryMuse Apr 14, 2020
c5c398f
:art:
BinaryMuse Apr 14, 2020
0c7cacf
Major bump to v19.0.0
BinaryMuse Apr 16, 2020
d128721
Add FLEX to Box and make Flex display:flex
BinaryMuse Apr 14, 2020
fb27355
Add Dropdown.Button to FilteredSearch example
BinaryMuse Apr 14, 2020
688e1b6
Split BorderBox default props
BinaryMuse Apr 16, 2020
3db413f
Shadow Doctocat components that use the old BorderBox styles
BinaryMuse Apr 16, 2020
80774f4
Update components for new BorderBox API
BinaryMuse Apr 16, 2020
d6dba25
Update tests for new BorderBox API
BinaryMuse Apr 16, 2020
a31d019
Update BorderBoxProps TS interface
BinaryMuse Apr 16, 2020
5b37a2a
Add usage note to BorderBox docs
BinaryMuse Apr 16, 2020
88aa3e7
Deprecate Flex.Item
BinaryMuse Apr 17, 2020
4d3d974
Use COMMON instead of space and color for Box system props
BinaryMuse Apr 17, 2020
30ff26e
Update system props tests for Box and BorderBox
BinaryMuse Apr 17, 2020
286582f
Update snapshots
BinaryMuse Apr 17, 2020
9c823f4
Update some more propTypes
BinaryMuse Apr 17, 2020
0eb814d
Remove Flex.Item :fire:
BinaryMuse Apr 17, 2020
ab8ff2f
Remove Flex.Item tests
BinaryMuse Apr 17, 2020
236f05d
Remove "Segoe UI Symbol" from font stack
skw Apr 17, 2020
dd28013
Merge pull request #769 from skw/segoe-ui-symbol
Apr 17, 2020
c27ea3f
Default to center-align button text
albingroen Apr 18, 2020
9983054
Clean up BorderProps
BinaryMuse Apr 20, 2020
0d4f730
Remove unused union
BinaryMuse Apr 20, 2020
f57c5f9
Use COMMON for Box propTypes
BinaryMuse Apr 20, 2020
791e828
Update border styles across package
BinaryMuse Apr 20, 2020
241b40b
Add all border colors from Primer CSS
BinaryMuse Apr 20, 2020
1e1cbc2
Update snapshots
BinaryMuse Apr 20, 2020
864cf54
Merge pull request #761 from primer/mkt/nobody-puts-border-in-a-box
Apr 20, 2020
44d33f9
Merge remote-tracking branch 'origin/release-19.0.0' into mkt/sx-prop
BinaryMuse Apr 21, 2020
bf285df
Add sx.propTypes
BinaryMuse Apr 21, 2020
96de6cb
Make all components sx-prop aware and convert test suites
BinaryMuse Apr 21, 2020
b421aba
Add sx prop info to CONTRIBUTING and fix spelling and linting errors
BinaryMuse Apr 22, 2020
272f7b2
Add initial pass at sx-prop docs
BinaryMuse Apr 22, 2020
03703ce
Remove weird pattern in SelectMenuFilter sx prop
BinaryMuse Apr 22, 2020
c862012
Update Dialog definition
BinaryMuse Apr 22, 2020
e0a165f
Add missing system props types to CONTRIBUTING
BinaryMuse Apr 22, 2020
b859e4d
Update sx props doc
BinaryMuse Apr 22, 2020
3c6bdf8
Add responsive sx prop example
BinaryMuse Apr 22, 2020
95615da
refactor Flash
Apr 23, 2020
a12a19c
fix bad merge
Apr 23, 2020
c21443c
update tests + lint
Apr 23, 2020
cff9e05
Move 'When to use the sx prop' section up
BinaryMuse Apr 27, 2020
fa3943e
Fix formatting and links in Primer Theme docs
BinaryMuse Apr 27, 2020
e9d9c33
Add note on custom theme to sx prop docs
BinaryMuse Apr 27, 2020
c4f78d0
Modify sx prop guidelines
BinaryMuse Apr 27, 2020
398706b
Use SystemStyleObject from @styled-system/css in TS sx prop typings
BinaryMuse Apr 27, 2020
49ab122
Merge remote-tracking branch 'origin/master' into release-19.0.0
BinaryMuse Apr 27, 2020
adf2b0c
Fix 'borders.1' from merge
BinaryMuse Apr 27, 2020
e9c3946
Fix typo 'Dropdown.Caret.propTpyes' to propTypes
andrewhillcode Apr 28, 2020
22ea208
Add documentation about TypeScript support
BinaryMuse Apr 28, 2020
ce2872a
:memo: clarify
BinaryMuse Apr 28, 2020
4243c0c
Clarify problem with FormData in TS
BinaryMuse Apr 28, 2020
de1f380
Add info about importing types from TypeScript
BinaryMuse Apr 28, 2020
ffd4110
Clarify typings installation
BinaryMuse Apr 28, 2020
2f9a2a5
:keyboard: typo
BinaryMuse Apr 28, 2020
41e3cb6
diff -> json
BinaryMuse Apr 28, 2020
9f372d9
Testing some docs changes
BinaryMuse Apr 28, 2020
9cc83ef
Fix link to styled components
BinaryMuse Apr 28, 2020
5f9f315
update docs
Apr 28, 2020
6972e39
add button overrides
Apr 28, 2020
17108d4
update docs
Apr 28, 2020
1dad9ac
Merge pull request #783 from andrewhillcode/andrewhillcode-patch-1
Apr 29, 2020
f4a3a56
Try new redirect strategy
BinaryMuse Apr 28, 2020
72e2bfe
Merge remote-tracking branch 'origin/master' into mkt/sx-prop
BinaryMuse Apr 29, 2020
7a7f79a
Merge remote-tracking branch 'origin/master' into release-19.0.0
BinaryMuse Apr 29, 2020
5d99108
Merge remote-tracking branch 'origin/release-19.0.0' into mkt/sx-prop
BinaryMuse Apr 29, 2020
16614c6
Merge pull request #755 from primer/mkt/sx-prop
Apr 29, 2020
03aeeff
Update import instructions
BinaryMuse Apr 29, 2020
f091d22
Create whole browser bundles and transpile everything else
BinaryMuse Apr 29, 2020
4908b2b
Update bundlesize files
BinaryMuse Apr 29, 2020
4a61104
Update babelrc path in Vercel config
BinaryMuse Apr 29, 2020
3e12398
ohh that typo
BinaryMuse Apr 29, 2020
a1778a8
Merge remote-tracking branch 'origin/release-19.0.0' into mkt/bundle-up
BinaryMuse Apr 29, 2020
700cd1d
Update entry point
BinaryMuse Apr 29, 2020
9285096
Fix formatting and clarify
BinaryMuse Apr 29, 2020
365843c
Add exports checker
BinaryMuse Apr 29, 2020
2a74748
More heading tweaking
BinaryMuse Apr 29, 2020
da29fa6
Words
BinaryMuse Apr 29, 2020
f2abb8f
More wordsing and stuff
BinaryMuse Apr 29, 2020
99316c7
Changesss
BinaryMuse Apr 29, 2020
6d904a8
Fix local development section
BinaryMuse Apr 29, 2020
9e95600
use update border radius
Apr 29, 2020
c46e238
Split out index page and getting started again
BinaryMuse Apr 29, 2020
630852d
Merge branch 'release-19.0.0' into flash-refresh
Apr 29, 2020
9a10ba7
update type
Apr 29, 2020
65d1e23
update snap
Apr 29, 2020
b33b16d
support scheme and variant for a while
Apr 29, 2020
2550484
add deprecation notice
Apr 29, 2020
db152d9
Update deprecate.js
Apr 29, 2020
349f175
babel transform
Apr 29, 2020
6de2240
Where'd that come from
BinaryMuse Apr 29, 2020
d6f959b
Declarated
BinaryMuse Apr 29, 2020
2fcfe7c
remove conditional for now
Apr 29, 2020
cd82d23
lint
Apr 30, 2020
890711d
revert yarn lock changes
Apr 30, 2020
092e228
Update yarn.lock
Apr 30, 2020
464f525
Merge pull request #772 from albingroen/albingroen/button-text-align-fix
Apr 30, 2020
2bcc3fb
update snapshots
Apr 30, 2020
260e70c
Merge branch 'master' into release-19.0.0
Apr 30, 2020
89e3b95
Merge pull request #790 from primer/test-button-changes
Apr 30, 2020
66cbd50
Add `__DEV__` expression for dev mode checks
BinaryMuse Apr 30, 2020
94c6588
Fix button snapshots
BinaryMuse Apr 30, 2020
86eb3ee
Merge pull request #786 from primer/mkt/some-docs-updates
Apr 30, 2020
016441c
Merge remote-tracking branch 'origin/release-19.0.0' into mkt/bundle-up
BinaryMuse Apr 30, 2020
37c03c5
Add instructions for importing individual components
BinaryMuse Apr 30, 2020
1a970d7
Add exports tests and massage some exports
BinaryMuse Apr 30, 2020
b131c5c
use `scale` in variants 🙌
May 1, 2020
9dda091
scale tweak
May 1, 2020
dc88560
lint
May 1, 2020
f08ff27
add deprecated comment to type
May 1, 2020
77ab65b
Merge pull request #777 from primer/flash-refresh
May 1, 2020
ecbc601
Merge remote-tracking branch 'origin/release-19.0.0' into mkt/bundle-up
BinaryMuse May 1, 2020
de5f637
Test deprecations and remove in prod
BinaryMuse May 1, 2020
e476648
Define 'SelectMenuItemProps' as a [discriminated union](https://www.t…
smockle May 4, 2020
06948ae
Add bundle analyzer and make ReactDOM a peer dep
BinaryMuse May 4, 2020
2baa3e1
Import polished functions individually to reduce bundle size
BinaryMuse May 4, 2020
a9445a7
Use actual PropTypes.elementType
BinaryMuse May 4, 2020
d487b5e
Revert importing polished functions individually
BinaryMuse May 4, 2020
0a72ac9
Emit sourcemaps and use them to determine bundle size
BinaryMuse May 4, 2020
9db4bd1
I thought I deleted you :fire:
BinaryMuse May 4, 2020
3eafee8
Merge pull request #794 from primer/SelectMenuItem-ts
May 4, 2020
5b5bd23
Preval the theme file to drop polished from bundle
BinaryMuse May 4, 2020
5a26c6c
Merge branch 'mkt/bundle-up' into mkt/deprecation-testing
BinaryMuse May 4, 2020
9bef137
Add notes on silencing deprecation warnings
BinaryMuse May 4, 2020
8b77183
what is this??
BinaryMuse May 4, 2020
8490287
Transpile to lib/
BinaryMuse May 4, 2020
396c3ca
:memo: wordings
BinaryMuse May 4, 2020
094df0a
Merge pull request #791 from primer/mkt/deprecation-testing
May 4, 2020
fa23a97
wip
BinaryMuse May 5, 2020
abefb67
Merge remote-tracking branch 'origin/release-19.0.0' into tiaanduples…
BinaryMuse May 5, 2020
a757e70
Merge remote-tracking branch 'origin/mkt/bundle-up' into mkt/more-sta…
BinaryMuse May 5, 2020
7d26db6
Update StateLabel variants
BinaryMuse May 5, 2020
1855bdf
Add align='right' prop to SelectMenu.Modal
dmarcey May 5, 2020
63b648a
remove old test
May 5, 2020
bd106fd
Merge branch 'SelectMenuItem' of github.com:primer/components into Se…
May 5, 2020
ef35bdc
Merge pull request #787 from primer/SelectMenuItem
May 5, 2020
8483173
Refactor StateLabel and update tests
BinaryMuse May 5, 2020
c994c89
Update StateLabel typings
BinaryMuse May 5, 2020
d8846ff
:fire: debugging comments
BinaryMuse May 5, 2020
cc019a4
Deprecate StateLabel's small prop
BinaryMuse May 5, 2020
c24cc9a
Merge remote-tracking branch 'origin/master' into release-19.0.0
BinaryMuse May 5, 2020
e69e468
Add examples for all StateLabel variants
May 5, 2020
39ae3a2
Add default for align to docs
dmarcey May 6, 2020
6a2c78e
Add defaultProps for SelectMenuModal
dmarcey May 6, 2020
ffc2ebf
Added test for right-aligned SelectMenu
dmarcey May 6, 2020
711a753
Merge remote-tracking branch 'origin/release-19.0.0' into dmarcey-sel…
dmarcey May 6, 2020
5da8201
Updated snapshot for right-align menu
dmarcey May 6, 2020
9bde038
Add cross-env for portable environment variables during builds
BinaryMuse May 6, 2020
c72014f
Fix rollup's handling of the preval'd theme
BinaryMuse May 7, 2020
9e8536e
Merge pull request #789 from primer/mkt/bundle-up
May 7, 2020
e3b7389
Update src/theme-preval.js
May 7, 2020
3c73e96
Update src/StateLabel.js
May 7, 2020
e96bf9b
Update snapshots from suggested changes
BinaryMuse May 7, 2020
cdd348b
:shirt: Remove some lint
BinaryMuse May 7, 2020
d4874f0
Merge pull request #798 from primer/mkt/more-state-label-work
May 7, 2020
2692a87
Don't transpile to CJS in dev
BinaryMuse May 7, 2020
999f12a
Transpile to CJS, but use dist/browser.esm for module field
BinaryMuse May 7, 2020
a622007
Merge remote-tracking branch 'origin/release-19.0.0' into dmarcey-sel…
BinaryMuse May 7, 2020
2f1d9d3
Fixup SelectMenuModal propTypes
BinaryMuse May 7, 2020
f969681
Create dev and prod bundles
BinaryMuse May 7, 2020
cef96b0
Fixup bundlecheck keys
BinaryMuse May 7, 2020
632292e
*ACTUALLY* fix bundlesize keys
BinaryMuse May 7, 2020
a224c95
Update docs
BinaryMuse May 7, 2020
67c6200
One more doc tweak
BinaryMuse May 7, 2020
9a6b35c
Update docs for bundle usage
BinaryMuse May 7, 2020
98c8670
Transpile separate CJS and ESM libs
BinaryMuse May 7, 2020
a9b8031
Some more docs changes
BinaryMuse May 7, 2020
0975930
Merge pull request #802 from primer/mkt/tweak-babel-transpilation
May 7, 2020
b435b3d
Bump sha
BinaryMuse May 7, 2020
17f08f5
make as prop optional
May 7, 2020
1393faa
Export from transpiled lib/ instead of src/
BinaryMuse May 7, 2020
06a6607
give Position components flex props by extending Box
May 7, 2020
89d565f
Merge pull request #804 from primer/mkt/dont-import-from-there
May 7, 2020
206e450
update types
May 7, 2020
9d9c12c
typo
May 7, 2020
a82214b
:memo: Wordsings
BinaryMuse May 8, 2020
7b34d3c
update docs
May 8, 2020
4470bee
Merge pull request #803 from primer/fix-select-item-type
May 8, 2020
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
20 changes: 0 additions & 20 deletions .babelrc

This file was deleted.

3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"plugin:jsx-a11y/recommended",
"plugin:react-hooks/recommended"
],
"globals": {
"__DEV__": "readonly"
},
"rules": {
"import/no-namespace": 0,
"no-shadow": 0,
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ node_modules
.DS_Store
coverage/
dist/
lib/
lib-esm/
public/
stats.html
110 changes: 75 additions & 35 deletions CONTRIBUTING.md

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions babel-defines.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const shared = {
__DEV__: "process.env.NODE_ENV !== 'production'"
}

module.exports = {
development: shared,
test: shared,
production: {
...shared,
__DEV__: 'false',
'process.env.NODE_ENV': "'production'"
}
}
39 changes: 39 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
const defines = require('./babel-defines')

function replacementPlugin(env) {
return ['babel-plugin-transform-replace-expressions', {replace: defines[env]}]
}

const sharedPlugins = [
'macros',
'preval',
'add-react-displayname',
'babel-plugin-styled-components',
'@babel/plugin-proposal-object-rest-spread'
]

const runtimePlugins = [['@babel/plugin-transform-runtime', {version: '7.9.2', helpers: true}]]

function makePresets(moduleValue) {
return [
['@babel/preset-react', {modules: moduleValue}],
['@babel/preset-env', {modules: moduleValue}]
]
}

module.exports = {
env: {
development: {
presets: makePresets(process.env.BABEL_MODULE || false),
plugins: [...sharedPlugins, ...runtimePlugins, replacementPlugin('development')]
},
production: {
presets: makePresets(false),
plugins: [...sharedPlugins, ...runtimePlugins, replacementPlugin('production')]
},
test: {
presets: makePresets('commonjs'),
plugins: [...sharedPlugins, replacementPlugin('test')]
}
}
}
1 change: 0 additions & 1 deletion css.js

This file was deleted.

9 changes: 6 additions & 3 deletions docs/content/BorderBox.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@ BorderBox is a Box component with a border. When no `borderColor` is present, th
<BorderBox>This is a BorderBox</BorderBox>
```

Note that `BorderBox` has default props set for `borderWidth`, `borderStyle`, and `borderColor`. This means that you cannot use `border={0} borderBottom={1}` or similar patterns; instead, use individual properties like `borderWidth={0} borderBottomWidth={1}`.

## System props

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

## Component props

| Prop name | Type | Default | Description |
| :- | :- | :-: | :- |
| border | String | 'borders.1' (from theme) | Sets the border, use theme values or provide your own. |
| borderWidth | String | '1px' | Sets the border, use theme values or provide your own. |
| borderStyle | String | 'solid' | Sets the border style, use theme values or provide your own. |
| borderColor | String | 'gray.2' (from theme) | Sets the border color, use theme values or provide your own. |
| borderRadius | String or Number| 'radii.1' (from theme)| Sets the border radius, use theme values or provide your own. |
| borderRadius | String or Number| 2 (from theme)| Sets the border radius, use theme values or provide your own. |
| boxShadow | String | | Sets box shadow, use theme values or provide your own. |
2 changes: 1 addition & 1 deletion docs/content/Box.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The Box component serves as a wrapper component for most layout related needs. U

## System props

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

## Component props

Expand Down
3 changes: 2 additions & 1 deletion docs/content/FilteredSearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ The FilteredSearch component helps style a Dropdown and a TextInput side-by-side

```jsx live
<FilteredSearch>
<Dropdown title="Filter">
<Dropdown>
<Dropdown.Button>Filter</Dropdown.Button>
<Dropdown.Menu direction="sw">
<Dropdown.Item>Item 1</Dropdown.Item>
<Dropdown.Item>Item 2</Dropdown.Item>
Expand Down
18 changes: 16 additions & 2 deletions docs/content/Flash.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,21 @@ The Flash component informs users of successful or pending actions.
## Default example

```jsx live
<Flash m={4} scheme="green"> Flash green </Flash>
<Flash>Default Flash</Flash>
<Flash variant="success">Success Flash</Flash>
<Flash variant="warning">Warning Flash</Flash>
<Flash variant="danger">Danger Flash</Flash>
```

## With an icon

Flash components with icons inside of them will automatically set the correct color for the icon depending on the type of Flash, as well as applying the correct right margin.

```jsx live
<Flash variant="success">
<StyledOcticon icon={Check}/>
Success!
</Flash>
```

## System props
Expand All @@ -19,4 +33,4 @@ Flash components get `COMMON` system props. Read our [System Props](/system-prop
| Name | Type | Default | Description |
| :- | :- | :-: | :- |
| full | Boolean | | Creates a full width Flash component|
| scheme | String | blue | Can be one of `green`, `yellow`, or `red` - sets the background color, border, and text color of the Flash component
| variant | String | default | Can be one of `default`, `success`, `warning`, or `danger` - sets the background color and border of the Flash component |
5 changes: 2 additions & 3 deletions docs/content/Flex.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
title: Flex
---

Flex is a component that will allow you to use flexbox properties.
The `Flex` component behaves the same as the `Box` component except that it has `display: flex` set by default.

*Previously, `Flex.Item` was used for flex item specific properties - we've added all properties to the `Flex` component, but are keeping Flex.Item around for backwards compatibility.*
*Previously, a `Flex.Item` component was used for flex item specific properties; `Box` now contains all those properties and should be used in its place.*

## Default example

Expand All @@ -28,7 +28,6 @@ Flex is a component that will allow you to use flexbox properties.

Flex components get `FLEX`, `COMMON`, and `LAYOUT` system props.


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

## Component props
Expand Down
2 changes: 1 addition & 1 deletion docs/content/PointerBox.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ PointerBox is a [BorderBox](./BorderBox) component with a caret added to it.

## System props

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

## Component props

Expand Down
2 changes: 1 addition & 1 deletion docs/content/Popover.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ render(<PopoverDemo />)

## System props

`Popover` components get `COMMON`, `LAYOUT`, and `POSITION` system props. `Popover.Content` components get `COMMON`, `LAYOUT`, and `BORDER` system props. Read our [System Props](/system-props) doc page for a full list of available props.
`Popover` components get `COMMON`, `LAYOUT`, and `POSITION` system props. `Popover.Content` components get `COMMON`, `LAYOUT`, `BORDER`, and `FLEX` system props. Read our [System Props](/system-props) doc page for a full list of available props.

## Component props

Expand Down
2 changes: 1 addition & 1 deletion docs/content/Position.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The Position component is a wrapper component that gives the containing componen

## System props

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

## Component props

Expand Down
32 changes: 29 additions & 3 deletions docs/content/SelectMenu.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,36 @@ Used to wrap the content in a `SelectMenu`.
</SelectMenu.Menu>
```

### Right-aligned modal

Use the `align='right'` prop to align the modal to the right. Note that this only modifies alignment for the modal, and not the SelectMenu itself. You will need to wrap the SelectMenu in a relatively positioned element for this to work properly.

```jsx live
<Relative display="flex" justifyContent="flex-end">
<SelectMenu>
<Button as="summary">Projects</Button>
<SelectMenu.Modal align="right">
<SelectMenu.Header>Projects</SelectMenu.Header>
<SelectMenu.List>
<SelectMenu.Item href="#">Primer Components bugs</SelectMenu.Item>
<SelectMenu.Item href="#">Primer Components roadmap</SelectMenu.Item>
<SelectMenu.Item href="#"> Project 3</SelectMenu.Item>
<SelectMenu.Item href="#">Project 4</SelectMenu.Item>
</SelectMenu.List>
</SelectMenu.Modal>
</SelectMenu>
</Relative>
```

### System Props

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

### Component Props
SelectMenu.Modal components do not get any additional props besides system props.

| Prop name | Type | Default | Description |
| :-------- | :----- | :------ | ------------------------------------------------- |
| align | String | 'left' | Use `right` to align the select menu to the right |


## SelectMenu.List
Expand All @@ -114,10 +138,12 @@ SelectMenu.List components do not get any additional props besides system props.

## SelectMenu.Item

Individual items in a select menu.
Individual items in a select menu. SelectMenu.Item renders an anchor tag by default, you'll need to make sure to provide the appropriate `href`.

You can use a `button` tag instead by utilizing the [`as` prop](/core-concepts#the-as-prop). Be sure to consider [which HTML element is the right choice](https://marcysutton.com/links-vs-buttons-in-modern-web-applications) for your usage of the component.

```jsx
<SelectMenu.Item selected={true}>
<SelectMenu.Item href="/link/to/thing" selected={true}>
{/* wraps an individual list item*/}
</SelectMenu.Item>
```
Expand Down
4 changes: 2 additions & 2 deletions docs/content/SideNav.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Add the `variant="lightweight"` prop to `SideNav` to render an alternative, more

```jsx live
<BorderBox p={3} backgroundColor='gray.0' maxWidth={360}>
<BorderBox border='none' borderBottom={1} mb={2} pb={1}>
<BorderBox borderWidth={0} borderBottomWidth={1} borderRadius={0} mb={2} pb={1}>
<Heading as="h5" fontSize={1} color="gray.7">Menu</Heading>
</BorderBox>
<SideNav variant="lightweight">
Expand Down Expand Up @@ -133,7 +133,7 @@ If using React Router, you can use the `as` prop to render the element as a `Nav

## System props

`SideNav` components get `COMMON`, `BORDER`, and `LAYOUT` system props. `SideNav.Link` components get `COMMON` and `TYPOGRAPHY` system props. Read our [System Props](/system-props) doc page for a full list of available props.
`SideNav` components get `COMMON`, `BORDER`, `LAYOUT`, and `FLEX` system props. `SideNav.Link` components get `COMMON` and `TYPOGRAPHY` system props. Read our [System Props](/system-props) doc page for a full list of available props.

## Component props

Expand Down
11 changes: 8 additions & 3 deletions docs/content/StateLabel.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ Use StateLabel components to show the status of an issue or pull request.
## Default example

```jsx live
<StateLabel status="issueOpened">Open</StateLabel>
<StateLabel status="issueOpened">Open</StateLabel>
<StateLabel status="issueClosed">Closed</StateLabel>
<StateLabel status="pullOpened">Open</StateLabel>
<StateLabel status="pullClosed">Closed</StateLabel>
<StateLabel status="pullMerged">Merged</StateLabel>
<StateLabel status="draft">Draft</StateLabel>
```

## System props
Expand All @@ -17,5 +22,5 @@ StateLabel components get `COMMON` system props. Read our [System Props](/system

| Name | Type | Default | Description |
| :- | :- | :-: | :- |
| small | Boolean | | Used to create a smaller version of the default StateLabel |
| status | String | | Can be one of `issueOpened`, `issueClosed`, `pullOpened`, `pullClosed` or `pullMerged`.
| variant | String | 'normal' | a value of `small` or `normal` results in a smaller or larger version of the StateLabel. |
| status | String | | Can be one of `issueOpened`, `issueClosed`, `pullOpened`, `pullClosed`, `pullMerged`, or `draft`.
Loading