Skip to content

Commit 77abf53

Browse files
authored
Adding typographic components and Mona Sans typeface (#23)
1 parent 4b00b72 commit 77abf53

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+10431
-7734
lines changed

.changeset/clean-tomatoes-care.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@primer/react-brand': patch
3+
---
4+
5+
add Text and Heading components

.changeset/light-poets-provide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@primer/react-brand': patch
3+
---
4+
5+
forward className in Hero

.github/workflows/check_for_changeset.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ on:
1010
# For `skip-label` only.
1111
- 'labeled'
1212
- 'unlabeled'
13+
branches-ignore:
14+
- '**' ## temporarily disabling as the workflow is consistently failing
1315

1416
jobs:
1517
check-for-changeset:

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88

99
jobs:
1010
ci:
11+
if: ${{ github.repository == 'primer/react-brand' }}
1112
name: Install and run tests
1213
runs-on: ubuntu-latest
1314
steps:

.github/workflows/deploy_docs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ permissions:
1212

1313
jobs:
1414
build_deploy:
15+
if: ${{ github.repository == 'primer/react-brand' }}
1516
name: Build and deploy
1617
uses: primer/.github/.github/workflows/deploy.yml@main
1718
with:

.github/workflows/deploy_docs_preview.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,53 @@ on:
44
pull_request:
55

66
permissions:
7+
checks: write
78
contents: read
9+
deployments: write
810
pages: write
911
id-token: write
1012

1113
jobs:
1214
deploy:
15+
if: ${{ github.repository == 'primer/react-brand' }}
1316
name: Build and deploy
1417
uses: primer/.github/.github/workflows/deploy_preview.yml@main
1518
with:
1619
node_version: 16
20+
install: npm ci && cd docs && npm ci && cd ..
1721
build: npm run build && npm run build:docs:preview
1822
output_dir: docs/public/
23+
24+
deploy-storybook:
25+
if: ${{ github.repository == 'primer/react-brand' }}
26+
name: Preview Storybook
27+
runs-on: ubuntu-latest
28+
needs: deploy
29+
steps:
30+
- uses: actions/checkout@v3
31+
32+
- uses: chrnorm/[email protected]
33+
name: Create GitHub deployment for storybook
34+
id: storybook
35+
with:
36+
token: ${{ secrets.GITHUB_TOKEN }}
37+
environment: Preview Storybook
38+
target_url: '${{ needs.deploy.outputs.deployment_url }}storybook'
39+
40+
- name: Update storybook deployment status (success)
41+
if: success()
42+
uses: chrnorm/[email protected]
43+
with:
44+
token: ${{ secrets.GITHUB_TOKEN }}
45+
environment_url: '${{ needs.deploy.outputs.deployment_url }}storybook'
46+
target_url: '${{ needs.deploy.outputs.deployment_url }}storybook'
47+
state: 'success'
48+
deployment_id: ${{ steps.storybook.outputs.deployment_id }}
49+
50+
- name: Update storybook deployment status (failure)
51+
if: failure()
52+
uses: chrnorm/[email protected]
53+
with:
54+
token: ${{ secrets.GITHUB_TOKEN }}
55+
state: 'failure'
56+
deployment_id: ${{ steps.storybook.outputs.deployment_id }}

.github/workflows/release_canary.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ on:
44
push:
55
branches-ignore:
66
- main
7-
- "changeset-release/main"
7+
- 'changeset-release/main'
88

99
jobs:
1010
release-canary:
11+
if: ${{ github.repository == 'primer/react-brand' }}
1112
name: Canary
1213
uses: primer/.github/.github/workflows/release_canary.yml@main
1314
secrets:

.github/workflows/release_candidate.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ name: Release candidate
33
on:
44
push:
55
branches:
6-
- "changeset-release/main"
6+
- 'changeset-release/main'
77

88
jobs:
99
release-candidate:
10+
if: ${{ github.repository == 'primer/react-brand' }}
1011
name: Candidate
1112
uses: primer/.github/.github/workflows/release_candidate.yml@main
1213
secrets:

.storybook/preview.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {ThemeProvider} from '../src'
22
import styles from './preview.module.css'
3-
import '../lib/css/gh-variables.color.css'
3+
import '../src/css/stylesheets'
4+
import '../fonts/fonts.css'
45

56
export const globalTypes = {
67
colorMode: {

docs/content/components/Heading.mdx

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
title: Heading
3+
status: Experimental
4+
source: https://github.com/primer/react-brand/tree/main/src/Heading/Heading.tsx
5+
storybook: '/react-brand/storybook?path=/story/components-hero--centered'
6+
description: Use the Heading component to render body content
7+
---
8+
9+
import {HeadingTags, defaultHeadingTag} from '@primer/react-brand'
10+
import {Box as Container} from '@primer/react'
11+
import {PropTableValues} from '../../src/components'
12+
13+
```js
14+
import {Heading} from '@primer/react-brand'
15+
```
16+
17+
## Examples
18+
19+
### Default
20+
21+
```jsx live
22+
<Container pl={3}>
23+
<Heading>This is my super sweet heading</Heading>
24+
</Container>
25+
```
26+
27+
### Scale
28+
29+
```jsx live
30+
<Container pl={3}>
31+
<Heading as="h1">Heading 1</Heading>
32+
<Heading as="h2">Heading 2</Heading>
33+
<Heading as="h3">Heading 3</Heading>
34+
<Heading as="h4">Heading 4</Heading>
35+
<Heading as="h5">Heading 5</Heading>
36+
<Heading as="h6">Heading 6</Heading>
37+
</Container>
38+
```
39+
40+
### Sizes
41+
42+
The `Heading` size is determined by the type of HTML element specified. E.g. `h1`, `h2`, `h3`, `h4`, `h5` or `h6`.
43+
44+
```jsx live
45+
<Container pl={3}>
46+
<Heading as="h6">This is my super sweet heading</Heading>
47+
</Container>
48+
```
49+
50+
## Component props
51+
52+
### Heading
53+
54+
| Name | Type | Default | Description |
55+
| :--- | :----------------------------------------------------- | :----------------------------------------------: | :---------------------------------- |
56+
| `as` | <PropTableValues values={HeadingTags} addLineBreaks /> | <PropTableValues values={[defaultHeadingTag]} /> | Applies the underlying HTML element |

0 commit comments

Comments
 (0)