carbon-react 110.7.0 → 110.9.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/esm/components/heading/heading.style.js +7 -5
- package/esm/components/link/link.component.d.ts +2 -7
- package/esm/components/link/link.component.js +8 -3
- package/esm/components/link/link.config.d.ts +1 -0
- package/esm/components/link/link.config.js +2 -1
- package/esm/components/link/link.style.d.ts +15 -3
- package/esm/components/link/link.style.js +151 -61
- package/esm/components/menu/menu-item/menu-item.style.js +43 -39
- package/esm/components/select/filterable-select/filterable-select.component.js +5 -0
- package/esm/components/select/filterable-select/filterable-select.d.ts +2 -0
- package/esm/components/select/multi-select/multi-select.component.js +5 -0
- package/esm/components/select/multi-select/multi-select.d.ts +2 -0
- package/esm/components/select/select-list/select-list-container.style.js +1 -3
- package/esm/components/select/select-list/select-list.component.js +6 -2
- package/esm/components/select/select-list/select-list.style.js +1 -1
- package/esm/components/select/simple-select/simple-select.component.js +5 -0
- package/esm/components/select/simple-select/simple-select.d.ts +2 -0
- package/esm/style/design-tokens/debug-theme.util.d.ts +107 -102
- package/esm/style/themes/sage/index.d.ts +107 -102
- package/lib/components/heading/heading.style.js +7 -5
- package/lib/components/link/link.component.d.ts +2 -7
- package/lib/components/link/link.component.js +8 -3
- package/lib/components/link/link.config.d.ts +1 -0
- package/lib/components/link/link.config.js +4 -2
- package/lib/components/link/link.style.d.ts +15 -3
- package/lib/components/link/link.style.js +151 -61
- package/lib/components/menu/menu-item/menu-item.style.js +43 -39
- package/lib/components/select/filterable-select/filterable-select.component.js +5 -0
- package/lib/components/select/filterable-select/filterable-select.d.ts +2 -0
- package/lib/components/select/multi-select/multi-select.component.js +5 -0
- package/lib/components/select/multi-select/multi-select.d.ts +2 -0
- package/lib/components/select/select-list/select-list-container.style.js +1 -3
- package/lib/components/select/select-list/select-list.component.js +6 -2
- package/lib/components/select/select-list/select-list.style.js +1 -1
- package/lib/components/select/simple-select/simple-select.component.js +5 -0
- package/lib/components/select/simple-select/simple-select.d.ts +2 -0
- package/lib/style/design-tokens/debug-theme.util.d.ts +107 -102
- package/lib/style/themes/sage/index.d.ts +107 -102
- package/package.json +3 -3
|
@@ -56,9 +56,16 @@ const StyledHeadingBackButton = styled(Link)`
|
|
|
56
56
|
outline: 3px solid var(--colorsSemanticFocus500);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
&:hover {
|
|
60
|
+
${StyledIcon} {
|
|
61
|
+
color: var(--colorsActionMinor600);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
59
65
|
${StyledIcon} {
|
|
60
66
|
margin-right: 0;
|
|
61
67
|
display: inline-flex;
|
|
68
|
+
color: var(--colorsActionMinor500);
|
|
62
69
|
}
|
|
63
70
|
}
|
|
64
71
|
`;
|
|
@@ -93,17 +100,12 @@ const StyledSubHeader = styled.div`
|
|
|
93
100
|
`}
|
|
94
101
|
`;
|
|
95
102
|
const StyledHeadingIcon = styled(Icon)`
|
|
96
|
-
color: var(--colorsActionMinor500);
|
|
97
103
|
height: 30px;
|
|
98
104
|
|
|
99
105
|
&:before,
|
|
100
106
|
&${StyledIcon}:before {
|
|
101
107
|
font-size: 24px;
|
|
102
108
|
}
|
|
103
|
-
|
|
104
|
-
&:hover {
|
|
105
|
-
color: var(--colorsActionMinor600);
|
|
106
|
-
}
|
|
107
109
|
`;
|
|
108
110
|
const StyledSeparator = styled.hr`
|
|
109
111
|
border-top: 2px solid var(--colorsUtilityMajor100);
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { IconType } from "components/icon/icon-type";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
disabled?: boolean;
|
|
3
|
+
import { StyledLinkProps } from "./link.style";
|
|
4
|
+
export interface LinkProps extends StyledLinkProps, React.AriaAttributes {
|
|
6
5
|
/** An href for an anchor tag. */
|
|
7
6
|
href?: string;
|
|
8
7
|
/** An icon to display next to the link. */
|
|
9
8
|
icon?: IconType;
|
|
10
|
-
/** Which side of the link to the render the link. */
|
|
11
|
-
iconAlign?: "left" | "right";
|
|
12
9
|
/** Function called when the mouse is clicked. */
|
|
13
10
|
onClick?: (ev: React.MouseEvent<HTMLAnchorElement> | React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLAnchorElement> | React.KeyboardEvent<HTMLButtonElement>) => void;
|
|
14
11
|
/** Function called when a key is pressed. */
|
|
@@ -27,8 +24,6 @@ export interface LinkProps extends React.AriaAttributes {
|
|
|
27
24
|
target?: string;
|
|
28
25
|
/** Aria label for accessibility purposes */
|
|
29
26
|
ariaLabel?: string;
|
|
30
|
-
/** Allows to create skip link */
|
|
31
|
-
isSkipLink?: boolean;
|
|
32
27
|
/** allows to set rel property in <a> tag */
|
|
33
28
|
rel?: string;
|
|
34
29
|
}
|
|
@@ -23,6 +23,8 @@ const Link = /*#__PURE__*/React.forwardRef(({
|
|
|
23
23
|
tooltipMessage,
|
|
24
24
|
tooltipPosition,
|
|
25
25
|
target,
|
|
26
|
+
variant = "default",
|
|
27
|
+
isDarkBackground,
|
|
26
28
|
...rest
|
|
27
29
|
}, ref) => {
|
|
28
30
|
const l = useLocale();
|
|
@@ -48,7 +50,6 @@ const Link = /*#__PURE__*/React.forwardRef(({
|
|
|
48
50
|
return hasProperAlignment ? /*#__PURE__*/React.createElement(Icon, {
|
|
49
51
|
type: icon,
|
|
50
52
|
bgSize: "extra-small",
|
|
51
|
-
color: "--colorsActionMajor500",
|
|
52
53
|
disabled: disabled,
|
|
53
54
|
ariaLabel: ariaLabel,
|
|
54
55
|
tooltipMessage: tooltipMessage,
|
|
@@ -91,7 +92,9 @@ const Link = /*#__PURE__*/React.forwardRef(({
|
|
|
91
92
|
disabled: disabled,
|
|
92
93
|
className: className,
|
|
93
94
|
iconAlign: iconAlign,
|
|
94
|
-
hasContent: Boolean(children)
|
|
95
|
+
hasContent: Boolean(children),
|
|
96
|
+
variant: variant,
|
|
97
|
+
isDarkBackground: isDarkBackground
|
|
95
98
|
}, tagComponent("link", rest), isSkipLink && {
|
|
96
99
|
"data-element": "skip-link"
|
|
97
100
|
}), createLinkBasedOnType());
|
|
@@ -152,6 +155,7 @@ Link.propTypes = {
|
|
|
152
155
|
"href": PropTypes.string,
|
|
153
156
|
"icon": PropTypes.oneOf(["add", "admin", "alert_on", "alert", "analysis", "arrow_down", "arrow_left_boxed", "arrow_left_right_small", "arrow_left_small", "arrow_left", "arrow_right_small", "arrow_right", "arrow_up", "arrow", "attach", "bank", "basket_with_squares", "basket", "bin", "block_arrow_right", "blocked_square", "blocked", "bold", "boxed_shapes", "bulk_destroy", "bullet_list_dotted", "bullet_list_numbers", "bullet_list", "business", "calendar_today", "calendar", "call", "camera", "card_view", "caret_down", "caret_large_down", "caret_large_left", "caret_large_right", "caret_large_up", "caret_left", "caret_right", "caret_up", "cart", "chart_bar", "chart_line", "chart_pie", "chat_notes", "chat", "chevron_down_thick", "chevron_down", "chevron_left_thick", "chevron_left", "chevron_right_thick", "chevron_right", "chevron_up_thick", "chevron_up", "circle_with_dots", "circles_connection", "clock", "close", "coins", "collaborate", "computer_clock", "connect", "contacts", "copy", "create", "credit_card_slash", "credit_card", "cross_circle", "cross", "csv", "delete", "delivery", "disconnect", "disputed", "document_right_align", "document_tick", "document_vertical_lines", "download", "draft", "drag_vertical", "drag", "dropdown", "duplicate", "edit", "edited", "ellipsis_horizontal", "ellipsis_vertical", "email_switch", "email", "entry", "envelope_dollar", "envelope_euro", "error_square", "error", "euro", "expand", "factory", "favourite_lined", "favourite", "fax", "feedback", "file_excel", "file_generic", "file_image", "file_pdf", "file_word", "files_leaning", "filter_new", "filter", "fit_height", "fit_width", "flag", "folder", "gift", "go", "graph", "grid", "help", "hide", "home", "image", "in_progress", "in_transit", "individual", "info", "italic", "key", "ledger_arrow_left", "ledger_arrow_right", "ledger", "lightbulb_off", "lightbulb_on", "link", "list_view", "location", "locked", "logout", "lookup", "marker", "message", "minus_large", "minus", "mobile", "money_bag", "none", "old_warning", "palm_tree", "pause_circle", "pause", "pdf", "people_switch", "people", "person_info", "person_tick", "person", "phone", "piggy_bank", "play_circle", "play", "plus_large", "plus", "pound", "print", "progress", "progressed", "question_hollow", "question_mark", "question", "refresh_clock", "refresh", "remove", "sage_coin", "save", "scan", "search", "services", "settings_old", "settings", "share", "shop", "sort_down", "sort_up", "spanner", "split_container", "split", "square_dot", "squares_nine", "stacked_boxes", "stacked_squares", "submitted", "sync", "tag", "talk", "three_boxes", "tick_circle", "tick_thick", "tick", "true_tick", "undo", "unlocked", "upload", "uploaded", "video", "view", "warning"]),
|
|
154
157
|
"iconAlign": PropTypes.oneOf(["left", "right"]),
|
|
158
|
+
"isDarkBackground": PropTypes.bool,
|
|
155
159
|
"isSkipLink": PropTypes.bool,
|
|
156
160
|
"onClick": PropTypes.func,
|
|
157
161
|
"onKeyDown": PropTypes.func,
|
|
@@ -159,7 +163,8 @@ Link.propTypes = {
|
|
|
159
163
|
"rel": PropTypes.string,
|
|
160
164
|
"target": PropTypes.string,
|
|
161
165
|
"tooltipMessage": PropTypes.string,
|
|
162
|
-
"tooltipPosition": PropTypes.oneOf(["bottom", "left", "right", "top"])
|
|
166
|
+
"tooltipPosition": PropTypes.oneOf(["bottom", "left", "right", "top"]),
|
|
167
|
+
"variant": PropTypes.oneOf(["default", "negative", "neutral"])
|
|
163
168
|
};
|
|
164
169
|
export { Link };
|
|
165
170
|
Link.displayName = "Link";
|
|
@@ -1,7 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
interface StyledLinkProps
|
|
1
|
+
declare type Variants = "default" | "negative" | "neutral";
|
|
2
|
+
export interface StyledLinkProps {
|
|
3
|
+
/** The disabled state of the link. */
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
/** Which side of the link to the render the link. */
|
|
6
|
+
iconAlign?: "left" | "right";
|
|
7
|
+
/** Allows to create skip link */
|
|
8
|
+
isSkipLink?: boolean;
|
|
9
|
+
/** Sets the colour styling when component is rendered on a dark background */
|
|
10
|
+
isDarkBackground?: boolean;
|
|
11
|
+
/** Allows link styling to be updated for light or dark backgrounds */
|
|
12
|
+
variant?: Variants;
|
|
13
|
+
}
|
|
14
|
+
interface PrivateStyledLinkProps {
|
|
3
15
|
hasContent: boolean;
|
|
4
16
|
}
|
|
5
|
-
declare const StyledLink: import("styled-components").StyledComponent<"span", any, StyledLinkProps, never>;
|
|
17
|
+
declare const StyledLink: import("styled-components").StyledComponent<"span", any, StyledLinkProps & PrivateStyledLinkProps, never>;
|
|
6
18
|
declare const StyledContent: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
7
19
|
export { StyledLink, StyledContent };
|
|
@@ -1,84 +1,174 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
2
|
import baseTheme from "../../style/themes/base";
|
|
3
3
|
import StyledIcon from "../icon/icon.style";
|
|
4
|
+
const colorMap = {
|
|
5
|
+
light: variant => {
|
|
6
|
+
let color = "var(--colorsActionMajor500)";
|
|
7
|
+
let hoverColor = "var(--colorsActionMajor600)";
|
|
8
|
+
|
|
9
|
+
if (variant === "negative") {
|
|
10
|
+
color = "var(--colorsSemanticNegative500)";
|
|
11
|
+
hoverColor = "var(--colorsSemanticNegative600)";
|
|
12
|
+
} else if (variant === "neutral") {
|
|
13
|
+
color = "var(--colorsActionMajorYin090)";
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return {
|
|
17
|
+
color,
|
|
18
|
+
hoverColor,
|
|
19
|
+
disabledColor: "var(--colorsActionMajorYin030)"
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
dark: variant => {
|
|
23
|
+
let color = "var(--colorsActionMajor350)";
|
|
24
|
+
let hoverColor = "var(--colorsActionMajor450)";
|
|
25
|
+
|
|
26
|
+
if (variant === "negative") {
|
|
27
|
+
color = "var(--colorsSemanticNegative350)";
|
|
28
|
+
hoverColor = "var(--colorsSemanticNegative450)";
|
|
29
|
+
} else if (variant === "neutral") {
|
|
30
|
+
color = "var(--colorsActionMinor100)";
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
color,
|
|
35
|
+
hoverColor,
|
|
36
|
+
disabledColor: "var(--colorsActionMajorYang030)"
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
};
|
|
4
40
|
const StyledLink = styled.span`
|
|
5
41
|
${({
|
|
6
42
|
isSkipLink,
|
|
7
43
|
theme,
|
|
8
44
|
iconAlign,
|
|
9
45
|
hasContent,
|
|
10
|
-
disabled
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
box-shadow: inset 0 0 0 2px var(--colorsActionMajor500);
|
|
23
|
-
border: 2px solid var(--colorsUtilityYang100);
|
|
24
|
-
}
|
|
46
|
+
disabled,
|
|
47
|
+
variant,
|
|
48
|
+
isDarkBackground
|
|
49
|
+
}) => {
|
|
50
|
+
const colorMapKey = isDarkBackground ? "dark" : "light";
|
|
51
|
+
const {
|
|
52
|
+
color,
|
|
53
|
+
hoverColor,
|
|
54
|
+
disabledColor
|
|
55
|
+
} = colorMap[colorMapKey](variant);
|
|
56
|
+
return css`
|
|
57
|
+
display: inline-block;
|
|
25
58
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
59
|
+
${isSkipLink && css`
|
|
60
|
+
a {
|
|
61
|
+
position: absolute;
|
|
62
|
+
padding-left: 24px;
|
|
63
|
+
padding-right: 24px;
|
|
64
|
+
line-height: 36px;
|
|
65
|
+
left: -999em;
|
|
66
|
+
z-index: ${theme.zIndex.aboveAll};
|
|
67
|
+
box-shadow: inset 0 0 0 2px var(--colorsActionMajor500);
|
|
68
|
+
border: 2px solid var(--colorsUtilityYang100);
|
|
69
|
+
font-size: 16px;
|
|
70
|
+
color: var(--colorsUtilityYin090);
|
|
31
71
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
72
|
+
&:hover {
|
|
73
|
+
cursor: pointer;
|
|
74
|
+
color: var(--colorsUtilityYin090);
|
|
75
|
+
|
|
76
|
+
${StyledIcon} {
|
|
77
|
+
color: var(--colorsActionMajor600);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&:focus {
|
|
82
|
+
background-color: var(--colorsUtilityYang100);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
a:focus {
|
|
87
|
+
top: 8px;
|
|
88
|
+
left: 8px;
|
|
89
|
+
}
|
|
90
|
+
`}
|
|
50
91
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
92
|
+
${!isSkipLink && css`
|
|
93
|
+
a,
|
|
94
|
+
button {
|
|
95
|
+
font-size: 14px;
|
|
96
|
+
|
|
97
|
+
${!disabled && css`
|
|
98
|
+
color: ${color};
|
|
99
|
+
${StyledIcon} {
|
|
100
|
+
color: ${color};
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&:hover {
|
|
104
|
+
color: ${hoverColor};
|
|
105
|
+
|
|
106
|
+
${StyledIcon} {
|
|
107
|
+
color: ${hoverColor};
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&:focus {
|
|
112
|
+
background-color: var(--colorsSemanticFocus250);
|
|
113
|
+
}
|
|
114
|
+
`}
|
|
115
|
+
|
|
116
|
+
${disabled && css`
|
|
117
|
+
color: ${disabledColor};
|
|
118
|
+
&:hover,
|
|
119
|
+
&:focus {
|
|
120
|
+
color: ${disabledColor};
|
|
121
|
+
}
|
|
122
|
+
`}
|
|
123
|
+
}
|
|
124
|
+
`}
|
|
125
|
+
|
|
126
|
+
a,
|
|
127
|
+
button {
|
|
128
|
+
text-decoration: underline;
|
|
129
|
+
display: inline-block;
|
|
54
130
|
|
|
55
131
|
${StyledIcon} {
|
|
56
|
-
|
|
132
|
+
display: inline-block;
|
|
133
|
+
position: relative;
|
|
134
|
+
vertical-align: middle;
|
|
135
|
+
${iconAlign === "left" && css`
|
|
136
|
+
margin-right: ${hasContent ? "var(--spacing100)" : 0};
|
|
137
|
+
`}
|
|
138
|
+
${iconAlign === "right" && css`
|
|
139
|
+
margin-right: 0;
|
|
140
|
+
margin-left: ${hasContent ? "var(--spacing100)" : 0};
|
|
141
|
+
`}
|
|
57
142
|
}
|
|
58
|
-
}
|
|
59
143
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
outline: none;
|
|
64
|
-
}
|
|
144
|
+
&:hover {
|
|
145
|
+
cursor: pointer;
|
|
146
|
+
}
|
|
65
147
|
|
|
66
|
-
${disabled && css`
|
|
67
|
-
color: var(--colorsActionMajorYin030);
|
|
68
|
-
&:hover,
|
|
69
148
|
&:focus {
|
|
70
|
-
|
|
71
|
-
|
|
149
|
+
color: var(--colorsActionMajorYin090);
|
|
150
|
+
outline: none;
|
|
151
|
+
|
|
152
|
+
${StyledIcon} {
|
|
153
|
+
color: var(--colorsActionMajorYin090);
|
|
154
|
+
}
|
|
72
155
|
}
|
|
73
|
-
`}
|
|
74
|
-
}
|
|
75
156
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
157
|
+
${disabled && css`
|
|
158
|
+
&:hover,
|
|
159
|
+
&:focus {
|
|
160
|
+
cursor: not-allowed;
|
|
161
|
+
}
|
|
162
|
+
`}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
button {
|
|
166
|
+
background-color: transparent;
|
|
167
|
+
border: none;
|
|
168
|
+
padding: 0;
|
|
169
|
+
}
|
|
170
|
+
`;
|
|
171
|
+
}}
|
|
82
172
|
`;
|
|
83
173
|
StyledLink.defaultProps = {
|
|
84
174
|
theme: baseTheme,
|
|
@@ -37,35 +37,37 @@ const StyledMenuItemWrapper = styled.a`
|
|
|
37
37
|
${!inFullscreenView && css`
|
|
38
38
|
max-width: inherit;
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
a:focus,
|
|
53
|
-
button:focus {
|
|
54
|
-
box-shadow: inset 0 0 0 var(--borderWidth300)
|
|
55
|
-
var(--colorsSemanticFocus500);
|
|
56
|
-
background-color: ${menuConfigVariants[menuType].background};
|
|
57
|
-
color: ${menuConfigVariants[menuType].color};
|
|
58
|
-
z-index: 1;
|
|
59
|
-
position: relative;
|
|
60
|
-
}
|
|
40
|
+
&& {
|
|
41
|
+
a,
|
|
42
|
+
button {
|
|
43
|
+
${maxWidth && css`
|
|
44
|
+
box-sizing: border-box;
|
|
45
|
+
max-width: inherit;
|
|
46
|
+
text-overflow: ellipsis;
|
|
47
|
+
overflow: hidden;
|
|
48
|
+
white-space: nowrap;
|
|
49
|
+
vertical-align: bottom;
|
|
50
|
+
`}
|
|
51
|
+
}
|
|
61
52
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
53
|
+
a:focus,
|
|
54
|
+
button:focus {
|
|
55
|
+
box-shadow: inset 0 0 0 var(--borderWidth300)
|
|
56
|
+
var(--colorsSemanticFocus500);
|
|
57
|
+
background-color: ${menuConfigVariants[menuType].background};
|
|
58
|
+
color: ${menuConfigVariants[menuType].color};
|
|
59
|
+
z-index: 1;
|
|
60
|
+
position: relative;
|
|
61
|
+
}
|
|
66
62
|
|
|
67
|
-
|
|
63
|
+
a:hover,
|
|
64
|
+
button:hover {
|
|
65
|
+
background-color: var(--colorsComponentsMenuAutumnStandard600);
|
|
68
66
|
color: var(--colorsComponentsMenuYang100);
|
|
67
|
+
|
|
68
|
+
[data-component="icon"] {
|
|
69
|
+
color: var(--colorsComponentsMenuYang100);
|
|
70
|
+
}
|
|
69
71
|
}
|
|
70
72
|
}
|
|
71
73
|
`}
|
|
@@ -85,19 +87,21 @@ const StyledMenuItemWrapper = styled.a`
|
|
|
85
87
|
text-align: left;
|
|
86
88
|
}
|
|
87
89
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
90
|
+
&& {
|
|
91
|
+
a,
|
|
92
|
+
button,
|
|
93
|
+
[data-component="icon"],
|
|
94
|
+
${StyledLink} a,
|
|
95
|
+
${StyledLink} button,
|
|
96
|
+
${StyledLink} [data-component="icon"] {
|
|
97
|
+
font-weight: 700;
|
|
98
|
+
text-decoration: none;
|
|
99
|
+
color: ${menuConfigVariants[menuType].color};
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
${IconStyle} {
|
|
103
|
+
bottom: 1px;
|
|
104
|
+
}
|
|
101
105
|
}
|
|
102
106
|
|
|
103
107
|
${selected && css`
|
|
@@ -30,6 +30,7 @@ const FilterableSelect = /*#__PURE__*/React.forwardRef(({
|
|
|
30
30
|
noResultsMessage,
|
|
31
31
|
disablePortal,
|
|
32
32
|
listActionButton,
|
|
33
|
+
listMaxHeight,
|
|
33
34
|
onListAction,
|
|
34
35
|
isLoading,
|
|
35
36
|
disabled,
|
|
@@ -401,6 +402,7 @@ const FilterableSelect = /*#__PURE__*/React.forwardRef(({
|
|
|
401
402
|
noResultsMessage: noResultsMessage,
|
|
402
403
|
disablePortal: disablePortal,
|
|
403
404
|
listActionButton: listActionButton,
|
|
405
|
+
listMaxHeight: listMaxHeight,
|
|
404
406
|
onListAction: handleOnListAction,
|
|
405
407
|
isLoading: isLoading,
|
|
406
408
|
readOnly: readOnly,
|
|
@@ -490,6 +492,9 @@ FilterableSelect.propTypes = { ...formInputPropTypes,
|
|
|
490
492
|
/** Overrides the default tooltip position */
|
|
491
493
|
tooltipPosition: PropTypes.oneOf(["top", "bottom", "left", "right"]),
|
|
492
494
|
|
|
495
|
+
/** Maximum list height - defaults to 180 */
|
|
496
|
+
listMaxHeight: PropTypes.number,
|
|
497
|
+
|
|
493
498
|
/** Placement of the select list in relation to the input element */
|
|
494
499
|
listPlacement: PropTypes.oneOf(["auto", "auto-start", "auto-end", "top", "top-start", "top-end", "bottom", "bottom-start", "bottom-end", "right", "right-start", "right-end", "left", "left-start", "left-end"]),
|
|
495
500
|
|
|
@@ -44,6 +44,8 @@ export interface FilterableSelectProps
|
|
|
44
44
|
value?: string | Record<string, unknown>;
|
|
45
45
|
/** Overrides the default tooltip position */
|
|
46
46
|
tooltipPosition?: "top" | "bottom" | "left" | "right";
|
|
47
|
+
/** Maximum list height - defaults to 180 */
|
|
48
|
+
listMaxHeight?: number;
|
|
47
49
|
/** Placement of the select list in relation to the input element */
|
|
48
50
|
listPlacement?:
|
|
49
51
|
| "auto"
|
|
@@ -42,6 +42,7 @@ const MultiSelect = /*#__PURE__*/React.forwardRef(({
|
|
|
42
42
|
"data-element": dataElement,
|
|
43
43
|
"data-role": dataRole,
|
|
44
44
|
listPlacement = "bottom-start",
|
|
45
|
+
listMaxHeight,
|
|
45
46
|
flipEnabled = true,
|
|
46
47
|
wrapPillText = true,
|
|
47
48
|
...textboxProps
|
|
@@ -423,6 +424,7 @@ const MultiSelect = /*#__PURE__*/React.forwardRef(({
|
|
|
423
424
|
tableHeader: tableHeader,
|
|
424
425
|
multiColumn: multiColumn,
|
|
425
426
|
listPlacement: listPlacement,
|
|
427
|
+
listMaxHeight: listMaxHeight,
|
|
426
428
|
flipEnabled: flipEnabled,
|
|
427
429
|
loaderDataRole: "multi-select-list-loader",
|
|
428
430
|
multiselectValues: actualValue,
|
|
@@ -501,6 +503,9 @@ MultiSelect.propTypes = { ...formInputPropTypes,
|
|
|
501
503
|
/** Overrides the default tooltip position */
|
|
502
504
|
tooltipPosition: PropTypes.oneOf(["top", "bottom", "left", "right"]),
|
|
503
505
|
|
|
506
|
+
/** Maximum list height - defaults to 180 */
|
|
507
|
+
listMaxHeight: PropTypes.number,
|
|
508
|
+
|
|
504
509
|
/** Placement of the select list in relation to the input element */
|
|
505
510
|
listPlacement: PropTypes.oneOf(["auto", "auto-start", "auto-end", "top", "top-start", "top-end", "bottom", "bottom-start", "bottom-end", "right", "right-start", "right-end", "left", "left-start", "left-end"]),
|
|
506
511
|
|
|
@@ -39,6 +39,8 @@ export interface MultiSelectProps
|
|
|
39
39
|
value?: string[] | Record<string, unknown>[];
|
|
40
40
|
/** Overrides the default tooltip position */
|
|
41
41
|
tooltipPosition?: "top" | "bottom" | "left" | "right";
|
|
42
|
+
/** Maximum list height - defaults to 180 */
|
|
43
|
+
listMaxHeight?: number;
|
|
42
44
|
/** Placement of the select list in relation to the input element */
|
|
43
45
|
listPlacement?:
|
|
44
46
|
| "auto"
|
|
@@ -28,6 +28,7 @@ const fixedPopoverModifiers = [{
|
|
|
28
28
|
}
|
|
29
29
|
}];
|
|
30
30
|
const SelectList = /*#__PURE__*/React.forwardRef(({
|
|
31
|
+
listMaxHeight = 180,
|
|
31
32
|
listActionButton,
|
|
32
33
|
id,
|
|
33
34
|
labelId,
|
|
@@ -337,7 +338,6 @@ const SelectList = /*#__PURE__*/React.forwardRef(({
|
|
|
337
338
|
}
|
|
338
339
|
}, /*#__PURE__*/React.createElement(StyledSelectListContainer, _extends({
|
|
339
340
|
"data-element": "select-list-wrapper",
|
|
340
|
-
height: listHeight,
|
|
341
341
|
placement: placement.current
|
|
342
342
|
}, listProps), /*#__PURE__*/React.createElement(StyledSelectList, {
|
|
343
343
|
id: id,
|
|
@@ -348,7 +348,8 @@ const SelectList = /*#__PURE__*/React.forwardRef(({
|
|
|
348
348
|
ref: listCallbackRef,
|
|
349
349
|
tabIndex: "-1",
|
|
350
350
|
isLoading: isLoading,
|
|
351
|
-
multiColumn: multiColumn
|
|
351
|
+
multiColumn: multiColumn,
|
|
352
|
+
maxHeight: listMaxHeight
|
|
352
353
|
}, selectListContent, isLoading && loader()), listActionButton && /*#__PURE__*/React.createElement(ListActionButton, {
|
|
353
354
|
ref: listActionButtonRef,
|
|
354
355
|
listActionButton: listActionButton,
|
|
@@ -386,6 +387,9 @@ SelectList.propTypes = {
|
|
|
386
387
|
/** True for default text button or a Button Component to be rendered */
|
|
387
388
|
listActionButton: PropTypes.oneOfType([PropTypes.bool, PropTypes.element]),
|
|
388
389
|
|
|
390
|
+
/** Maximum list height - defaults to 180 */
|
|
391
|
+
listMaxHeight: PropTypes.number,
|
|
392
|
+
|
|
389
393
|
/** A callback for when the Action Button is triggered */
|
|
390
394
|
onListAction: PropTypes.func,
|
|
391
395
|
|
|
@@ -30,6 +30,7 @@ const SimpleSelect = /*#__PURE__*/React.forwardRef(({
|
|
|
30
30
|
onBlur,
|
|
31
31
|
disablePortal,
|
|
32
32
|
isLoading,
|
|
33
|
+
listMaxHeight,
|
|
33
34
|
onListScrollBottom,
|
|
34
35
|
tableHeader,
|
|
35
36
|
multiColumn,
|
|
@@ -325,6 +326,7 @@ const SimpleSelect = /*#__PURE__*/React.forwardRef(({
|
|
|
325
326
|
onSelectListClose: onSelectListClose,
|
|
326
327
|
highlightedValue: selectedValue,
|
|
327
328
|
disablePortal: disablePortal,
|
|
329
|
+
listMaxHeight: listMaxHeight,
|
|
328
330
|
isLoading: isLoading,
|
|
329
331
|
onListScrollBottom: onListScrollBottom,
|
|
330
332
|
tableHeader: tableHeader,
|
|
@@ -404,6 +406,9 @@ SimpleSelect.propTypes = {
|
|
|
404
406
|
/** Overrides the default tooltip position */
|
|
405
407
|
tooltipPosition: PropTypes.oneOf(["top", "bottom", "left", "right"]),
|
|
406
408
|
|
|
409
|
+
/** Maximum list height - defaults to 180 */
|
|
410
|
+
listMaxHeight: PropTypes.number,
|
|
411
|
+
|
|
407
412
|
/** Placement of the select list in relation to the input element */
|
|
408
413
|
listPlacement: PropTypes.oneOf(["auto", "auto-start", "auto-end", "top", "top-start", "top-end", "bottom", "bottom-start", "bottom-end", "right", "right-start", "right-end", "left", "left-start", "left-end"]),
|
|
409
414
|
|
|
@@ -37,6 +37,8 @@ export interface SimpleSelectProps
|
|
|
37
37
|
value?: string | Record<string, unknown>;
|
|
38
38
|
/** Overrides the default tooltip position */
|
|
39
39
|
tooltipPosition?: "top" | "bottom" | "left" | "right";
|
|
40
|
+
/** Maximum list height - defaults to 180 */
|
|
41
|
+
listMaxHeight?: number;
|
|
40
42
|
/** Placement of the select list in relation to the input element */
|
|
41
43
|
listPlacement?:
|
|
42
44
|
| "auto"
|