Skip to content

Commit 6a90859

Browse files
authored
Merge pull request #400 from primer/release-10.1.0
Release 10.1.0
2 parents c865391 + 18166a0 commit 6a90859

File tree

76 files changed

+594
-204
lines changed

Some content is hidden

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

76 files changed

+594
-204
lines changed

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
## 10.1.0 (2017-11-15)
2+
3+
#### :rocket: Enhancement
4+
* [#385](https://github.com/primer/primer/pull/385) New Avatar stack. ([@califa](https://github.com/califa) & [@sophshep](https://github.com/sophshep))
5+
* [#404](https://github.com/primer/primer/pull/404) Tooltip component updates ([@broccolini](https://github.com/broccolini))
6+
7+
#### :memo: Documentation
8+
* [#405](https://github.com/primer/primer/pull/405) Add deprecation warning for `.avatar-stack`. ([@jonrohan](https://github.com/jonrohan))
9+
* [#391](https://github.com/primer/primer/pull/391) Update shields.io url to https. ([@NuttasitBoonwat](https://github.com/NuttasitBoonwat))
10+
11+
#### Committers: 5
12+
- Diana Mounter ([broccolini](https://github.com/broccolini))
13+
- Joel Califa ([califa](https://github.com/califa))
14+
- Jon Rohan ([jonrohan](https://github.com/jonrohan))
15+
- Sophie Shepherd ([sophshep](https://github.com/sophshep))
16+
- [NuttasitBoonwat](https://github.com/NuttasitBoonwat)
17+
118
# 10.0.1 (2017-11-14)
219

320
#### :bug: Bug Fix

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Primer
22

3-
[![npm version](http://img.shields.io/npm/v/primer.svg)](https://www.npmjs.org/package/primer)
3+
[![npm version](https://img.shields.io/npm/v/primer.svg)](https://www.npmjs.org/package/primer)
44
[![Build Status](https://travis-ci.org/primer/primer.svg?branch=master)](https://travis-ci.org/primer/primer)
55

66
Primer is the design system that powers GitHub. Primer includes 23 packages that are grouped into 3 core meta-packages for easy install. Each package and meta-package is independently versioned and distributed via npm, so it's easy to include all or part of Primer within your own project.
@@ -13,10 +13,10 @@ The Primer repo is managed as a monorepo that is composed of many npm packages.
1313

1414
| Package | Version |
1515
|---|---|
16-
| **[primer](/modules/primer)** <br />Includes all 23 packages | [![npm](http://img.shields.io/npm/v/primer.svg)](https://www.npmjs.com/package/primer) |
17-
| [primer-core](/modules/primer-core) | [![npm](http://img.shields.io/npm/v/primer-core.svg)](https://www.npmjs.com/package/primer-core) |
18-
| [primer-product](/modules/primer-product) | [![npm](http://img.shields.io/npm/v/primer-product.svg)](https://www.npmjs.com/package/primer-product) |
19-
| [primer-marketing](/modules/primer-marketing) | [![npm](http://img.shields.io/npm/v/primer-marketing.svg)](https://www.npmjs.com/package/primer-marketing) |
16+
| **[primer](/modules/primer)** <br />Includes all 23 packages | [![npm](https://img.shields.io/npm/v/primer.svg)](https://www.npmjs.com/package/primer) |
17+
| [primer-core](/modules/primer-core) | [![npm](https://img.shields.io/npm/v/primer-core.svg)](https://www.npmjs.com/package/primer-core) |
18+
| [primer-product](/modules/primer-product) | [![npm](https://img.shields.io/npm/v/primer-product.svg)](https://www.npmjs.com/package/primer-product) |
19+
| [primer-marketing](/modules/primer-marketing) | [![npm](https://img.shields.io/npm/v/primer-marketing.svg)](https://www.npmjs.com/package/primer-marketing) |
2020

2121
## Install
2222

modules/primer-alerts/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Primer Alerts
22

3-
[![npm version](http://img.shields.io/npm/v/primer-alerts.svg)](https://www.npmjs.org/package/primer-alerts)
3+
[![npm version](https://img.shields.io/npm/v/primer-alerts.svg)](https://www.npmjs.org/package/primer-alerts)
44
[![Build Status](https://travis-ci.org/primer/primer.svg?branch=master)](https://travis-ci.org/primer/primer)
55

66
> Flash messages, or alerts, inform users of successful or pending actions. Use them sparingly. Don’t show more than one at a time.

modules/primer-alerts/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "1.5.2",
2+
"version": "1.5.3",
33
"name": "primer-alerts",
44
"description": "Flash messages, or alerts, inform users of successful or pending actions.",
55
"homepage": "http://primer.github.io/",
@@ -27,7 +27,7 @@
2727
"test": "../../script/npm-run-all build lint"
2828
},
2929
"dependencies": {
30-
"primer-support": "4.4.2"
30+
"primer-support": "4.5.0"
3131
},
3232
"keywords": [
3333
"alerts",

modules/primer-avatars/README.md

Lines changed: 55 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Primer Avatars
22

3-
[![npm version](http://img.shields.io/npm/v/primer-avatars.svg)](https://www.npmjs.org/package/primer-avatars)
3+
[![npm version](https://img.shields.io/npm/v/primer-avatars.svg)](https://www.npmjs.org/package/primer-avatars)
44
[![Build Status](https://travis-ci.org/primer/primer.svg?branch=master)](https://travis-ci.org/primer/primer)
55

66
> Avatars are images that users can set as their profile picture. On GitHub, they’re always going to be rounded squares. They can be custom photos, uploaded by users, or generated as Identicons as a placeholder.
@@ -75,14 +75,62 @@ When you need a larger parent avatar, and a smaller child one, overlaid slightly
7575

7676
### Avatar stack
7777

78-
Stacked avatars can be used to show who is participating in thread when there is limited space available. When you hover over the stack, the avatars will reveal themselves. Optimally, you should put no more than 3 avatars in the stack.
78+
Stacked avatars can be used to show multiple collaborators or participants when there is limited space available. When you hover over the stack, the avatars will reveal themselves.
7979

8080
```html
81-
<span class="avatar-stack tooltipped tooltipped-s" aria-label="jonrohan, aaronshekey, and josh">
82-
<img alt="@jonrohan" class="avatar" height="39" alt="jonrohan" src="/jonrohan.png" width="39">
83-
<img alt="@aaronshekey" class="avatar" height="39" alt="aaronshekey" src="/aaronshekey.png" width="39">
84-
<img alt="@josh" class="avatar" height="39" alt="josh" src="/josh.png" width="39">
85-
</span>
81+
<div class="AvatarStack AvatarStack--three-plus">
82+
<div class="AvatarStack-body tooltipped tooltipped-se tooltipped-align-left-1" aria-label="octocat, octocat, and octocat">
83+
<img class="avatar" height="20" alt="@octocat" src="https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png" width="20">
84+
<img class="avatar" height="20" alt="@octocat" src="https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png" width="20">
85+
<img class="avatar" height="20" alt="@octocat" src="https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png" width="20">
86+
</div>
87+
</div>
88+
```
89+
90+
Based on the number of avatars in the stack, add these modifier classes:
91+
- `AvatarStack--two` for 2 avatars.
92+
- `AvatarStack--three-plus` for 3 or more avatars.
93+
94+
If you have more than three avatars, add a div with the classes `avatar avatar-more` as the third avatar in the stack, as such:
95+
96+
```html
97+
<div class="AvatarStack AvatarStack--three-plus">
98+
<div class="AvatarStack-body tooltipped tooltipped-se tooltipped-align-left-1" aria-label="octocat, octocat, octocat, octocat, and octocat">
99+
<img class="avatar" height="20" alt="@octocat" src="https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png" width="20">
100+
<img class="avatar" height="20" alt="@octocat" src="https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png" width="20">
101+
<div class="avatar avatar-more"></div>
102+
<img class="avatar" height="20" alt="@octocat" src="https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png" width="20">
103+
<img class="avatar" height="20" alt="@octocat" src="https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png" width="20">
104+
<img class="avatar" height="20" alt="@octocat" src="https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png" width="20">
105+
</div>
106+
</div>
107+
```
108+
109+
You can also link individual avatars. To do this shift the `avatar` class over to the anchor:
110+
111+
```html
112+
<div class="AvatarStack AvatarStack--two">
113+
<div class="AvatarStack-body tooltipped tooltipped-se tooltipped-align-left-1" aria-label="octocat and octocat">
114+
<a href="#" class="avatar">
115+
<img height="20" alt="@octocat" src="https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png" width="20">
116+
</a>
117+
<a href="#" class="avatar">
118+
<img height="20" alt="@octocat" src="https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png" width="20">
119+
</a>
120+
</div>
121+
</div>
122+
```
123+
124+
Use `AvatarStack--right` to right-align the avatar stack. Remember to switch the alignment of tooltips when making this change.
125+
126+
```html
127+
<div class="AvatarStack AvatarStack--three-plus AvatarStack--right">
128+
<div class="AvatarStack-body tooltipped tooltipped-sw tooltipped-align-right-1" aria-label="octocat, octocat, and octocat">
129+
<img class="avatar" height="20" alt="@octocat" src="https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png" width="20">
130+
<img class="avatar" height="20" alt="@octocat" src="https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png" width="20">
131+
<img class="avatar" height="20" alt="@octocat" src="https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png" width="20">
132+
</div>
133+
</div>
86134
```
87135

88136
## Circle Badge

modules/primer-avatars/lib/avatar-stack.scss

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// there is limited space available.
33
//
44
// No styleguide references
5+
@warn ".avatar-stack will be deprecated in version 11. Use .AvatarStack instead.";
6+
57
.avatar-stack {
68
display: inline-block;
79
white-space: nowrap;
@@ -43,3 +45,137 @@
4345
}
4446
}
4547
}
48+
49+
// Refactored, new avatar stack:
50+
51+
.AvatarStack {
52+
position: relative;
53+
min-width: 26px;
54+
height: 20px;
55+
56+
.AvatarStack-body {
57+
position: absolute;
58+
}
59+
60+
&.AvatarStack--two {
61+
min-width: 36px;
62+
}
63+
64+
&.AvatarStack--three-plus {
65+
min-width: 46px;
66+
}
67+
}
68+
69+
.AvatarStack-body {
70+
display: flex;
71+
background: $bg-white;
72+
73+
.avatar {
74+
position: relative;
75+
z-index: 2;
76+
display: flex;
77+
width: 20px;
78+
height: 20px;
79+
box-sizing: content-box;
80+
margin-right: -11px;
81+
background-color: $bg-white;
82+
border-right: $border-width $border-style $white;
83+
border-radius: 2px;
84+
transition: margin 0.1s ease-in-out;
85+
86+
&:first-child {
87+
z-index: 3;
88+
}
89+
90+
&:last-child {
91+
z-index: 1;
92+
}
93+
94+
// stylelint-disable selector-max-type
95+
img {
96+
border-radius: 2px;
97+
}
98+
// stylelint-enable selector-max-type
99+
100+
// Account for 4+ avatars
101+
&:nth-child(n+4) {
102+
display: none;
103+
opacity: 0;
104+
}
105+
}
106+
107+
&:hover {
108+
.avatar {
109+
margin-right: 3px;
110+
}
111+
112+
.avatar:nth-child(n+4) {
113+
display: flex;
114+
opacity: 1;
115+
}
116+
117+
.avatar-more {
118+
display: none !important;
119+
}
120+
}
121+
}
122+
123+
.avatar.avatar-more {
124+
z-index: 1;
125+
margin-right: 0;
126+
background: $gray-100;
127+
128+
&::before,
129+
&::after {
130+
position: absolute;
131+
display: block;
132+
height: 20px;
133+
content: "";
134+
border-radius: 2px;
135+
outline: $border-width $border-style $white;
136+
}
137+
138+
&::before {
139+
width: 17px;
140+
background: $gray-200;
141+
}
142+
143+
&::after {
144+
width: 14px;
145+
background: $gray-300;
146+
}
147+
}
148+
149+
// Right aligned variation
150+
151+
.AvatarStack--right {
152+
.AvatarStack-body {
153+
right: 0;
154+
flex-direction: row-reverse;
155+
156+
&:hover .avatar {
157+
margin-right: 0;
158+
margin-left: 3px;
159+
}
160+
}
161+
162+
.avatar.avatar-more {
163+
background: $gray-300;
164+
165+
&::before {
166+
width: 5px;
167+
}
168+
169+
&::after {
170+
width: 2px;
171+
background: $gray-100;
172+
}
173+
}
174+
175+
.avatar {
176+
margin-right: 0;
177+
margin-left: -11px;
178+
border-right: 0;
179+
border-left: $border-width $border-style $white;
180+
}
181+
}

modules/primer-avatars/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "1.4.2",
2+
"version": "1.5.0",
33
"name": "primer-avatars",
44
"description": "Basic styles for user profile avatars.",
55
"homepage": "http://primer.github.io/",
@@ -27,7 +27,7 @@
2727
"test": "../../script/npm-run-all build lint"
2828
},
2929
"dependencies": {
30-
"primer-support": "4.4.2"
30+
"primer-support": "4.5.0"
3131
},
3232
"keywords": [
3333
"avatars",

modules/primer-avatars/stories.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,43 @@ storiesOf('Avatars', module)
2626
</div>
2727

2828
))
29+
.add('AvatarStack', () => (
30+
<div>
31+
<div className='AvatarStack AvatarStack-three-plus mb-2'>
32+
<div className='AvatarStack-body tooltipped tooltipped-se tooltipped-align-left-1' aria-label='five avatars'>
33+
<img className='avatar' alt='Uncle Cat' width='20' height='20' src='https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png'/>
34+
<img className='avatar' alt='Uncle Cat' width='20' height='20' src='https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png'/>
35+
<div className='avatar-more avatar'></div>
36+
<img className='avatar' alt='Uncle Cat' width='20' height='20' src='https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png'/>
37+
<img className='avatar' alt='Uncle Cat' width='20' height='20' src='https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png'/>
38+
<img className='avatar' alt='Uncle Cat' width='20' height='20' src='https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png'/>
39+
</div>
40+
</div>
41+
<div className='AvatarStack AvatarStack-two mb-2'>
42+
<div className='AvatarStack-body tooltipped tooltipped-se tooltipped-align-left-1' aria-label='two avatars'>
43+
<img className='avatar' alt='Uncle Cat' width='20' height='20' src='https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png'/>
44+
<img className='avatar' alt='Uncle Cat' width='20' height='20' src='https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png'/>
45+
</div>
46+
</div>
47+
<div className='AvatarStack AvatarStack-three-plus AvatarStack--right mb-2'>
48+
<div className='AvatarStack-body tooltipped tooltipped-sw tooltipped-align-right-1' aria-label='five avatars'>
49+
<img className='avatar' alt='Uncle Cat' width='20' height='20' src='https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png'/>
50+
<img className='avatar' alt='Uncle Cat' width='20' height='20' src='https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png'/>
51+
<div className='avatar-more avatar'></div>
52+
<img className='avatar' alt='Uncle Cat' width='20' height='20' src='https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png'/>
53+
<img className='avatar' alt='Uncle Cat' width='20' height='20' src='https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png'/>
54+
<img className='avatar' alt='Uncle Cat' width='20' height='20' src='https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png'/>
55+
</div>
56+
</div>
57+
<div className='AvatarStack AvatarStack-two AvatarStack--right mb-2'>
58+
<div className='AvatarStack-body tooltipped tooltipped-sw tooltipped-align-right-1' aria-label='two avatars'>
59+
<img className='avatar' alt='Uncle Cat' width='20' height='20' src='https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png'/>
60+
<img className='avatar' alt='Uncle Cat' width='20' height='20' src='https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png'/>
61+
</div>
62+
</div>
63+
64+
</div>
65+
))
2966
.add('CircleBadge--small', () => (
3067
<div>
3168
<a className='CircleBadge CircleBadge--small' href='#url' title='Travis CI'>

modules/primer-base/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Primer Base
22

3-
[![npm version](http://img.shields.io/npm/v/primer-base.svg)](https://www.npmjs.org/package/primer-base)
3+
[![npm version](https://img.shields.io/npm/v/primer-base.svg)](https://www.npmjs.org/package/primer-base)
44
[![Build Status](https://travis-ci.org/primer/primer.svg?branch=master)](https://travis-ci.org/primer/primer)
55

66
> GitHub's CSS to reset the browsers default styles. Built on top of normalize.css

modules/primer-base/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "1.6.0",
2+
"version": "1.6.1",
33
"name": "primer-base",
44
"description": "CSS to reset the browsers default styles",
55
"homepage": "http://primer.github.io/",
@@ -27,7 +27,7 @@
2727
"test": "../../script/npm-run-all build lint"
2828
},
2929
"dependencies": {
30-
"primer-support": "4.4.2"
30+
"primer-support": "4.5.0"
3131
},
3232
"keywords": [
3333
"primer",

0 commit comments

Comments
 (0)