@ringcentral/juno 2.26.1 → 2.26.2
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/components/Forms/Picker/DatePicker/DatePickerHeader.js +2 -2
- package/components/Forms/Picker/DatePicker/Year.js +1 -1
- package/components/Forms/Picker/DatePicker/styles/StyledDatePickerHeader.js +1 -1
- package/components/Forms/Picker/DatePicker/styles/StyledDay.js +3 -1
- package/components/Forms/Picker/DatePicker/styles/StyledYear.js +1 -1
- package/components/Forms/Picker/styles/PickerBaseIconButton.js +1 -1
- package/components/Forms/Picker/styles/datePickerCustomFocusRingStyle.d.ts +5 -0
- package/components/Forms/Picker/styles/datePickerCustomFocusRingStyle.js +15 -0
- package/components/Forms/Picker/styles/index.d.ts +1 -0
- package/components/Forms/Picker/styles/index.js +1 -0
- package/es6/components/Forms/Picker/DatePicker/DatePickerHeader.js +2 -2
- package/es6/components/Forms/Picker/DatePicker/Year.js +1 -1
- package/es6/components/Forms/Picker/DatePicker/styles/StyledDatePickerHeader.js +1 -1
- package/es6/components/Forms/Picker/DatePicker/styles/StyledDay.js +3 -1
- package/es6/components/Forms/Picker/DatePicker/styles/StyledYear.js +2 -2
- package/es6/components/Forms/Picker/styles/PickerBaseIconButton.js +1 -1
- package/es6/components/Forms/Picker/styles/datePickerCustomFocusRingStyle.js +13 -0
- package/es6/components/Forms/Picker/styles/index.js +1 -0
- package/es6/foundation/styles/focusVisible.js +5 -1
- package/foundation/styles/focusVisible.d.ts +1 -1
- package/foundation/styles/focusVisible.js +5 -1
- package/package.json +1 -1
|
@@ -37,8 +37,8 @@ var DatePickerHeader = react_1.memo(function (props) {
|
|
|
37
37
|
monthLabel,
|
|
38
38
|
react_1.default.createElement(SelectArrowDownIcon_1.SelectArrowDownIcon, null)),
|
|
39
39
|
react_1.default.createElement(styles_1.SwitchHeaderButtonWrapper, { size: size, gap: 3, view: view },
|
|
40
|
-
react_1.default.createElement(styles_1.SwitchHeaderButton, { color: "neutral.f04", size: "small", disabled: disablePrevMonth, onClick: selectPreviousMonth, symbol: juno_icon_1.ArrowLeft2, "aria-label": previousMonthAriaLabel, "data-picker-action": true, "data-test-automation-id": "date-picker-pre-month", className: classes.leftArrow }),
|
|
41
|
-
react_1.default.createElement(styles_1.SwitchHeaderButton, { color: "neutral.f04", size: "small", disabled: disableNextMonth, onClick: selectNextMonth, symbol: juno_icon_1.ArrowRight, "aria-label": nextMonthAriaLabel, "data-picker-action": true, "data-test-automation-id": "date-picker-next-month", className: classes.rightArrow })))));
|
|
40
|
+
react_1.default.createElement(styles_1.SwitchHeaderButton, { color: "neutral.f04", size: "small", disabled: disablePrevMonth, onClick: selectPreviousMonth, symbol: juno_icon_1.ArrowLeft2, "aria-label": previousMonthAriaLabel, "data-picker-action": true, "data-test-automation-id": "date-picker-pre-month", className: classes.leftArrow, focusVariant: "focusRing" }),
|
|
41
|
+
react_1.default.createElement(styles_1.SwitchHeaderButton, { color: "neutral.f04", size: "small", disabled: disableNextMonth, onClick: selectNextMonth, symbol: juno_icon_1.ArrowRight, "aria-label": nextMonthAriaLabel, "data-picker-action": true, "data-test-automation-id": "date-picker-next-month", className: classes.rightArrow, focusVariant: "focusRing" })))));
|
|
42
42
|
});
|
|
43
43
|
exports.DatePickerHeader = DatePickerHeader;
|
|
44
44
|
DatePickerHeader.defaultProps = {
|
|
@@ -16,7 +16,7 @@ var Year = react_1.memo(react_1.forwardRef(function (props, ref) {
|
|
|
16
16
|
});
|
|
17
17
|
var yearAriaLabel = getYearAriaLabel === null || getYearAriaLabel === void 0 ? void 0 : getYearAriaLabel("" + value, selected);
|
|
18
18
|
var handleClick = !disabled ? _handleClick : undefined;
|
|
19
|
-
return (react_1.default.createElement(styles_1.StyledYear, tslib_1.__assign({ radius: "round", onClick: handleClick, onKeyPress: handleClick, ref: ref, selected: selected, "aria-pressed": focused, "aria-label": yearAriaLabel, className: className, "data-test-automation-class": "date-picker-year", "data-test-automation-value": children }, rest),
|
|
19
|
+
return (react_1.default.createElement(styles_1.StyledYear, tslib_1.__assign({ radius: "round", onClick: handleClick, onKeyPress: handleClick, ref: ref, selected: selected, "aria-pressed": focused, size: "medium", "aria-label": yearAriaLabel, className: className, "data-test-automation-class": "date-picker-year", "data-test-automation-value": children }, rest),
|
|
20
20
|
react_1.default.createElement(react_1.default.Fragment, null,
|
|
21
21
|
// TODO: that <></> will fix when `RcIconButton` ready
|
|
22
22
|
children)));
|
|
@@ -7,7 +7,7 @@ var utils_1 = require("../../../../Buttons/IconButton/utils");
|
|
|
7
7
|
var Icon_1 = require("../../../../Icon");
|
|
8
8
|
var utils_2 = require("../utils");
|
|
9
9
|
var monthInactiveStyle = foundation_1.css(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n &,\n ", " {\n color: ", ";\n }\n"], ["\n &,\n ", " {\n color: ", ";\n }\n"])), Icon_1.RcIcon, foundation_1.focusVisibleColor);
|
|
10
|
-
var StyledCurrentMonth = foundation_1.styled.button(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject(["\n background: none;\n border: none;\n cursor: pointer;\n outline: inherit;\n\n ", ";\n position: relative;\n cursor: pointer;\n margin-left: ", ";\n color: ", ";\n ", ";\n border-radius: ", ";\n\n padding: ", ";\n\n ", ";\n\n ", " {\n margin-left: ", ";\n transform: rotate(", "deg);\n color: ", ";\n }\n\n ", " {\n ", ";\n }\n\n ", " {\n &:hover {\n ", ";\n }\n }\n"], ["\n background: none;\n border: none;\n cursor: pointer;\n outline: inherit;\n\n ", ";\n position: relative;\n cursor: pointer;\n margin-left: ", ";\n color: ", ";\n ", ";\n border-radius: ", ";\n\n padding: ", ";\n\n ", ";\n\n ", " {\n margin-left: ", ";\n transform: rotate(", "deg);\n color: ", ";\n }\n\n ", " {\n ", ";\n }\n\n ", " {\n &:hover {\n ", ";\n }\n }\n"])), foundation_1.flexCenterStyle, foundation_1.spacing(5), utils_2.textColor, foundation_1.typography('body2'), foundation_1.radius('sm'), foundation_1.spacing(1, 0, 1, 1), foundation_1.focusVisibleShadowStyle('
|
|
10
|
+
var StyledCurrentMonth = foundation_1.styled.button(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject(["\n background: none;\n border: none;\n cursor: pointer;\n outline: inherit;\n\n ", ";\n position: relative;\n cursor: pointer;\n margin-left: ", ";\n color: ", ";\n ", ";\n border-radius: ", ";\n\n padding: ", ";\n\n ", ";\n\n ", " {\n margin-left: ", ";\n transform: rotate(", "deg);\n color: ", ";\n }\n\n ", " {\n ", ";\n }\n\n ", " {\n &:hover {\n ", ";\n }\n }\n"], ["\n background: none;\n border: none;\n cursor: pointer;\n outline: inherit;\n\n ", ";\n position: relative;\n cursor: pointer;\n margin-left: ", ";\n color: ", ";\n ", ";\n border-radius: ", ";\n\n padding: ", ";\n\n ", ";\n\n ", " {\n margin-left: ", ";\n transform: rotate(", "deg);\n color: ", ";\n }\n\n ", " {\n ", ";\n }\n\n ", " {\n &:hover {\n ", ";\n }\n }\n"])), foundation_1.flexCenterStyle, foundation_1.spacing(5), utils_2.textColor, foundation_1.typography('body2'), foundation_1.radius('sm'), foundation_1.spacing(1, 0, 1, 1), foundation_1.focusVisibleShadowStyle('lg', undefined, undefined, 2), Icon_1.RcIcon, foundation_1.spacing(2), function (_a) {
|
|
11
11
|
var view = _a.view;
|
|
12
12
|
return (view === 'day' ? '0' : '180');
|
|
13
13
|
}, foundation_1.palette2('neutral', 'f04'), foundation_1.focusVisible, monthInactiveStyle, foundation_1.nonTouchHoverMedia, monthInactiveStyle);
|
|
@@ -3,10 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
var tslib_1 = require("tslib");
|
|
4
4
|
var foundation_1 = require("../../../../../foundation");
|
|
5
5
|
var utils_1 = require("../../../../Buttons/IconButton/utils");
|
|
6
|
+
var styles_1 = require("../../styles");
|
|
6
7
|
var utils_2 = require("../utils");
|
|
7
8
|
var CurrentDayStyle = foundation_1.css(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n border: 1px solid ", ";\n"], ["\n border: 1px solid ", ";\n"])), foundation_1.palette2('neutral', 'b04'));
|
|
8
9
|
exports.DayStyle = function (_a) {
|
|
9
10
|
var current = _a.current, size = _a.size, hidden = _a.hidden, selected = _a.selected;
|
|
10
|
-
|
|
11
|
+
var sizeValue = utils_2.RcDatePickerIconWidths[size];
|
|
12
|
+
return foundation_1.css(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject(["\n &.", " {\n width: ", ";\n height: ", ";\n margin: 0 2px;\n visibility: ", ";\n ", ";\n ", ";\n\n ", "\n }\n "], ["\n &.", " {\n width: ", ";\n height: ", ";\n margin: 0 2px;\n visibility: ", ";\n ", ";\n ", ";\n\n ", "\n }\n "])), utils_1.RcIconButtonClasses.root, sizeValue, sizeValue, hidden && 'hidden', foundation_1.typography('caption1'), current && !selected && CurrentDayStyle, styles_1.datePickerCustomFocusRingStyle);
|
|
11
13
|
};
|
|
12
14
|
var templateObject_1, templateObject_2;
|
|
@@ -4,5 +4,5 @@ var tslib_1 = require("tslib");
|
|
|
4
4
|
var foundation_1 = require("../../../../../foundation");
|
|
5
5
|
var utils_1 = require("../../../../Buttons/IconButton/utils");
|
|
6
6
|
var styles_1 = require("../../styles");
|
|
7
|
-
exports.StyledYear = foundation_1.styled(styles_1.PickerBaseIconButton)(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n &.", " {\n width: 56px;\n min-width: 56px;\n height: 28px;\n margin: 4px 0;\n ", ";\n }\n"], ["\n &.", " {\n width: 56px;\n min-width: 56px;\n height: 28px;\n margin: 4px 0;\n ", ";\n }\n"])), utils_1.RcIconButtonClasses.root, foundation_1.typography('body1'));
|
|
7
|
+
exports.StyledYear = foundation_1.styled(styles_1.PickerBaseIconButton)(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n &.", " {\n width: 56px;\n min-width: 56px;\n height: 28px;\n margin: 4px 0;\n ", ";\n ", ";\n }\n"], ["\n &.", " {\n width: 56px;\n min-width: 56px;\n height: 28px;\n margin: 4px 0;\n ", ";\n ", ";\n }\n"])), utils_1.RcIconButtonClasses.root, foundation_1.typography('body1'), styles_1.datePickerCustomFocusRingStyle);
|
|
8
8
|
var templateObject_1;
|
|
@@ -5,6 +5,6 @@ var react_1 = tslib_1.__importStar(require("react"));
|
|
|
5
5
|
var IconButton_1 = require("../../../Buttons/IconButton");
|
|
6
6
|
exports.PickerBaseIconButton = react_1.forwardRef(function (props, ref) {
|
|
7
7
|
var children = props.children, selected = props.selected, hidden = props.hidden, rest = tslib_1.__rest(props, ["children", "selected", "hidden"]);
|
|
8
|
-
return (react_1.default.createElement(IconButton_1.RcIconButton, tslib_1.__assign({ elevation: 0, activeElevation: 0, ref: ref, variant: selected ? 'contained' : 'round', color: selected ? 'interactive.b02' : 'neutral.f06', "data-hidden": hidden, size: "xsmall" }, rest), children));
|
|
8
|
+
return (react_1.default.createElement(IconButton_1.RcIconButton, tslib_1.__assign({ elevation: 0, activeElevation: 0, ref: ref, variant: selected ? 'contained' : 'round', color: selected ? 'interactive.b02' : 'neutral.f06', "data-hidden": hidden, size: "xsmall", focusVariant: "focusRing" }, rest), children));
|
|
9
9
|
});
|
|
10
10
|
exports.PickerBaseIconButton.displayName = 'PickerBaseIconButton';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { RcThemedStyled, UnitMap } from '../../../../foundation';
|
|
2
|
+
import { RcDatePickerSize } from '../DatePicker';
|
|
3
|
+
import { PickerBaseIconButtonProps } from './PickerBaseIconButton';
|
|
4
|
+
export declare const RcPickerFocusInsetBorderSizes: UnitMap<RcDatePickerSize, number>;
|
|
5
|
+
export declare const datePickerCustomFocusRingStyle: RcThemedStyled<PickerBaseIconButtonProps, any>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
4
|
+
var foundation_1 = require("../../../../foundation");
|
|
5
|
+
exports.RcPickerFocusInsetBorderSizes = {
|
|
6
|
+
small: 1,
|
|
7
|
+
medium: 2,
|
|
8
|
+
};
|
|
9
|
+
exports.datePickerCustomFocusRingStyle = function (_a) {
|
|
10
|
+
var size = _a.size, selected = _a.selected, _b = _a.radius, radius = _b === void 0 ? 'circle' : _b;
|
|
11
|
+
var focusInsetBorderSizes = exports.RcPickerFocusInsetBorderSizes[size];
|
|
12
|
+
return (selected && foundation_1.css(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", " {\n ", "\n &:after {\n top: ", "px;\n right: ", "px;\n bottom: ", "px;\n left: ", "px;\n }\n &:before {\n background-color: unset !important;\n }\n }\n "], ["\n ", " {\n ",
|
|
13
|
+
"\n &:after {\n top: ", "px;\n right: ", "px;\n bottom: ", "px;\n left: ", "px;\n }\n &:before {\n background-color: unset !important;\n }\n }\n "])), foundation_1.focusVisible, foundation_1.shadowBorder(radius, foundation_1.palette2('neutral', 'b01'), true, focusInsetBorderSizes), focusInsetBorderSizes, focusInsetBorderSizes, focusInsetBorderSizes, focusInsetBorderSizes));
|
|
14
|
+
};
|
|
15
|
+
var templateObject_1;
|
|
@@ -4,3 +4,4 @@ var tslib_1 = require("tslib");
|
|
|
4
4
|
tslib_1.__exportStar(require("./PickerBaseIconButton"), exports);
|
|
5
5
|
tslib_1.__exportStar(require("./StyledPickerTextField"), exports);
|
|
6
6
|
tslib_1.__exportStar(require("./StyledPopover"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./datePickerCustomFocusRingStyle"), exports);
|
|
@@ -34,8 +34,8 @@ var DatePickerHeader = memo(function (props) {
|
|
|
34
34
|
monthLabel,
|
|
35
35
|
React.createElement(SelectArrowDownIcon, null)),
|
|
36
36
|
React.createElement(SwitchHeaderButtonWrapper, { size: size, gap: 3, view: view },
|
|
37
|
-
React.createElement(SwitchHeaderButton, { color: "neutral.f04", size: "small", disabled: disablePrevMonth, onClick: selectPreviousMonth, symbol: arrowLeftSvg, "aria-label": previousMonthAriaLabel, "data-picker-action": true, "data-test-automation-id": "date-picker-pre-month", className: classes.leftArrow }),
|
|
38
|
-
React.createElement(SwitchHeaderButton, { color: "neutral.f04", size: "small", disabled: disableNextMonth, onClick: selectNextMonth, symbol: arrowRightSvg, "aria-label": nextMonthAriaLabel, "data-picker-action": true, "data-test-automation-id": "date-picker-next-month", className: classes.rightArrow })))));
|
|
37
|
+
React.createElement(SwitchHeaderButton, { color: "neutral.f04", size: "small", disabled: disablePrevMonth, onClick: selectPreviousMonth, symbol: arrowLeftSvg, "aria-label": previousMonthAriaLabel, "data-picker-action": true, "data-test-automation-id": "date-picker-pre-month", className: classes.leftArrow, focusVariant: "focusRing" }),
|
|
38
|
+
React.createElement(SwitchHeaderButton, { color: "neutral.f04", size: "small", disabled: disableNextMonth, onClick: selectNextMonth, symbol: arrowRightSvg, "aria-label": nextMonthAriaLabel, "data-picker-action": true, "data-test-automation-id": "date-picker-next-month", className: classes.rightArrow, focusVariant: "focusRing" })))));
|
|
39
39
|
});
|
|
40
40
|
DatePickerHeader.defaultProps = {
|
|
41
41
|
disablePrevMonth: false,
|
|
@@ -14,7 +14,7 @@ var Year = memo(forwardRef(function (props, ref) {
|
|
|
14
14
|
});
|
|
15
15
|
var yearAriaLabel = getYearAriaLabel === null || getYearAriaLabel === void 0 ? void 0 : getYearAriaLabel("" + value, selected);
|
|
16
16
|
var handleClick = !disabled ? _handleClick : undefined;
|
|
17
|
-
return (React.createElement(StyledYear, __assign({ radius: "round", onClick: handleClick, onKeyPress: handleClick, ref: ref, selected: selected, "aria-pressed": focused, "aria-label": yearAriaLabel, className: className, "data-test-automation-class": "date-picker-year", "data-test-automation-value": children }, rest),
|
|
17
|
+
return (React.createElement(StyledYear, __assign({ radius: "round", onClick: handleClick, onKeyPress: handleClick, ref: ref, selected: selected, "aria-pressed": focused, size: "medium", "aria-label": yearAriaLabel, className: className, "data-test-automation-class": "date-picker-year", "data-test-automation-value": children }, rest),
|
|
18
18
|
React.createElement(React.Fragment, null,
|
|
19
19
|
// TODO: that <></> will fix when `RcIconButton` ready
|
|
20
20
|
children)));
|
|
@@ -5,7 +5,7 @@ import { RcIconButtonClasses } from '../../../../Buttons/IconButton/utils';
|
|
|
5
5
|
import { RcIcon } from '../../../../Icon';
|
|
6
6
|
import { textColor } from '../utils';
|
|
7
7
|
var monthInactiveStyle = css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n &,\n ", " {\n color: ", ";\n }\n"], ["\n &,\n ", " {\n color: ", ";\n }\n"])), RcIcon, focusVisibleColor);
|
|
8
|
-
var StyledCurrentMonth = styled.button(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background: none;\n border: none;\n cursor: pointer;\n outline: inherit;\n\n ", ";\n position: relative;\n cursor: pointer;\n margin-left: ", ";\n color: ", ";\n ", ";\n border-radius: ", ";\n\n padding: ", ";\n\n ", ";\n\n ", " {\n margin-left: ", ";\n transform: rotate(", "deg);\n color: ", ";\n }\n\n ", " {\n ", ";\n }\n\n ", " {\n &:hover {\n ", ";\n }\n }\n"], ["\n background: none;\n border: none;\n cursor: pointer;\n outline: inherit;\n\n ", ";\n position: relative;\n cursor: pointer;\n margin-left: ", ";\n color: ", ";\n ", ";\n border-radius: ", ";\n\n padding: ", ";\n\n ", ";\n\n ", " {\n margin-left: ", ";\n transform: rotate(", "deg);\n color: ", ";\n }\n\n ", " {\n ", ";\n }\n\n ", " {\n &:hover {\n ", ";\n }\n }\n"])), flexCenterStyle, spacing(5), textColor, typography('body2'), radius('sm'), spacing(1, 0, 1, 1), focusVisibleShadowStyle('
|
|
8
|
+
var StyledCurrentMonth = styled.button(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background: none;\n border: none;\n cursor: pointer;\n outline: inherit;\n\n ", ";\n position: relative;\n cursor: pointer;\n margin-left: ", ";\n color: ", ";\n ", ";\n border-radius: ", ";\n\n padding: ", ";\n\n ", ";\n\n ", " {\n margin-left: ", ";\n transform: rotate(", "deg);\n color: ", ";\n }\n\n ", " {\n ", ";\n }\n\n ", " {\n &:hover {\n ", ";\n }\n }\n"], ["\n background: none;\n border: none;\n cursor: pointer;\n outline: inherit;\n\n ", ";\n position: relative;\n cursor: pointer;\n margin-left: ", ";\n color: ", ";\n ", ";\n border-radius: ", ";\n\n padding: ", ";\n\n ", ";\n\n ", " {\n margin-left: ", ";\n transform: rotate(", "deg);\n color: ", ";\n }\n\n ", " {\n ", ";\n }\n\n ", " {\n &:hover {\n ", ";\n }\n }\n"])), flexCenterStyle, spacing(5), textColor, typography('body2'), radius('sm'), spacing(1, 0, 1, 1), focusVisibleShadowStyle('lg', undefined, undefined, 2), RcIcon, spacing(2), function (_a) {
|
|
9
9
|
var view = _a.view;
|
|
10
10
|
return (view === 'day' ? '0' : '180');
|
|
11
11
|
}, palette2('neutral', 'f04'), focusVisible, monthInactiveStyle, nonTouchHoverMedia, monthInactiveStyle);
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { __makeTemplateObject } from "tslib";
|
|
2
2
|
import { css, palette2, typography, } from '../../../../../foundation';
|
|
3
3
|
import { RcIconButtonClasses } from '../../../../Buttons/IconButton/utils';
|
|
4
|
+
import { datePickerCustomFocusRingStyle } from '../../styles';
|
|
4
5
|
import { RcDatePickerIconWidths } from '../utils';
|
|
5
6
|
var CurrentDayStyle = css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border: 1px solid ", ";\n"], ["\n border: 1px solid ", ";\n"])), palette2('neutral', 'b04'));
|
|
6
7
|
export var DayStyle = function (_a) {
|
|
7
8
|
var current = _a.current, size = _a.size, hidden = _a.hidden, selected = _a.selected;
|
|
8
|
-
|
|
9
|
+
var sizeValue = RcDatePickerIconWidths[size];
|
|
10
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n &.", " {\n width: ", ";\n height: ", ";\n margin: 0 2px;\n visibility: ", ";\n ", ";\n ", ";\n\n ", "\n }\n "], ["\n &.", " {\n width: ", ";\n height: ", ";\n margin: 0 2px;\n visibility: ", ";\n ", ";\n ", ";\n\n ", "\n }\n "])), RcIconButtonClasses.root, sizeValue, sizeValue, hidden && 'hidden', typography('caption1'), current && !selected && CurrentDayStyle, datePickerCustomFocusRingStyle);
|
|
9
11
|
};
|
|
10
12
|
var templateObject_1, templateObject_2;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __makeTemplateObject } from "tslib";
|
|
2
2
|
import { styled, typography } from '../../../../../foundation';
|
|
3
3
|
import { RcIconButtonClasses } from '../../../../Buttons/IconButton/utils';
|
|
4
|
-
import { PickerBaseIconButton } from '../../styles';
|
|
5
|
-
export var StyledYear = styled(PickerBaseIconButton)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n &.", " {\n width: 56px;\n min-width: 56px;\n height: 28px;\n margin: 4px 0;\n ", ";\n }\n"], ["\n &.", " {\n width: 56px;\n min-width: 56px;\n height: 28px;\n margin: 4px 0;\n ", ";\n }\n"])), RcIconButtonClasses.root, typography('body1'));
|
|
4
|
+
import { datePickerCustomFocusRingStyle, PickerBaseIconButton, } from '../../styles';
|
|
5
|
+
export var StyledYear = styled(PickerBaseIconButton)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n &.", " {\n width: 56px;\n min-width: 56px;\n height: 28px;\n margin: 4px 0;\n ", ";\n ", ";\n }\n"], ["\n &.", " {\n width: 56px;\n min-width: 56px;\n height: 28px;\n margin: 4px 0;\n ", ";\n ", ";\n }\n"])), RcIconButtonClasses.root, typography('body1'), datePickerCustomFocusRingStyle);
|
|
6
6
|
var templateObject_1;
|
|
@@ -3,6 +3,6 @@ import React, { forwardRef } from 'react';
|
|
|
3
3
|
import { RcIconButton } from '../../../Buttons/IconButton';
|
|
4
4
|
export var PickerBaseIconButton = forwardRef(function (props, ref) {
|
|
5
5
|
var children = props.children, selected = props.selected, hidden = props.hidden, rest = __rest(props, ["children", "selected", "hidden"]);
|
|
6
|
-
return (React.createElement(RcIconButton, __assign({ elevation: 0, activeElevation: 0, ref: ref, variant: selected ? 'contained' : 'round', color: selected ? 'interactive.b02' : 'neutral.f06', "data-hidden": hidden, size: "xsmall" }, rest), children));
|
|
6
|
+
return (React.createElement(RcIconButton, __assign({ elevation: 0, activeElevation: 0, ref: ref, variant: selected ? 'contained' : 'round', color: selected ? 'interactive.b02' : 'neutral.f06', "data-hidden": hidden, size: "xsmall", focusVariant: "focusRing" }, rest), children));
|
|
7
7
|
});
|
|
8
8
|
PickerBaseIconButton.displayName = 'PickerBaseIconButton';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { __makeTemplateObject } from "tslib";
|
|
2
|
+
import { css, focusVisible, palette2, shadowBorder, } from '../../../../foundation';
|
|
3
|
+
export var RcPickerFocusInsetBorderSizes = {
|
|
4
|
+
small: 1,
|
|
5
|
+
medium: 2,
|
|
6
|
+
};
|
|
7
|
+
export var datePickerCustomFocusRingStyle = function (_a) {
|
|
8
|
+
var size = _a.size, selected = _a.selected, _b = _a.radius, radius = _b === void 0 ? 'circle' : _b;
|
|
9
|
+
var focusInsetBorderSizes = RcPickerFocusInsetBorderSizes[size];
|
|
10
|
+
return (selected && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", " {\n ", "\n &:after {\n top: ", "px;\n right: ", "px;\n bottom: ", "px;\n left: ", "px;\n }\n &:before {\n background-color: unset !important;\n }\n }\n "], ["\n ", " {\n ",
|
|
11
|
+
"\n &:after {\n top: ", "px;\n right: ", "px;\n bottom: ", "px;\n left: ", "px;\n }\n &:before {\n background-color: unset !important;\n }\n }\n "])), focusVisible, shadowBorder(radius, palette2('neutral', 'b01'), true, focusInsetBorderSizes), focusInsetBorderSizes, focusInsetBorderSizes, focusInsetBorderSizes, focusInsetBorderSizes));
|
|
12
|
+
};
|
|
13
|
+
var templateObject_1;
|
|
@@ -12,5 +12,9 @@ export var shadowBorder = function (r, color, inset, size) {
|
|
|
12
12
|
if (size === void 0) { size = 1; }
|
|
13
13
|
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n &:after {\n content: '';\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n box-shadow: ", " 0 0 0 ", "px ", ";\n border-radius: ", ";\n pointer-events: none;\n }\n"], ["\n &:after {\n content: '';\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n box-shadow: ", " 0 0 0 ", "px ", ";\n border-radius: ", ";\n pointer-events: none;\n }\n"])), inset ? 'inset' : '', size, color, radius(r));
|
|
14
14
|
};
|
|
15
|
-
export var focusVisibleShadowStyle = function (r, color
|
|
15
|
+
export var focusVisibleShadowStyle = function (r, color, inset, size) {
|
|
16
|
+
if (inset === void 0) { inset = true; }
|
|
17
|
+
if (size === void 0) { size = 1; }
|
|
18
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", " {\n ", ";\n }\n"], ["\n ", " {\n ", ";\n }\n"])), focusVisible, shadowBorder(r, color, inset, size));
|
|
19
|
+
};
|
|
16
20
|
var templateObject_1, templateObject_2;
|
|
@@ -2,4 +2,4 @@ export declare const focusVisible = "&.focus-visible, &[data-focus-visible-added
|
|
|
2
2
|
export declare const focusWithin = "&:hover, &:focus-within";
|
|
3
3
|
export declare const focusVisibleColor: import("./newPalette").PaletteReturnType;
|
|
4
4
|
export declare const shadowBorder: (r?: "round" | "circle" | "sm" | "md" | "lg" | "xl" | "xxl" | "zero", color?: any, inset?: boolean, size?: number) => import("styled-components").FlattenInterpolation<any>[];
|
|
5
|
-
export declare const focusVisibleShadowStyle: (r?: "round" | "circle" | "sm" | "md" | "lg" | "xl" | "xxl" | "zero" | undefined, color?: any) => import("styled-components").FlattenInterpolation<any>[];
|
|
5
|
+
export declare const focusVisibleShadowStyle: (r?: "round" | "circle" | "sm" | "md" | "lg" | "xl" | "xxl" | "zero" | undefined, color?: any, inset?: boolean, size?: number) => import("styled-components").FlattenInterpolation<any>[];
|
|
@@ -14,5 +14,9 @@ exports.shadowBorder = function (r, color, inset, size) {
|
|
|
14
14
|
if (size === void 0) { size = 1; }
|
|
15
15
|
return styled_components_1.css(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n &:after {\n content: '';\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n box-shadow: ", " 0 0 0 ", "px ", ";\n border-radius: ", ";\n pointer-events: none;\n }\n"], ["\n &:after {\n content: '';\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n box-shadow: ", " 0 0 0 ", "px ", ";\n border-radius: ", ";\n pointer-events: none;\n }\n"])), inset ? 'inset' : '', size, color, radius_1.radius(r));
|
|
16
16
|
};
|
|
17
|
-
exports.focusVisibleShadowStyle = function (r, color
|
|
17
|
+
exports.focusVisibleShadowStyle = function (r, color, inset, size) {
|
|
18
|
+
if (inset === void 0) { inset = true; }
|
|
19
|
+
if (size === void 0) { size = 1; }
|
|
20
|
+
return styled_components_1.css(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject(["\n ", " {\n ", ";\n }\n"], ["\n ", " {\n ", ";\n }\n"])), exports.focusVisible, exports.shadowBorder(r, color, inset, size));
|
|
21
|
+
};
|
|
18
22
|
var templateObject_1, templateObject_2;
|