Skip to content

Commit

Permalink
Merge branch 'accessibility/issues/925/dialog-component' of https://g…
Browse files Browse the repository at this point in the history
…ithub.com/primer/css into accessibility/issues/925/dialog-component
  • Loading branch information
langermank committed May 10, 2022
2 parents b9747f7 + b94a0b8 commit ea44985
Show file tree
Hide file tree
Showing 54 changed files with 1,225 additions and 356 deletions.
5 changes: 5 additions & 0 deletions .changeset/four-dancers-dress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/css": minor
---

Add `.text-capitalize` utility class
2 changes: 1 addition & 1 deletion .github/workflows/axe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
axe:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get changed files
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy_production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
# If it's 0, we deploy.
should_deploy: ${{ steps.changeset-count.outputs.change_count == 0 }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- id: changeset-count
run: echo "::set-output name=change_count::$(ls .changeset/*.md | grep -v README | wc -l | xargs)"
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/next_major.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Next Major Pull Request
on:
push:
branches:
- 'changeset-release/next_major'

jobs:
next_major_pr:
runs-on: ubuntu-latest
steps:
- name: Don't Merge
run: |
echo "Don't merge the next_major, changeset pr into next_major. Instead when you're ready to release a new major version, change the base of this pr to main, and merge."
exit 1
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v4
- uses: actions/stale@v5
with:

# General settings
Expand Down
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# @primer/css

## 20.0.0

### Major Changes

- [#2049](https://github.com/primer/css/pull/2049) [`f4dba96e`](https://github.com/primer/css/commit/f4dba96e0cb78d3d451226cf60b01187678ced45) Thanks [@langermank](https://github.com/langermank)! - Comment box upload focus border-radius

* [#1744](https://github.com/primer/css/pull/1744) [`942f65a4`](https://github.com/primer/css/commit/942f65a45a18b7042ba1ce2703688b62d874cf18) Thanks [@langermank](https://github.com/langermank)! - Global CSS focus styles

- [#1767](https://github.com/primer/css/pull/1767) [`7e01db97`](https://github.com/primer/css/commit/7e01db97f3f2b9d9383f66385ca16f0bdc06abd1) Thanks [@tobiasahlin](https://github.com/tobiasahlin)! - Marketing: Remove unused pullquote selector

* [#1821](https://github.com/primer/css/pull/1821) [`daa2685c`](https://github.com/primer/css/commit/daa2685c596d894b3bae1896bf97c3319cd9816c) Thanks [@jonrohan](https://github.com/jonrohan)! - UnderlineNav `:focus` styles
Refactor selected state and spacing
Add selected bold state override from github/github

- [#2047](https://github.com/primer/css/pull/2047) [`553d72cc`](https://github.com/primer/css/commit/553d72cc1baaf43a4c743c50cc8881f3811123e9) Thanks [@langermank](https://github.com/langermank)! - UnderlineNav bug fix

* [#2046](https://github.com/primer/css/pull/2046) [`55e2b069`](https://github.com/primer/css/commit/55e2b069a4cbd225af676bef918bbbe2e6cd73b7) Thanks [@langermank](https://github.com/langermank)! - Global focus style CSS from feature flag (next major)

### Patch Changes

- [#2048](https://github.com/primer/css/pull/2048) [`dc529e31`](https://github.com/primer/css/commit/dc529e3102788d5caa136a9d30c58e56721427a7) Thanks [@simurai](https://github.com/simurai)! - Fix headings with an anchor in a summary

* [#2041](https://github.com/primer/css/pull/2041) [`20550bbf`](https://github.com/primer/css/commit/20550bbfaa236ac197ca58805542eaab0bf38fd4) Thanks [@jonrohan](https://github.com/jonrohan)! - Upgrading to stylelint-config-12.4.0

## 19.8.2

### Patch Changes
Expand Down
1 change: 1 addition & 0 deletions docs/content/utilities/typography.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ Change the font weight, styles, and alignment with these utilities.
<p class="lead">Bacon ipsum dolor amet tri-tip chicken kielbasa, cow swine beef corned beef ground round prosciutto hamburger porchetta sausage alcatra tail.</p>
<p class="text-mono">Monospace</p>
<p class="user-select-none">User Select None</p>
<p class="text-capitalize">capitalize</p>
```

## Word-break
Expand Down
4 changes: 2 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
"@koddsson/postcss-sass": "5.0.1",
"@primer/components": "32.1.0",
"@primer/gatsby-theme-doctocat": "3.1.1",
"@primer/octicons": "16.3.0",
"@primer/octicons": "17.0.0",
"@primer/octicons-react": "17.0.0",
"@primer/primitives": "7.3.0",
"@svgr/webpack": "5.5.0",
"autoprefixer": "10.4.2",
"babel-preset-gatsby": "^2.11.1",
"chroma-js": "^2.1.2",
"chroma-js": "^2.4.2",
"clsx": "^1.1.1",
"core-js": "^3.20.3",
"gatsby": "2.32.13",
Expand Down
2 changes: 1 addition & 1 deletion docs/src/stories/components/Link/Link.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const LinkTemplate = ({label, variant, href, noUnderline, focusElement, f
<>
<a
href={href}
className={clsx(variant && `${variant}`, noUnderline && 'no-underline', focusAllElements && 'focus')}
className={clsx('Link', variant && `${variant}`, noUnderline && 'no-underline', focusAllElements && 'focus')}
>
{label}
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
layout: 'padded'
},

excludeStories: ['ButtonTemplate'],
excludeStories: ['MarketingButtonTemplate'],
argTypes: {
variant: {
options: [0, 1, 2, 3], // iterator
Expand Down Expand Up @@ -77,7 +77,7 @@ const focusMethod = function getFocus() {
button.focus()
}

export const ButtonTemplate = ({label, variant, disabled, size, animated, focusElement, focusAllElements}) => (
export const MarketingButtonTemplate = ({label, variant, disabled, size, animated, focusElement, focusAllElements}) => (
<>
<button
disabled={disabled}
Expand Down Expand Up @@ -111,7 +111,7 @@ export const ButtonTemplate = ({label, variant, disabled, size, animated, focusE
</>
)

export const Playground = ButtonTemplate.bind({})
export const Playground = MarketingButtonTemplate.bind({})
Playground.args = {
animated: false,
focusElement: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
layout: 'padded'
},

excludeStories: ['LinkTemplate'],
excludeStories: ['MarketingLinkTemplate'],
argTypes: {
size: {
options: [0, 1], // iterator
Expand Down Expand Up @@ -67,7 +67,7 @@ const focusMethod = function getFocus() {
link.focus()
}

export const LinkTemplate = ({label, emphasis, href, size, focusElement, focusAllElements}) => (
export const MarketingLinkTemplate = ({label, emphasis, href, size, focusElement, focusAllElements}) => (
<>
<a
href={href}
Expand Down Expand Up @@ -98,7 +98,7 @@ export const LinkTemplate = ({label, emphasis, href, size, focusElement, focusAl
</>
)

export const Playground = LinkTemplate.bind({})
export const Playground = MarketingLinkTemplate.bind({})
Playground.args = {
label: 'Link label',
href: '/',
Expand Down
73 changes: 73 additions & 0 deletions docs/src/stories/components/Navigation/UnderlineNav.stories.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import React from 'react'
import clsx from 'clsx'
import {UnderlineNavItemTemplate} from './UnderlineNavItem.stories'

export default {
title: 'Components/Navigation/UnderlineNav',
excludeStories: ['UnderlineNavTemplate'],
layout: 'padded',
argTypes: {
variant: {
options: [0, 1, 2], // iterator
mapping: ['', 'UnderlineNav--right', 'UnderlineNav--full'], // values
control: {
type: 'inline-radio',
labels: ['default', 'align-right', 'fullwidth']
},
description: 'nav positioning options',
table: {
category: 'CSS'
}
},
children: {
description: 'creates a slot for children',
table: {
category: 'HTML'
}
},
actionStart: {
description: 'action to left of nav',
table: {
category: 'HTML'
}
},
actionEnd: {
description: 'action to right of nav',
table: {
category: 'HTML'
}
}
}
}

export const UnderlineNavTemplate = ({variant, children, actionStart, actionEnd}) => (
<>
<nav className={clsx('UnderlineNav', variant && `${variant}`)}>
{actionStart}
{variant === 'UnderlineNav--full' ? (
<div class="container-lg UnderlineNav-container">
<ul class="UnderlineNav-body" role="tablist">
{children}
</ul>
</div>
) : (
<ul class="UnderlineNav-body" role="tablist">
{children}
</ul>
)}
{actionEnd}
</nav>
</>
)

export const Playground = UnderlineNavTemplate.bind({})
Playground.args = {
variant: 0,
children: (
<>
<UnderlineNavItemTemplate label="Item" semanticItemType="button" selected usesDataContent />
<UnderlineNavItemTemplate label="Item" semanticItemType="button" usesDataContent />
<UnderlineNavItemTemplate label="Item" semanticItemType="button" usesDataContent />
</>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import React from 'react'
import clsx from 'clsx'
import {ButtonTemplate} from '../Button/Button.stories'
import {LinkTemplate} from '../Link/Link.stories'

export default {
title: 'Components/Navigation/UnderlineNav/Action',
excludeStories: ['UnderlineNavActionTemplate'],
layout: 'padded',
argTypes: {
semanticItemType: {
options: ['button', 'link'],
control: {
type: 'inline-radio'
},
description: 'item can be a button or a link',
table: {
category: 'HTML'
}
},
label: {
name: 'label',
type: 'string',
description: 'Item label text',
table: {
category: 'HTML'
}
},
focusElement: {
control: {type: 'boolean'},
description: 'set manual focus on item',
table: {
category: 'Interactive'
}
}
}
}

export const UnderlineNavActionTemplate = ({semanticItemType, label, focusElement}) => {
return (
<div class="UnderlineNav-actions">
{semanticItemType === 'button' ? (
<ButtonTemplate label={label} focusAllElements={focusElement} />
) : (
<LinkTemplate label={label} focusAllElements={focusElement} />
)}
</div>
)
}

export const Playground = UnderlineNavActionTemplate.bind({})
Playground.args = {
semanticItemType: 'button',
label: 'Action',
focusElement: false
}

0 comments on commit ea44985

Please sign in to comment.