Skip to content

Commit 7c6f49c

Browse files
committed
Merge branch 'release-10.0.0' into code_padding
2 parents 6626240 + 6817dff commit 7c6f49c

File tree

131 files changed

+3085
-1134
lines changed

Some content is hidden

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

131 files changed

+3085
-1134
lines changed

.github/pull_request_template.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
First, change the base branch from "master" to "dev".
1+
- [ ] First, change the base branch from "master" to "dev".
22

3-
↑ Next, briefly describe your proposal in the title.
3+
- [ ] Next, briefly describe your proposal in the title.
4+
5+
- [ ] Fixes: # (type an issue number after the # if applicable)
46

57
Finally, tell us more about the change here, in the description.
68

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.DS_Store
22
.sass-cache
33
node_modules
4+
**/package-lock.json
45
*.log
56
build
67
_site

.storybook/.babelrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"presets": [
3+
"env",
4+
"react",
5+
"minify"
6+
]
7+
}

.storybook/Octicon.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
11
import React from 'react'
22
import {storiesOf} from '@storybook/react'
33
import octicons from 'octicons'
4-
import SVGInline from 'react-svg-inline'
54

6-
const Octicon = (props) => {
5+
export const Octicon = (props) => {
76
const {name} = props
87
if (name in octicons) {
9-
return <SVGInline svg={octicons[name].toSVG(props)} />
8+
const svg = octicons[name].toSVG(props)
9+
return <span dangerouslySetInnerHTML={ {__html: svg } } />
1010
} else {
1111
throw new Error(`No such octicon: "${name}"!`)
1212
}
1313
}
1414

1515
const story = storiesOf('Octicons', module)
16-
const sizes = [64, 32, 16]
1716

1817
Object.keys(octicons).forEach(name => {
19-
story.add(name, () => (
20-
<div>{sizes.map((size, i) => (
21-
<Octicon name={name} width={size} height={size} key={i} />
22-
))}</div>
23-
))
18+
story.add(name, () => {
19+
return (
20+
<div>
21+
<Octicon name={name} height="64" />
22+
<Octicon name={name} height="32" />
23+
<Octicon name={name} height="16" />
24+
</div>
25+
)
26+
})
2427
})

.storybook/lib/storiesFromMarkdown.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,23 @@ import select from 'unist-util-select'
44
import findBefore from 'unist-util-find-before'
55
import htmlToReact from 'html-to-react'
66
import parsePairs from 'parse-pairs'
7+
import React from 'react'
8+
import ReactDOMServer from 'react-dom/server'
9+
import {Octicon} from '../Octicon'
710

811
const htmlParser = new htmlToReact.Parser()
912

13+
const railsOcticonToReact = (html) => {
14+
// <%= octicon "tools" %> to <Octicon name="tools" />
15+
const octre = /<%= octicon ["']([a-z\-]+)["'][^%]*%>/gi
16+
html = html.replace(octre, (match, name) => {
17+
return ReactDOMServer.renderToStaticMarkup(<Octicon name={name} />)
18+
})
19+
return html
20+
}
21+
1022
const nodeToStory = (node, file) => {
11-
const html = node.value
23+
const html = railsOcticonToReact(node.value)
1224
const element = htmlParser.parse(html)
1325
const pairs = node.lang.replace(/^html\s*/, '')
1426
const attrs = pairs.length ? parsePairs(pairs) : {}

.storybook/preview-head.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
<link rel="stylesheet" href="https://unpkg.com/octicons@7.0.1/build/build.css">
12
<script src="https://github.com/site/assets/styleguide.js" async></script>

.storybook/webpack.config.js

Lines changed: 37 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,43 @@ const path = require("path");
22

33
const modulesPath = path.resolve(__dirname, "../modules")
44

5-
module.exports = {
6-
module: {
7-
rules: [
8-
{
9-
test: /\.md$/,
10-
use: "raw-loader",
11-
},
12-
{
13-
test: /\.scss$/,
14-
loaders: [
15-
"style-loader",
16-
"css-loader",
17-
{
18-
loader: "postcss-loader",
19-
options: {
20-
config: {
21-
path: require.resolve("./postcss.config.js"),
22-
},
5+
module.exports = (config, env) => {
6+
7+
if (env === 'PRODUCTION') {
8+
config.plugins = config.plugins
9+
.filter(plugin => plugin.constructor.name !== 'UglifyJsPlugin')
10+
}
11+
12+
config.module.rules.push(
13+
{
14+
test: /\.md$/,
15+
use: "raw-loader",
16+
},
17+
{
18+
test: /\.scss$/,
19+
loaders: [
20+
"style-loader",
21+
"css-loader",
22+
{
23+
loader: "postcss-loader",
24+
options: {
25+
config: {
26+
path: require.resolve("./postcss.config.js"),
2327
},
2428
},
25-
{
26-
loader: "sass-loader",
27-
options: {
28-
includePaths: [
29-
modulesPath,
30-
],
31-
}
32-
},
33-
],
34-
include: modulesPath,
35-
},
36-
],
37-
},
29+
},
30+
{
31+
loader: "sass-loader",
32+
options: {
33+
includePaths: [
34+
modulesPath,
35+
],
36+
}
37+
},
38+
],
39+
include: modulesPath,
40+
}
41+
)
42+
43+
return config
3844
}

CHANGELOG.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,47 @@
1+
# 10.0.0
2+
3+
### Added
4+
- New module `primer-subhead`. The Subhead is a simple header with a bottom border. It&#39;s designed to be used on settings and configuration pages.
5+
- Importing `.input-group` into `primer-forms` module.
6+
- New module `primer-branch-name` "A nice, consistent way to display branch names."
7+
8+
### Removed
9+
- Removing `primer-cards` module.
10+
- Removing `.form-cards` styles.
11+
12+
### Changes
13+
- Moving `primer-breadcrumb` from `primer-marketing` to `primer-core`
14+
- added `border-radius: 0` to `button` to account for updates in Chroma 62 macOS
15+
16+
# 9.6.0
17+
18+
### Added
19+
- Storybook. We've added a storybook prototyping environment for testing components in seclusion. To start the server run `npm start`
20+
- Adding yeoman generator for creating a primer module. `generator-primer-module`
21+
- Importing `stylelint-config-primer` from https://github.com/primer/stylelint-config-primer/ into monorepo.
22+
- Importing `stylelint-selector-no-utility` from https://github.com/primer/stylelint-selector-no-utility into monorepo.
23+
24+
### Changes
25+
- Deployment and publishing scripts refinements.
26+
27+
# 9.5.0
28+
29+
### Added
30+
- It's now possible to style `<summary>` elements as buttons and have them appear in the active/selected state when the enclosing [`<details>` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) is open. #346
31+
32+
### Changes
33+
- Updates our release candidate versioning logic so that prerelease increments are done on a per-module basis, fixing #350.
34+
35+
# 9.4.0
36+
37+
### Added
38+
- Add `v-align-baseline` class to `primer-utilities` #324
39+
- Add deprecation warnings for `primer-cards` and `primer-forms/lib/form-validation.scss` #347 (these will be removed in v10.0.0)
40+
41+
### Changes
42+
- Update npm metadata for `primer-css`, `primer-core`, `primer-product`, and `primer-marketing` #328
43+
- Remove `HEAD` heading from the changelog #327
44+
145
# 9.3.0
246

347
## Added

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2016 GitHub Inc.
3+
Copyright (c) 2017 GitHub Inc.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

lerna.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
2-
"lerna": "2.0.0-rc.5",
2+
"lerna": "2.4.0",
33
"packages": [
4-
"modules/*"
4+
"modules/*",
5+
"tools/*"
56
],
67
"version": "independent"
78
}

0 commit comments

Comments
 (0)