@zendeskgarden/react-datepickers 9.0.0-next.4 → 9.0.0-next.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/index.cjs.js +12 -12
- package/dist/index.esm.js +13 -13
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ for localization support.
|
|
|
22
22
|
|
|
23
23
|
```jsx
|
|
24
24
|
import { ThemeProvider } from '@zendeskgarden/react-theming';
|
|
25
|
-
import { Field,
|
|
25
|
+
import { Field, Input } from '@zendeskgarden/react-forms';
|
|
26
26
|
import { DatePicker } from '@zendeskgarden/react-datepickers';
|
|
27
27
|
|
|
28
28
|
/**
|
|
@@ -30,7 +30,7 @@ import { DatePicker } from '@zendeskgarden/react-datepickers';
|
|
|
30
30
|
*/
|
|
31
31
|
<ThemeProvider>
|
|
32
32
|
<Field>
|
|
33
|
-
<Label>Example datepicker</Label>
|
|
33
|
+
<Field.Label>Example datepicker</Field.Label>
|
|
34
34
|
<DatePicker value={new Date()} onChange={selectedDate => console.log(selectedDate)}>
|
|
35
35
|
<Input />
|
|
36
36
|
</DatePicker>
|
package/dist/index.cjs.js
CHANGED
|
@@ -63,7 +63,7 @@ const PLACEMENT = ['auto', ...reactTheming.PLACEMENT];
|
|
|
63
63
|
const COMPONENT_ID$b = 'datepickers.menu';
|
|
64
64
|
const StyledMenu = styled__default.default.div.attrs({
|
|
65
65
|
'data-garden-id': COMPONENT_ID$b,
|
|
66
|
-
'data-garden-version': '9.0.0-next.
|
|
66
|
+
'data-garden-version': '9.0.0-next.5'
|
|
67
67
|
}).withConfig({
|
|
68
68
|
displayName: "StyledMenu",
|
|
69
69
|
componentId: "sc-1npbkk0-0"
|
|
@@ -148,7 +148,7 @@ const retrieveColor$1 = _ref2 => {
|
|
|
148
148
|
let {
|
|
149
149
|
theme
|
|
150
150
|
} = _ref2;
|
|
151
|
-
return styled.css([":hover{background-color:", ";color:", ";}:active{background-color:", ";color:", ";}color:", ";"], reactTheming.
|
|
151
|
+
return styled.css([":hover{background-color:", ";color:", ";}:active{background-color:", ";color:", ";}color:", ";"], reactTheming.getColorV8('primaryHue', 600, theme, 0.08), theme.colors.foreground, reactTheming.getColorV8('primaryHue', 600, theme, 0.2), theme.colors.foreground, reactTheming.getColorV8('neutralHue', 600, theme));
|
|
152
152
|
};
|
|
153
153
|
const COMPONENT_ID$6 = 'datepickers.header_paddle';
|
|
154
154
|
const StyledHeaderPaddle = styled__default.default.div.attrs({
|
|
@@ -246,7 +246,7 @@ const retrieveColor = _ref2 => {
|
|
|
246
246
|
isHighlighted,
|
|
247
247
|
theme
|
|
248
248
|
} = _ref2;
|
|
249
|
-
return styled.css(["background-color:", ";"], isHighlighted && reactTheming.
|
|
249
|
+
return styled.css(["background-color:", ";"], isHighlighted && reactTheming.getColorV8('primaryHue', 600, theme, 0.08));
|
|
250
250
|
};
|
|
251
251
|
const StyledHighlight = styled__default.default.div.attrs({
|
|
252
252
|
'data-garden-id': COMPONENT_ID$1
|
|
@@ -267,26 +267,26 @@ const retrieveStyledDayColors = _ref => {
|
|
|
267
267
|
theme
|
|
268
268
|
} = _ref;
|
|
269
269
|
let backgroundColor = 'inherit';
|
|
270
|
-
let color = reactTheming.
|
|
270
|
+
let color = reactTheming.getColorV8('primaryHue', 600, theme);
|
|
271
271
|
if (isSelected && !isDisabled) {
|
|
272
|
-
backgroundColor = reactTheming.
|
|
272
|
+
backgroundColor = reactTheming.getColorV8('primaryHue', 600, theme);
|
|
273
273
|
color = theme.colors.background;
|
|
274
274
|
} else if (isDisabled) {
|
|
275
|
-
color = reactTheming.
|
|
275
|
+
color = reactTheming.getColorV8('neutralHue', 400, theme);
|
|
276
276
|
} else if (isToday) {
|
|
277
277
|
color = 'inherit';
|
|
278
278
|
} else if (isPreviousMonth) {
|
|
279
|
-
color = reactTheming.
|
|
279
|
+
color = reactTheming.getColorV8('neutralHue', 600, theme);
|
|
280
280
|
}
|
|
281
281
|
return styled.css(["background-color:", ";color:", ";", ""], backgroundColor, color, !isSelected && !isDisabled && `
|
|
282
282
|
:hover {
|
|
283
|
-
background-color: ${reactTheming.
|
|
284
|
-
color: ${reactTheming.
|
|
283
|
+
background-color: ${reactTheming.getColorV8('primaryHue', 600, theme, 0.08)};
|
|
284
|
+
color: ${reactTheming.getColorV8('primaryHue', 800, theme)};
|
|
285
285
|
}
|
|
286
286
|
|
|
287
287
|
:active {
|
|
288
|
-
background-color: ${reactTheming.
|
|
289
|
-
color: ${reactTheming.
|
|
288
|
+
background-color: ${reactTheming.getColorV8('primaryHue', 600, theme, 0.2)};
|
|
289
|
+
color: ${reactTheming.getColorV8('primaryHue', 800, theme)};
|
|
290
290
|
}
|
|
291
291
|
`);
|
|
292
292
|
};
|
|
@@ -1612,7 +1612,7 @@ const Calendar = React.forwardRef((props, ref) => {
|
|
|
1612
1612
|
return React__namespace.default.createElement(StyledRangeCalendar, _extends({
|
|
1613
1613
|
ref: ref,
|
|
1614
1614
|
"data-garden-id": "datepickers.range",
|
|
1615
|
-
"data-garden-version": '9.0.0-next.
|
|
1615
|
+
"data-garden-version": '9.0.0-next.5'
|
|
1616
1616
|
}, props), React__namespace.default.createElement(Month, {
|
|
1617
1617
|
displayDate: state.previewDate,
|
|
1618
1618
|
isNextHidden: true
|
package/dist/index.esm.js
CHANGED
|
@@ -11,7 +11,7 @@ import PropTypes from 'prop-types';
|
|
|
11
11
|
import { mergeRefs } from 'react-merge-refs';
|
|
12
12
|
import styled, { css, ThemeContext } from 'styled-components';
|
|
13
13
|
import { useFloating, platform, autoPlacement, flip, autoUpdate } from '@floating-ui/react-dom';
|
|
14
|
-
import { PLACEMENT as PLACEMENT$1, retrieveComponentStyles, DEFAULT_THEME, menuStyles, getMenuPosition,
|
|
14
|
+
import { PLACEMENT as PLACEMENT$1, retrieveComponentStyles, DEFAULT_THEME, menuStyles, getMenuPosition, getColorV8, getFloatingPlacements } from '@zendeskgarden/react-theming';
|
|
15
15
|
import { startOfMonth } from 'date-fns/startOfMonth';
|
|
16
16
|
import { endOfMonth } from 'date-fns/endOfMonth';
|
|
17
17
|
import { startOfWeek } from 'date-fns/startOfWeek';
|
|
@@ -38,7 +38,7 @@ const PLACEMENT = ['auto', ...PLACEMENT$1];
|
|
|
38
38
|
const COMPONENT_ID$b = 'datepickers.menu';
|
|
39
39
|
const StyledMenu = styled.div.attrs({
|
|
40
40
|
'data-garden-id': COMPONENT_ID$b,
|
|
41
|
-
'data-garden-version': '9.0.0-next.
|
|
41
|
+
'data-garden-version': '9.0.0-next.5'
|
|
42
42
|
}).withConfig({
|
|
43
43
|
displayName: "StyledMenu",
|
|
44
44
|
componentId: "sc-1npbkk0-0"
|
|
@@ -123,7 +123,7 @@ const retrieveColor$1 = _ref2 => {
|
|
|
123
123
|
let {
|
|
124
124
|
theme
|
|
125
125
|
} = _ref2;
|
|
126
|
-
return css([":hover{background-color:", ";color:", ";}:active{background-color:", ";color:", ";}color:", ";"],
|
|
126
|
+
return css([":hover{background-color:", ";color:", ";}:active{background-color:", ";color:", ";}color:", ";"], getColorV8('primaryHue', 600, theme, 0.08), theme.colors.foreground, getColorV8('primaryHue', 600, theme, 0.2), theme.colors.foreground, getColorV8('neutralHue', 600, theme));
|
|
127
127
|
};
|
|
128
128
|
const COMPONENT_ID$6 = 'datepickers.header_paddle';
|
|
129
129
|
const StyledHeaderPaddle = styled.div.attrs({
|
|
@@ -221,7 +221,7 @@ const retrieveColor = _ref2 => {
|
|
|
221
221
|
isHighlighted,
|
|
222
222
|
theme
|
|
223
223
|
} = _ref2;
|
|
224
|
-
return css(["background-color:", ";"], isHighlighted &&
|
|
224
|
+
return css(["background-color:", ";"], isHighlighted && getColorV8('primaryHue', 600, theme, 0.08));
|
|
225
225
|
};
|
|
226
226
|
const StyledHighlight = styled.div.attrs({
|
|
227
227
|
'data-garden-id': COMPONENT_ID$1
|
|
@@ -242,26 +242,26 @@ const retrieveStyledDayColors = _ref => {
|
|
|
242
242
|
theme
|
|
243
243
|
} = _ref;
|
|
244
244
|
let backgroundColor = 'inherit';
|
|
245
|
-
let color =
|
|
245
|
+
let color = getColorV8('primaryHue', 600, theme);
|
|
246
246
|
if (isSelected && !isDisabled) {
|
|
247
|
-
backgroundColor =
|
|
247
|
+
backgroundColor = getColorV8('primaryHue', 600, theme);
|
|
248
248
|
color = theme.colors.background;
|
|
249
249
|
} else if (isDisabled) {
|
|
250
|
-
color =
|
|
250
|
+
color = getColorV8('neutralHue', 400, theme);
|
|
251
251
|
} else if (isToday) {
|
|
252
252
|
color = 'inherit';
|
|
253
253
|
} else if (isPreviousMonth) {
|
|
254
|
-
color =
|
|
254
|
+
color = getColorV8('neutralHue', 600, theme);
|
|
255
255
|
}
|
|
256
256
|
return css(["background-color:", ";color:", ";", ""], backgroundColor, color, !isSelected && !isDisabled && `
|
|
257
257
|
:hover {
|
|
258
|
-
background-color: ${
|
|
259
|
-
color: ${
|
|
258
|
+
background-color: ${getColorV8('primaryHue', 600, theme, 0.08)};
|
|
259
|
+
color: ${getColorV8('primaryHue', 800, theme)};
|
|
260
260
|
}
|
|
261
261
|
|
|
262
262
|
:active {
|
|
263
|
-
background-color: ${
|
|
264
|
-
color: ${
|
|
263
|
+
background-color: ${getColorV8('primaryHue', 600, theme, 0.2)};
|
|
264
|
+
color: ${getColorV8('primaryHue', 800, theme)};
|
|
265
265
|
}
|
|
266
266
|
`);
|
|
267
267
|
};
|
|
@@ -1587,7 +1587,7 @@ const Calendar = forwardRef((props, ref) => {
|
|
|
1587
1587
|
return React__default.createElement(StyledRangeCalendar, _extends({
|
|
1588
1588
|
ref: ref,
|
|
1589
1589
|
"data-garden-id": "datepickers.range",
|
|
1590
|
-
"data-garden-version": '9.0.0-next.
|
|
1590
|
+
"data-garden-version": '9.0.0-next.5'
|
|
1591
1591
|
}, props), React__default.createElement(Month, {
|
|
1592
1592
|
displayDate: state.previewDate,
|
|
1593
1593
|
isNextHidden: true
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/react-datepickers",
|
|
3
|
-
"version": "9.0.0-next.
|
|
3
|
+
"version": "9.0.0-next.5",
|
|
4
4
|
"description": "Components relating to datepickers in the Garden Design System",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Zendesk Garden <garden@zendesk.com>",
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
"@zendeskgarden/react-theming": "^8.1.0",
|
|
32
32
|
"react": ">=16.8.0",
|
|
33
33
|
"react-dom": ">=16.8.0",
|
|
34
|
-
"styled-components": "^5.1
|
|
34
|
+
"styled-components": "^5.3.1"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@zendeskgarden/react-theming": "^9.0.0-next.
|
|
37
|
+
"@zendeskgarden/react-theming": "^9.0.0-next.5",
|
|
38
38
|
"@zendeskgarden/svg-icons": "7.0.0"
|
|
39
39
|
},
|
|
40
40
|
"keywords": [
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
49
|
"zendeskgarden:src": "src/index.ts",
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "806fa33feb06142c3f69b6a87b53628469117e4d"
|
|
51
51
|
}
|