carbon-react 109.5.2 → 109.7.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/__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/dialog/dialog.d.ts +1 -1
- package/esm/components/dialog-full-screen/dialog-full-screen.d.ts +1 -1
- 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/menu/menu.d.ts +2 -2
- package/esm/components/modal/__internal__/modal-manager.d.ts +19 -6
- package/esm/components/modal/__internal__/modal-manager.js +23 -40
- package/esm/components/modal/index.d.ts +1 -0
- package/esm/components/modal/modal.component.d.ts +44 -33
- package/esm/components/modal/modal.component.js +10 -14
- package/esm/components/modal/modal.style.d.ts +7 -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/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/dialog/dialog.d.ts +1 -1
- package/lib/components/dialog-full-screen/dialog-full-screen.d.ts +1 -1
- 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/menu/menu.d.ts +2 -2
- package/lib/components/modal/__internal__/modal-manager.d.ts +19 -6
- package/lib/components/modal/__internal__/modal-manager.js +23 -41
- package/lib/components/modal/index.d.ts +1 -0
- package/lib/components/modal/modal.component.d.ts +44 -33
- package/lib/components/modal/modal.component.js +9 -14
- package/lib/components/modal/modal.style.d.ts +7 -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/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 +3 -3
- package/esm/components/dismissible-box/dismissible-box.d.ts +0 -18
- package/esm/components/fieldset/fieldset.d.ts +0 -15
- package/esm/components/modal/modal.d.ts +0 -35
- package/lib/components/dismissible-box/dismissible-box.d.ts +0 -18
- package/lib/components/fieldset/fieldset.d.ts +0 -15
- package/lib/components/modal/modal.d.ts +0 -35
|
@@ -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 = {
|
|
@@ -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,9 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
declare type SetTriggerRefocusFlag = (boolean: boolean) => void;
|
|
2
|
+
declare type ModalList = {
|
|
3
|
+
modal: HTMLElement;
|
|
4
|
+
setTriggerRefocusFlag?: SetTriggerRefocusFlag;
|
|
5
|
+
}[];
|
|
6
|
+
declare global {
|
|
7
|
+
interface Window {
|
|
8
|
+
__CARBON_INTERNALS_MODAL_LIST?: ModalList;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
declare class ModalManagerInstance {
|
|
12
|
+
private modalList;
|
|
13
|
+
constructor();
|
|
14
|
+
private getTopModal;
|
|
15
|
+
addModal: (modal: HTMLElement | null, setTriggerRefocusFlag?: SetTriggerRefocusFlag | undefined) => void;
|
|
16
|
+
isTopmost(modal: HTMLElement | null): boolean;
|
|
17
|
+
removeModal(modal: HTMLElement | null): void;
|
|
6
18
|
clearList(): void;
|
|
7
|
-
#private;
|
|
8
19
|
}
|
|
9
20
|
declare const ModalManager: ModalManagerInstance;
|
|
21
|
+
export { ModalManagerInstance };
|
|
22
|
+
export default ModalManager;
|
|
@@ -13,44 +13,27 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
13
13
|
|
|
14
14
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15
15
|
|
|
16
|
-
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
|
17
|
-
|
|
18
|
-
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
|
19
|
-
|
|
20
|
-
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
|
21
|
-
|
|
22
|
-
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
|
23
|
-
|
|
24
|
-
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
|
25
|
-
|
|
26
|
-
function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
|
|
27
|
-
|
|
28
|
-
var _modalList = /*#__PURE__*/new WeakMap();
|
|
29
|
-
|
|
30
|
-
var _getTopModal = /*#__PURE__*/new WeakSet();
|
|
31
|
-
|
|
32
16
|
let ModalManagerInstance = /*#__PURE__*/function () {
|
|
33
17
|
function ModalManagerInstance() {
|
|
34
18
|
_classCallCheck(this, ModalManagerInstance);
|
|
35
19
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
_modalList.set(this, {
|
|
39
|
-
writable: true,
|
|
40
|
-
value: void 0
|
|
41
|
-
});
|
|
20
|
+
_defineProperty(this, "modalList", void 0);
|
|
42
21
|
|
|
43
22
|
_defineProperty(this, "addModal", (modal, setTriggerRefocusFlag) => {
|
|
23
|
+
if (!modal) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
|
|
44
27
|
const {
|
|
45
28
|
modal: topModal,
|
|
46
29
|
setTriggerRefocusFlag: setTrapFlag
|
|
47
|
-
} =
|
|
30
|
+
} = this.getTopModal();
|
|
48
31
|
|
|
49
32
|
if (topModal && setTrapFlag) {
|
|
50
33
|
setTrapFlag(false);
|
|
51
34
|
}
|
|
52
35
|
|
|
53
|
-
|
|
36
|
+
this.modalList.push({
|
|
54
37
|
modal,
|
|
55
38
|
setTriggerRefocusFlag
|
|
56
39
|
});
|
|
@@ -62,15 +45,24 @@ let ModalManagerInstance = /*#__PURE__*/function () {
|
|
|
62
45
|
window.__CARBON_INTERNALS_MODAL_LIST = [];
|
|
63
46
|
}
|
|
64
47
|
|
|
65
|
-
|
|
48
|
+
this.modalList = window.__CARBON_INTERNALS_MODAL_LIST;
|
|
66
49
|
}
|
|
67
50
|
|
|
68
51
|
_createClass(ModalManagerInstance, [{
|
|
52
|
+
key: "getTopModal",
|
|
53
|
+
value: function getTopModal() {
|
|
54
|
+
if (!this.modalList.length) {
|
|
55
|
+
return {};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return this.modalList[this.modalList.length - 1];
|
|
59
|
+
}
|
|
60
|
+
}, {
|
|
69
61
|
key: "isTopmost",
|
|
70
62
|
value: function isTopmost(modal) {
|
|
71
63
|
const {
|
|
72
64
|
modal: topModal
|
|
73
|
-
} =
|
|
65
|
+
} = this.getTopModal();
|
|
74
66
|
|
|
75
67
|
if (!modal || !topModal) {
|
|
76
68
|
return false;
|
|
@@ -81,7 +73,7 @@ let ModalManagerInstance = /*#__PURE__*/function () {
|
|
|
81
73
|
}, {
|
|
82
74
|
key: "removeModal",
|
|
83
75
|
value: function removeModal(modal) {
|
|
84
|
-
const modalIndex =
|
|
76
|
+
const modalIndex = this.modalList.findIndex(({
|
|
85
77
|
modal: m
|
|
86
78
|
}) => m === modal);
|
|
87
79
|
|
|
@@ -89,15 +81,15 @@ let ModalManagerInstance = /*#__PURE__*/function () {
|
|
|
89
81
|
return;
|
|
90
82
|
}
|
|
91
83
|
|
|
92
|
-
|
|
84
|
+
this.modalList.splice(modalIndex, 1);
|
|
93
85
|
|
|
94
|
-
if (!
|
|
86
|
+
if (!this.modalList.length) {
|
|
95
87
|
return;
|
|
96
88
|
}
|
|
97
89
|
|
|
98
90
|
const {
|
|
99
91
|
setTriggerRefocusFlag
|
|
100
|
-
} =
|
|
92
|
+
} = this.getTopModal();
|
|
101
93
|
|
|
102
94
|
if (setTriggerRefocusFlag) {
|
|
103
95
|
setTriggerRefocusFlag(true);
|
|
@@ -107,8 +99,7 @@ let ModalManagerInstance = /*#__PURE__*/function () {
|
|
|
107
99
|
key: "clearList",
|
|
108
100
|
value: function clearList() {
|
|
109
101
|
window.__CARBON_INTERNALS_MODAL_LIST = [];
|
|
110
|
-
|
|
111
|
-
_classPrivateFieldSet(this, _modalList, window.__CARBON_INTERNALS_MODAL_LIST);
|
|
102
|
+
this.modalList = window.__CARBON_INTERNALS_MODAL_LIST;
|
|
112
103
|
}
|
|
113
104
|
}]);
|
|
114
105
|
|
|
@@ -116,15 +107,6 @@ let ModalManagerInstance = /*#__PURE__*/function () {
|
|
|
116
107
|
}();
|
|
117
108
|
|
|
118
109
|
exports.ModalManagerInstance = ModalManagerInstance;
|
|
119
|
-
|
|
120
|
-
function _getTopModal2() {
|
|
121
|
-
if (!_classPrivateFieldGet(this, _modalList).length) {
|
|
122
|
-
return {};
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
return _classPrivateFieldGet(this, _modalList)[_classPrivateFieldGet(this, _modalList).length - 1];
|
|
126
|
-
}
|
|
127
|
-
|
|
128
110
|
const ModalManager = new ModalManagerInstance();
|
|
129
111
|
var _default = ModalManager;
|
|
130
112
|
exports.default = _default;
|
|
@@ -1,35 +1,46 @@
|
|
|
1
|
-
export const ModalContext: React.Context<{}>;
|
|
2
|
-
export default Modal;
|
|
3
1
|
import React from "react";
|
|
4
|
-
declare function Modal({ children, open, onCancel, disableEscKey, disableClose, enableBackgroundUI, timeout, ...rest }: {
|
|
5
|
-
[x: string]: any;
|
|
6
|
-
children: any;
|
|
7
|
-
open: any;
|
|
8
|
-
onCancel: any;
|
|
9
|
-
disableEscKey: any;
|
|
10
|
-
disableClose: any;
|
|
11
|
-
enableBackgroundUI: any;
|
|
12
|
-
timeout: any;
|
|
13
|
-
}): JSX.Element;
|
|
14
|
-
declare namespace Modal {
|
|
15
|
-
namespace propTypes {
|
|
16
|
-
const children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
17
|
-
const onCancel: PropTypes.Requireable<(...args: any[]) => any>;
|
|
18
|
-
const open: PropTypes.Validator<boolean>;
|
|
19
|
-
const enableBackgroundUI: PropTypes.Requireable<boolean>;
|
|
20
|
-
const disableEscKey: PropTypes.Requireable<boolean>;
|
|
21
|
-
const disableClose: PropTypes.Requireable<boolean>;
|
|
22
|
-
const timeout: PropTypes.Requireable<number>;
|
|
23
|
-
}
|
|
24
|
-
namespace defaultProps {
|
|
25
|
-
const onCancel_1: null;
|
|
26
|
-
export { onCancel_1 as onCancel };
|
|
27
|
-
const enableBackgroundUI_1: boolean;
|
|
28
|
-
export { enableBackgroundUI_1 as enableBackgroundUI };
|
|
29
|
-
const disableEscKey_1: boolean;
|
|
30
|
-
export { disableEscKey_1 as disableEscKey };
|
|
31
|
-
const timeout_1: number;
|
|
32
|
-
export { timeout_1 as timeout };
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
2
|
import PropTypes from "prop-types";
|
|
3
|
+
export interface ModalContextProps {
|
|
4
|
+
isInModal?: boolean;
|
|
5
|
+
isAnimationComplete?: boolean;
|
|
6
|
+
triggerRefocusFlag?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const ModalContext: React.Context<ModalContextProps>;
|
|
9
|
+
export interface ModalProps {
|
|
10
|
+
/** Modal content */
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
/** The ARIA role to be applied to the modal */
|
|
13
|
+
ariaRole?: string;
|
|
14
|
+
/** Determines if the Esc Key closes the modal */
|
|
15
|
+
disableEscKey?: boolean;
|
|
16
|
+
/** Determines if the Dialog can be closed */
|
|
17
|
+
disableClose?: boolean;
|
|
18
|
+
/** Determines if the background is disabled when the modal is open */
|
|
19
|
+
enableBackgroundUI?: boolean;
|
|
20
|
+
/** A custom close event handler */
|
|
21
|
+
onCancel?: (ev: React.KeyboardEvent<HTMLElement>) => void;
|
|
22
|
+
/** Sets the open state of the modal */
|
|
23
|
+
open: boolean;
|
|
24
|
+
/** Transition time */
|
|
25
|
+
timeout?: number;
|
|
26
|
+
}
|
|
27
|
+
declare const Modal: {
|
|
28
|
+
({ children, open, onCancel, disableEscKey, disableClose, enableBackgroundUI, timeout, ...rest }: ModalProps): JSX.Element;
|
|
29
|
+
propTypes: {
|
|
30
|
+
/** Modal content */
|
|
31
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
32
|
+
/** A custom close event handler */
|
|
33
|
+
onCancel: PropTypes.Requireable<(...args: any[]) => any>;
|
|
34
|
+
/** Controls the open state of the modal */
|
|
35
|
+
open: PropTypes.Validator<boolean>;
|
|
36
|
+
/** Determines if the background is disabled when the modal is open */
|
|
37
|
+
enableBackgroundUI: PropTypes.Requireable<boolean>;
|
|
38
|
+
/** Determines if the Esc Key closes the modal */
|
|
39
|
+
disableEscKey: PropTypes.Requireable<boolean>;
|
|
40
|
+
/** Determines if the Dialog can be closed */
|
|
41
|
+
disableClose: PropTypes.Requireable<boolean>;
|
|
42
|
+
/** Transition time */
|
|
43
|
+
timeout: PropTypes.Requireable<number>;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export default Modal;
|
|
@@ -37,15 +37,15 @@ const Modal = ({
|
|
|
37
37
|
children,
|
|
38
38
|
open,
|
|
39
39
|
onCancel,
|
|
40
|
-
disableEscKey,
|
|
40
|
+
disableEscKey = false,
|
|
41
41
|
disableClose,
|
|
42
|
-
enableBackgroundUI,
|
|
43
|
-
timeout,
|
|
42
|
+
enableBackgroundUI = false,
|
|
43
|
+
timeout = 300,
|
|
44
44
|
...rest
|
|
45
45
|
}) => {
|
|
46
|
-
const ref = (0, _react.useRef)();
|
|
47
|
-
const backgroundNodeRef = (0, _react.useRef)();
|
|
48
|
-
const contentNodeRef = (0, _react.useRef)();
|
|
46
|
+
const ref = (0, _react.useRef)(null);
|
|
47
|
+
const backgroundNodeRef = (0, _react.useRef)(null);
|
|
48
|
+
const contentNodeRef = (0, _react.useRef)(null);
|
|
49
49
|
const [isAnimationComplete, setAnimationComplete] = (0, _react.useState)(false);
|
|
50
50
|
const [triggerRefocusFlag, setTriggerRefocusFlag] = (0, _react.useState)(false);
|
|
51
51
|
const {
|
|
@@ -113,9 +113,10 @@ const Modal = ({
|
|
|
113
113
|
isAnimationComplete,
|
|
114
114
|
triggerRefocusFlag,
|
|
115
115
|
isInModal: true
|
|
116
|
-
}
|
|
116
|
+
}
|
|
117
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
117
118
|
ref: contentNodeRef
|
|
118
|
-
}, content)))));
|
|
119
|
+
}, content))))));
|
|
119
120
|
};
|
|
120
121
|
|
|
121
122
|
Modal.propTypes = {
|
|
@@ -140,11 +141,5 @@ Modal.propTypes = {
|
|
|
140
141
|
/** Transition time */
|
|
141
142
|
timeout: _propTypes.default.number
|
|
142
143
|
};
|
|
143
|
-
Modal.defaultProps = {
|
|
144
|
-
onCancel: null,
|
|
145
|
-
enableBackgroundUI: false,
|
|
146
|
-
disableEscKey: false,
|
|
147
|
-
timeout: 300
|
|
148
|
-
};
|
|
149
144
|
var _default = Modal;
|
|
150
145
|
exports.default = _default;
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
declare type TransitionProps = {
|
|
2
|
+
transitionName: string;
|
|
3
|
+
transitionTime: number;
|
|
4
|
+
};
|
|
5
|
+
declare const StyledModalBackground: import("styled-components").StyledComponent<"div", any, TransitionProps, never>;
|
|
6
|
+
declare const StyledModal: import("styled-components").StyledComponent<"div", any, TransitionProps, never>;
|
|
7
|
+
export { StyledModal, StyledModalBackground };
|
|
@@ -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,
|
package/lib/global.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "carbon-react",
|
|
3
|
-
"version": "109.
|
|
3
|
+
"version": "109.7.1",
|
|
4
4
|
"description": "A library of reusable React components for easily building user interfaces.",
|
|
5
5
|
"engineStrict": true,
|
|
6
6
|
"engines": {
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"@types/react-dom": "^17.0.2",
|
|
99
99
|
"@types/react-is": "^17.0.3",
|
|
100
100
|
"@types/react-test-renderer": "^17.0.1",
|
|
101
|
-
"@types/react-transition-group": "^4.4.
|
|
101
|
+
"@types/react-transition-group": "^4.4.5",
|
|
102
102
|
"@types/sprintf-js": "^1.1.2",
|
|
103
103
|
"@types/styled-components": "^5.1.9",
|
|
104
104
|
"@types/uuid": "^8.3.3",
|
|
@@ -192,7 +192,7 @@
|
|
|
192
192
|
"react-dnd": "^15.1.1",
|
|
193
193
|
"react-dnd-html5-backend": "^15.1.2",
|
|
194
194
|
"react-is": "^17.0.2",
|
|
195
|
-
"react-transition-group": "^4.4.
|
|
195
|
+
"react-transition-group": "^4.4.2",
|
|
196
196
|
"styled-system": "^5.1.5",
|
|
197
197
|
"wait-on": "^5.2.1"
|
|
198
198
|
},
|
|
@@ -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,35 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
export interface ModalContextProps {
|
|
4
|
-
value?: {
|
|
5
|
-
isInModal?: boolean;
|
|
6
|
-
isAnimationComplete?: boolean;
|
|
7
|
-
triggerRefocusFlag?: boolean;
|
|
8
|
-
};
|
|
9
|
-
ref?: React.MutableRefObject<React.ReactNode>;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface ModalProps {
|
|
13
|
-
/** Modal content */
|
|
14
|
-
children?: React.ReactNode;
|
|
15
|
-
/** The ARIA role to be applied to the modal */
|
|
16
|
-
ariaRole?: string;
|
|
17
|
-
/** Determines if the Esc Key closes the modal */
|
|
18
|
-
disableEscKey?: boolean;
|
|
19
|
-
/** Determines if the Dialog can be closed */
|
|
20
|
-
disableClose?: boolean;
|
|
21
|
-
/** Determines if the background is disabled when the modal is open */
|
|
22
|
-
enableBackgroundUI?: boolean;
|
|
23
|
-
/** A custom close event handler */
|
|
24
|
-
onCancel?: (ev: React.KeyboardEvent<HTMLElement>) => void;
|
|
25
|
-
/** Sets the open state of the modal */
|
|
26
|
-
open: boolean;
|
|
27
|
-
/** Transition time */
|
|
28
|
-
timeout?: number;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
declare const ModelContext: React.Context<ModalContextProps>;
|
|
32
|
-
declare function Modal(props: ModalProps): JSX.Element;
|
|
33
|
-
|
|
34
|
-
export { ModalContext };
|
|
35
|
-
export default Modal;
|
|
@@ -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,35 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
export interface ModalContextProps {
|
|
4
|
-
value?: {
|
|
5
|
-
isInModal?: boolean;
|
|
6
|
-
isAnimationComplete?: boolean;
|
|
7
|
-
triggerRefocusFlag?: boolean;
|
|
8
|
-
};
|
|
9
|
-
ref?: React.MutableRefObject<React.ReactNode>;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface ModalProps {
|
|
13
|
-
/** Modal content */
|
|
14
|
-
children?: React.ReactNode;
|
|
15
|
-
/** The ARIA role to be applied to the modal */
|
|
16
|
-
ariaRole?: string;
|
|
17
|
-
/** Determines if the Esc Key closes the modal */
|
|
18
|
-
disableEscKey?: boolean;
|
|
19
|
-
/** Determines if the Dialog can be closed */
|
|
20
|
-
disableClose?: boolean;
|
|
21
|
-
/** Determines if the background is disabled when the modal is open */
|
|
22
|
-
enableBackgroundUI?: boolean;
|
|
23
|
-
/** A custom close event handler */
|
|
24
|
-
onCancel?: (ev: React.KeyboardEvent<HTMLElement>) => void;
|
|
25
|
-
/** Sets the open state of the modal */
|
|
26
|
-
open: boolean;
|
|
27
|
-
/** Transition time */
|
|
28
|
-
timeout?: number;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
declare const ModelContext: React.Context<ModalContextProps>;
|
|
32
|
-
declare function Modal(props: ModalProps): JSX.Element;
|
|
33
|
-
|
|
34
|
-
export { ModalContext };
|
|
35
|
-
export default Modal;
|