@carbon/ibm-products 1.65.0 → 1.66.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  /* eslint-disable react/jsx-key */
4
4
  /**
5
- * Copyright IBM Corp. 2022, 2023
5
+ * Copyright IBM Corp. 2022, 2024
6
6
  *
7
7
  * This source code is licensed under the Apache-2.0 license found in the
8
8
  * LICENSE file in the root directory of this source tree.
@@ -15,7 +15,7 @@ import { rem } from '@carbon/layout';
15
15
  import { pkg } from '../../../../../settings';
16
16
  import { BATCH, CLEAR_FILTERS, INSTANT, PANEL } from './constants';
17
17
  import cx from 'classnames';
18
- import { motion } from 'framer-motion';
18
+ import { motion, useReducedMotion } from 'framer-motion';
19
19
  import { panelVariants, innerContainerVariants, actionSetVariants } from './motion/variants';
20
20
  import { Close32 } from '@carbon/icons-react';
21
21
  import { ActionSet } from '../../../../ActionSet';
@@ -102,6 +102,7 @@ var FilterPanel = function FilterPanel(_ref) {
102
102
  _useShouldDisableButt2 = _slicedToArray(_useShouldDisableButt, 2),
103
103
  shouldDisableButtons = _useShouldDisableButt2[0],
104
104
  setShouldDisableButtons = _useShouldDisableButt2[1];
105
+ var shouldReduceMotion = useReducedMotion();
105
106
 
106
107
  /** Memos */
107
108
  var showActionSet = useMemo(function () {
@@ -146,6 +147,7 @@ var FilterPanel = function FilterPanel(_ref) {
146
147
  }],
147
148
  className: "".concat(componentClass, "__action-set"),
148
149
  ref: actionSetRef,
150
+ custom: shouldReduceMotion,
149
151
  variants: actionSetVariants
150
152
  });
151
153
  };
