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
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Carbon [![npm](https://img.shields.io/npm/v/carbon-react.svg)](https://www.npmjs.com/package/carbon-react) [![Cypress](https://github.com/Sage/carbon/actions/workflows/cypress.yml/badge.svg)](https://github.com/Sage/carbon/actions/workflows/cypress.yml)
1
+ # Carbon [![npm](https://img.shields.io/npm/v/carbon-react.svg)](https://www.npmjs.com/package/carbon-react) [![Cypress](https://github.com/Sage/carbon/actions/workflows/cypress.yml/badge.svg)](https://github.com/Sage/carbon/actions/workflows/cypress.yml) [![Playwright](https://github.com/Sage/carbon/actions/workflows/playwright.yml/badge.svg)](https://github.com/Sage/carbon/actions/workflows/playwright.yml)
2
2
 
3
3
  Carbon is a [React](https://facebook.github.io/react/) component library developed by Sage.
4
4
 
@@ -1,6 +1,10 @@
1
1
  import styled, { css } from "styled-components";
2
2
  import sizes from "./input-sizes.style";
3
3
  import StyledInput from "./input.style";
4
+ import addFocusStyling from "../../style/utils/add-focus-styling";
5
+ const oldFocusStyling = `
6
+ outline: solid 3px var(--colorsSemanticFocus500);
7
+ `;
4
8
  export const StyledInputPresentationContainer = styled.div`
5
9
  flex: 0 0 ${({
6
10
  inputWidth
@@ -70,11 +74,12 @@ const InputPresentationStyle = styled.div`
70
74
  cursor: not-allowed;
71
75
  `}
72
76
 
73
- ${({
74
- hasFocus
77
+ ${({
78
+ hasFocus,
79
+ theme
75
80
  }) => hasFocus && css`
76
81
  & {
77
- outline: 3px solid var(--colorsSemanticFocus500);
82
+ ${!theme.focusRedesignOptOut ? addFocusStyling() : /* istanbul ignore next */oldFocusStyling}
78
83
  z-index: 2;
79
84
  }
80
85
  `}
@@ -1,5 +1,9 @@
1
1
  import styled, { css } from "styled-components";
2
2
  import sizes from "../input/input-sizes.style";
3
+ import addFocusStyling from "../../style/utils/add-focus-styling";
4
+ const oldFocusStyling = `
5
+ outline: solid 3px var(--colorsSemanticFocus500);
6
+ `;
3
7
  const InputIconToggleStyle = styled.span.attrs(({
4
8
  onClick
5
9
  }) => ({
@@ -22,8 +26,12 @@ const InputIconToggleStyle = styled.span.attrs(({
22
26
  width: ${sizes[size].height};
23
27
  `}
24
28
 
25
- &:focus {
26
- outline: solid 3px var(--colorsSemanticFocus500);
27
- }
29
+ ${({
30
+ theme
31
+ }) => `
32
+ &:focus {
33
+ ${!theme.focusRedesignOptOut ? addFocusStyling() : /* istanbul ignore next */oldFocusStyling}
34
+ }
35
+ `}
28
36
  `;
29
37
  export default InputIconToggleStyle;
@@ -2,11 +2,15 @@ import styled, { css } from "styled-components";
2
2
  import { margin } from "styled-system";
3
3
  import BaseTheme from "../../style/themes/base";
4
4
  import StyledIcon from "../../components/icon/icon.style";
5
+ import addFocusStyling from "../../style/utils/add-focus-styling";
5
6
  const validationIconTypes = {
6
7
  error: "var(--colorsSemanticNegative500)",
7
8
  info: "var(--colorsSemanticInfo500)",
8
9
  warning: "var(--colorsSemanticCaution500)"
9
10
  };
11
+ const oldFocusStyling = `
12
+ outline: solid 2px var(--colorsSemanticFocus500);
13
+ `;
10
14
  const ValidationIconStyle = styled.span`
11
15
  background: none;
12
16
  cursor: default;
@@ -30,7 +34,9 @@ const ValidationIconStyle = styled.span`
30
34
  }
31
35
 
32
36
  ${StyledIcon}:focus {
33
- outline: solid 2px var(--colorsSemanticFocus500);
37
+ ${({
38
+ theme
39
+ }) => !theme.focusRedesignOptOut ? addFocusStyling() : /* istanbul ignore next */oldFocusStyling}
34
40
  }
35
41
 
36
42
  ${margin}
@@ -3,6 +3,7 @@ import { space, margin } from "styled-system";
3
3
  import Icon from "../icon";
4
4
  import { baseTheme } from "../../style/themes";
5
5
  import ValidationIconStyle from "../../__internal__/validations/validation-icon.style";
6
+ import addFocusStyling from "../../style/utils/add-focus-styling";
6
7
  const StyledAccordionGroup = styled.div`
7
8
  ${margin}
8
9
  `;
@@ -93,13 +94,17 @@ const StyledAccordionHeadingsContainer = styled.div`
93
94
  }
94
95
  `}
95
96
  `;
97
+ const oldFocusStyling = `
98
+ outline: solid 3px var(--colorsSemanticFocus500);
99
+ `;
96
100
  const StyledAccordionTitleContainer = styled.div`
97
101
  ${({
98
102
  buttonHeading,
99
103
  buttonWidth,
100
104
  iconAlign,
101
105
  size,
102
- hasButtonProps
106
+ hasButtonProps,
107
+ theme
103
108
  }) => css`
104
109
  padding: ${size === "small" ? "var(--spacing200)" : "var(--spacing300)"};
105
110
  ${space}
@@ -116,7 +121,7 @@ const StyledAccordionTitleContainer = styled.div`
116
121
  z-index: 1;
117
122
 
118
123
  &:focus {
119
- outline: var(--borderWidth300) solid var(--colorsSemanticFocus500);
124
+ ${!theme.focusRedesignOptOut ? addFocusStyling() : /* istanbul ignore next */oldFocusStyling}
120
125
  }
121
126
 
122
127
  ${!buttonHeading && css`
@@ -4,6 +4,11 @@ import Icon from "../icon";
4
4
  import StyledIcon from "../icon/icon.style";
5
5
  import StyledButton from "../button/button.style";
6
6
  import { isSafari } from "../../__internal__/utils/helpers/browser-type-check";
7
+ import addFocusStyling from "../../style/utils/add-focus-styling";
8
+ import baseTheme from "../../style/themes/base";
9
+ const oldFocusStyling = `
10
+ outline: solid 3px var(--colorsSemanticFocus500);
11
+ `;
7
12
  const Menu = styled.div`
8
13
  ${({
9
14
  isOpen
@@ -109,7 +114,9 @@ const StyledMenuItem = styled.button`
109
114
  font-weight: 700;
110
115
 
111
116
  &:focus {
112
- outline: var(--borderWidth300) solid var(--colorsSemanticFocus500);
117
+ ${({
118
+ theme
119
+ }) => `${!theme.focusRedesignOptOut ? addFocusStyling() : /* istanbul ignore next */oldFocusStyling}`}
113
120
  z-index: 1;
114
121
  border-radius: var(--borderRadius000);
115
122
  }
@@ -138,6 +145,9 @@ const StyledMenuItem = styled.button`
138
145
  }
139
146
  `}
