carbon-react 106.6.9 → 107.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__/focus-trap/focus-trap-utils.js +25 -1
- package/esm/__internal__/focus-trap/focus-trap.component.d.ts +3 -1
- package/esm/__internal__/focus-trap/focus-trap.component.js +44 -12
- package/esm/{components/radio-button → __internal__/radio-button-mapper}/radio-button-mapper.component.d.ts +0 -0
- package/esm/{components/radio-button → __internal__/radio-button-mapper}/radio-button-mapper.component.js +0 -0
- package/esm/components/advanced-color-picker/advanced-color-picker.component.js +5 -5
- package/esm/components/badge/badge.style.d.ts +1 -1
- package/esm/components/button/button.component.d.ts +1 -3
- package/esm/components/button/button.component.js +1 -12
- package/esm/components/button/button.style.d.ts +1 -1
- package/esm/components/button-toggle-group/button-toggle-group.component.js +1 -1
- package/esm/components/confirm/confirm.component.d.ts +1 -5
- package/esm/components/confirm/confirm.component.js +2 -14
- package/esm/components/confirm/confirm.d.ts +0 -2
- package/esm/components/date/__internal__/date-picker/date-picker.component.js +24 -11
- package/esm/components/date/__internal__/date-picker/date-picker.d.ts +2 -0
- package/esm/components/date/date.component.js +3 -2
- package/esm/components/dialog/dialog.component.js +4 -3
- package/esm/components/dialog-full-screen/content.style.js +4 -10
- package/esm/components/dialog-full-screen/dialog-full-screen.component.js +4 -3
- package/esm/components/heading/heading.component.d.ts +27 -52
- package/esm/components/heading/heading.component.js +86 -170
- package/esm/components/heading/heading.d.ts +5 -3
- package/esm/components/i18n-provider/i18n-provider.component.d.ts +0 -9
- package/esm/components/i18n-provider/i18n-provider.component.js +0 -9
- package/esm/components/menu/index.d.ts +0 -1
- package/esm/components/menu/index.js +0 -1
- package/esm/components/menu/menu-full-screen/menu-full-screen.component.js +4 -18
- package/esm/components/menu/menu-full-screen/menu-full-screen.style.js +1 -0
- package/esm/components/menu/menu-item/menu-item.component.js +0 -6
- package/esm/components/multi-action-button/multi-action-button.component.d.ts +1 -1
- package/esm/components/multi-action-button/multi-action-button.component.js +1 -11
- package/esm/components/navigation-bar/navigation-bar.component.d.ts +1 -6
- package/esm/components/navigation-bar/navigation-bar.component.js +1 -15
- package/esm/components/navigation-bar/navigation-bar.style.d.ts +0 -4
- package/esm/components/navigation-bar/navigation-bar.style.js +0 -8
- package/esm/components/radio-button/radio-button-group.component.js +1 -1
- package/esm/components/select/select-list/select-list.component.js +2 -2
- package/esm/components/sidebar/__internal__/sidebar-header/sidebar-header.component.d.ts +3 -1
- package/esm/components/sidebar/__internal__/sidebar-header/sidebar-header.component.js +7 -2
- package/esm/components/sidebar/sidebar.component.js +10 -3
- package/esm/components/simple-color-picker/simple-color-picker.component.js +1 -1
- package/esm/components/split-button/split-button-toggle.style.d.ts +1 -1
- package/esm/components/split-button/split-button.component.d.ts +1 -4
- package/esm/components/split-button/split-button.component.js +3 -16
- package/esm/components/split-button/split-button.d.ts +0 -2
- package/esm/components/tile/tile.component.d.ts +1 -2
- package/esm/components/tile/tile.component.js +1 -13
- package/esm/components/tile/tile.d.ts +0 -2
- package/esm/components/tile-select/tile-select-group.component.js +1 -1
- package/esm/components/toast/toast.component.d.ts +1 -4
- package/esm/components/toast/toast.component.js +1 -13
- package/esm/components/toast/toast.d.ts +0 -2
- package/esm/locales/en-gb.js +0 -9
- package/esm/locales/locale.d.ts +0 -9
- package/esm/locales/pl-pl.js +0 -9
- package/lib/__internal__/focus-trap/focus-trap-utils.js +25 -1
- package/lib/__internal__/focus-trap/focus-trap.component.d.ts +3 -1
- package/lib/__internal__/focus-trap/focus-trap.component.js +46 -12
- package/lib/{components/radio-button → __internal__/radio-button-mapper}/radio-button-mapper.component.d.ts +0 -0
- package/lib/{components/radio-button → __internal__/radio-button-mapper}/radio-button-mapper.component.js +0 -0
- package/lib/components/advanced-color-picker/advanced-color-picker.component.js +5 -5
- package/lib/components/badge/badge.style.d.ts +1 -1
- package/lib/components/button/button.component.d.ts +1 -3
- package/lib/components/button/button.component.js +1 -14
- package/lib/components/button/button.style.d.ts +1 -1
- package/lib/components/button-toggle-group/button-toggle-group.component.js +1 -1
- package/lib/components/confirm/confirm.component.d.ts +1 -5
- package/lib/components/confirm/confirm.component.js +2 -17
- package/lib/components/confirm/confirm.d.ts +0 -2
- package/lib/components/date/__internal__/date-picker/date-picker.component.js +24 -11
- package/lib/components/date/__internal__/date-picker/date-picker.d.ts +2 -0
- package/lib/components/date/date.component.js +3 -2
- package/lib/components/dialog/dialog.component.js +4 -3
- package/lib/components/dialog-full-screen/content.style.js +4 -10
- package/lib/components/dialog-full-screen/dialog-full-screen.component.js +4 -3
- package/lib/components/heading/heading.component.d.ts +27 -52
- package/lib/components/heading/heading.component.js +86 -170
- package/lib/components/heading/heading.d.ts +5 -3
- package/lib/components/i18n-provider/i18n-provider.component.d.ts +0 -9
- package/lib/components/i18n-provider/i18n-provider.component.js +0 -9
- package/lib/components/menu/index.d.ts +0 -1
- package/lib/components/menu/index.js +0 -8
- package/lib/components/menu/menu-full-screen/menu-full-screen.component.js +3 -17
- package/lib/components/menu/menu-full-screen/menu-full-screen.style.js +1 -0
- package/lib/components/menu/menu-item/menu-item.component.js +0 -7
- package/lib/components/multi-action-button/multi-action-button.component.d.ts +1 -1
- package/lib/components/multi-action-button/multi-action-button.component.js +1 -14
- package/lib/components/navigation-bar/navigation-bar.component.d.ts +1 -6
- package/lib/components/navigation-bar/navigation-bar.component.js +1 -18
- package/lib/components/navigation-bar/navigation-bar.style.d.ts +0 -4
- package/lib/components/navigation-bar/navigation-bar.style.js +0 -8
- package/lib/components/radio-button/radio-button-group.component.js +1 -1
- package/lib/components/select/select-list/select-list.component.js +2 -2
- package/lib/components/sidebar/__internal__/sidebar-header/sidebar-header.component.d.ts +3 -1
- package/lib/components/sidebar/__internal__/sidebar-header/sidebar-header.component.js +7 -2
- package/lib/components/sidebar/sidebar.component.js +11 -3
- package/lib/components/simple-color-picker/simple-color-picker.component.js +1 -1
- package/lib/components/split-button/split-button-toggle.style.d.ts +1 -1
- package/lib/components/split-button/split-button.component.d.ts +1 -4
- package/lib/components/split-button/split-button.component.js +3 -18
- package/lib/components/split-button/split-button.d.ts +0 -2
- package/lib/components/tile/tile.component.d.ts +1 -2
- package/lib/components/tile/tile.component.js +1 -16
- package/lib/components/tile/tile.d.ts +0 -2
- package/lib/components/tile-select/tile-select-group.component.js +1 -1
- package/lib/components/toast/toast.component.d.ts +1 -4
- package/lib/components/toast/toast.component.js +1 -16
- package/lib/components/toast/toast.d.ts +0 -2
- package/lib/locales/en-gb.js +0 -9
- package/lib/locales/locale.d.ts +0 -9
- package/lib/locales/pl-pl.js +0 -9
- package/package.json +1 -1
- package/esm/components/app-wrapper/app-wrapper.component.d.ts +0 -25
- package/esm/components/app-wrapper/app-wrapper.component.js +0 -104
- package/esm/components/app-wrapper/app-wrapper.d.ts +0 -12
- package/esm/components/app-wrapper/app-wrapper.style.d.ts +0 -2
- package/esm/components/app-wrapper/app-wrapper.style.js +0 -17
- package/esm/components/app-wrapper/index.d.ts +0 -1
- package/esm/components/app-wrapper/index.js +0 -1
- package/esm/components/menu/submenu-block/index.d.ts +0 -2
- package/esm/components/menu/submenu-block/index.js +0 -1
- package/esm/components/menu/submenu-block/submenu-block.component.d.ts +0 -12
- package/esm/components/menu/submenu-block/submenu-block.component.js +0 -34
- package/esm/components/menu/submenu-block/submenu-block.d.ts +0 -12
- package/esm/components/menu/submenu-block/submenu-block.style.d.ts +0 -2
- package/esm/components/menu/submenu-block/submenu-block.style.js +0 -16
- package/esm/components/mount-in-app/__spec__.d.ts +0 -1
- package/esm/components/mount-in-app/__spec__.js +0 -47
- package/esm/components/mount-in-app/index.d.ts +0 -1
- package/esm/components/mount-in-app/mount-in-app.d.ts +0 -12
- package/esm/components/mount-in-app/mount-in-app.js +0 -90
- package/esm/components/mount-in-app/package.json +0 -3
- package/esm/components/multi-step-wizard/__spec__.d.ts +0 -1
- package/esm/components/multi-step-wizard/__spec__.js +0 -191
- package/esm/components/multi-step-wizard/multi-step-wizard.d.ts +0 -109
- package/esm/components/multi-step-wizard/multi-step-wizard.js +0 -383
- package/esm/components/multi-step-wizard/multi-step-wizard.style.d.ts +0 -2
- package/esm/components/multi-step-wizard/multi-step-wizard.style.js +0 -10
- package/esm/components/multi-step-wizard/package.json +0 -4
- package/esm/components/multi-step-wizard/step/__spec__.d.ts +0 -1
- package/esm/components/multi-step-wizard/step/__spec__.js +0 -399
- package/esm/components/multi-step-wizard/step/package.json +0 -4
- package/esm/components/multi-step-wizard/step/step.d.ts +0 -166
- package/esm/components/multi-step-wizard/step/step.js +0 -407
- package/esm/components/multi-step-wizard/step/step.style.d.ts +0 -13
- package/esm/components/multi-step-wizard/step/step.style.js +0 -138
- package/esm/components/scrollable-list/as-scrollable-list-item.wrapper.d.ts +0 -2
- package/esm/components/scrollable-list/as-scrollable-list-item.wrapper.js +0 -10
- package/esm/components/scrollable-list/index.d.ts +0 -4
- package/esm/components/scrollable-list/index.js +0 -4
- package/esm/components/scrollable-list/scrollable-list-item.component.d.ts +0 -2
- package/esm/components/scrollable-list/scrollable-list-item.component.js +0 -26
- package/esm/components/scrollable-list/scrollable-list.component.d.ts +0 -52
- package/esm/components/scrollable-list/scrollable-list.component.js +0 -306
- package/esm/components/scrollable-list/scrollable-list.context.d.ts +0 -3
- package/esm/components/scrollable-list/scrollable-list.context.js +0 -2
- package/esm/components/scrollable-list/scrollable-list.style.d.ts +0 -2
- package/esm/components/scrollable-list/scrollable-list.style.js +0 -30
- package/esm/components/scrollable-list/test-utils.d.ts +0 -2
- package/esm/components/scrollable-list/test-utils.js +0 -25
- package/lib/components/app-wrapper/app-wrapper.component.d.ts +0 -25
- package/lib/components/app-wrapper/app-wrapper.component.js +0 -120
- package/lib/components/app-wrapper/app-wrapper.d.ts +0 -12
- package/lib/components/app-wrapper/app-wrapper.style.d.ts +0 -2
- package/lib/components/app-wrapper/app-wrapper.style.js +0 -28
- package/lib/components/app-wrapper/index.d.ts +0 -1
- package/lib/components/app-wrapper/index.js +0 -15
- package/lib/components/app-wrapper/package.json +0 -6
- package/lib/components/menu/submenu-block/index.d.ts +0 -2
- package/lib/components/menu/submenu-block/index.js +0 -15
- package/lib/components/menu/submenu-block/package.json +0 -6
- package/lib/components/menu/submenu-block/submenu-block.component.d.ts +0 -12
- package/lib/components/menu/submenu-block/submenu-block.component.js +0 -53
- package/lib/components/menu/submenu-block/submenu-block.d.ts +0 -12
- package/lib/components/menu/submenu-block/submenu-block.style.d.ts +0 -2
- package/lib/components/menu/submenu-block/submenu-block.style.js +0 -33
- package/lib/components/mount-in-app/__spec__.d.ts +0 -1
- package/lib/components/mount-in-app/__spec__.js +0 -55
- package/lib/components/mount-in-app/index.d.ts +0 -1
- package/lib/components/mount-in-app/mount-in-app.d.ts +0 -12
- package/lib/components/mount-in-app/mount-in-app.js +0 -105
- package/lib/components/mount-in-app/package.json +0 -3
- package/lib/components/multi-step-wizard/__spec__.d.ts +0 -1
- package/lib/components/multi-step-wizard/__spec__.js +0 -202
- package/lib/components/multi-step-wizard/multi-step-wizard.d.ts +0 -109
- package/lib/components/multi-step-wizard/multi-step-wizard.js +0 -397
- package/lib/components/multi-step-wizard/multi-step-wizard.style.d.ts +0 -2
- package/lib/components/multi-step-wizard/multi-step-wizard.style.js +0 -21
- package/lib/components/multi-step-wizard/package.json +0 -4
- package/lib/components/multi-step-wizard/step/__spec__.d.ts +0 -1
- package/lib/components/multi-step-wizard/step/__spec__.js +0 -409
- package/lib/components/multi-step-wizard/step/package.json +0 -4
- package/lib/components/multi-step-wizard/step/step.d.ts +0 -166
- package/lib/components/multi-step-wizard/step/step.js +0 -421
- package/lib/components/multi-step-wizard/step/step.style.d.ts +0 -13
- package/lib/components/multi-step-wizard/step/step.style.js +0 -162
- package/lib/components/scrollable-list/as-scrollable-list-item.wrapper.d.ts +0 -2
- package/lib/components/scrollable-list/as-scrollable-list-item.wrapper.js +0 -21
- package/lib/components/scrollable-list/index.d.ts +0 -4
- package/lib/components/scrollable-list/index.js +0 -31
- package/lib/components/scrollable-list/package.json +0 -6
- package/lib/components/scrollable-list/scrollable-list-item.component.d.ts +0 -2
- package/lib/components/scrollable-list/scrollable-list-item.component.js +0 -42
- package/lib/components/scrollable-list/scrollable-list.component.d.ts +0 -52
- package/lib/components/scrollable-list/scrollable-list.component.js +0 -328
- package/lib/components/scrollable-list/scrollable-list.context.d.ts +0 -3
- package/lib/components/scrollable-list/scrollable-list.context.js +0 -14
- package/lib/components/scrollable-list/scrollable-list.style.d.ts +0 -2
- package/lib/components/scrollable-list/scrollable-list.style.js +0 -41
- package/lib/components/scrollable-list/test-utils.d.ts +0 -2
- package/lib/components/scrollable-list/test-utils.js +0 -37
|
@@ -13,6 +13,8 @@ var _focusTrapUtils = require("./focus-trap-utils");
|
|
|
13
13
|
|
|
14
14
|
var _modal = require("../../components/modal/modal.component");
|
|
15
15
|
|
|
16
|
+
var _usePrevious = _interopRequireDefault(require("../../hooks/__internal__/usePrevious"));
|
|
17
|
+
|
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
19
|
|
|
18
20
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
@@ -24,16 +26,16 @@ const FocusTrap = ({
|
|
|
24
26
|
autoFocus = true,
|
|
25
27
|
focusFirstElement,
|
|
26
28
|
bespokeTrap,
|
|
27
|
-
wrapperRef
|
|
29
|
+
wrapperRef,
|
|
30
|
+
isOpen
|
|
28
31
|
}) => {
|
|
29
32
|
const trapRef = (0, _react.useRef)(null);
|
|
30
|
-
const firstOpen = (0, _react.useRef)(true);
|
|
31
33
|
const [focusableElements, setFocusableElements] = (0, _react.useState)();
|
|
32
34
|
const [firstElement, setFirstElement] = (0, _react.useState)();
|
|
33
35
|
const [lastElement, setLastElement] = (0, _react.useState)();
|
|
34
36
|
const [currentFocusedElement, setCurrentFocusedElement] = (0, _react.useState)();
|
|
35
37
|
const {
|
|
36
|
-
isAnimationComplete,
|
|
38
|
+
isAnimationComplete = true,
|
|
37
39
|
triggerRefocusFlag
|
|
38
40
|
} = (0, _react.useContext)(_modal.ModalContext);
|
|
39
41
|
const hasNewInputs = (0, _react.useCallback)(candidate => {
|
|
@@ -69,12 +71,13 @@ const FocusTrap = ({
|
|
|
69
71
|
(0, _react.useLayoutEffect)(() => {
|
|
70
72
|
updateFocusableElements();
|
|
71
73
|
}, [children, updateFocusableElements]);
|
|
74
|
+
const shouldSetFocus = autoFocus && isOpen && isAnimationComplete && (focusFirstElement || (wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current));
|
|
75
|
+
const prevShouldSetFocus = (0, _usePrevious.default)(shouldSetFocus);
|
|
72
76
|
(0, _react.useEffect)(() => {
|
|
73
|
-
if (
|
|
74
|
-
(0, _focusTrapUtils.setElementFocus)(focusFirstElement ||
|
|
75
|
-
firstOpen.current = false;
|
|
77
|
+
if (shouldSetFocus && !prevShouldSetFocus) {
|
|
78
|
+
(0, _focusTrapUtils.setElementFocus)(focusFirstElement || (wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current));
|
|
76
79
|
}
|
|
77
|
-
}, [
|
|
80
|
+
}, [shouldSetFocus, prevShouldSetFocus, focusFirstElement, wrapperRef]);
|
|
78
81
|
(0, _react.useEffect)(() => {
|
|
79
82
|
const trapFn = ev => {
|
|
80
83
|
if (bespokeTrap) {
|
|
@@ -92,7 +95,7 @@ const FocusTrap = ({
|
|
|
92
95
|
ev.preventDefault();
|
|
93
96
|
} else if (ev.shiftKey) {
|
|
94
97
|
/* shift + tab */
|
|
95
|
-
if (activeElement === firstElement) {
|
|
98
|
+
if (activeElement === firstElement || activeElement === wrapperRef.current) {
|
|
96
99
|
lastElement.focus();
|
|
97
100
|
ev.preventDefault();
|
|
98
101
|
} // If current element is radio button -
|
|
@@ -115,7 +118,7 @@ const FocusTrap = ({
|
|
|
115
118
|
return function cleanup() {
|
|
116
119
|
document.removeEventListener("keydown", trapFn);
|
|
117
120
|
};
|
|
118
|
-
}, [firstElement, lastElement, focusableElements, bespokeTrap]);
|
|
121
|
+
}, [firstElement, lastElement, focusableElements, bespokeTrap, wrapperRef]);
|
|
119
122
|
const updateCurrentFocusedElement = (0, _react.useCallback)(() => {
|
|
120
123
|
const element = focusableElements === null || focusableElements === void 0 ? void 0 : focusableElements.find(el => el === document.activeElement);
|
|
121
124
|
|
|
@@ -130,22 +133,50 @@ const FocusTrap = ({
|
|
|
130
133
|
};
|
|
131
134
|
}, [updateCurrentFocusedElement]);
|
|
132
135
|
const refocusTrap = (0, _react.useCallback)(() => {
|
|
136
|
+
var _wrapperRef$current;
|
|
137
|
+
|
|
133
138
|
/* istanbul ignore else */
|
|
134
139
|
if (currentFocusedElement && !currentFocusedElement.hasAttribute("disabled")) {
|
|
135
140
|
// the trap breaks if it tries to refocus a disabled element
|
|
136
141
|
(0, _focusTrapUtils.setElementFocus)(currentFocusedElement);
|
|
142
|
+
} else if (wrapperRef !== null && wrapperRef !== void 0 && (_wrapperRef$current = wrapperRef.current) !== null && _wrapperRef$current !== void 0 && _wrapperRef$current.hasAttribute("tabindex")) {
|
|
143
|
+
(0, _focusTrapUtils.setElementFocus)(wrapperRef.current);
|
|
137
144
|
} else if (firstElement) {
|
|
138
145
|
(0, _focusTrapUtils.setElementFocus)(firstElement);
|
|
139
146
|
}
|
|
140
|
-
}, [currentFocusedElement, firstElement]);
|
|
147
|
+
}, [currentFocusedElement, firstElement, wrapperRef]);
|
|
141
148
|
(0, _react.useEffect)(() => {
|
|
142
149
|
if (triggerRefocusFlag) {
|
|
143
150
|
refocusTrap();
|
|
144
151
|
}
|
|
145
152
|
}, [triggerRefocusFlag, refocusTrap]);
|
|
153
|
+
const [tabIndex, setTabIndex] = (0, _react.useState)(0);
|
|
154
|
+
(0, _react.useEffect)(() => {
|
|
155
|
+
// issue in cypress prevents setting tabIndex to -1, instead tabIndex is set to 0 and removed on blur.
|
|
156
|
+
if (!isOpen) {
|
|
157
|
+
setTabIndex(0);
|
|
158
|
+
}
|
|
159
|
+
}, [isOpen]);
|
|
160
|
+
|
|
161
|
+
const onBlur = () => {
|
|
162
|
+
/* istanbul ignore else */
|
|
163
|
+
if (isOpen) {
|
|
164
|
+
setTabIndex(undefined);
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
const focusProps = {
|
|
169
|
+
tabIndex,
|
|
170
|
+
onBlur
|
|
171
|
+
}; // passes focusProps if no tabindex has been explicitly set on the wrapper
|
|
172
|
+
|
|
173
|
+
const clonedChildren = _react.default.Children.map(children, child => {
|
|
174
|
+
return child.props.tabIndex === undefined ? /*#__PURE__*/_react.default.cloneElement(child, focusProps) : child;
|
|
175
|
+
});
|
|
176
|
+
|
|
146
177
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
147
178
|
ref: trapRef
|
|
148
|
-
},
|
|
179
|
+
}, clonedChildren);
|
|
149
180
|
};
|
|
150
181
|
|
|
151
182
|
FocusTrap.propTypes = {
|
|
@@ -165,7 +196,10 @@ FocusTrap.propTypes = {
|
|
|
165
196
|
/** a ref to the container wrapping the focusable elements */
|
|
166
197
|
wrapperRef: _propTypes.default.shape({
|
|
167
198
|
current: _propTypes.default.any
|
|
168
|
-
})
|
|
199
|
+
}),
|
|
200
|
+
|
|
201
|
+
/* whether the modal (etc.) component that the focus trap is inside is open or not */
|
|
202
|
+
isOpen: _propTypes.default.bool
|
|
169
203
|
};
|
|
170
204
|
var _default = FocusTrap;
|
|
171
205
|
exports.default = _default;
|
|
File without changes
|
|
File without changes
|
|
@@ -68,17 +68,17 @@ const AdvancedColorPicker = ({
|
|
|
68
68
|
setSelectedColorRef(selected.ref.current);
|
|
69
69
|
}
|
|
70
70
|
}, [colors, currentColor, dialogOpen, isOpen]);
|
|
71
|
-
const handleFocus = (0, _react.useCallback)((e, firstFocusableElement
|
|
71
|
+
const handleFocus = (0, _react.useCallback)((e, firstFocusableElement) => {
|
|
72
72
|
if (e.key === "Tab") {
|
|
73
73
|
/* istanbul ignore else */
|
|
74
74
|
if (e.shiftKey) {
|
|
75
75
|
/* istanbul ignore else */
|
|
76
|
-
if (document.activeElement ===
|
|
77
|
-
|
|
76
|
+
if (document.activeElement === firstFocusableElement) {
|
|
77
|
+
selectedColorRef.focus();
|
|
78
78
|
e.preventDefault();
|
|
79
79
|
}
|
|
80
|
-
} else if (document.activeElement ===
|
|
81
|
-
|
|
80
|
+
} else if (document.activeElement === selectedColorRef) {
|
|
81
|
+
firstFocusableElement.focus();
|
|
82
82
|
e.preventDefault();
|
|
83
83
|
}
|
|
84
84
|
}
|
|
@@ -3,7 +3,7 @@ import Icon from "../icon";
|
|
|
3
3
|
declare const StyledBadgeWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
4
|
declare const StyledCounter: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
5
|
declare const StyledButton: import("styled-components").StyledComponent<{
|
|
6
|
-
({ size, subtext,
|
|
6
|
+
({ size, subtext, children, forwardRef, "aria-label": ariaLabel, disabled, destructive, buttonType: buttonTypeProp, iconType, iconPosition, href, m, px, noWrap, target, rel, iconTooltipMessage, iconTooltipPosition, fullWidth, ...rest }: import("../button").ButtonProps): JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
}, any, {}, never>;
|
|
9
9
|
declare const StyledCrossIcon: import("styled-components").StyledComponent<typeof Icon, any, {}, never>;
|
|
@@ -10,8 +10,6 @@ export interface ButtonProps extends SpaceProps {
|
|
|
10
10
|
* This is required to comply with WCAG 4.1.2 - Buttons must have discernible text
|
|
11
11
|
*/
|
|
12
12
|
"aria-label"?: string;
|
|
13
|
-
/** [Legacy] Button types for legacy theme: "primary" | "secondary" */
|
|
14
|
-
as?: ButtonTypes;
|
|
15
13
|
/** Color variants for new business themes: "primary" | "secondary" | "tertiary" | "darkBackground" */
|
|
16
14
|
buttonType?: ButtonTypes;
|
|
17
15
|
/** The text the button displays */
|
|
@@ -60,7 +58,7 @@ export interface ButtonProps extends SpaceProps {
|
|
|
60
58
|
rel?: string;
|
|
61
59
|
}
|
|
62
60
|
declare const Button: {
|
|
63
|
-
({ size, subtext,
|
|
61
|
+
({ size, subtext, children, forwardRef, "aria-label": ariaLabel, disabled, destructive, buttonType: buttonTypeProp, iconType, iconPosition, href, m, px, noWrap, target, rel, iconTooltipMessage, iconTooltipPosition, fullWidth, ...rest }: ButtonProps): JSX.Element;
|
|
64
62
|
displayName: string;
|
|
65
63
|
};
|
|
66
64
|
declare const ButtonWithForwardRef: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -19,8 +19,6 @@ var _tags = _interopRequireDefault(require("../../__internal__/utils/helpers/tag
|
|
|
19
19
|
|
|
20
20
|
var _tooltipProvider = require("../../__internal__/tooltip-provider");
|
|
21
21
|
|
|
22
|
-
var _logger = _interopRequireDefault(require("../../__internal__/utils/logger"));
|
|
23
|
-
|
|
24
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
23
|
|
|
26
24
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
@@ -94,12 +92,10 @@ renderChildren.propTypes = {
|
|
|
94
92
|
}
|
|
95
93
|
}
|
|
96
94
|
};
|
|
97
|
-
let deprecatedWarnTriggered = false;
|
|
98
95
|
|
|
99
96
|
const Button = ({
|
|
100
97
|
size = "medium",
|
|
101
98
|
subtext = "",
|
|
102
|
-
as,
|
|
103
99
|
children,
|
|
104
100
|
forwardRef,
|
|
105
101
|
"aria-label": ariaLabel,
|
|
@@ -119,13 +115,6 @@ const Button = ({
|
|
|
119
115
|
fullWidth = false,
|
|
120
116
|
...rest
|
|
121
117
|
}) => {
|
|
122
|
-
if (!deprecatedWarnTriggered && as) {
|
|
123
|
-
deprecatedWarnTriggered = true;
|
|
124
|
-
|
|
125
|
-
_logger.default.deprecate( // eslint-disable-next-line max-len
|
|
126
|
-
"The `as` prop is deprecated and will soon be removed from the `Button` component interface. You should use the `buttonType` prop to achieve the same styling. The following codemod is available to help with updating your code https://github.com/Sage/carbon-codemod/tree/master/transforms/rename-prop");
|
|
127
|
-
}
|
|
128
|
-
|
|
129
118
|
(0, _invariant.default)(!!(children || iconType), "Either prop `iconType` must be defined or this node must have children.");
|
|
130
119
|
|
|
131
120
|
if (subtext) {
|
|
@@ -133,7 +122,7 @@ const Button = ({
|
|
|
133
122
|
}
|
|
134
123
|
|
|
135
124
|
const [internalRef, setInternalRef] = (0, _react.useState)();
|
|
136
|
-
const buttonType =
|
|
125
|
+
const buttonType = buttonTypeProp;
|
|
137
126
|
let paddingX;
|
|
138
127
|
|
|
139
128
|
const handleLinkKeyDown = event => {
|
|
@@ -203,7 +192,6 @@ const Button = ({
|
|
|
203
192
|
|
|
204
193
|
Button.propTypes = {
|
|
205
194
|
"aria-label": _propTypes.default.string,
|
|
206
|
-
"as": _propTypes.default.oneOf(["darkBackground", "dashed", "primary", "secondary", "tertiary"]),
|
|
207
195
|
"buttonType": _propTypes.default.oneOf(["darkBackground", "dashed", "primary", "secondary", "tertiary"]),
|
|
208
196
|
"children": _propTypes.default.node,
|
|
209
197
|
"destructive": _propTypes.default.bool,
|
|
@@ -546,7 +534,6 @@ const ButtonWithForwardRef = /*#__PURE__*/_react.default.forwardRef((props, ref)
|
|
|
546
534
|
exports.ButtonWithForwardRef = ButtonWithForwardRef;
|
|
547
535
|
ButtonWithForwardRef.propTypes = {
|
|
548
536
|
"aria-label": _propTypes.default.string,
|
|
549
|
-
"as": _propTypes.default.oneOf(["darkBackground", "dashed", "primary", "secondary", "tertiary"]),
|
|
550
537
|
"buttonType": _propTypes.default.oneOf(["darkBackground", "dashed", "primary", "secondary", "tertiary"]),
|
|
551
538
|
"children": _propTypes.default.node,
|
|
552
539
|
"destructive": _propTypes.default.bool,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SpaceProps } from "styled-system";
|
|
2
2
|
import { ButtonProps } from "./button.component";
|
|
3
|
-
declare const StyledButton: import("styled-components").StyledComponent<"button", any, SpaceProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> &
|
|
3
|
+
declare const StyledButton: import("styled-components").StyledComponent<"button", any, SpaceProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & ButtonProps & {
|
|
4
4
|
iconOnly?: boolean | undefined;
|
|
5
5
|
}, never>;
|
|
6
6
|
export declare const StyledButtonSubtext: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
@@ -17,7 +17,7 @@ var _buttonToggleGroup = _interopRequireDefault(require("./button-toggle-group.s
|
|
|
17
17
|
|
|
18
18
|
var _buttonToggle = _interopRequireDefault(require("../button-toggle"));
|
|
19
19
|
|
|
20
|
-
var _radioButtonMapper = _interopRequireDefault(require("
|
|
20
|
+
var _radioButtonMapper = _interopRequireDefault(require("../../__internal__/radio-button-mapper/radio-button-mapper.component"));
|
|
21
21
|
|
|
22
22
|
var _validationIcon = _interopRequireDefault(require("../../__internal__/validations/validation-icon.component"));
|
|
23
23
|
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
export default Confirm;
|
|
2
|
-
declare function Confirm({ "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-label": ariaLabel, open, children,
|
|
2
|
+
declare function Confirm({ "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-label": ariaLabel, open, children, cancelButtonDestructive, confirmButtonDestructive, cancelButtonType, confirmButtonType, cancelButtonIconType, cancelButtonIconPosition, confirmButtonIconType, confirmButtonIconPosition, cancelLabel, onCancel, disableCancel, onConfirm, isLoadingConfirm, disableConfirm, confirmLabel, iconType, subtitle, title, ...rest }: {
|
|
3
3
|
[x: string]: any;
|
|
4
4
|
"aria-labelledby": any;
|
|
5
5
|
"aria-describedby": any;
|
|
6
6
|
"aria-label": any;
|
|
7
7
|
open: any;
|
|
8
8
|
children: any;
|
|
9
|
-
destructive: any;
|
|
10
9
|
cancelButtonDestructive: any;
|
|
11
10
|
confirmButtonDestructive: any;
|
|
12
11
|
cancelButtonType: any;
|
|
@@ -30,7 +29,6 @@ declare namespace Confirm {
|
|
|
30
29
|
namespace defaultProps {
|
|
31
30
|
const size: string;
|
|
32
31
|
const showCloseIcon: boolean;
|
|
33
|
-
const destructive: boolean;
|
|
34
32
|
const cancelButtonDestructive: boolean;
|
|
35
33
|
const confirmButtonDestructive: boolean;
|
|
36
34
|
const iconType: null;
|
|
@@ -81,8 +79,6 @@ declare namespace Confirm {
|
|
|
81
79
|
confirmLabel: PropTypes.Requireable<string>;
|
|
82
80
|
/** Customise the cancel button label */
|
|
83
81
|
cancelLabel: PropTypes.Requireable<string>;
|
|
84
|
-
/** Apply destructive style to the buttons */
|
|
85
|
-
destructive: PropTypes.Requireable<boolean>;
|
|
86
82
|
/** Apply destructive style to the cancel button */
|
|
87
83
|
cancelButtonDestructive: PropTypes.Requireable<boolean>;
|
|
88
84
|
/** Apply destructive style to the confirm button */
|
|
@@ -11,8 +11,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
11
11
|
|
|
12
12
|
var _guid = _interopRequireDefault(require("../../__internal__/utils/helpers/guid"));
|
|
13
13
|
|
|
14
|
-
var _logger = _interopRequireDefault(require("../../__internal__/utils/logger"));
|
|
15
|
-
|
|
16
14
|
var _heading = _interopRequireDefault(require("../heading"));
|
|
17
15
|
|
|
18
16
|
var _dialog = _interopRequireDefault(require("../dialog"));
|
|
@@ -35,15 +33,12 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
|
|
|
35
33
|
|
|
36
34
|
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); }
|
|
37
35
|
|
|
38
|
-
let deprecatedWarnTriggered = false;
|
|
39
|
-
|
|
40
36
|
const Confirm = ({
|
|
41
37
|
"aria-labelledby": ariaLabelledBy,
|
|
42
38
|
"aria-describedby": ariaDescribedBy,
|
|
43
39
|
"aria-label": ariaLabel,
|
|
44
40
|
open,
|
|
45
41
|
children,
|
|
46
|
-
destructive,
|
|
47
42
|
cancelButtonDestructive,
|
|
48
43
|
confirmButtonDestructive,
|
|
49
44
|
cancelButtonType,
|
|
@@ -64,12 +59,6 @@ const Confirm = ({
|
|
|
64
59
|
title,
|
|
65
60
|
...rest
|
|
66
61
|
}) => {
|
|
67
|
-
if (!deprecatedWarnTriggered && destructive) {
|
|
68
|
-
deprecatedWarnTriggered = true;
|
|
69
|
-
|
|
70
|
-
_logger.default.deprecate("`destructive` prop is deprecated and will soon be removed. Please use `cancelButtonDestructive` and `confirmButtonDestructive` props.");
|
|
71
|
-
}
|
|
72
|
-
|
|
73
62
|
const l = (0, _useLocale.default)();
|
|
74
63
|
const {
|
|
75
64
|
current: titleId
|
|
@@ -97,7 +86,7 @@ const Confirm = ({
|
|
|
97
86
|
onClick: onCancel,
|
|
98
87
|
"data-element": "cancel",
|
|
99
88
|
buttonType: cancelButtonType,
|
|
100
|
-
destructive:
|
|
89
|
+
destructive: cancelButtonDestructive,
|
|
101
90
|
disabled: disableCancel,
|
|
102
91
|
iconType: cancelButtonIconType,
|
|
103
92
|
iconPosition: cancelButtonIconPosition
|
|
@@ -108,7 +97,7 @@ const Confirm = ({
|
|
|
108
97
|
onClick: onConfirm,
|
|
109
98
|
"data-element": "confirm",
|
|
110
99
|
buttonType: confirmButtonType,
|
|
111
|
-
destructive:
|
|
100
|
+
destructive: confirmButtonDestructive,
|
|
112
101
|
disabled: isLoadingConfirm || disableConfirm,
|
|
113
102
|
ml: 2,
|
|
114
103
|
iconType: confirmButtonIconType,
|
|
@@ -152,7 +141,6 @@ const Confirm = ({
|
|
|
152
141
|
Confirm.defaultProps = {
|
|
153
142
|
size: "extra-small",
|
|
154
143
|
showCloseIcon: false,
|
|
155
|
-
destructive: false,
|
|
156
144
|
cancelButtonDestructive: false,
|
|
157
145
|
confirmButtonDestructive: false,
|
|
158
146
|
iconType: null,
|
|
@@ -220,9 +208,6 @@ Confirm.propTypes = {
|
|
|
220
208
|
/** Customise the cancel button label */
|
|
221
209
|
cancelLabel: _propTypes.default.string,
|
|
222
210
|
|
|
223
|
-
/** Apply destructive style to the buttons */
|
|
224
|
-
destructive: _propTypes.default.bool,
|
|
225
|
-
|
|
226
211
|
/** Apply destructive style to the cancel button */
|
|
227
212
|
cancelButtonDestructive: _propTypes.default.bool,
|
|
228
213
|
|
|
@@ -21,8 +21,6 @@ export interface ConfirmProps extends DialogProps {
|
|
|
21
21
|
cancelLabel?: string;
|
|
22
22
|
/** Customise the confirm button label */
|
|
23
23
|
confirmLabel?: string;
|
|
24
|
-
/** Apply destructive style to the buttons */
|
|
25
|
-
destructive?: boolean;
|
|
26
24
|
/** Apply destructive style to the cancel button */
|
|
27
25
|
cancelButtonDestructive?: boolean;
|
|
28
26
|
/** Apply destructive style to the confirm button */
|
|
@@ -39,7 +39,8 @@ const DatePicker = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
39
39
|
disablePortal,
|
|
40
40
|
onDayClick,
|
|
41
41
|
pickerMouseDown,
|
|
42
|
-
pickerProps
|
|
42
|
+
pickerProps,
|
|
43
|
+
open
|
|
43
44
|
}, ref) => {
|
|
44
45
|
const l = (0, _useLocale.default)();
|
|
45
46
|
const {
|
|
@@ -49,22 +50,27 @@ const DatePicker = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
49
50
|
const {
|
|
50
51
|
weekStartsOn
|
|
51
52
|
} = options;
|
|
52
|
-
const monthsLong = Array.from({
|
|
53
|
+
const monthsLong = (0, _react.useMemo)(() => Array.from({
|
|
53
54
|
length: 12
|
|
54
|
-
}).map((_, i) =>
|
|
55
|
-
|
|
55
|
+
}).map((_, i) => {
|
|
56
|
+
const month = localize.month(i);
|
|
57
|
+
return month[0].toUpperCase() + month.slice(1);
|
|
58
|
+
}), [localize]);
|
|
59
|
+
const monthsShort = (0, _react.useMemo)(() => Array.from({
|
|
56
60
|
length: 12
|
|
57
61
|
}).map((_, i) => localize.month(i, {
|
|
58
62
|
width: "abbreviated"
|
|
59
|
-
}).substring(0, 3));
|
|
60
|
-
const weekdaysLong = Array.from({
|
|
63
|
+
}).substring(0, 3)), [localize]);
|
|
64
|
+
const weekdaysLong = (0, _react.useMemo)(() => Array.from({
|
|
61
65
|
length: 7
|
|
62
|
-
}).map((_, i) => localize.day(i));
|
|
63
|
-
const weekdaysShort = Array.from({
|
|
66
|
+
}).map((_, i) => localize.day(i)), [localize]);
|
|
67
|
+
const weekdaysShort = (0, _react.useMemo)(() => Array.from({
|
|
64
68
|
length: 7
|
|
65
|
-
}).map((_, i) => localize.day(i, l.locale()
|
|
69
|
+
}).map((_, i) => localize.day(i, ["de", "pl"].filter(str => l.locale().includes(str)).length ? {
|
|
70
|
+
width: "wide"
|
|
71
|
+
} : {
|
|
66
72
|
width: "abbreviated"
|
|
67
|
-
}).substring(0, 3));
|
|
73
|
+
}).substring(0, 3)), [l, localize]);
|
|
68
74
|
const popoverModifiers = (0, _react.useMemo)(() => [{
|
|
69
75
|
name: "offset",
|
|
70
76
|
options: {
|
|
@@ -87,6 +93,10 @@ const DatePicker = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
87
93
|
|
|
88
94
|
const formatDay = date => `${weekdaysShort[date.getDay()]} ${date.getDate()} ${monthsShort[date.getMonth()]} ${date.getFullYear()}`;
|
|
89
95
|
|
|
96
|
+
if (!open) {
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
|
|
90
100
|
return /*#__PURE__*/_react.default.createElement(_popover.default, {
|
|
91
101
|
placement: "bottom-start",
|
|
92
102
|
reference: inputElement,
|
|
@@ -148,7 +158,10 @@ DatePicker.propTypes = {
|
|
|
148
158
|
pickerProps: _propTypes.default.object,
|
|
149
159
|
|
|
150
160
|
/** Callback to handle mousedown event on picker */
|
|
151
|
-
pickerMouseDown: _propTypes.default.func
|
|
161
|
+
pickerMouseDown: _propTypes.default.func,
|
|
162
|
+
|
|
163
|
+
/** Sets whether the picker should be displayed */
|
|
164
|
+
open: _propTypes.default.bool
|
|
152
165
|
};
|
|
153
166
|
var _default = DatePicker;
|
|
154
167
|
exports.default = _default;
|
|
@@ -16,6 +16,8 @@ export interface DatePickerProps extends Pick<DayPickerProps, "onDayClick"> {
|
|
|
16
16
|
selectedDays?: Date;
|
|
17
17
|
/** Callback to handle mousedown event on picker container */
|
|
18
18
|
pickerMouseDown?: () => void;
|
|
19
|
+
/** Sets whether the picker should be displayed */
|
|
20
|
+
open?: boolean;
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
declare function DatePicker(
|
|
@@ -335,7 +335,7 @@ const DateInput = ({
|
|
|
335
335
|
size: size,
|
|
336
336
|
disabled: disabled,
|
|
337
337
|
readOnly: readOnly
|
|
338
|
-
})),
|
|
338
|
+
})), /*#__PURE__*/_react.default.createElement(_datePicker.default, {
|
|
339
339
|
disablePortal: disablePortal,
|
|
340
340
|
inputElement: parentRef,
|
|
341
341
|
pickerProps: pickerProps,
|
|
@@ -345,7 +345,8 @@ const DateInput = ({
|
|
|
345
345
|
minDate: minDate,
|
|
346
346
|
maxDate: maxDate,
|
|
347
347
|
ref: pickerRef,
|
|
348
|
-
pickerMouseDown: handlePickerMouseDown
|
|
348
|
+
pickerMouseDown: handlePickerMouseDown,
|
|
349
|
+
open: open
|
|
349
350
|
}));
|
|
350
351
|
};
|
|
351
352
|
|
|
@@ -179,7 +179,8 @@ const Dialog = ({
|
|
|
179
179
|
autoFocus: !disableAutoFocus,
|
|
180
180
|
focusFirstElement: focusFirstElement,
|
|
181
181
|
bespokeTrap: bespokeFocusTrap,
|
|
182
|
-
wrapperRef: dialogRef
|
|
182
|
+
wrapperRef: dialogRef,
|
|
183
|
+
isOpen: open
|
|
183
184
|
}, /*#__PURE__*/_react.default.createElement(_dialog.DialogStyle, _extends({
|
|
184
185
|
"aria-modal": true,
|
|
185
186
|
ref: dialogRef,
|
|
@@ -189,9 +190,9 @@ const Dialog = ({
|
|
|
189
190
|
"data-element": "dialog",
|
|
190
191
|
"data-role": rest["data-role"],
|
|
191
192
|
role: role
|
|
192
|
-
}, contentPadding), dialogTitle(), /*#__PURE__*/_react.default.createElement(_dialog.DialogContentStyle, contentPadding, /*#__PURE__*/_react.default.createElement(_dialog.DialogInnerContentStyle, _extends({
|
|
193
|
+
}, contentPadding), dialogTitle(), closeIcon(), /*#__PURE__*/_react.default.createElement(_dialog.DialogContentStyle, contentPadding, /*#__PURE__*/_react.default.createElement(_dialog.DialogInnerContentStyle, _extends({
|
|
193
194
|
ref: innerContentRef
|
|
194
|
-
}, contentPadding), children))
|
|
195
|
+
}, contentPadding), children)))));
|
|
195
196
|
};
|
|
196
197
|
|
|
197
198
|
Dialog.propTypes = {
|
|
@@ -93,16 +93,10 @@ const StyledContent = _styledComponents.default.div`
|
|
|
93
93
|
|
|
94
94
|
${({
|
|
95
95
|
hasHeader
|
|
96
|
-
}) => !hasHeader && `
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
.carbon-app-wrapper {
|
|
101
|
-
max-width: 100%;
|
|
102
|
-
padding: 0;
|
|
103
|
-
height: 70px;
|
|
104
|
-
}
|
|
105
|
-
`}
|
|
96
|
+
}) => !hasHeader && (0, _styledComponents.css)`
|
|
97
|
+
padding-top: 0;
|
|
98
|
+
margin-top: -25px;
|
|
99
|
+
`}
|
|
106
100
|
`;
|
|
107
101
|
var _default = StyledContent;
|
|
108
102
|
exports.default = _default;
|
|
@@ -109,7 +109,8 @@ const DialogFullScreen = ({
|
|
|
109
109
|
}, componentTags), /*#__PURE__*/_react.default.createElement(_focusTrap.default, {
|
|
110
110
|
autoFocus: !disableAutoFocus,
|
|
111
111
|
focusFirstElement: focusFirstElement,
|
|
112
|
-
wrapperRef: dialogRef
|
|
112
|
+
wrapperRef: dialogRef,
|
|
113
|
+
isOpen: open
|
|
113
114
|
}, /*#__PURE__*/_react.default.createElement(_dialogFullScreen.default, _extends({
|
|
114
115
|
"aria-modal": role === "dialog" ? true : undefined
|
|
115
116
|
}, ariaProps, {
|
|
@@ -117,12 +118,12 @@ const DialogFullScreen = ({
|
|
|
117
118
|
"data-element": "dialog-full-screen",
|
|
118
119
|
pagesStyling: pagesStyling,
|
|
119
120
|
role: role
|
|
120
|
-
}), dialogTitle(), /*#__PURE__*/_react.default.createElement(_content.default, {
|
|
121
|
+
}), dialogTitle(), closeIcon(), /*#__PURE__*/_react.default.createElement(_content.default, {
|
|
121
122
|
hasHeader: title !== undefined,
|
|
122
123
|
"data-element": "content",
|
|
123
124
|
ref: contentRef,
|
|
124
125
|
disableContentPadding: disableContentPadding
|
|
125
|
-
}, children)
|
|
126
|
+
}, children))));
|
|
126
127
|
};
|
|
127
128
|
|
|
128
129
|
DialogFullScreen.defaultProps = {
|
|
@@ -1,64 +1,44 @@
|
|
|
1
1
|
export default Heading;
|
|
2
|
-
declare
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
declare function Heading({ children, backLink, divider, help, helpAriaLabel, helpLink, pills, separator, subheader, subtitleId, title, titleId, ...rest }: {
|
|
3
|
+
[x: string]: any;
|
|
4
|
+
children: any;
|
|
5
|
+
backLink: any;
|
|
6
|
+
divider?: boolean | undefined;
|
|
7
|
+
help: any;
|
|
8
|
+
helpAriaLabel: any;
|
|
9
|
+
helpLink: any;
|
|
10
|
+
pills: any;
|
|
11
|
+
separator?: boolean | undefined;
|
|
12
|
+
subheader: any;
|
|
13
|
+
subtitleId: any;
|
|
14
|
+
title: any;
|
|
15
|
+
titleId: any;
|
|
16
|
+
}): JSX.Element | null;
|
|
13
17
|
declare namespace Heading {
|
|
14
18
|
const propTypes: {
|
|
15
|
-
/**
|
|
16
|
-
* Children elements
|
|
17
|
-
*/
|
|
19
|
+
/** Child elements */
|
|
18
20
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
19
|
-
/**
|
|
20
|
-
* Defines the title for the heading.
|
|
21
|
-
*/
|
|
21
|
+
/** Defines the title for the heading. */
|
|
22
22
|
title: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
23
|
-
/**
|
|
24
|
-
* Defines the title id for the heading.
|
|
25
|
-
*/
|
|
23
|
+
/** Defines the title id for the heading. */
|
|
26
24
|
titleId: PropTypes.Requireable<string>;
|
|
27
|
-
/**
|
|
28
|
-
* Defines the subheader for the heading.
|
|
29
|
-
*/
|
|
25
|
+
/** Defines the subheader for the heading. */
|
|
30
26
|
subheader: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
31
|
-
/**
|
|
32
|
-
* Defines the subtitle id for the heading.
|
|
33
|
-
*/
|
|
27
|
+
/** Defines the subtitle id for the heading. */
|
|
34
28
|
subtitleId: PropTypes.Requireable<string>;
|
|
35
|
-
/**
|
|
36
|
-
* Defines the help text for the heading.
|
|
37
|
-
*/
|
|
29
|
+
/** Defines the help text for the heading. */
|
|
38
30
|
help: PropTypes.Requireable<string>;
|
|
39
|
-
/**
|
|
40
|
-
* Defines the help link for the heading.
|
|
41
|
-
*/
|
|
31
|
+
/** Defines the help link for the heading. */
|
|
42
32
|
helpLink: PropTypes.Requireable<string>;
|
|
43
|
-
/**
|
|
44
|
-
* Defines the a href for the back link.
|
|
45
|
-
*/
|
|
33
|
+
/** Defines the a href for the back link. */
|
|
46
34
|
backLink: PropTypes.Requireable<string | ((...args: any[]) => any)>;
|
|
47
|
-
/**
|
|
48
|
-
* Adds a divider below the heading and the content.
|
|
49
|
-
*/
|
|
35
|
+
/** Adds a divider below the heading and the content. */
|
|
50
36
|
divider: PropTypes.Requireable<boolean>;
|
|
51
|
-
/**
|
|
52
|
-
* Adds a separator between the title and the subheader.
|
|
53
|
-
*/
|
|
37
|
+
/** Adds a separator between the title and the subheader. */
|
|
54
38
|
separator: PropTypes.Requireable<boolean>;
|
|
55
|
-
/**
|
|
56
|
-
* Pills that will be added after the title.
|
|
57
|
-
*/
|
|
39
|
+
/** Pills that will be added after the title. */
|
|
58
40
|
pills: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
59
|
-
/**
|
|
60
|
-
* Aria label for rendered help component
|
|
61
|
-
*/
|
|
41
|
+
/** Aria label for rendered help component */
|
|
62
42
|
helpAriaLabel: PropTypes.Requireable<string>;
|
|
63
43
|
marginBottom?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
64
44
|
margin?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
@@ -75,10 +55,5 @@ declare namespace Heading {
|
|
|
75
55
|
marginY?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
76
56
|
my?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
77
57
|
};
|
|
78
|
-
namespace defaultProps {
|
|
79
|
-
const divider: boolean;
|
|
80
|
-
const separator: boolean;
|
|
81
|
-
}
|
|
82
58
|
}
|
|
83
|
-
import React from "react";
|
|
84
59
|
import PropTypes from "prop-types";
|