Skip to content
This repository was archived by the owner on Sep 26, 2024. It is now read-only.

Commit cae50ab

Browse files
committed
Merge branch 'master' of github.com:bufferapp/buffer-components into task/automated-a11y-tests
2 parents b46d451 + 416e6e2 commit cae50ab

Some content is hidden

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

66 files changed

+2283
-643
lines changed

.storybook/addons.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
import '@kadira/storybook/addons';
1+
import '@storybook/addon-actions/register';
22
import 'storybook-addon-a11y/register';

.storybook/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { configure } from '@kadira/storybook';
1+
import { configure } from '@storybook/react';
22

33
// automatically import all story.js files
44
const req = require.context('../', true, /story\.jsx$/);
Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1 @@
11
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800" rel="stylesheet">
2-
<style>
3-
* {
4-
font-family: 'Open Sans', sans-serif;
5-
}
6-
</style>

Button/story.jsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import React from 'react';
2-
import {
3-
action,
4-
storiesOf,
5-
} from '@kadira/storybook';
2+
import { storiesOf } from '@storybook/react';
3+
import { action } from '@storybook/addon-actions';
64
import { checkA11y } from 'storybook-addon-a11y';
75
import Button from './index';
86
import CloseIcon from '../Icon/Icons/CloseIcon';
7+
import Text from '../Text';
98

