@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
|
@@ -10,7 +10,8 @@ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-the
|
|
|
10
10
|
|
|
11
11
|
const COMPONENT_ID = 'datepickers.range_calendar';
|
|
12
12
|
const StyledRangeCalendar = styled.div.attrs({
|
|
13
|
-
'data-garden-id': COMPONENT_ID
|
|
13
|
+
'data-garden-id': COMPONENT_ID,
|
|
14
|
+
'data-garden-version': '9.0.0-next.19'
|
|
14
15
|
}).withConfig({
|
|
15
16
|
displayName: "StyledRangeCalendar",
|
|
16
17
|
componentId: "sc-1og46sy-0"
|
package/dist/index.cjs.js
CHANGED
|
@@ -62,7 +62,7 @@ const PLACEMENT = ['auto', ...reactTheming.PLACEMENT];
|
|
|
62
62
|
const COMPONENT_ID$b = 'datepickers.menu';
|
|
63
63
|
const StyledMenu = styled__default.default.div.attrs({
|
|
64
64
|
'data-garden-id': COMPONENT_ID$b,
|
|
65
|
-
'data-garden-version': '9.0.0-next.
|
|
65
|
+
'data-garden-version': '9.0.0-next.19'
|
|
66
66
|
}).withConfig({
|
|
67
67
|
displayName: "StyledMenu",
|
|
68
68
|
componentId: "sc-1npbkk0-0"
|
|
@@ -73,46 +73,57 @@ StyledMenu.defaultProps = {
|
|
|
73
73
|
|
|
74
74
|
const COMPONENT_ID$a = 'datepickers.menu_wrapper';
|
|
75
75
|
const StyledMenuWrapper = styled__default.default.div.attrs(props => ({
|
|
76
|
-
|
|
76
|
+
'data-garden-id': COMPONENT_ID$a,
|
|
77
|
+
'data-garden-version': '9.0.0-next.19',
|
|
78
|
+
className: props.$isAnimated && 'is-animated'
|
|
77
79
|
})).withConfig({
|
|
78
80
|
displayName: "StyledMenuWrapper",
|
|
79
81
|
componentId: "sc-6fowoz-0"
|
|
80
|
-
})(["top:0;left:0;", ";", ";"], props => reactTheming.menuStyles(reactTheming.getMenuPosition(props
|
|
82
|
+
})(["top:0;left:0;", ";", ";"], props => reactTheming.menuStyles(reactTheming.getMenuPosition(props.$placement), {
|
|
81
83
|
theme: props.theme,
|
|
82
|
-
hidden: props
|
|
84
|
+
hidden: props['aria-hidden'],
|
|
83
85
|
margin: `${props.theme.space.base}px`,
|
|
84
|
-
zIndex: props
|
|
85
|
-
animationModifier: props
|
|
86
|
+
zIndex: props.$zIndex,
|
|
87
|
+
animationModifier: props.$isAnimated ? '.is-animated' : undefined
|
|
86
88
|
}), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$a, props));
|
|
87
89
|
StyledMenuWrapper.defaultProps = {
|
|
88
90
|
theme: reactTheming.DEFAULT_THEME
|
|
89
91
|
};
|
|
90
92
|
|
|
91
93
|
const COMPONENT_ID$9 = 'datepickers.datepicker';
|
|
92
|
-
const
|
|
94
|
+
const sizeStyles$4 = _ref => {
|
|
93
95
|
let {
|
|
94
|
-
isCompact,
|
|
96
|
+
$isCompact,
|
|
95
97
|
theme
|
|
96
98
|
} = _ref;
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
const margin = theme.space.base * ($isCompact ? 4 : 5);
|
|
100
|
+
return styled.css(["margin:", "px;"], margin);
|
|
101
|
+
};
|
|
102
|
+
const colorStyles$3 = _ref2 => {
|
|
103
|
+
let {
|
|
104
|
+
theme
|
|
105
|
+
} = _ref2;
|
|
106
|
+
const foreground = reactTheming.getColor({
|
|
107
|
+
variable: 'foreground.default',
|
|
108
|
+
theme
|
|
109
|
+
});
|
|
110
|
+
return styled.css(["background-color:transparent;color:", ";"], foreground);
|
|
102
111
|
};
|
|
103
112
|
const StyledDatePicker = styled__default.default.div.attrs({
|
|
104
|
-
'data-garden-id': COMPONENT_ID$9
|
|
113
|
+
'data-garden-id': COMPONENT_ID$9,
|
|
114
|
+
'data-garden-version': '9.0.0-next.19'
|
|
105
115
|
}).withConfig({
|
|
106
116
|
displayName: "StyledDatePicker",
|
|
107
117
|
componentId: "sc-15hwqzh-0"
|
|
108
|
-
})(["direction:", ";", "
|
|
118
|
+
})(["direction:", ";", " ", " ", ";"], p => p.theme.rtl && 'rtl', sizeStyles$4, colorStyles$3, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$9, props));
|
|
109
119
|
StyledDatePicker.defaultProps = {
|
|
110
120
|
theme: reactTheming.DEFAULT_THEME
|
|
111
121
|
};
|
|
112
122
|
|
|
113
123
|
const COMPONENT_ID$8 = 'datepickers.range_calendar';
|
|
114
124
|
const StyledRangeCalendar = styled__default.default.div.attrs({
|
|
115
|
-
'data-garden-id': COMPONENT_ID$8
|
|
125
|
+
'data-garden-id': COMPONENT_ID$8,
|
|
126
|
+
'data-garden-version': '9.0.0-next.19'
|
|
116
127
|
}).withConfig({
|
|
117
128
|
displayName: "StyledRangeCalendar",
|
|
118
129
|
componentId: "sc-1og46sy-0"
|
|
@@ -123,73 +134,109 @@ StyledRangeCalendar.defaultProps = {
|
|
|
123
134
|
|
|
124
135
|
const COMPONENT_ID$7 = 'datepickers.header';
|
|
125
136
|
const StyledHeader = styled__default.default.div.attrs({
|
|
126
|
-
'data-garden-id': COMPONENT_ID$7
|
|
137
|
+
'data-garden-id': COMPONENT_ID$7,
|
|
138
|
+
'data-garden-version': '9.0.0-next.19'
|
|
127
139
|
}).withConfig({
|
|
128
140
|
displayName: "StyledHeader",
|
|
129
141
|
componentId: "sc-upq318-0"
|
|
130
|
-
})(["display:flex;width:", "px;", ";"], props => props
|
|
142
|
+
})(["display:flex;width:", "px;", ";"], props => props.$isCompact ? props.theme.space.base * 56 : props.theme.space.base * 70, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$7, props));
|
|
131
143
|
StyledHeader.defaultProps = {
|
|
132
144
|
theme: reactTheming.DEFAULT_THEME
|
|
133
145
|
};
|
|
134
146
|
|
|
135
|
-
const
|
|
147
|
+
const sizeStyles$3 = _ref => {
|
|
136
148
|
let {
|
|
137
|
-
isCompact,
|
|
149
|
+
$isCompact,
|
|
138
150
|
theme
|
|
139
151
|
} = _ref;
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
return styled.css(["width:", "px;height:", "px;"], size, size);
|
|
152
|
+
const iconSize = theme.iconSizes.md;
|
|
153
|
+
const size = theme.space.base * ($isCompact ? 8 : 10);
|
|
154
|
+
return styled.css(["width:", "px;height:", "px;svg{width:", ";height:", ";}"], size, size, iconSize, iconSize);
|
|
145
155
|
};
|
|
146
|
-
const
|
|
156
|
+
const colorStyles$2 = _ref2 => {
|
|
147
157
|
let {
|
|
148
158
|
theme
|
|
149
159
|
} = _ref2;
|
|
150
|
-
|
|
160
|
+
const foreground = reactTheming.getColor({
|
|
161
|
+
variable: 'foreground.subtle',
|
|
162
|
+
theme
|
|
163
|
+
});
|
|
164
|
+
const foregroundHover = reactTheming.getColor({
|
|
165
|
+
variable: 'foreground.subtle',
|
|
166
|
+
light: {
|
|
167
|
+
offset: 100
|
|
168
|
+
},
|
|
169
|
+
dark: {
|
|
170
|
+
offset: -100
|
|
171
|
+
},
|
|
172
|
+
theme
|
|
173
|
+
});
|
|
174
|
+
const backgroundHover = reactTheming.getColor({
|
|
175
|
+
variable: 'background.primaryEmphasis',
|
|
176
|
+
theme,
|
|
177
|
+
transparency: theme.opacity[100]
|
|
178
|
+
});
|
|
179
|
+
const foregroundActive = reactTheming.getColor({
|
|
180
|
+
variable: 'foreground.subtle',
|
|
181
|
+
light: {
|
|
182
|
+
offset: 200
|
|
183
|
+
},
|
|
184
|
+
dark: {
|
|
185
|
+
offset: -200
|
|
186
|
+
},
|
|
187
|
+
theme
|
|
188
|
+
});
|
|
189
|
+
const backgroundActive = reactTheming.getColor({
|
|
190
|
+
variable: 'background.primaryEmphasis',
|
|
191
|
+
theme,
|
|
192
|
+
transparency: theme.opacity[200]
|
|
193
|
+
});
|
|
194
|
+
return styled.css(["color:", ";:hover{background-color:", ";color:", ";}:active{background-color:", ";color:", ";}"], foreground, backgroundHover, foregroundHover, backgroundActive, foregroundActive);
|
|
151
195
|
};
|
|
152
196
|
const COMPONENT_ID$6 = 'datepickers.header_paddle';
|
|
153
197
|
const StyledHeaderPaddle = styled__default.default.div.attrs({
|
|
154
|
-
'data-garden-id': COMPONENT_ID$6
|
|
198
|
+
'data-garden-id': COMPONENT_ID$6,
|
|
199
|
+
'data-garden-version': '9.0.0-next.19'
|
|
155
200
|
}).withConfig({
|
|
156
201
|
displayName: "StyledHeaderPaddle",
|
|
157
202
|
componentId: "sc-2oqh0g-0"
|
|
158
|
-
})(["display:flex;align-items:center;justify-content:center;transform:", ";
|
|
203
|
+
})(["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$3, colorStyles$2, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$6, props));
|
|
159
204
|
StyledHeaderPaddle.defaultProps = {
|
|
160
205
|
theme: reactTheming.DEFAULT_THEME
|
|
161
206
|
};
|
|
162
207
|
|
|
163
208
|
const COMPONENT_ID$5 = 'datepickers.header_label';
|
|
164
209
|
const StyledHeaderLabel = styled__default.default.div.attrs({
|
|
165
|
-
'data-garden-id': COMPONENT_ID$5
|
|
210
|
+
'data-garden-id': COMPONENT_ID$5,
|
|
211
|
+
'data-garden-version': '9.0.0-next.19'
|
|
166
212
|
}).withConfig({
|
|
167
213
|
displayName: "StyledHeaderLabel",
|
|
168
214
|
componentId: "sc-1ryf5ub-0"
|
|
169
|
-
})(["display:flex;flex-grow:1;align-items:center;justify-content:center;font-size:", ";font-weight:", ";", ";"], props => props
|
|
215
|
+
})(["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 => reactTheming.retrieveComponentStyles(COMPONENT_ID$5, props));
|
|
170
216
|
StyledHeaderLabel.defaultProps = {
|
|
171
217
|
theme: reactTheming.DEFAULT_THEME
|
|
172
218
|
};
|
|
173
219
|
|
|
174
220
|
const COMPONENT_ID$4 = 'datepickers.calendar';
|
|
175
221
|
const StyledCalendar = styled__default.default.div.attrs({
|
|
176
|
-
'data-garden-id': COMPONENT_ID$4
|
|
222
|
+
'data-garden-id': COMPONENT_ID$4,
|
|
223
|
+
'data-garden-version': '9.0.0-next.19'
|
|
177
224
|
}).withConfig({
|
|
178
225
|
displayName: "StyledCalendar",
|
|
179
226
|
componentId: "sc-g5hoe8-0"
|
|
180
|
-
})(["width:", "px;", ";"], props => props
|
|
227
|
+
})(["width:", "px;", ";"], props => props.$isCompact ? props.theme.space.base * 56 : props.theme.space.base * 70, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$4, props));
|
|
181
228
|
StyledCalendar.defaultProps = {
|
|
182
229
|
theme: reactTheming.DEFAULT_THEME
|
|
183
230
|
};
|
|
184
231
|
|
|
185
232
|
const COMPONENT_ID$3 = 'datepickers.calendar_item';
|
|
186
|
-
const
|
|
233
|
+
const sizeStyles$2 = _ref => {
|
|
187
234
|
let {
|
|
188
|
-
isCompact,
|
|
235
|
+
$isCompact,
|
|
189
236
|
theme
|
|
190
237
|
} = _ref;
|
|
191
238
|
let size;
|
|
192
|
-
if (isCompact) {
|
|
239
|
+
if ($isCompact) {
|
|
193
240
|
size = `${theme.space.base * 8}px`;
|
|
194
241
|
} else {
|
|
195
242
|
size = `${theme.space.base * 10}px`;
|
|
@@ -197,106 +244,155 @@ const retrieveSize = _ref => {
|
|
|
197
244
|
return styled.css(["width:", ";height:", ";"], size, size);
|
|
198
245
|
};
|
|
199
246
|
const StyledCalendarItem = styled__default.default.div.attrs({
|
|
200
|
-
'data-garden-id': COMPONENT_ID$3
|
|
247
|
+
'data-garden-id': COMPONENT_ID$3,
|
|
248
|
+
'data-garden-version': '9.0.0-next.19'
|
|
201
249
|
}).withConfig({
|
|
202
250
|
displayName: "StyledCalendarItem",
|
|
203
251
|
componentId: "sc-143w8wb-0"
|
|
204
|
-
})(["display:inline-block;position:relative;vertical-align:top;", " ", ";"],
|
|
252
|
+
})(["display:inline-block;position:relative;vertical-align:top;", " ", ";"], sizeStyles$2, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$3, props));
|
|
205
253
|
StyledCalendarItem.defaultProps = {
|
|
206
254
|
theme: reactTheming.DEFAULT_THEME
|
|
207
255
|
};
|
|
208
256
|
|
|
209
257
|
const COMPONENT_ID$2 = 'datepickers.day_label';
|
|
210
258
|
const StyledDayLabel = styled__default.default.div.attrs({
|
|
211
|
-
'data-garden-id': COMPONENT_ID$2
|
|
259
|
+
'data-garden-id': COMPONENT_ID$2,
|
|
260
|
+
'data-garden-version': '9.0.0-next.19'
|
|
212
261
|
}).withConfig({
|
|
213
262
|
displayName: "StyledDayLabel",
|
|
214
263
|
componentId: "sc-9bh1p7-0"
|
|
215
|
-
})(["display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-size:", ";font-weight:", ";", ";"], props => props
|
|
264
|
+
})(["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 => reactTheming.retrieveComponentStyles(COMPONENT_ID$2, props));
|
|
216
265
|
StyledDayLabel.defaultProps = {
|
|
217
266
|
theme: reactTheming.DEFAULT_THEME
|
|
218
267
|
};
|
|
219
268
|
|
|
220
269
|
const COMPONENT_ID$1 = 'datepickers.highlight';
|
|
221
|
-
const
|
|
270
|
+
const sizeStyles$1 = _ref => {
|
|
222
271
|
let {
|
|
223
272
|
theme,
|
|
224
|
-
isEnd,
|
|
225
|
-
isStart
|
|
273
|
+
$isEnd,
|
|
274
|
+
$isStart
|
|
226
275
|
} = _ref;
|
|
227
|
-
|
|
228
|
-
const
|
|
276
|
+
let borderRadius;
|
|
277
|
+
const startValue = '0 50% 50% 0;';
|
|
278
|
+
const endValue = '50% 0 0 50%;';
|
|
229
279
|
if (theme.rtl) {
|
|
230
|
-
if (isStart) {
|
|
231
|
-
|
|
232
|
-
} else if (isEnd) {
|
|
233
|
-
|
|
280
|
+
if ($isStart) {
|
|
281
|
+
borderRadius = startValue;
|
|
282
|
+
} else if ($isEnd) {
|
|
283
|
+
borderRadius = endValue;
|
|
234
284
|
}
|
|
235
285
|
}
|
|
236
|
-
if (isStart) {
|
|
237
|
-
|
|
238
|
-
} else if (isEnd) {
|
|
239
|
-
|
|
286
|
+
if ($isStart) {
|
|
287
|
+
borderRadius = endValue;
|
|
288
|
+
} else if ($isEnd) {
|
|
289
|
+
borderRadius = startValue;
|
|
240
290
|
}
|
|
241
|
-
return
|
|
291
|
+
return styled.css(["border-radius:", ";width:100%;height:100%;"], borderRadius);
|
|
242
292
|
};
|
|
243
|
-
const
|
|
293
|
+
const colorStyles$1 = _ref2 => {
|
|
244
294
|
let {
|
|
245
|
-
isHighlighted,
|
|
295
|
+
$isHighlighted,
|
|
246
296
|
theme
|
|
247
297
|
} = _ref2;
|
|
248
|
-
return styled.css(["background-color:", ";"], isHighlighted && reactTheming.
|
|
298
|
+
return styled.css(["background-color:", ";"], $isHighlighted && reactTheming.getColor({
|
|
299
|
+
variable: 'background.primaryEmphasis',
|
|
300
|
+
transparency: theme.opacity[100],
|
|
301
|
+
theme
|
|
302
|
+
}));
|
|
249
303
|
};
|
|
250
304
|
const StyledHighlight = styled__default.default.div.attrs({
|
|
251
|
-
'data-garden-id': COMPONENT_ID$1
|
|
305
|
+
'data-garden-id': COMPONENT_ID$1,
|
|
306
|
+
'data-garden-version': '9.0.0-next.19'
|
|
252
307
|
}).withConfig({
|
|
253
308
|
displayName: "StyledHighlight",
|
|
254
309
|
componentId: "sc-16vr32x-0"
|
|
255
|
-
})(["position:absolute;top:0;left:0;
|
|
310
|
+
})(["position:absolute;top:0;left:0;", " ", " ", ";"], sizeStyles$1, colorStyles$1, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$1, props));
|
|
256
311
|
StyledHighlight.defaultProps = {
|
|
257
312
|
theme: reactTheming.DEFAULT_THEME
|
|
258
313
|
};
|
|
259
314
|
|
|
260
|
-
const
|
|
315
|
+
const sizeStyles = () => {
|
|
316
|
+
return styled.css(["border-radius:50%;width:100%;height:100%;"]);
|
|
317
|
+
};
|
|
318
|
+
const colorStyles = _ref => {
|
|
261
319
|
let {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
theme
|
|
320
|
+
$isToday,
|
|
321
|
+
$isPreviousMonth,
|
|
322
|
+
theme,
|
|
323
|
+
...props
|
|
267
324
|
} = _ref;
|
|
325
|
+
const isSelected = props['aria-selected'];
|
|
326
|
+
const isDisabled = props['aria-disabled'];
|
|
268
327
|
let backgroundColor = 'inherit';
|
|
269
|
-
let
|
|
328
|
+
let foreground;
|
|
329
|
+
const backgroundHover = reactTheming.getColor({
|
|
330
|
+
variable: 'background.primaryEmphasis',
|
|
331
|
+
theme,
|
|
332
|
+
transparency: theme.opacity[100]
|
|
333
|
+
});
|
|
334
|
+
const foregroundHover = !$isToday && reactTheming.getColor({
|
|
335
|
+
variable: 'foreground.primary',
|
|
336
|
+
light: {
|
|
337
|
+
offset: 100
|
|
338
|
+
},
|
|
339
|
+
dark: {
|
|
340
|
+
offset: -100
|
|
341
|
+
},
|
|
342
|
+
theme
|
|
343
|
+
});
|
|
344
|
+
const backgroundActive = reactTheming.getColor({
|
|
345
|
+
variable: 'background.primaryEmphasis',
|
|
346
|
+
theme,
|
|
347
|
+
transparency: theme.opacity[200]
|
|
348
|
+
});
|
|
349
|
+
const foregroundActive = !$isToday && reactTheming.getColor({
|
|
350
|
+
variable: 'foreground.primary',
|
|
351
|
+
light: {
|
|
352
|
+
offset: 200
|
|
353
|
+
},
|
|
354
|
+
dark: {
|
|
355
|
+
offset: -200
|
|
356
|
+
},
|
|
357
|
+
theme
|
|
358
|
+
});
|
|
270
359
|
if (isSelected && !isDisabled) {
|
|
271
|
-
backgroundColor = reactTheming.
|
|
272
|
-
|
|
360
|
+
backgroundColor = reactTheming.getColor({
|
|
361
|
+
variable: 'background.primaryEmphasis',
|
|
362
|
+
theme
|
|
363
|
+
});
|
|
364
|
+
foreground = reactTheming.getColor({
|
|
365
|
+
variable: 'foreground.onEmphasis',
|
|
366
|
+
theme
|
|
367
|
+
});
|
|
273
368
|
} else if (isDisabled) {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
369
|
+
foreground = reactTheming.getColor({
|
|
370
|
+
variable: 'foreground.disabled',
|
|
371
|
+
theme
|
|
372
|
+
});
|
|
373
|
+
} else if ($isToday) {
|
|
374
|
+
foreground = 'inherit';
|
|
375
|
+
} else if ($isPreviousMonth) {
|
|
376
|
+
foreground = reactTheming.getColor({
|
|
377
|
+
variable: 'foreground.subtle',
|
|
378
|
+
theme
|
|
379
|
+
});
|
|
380
|
+
} else {
|
|
381
|
+
foreground = reactTheming.getColor({
|
|
382
|
+
variable: 'foreground.primary',
|
|
383
|
+
theme
|
|
384
|
+
});
|
|
279
385
|
}
|
|
280
|
-
return styled.css(["background-color:", ";color:", ";", ""], backgroundColor,
|
|
281
|
-
:hover {
|
|
282
|
-
background-color: ${reactTheming.getColorV8('primaryHue', 600, theme, 0.08)};
|
|
283
|
-
color: ${reactTheming.getColorV8('primaryHue', 800, theme)};
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
:active {
|
|
287
|
-
background-color: ${reactTheming.getColorV8('primaryHue', 600, theme, 0.2)};
|
|
288
|
-
color: ${reactTheming.getColorV8('primaryHue', 800, theme)};
|
|
289
|
-
}
|
|
290
|
-
`);
|
|
386
|
+
return styled.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);
|
|
291
387
|
};
|
|
292
388
|
const COMPONENT_ID = 'datepickers.day';
|
|
293
|
-
const StyledDay = styled__default.default.div.attrs(
|
|
389
|
+
const StyledDay = styled__default.default.div.attrs({
|
|
294
390
|
'data-garden-id': COMPONENT_ID,
|
|
295
|
-
'
|
|
296
|
-
})
|
|
391
|
+
'data-garden-version': '9.0.0-next.19'
|
|
392
|
+
}).withConfig({
|
|
297
393
|
displayName: "StyledDay",
|
|
298
394
|
componentId: "sc-v42uk5-0"
|
|
299
|
-
})(["display:flex;position:absolute;align-items:center;justify-content:center;
|
|
395
|
+
})(["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 => reactTheming.retrieveComponentStyles(COMPONENT_ID, props));
|
|
300
396
|
StyledDay.defaultProps = {
|
|
301
397
|
theme: reactTheming.DEFAULT_THEME
|
|
302
398
|
};
|
|
@@ -436,18 +532,18 @@ const MonthSelector = _ref => {
|
|
|
436
532
|
return formatter.format(date);
|
|
437
533
|
}, [locale]);
|
|
438
534
|
return React__namespace.default.createElement(StyledHeader, {
|
|
439
|
-
isCompact: isCompact
|
|
535
|
+
$isCompact: isCompact
|
|
440
536
|
}, React__namespace.default.createElement(StyledHeaderPaddle, {
|
|
441
|
-
isCompact: isCompact,
|
|
537
|
+
$isCompact: isCompact,
|
|
442
538
|
onClick: () => {
|
|
443
539
|
dispatch({
|
|
444
540
|
type: 'PREVIEW_PREVIOUS_MONTH'
|
|
445
541
|
});
|
|
446
542
|
}
|
|
447
543
|
}, React__namespace.default.createElement(SvgChevronLeftStroke, null)), React__namespace.default.createElement(StyledHeaderLabel, {
|
|
448
|
-
isCompact: isCompact
|
|
544
|
+
$isCompact: isCompact
|
|
449
545
|
}, headerLabelFormatter(state.previewDate)), React__namespace.default.createElement(StyledHeaderPaddle, {
|
|
450
|
-
isCompact: isCompact,
|
|
546
|
+
$isCompact: isCompact,
|
|
451
547
|
onClick: () => {
|
|
452
548
|
dispatch({
|
|
453
549
|
type: 'PREVIEW_NEXT_MONTH'
|
|
@@ -491,9 +587,9 @@ const Calendar$1 = React.forwardRef((_ref, ref) => {
|
|
|
491
587
|
const formattedDayLabel = dayLabelFormatter(date);
|
|
492
588
|
return React__namespace.default.createElement(StyledCalendarItem, {
|
|
493
589
|
key: `day-label-${formattedDayLabel}`,
|
|
494
|
-
isCompact: isCompact
|
|
590
|
+
$isCompact: isCompact
|
|
495
591
|
}, React__namespace.default.createElement(StyledDayLabel, {
|
|
496
|
-
isCompact: isCompact
|
|
592
|
+
$isCompact: isCompact
|
|
497
593
|
}, formattedDayLabel));
|
|
498
594
|
});
|
|
499
595
|
const items = eachDayOfInterval.eachDayOfInterval({
|
|
@@ -513,13 +609,13 @@ const Calendar$1 = React.forwardRef((_ref, ref) => {
|
|
|
513
609
|
}
|
|
514
610
|
return React__namespace.default.createElement(StyledCalendarItem, {
|
|
515
611
|
key: `day-${itemsIndex}`,
|
|
516
|
-
isCompact: isCompact
|
|
612
|
+
$isCompact: isCompact
|
|
517
613
|
}, React__namespace.default.createElement(StyledDay, {
|
|
518
|
-
isToday: isCurrentDate,
|
|
519
|
-
isPreviousMonth: isPreviousMonth,
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
614
|
+
$isToday: isCurrentDate,
|
|
615
|
+
$isPreviousMonth: isPreviousMonth,
|
|
616
|
+
$isCompact: isCompact,
|
|
617
|
+
"aria-selected": isSelected || undefined,
|
|
618
|
+
"aria-disabled": isDisabled || undefined,
|
|
523
619
|
onClick: () => {
|
|
524
620
|
if (!isDisabled) {
|
|
525
621
|
dispatch({
|
|
@@ -532,7 +628,7 @@ const Calendar$1 = React.forwardRef((_ref, ref) => {
|
|
|
532
628
|
});
|
|
533
629
|
return React__namespace.default.createElement(StyledDatePicker, {
|
|
534
630
|
ref: ref,
|
|
535
|
-
isCompact: isCompact,
|
|
631
|
+
$isCompact: isCompact,
|
|
536
632
|
onMouseDown: e => {
|
|
537
633
|
e.preventDefault();
|
|
538
634
|
}
|
|
@@ -540,7 +636,7 @@ const Calendar$1 = React.forwardRef((_ref, ref) => {
|
|
|
540
636
|
locale: locale,
|
|
541
637
|
isCompact: isCompact
|
|
542
638
|
}), React__namespace.default.createElement(StyledCalendar, {
|
|
543
|
-
isCompact: isCompact
|
|
639
|
+
$isCompact: isCompact
|
|
544
640
|
}, dayLabels, items));
|
|
545
641
|
});
|
|
546
642
|
Calendar$1.displayName = 'Calendar';
|
|
@@ -883,10 +979,10 @@ const DatePicker = React.forwardRef((props, calendarRef) => {
|
|
|
883
979
|
style: {
|
|
884
980
|
transform
|
|
885
981
|
},
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
982
|
+
$isAnimated: isAnimated && (state.isOpen || isVisible),
|
|
983
|
+
$placement: placement,
|
|
984
|
+
$zIndex: zIndex,
|
|
985
|
+
"aria-hidden": !state.isOpen || undefined
|
|
890
986
|
}, (state.isOpen || isVisible) && React__namespace.default.createElement(StyledMenu, menuProps, React__namespace.default.createElement(Calendar$1, {
|
|
891
987
|
ref: calendarRef,
|
|
892
988
|
isCompact: isCompact,
|
|
@@ -1410,9 +1506,9 @@ const Month = React.forwardRef((_ref, ref) => {
|
|
|
1410
1506
|
const formattedDayLabel = dayLabelFormatter(date);
|
|
1411
1507
|
return React__namespace.default.createElement(StyledCalendarItem, {
|
|
1412
1508
|
key: `day-label-${formattedDayLabel}`,
|
|
1413
|
-
isCompact: isCompact
|
|
1509
|
+
$isCompact: isCompact
|
|
1414
1510
|
}, React__namespace.default.createElement(StyledDayLabel, {
|
|
1415
|
-
isCompact: isCompact
|
|
1511
|
+
$isCompact: isCompact
|
|
1416
1512
|
}, formattedDayLabel));
|
|
1417
1513
|
});
|
|
1418
1514
|
const items = eachDayOfInterval.eachDayOfInterval({
|
|
@@ -1425,11 +1521,11 @@ const Month = React.forwardRef((_ref, ref) => {
|
|
|
1425
1521
|
if (isPreviousMonth) {
|
|
1426
1522
|
return React__namespace.default.createElement(StyledCalendarItem, {
|
|
1427
1523
|
key: `day-${itemsIndex}`,
|
|
1428
|
-
isCompact: isCompact
|
|
1524
|
+
$isCompact: isCompact
|
|
1429
1525
|
}, React__namespace.default.createElement(StyledDay, {
|
|
1430
|
-
isCompact: isCompact,
|
|
1431
|
-
isPreviousMonth: true,
|
|
1432
|
-
|
|
1526
|
+
$isCompact: isCompact,
|
|
1527
|
+
$isPreviousMonth: true,
|
|
1528
|
+
"aria-disabled": true
|
|
1433
1529
|
}, "\xA0"));
|
|
1434
1530
|
}
|
|
1435
1531
|
let isSelected = false;
|
|
@@ -1473,17 +1569,17 @@ const Month = React.forwardRef((_ref, ref) => {
|
|
|
1473
1569
|
}
|
|
1474
1570
|
return React__namespace.default.createElement(StyledCalendarItem, {
|
|
1475
1571
|
key: `day-${itemsIndex}`,
|
|
1476
|
-
isCompact: isCompact
|
|
1572
|
+
$isCompact: isCompact
|
|
1477
1573
|
}, React__namespace.default.createElement(StyledHighlight, {
|
|
1478
|
-
isHighlighted: !isInvalidDateRange && isHighlighted && !isDisabled,
|
|
1479
|
-
isStart: !isInvalidDateRange && isHighlightStart,
|
|
1480
|
-
isEnd: !isInvalidDateRange && isHighlightEnd
|
|
1574
|
+
$isHighlighted: !isInvalidDateRange && isHighlighted && !isDisabled,
|
|
1575
|
+
$isStart: !isInvalidDateRange && isHighlightStart,
|
|
1576
|
+
$isEnd: !isInvalidDateRange && isHighlightEnd
|
|
1481
1577
|
}), React__namespace.default.createElement(StyledDay, {
|
|
1482
|
-
isToday: isCurrentDate,
|
|
1483
|
-
isPreviousMonth: isPreviousMonth,
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
isCompact: isCompact,
|
|
1578
|
+
$isToday: isCurrentDate,
|
|
1579
|
+
$isPreviousMonth: isPreviousMonth,
|
|
1580
|
+
"aria-selected": !isInvalidDateRange && isSelected || undefined,
|
|
1581
|
+
"aria-disabled": isDisabled || undefined,
|
|
1582
|
+
$isCompact: isCompact,
|
|
1487
1583
|
onClick: () => {
|
|
1488
1584
|
if (!isDisabled) {
|
|
1489
1585
|
dispatch({
|
|
@@ -1553,32 +1649,32 @@ const Month = React.forwardRef((_ref, ref) => {
|
|
|
1553
1649
|
});
|
|
1554
1650
|
return React__namespace.default.createElement(StyledDatePicker, {
|
|
1555
1651
|
ref: ref,
|
|
1556
|
-
isCompact: isCompact,
|
|
1652
|
+
$isCompact: isCompact,
|
|
1557
1653
|
onMouseDown: e => {
|
|
1558
1654
|
e.preventDefault();
|
|
1559
1655
|
}
|
|
1560
1656
|
}, React__namespace.default.createElement(StyledHeader, {
|
|
1561
|
-
isCompact: isCompact
|
|
1657
|
+
$isCompact: isCompact
|
|
1562
1658
|
}, React__namespace.default.createElement(StyledHeaderPaddle, {
|
|
1563
|
-
isCompact: isCompact,
|
|
1659
|
+
$isCompact: isCompact,
|
|
1564
1660
|
onClick: () => {
|
|
1565
1661
|
dispatch({
|
|
1566
1662
|
type: 'PREVIEW_PREVIOUS_MONTH'
|
|
1567
1663
|
});
|
|
1568
1664
|
},
|
|
1569
|
-
|
|
1665
|
+
"aria-hidden": isPreviousHidden || undefined
|
|
1570
1666
|
}, React__namespace.default.createElement(SvgChevronLeftStroke, null)), React__namespace.default.createElement(StyledHeaderLabel, {
|
|
1571
|
-
isCompact: isCompact
|
|
1667
|
+
$isCompact: isCompact
|
|
1572
1668
|
}, headerLabelFormatter(displayDate)), React__namespace.default.createElement(StyledHeaderPaddle, {
|
|
1573
|
-
isCompact: isCompact,
|
|
1574
|
-
|
|
1669
|
+
$isCompact: isCompact,
|
|
1670
|
+
"aria-hidden": isNextHidden || undefined,
|
|
1575
1671
|
onClick: () => {
|
|
1576
1672
|
dispatch({
|
|
1577
1673
|
type: 'PREVIEW_NEXT_MONTH'
|
|
1578
1674
|
});
|
|
1579
1675
|
}
|
|
1580
1676
|
}, React__namespace.default.createElement(SvgChevronRightStroke, null))), React__namespace.default.createElement(StyledCalendar, {
|
|
1581
|
-
isCompact: isCompact,
|
|
1677
|
+
$isCompact: isCompact,
|
|
1582
1678
|
onMouseLeave: () => {
|
|
1583
1679
|
dispatch({
|
|
1584
1680
|
type: 'HOVER_DATE',
|
|
@@ -1596,7 +1692,7 @@ const Calendar = React.forwardRef((props, ref) => {
|
|
|
1596
1692
|
return React__namespace.default.createElement(StyledRangeCalendar, Object.assign({
|
|
1597
1693
|
ref: ref,
|
|
1598
1694
|
"data-garden-id": "datepickers.range",
|
|
1599
|
-
"data-garden-version": '9.0.0-next.
|
|
1695
|
+
"data-garden-version": '9.0.0-next.19'
|
|
1600
1696
|
}, props), React__namespace.default.createElement(Month, {
|
|
1601
1697
|
displayDate: state.previewDate,
|
|
1602
1698
|
isNextHidden: true
|
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
interface IStyledCalendarProps {
|
|
8
|
-
isCompact?: boolean;
|
|
8
|
+
$isCompact?: boolean;
|
|
9
9
|
}
|
|
10
10
|
export declare const StyledCalendar: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
11
11
|
'data-garden-id': string;
|
|
12
|
-
|
|
12
|
+
'data-garden-version': string;
|
|
13
|
+
} & IStyledCalendarProps, "data-garden-id" | "data-garden-version">;
|
|
13
14
|
export {};
|
|
@@ -5,11 +5,12 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import { ThemeProps, DefaultTheme } from 'styled-components';
|
|
8
|
-
export declare const
|
|
8
|
+
export declare const sizeStyles: ({ $isCompact, theme }: IStyledCalendarItemProps & ThemeProps<DefaultTheme>) => import("styled-components").FlattenSimpleInterpolation;
|
|
9
9
|
interface IStyledCalendarItemProps {
|
|
10
|
-
isCompact?: boolean;
|
|
10
|
+
$isCompact?: boolean;
|
|
11
11
|
}
|
|
12
12
|
export declare const StyledCalendarItem: import("styled-components").StyledComponent<"div", DefaultTheme, {
|
|
13
13
|
'data-garden-id': string;
|
|
14
|
-
|
|
14
|
+
'data-garden-version': string;
|
|
15
|
+
} & IStyledCalendarItemProps, "data-garden-id" | "data-garden-version">;
|
|
15
16
|
export {};
|