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.
Files changed (110) hide show
  1. package/README.md +1 -1
  2. package/esm/__internal__/input/input-presentation.style.js +8 -3
  3. package/esm/__internal__/input-icon-toggle/input-icon-toggle.style.js +11 -3
  4. package/esm/__internal__/validations/validation-icon.style.js +7 -1
  5. package/esm/components/accordion/accordion.style.js +7 -2
  6. package/esm/components/action-popover/action-popover.style.js +22 -5
  7. package/esm/components/advanced-color-picker/advanced-color-picker-cell.style.js +13 -1
  8. package/esm/components/anchor-navigation/anchor-navigation-item/anchor-navigation-item.style.js +8 -1
  9. package/esm/components/batch-selection/batch-selection.style.js +13 -0
  10. package/esm/components/button/button.style.js +5 -2
  11. package/esm/components/button-toggle/button-toggle.style.js +12 -2
  12. package/esm/components/carbon-provider/carbon-provider.component.d.ts +3 -2
  13. package/esm/components/carbon-provider/carbon-provider.component.js +7 -3
  14. package/esm/components/carousel/carousel.style.js +13 -3
  15. package/esm/components/checkbox/checkbox.style.js +12 -4
  16. package/esm/components/date/__internal__/date-picker/day-picker.style.js +14 -4
  17. package/esm/components/date/__internal__/navbar/button.style.js +15 -3
  18. package/esm/components/drawer/drawer.style.js +15 -3
  19. package/esm/components/duelling-picklist/picklist/picklist.style.js +1 -1
  20. package/esm/components/duelling-picklist/picklist-item/picklist-item.style.js +7 -0
  21. package/esm/components/flat-table/flat-table-row/flat-table-row.style.js +58 -17
  22. package/esm/components/flat-table/flat-table.style.js +25 -8
  23. package/esm/components/flat-table/sort/sort.style.js +11 -1
  24. package/esm/components/heading/heading.style.js +8 -1
  25. package/esm/components/help/help.style.js +8 -1
  26. package/esm/components/icon/icon.style.js +3 -1
  27. package/esm/components/icon-button/icon-button.style.js +9 -3
  28. package/esm/components/link/link.style.js +16 -1
  29. package/esm/components/link-preview/link-preview.style.js +12 -2
  30. package/esm/components/menu/menu-full-screen/menu-full-screen.style.js +9 -2
  31. package/esm/components/menu/menu-item/menu-item.style.js +156 -131
  32. package/esm/components/multi-action-button/multi-action-button.style.js +10 -2
  33. package/esm/components/pager/pager.style.js +2 -3
  34. package/esm/components/pill/pill.style.js +6 -2
  35. package/esm/components/pod/pod.component.d.ts +3 -3
  36. package/esm/components/pod/pod.component.js +4 -4
  37. package/esm/components/simple-color-picker/simple-color/simple-color.style.js +21 -4
  38. package/esm/components/split-button/split-button-toggle.style.js +9 -2
  39. package/esm/components/split-button/split-button.style.js +16 -4
  40. package/esm/components/switch/switch.style.d.ts +1 -3
  41. package/esm/components/switch/switch.style.js +7 -2
  42. package/esm/components/tabs/__internal__/tab-title/tab-title.style.js +11 -5
  43. package/esm/components/tabs/__internal__/tabs-header/tabs-header.component.js +4 -2
  44. package/esm/components/tabs/__internal__/tabs-header/tabs-header.style.d.ts +3 -1
  45. package/esm/components/tabs/__internal__/tabs-header/tabs-header.style.js +14 -2
  46. package/esm/components/tabs/tabs.style.js +4 -1
  47. package/esm/components/text-editor/__internal__/toolbar/toolbar-button/toolbar-button.style.js +18 -3
  48. package/esm/components/text-editor/text-editor.style.js +7 -3
  49. package/esm/components/tile-select/tile-select.style.js +7 -2
  50. package/esm/components/typography/typography.component.d.ts +1 -1
  51. package/esm/components/vertical-menu/vertical-menu.style.js +12 -2
  52. package/esm/style/design-tokens/generate-css-variables.util.d.ts +1 -1
  53. package/esm/style/design-tokens/generate-css-variables.util.js +2 -2
  54. package/esm/style/utils/add-focus-styling.d.ts +2 -0
  55. package/esm/style/utils/add-focus-styling.js +13 -0
  56. package/lib/__internal__/input/input-presentation.style.js +8 -3
  57. package/lib/__internal__/input-icon-toggle/input-icon-toggle.style.js +11 -3
  58. package/lib/__internal__/validations/validation-icon.style.js +7 -1
  59. package/lib/components/accordion/accordion.style.js +7 -2
  60. package/lib/components/action-popover/action-popover.style.js +22 -5
  61. package/lib/components/advanced-color-picker/advanced-color-picker-cell.style.js +14 -1
  62. package/lib/components/anchor-navigation/anchor-navigation-item/anchor-navigation-item.style.js +9 -1
  63. package/lib/components/batch-selection/batch-selection.style.js +13 -0
  64. package/lib/components/button/button.style.js +5 -2
  65. package/lib/components/button-toggle/button-toggle.style.js +12 -2
  66. package/lib/components/carbon-provider/carbon-provider.component.d.ts +3 -2
  67. package/lib/components/carbon-provider/carbon-provider.component.js +7 -3
  68. package/lib/components/carousel/carousel.style.js +13 -3
  69. package/lib/components/checkbox/checkbox.style.js +12 -4
  70. package/lib/components/date/__internal__/date-picker/day-picker.style.js +15 -4
  71. package/lib/components/date/__internal__/navbar/button.style.js +15 -3
  72. package/lib/components/drawer/drawer.style.js +15 -3
  73. package/lib/components/duelling-picklist/picklist/picklist.style.js +1 -1
  74. package/lib/components/duelling-picklist/picklist-item/picklist-item.style.js +7 -0
  75. package/lib/components/flat-table/flat-table-row/flat-table-row.style.js +58 -17
  76. package/lib/components/flat-table/flat-table.style.js +25 -8
  77. package/lib/components/flat-table/sort/sort.style.js +11 -1
  78. package/lib/components/heading/heading.style.js +8 -1
  79. package/lib/components/help/help.style.js +8 -1
  80. package/lib/components/icon/icon.style.js +3 -1
  81. package/lib/components/icon-button/icon-button.style.js +9 -3
  82. package/lib/components/link/link.style.js +16 -1
  83. package/lib/components/link-preview/link-preview.style.js +13 -2
  84. package/lib/components/menu/menu-full-screen/menu-full-screen.style.js +9 -2
  85. package/lib/components/menu/menu-item/menu-item.style.js +156 -131
  86. package/lib/components/multi-action-button/multi-action-button.style.js +10 -2
  87. package/lib/components/pager/pager.style.js +2 -3
  88. package/lib/components/pill/pill.style.js +6 -2
  89. package/lib/components/pod/pod.component.d.ts +3 -3
  90. package/lib/components/pod/pod.component.js +4 -4
  91. package/lib/components/simple-color-picker/simple-color/simple-color.style.js +21 -4
  92. package/lib/components/split-button/split-button-toggle.style.js +9 -2
  93. package/lib/components/split-button/split-button.style.js +18 -4
  94. package/lib/components/switch/switch.style.d.ts +1 -3
  95. package/lib/components/switch/switch.style.js +7 -2
  96. package/lib/components/tabs/__internal__/tab-title/tab-title.style.js +11 -5
  97. package/lib/components/tabs/__internal__/tabs-header/tabs-header.component.js +3 -1
  98. package/lib/components/tabs/__internal__/tabs-header/tabs-header.style.d.ts +3 -1
  99. package/lib/components/tabs/__internal__/tabs-header/tabs-header.style.js +15 -2
  100. package/lib/components/tabs/tabs.style.js +4 -1
  101. package/lib/components/text-editor/__internal__/toolbar/toolbar-button/toolbar-button.style.js +18 -3
  102. package/lib/components/text-editor/text-editor.style.js +7 -3
  103. package/lib/components/tile-select/tile-select.style.js +7 -2
  104. package/lib/components/typography/typography.component.d.ts +1 -1
  105. package/lib/components/vertical-menu/vertical-menu.style.js +12 -2
  106. package/lib/style/design-tokens/generate-css-variables.util.d.ts +1 -1
  107. package/lib/style/design-tokens/generate-css-variables.util.js +2 -2
  108. package/lib/style/utils/add-focus-styling.d.ts +2 -0
  109. package/lib/style/utils/add-focus-styling.js +20 -0
  110. 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
