@zendeskgarden/react-datepickers 9.0.0-next.9 → 9.1.0
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 +19 -15
- package/dist/esm/elements/DatePicker/components/Calendar.js +12 -12
- 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 +26 -26
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/chevron-left-stroke.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/chevron-right-stroke.svg.js +1 -1
- package/dist/esm/styled/StyledCalendar.js +4 -6
- package/dist/esm/styled/StyledCalendarItem.js +8 -10
- package/dist/esm/styled/StyledDatePicker.js +19 -14
- package/dist/esm/styled/StyledDay.js +71 -33
- package/dist/esm/styled/StyledDayLabel.js +4 -6
- package/dist/esm/styled/StyledHeader.js +4 -6
- package/dist/esm/styled/StyledHeaderLabel.js +4 -6
- package/dist/esm/styled/StyledHeaderPaddle.js +45 -15
- package/dist/esm/styled/StyledHighlight.js +26 -23
- package/dist/esm/styled/StyledMenu.js +2 -5
- package/dist/esm/styled/StyledMenuWrapper.js +8 -9
- package/dist/esm/styled/StyledRangeCalendar.js +3 -5
- package/dist/index.cjs.js +248 -184
- package/dist/typings/elements/DatePicker/utils/date-picker-reducer.d.ts +4 -4
- package/dist/typings/elements/DatePicker/utils/useDatePickerContext.d.ts +0 -1
- package/dist/typings/elements/DatePickerRange/DatePickerRange.d.ts +4 -2
- package/dist/typings/elements/DatePickerRange/utils/date-picker-range-reducer.d.ts +4 -4
- 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/dist/typings/types/index.d.ts +2 -0
- package/package.json +7 -7
|
@@ -5,34 +5,64 @@
|
|
|
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,
|
|
8
|
+
import { retrieveComponentStyles, 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.1.0'
|
|
30
63
|
}).withConfig({
|
|
31
64
|
displayName: "StyledHeaderPaddle",
|
|
32
65
|
componentId: "sc-2oqh0g-0"
|
|
33
|
-
})(["display:flex;align-items:center;justify-content:center;transform:", ";
|
|
34
|
-
StyledHeaderPaddle.defaultProps = {
|
|
35
|
-
theme: DEFAULT_THEME
|
|
36
|
-
};
|
|
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));
|
|
37
67
|
|
|
38
68
|
export { StyledHeaderPaddle };
|
|
@@ -5,46 +5,49 @@
|
|
|
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,
|
|
8
|
+
import { retrieveComponentStyles, 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.1.0'
|
|
42
48
|
}).withConfig({
|
|
43
49
|
displayName: "StyledHighlight",
|
|
44
50
|
componentId: "sc-16vr32x-0"
|
|
45
|
-
})(["position:absolute;top:0;left:0;
|
|
46
|
-
StyledHighlight.defaultProps = {
|
|
47
|
-
theme: DEFAULT_THEME
|
|
48
|
-
};
|
|
51
|
+
})(["position:absolute;top:0;left:0;", " ", " ", ";"], sizeStyles, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
49
52
|
|
|
50
53
|
export { StyledHighlight };
|
|
@@ -5,18 +5,15 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled from 'styled-components';
|
|
8
|
-
import { retrieveComponentStyles
|
|
8
|
+
import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
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.
|
|
13
|
+
'data-garden-version': '9.1.0'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledMenu",
|
|
16
16
|
componentId: "sc-1npbkk0-0"
|
|
17
17
|
})(["", ";"], props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
18
|
-
StyledMenu.defaultProps = {
|
|
19
|
-
theme: DEFAULT_THEME
|
|
20
|
-
};
|
|
21
18
|
|
|
22
19
|
export { StyledMenu };
|
|
@@ -5,23 +5,22 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled from 'styled-components';
|
|
8
|
-
import { menuStyles, getMenuPosition, retrieveComponentStyles
|
|
8
|
+
import { menuStyles, getMenuPosition, retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
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.1.0',
|
|
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
|
-
StyledMenuWrapper.defaultProps = {
|
|
24
|
-
theme: DEFAULT_THEME
|
|
25
|
-
};
|
|
26
25
|
|
|
27
26
|
export { StyledMenuWrapper };
|
|
@@ -6,17 +6,15 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import styled from 'styled-components';
|
|
8
8
|
import { StyledDatePicker } from './StyledDatePicker.js';
|
|
9
|
-
import { retrieveComponentStyles
|
|
9
|
+
import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
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.1.0'
|
|
14
15
|
}).withConfig({
|
|
15
16
|
displayName: "StyledRangeCalendar",
|
|
16
17
|
componentId: "sc-1og46sy-0"
|
|
17
18
|
})(["display:flex;overflow:auto;", "{margin:0;", "}", ";"], StyledDatePicker, props => props.theme.rtl ? `&:last-of-type {margin-right: ${props.theme.space.base * 5}px}` : `&:first-of-type {margin-right: ${props.theme.space.base * 5}px}`, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
18
|
-
StyledRangeCalendar.defaultProps = {
|
|
19
|
-
theme: DEFAULT_THEME
|
|
20
|
-
};
|
|
21
19
|
|
|
22
20
|
export { StyledRangeCalendar };
|