carbon-react 119.10.2 → 119.12.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/README.md +1 -1
- package/esm/__internal__/input/input-presentation.style.js +8 -3
- package/esm/__internal__/input-icon-toggle/input-icon-toggle.style.js +11 -3
- package/esm/__internal__/validations/validation-icon.style.js +7 -1
- package/esm/components/accordion/accordion.style.js +7 -2
- package/esm/components/action-popover/action-popover.style.js +22 -5
- package/esm/components/advanced-color-picker/advanced-color-picker-cell.style.js +13 -1
- package/esm/components/anchor-navigation/anchor-navigation-item/anchor-navigation-item.style.js +8 -1
- package/esm/components/batch-selection/batch-selection.style.js +13 -0
- package/esm/components/button/button.style.js +5 -2
- package/esm/components/button-toggle/button-toggle.style.js +12 -2
- package/esm/components/carbon-provider/carbon-provider.component.d.ts +3 -2
- package/esm/components/carbon-provider/carbon-provider.component.js +7 -3
- package/esm/components/carousel/carousel.style.js +13 -3
- package/esm/components/checkbox/checkbox.style.js +12 -4
- package/esm/components/date/__internal__/date-picker/day-picker.style.js +14 -4
- package/esm/components/date/__internal__/navbar/button.style.js +15 -3
- package/esm/components/drawer/drawer.style.js +15 -3
- package/esm/components/duelling-picklist/picklist/picklist.style.js +1 -1
- package/esm/components/duelling-picklist/picklist-item/picklist-item.style.js +7 -0
- package/esm/components/flat-table/flat-table-row/flat-table-row.style.js +58 -17
- package/esm/components/flat-table/flat-table.style.js +25 -8
- package/esm/components/flat-table/sort/sort.style.js +11 -1
- package/esm/components/heading/heading.style.js +8 -1
- package/esm/components/help/help.style.js +8 -1
- package/esm/components/icon/icon.style.js +3 -1
- package/esm/components/icon-button/icon-button.style.js +9 -3
- package/esm/components/link/link.style.js +16 -1
- package/esm/components/link-preview/link-preview.style.js +12 -2
- package/esm/components/menu/menu-full-screen/menu-full-screen.style.js +9 -2
- package/esm/components/menu/menu-item/menu-item.style.js +156 -131
- package/esm/components/multi-action-button/multi-action-button.style.js +10 -2
- package/esm/components/pager/pager.style.js +2 -3
- package/esm/components/pill/pill.style.js +6 -2
- package/esm/components/pod/pod.component.d.ts +3 -3
- package/esm/components/pod/pod.component.js +4 -4
- package/esm/components/simple-color-picker/simple-color/simple-color.style.js +21 -4
- package/esm/components/split-button/split-button-toggle.style.js +9 -2
- package/esm/components/split-button/split-button.style.js +16 -4
- package/esm/components/switch/switch.style.d.ts +1 -3
- package/esm/components/switch/switch.style.js +7 -2
- package/esm/components/tabs/__internal__/tab-title/tab-title.style.js +11 -5
- package/esm/components/tabs/__internal__/tabs-header/tabs-header.component.js +4 -2
- package/esm/components/tabs/__internal__/tabs-header/tabs-header.style.d.ts +3 -1
- package/esm/components/tabs/__internal__/tabs-header/tabs-header.style.js +14 -2
- package/esm/components/tabs/tabs.style.js +4 -1
- package/esm/components/text-editor/__internal__/toolbar/toolbar-button/toolbar-button.style.js +18 -3
- package/esm/components/text-editor/text-editor.style.js +7 -3
- package/esm/components/tile-select/tile-select.style.js +7 -2
- package/esm/components/typography/typography.component.d.ts +1 -1
- package/esm/components/vertical-menu/vertical-menu.style.js +12 -2
- package/esm/style/design-tokens/generate-css-variables.util.d.ts +1 -1
- package/esm/style/design-tokens/generate-css-variables.util.js +2 -2
- package/esm/style/utils/add-focus-styling.d.ts +2 -0
- package/esm/style/utils/add-focus-styling.js +13 -0
- package/lib/__internal__/input/input-presentation.style.js +8 -3
- package/lib/__internal__/input-icon-toggle/input-icon-toggle.style.js +11 -3
- package/lib/__internal__/validations/validation-icon.style.js +7 -1
- package/lib/components/accordion/accordion.style.js +7 -2
- package/lib/components/action-popover/action-popover.style.js +22 -5
- package/lib/components/advanced-color-picker/advanced-color-picker-cell.style.js +14 -1
- package/lib/components/anchor-navigation/anchor-navigation-item/anchor-navigation-item.style.js +9 -1
- package/lib/components/batch-selection/batch-selection.style.js +13 -0
- package/lib/components/button/button.style.js +5 -2
- package/lib/components/button-toggle/button-toggle.style.js +12 -2
- package/lib/components/carbon-provider/carbon-provider.component.d.ts +3 -2
- package/lib/components/carbon-provider/carbon-provider.component.js +7 -3
- package/lib/components/carousel/carousel.style.js +13 -3
- package/lib/components/checkbox/checkbox.style.js +12 -4
- package/lib/components/date/__internal__/date-picker/day-picker.style.js +15 -4
- package/lib/components/date/__internal__/navbar/button.style.js +15 -3
- package/lib/components/drawer/drawer.style.js +15 -3
- package/lib/components/duelling-picklist/picklist/picklist.style.js +1 -1
- package/lib/components/duelling-picklist/picklist-item/picklist-item.style.js +7 -0
- package/lib/components/flat-table/flat-table-row/flat-table-row.style.js +58 -17
- package/lib/components/flat-table/flat-table.style.js +25 -8
- package/lib/components/flat-table/sort/sort.style.js +11 -1
- package/lib/components/heading/heading.style.js +8 -1
- package/lib/components/help/help.style.js +8 -1
- package/lib/components/icon/icon.style.js +3 -1
- package/lib/components/icon-button/icon-button.style.js +9 -3
- package/lib/components/link/link.style.js +16 -1
- package/lib/components/link-preview/link-preview.style.js +13 -2
- package/lib/components/menu/menu-full-screen/menu-full-screen.style.js +9 -2
- package/lib/components/menu/menu-item/menu-item.style.js +156 -131
- package/lib/components/multi-action-button/multi-action-button.style.js +10 -2
- package/lib/components/pager/pager.style.js +2 -3
- package/lib/components/pill/pill.style.js +6 -2
- package/lib/components/pod/pod.component.d.ts +3 -3
- package/lib/components/pod/pod.component.js +4 -4
- package/lib/components/simple-color-picker/simple-color/simple-color.style.js +21 -4
- package/lib/components/split-button/split-button-toggle.style.js +9 -2
- package/lib/components/split-button/split-button.style.js +18 -4
- package/lib/components/switch/switch.style.d.ts +1 -3
- package/lib/components/switch/switch.style.js +7 -2
- package/lib/components/tabs/__internal__/tab-title/tab-title.style.js +11 -5
- package/lib/components/tabs/__internal__/tabs-header/tabs-header.component.js +3 -1
- package/lib/components/tabs/__internal__/tabs-header/tabs-header.style.d.ts +3 -1
- package/lib/components/tabs/__internal__/tabs-header/tabs-header.style.js +15 -2
- package/lib/components/tabs/tabs.style.js +4 -1
- package/lib/components/text-editor/__internal__/toolbar/toolbar-button/toolbar-button.style.js +18 -3
- package/lib/components/text-editor/text-editor.style.js +7 -3
- package/lib/components/tile-select/tile-select.style.js +7 -2
- package/lib/components/typography/typography.component.d.ts +1 -1
- package/lib/components/vertical-menu/vertical-menu.style.js +12 -2
- package/lib/style/design-tokens/generate-css-variables.util.d.ts +1 -1
- package/lib/style/design-tokens/generate-css-variables.util.js +2 -2
- package/lib/style/utils/add-focus-styling.d.ts +2 -0
- package/lib/style/utils/add-focus-styling.js +20 -0
- package/package.json +4 -2
|
@@ -8,9 +8,15 @@ var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
|
8
8
|
var _styledSystem = require("styled-system");
|
|
9
9
|
var _icon = _interopRequireDefault(require("../icon/icon.style"));
|
|
10
10
|
var _themes = require("../../style/themes");
|
|
11
|
+
var _addFocusStyling = _interopRequireDefault(require("../../style/utils/add-focus-styling"));
|
|
11
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
13
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }
|
|
15
|
+
const oldFocusStyling = `
|
|
16
|
+
background-color: transparent;
|
|
17
|
+
outline: solid 3px var(--colorsSemanticFocus500);
|
|
18
|
+
z-index: 1;
|
|
19
|
+
`;
|
|
14
20
|
const StyledIconButton = _styledComponents.default.button.attrs({
|
|
15
21
|
type: "button"
|
|
16
22
|
})`
|
|
@@ -25,9 +31,9 @@ const StyledIconButton = _styledComponents.default.button.attrs({
|
|
|
25
31
|
border-radius: var(--borderRadius050);
|
|
26
32
|
|
|
27
33
|
&:focus {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
34
|
+
${({
|
|
35
|
+
theme
|
|
36
|
+
}) => `${!theme.focusRedesignOptOut ? (0, _addFocusStyling.default)() : /* istanbul ignore next */oldFocusStyling}`}
|
|
31
37
|
}
|
|
32
38
|
|
|
33
39
|
&:hover {
|
|
@@ -114,7 +114,7 @@ const StyledLink = _styledComponents.default.span`
|
|
|
114
114
|
|
|
115
115
|
&:focus {
|
|
116
116
|
background-color: var(--colorsSemanticFocus250);
|
|
117
|
-
border-radius: var(--
|
|
117
|
+
border-radius: var(--borderRadius025);
|
|
118
118
|
}
|
|
119
119
|
`}
|
|
120
120
|
|
|
@@ -126,6 +126,21 @@ const StyledLink = _styledComponents.default.span`
|
|
|
126
126
|
}
|
|
127
127
|
`}
|
|
128
128
|
}
|
|
129
|
+
|
|
130
|
+
${!disabled && !theme.focusRedesignOptOut && (0, _styledComponents.css)`
|
|
131
|
+
a,
|
|
132
|
+
button {
|
|
133
|
+
outline: none;
|
|
134
|
+
text-decoration: none;
|
|
135
|
+
border-bottom-left-radius: var(--borderRadius000);
|
|
136
|
+
border-bottom-right-radius: var(--borderRadius000);
|
|
137
|
+
}
|
|
138
|
+
&:focus-within {
|
|
139
|
+
box-shadow: 0 4px 0 0 var(--colorsUtilityYin090);
|
|
140
|
+
border-bottom-left-radius: var(--borderRadius025);
|
|
141
|
+
border-bottom-right-radius: var(--borderRadius025);
|
|
142
|
+
}
|
|
143
|
+
`}
|
|
129
144
|
`}
|
|
130
145
|
|
|
131
146
|
a,
|
|
@@ -7,8 +7,15 @@ exports.StyledUrl = exports.StyledTitle = exports.StyledPreviewWrapper = exports
|
|
|
7
7
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
8
8
|
var _preview = require("../preview/preview.style");
|
|
9
9
|
var _previewPlaceholder = require("../preview/__internal__/preview-placeholder.style");
|
|
10
|
+
var _addFocusStyling = _interopRequireDefault(require("../../style/utils/add-focus-styling"));
|
|
11
|
+
var _base = _interopRequireDefault(require("../../style/themes/base"));
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
13
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }
|
|
15
|
+
const oldFocusStyling = `
|
|
16
|
+
outline: solid 2px var(--colorsSemanticFocus500);
|
|
17
|
+
outline-offset: -1px;
|
|
18
|
+
`;
|
|
12
19
|
const StyledLinkPreview = _styledComponents.default.a`
|
|
13
20
|
display: flex;
|
|
14
21
|
margin: 8px;
|
|
@@ -25,8 +32,9 @@ const StyledLinkPreview = _styledComponents.default.a`
|
|
|
25
32
|
|
|
26
33
|
${as !== "div" && (0, _styledComponents.css)`
|
|
27
34
|
:focus {
|
|
28
|
-
|
|
29
|
-
|
|
35
|
+
${({
|
|
36
|
+
theme
|
|
37
|
+
}) => `${!theme.focusRedesignOptOut ? (0, _addFocusStyling.default)() : /* istanbul ignore next */oldFocusStyling}`}
|
|
30
38
|
}
|
|
31
39
|
|
|
32
40
|
:hover {
|
|
@@ -37,6 +45,9 @@ const StyledLinkPreview = _styledComponents.default.a`
|
|
|
37
45
|
`}
|
|
38
46
|
`;
|
|
39
47
|
exports.StyledLinkPreview = StyledLinkPreview;
|
|
48
|
+
StyledLinkPreview.defaultProps = {
|
|
49
|
+
theme: _base.default
|
|
50
|
+
};
|
|
40
51
|
const StyledCloseIconWrapper = _styledComponents.default.div`
|
|
41
52
|
padding: 16px;
|
|
42
53
|
`;
|
|
@@ -12,9 +12,14 @@ var _search = _interopRequireDefault(require("../../search/search.style"));
|
|
|
12
12
|
var _icon = _interopRequireDefault(require("../../icon/icon.style"));
|
|
13
13
|
var _button = _interopRequireDefault(require("../../button/button.style"));
|
|
14
14
|
var _menu = _interopRequireDefault(require("../menu.config"));
|
|
15
|
+
var _addFocusStyling = _interopRequireDefault(require("../../../style/utils/add-focus-styling"));
|
|
15
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
17
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }
|
|
19
|
+
const oldFocusStyling = `
|
|
20
|
+
outline: solid 3px var(--colorsSemanticFocus500);
|
|
21
|
+
box-shadow: none;
|
|
22
|
+
`;
|
|
18
23
|
const StyledMenuFullscreen = _styledComponents.default.div`
|
|
19
24
|
position: fixed;
|
|
20
25
|
top: 0;
|
|
@@ -72,8 +77,10 @@ const StyledMenuFullscreen = _styledComponents.default.div`
|
|
|
72
77
|
padding-bottom: 0;
|
|
73
78
|
|
|
74
79
|
&:focus {
|
|
75
|
-
|
|
76
|
-
|
|
80
|
+
border-bottom-right-radius: var(--borderRadius050);
|
|
81
|
+
border-top-right-radius: var(--borderRadius050);
|
|
82
|
+
|
|
83
|
+
${!theme.focusRedesignOptOut ? (0, _addFocusStyling.default)() : /* istanbul ignore next */oldFocusStyling}
|
|
77
84
|
}
|
|
78
85
|
}
|
|
79
86
|
}
|
|
@@ -11,10 +11,22 @@ var _icon = _interopRequireDefault(require("../../icon/icon.style"));
|
|
|
11
11
|
var _iconButton = _interopRequireDefault(require("../../icon-button/icon-button.style"));
|
|
12
12
|
var _menu = _interopRequireDefault(require("../menu.config"));
|
|
13
13
|
var _link2 = _interopRequireDefault(require("../../link"));
|
|
14
|
+
var _addFocusStyling = _interopRequireDefault(require("../../../style/utils/add-focus-styling"));
|
|
14
15
|
var _themes = require("../../../style/themes");
|
|
15
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
17
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }
|
|
19
|
+
const overrideLinkFocusStyling = fullScreenView => `
|
|
20
|
+
&:focus-within {
|
|
21
|
+
box-shadow: none;
|
|
22
|
+
a {
|
|
23
|
+
background-color: ${fullScreenView ? "var(--colorsComponentsMenuAutumnStandard600)" : "transparent"};
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
`;
|
|
27
|
+
const oldFocusStyling = `
|
|
28
|
+
box-shadow: inset 0 0 0 var(--borderWidth300) var(--colorsSemanticFocus500);
|
|
29
|
+
`;
|
|
18
30
|
const StyledMenuItemWrapper = _styledComponents.default.a.attrs({
|
|
19
31
|
as: _link2.default
|
|
20
32
|
})`
|
|
@@ -41,65 +53,80 @@ const StyledMenuItemWrapper = _styledComponents.default.a.attrs({
|
|
|
41
53
|
font-weight: 700;
|
|
42
54
|
height: 40px;
|
|
43
55
|
position: relative;
|
|
56
|
+
|
|
57
|
+
&& {
|
|
58
|
+
:focus-within > a, > button {
|
|
59
|
+
background-color: transparent;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
44
63
|
a,
|
|
45
64
|
button {
|
|
46
65
|
cursor: pointer;
|
|
47
66
|
}
|
|
48
|
-
${!overrideColor && (0, _styledComponents.css)`
|
|
49
|
-
background-color: ${_menu.default[menuType].background};
|
|
50
|
-
`}
|
|
51
67
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
68
|
+
${overrideLinkFocusStyling(inFullscreenView)}
|
|
69
|
+
a:focus,
|
|
70
|
+
button:focus {
|
|
71
|
+
${({
|
|
72
|
+
theme
|
|
73
|
+
}) => `${!theme.focusRedesignOptOut ? (0, _addFocusStyling.default)(true) : /* istanbul ignore next */oldFocusStyling}`}
|
|
55
74
|
}
|
|
56
|
-
|
|
75
|
+
}
|
|
57
76
|
|
|
58
|
-
${!
|
|
59
|
-
|
|
77
|
+
${!overrideColor && (0, _styledComponents.css)`
|
|
78
|
+
background-color: ${_menu.default[menuType].background};
|
|
79
|
+
`}
|
|
60
80
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
box-shadow: inset 0 0 0 var(--borderWidth300)
|
|
65
|
-
var(--colorsSemanticFocus500);
|
|
66
|
-
background-color: ${_menu.default[menuType].background};
|
|
67
|
-
color: ${_menu.default[menuType].color};
|
|
68
|
-
z-index: 1;
|
|
69
|
-
position: relative;
|
|
81
|
+
${overrideColor && (0, _styledComponents.css)`
|
|
82
|
+
&&&& {
|
|
83
|
+
background-color: ${variant === "alternate" ? _menu.default[menuType].alternate : _menu.default[menuType].submenuItemBackground};
|
|
70
84
|
}
|
|
71
|
-
}
|
|
85
|
+
`}
|
|
72
86
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
87
|
+
${!inFullscreenView && (0, _styledComponents.css)`
|
|
88
|
+
max-width: inherit;
|
|
89
|
+
|
|
90
|
+
&& {
|
|
91
|
+
a:focus,
|
|
92
|
+
button:focus {
|
|
93
|
+
background-color: ${_menu.default[menuType].background};
|
|
94
|
+
color: ${_menu.default[menuType].color};
|
|
95
|
+
z-index: 1;
|
|
96
|
+
position: relative;
|
|
97
|
+
}
|
|
84
98
|
}
|
|
85
99
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
100
|
+
&&& {
|
|
101
|
+
a,
|
|
102
|
+
button {
|
|
103
|
+
${maxWidth && (0, _styledComponents.css)`
|
|
104
|
+
box-sizing: border-box;
|
|
105
|
+
max-width: inherit;
|
|
106
|
+
text-overflow: ellipsis;
|
|
107
|
+
overflow: hidden;
|
|
108
|
+
white-space: nowrap;
|
|
109
|
+
vertical-align: bottom;
|
|
110
|
+
`}
|
|
111
|
+
}
|
|
91
112
|
|
|
92
|
-
|
|
113
|
+
a:hover,
|
|
114
|
+
button:hover {
|
|
115
|
+
${!asDiv && (0, _styledComponents.css)`
|
|
116
|
+
background-color: var(--colorsComponentsMenuAutumnStandard600);
|
|
93
117
|
color: var(--colorsComponentsMenuYang100);
|
|
94
|
-
}
|
|
95
|
-
`}
|
|
96
118
|
|
|
97
|
-
|
|
98
|
-
|
|
119
|
+
[data-component="icon"] {
|
|
120
|
+
color: var(--colorsComponentsMenuYang100);
|
|
121
|
+
}
|
|
122
|
+
`}
|
|
123
|
+
|
|
124
|
+
::before {
|
|
125
|
+
border-top-color: var(--colorsComponentsMenuYang100);
|
|
126
|
+
}
|
|
99
127
|
}
|
|
100
128
|
}
|
|
101
|
-
}
|
|
102
|
-
`}
|
|
129
|
+
`}
|
|
103
130
|
|
|
104
131
|
${asPassiveItem ? `
|
|
105
132
|
${_iconButton.default} {
|
|
@@ -150,120 +177,120 @@ const StyledMenuItemWrapper = _styledComponents.default.a.attrs({
|
|
|
150
177
|
}
|
|
151
178
|
|
|
152
179
|
${selected && (0, _styledComponents.css)`
|
|
153
|
-
background-color: ${_menu.default[menuType].selected};
|
|
154
|
-
|
|
155
|
-
a:focus,
|
|
156
|
-
button:focus {
|
|
157
180
|
background-color: ${_menu.default[menuType].selected};
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
a:hover,
|
|
161
|
-
button:hover {
|
|
162
|
-
background-color: var(--colorsComponentsMenuAutumnStandard600);
|
|
163
|
-
}
|
|
164
|
-
`}
|
|
165
181
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
&&& a:focus,
|
|
172
|
-
&&& button:focus {
|
|
173
|
-
background-color: ${_menu.default[menuType].alternate};
|
|
174
|
-
}
|
|
182
|
+
a:focus,
|
|
183
|
+
button:focus {
|
|
184
|
+
background-color: ${_menu.default[menuType].selected};
|
|
185
|
+
}
|
|
175
186
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
background-color: ${_menu.default[menuType].alternateHover};
|
|
187
|
+
a:hover,
|
|
188
|
+
button:hover {
|
|
189
|
+
background-color: var(--colorsComponentsMenuAutumnStandard600);
|
|
180
190
|
}
|
|
181
191
|
`}
|
|
182
|
-
`}
|
|
183
|
-
|
|
184
|
-
${isOpen && (0, _styledComponents.css)`
|
|
185
|
-
a,
|
|
186
|
-
button {
|
|
187
|
-
background-color: ${_menu.default[menuType].submenuItemBackground};
|
|
188
|
-
color: ${_menu.default[menuType].color};
|
|
189
|
-
}
|
|
190
|
-
`}
|
|
191
|
-
|
|
192
|
-
${hasSubmenu && (0, _styledComponents.css)`
|
|
193
|
-
background-color: ${_menu.default[menuType].submenuBackground};
|
|
194
192
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
193
|
+
${variant === "alternate" && !inFullscreenView && (0, _styledComponents.css)`
|
|
194
|
+
&&& {
|
|
195
|
+
background-color: ${_menu.default[menuType].alternate};
|
|
196
|
+
}
|
|
199
197
|
|
|
200
|
-
|
|
201
|
-
|
|
198
|
+
&&& a:focus,
|
|
199
|
+
&&& button:focus {
|
|
200
|
+
background-color: ${_menu.default[menuType].alternate};
|
|
202
201
|
}
|
|
203
202
|
|
|
204
|
-
${
|
|
205
|
-
|
|
203
|
+
${!hasInput && (0, _styledComponents.css)`
|
|
204
|
+
&&& a:hover,
|
|
205
|
+
&&& button:hover {
|
|
206
|
+
background-color: ${_menu.default[menuType].alternateHover};
|
|
207
|
+
}
|
|
206
208
|
`}
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
a:hover,
|
|
210
|
-
button:hover {
|
|
211
|
-
background-color: ${_menu.default[menuType].submenuOpenedBackground};
|
|
212
|
-
color: var(--colorsComponentsMenuYang100);
|
|
209
|
+
`}
|
|
213
210
|
|
|
214
|
-
|
|
215
|
-
|
|
211
|
+
${isOpen && (0, _styledComponents.css)`
|
|
212
|
+
a,
|
|
213
|
+
button {
|
|
216
214
|
background-color: ${_menu.default[menuType].submenuItemBackground};
|
|
217
215
|
color: ${_menu.default[menuType].color};
|
|
218
|
-
`}
|
|
219
|
-
|
|
220
|
-
[data-component="icon"] {
|
|
221
|
-
color: ${_menu.default[menuType].color};
|
|
222
216
|
}
|
|
223
|
-
}
|
|
217
|
+
`}
|
|
224
218
|
|
|
225
|
-
|
|
226
|
-
background-color: ${_menu.default[menuType].
|
|
219
|
+
${hasSubmenu && (0, _styledComponents.css)`
|
|
220
|
+
background-color: ${_menu.default[menuType].submenuBackground};
|
|
227
221
|
|
|
228
222
|
a:focus,
|
|
229
223
|
button:focus {
|
|
230
|
-
background-color: ${_menu.default[menuType].
|
|
224
|
+
background-color: ${_menu.default[menuType].submenuBackground};
|
|
225
|
+
color: ${_menu.default[menuType].color};
|
|
226
|
+
|
|
227
|
+
[data-component="icon"] {
|
|
228
|
+
color: ${_menu.default[menuType].color};
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
${clickToOpen && isOpen && (0, _styledComponents.css)`
|
|
232
|
+
background-color: ${_menu.default[menuType].submenuOpenedBackground};
|
|
233
|
+
`}
|
|
231
234
|
}
|
|
232
235
|
|
|
233
236
|
a:hover,
|
|
234
237
|
button:hover {
|
|
235
|
-
background-color:
|
|
238
|
+
background-color: ${_menu.default[menuType].submenuOpenedBackground};
|
|
236
239
|
color: var(--colorsComponentsMenuYang100);
|
|
237
|
-
}
|
|
238
|
-
`}
|
|
239
240
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
241
|
+
${!(href || clickToOpen) && (0, _styledComponents.css)`
|
|
242
|
+
cursor: default;
|
|
243
|
+
background-color: ${_menu.default[menuType].submenuItemBackground};
|
|
244
|
+
color: ${_menu.default[menuType].color};
|
|
245
|
+
`}
|
|
245
246
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
margin-top: -2px;
|
|
250
|
-
pointer-events: none;
|
|
251
|
-
position: absolute;
|
|
252
|
-
right: 16px;
|
|
253
|
-
top: 50%;
|
|
254
|
-
z-index: 2;
|
|
255
|
-
content: "";
|
|
256
|
-
width: 0;
|
|
257
|
-
height: 0;
|
|
258
|
-
border-width: 5px 4px 4px;
|
|
259
|
-
border-style: solid;
|
|
260
|
-
border-top-color: initial;
|
|
261
|
-
border-right-color: transparent;
|
|
262
|
-
border-bottom-color: transparent;
|
|
263
|
-
border-left-color: transparent;
|
|
247
|
+
[data-component="icon"] {
|
|
248
|
+
color: ${_menu.default[menuType].color};
|
|
249
|
+
}
|
|
264
250
|
}
|
|
251
|
+
|
|
252
|
+
${selected && (0, _styledComponents.css)`
|
|
253
|
+
background-color: ${_menu.default[menuType].submenuSelected};
|
|
254
|
+
|
|
255
|
+
a:focus,
|
|
256
|
+
button:focus {
|
|
257
|
+
background-color: ${_menu.default[menuType].submenuSelected};
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
a:hover,
|
|
261
|
+
button:hover {
|
|
262
|
+
background-color: var(--colorsComponentsMenuAutumnStandard600);
|
|
263
|
+
color: var(--colorsComponentsMenuYang100);
|
|
264
|
+
}
|
|
265
|
+
`}
|
|
266
|
+
|
|
267
|
+
${showDropdownArrow && (0, _styledComponents.css)`
|
|
268
|
+
> a,
|
|
269
|
+
> button:not(${_iconButton.default}) {
|
|
270
|
+
padding-right: 32px;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
a::before,
|
|
274
|
+
button::before {
|
|
275
|
+
display: block;
|
|
276
|
+
margin-top: -2px;
|
|
277
|
+
pointer-events: none;
|
|
278
|
+
position: absolute;
|
|
279
|
+
right: 16px;
|
|
280
|
+
top: 50%;
|
|
281
|
+
z-index: 2;
|
|
282
|
+
content: "";
|
|
283
|
+
width: 0;
|
|
284
|
+
height: 0;
|
|
285
|
+
border-width: 5px 4px 4px;
|
|
286
|
+
border-style: solid;
|
|
287
|
+
border-top-color: initial;
|
|
288
|
+
border-right-color: transparent;
|
|
289
|
+
border-bottom-color: transparent;
|
|
290
|
+
border-left-color: transparent;
|
|
291
|
+
}
|
|
292
|
+
`}
|
|
265
293
|
`}
|
|
266
|
-
`}
|
|
267
294
|
|
|
268
295
|
${inFullscreenView && (0, _styledComponents.css)`
|
|
269
296
|
${asDiv && (0, _styledComponents.css)`
|
|
@@ -303,8 +330,6 @@ const StyledMenuItemWrapper = _styledComponents.default.a.attrs({
|
|
|
303
330
|
|
|
304
331
|
a:focus,
|
|
305
332
|
button:focus {
|
|
306
|
-
box-shadow: inset 0 0 0 var(--borderWidth300)
|
|
307
|
-
var(--colorsSemanticFocus500);
|
|
308
333
|
z-index: 1;
|
|
309
334
|
position: relative;
|
|
310
335
|
}
|
|
@@ -42,7 +42,10 @@ const StyledMultiActionButton = _styledComponents.default.div`
|
|
|
42
42
|
|
|
43
43
|
&:focus {
|
|
44
44
|
background-color: var(--colorsActionMajor700);
|
|
45
|
-
border: 3px solid
|
|
45
|
+
border: 3px solid
|
|
46
|
+
${({
|
|
47
|
+
theme
|
|
48
|
+
}) => !theme.focusRedesignOptOut ? "var(--colorsActionMajor700)" : /* istanbul ignore next */"var(--colorsSemanticFocus500)"};
|
|
46
49
|
outline: none;
|
|
47
50
|
margin: 0 -1px;
|
|
48
51
|
|
|
@@ -64,7 +67,12 @@ const StyledMultiActionButton = _styledComponents.default.div`
|
|
|
64
67
|
}
|
|
65
68
|
|
|
66
69
|
&:focus {
|
|
67
|
-
|
|
70
|
+
${({
|
|
71
|
+
theme
|
|
72
|
+
}) => /* istanbul ignore next */
|
|
73
|
+
theme.focusRedesignOptOut && (0, _styledComponents.css)`
|
|
74
|
+
border-color: var(--colorsSemanticFocus500);
|
|
75
|
+
`}
|
|
68
76
|
margin: 0 -1px;
|
|
69
77
|
}
|
|
70
78
|
`}
|
|
@@ -119,9 +119,8 @@ const StyledPagerNavLabel = _styledComponents.default.label`
|
|
|
119
119
|
`;
|
|
120
120
|
exports.StyledPagerNavLabel = StyledPagerNavLabel;
|
|
121
121
|
const StyledPagerLink = (0, _styledComponents.default)(_link.default)`
|
|
122
|
-
|
|
123
|
-
margin-
|
|
124
|
-
margin-right: 7px;
|
|
122
|
+
margin-left: 17px;
|
|
123
|
+
margin-right: 17px;
|
|
125
124
|
|
|
126
125
|
${({
|
|
127
126
|
hideDisabledButtons
|
|
@@ -168,8 +168,12 @@ const StyledPill = _styledComponents.default.span`
|
|
|
168
168
|
line-height: 16px;
|
|
169
169
|
|
|
170
170
|
&:focus {
|
|
171
|
-
|
|
172
|
-
|
|
171
|
+
${theme.focusRedesignOptOut && /* istanbul ignore next */
|
|
172
|
+
(0, _styledComponents.css)`
|
|
173
|
+
outline: none;
|
|
174
|
+
box-shadow: 0 0 0 3px var(--colorsSemanticFocus500);
|
|
175
|
+
`}
|
|
176
|
+
|
|
173
177
|
background-color: ${buttonFocusColor};
|
|
174
178
|
${!theme.roundedCornersOptOut && (0, _styledComponents.css)`
|
|
175
179
|
border-radius: var(--borderRadius000) var(--borderRadius025)
|
|
@@ -18,10 +18,10 @@ export interface PodProps extends MarginProps {
|
|
|
18
18
|
size?: PodSize;
|
|
19
19
|
/** Prop to apply a theme to the Pod */
|
|
20
20
|
variant?: PodVariant;
|
|
21
|
-
/** Title for the pod
|
|
22
|
-
title?:
|
|
21
|
+
/** Title for the pod */
|
|
22
|
+
title?: React.ReactNode;
|
|
23
23
|
/** Optional subtitle for the pod */
|
|
24
|
-
subtitle?:
|
|
24
|
+
subtitle?: React.ReactNode;
|
|
25
25
|
/** A component to render as a Pod footer */
|
|
26
26
|
footer?: string | React.ReactNode;
|
|
27
27
|
/** Supplies an edit action to the pod */
|
|
@@ -102,11 +102,11 @@ const Pod = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
102
102
|
alignTitle: alignTitle,
|
|
103
103
|
internalEditButton: internalEditButton,
|
|
104
104
|
size: size
|
|
105
|
-
}, /*#__PURE__*/_react.default.createElement(_pod.StyledTitle, {
|
|
105
|
+
}, typeof title === "string" ? /*#__PURE__*/_react.default.createElement(_pod.StyledTitle, {
|
|
106
106
|
"data-element": "title"
|
|
107
|
-
}, title), subtitle
|
|
107
|
+
}, title) : title, typeof subtitle === "string" ? /*#__PURE__*/_react.default.createElement(_pod.StyledSubtitle, {
|
|
108
108
|
"data-element": "subtitle"
|
|
109
|
-
}, subtitle)), children), footer && /*#__PURE__*/_react.default.createElement(_pod.StyledFooter, {
|
|
109
|
+
}, subtitle) : subtitle), children), footer && /*#__PURE__*/_react.default.createElement(_pod.StyledFooter, {
|
|
110
110
|
"data-element": "footer",
|
|
111
111
|
size: size,
|
|
112
112
|
variant: variant,
|
|
@@ -333,7 +333,7 @@ Pod.propTypes = {
|
|
|
333
333
|
"onUndo": _propTypes.default.func,
|
|
334
334
|
"size": _propTypes.default.oneOf(["extra-large", "extra-small", "large", "medium", "small"]),
|
|
335
335
|
"softDelete": _propTypes.default.bool,
|
|
336
|
-
"subtitle": _propTypes.default.
|
|
336
|
+
"subtitle": _propTypes.default.node,
|
|
337
337
|
"title": _propTypes.default.node,
|
|
338
338
|
"triggerEditOnContent": _propTypes.default.bool,
|
|
339
339
|
"variant": _propTypes.default.oneOf(["primary", "secondary", "tertiary", "tile", "transparent"])
|
|
@@ -9,6 +9,7 @@ var _input = require("../../../__internal__/input");
|
|
|
9
9
|
var _checkerBoard = _interopRequireDefault(require("./checker-board.svg"));
|
|
10
10
|
var _icon = _interopRequireDefault(require("../../icon"));
|
|
11
11
|
var _getRgbValues = _interopRequireDefault(require("../../../style/utils/get-rgb-values"));
|
|
12
|
+
var _addFocusStyling = _interopRequireDefault(require("../../../style/utils/add-focus-styling"));
|
|
12
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
14
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
15
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }
|
|
@@ -23,6 +24,10 @@ const StyledSimpleColor = _styledComponents.default.div`
|
|
|
23
24
|
}
|
|
24
25
|
`;
|
|
25
26
|
exports.StyledSimpleColor = StyledSimpleColor;
|
|
27
|
+
const oldFocusStyling = `
|
|
28
|
+
box-shadow: inset 0px 0px 0px var(--borderWidth200) var(--colorsUtilityYang100);
|
|
29
|
+
border: 2px solid var(--colorsSemanticFocus500);
|
|
30
|
+
`;
|
|
26
31
|
const StyledColorSampleBox = _styledComponents.default.div`
|
|
27
32
|
height: 100%;
|
|
28
33
|
width: 100%;
|
|
@@ -30,7 +35,10 @@ const StyledColorSampleBox = _styledComponents.default.div`
|
|
|
30
35
|
display: flex;
|
|
31
36
|
align-items: center;
|
|
32
37
|
justify-content: center;
|
|
33
|
-
|
|
38
|
+
${({
|
|
39
|
+
theme
|
|
40
|
+
}) => /* istanbul ignore next */
|
|
41
|
+
theme.focusRedesignOptOut && "border: 2px solid transparent;"}
|
|
34
42
|
|
|
35
43
|
${({
|
|
36
44
|
color
|
|
@@ -64,9 +72,18 @@ const StyledSimpleColorInput = (0, _styledComponents.default)(_input.Input)`
|
|
|
64
72
|
}
|
|
65
73
|
|
|
66
74
|
&:focus + ${StyledColorSampleBox} {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
75
|
+
${({
|
|
76
|
+
theme
|
|
77
|
+
}) => (0, _styledComponents.css)`
|
|
78
|
+
${theme.focusRedesignOptOut && /* istanbul ignore next */
|
|
79
|
+
`
|
|
80
|
+
${oldFocusStyling}
|
|
81
|
+
`}
|
|
82
|
+
|
|
83
|
+
${!theme.focusRedesignOptOut && `
|
|
84
|
+
${(0, _addFocusStyling.default)(true)}
|
|
85
|
+
`}
|
|
86
|
+
`}
|
|
70
87
|
}
|
|
71
88
|
`;
|
|
72
89
|
exports.StyledSimpleColorInput = StyledSimpleColorInput;
|