140
147
  `;
148
+ StyledMenuItem.defaultProps = {
149
+ theme: baseTheme
150
+ };
141
151
  const StyledMenuItemWrapper = styled.div`
142
152
  position: relative;
143
153
  `;
@@ -165,10 +175,14 @@ const ButtonIcon = styled(Icon)`
165
175
  }
166
176
  `;
167
177
  const StyledButtonIcon = styled.div`
168
- &:focus {
169
- outline: var(--borderWidth300) solid var(--colorsSemanticFocus500);
170
- border-radius: var(--borderRadius050);
171
- }
178
+ ${({
179
+ theme
180
+ }) => `
181
+ &:focus {
182
+ ${!theme.focusRedesignOptOut ? addFocusStyling() : /* istanbul ignore next */oldFocusStyling}
183
+ }
184
+ `}
185
+ border-radius: var(--borderRadius050);
172
186
  `;
173
187
  const MenuItemIcon = styled(Icon)`
174
188
  ${({
@@ -188,6 +202,9 @@ const MenuItemIcon = styled(Icon)`
188
202
  color: var(--colorsUtilityYin065);
189
203
  `}
190
204
  `;
205
+ StyledButtonIcon.defaultProps = {
206
+ theme: baseTheme
207
+ };
191
208
  const SubMenuItemIcon = styled(ButtonIcon)`
192
209
  ${({
193
210
  type
@@ -1,5 +1,10 @@
1
1
  import styled, { css } from "styled-components";
2
+ import baseTheme from "../../style/themes/base";
3
+ import addFocusStyling from "../../style/utils/add-focus-styling";
2
4
  const transparentSvg = "%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%" + "2Fsvg%22%20width%3D%22400%22%20height%3D%22400%22%20fill-opacity%3D%22." + "45%22%3E%3Crect%20x%3D%22200%22%20width%3D%22200%22%20height%3D%22200%22%20%2" + "F%3E%3Crect%20y%3D%22200%22%20width%3D%22200%22%20height%3D%22200%22%20%2F%3E%3C%2Fsvg%3E";
5
+ const oldFocusStyling = `
6
+ outline: solid 3px var(--colorsSemanticFocus500);
7
+ `;
3
8
  const StyledAdvancedColorPickerCell = styled.button.attrs({
4
9
  type: "button"
5
10
  })`
@@ -26,11 +31,18 @@ const StyledAdvancedColorPickerCell = styled.button.attrs({
26
31
  }
27
32
 
28
33
  &:focus {
29
- outline: solid 3px var(--colorsSemanticFocus500);
34
+ ${({
35
+ theme
36
+ }) => `
37
+ ${!theme.focusRedesignOptOut ? addFocusStyling() : /* istanbul ignore next */oldFocusStyling}
38
+ `}
30
39
  }
31
40
 
32
41
  &::-moz-focus-inner {
33
42
  border: none;
34
43
  }
35
44
  `;
45
+ StyledAdvancedColorPickerCell.defaultProps = {
46
+ theme: baseTheme
47
+ };
36
48
  export default StyledAdvancedColorPickerCell;
@@ -1,4 +1,8 @@
1
1
  import styled, { css } from "styled-components";
2
+ import addFocusStyling from "../../../style/utils/add-focus-styling";
3
+ const oldFocusStyling = `
4
+ outline: solid 3px var(--colorsSemanticFocus500);
5
+ `;
2
6
  const StyledNavigationItem = styled.li`
3
7
  width: 100%;
4
8
 
@@ -15,7 +19,10 @@ const StyledNavigationItem = styled.li`
15
19
  border-bottom-right-radius: var(--borderRadius100);
16
20
 
17
21
  &:focus {
18
- outline: var(--borderWidth300) solid var(--colorsSemanticFocus500);
22
+ ${({
23
+ theme
24
+ }) => `${!theme.focusRedesignOptOut ? addFocusStyling() : /* istanbul ignore next */oldFocusStyling}`}
25
+ position: relative;
19
26
  }
20
27
 
21
28
  &:hover {
@@ -1,6 +1,10 @@
1
1
  import styled, { css } from "styled-components";
2
2
  import StyledIconButton from "../icon-button/icon-button.style";
3
3
  import StyledIcon from "../icon/icon.style";
4
+ import addFocusStyling from "../../style/utils/add-focus-styling";
5
+ const oldFocusStyling = `
6
+ outline: solid 3px var(--colorsSemanticFocus500);
7
+ `;
4
8
  const StyledBatchSelection = styled.div`
5
9
  ${({
6
10
  disabled,
@@ -15,6 +19,11 @@ const StyledBatchSelection = styled.div`
15
19
 
16
20
  ${StyledIcon} {
17
21
  color: var(--colorsActionMajorYin065);
22
+ &:focus {
23
+ ${({
24
+ theme
25
+ }) => `${!theme.focusRedesignOptOut ? addFocusStyling() : /* istanbul ignore next */oldFocusStyling}`}
26
+ }
18
27
  }
19
28
 
20
29
  ${colorTheme === "dark" && css`
@@ -52,6 +61,10 @@ const StyledBatchSelection = styled.div`
52
61
 
53
62
  ${StyledIconButton}:focus {
54
63
  border-radius: var(--borderRadius100);
64
+ z-index: 1;
65
+ ${({
66
+ theme
67
+ }) => `${!theme.focusRedesignOptOut ? addFocusStyling() : /* istanbul ignore next */oldFocusStyling}`}
55
68
  }
56
69
 
57
70
  ${disabled && css`
@@ -3,6 +3,7 @@ import { space } from "styled-system";
3
3
  import BaseTheme from "../../style/themes/base";
4
4
  import buttonTypes from "./button-types.style";
5
5
  import StyledIcon from "../icon/icon.style";
6
+ import addFocusStyling from "../../style/utils/add-focus-styling";
6
7
  function additionalIconStyle(iconType) {
7
8
  if (iconType === "services") return "6px";
8
9
  return "16px";
@@ -52,11 +53,13 @@ function stylingForType({
52
53
  ${iconOnly && stylingForIconOnly(size)}
53
54
  `;
54
55
  }
56
+ const oldFocusStyling = "outline: solid 3px var(--colorsSemanticFocus500);";
55
57
  const StyledButton = styled.button`
56
58
  ${space}
57
59
  ${({
58
60
  disabled,
59
- noWrap
61
+ noWrap,
62
+ theme
60
63
  }) => css`
61
64
  align-items: center;
62
65
  cursor: ${disabled ? "not-allowed" : "pointer"};
@@ -72,7 +75,7 @@ const StyledButton = styled.button`
72
75
  border-radius: var(--borderRadius400);
73
76
 
74
77
  &:focus {
75
- outline: solid 3px var(--colorsSemanticFocus500);
78
+ ${!theme.focusRedesignOptOut ? addFocusStyling() : /* istanbul ignore next */oldFocusStyling}
76
79
  }
77
80
 
78
81
  ${stylingForType}
@@ -1,5 +1,7 @@
1
1
  import styled, { css } from "styled-components";
2
2
  import StyledIcon from "../icon/icon.style";
3
+ import addFocusStyling from "../../style/utils/add-focus-styling";
4
+ import baseTheme from "../../style/themes/base";
3
5
  const heightConfig = {
4
6
  small: 32,
5
7
  medium: 40,
@@ -33,6 +35,9 @@ const StyledButtonToggleContentWrapper = styled.div`
33
35
  height: 100%;
34
36
  flex-flow: wrap;
35
37
  `;
38
+ const oldFocusStyling = `
39
+ outline: solid 3px var(--colorsSemanticFocus500);
40
+ `;
36
41
  const StyledButtonToggle = styled.button`
37
42
  display: inline-flex;
38
43
  justify-content: center;
@@ -56,8 +61,10 @@ const StyledButtonToggle = styled.button`
56
61
 
57
62
  border: 1px solid var(--colorsActionMinor500);
58
63
 
59
- :focus {
60
- outline: 3px solid var(--colorsSemanticFocus500);
64
+ &:focus {
65
+ ${({
66
+ theme
67
+ }) => `${!theme.focusRedesignOptOut ? addFocusStyling() : /* istanbul ignore next */oldFocusStyling}`}
61
68
  z-index: 100;
62
69
  }
63
70
 
@@ -133,6 +140,9 @@ const StyledButtonToggleIcon = styled.div`
133
140
  }
134
141
  `}
135
142
  `;
143
+ StyledButtonToggle.defaultProps = {
144
+ theme: baseTheme
145
+ };
136
146
  const StyledButtonToggleWrapper = styled.div`
137
147
  display: inline-block;
138
148
  vertical-align: middle;
@@ -12,7 +12,8 @@ export interface CarbonProviderProps {
12
12
  *
13
13
  * NOTE - Will eventually be set to `false` by default in the future. */
14
14
  roundedCornersOptOut?: boolean;
15
+ focusRedesignOptOut?: boolean;
15
16
  }
16
- export declare const NewValidationContext: React.Context<Pick<CarbonProviderProps, "validationRedesignOptIn" | "roundedCornersOptOut">>;
17
- export declare const CarbonProvider: ({ children, theme, validationRedesignOptIn, roundedCornersOptOut, }: CarbonProviderProps) => React.JSX.Element;
17
+ export declare const NewValidationContext: React.Context<Pick<CarbonProviderProps, "validationRedesignOptIn" | "roundedCornersOptOut" | "focusRedesignOptOut">>;
18
+ export declare const CarbonProvider: ({ children, theme, validationRedesignOptIn, roundedCornersOptOut, focusRedesignOptOut, }: CarbonProviderProps) => React.JSX.Element;
18
19
  export default CarbonProvider;
@@ -9,16 +9,20 @@ export const CarbonProvider = ({
9
9
  children,
10
10
  theme = mintTheme,
11
11
  validationRedesignOptIn = false,
12
- roundedCornersOptOut = false
12
+ roundedCornersOptOut = false,
13
+ focusRedesignOptOut = false
13
14
  }) => {
14
15
  const {
15
- roundedCornersOptOut: existingRoundedCornersOptOut
16
+ roundedCornersOptOut: existingRoundedCornersOptOut,
17
+ focusRedesignOptOut: existingFocusRedesignOptOut
16
18
  } = useContext(NewValidationContext);
17
19
  const roundedCornersOptOutValue = existingRoundedCornersOptOut || roundedCornersOptOut;
20
+ const focusRedesignOptOutValue = existingFocusRedesignOptOut || focusRedesignOptOut;
18
21
  return /*#__PURE__*/React.createElement(ThemeProvider, {
19
22
  theme: {
20
23
  ...theme,
21
- roundedCornersOptOut: roundedCornersOptOutValue
24
+ roundedCornersOptOut: roundedCornersOptOutValue,
25
+ focusRedesignOptOut: focusRedesignOptOutValue
22
26
  }
23
27
  }, /*#__PURE__*/React.createElement(CarbonScopedTokensProvider, null, /*#__PURE__*/React.createElement(NewValidationContext.Provider, {
24
28
  value: {
@@ -2,6 +2,8 @@ import styled, { css } from "styled-components";
2
2
  import Icon from "../icon";
3
3
  import { slideAnimation, fadeAnimation } from "./slide.config";
4
4
  import { SlideStyle } from "./slide/slide.style";
5
+ import addFocusStyling from "../../style/utils/add-focus-styling";
6
+ import baseTheme from "../../style/themes/base";
5
7
  const CarouselNavigationStyle = styled.div`
6
8
  margin-top: -32.5px;
7
9
  position: absolute;
@@ -9,11 +11,11 @@ const CarouselNavigationStyle = styled.div`
9
11
  z-index: 20;
10
12
  `;
11
13
  const CarouselPreviousButtonWrapperStyle = styled(CarouselNavigationStyle)`
12
- margin-left: 2px;
14
+ margin-left: 8px;
13
15
  `;
14
16
  const CarouselNextButtonWrapperStyle = styled(CarouselNavigationStyle)`
15
17
  right: 0;
16
- margin-right: 2px;
18
+ margin-right: 8px;
17
19
  `;
18
20
  const CarouselStyledIcon = styled(Icon)`
19
21
  cursor: pointer;
@@ -28,6 +30,9 @@ const CarouselStyledIconLeft = styled(CarouselStyledIcon)`
28
30
  const CarouselStyledIconRight = styled(CarouselStyledIcon)`
29
31
  transform: rotate(-90deg);
30
32
  `;
33
+ const oldFocusStyling = `
34
+ outline: solid 2px var(--colorsSemanticFocus500);
35
+ `;
31
36
  const CarouselButtonStyle = styled.button.attrs({
32
37
  type: "button"
33
38
  })`
@@ -67,7 +72,9 @@ const CarouselButtonStyle = styled.button.attrs({
67
72
  }
68
73
 
69
74
  &:focus {
70
- outline: 2px solid var(--colorsSemanticFocus500);
75
+ ${({
76
+ theme
77
+ }) => `${!theme.focusRedesignOptOut ? addFocusStyling() : /* istanbul ignore next */oldFocusStyling}`}
71
78
 
72
79
  ::-moz-focus-inner {
73
80
  border: 0;
@@ -79,6 +86,9 @@ const CarouselButtonStyle = styled.button.attrs({
79
86
  }
80
87
  `}
81
88
  `;
89
+ CarouselButtonStyle.defaultProps = {
90
+ theme: baseTheme
91
+ };
82
92
  const CarouselSelectorInputStyle = styled.input`
83
93
  display: none;
84
94
  `;
@@ -7,6 +7,10 @@ import StyledCheckableInputSvgWrapper from "../../__internal__/checkable-input/c
7
7
  import StyledLabel, { StyledLabelContainer } from "../../__internal__/label/label.style";
8
8
  import StyledValidationIcon from "../../__internal__/validations/validation-icon.style";
9
9
  import baseTheme from "../../style/themes/base";
10
+ import addFocusStyling from "../../style/utils/add-focus-styling";
11
+ const oldFocusStyling = `
12
+ box-shadow: 0 0 0 3px var(--colorsSemanticFocus500);
13
+ `;
10
14
  const StyledCheckbox = styled.div`
11
15
  ${margin}
12
16
  ${({
@@ -65,10 +69,14 @@ const StyledCheckbox = styled.div`
65
69
 
66
70
  // prettier-ignore
67
71
  ${StyledHiddenCheckableInput}:not([disabled]) {
68
- &:focus + ${StyledCheckableInputSvgWrapper},
69
- &:hover + ${StyledCheckableInputSvgWrapper} {
70
- box-shadow: 0 0 0 3px var(--colorsSemanticFocus500);
71
- }
72
+ ${({
73
+ theme
74
+ }) => `
75
+ &:focus + ${StyledCheckableInputSvgWrapper} ,
76
+ &:hover + ${StyledCheckableInputSvgWrapper} {
77
+ ${!theme.focusRedesignOptOut ? addFocusStyling() : /* istanbul ignore next */oldFocusStyling}
78
+ }
79
+ `}
72
80
  }
73
81
 
74
82
  ${StyledLabelContainer} {
@@ -1,5 +1,9 @@
1
1
  import styled from "styled-components";
2
2
  import baseTheme from "../../../../style/themes/base";
3
+ import addFocusStyling from "../../../../style/utils/add-focus-styling";
4
+ const oldFocusStyling = `
5
+ outline: solid 3px var(--colorsSemanticFocus500);
6
+ `;
3
7
 
4
8
  // Styles copied from https://github.com/gpbl/react-day-picker/blob/v6.1.1/src/style.css
5
9
  const addReactDayPickerStyles = () => `
@@ -215,7 +219,9 @@ const StyledDayPicker = styled.div`
215
219
  .DayPicker-wrapper {
216
220
  padding: 0;
217
221
  &:focus {
218
- outline: var(--borderWidth300) solid var(--colorsSemanticFocus500);
222
+ ${({
223
+ theme
224
+ }) => !theme.focusRedesignOptOut ? addFocusStyling() : /* istanbul ignore next */oldFocusStyling}
219
225
  border-radius: var(--borderRadius050);
220
226
  }
221
227
  }
@@ -262,9 +268,13 @@ const StyledDayPicker = styled.div`
262
268
  color: var(--colorsActionMajorYin090);
263
269
  }
264
270
 
265
- &:focus {
266
- outline: var(--borderWidth300) solid var(--colorsSemanticFocus500);
267
- }
271
+ ${({
272
+ theme
273
+ }) => `
274
+ &:focus {
275
+ ${!theme.focusRedesignOptOut ? addFocusStyling(true) : /* istanbul ignore next */oldFocusStyling}
276
+ }
277
+ `}
268
278
 
269
279
  + * {
270
280
  border-left: 1px;
@@ -1,4 +1,9 @@
1
1
  import styled from "styled-components";
2
+ import addFocusStyling from "../../../../style/utils/add-focus-styling";
3
+ import { baseTheme } from "../../../../style/themes";
4
+ const oldFocusStyling = `
5
+ outline: solid 3px var(--colorsSemanticFocus500);
6
+ `;
2
7
  const StyledButton = styled.button.attrs({
3
8
  type: "button"
4
9
  })`
@@ -15,8 +20,15 @@ const StyledButton = styled.button.attrs({
15
20
  box-sizing: border-box;
16
21
  border-radius: var(--borderRadius050);
17
22
 
18
- &:focus {
19
- outline: var(--borderWidth300) solid var(--colorsSemanticFocus500);
20
- }
23
+ ${({
24
+ theme
25
+ }) => `
26
+ &:focus {
27
+ ${!theme.focusRedesignOptOut ? addFocusStyling() : /* istanbul ignore next */oldFocusStyling}
28
+ }
29
+ `}
21
30
  `;
31
+ StyledButton.defaultProps = {
32
+ theme: baseTheme
33
+ };
22
34
  export default StyledButton;
@@ -2,6 +2,8 @@ import styled, { css, keyframes } from "styled-components";
2
2
  import StyledTabs from "../tabs/tabs.style";
3
3
  import Box from "../box";
4
4
  import StyledStickyFooter from "../../__internal__/sticky-footer/sticky-footer.style";
5
+ import addFocusStyling from "../../style/utils/add-focus-styling";
6
+ import baseTheme from "../../style/themes/base";
5
7
  const defaultExpandedWidth = "var(--sizing500)";
6
8
  const StyledSidebarHeader = styled.div`
7
9
  ${({
@@ -158,6 +160,9 @@ const StyledDrawerContent = styled.div`
158
160
  }
159
161
  }
160
162
  `;
163
+ const oldFocusStyling = `
164
+ outline: solid 3px var(--colorsSemanticFocus500);
165
+ `;
161
166
  const StyledSidebarToggleButton = styled.button.attrs({
162
167
  type: "button"
163
168
  })`
@@ -181,9 +186,13 @@ const StyledSidebarToggleButton = styled.button.attrs({
181
186
  animation: ${buttonClose} ${animationDuration} ease-in-out;
182
187
  border-radius: var(--borderRadius050);
183
188
 
184
- &:focus {
185
- outline: var(--borderWidth300) solid var(--colorsSemanticFocus500);
186
- }
189
+ ${({
190
+ theme
191
+ }) => `
192
+ &:focus {
193
+ ${!theme.focusRedesignOptOut ? addFocusStyling() : /* istanbul ignore next */oldFocusStyling}
194
+ }
195
+ `}
187
196
 
188
197
  &:hover {
189
198
  cursor: pointer;
@@ -195,6 +204,9 @@ const StyledSidebarToggleButton = styled.button.attrs({
195
204
  `}
196
205
  `}
197
206
  `;
207
+ StyledSidebarToggleButton.defaultProps = {
208
+ theme: baseTheme
209
+ };
198
210
  const StyledDrawerWrapper = styled.div`
199
211
  display: flex;
200
212
  height: ${({
@@ -6,7 +6,7 @@ const StyledPicklist = styled(Box).attrs({
6
6
  position: relative;
7
7
  list-style: none;
8
8
  margin: 0;
9
- padding: 4px 8px 8px 8px;
9
+ padding: 8px 8px 8px 8px;
10
10
  width: 100%;
11
11
  box-sizing: border-box;
12
12
  overflow-y: auto;
@@ -68,5 +68,12 @@ const StyledLockIcon = styled(Icon)`
68
68
  margin-right: 0;
69
69
  height: 40px;
70
70
  min-width: 40px;
71
+
72
+ :focus {
73
+ border-bottom-right-radius: var(--borderRadius100);
74
+ border-top-right-radius: var(--borderRadius100);
75
+ border-bottom-left-radius: var(--borderRadius000);
76
+ border-top-left-radius: var(--borderRadius000);
77
+ }
71
78
  `;
72
79
  export { StyledPicklistItem, StyledButton, StyledLockIcon };