From 93b199e957d46d1eb9cd8c0d9dcd45b597415c47 Mon Sep 17 00:00:00 2001 From: Sara Vieira Date: Mon, 18 Sep 2017 18:23:17 +0100 Subject: [PATCH] fix(my-joyent): sliders need to be reset --- .../__snapshots__/filters.spec.js.snap | 6 +- .../src/components/filters/filters.js | 110 ++++++++----- .../__snapshots__/index.spec.js.snap | 15 ++ .../__tests__/__snapshots__/list.spec.js.snap | 55 +++++++ .../my-joyent/src/components/packages/list.js | 3 +- .../my-joyent/src/components/sliders/index.js | 81 ++++----- .../__snapshots__/index.spec.js.snap | 155 +++++++++++++++++- .../__snapshots__/index.spec.js.snap | 151 +++++++++++++++++ packages/ui-toolkit/src/card/card.js | 1 + packages/ui-toolkit/src/card/footer.js | 1 + packages/ui-toolkit/src/card/title.js | 3 +- .../input-range/input-range.jsx | 8 +- .../react-input-range/input-range/label.jsx | 6 +- .../react-input-range/input-range/slider.jsx | 18 +- .../react-input-range/input-range/track.jsx | 12 +- 15 files changed, 520 insertions(+), 105 deletions(-) diff --git a/packages/my-joyent/src/components/filters/__tests__/__snapshots__/filters.spec.js.snap b/packages/my-joyent/src/components/filters/__tests__/__snapshots__/filters.spec.js.snap index bc92f250..7ce0e0ce 100644 --- a/packages/my-joyent/src/components/filters/__tests__/__snapshots__/filters.spec.js.snap +++ b/packages/my-joyent/src/components/filters/__tests__/__snapshots__/filters.spec.js.snap @@ -192,7 +192,7 @@ exports[`renders without throwing 1`] = ` font-size: 0.625rem; color: #464646; position: absolute; - top: 1rem; + top: 0.875rem; right: auto; } @@ -201,7 +201,7 @@ exports[`renders without throwing 1`] = ` font-size: 0.625rem; color: #464646; position: absolute; - top: 1rem; + top: 0.875rem; right: 1px; } @@ -732,7 +732,7 @@ exports[`renders without throwing 1`] = ` diff --git a/packages/my-joyent/src/components/filters/filters.js b/packages/my-joyent/src/components/filters/filters.js index 8d6d90d9..216b8148 100644 --- a/packages/my-joyent/src/components/filters/filters.js +++ b/packages/my-joyent/src/components/filters/filters.js @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { Component } from 'react'; import styled from 'styled-components'; import remcalc from 'remcalc'; import isEqual from 'lodash.isequal'; @@ -19,48 +19,78 @@ const Wrapper = styled.section` width: 100%; `; -const Filters = ({ - filters, - ramSliderChange, - cpuSliderChange, - diskSliderChange, - costSliderChange, - groupChange, - filterReset -}) => ( - - Choose a package - - -
- {filters.groups.sort((a, b) => a.name < b.name ? -1 : 1 ).map(group => ( +class Filters extends Component { + constructor(props) { + super(props); + + this.state = { + reset: 0 + }; + + this.handleResetClick = this.handleResetClick.bind(this); + } + + handleResetClick() { + const { filterReset } = this.props; + const { reset } = this.state; + filterReset(); + + this.setState({ + reset: reset + 1 + }); + } + + render() { + const { + filters, + ramSliderChange, + cpuSliderChange, + diskSliderChange, + costSliderChange, + groupChange + } = this.props; + + const { reset } = this.state; + + return ( + + Choose a package + + +
+ {filters.groups + .sort((a, b) => (a.name < b.name ? -1 : 1)) + .map(group => ( + + ))} +
- ))} -
- -
-
-); + + + ); + } +} export default Filters; diff --git a/packages/my-joyent/src/components/package/__tests__/__snapshots__/index.spec.js.snap b/packages/my-joyent/src/components/package/__tests__/__snapshots__/index.spec.js.snap index a843bc4f..fd98980d 100644 --- a/packages/my-joyent/src/components/package/__tests__/__snapshots__/index.spec.js.snap +++ b/packages/my-joyent/src/components/package/__tests__/__snapshots__/index.spec.js.snap @@ -34,6 +34,8 @@ exports[`renders without throwing 1`] = ` flex-basis: 5.625rem; width: 100%; padding: 0.75rem 1.125rem 0 1.125rem; + -webkit-transition: all 300ms ease; + transition: all 300ms ease; } .c1 { @@ -69,6 +71,9 @@ exports[`renders without throwing 1`] = ` box-shadow: 0px 2px 0px rgba(0,0,0,0.05); min-height: 11.5625rem; min-width: 292px; + cursor: pointer; + -webkit-transition: all 300ms ease; + transition: all 300ms ease; } .c2 { @@ -171,6 +176,8 @@ exports[`renders without throwing 1`] = ` font-weight: 500; text-transform: uppercase; color: rgba(73,73,73,0.5); + -webkit-transition: all 300ms ease; + transition: all 300ms ease; } .c0 { @@ -191,6 +198,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 0.263 @@ -214,6 +224,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > Compute Optimized diff --git a/packages/my-joyent/src/components/packages/__tests__/__snapshots__/list.spec.js.snap b/packages/my-joyent/src/components/packages/__tests__/__snapshots__/list.spec.js.snap index b2d77297..17680757 100644 --- a/packages/my-joyent/src/components/packages/__tests__/__snapshots__/list.spec.js.snap +++ b/packages/my-joyent/src/components/packages/__tests__/__snapshots__/list.spec.js.snap @@ -43,6 +43,8 @@ exports[`renders without throwing 1`] = ` flex-basis: 5.625rem; width: 100%; padding: 0.75rem 1.125rem 0 1.125rem; + -webkit-transition: all 300ms ease; + transition: all 300ms ease; } .c3 { @@ -78,6 +80,9 @@ exports[`renders without throwing 1`] = ` box-shadow: 0px 2px 0px rgba(0,0,0,0.05); min-height: 11.5625rem; min-width: 292px; + cursor: pointer; + -webkit-transition: all 300ms ease; + transition: all 300ms ease; } .c4 { @@ -180,6 +185,8 @@ exports[`renders without throwing 1`] = ` font-weight: 500; text-transform: uppercase; color: rgba(73,73,73,0.5); + -webkit-transition: all 300ms ease; + transition: all 300ms ease; } .c2 { @@ -262,6 +269,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 0.016 @@ -285,6 +295,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > Compute Optimized @@ -346,6 +361,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 0.033 @@ -369,6 +387,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > Compute Optimized @@ -430,6 +453,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 0.066 @@ -453,6 +479,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > Compute Optimized @@ -514,6 +545,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 0.131 @@ -537,6 +571,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > Compute Optimized @@ -598,6 +637,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 0.263 @@ -621,6 +663,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > Compute Optimized @@ -682,6 +729,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 0.525 @@ -705,6 +755,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > Compute Optimized diff --git a/packages/my-joyent/src/components/packages/list.js b/packages/my-joyent/src/components/packages/list.js index b0e06af7..40346631 100644 --- a/packages/my-joyent/src/components/packages/list.js +++ b/packages/my-joyent/src/components/packages/list.js @@ -29,9 +29,10 @@ class Packages extends Component { handleClick(id) { this.setState({ - selected: id + selected: id !== this.state.selected ? id : null }); } + render() { const { packages } = this.props; const { selected } = this.state; diff --git a/packages/my-joyent/src/components/sliders/index.js b/packages/my-joyent/src/components/sliders/index.js index d6e4d698..4d2cfd55 100644 --- a/packages/my-joyent/src/components/sliders/index.js +++ b/packages/my-joyent/src/components/sliders/index.js @@ -20,46 +20,47 @@ const Sliders = ({ ramSliderChange, cpuSliderChange, diskSliderChange, - costSliderChange + costSliderChange, + reset }) => ( - - ramSliderChange(value)} - > - GB RAM - - cpuSliderChange(value)} - > - vCPUs - - diskSliderChange(value)} - > - TB Disk - - costSliderChange(value)} - > - $/hr - - -); + + ramSliderChange(value)} + > + GB RAM + + cpuSliderChange(value)} + > + vCPUs + + diskSliderChange(value)} + > + TB Disk + + costSliderChange(value)} + > + $/hr + + + ); export default Sliders; diff --git a/packages/my-joyent/src/containers/home/__tests__/__snapshots__/index.spec.js.snap b/packages/my-joyent/src/containers/home/__tests__/__snapshots__/index.spec.js.snap index 7218a74d..d606b0fb 100644 --- a/packages/my-joyent/src/containers/home/__tests__/__snapshots__/index.spec.js.snap +++ b/packages/my-joyent/src/containers/home/__tests__/__snapshots__/index.spec.js.snap @@ -503,7 +503,7 @@ exports[`renders without throwing 1`] = ` font-size: 0.625rem; color: #464646; position: absolute; - top: 1rem; + top: 0.875rem; right: auto; } @@ -512,7 +512,7 @@ exports[`renders without throwing 1`] = ` font-size: 0.625rem; color: #464646; position: absolute; - top: 1rem; + top: 0.875rem; right: 1px; } @@ -624,6 +624,8 @@ exports[`renders without throwing 1`] = ` flex-basis: 5.625rem; width: 100%; padding: 0.75rem 1.125rem 0 1.125rem; + -webkit-transition: all 300ms ease; + transition: all 300ms ease; } .c36 { @@ -659,6 +661,9 @@ exports[`renders without throwing 1`] = ` box-shadow: 0px 2px 0px rgba(0,0,0,0.05); min-height: 11.5625rem; min-width: 292px; + cursor: pointer; + -webkit-transition: all 300ms ease; + transition: all 300ms ease; } .c37 { @@ -761,6 +766,8 @@ exports[`renders without throwing 1`] = ` font-weight: 500; text-transform: uppercase; color: rgba(73,73,73,0.5); + -webkit-transition: all 300ms ease; + transition: all 300ms ease; } .c4 { @@ -1469,6 +1476,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 0.016 @@ -1492,6 +1502,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > Compute Optimized @@ -1553,6 +1568,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 0.033 @@ -1576,6 +1594,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > Compute Optimized @@ -1637,6 +1660,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 0.066 @@ -1660,6 +1686,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > Compute Optimized @@ -1721,6 +1752,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 0.131 @@ -1744,6 +1778,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > Compute Optimized @@ -1805,6 +1844,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 0.263 @@ -1828,6 +1870,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > Compute Optimized @@ -1889,6 +1936,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 0.525 @@ -1912,6 +1962,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > Compute Optimized @@ -1973,6 +2028,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 0.084 @@ -1996,6 +2054,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > General Purpose @@ -2057,6 +2120,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 0.166 @@ -2080,6 +2146,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > General Purpose @@ -2141,6 +2212,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 0.333 @@ -2164,6 +2238,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > General Purpose @@ -2225,6 +2304,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 0.665 @@ -2248,6 +2330,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > General Purpose @@ -2309,6 +2396,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 0.259 @@ -2332,6 +2422,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > Memory Optimized @@ -2393,6 +2488,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 0.52 @@ -2416,6 +2514,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > Memory Optimized @@ -2477,6 +2580,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 1.039 @@ -2500,6 +2606,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > Memory Optimized @@ -2561,6 +2672,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 1.066 @@ -2584,6 +2698,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > Storage Optimized @@ -2645,6 +2764,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 2.31 @@ -2668,6 +2790,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > Storage Optimized @@ -2729,6 +2856,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 0.413 @@ -2752,6 +2882,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > Storage Optimized @@ -2813,6 +2948,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 0.825 @@ -2836,6 +2974,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > Storage Optimized @@ -2897,6 +3040,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 1.75 @@ -2920,6 +3066,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > Storage Optimized diff --git a/packages/my-joyent/src/containers/packages/__tests__/__snapshots__/index.spec.js.snap b/packages/my-joyent/src/containers/packages/__tests__/__snapshots__/index.spec.js.snap index 353a806b..77a1ae99 100644 --- a/packages/my-joyent/src/containers/packages/__tests__/__snapshots__/index.spec.js.snap +++ b/packages/my-joyent/src/containers/packages/__tests__/__snapshots__/index.spec.js.snap @@ -43,6 +43,8 @@ exports[`renders without throwing 1`] = ` flex-basis: 5.625rem; width: 100%; padding: 0.75rem 1.125rem 0 1.125rem; + -webkit-transition: all 300ms ease; + transition: all 300ms ease; } .c3 { @@ -78,6 +80,9 @@ exports[`renders without throwing 1`] = ` box-shadow: 0px 2px 0px rgba(0,0,0,0.05); min-height: 11.5625rem; min-width: 292px; + cursor: pointer; + -webkit-transition: all 300ms ease; + transition: all 300ms ease; } .c4 { @@ -180,6 +185,8 @@ exports[`renders without throwing 1`] = ` font-weight: 500; text-transform: uppercase; color: rgba(73,73,73,0.5); + -webkit-transition: all 300ms ease; + transition: all 300ms ease; } .c2 { @@ -262,6 +269,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 0.016 @@ -285,6 +295,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > Compute Optimized @@ -346,6 +361,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 0.033 @@ -369,6 +387,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > Compute Optimized @@ -430,6 +453,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 0.066 @@ -453,6 +479,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > Compute Optimized @@ -514,6 +545,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 0.131 @@ -537,6 +571,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > Compute Optimized @@ -598,6 +637,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 0.263 @@ -621,6 +663,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > Compute Optimized @@ -682,6 +729,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 0.525 @@ -705,6 +755,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > Compute Optimized @@ -766,6 +821,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 0.084 @@ -789,6 +847,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > General Purpose @@ -850,6 +913,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 0.166 @@ -873,6 +939,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > General Purpose @@ -934,6 +1005,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 0.333 @@ -957,6 +1031,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > General Purpose @@ -1018,6 +1097,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 0.665 @@ -1041,6 +1123,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > General Purpose @@ -1102,6 +1189,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 0.259 @@ -1125,6 +1215,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > Memory Optimized @@ -1186,6 +1281,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 0.52 @@ -1209,6 +1307,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > Memory Optimized @@ -1270,6 +1373,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 1.039 @@ -1293,6 +1399,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > Memory Optimized @@ -1354,6 +1465,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 1.066 @@ -1377,6 +1491,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > Storage Optimized @@ -1438,6 +1557,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 2.31 @@ -1461,6 +1583,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > Storage Optimized @@ -1522,6 +1649,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 0.413 @@ -1545,6 +1675,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > Storage Optimized @@ -1606,6 +1741,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 0.825 @@ -1629,6 +1767,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > Storage Optimized @@ -1690,6 +1833,8 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
$ 1.75 @@ -1713,6 +1859,7 @@ exports[`renders without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = `
without throwing 1`] = ` > Storage Optimized diff --git a/packages/ui-toolkit/src/card/card.js b/packages/ui-toolkit/src/card/card.js index d62b8fd9..7a5e17d9 100644 --- a/packages/ui-toolkit/src/card/card.js +++ b/packages/ui-toolkit/src/card/card.js @@ -49,6 +49,7 @@ const StyledCard = Row.extend` ${is('transparent', 'selected')` border: 1px solid ${props => props.theme.blue}; background: ${props => props.theme.tertiaryActive}; + box-shadow: none; `}; ${is('stacked')` diff --git a/packages/ui-toolkit/src/card/footer.js b/packages/ui-toolkit/src/card/footer.js index 8711292a..41cc6655 100644 --- a/packages/ui-toolkit/src/card/footer.js +++ b/packages/ui-toolkit/src/card/footer.js @@ -27,6 +27,7 @@ const Span = styled.span` text-transform: uppercase; color: rgba(73, 73, 73, 0.5); + transition: all 300ms ease; ${is('selected')` color: rgba(41, 49, 194, 0.5); diff --git a/packages/ui-toolkit/src/card/title.js b/packages/ui-toolkit/src/card/title.js index 8df30bfd..84656ab3 100644 --- a/packages/ui-toolkit/src/card/title.js +++ b/packages/ui-toolkit/src/card/title.js @@ -25,6 +25,7 @@ const Container = styled.div` width: 100%; padding: ${remcalc(12)} ${remcalc(18)} 0 ${remcalc(18)}; + transition: all 300ms ease; ${is('fromHeader')` color: ${props => props.theme.white}; @@ -38,7 +39,7 @@ const Container = styled.div` padding: 0 ${remcalc(18)}; `}; - ${is('selected')` + ${is('selected')` color: ${props => props.theme.blue}; `}; `; diff --git a/packages/ui-toolkit/src/slider/react-input-range/input-range/input-range.jsx b/packages/ui-toolkit/src/slider/react-input-range/input-range/input-range.jsx index 924a0b06..f982428b 100755 --- a/packages/ui-toolkit/src/slider/react-input-range/input-range/input-range.jsx +++ b/packages/ui-toolkit/src/slider/react-input-range/input-range/input-range.jsx @@ -36,7 +36,7 @@ export default class InputRange extends Component { minValue: rangePropType, name: PropTypes.string, onChangeStart: PropTypes.func, - onChange: PropTypes.func.isRequired, + onChange: PropTypes.func, onChangeComplete: PropTypes.func, step: PropTypes.number, value: valuePropType @@ -129,7 +129,7 @@ export default class InputRange extends Component { * @return {ClientRect} */ getTrackClientRect() { - return this.trackNode.getClientRect(); + return this.trackNode && this.trackNode.getClientRect(); } /** @@ -379,7 +379,7 @@ export default class InputRange extends Component { * @return {void} */ removeDocumentMouseUpListener() { - this.node.ownerDocument.removeEventListener('mouseup', this.handleMouseUp); + this.node && this.node.ownerDocument.removeEventListener('mouseup', this.handleMouseUp); } /** @@ -697,7 +697,7 @@ export default class InputRange extends Component { return ( { + innerRef={node => { this.node = node; }} onKeyDown={this.handleKeyDown} diff --git a/packages/ui-toolkit/src/slider/react-input-range/input-range/label.jsx b/packages/ui-toolkit/src/slider/react-input-range/input-range/label.jsx index a7f350da..f047bbf6 100755 --- a/packages/ui-toolkit/src/slider/react-input-range/input-range/label.jsx +++ b/packages/ui-toolkit/src/slider/react-input-range/input-range/label.jsx @@ -10,7 +10,7 @@ const Span = styled.span` font-size: ${remcalc(10)}; color: ${theme.secondary}; position: absolute; - top: ${remcalc(8)}; + top: ${remcalc(14)}; right: ${props => (props.type === 'max' ? '1px' : 'auto')}; `; @@ -38,7 +38,7 @@ export default function Label(props) { */ Label.propTypes = { children: PropTypes.node.isRequired, - classNames: PropTypes.objectOf(PropTypes.string).isRequired, + classNames: PropTypes.objectOf(PropTypes.string), formatLabel: PropTypes.func, - type: PropTypes.string.isRequired + type: PropTypes.string }; diff --git a/packages/ui-toolkit/src/slider/react-input-range/input-range/slider.jsx b/packages/ui-toolkit/src/slider/react-input-range/input-range/slider.jsx index df3b68fc..325c3b1d 100755 --- a/packages/ui-toolkit/src/slider/react-input-range/input-range/slider.jsx +++ b/packages/ui-toolkit/src/slider/react-input-range/input-range/slider.jsx @@ -57,15 +57,15 @@ export default class Slider extends Component { return { ariaLabelledby: PropTypes.string, ariaControls: PropTypes.string, - classNames: PropTypes.objectOf(PropTypes.string).isRequired, + classNames: PropTypes.objectOf(PropTypes.string), formatLabel: PropTypes.func, maxValue: PropTypes.number, minValue: PropTypes.number, - onSliderDrag: PropTypes.func.isRequired, - onSliderKeyDown: PropTypes.func.isRequired, - percentage: PropTypes.number.isRequired, - type: PropTypes.string.isRequired, - value: PropTypes.number.isRequired + onSliderDrag: PropTypes.func, + onSliderKeyDown: PropTypes.func, + percentage: PropTypes.number, + type: PropTypes.string, + value: PropTypes.number }; } @@ -183,7 +183,11 @@ export default class Slider extends Component { * @return {void} */ removeDocumentMouseUpListener() { - this.node.ownerDocument.removeEventListener('mouseup', this.handleMouseUp); + this.node && + this.node.ownerDocument.removeEventListener( + 'mouseup', + this.handleMouseUp + ); } /** diff --git a/packages/ui-toolkit/src/slider/react-input-range/input-range/track.jsx b/packages/ui-toolkit/src/slider/react-input-range/input-range/track.jsx index 7885a262..51e338a9 100755 --- a/packages/ui-toolkit/src/slider/react-input-range/input-range/track.jsx +++ b/packages/ui-toolkit/src/slider/react-input-range/input-range/track.jsx @@ -35,11 +35,11 @@ export default class Track extends Component { static get propTypes() { return { children: PropTypes.node.isRequired, - classNames: PropTypes.objectOf(PropTypes.string).isRequired, + classNames: PropTypes.objectOf(PropTypes.string), draggableTrack: PropTypes.bool, onTrackDrag: PropTypes.func, - onTrackMouseDown: PropTypes.func.isRequired, - percentages: PropTypes.objectOf(PropTypes.number).isRequired + onTrackMouseDown: PropTypes.func, + percentages: PropTypes.objectOf(PropTypes.number) }; } @@ -123,7 +123,11 @@ export default class Track extends Component { * @return {void} */ removeDocumentMouseUpListener() { - this.node.ownerDocument.removeEventListener('mouseup', this.handleMouseUp); + this.node && + this.node.ownerDocument.removeEventListener( + 'mouseup', + this.handleMouseUp + ); } /**