Skip to content

Commit ef7500f

Browse files
authored
Feature/UIDS-188 Add new Modals to DS (#208)
* add Modal and react-modal * add ModalHeader * add ModalBody * add ModalFooter * initial update of scss on components * WIP stories for Modals * small story edit * add Warning and Danger icon variants * more story updates * lint * small scss changes to ModalHeader * update docs * move react-modal to peerDependencies * revert deleted files * Modal default props set to undefined * use classnames lib * use Input component for example Modal + lint * fix Input id prop warning * lint
1 parent 3037c80 commit ef7500f

24 files changed

+471
-28
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"react": "^16.12.0",
4545
"react-copy-to-clipboard": "^5.0.2",
4646
"react-dom": "^16.12.0",
47+
"react-modal": "^3.12.1",
4748
"react-popper": "^2.2.3",
4849
"react-tracking": "^7.3.0"
4950
},

scss/timing.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ $ux-ease-out-circ: cubic-bezier(0.075, 0.82, 0.165, 1);
77

88
$ux-duration-brief: 80ms;
99
$ux-duration-short: 160ms;
10-
$ux-duration-long: 240ms;
10+
$ux-duration-long: 240ms;

src/Layout/Header/Controls.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import React from 'react';
22

3-
const Controls = props => (
3+
const Controls = (props) => (
44
<div className="Header__controls">
55
{props.children}
66
</div>
77
);
88

9-
export default Controls;
9+
export default Controls;

src/Layout/Header/Header.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818
margin-right: $ux-spacing-20;
1919
}
2020
}
21-
}
21+
}

src/Layout/Header/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { default } from './Header';
1+
export { default } from './Header';

src/Layout/SidebarNav/SidebarNav.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ SidebarNav.defaultProps = {
2525
controls: undefined,
2626
};
2727

28-
export default SidebarNav;
28+
export default SidebarNav;

src/Layout/SidebarNav/SidebarNavLink.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,3 @@
3131
height: 3.25rem;
3232
width: 100%;
3333
}
34-

src/Layout/SidebarNav/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { default } from './SidebarNav';
1+
export { default } from './SidebarNav';

src/Layout/SidebarView/SidebarView.jsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,6 @@ import './SidebarView.scss';
3939
// mismatched, the layout would remain in the ‘unopenable’ state.
4040

4141
export default class SidebarView extends Component {
42-
static propTypes = {
43-
className: PropTypes.string,
44-
hideSidebar: PropTypes.bool,
45-
isSidebarOpen: PropTypes.bool.isRequired,
46-
isSidebarOpenable: PropTypes.bool.isRequired,
47-
sidebarTitleId: PropTypes.string.isRequired,
48-
onSidebarCloseRequest: PropTypes.func.isRequired,
49-
};
50-
51-
static defaultProps = {
52-
className: undefined,
53-
hideSidebar: false,
54-
};
55-
5642
contentElementRef = createRef();
5743

5844
sidebarElementRef = createRef();
@@ -189,3 +175,17 @@ export default class SidebarView extends Component {
189175
);
190176
}
191177
}
178+
179+
SidebarView.propTypes = {
180+
className: PropTypes.string,
181+
hideSidebar: PropTypes.bool,
182+
isSidebarOpen: PropTypes.bool.isRequired,
183+
isSidebarOpenable: PropTypes.bool.isRequired,
184+
sidebarTitleId: PropTypes.string.isRequired,
185+
onSidebarCloseRequest: PropTypes.func.isRequired,
186+
};
187+
188+
SidebarView.defaultProps = {
189+
className: undefined,
190+
hideSidebar: false,
191+
};

src/Layout/SidebarView/SidebarView.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,4 @@
6464
}
6565
}
6666
}
67-
}
67+
}

0 commit comments

Comments
 (0)