Skip to content

Commit 603dee4

Browse files
authored
Merge branch 'release-10.0.0' into btn-link-fixes
2 parents e042b5e + 6817dff commit 603dee4

File tree

65 files changed

+1508
-316
lines changed

Some content is hidden

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

65 files changed

+1508
-316
lines changed

.storybook/Octicon.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
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
}

.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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
<link rel="stylesheet" href="https://unpkg.com/primer-css@9.2.0/build/build.css">
1+
<link rel="stylesheet" href="https://unpkg.com/octicons@7.0.1/build/build.css">
22
<script src="https://github.com/site/assets/styleguide.js" async></script>

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
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+
116
# 9.6.0
217

318
### 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

modules/primer-base/lib/base.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,6 @@ th {
6464

6565
button {
6666
cursor: pointer;
67+
// Remove border radius added by Chroma macOS
68+
border-radius: 0;
6769
}

modules/primer-base/stories.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import React from 'react'
2+
import { storiesOf } from '@storybook/react'
3+
4+
storiesOf('Base', module)
5+
.add('button', () => (
6+
<button>Button</button>
7+
))
File renamed without changes.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Primer CSS / Branch Name
2+
3+
[![npm version](http://img.shields.io/npm/v/primer-branch-name.svg)](https://www.npmjs.org/package/primer-branch-name)
4+
[![Build Status](https://travis-ci.org/primer/primer-css.svg?branch=master)](https://travis-ci.org/primer/primer-css)
5+
6+
> A nice, consistent way to display branch names.
7+
8+
This repository is a module of the full [primer-css][primer-css] repository.
9+
10+
## Install
11+
12+
This repository is distributed with [npm]. After [installing npm][install-npm], you can install `primer-branch-name` with this command.
13+
14+
```
15+
$ npm install --save primer-branch-name
16+
```
17+
18+
## Usage
19+
20+
The source files included are written in [Sass][sass] (SCSS) You can simply point your sass `include-path` at your `node_modules` directory and import it like this.
21+
22+
```scss
23+
@import "primer-branch-name/index.scss";
24+
```
25+
26+
You can also import specific portions of the module by importing those partials from the `/lib/` folder. _Make sure you import any requirements along with the modules._
27+
28+
## Build
29+
30+
For a compiled **CSS** version of this module, an npm script is included that will output a css version to `build/build.css` The built css file is also included in the npm package:
31+
32+
```
33+
$ npm run build
34+
```
35+
36+
## Documentation
37+
38+
<!-- %docs
39+
title: Branch name
40+
status: Stable
41+
-->
42+
43+
Branch names can be a link name or not:
44+
45+
```html
46+
<span class="branch-name">a_new_feature_branch</span>
47+
<a href="#url" class="branch-name">a_new_feature_branch</a>
48+
```
49+
50+
You may also include an octicon before the branch name text:
51+
52+
```html
53+
<span class="branch-name">
54+
<%= octicon("git-branch") width:16 height:16 %>
55+
a_new_feature_branch
56+
</span>
57+
```
58+
59+
<!-- %enddocs -->
60+
61+
## License
62+
63+
[MIT](./LICENSE) &copy; [GitHub](https://github.com/)
64+
65+
[primer-css]: https://github.com/primer/primer
66+
[docs]: http://primercss.io/
67+
[npm]: https://www.npmjs.com/
68+
[install-npm]: https://docs.npmjs.com/getting-started/installing-node
69+
[sass]: http://sass-lang.com/
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// support files
2+
@import "primer-support/index.scss";
3+
@import "./lib/branch-name.scss";

0 commit comments

Comments
 (0)