109
storiesOf('Button')
1110
.addDecorator(checkA11y)
@@ -16,7 +15,10 @@ storiesOf('Button')
1615
<Button onClick={action('on-click')} warning>Warning</Button>
1716
))
1817
.add('with icon and text', () => (
19-
<Button onClick={action('on-click')} noStyle><CloseIcon />Close</Button>
18+
<Button onClick={action('on-click')} noStyle>
19+
<CloseIcon />
20+
<Text>Close</Text>
21+
</Button>
2022
))
2123
.add('with icon only', () => (
2224
<Button onClick={action('on-click')} noStyle><CloseIcon /></Button>

ButtonStateless/index.jsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
white,
1212
curiousBlue,
1313
geyser,
14+
offWhite,
1415
outerSpace,
1516
transparent,
1617
torchRed,
@@ -40,6 +41,7 @@ const Button = ({
4041
secondary,
4142
small,
4243
tertiary,
44+
quaternary,
4345
warning,
4446
noStyle,
4547
}) => {
@@ -102,6 +104,15 @@ const Button = ({
102104
color: outerSpace,
103105
backgroundColor: transparent,
104106
},
107+
quaternary: {
108+
color: outerSpace,
109+
backgroundColor: offWhite,
110+
borderColor: geyser,
111+
},
112+
quaternaryHovered: {
113+
color: outerSpace,
114+
backgroundColor: offWhite,
115+
},
105116
warning: {
106117
color: outerSpace,
107118
backgroundColor: transparent,
@@ -116,6 +127,7 @@ const Button = ({
116127
},
117128
noStyle: {
118129
display: 'unset',
130+
lineHeight: 'unset',
119131
margin: 'unset',
120132
padding: 0,
121133
fontFamily: 'unset',
@@ -143,6 +155,8 @@ const Button = ({
143155
small,
144156
tertiary,
145157
tertiaryHovered: tertiary && hovered && !disabled,
158+
quaternary,
159+
quaternaryHovered: quaternary && hovered && !disabled,
146160
warning,
147161
warningHovered: warning && hovered && !disabled,
148162
fillContainer,
@@ -181,6 +195,7 @@ Button.propTypes = {
181195
secondary: PropTypes.bool,
182196
small: PropTypes.bool,
183197
tertiary: PropTypes.bool,
198+
quaternary: PropTypes.bool,
184199
warning: PropTypes.bool,
185200
};
186201

ButtonStateless/story.jsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import React from 'react';
2-
import {
3-
storiesOf,
4-
action,
5-
} from '@kadira/storybook';
2+
import { storiesOf } from '@storybook/react';
3+
import { action } from '@storybook/addon-actions';
64
import { checkA11y } from 'storybook-addon-a11y';
75
import Button from './index';
86
import Text from '../Text';
@@ -29,6 +27,8 @@ storiesOf('ButtonStateless')
2927
<Button disabled small>Button text</Button><br /><br />
3028
<p>Tertiary</p>
3129
<Button disabled tertiary>Button text</Button><br /><br />
30+
<p>Quaternary</p>
31+
<Button disabled quaternary>Button text</Button><br /><br />
3232
<p>Warning</p>
3333
<Button disabled warning>Button text</Button>
3434
<p>Click Events Should Not Fire</p>
@@ -62,6 +62,8 @@ storiesOf('ButtonStateless')
6262
<Button hovered small>Button text</Button><br /><br />
6363
<p>Tertiary</p>
6464
<Button hovered tertiary>Button text</Button><br /><br />
65+
<p>Quaternary</p>
66+
<Button hovered quaternary>Button text</Button><br /><br />
6567
<p>Warning</p>
6668
<Button hovered warning>Button text</Button>
6769
<p>Disabled</p>
@@ -93,6 +95,9 @@ storiesOf('ButtonStateless')
9395
.add('tertiary', () => (
9496
<Button tertiary>Button text</Button>
9597
))
98+
.add('quaternary', () => (
99+
<Button quaternary>Button text</Button>
100+
))
96101
.add('warning', () => (
97102
<Button warning>Button text</Button>
98103
))

CHANGELOG.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,55 @@
11
# Changelog
22

3+
## 0.5.22 (June 13, 2017)
4+
5+
- Remove setting font-family with global CSS rule and set fontFamily on components that need it
6+
7+
## 0.5.21 (June 13, 2017)
8+
9+
- Set default `alt` text to empty string
10+
11+
## 0.5.20 (June 8, 2017)
12+
13+
- Change the `lineHeight` CSS property on the `ButtonStateless` component to `'unset'` to fix Safari bug
14+
15+
## 0.5.19 (June 8, 2017)
16+
17+
- Remove `inline-flex` from `InputTime`'s `default` style
18+
- Add missing `,` in our `fontFamily` value
19+
20+
## 0.5.18 (June 7, 2017)
21+
22+
- Make first day of week configurable in `InputDate`
23+
24+
## 0.5.17 (June 5, 2017)
25+
26+
- Change `InputDate` selected date color to universal blue
27+
28+
## 0.5.16 (June 5, 2017)
29+
30+
- Remove browser prefix strings as keys and replaces them with preferred keys
31+
32+
## 0.5.15 (June 5, 2017)
33+
34+
- Add `CloseSmallIcon`, `Notification`, and `NotificationClose` to `Icon/index.js`
35+
36+
## 0.5.14 (June 5, 2017)
37+
38+
- Add `CloseSmallIcon`, `Notification`, and `NotificationClose` components
39+
- Update `WarningIcon` component
40+
41+
## 0.5.13 (June 5, 2017)
42+
43+
- Add a `lineHeight: 0` rule to our `noStyle` config on ButtonStateless
44+
45+
## 0.5.12 (June 1, 2017)
46+
47+
- Add `disabled` config to `InputTime` component
48+
49+
## 0.5.11 (May 31, 2017)
50+
51+
- Add `quaternary` config to `ButtonStateless` component
52+
353
## 0.5.10 (May 26, 2017)
454

555
- Add `noStyle` config to `InputTimes`

Card/story.jsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import React from 'react';
2-
import {
3-
storiesOf,
4-
action,
5-
} from '@kadira/storybook';
2+
import { storiesOf } from '@storybook/react';
3+
import { action } from '@storybook/addon-actions';
64
import { checkA11y } from 'storybook-addon-a11y';
75
import Card from './index';
86
import Link from '../Link';

Card/test.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import React from 'react';
2-
import a11yTestHelper from '../lib/a11yTestHelper';
2+
import { testComponentA11y } from '../lib/a11yTestHelper';
33
import Card from './index';
44

55
describe('Card', () => {
66
it('should pass accessibility audit', (done) => {
7-
a11yTestHelper.testComponent(
7+
testComponentA11y(
88
<Card>
99
What is a Product Designer? An awesome story by @jgadapee over on Medium!
1010
</Card>, [], (results) => {

Icon/Icons/CloseSmallIcon.jsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React from 'react';
2+
import Icon from '../../Icon';
3+
4+
const CloseSmallIcon = ({ color, size }) => (
5+
<Icon color={color} size={size}>
6+
<rect height="12" rx="0.5" transform="translate(5.046194, 5.000000) rotate(45.000000) translate(-5.046194, -5.000000)" width="1" x="4.54619413" y="-1" />
7+
<rect height="12" rx="0.5" transform="translate(5.046194, 5.000000) scale(-1, 1) rotate(45.000000) translate(-5.046194, -5.000000)" width="1" x="4.54619413" y="-1" />
8+
</Icon>
9+
);
10+
11+
CloseSmallIcon.propTypes = {
12+
...Icon.propTypes,
13+
};
14+
15+
export default CloseSmallIcon;

0 commit comments

Comments
 (0)