carbon-react 114.5.1 → 114.6.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/i18n-provider/i18n-provider.component.js +5 -0
- package/esm/components/text-editor/text-editor.component.js +2 -1
- package/esm/components/text-editor/text-editor.d.ts +2 -2
- package/esm/components/vertical-menu/index.d.ts +8 -0
- package/esm/components/vertical-menu/index.js +4 -0
- package/esm/components/vertical-menu/vertical-menu-full-screen.component.d.ts +16 -0
- package/esm/components/vertical-menu/vertical-menu-full-screen.component.js +79 -0
- package/esm/components/vertical-menu/vertical-menu-full-screen.context.d.ts +5 -0
- package/esm/components/vertical-menu/vertical-menu-full-screen.context.js +5 -0
- package/esm/components/vertical-menu/vertical-menu-item.component.d.ts +25 -0
- package/esm/components/vertical-menu/vertical-menu-item.component.js +267 -0
- package/esm/components/vertical-menu/vertical-menu-trigger.component.d.ts +13 -0
- package/esm/components/vertical-menu/vertical-menu-trigger.component.js +189 -0
- package/esm/components/vertical-menu/vertical-menu.component.d.ts +16 -0
- package/esm/components/vertical-menu/vertical-menu.component.js +41 -0
- package/esm/components/vertical-menu/vertical-menu.style.d.ts +15 -0
- package/esm/components/vertical-menu/vertical-menu.style.js +127 -0
- package/esm/locales/en-gb.js +5 -0
- package/esm/locales/locale.d.ts +5 -0
- package/esm/locales/pl-pl.js +5 -0
- package/lib/components/i18n-provider/i18n-provider.component.js +5 -0
- package/lib/components/text-editor/text-editor.component.js +2 -1
- package/lib/components/text-editor/text-editor.d.ts +2 -2
- package/lib/components/vertical-menu/index.d.ts +8 -0
- package/lib/components/vertical-menu/index.js +39 -0
- package/lib/components/vertical-menu/package.json +6 -0
- package/lib/components/vertical-menu/vertical-menu-full-screen.component.d.ts +16 -0
- package/lib/components/vertical-menu/vertical-menu-full-screen.component.js +104 -0
- package/lib/components/vertical-menu/vertical-menu-full-screen.context.d.ts +5 -0
- package/lib/components/vertical-menu/vertical-menu-full-screen.context.js +17 -0
- package/lib/components/vertical-menu/vertical-menu-item.component.d.ts +25 -0
- package/lib/components/vertical-menu/vertical-menu-item.component.js +287 -0
- package/lib/components/vertical-menu/vertical-menu-trigger.component.d.ts +13 -0
- package/lib/components/vertical-menu/vertical-menu-trigger.component.js +203 -0
- package/lib/components/vertical-menu/vertical-menu.component.d.ts +16 -0
- package/lib/components/vertical-menu/vertical-menu.component.js +54 -0
- package/lib/components/vertical-menu/vertical-menu.style.d.ts +15 -0
- package/lib/components/vertical-menu/vertical-menu.style.js +153 -0
- package/lib/locales/en-gb.js +5 -0
- package/lib/locales/locale.d.ts +5 -0
- package/lib/locales/pl-pl.js +5 -0
- package/package.json +1 -1
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
import React from "react";
|
|
4
|
+
import PropTypes from "prop-types";
|
|
5
|
+
import tagComponent from "../../__internal__/utils/helpers/tags";
|
|
6
|
+
import { filterStyledSystemPaddingProps } from "../../style/utils";
|
|
7
|
+
import { StyledVerticalMenuItem, StyledTitle } from "./vertical-menu.style";
|
|
8
|
+
|
|
9
|
+
const VerticalMenuTrigger = ({
|
|
10
|
+
height = "40px",
|
|
11
|
+
p = 2,
|
|
12
|
+
onClick,
|
|
13
|
+
children,
|
|
14
|
+
...rest
|
|
15
|
+
}) => {
|
|
16
|
+
const paddingProps = filterStyledSystemPaddingProps(rest);
|
|
17
|
+
return /*#__PURE__*/React.createElement(StyledVerticalMenuItem, _extends({
|
|
18
|
+
onClick: onClick,
|
|
19
|
+
as: "button",
|
|
20
|
+
height: height,
|
|
21
|
+
p: p,
|
|
22
|
+
tabIndex: 0
|
|
23
|
+
}, paddingProps, tagComponent("vertical-menu-trigger", rest)), /*#__PURE__*/React.createElement(StyledTitle, null, children));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
VerticalMenuTrigger.propTypes = {
|
|
27
|
+
"children": PropTypes.string.isRequired,
|
|
28
|
+
"data-component": PropTypes.string,
|
|
29
|
+
"data-element": PropTypes.string,
|
|
30
|
+
"data-role": PropTypes.string,
|
|
31
|
+
"height": PropTypes.string,
|
|
32
|
+
"onClick": PropTypes.func.isRequired,
|
|
33
|
+
"p": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
34
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
35
|
+
"description": PropTypes.string,
|
|
36
|
+
"toString": PropTypes.func.isRequired,
|
|
37
|
+
"valueOf": PropTypes.func.isRequired
|
|
38
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
39
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
40
|
+
"description": PropTypes.string,
|
|
41
|
+
"toString": PropTypes.func.isRequired,
|
|
42
|
+
"valueOf": PropTypes.func.isRequired
|
|
43
|
+
}), PropTypes.string]),
|
|
44
|
+
"padding": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
45
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
46
|
+
"description": PropTypes.string,
|
|
47
|
+
"toString": PropTypes.func.isRequired,
|
|
48
|
+
"valueOf": PropTypes.func.isRequired
|
|
49
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
50
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
51
|
+
"description": PropTypes.string,
|
|
52
|
+
"toString": PropTypes.func.isRequired,
|
|
53
|
+
"valueOf": PropTypes.func.isRequired
|
|
54
|
+
}), PropTypes.string]),
|
|
55
|
+
"paddingBottom": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
56
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
57
|
+
"description": PropTypes.string,
|
|
58
|
+
"toString": PropTypes.func.isRequired,
|
|
59
|
+
"valueOf": PropTypes.func.isRequired
|
|
60
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
61
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
62
|
+
"description": PropTypes.string,
|
|
63
|
+
"toString": PropTypes.func.isRequired,
|
|
64
|
+
"valueOf": PropTypes.func.isRequired
|
|
65
|
+
}), PropTypes.string]),
|
|
66
|
+
"paddingLeft": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
67
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
68
|
+
"description": PropTypes.string,
|
|
69
|
+
"toString": PropTypes.func.isRequired,
|
|
70
|
+
"valueOf": PropTypes.func.isRequired
|
|
71
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
72
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
73
|
+
"description": PropTypes.string,
|
|
74
|
+
"toString": PropTypes.func.isRequired,
|
|
75
|
+
"valueOf": PropTypes.func.isRequired
|
|
76
|
+
}), PropTypes.string]),
|
|
77
|
+
"paddingRight": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
78
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
79
|
+
"description": PropTypes.string,
|
|
80
|
+
"toString": PropTypes.func.isRequired,
|
|
81
|
+
"valueOf": PropTypes.func.isRequired
|
|
82
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
83
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
84
|
+
"description": PropTypes.string,
|
|
85
|
+
"toString": PropTypes.func.isRequired,
|
|
86
|
+
"valueOf": PropTypes.func.isRequired
|
|
87
|
+
}), PropTypes.string]),
|
|
88
|
+
"paddingTop": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
89
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
90
|
+
"description": PropTypes.string,
|
|
91
|
+
"toString": PropTypes.func.isRequired,
|
|
92
|
+
"valueOf": PropTypes.func.isRequired
|
|
93
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
94
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
95
|
+
"description": PropTypes.string,
|
|
96
|
+
"toString": PropTypes.func.isRequired,
|
|
97
|
+
"valueOf": PropTypes.func.isRequired
|
|
98
|
+
}), PropTypes.string]),
|
|
99
|
+
"paddingX": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
100
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
101
|
+
"description": PropTypes.string,
|
|
102
|
+
"toString": PropTypes.func.isRequired,
|
|
103
|
+
"valueOf": PropTypes.func.isRequired
|
|
104
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
105
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
106
|
+
"description": PropTypes.string,
|
|
107
|
+
"toString": PropTypes.func.isRequired,
|
|
108
|
+
"valueOf": PropTypes.func.isRequired
|
|
109
|
+
}), PropTypes.string]),
|
|
110
|
+
"paddingY": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
111
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
112
|
+
"description": PropTypes.string,
|
|
113
|
+
"toString": PropTypes.func.isRequired,
|
|
114
|
+
"valueOf": PropTypes.func.isRequired
|
|
115
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
116
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
117
|
+
"description": PropTypes.string,
|
|
118
|
+
"toString": PropTypes.func.isRequired,
|
|
119
|
+
"valueOf": PropTypes.func.isRequired
|
|
120
|
+
}), PropTypes.string]),
|
|
121
|
+
"pb": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
122
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
123
|
+
"description": PropTypes.string,
|
|
124
|
+
"toString": PropTypes.func.isRequired,
|
|
125
|
+
"valueOf": PropTypes.func.isRequired
|
|
126
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
127
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
128
|
+
"description": PropTypes.string,
|
|
129
|
+
"toString": PropTypes.func.isRequired,
|
|
130
|
+
"valueOf": PropTypes.func.isRequired
|
|
131
|
+
}), PropTypes.string]),
|
|
132
|
+
"pl": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
133
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
134
|
+
"description": PropTypes.string,
|
|
135
|
+
"toString": PropTypes.func.isRequired,
|
|
136
|
+
"valueOf": PropTypes.func.isRequired
|
|
137
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
138
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
139
|
+
"description": PropTypes.string,
|
|
140
|
+
"toString": PropTypes.func.isRequired,
|
|
141
|
+
"valueOf": PropTypes.func.isRequired
|
|
142
|
+
}), PropTypes.string]),
|
|
143
|
+
"pr": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
144
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
145
|
+
"description": PropTypes.string,
|
|
146
|
+
"toString": PropTypes.func.isRequired,
|
|
147
|
+
"valueOf": PropTypes.func.isRequired
|
|
148
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
149
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
150
|
+
"description": PropTypes.string,
|
|
151
|
+
"toString": PropTypes.func.isRequired,
|
|
152
|
+
"valueOf": PropTypes.func.isRequired
|
|
153
|
+
}), PropTypes.string]),
|
|
154
|
+
"pt": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
155
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
156
|
+
"description": PropTypes.string,
|
|
157
|
+
"toString": PropTypes.func.isRequired,
|
|
158
|
+
"valueOf": PropTypes.func.isRequired
|
|
159
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
160
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
161
|
+
"description": PropTypes.string,
|
|
162
|
+
"toString": PropTypes.func.isRequired,
|
|
163
|
+
"valueOf": PropTypes.func.isRequired
|
|
164
|
+
}), PropTypes.string]),
|
|
165
|
+
"px": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
166
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
167
|
+
"description": PropTypes.string,
|
|
168
|
+
"toString": PropTypes.func.isRequired,
|
|
169
|
+
"valueOf": PropTypes.func.isRequired
|
|
170
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
171
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
172
|
+
"description": PropTypes.string,
|
|
173
|
+
"toString": PropTypes.func.isRequired,
|
|
174
|
+
"valueOf": PropTypes.func.isRequired
|
|
175
|
+
}), PropTypes.string]),
|
|
176
|
+
"py": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
177
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
178
|
+
"description": PropTypes.string,
|
|
179
|
+
"toString": PropTypes.func.isRequired,
|
|
180
|
+
"valueOf": PropTypes.func.isRequired
|
|
181
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
182
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
183
|
+
"description": PropTypes.string,
|
|
184
|
+
"toString": PropTypes.func.isRequired,
|
|
185
|
+
"valueOf": PropTypes.func.isRequired
|
|
186
|
+
}), PropTypes.string])
|
|
187
|
+
};
|
|
188
|
+
export { VerticalMenuTrigger };
|
|
189
|
+
export default VerticalMenuTrigger;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TagProps } from "../../__internal__/utils/helpers/tags";
|
|
3
|
+
export interface VerticalMenuProps extends TagProps {
|
|
4
|
+
/** An aria-label attribute for the menu */
|
|
5
|
+
"aria-label"?: string;
|
|
6
|
+
/** An aria-labelledby attribute for the menu */
|
|
7
|
+
"aria-labelledby"?: string;
|
|
8
|
+
/** Width of the menu */
|
|
9
|
+
width?: string;
|
|
10
|
+
/** Content of the menu - VerticalMenuItem */
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
/** Height of the menu */
|
|
13
|
+
height?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const VerticalMenu: ({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, width, children, height, ...rest }: VerticalMenuProps) => JSX.Element;
|
|
16
|
+
export default VerticalMenu;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
import React from "react";
|
|
4
|
+
import PropTypes from "prop-types";
|
|
5
|
+
import tagComponent from "../../__internal__/utils/helpers/tags";
|
|
6
|
+
import { StyledVerticalMenu, StyledList } from "./vertical-menu.style";
|
|
7
|
+
|
|
8
|
+
const VerticalMenu = ({
|
|
9
|
+
"aria-label": ariaLabel,
|
|
10
|
+
"aria-labelledby": ariaLabelledBy,
|
|
11
|
+
width = "322px",
|
|
12
|
+
children,
|
|
13
|
+
height = "100%",
|
|
14
|
+
...rest
|
|
15
|
+
}) => {
|
|
16
|
+
return /*#__PURE__*/React.createElement(StyledVerticalMenu, _extends({
|
|
17
|
+
boxSizing: "border-box",
|
|
18
|
+
scrollVariant: "light",
|
|
19
|
+
backgroundColor: "var(--colorsComponentsLeftnavWinterStandardBackground)",
|
|
20
|
+
width: width,
|
|
21
|
+
height: height,
|
|
22
|
+
py: 1,
|
|
23
|
+
as: "nav",
|
|
24
|
+
overflow: "auto",
|
|
25
|
+
"aria-label": ariaLabel,
|
|
26
|
+
"aria-labelledby": ariaLabelledBy
|
|
27
|
+
}, tagComponent("vertical-menu", rest)), /*#__PURE__*/React.createElement(StyledList, null, children));
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
VerticalMenu.propTypes = {
|
|
31
|
+
"aria-label": PropTypes.string,
|
|
32
|
+
"aria-labelledby": PropTypes.string,
|
|
33
|
+
"children": PropTypes.node,
|
|
34
|
+
"data-component": PropTypes.string,
|
|
35
|
+
"data-element": PropTypes.string,
|
|
36
|
+
"data-role": PropTypes.string,
|
|
37
|
+
"height": PropTypes.string,
|
|
38
|
+
"width": PropTypes.string
|
|
39
|
+
};
|
|
40
|
+
export { VerticalMenu };
|
|
41
|
+
export default VerticalMenu;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { PaddingProps } from "styled-system";
|
|
3
|
+
export declare const StyledList: import("styled-components").StyledComponent<"ul", any, {}, never>;
|
|
4
|
+
interface StyledVerticalMenuProps extends PaddingProps {
|
|
5
|
+
active?: boolean;
|
|
6
|
+
height: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const StyledVerticalMenuItem: import("styled-components").StyledComponent<"div", any, StyledVerticalMenuProps, never>;
|
|
9
|
+
export declare const StyledTitle: import("styled-components").StyledComponent<"h3", any, {}, never>;
|
|
10
|
+
export declare const StyledAdornment: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
11
|
+
export declare const StyledTitleIcon: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../icon").IconProps & import("react").RefAttributes<HTMLSpanElement>>, any, {}, never>;
|
|
12
|
+
export declare const StyledChevronIcon: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../icon").IconProps & import("react").RefAttributes<HTMLSpanElement>>, any, {}, never>;
|
|
13
|
+
export declare const StyledVerticalMenu: import("styled-components").StyledComponent<"div", any, import("../box").BoxProps, never>;
|
|
14
|
+
export declare const StyledVerticalMenuFullScreen: import("styled-components").StyledComponent<"div", any, import("../box").BoxProps, never>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import styled, { css } from "styled-components";
|
|
2
|
+
import { padding } from "styled-system";
|
|
3
|
+
import StyledIcon from "../icon/icon.style";
|
|
4
|
+
import Icon from "../icon";
|
|
5
|
+
import Box from "../box";
|
|
6
|
+
export const StyledList = styled.ul`
|
|
7
|
+
list-style: none;
|
|
8
|
+
margin: 0;
|
|
9
|
+
padding: 0;
|
|
10
|
+
`;
|
|
11
|
+
export const StyledVerticalMenuItem = styled.div`
|
|
12
|
+
min-height: ${({
|
|
13
|
+
height
|
|
14
|
+
}) => height};
|
|
15
|
+
width: 100%;
|
|
16
|
+
display: flex;
|
|
17
|
+
border: none;
|
|
18
|
+
align-items: center;
|
|
19
|
+
font-weight: 600;
|
|
20
|
+
font-size: 14px;
|
|
21
|
+
cursor: pointer;
|
|
22
|
+
color: var(--colorsComponentsLeftnavWinterStandardContent);
|
|
23
|
+
position: relative;
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
text-decoration: none;
|
|
26
|
+
background-color: var(--colorsComponentsLeftnavWinterStandardBackground);
|
|
27
|
+
|
|
28
|
+
${padding}
|
|
29
|
+
|
|
30
|
+
&:hover {
|
|
31
|
+
background-color: var(--colorsComponentsLeftnavWinterStandardHover);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&:focus {
|
|
35
|
+
outline: 3px solid var(--colorsSemanticFocus500);
|
|
36
|
+
outline-offset: -3px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
${({
|
|
40
|
+
active
|
|
41
|
+
}) => active && css`
|
|
42
|
+
&:before {
|
|
43
|
+
background: var(--colorsComponentsLeftnavWinterStandardSelected);
|
|
44
|
+
content: "";
|
|
45
|
+
height: calc(100% - 16px);
|
|
46
|
+
left: 24px;
|
|
47
|
+
position: absolute;
|
|
48
|
+
top: 8px;
|
|
49
|
+
width: calc(100% - 48px);
|
|
50
|
+
z-index: 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&:hover {
|
|
54
|
+
&:before {
|
|
55
|
+
background: var(--colorsComponentsLeftnavWinterStandardHover);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
`}
|
|
59
|
+
|
|
60
|
+
${StyledIcon} {
|
|
61
|
+
width: 20px;
|
|
62
|
+
}
|
|
63
|
+
`;
|
|
64
|
+
export const StyledTitle = styled.h3`
|
|
65
|
+
font-weight: 600;
|
|
66
|
+
font-size: 14px;
|
|
67
|
+
line-height: 21px;
|
|
68
|
+
margin: 0;
|
|
69
|
+
z-index: 1;
|
|
70
|
+
text-align: left;
|
|
71
|
+
`;
|
|
72
|
+
export const StyledAdornment = styled.div`
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
justify-content: flex-end;
|
|
76
|
+
flex: 1;
|
|
77
|
+
`;
|
|
78
|
+
export const StyledTitleIcon = styled(Icon)`
|
|
79
|
+
margin-right: 12px;
|
|
80
|
+
width: 20px;
|
|
81
|
+
color: var(--colorsComponentsLeftnavWinterStandardContent);
|
|
82
|
+
`;
|
|
83
|
+
export const StyledChevronIcon = styled(Icon)`
|
|
84
|
+
margin-left: auto;
|
|
85
|
+
padding-left: 12px;
|
|
86
|
+
width: 20px;
|
|
87
|
+
color: var(--colorsComponentsLeftnavWinterStandardContent);
|
|
88
|
+
`;
|
|
89
|
+
export const StyledVerticalMenu = styled(Box)`
|
|
90
|
+
// TODO remove hardcoded values when DS have had chance to review which token to use
|
|
91
|
+
&::-webkit-scrollbar-track {
|
|
92
|
+
background-color: #cccccc;
|
|
93
|
+
}
|
|
94
|
+
&::-webkit-scrollbar-thumb {
|
|
95
|
+
background-color: #808080;
|
|
96
|
+
}
|
|
97
|
+
&::-webkit-scrollbar {
|
|
98
|
+
width: 12px;
|
|
99
|
+
}
|
|
100
|
+
`;
|
|
101
|
+
export const StyledVerticalMenuFullScreen = styled(Box)`
|
|
102
|
+
position: fixed;
|
|
103
|
+
top: 0;
|
|
104
|
+
bottom: 0;
|
|
105
|
+
height: 100vh;
|
|
106
|
+
width: 100%;
|
|
107
|
+
outline: none;
|
|
108
|
+
padding: 8px 0px;
|
|
109
|
+
overflow: auto;
|
|
110
|
+
background-color: var(--colorsComponentsLeftnavWinterStandardBackground);
|
|
111
|
+
box-sizing: border-box;
|
|
112
|
+
transition: all 0.3s ease;
|
|
113
|
+
z-index: ${({
|
|
114
|
+
theme
|
|
115
|
+
}) => theme.zIndex.fullScreenModal};
|
|
116
|
+
|
|
117
|
+
// TODO remove hardcoded values when DS have had chance to review which token to use
|
|
118
|
+
&::-webkit-scrollbar-track {
|
|
119
|
+
background-color: #cccccc;
|
|
120
|
+
}
|
|
121
|
+
&::-webkit-scrollbar-thumb {
|
|
122
|
+
background-color: #808080;
|
|
123
|
+
}
|
|
124
|
+
&::-webkit-scrollbar {
|
|
125
|
+
width: 12px;
|
|
126
|
+
}
|
|
127
|
+
`;
|
package/esm/locales/en-gb.js
CHANGED
package/esm/locales/locale.d.ts
CHANGED
package/esm/locales/pl-pl.js
CHANGED
|
@@ -128,6 +128,11 @@ I18nProvider.propTypes = {
|
|
|
128
128
|
"ariaLabels": _propTypes.default.shape({
|
|
129
129
|
"close": _propTypes.default.func.isRequired
|
|
130
130
|
}).isRequired
|
|
131
|
+
}),
|
|
132
|
+
"verticalMenuFullScreen": _propTypes.default.shape({
|
|
133
|
+
"ariaLabels": _propTypes.default.shape({
|
|
134
|
+
"close": _propTypes.default.func.isRequired
|
|
135
|
+
}).isRequired
|
|
131
136
|
})
|
|
132
137
|
})
|
|
133
138
|
};
|
|
@@ -291,7 +291,8 @@ const TextEditor = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
291
291
|
ariaLabelledBy: labelId.current,
|
|
292
292
|
ariaDescribedBy: labelId.current,
|
|
293
293
|
blockStyleFn: _utils.blockStyleFn,
|
|
294
|
-
keyBindingFn: keyBindingFn
|
|
294
|
+
keyBindingFn: keyBindingFn,
|
|
295
|
+
tabIndex: 0
|
|
295
296
|
}), _react.default.Children.map(previews, preview => {
|
|
296
297
|
const {
|
|
297
298
|
onClose
|
|
@@ -8,11 +8,11 @@ export interface TextEditorProps extends MarginProps {
|
|
|
8
8
|
/** The text for the editor's label */
|
|
9
9
|
labelText: string;
|
|
10
10
|
/** onChange callback to control value updates */
|
|
11
|
-
onChange: (event:
|
|
11
|
+
onChange: (event: EditorState) => void;
|
|
12
12
|
/** Additional elements to be rendered in the Editor Toolbar, e.g. Save and Cancel Button */
|
|
13
13
|
toolbarElements?: React.ReactNode;
|
|
14
14
|
/** The value of the input, this is an EditorState immutable object */
|
|
15
|
-
value:
|
|
15
|
+
value: EditorState;
|
|
16
16
|
/** Flag to configure component as mandatory */
|
|
17
17
|
required?: boolean;
|
|
18
18
|
/** Message to be displayed when there is an error */
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { default as VerticalMenu } from "./vertical-menu.component";
|
|
2
|
+
export type { VerticalMenuProps } from "./vertical-menu.component";
|
|
3
|
+
export { default as VerticalMenuItem } from "./vertical-menu-item.component";
|
|
4
|
+
export type { VerticalMenuItemProps } from "./vertical-menu-item.component";
|
|
5
|
+
export { default as VerticalMenuFullScreen } from "./vertical-menu-full-screen.component";
|
|
6
|
+
export type { VerticalMenuFullScreenProps } from "./vertical-menu-full-screen.component";
|
|
7
|
+
export { default as VerticalMenuTrigger } from "./vertical-menu-trigger.component";
|
|
8
|
+
export type { VerticalMenuTriggerProps } from "./vertical-menu-trigger.component";
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "VerticalMenu", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _verticalMenu.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "VerticalMenuItem", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _verticalMenuItem.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "VerticalMenuFullScreen", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _verticalMenuFullScreen.default;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "VerticalMenuTrigger", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _verticalMenuTrigger.default;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
var _verticalMenu = _interopRequireDefault(require("./vertical-menu.component"));
|
|
32
|
+
|
|
33
|
+
var _verticalMenuItem = _interopRequireDefault(require("./vertical-menu-item.component"));
|
|
34
|
+
|
|
35
|
+
var _verticalMenuFullScreen = _interopRequireDefault(require("./vertical-menu-full-screen.component"));
|
|
36
|
+
|
|
37
|
+
var _verticalMenuTrigger = _interopRequireDefault(require("./vertical-menu-trigger.component"));
|
|
38
|
+
|
|
39
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TagProps } from "../../__internal__/utils/helpers/tags";
|
|
3
|
+
export interface VerticalMenuFullScreenProps extends TagProps {
|
|
4
|
+
/** An aria-label attribute for the menu */
|
|
5
|
+
"aria-label"?: string;
|
|
6
|
+
/** An aria-labelledby attribute for the menu */
|
|
7
|
+
"aria-labelledby"?: string;
|
|
8
|
+
/** Content of the menu - VerticalMenuItem */
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
/** Whether the menu is open or not */
|
|
11
|
+
isOpen: boolean;
|
|
12
|
+
/** A callback to be called when the close icon is clicked or enter is pressed when focused */
|
|
13
|
+
onClose: (ev: React.KeyboardEvent<HTMLButtonElement> | React.MouseEvent<HTMLButtonElement>) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare const VerticalMenuFullScreen: ({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, children, isOpen, onClose, ...rest }: VerticalMenuFullScreenProps) => JSX.Element | null;
|
|
16
|
+
export default VerticalMenuFullScreen;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.VerticalMenuFullScreen = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var _tags = _interopRequireDefault(require("../../__internal__/utils/helpers/tags"));
|
|
13
|
+
|
|
14
|
+
var _useLocale = _interopRequireDefault(require("../../hooks/__internal__/useLocale"));
|
|
15
|
+
|
|
16
|
+
var _portal = _interopRequireDefault(require("../portal"));
|
|
17
|
+
|
|
18
|
+
var _focusTrap = _interopRequireDefault(require("../../__internal__/focus-trap/focus-trap.component"));
|
|
19
|
+
|
|
20
|
+
var _iconButton = _interopRequireDefault(require("../icon-button"));
|
|
21
|
+
|
|
22
|
+
var _icon = _interopRequireDefault(require("../icon"));
|
|
23
|
+
|
|
24
|
+
var _box = _interopRequireDefault(require("../box"));
|
|
25
|
+
|
|
26
|
+
var _verticalMenu = require("./vertical-menu.style");
|
|
27
|
+
|
|
28
|
+
var _verticalMenuFullScreen = _interopRequireDefault(require("./vertical-menu-full-screen.context"));
|
|
29
|
+
|
|
30
|
+
var _events = _interopRequireDefault(require("../../__internal__/utils/helpers/events/events"));
|
|
31
|
+
|
|
32
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
|
+
|
|
34
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
35
|
+
|
|
36
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
37
|
+
|
|
38
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
39
|
+
|
|
40
|
+
const VerticalMenuFullScreen = ({
|
|
41
|
+
"aria-label": ariaLabel,
|
|
42
|
+
"aria-labelledby": ariaLabelledBy,
|
|
43
|
+
children,
|
|
44
|
+
isOpen,
|
|
45
|
+
onClose,
|
|
46
|
+
...rest
|
|
47
|
+
}) => {
|
|
48
|
+
const l = (0, _useLocale.default)();
|
|
49
|
+
const menuWrapperRef = (0, _react.useRef)(null);
|
|
50
|
+
const handleKeyDown = (0, _react.useCallback)(ev => {
|
|
51
|
+
// istanbul ignore else
|
|
52
|
+
if (_events.default.isEscKey(ev)) {
|
|
53
|
+
onClose(ev);
|
|
54
|
+
}
|
|
55
|
+
}, [onClose]); // TODO remove this as part of FE-5650
|
|
56
|
+
|
|
57
|
+
if (!isOpen) return null;
|
|
58
|
+
return /*#__PURE__*/_react.default.createElement(_portal.default, null, /*#__PURE__*/_react.default.createElement(_focusTrap.default, {
|
|
59
|
+
isOpen: isOpen,
|
|
60
|
+
wrapperRef: menuWrapperRef
|
|
61
|
+
}, /*#__PURE__*/_react.default.createElement(_verticalMenu.StyledVerticalMenuFullScreen, _extends({
|
|
62
|
+
ref: menuWrapperRef,
|
|
63
|
+
scrollVariant: "light",
|
|
64
|
+
as: "nav",
|
|
65
|
+
"aria-label": ariaLabel,
|
|
66
|
+
"aria-labelledby": ariaLabelledBy,
|
|
67
|
+
onKeyDown: handleKeyDown
|
|
68
|
+
}, (0, _tags.default)("vertical-menu-full-screen", rest)), /*#__PURE__*/_react.default.createElement(_box.default, {
|
|
69
|
+
display: "flex",
|
|
70
|
+
justifyContent: "flex-end",
|
|
71
|
+
height: "60px",
|
|
72
|
+
alignItems: "flex-start",
|
|
73
|
+
px: "20px",
|
|
74
|
+
pt: "20px",
|
|
75
|
+
boxSizing: "border-box"
|
|
76
|
+
}, /*#__PURE__*/_react.default.createElement(_iconButton.default, {
|
|
77
|
+
"aria-label": l.verticalMenuFullScreen.ariaLabels.close(),
|
|
78
|
+
onAction: onClose,
|
|
79
|
+
"data-element": "close"
|
|
80
|
+
}, /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
81
|
+
type: "close",
|
|
82
|
+
color: "var(--colorsComponentsLeftnavWinterStandardContent)",
|
|
83
|
+
bgSize: "small",
|
|
84
|
+
fontSize: "medium"
|
|
85
|
+
}))), /*#__PURE__*/_react.default.createElement(_verticalMenuFullScreen.default.Provider, {
|
|
86
|
+
value: {
|
|
87
|
+
isFullScreen: true
|
|
88
|
+
}
|
|
89
|
+
}, /*#__PURE__*/_react.default.createElement(_verticalMenu.StyledList, null, children)))));
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
exports.VerticalMenuFullScreen = VerticalMenuFullScreen;
|
|
93
|
+
VerticalMenuFullScreen.propTypes = {
|
|
94
|
+
"aria-label": _propTypes.default.string,
|
|
95
|
+
"aria-labelledby": _propTypes.default.string,
|
|
96
|
+
"children": _propTypes.default.node,
|
|
97
|
+
"data-component": _propTypes.default.string,
|
|
98
|
+
"data-element": _propTypes.default.string,
|
|
99
|
+
"data-role": _propTypes.default.string,
|
|
100
|
+
"isOpen": _propTypes.default.bool.isRequired,
|
|
101
|
+
"onClose": _propTypes.default.func.isRequired
|
|
102
|
+
};
|
|
103
|
+
var _default = VerticalMenuFullScreen;
|
|
104
|
+
exports.default = _default;
|