@carbon/ibm-products 2.43.2-canary.53 → 2.43.2-canary.55
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/css/index-full-carbon.css +8 -2
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +1 -1
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon.css +8 -2
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +1 -1
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +8 -2
- package/css/index.css.map +1 -1
- package/css/index.min.css +1 -1
- package/css/index.min.css.map +1 -1
- package/es/components/Coachmark/Coachmark.js +12 -7
- package/es/components/CoachmarkFixed/CoachmarkFixed.js +13 -11
- package/es/components/CoachmarkStack/CoachmarkStack.js +7 -3
- package/es/components/CoachmarkStack/CoachmarkStackHome.js +8 -4
- package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +21 -11
- package/es/components/ConditionBuilder/ConditionBuilder.js +15 -5
- package/es/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.d.ts +2 -2
- package/es/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.js +58 -36
- package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +3 -1
- package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +21 -9
- package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +4 -1
- package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +14 -4
- package/es/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +8 -4
- package/es/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +17 -9
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +19 -10
- package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +12 -6
- package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +20 -7
- package/es/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.d.ts +2 -1
- package/es/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.js +18 -17
- package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +36 -39
- package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +36 -38
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +20 -12
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +8 -3
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +9 -7
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +9 -4
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +10 -5
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.d.ts +5 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js +19 -7
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +23 -17
- package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +3 -1
- package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +31 -14
- package/es/components/ConditionBuilder/utils/useTranslations.d.ts +1 -0
- package/es/components/ConditionBuilder/utils/useTranslations.js +26 -0
- package/es/components/ConditionBuilder/utils/util.js +1 -9
- package/es/components/CreateFullPage/CreateFullPage.js +2 -2
- package/es/components/Datagrid/Datagrid/DatagridSelectAll.js +2 -1
- package/es/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +3 -2
- package/es/components/Datagrid/useSelectRows.js +2 -1
- package/es/components/Nav/NavItem.js +12 -3
- package/es/components/OptionsTile/OptionsTile.js +4 -5
- package/es/components/SidePanel/SidePanel.js +17 -20
- package/es/components/SidePanel/motion/variants.d.ts +4 -6
- package/es/components/SidePanel/motion/variants.js +10 -11
- package/es/components/Tearsheet/TearsheetShell.js +3 -1
- package/es/components/WebTerminal/WebTerminal.js +10 -12
- package/es/global/js/hooks/usePrefersReducedMotion.js +14 -8
- package/lib/components/Coachmark/Coachmark.js +12 -7
- package/lib/components/CoachmarkFixed/CoachmarkFixed.js +13 -11
- package/lib/components/CoachmarkStack/CoachmarkStack.js +7 -3
- package/lib/components/CoachmarkStack/CoachmarkStackHome.js +8 -4
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +20 -10
- package/lib/components/ConditionBuilder/ConditionBuilder.js +15 -5
- package/lib/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.d.ts +2 -2
- package/lib/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.js +56 -33
- package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +3 -1
- package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +20 -8
- package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +4 -1
- package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +13 -3
- package/lib/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +6 -2
- package/lib/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +16 -8
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +18 -9
- package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +12 -6
- package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +20 -7
- package/lib/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.d.ts +2 -1
- package/lib/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.js +17 -17
- package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +36 -39
- package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +36 -38
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +19 -11
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +8 -3
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +8 -6
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +8 -3
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +9 -4
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.d.ts +5 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js +18 -6
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +21 -15
- package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +3 -1
- package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +30 -13
- package/lib/components/ConditionBuilder/utils/useTranslations.d.ts +1 -0
- package/lib/components/ConditionBuilder/utils/useTranslations.js +30 -0
- package/lib/components/ConditionBuilder/utils/util.js +0 -9
- package/lib/components/CreateFullPage/CreateFullPage.js +2 -2
- package/lib/components/Datagrid/Datagrid/DatagridSelectAll.js +2 -1
- package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +3 -2
- package/lib/components/Datagrid/useSelectRows.js +2 -1
- package/lib/components/Nav/NavItem.js +10 -1
- package/lib/components/OptionsTile/OptionsTile.js +4 -5
- package/lib/components/SidePanel/SidePanel.js +16 -19
- package/lib/components/SidePanel/motion/variants.d.ts +4 -6
- package/lib/components/SidePanel/motion/variants.js +10 -11
- package/lib/components/Tearsheet/TearsheetShell.js +3 -1
- package/lib/components/WebTerminal/WebTerminal.js +10 -12
- package/lib/global/js/hooks/usePrefersReducedMotion.js +13 -7
- package/package.json +3 -3
- package/scss/components/ConditionBuilder/styles/_conditionBuilderCondition.scss +5 -1
- package/scss/components/ConditionBuilder/styles/_conditionBuilderItem.scss +3 -1
- package/es/global/js/utils/window.d.ts +0 -2
- package/es/global/js/utils/window.js +0 -12
- package/lib/global/js/utils/window.d.ts +0 -2
- package/lib/global/js/utils/window.js +0 -16
@@ -23,6 +23,7 @@ var react = require('@carbon/react');
|
|
23
23
|
var icons = require('@carbon/react/icons');
|
24
24
|
var variants = require('./motion/variants.js');
|
25
25
|
var pconsole = require('../../global/js/utils/pconsole.js');
|
26
|
+
var usePrefersReducedMotion = require('../../global/js/hooks/usePrefersReducedMotion.js');
|
26
27
|
var ActionSet = require('../ActionSet/ActionSet.js');
|
27
28
|
var usePreviousValue = require('../../global/js/hooks/usePreviousValue.js');
|
28
29
|
var useFocus = require('../../global/js/hooks/useFocus.js');
|
@@ -53,7 +54,6 @@ var defaults = {
|
|
53
54
|
* Side panels keep users in-context of a page while performing tasks like navigating, editing, viewing details, or configuring something new.
|
54
55
|
*/
|
55
56
|
exports.SidePanel = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, ref) {
|
56
|
-
var _window;
|
57
57
|
var actionToolbarButtons = _ref.actionToolbarButtons,
|
58
58
|
actions = _ref.actions,
|
59
59
|
_ref$animateTitle = _ref.animateTitle,
|
@@ -120,7 +120,7 @@ exports.SidePanel = /*#__PURE__*/React__default["default"].forwardRef(function (
|
|
120
120
|
keyDownListener = _useFocus.keyDownListener;
|
121
121
|
var panelRefValue = sidePanelRef.current;
|
122
122
|
var previousOpen = usePreviousValue.usePreviousValue(open);
|
123
|
-
var shouldReduceMotion =
|
123
|
+
var shouldReduceMotion = usePrefersReducedMotion["default"]();
|
124
124
|
|
125
125
|
// Title animation on scroll related state
|
126
126
|
var _useState7 = React.useState(0),
|
@@ -163,9 +163,6 @@ exports.SidePanel = /*#__PURE__*/React__default["default"].forwardRef(function (
|
|
163
163
|
titleItemsStyles(animationProgress);
|
164
164
|
}
|
165
165
|
}, [doAnimateTitle, panelRefValue === null || panelRefValue === void 0 ? void 0 : panelRefValue.style, scrollAnimationDistance, titleItemsStyles]);
|
166
|
-
var reducedMotion = typeof document !== 'undefined' && (_window = window) !== null && _window !== void 0 && _window.matchMedia ? window.matchMedia('(prefers-reduced-motion: reduce)') : {
|
167
|
-
matches: true
|
168
|
-
};
|
169
166
|
|
170
167
|
// scroll panel to top going between steps
|
171
168
|
React.useEffect(function () {
|
@@ -202,7 +199,7 @@ exports.SidePanel = /*#__PURE__*/React__default["default"].forwardRef(function (
|
|
202
199
|
}, [launcherButtonRef, open, previousOpen]);
|
203
200
|
var checkSetDoAnimateTitle = function checkSetDoAnimateTitle() {
|
204
201
|
var canDoAnimateTitle = false;
|
205
|
-
if (panelRefValue && open && animateTitle && animationComplete && titleRef !== null && titleRef !== void 0 && titleRef.current && title && title.length && !
|
202
|
+
if (panelRefValue && open && animateTitle && animationComplete && titleRef !== null && titleRef !== void 0 && titleRef.current && title && title.length && !shouldReduceMotion) {
|
206
203
|
var _labelTextRef$current3, _labelTextRef$current4, _subtitleRef$current$, _subtitleRef$current;
|
207
204
|
var titleEl = titleRef.current;
|
208
205
|
var labelHeight = (_labelTextRef$current3 = labelTextRef === null || labelTextRef === void 0 || (_labelTextRef$current4 = labelTextRef.current) === null || _labelTextRef$current4 === void 0 ? void 0 : _labelTextRef$current4.offsetHeight) !== null && _labelTextRef$current3 !== void 0 ? _labelTextRef$current3 : 0;
|
@@ -218,8 +215,8 @@ exports.SidePanel = /*#__PURE__*/React__default["default"].forwardRef(function (
|
|
218
215
|
panelRefValue === null || panelRefValue === void 0 || panelRefValue.style.setProperty("--".concat(blockClass, "--scroll-animation-distance"), _scrollAnimationDistance.toString());
|
219
216
|
var scrollEl = innerContentRef.current;
|
220
217
|
if (scrollEl) {
|
221
|
-
var
|
222
|
-
var innerComputed = (
|
218
|
+
var _window;
|
219
|
+
var innerComputed = (_window = window) === null || _window === void 0 ? void 0 : _window.getComputedStyle(innerContentRef.current);
|
223
220
|
var innerPaddingHeight = innerComputed ? parseFloat(innerComputed === null || innerComputed === void 0 ? void 0 : innerComputed.paddingTop) + parseFloat(innerComputed === null || innerComputed === void 0 ? void 0 : innerComputed.paddingBottom) : 0;
|
224
221
|
canDoAnimateTitle = (!!labelText || !!actionToolbarButtons || !!subtitle) && scrollEl.scrollHeight - scrollEl.clientHeight >= _scrollAnimationDistance + innerPaddingHeight;
|
225
222
|
}
|
@@ -237,12 +234,12 @@ exports.SidePanel = /*#__PURE__*/React__default["default"].forwardRef(function (
|
|
237
234
|
|
238
235
|
// Calculate scroll distances
|
239
236
|
React.useEffect(function () {
|
240
|
-
if (panelRefValue && open && animateTitle && animationComplete && titleRef !== null && titleRef !== void 0 && titleRef.current && title && title.length && !
|
237
|
+
if (panelRefValue && open && animateTitle && animationComplete && titleRef !== null && titleRef !== void 0 && titleRef.current && title && title.length && !shouldReduceMotion) {
|
241
238
|
checkSetDoAnimateTitle();
|
242
239
|
}
|
243
240
|
|
244
241
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
245
|
-
}, [open, doAnimateTitle /* use do instead of animateTitle directly */, animationComplete, handleScroll, title, size,
|
242
|
+
}, [open, doAnimateTitle /* use do instead of animateTitle directly */, animationComplete, handleScroll, title, size, shouldReduceMotion, id]);
|
246
243
|
|
247
244
|
// click outside functionality if `includeOverlay` prop is set
|
248
245
|
React.useEffect(function () {
|
@@ -278,10 +275,10 @@ exports.SidePanel = /*#__PURE__*/React__default["default"].forwardRef(function (
|
|
278
275
|
// Set the internal state `animationComplete` to true if
|
279
276
|
// prefers reduced motion is true
|
280
277
|
React.useEffect(function () {
|
281
|
-
if (
|
278
|
+
if (shouldReduceMotion) {
|
282
279
|
setAnimationComplete(true);
|
283
280
|
}
|
284
|
-
}, [
|
281
|
+
}, [shouldReduceMotion]);
|
285
282
|
|
286
283
|
// initializes the side panel to open
|
287
284
|
var onAnimationStart = function onAnimationStart() {
|
@@ -300,10 +297,10 @@ exports.SidePanel = /*#__PURE__*/React__default["default"].forwardRef(function (
|
|
300
297
|
}
|
301
298
|
}, [open, placement, selectorPageContent, slideIn]);
|
302
299
|
React.useEffect(function () {
|
303
|
-
if (!open && previousState && previousState['open'] &&
|
300
|
+
if (!open && previousState && previousState['open'] && shouldReduceMotion) {
|
304
301
|
onUnmount === null || onUnmount === void 0 || onUnmount();
|
305
302
|
}
|
306
|
-
}, [open, onUnmount,
|
303
|
+
}, [open, onUnmount, shouldReduceMotion, previousState]);
|
307
304
|
|
308
305
|
// used to set margins of content for slide in panel version
|
309
306
|
React.useEffect(function () {
|
@@ -316,15 +313,15 @@ exports.SidePanel = /*#__PURE__*/React__default["default"].forwardRef(function (
|
|
316
313
|
}
|
317
314
|
if (placement && placement === 'right' && pageContentElement) {
|
318
315
|
pageContentElement.style.marginInlineEnd = '0';
|
319
|
-
pageContentElement.style.transition = !
|
316
|
+
pageContentElement.style.transition = !shouldReduceMotion ? "margin-inline-end ".concat(carbonMotion.moderate02) : '';
|
320
317
|
pageContentElement.style.marginInlineEnd = constants.SIDE_PANEL_SIZES[size];
|
321
318
|
} else if (pageContentElement) {
|
322
319
|
pageContentElement.style.marginInlineStart = '0';
|
323
|
-
pageContentElement.style.transition = !
|
320
|
+
pageContentElement.style.transition = !shouldReduceMotion ? "margin-inline-start ".concat(carbonMotion.moderate02) : '';
|
324
321
|
pageContentElement.style.marginInlineStart = constants.SIDE_PANEL_SIZES[size];
|
325
322
|
}
|
326
323
|
}
|
327
|
-
}, [slideIn, selectorPageContent, placement, size,
|
324
|
+
}, [slideIn, selectorPageContent, placement, size, shouldReduceMotion, open]);
|
328
325
|
React.useEffect(function () {
|
329
326
|
if (open) {
|
330
327
|
setTimeout(function () {
|
@@ -350,7 +347,7 @@ exports.SidePanel = /*#__PURE__*/React__default["default"].forwardRef(function (
|
|
350
347
|
className: "".concat(blockClass, "__title-text"),
|
351
348
|
title: title,
|
352
349
|
"aria-hidden": false
|
353
|
-
}, title), doAnimateTitle && !
|
350
|
+
}, title), doAnimateTitle && !shouldReduceMotion && /*#__PURE__*/React__default["default"].createElement("h2", {
|
354
351
|
className: "".concat(blockClass, "__collapsed-title-text"),
|
355
352
|
title: title,
|
356
353
|
"aria-hidden": true
|
@@ -367,7 +364,7 @@ exports.SidePanel = /*#__PURE__*/React__default["default"].forwardRef(function (
|
|
367
364
|
});
|
368
365
|
}
|
369
366
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
370
|
-
className: cx__default["default"]("".concat(blockClass, "__header"), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__header--on-detail-step"), currentStep > 0), "".concat(blockClass, "__header--no-title-animation"), !animateTitle), "".concat(blockClass, "__header--reduced-motion"),
|
367
|
+
className: cx__default["default"]("".concat(blockClass, "__header"), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__header--on-detail-step"), currentStep > 0), "".concat(blockClass, "__header--no-title-animation"), !animateTitle), "".concat(blockClass, "__header--reduced-motion"), shouldReduceMotion), "".concat(blockClass, "__header--has-title"), title)),
|
371
368
|
ref: headerRef
|
372
369
|
}, currentStep > 0 && /*#__PURE__*/React__default["default"].createElement(react.Button, {
|
373
370
|
"aria-label": navigationBackIconDescription,
|
@@ -16,15 +16,13 @@ export namespace overlayVariants {
|
|
16
16
|
}
|
17
17
|
}
|
18
18
|
export namespace panelVariants {
|
19
|
-
export function visible_1(
|
20
|
-
shouldReduceMotion: any;
|
21
|
-
}): {
|
19
|
+
export function visible_1(): {
|
22
20
|
x: number;
|
23
21
|
transition: {
|
24
22
|
duration: number;
|
25
23
|
ease: number[];
|
26
24
|
};
|
27
|
-
opacity:
|
25
|
+
opacity: number;
|
28
26
|
};
|
29
27
|
export { visible_1 as visible };
|
30
28
|
export function hidden_1({ placement, shouldReduceMotion }: {
|
@@ -32,7 +30,7 @@ export namespace panelVariants {
|
|
32
30
|
shouldReduceMotion: any;
|
33
31
|
}): {
|
34
32
|
x: string | number;
|
35
|
-
opacity:
|
33
|
+
opacity: number;
|
36
34
|
};
|
37
35
|
export { hidden_1 as hidden };
|
38
36
|
export function exit_1({ placement, shouldReduceMotion }: {
|
@@ -44,7 +42,7 @@ export namespace panelVariants {
|
|
44
42
|
duration: number;
|
45
43
|
ease: number[];
|
46
44
|
};
|
47
|
-
opacity:
|
45
|
+
opacity: number;
|
48
46
|
};
|
49
47
|
export { exit_1 as exit };
|
50
48
|
}
|
@@ -27,35 +27,34 @@ var overlayVariants = {
|
|
27
27
|
}
|
28
28
|
};
|
29
29
|
var panelVariants = {
|
30
|
-
visible: function visible(
|
31
|
-
var shouldReduceMotion = _ref.shouldReduceMotion;
|
30
|
+
visible: function visible() {
|
32
31
|
return {
|
33
32
|
x: 0,
|
34
33
|
transition: {
|
35
34
|
duration: motionConstants.DURATIONS.moderate02,
|
36
35
|
ease: motionConstants.EASINGS.productive.standard
|
37
36
|
},
|
38
|
-
opacity:
|
37
|
+
opacity: 1
|
39
38
|
};
|
40
39
|
},
|
41
|
-
hidden: function hidden(
|
42
|
-
var placement =
|
43
|
-
shouldReduceMotion =
|
40
|
+
hidden: function hidden(_ref) {
|
41
|
+
var placement = _ref.placement,
|
42
|
+
shouldReduceMotion = _ref.shouldReduceMotion;
|
44
43
|
return {
|
45
44
|
x: placement === 'right' ? shouldReduceMotion ? 0 : '100%' : shouldReduceMotion ? 0 : -320,
|
46
|
-
opacity: shouldReduceMotion
|
45
|
+
opacity: shouldReduceMotion ? 0 : 1
|
47
46
|
};
|
48
47
|
},
|
49
|
-
exit: function exit(
|
50
|
-
var placement =
|
51
|
-
shouldReduceMotion =
|
48
|
+
exit: function exit(_ref2) {
|
49
|
+
var placement = _ref2.placement,
|
50
|
+
shouldReduceMotion = _ref2.shouldReduceMotion;
|
52
51
|
return {
|
53
52
|
x: placement === 'right' ? shouldReduceMotion ? 0 : '100%' : shouldReduceMotion ? 0 : -320,
|
54
53
|
transition: {
|
55
54
|
duration: motionConstants.DURATIONS.moderate01,
|
56
55
|
ease: motionConstants.EASINGS.productive.exit
|
57
56
|
},
|
58
|
-
opacity: shouldReduceMotion
|
57
|
+
opacity: shouldReduceMotion ? 0 : 1
|
59
58
|
};
|
60
59
|
}
|
61
60
|
};
|
@@ -322,7 +322,9 @@ var TearsheetShell = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
322
322
|
// The display name of the component, used by React. Note that displayName
|
323
323
|
// is used in preference to relying on function.name.
|
324
324
|
TearsheetShell.displayName = componentName;
|
325
|
-
var portalType = typeof Element === 'undefined' ? index["default"].object
|
325
|
+
var portalType = typeof Element === 'undefined' ? index["default"].object
|
326
|
+
// eslint-disable-next-line ssr-friendly/no-dom-globals-in-module-scope
|
327
|
+
: index["default"].instanceOf(Element);
|
326
328
|
var deprecatedProps = {
|
327
329
|
/**
|
328
330
|
* **Deprecated**
|
@@ -19,6 +19,7 @@ var react = require('@carbon/react');
|
|
19
19
|
var carbonMotion = require('@carbon/motion');
|
20
20
|
var index = require('./hooks/index.js');
|
21
21
|
var devtools = require('../../global/js/utils/devtools.js');
|
22
|
+
var usePrefersReducedMotion = require('../../global/js/hooks/usePrefersReducedMotion.js');
|
22
23
|
|
23
24
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
24
25
|
|
@@ -65,10 +66,7 @@ exports.WebTerminal = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
65
66
|
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
66
67
|
shouldRender = _useState2[0],
|
67
68
|
setRender = _useState2[1];
|
68
|
-
var
|
69
|
-
matches: true
|
70
|
-
},
|
71
|
-
prefersReducedMotion = _ref2.matches;
|
69
|
+
var shouldReduceMotion = usePrefersReducedMotion["default"]();
|
72
70
|
var webTerminalAnimationName = "".concat(open ? 'web-terminal-entrance' : 'web-terminal-exit forwards', " ").concat(carbonMotion.moderate02);
|
73
71
|
var showDocumentationLinks = React.useMemo(function () {
|
74
72
|
return documentationLinks.length > 0;
|
@@ -101,7 +99,7 @@ exports.WebTerminal = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
101
99
|
If the user prefers reduced motion, we have to manually set render to false
|
102
100
|
because onAnimationEnd will never be called.
|
103
101
|
*/
|
104
|
-
if (
|
102
|
+
if (shouldReduceMotion) {
|
105
103
|
setRender(false);
|
106
104
|
}
|
107
105
|
closeWebTerminal === null || closeWebTerminal === void 0 || closeWebTerminal();
|
@@ -110,7 +108,7 @@ exports.WebTerminal = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
110
108
|
ref: ref,
|
111
109
|
className: cx__default["default"]([blockClass, className, _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "--open"), open), "".concat(blockClass, "--closed"), !open)]),
|
112
110
|
style: {
|
113
|
-
animation: !
|
111
|
+
animation: !shouldReduceMotion ? webTerminalAnimationName : ''
|
114
112
|
},
|
115
113
|
onAnimationEnd: onAnimationEnd
|
116
114
|
}), /*#__PURE__*/React__default["default"].createElement("header", {
|
@@ -128,15 +126,15 @@ exports.WebTerminal = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
128
126
|
"aria-label": documentationLinksIconDescription,
|
129
127
|
menuOptionsClass: "".concat(blockClass, "__documentation-overflow"),
|
130
128
|
size: "lg"
|
131
|
-
}, documentationLinks.map(function (
|
132
|
-
var rest = _rollupPluginBabelHelpers["extends"]({}, (_rollupPluginBabelHelpers.objectDestructuringEmpty(
|
129
|
+
}, documentationLinks.map(function (_ref3, i) {
|
130
|
+
var rest = _rollupPluginBabelHelpers["extends"]({}, (_rollupPluginBabelHelpers.objectDestructuringEmpty(_ref3), _ref3));
|
133
131
|
return /*#__PURE__*/React__default["default"].createElement(react.OverflowMenuItem, _rollupPluginBabelHelpers["extends"]({
|
134
132
|
key: i
|
135
133
|
}, rest));
|
136
|
-
})), actions.map(function (
|
137
|
-
var renderIcon =
|
138
|
-
onClick =
|
139
|
-
iconDescription =
|
134
|
+
})), actions.map(function (_ref4) {
|
135
|
+
var renderIcon = _ref4.renderIcon,
|
136
|
+
onClick = _ref4.onClick,
|
137
|
+
iconDescription = _ref4.iconDescription;
|
140
138
|
return /*#__PURE__*/React__default["default"].createElement(react.Button, {
|
141
139
|
key: iconDescription,
|
142
140
|
hasIconOnly: true,
|
@@ -11,19 +11,25 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
11
|
|
12
12
|
var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
|
13
13
|
var React = require('react');
|
14
|
-
var
|
14
|
+
var useIsomorphicEffect = require('./useIsomorphicEffect.js');
|
15
15
|
|
16
16
|
var usePrefersReducedMotion = function usePrefersReducedMotion() {
|
17
17
|
var _useState = React.useState(false),
|
18
18
|
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
19
19
|
prefersReducedMotion = _useState2[0],
|
20
20
|
setPrefersReducedMotion = _useState2[1];
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
21
|
+
useIsomorphicEffect.useIsomorphicEffect(function () {
|
22
|
+
var mediaQueryList = window.matchMedia('(prefers-reduced-motion: no-preference)');
|
23
|
+
var _window$matchMedia = window.matchMedia('(prefers-reduced-motion: no-preference)'),
|
24
|
+
matches = _window$matchMedia.matches;
|
25
|
+
setPrefersReducedMotion(!matches);
|
26
|
+
var listener = function listener(event) {
|
27
|
+
setPrefersReducedMotion(!event.matches);
|
28
|
+
};
|
29
|
+
mediaQueryList.addEventListener('change', listener);
|
30
|
+
return function () {
|
31
|
+
mediaQueryList.removeEventListener('change', listener);
|
32
|
+
};
|
27
33
|
}, []);
|
28
34
|
return prefersReducedMotion;
|
29
35
|
};
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@carbon/ibm-products",
|
3
3
|
"description": "Carbon for IBM Products",
|
4
|
-
"version": "2.43.2-canary.
|
4
|
+
"version": "2.43.2-canary.55+9f0245063",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "lib/index.js",
|
7
7
|
"module": "es/index.js",
|
@@ -96,7 +96,7 @@
|
|
96
96
|
"dependencies": {
|
97
97
|
"@babel/runtime": "^7.23.9",
|
98
98
|
"@carbon/feature-flags": "^0.20.0",
|
99
|
-
"@carbon/ibm-products-styles": "^2.
|
99
|
+
"@carbon/ibm-products-styles": "^2.39.1-canary.65+9f0245063",
|
100
100
|
"@carbon/telemetry": "^0.1.0",
|
101
101
|
"@dnd-kit/core": "^6.0.8",
|
102
102
|
"@dnd-kit/modifiers": "^7.0.0",
|
@@ -120,5 +120,5 @@
|
|
120
120
|
"react": "^16.8.6 || ^17.0.1 || ^18.2.0",
|
121
121
|
"react-dom": "^16.8.6 || ^17.0.1 || ^18.2.0"
|
122
122
|
},
|
123
|
-
"gitHead": "
|
123
|
+
"gitHead": "9f0245063cc08bb494ef3dc9e2c768ab069ec5de"
|
124
124
|
}
|
@@ -30,7 +30,8 @@ $block-class: #{c4p-settings.$pkg-prefix}--condition-builder;
|
|
30
30
|
.#{$block-class}__condition__deletion-preview
|
31
31
|
.#{$block-class}__button:not(
|
32
32
|
.#{$block-class}__statement-button,
|
33
|
-
.#{$block-class}__connector-button
|
33
|
+
.#{$block-class}__connector-button,
|
34
|
+
.#{$block-class}__add-button
|
34
35
|
) {
|
35
36
|
background-color: $tag-background-red;
|
36
37
|
color: $tag-color-red;
|
@@ -56,6 +57,9 @@ $block-class: #{c4p-settings.$pkg-prefix}--condition-builder;
|
|
56
57
|
opacity: 0;
|
57
58
|
pointer-events: none;
|
58
59
|
transition: all $duration-moderate-02 motion(exit, expressive);
|
60
|
+
.#{$block-class}__preview-condition {
|
61
|
+
display: flex;
|
62
|
+
}
|
59
63
|
}
|
60
64
|
.#{$block-class}__group-preview-animate {
|
61
65
|
height: auto;
|
@@ -96,7 +96,7 @@ $block-class: #{c4p-settings.$pkg-prefix}--condition-builder;
|
|
96
96
|
.#{$block-class}__item-date,
|
97
97
|
.#{$block-class}__item-text,
|
98
98
|
.#{$block-class}__item-number,
|
99
|
-
|
99
|
+
.#{$block-class}__item-time {
|
100
100
|
padding-block-end: $spacing-05;
|
101
101
|
padding-inline: $spacing-05;
|
102
102
|
}
|
@@ -236,6 +236,7 @@ $colors: (
|
|
236
236
|
}
|
237
237
|
.#{$block-class}__add_condition_group-wrapper {
|
238
238
|
z-index: -1;
|
239
|
+
width: 0;
|
239
240
|
margin-left: -50%;
|
240
241
|
opacity: 0;
|
241
242
|
pointer-events: none;
|
@@ -244,6 +245,7 @@ $colors: (
|
|
244
245
|
}
|
245
246
|
.#{$block-class}__add_condition_group-wrapper--show {
|
246
247
|
z-index: 0;
|
248
|
+
width: auto;
|
247
249
|
margin-left: 0;
|
248
250
|
opacity: 1;
|
249
251
|
pointer-events: all;
|
@@ -1,12 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright IBM Corp. 2020, 2024
|
3
|
-
*
|
4
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
6
|
-
*/
|
7
|
-
|
8
|
-
var hasDocument = function hasDocument() {
|
9
|
-
return typeof document !== 'undefined';
|
10
|
-
};
|
11
|
-
|
12
|
-
export { hasDocument };
|
@@ -1,16 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright IBM Corp. 2020, 2024
|
3
|
-
*
|
4
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
6
|
-
*/
|
7
|
-
|
8
|
-
'use strict';
|
9
|
-
|
10
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
11
|
-
|
12
|
-
var hasDocument = function hasDocument() {
|
13
|
-
return typeof document !== 'undefined';
|
14
|
-
};
|
15
|
-
|
16
|
-
exports.hasDocument = hasDocument;
|