carbon-react 109.6.0 → 110.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/__internal__/checkable-input/checkable-input-svg-wrapper.style.d.ts +2 -0
- package/esm/__internal__/checkable-input/checkable-input.style.d.ts +2 -0
- package/esm/__internal__/checkable-input/hidden-checkable-input.style.d.ts +2 -0
- package/esm/components/carbon-provider/carbon-provider.component.js +1 -0
- package/esm/components/checkbox/checkbox.style.d.ts +3 -0
- package/esm/components/dismissible-box/dismissible-box.component.d.ts +17 -0
- package/esm/components/dismissible-box/dismissible-box.component.js +2003 -37
- package/esm/components/dismissible-box/dismissible-box.style.d.ts +8 -0
- package/esm/components/dismissible-box/dismissible-box.style.js +9 -4
- package/esm/components/dismissible-box/index.d.ts +2 -1
- package/esm/components/fieldset/fieldset.component.d.ts +11 -0
- package/esm/components/fieldset/fieldset.component.js +158 -17
- package/esm/components/fieldset/fieldset.style.d.ts +8 -0
- package/esm/components/fieldset/index.d.ts +2 -1
- package/esm/components/global-header/global-header.component.d.ts +13 -0
- package/esm/components/global-header/global-header.component.js +1058 -0
- package/esm/components/global-header/index.d.ts +2 -0
- package/esm/components/global-header/index.js +1 -0
- package/esm/components/grid/grid-container/grid-container.component.js +4 -23
- package/esm/components/link/link.component.d.ts +0 -2
- package/esm/components/link/link.component.js +0 -4
- package/esm/components/menu/__internal__/submenu/submenu.component.js +1 -2
- package/esm/components/menu/menu.d.ts +2 -2
- package/esm/components/navigation-bar/navigation-bar.style.d.ts +10 -0
- package/esm/components/pages/pages.component.js +1 -0
- package/esm/components/pill/pill.component.js +1 -0
- package/esm/components/text-editor/__internal__/editor-link/editor-link.component.js +3 -4
- package/esm/global.d.ts +1 -0
- package/esm/style/themes/base/base-theme.config.d.ts +1 -0
- package/esm/style/themes/base/base-theme.config.js +2 -1
- package/esm/style/themes/sage/index.d.ts +1 -0
- package/lib/__internal__/checkable-input/checkable-input-svg-wrapper.style.d.ts +2 -0
- package/lib/__internal__/checkable-input/checkable-input.style.d.ts +2 -0
- package/lib/__internal__/checkable-input/hidden-checkable-input.style.d.ts +2 -0
- package/lib/components/carbon-provider/carbon-provider.component.js +1 -0
- package/lib/components/checkbox/checkbox.style.d.ts +3 -0
- package/lib/components/dismissible-box/dismissible-box.component.d.ts +17 -0
- package/lib/components/dismissible-box/dismissible-box.component.js +2005 -41
- package/lib/components/dismissible-box/dismissible-box.style.d.ts +8 -0
- package/lib/components/dismissible-box/dismissible-box.style.js +9 -6
- package/lib/components/dismissible-box/index.d.ts +2 -1
- package/lib/components/fieldset/fieldset.component.d.ts +11 -0
- package/lib/components/fieldset/fieldset.component.js +158 -19
- package/lib/components/fieldset/fieldset.style.d.ts +8 -0
- package/lib/components/fieldset/index.d.ts +2 -1
- package/lib/components/global-header/global-header.component.d.ts +13 -0
- package/lib/components/global-header/global-header.component.js +1078 -0
- package/lib/components/global-header/index.d.ts +2 -0
- package/lib/components/global-header/index.js +15 -0
- package/lib/components/global-header/package.json +6 -0
- package/lib/components/grid/grid-container/grid-container.component.js +4 -30
- package/lib/components/link/link.component.d.ts +0 -2
- package/lib/components/link/link.component.js +0 -4
- package/lib/components/menu/__internal__/submenu/submenu.component.js +1 -2
- package/lib/components/menu/menu.d.ts +2 -2
- package/lib/components/navigation-bar/navigation-bar.style.d.ts +10 -0
- package/lib/components/pages/pages.component.js +1 -0
- package/lib/components/pill/pill.component.js +1 -0
- package/lib/components/text-editor/__internal__/editor-link/editor-link.component.js +3 -4
- package/lib/global.d.ts +1 -0
- package/lib/style/themes/base/base-theme.config.d.ts +1 -0
- package/lib/style/themes/base/base-theme.config.js +2 -1
- package/lib/style/themes/sage/index.d.ts +1 -0
- package/package.json +1 -1
- package/esm/components/dismissible-box/dismissible-box.d.ts +0 -18
- package/esm/components/fieldset/fieldset.d.ts +0 -15
- package/lib/components/dismissible-box/dismissible-box.d.ts +0 -18
- package/lib/components/fieldset/fieldset.d.ts +0 -15
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "default", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _globalHeader.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
var _globalHeader = _interopRequireDefault(require("./global-header.component"));
|
|
14
|
+
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -5,45 +5,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.GridContainer = void 0;
|
|
7
7
|
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
12
|
-
var _invariant = _interopRequireDefault(require("invariant"));
|
|
13
|
-
|
|
14
12
|
var _gridContainer = _interopRequireDefault(require("./grid-container.style"));
|
|
15
13
|
|
|
16
|
-
var _gridItem = _interopRequireDefault(require("../grid-item"));
|
|
17
|
-
|
|
18
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
15
|
|
|
20
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
21
|
-
|
|
22
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
-
|
|
24
16
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
25
17
|
|
|
26
|
-
const GridContainer = props => {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
...rest
|
|
30
|
-
} = props;
|
|
31
|
-
const hasProperChildren = (0, _react.useMemo)(() => {
|
|
32
|
-
const incorrectChild = _react.default.Children.toArray(children).find(child => {
|
|
33
|
-
if (! /*#__PURE__*/_react.default.isValidElement(child)) {
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return child.type.displayName !== _gridItem.default.displayName;
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
return !incorrectChild;
|
|
41
|
-
}, [children]);
|
|
42
|
-
!hasProperChildren ? process.env.NODE_ENV !== "production" ? (0, _invariant.default)(false, `GridContainer only accepts children of type ${_gridItem.default.displayName}.`) : (0, _invariant.default)(false) : void 0;
|
|
43
|
-
return /*#__PURE__*/_react.default.createElement(_gridContainer.default, _extends({
|
|
44
|
-
"data-component": "grid"
|
|
45
|
-
}, rest), children);
|
|
46
|
-
};
|
|
18
|
+
const GridContainer = props => /*#__PURE__*/_react.default.createElement(_gridContainer.default, _extends({
|
|
19
|
+
"data-component": "grid"
|
|
20
|
+
}, props));
|
|
47
21
|
|
|
48
22
|
exports.GridContainer = GridContainer;
|
|
49
23
|
GridContainer.propTypes = {
|
|
@@ -15,8 +15,6 @@ export interface LinkProps extends React.AriaAttributes {
|
|
|
15
15
|
onKeyDown?: (ev: React.KeyboardEvent<HTMLAnchorElement> | React.KeyboardEvent<HTMLButtonElement>) => void;
|
|
16
16
|
/** Function called when a mouse down event triggers. */
|
|
17
17
|
onMouseDown?: (ev: React.MouseEvent<HTMLAnchorElement> | React.MouseEvent<HTMLButtonElement>) => void;
|
|
18
|
-
/** Whether to include the link in the tab order of the page */
|
|
19
|
-
tabbable?: boolean;
|
|
20
18
|
/** A message to display as a tooltip to the link. */
|
|
21
19
|
tooltipMessage?: string;
|
|
22
20
|
/** Positions the tooltip with the link. */
|
|
@@ -42,12 +42,10 @@ const Link = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
42
42
|
rel,
|
|
43
43
|
tooltipMessage,
|
|
44
44
|
tooltipPosition,
|
|
45
|
-
tabbable = true,
|
|
46
45
|
target,
|
|
47
46
|
...rest
|
|
48
47
|
}, ref) => {
|
|
49
48
|
const l = (0, _useLocale.default)();
|
|
50
|
-
const tabIndex = tabbable && !disabled ? "0" : "-1";
|
|
51
49
|
|
|
52
50
|
const handleOnKeyDown = ev => {
|
|
53
51
|
if (onKeyDown) {
|
|
@@ -90,7 +88,6 @@ const Link = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
90
88
|
onMouseDown,
|
|
91
89
|
onClick,
|
|
92
90
|
disabled,
|
|
93
|
-
tabIndex,
|
|
94
91
|
target,
|
|
95
92
|
ref,
|
|
96
93
|
href,
|
|
@@ -182,7 +179,6 @@ Link.propTypes = {
|
|
|
182
179
|
"onKeyDown": _propTypes.default.func,
|
|
183
180
|
"onMouseDown": _propTypes.default.func,
|
|
184
181
|
"rel": _propTypes.default.string,
|
|
185
|
-
"tabbable": _propTypes.default.bool,
|
|
186
182
|
"target": _propTypes.default.string,
|
|
187
183
|
"tooltipMessage": _propTypes.default.string,
|
|
188
184
|
"tooltipPosition": _propTypes.default.oneOf(["bottom", "left", "right", "top"])
|
|
@@ -247,9 +247,8 @@ const Submenu = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
247
247
|
menuType: menuContext.menuType,
|
|
248
248
|
ref: ref,
|
|
249
249
|
as: asPassiveItem ? "div" : _link.default,
|
|
250
|
-
href:
|
|
250
|
+
href: href,
|
|
251
251
|
icon: icon,
|
|
252
|
-
tabIndex: asPassiveItem ? -1 : 0,
|
|
253
252
|
variant: variant,
|
|
254
253
|
inFullscreenView: inFullscreenView
|
|
255
254
|
}), title), /*#__PURE__*/_react.default.createElement(_submenu.StyledSubmenu, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { LayoutProps,
|
|
2
|
+
import { LayoutProps, FlexboxProps } from "styled-system";
|
|
3
3
|
|
|
4
4
|
type menuType = "light" | "dark" | "white" | "black";
|
|
5
5
|
interface MenuContextProps {
|
|
@@ -11,7 +11,7 @@ interface MenuContextProps {
|
|
|
11
11
|
inMenu: boolean;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
export interface MenuProps extends LayoutProps,
|
|
14
|
+
export interface MenuProps extends LayoutProps, FlexboxProps {
|
|
15
15
|
/** Children elements */
|
|
16
16
|
children: React.ReactNode;
|
|
17
17
|
/** Defines the color scheme of the component */
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { PaddingProps, FlexboxProps } from "styled-system";
|
|
2
2
|
import { Position, Orientation, NavigationType } from "./navigation-bar.component";
|
|
3
|
+
export declare type StyledNavigationBarProps = PaddingProps & FlexboxProps & {
|
|
4
|
+
/** Color scheme of navigation component */
|
|
5
|
+
navigationType?: NavigationType;
|
|
6
|
+
/** Defines whether the navigation bar should be positioned fixed or sticky */
|
|
7
|
+
position?: Position;
|
|
8
|
+
/** Defines the offset of navigation bar */
|
|
9
|
+
offset?: string;
|
|
10
|
+
/** Defines whether the navigation bar should be positioned top or bottom */
|
|
11
|
+
orientation?: Orientation;
|
|
12
|
+
};
|
|
3
13
|
declare const StyledNavigationBar: import("styled-components").StyledComponent<"nav", any, PaddingProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & FlexboxProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & {
|
|
4
14
|
/** Color scheme of navigation component */
|
|
5
15
|
navigationType?: NavigationType | undefined;
|
|
@@ -147,6 +147,7 @@ Pages.propTypes = {
|
|
|
147
147
|
"zIndex": _propTypes.default.shape({
|
|
148
148
|
"aboveAll": _propTypes.default.number.isRequired,
|
|
149
149
|
"fullScreenModal": _propTypes.default.number.isRequired,
|
|
150
|
+
"globalNav": _propTypes.default.number.isRequired,
|
|
150
151
|
"header": _propTypes.default.number.isRequired,
|
|
151
152
|
"modal": _propTypes.default.number.isRequired,
|
|
152
153
|
"nav": _propTypes.default.number.isRequired,
|
|
@@ -250,6 +250,7 @@ Pill.propTypes = {
|
|
|
250
250
|
"zIndex": _propTypes.default.shape({
|
|
251
251
|
"aboveAll": _propTypes.default.number.isRequired,
|
|
252
252
|
"fullScreenModal": _propTypes.default.number.isRequired,
|
|
253
|
+
"globalNav": _propTypes.default.number.isRequired,
|
|
253
254
|
"header": _propTypes.default.number.isRequired,
|
|
254
255
|
"modal": _propTypes.default.number.isRequired,
|
|
255
256
|
"nav": _propTypes.default.number.isRequired,
|
|
@@ -47,12 +47,11 @@ const EditorLink = ({
|
|
|
47
47
|
|
|
48
48
|
}, [validUrl]);
|
|
49
49
|
return /*#__PURE__*/_react.default.createElement(_editorLink.default, _extends({
|
|
50
|
-
href: validUrl,
|
|
50
|
+
href: !editMode ? validUrl : undefined,
|
|
51
51
|
title: validUrl,
|
|
52
|
-
"aria-label": validUrl,
|
|
52
|
+
"aria-label": !editMode ? validUrl : undefined,
|
|
53
53
|
target: "_blank",
|
|
54
|
-
rel: "noopener noreferrer"
|
|
55
|
-
tabbable: !editMode
|
|
54
|
+
rel: "noopener noreferrer"
|
|
56
55
|
}, rest), children);
|
|
57
56
|
};
|
|
58
57
|
|
package/lib/global.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { BoxProps } from "components/box/box";
|
|
3
|
-
|
|
4
|
-
export interface DismissibleBoxProps
|
|
5
|
-
extends Omit<BoxProps, "display" | "justifyContent"> {
|
|
6
|
-
/** Flag to control whether the thicker left border highlight should be rendered */
|
|
7
|
-
hasBorderLeftHighlight?: boolean;
|
|
8
|
-
/** The content to render in the component */
|
|
9
|
-
children?: React.ReactNode;
|
|
10
|
-
/** Callback to be called when the close icon button is clicked */
|
|
11
|
-
onClose: React.MouseEventHandler<HTMLButtonElement>;
|
|
12
|
-
/** Set the base color variant */
|
|
13
|
-
variant?: "light" | "dark";
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
declare function DismissibleBox(props: DismissibleBoxProps): JSX.Element;
|
|
17
|
-
|
|
18
|
-
export default DismissibleBox;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { MarginProps } from "styled-system";
|
|
3
|
-
|
|
4
|
-
export interface FieldsetProps extends MarginProps {
|
|
5
|
-
/** Child elements */
|
|
6
|
-
children?: React.ReactNode;
|
|
7
|
-
/** The text for the fieldsets legend element. */
|
|
8
|
-
legend?: string;
|
|
9
|
-
/** When true, legend is placed in line with the children */
|
|
10
|
-
inline?: boolean;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
declare function Fieldset(props: FieldsetProps): JSX.Element;
|
|
14
|
-
|
|
15
|
-
export default Fieldset;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { BoxProps } from "components/box/box";
|
|
3
|
-
|
|
4
|
-
export interface DismissibleBoxProps
|
|
5
|
-
extends Omit<BoxProps, "display" | "justifyContent"> {
|
|
6
|
-
/** Flag to control whether the thicker left border highlight should be rendered */
|
|
7
|
-
hasBorderLeftHighlight?: boolean;
|
|
8
|
-
/** The content to render in the component */
|
|
9
|
-
children?: React.ReactNode;
|
|
10
|
-
/** Callback to be called when the close icon button is clicked */
|
|
11
|
-
onClose: React.MouseEventHandler<HTMLButtonElement>;
|
|
12
|
-
/** Set the base color variant */
|
|
13
|
-
variant?: "light" | "dark";
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
declare function DismissibleBox(props: DismissibleBoxProps): JSX.Element;
|
|
17
|
-
|
|
18
|
-
export default DismissibleBox;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { MarginProps } from "styled-system";
|
|
3
|
-
|
|
4
|
-
export interface FieldsetProps extends MarginProps {
|
|
5
|
-
/** Child elements */
|
|
6
|
-
children?: React.ReactNode;
|
|
7
|
-
/** The text for the fieldsets legend element. */
|
|
8
|
-
legend?: string;
|
|
9
|
-
/** When true, legend is placed in line with the children */
|
|
10
|
-
inline?: boolean;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
declare function Fieldset(props: FieldsetProps): JSX.Element;
|
|
14
|
-
|
|
15
|
-
export default Fieldset;
|