carbon-react 144.8.1 → 144.9.1
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/carbon-provider/__internal__/new-validation.context.d.ts +5 -2
- package/esm/components/carbon-provider/carbon-provider.component.js +11 -0
- package/esm/components/sidebar/__internal__/sidebar-header/sidebar-header.component.js +4 -2
- package/lib/components/carbon-provider/__internal__/new-validation.context.d.ts +5 -2
- package/lib/components/carbon-provider/carbon-provider.component.js +11 -0
- package/lib/components/sidebar/__internal__/sidebar-header/sidebar-header.component.js +4 -2
- package/package.json +1 -1
|
@@ -4,10 +4,13 @@ export interface NewValidationContextProps {
|
|
|
4
4
|
*
|
|
5
5
|
* NOTE - Will eventually be set to `true` by default in the future. */
|
|
6
6
|
validationRedesignOptIn?: boolean;
|
|
7
|
-
/** Feature flag for opting out of styling components to have rounded corners.
|
|
7
|
+
/** (Deprecated) Feature flag for opting out of styling components to have rounded corners.
|
|
8
8
|
*
|
|
9
|
-
* NOTE -
|
|
9
|
+
* NOTE - This feature flag will soon be removed, along with the legacy styling. */
|
|
10
10
|
roundedCornersOptOut?: boolean;
|
|
11
|
+
/** (Deprecated) Feature flag for opting out of the focus redesign.
|
|
12
|
+
*
|
|
13
|
+
* NOTE - This feature flag will soon be removed, along with the legacy styling. */
|
|
11
14
|
focusRedesignOptOut?: boolean;
|
|
12
15
|
}
|
|
13
16
|
declare const _default: React.Context<NewValidationContextProps>;
|
|
@@ -5,6 +5,9 @@ import CarbonScopedTokensProvider from "../../style/design-tokens/carbon-scoped-
|
|
|
5
5
|
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
|
+
import Logger from "../../__internal__/utils/logger";
|
|
9
|
+
let deprecatedRoundedCornersOptOut = false;
|
|
10
|
+
let deprecatedFocusRedesignOptOut = false;
|
|
8
11
|
export const CarbonProvider = ({
|
|
9
12
|
children,
|
|
10
13
|
theme = sageTheme,
|
|
@@ -18,6 +21,14 @@ export const CarbonProvider = ({
|
|
|
18
21
|
} = useContext(NewValidationContext);
|
|
19
22
|
const roundedCornersOptOutValue = existingRoundedCornersOptOut || roundedCornersOptOut;
|
|
20
23
|
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
|
+
if (!deprecatedFocusRedesignOptOut && focusRedesignOptOutValue) {
|
|
29
|
+
deprecatedFocusRedesignOptOut = true;
|
|
30
|
+
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. ");
|
|
31
|
+
}
|
|
21
32
|
return /*#__PURE__*/React.createElement(ThemeProvider, {
|
|
22
33
|
theme: {
|
|
23
34
|
...theme,
|
|
@@ -9,9 +9,11 @@ const SidebarHeader = ({
|
|
|
9
9
|
...rest
|
|
10
10
|
}) => /*#__PURE__*/React.createElement(StyledSidebarHeader, _extends({
|
|
11
11
|
hasClose: !!closeIcon,
|
|
12
|
-
id: id,
|
|
13
12
|
"data-component": "sidebar-header",
|
|
14
13
|
p: "27px 32px 32px"
|
|
15
|
-
}, rest),
|
|
14
|
+
}, rest), /*#__PURE__*/React.createElement("div", {
|
|
15
|
+
"data-element": "sidebar-heading",
|
|
16
|
+
id: id
|
|
17
|
+
}, children), closeIcon);
|
|
16
18
|
SidebarHeader.displayName = "SidebarHeader";
|
|
17
19
|
export default SidebarHeader;
|
|
@@ -4,10 +4,13 @@ export interface NewValidationContextProps {
|
|
|
4
4
|
*
|
|
5
5
|
* NOTE - Will eventually be set to `true` by default in the future. */
|
|
6
6
|
validationRedesignOptIn?: boolean;
|
|
7
|
-
/** Feature flag for opting out of styling components to have rounded corners.
|
|
7
|
+
/** (Deprecated) Feature flag for opting out of styling components to have rounded corners.
|
|
8
8
|
*
|
|
9
|
-
* NOTE -
|
|
9
|
+
* NOTE - This feature flag will soon be removed, along with the legacy styling. */
|
|
10
10
|
roundedCornersOptOut?: boolean;
|
|
11
|
+
/** (Deprecated) Feature flag for opting out of the focus redesign.
|
|
12
|
+
*
|
|
13
|
+
* NOTE - This feature flag will soon be removed, along with the legacy styling. */
|
|
11
14
|
focusRedesignOptOut?: boolean;
|
|
12
15
|
}
|
|
13
16
|
declare const _default: React.Context<NewValidationContextProps>;
|
|
@@ -11,9 +11,12 @@ var _carbonScopedTokensProvider = _interopRequireDefault(require("../../style/de
|
|
|
11
11
|
var _themes = require("../../style/themes");
|
|
12
12
|
var _newValidation = _interopRequireDefault(require("./__internal__/new-validation.context"));
|
|
13
13
|
var _topModalProvider = _interopRequireDefault(require("./__internal__/top-modal-provider.component"));
|
|
14
|
+
var _logger = _interopRequireDefault(require("../../__internal__/utils/logger"));
|
|
14
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
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); }
|
|
16
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
|
+
let deprecatedFocusRedesignOptOut = false;
|
|
17
20
|
const CarbonProvider = ({
|
|
18
21
|
children,
|
|
19
22
|
theme = _themes.sageTheme,
|
|
@@ -27,6 +30,14 @@ const CarbonProvider = ({
|
|
|
27
30
|
} = (0, _react.useContext)(_newValidation.default);
|
|
28
31
|
const roundedCornersOptOutValue = existingRoundedCornersOptOut || roundedCornersOptOut;
|
|
29
32
|
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
|
+
if (!deprecatedFocusRedesignOptOut && focusRedesignOptOutValue) {
|
|
38
|
+
deprecatedFocusRedesignOptOut = true;
|
|
39
|
+
_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. ");
|
|
40
|
+
}
|
|
30
41
|
return /*#__PURE__*/_react.default.createElement(_styledComponents.ThemeProvider, {
|
|
31
42
|
theme: {
|
|
32
43
|
...theme,
|
|
@@ -16,9 +16,11 @@ const SidebarHeader = ({
|
|
|
16
16
|
...rest
|
|
17
17
|
}) => /*#__PURE__*/_react.default.createElement(_sidebarHeader.default, _extends({
|
|
18
18
|
hasClose: !!closeIcon,
|
|
19
|
-
id: id,
|
|
20
19
|
"data-component": "sidebar-header",
|
|
21
20
|
p: "27px 32px 32px"
|
|
22
|
-
}, rest),
|
|
21
|
+
}, rest), /*#__PURE__*/_react.default.createElement("div", {
|
|
22
|
+
"data-element": "sidebar-heading",
|
|
23
|
+
id: id
|
|
24
|
+
}, children), closeIcon);
|
|
23
25
|
SidebarHeader.displayName = "SidebarHeader";
|
|
24
26
|
var _default = exports.default = SidebarHeader;
|