@@ -183,8 +185,10 @@ var FilterPanel = function FilterPanel(_ref) {
183
185
  className: cx(componentClass, "".concat(componentClass, "__container"), (_cx = {}, _defineProperty(_cx, "".concat(componentClass, "--open"), panelOpen), _defineProperty(_cx, "".concat(componentClass, "--batch"), showActionSet), _defineProperty(_cx, "".concat(componentClass, "--instant"), !showActionSet), _cx)),
184
186
  initial: false,
185
187
  animate: panelOpen ? 'visible' : 'hidden',
188
+ custom: shouldReduceMotion,
186
189
  variants: panelVariants
187
190
  }, /*#__PURE__*/React.createElement(motion.div, {
191
+ custom: shouldReduceMotion,
188
192
  variants: innerContainerVariants
189
193
  }, /*#__PURE__*/React.createElement("header", {
190
194
  ref: filterHeadingRef,
@@ -1,55 +1,74 @@
1
+ /**
2
+ * Copyright IBM Corp. 2023, 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
+
1
8
  import { DURATIONS, EASINGS } from '../../../../../../global/js/utils/motionConstants';
2
9
  import { ACTION_SET_HEIGHT, PANEL_WIDTH } from '../constants';
3
10
  export var panelVariants = {
4
- hidden: {
5
- width: 0,
6
- overflow: 'hidden',
7
- transition: {
8
- duration: DURATIONS.fast02,
9
- ease: EASINGS.productive.exit,
10
- when: 'afterChildren'
11
- }
11
+ hidden: function hidden(shouldReduceMotion) {
12
+ return {
13
+ width: 0,
14
+ overflow: 'hidden',
15
+ transition: {
16
+ duration: shouldReduceMotion ? 0 : DURATIONS.fast02,
17
+ ease: shouldReduceMotion ? 0 : EASINGS.productive.exit,
18
+ when: 'afterChildren'
19
+ }
20
+ };
12
21
  },
13
- visible: {
14
- width: PANEL_WIDTH,
15
- overflow: 'visible',
16
- transition: {
17
- duration: DURATIONS.moderate02,
18
- ease: EASINGS.productive.entrance,
19
- when: 'beforeChildren'
20
- }
22
+ visible: function visible(shouldReduceMotion) {
23
+ return {
24
+ width: PANEL_WIDTH,
25
+ overflow: 'visible',
26
+ transition: {
27
+ duration: shouldReduceMotion ? 0 : DURATIONS.moderate02,
28
+ ease: shouldReduceMotion ? 0 : EASINGS.productive.entrance,
29
+ when: 'beforeChildren'
30
+ }
31
+ };
21
32
  }
22
33
  };
23
34
  export var innerContainerVariants = {
24
- hidden: {
25
- opacity: 0,
26
- transition: {
27
- duration: DURATIONS.fast01,
28
- ease: EASINGS.productive.exit
29
- }
35
+ hidden: function hidden(shouldReduceMotion) {
36
+ return {
37
+ opacity: 0,
38
+ transition: {
39
+ duration: shouldReduceMotion ? 0 : DURATIONS.fast01,
40
+ ease: shouldReduceMotion ? 0 : EASINGS.productive.exit
41
+ }
42
+ };
30
43
  },
31
- visible: {
32
- opacity: 1,
33
- transition: {
34
- duration: DURATIONS.fast02,
35
- ease: EASINGS.productive.entrance,
36
- when: 'beforeChildren'
37
- }
44
+ visible: function visible(shouldReduceMotion) {
45
+ return {
46
+ opacity: 1,
47
+ transition: {
48
+ duration: shouldReduceMotion ? 0 : DURATIONS.fast02,
49
+ ease: shouldReduceMotion ? 0 : EASINGS.productive.entrance,
50
+ when: 'beforeChildren'
51
+ }
52
+ };
38
53
  }
39
54
  };
40
55
  export var actionSetVariants = {
41
- hidden: {
42
- y: ACTION_SET_HEIGHT,
43
- transition: {
44
- duration: DURATIONS.fast01,
45
- ease: EASINGS.productive.exit
46
- }
56
+ hidden: function hidden(shouldReduceMotion) {
57
+ return {
58
+ y: ACTION_SET_HEIGHT,
59
+ transition: {
60
+ duration: shouldReduceMotion ? 0 : DURATIONS.fast01,
61
+ ease: shouldReduceMotion ? 0 : EASINGS.productive.exit
62
+ }
63
+ };
47
64
  },
48
- visible: {
49
- y: 0,
50
- transition: {
51
- duration: DURATIONS.fast02,
52
- ease: EASINGS.productive.entrance
53
- }
65
+ visible: function visible(shouldReduceMotion) {
66
+ return {
67
+ y: 0,
68
+ transition: {
69
+ duration: shouldReduceMotion ? 0 : DURATIONS.fast02,
70
+ ease: shouldReduceMotion ? 0 : EASINGS.productive.entrance
71
+ }
72
+ };
54
73
  }
55
74
  };
@@ -25,7 +25,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
25
25
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }
26
26
  /* eslint-disable react/jsx-key */
27
27
  /**
28
- * Copyright IBM Corp. 2022, 2023
28
+ * Copyright IBM Corp. 2022, 2024
29
29
  *
30
30
  * This source code is licensed under the Apache-2.0 license found in the
31
31
  * LICENSE file in the root directory of this source tree.
@@ -112,6 +112,7 @@ var FilterPanel = function FilterPanel(_ref) {
112
112
  _useShouldDisableButt2 = (0, _slicedToArray2.default)(_useShouldDisableButt, 2),
113
113
  shouldDisableButtons = _useShouldDisableButt2[0],
114
114
  setShouldDisableButtons = _useShouldDisableButt2[1];
115
+ var shouldReduceMotion = (0, _framerMotion.useReducedMotion)();
115
116
 
116
117
  /** Memos */
117
118
  var showActionSet = (0, _react.useMemo)(function () {
@@ -156,6 +157,7 @@ var FilterPanel = function FilterPanel(_ref) {
156
157
  }],
157
158
  className: "".concat(componentClass, "__action-set"),
158
159
  ref: actionSetRef,
160
+ custom: shouldReduceMotion,
159
161
  variants: _variants.actionSetVariants
160
162
  });
161
163
  };
@@ -193,8 +195,10 @@ var FilterPanel = function FilterPanel(_ref) {
193
195
  className: (0, _classnames.default)(componentClass, "".concat(componentClass, "__container"), (_cx = {}, (0, _defineProperty2.default)(_cx, "".concat(componentClass, "--open"), panelOpen), (0, _defineProperty2.default)(_cx, "".concat(componentClass, "--batch"), showActionSet), (0, _defineProperty2.default)(_cx, "".concat(componentClass, "--instant"), !showActionSet), _cx)),
194
196
  initial: false,
195
197
  animate: panelOpen ? 'visible' : 'hidden',
198
+ custom: shouldReduceMotion,
196
199
  variants: _variants.panelVariants
197
200
  }, /*#__PURE__*/_react.default.createElement(_framerMotion.motion.div, {
201
+ custom: shouldReduceMotion,
198
202
  variants: _variants.innerContainerVariants
199
203
  }, /*#__PURE__*/_react.default.createElement("header", {
200
204
  ref: filterHeadingRef,
@@ -6,59 +6,78 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.panelVariants = exports.innerContainerVariants = exports.actionSetVariants = void 0;
7
7
  var _motionConstants = require("../../../../../../global/js/utils/motionConstants");
8
8
  var _constants = require("../constants");
9
+ /**
10
+ * Copyright IBM Corp. 2023, 2024
11
+ *
12
+ * This source code is licensed under the Apache-2.0 license found in the
13
+ * LICENSE file in the root directory of this source tree.
14
+ */
15
+
9
16
  var panelVariants = {
10
- hidden: {
11
- width: 0,
12
- overflow: 'hidden',
13
- transition: {
14
- duration: _motionConstants.DURATIONS.fast02,
15
- ease: _motionConstants.EASINGS.productive.exit,
16
- when: 'afterChildren'
17
- }
17
+ hidden: function hidden(shouldReduceMotion) {
18
+ return {
19
+ width: 0,
20
+ overflow: 'hidden',
21
+ transition: {
22
+ duration: shouldReduceMotion ? 0 : _motionConstants.DURATIONS.fast02,
23
+ ease: shouldReduceMotion ? 0 : _motionConstants.EASINGS.productive.exit,
24
+ when: 'afterChildren'
25
+ }
26
+ };
18
27
  },
19
- visible: {
20
- width: _constants.PANEL_WIDTH,
21
- overflow: 'visible',
22
- transition: {
23
- duration: _motionConstants.DURATIONS.moderate02,
24
- ease: _motionConstants.EASINGS.productive.entrance,
25
- when: 'beforeChildren'
26
- }
28
+ visible: function visible(shouldReduceMotion) {
29
+ return {
30
+ width: _constants.PANEL_WIDTH,
31
+ overflow: 'visible',
32
+ transition: {
33
+ duration: shouldReduceMotion ? 0 : _motionConstants.DURATIONS.moderate02,
34
+ ease: shouldReduceMotion ? 0 : _motionConstants.EASINGS.productive.entrance,
35
+ when: 'beforeChildren'
36
+ }
37
+ };
27
38
  }
28
39
  };
29
40
  exports.panelVariants = panelVariants;
30
41
  var innerContainerVariants = {
31
- hidden: {
32
- opacity: 0,
33
- transition: {
34
- duration: _motionConstants.DURATIONS.fast01,
35
- ease: _motionConstants.EASINGS.productive.exit
36
- }
42
+ hidden: function hidden(shouldReduceMotion) {
43
+ return {
44
+ opacity: 0,
45
+ transition: {
46
+ duration: shouldReduceMotion ? 0 : _motionConstants.DURATIONS.fast01,
47
+ ease: shouldReduceMotion ? 0 : _motionConstants.EASINGS.productive.exit
48
+ }
49
+ };
37
50
  },
38
- visible: {
39
- opacity: 1,
40
- transition: {
41
- duration: _motionConstants.DURATIONS.fast02,
42
- ease: _motionConstants.EASINGS.productive.entrance,
43
- when: 'beforeChildren'
44
- }
51
+ visible: function visible(shouldReduceMotion) {
52
+ return {
53
+ opacity: 1,
54
+ transition: {
55
+ duration: shouldReduceMotion ? 0 : _motionConstants.DURATIONS.fast02,
56
+ ease: shouldReduceMotion ? 0 : _motionConstants.EASINGS.productive.entrance,
57
+ when: 'beforeChildren'
58
+ }
59
+ };
45
60
  }
46
61
  };
47
62
  exports.innerContainerVariants = innerContainerVariants;
48
63
  var actionSetVariants = {
49
- hidden: {
50
- y: _constants.ACTION_SET_HEIGHT,
51
- transition: {
52
- duration: _motionConstants.DURATIONS.fast01,
53
- ease: _motionConstants.EASINGS.productive.exit
54
- }
64
+ hidden: function hidden(shouldReduceMotion) {
65
+ return {
66
+ y: _constants.ACTION_SET_HEIGHT,
67
+ transition: {
68
+ duration: shouldReduceMotion ? 0 : _motionConstants.DURATIONS.fast01,
69
+ ease: shouldReduceMotion ? 0 : _motionConstants.EASINGS.productive.exit
70
+ }
71
+ };
55
72
  },
56
- visible: {
57
- y: 0,
58
- transition: {
59
- duration: _motionConstants.DURATIONS.fast02,
60
- ease: _motionConstants.EASINGS.productive.entrance
61
- }
73
+ visible: function visible(shouldReduceMotion) {
74
+ return {
75
+ y: 0,
76
+ transition: {
77
+ duration: shouldReduceMotion ? 0 : _motionConstants.DURATIONS.fast02,
78
+ ease: shouldReduceMotion ? 0 : _motionConstants.EASINGS.productive.entrance
79
+ }
80
+ };
62
81
  }
63
82
  };
64
83
  exports.actionSetVariants = actionSetVariants;
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": "1.65.0",
4
+ "version": "1.66.0",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -97,5 +97,5 @@
97
97
  "react": "^16.8.6 || ^17.0.1",
98
98
  "react-dom": "^16.8.6 || ^17.0.1"
99
99
  },
100
- "gitHead": "4d5770a9e051155c8559c650142f729f4187ac82"
100
+ "gitHead": "7af504361db8089815fc8527da02eaad1871362e"
101
101
  }
@@ -73,8 +73,7 @@ $action-set-block-class: #{$pkg-prefix}--action-set;
73
73
  @include setPanelSize($size_value);
74
74
  .#{$block-class}__title-container.#{$block-class}__title-container--no-title-animation,
75
75
  .#{$block-class}__subtitle-text.#{$block-class}__subtitle-text-no-animation,
76
- .#{$block-class}__action-toolbar.#{$block-class}__action-toolbar-no-animation,
77
- .#{$block-class}__actions-container.#{$action-set-block-class}--#{$size} {
76
+ .#{$block-class}__action-toolbar.#{$block-class}__action-toolbar-no-animation {
78
77
  @include setPanelSize($size_value);
79
78
  }
80
79
  }
@@ -87,6 +86,9 @@ $action-set-block-class: #{$pkg-prefix}--action-set;
87
86
  border-right: 1px solid $decorative-01;
88
87
  }
89
88
  }
89
+ .#{$block-class}__actions-container {
90
+ width: 100%;
91
+ }
90
92
  &.#{$block-class}__container-with-action-toolbar.#{$block-class}__with-condensed-header {
91
93
  .#{$block-class}__title-container {
92
94
  &::before {