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

Commit 045427d

Browse files
Refactored DatePicker to new react-date style
Tiny react-dates styling fix Fix test regression CSS
1 parent 9772dd2 commit 045427d

File tree

10 files changed

+206
-1514
lines changed

10 files changed

+206
-1514
lines changed

dash_core_components/dash_core_components.dev.js

Lines changed: 98 additions & 76 deletions
Large diffs are not rendered by default.

dash_core_components/dash_core_components.min.js

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dash_core_components/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"author": "Chris Parmer <[email protected]>",
2828
"license": "MIT",
2929
"dependencies": {
30+
"babel-plugin-transform-object-rest-spread": "^6.26.0",
3031
"cross-env": "^5.2.0",
3132
"eslint": "^5.8.0",
3233
"eslint-config-prettier": "^3.0.1",
@@ -43,7 +44,8 @@
4344
"react-select": "^2.1.0",
4445
"react-select-fast-filter-options": "^0.2.3",
4546
"react-syntax-highlighter": "^10.0.0",
46-
"react-virtualized-select": "^3.1.3"
47+
"react-virtualized-select": "^3.1.3",
48+
"react-with-direction": "^1.3.0"
4749
},
4850
"devDependencies": {
4951
"babel-core": "^6.26.3",
@@ -52,7 +54,7 @@
5254
"babel-loader": "^7.1.4",
5355
"babel-preset-env": "^1.7.0",
5456
"babel-preset-react": "^6.24.1",
55-
"component-playground": "^2.0.0",
57+
"component-playground": "^3.0.0",
5658
"copyfiles": "^2.0.0",
5759
"css-loader": "^1.0.1",
5860
"enzyme": "^3.7.0",

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"author": "Chris Parmer <[email protected]>",
2828
"license": "MIT",
2929
"dependencies": {
30+
"babel-plugin-transform-object-rest-spread": "^6.26.0",
3031
"cross-env": "^5.2.0",
3132
"eslint": "^5.8.0",
3233
"eslint-config-prettier": "^3.0.1",
@@ -43,7 +44,8 @@
4344
"react-select": "^2.1.0",
4445
"react-select-fast-filter-options": "^0.2.3",
4546
"react-syntax-highlighter": "^10.0.0",
46-
"react-virtualized-select": "^3.1.3"
47+
"react-virtualized-select": "^3.1.3",
48+
"react-with-direction": "^1.3.0"
4749
},
4850
"devDependencies": {
4951
"babel-core": "^6.26.3",
@@ -52,7 +54,7 @@
5254
"babel-loader": "^7.1.4",
5355
"babel-preset-env": "^1.7.0",
5456
"babel-preset-react": "^6.24.1",
55-
"component-playground": "^2.0.0",
57+
"component-playground": "^3.0.0",
5658
"copyfiles": "^2.0.0",
5759
"css-loader": "^1.0.1",
5860
"enzyme": "^3.7.0",

src/components/DatePickerRange.react.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import moment from 'moment';
44
import PropTypes from 'prop-types';
55
import R from 'ramda';
66
import React, {Component} from 'react';
7-
import './css/[email protected]';
7+
import 'react-dates/lib/css/_datepicker.css';
8+
import './css/react-dates-overrides.css';
89

910
/**
1011
* DatePickerRange is a tailor made component designed for selecting

src/components/DatePickerSingle.react.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import moment from 'moment';
33
import PropTypes from 'prop-types';
44
import R from 'ramda';
55
import React, {Component} from 'react';
6+
import 'react-dates/lib/css/_datepicker.css';
67

78
/**
89
* DatePickerSingle is a tailor made component designed for selecting
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* From the react-dates docs:
3+
* "Note: This component assumes box-sizing: border-box is set globally in your page's CSS."
4+
* If box-sizing: border box isn't set globally, the picker appears a bit broken.
5+
*/
6+
html {
7+
box-sizing: border-box;
8+
}
9+
*, *:before, *:after {
10+
box-sizing: inherit;
11+
}
12+
13+
.DateInput_input {
14+
font: 400 16px system-ui;
15+
}
16+
17+
.CalendarDay__selected, .CalendarDay__selected:active, .CalendarDay__selected:hover {
18+
background: #70d1ff;
19+
border: #70d1ff;
20+
}
21+
.CalendarDay__selected_span {
22+
background: #abe2fb;
23+
border: #abe2fb;
24+
}
25+
26+
.DateInput_input__focused {
27+
border-bottom: 2px solid #70d1ff;
28+
}
29+
30+
.DayPickerKeyboardShortcuts_show__bottomRight{
31+
border-right: 33px solid #70d1ff;
32+
}

0 commit comments

Comments
 (0)