Skip to content

Commit 39d9f00

Browse files
committed
chore: ad-hoc fixes for next-major branch
1 parent e9b81fa commit 39d9f00

File tree

7 files changed

+19
-14
lines changed

7 files changed

+19
-14
lines changed

contributor-docs/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ If you're looking for something to work on, a great place to start is our issues
2929

3030
A common question asked about Primer Components is how to know what should be added to Primer Components and what is best left as a local component in a consuming application. Though there are no hard & fast rules about what can and cannot be added to Primer Components, here are a few things we take into consideration:
3131

32-
- Is the new feature an existing pattern in Primer CSS or related to UI built at GitHub? Primer Components is first and foremost a library for building UI at GitHub - patterns that aren't currently being used in GitHub UI (either on github.com or in a GitHub owned project outside of github.com) probably shouldn't be added to Primer Components. Exceptions to this could be helper components that don't necessarily render UI but help with the development process (like `Flex`, `Grid`, or `Box`).
32+
- Is the new feature an existing pattern in Primer CSS or related to UI built at GitHub? Primer Components is first and foremost a library for building UI at GitHub - patterns that aren't currently being used in GitHub UI (either on github.com or in a GitHub owned project outside of github.com) probably shouldn't be added to Primer Components. Exceptions to this could be helper components that don't necessarily render UI but help with the development process (like `Box`).
3333

3434
- Does the proposed component get used in more than one or two places across GitHub UI? A component that's only meant to be used in one place and doesn't have potential to be reused in many places probably should exist as a local component. An example of something like this might be a component that renders content specific to a single GitHub product.
3535

docs/content/Autocomplete.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,11 @@ const InOverlayWithCustomScrollContainerRef = () => {
374374
height="xsmall"
375375
focusTrapSettings={{initialFocusRef: inputRef}}
376376
side="inside-top"
377-
renderAnchor={props => <ButtonInvisible {...props}>Pick branches</ButtonInvisible>}
377+
renderAnchor={props => (
378+
<Button variant="invisible" {...props}>
379+
Pick branches
380+
</Button>
381+
)}
378382
>
379383
<FormControl>
380384
<FormControl.Label visuallyHidden>Pick branches</FormControl.Label>

docs/content/core-concepts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Pattern components are components that are made up of several building block com
4545

4646
- Helper Components
4747

48-
Helper components are components that help the user achieve common CSS patterns while maintaining some control over values used. Some examples of helper components are `Flex`, `Text`, `Grid`, and the `Position` components.
48+
Helper components are components that help the user achieve common CSS patterns while maintaining some control over values used. An example of a helper component is `Box`.
4949

5050
## The `as` prop
5151

docs/content/getting-started.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ You can now import Primer React from the main package module:
1818

1919
```javascript
2020
// using import syntax
21-
import {Box, Flex} from '@primer/react'
21+
import {Box} from '@primer/react'
2222
```
2323

2424
```javascript
2525
// using require syntax
26-
const {Box, Flex} = require('@primer/react')
26+
const {Box} = require('@primer/react')
2727
```
2828

2929
### Polyfills & Browser Support
@@ -41,13 +41,11 @@ Module bundlers that use ECMAScript modules (ESM) will automatically tree-shake
4141
```javascript
4242
// using import syntax
4343
import Box from '@primer/react/lib/Box'
44-
import Flex from '@primer/react/lib/Flex'
4544
```
4645

4746
```javascript
4847
// using require syntax
4948
const Box = require('@primer/react/lib/Box')
50-
const Flex = require('@primer/react/lib/Flex')
5149
```
5250

5351
Note that the modules in the `lib` folder are CommonJS-style modules; if you're using ESM and a compatible module bundler, importing files individually from `lib` provides no benefit.
@@ -59,8 +57,8 @@ Primer React ships with a few libraries labeled as peer dependencies. These libr
5957
Primer React requires the following libraries to be installed along with it:
6058

6159
- `styled-components` at version 4.0.0 or higher
62-
- `react` at versions 16.8.0 or higher
63-
- `react-dom` at versions 16.8.0 or higher
60+
- `react` at versions 17.x or higher
61+
- `react-dom` at versions 17.x or higher
6462

6563
## ThemeProvider
6664

docs/content/philosophy.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@ title: Primer React Philosophy
33
---
44

55
## Presentational Components
6-
We are focusing primarily on presentational components that help standardize common design patterns. Primer React components don't handle fetching and submitting data to/from APIs. If you would like to handle data in a Primer Component, feel free to create a wrapper around the Primer Component to do so.
6+
7+
We are focusing primarily on presentational components that help standardize common design patterns. Primer React components don't handle fetching and submitting data to/from APIs. If you would like to handle data in a Primer Component, feel free to create a wrapper around the Primer Component to do so.
78

89
## Assume that people will break the rules, provide safe ways for them to do so
9-
While we aim to standardize design in Primer React, we also provide some flexibility with constraint-based props. We offer system props via [styled-system](https://github.com/styled-system/styled-system) to allow users of the components to make small customizations, such as color and spacing, using values from the theme. Users also have the option to override the theme with a theme of their own.
1010

11+
While we aim to standardize design in Primer React, we also provide some flexibility with constraint-based props. We offer system props via [styled-system](https://github.com/styled-system/styled-system) to allow users of the components to make small customizations, such as color and spacing, using values from the theme. Users also have the option to override the theme with a theme of their own.
1112

1213
## Pattern Components vs Helper Components
1314

1415
Our components can roughly be categorized into two different component types:
1516

16-
1717
- Pattern Components
1818

1919
Pattern components help us repeat commonly used UI patterns and interactions in order to maintain our brand and provide a great user experience. Some examples of pattern components are `Button`, `Avatar`, or `Label`.
2020

2121
- Helper Components
2222

23-
Helper components are components that help the user achieve common CSS patterns while maintaining some control over values used. Some examples of helper components are `Flex`, `Text`, `Grid`, and the `Position` components.
23+
Helper components are components that help the user achieve common CSS patterns while maintaining some control over values used. An example of a helper component is `Box`.

docs/content/system-props.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ All Primer React components have access to the `as` prop, provided by [styled-co
2020

2121
For example, if you wanted to add some flex utilities to the `Text` component, you could do:
2222

23-
```jsx live
23+
```jsx live deprecated
2424
<Text as={Flex}>Hello!</Text>
2525
```
2626

src/deprecated/DropdownMenu/DropdownButton.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ import StyledOcticon from '../../StyledOcticon'
55

66
export type DropdownButtonProps = ButtonProps
77

8+
/**
9+
* @deprecated Use Button with Octicons instead. See https://primer.style/react/drafts/Button2#appending-an-icon for more details.
10+
*/
811
export const DropdownButton = React.forwardRef<HTMLElement, React.PropsWithChildren<DropdownButtonProps>>(
912
({children, ...props}: React.PropsWithChildren<DropdownButtonProps>, ref): JSX.Element => (
1013
<Button ref={ref} type="button" {...props}>

0 commit comments

Comments
 (0)