@kaizen/components 1.75.1 → 1.75.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/dist/cjs/Modal/ConfirmationModal/ConfirmationModal.module.scss.cjs +4 -2
- package/dist/cjs/Modal/ContextModal/ContextModal.module.scss.cjs +5 -3
- package/dist/cjs/Modal/GenericModal/GenericModal.cjs +13 -12
- package/dist/cjs/Modal/GenericModal/GenericModal.module.scss.cjs +1 -0
- package/dist/esm/Modal/ConfirmationModal/ConfirmationModal.module.scss.mjs +4 -2
- package/dist/esm/Modal/ContextModal/ContextModal.module.scss.mjs +5 -3
- package/dist/esm/Modal/GenericModal/GenericModal.mjs +13 -13
- package/dist/esm/Modal/GenericModal/GenericModal.module.scss.mjs +1 -0
- package/dist/styles.css +112 -32
- package/package.json +2 -2
- package/src/Modal/GenericModal/GenericModal.module.scss +15 -3
- package/src/Modal/GenericModal/GenericModal.tsx +17 -12
|
@@ -6,12 +6,14 @@ var styles = {
|
|
|
6
6
|
"scrollLayer": "ConfirmationModal-module_scrollLayer__x-yP4",
|
|
7
7
|
"modalLayer": "ConfirmationModal-module_modalLayer__MucTZ",
|
|
8
8
|
"modal": "ConfirmationModal-module_modal__k3pXu",
|
|
9
|
-
"
|
|
9
|
+
"transitionLayer": "ConfirmationModal-module_transitionLayer__Ue95T",
|
|
10
10
|
"fade-0-to-0-5": "ConfirmationModal-module_fade-0-to-0-5__353tZ",
|
|
11
11
|
"custom-1": "ConfirmationModal-module_custom-1__Ibcy-",
|
|
12
|
+
"animatingEnter": "ConfirmationModal-module_animatingEnter__4W4xh",
|
|
13
|
+
"custom-3": "ConfirmationModal-module_custom-3__MEO7v",
|
|
12
14
|
"animatingLeave": "ConfirmationModal-module_animatingLeave__n-S4X",
|
|
13
15
|
"fade-0-5-to-0": "ConfirmationModal-module_fade-0-5-to-0__pfhV-",
|
|
14
|
-
"custom-
|
|
16
|
+
"custom-5": "ConfirmationModal-module_custom-5__zbG38",
|
|
15
17
|
"unscrollable": "ConfirmationModal-module_unscrollable__wg2AZ",
|
|
16
18
|
"pseudoScrollbar": "ConfirmationModal-module_pseudoScrollbar__NqMuT",
|
|
17
19
|
"hide": "ConfirmationModal-module_hide__jOdWV",
|
|
@@ -6,17 +6,19 @@ var styles = {
|
|
|
6
6
|
"scrollLayer": "ContextModal-module_scrollLayer__JANXA",
|
|
7
7
|
"modalLayer": "ContextModal-module_modalLayer__Cx6aX",
|
|
8
8
|
"modal": "ContextModal-module_modal__wriV7",
|
|
9
|
-
"
|
|
9
|
+
"transitionLayer": "ContextModal-module_transitionLayer__IjJem",
|
|
10
10
|
"fade-0-to-0-5": "ContextModal-module_fade-0-to-0-5__vZx9M",
|
|
11
11
|
"custom-1": "ContextModal-module_custom-1__be8sO",
|
|
12
|
+
"animatingEnter": "ContextModal-module_animatingEnter__53BlF",
|
|
13
|
+
"custom-3": "ContextModal-module_custom-3__klp3m",
|
|
12
14
|
"animatingLeave": "ContextModal-module_animatingLeave__-JR11",
|
|
13
15
|
"fade-0-5-to-0": "ContextModal-module_fade-0-5-to-0__R4eO-",
|
|
14
|
-
"custom-
|
|
16
|
+
"custom-5": "ContextModal-module_custom-5__deZpl",
|
|
15
17
|
"unscrollable": "ContextModal-module_unscrollable__kF7MR",
|
|
16
18
|
"pseudoScrollbar": "ContextModal-module_pseudoScrollbar__6RfHj",
|
|
17
19
|
"hide": "ContextModal-module_hide__Sdnsg",
|
|
18
|
-
"custom-5": "ContextModal-module_custom-5__deZpl",
|
|
19
20
|
"custom-7": "ContextModal-module_custom-7__rPmP4",
|
|
21
|
+
"custom-9": "ContextModal-module_custom-9__QZcNq",
|
|
20
22
|
"header": "ContextModal-module_header__V4IRF",
|
|
21
23
|
"padded": "ContextModal-module_padded__osmk1",
|
|
22
24
|
"footerWithSecondaryAction": "ContextModal-module_footerWithSecondaryAction__-5sq8",
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var ReactDOM = require('react-dom');
|
|
5
5
|
var react = require('@headlessui/react');
|
|
6
|
+
var classnames = require('classnames');
|
|
6
7
|
var FocusLock = require('react-focus-lock');
|
|
7
8
|
var console = require('../util/console.cjs');
|
|
8
9
|
var ModalContext = require('./context/ModalContext.cjs');
|
|
@@ -13,6 +14,7 @@ function _interopDefault(e) {
|
|
|
13
14
|
};
|
|
14
15
|
}
|
|
15
16
|
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
17
|
+
var classnames__default = /*#__PURE__*/_interopDefault(classnames);
|
|
16
18
|
var FocusLock__default = /*#__PURE__*/_interopDefault(FocusLock);
|
|
17
19
|
var GenericModal = function (_a) {
|
|
18
20
|
var propsId = _a.id,
|
|
@@ -81,20 +83,21 @@ var GenericModal = function (_a) {
|
|
|
81
83
|
a11yWarn();
|
|
82
84
|
}
|
|
83
85
|
};
|
|
86
|
+
var escapeKeyHandler = React.useCallback(function (event) {
|
|
87
|
+
if (event.key === 'Escape') {
|
|
88
|
+
onEscapeKeyup === null || onEscapeKeyup === void 0 ? void 0 : onEscapeKeyup(event);
|
|
89
|
+
}
|
|
90
|
+
}, [onEscapeKeyup]);
|
|
84
91
|
var onBeforeEnterHandler = function () {
|
|
85
92
|
preventBodyScroll();
|
|
86
93
|
if (onEscapeKeyup) {
|
|
87
|
-
document.addEventListener('keyup',
|
|
88
|
-
if (event.key === 'Escape') {
|
|
89
|
-
onEscapeKeyup === null || onEscapeKeyup === void 0 ? void 0 : onEscapeKeyup(event);
|
|
90
|
-
}
|
|
91
|
-
});
|
|
94
|
+
document.addEventListener('keyup', escapeKeyHandler);
|
|
92
95
|
}
|
|
93
96
|
};
|
|
94
97
|
var cleanUpAfterClose = function () {
|
|
95
98
|
document.documentElement.classList.remove(GenericModal_module.unscrollable, GenericModal_module.pseudoScrollbar);
|
|
96
99
|
if (onEscapeKeyup) {
|
|
97
|
-
document.removeEventListener('keyup',
|
|
100
|
+
document.removeEventListener('keyup', escapeKeyHandler);
|
|
98
101
|
}
|
|
99
102
|
};
|
|
100
103
|
/* Ensure sure add-on styles (e.g. unscrollable) and key event is cleaned up when the modal is unmounted*/
|
|
@@ -112,16 +115,14 @@ var GenericModal = function (_a) {
|
|
|
112
115
|
return ReactDOM.createPortal(React__default.default.createElement(react.Transition, {
|
|
113
116
|
appear: true,
|
|
114
117
|
show: isOpen,
|
|
115
|
-
enter: GenericModal_module.animatingEnter,
|
|
116
|
-
leave: GenericModal_module.animatingLeave,
|
|
117
118
|
beforeEnter: onBeforeEnterHandler,
|
|
118
119
|
afterEnter: onAfterEnterHandler,
|
|
119
120
|
afterLeave: onAfterLeaveHandler,
|
|
120
121
|
"data-generic-modal-transition-wrapper": true,
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
className: className
|
|
122
|
+
enter: GenericModal_module.animatingEnter,
|
|
123
|
+
leave: GenericModal_module.animatingLeave,
|
|
124
|
+
as: "div",
|
|
125
|
+
className: classnames__default.default(GenericModal_module.transitionLayer, className)
|
|
125
126
|
}, React__default.default.createElement(FocusLock__default.default, {
|
|
126
127
|
disabled: focusLockDisabled,
|
|
127
128
|
returnFocus: true,
|
|
@@ -4,6 +4,7 @@ var styles = {
|
|
|
4
4
|
"backdropLayer": "GenericModal-module_backdropLayer__RNQ-U",
|
|
5
5
|
"scrollLayer": "GenericModal-module_scrollLayer__A5VdY",
|
|
6
6
|
"modalLayer": "GenericModal-module_modalLayer__WfD1U",
|
|
7
|
+
"transitionLayer": "GenericModal-module_transitionLayer__zTH-C",
|
|
7
8
|
"animatingEnter": "GenericModal-module_animatingEnter__P3wuk",
|
|
8
9
|
"animatingLeave": "GenericModal-module_animatingLeave__rNkKX",
|
|
9
10
|
"unscrollable": "GenericModal-module_unscrollable__HjRaW",
|
|
@@ -4,12 +4,14 @@ var styles = {
|
|
|
4
4
|
"scrollLayer": "ConfirmationModal-module_scrollLayer__x-yP4",
|
|
5
5
|
"modalLayer": "ConfirmationModal-module_modalLayer__MucTZ",
|
|
6
6
|
"modal": "ConfirmationModal-module_modal__k3pXu",
|
|
7
|
-
"
|
|
7
|
+
"transitionLayer": "ConfirmationModal-module_transitionLayer__Ue95T",
|
|
8
8
|
"fade-0-to-0-5": "ConfirmationModal-module_fade-0-to-0-5__353tZ",
|
|
9
9
|
"custom-1": "ConfirmationModal-module_custom-1__Ibcy-",
|
|
10
|
+
"animatingEnter": "ConfirmationModal-module_animatingEnter__4W4xh",
|
|
11
|
+
"custom-3": "ConfirmationModal-module_custom-3__MEO7v",
|
|
10
12
|
"animatingLeave": "ConfirmationModal-module_animatingLeave__n-S4X",
|
|
11
13
|
"fade-0-5-to-0": "ConfirmationModal-module_fade-0-5-to-0__pfhV-",
|
|
12
|
-
"custom-
|
|
14
|
+
"custom-5": "ConfirmationModal-module_custom-5__zbG38",
|
|
13
15
|
"unscrollable": "ConfirmationModal-module_unscrollable__wg2AZ",
|
|
14
16
|
"pseudoScrollbar": "ConfirmationModal-module_pseudoScrollbar__NqMuT",
|
|
15
17
|
"hide": "ConfirmationModal-module_hide__jOdWV",
|
|
@@ -4,17 +4,19 @@ var styles = {
|
|
|
4
4
|
"scrollLayer": "ContextModal-module_scrollLayer__JANXA",
|
|
5
5
|
"modalLayer": "ContextModal-module_modalLayer__Cx6aX",
|
|
6
6
|
"modal": "ContextModal-module_modal__wriV7",
|
|
7
|
-
"
|
|
7
|
+
"transitionLayer": "ContextModal-module_transitionLayer__IjJem",
|
|
8
8
|
"fade-0-to-0-5": "ContextModal-module_fade-0-to-0-5__vZx9M",
|
|
9
9
|
"custom-1": "ContextModal-module_custom-1__be8sO",
|
|
10
|
+
"animatingEnter": "ContextModal-module_animatingEnter__53BlF",
|
|
11
|
+
"custom-3": "ContextModal-module_custom-3__klp3m",
|
|
10
12
|
"animatingLeave": "ContextModal-module_animatingLeave__-JR11",
|
|
11
13
|
"fade-0-5-to-0": "ContextModal-module_fade-0-5-to-0__R4eO-",
|
|
12
|
-
"custom-
|
|
14
|
+
"custom-5": "ContextModal-module_custom-5__deZpl",
|
|
13
15
|
"unscrollable": "ContextModal-module_unscrollable__kF7MR",
|
|
14
16
|
"pseudoScrollbar": "ContextModal-module_pseudoScrollbar__6RfHj",
|
|
15
17
|
"hide": "ContextModal-module_hide__Sdnsg",
|
|
16
|
-
"custom-5": "ContextModal-module_custom-5__deZpl",
|
|
17
18
|
"custom-7": "ContextModal-module_custom-7__rPmP4",
|
|
19
|
+
"custom-9": "ContextModal-module_custom-9__QZcNq",
|
|
18
20
|
"header": "ContextModal-module_header__V4IRF",
|
|
19
21
|
"padded": "ContextModal-module_padded__osmk1",
|
|
20
22
|
"footerWithSecondaryAction": "ContextModal-module_footerWithSecondaryAction__-5sq8",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import React, { useId, useState, useEffect } from 'react';
|
|
1
|
+
import React, { useId, useState, useCallback, useEffect } from 'react';
|
|
2
2
|
import { createPortal } from 'react-dom';
|
|
3
3
|
import { Transition } from '@headlessui/react';
|
|
4
|
+
import classnames from 'classnames';
|
|
4
5
|
import FocusLock from 'react-focus-lock';
|
|
5
6
|
import { warn } from '../util/console.mjs';
|
|
6
7
|
import { ModalContext } from './context/ModalContext.mjs';
|
|
@@ -73,20 +74,21 @@ const GenericModal = /*#__PURE__*/function () {
|
|
|
73
74
|
a11yWarn();
|
|
74
75
|
}
|
|
75
76
|
};
|
|
77
|
+
var escapeKeyHandler = useCallback(function (event) {
|
|
78
|
+
if (event.key === 'Escape') {
|
|
79
|
+
onEscapeKeyup === null || onEscapeKeyup === void 0 ? void 0 : onEscapeKeyup(event);
|
|
80
|
+
}
|
|
81
|
+
}, [onEscapeKeyup]);
|
|
76
82
|
var onBeforeEnterHandler = function () {
|
|
77
83
|
preventBodyScroll();
|
|
78
84
|
if (onEscapeKeyup) {
|
|
79
|
-
document.addEventListener('keyup',
|
|
80
|
-
if (event.key === 'Escape') {
|
|
81
|
-
onEscapeKeyup === null || onEscapeKeyup === void 0 ? void 0 : onEscapeKeyup(event);
|
|
82
|
-
}
|
|
83
|
-
});
|
|
85
|
+
document.addEventListener('keyup', escapeKeyHandler);
|
|
84
86
|
}
|
|
85
87
|
};
|
|
86
88
|
var cleanUpAfterClose = function () {
|
|
87
89
|
document.documentElement.classList.remove(styles.unscrollable, styles.pseudoScrollbar);
|
|
88
90
|
if (onEscapeKeyup) {
|
|
89
|
-
document.removeEventListener('keyup',
|
|
91
|
+
document.removeEventListener('keyup', escapeKeyHandler);
|
|
90
92
|
}
|
|
91
93
|
};
|
|
92
94
|
/* Ensure sure add-on styles (e.g. unscrollable) and key event is cleaned up when the modal is unmounted*/
|
|
@@ -104,16 +106,14 @@ const GenericModal = /*#__PURE__*/function () {
|
|
|
104
106
|
return /*#__PURE__*/createPortal(/*#__PURE__*/React.createElement(Transition, {
|
|
105
107
|
appear: true,
|
|
106
108
|
show: isOpen,
|
|
107
|
-
enter: styles.animatingEnter,
|
|
108
|
-
leave: styles.animatingLeave,
|
|
109
109
|
beforeEnter: onBeforeEnterHandler,
|
|
110
110
|
afterEnter: onAfterEnterHandler,
|
|
111
111
|
afterLeave: onAfterLeaveHandler,
|
|
112
112
|
"data-generic-modal-transition-wrapper": true,
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
className: className
|
|
113
|
+
enter: styles.animatingEnter,
|
|
114
|
+
leave: styles.animatingLeave,
|
|
115
|
+
as: "div",
|
|
116
|
+
className: classnames(styles.transitionLayer, className)
|
|
117
117
|
}, /*#__PURE__*/React.createElement(FocusLock, {
|
|
118
118
|
disabled: focusLockDisabled,
|
|
119
119
|
returnFocus: true,
|
|
@@ -2,6 +2,7 @@ var styles = {
|
|
|
2
2
|
"backdropLayer": "GenericModal-module_backdropLayer__RNQ-U",
|
|
3
3
|
"scrollLayer": "GenericModal-module_scrollLayer__A5VdY",
|
|
4
4
|
"modalLayer": "GenericModal-module_modalLayer__WfD1U",
|
|
5
|
+
"transitionLayer": "GenericModal-module_transitionLayer__zTH-C",
|
|
5
6
|
"animatingEnter": "GenericModal-module_animatingEnter__P3wuk",
|
|
6
7
|
"animatingLeave": "GenericModal-module_animatingLeave__rNkKX",
|
|
7
8
|
"unscrollable": "GenericModal-module_unscrollable__HjRaW",
|
package/dist/styles.css
CHANGED
|
@@ -6240,10 +6240,11 @@ input[type=range].InputRange-module_ratingScaleRange__gI-rs::-ms-thumb:not(:disa
|
|
|
6240
6240
|
width: 100%;
|
|
6241
6241
|
}
|
|
6242
6242
|
|
|
6243
|
-
.GenericModal-
|
|
6244
|
-
transition
|
|
6243
|
+
.GenericModal-module_transitionLayer__zTH-C {
|
|
6244
|
+
transition: opacity var(--animation-duration-fast, 300ms) ease-in-out;
|
|
6245
|
+
opacity: 1;
|
|
6245
6246
|
}
|
|
6246
|
-
.GenericModal-
|
|
6247
|
+
.GenericModal-module_transitionLayer__zTH-C .GenericModal-module_backdropLayer__RNQ-U {
|
|
6247
6248
|
/*
|
|
6248
6249
|
There's a weird bug in Chrome/Blink 102.x that animates the opacity
|
|
6249
6250
|
all the way to 1 with 200ms ("rapid" token), but is fine with
|
|
@@ -6262,7 +6263,7 @@ input[type=range].InputRange-module_ratingScaleRange__gI-rs::-ms-thumb:not(:disa
|
|
|
6262
6263
|
opacity: 0.5;
|
|
6263
6264
|
}
|
|
6264
6265
|
}
|
|
6265
|
-
.GenericModal-
|
|
6266
|
+
.GenericModal-module_transitionLayer__zTH-C [data-modal] {
|
|
6266
6267
|
animation-duration: var(--animation-duration-fast, 300ms);
|
|
6267
6268
|
animation-fill-mode: forwards;
|
|
6268
6269
|
animation-timing-function: var(--animation-easing-function-bounce-in, cubic-bezier(0.485, 0.155, 0.24, 1.245));
|
|
@@ -6280,8 +6281,27 @@ input[type=range].InputRange-module_ratingScaleRange__gI-rs::-ms-thumb:not(:disa
|
|
|
6280
6281
|
}
|
|
6281
6282
|
}
|
|
6282
6283
|
|
|
6284
|
+
.GenericModal-module_animatingEnter__P3wuk [data-modal] {
|
|
6285
|
+
animation-duration: var(--animation-duration-fast, 300ms);
|
|
6286
|
+
animation-fill-mode: forwards;
|
|
6287
|
+
animation-timing-function: var(--animation-easing-function-bounce-in, cubic-bezier(0.485, 0.155, 0.24, 1.245));
|
|
6288
|
+
/* stylelint-disable-next-line scss/function-unquote-no-unquoted-strings-inside */
|
|
6289
|
+
animation-name: GenericModal-module_custom-3__oWflS;
|
|
6290
|
+
}
|
|
6291
|
+
@keyframes GenericModal-module_custom-3__oWflS {
|
|
6292
|
+
0% {
|
|
6293
|
+
opacity: 0;
|
|
6294
|
+
transform: scale(0.5);
|
|
6295
|
+
}
|
|
6296
|
+
100% {
|
|
6297
|
+
opacity: 1;
|
|
6298
|
+
transform: scale(1);
|
|
6299
|
+
}
|
|
6300
|
+
}
|
|
6301
|
+
|
|
6283
6302
|
.GenericModal-module_animatingLeave__rNkKX {
|
|
6284
6303
|
transition-duration: var(--animation-duration-rapid, 200ms);
|
|
6304
|
+
opacity: 0;
|
|
6285
6305
|
}
|
|
6286
6306
|
.GenericModal-module_animatingLeave__rNkKX .GenericModal-module_backdropLayer__RNQ-U {
|
|
6287
6307
|
animation-duration: var(--animation-duration-rapid, 200ms);
|
|
@@ -6302,9 +6322,9 @@ input[type=range].InputRange-module_ratingScaleRange__gI-rs::-ms-thumb:not(:disa
|
|
|
6302
6322
|
animation-fill-mode: forwards;
|
|
6303
6323
|
animation-timing-function: var(--animation-easing-function-bounce-out, cubic-bezier(0.485, 0.155, 0.515, 0.845));
|
|
6304
6324
|
/* stylelint-disable-next-line scss/function-unquote-no-unquoted-strings-inside */
|
|
6305
|
-
animation-name: GenericModal-module_custom-
|
|
6325
|
+
animation-name: GenericModal-module_custom-5__b6Zah;
|
|
6306
6326
|
}
|
|
6307
|
-
@keyframes GenericModal-module_custom-
|
|
6327
|
+
@keyframes GenericModal-module_custom-5__b6Zah {
|
|
6308
6328
|
0% {
|
|
6309
6329
|
opacity: 1;
|
|
6310
6330
|
transform: scale(1);
|
|
@@ -6623,10 +6643,11 @@ input[type=range].InputRange-module_ratingScaleRange__gI-rs::-ms-thumb:not(:disa
|
|
|
6623
6643
|
outline-offset: 2px;
|
|
6624
6644
|
}
|
|
6625
6645
|
|
|
6626
|
-
.ConfirmationModal-
|
|
6627
|
-
transition
|
|
6646
|
+
.ConfirmationModal-module_transitionLayer__Ue95T {
|
|
6647
|
+
transition: opacity var(--animation-duration-fast, 300ms) ease-in-out;
|
|
6648
|
+
opacity: 1;
|
|
6628
6649
|
}
|
|
6629
|
-
.ConfirmationModal-
|
|
6650
|
+
.ConfirmationModal-module_transitionLayer__Ue95T .ConfirmationModal-module_backdropLayer__wvXnl {
|
|
6630
6651
|
/*
|
|
6631
6652
|
There's a weird bug in Chrome/Blink 102.x that animates the opacity
|
|
6632
6653
|
all the way to 1 with 200ms ("rapid" token), but is fine with
|
|
@@ -6645,7 +6666,7 @@ input[type=range].InputRange-module_ratingScaleRange__gI-rs::-ms-thumb:not(:disa
|
|
|
6645
6666
|
opacity: 0.5;
|
|
6646
6667
|
}
|
|
6647
6668
|
}
|
|
6648
|
-
.ConfirmationModal-
|
|
6669
|
+
.ConfirmationModal-module_transitionLayer__Ue95T [data-modal] {
|
|
6649
6670
|
animation-duration: var(--animation-duration-fast, 300ms);
|
|
6650
6671
|
animation-fill-mode: forwards;
|
|
6651
6672
|
animation-timing-function: var(--animation-easing-function-bounce-in, cubic-bezier(0.485, 0.155, 0.24, 1.245));
|
|
@@ -6663,8 +6684,27 @@ input[type=range].InputRange-module_ratingScaleRange__gI-rs::-ms-thumb:not(:disa
|
|
|
6663
6684
|
}
|
|
6664
6685
|
}
|
|
6665
6686
|
|
|
6687
|
+
.ConfirmationModal-module_animatingEnter__4W4xh [data-modal] {
|
|
6688
|
+
animation-duration: var(--animation-duration-fast, 300ms);
|
|
6689
|
+
animation-fill-mode: forwards;
|
|
6690
|
+
animation-timing-function: var(--animation-easing-function-bounce-in, cubic-bezier(0.485, 0.155, 0.24, 1.245));
|
|
6691
|
+
/* stylelint-disable-next-line scss/function-unquote-no-unquoted-strings-inside */
|
|
6692
|
+
animation-name: ConfirmationModal-module_custom-3__MEO7v;
|
|
6693
|
+
}
|
|
6694
|
+
@keyframes ConfirmationModal-module_custom-3__MEO7v {
|
|
6695
|
+
0% {
|
|
6696
|
+
opacity: 0;
|
|
6697
|
+
transform: scale(0.5);
|
|
6698
|
+
}
|
|
6699
|
+
100% {
|
|
6700
|
+
opacity: 1;
|
|
6701
|
+
transform: scale(1);
|
|
6702
|
+
}
|
|
6703
|
+
}
|
|
6704
|
+
|
|
6666
6705
|
.ConfirmationModal-module_animatingLeave__n-S4X {
|
|
6667
6706
|
transition-duration: var(--animation-duration-rapid, 200ms);
|
|
6707
|
+
opacity: 0;
|
|
6668
6708
|
}
|
|
6669
6709
|
.ConfirmationModal-module_animatingLeave__n-S4X .ConfirmationModal-module_backdropLayer__wvXnl {
|
|
6670
6710
|
animation-duration: var(--animation-duration-rapid, 200ms);
|
|
@@ -6685,9 +6725,9 @@ input[type=range].InputRange-module_ratingScaleRange__gI-rs::-ms-thumb:not(:disa
|
|
|
6685
6725
|
animation-fill-mode: forwards;
|
|
6686
6726
|
animation-timing-function: var(--animation-easing-function-bounce-out, cubic-bezier(0.485, 0.155, 0.515, 0.845));
|
|
6687
6727
|
/* stylelint-disable-next-line scss/function-unquote-no-unquoted-strings-inside */
|
|
6688
|
-
animation-name: ConfirmationModal-module_custom-
|
|
6728
|
+
animation-name: ConfirmationModal-module_custom-5__zbG38;
|
|
6689
6729
|
}
|
|
6690
|
-
@keyframes ConfirmationModal-module_custom-
|
|
6730
|
+
@keyframes ConfirmationModal-module_custom-5__zbG38 {
|
|
6691
6731
|
0% {
|
|
6692
6732
|
opacity: 1;
|
|
6693
6733
|
transform: scale(1);
|
|
@@ -6972,10 +7012,11 @@ input[type=range].InputRange-module_ratingScaleRange__gI-rs::-ms-thumb:not(:disa
|
|
|
6972
7012
|
outline-offset: 2px;
|
|
6973
7013
|
}
|
|
6974
7014
|
|
|
6975
|
-
.ContextModal-
|
|
6976
|
-
transition
|
|
7015
|
+
.ContextModal-module_transitionLayer__IjJem {
|
|
7016
|
+
transition: opacity var(--animation-duration-fast, 300ms) ease-in-out;
|
|
7017
|
+
opacity: 1;
|
|
6977
7018
|
}
|
|
6978
|
-
.ContextModal-
|
|
7019
|
+
.ContextModal-module_transitionLayer__IjJem .ContextModal-module_backdropLayer__wuj3B {
|
|
6979
7020
|
/*
|
|
6980
7021
|
There's a weird bug in Chrome/Blink 102.x that animates the opacity
|
|
6981
7022
|
all the way to 1 with 200ms ("rapid" token), but is fine with
|
|
@@ -6994,7 +7035,7 @@ input[type=range].InputRange-module_ratingScaleRange__gI-rs::-ms-thumb:not(:disa
|
|
|
6994
7035
|
opacity: 0.5;
|
|
6995
7036
|
}
|
|
6996
7037
|
}
|
|
6997
|
-
.ContextModal-
|
|
7038
|
+
.ContextModal-module_transitionLayer__IjJem [data-modal] {
|
|
6998
7039
|
animation-duration: var(--animation-duration-fast, 300ms);
|
|
6999
7040
|
animation-fill-mode: forwards;
|
|
7000
7041
|
animation-timing-function: var(--animation-easing-function-bounce-in, cubic-bezier(0.485, 0.155, 0.24, 1.245));
|
|
@@ -7012,8 +7053,27 @@ input[type=range].InputRange-module_ratingScaleRange__gI-rs::-ms-thumb:not(:disa
|
|
|
7012
7053
|
}
|
|
7013
7054
|
}
|
|
7014
7055
|
|
|
7056
|
+
.ContextModal-module_animatingEnter__53BlF [data-modal] {
|
|
7057
|
+
animation-duration: var(--animation-duration-fast, 300ms);
|
|
7058
|
+
animation-fill-mode: forwards;
|
|
7059
|
+
animation-timing-function: var(--animation-easing-function-bounce-in, cubic-bezier(0.485, 0.155, 0.24, 1.245));
|
|
7060
|
+
/* stylelint-disable-next-line scss/function-unquote-no-unquoted-strings-inside */
|
|
7061
|
+
animation-name: ContextModal-module_custom-3__klp3m;
|
|
7062
|
+
}
|
|
7063
|
+
@keyframes ContextModal-module_custom-3__klp3m {
|
|
7064
|
+
0% {
|
|
7065
|
+
opacity: 0;
|
|
7066
|
+
transform: scale(0.5);
|
|
7067
|
+
}
|
|
7068
|
+
100% {
|
|
7069
|
+
opacity: 1;
|
|
7070
|
+
transform: scale(1);
|
|
7071
|
+
}
|
|
7072
|
+
}
|
|
7073
|
+
|
|
7015
7074
|
.ContextModal-module_animatingLeave__-JR11 {
|
|
7016
7075
|
transition-duration: var(--animation-duration-rapid, 200ms);
|
|
7076
|
+
opacity: 0;
|
|
7017
7077
|
}
|
|
7018
7078
|
.ContextModal-module_animatingLeave__-JR11 .ContextModal-module_backdropLayer__wuj3B {
|
|
7019
7079
|
animation-duration: var(--animation-duration-rapid, 200ms);
|
|
@@ -7034,9 +7094,9 @@ input[type=range].InputRange-module_ratingScaleRange__gI-rs::-ms-thumb:not(:disa
|
|
|
7034
7094
|
animation-fill-mode: forwards;
|
|
7035
7095
|
animation-timing-function: var(--animation-easing-function-bounce-out, cubic-bezier(0.485, 0.155, 0.515, 0.845));
|
|
7036
7096
|
/* stylelint-disable-next-line scss/function-unquote-no-unquoted-strings-inside */
|
|
7037
|
-
animation-name: ContextModal-module_custom-
|
|
7097
|
+
animation-name: ContextModal-module_custom-5__deZpl;
|
|
7038
7098
|
}
|
|
7039
|
-
@keyframes ContextModal-module_custom-
|
|
7099
|
+
@keyframes ContextModal-module_custom-5__deZpl {
|
|
7040
7100
|
0% {
|
|
7041
7101
|
opacity: 1;
|
|
7042
7102
|
transform: scale(1);
|
|
@@ -7076,9 +7136,9 @@ input[type=range].InputRange-module_ratingScaleRange__gI-rs::-ms-thumb:not(:disa
|
|
|
7076
7136
|
animation-fill-mode: forwards;
|
|
7077
7137
|
animation-timing-function: var(--animation-easing-function-bounce-in, cubic-bezier(0.485, 0.155, 0.24, 1.245));
|
|
7078
7138
|
/* stylelint-disable-next-line scss/function-unquote-no-unquoted-strings-inside */
|
|
7079
|
-
animation-name: ContextModal-module_custom-
|
|
7139
|
+
animation-name: ContextModal-module_custom-7__rPmP4;
|
|
7080
7140
|
}
|
|
7081
|
-
@keyframes ContextModal-module_custom-
|
|
7141
|
+
@keyframes ContextModal-module_custom-7__rPmP4 {
|
|
7082
7142
|
0% {
|
|
7083
7143
|
opacity: 0;
|
|
7084
7144
|
transform: scale(0.5);
|
|
@@ -7093,9 +7153,9 @@ input[type=range].InputRange-module_ratingScaleRange__gI-rs::-ms-thumb:not(:disa
|
|
|
7093
7153
|
animation-fill-mode: forwards;
|
|
7094
7154
|
animation-timing-function: var(--animation-easing-function-bounce-out, cubic-bezier(0.485, 0.155, 0.515, 0.845));
|
|
7095
7155
|
/* stylelint-disable-next-line scss/function-unquote-no-unquoted-strings-inside */
|
|
7096
|
-
animation-name: ContextModal-module_custom-
|
|
7156
|
+
animation-name: ContextModal-module_custom-9__QZcNq;
|
|
7097
7157
|
}
|
|
7098
|
-
@keyframes ContextModal-module_custom-
|
|
7158
|
+
@keyframes ContextModal-module_custom-9__QZcNq {
|
|
7099
7159
|
0% {
|
|
7100
7160
|
opacity: 1;
|
|
7101
7161
|
transform: scale(1);
|
|
@@ -7289,10 +7349,11 @@ input[type=range].InputRange-module_ratingScaleRange__gI-rs::-ms-thumb:not(:disa
|
|
|
7289
7349
|
outline-offset: 2px;
|
|
7290
7350
|
}
|
|
7291
7351
|
|
|
7292
|
-
.InputEditModal-
|
|
7293
|
-
transition
|
|
7352
|
+
.InputEditModal-module_transitionLayer__1B3VI {
|
|
7353
|
+
transition: opacity var(--animation-duration-fast, 300ms) ease-in-out;
|
|
7354
|
+
opacity: 1;
|
|
7294
7355
|
}
|
|
7295
|
-
.InputEditModal-
|
|
7356
|
+
.InputEditModal-module_transitionLayer__1B3VI .InputEditModal-module_backdropLayer__aVLSb {
|
|
7296
7357
|
/*
|
|
7297
7358
|
There's a weird bug in Chrome/Blink 102.x that animates the opacity
|
|
7298
7359
|
all the way to 1 with 200ms ("rapid" token), but is fine with
|
|
@@ -7311,7 +7372,7 @@ input[type=range].InputRange-module_ratingScaleRange__gI-rs::-ms-thumb:not(:disa
|
|
|
7311
7372
|
opacity: 0.5;
|
|
7312
7373
|
}
|
|
7313
7374
|
}
|
|
7314
|
-
.InputEditModal-
|
|
7375
|
+
.InputEditModal-module_transitionLayer__1B3VI [data-modal] {
|
|
7315
7376
|
animation-duration: var(--animation-duration-fast, 300ms);
|
|
7316
7377
|
animation-fill-mode: forwards;
|
|
7317
7378
|
animation-timing-function: var(--animation-easing-function-bounce-in, cubic-bezier(0.485, 0.155, 0.24, 1.245));
|
|
@@ -7329,8 +7390,27 @@ input[type=range].InputRange-module_ratingScaleRange__gI-rs::-ms-thumb:not(:disa
|
|
|
7329
7390
|
}
|
|
7330
7391
|
}
|
|
7331
7392
|
|
|
7393
|
+
.InputEditModal-module_animatingEnter__qZgX2 [data-modal] {
|
|
7394
|
+
animation-duration: var(--animation-duration-fast, 300ms);
|
|
7395
|
+
animation-fill-mode: forwards;
|
|
7396
|
+
animation-timing-function: var(--animation-easing-function-bounce-in, cubic-bezier(0.485, 0.155, 0.24, 1.245));
|
|
7397
|
+
/* stylelint-disable-next-line scss/function-unquote-no-unquoted-strings-inside */
|
|
7398
|
+
animation-name: InputEditModal-module_custom-3__T3riv;
|
|
7399
|
+
}
|
|
7400
|
+
@keyframes InputEditModal-module_custom-3__T3riv {
|
|
7401
|
+
0% {
|
|
7402
|
+
opacity: 0;
|
|
7403
|
+
transform: scale(0.5);
|
|
7404
|
+
}
|
|
7405
|
+
100% {
|
|
7406
|
+
opacity: 1;
|
|
7407
|
+
transform: scale(1);
|
|
7408
|
+
}
|
|
7409
|
+
}
|
|
7410
|
+
|
|
7332
7411
|
.InputEditModal-module_animatingLeave__S2HGz {
|
|
7333
7412
|
transition-duration: var(--animation-duration-rapid, 200ms);
|
|
7413
|
+
opacity: 0;
|
|
7334
7414
|
}
|
|
7335
7415
|
.InputEditModal-module_animatingLeave__S2HGz .InputEditModal-module_backdropLayer__aVLSb {
|
|
7336
7416
|
animation-duration: var(--animation-duration-rapid, 200ms);
|
|
@@ -7351,9 +7431,9 @@ input[type=range].InputRange-module_ratingScaleRange__gI-rs::-ms-thumb:not(:disa
|
|
|
7351
7431
|
animation-fill-mode: forwards;
|
|
7352
7432
|
animation-timing-function: var(--animation-easing-function-bounce-out, cubic-bezier(0.485, 0.155, 0.515, 0.845));
|
|
7353
7433
|
/* stylelint-disable-next-line scss/function-unquote-no-unquoted-strings-inside */
|
|
7354
|
-
animation-name: InputEditModal-module_custom-
|
|
7434
|
+
animation-name: InputEditModal-module_custom-5__trORr;
|
|
7355
7435
|
}
|
|
7356
|
-
@keyframes InputEditModal-module_custom-
|
|
7436
|
+
@keyframes InputEditModal-module_custom-5__trORr {
|
|
7357
7437
|
0% {
|
|
7358
7438
|
opacity: 1;
|
|
7359
7439
|
transform: scale(1);
|
|
@@ -7388,9 +7468,9 @@ input[type=range].InputRange-module_ratingScaleRange__gI-rs::-ms-thumb:not(:disa
|
|
|
7388
7468
|
animation-fill-mode: forwards;
|
|
7389
7469
|
animation-timing-function: var(--animation-easing-function-bounce-in, cubic-bezier(0.485, 0.155, 0.24, 1.245));
|
|
7390
7470
|
/* stylelint-disable-next-line scss/function-unquote-no-unquoted-strings-inside */
|
|
7391
|
-
animation-name: InputEditModal-module_custom-
|
|
7471
|
+
animation-name: InputEditModal-module_custom-7__-98CZ;
|
|
7392
7472
|
}
|
|
7393
|
-
@keyframes InputEditModal-module_custom-
|
|
7473
|
+
@keyframes InputEditModal-module_custom-7__-98CZ {
|
|
7394
7474
|
0% {
|
|
7395
7475
|
opacity: 0;
|
|
7396
7476
|
transform: scale(0.5);
|
|
@@ -7405,9 +7485,9 @@ input[type=range].InputRange-module_ratingScaleRange__gI-rs::-ms-thumb:not(:disa
|
|
|
7405
7485
|
animation-fill-mode: forwards;
|
|
7406
7486
|
animation-timing-function: var(--animation-easing-function-bounce-out, cubic-bezier(0.485, 0.155, 0.515, 0.845));
|
|
7407
7487
|
/* stylelint-disable-next-line scss/function-unquote-no-unquoted-strings-inside */
|
|
7408
|
-
animation-name: InputEditModal-module_custom-
|
|
7488
|
+
animation-name: InputEditModal-module_custom-9__VnL9W;
|
|
7409
7489
|
}
|
|
7410
|
-
@keyframes InputEditModal-module_custom-
|
|
7490
|
+
@keyframes InputEditModal-module_custom-9__VnL9W {
|
|
7411
7491
|
0% {
|
|
7412
7492
|
opacity: 1;
|
|
7413
7493
|
transform: scale(1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaizen/components",
|
|
3
|
-
"version": "1.75.
|
|
3
|
+
"version": "1.75.2",
|
|
4
4
|
"description": "Kaizen component library",
|
|
5
5
|
"author": "Geoffrey Chong <geoff.chong@cultureamp.com>",
|
|
6
6
|
"homepage": "https://cultureamp.design",
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
},
|
|
104
104
|
"dependencies": {
|
|
105
105
|
"@floating-ui/react-dom": "^2.1.2",
|
|
106
|
-
"@headlessui/react": "
|
|
106
|
+
"@headlessui/react": "^2.2.0",
|
|
107
107
|
"@internationalized/date": "^3.7.0",
|
|
108
108
|
"@popperjs/core": "^2.11.8",
|
|
109
109
|
"@reach/tabs": "^0.18.0",
|
|
@@ -64,9 +64,9 @@
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
.transitionLayer {
|
|
68
|
+
transition: opacity $ca-duration-fast ease-in-out;
|
|
69
|
+
opacity: 1;
|
|
70
70
|
|
|
71
71
|
.backdropLayer {
|
|
72
72
|
/*
|
|
@@ -86,8 +86,20 @@
|
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
// WAITING FOR TEXTFIELD
|
|
90
|
+
.animatingEnter {
|
|
91
|
+
[data-modal] {
|
|
92
|
+
animation-duration: $ca-duration-fast;
|
|
93
|
+
animation-fill-mode: forwards;
|
|
94
|
+
animation-timing-function: $ca-bounce-in;
|
|
95
|
+
|
|
96
|
+
@include ca-animation(fade($from: 0, $to: 1), zoom($from: 0.5, $to: 1));
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
89
100
|
.animatingLeave {
|
|
90
101
|
transition-duration: $ca-duration-rapid;
|
|
102
|
+
opacity: 0;
|
|
91
103
|
|
|
92
104
|
.backdropLayer {
|
|
93
105
|
@include ca-animation-fade($duration: $ca-duration-rapid, $from: 0.5, $to: 0);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import React, { useEffect, useId, useState } from 'react'
|
|
1
|
+
import React, { useCallback, useEffect, useId, useState } from 'react'
|
|
2
2
|
import { createPortal } from 'react-dom'
|
|
3
3
|
import { Transition } from '@headlessui/react'
|
|
4
|
+
import classnames from 'classnames'
|
|
4
5
|
import FocusLock from 'react-focus-lock'
|
|
5
6
|
import { warn } from '../util/console'
|
|
6
7
|
import { ModalContext } from './context/ModalContext'
|
|
@@ -98,15 +99,20 @@ export const GenericModal = ({
|
|
|
98
99
|
}
|
|
99
100
|
}
|
|
100
101
|
|
|
102
|
+
const escapeKeyHandler = useCallback(
|
|
103
|
+
(event: KeyboardEvent): void => {
|
|
104
|
+
if (event.key === 'Escape') {
|
|
105
|
+
onEscapeKeyup?.(event)
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
[onEscapeKeyup],
|
|
109
|
+
)
|
|
110
|
+
|
|
101
111
|
const onBeforeEnterHandler = (): void => {
|
|
102
112
|
preventBodyScroll()
|
|
103
113
|
|
|
104
114
|
if (onEscapeKeyup) {
|
|
105
|
-
document.addEventListener('keyup',
|
|
106
|
-
if (event.key === 'Escape') {
|
|
107
|
-
onEscapeKeyup?.(event)
|
|
108
|
-
}
|
|
109
|
-
})
|
|
115
|
+
document.addEventListener('keyup', escapeKeyHandler)
|
|
110
116
|
}
|
|
111
117
|
}
|
|
112
118
|
|
|
@@ -114,7 +120,7 @@ export const GenericModal = ({
|
|
|
114
120
|
document.documentElement.classList.remove(styles.unscrollable, styles.pseudoScrollbar)
|
|
115
121
|
|
|
116
122
|
if (onEscapeKeyup) {
|
|
117
|
-
document.removeEventListener('keyup',
|
|
123
|
+
document.removeEventListener('keyup', escapeKeyHandler)
|
|
118
124
|
}
|
|
119
125
|
}
|
|
120
126
|
|
|
@@ -127,19 +133,18 @@ export const GenericModal = ({
|
|
|
127
133
|
cleanUpAfterClose()
|
|
128
134
|
propsOnAfterLeave?.()
|
|
129
135
|
}
|
|
130
|
-
|
|
131
136
|
return createPortal(
|
|
132
137
|
<Transition
|
|
133
138
|
appear={true}
|
|
134
139
|
show={isOpen}
|
|
135
|
-
enter={styles.animatingEnter}
|
|
136
|
-
leave={styles.animatingLeave}
|
|
137
140
|
beforeEnter={onBeforeEnterHandler}
|
|
138
141
|
afterEnter={onAfterEnterHandler}
|
|
139
142
|
afterLeave={onAfterLeaveHandler}
|
|
140
143
|
data-generic-modal-transition-wrapper
|
|
141
|
-
|
|
142
|
-
|
|
144
|
+
enter={styles.animatingEnter}
|
|
145
|
+
leave={styles.animatingLeave}
|
|
146
|
+
as="div"
|
|
147
|
+
className={classnames(styles.transitionLayer, className)}
|
|
143
148
|
>
|
|
144
149
|
<FocusLock
|
|
145
150
|
disabled={focusLockDisabled}
|