@zendeskgarden/react-datepickers 9.0.0-next.18 → 9.0.0-next.19
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/dist/esm/elements/DatePicker/DatePicker.js +4 -4
- package/dist/esm/elements/DatePicker/components/Calendar.js +10 -10
- package/dist/esm/elements/DatePicker/components/MonthSelector.js +4 -4
- package/dist/esm/elements/DatePickerRange/components/Calendar.js +1 -1
- package/dist/esm/elements/DatePickerRange/components/Month.js +23 -23
- package/dist/esm/styled/StyledCalendar.js +3 -2
- package/dist/esm/styled/StyledCalendarItem.js +7 -6
- package/dist/esm/styled/StyledDatePicker.js +19 -11
- package/dist/esm/styled/StyledDay.js +71 -30
- package/dist/esm/styled/StyledDayLabel.js +3 -2
- package/dist/esm/styled/StyledHeader.js +3 -2
- package/dist/esm/styled/StyledHeaderLabel.js +3 -2
- package/dist/esm/styled/StyledHeaderPaddle.js +45 -12
- package/dist/esm/styled/StyledHighlight.js +26 -20
- package/dist/esm/styled/StyledMenu.js +1 -1
- package/dist/esm/styled/StyledMenuWrapper.js +7 -5
- package/dist/esm/styled/StyledRangeCalendar.js +2 -1
- package/dist/index.cjs.js +226 -130
- package/dist/typings/styled/StyledCalendar.d.ts +3 -2
- package/dist/typings/styled/StyledCalendarItem.d.ts +4 -3
- package/dist/typings/styled/StyledDatePicker.d.ts +3 -2
- package/dist/typings/styled/StyledDay.d.ts +5 -5
- package/dist/typings/styled/StyledDayLabel.d.ts +3 -2
- package/dist/typings/styled/StyledHeader.d.ts +3 -2
- package/dist/typings/styled/StyledHeaderLabel.d.ts +3 -2
- package/dist/typings/styled/StyledHeaderPaddle.d.ts +7 -4
- package/dist/typings/styled/StyledHighlight.d.ts +5 -4
- package/dist/typings/styled/StyledMenuWrapper.d.ts +4 -4
- package/dist/typings/styled/StyledRangeCalendar.d.ts +2 -1
- package/package.json +3 -3
|
@@ -128,10 +128,10 @@ const DatePicker = forwardRef((props, calendarRef) => {
|
|
|
128
128
|
style: {
|
|
129
129
|
transform
|
|
130
130
|
},
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
131
|
+
$isAnimated: isAnimated && (state.isOpen || isVisible),
|
|
132
|
+
$placement: placement,
|
|
133
|
+
$zIndex: zIndex,
|
|
134
|
+
"aria-hidden": !state.isOpen || undefined
|
|
135
135
|
}, (state.isOpen || isVisible) && React__default.createElement(StyledMenu, menuProps, React__default.createElement(Calendar, {
|
|
136
136
|
ref: calendarRef,
|
|
137
137
|
isCompact: isCompact,
|
|
@@ -68,9 +68,9 @@ const Calendar = forwardRef((_ref, ref) => {
|
|
|
68
68
|
const formattedDayLabel = dayLabelFormatter(date);
|
|
69
69
|
return React__default.createElement(StyledCalendarItem, {
|
|
70
70
|
key: `day-label-${formattedDayLabel}`,
|
|
71
|
-
isCompact: isCompact
|
|
71
|
+
$isCompact: isCompact
|
|
72
72
|
}, React__default.createElement(StyledDayLabel, {
|
|
73
|
-
isCompact: isCompact
|
|
73
|
+
$isCompact: isCompact
|
|
74
74
|
}, formattedDayLabel));
|
|
75
75
|
});
|
|
76
76
|
const items = eachDayOfInterval({
|
|
@@ -90,13 +90,13 @@ const Calendar = forwardRef((_ref, ref) => {
|
|
|
90
90
|
}
|
|
91
91
|
return React__default.createElement(StyledCalendarItem, {
|
|
92
92
|
key: `day-${itemsIndex}`,
|
|
93
|
-
isCompact: isCompact
|
|
93
|
+
$isCompact: isCompact
|
|
94
94
|
}, React__default.createElement(StyledDay, {
|
|
95
|
-
isToday: isCurrentDate,
|
|
96
|
-
isPreviousMonth: isPreviousMonth,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
95
|
+
$isToday: isCurrentDate,
|
|
96
|
+
$isPreviousMonth: isPreviousMonth,
|
|
97
|
+
$isCompact: isCompact,
|
|
98
|
+
"aria-selected": isSelected || undefined,
|
|
99
|
+
"aria-disabled": isDisabled || undefined,
|
|
100
100
|
onClick: () => {
|
|
101
101
|
if (!isDisabled) {
|
|
102
102
|
dispatch({
|
|
@@ -109,7 +109,7 @@ const Calendar = forwardRef((_ref, ref) => {
|
|
|
109
109
|
});
|
|
110
110
|
return React__default.createElement(StyledDatePicker, {
|
|
111
111
|
ref: ref,
|
|
112
|
-
isCompact: isCompact,
|
|
112
|
+
$isCompact: isCompact,
|
|
113
113
|
onMouseDown: e => {
|
|
114
114
|
e.preventDefault();
|
|
115
115
|
}
|
|
@@ -117,7 +117,7 @@ const Calendar = forwardRef((_ref, ref) => {
|
|
|
117
117
|
locale: locale,
|
|
118
118
|
isCompact: isCompact
|
|
119
119
|
}), React__default.createElement(StyledCalendar, {
|
|
120
|
-
isCompact: isCompact
|
|
120
|
+
$isCompact: isCompact
|
|
121
121
|
}, dayLabels, items));
|
|
122
122
|
});
|
|
123
123
|
Calendar.displayName = 'Calendar';
|
|
@@ -38,18 +38,18 @@ const MonthSelector = _ref => {
|
|
|
38
38
|
return formatter.format(date);
|
|
39
39
|
}, [locale]);
|
|
40
40
|
return React__default.createElement(StyledHeader, {
|
|
41
|
-
isCompact: isCompact
|
|
41
|
+
$isCompact: isCompact
|
|
42
42
|
}, React__default.createElement(StyledHeaderPaddle, {
|
|
43
|
-
isCompact: isCompact,
|
|
43
|
+
$isCompact: isCompact,
|
|
44
44
|
onClick: () => {
|
|
45
45
|
dispatch({
|
|
46
46
|
type: 'PREVIEW_PREVIOUS_MONTH'
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
}, React__default.createElement(SvgChevronLeftStroke, null)), React__default.createElement(StyledHeaderLabel, {
|
|
50
|
-
isCompact: isCompact
|
|
50
|
+
$isCompact: isCompact
|
|
51
51
|
}, headerLabelFormatter(state.previewDate)), React__default.createElement(StyledHeaderPaddle, {
|
|
52
|
-
isCompact: isCompact,
|
|
52
|
+
$isCompact: isCompact,
|
|
53
53
|
onClick: () => {
|
|
54
54
|
dispatch({
|
|
55
55
|
type: 'PREVIEW_NEXT_MONTH'
|
|
@@ -28,7 +28,7 @@ const Calendar = forwardRef((props, ref) => {
|
|
|
28
28
|
return React__default.createElement(StyledRangeCalendar, Object.assign({
|
|
29
29
|
ref: ref,
|
|
30
30
|
"data-garden-id": "datepickers.range",
|
|
31
|
-
"data-garden-version": '9.0.0-next.
|
|
31
|
+
"data-garden-version": '9.0.0-next.19'
|
|
32
32
|
}, props), React__default.createElement(Month, {
|
|
33
33
|
displayDate: state.previewDate,
|
|
34
34
|
isNextHidden: true
|
|
@@ -88,9 +88,9 @@ const Month = forwardRef((_ref, ref) => {
|
|
|
88
88
|
const formattedDayLabel = dayLabelFormatter(date);
|
|
89
89
|
return React__default.createElement(StyledCalendarItem, {
|
|
90
90
|
key: `day-label-${formattedDayLabel}`,
|
|
91
|
-
isCompact: isCompact
|
|
91
|
+
$isCompact: isCompact
|
|
92
92
|
}, React__default.createElement(StyledDayLabel, {
|
|
93
|
-
isCompact: isCompact
|
|
93
|
+
$isCompact: isCompact
|
|
94
94
|
}, formattedDayLabel));
|
|
95
95
|
});
|
|
96
96
|
const items = eachDayOfInterval({
|
|
@@ -103,11 +103,11 @@ const Month = forwardRef((_ref, ref) => {
|
|
|
103
103
|
if (isPreviousMonth) {
|
|
104
104
|
return React__default.createElement(StyledCalendarItem, {
|
|
105
105
|
key: `day-${itemsIndex}`,
|
|
106
|
-
isCompact: isCompact
|
|
106
|
+
$isCompact: isCompact
|
|
107
107
|
}, React__default.createElement(StyledDay, {
|
|
108
|
-
isCompact: isCompact,
|
|
109
|
-
isPreviousMonth: true,
|
|
110
|
-
|
|
108
|
+
$isCompact: isCompact,
|
|
109
|
+
$isPreviousMonth: true,
|
|
110
|
+
"aria-disabled": true
|
|
111
111
|
}, "\xA0"));
|
|
112
112
|
}
|
|
113
113
|
let isSelected = false;
|
|
@@ -151,17 +151,17 @@ const Month = forwardRef((_ref, ref) => {
|
|
|
151
151
|
}
|
|
152
152
|
return React__default.createElement(StyledCalendarItem, {
|
|
153
153
|
key: `day-${itemsIndex}`,
|
|
154
|
-
isCompact: isCompact
|
|
154
|
+
$isCompact: isCompact
|
|
155
155
|
}, React__default.createElement(StyledHighlight, {
|
|
156
|
-
isHighlighted: !isInvalidDateRange && isHighlighted && !isDisabled,
|
|
157
|
-
isStart: !isInvalidDateRange && isHighlightStart,
|
|
158
|
-
isEnd: !isInvalidDateRange && isHighlightEnd
|
|
156
|
+
$isHighlighted: !isInvalidDateRange && isHighlighted && !isDisabled,
|
|
157
|
+
$isStart: !isInvalidDateRange && isHighlightStart,
|
|
158
|
+
$isEnd: !isInvalidDateRange && isHighlightEnd
|
|
159
159
|
}), React__default.createElement(StyledDay, {
|
|
160
|
-
isToday: isCurrentDate,
|
|
161
|
-
isPreviousMonth: isPreviousMonth,
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
isCompact: isCompact,
|
|
160
|
+
$isToday: isCurrentDate,
|
|
161
|
+
$isPreviousMonth: isPreviousMonth,
|
|
162
|
+
"aria-selected": !isInvalidDateRange && isSelected || undefined,
|
|
163
|
+
"aria-disabled": isDisabled || undefined,
|
|
164
|
+
$isCompact: isCompact,
|
|
165
165
|
onClick: () => {
|
|
166
166
|
if (!isDisabled) {
|
|
167
167
|
dispatch({
|
|
@@ -231,32 +231,32 @@ const Month = forwardRef((_ref, ref) => {
|
|
|
231
231
|
});
|
|
232
232
|
return React__default.createElement(StyledDatePicker, {
|
|
233
233
|
ref: ref,
|
|
234
|
-
isCompact: isCompact,
|
|
234
|
+
$isCompact: isCompact,
|
|
235
235
|
onMouseDown: e => {
|
|
236
236
|
e.preventDefault();
|
|
237
237
|
}
|
|
238
238
|
}, React__default.createElement(StyledHeader, {
|
|
239
|
-
isCompact: isCompact
|
|
239
|
+
$isCompact: isCompact
|
|
240
240
|
}, React__default.createElement(StyledHeaderPaddle, {
|
|
241
|
-
isCompact: isCompact,
|
|
241
|
+
$isCompact: isCompact,
|
|
242
242
|
onClick: () => {
|
|
243
243
|
dispatch({
|
|
244
244
|
type: 'PREVIEW_PREVIOUS_MONTH'
|
|
245
245
|
});
|
|
246
246
|
},
|
|
247
|
-
|
|
247
|
+
"aria-hidden": isPreviousHidden || undefined
|
|
248
248
|
}, React__default.createElement(SvgChevronLeftStroke, null)), React__default.createElement(StyledHeaderLabel, {
|
|
249
|
-
isCompact: isCompact
|
|
249
|
+
$isCompact: isCompact
|
|
250
250
|
}, headerLabelFormatter(displayDate)), React__default.createElement(StyledHeaderPaddle, {
|
|
251
|
-
isCompact: isCompact,
|
|
252
|
-
|
|
251
|
+
$isCompact: isCompact,
|
|
252
|
+
"aria-hidden": isNextHidden || undefined,
|
|
253
253
|
onClick: () => {
|
|
254
254
|
dispatch({
|
|
255
255
|
type: 'PREVIEW_NEXT_MONTH'
|
|
256
256
|
});
|
|
257
257
|
}
|
|
258
258
|
}, React__default.createElement(SvgChevronRightStroke, null))), React__default.createElement(StyledCalendar, {
|
|
259
|
-
isCompact: isCompact,
|
|
259
|
+
$isCompact: isCompact,
|
|
260
260
|
onMouseLeave: () => {
|
|
261
261
|
dispatch({
|
|
262
262
|
type: 'HOVER_DATE',
|
|
@@ -9,11 +9,12 @@ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-the
|
|
|
9
9
|
|
|
10
10
|
const COMPONENT_ID = 'datepickers.calendar';
|
|
11
11
|
const StyledCalendar = styled.div.attrs({
|
|
12
|
-
'data-garden-id': COMPONENT_ID
|
|
12
|
+
'data-garden-id': COMPONENT_ID,
|
|
13
|
+
'data-garden-version': '9.0.0-next.19'
|
|
13
14
|
}).withConfig({
|
|
14
15
|
displayName: "StyledCalendar",
|
|
15
16
|
componentId: "sc-g5hoe8-0"
|
|
16
|
-
})(["width:", "px;", ";"], props => props
|
|
17
|
+
})(["width:", "px;", ";"], props => props.$isCompact ? props.theme.space.base * 56 : props.theme.space.base * 70, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
17
18
|
StyledCalendar.defaultProps = {
|
|
18
19
|
theme: DEFAULT_THEME
|
|
19
20
|
};
|
|
@@ -8,13 +8,13 @@ import styled, { css } from 'styled-components';
|
|
|
8
8
|
import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
10
|
const COMPONENT_ID = 'datepickers.calendar_item';
|
|
11
|
-
const
|
|
11
|
+
const sizeStyles = _ref => {
|
|
12
12
|
let {
|
|
13
|
-
isCompact,
|
|
13
|
+
$isCompact,
|
|
14
14
|
theme
|
|
15
15
|
} = _ref;
|
|
16
16
|
let size;
|
|
17
|
-
if (isCompact) {
|
|
17
|
+
if ($isCompact) {
|
|
18
18
|
size = `${theme.space.base * 8}px`;
|
|
19
19
|
} else {
|
|
20
20
|
size = `${theme.space.base * 10}px`;
|
|
@@ -22,13 +22,14 @@ const retrieveSize = _ref => {
|
|
|
22
22
|
return css(["width:", ";height:", ";"], size, size);
|
|
23
23
|
};
|
|
24
24
|
const StyledCalendarItem = styled.div.attrs({
|
|
25
|
-
'data-garden-id': COMPONENT_ID
|
|
25
|
+
'data-garden-id': COMPONENT_ID,
|
|
26
|
+
'data-garden-version': '9.0.0-next.19'
|
|
26
27
|
}).withConfig({
|
|
27
28
|
displayName: "StyledCalendarItem",
|
|
28
29
|
componentId: "sc-143w8wb-0"
|
|
29
|
-
})(["display:inline-block;position:relative;vertical-align:top;", " ", ";"],
|
|
30
|
+
})(["display:inline-block;position:relative;vertical-align:top;", " ", ";"], sizeStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
30
31
|
StyledCalendarItem.defaultProps = {
|
|
31
32
|
theme: DEFAULT_THEME
|
|
32
33
|
};
|
|
33
34
|
|
|
34
|
-
export { StyledCalendarItem,
|
|
35
|
+
export { StyledCalendarItem, sizeStyles };
|
|
@@ -4,27 +4,35 @@
|
|
|
4
4
|
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
|
-
import styled from 'styled-components';
|
|
8
|
-
import {
|
|
7
|
+
import styled, { css } from 'styled-components';
|
|
8
|
+
import { retrieveComponentStyles, DEFAULT_THEME, getColor } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
10
|
const COMPONENT_ID = 'datepickers.datepicker';
|
|
11
|
-
const
|
|
11
|
+
const sizeStyles = _ref => {
|
|
12
12
|
let {
|
|
13
|
-
isCompact,
|
|
13
|
+
$isCompact,
|
|
14
14
|
theme
|
|
15
15
|
} = _ref;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
const margin = theme.space.base * ($isCompact ? 4 : 5);
|
|
17
|
+
return css(["margin:", "px;"], margin);
|
|
18
|
+
};
|
|
19
|
+
const colorStyles = _ref2 => {
|
|
20
|
+
let {
|
|
21
|
+
theme
|
|
22
|
+
} = _ref2;
|
|
23
|
+
const foreground = getColor({
|
|
24
|
+
variable: 'foreground.default',
|
|
25
|
+
theme
|
|
26
|
+
});
|
|
27
|
+
return css(["background-color:transparent;color:", ";"], foreground);
|
|
21
28
|
};
|
|
22
29
|
const StyledDatePicker = styled.div.attrs({
|
|
23
|
-
'data-garden-id': COMPONENT_ID
|
|
30
|
+
'data-garden-id': COMPONENT_ID,
|
|
31
|
+
'data-garden-version': '9.0.0-next.19'
|
|
24
32
|
}).withConfig({
|
|
25
33
|
displayName: "StyledDatePicker",
|
|
26
34
|
componentId: "sc-15hwqzh-0"
|
|
27
|
-
})(["direction:", ";", "
|
|
35
|
+
})(["direction:", ";", " ", " ", ";"], p => p.theme.rtl && 'rtl', sizeStyles, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
28
36
|
StyledDatePicker.defaultProps = {
|
|
29
37
|
theme: DEFAULT_THEME
|
|
30
38
|
};
|
|
@@ -5,48 +5,89 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
|
-
import { retrieveComponentStyles, DEFAULT_THEME,
|
|
8
|
+
import { retrieveComponentStyles, DEFAULT_THEME, getColor } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
|
-
const
|
|
10
|
+
const sizeStyles = () => {
|
|
11
|
+
return css(["border-radius:50%;width:100%;height:100%;"]);
|
|
12
|
+
};
|
|
13
|
+
const colorStyles = _ref => {
|
|
11
14
|
let {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
theme
|
|
15
|
+
$isToday,
|
|
16
|
+
$isPreviousMonth,
|
|
17
|
+
theme,
|
|
18
|
+
...props
|
|
17
19
|
} = _ref;
|
|
20
|
+
const isSelected = props['aria-selected'];
|
|
21
|
+
const isDisabled = props['aria-disabled'];
|
|
18
22
|
let backgroundColor = 'inherit';
|
|
19
|
-
let
|
|
23
|
+
let foreground;
|
|
24
|
+
const backgroundHover = getColor({
|
|
25
|
+
variable: 'background.primaryEmphasis',
|
|
26
|
+
theme,
|
|
27
|
+
transparency: theme.opacity[100]
|
|
28
|
+
});
|
|
29
|
+
const foregroundHover = !$isToday && getColor({
|
|
30
|
+
variable: 'foreground.primary',
|
|
31
|
+
light: {
|
|
32
|
+
offset: 100
|
|
33
|
+
},
|
|
34
|
+
dark: {
|
|
35
|
+
offset: -100
|
|
36
|
+
},
|
|
37
|
+
theme
|
|
38
|
+
});
|
|
39
|
+
const backgroundActive = getColor({
|
|
40
|
+
variable: 'background.primaryEmphasis',
|
|
41
|
+
theme,
|
|
42
|
+
transparency: theme.opacity[200]
|
|
43
|
+
});
|
|
44
|
+
const foregroundActive = !$isToday && getColor({
|
|
45
|
+
variable: 'foreground.primary',
|
|
46
|
+
light: {
|
|
47
|
+
offset: 200
|
|
48
|
+
},
|
|
49
|
+
dark: {
|
|
50
|
+
offset: -200
|
|
51
|
+
},
|
|
52
|
+
theme
|
|
53
|
+
});
|
|
20
54
|
if (isSelected && !isDisabled) {
|
|
21
|
-
backgroundColor =
|
|
22
|
-
|
|
55
|
+
backgroundColor = getColor({
|
|
56
|
+
variable: 'background.primaryEmphasis',
|
|
57
|
+
theme
|
|
58
|
+
});
|
|
59
|
+
foreground = getColor({
|
|
60
|
+
variable: 'foreground.onEmphasis',
|
|
61
|
+
theme
|
|
62
|
+
});
|
|
23
63
|
} else if (isDisabled) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
64
|
+
foreground = getColor({
|
|
65
|
+
variable: 'foreground.disabled',
|
|
66
|
+
theme
|
|
67
|
+
});
|
|
68
|
+
} else if ($isToday) {
|
|
69
|
+
foreground = 'inherit';
|
|
70
|
+
} else if ($isPreviousMonth) {
|
|
71
|
+
foreground = getColor({
|
|
72
|
+
variable: 'foreground.subtle',
|
|
73
|
+
theme
|
|
74
|
+
});
|
|
75
|
+
} else {
|
|
76
|
+
foreground = getColor({
|
|
77
|
+
variable: 'foreground.primary',
|
|
78
|
+
theme
|
|
79
|
+
});
|
|
29
80
|
}
|
|
30
|
-
return css(["background-color:", ";color:", ";", ""], backgroundColor,
|
|
31
|
-
:hover {
|
|
32
|
-
background-color: ${getColorV8('primaryHue', 600, theme, 0.08)};
|
|
33
|
-
color: ${getColorV8('primaryHue', 800, theme)};
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
:active {
|
|
37
|
-
background-color: ${getColorV8('primaryHue', 600, theme, 0.2)};
|
|
38
|
-
color: ${getColorV8('primaryHue', 800, theme)};
|
|
39
|
-
}
|
|
40
|
-
`);
|
|
81
|
+
return css(["background-color:", ";color:", ";&:not([aria-disabled]):not([aria-selected]):hover{background-color:", ";color:", ";}&:not([aria-disabled]):not([aria-selected]):active{background-color:", ";color:", ";}"], backgroundColor, foreground, backgroundHover, foregroundHover, backgroundActive, foregroundActive);
|
|
41
82
|
};
|
|
42
83
|
const COMPONENT_ID = 'datepickers.day';
|
|
43
|
-
const StyledDay = styled.div.attrs(
|
|
84
|
+
const StyledDay = styled.div.attrs({
|
|
44
85
|
'data-garden-id': COMPONENT_ID,
|
|
45
|
-
'
|
|
46
|
-
})
|
|
86
|
+
'data-garden-version': '9.0.0-next.19'
|
|
87
|
+
}).withConfig({
|
|
47
88
|
displayName: "StyledDay",
|
|
48
89
|
componentId: "sc-v42uk5-0"
|
|
49
|
-
})(["display:flex;position:absolute;align-items:center;justify-content:center;
|
|
90
|
+
})(["display:flex;position:absolute;align-items:center;justify-content:center;cursor:", ";font-size:", ";font-weight:", ";", " ", " ", ";"], props => props['aria-disabled'] ? 'inherit' : 'pointer', props => props.$isCompact ? props.theme.fontSizes.sm : props.theme.fontSizes.md, props => props.$isToday && !props['aria-disabled'] ? props.theme.fontWeights.semibold : 'inherit', sizeStyles, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
50
91
|
StyledDay.defaultProps = {
|
|
51
92
|
theme: DEFAULT_THEME
|
|
52
93
|
};
|
|
@@ -9,11 +9,12 @@ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-the
|
|
|
9
9
|
|
|
10
10
|
const COMPONENT_ID = 'datepickers.day_label';
|
|
11
11
|
const StyledDayLabel = styled.div.attrs({
|
|
12
|
-
'data-garden-id': COMPONENT_ID
|
|
12
|
+
'data-garden-id': COMPONENT_ID,
|
|
13
|
+
'data-garden-version': '9.0.0-next.19'
|
|
13
14
|
}).withConfig({
|
|
14
15
|
displayName: "StyledDayLabel",
|
|
15
16
|
componentId: "sc-9bh1p7-0"
|
|
16
|
-
})(["display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-size:", ";font-weight:", ";", ";"], props => props
|
|
17
|
+
})(["display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-size:", ";font-weight:", ";", ";"], props => props.$isCompact ? props.theme.fontSizes.sm : props.theme.fontSizes.md, props => props.theme.fontWeights.semibold, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
17
18
|
StyledDayLabel.defaultProps = {
|
|
18
19
|
theme: DEFAULT_THEME
|
|
19
20
|
};
|
|
@@ -9,11 +9,12 @@ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-the
|
|
|
9
9
|
|
|
10
10
|
const COMPONENT_ID = 'datepickers.header';
|
|
11
11
|
const StyledHeader = styled.div.attrs({
|
|
12
|
-
'data-garden-id': COMPONENT_ID
|
|
12
|
+
'data-garden-id': COMPONENT_ID,
|
|
13
|
+
'data-garden-version': '9.0.0-next.19'
|
|
13
14
|
}).withConfig({
|
|
14
15
|
displayName: "StyledHeader",
|
|
15
16
|
componentId: "sc-upq318-0"
|
|
16
|
-
})(["display:flex;width:", "px;", ";"], props => props
|
|
17
|
+
})(["display:flex;width:", "px;", ";"], props => props.$isCompact ? props.theme.space.base * 56 : props.theme.space.base * 70, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
17
18
|
StyledHeader.defaultProps = {
|
|
18
19
|
theme: DEFAULT_THEME
|
|
19
20
|
};
|
|
@@ -9,11 +9,12 @@ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-the
|
|
|
9
9
|
|
|
10
10
|
const COMPONENT_ID = 'datepickers.header_label';
|
|
11
11
|
const StyledHeaderLabel = styled.div.attrs({
|
|
12
|
-
'data-garden-id': COMPONENT_ID
|
|
12
|
+
'data-garden-id': COMPONENT_ID,
|
|
13
|
+
'data-garden-version': '9.0.0-next.19'
|
|
13
14
|
}).withConfig({
|
|
14
15
|
displayName: "StyledHeaderLabel",
|
|
15
16
|
componentId: "sc-1ryf5ub-0"
|
|
16
|
-
})(["display:flex;flex-grow:1;align-items:center;justify-content:center;font-size:", ";font-weight:", ";", ";"], props => props
|
|
17
|
+
})(["display:flex;flex-grow:1;align-items:center;justify-content:center;font-size:", ";font-weight:", ";", ";"], props => props.$isCompact ? props.theme.fontSizes.sm : props.theme.fontSizes.md, props => props.theme.fontWeights.semibold, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
17
18
|
StyledHeaderLabel.defaultProps = {
|
|
18
19
|
theme: DEFAULT_THEME
|
|
19
20
|
};
|
|
@@ -5,32 +5,65 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
|
-
import { retrieveComponentStyles, DEFAULT_THEME,
|
|
8
|
+
import { retrieveComponentStyles, DEFAULT_THEME, getColor } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
|
-
const
|
|
10
|
+
const sizeStyles = _ref => {
|
|
11
11
|
let {
|
|
12
|
-
isCompact,
|
|
12
|
+
$isCompact,
|
|
13
13
|
theme
|
|
14
14
|
} = _ref;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
return css(["width:", "px;height:", "px;"], size, size);
|
|
15
|
+
const iconSize = theme.iconSizes.md;
|
|
16
|
+
const size = theme.space.base * ($isCompact ? 8 : 10);
|
|
17
|
+
return css(["width:", "px;height:", "px;svg{width:", ";height:", ";}"], size, size, iconSize, iconSize);
|
|
20
18
|
};
|
|
21
|
-
const
|
|
19
|
+
const colorStyles = _ref2 => {
|
|
22
20
|
let {
|
|
23
21
|
theme
|
|
24
22
|
} = _ref2;
|
|
25
|
-
|
|
23
|
+
const foreground = getColor({
|
|
24
|
+
variable: 'foreground.subtle',
|
|
25
|
+
theme
|
|
26
|
+
});
|
|
27
|
+
const foregroundHover = getColor({
|
|
28
|
+
variable: 'foreground.subtle',
|
|
29
|
+
light: {
|
|
30
|
+
offset: 100
|
|
31
|
+
},
|
|
32
|
+
dark: {
|
|
33
|
+
offset: -100
|
|
34
|
+
},
|
|
35
|
+
theme
|
|
36
|
+
});
|
|
37
|
+
const backgroundHover = getColor({
|
|
38
|
+
variable: 'background.primaryEmphasis',
|
|
39
|
+
theme,
|
|
40
|
+
transparency: theme.opacity[100]
|
|
41
|
+
});
|
|
42
|
+
const foregroundActive = getColor({
|
|
43
|
+
variable: 'foreground.subtle',
|
|
44
|
+
light: {
|
|
45
|
+
offset: 200
|
|
46
|
+
},
|
|
47
|
+
dark: {
|
|
48
|
+
offset: -200
|
|
49
|
+
},
|
|
50
|
+
theme
|
|
51
|
+
});
|
|
52
|
+
const backgroundActive = getColor({
|
|
53
|
+
variable: 'background.primaryEmphasis',
|
|
54
|
+
theme,
|
|
55
|
+
transparency: theme.opacity[200]
|
|
56
|
+
});
|
|
57
|
+
return css(["color:", ";:hover{background-color:", ";color:", ";}:active{background-color:", ";color:", ";}"], foreground, backgroundHover, foregroundHover, backgroundActive, foregroundActive);
|
|
26
58
|
};
|
|
27
59
|
const COMPONENT_ID = 'datepickers.header_paddle';
|
|
28
60
|
const StyledHeaderPaddle = styled.div.attrs({
|
|
29
|
-
'data-garden-id': COMPONENT_ID
|
|
61
|
+
'data-garden-id': COMPONENT_ID,
|
|
62
|
+
'data-garden-version': '9.0.0-next.19'
|
|
30
63
|
}).withConfig({
|
|
31
64
|
displayName: "StyledHeaderPaddle",
|
|
32
65
|
componentId: "sc-2oqh0g-0"
|
|
33
|
-
})(["display:flex;align-items:center;justify-content:center;transform:", ";
|
|
66
|
+
})(["display:flex;align-items:center;justify-content:center;transform:", ";border-radius:50%;cursor:pointer;&[aria-hidden]{visibility:hidden;}", " ", " ", ";"], props => props.theme.rtl && 'rotate(180deg)', sizeStyles, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
34
67
|
StyledHeaderPaddle.defaultProps = {
|
|
35
68
|
theme: DEFAULT_THEME
|
|
36
69
|
};
|
|
@@ -5,44 +5,50 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
|
-
import { retrieveComponentStyles, DEFAULT_THEME,
|
|
8
|
+
import { retrieveComponentStyles, DEFAULT_THEME, getColor } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
10
|
const COMPONENT_ID = 'datepickers.highlight';
|
|
11
|
-
const
|
|
11
|
+
const sizeStyles = _ref => {
|
|
12
12
|
let {
|
|
13
13
|
theme,
|
|
14
|
-
isEnd,
|
|
15
|
-
isStart
|
|
14
|
+
$isEnd,
|
|
15
|
+
$isStart
|
|
16
16
|
} = _ref;
|
|
17
|
-
|
|
18
|
-
const
|
|
17
|
+
let borderRadius;
|
|
18
|
+
const startValue = '0 50% 50% 0;';
|
|
19
|
+
const endValue = '50% 0 0 50%;';
|
|
19
20
|
if (theme.rtl) {
|
|
20
|
-
if (isStart) {
|
|
21
|
-
|
|
22
|
-
} else if (isEnd) {
|
|
23
|
-
|
|
21
|
+
if ($isStart) {
|
|
22
|
+
borderRadius = startValue;
|
|
23
|
+
} else if ($isEnd) {
|
|
24
|
+
borderRadius = endValue;
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
|
-
if (isStart) {
|
|
27
|
-
|
|
28
|
-
} else if (isEnd) {
|
|
29
|
-
|
|
27
|
+
if ($isStart) {
|
|
28
|
+
borderRadius = endValue;
|
|
29
|
+
} else if ($isEnd) {
|
|
30
|
+
borderRadius = startValue;
|
|
30
31
|
}
|
|
31
|
-
return
|
|
32
|
+
return css(["border-radius:", ";width:100%;height:100%;"], borderRadius);
|
|
32
33
|
};
|
|
33
|
-
const
|
|
34
|
+
const colorStyles = _ref2 => {
|
|
34
35
|
let {
|
|
35
|
-
isHighlighted,
|
|
36
|
+
$isHighlighted,
|
|
36
37
|
theme
|
|
37
38
|
} = _ref2;
|
|
38
|
-
return css(["background-color:", ";"], isHighlighted &&
|
|
39
|
+
return css(["background-color:", ";"], $isHighlighted && getColor({
|
|
40
|
+
variable: 'background.primaryEmphasis',
|
|
41
|
+
transparency: theme.opacity[100],
|
|
42
|
+
theme
|
|
43
|
+
}));
|
|
39
44
|
};
|
|
40
45
|
const StyledHighlight = styled.div.attrs({
|
|
41
|
-
'data-garden-id': COMPONENT_ID
|
|
46
|
+
'data-garden-id': COMPONENT_ID,
|
|
47
|
+
'data-garden-version': '9.0.0-next.19'
|
|
42
48
|
}).withConfig({
|
|
43
49
|
displayName: "StyledHighlight",
|
|
44
50
|
componentId: "sc-16vr32x-0"
|
|
45
|
-
})(["position:absolute;top:0;left:0;
|
|
51
|
+
})(["position:absolute;top:0;left:0;", " ", " ", ";"], sizeStyles, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
46
52
|
StyledHighlight.defaultProps = {
|
|
47
53
|
theme: DEFAULT_THEME
|
|
48
54
|
};
|
|
@@ -10,7 +10,7 @@ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-the
|
|
|
10
10
|
const COMPONENT_ID = 'datepickers.menu';
|
|
11
11
|
const StyledMenu = styled.div.attrs({
|
|
12
12
|
'data-garden-id': COMPONENT_ID,
|
|
13
|
-
'data-garden-version': '9.0.0-next.
|
|
13
|
+
'data-garden-version': '9.0.0-next.19'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledMenu",
|
|
16
16
|
componentId: "sc-1npbkk0-0"
|
|
@@ -9,16 +9,18 @@ import { menuStyles, getMenuPosition, retrieveComponentStyles, DEFAULT_THEME } f
|
|
|
9
9
|
|
|
10
10
|
const COMPONENT_ID = 'datepickers.menu_wrapper';
|
|
11
11
|
const StyledMenuWrapper = styled.div.attrs(props => ({
|
|
12
|
-
|
|
12
|
+
'data-garden-id': COMPONENT_ID,
|
|
13
|
+
'data-garden-version': '9.0.0-next.19',
|
|
14
|
+
className: props.$isAnimated && 'is-animated'
|
|
13
15
|
})).withConfig({
|
|
14
16
|
displayName: "StyledMenuWrapper",
|
|
15
17
|
componentId: "sc-6fowoz-0"
|
|
16
|
-
})(["top:0;left:0;", ";", ";"], props => menuStyles(getMenuPosition(props
|
|
18
|
+
})(["top:0;left:0;", ";", ";"], props => menuStyles(getMenuPosition(props.$placement), {
|
|
17
19
|
theme: props.theme,
|
|
18
|
-
hidden: props
|
|
20
|
+
hidden: props['aria-hidden'],
|
|
19
21
|
margin: `${props.theme.space.base}px`,
|
|
20
|
-
zIndex: props
|
|
21
|
-
animationModifier: props
|
|
22
|
+
zIndex: props.$zIndex,
|
|
23
|
+
animationModifier: props.$isAnimated ? '.is-animated' : undefined
|
|
22
24
|
}), props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
23
25
|
StyledMenuWrapper.defaultProps = {
|
|
24
26
|
theme: DEFAULT_THEME
|