carbon-react 144.22.0 → 145.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/components/box/box.style.js +3 -4
- package/esm/components/carbon-provider/__internal__/new-validation.context.d.ts +0 -4
- package/esm/components/carbon-provider/carbon-provider.component.d.ts +1 -1
- package/esm/components/carbon-provider/carbon-provider.component.js +1 -11
- package/esm/components/dismissible-box/dismissible-box.component.d.ts +1 -1
- package/esm/components/loader/loader-square.style.js +3 -4
- package/esm/components/pill/pill.style.js +4 -43
- package/esm/components/portrait/portrait.component.js +4 -9
- package/esm/components/progress-tracker/progress-tracker.style.js +4 -6
- package/esm/components/switch/__internal__/switch-slider.style.d.ts +1 -3
- package/esm/components/switch/__internal__/switch-slider.style.js +1 -10
- package/esm/style/design-tokens/carbon-scoped-tokens-provider/carbon-scoped-tokens-provider.component.d.ts +1 -2
- package/esm/style/design-tokens/carbon-scoped-tokens-provider/carbon-scoped-tokens-provider.component.js +2 -1
- package/esm/style/design-tokens/generate-css-variables.util.d.ts +1 -1
- package/esm/style/design-tokens/generate-css-variables.util.js +1 -6
- package/lib/components/box/box.style.js +3 -4
- package/lib/components/carbon-provider/__internal__/new-validation.context.d.ts +0 -4
- package/lib/components/carbon-provider/carbon-provider.component.d.ts +1 -1
- package/lib/components/carbon-provider/carbon-provider.component.js +1 -11
- package/lib/components/dismissible-box/dismissible-box.component.d.ts +1 -1
- package/lib/components/loader/loader-square.style.js +3 -4
- package/lib/components/pill/pill.style.js +4 -43
- package/lib/components/portrait/portrait.component.js +3 -8
- package/lib/components/progress-tracker/progress-tracker.style.js +4 -6
- package/lib/components/switch/__internal__/switch-slider.style.d.ts +1 -3
- package/lib/components/switch/__internal__/switch-slider.style.js +1 -10
- package/lib/style/design-tokens/carbon-scoped-tokens-provider/carbon-scoped-tokens-provider.component.d.ts +1 -2
- package/lib/style/design-tokens/carbon-scoped-tokens-provider/carbon-scoped-tokens-provider.component.js +1 -1
- package/lib/style/design-tokens/generate-css-variables.util.d.ts +1 -1
- package/lib/style/design-tokens/generate-css-variables.util.js +1 -6
- package/package.json +1 -1
|
@@ -23,11 +23,10 @@ const StyledBox = styled.div`
|
|
|
23
23
|
${calculatePosition}
|
|
24
24
|
|
|
25
25
|
${({
|
|
26
|
-
theme,
|
|
27
26
|
borderRadius = "borderRadius000"
|
|
28
|
-
}) =>
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
}) => css`
|
|
28
|
+
border-radius: var(--${borderRadius});
|
|
29
|
+
`}
|
|
31
30
|
|
|
32
31
|
${({
|
|
33
32
|
cssProps,
|
|
@@ -4,10 +4,6 @@ export interface NewValidationContextProps {
|
|
|
4
4
|
*
|
|
5
5
|
* NOTE - Will eventually be set to `true` by default in the future. */
|
|
6
6
|
validationRedesignOptIn?: boolean;
|
|
7
|
-
/** (Deprecated) Feature flag for opting out of styling components to have rounded corners.
|
|
8
|
-
*
|
|
9
|
-
* NOTE - This feature flag will soon be removed, along with the legacy styling. */
|
|
10
|
-
roundedCornersOptOut?: boolean;
|
|
11
7
|
/** (Deprecated) Feature flag for opting out of the focus redesign.
|
|
12
8
|
*
|
|
13
9
|
* NOTE - This feature flag will soon be removed, along with the legacy styling. */
|
|
@@ -6,5 +6,5 @@ export interface CarbonProviderProps extends NewValidationContextProps {
|
|
|
6
6
|
/** Theme which specifies styles to apply to all child components. Set to `sageTheme` by default. */
|
|
7
7
|
theme?: Partial<ThemeObject>;
|
|
8
8
|
}
|
|
9
|
-
export declare const CarbonProvider: ({ children, theme, validationRedesignOptIn,
|
|
9
|
+
export declare const CarbonProvider: ({ children, theme, validationRedesignOptIn, focusRedesignOptOut, }: CarbonProviderProps) => React.JSX.Element;
|
|
10
10
|
export default CarbonProvider;
|
|
@@ -6,25 +6,17 @@ import { sageTheme } from "../../style/themes";
|
|
|
6
6
|
import NewValidationContext from "./__internal__/new-validation.context";
|
|
7
7
|
import TopModalProvider from "./__internal__/top-modal-provider.component";
|
|
8
8
|
import Logger from "../../__internal__/utils/logger";
|
|
9
|
-
let deprecatedRoundedCornersOptOut = false;
|
|
10
9
|
let deprecatedFocusRedesignOptOut = false;
|
|
11
10
|
export const CarbonProvider = ({
|
|
12
11
|
children,
|
|
13
12
|
theme = sageTheme,
|
|
14
13
|
validationRedesignOptIn = false,
|
|
15
|
-
roundedCornersOptOut = false,
|
|
16
14
|
focusRedesignOptOut = false
|
|
17
15
|
}) => {
|
|
18
16
|
const {
|
|
19
|
-
roundedCornersOptOut: existingRoundedCornersOptOut,
|
|
20
17
|
focusRedesignOptOut: existingFocusRedesignOptOut
|
|
21
18
|
} = useContext(NewValidationContext);
|
|
22
|
-
const roundedCornersOptOutValue = existingRoundedCornersOptOut || roundedCornersOptOut;
|
|
23
19
|
const focusRedesignOptOutValue = existingFocusRedesignOptOut || focusRedesignOptOut;
|
|
24
|
-
if (!deprecatedRoundedCornersOptOut && roundedCornersOptOutValue) {
|
|
25
|
-
deprecatedRoundedCornersOptOut = true;
|
|
26
|
-
Logger.deprecate("The `roundedCornersOptOut` feature flag has been deprecated and will soon be removed. " + "Along with this feature flag, the legacy pre-rounded corners styling will also be removed. ");
|
|
27
|
-
}
|
|
28
20
|
if (!deprecatedFocusRedesignOptOut && focusRedesignOptOutValue) {
|
|
29
21
|
deprecatedFocusRedesignOptOut = true;
|
|
30
22
|
Logger.deprecate("The `focusRedesignOptOut` feature flag has been deprecated and will soon be removed. " + "Along with this feature flag, the legacy focus styling will also be removed. ");
|
|
@@ -32,13 +24,11 @@ export const CarbonProvider = ({
|
|
|
32
24
|
return /*#__PURE__*/React.createElement(ThemeProvider, {
|
|
33
25
|
theme: {
|
|
34
26
|
...theme,
|
|
35
|
-
roundedCornersOptOut: roundedCornersOptOutValue,
|
|
36
27
|
focusRedesignOptOut: focusRedesignOptOutValue
|
|
37
28
|
}
|
|
38
29
|
}, /*#__PURE__*/React.createElement(CarbonScopedTokensProvider, null, /*#__PURE__*/React.createElement(NewValidationContext.Provider, {
|
|
39
30
|
value: {
|
|
40
|
-
validationRedesignOptIn
|
|
41
|
-
roundedCornersOptOut: roundedCornersOptOutValue
|
|
31
|
+
validationRedesignOptIn
|
|
42
32
|
}
|
|
43
33
|
}, /*#__PURE__*/React.createElement(TopModalProvider, null, children))));
|
|
44
34
|
};
|
|
@@ -3,7 +3,7 @@ import { SpaceProps } from "styled-system";
|
|
|
3
3
|
import { StyledDismissibleBoxProps } from "./dismissible-box.style";
|
|
4
4
|
import { BoxProps } from "../box";
|
|
5
5
|
import { TagProps } from "../../__internal__/utils/helpers/tags";
|
|
6
|
-
export interface DismissibleBoxProps extends SpaceProps, StyledDismissibleBoxProps, Omit<BoxProps, "display" | "justifyContent">, Omit<TagProps, "data-component"> {
|
|
6
|
+
export interface DismissibleBoxProps extends SpaceProps, StyledDismissibleBoxProps, Omit<BoxProps, "display" | "justifyContent" | "bg" | "backgroundColor">, Omit<TagProps, "data-component"> {
|
|
7
7
|
/** The content to render in the component */
|
|
8
8
|
children?: React.ReactNode;
|
|
9
9
|
/** Data tag prop bag for close Button */
|
|
@@ -10,7 +10,7 @@ const loaderAnimation = keyframes`
|
|
|
10
10
|
transform: scale(1);
|
|
11
11
|
}
|
|
12
12
|
`;
|
|
13
|
-
const getDimensions =
|
|
13
|
+
const getDimensions = size => {
|
|
14
14
|
let width;
|
|
15
15
|
let marginRight;
|
|
16
16
|
switch (size) {
|
|
@@ -30,7 +30,6 @@ const getDimensions = (size, roundedCornersOptOut) => {
|
|
|
30
30
|
width: ${width};
|
|
31
31
|
height: ${width};
|
|
32
32
|
margin-right: ${marginRight};
|
|
33
|
-
${!roundedCornersOptOut && "border-radius: var(--borderRadiusCircle);"}
|
|
34
33
|
`;
|
|
35
34
|
};
|
|
36
35
|
const StyledLoaderSquare = styled.div`
|
|
@@ -38,13 +37,13 @@ const StyledLoaderSquare = styled.div`
|
|
|
38
37
|
size,
|
|
39
38
|
isInsideButton,
|
|
40
39
|
isActive,
|
|
41
|
-
theme,
|
|
42
40
|
backgroundColor
|
|
43
41
|
}) => css`
|
|
44
42
|
animation: ${loaderAnimation} 1s infinite ease-in-out both;
|
|
45
43
|
background-color: ${backgroundColor};
|
|
46
44
|
display: inline-block;
|
|
47
|
-
${getDimensions(size
|
|
45
|
+
${getDimensions(size)}
|
|
46
|
+
border-radius: var(--borderRadiusCircle);
|
|
48
47
|
|
|
49
48
|
${isInsideButton && css`
|
|
50
49
|
background-color: ${isActive ? "var(--colorsUtilityYang100)" : "var(--colorsSemanticNeutral500)"};
|
|
@@ -58,9 +58,7 @@ const StyledPill = styled.span`
|
|
|
58
58
|
align-items: center;
|
|
59
59
|
justify-content: center;
|
|
60
60
|
border: 2px solid ${pillColor};
|
|
61
|
-
|
|
62
|
-
border-radius: var(--borderRadius025);
|
|
63
|
-
`}
|
|
61
|
+
border-radius: var(--borderRadius025);
|
|
64
62
|
height: auto;
|
|
65
63
|
|
|
66
64
|
${!wrapText && css`
|
|
@@ -87,10 +85,6 @@ const StyledPill = styled.span`
|
|
|
87
85
|
line-height: 16px;
|
|
88
86
|
font-size: 12px;
|
|
89
87
|
padding: 0 8px;
|
|
90
|
-
|
|
91
|
-
${theme.roundedCornersOptOut && css`
|
|
92
|
-
border-radius: 12px;
|
|
93
|
-
`}
|
|
94
88
|
`}
|
|
95
89
|
|
|
96
90
|
${size === "M" && css`
|
|
@@ -98,10 +92,6 @@ const StyledPill = styled.span`
|
|
|
98
92
|
line-height: 20px;
|
|
99
93
|
font-size: 14px;
|
|
100
94
|
padding: 0 8px;
|
|
101
|
-
|
|
102
|
-
${theme.roundedCornersOptOut && css`
|
|
103
|
-
border-radius: 12px;
|
|
104
|
-
`}
|
|
105
95
|
`}
|
|
106
96
|
|
|
107
97
|
${size === "L" && css`
|
|
@@ -109,10 +99,6 @@ const StyledPill = styled.span`
|
|
|
109
99
|
line-height: 24px;
|
|
110
100
|
font-size: 14px;
|
|
111
101
|
padding: 0 8px;
|
|
112
|
-
|
|
113
|
-
${theme.roundedCornersOptOut && css`
|
|
114
|
-
border-radius: 13px;
|
|
115
|
-
`}
|
|
116
102
|
`}
|
|
117
103
|
|
|
118
104
|
${size === "XL" && css`
|
|
@@ -120,18 +106,12 @@ const StyledPill = styled.span`
|
|
|
120
106
|
line-height: 28px;
|
|
121
107
|
font-size: 16px;
|
|
122
108
|
padding: 0 12px;
|
|
123
|
-
|
|
124
|
-
${theme.roundedCornersOptOut && css`
|
|
125
|
-
border-radius: 15px;
|
|
126
|
-
`}
|
|
127
109
|
`}
|
|
128
110
|
|
|
129
111
|
${isDeletable && css`
|
|
130
112
|
${StyledIconButton} {
|
|
131
113
|
-webkit-appearance: none;
|
|
132
|
-
|
|
133
|
-
border-radius: var(--borderRadius000);
|
|
134
|
-
`}
|
|
114
|
+
border-radius: var(--borderRadius000);
|
|
135
115
|
border: none;
|
|
136
116
|
bottom: 0;
|
|
137
117
|
font-size: 100%;
|
|
@@ -150,11 +130,8 @@ const StyledPill = styled.span`
|
|
|
150
130
|
`}
|
|
151
131
|
|
|
152
132
|
background-color: ${buttonFocusColor};
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
var(--borderRadius025) var(--borderRadius000);
|
|
156
|
-
`}
|
|
157
|
-
|
|
133
|
+
border-radius: var(--borderRadius000) var(--borderRadius025)
|
|
134
|
+
var(--borderRadius025) var(--borderRadius000);
|
|
158
135
|
::-moz-focus-inner {
|
|
159
136
|
border: 0;
|
|
160
137
|
}
|
|
@@ -198,10 +175,6 @@ const StyledPill = styled.span`
|
|
|
198
175
|
font-size: 16px;
|
|
199
176
|
}
|
|
200
177
|
}
|
|
201
|
-
|
|
202
|
-
${theme.roundedCornersOptOut && css`
|
|
203
|
-
border-radius: 0 10px 10px 0;
|
|
204
|
-
`}
|
|
205
178
|
}
|
|
206
179
|
`}
|
|
207
180
|
|
|
@@ -212,10 +185,6 @@ const StyledPill = styled.span`
|
|
|
212
185
|
width: 24px;
|
|
213
186
|
padding: 0;
|
|
214
187
|
line-height: 15px;
|
|
215
|
-
|
|
216
|
-
${theme.roundedCornersOptOut && css`
|
|
217
|
-
border-radius: 0 10px 10px 0;
|
|
218
|
-
`}
|
|
219
188
|
}
|
|
220
189
|
`}
|
|
221
190
|
|
|
@@ -226,10 +195,6 @@ const StyledPill = styled.span`
|
|
|
226
195
|
width: 28px;
|
|
227
196
|
padding: 0;
|
|
228
197
|
line-height: 16px;
|
|
229
|
-
|
|
230
|
-
${theme.roundedCornersOptOut && css`
|
|
231
|
-
border-radius: 0 11px 11px 0;
|
|
232
|
-
`}
|
|
233
198
|
}
|
|
234
199
|
`}
|
|
235
200
|
|
|
@@ -240,10 +205,6 @@ const StyledPill = styled.span`
|
|
|
240
205
|
width: 32px;
|
|
241
206
|
padding: 0;
|
|
242
207
|
line-height: 18px;
|
|
243
|
-
|
|
244
|
-
${theme.roundedCornersOptOut && css`
|
|
245
|
-
border-radius: 0 12px 12px 0;
|
|
246
|
-
`}
|
|
247
208
|
}
|
|
248
209
|
`}
|
|
249
210
|
`}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
-
import React, { useEffect, useState
|
|
2
|
+
import React, { useEffect, useState } from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
import MD5 from "crypto-js/md5";
|
|
5
5
|
import invariant from "invariant";
|
|
@@ -9,7 +9,6 @@ import tagComponent from "../../__internal__/utils/helpers/tags/tags";
|
|
|
9
9
|
import { PORTRAIT_SIZE_PARAMS } from "./portrait.config";
|
|
10
10
|
import { StyledCustomImg, StyledIcon, StyledPortraitContainer, StyledPortraitInitials, StyledPortraitGravatar } from "./portrait.style";
|
|
11
11
|
import { filterStyledSystemMarginProps } from "../../style/utils";
|
|
12
|
-
import RoundedCornersOptOutContext from "../carbon-provider/__internal__/new-validation.context";
|
|
13
12
|
let deprecatedGravatarWarnTriggered = false;
|
|
14
13
|
const Portrait = ({
|
|
15
14
|
alt,
|
|
@@ -18,7 +17,7 @@ const Portrait = ({
|
|
|
18
17
|
gravatar = "",
|
|
19
18
|
iconType = "individual",
|
|
20
19
|
initials,
|
|
21
|
-
shape,
|
|
20
|
+
shape = "circle",
|
|
22
21
|
size = "M",
|
|
23
22
|
src,
|
|
24
23
|
onClick,
|
|
@@ -33,10 +32,6 @@ const Portrait = ({
|
|
|
33
32
|
...rest
|
|
34
33
|
}) => {
|
|
35
34
|
const [externalError, setExternalError] = useState(false);
|
|
36
|
-
const {
|
|
37
|
-
roundedCornersOptOut
|
|
38
|
-
} = useContext(RoundedCornersOptOutContext);
|
|
39
|
-
const defaultShape = roundedCornersOptOut ? "square" : "circle";
|
|
40
35
|
!!(src && gravatar) ? process.env.NODE_ENV !== "production" ? invariant(false, "The `src` prop cannot be used in conjunction with the `gravatar` prop." + " Please use one or the other.") : invariant(false) : void 0;
|
|
41
36
|
const logGravatarDeprecationWarning = () => {
|
|
42
37
|
deprecatedGravatarWarnTriggered = true;
|
|
@@ -99,7 +94,7 @@ const Portrait = ({
|
|
|
99
94
|
}, tagProps, {
|
|
100
95
|
darkBackground: darkBackground,
|
|
101
96
|
size: size,
|
|
102
|
-
shape: shape
|
|
97
|
+
shape: shape
|
|
103
98
|
}), portrait));
|
|
104
99
|
}
|
|
105
100
|
return /*#__PURE__*/React.createElement(StyledPortraitContainer, _extends({}, filterStyledSystemMarginProps(rest), {
|
|
@@ -107,7 +102,7 @@ const Portrait = ({
|
|
|
107
102
|
}, tagProps, {
|
|
108
103
|
darkBackground: darkBackground,
|
|
109
104
|
size: size,
|
|
110
|
-
shape: shape
|
|
105
|
+
shape: shape
|
|
111
106
|
}), portrait);
|
|
112
107
|
};
|
|
113
108
|
return renderComponent();
|
|
@@ -47,8 +47,7 @@ const StyledProgressTracker = styled.div`
|
|
|
47
47
|
const StyledProgressBar = styled.span`
|
|
48
48
|
${({
|
|
49
49
|
progress,
|
|
50
|
-
error
|
|
51
|
-
theme
|
|
50
|
+
error
|
|
52
51
|
}) => css`
|
|
53
52
|
display: flex;
|
|
54
53
|
position: relative;
|
|
@@ -57,7 +56,7 @@ const StyledProgressBar = styled.span`
|
|
|
57
56
|
progress,
|
|
58
57
|
error
|
|
59
58
|
})};
|
|
60
|
-
border-radius:
|
|
59
|
+
border-radius: var(--borderRadius400);
|
|
61
60
|
overflow-x: hidden;
|
|
62
61
|
width: 100%
|
|
63
62
|
min-height: fit-content;
|
|
@@ -108,8 +107,7 @@ const InnerBar = styled.span`
|
|
|
108
107
|
${({
|
|
109
108
|
progress,
|
|
110
109
|
size,
|
|
111
|
-
error
|
|
112
|
-
theme
|
|
110
|
+
error
|
|
113
111
|
}) => css`
|
|
114
112
|
position: relative;
|
|
115
113
|
left: 0;
|
|
@@ -117,7 +115,7 @@ const InnerBar = styled.span`
|
|
|
117
115
|
progress,
|
|
118
116
|
error
|
|
119
117
|
})};
|
|
120
|
-
border-radius:
|
|
118
|
+
border-radius: var(--borderRadius400);
|
|
121
119
|
width: ${progress}%;
|
|
122
120
|
min-width: 2px;
|
|
123
121
|
height: ${getHeight(size)};
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { ThemeObject } from "../../../style/themes/base";
|
|
2
1
|
import { SwitchSliderProps } from "./switch-slider.component";
|
|
3
2
|
interface StyledSwitchSliderProps extends Pick<SwitchSliderProps, "checked" | "disabled" | "size" | "error" | "warning"> {
|
|
4
3
|
isLoading?: boolean;
|
|
5
|
-
theme?: Partial<ThemeObject>;
|
|
6
4
|
isDarkBackground?: boolean;
|
|
7
5
|
}
|
|
8
|
-
declare const StyledSwitchSlider: import("styled-components").StyledComponent<"div", any,
|
|
6
|
+
declare const StyledSwitchSlider: import("styled-components").StyledComponent<"div", any, StyledSwitchSliderProps, never>;
|
|
9
7
|
declare const HiddenContent: import("styled-components").StyledComponent<"div", any, Pick<StyledSwitchSliderProps, "size">, never>;
|
|
10
8
|
export { StyledSwitchSlider, HiddenContent };
|
|
11
9
|
export default StyledSwitchSlider;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
2
|
import StyledValidationIcon from "../../../__internal__/validations/validation-icon.style";
|
|
3
|
-
import baseTheme from "../../../style/themes/base";
|
|
4
3
|
import SwitchSliderPanel from "./switch-slider-panel.style";
|
|
5
4
|
const StyledSwitchSlider = styled.div`
|
|
6
5
|
${({
|
|
@@ -10,7 +9,6 @@ const StyledSwitchSlider = styled.div`
|
|
|
10
9
|
size,
|
|
11
10
|
error,
|
|
12
11
|
warning,
|
|
13
|
-
theme,
|
|
14
12
|
isDarkBackground
|
|
15
13
|
}) => css`
|
|
16
14
|
display: flex;
|
|
@@ -24,7 +22,7 @@ const StyledSwitchSlider = styled.div`
|
|
|
24
22
|
top: 0;
|
|
25
23
|
width: 100%
|
|
26
24
|
z-index: 2;
|
|
27
|
-
border-radius:
|
|
25
|
+
border-radius: var(--borderRadius400);
|
|
28
26
|
border-style: solid;
|
|
29
27
|
border-color: ${isDarkBackground ? "var(--colorsUtilityYang100)" : "var(--colorsActionMinor400)"};
|
|
30
28
|
border-width: var(--borderWidth200);
|
|
@@ -83,10 +81,6 @@ const StyledSwitchSlider = styled.div`
|
|
|
83
81
|
`}
|
|
84
82
|
`}
|
|
85
83
|
|
|
86
|
-
${size === "large" && css`
|
|
87
|
-
${theme?.roundedCornersOptOut ? "border-radius: 30px;" : ""}
|
|
88
|
-
`}
|
|
89
|
-
|
|
90
84
|
${isLoading && css`
|
|
91
85
|
&::before {
|
|
92
86
|
display: none;
|
|
@@ -117,8 +111,5 @@ const HiddenContent = styled.div`
|
|
|
117
111
|
padding-left: ${size === "large" ? "var(--spacing700)" : "var(--spacing500)"};
|
|
118
112
|
`}
|
|
119
113
|
`;
|
|
120
|
-
StyledSwitchSlider.defaultProps = {
|
|
121
|
-
theme: baseTheme
|
|
122
|
-
};
|
|
123
114
|
export { StyledSwitchSlider, HiddenContent };
|
|
124
115
|
export default StyledSwitchSlider;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { ThemeObject } from "../../themes/base";
|
|
2
|
-
import { CarbonProviderProps } from "../../../components/carbon-provider";
|
|
3
2
|
/**
|
|
4
3
|
*
|
|
5
4
|
* Converts theme properties to css variables form and set them locally for
|
|
6
5
|
* given scope
|
|
7
6
|
*
|
|
8
7
|
*/
|
|
9
|
-
declare const CarbonScopedTokensProvider: import("styled-components").StyledComponent<"div", any, ThemeObject
|
|
8
|
+
declare const CarbonScopedTokensProvider: import("styled-components").StyledComponent<"div", any, ThemeObject, never>;
|
|
10
9
|
export default CarbonScopedTokensProvider;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
2
|
import { baseTheme } from "../../themes";
|
|
3
3
|
import generateCssVariables from "../generate-css-variables.util";
|
|
4
|
+
|
|
4
5
|
/**
|
|
5
6
|
*
|
|
6
7
|
* Converts theme properties to css variables form and set them locally for
|
|
@@ -16,7 +17,7 @@ const CarbonScopedTokensProvider = styled.div`
|
|
|
16
17
|
|
|
17
18
|
${({
|
|
18
19
|
theme
|
|
19
|
-
}) => generateCssVariables(theme.compatibility
|
|
20
|
+
}) => generateCssVariables(theme.compatibility)}
|
|
20
21
|
`;
|
|
21
22
|
CarbonScopedTokensProvider.defaultProps = {
|
|
22
23
|
theme: baseTheme
|
|
@@ -7,5 +7,5 @@ import { ThemeObject } from "../themes/base";
|
|
|
7
7
|
* form of CSS variables along with styled-components ThemeProvider.
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
|
-
declare const _default: (theme: ThemeObject | Record<string, string
|
|
10
|
+
declare const _default: (theme: ThemeObject | Record<string, string>) => string;
|
|
11
11
|
export default _default;
|
|
@@ -7,9 +7,4 @@
|
|
|
7
7
|
*
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
export default
|
|
11
|
-
if (roundedCornersOptOut && key.startsWith("borderRadius") && key !== "borderRadiusCircle") {
|
|
12
|
-
return `--${key}: 0px;`;
|
|
13
|
-
}
|
|
14
|
-
return `--${key}: ${value};`;
|
|
15
|
-
}).join("\r\n");
|
|
10
|
+
export default theme => Object.entries(theme).map(([key, value]) => `--${key}: ${value};`).join("\r\n");
|
|
@@ -32,11 +32,10 @@ const StyledBox = _styledComponents.default.div`
|
|
|
32
32
|
${calculatePosition}
|
|
33
33
|
|
|
34
34
|
${({
|
|
35
|
-
theme,
|
|
36
35
|
borderRadius = "borderRadius000"
|
|
37
|
-
}) =>
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
}) => (0, _styledComponents.css)`
|
|
37
|
+
border-radius: var(--${borderRadius});
|
|
38
|
+
`}
|
|
40
39
|
|
|
41
40
|
${({
|
|
42
41
|
cssProps,
|
|
@@ -4,10 +4,6 @@ export interface NewValidationContextProps {
|
|
|
4
4
|
*
|
|
5
5
|
* NOTE - Will eventually be set to `true` by default in the future. */
|
|
6
6
|
validationRedesignOptIn?: boolean;
|
|
7
|
-
/** (Deprecated) Feature flag for opting out of styling components to have rounded corners.
|
|
8
|
-
*
|
|
9
|
-
* NOTE - This feature flag will soon be removed, along with the legacy styling. */
|
|
10
|
-
roundedCornersOptOut?: boolean;
|
|
11
7
|
/** (Deprecated) Feature flag for opting out of the focus redesign.
|
|
12
8
|
*
|
|
13
9
|
* NOTE - This feature flag will soon be removed, along with the legacy styling. */
|
|
@@ -6,5 +6,5 @@ export interface CarbonProviderProps extends NewValidationContextProps {
|
|
|
6
6
|
/** Theme which specifies styles to apply to all child components. Set to `sageTheme` by default. */
|
|
7
7
|
theme?: Partial<ThemeObject>;
|
|
8
8
|
}
|
|
9
|
-
export declare const CarbonProvider: ({ children, theme, validationRedesignOptIn,
|
|
9
|
+
export declare const CarbonProvider: ({ children, theme, validationRedesignOptIn, focusRedesignOptOut, }: CarbonProviderProps) => React.JSX.Element;
|
|
10
10
|
export default CarbonProvider;
|
|
@@ -15,25 +15,17 @@ var _logger = _interopRequireDefault(require("../../__internal__/utils/logger"))
|
|
|
15
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
16
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
17
17
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
|
-
let deprecatedRoundedCornersOptOut = false;
|
|
19
18
|
let deprecatedFocusRedesignOptOut = false;
|
|
20
19
|
const CarbonProvider = ({
|
|
21
20
|
children,
|
|
22
21
|
theme = _themes.sageTheme,
|
|
23
22
|
validationRedesignOptIn = false,
|
|
24
|
-
roundedCornersOptOut = false,
|
|
25
23
|
focusRedesignOptOut = false
|
|
26
24
|
}) => {
|
|
27
25
|
const {
|
|
28
|
-
roundedCornersOptOut: existingRoundedCornersOptOut,
|
|
29
26
|
focusRedesignOptOut: existingFocusRedesignOptOut
|
|
30
27
|
} = (0, _react.useContext)(_newValidation.default);
|
|
31
|
-
const roundedCornersOptOutValue = existingRoundedCornersOptOut || roundedCornersOptOut;
|
|
32
28
|
const focusRedesignOptOutValue = existingFocusRedesignOptOut || focusRedesignOptOut;
|
|
33
|
-
if (!deprecatedRoundedCornersOptOut && roundedCornersOptOutValue) {
|
|
34
|
-
deprecatedRoundedCornersOptOut = true;
|
|
35
|
-
_logger.default.deprecate("The `roundedCornersOptOut` feature flag has been deprecated and will soon be removed. " + "Along with this feature flag, the legacy pre-rounded corners styling will also be removed. ");
|
|
36
|
-
}
|
|
37
29
|
if (!deprecatedFocusRedesignOptOut && focusRedesignOptOutValue) {
|
|
38
30
|
deprecatedFocusRedesignOptOut = true;
|
|
39
31
|
_logger.default.deprecate("The `focusRedesignOptOut` feature flag has been deprecated and will soon be removed. " + "Along with this feature flag, the legacy focus styling will also be removed. ");
|
|
@@ -41,13 +33,11 @@ const CarbonProvider = ({
|
|
|
41
33
|
return /*#__PURE__*/_react.default.createElement(_styledComponents.ThemeProvider, {
|
|
42
34
|
theme: {
|
|
43
35
|
...theme,
|
|
44
|
-
roundedCornersOptOut: roundedCornersOptOutValue,
|
|
45
36
|
focusRedesignOptOut: focusRedesignOptOutValue
|
|
46
37
|
}
|
|
47
38
|
}, /*#__PURE__*/_react.default.createElement(_carbonScopedTokensProvider.default, null, /*#__PURE__*/_react.default.createElement(_newValidation.default.Provider, {
|
|
48
39
|
value: {
|
|
49
|
-
validationRedesignOptIn
|
|
50
|
-
roundedCornersOptOut: roundedCornersOptOutValue
|
|
40
|
+
validationRedesignOptIn
|
|
51
41
|
}
|
|
52
42
|
}, /*#__PURE__*/_react.default.createElement(_topModalProvider.default, null, children))));
|
|
53
43
|
};
|
|
@@ -3,7 +3,7 @@ import { SpaceProps } from "styled-system";
|
|
|
3
3
|
import { StyledDismissibleBoxProps } from "./dismissible-box.style";
|
|
4
4
|
import { BoxProps } from "../box";
|
|
5
5
|
import { TagProps } from "../../__internal__/utils/helpers/tags";
|
|
6
|
-
export interface DismissibleBoxProps extends SpaceProps, StyledDismissibleBoxProps, Omit<BoxProps, "display" | "justifyContent">, Omit<TagProps, "data-component"> {
|
|
6
|
+
export interface DismissibleBoxProps extends SpaceProps, StyledDismissibleBoxProps, Omit<BoxProps, "display" | "justifyContent" | "bg" | "backgroundColor">, Omit<TagProps, "data-component"> {
|
|
7
7
|
/** The content to render in the component */
|
|
8
8
|
children?: React.ReactNode;
|
|
9
9
|
/** Data tag prop bag for close Button */
|
|
@@ -19,7 +19,7 @@ const loaderAnimation = (0, _styledComponents.keyframes)`
|
|
|
19
19
|
transform: scale(1);
|
|
20
20
|
}
|
|
21
21
|
`;
|
|
22
|
-
const getDimensions =
|
|
22
|
+
const getDimensions = size => {
|
|
23
23
|
let width;
|
|
24
24
|
let marginRight;
|
|
25
25
|
switch (size) {
|
|
@@ -39,7 +39,6 @@ const getDimensions = (size, roundedCornersOptOut) => {
|
|
|
39
39
|
width: ${width};
|
|
40
40
|
height: ${width};
|
|
41
41
|
margin-right: ${marginRight};
|
|
42
|
-
${!roundedCornersOptOut && "border-radius: var(--borderRadiusCircle);"}
|
|
43
42
|
`;
|
|
44
43
|
};
|
|
45
44
|
const StyledLoaderSquare = _styledComponents.default.div`
|
|
@@ -47,13 +46,13 @@ const StyledLoaderSquare = _styledComponents.default.div`
|
|
|
47
46
|
size,
|
|
48
47
|
isInsideButton,
|
|
49
48
|
isActive,
|
|
50
|
-
theme,
|
|
51
49
|
backgroundColor
|
|
52
50
|
}) => (0, _styledComponents.css)`
|
|
53
51
|
animation: ${loaderAnimation} 1s infinite ease-in-out both;
|
|
54
52
|
background-color: ${backgroundColor};
|
|
55
53
|
display: inline-block;
|
|
56
|
-
${getDimensions(size
|
|
54
|
+
${getDimensions(size)}
|
|
55
|
+
border-radius: var(--borderRadiusCircle);
|
|
57
56
|
|
|
58
57
|
${isInsideButton && (0, _styledComponents.css)`
|
|
59
58
|
background-color: ${isActive ? "var(--colorsUtilityYang100)" : "var(--colorsSemanticNeutral500)"};
|
|
@@ -67,9 +67,7 @@ const StyledPill = _styledComponents.default.span`
|
|
|
67
67
|
align-items: center;
|
|
68
68
|
justify-content: center;
|
|
69
69
|
border: 2px solid ${pillColor};
|
|
70
|
-
|
|
71
|
-
border-radius: var(--borderRadius025);
|
|
72
|
-
`}
|
|
70
|
+
border-radius: var(--borderRadius025);
|
|
73
71
|
height: auto;
|
|
74
72
|
|
|
75
73
|
${!wrapText && (0, _styledComponents.css)`
|
|
@@ -96,10 +94,6 @@ const StyledPill = _styledComponents.default.span`
|
|
|
96
94
|
line-height: 16px;
|
|
97
95
|
font-size: 12px;
|
|
98
96
|
padding: 0 8px;
|
|
99
|
-
|
|
100
|
-
${theme.roundedCornersOptOut && (0, _styledComponents.css)`
|
|
101
|
-
border-radius: 12px;
|
|
102
|
-
`}
|
|
103
97
|
`}
|
|
104
98
|
|
|
105
99
|
${size === "M" && (0, _styledComponents.css)`
|
|
@@ -107,10 +101,6 @@ const StyledPill = _styledComponents.default.span`
|
|
|
107
101
|
line-height: 20px;
|
|
108
102
|
font-size: 14px;
|
|
109
103
|
padding: 0 8px;
|
|
110
|
-
|
|
111
|
-
${theme.roundedCornersOptOut && (0, _styledComponents.css)`
|
|
112
|
-
border-radius: 12px;
|
|
113
|
-
`}
|
|
114
104
|
`}
|
|
115
105
|
|
|
116
106
|
${size === "L" && (0, _styledComponents.css)`
|
|
@@ -118,10 +108,6 @@ const StyledPill = _styledComponents.default.span`
|
|
|
118
108
|
line-height: 24px;
|
|
119
109
|
font-size: 14px;
|
|
120
110
|
padding: 0 8px;
|
|
121
|
-
|
|
122
|
-
${theme.roundedCornersOptOut && (0, _styledComponents.css)`
|
|
123
|
-
border-radius: 13px;
|
|
124
|
-
`}
|
|
125
111
|
`}
|
|
126
112
|
|
|
127
113
|
${size === "XL" && (0, _styledComponents.css)`
|
|
@@ -129,18 +115,12 @@ const StyledPill = _styledComponents.default.span`
|
|
|
129
115
|
line-height: 28px;
|
|
130
116
|
font-size: 16px;
|
|
131
117
|
padding: 0 12px;
|
|
132
|
-
|
|
133
|
-
${theme.roundedCornersOptOut && (0, _styledComponents.css)`
|
|
134
|
-
border-radius: 15px;
|
|
135
|
-
`}
|
|
136
118
|
`}
|
|
137
119
|
|
|
138
120
|
${isDeletable && (0, _styledComponents.css)`
|
|
139
121
|
${_iconButton.default} {
|
|
140
122
|
-webkit-appearance: none;
|
|
141
|
-
|
|
142
|
-
border-radius: var(--borderRadius000);
|
|
143
|
-
`}
|
|
123
|
+
border-radius: var(--borderRadius000);
|
|
144
124
|
border: none;
|
|
145
125
|
bottom: 0;
|
|
146
126
|
font-size: 100%;
|
|
@@ -159,11 +139,8 @@ const StyledPill = _styledComponents.default.span`
|
|
|
159
139
|
`}
|
|
160
140
|
|
|
161
141
|
background-color: ${buttonFocusColor};
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
var(--borderRadius025) var(--borderRadius000);
|
|
165
|
-
`}
|
|
166
|
-
|
|
142
|
+
border-radius: var(--borderRadius000) var(--borderRadius025)
|
|
143
|
+
var(--borderRadius025) var(--borderRadius000);
|
|
167
144
|
::-moz-focus-inner {
|
|
168
145
|
border: 0;
|
|
169
146
|
}
|
|
@@ -207,10 +184,6 @@ const StyledPill = _styledComponents.default.span`
|
|
|
207
184
|
font-size: 16px;
|
|
208
185
|
}
|
|
209
186
|
}
|
|
210
|
-
|
|
211
|
-
${theme.roundedCornersOptOut && (0, _styledComponents.css)`
|
|
212
|
-
border-radius: 0 10px 10px 0;
|
|
213
|
-
`}
|
|
214
187
|
}
|
|
215
188
|
`}
|
|
216
189
|
|
|
@@ -221,10 +194,6 @@ const StyledPill = _styledComponents.default.span`
|
|
|
221
194
|
width: 24px;
|
|
222
195
|
padding: 0;
|
|
223
196
|
line-height: 15px;
|
|
224
|
-
|
|
225
|
-
${theme.roundedCornersOptOut && (0, _styledComponents.css)`
|
|
226
|
-
border-radius: 0 10px 10px 0;
|
|
227
|
-
`}
|
|
228
197
|
}
|
|
229
198
|
`}
|
|
230
199
|
|
|
@@ -235,10 +204,6 @@ const StyledPill = _styledComponents.default.span`
|
|
|
235
204
|
width: 28px;
|
|
236
205
|
padding: 0;
|
|
237
206
|
line-height: 16px;
|
|
238
|
-
|
|
239
|
-
${theme.roundedCornersOptOut && (0, _styledComponents.css)`
|
|
240
|
-
border-radius: 0 11px 11px 0;
|
|
241
|
-
`}
|
|
242
207
|
}
|
|
243
208
|
`}
|
|
244
209
|
|
|
@@ -249,10 +214,6 @@ const StyledPill = _styledComponents.default.span`
|
|
|
249
214
|
width: 32px;
|
|
250
215
|
padding: 0;
|
|
251
216
|
line-height: 18px;
|
|
252
|
-
|
|
253
|
-
${theme.roundedCornersOptOut && (0, _styledComponents.css)`
|
|
254
|
-
border-radius: 0 12px 12px 0;
|
|
255
|
-
`}
|
|
256
217
|
}
|
|
257
218
|
`}
|
|
258
219
|
`}
|
|
@@ -14,7 +14,6 @@ var _tags = _interopRequireDefault(require("../../__internal__/utils/helpers/tag
|
|
|
14
14
|
var _portrait = require("./portrait.config");
|
|
15
15
|
var _portrait2 = require("./portrait.style");
|
|
16
16
|
var _utils = require("../../style/utils");
|
|
17
|
-
var _newValidation = _interopRequireDefault(require("../carbon-provider/__internal__/new-validation.context"));
|
|
18
17
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
19
18
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
20
19
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -27,7 +26,7 @@ const Portrait = ({
|
|
|
27
26
|
gravatar = "",
|
|
28
27
|
iconType = "individual",
|
|
29
28
|
initials,
|
|
30
|
-
shape,
|
|
29
|
+
shape = "circle",
|
|
31
30
|
size = "M",
|
|
32
31
|
src,
|
|
33
32
|
onClick,
|
|
@@ -42,10 +41,6 @@ const Portrait = ({
|
|
|
42
41
|
...rest
|
|
43
42
|
}) => {
|
|
44
43
|
const [externalError, setExternalError] = (0, _react.useState)(false);
|
|
45
|
-
const {
|
|
46
|
-
roundedCornersOptOut
|
|
47
|
-
} = (0, _react.useContext)(_newValidation.default);
|
|
48
|
-
const defaultShape = roundedCornersOptOut ? "square" : "circle";
|
|
49
44
|
!!(src && gravatar) ? process.env.NODE_ENV !== "production" ? (0, _invariant.default)(false, "The `src` prop cannot be used in conjunction with the `gravatar` prop." + " Please use one or the other.") : (0, _invariant.default)(false) : void 0;
|
|
50
45
|
const logGravatarDeprecationWarning = () => {
|
|
51
46
|
deprecatedGravatarWarnTriggered = true;
|
|
@@ -108,7 +103,7 @@ const Portrait = ({
|
|
|
108
103
|
}, tagProps, {
|
|
109
104
|
darkBackground: darkBackground,
|
|
110
105
|
size: size,
|
|
111
|
-
shape: shape
|
|
106
|
+
shape: shape
|
|
112
107
|
}), portrait));
|
|
113
108
|
}
|
|
114
109
|
return /*#__PURE__*/_react.default.createElement(_portrait2.StyledPortraitContainer, _extends({}, (0, _utils.filterStyledSystemMarginProps)(rest), {
|
|
@@ -116,7 +111,7 @@ const Portrait = ({
|
|
|
116
111
|
}, tagProps, {
|
|
117
112
|
darkBackground: darkBackground,
|
|
118
113
|
size: size,
|
|
119
|
-
shape: shape
|
|
114
|
+
shape: shape
|
|
120
115
|
}), portrait);
|
|
121
116
|
};
|
|
122
117
|
return renderComponent();
|
|
@@ -56,8 +56,7 @@ const StyledProgressTracker = exports.StyledProgressTracker = _styledComponents.
|
|
|
56
56
|
const StyledProgressBar = exports.StyledProgressBar = _styledComponents.default.span`
|
|
57
57
|
${({
|
|
58
58
|
progress,
|
|
59
|
-
error
|
|
60
|
-
theme
|
|
59
|
+
error
|
|
61
60
|
}) => (0, _styledComponents.css)`
|
|
62
61
|
display: flex;
|
|
63
62
|
position: relative;
|
|
@@ -66,7 +65,7 @@ const StyledProgressBar = exports.StyledProgressBar = _styledComponents.default.
|
|
|
66
65
|
progress,
|
|
67
66
|
error
|
|
68
67
|
})};
|
|
69
|
-
border-radius:
|
|
68
|
+
border-radius: var(--borderRadius400);
|
|
70
69
|
overflow-x: hidden;
|
|
71
70
|
width: 100%
|
|
72
71
|
min-height: fit-content;
|
|
@@ -117,8 +116,7 @@ const InnerBar = exports.InnerBar = _styledComponents.default.span`
|
|
|
117
116
|
${({
|
|
118
117
|
progress,
|
|
119
118
|
size,
|
|
120
|
-
error
|
|
121
|
-
theme
|
|
119
|
+
error
|
|
122
120
|
}) => (0, _styledComponents.css)`
|
|
123
121
|
position: relative;
|
|
124
122
|
left: 0;
|
|
@@ -126,7 +124,7 @@ const InnerBar = exports.InnerBar = _styledComponents.default.span`
|
|
|
126
124
|
progress,
|
|
127
125
|
error
|
|
128
126
|
})};
|
|
129
|
-
border-radius:
|
|
127
|
+
border-radius: var(--borderRadius400);
|
|
130
128
|
width: ${progress}%;
|
|
131
129
|
min-width: 2px;
|
|
132
130
|
height: ${getHeight(size)};
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { ThemeObject } from "../../../style/themes/base";
|
|
2
1
|
import { SwitchSliderProps } from "./switch-slider.component";
|
|
3
2
|
interface StyledSwitchSliderProps extends Pick<SwitchSliderProps, "checked" | "disabled" | "size" | "error" | "warning"> {
|
|
4
3
|
isLoading?: boolean;
|
|
5
|
-
theme?: Partial<ThemeObject>;
|
|
6
4
|
isDarkBackground?: boolean;
|
|
7
5
|
}
|
|
8
|
-
declare const StyledSwitchSlider: import("styled-components").StyledComponent<"div", any,
|
|
6
|
+
declare const StyledSwitchSlider: import("styled-components").StyledComponent<"div", any, StyledSwitchSliderProps, never>;
|
|
9
7
|
declare const HiddenContent: import("styled-components").StyledComponent<"div", any, Pick<StyledSwitchSliderProps, "size">, never>;
|
|
10
8
|
export { StyledSwitchSlider, HiddenContent };
|
|
11
9
|
export default StyledSwitchSlider;
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = exports.StyledSwitchSlider = exports.HiddenContent = void 0;
|
|
7
7
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
8
8
|
var _validationIcon = _interopRequireDefault(require("../../../__internal__/validations/validation-icon.style"));
|
|
9
|
-
var _base = _interopRequireDefault(require("../../../style/themes/base"));
|
|
10
9
|
var _switchSliderPanel = _interopRequireDefault(require("./switch-slider-panel.style"));
|
|
11
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
11
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
@@ -19,7 +18,6 @@ const StyledSwitchSlider = exports.StyledSwitchSlider = _styledComponents.defaul
|
|
|
19
18
|
size,
|
|
20
19
|
error,
|
|
21
20
|
warning,
|
|
22
|
-
theme,
|
|
23
21
|
isDarkBackground
|
|
24
22
|
}) => (0, _styledComponents.css)`
|
|
25
23
|
display: flex;
|
|
@@ -33,7 +31,7 @@ const StyledSwitchSlider = exports.StyledSwitchSlider = _styledComponents.defaul
|
|
|
33
31
|
top: 0;
|
|
34
32
|
width: 100%
|
|
35
33
|
z-index: 2;
|
|
36
|
-
border-radius:
|
|
34
|
+
border-radius: var(--borderRadius400);
|
|
37
35
|
border-style: solid;
|
|
38
36
|
border-color: ${isDarkBackground ? "var(--colorsUtilityYang100)" : "var(--colorsActionMinor400)"};
|
|
39
37
|
border-width: var(--borderWidth200);
|
|
@@ -92,10 +90,6 @@ const StyledSwitchSlider = exports.StyledSwitchSlider = _styledComponents.defaul
|
|
|
92
90
|
`}
|
|
93
91
|
`}
|
|
94
92
|
|
|
95
|
-
${size === "large" && (0, _styledComponents.css)`
|
|
96
|
-
${theme?.roundedCornersOptOut ? "border-radius: 30px;" : ""}
|
|
97
|
-
`}
|
|
98
|
-
|
|
99
93
|
${isLoading && (0, _styledComponents.css)`
|
|
100
94
|
&::before {
|
|
101
95
|
display: none;
|
|
@@ -126,7 +120,4 @@ const HiddenContent = exports.HiddenContent = _styledComponents.default.div`
|
|
|
126
120
|
padding-left: ${size === "large" ? "var(--spacing700)" : "var(--spacing500)"};
|
|
127
121
|
`}
|
|
128
122
|
`;
|
|
129
|
-
StyledSwitchSlider.defaultProps = {
|
|
130
|
-
theme: _base.default
|
|
131
|
-
};
|
|
132
123
|
var _default = exports.default = StyledSwitchSlider;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { ThemeObject } from "../../themes/base";
|
|
2
|
-
import { CarbonProviderProps } from "../../../components/carbon-provider";
|
|
3
2
|
/**
|
|
4
3
|
*
|
|
5
4
|
* Converts theme properties to css variables form and set them locally for
|
|
6
5
|
* given scope
|
|
7
6
|
*
|
|
8
7
|
*/
|
|
9
|
-
declare const CarbonScopedTokensProvider: import("styled-components").StyledComponent<"div", any, ThemeObject
|
|
8
|
+
declare const CarbonScopedTokensProvider: import("styled-components").StyledComponent<"div", any, ThemeObject, never>;
|
|
10
9
|
export default CarbonScopedTokensProvider;
|
|
@@ -23,7 +23,7 @@ const CarbonScopedTokensProvider = _styledComponents.default.div`
|
|
|
23
23
|
|
|
24
24
|
${({
|
|
25
25
|
theme
|
|
26
|
-
}) => (0, _generateCssVariables.default)(theme.compatibility
|
|
26
|
+
}) => (0, _generateCssVariables.default)(theme.compatibility)}
|
|
27
27
|
`;
|
|
28
28
|
CarbonScopedTokensProvider.defaultProps = {
|
|
29
29
|
theme: _themes.baseTheme
|
|
@@ -7,5 +7,5 @@ import { ThemeObject } from "../themes/base";
|
|
|
7
7
|
* form of CSS variables along with styled-components ThemeProvider.
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
|
-
declare const _default: (theme: ThemeObject | Record<string, string
|
|
10
|
+
declare const _default: (theme: ThemeObject | Record<string, string>) => string;
|
|
11
11
|
export default _default;
|
|
@@ -12,10 +12,5 @@ exports.default = void 0;
|
|
|
12
12
|
* form of CSS variables along with styled-components ThemeProvider.
|
|
13
13
|
*
|
|
14
14
|
*/
|
|
15
|
-
var _default =
|
|
16
|
-
if (roundedCornersOptOut && key.startsWith("borderRadius") && key !== "borderRadiusCircle") {
|
|
17
|
-
return `--${key}: 0px;`;
|
|
18
|
-
}
|
|
19
|
-
return `--${key}: ${value};`;
|
|
20
|
-
}).join("\r\n");
|
|
15
|
+
var _default = theme => Object.entries(theme).map(([key, value]) => `--${key}: ${value};`).join("\r\n");
|
|
21
16
|
exports.default = _default;
|