carbon-react 106.0.3 → 106.1.2
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__/input/input-presentation.component.d.ts +2 -2
- package/esm/__internal__/validations/index.d.ts +1 -1
- package/esm/__internal__/validations/validation-icon.component.d.ts +50 -40
- package/esm/__internal__/validations/validation-icon.component.js +12 -64
- package/esm/__internal__/validations/validation-icon.style.d.ts +5 -1
- package/esm/__internal__/validations/validation-icon.style.js +0 -1
- package/esm/components/duelling-picklist/picklist-item/picklist-item.component.js +7 -3
- package/esm/components/icon/icon.d.ts +4 -0
- package/esm/components/modal/modal.component.js +7 -1
- package/esm/components/pages/page/page.component.js +7 -3
- package/esm/components/popover-container/popover-container.component.js +5 -2
- package/esm/components/portal/portal.js +12 -8
- package/esm/components/select/simple-select/simple-select.component.js +1 -1
- package/esm/components/show-edit-pod/show-edit-pod.component.js +10 -4
- package/esm/components/textarea/textarea-test.stories.js +21 -1
- package/esm/components/toast/toast.component.js +6 -2
- package/esm/style/fonts.css +22 -16
- package/esm/style/themes/base/base-theme.config.d.ts +78 -10
- package/esm/style/themes/sage/index.d.ts +78 -10
- package/lib/__internal__/input/input-presentation.component.d.ts +2 -2
- package/lib/__internal__/validations/index.d.ts +1 -1
- package/lib/__internal__/validations/validation-icon.component.d.ts +50 -40
- package/lib/__internal__/validations/validation-icon.component.js +13 -65
- package/lib/__internal__/validations/validation-icon.style.d.ts +5 -1
- package/lib/__internal__/validations/validation-icon.style.js +0 -1
- package/lib/components/duelling-picklist/picklist-item/picklist-item.component.js +6 -2
- package/lib/components/icon/icon.d.ts +4 -0
- package/lib/components/modal/modal.component.js +7 -1
- package/lib/components/pages/page/page.component.js +11 -3
- package/lib/components/popover-container/popover-container.component.js +5 -2
- package/lib/components/portal/portal.js +15 -8
- package/lib/components/select/simple-select/simple-select.component.js +1 -1
- package/lib/components/show-edit-pod/show-edit-pod.component.js +10 -4
- package/lib/components/textarea/textarea-test.stories.js +21 -1
- package/lib/components/toast/toast.component.js +6 -2
- package/lib/style/fonts.css +22 -16
- package/lib/style/themes/base/base-theme.config.d.ts +78 -10
- package/lib/style/themes/sage/index.d.ts +78 -10
- package/package.json +2 -2
- package/esm/__internal__/validations/validation-icon.d.ts +0 -38
- package/esm/__internal__/validations/validations.d.ts +0 -17
- package/lib/__internal__/validations/validation-icon.d.ts +0 -38
- package/lib/__internal__/validations/validations.d.ts +0 -17
|
@@ -3,13 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = void 0;
|
|
6
|
+
exports.default = exports.ValidationIcon = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
var _propTypes2 = _interopRequireDefault(require("@styled-system/prop-types"));
|
|
10
|
+
var _invariant = _interopRequireDefault(require("invariant"));
|
|
13
11
|
|
|
14
12
|
var _icon = _interopRequireDefault(require("../../components/icon"));
|
|
15
13
|
|
|
@@ -27,8 +25,6 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
|
|
|
27
25
|
|
|
28
26
|
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); }
|
|
29
27
|
|
|
30
|
-
const marginPropTypes = (0, _utils.filterStyledSystemMarginProps)(_propTypes2.default.space);
|
|
31
|
-
|
|
32
28
|
const getValidationType = ({
|
|
33
29
|
error,
|
|
34
30
|
warning,
|
|
@@ -37,7 +33,7 @@ const getValidationType = ({
|
|
|
37
33
|
if (error) return "error";
|
|
38
34
|
if (warning) return "warning";
|
|
39
35
|
if (info) return "info";
|
|
40
|
-
return
|
|
36
|
+
return null;
|
|
41
37
|
};
|
|
42
38
|
|
|
43
39
|
const ValidationIcon = ({
|
|
@@ -50,12 +46,18 @@ const ValidationIcon = ({
|
|
|
50
46
|
iconId,
|
|
51
47
|
tooltipId,
|
|
52
48
|
isPartOfInput,
|
|
53
|
-
tabIndex,
|
|
49
|
+
tabIndex = -1,
|
|
54
50
|
onClick,
|
|
55
|
-
tooltipPosition,
|
|
51
|
+
tooltipPosition = "right",
|
|
56
52
|
tooltipFlipOverrides,
|
|
57
53
|
...rest
|
|
58
54
|
}) => {
|
|
55
|
+
const flipBehaviourCheck = Array.isArray(tooltipFlipOverrides) && tooltipFlipOverrides.every(override => ["bottom", "left", "right", "top"].includes(override));
|
|
56
|
+
|
|
57
|
+
if (tooltipFlipOverrides) {
|
|
58
|
+
(0, _invariant.default)(flipBehaviourCheck, `The tooltipFlipOverrides prop supplied to ValidationIcon must be an array containing some or all of ["top", "bottom", "left", "right"].`);
|
|
59
|
+
}
|
|
60
|
+
|
|
59
61
|
const {
|
|
60
62
|
hasFocus,
|
|
61
63
|
hasMouseOver
|
|
@@ -72,7 +74,7 @@ const ValidationIcon = ({
|
|
|
72
74
|
});
|
|
73
75
|
const validationMessage = error || warning || info;
|
|
74
76
|
|
|
75
|
-
if (typeof validationMessage !== "string") {
|
|
77
|
+
if (typeof validationMessage !== "string" || !validationType) {
|
|
76
78
|
return null;
|
|
77
79
|
}
|
|
78
80
|
|
|
@@ -107,60 +109,6 @@ const ValidationIcon = ({
|
|
|
107
109
|
}));
|
|
108
110
|
};
|
|
109
111
|
|
|
110
|
-
ValidationIcon
|
|
111
|
-
|
|
112
|
-
/** A small string to indicate the size of the icon */
|
|
113
|
-
size: _propTypes.default.oneOf(["small", "medium", "large"]),
|
|
114
|
-
|
|
115
|
-
/** The unique id of the component (used with aria-describedby for accessibility) */
|
|
116
|
-
iconId: _propTypes.default.string,
|
|
117
|
-
|
|
118
|
-
/** Define position of the tooltip */
|
|
119
|
-
tooltipPosition: _propTypes.default.string,
|
|
120
|
-
|
|
121
|
-
/** Overrides the default flip behaviour of the Tooltip, must be an array containing some or all of ["top", "bottom", "left", "right"] (see https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements) */
|
|
122
|
-
tooltipFlipOverrides: (props, propName, componentName) => {
|
|
123
|
-
const prop = props[propName];
|
|
124
|
-
const isValid = prop && Array.isArray(prop) && prop.every(placement => ["bottom", "left", "right", "top"].includes(placement));
|
|
125
|
-
|
|
126
|
-
if (!prop || isValid) {
|
|
127
|
-
return null;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
return new Error( // eslint-disable-next-line max-len
|
|
131
|
-
`The \`${propName}\` prop supplied to \`${componentName}\` must be an array containing some or all of ["top", "bottom", "left", "right"].`);
|
|
132
|
-
},
|
|
133
|
-
|
|
134
|
-
/** Id passed to the tooltip container, used for accessibility purposes. */
|
|
135
|
-
tooltipId: _propTypes.default.string,
|
|
136
|
-
|
|
137
|
-
/** An onClick handler */
|
|
138
|
-
onClick: _propTypes.default.func,
|
|
139
|
-
|
|
140
|
-
/** An onFocus handler */
|
|
141
|
-
onFocus: _propTypes.default.func,
|
|
142
|
-
|
|
143
|
-
/** An onBlur handler */
|
|
144
|
-
onBlur: _propTypes.default.func,
|
|
145
|
-
|
|
146
|
-
/** A boolean to indicate if the icon is part of an input */
|
|
147
|
-
isPartOfInput: _propTypes.default.bool,
|
|
148
|
-
|
|
149
|
-
/** Overrides the default tabindex of the component */
|
|
150
|
-
tabIndex: _propTypes.default.number,
|
|
151
|
-
|
|
152
|
-
/** Status of error validations */
|
|
153
|
-
error: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.string]),
|
|
154
|
-
|
|
155
|
-
/** Status of warnings */
|
|
156
|
-
warning: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.string]),
|
|
157
|
-
|
|
158
|
-
/** Status of info */
|
|
159
|
-
info: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.string])
|
|
160
|
-
};
|
|
161
|
-
ValidationIcon.defaultProps = {
|
|
162
|
-
tooltipPosition: "right",
|
|
163
|
-
tabIndex: -1
|
|
164
|
-
};
|
|
112
|
+
exports.ValidationIcon = ValidationIcon;
|
|
165
113
|
var _default = ValidationIcon;
|
|
166
114
|
exports.default = _default;
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
+
import { ValidationIconProps } from "./validation-icon.component";
|
|
2
|
+
declare type ValidationType = "error" | "warning" | "info";
|
|
3
|
+
declare const ValidationIconStyle: import("styled-components").StyledComponent<"span", any, ValidationIconProps & {
|
|
4
|
+
validationType: ValidationType;
|
|
5
|
+
}, never>;
|
|
1
6
|
export default ValidationIconStyle;
|
|
2
|
-
declare const ValidationIconStyle: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
@@ -22,7 +22,6 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
|
|
|
22
22
|
const validationIconTypes = {
|
|
23
23
|
error: "var(--colorsSemanticNegative500)",
|
|
24
24
|
info: "var(--colorsSemanticInfo500)",
|
|
25
|
-
success: "var(--colorsSemanticPositive500)",
|
|
26
25
|
warning: "var(--colorsSemanticCaution500)"
|
|
27
26
|
};
|
|
28
27
|
const ValidationIconStyle = _styledComponents.default.span`
|
|
@@ -44,6 +44,7 @@ const PicklistItem = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
44
44
|
const {
|
|
45
45
|
setElementToFocus
|
|
46
46
|
} = (0, _react.useContext)(_duellingPicklist.default);
|
|
47
|
+
const picklistItemNodeRef = (0, _react.useRef)();
|
|
47
48
|
const calculateFocusIndex = (0, _react.useCallback)(() => {
|
|
48
49
|
if (isLastItem) {
|
|
49
50
|
const toggledListIndex = listIndex === 0 ? 1 : 0;
|
|
@@ -89,10 +90,13 @@ const PicklistItem = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
89
90
|
classNames: "picklist-item"
|
|
90
91
|
}, rest, type === "add" ? {
|
|
91
92
|
enter: false
|
|
92
|
-
} : {}
|
|
93
|
+
} : {}, {
|
|
94
|
+
nodeRef: picklistItemNodeRef
|
|
95
|
+
}), /*#__PURE__*/_react.default.createElement(_picklistItem.StyledPicklistItem, {
|
|
93
96
|
onKeyDown: handleKeydown,
|
|
94
97
|
"data-element": "picklist-item",
|
|
95
|
-
locked: locked
|
|
98
|
+
locked: locked,
|
|
99
|
+
ref: picklistItemNodeRef
|
|
96
100
|
}, children, !locked && /*#__PURE__*/_react.default.createElement(_picklistItem.StyledButton, {
|
|
97
101
|
buttonType: "primary",
|
|
98
102
|
destructive: type === "remove",
|
|
@@ -239,6 +239,10 @@ export interface IconProps extends MarginProps {
|
|
|
239
239
|
tooltipId?: string;
|
|
240
240
|
/** Id passed to the icon. */
|
|
241
241
|
id?: string;
|
|
242
|
+
tabIndex?: number;
|
|
243
|
+
isPartOfInput?: boolean;
|
|
244
|
+
inputSize?: "small" | "medium" | "large";
|
|
245
|
+
focusable?: boolean;
|
|
242
246
|
}
|
|
243
247
|
|
|
244
248
|
declare function Icon(
|
|
@@ -44,6 +44,8 @@ const Modal = ({
|
|
|
44
44
|
...rest
|
|
45
45
|
}) => {
|
|
46
46
|
const ref = (0, _react.useRef)();
|
|
47
|
+
const backgroundNodeRef = (0, _react.useRef)();
|
|
48
|
+
const contentNodeRef = (0, _react.useRef)();
|
|
47
49
|
const listenerAdded = (0, _react.useRef)(false);
|
|
48
50
|
const modalRegistered = (0, _react.useRef)(false);
|
|
49
51
|
const [isAnimationComplete, setAnimationComplete] = (0, _react.useState)(false);
|
|
@@ -139,6 +141,7 @@ const Modal = ({
|
|
|
139
141
|
|
|
140
142
|
if (open) {
|
|
141
143
|
background = !enableBackgroundUI ? /*#__PURE__*/_react.default.createElement(_modal.StyledModalBackground, {
|
|
144
|
+
ref: backgroundNodeRef,
|
|
142
145
|
"data-element": "modal-background",
|
|
143
146
|
transitionName: "modal-background",
|
|
144
147
|
transitionTime: timeout
|
|
@@ -152,6 +155,7 @@ const Modal = ({
|
|
|
152
155
|
transitionTime: timeout,
|
|
153
156
|
ref: ref
|
|
154
157
|
}, rest), /*#__PURE__*/_react.default.createElement(_reactTransitionGroup.TransitionGroup, null, background && /*#__PURE__*/_react.default.createElement(_reactTransitionGroup.CSSTransition, {
|
|
158
|
+
nodeRef: backgroundNodeRef,
|
|
155
159
|
key: "modal",
|
|
156
160
|
appear: true,
|
|
157
161
|
classNames: "modal-background",
|
|
@@ -159,6 +163,7 @@ const Modal = ({
|
|
|
159
163
|
onEntered: () => setAnimationComplete(true),
|
|
160
164
|
onExiting: () => setAnimationComplete(false)
|
|
161
165
|
}, background)), /*#__PURE__*/_react.default.createElement(_reactTransitionGroup.TransitionGroup, null, content && /*#__PURE__*/_react.default.createElement(_reactTransitionGroup.CSSTransition, {
|
|
166
|
+
nodeRef: contentNodeRef,
|
|
162
167
|
appear: true,
|
|
163
168
|
classNames: "modal",
|
|
164
169
|
timeout: timeout
|
|
@@ -167,7 +172,8 @@ const Modal = ({
|
|
|
167
172
|
isAnimationComplete,
|
|
168
173
|
triggerRefocusFlag,
|
|
169
174
|
isInModal: true
|
|
170
|
-
}
|
|
175
|
+
},
|
|
176
|
+
ref: contentNodeRef
|
|
171
177
|
}, content)))));
|
|
172
178
|
};
|
|
173
179
|
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
@@ -21,6 +21,10 @@ var _page = require("./page.style");
|
|
|
21
21
|
|
|
22
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
23
|
|
|
24
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
25
|
+
|
|
26
|
+
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; }
|
|
27
|
+
|
|
24
28
|
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
29
|
|
|
26
30
|
const Page = ({
|
|
@@ -28,6 +32,7 @@ const Page = ({
|
|
|
28
32
|
children,
|
|
29
33
|
...props
|
|
30
34
|
}) => {
|
|
35
|
+
const styledPageNodeRef = (0, _react.useRef)();
|
|
31
36
|
return /*#__PURE__*/_react.default.createElement(_reactTransitionGroup.CSSTransition, _extends({
|
|
32
37
|
className: "carbon-carousel__transition",
|
|
33
38
|
timeout: {
|
|
@@ -36,8 +41,11 @@ const Page = ({
|
|
|
36
41
|
exit: 0
|
|
37
42
|
} // eslint-disable-next-line react/prop-types
|
|
38
43
|
,
|
|
39
|
-
classNames: props.transitionName()
|
|
40
|
-
|
|
44
|
+
classNames: props.transitionName(),
|
|
45
|
+
nodeRef: styledPageNodeRef
|
|
46
|
+
}, props), /*#__PURE__*/_react.default.createElement(_page.StyledPage, _extends({}, (0, _tags.default)("page", props), {
|
|
47
|
+
ref: styledPageNodeRef
|
|
48
|
+
}), /*#__PURE__*/_react.default.createElement(_fullScreenHeading.default, {
|
|
41
49
|
hasContent: title
|
|
42
50
|
}, title), /*#__PURE__*/_react.default.createElement(_page.StyledPageContent, {
|
|
43
51
|
"data-element": "carbon-page-content"
|
|
@@ -52,6 +52,7 @@ const PopoverContainer = ({
|
|
|
52
52
|
const closeButtonRef = (0, _react.useRef)();
|
|
53
53
|
const openButtonRef = (0, _react.useRef)();
|
|
54
54
|
const guid = (0, _react.useRef)((0, _guid.default)());
|
|
55
|
+
const popoverContentNodeRef = (0, _react.useRef)();
|
|
55
56
|
const popoverContainerId = title ? `PopoverContainer_${guid.current}` : undefined;
|
|
56
57
|
const isOpen = isControlled ? open : isOpenInternal;
|
|
57
58
|
(0, _react.useEffect)(() => {
|
|
@@ -99,7 +100,8 @@ const PopoverContainer = ({
|
|
|
99
100
|
},
|
|
100
101
|
appear: true,
|
|
101
102
|
mountOnEnter: true,
|
|
102
|
-
unmountOnExit: true
|
|
103
|
+
unmountOnExit: true,
|
|
104
|
+
nodeRef: popoverContentNodeRef
|
|
103
105
|
}, state => /*#__PURE__*/_react.default.createElement(_popoverContainer.PopoverContainerContentStyle, _extends({
|
|
104
106
|
"data-element": "popover-container-content",
|
|
105
107
|
role: "dialog",
|
|
@@ -109,7 +111,8 @@ const PopoverContainer = ({
|
|
|
109
111
|
"aria-labelledby": popoverContainerId,
|
|
110
112
|
"aria-label": containerAriaLabel,
|
|
111
113
|
"aria-describedby": ariaDescribedBy,
|
|
112
|
-
p: "16px 24px"
|
|
114
|
+
p: "16px 24px",
|
|
115
|
+
ref: popoverContentNodeRef
|
|
113
116
|
}, (0, _utils.filterStyledSystemPaddingProps)(rest)), /*#__PURE__*/_react.default.createElement(_popoverContainer.PopoverContainerHeaderStyle, null, /*#__PURE__*/_react.default.createElement(_popoverContainer.PopoverContainerTitleStyle, {
|
|
114
117
|
id: popoverContainerId,
|
|
115
118
|
"data-element": "popover-container-title"
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = void 0;
|
|
6
|
+
exports.default = exports.PortalContext = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
@@ -23,6 +23,10 @@ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return
|
|
|
23
23
|
|
|
24
24
|
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; }
|
|
25
25
|
|
|
26
|
+
const PortalContext = /*#__PURE__*/_react.default.createContext({});
|
|
27
|
+
|
|
28
|
+
exports.PortalContext = PortalContext;
|
|
29
|
+
|
|
26
30
|
const Portal = ({
|
|
27
31
|
children,
|
|
28
32
|
className,
|
|
@@ -31,6 +35,9 @@ const Portal = ({
|
|
|
31
35
|
}) => {
|
|
32
36
|
const [portalNode, setPortalNode] = (0, _react.useState)(null);
|
|
33
37
|
const uniqueId = (0, _react.useMemo)(() => (0, _guid.default)(), []);
|
|
38
|
+
const {
|
|
39
|
+
renderInRoot
|
|
40
|
+
} = (0, _react.useContext)(PortalContext);
|
|
34
41
|
(0, _react.useEffect)(() => {
|
|
35
42
|
if (onReposition) {
|
|
36
43
|
onReposition();
|
|
@@ -63,7 +70,7 @@ const Portal = ({
|
|
|
63
70
|
if (!node && id !== undefined && document.getElementById(id)) {
|
|
64
71
|
node = document.getElementById(id);
|
|
65
72
|
setPortalNode(node);
|
|
66
|
-
} else if (!node) {
|
|
73
|
+
} else if (!node || document.getElementsByClassName(portalClassName).length === 0) {
|
|
67
74
|
node = document.createElement("div");
|
|
68
75
|
node.classList.add(portalClassName);
|
|
69
76
|
node.setAttribute("data-portal-exit", uniqueId);
|
|
@@ -73,14 +80,14 @@ const Portal = ({
|
|
|
73
80
|
}
|
|
74
81
|
|
|
75
82
|
setPortalNode(node);
|
|
76
|
-
|
|
77
|
-
|
|
83
|
+
let mainNode = document.body;
|
|
84
|
+
const rootDiv = document.getElementById("root");
|
|
78
85
|
|
|
79
|
-
if (rootDiv &&
|
|
80
|
-
rootDiv
|
|
81
|
-
} else {
|
|
82
|
-
document.body.appendChild(node);
|
|
86
|
+
if (rootDiv && renderInRoot) {
|
|
87
|
+
mainNode = rootDiv;
|
|
83
88
|
}
|
|
89
|
+
|
|
90
|
+
mainNode.appendChild(node);
|
|
84
91
|
}
|
|
85
92
|
|
|
86
93
|
if (className) {
|
|
@@ -154,7 +154,7 @@ const SimpleSelect = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
154
154
|
|
|
155
155
|
return true;
|
|
156
156
|
});
|
|
157
|
-
} else if (key.length === 1) {
|
|
157
|
+
} else if (key.length === 1 && !event.metaKey && !event.ctrlKey) {
|
|
158
158
|
triggerFilterChange(key);
|
|
159
159
|
}
|
|
160
160
|
}, [triggerFilterChange, onKeyDown, onOpen, readOnly]);
|
|
@@ -61,6 +61,8 @@ const ShowEditPod = ({
|
|
|
61
61
|
}) => {
|
|
62
62
|
const locale = (0, _react.useContext)(_i18nContext.default);
|
|
63
63
|
const ref = (0, _react.useRef)();
|
|
64
|
+
const editModeNodeRef = (0, _react.useRef)();
|
|
65
|
+
const showModeNodeRef = (0, _react.useRef)();
|
|
64
66
|
const [isEditing, setIsEditingState] = (0, _react.useState)(false);
|
|
65
67
|
const isControlled = editing !== undefined;
|
|
66
68
|
|
|
@@ -146,9 +148,11 @@ const ShowEditPod = ({
|
|
|
146
148
|
timeout: {
|
|
147
149
|
enter: 300,
|
|
148
150
|
exit: 50
|
|
149
|
-
}
|
|
151
|
+
},
|
|
152
|
+
nodeRef: editModeNodeRef
|
|
150
153
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
151
|
-
key: "edit"
|
|
154
|
+
key: "edit",
|
|
155
|
+
ref: editModeNodeRef
|
|
152
156
|
}, editContent()));
|
|
153
157
|
}
|
|
154
158
|
|
|
@@ -158,9 +162,11 @@ const ShowEditPod = ({
|
|
|
158
162
|
timeout: {
|
|
159
163
|
enter: 300,
|
|
160
164
|
exit: 50
|
|
161
|
-
}
|
|
165
|
+
},
|
|
166
|
+
nodeRef: showModeNodeRef
|
|
162
167
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
163
|
-
key: "show"
|
|
168
|
+
key: "show",
|
|
169
|
+
ref: showModeNodeRef
|
|
164
170
|
}, children));
|
|
165
171
|
};
|
|
166
172
|
|
|
@@ -83,7 +83,27 @@ var _default = {
|
|
|
83
83
|
..._specialCharacters.number.mapping
|
|
84
84
|
}
|
|
85
85
|
},
|
|
86
|
-
fieldHelpSpecialCharacters: _specialCharacters.default
|
|
86
|
+
fieldHelpSpecialCharacters: _specialCharacters.default,
|
|
87
|
+
children: {
|
|
88
|
+
control: {
|
|
89
|
+
type: "text"
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
error: {
|
|
93
|
+
control: {
|
|
94
|
+
type: "text"
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
warning: {
|
|
98
|
+
control: {
|
|
99
|
+
type: "text"
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
info: {
|
|
103
|
+
control: {
|
|
104
|
+
type: "text"
|
|
105
|
+
}
|
|
106
|
+
}
|
|
87
107
|
},
|
|
88
108
|
args: {
|
|
89
109
|
expandable: false,
|
|
@@ -63,6 +63,7 @@ const Toast = ({
|
|
|
63
63
|
const locale = (0, _useLocale.default)();
|
|
64
64
|
const toastRef = (0, _react.useRef)();
|
|
65
65
|
const timer = (0, _react.useRef)();
|
|
66
|
+
const toastContentNodeRef = (0, _react.useRef)();
|
|
66
67
|
const componentClasses = (0, _react.useMemo)(() => {
|
|
67
68
|
return (0, _classnames.default)(className);
|
|
68
69
|
}, [className]);
|
|
@@ -122,10 +123,13 @@ const Toast = ({
|
|
|
122
123
|
appear: 1600,
|
|
123
124
|
enter: 1500,
|
|
124
125
|
exit: 500
|
|
125
|
-
}
|
|
126
|
+
},
|
|
127
|
+
nodeRef: toastContentNodeRef
|
|
126
128
|
}, /*#__PURE__*/_react.default.createElement(_toast.ToastStyle, _extends({
|
|
127
129
|
className: componentClasses
|
|
128
|
-
}, (0, _tags.default)(restProps["data-component"] || "toast", restProps), toastProps
|
|
130
|
+
}, (0, _tags.default)(restProps["data-component"] || "toast", restProps), toastProps, {
|
|
131
|
+
ref: toastContentNodeRef
|
|
132
|
+
}), /*#__PURE__*/_react.default.createElement(_toast.TypeIcon, {
|
|
129
133
|
variant: toastProps.variant
|
|
130
134
|
}, /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
131
135
|
type: toastProps.variant
|
package/lib/style/fonts.css
CHANGED
|
@@ -1,30 +1,36 @@
|
|
|
1
|
-
@font-face{
|
|
2
|
-
font-family: "
|
|
3
|
-
src: url(
|
|
4
|
-
font-weight:
|
|
1
|
+
@font-face {
|
|
2
|
+
font-family: "CarbonIcons";
|
|
3
|
+
src: url("./assets/carbon-icons-webfont.woff") format("woff");
|
|
4
|
+
font-weight: normal;
|
|
5
5
|
font-style: normal;
|
|
6
|
-
font-display: swap;
|
|
7
6
|
}
|
|
8
7
|
|
|
9
|
-
@font-face{
|
|
8
|
+
@font-face {
|
|
10
9
|
font-family: "Sage UI";
|
|
11
|
-
src: url('https://fonts.sage.com/Sage_UI-Medium.woff2') format("woff2"), url('https://fonts.sage.com/Sage_UI-Medium.woff') format("woff");
|
|
12
|
-
font-weight: 700;
|
|
13
10
|
font-style: normal;
|
|
14
|
-
font-
|
|
11
|
+
font-weight: 400;
|
|
12
|
+
src: url("~@sage/design-tokens/assets/fonts/sageui-regular.woff2") format("woff2"),
|
|
13
|
+
url("~@sage/design-tokens/assets/fonts/sageui-regular.woff") format("woff"),
|
|
14
|
+
url("~@sage/design-tokens/assets/fonts/sageui-regular.ttf") format("truetype"),
|
|
15
|
+
url("~@sage/design-tokens/assets/fonts/sageui-regular.otf") format("opentype");
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
@font-face{
|
|
18
|
+
@font-face {
|
|
18
19
|
font-family: "Sage UI";
|
|
19
|
-
src: url('https://fonts.sage.com/Sage_UI-Bold.woff2') format("woff2"), url('https://fonts.sage.com/Sage_UI-Bold.woff') format("woff");
|
|
20
|
-
font-weight: 900;
|
|
21
20
|
font-style: normal;
|
|
22
|
-
font-
|
|
21
|
+
font-weight: 700;
|
|
22
|
+
src: url("~@sage/design-tokens/assets/fonts/sageui-medium.woff2") format("woff2"),
|
|
23
|
+
url("~@sage/design-tokens/assets/fonts/sageui-medium.woff") format("woff"),
|
|
24
|
+
url("~@sage/design-tokens/assets/fonts/sageui-medium.ttf") format("truetype"),
|
|
25
|
+
url("~@sage/design-tokens/assets/fonts/sageui-medium.otf") format("opentype");
|
|
23
26
|
}
|
|
24
27
|
|
|
25
28
|
@font-face {
|
|
26
|
-
font-family: "
|
|
27
|
-
src: url("./assets/carbon-icons-webfont.woff") format("woff");
|
|
28
|
-
font-weight: normal;
|
|
29
|
+
font-family: "Sage UI";
|
|
29
30
|
font-style: normal;
|
|
31
|
+
font-weight: 900;
|
|
32
|
+
src: url("~@sage/design-tokens/assets/fonts/sageui-bold.woff2") format("woff2"),
|
|
33
|
+
url("~@sage/design-tokens/assets/fonts/sageui-bold.woff") format("woff"),
|
|
34
|
+
url("~@sage/design-tokens/assets/fonts/sageui-bold.ttf") format("truetype"),
|
|
35
|
+
url("~@sage/design-tokens/assets/fonts/sageui-bold.otf") format("opentype");
|
|
30
36
|
}
|