carbon-react 152.4.0 → 152.5.1
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/esm/components/link/link.component.js +8 -1
- package/esm/components/menu/menu-item/menu-item.component.js +13 -7
- package/esm/components/vertical-menu/vertical-menu-full-screen/vertical-menu-full-screen.component.d.ts +1 -1
- package/esm/components/vertical-menu/vertical-menu-full-screen/vertical-menu-full-screen.component.js +5 -6
- package/esm/components/vertical-menu/vertical-menu.style.d.ts +5 -1
- package/esm/components/vertical-menu/vertical-menu.style.js +20 -1
- package/lib/components/link/link.component.js +8 -1
- package/lib/components/menu/menu-item/menu-item.component.js +12 -6
- package/lib/components/vertical-menu/vertical-menu-full-screen/vertical-menu-full-screen.component.d.ts +1 -1
- package/lib/components/vertical-menu/vertical-menu-full-screen/vertical-menu-full-screen.component.js +5 -6
- package/lib/components/vertical-menu/vertical-menu.style.d.ts +5 -1
- package/lib/components/vertical-menu/vertical-menu.style.js +20 -1
- package/package.json +1 -1
|
@@ -36,6 +36,13 @@ export const Link = /*#__PURE__*/React.forwardRef(({
|
|
|
36
36
|
batchSelectionDisabled
|
|
37
37
|
} = useContext(BatchSelectionContext);
|
|
38
38
|
const isDisabled = disabled || batchSelectionDisabled;
|
|
39
|
+
const setRefs = React.useCallback(reference => {
|
|
40
|
+
if (!ref) return;
|
|
41
|
+
if (typeof ref === "object") ref.current = reference;
|
|
42
|
+
if (typeof ref === "function") {
|
|
43
|
+
ref(reference);
|
|
44
|
+
}
|
|
45
|
+
}, [ref]);
|
|
39
46
|
const renderLinkIcon = (currentAlignment = "left") => {
|
|
40
47
|
const hasProperAlignment = icon && iconAlign === currentAlignment;
|
|
41
48
|
return hasProperAlignment ? /*#__PURE__*/React.createElement(Icon, {
|
|
@@ -59,7 +66,7 @@ export const Link = /*#__PURE__*/React.forwardRef(({
|
|
|
59
66
|
onClick,
|
|
60
67
|
disabled: isDisabled,
|
|
61
68
|
target,
|
|
62
|
-
ref,
|
|
69
|
+
ref: setRefs,
|
|
63
70
|
href,
|
|
64
71
|
rel,
|
|
65
72
|
"aria-label": ariaLabel,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
-
import React, { useRef, useEffect, useContext } from "react";
|
|
2
|
+
import React, { useRef, useEffect, useContext, useState, useLayoutEffect } from "react";
|
|
3
3
|
import invariant from "invariant";
|
|
4
4
|
import { defaultFocusableSelectors as focusableSelectors } from "../../../__internal__/focus-trap/focus-trap-utils";
|
|
5
5
|
import { filterStyledSystemPaddingProps } from "../../../style/utils";
|
|
@@ -63,8 +63,14 @@ export const MenuItem = ({
|
|
|
63
63
|
} = submenuContext;
|
|
64
64
|
const focusFromMenu = focusId === menuItemId.current;
|
|
65
65
|
const focusFromSubmenu = submenuFocusId ? submenuFocusId === menuItemId.current : undefined;
|
|
66
|
-
const ref =
|
|
67
|
-
const firstFocusableChild =
|
|
66
|
+
const [ref, setRef] = useState(null);
|
|
67
|
+
const [firstFocusableChild, setFirstFocusableChild] = useState(null);
|
|
68
|
+
useLayoutEffect(() => {
|
|
69
|
+
const firstFocusable = ref?.querySelector(focusableSelectors) ?? null;
|
|
70
|
+
if (firstFocusable !== firstFocusableChild) {
|
|
71
|
+
setFirstFocusableChild(firstFocusable);
|
|
72
|
+
}
|
|
73
|
+
}, [ref]);
|
|
68
74
|
useEffect(() => {
|
|
69
75
|
const id = menuItemId.current;
|
|
70
76
|
|
|
@@ -85,7 +91,7 @@ export const MenuItem = ({
|
|
|
85
91
|
firstFocusableChild.focus();
|
|
86
92
|
return;
|
|
87
93
|
}
|
|
88
|
-
ref
|
|
94
|
+
ref?.focus();
|
|
89
95
|
}
|
|
90
96
|
}, [firstFocusableChild, focusFromMenu, focusFromSubmenu]);
|
|
91
97
|
const handleFocus = event => {
|
|
@@ -99,7 +105,7 @@ export const MenuItem = ({
|
|
|
99
105
|
const handleKeyDown = event => {
|
|
100
106
|
onKeyDown?.(event);
|
|
101
107
|
if (Events.isEscKey(event)) {
|
|
102
|
-
ref
|
|
108
|
+
ref?.focus();
|
|
103
109
|
}
|
|
104
110
|
handleSubmenuKeyDown?.(event);
|
|
105
111
|
};
|
|
@@ -114,7 +120,7 @@ export const MenuItem = ({
|
|
|
114
120
|
selected,
|
|
115
121
|
onKeyDown: !inFullscreenView ? handleKeyDown : undefined,
|
|
116
122
|
overrideColor,
|
|
117
|
-
ref
|
|
123
|
+
ref: setRef
|
|
118
124
|
};
|
|
119
125
|
if (overriddenVariant === "alternate" && isChildOfSegment && variant === "alternate" && ["white", "black"].includes(menuType)) {
|
|
120
126
|
elementProps.overrideColor = true;
|
|
@@ -153,7 +159,7 @@ export const MenuItem = ({
|
|
|
153
159
|
}, rest), children));
|
|
154
160
|
}
|
|
155
161
|
const paddingProps = filterStyledSystemPaddingProps(rest);
|
|
156
|
-
const hasInput = !!ref
|
|
162
|
+
const hasInput = !!ref?.querySelector("[data-element='input']");
|
|
157
163
|
return /*#__PURE__*/React.createElement(StyledMenuItem, _extends({
|
|
158
164
|
"data-component": "menu-item",
|
|
159
165
|
"data-element": dataElement,
|
|
@@ -12,5 +12,5 @@ export interface VerticalMenuFullScreenProps extends TagProps {
|
|
|
12
12
|
/** A callback to be called when the close icon is clicked or enter is pressed when focused */
|
|
13
13
|
onClose: (ev: React.KeyboardEvent<HTMLButtonElement> | React.MouseEvent<HTMLButtonElement> | KeyboardEvent) => void;
|
|
14
14
|
}
|
|
15
|
-
export declare const VerticalMenuFullScreen: ({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, children, isOpen, onClose, ...rest }: VerticalMenuFullScreenProps) => React.JSX.Element
|
|
15
|
+
export declare const VerticalMenuFullScreen: ({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, children, isOpen, onClose, ...rest }: VerticalMenuFullScreenProps) => React.JSX.Element;
|
|
16
16
|
export default VerticalMenuFullScreen;
|
|
@@ -12,6 +12,7 @@ import VerticalMenuFullScreenContext from "./__internal__/vertical-menu-full-scr
|
|
|
12
12
|
import { getDocument } from "../../../__internal__/dom/globals";
|
|
13
13
|
import Events from "../../../__internal__/utils/helpers/events/events";
|
|
14
14
|
import useModalManager from "../../../hooks/__internal__/useModalManager";
|
|
15
|
+
import useMediaQuery from "../../../hooks/useMediaQuery";
|
|
15
16
|
export const VerticalMenuFullScreen = ({
|
|
16
17
|
"aria-label": ariaLabel,
|
|
17
18
|
"aria-labelledby": ariaLabelledBy,
|
|
@@ -22,6 +23,7 @@ export const VerticalMenuFullScreen = ({
|
|
|
22
23
|
}) => {
|
|
23
24
|
const l = useLocale();
|
|
24
25
|
const menuWrapperRef = useRef(null);
|
|
26
|
+
const reduceMotion = !useMediaQuery("screen and (prefers-reduced-motion: no-preference)");
|
|
25
27
|
const handleKeyDown = useCallback(ev => {
|
|
26
28
|
// istanbul ignore else
|
|
27
29
|
if (Events.isEscKey(ev)) {
|
|
@@ -36,14 +38,13 @@ export const VerticalMenuFullScreen = ({
|
|
|
36
38
|
topModalOverride: true,
|
|
37
39
|
focusCallToActionElement: safeDocument?.activeElement
|
|
38
40
|
});
|
|
39
|
-
|
|
40
|
-
// TODO remove this as part of FE-5650
|
|
41
|
-
if (!isOpen) return null;
|
|
42
41
|
return /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement(FocusTrap, {
|
|
43
42
|
isOpen: isOpen,
|
|
44
43
|
wrapperRef: menuWrapperRef
|
|
45
44
|
}, /*#__PURE__*/React.createElement(StyledVerticalMenuFullScreen, _extends({
|
|
46
45
|
ref: menuWrapperRef,
|
|
46
|
+
isOpen: isOpen,
|
|
47
|
+
prefersReducedMotion: reduceMotion,
|
|
47
48
|
scrollVariant: "light",
|
|
48
49
|
as: "nav",
|
|
49
50
|
"aria-label": ariaLabel,
|
|
@@ -62,9 +63,7 @@ export const VerticalMenuFullScreen = ({
|
|
|
62
63
|
"data-element": "close"
|
|
63
64
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
64
65
|
type: "close",
|
|
65
|
-
color: "var(--colorsComponentsLeftnavWinterStandardContent)"
|
|
66
|
-
bgSize: "small",
|
|
67
|
-
fontSize: "medium"
|
|
66
|
+
color: "var(--colorsComponentsLeftnavWinterStandardContent)"
|
|
68
67
|
}))), /*#__PURE__*/React.createElement(VerticalMenuFullScreenContext.Provider, {
|
|
69
68
|
value: {
|
|
70
69
|
isFullScreen: true
|
|
@@ -18,6 +18,10 @@ export declare const StyledVerticalMenu: import("styled-components").StyledCompo
|
|
|
18
18
|
width?: string | undefined;
|
|
19
19
|
} | undefined;
|
|
20
20
|
}, never>;
|
|
21
|
+
interface FullScreenProps {
|
|
22
|
+
isOpen: boolean;
|
|
23
|
+
prefersReducedMotion?: boolean;
|
|
24
|
+
}
|
|
21
25
|
export declare const StyledVerticalMenuFullScreen: import("styled-components").StyledComponent<"div", any, import("../box").BoxProps & {
|
|
22
26
|
cssProps?: {
|
|
23
27
|
color?: string | undefined;
|
|
@@ -25,5 +29,5 @@ export declare const StyledVerticalMenuFullScreen: import("styled-components").S
|
|
|
25
29
|
height?: string | undefined;
|
|
26
30
|
width?: string | undefined;
|
|
27
31
|
} | undefined;
|
|
28
|
-
}, never>;
|
|
32
|
+
} & FullScreenProps, never>;
|
|
29
33
|
export {};
|
|
@@ -114,11 +114,30 @@ export const StyledVerticalMenuFullScreen = styled(StyledBox)`
|
|
|
114
114
|
overflow: auto;
|
|
115
115
|
background-color: var(--colorsComponentsLeftnavWinterStandardBackground);
|
|
116
116
|
box-sizing: border-box;
|
|
117
|
-
transition: all 0.3s ease;
|
|
118
117
|
z-index: ${({
|
|
119
118
|
theme
|
|
120
119
|
}) => theme.zIndex.fullScreenModal};
|
|
121
120
|
|
|
121
|
+
${({
|
|
122
|
+
prefersReducedMotion
|
|
123
|
+
}) => !prefersReducedMotion && css`
|
|
124
|
+
transition: all 0.3s ease;
|
|
125
|
+
`}
|
|
126
|
+
|
|
127
|
+
${({
|
|
128
|
+
isOpen
|
|
129
|
+
}) => isOpen && css`
|
|
130
|
+
visibility: visible;
|
|
131
|
+
transform: translateX(0);
|
|
132
|
+
`}
|
|
133
|
+
|
|
134
|
+
${({
|
|
135
|
+
isOpen
|
|
136
|
+
}) => !isOpen && css`
|
|
137
|
+
transform: translateX(-100%);
|
|
138
|
+
visibility: hidden;
|
|
139
|
+
`}
|
|
140
|
+
|
|
122
141
|
// TODO remove hardcoded values when DS have had chance to review which token to use
|
|
123
142
|
&::-webkit-scrollbar-track {
|
|
124
143
|
background-color: #cccccc;
|
|
@@ -45,6 +45,13 @@ const Link = exports.Link = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
45
45
|
batchSelectionDisabled
|
|
46
46
|
} = (0, _react.useContext)(_batchSelection.default);
|
|
47
47
|
const isDisabled = disabled || batchSelectionDisabled;
|
|
48
|
+
const setRefs = _react.default.useCallback(reference => {
|
|
49
|
+
if (!ref) return;
|
|
50
|
+
if (typeof ref === "object") ref.current = reference;
|
|
51
|
+
if (typeof ref === "function") {
|
|
52
|
+
ref(reference);
|
|
53
|
+
}
|
|
54
|
+
}, [ref]);
|
|
48
55
|
const renderLinkIcon = (currentAlignment = "left") => {
|
|
49
56
|
const hasProperAlignment = icon && iconAlign === currentAlignment;
|
|
50
57
|
return hasProperAlignment ? /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
@@ -68,7 +75,7 @@ const Link = exports.Link = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
68
75
|
onClick,
|
|
69
76
|
disabled: isDisabled,
|
|
70
77
|
target,
|
|
71
|
-
ref,
|
|
78
|
+
ref: setRefs,
|
|
72
79
|
href,
|
|
73
80
|
rel,
|
|
74
81
|
"aria-label": ariaLabel,
|
|
@@ -72,8 +72,14 @@ const MenuItem = ({
|
|
|
72
72
|
} = submenuContext;
|
|
73
73
|
const focusFromMenu = focusId === menuItemId.current;
|
|
74
74
|
const focusFromSubmenu = submenuFocusId ? submenuFocusId === menuItemId.current : undefined;
|
|
75
|
-
const ref = (0, _react.
|
|
76
|
-
const firstFocusableChild =
|
|
75
|
+
const [ref, setRef] = (0, _react.useState)(null);
|
|
76
|
+
const [firstFocusableChild, setFirstFocusableChild] = (0, _react.useState)(null);
|
|
77
|
+
(0, _react.useLayoutEffect)(() => {
|
|
78
|
+
const firstFocusable = ref?.querySelector(_focusTrapUtils.defaultFocusableSelectors) ?? null;
|
|
79
|
+
if (firstFocusable !== firstFocusableChild) {
|
|
80
|
+
setFirstFocusableChild(firstFocusable);
|
|
81
|
+
}
|
|
82
|
+
}, [ref]);
|
|
77
83
|
(0, _react.useEffect)(() => {
|
|
78
84
|
const id = menuItemId.current;
|
|
79
85
|
|
|
@@ -94,7 +100,7 @@ const MenuItem = ({
|
|
|
94
100
|
firstFocusableChild.focus();
|
|
95
101
|
return;
|
|
96
102
|
}
|
|
97
|
-
ref
|
|
103
|
+
ref?.focus();
|
|
98
104
|
}
|
|
99
105
|
}, [firstFocusableChild, focusFromMenu, focusFromSubmenu]);
|
|
100
106
|
const handleFocus = event => {
|
|
@@ -108,7 +114,7 @@ const MenuItem = ({
|
|
|
108
114
|
const handleKeyDown = event => {
|
|
109
115
|
onKeyDown?.(event);
|
|
110
116
|
if (_events.default.isEscKey(event)) {
|
|
111
|
-
ref
|
|
117
|
+
ref?.focus();
|
|
112
118
|
}
|
|
113
119
|
handleSubmenuKeyDown?.(event);
|
|
114
120
|
};
|
|
@@ -123,7 +129,7 @@ const MenuItem = ({
|
|
|
123
129
|
selected,
|
|
124
130
|
onKeyDown: !inFullscreenView ? handleKeyDown : undefined,
|
|
125
131
|
overrideColor,
|
|
126
|
-
ref
|
|
132
|
+
ref: setRef
|
|
127
133
|
};
|
|
128
134
|
if (overriddenVariant === "alternate" && isChildOfSegment && variant === "alternate" && ["white", "black"].includes(menuType)) {
|
|
129
135
|
elementProps.overrideColor = true;
|
|
@@ -162,7 +168,7 @@ const MenuItem = ({
|
|
|
162
168
|
}, rest), children));
|
|
163
169
|
}
|
|
164
170
|
const paddingProps = (0, _utils.filterStyledSystemPaddingProps)(rest);
|
|
165
|
-
const hasInput = !!ref
|
|
171
|
+
const hasInput = !!ref?.querySelector("[data-element='input']");
|
|
166
172
|
return /*#__PURE__*/_react.default.createElement(_menu2.StyledMenuItem, _extends({
|
|
167
173
|
"data-component": "menu-item",
|
|
168
174
|
"data-element": dataElement,
|
|
@@ -12,5 +12,5 @@ export interface VerticalMenuFullScreenProps extends TagProps {
|
|
|
12
12
|
/** A callback to be called when the close icon is clicked or enter is pressed when focused */
|
|
13
13
|
onClose: (ev: React.KeyboardEvent<HTMLButtonElement> | React.MouseEvent<HTMLButtonElement> | KeyboardEvent) => void;
|
|
14
14
|
}
|
|
15
|
-
export declare const VerticalMenuFullScreen: ({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, children, isOpen, onClose, ...rest }: VerticalMenuFullScreenProps) => React.JSX.Element
|
|
15
|
+
export declare const VerticalMenuFullScreen: ({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, children, isOpen, onClose, ...rest }: VerticalMenuFullScreenProps) => React.JSX.Element;
|
|
16
16
|
export default VerticalMenuFullScreen;
|
|
@@ -17,6 +17,7 @@ var _verticalMenuFullScreen = _interopRequireDefault(require("./__internal__/ver
|
|
|
17
17
|
var _globals = require("../../../__internal__/dom/globals");
|
|
18
18
|
var _events = _interopRequireDefault(require("../../../__internal__/utils/helpers/events/events"));
|
|
19
19
|
var _useModalManager = _interopRequireDefault(require("../../../hooks/__internal__/useModalManager"));
|
|
20
|
+
var _useMediaQuery = _interopRequireDefault(require("../../../hooks/useMediaQuery"));
|
|
20
21
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
21
22
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
22
23
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -31,6 +32,7 @@ const VerticalMenuFullScreen = ({
|
|
|
31
32
|
}) => {
|
|
32
33
|
const l = (0, _useLocale.default)();
|
|
33
34
|
const menuWrapperRef = (0, _react.useRef)(null);
|
|
35
|
+
const reduceMotion = !(0, _useMediaQuery.default)("screen and (prefers-reduced-motion: no-preference)");
|
|
34
36
|
const handleKeyDown = (0, _react.useCallback)(ev => {
|
|
35
37
|
// istanbul ignore else
|
|
36
38
|
if (_events.default.isEscKey(ev)) {
|
|
@@ -45,14 +47,13 @@ const VerticalMenuFullScreen = ({
|
|
|
45
47
|
topModalOverride: true,
|
|
46
48
|
focusCallToActionElement: safeDocument?.activeElement
|
|
47
49
|
});
|
|
48
|
-
|
|
49
|
-
// TODO remove this as part of FE-5650
|
|
50
|
-
if (!isOpen) return null;
|
|
51
50
|
return /*#__PURE__*/_react.default.createElement(_portal.default, null, /*#__PURE__*/_react.default.createElement(_focusTrap.default, {
|
|
52
51
|
isOpen: isOpen,
|
|
53
52
|
wrapperRef: menuWrapperRef
|
|
54
53
|
}, /*#__PURE__*/_react.default.createElement(_verticalMenu.StyledVerticalMenuFullScreen, _extends({
|
|
55
54
|
ref: menuWrapperRef,
|
|
55
|
+
isOpen: isOpen,
|
|
56
|
+
prefersReducedMotion: reduceMotion,
|
|
56
57
|
scrollVariant: "light",
|
|
57
58
|
as: "nav",
|
|
58
59
|
"aria-label": ariaLabel,
|
|
@@ -71,9 +72,7 @@ const VerticalMenuFullScreen = ({
|
|
|
71
72
|
"data-element": "close"
|
|
72
73
|
}, /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
73
74
|
type: "close",
|
|
74
|
-
color: "var(--colorsComponentsLeftnavWinterStandardContent)"
|
|
75
|
-
bgSize: "small",
|
|
76
|
-
fontSize: "medium"
|
|
75
|
+
color: "var(--colorsComponentsLeftnavWinterStandardContent)"
|
|
77
76
|
}))), /*#__PURE__*/_react.default.createElement(_verticalMenuFullScreen.default.Provider, {
|
|
78
77
|
value: {
|
|
79
78
|
isFullScreen: true
|
|
@@ -18,6 +18,10 @@ export declare const StyledVerticalMenu: import("styled-components").StyledCompo
|
|
|
18
18
|
width?: string | undefined;
|
|
19
19
|
} | undefined;
|
|
20
20
|
}, never>;
|
|
21
|
+
interface FullScreenProps {
|
|
22
|
+
isOpen: boolean;
|
|
23
|
+
prefersReducedMotion?: boolean;
|
|
24
|
+
}
|
|
21
25
|
export declare const StyledVerticalMenuFullScreen: import("styled-components").StyledComponent<"div", any, import("../box").BoxProps & {
|
|
22
26
|
cssProps?: {
|
|
23
27
|
color?: string | undefined;
|
|
@@ -25,5 +29,5 @@ export declare const StyledVerticalMenuFullScreen: import("styled-components").S
|
|
|
25
29
|
height?: string | undefined;
|
|
26
30
|
width?: string | undefined;
|
|
27
31
|
} | undefined;
|
|
28
|
-
}, never>;
|
|
32
|
+
} & FullScreenProps, never>;
|
|
29
33
|
export {};
|
|
@@ -123,11 +123,30 @@ const StyledVerticalMenuFullScreen = exports.StyledVerticalMenuFullScreen = (0,
|
|
|
123
123
|
overflow: auto;
|
|
124
124
|
background-color: var(--colorsComponentsLeftnavWinterStandardBackground);
|
|
125
125
|
box-sizing: border-box;
|
|
126
|
-
transition: all 0.3s ease;
|
|
127
126
|
z-index: ${({
|
|
128
127
|
theme
|
|
129
128
|
}) => theme.zIndex.fullScreenModal};
|
|
130
129
|
|
|
130
|
+
${({
|
|
131
|
+
prefersReducedMotion
|
|
132
|
+
}) => !prefersReducedMotion && (0, _styledComponents.css)`
|
|
133
|
+
transition: all 0.3s ease;
|
|
134
|
+
`}
|
|
135
|
+
|
|
136
|
+
${({
|
|
137
|
+
isOpen
|
|
138
|
+
}) => isOpen && (0, _styledComponents.css)`
|
|
139
|
+
visibility: visible;
|
|
140
|
+
transform: translateX(0);
|
|
141
|
+
`}
|
|
142
|
+
|
|
143
|
+
${({
|
|
144
|
+
isOpen
|
|
145
|
+
}) => !isOpen && (0, _styledComponents.css)`
|
|
146
|
+
transform: translateX(-100%);
|
|
147
|
+
visibility: hidden;
|
|
148
|
+
`}
|
|
149
|
+
|
|
131
150
|
// TODO remove hardcoded values when DS have had chance to review which token to use
|
|
132
151
|
&::-webkit-scrollbar-track {
|
|
133
152
|
background-color: #cccccc;
|