@deque/cauldron-react 5.4.1-canary.9657be35 → 5.4.1-canary.cfe8292d
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/lib/index.js +6 -2
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -399,7 +399,9 @@ var ExpandCollapsePanel = /** @class */ (function (_super) {
|
|
|
399
399
|
_this.animateOpen = function () {
|
|
400
400
|
var panel = _this.panel.current;
|
|
401
401
|
var animationTiming = _this.props.animationTiming;
|
|
402
|
-
|
|
402
|
+
var prefersReducedMotion = matchMedia('(prefers-reduced-motion: reduce)')
|
|
403
|
+
.matches;
|
|
404
|
+
if (!animationTiming || prefersReducedMotion) {
|
|
403
405
|
_this.setState({ isAnimating: false });
|
|
404
406
|
return;
|
|
405
407
|
}
|
|
@@ -421,7 +423,9 @@ var ExpandCollapsePanel = /** @class */ (function (_super) {
|
|
|
421
423
|
_this.animateClose = function () {
|
|
422
424
|
var panel = _this.panel.current;
|
|
423
425
|
var animationTiming = _this.props.animationTiming;
|
|
424
|
-
|
|
426
|
+
var prefersReducedMotion = matchMedia('(prefers-reduced-motion: reduce)')
|
|
427
|
+
.matches;
|
|
428
|
+
if (!animationTiming || prefersReducedMotion) {
|
|
425
429
|
_this.setState({ isAnimating: false });
|
|
426
430
|
return;
|
|
427
431
|
}
|
package/package.json
CHANGED