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
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Carbon [](https://www.npmjs.com/package/carbon-react) [](https://github.com/Sage/carbon/actions/workflows/cypress.yml)
|
|
1
|
+
# Carbon [](https://www.npmjs.com/package/carbon-react) [](https://github.com/Sage/carbon/actions/workflows/cypress.yml) [](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
|
-
|
|
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
|
-
|
|
26
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
169
|
-
|
|
170
|
-
|
|
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
|
-
|
|
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;
|
package/esm/components/anchor-navigation/anchor-navigation-item/anchor-navigation-item.style.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
60
|
-
|
|
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:
|
|
14
|
+
margin-left: 8px;
|
|
13
15
|
`;
|
|
14
16
|
const CarouselNextButtonWrapperStyle = styled(CarouselNavigationStyle)`
|
|
15
17
|
right: 0;
|
|
16
|
-
margin-right:
|
|
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
|
-
|
|
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
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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
|
-
|
|
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
|
-
|
|
266
|
-
|
|
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
|
-
|
|
19
|
-
|
|
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
|
-
|
|
185
|
-
|
|
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: ${({
|
|
@@ -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 };
|