Skip to content

Commit 2253e5a

Browse files
Rachel RoppoloRachel Roppolo
authored andcommitted
UIDS-24 implement review comments
1 parent fe72673 commit 2253e5a

File tree

19 files changed

+1779
-3242
lines changed

19 files changed

+1779
-3242
lines changed

.eslintrc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@
3333
"no-alert": 0,
3434
"react/destructuring-assignment": 0,
3535
"react/forbid-prop-types": 0,
36-
"react/jsx-props-no-spreading": [2, {
37-
"html": "ignore"
38-
}],
36+
"react/jsx-props-no-spreading": 0,
3937
"react/jsx-no-target-blank": 1,
4038
"react/jsx-no-undef": 0,
4139
"react/jsx-one-expression-per-line": 0,

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
"node-sass": "^4.13.1",
88
"polished": "^3.4.2",
99
"prop-types": "^15.7.2",
10-
"react": "^16.12.0",
1110
"react-bootstrap": "^1.0.0-beta.16",
12-
"react-dom": "^16.12.0",
1311
"react-transition-group": "^4.3.0",
1412
"uuid": "^7.0.2"
1513
},
@@ -37,6 +35,10 @@
3735
"last 1 safari version"
3836
]
3937
},
38+
"peerDependencies": {
39+
"react": "^16.12.0",
40+
"react-dom": "^16.12.0"
41+
},
4042
"devDependencies": {
4143
"@babel/cli": "^7.8.4",
4244
"@babel/core": "^7.8.4",
@@ -68,6 +70,8 @@
6870
"eslint-plugin-react": "^7.18.3",
6971
"eslint-plugin-react-hooks": "^2.5.1",
7072
"eslint-utils": "^1.4.3",
73+
"react": "^16.12.0",
74+
"react-dom": "^16.12.0",
7175
"react-test-renderer": "^16.12.0",
7276
"sass-loader": "^8.0.2",
7377
"style-loader": "^1.1.3"

scss/box_shadow.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
$ux-navbar-shadow-color: rgba( 0, 0, 0, 0.26 );
2+
3+
$ux-box-shadow: 0 2px 5px $ux-navbar-shadow-color;
4+
$ux-box-shadow-light: 0 1px 1px $ux-navbar-shadow-color;
5+
6+
$ux-box-shadow-card: 0 2px 4px rgba(0,0,0,0.1);
7+
8+
$ux-box-shadow-top: 0 -2px 5px $ux-navbar-shadow-color;
9+
$ux-box-shadow-top-light: 0 -1px 1px $ux-navbar-shadow-color;

scss/navbar.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
$ui-navbar-height: 3rem;
2+
$ui-navbar-height-mobile: $ui-navbar-height;

scss/theme.scss

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1+
@import './box_shadow';
12
@import './lists';
3+
@import './navbar';
24
@import './palette';
35
@import './typography';
46
@import './z_stack';
5-
6-
$ui-navbar-height: 3rem;
7-
$ui-navbar-height-mobile: $ui-navbar-height;

spec/Flash/Flash.test.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ describe('Flash', () => {
77
test('no header classes', () => {
88
const { props } = create(<Flash header messages={[]} />).toJSON();
99

10-
expect(props.className).toContain('flash');
11-
expect(props.className).not.toContain('flash--no-header');
10+
expect(props.className).toContain('Flash');
11+
expect(props.className).not.toContain('Flash--no-header');
1212
});
1313

1414
test('header classes', () => {
1515
const { props } = create(<Flash header={false} messages={[]} />).toJSON();
1616

17-
expect(props.className).toContain('flash');
18-
expect(props.className).toContain('flash--no-header');
17+
expect(props.className).toContain('Flash');
18+
expect(props.className).toContain('Flash--no-header');
1919
});
2020
});

spec/Flash/useFlash.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ describe('useFlash', () => {
4040
}]);
4141

4242
act(() => {
43-
result.current.dismissMessage('1234');
43+
result.current.dismissMessage(GENERATED_UUID);
4444
});
4545

4646
expect(result.current.messages).toEqual([]);

spec/Flash/withFlash.test.jsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { Component } from 'react';
1+
import React from 'react';
22
import { act } from '@testing-library/react-hooks';
33
import { create } from 'react-test-renderer';
44

@@ -12,12 +12,7 @@ jest.mock('react-transition-group', () => (
1212
}
1313
));
1414

15-
// eslint-disable-next-line react/prefer-stateless-function
16-
class WrappedComponent extends Component {
17-
render() {
18-
return <div />;
19-
}
20-
}
15+
const WrappedComponent = () => <div />;
2116

2217
describe('test withFlash', () => {
2318
test('it can create a new flash message', async () => {
@@ -26,7 +21,6 @@ describe('test withFlash', () => {
2621
const flash = create(<ComponentWithFlash />);
2722
const component = flash.root.findByType(WrappedComponent);
2823

29-
3024
act(() => {
3125
component.props.setFlashMessage(MessageTypes.SUCCESS, newMessage);
3226
});

spec/__snapshots__/Storyshots.test.js.snap

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,58 @@ exports[`Storyshots Design System/Card all cards 1`] = `
6565
</div>
6666
`;
6767

68+
exports[`Storyshots Design System/Flash Flash Message 1`] = `
69+
<div
70+
style={
71+
Object {
72+
"padding": "1rem",
73+
}
74+
}
75+
>
76+
<div
77+
className="container Flash"
78+
/>
79+
<div>
80+
<p>
81+
Click the button to see a flash message. Use the knobs to try different types!
82+
</p>
83+
<button
84+
className="btn btn-primary"
85+
onClick={[Function]}
86+
type="button"
87+
>
88+
Submit
89+
</button>
90+
</div>
91+
</div>
92+
`;
93+
94+
exports[`Storyshots Design System/Flash flash message 1`] = `
95+
<div
96+
style={
97+
Object {
98+
"padding": "1rem",
99+
}
100+
}
101+
>
102+
<div
103+
className="container flash"
104+
/>
105+
<div>
106+
<p>
107+
Click the button to see a flash message. Use the knobs to try different types!
108+
</p>
109+
<button
110+
className="btn btn-primary"
111+
onClick={[Function]}
112+
type="button"
113+
>
114+
Submit
115+
</button>
116+
</div>
117+
</div>
118+
`;
119+
68120
exports[`Storyshots Design System/Form Control Label Radio 1`] = `
69121
<div
70122
style={

src/Flash/fade_transition/FadeTransition.jsx renamed to src/FadeTransition/FadeTransition.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import { CSSTransition } from 'react-transition-group';
55
import './FadeTransition.scss';
66

77
const FadeTransition = ({ children, ...props }) => (
8-
/* eslint-disable-next-line react/jsx-props-no-spreading */
9-
<CSSTransition {...props} classNames="fade-transition" timeout={{ enter: 300, exit: 200 }}>
8+
<CSSTransition {...props} classNames="FadeTransition" timeout={{ enter: 300, exit: 200 }}>
109
{children}
1110
</CSSTransition>
1211
);

0 commit comments

Comments
 (0)