- background-color: transparent;
29
- outline: solid 3px var(--colorsSemanticFocus500);
30
- z-index: 1;
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(--borderRadius050);
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
- outline: 2px solid var(--colorsSemanticFocus500);
29
- outline-offset: -1px;
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
- outline: solid 3px var(--colorsSemanticFocus500);
76
- box-shadow: none;
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
- ${overrideColor && (0, _styledComponents.css)`
53
- &&&& {
54
- background-color: ${variant === "alternate" ? _menu.default[menuType].alternate : _menu.default[menuType].submenuItemBackground};
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
- ${!inFullscreenView && (0, _styledComponents.css)`
59
- max-width: inherit;
77
+ ${!overrideColor && (0, _styledComponents.css)`
78
+ background-color: ${_menu.default[menuType].background};
79
+ `}
60
80
 
61
- && {
62
- a:focus,
63
- button:focus {
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
- a,
75
- button {
76
- ${maxWidth && (0, _styledComponents.css)`
77
- box-sizing: border-box;
78
- max-width: inherit;
79
- text-overflow: ellipsis;
80
- overflow: hidden;
81
- white-space: nowrap;
82
- vertical-align: bottom;
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
- a:hover,
87
- button:hover {
88
- ${!asDiv && (0, _styledComponents.css)`
89
- background-color: var(--colorsComponentsMenuAutumnStandard600);
90
- color: var(--colorsComponentsMenuYang100);
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
- [data-component="icon"] {
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
- ::before {
98
- border-top-color: var(--colorsComponentsMenuYang100);
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
- ${variant === "alternate" && !inFullscreenView && (0, _styledComponents.css)`
167
- &&& {
168
- background-color: ${_menu.default[menuType].alternate};
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
- ${!hasInput && (0, _styledComponents.css)`
177
- &&& a:hover,
178
- &&& button:hover {
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
- a:focus,
196
- button:focus {
197
- background-color: ${_menu.default[menuType].submenuBackground};
198
- color: ${_menu.default[menuType].color};
193
+ ${variant === "alternate" && !inFullscreenView && (0, _styledComponents.css)`
194
+ &&& {
195
+ background-color: ${_menu.default[menuType].alternate};
196
+ }
199
197
 
200
- [data-component="icon"] {
201
- color: ${_menu.default[menuType].color};
198
+ &&& a:focus,
199
+ &&& button:focus {
200
+ background-color: ${_menu.default[menuType].alternate};
202
201
  }
203
202
 
204
- ${clickToOpen && isOpen && (0, _styledComponents.css)`
205
- background-color: ${_menu.default[menuType].submenuOpenedBackground};
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
- ${!(href || clickToOpen) && (0, _styledComponents.css)`
215
- cursor: default;
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
- ${selected && (0, _styledComponents.css)`
226
- background-color: ${_menu.default[menuType].submenuSelected};
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].submenuSelected};
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: var(--colorsComponentsMenuAutumnStandard600);
238
+ background-color: ${_menu.default[menuType].submenuOpenedBackground};
236
239
  color: var(--colorsComponentsMenuYang100);
237
- }
238
- `}
239
240
 
240
- ${showDropdownArrow && (0, _styledComponents.css)`
241
- > a,
242
- > button:not(${_iconButton.default}) {
243
- padding-right: 32px;
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
- a::before,
247
- button::before {
248
- display: block;
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 var(--colorsSemanticFocus500);
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
- border-color: var(--colorsSemanticFocus500);
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
- padding: 0 10px;
123
- margin-left: 7px;
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
- outline: none;
172
- box-shadow: 0 0 0 3px var(--colorsSemanticFocus500);
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 h4 element always shown */
22
- title?: string | React.ReactNode;
21
+ /** Title for the pod */
22
+ title?: React.ReactNode;
23
23
  /** Optional subtitle for the pod */
24
- subtitle?: string;
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 && /*#__PURE__*/_react.default.createElement(_pod.StyledSubtitle, {
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.string,
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
- border: 2px solid transparent;
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
- box-shadow: inset 0px 0px 0px var(--borderWidth200)
68
- var(--colorsUtilityYang100);
69
- border: 2px solid var(--colorsSemanticFocus500);
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;