@contentful/f36-modal 4.5.0 → 4.6.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/CHANGELOG.md +38 -0
- package/dist/main.js +82 -103
- package/dist/main.js.map +1 -1
- package/dist/module.js +76 -90
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +10 -7
- package/dist/types.d.ts.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 4.6.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1994](https://github.com/contentful/forma-36/pull/1994) [`0364ffe2`](https://github.com/contentful/forma-36/commit/0364ffe2aa2e5ccfea6263f4173b2d8069e4ec05) Thanks [@denkristoffer](https://github.com/denkristoffer)! - fix(modal): fix scaling issues for modals with size "zen"
|
|
8
|
+
|
|
9
|
+
- Updated dependencies []:
|
|
10
|
+
- @contentful/f36-button@4.6.2
|
|
11
|
+
- @contentful/f36-icons@4.6.2
|
|
12
|
+
- @contentful/f36-typography@4.6.2
|
|
13
|
+
- @contentful/f36-core@4.6.2
|
|
14
|
+
|
|
15
|
+
## 4.6.1
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [#1995](https://github.com/contentful/forma-36/pull/1995) [`f4495eda`](https://github.com/contentful/forma-36/commit/f4495edaf02d87e78acbc454730190161f6a305d) Thanks [@anho](https://github.com/anho)! - force scale for modal
|
|
20
|
+
|
|
21
|
+
- Updated dependencies []:
|
|
22
|
+
- @contentful/f36-button@4.6.1
|
|
23
|
+
- @contentful/f36-icons@4.6.1
|
|
24
|
+
- @contentful/f36-typography@4.6.1
|
|
25
|
+
- @contentful/f36-core@4.6.1
|
|
26
|
+
|
|
27
|
+
## 4.6.0
|
|
28
|
+
|
|
29
|
+
### Minor Changes
|
|
30
|
+
|
|
31
|
+
- [`6fd4099e`](https://github.com/contentful/forma-36/commit/6fd4099e3c4f364f6b95cb3720cca995c355e5cc) Thanks [@denkristoffer](https://github.com/denkristoffer)! - fix(modal): custom classname before modal root styles
|
|
32
|
+
|
|
33
|
+
### Patch Changes
|
|
34
|
+
|
|
35
|
+
- Updated dependencies []:
|
|
36
|
+
- @contentful/f36-button@4.6.0
|
|
37
|
+
- @contentful/f36-icons@4.6.0
|
|
38
|
+
- @contentful/f36-typography@4.6.0
|
|
39
|
+
- @contentful/f36-core@4.6.0
|
|
40
|
+
|
|
3
41
|
## 4.5.0
|
|
4
42
|
|
|
5
43
|
### Patch Changes
|
package/dist/main.js
CHANGED
|
@@ -1,43 +1,26 @@
|
|
|
1
|
-
var $
|
|
2
|
-
var $
|
|
3
|
-
var $
|
|
4
|
-
var $
|
|
5
|
-
var $
|
|
6
|
-
var $
|
|
7
|
-
var $
|
|
8
|
-
var $
|
|
9
|
-
var $
|
|
10
|
-
|
|
11
|
-
function $parcel$exportWildcard(dest, source) {
|
|
12
|
-
Object.keys(source).forEach(function(key) {
|
|
13
|
-
if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
Object.defineProperty(dest, key, {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function get() {
|
|
20
|
-
return source[key];
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
});
|
|
1
|
+
var $a6cQm$react = require("react");
|
|
2
|
+
var $a6cQm$reactmodal = require("react-modal");
|
|
3
|
+
var $a6cQm$contentfulf36core = require("@contentful/f36-core");
|
|
4
|
+
var $a6cQm$emotion = require("emotion");
|
|
5
|
+
var $a6cQm$contentfulf36icons = require("@contentful/f36-icons");
|
|
6
|
+
var $a6cQm$contentfulf36button = require("@contentful/f36-button");
|
|
7
|
+
var $a6cQm$contentfulf36typography = require("@contentful/f36-typography");
|
|
8
|
+
var $a6cQm$contentfulf36tokens = require("@contentful/f36-tokens");
|
|
9
|
+
var $a6cQm$reactdom = require("react-dom");
|
|
24
10
|
|
|
25
|
-
return dest;
|
|
26
|
-
}
|
|
27
11
|
function $parcel$export(e, n, v, s) {
|
|
28
12
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
29
13
|
}
|
|
30
14
|
function $parcel$interopDefault(a) {
|
|
31
15
|
return a && a.__esModule ? a.default : a;
|
|
32
16
|
}
|
|
33
|
-
var $4eddba25b642b7ac$exports = {};
|
|
34
17
|
|
|
35
|
-
$parcel$export(
|
|
36
|
-
$parcel$export(
|
|
37
|
-
$parcel$export(
|
|
38
|
-
$parcel$export(
|
|
39
|
-
$parcel$export(
|
|
40
|
-
$parcel$export(
|
|
18
|
+
$parcel$export(module.exports, "Modal", () => $2132db66f9439432$export$2b77a92f1a5ad772);
|
|
19
|
+
$parcel$export(module.exports, "ModalConfirm", () => $657ddd6e4548962f$export$427af6990c8ff682);
|
|
20
|
+
$parcel$export(module.exports, "ModalContent", () => $66391c55bbcf9065$export$6da19a24bf249f17);
|
|
21
|
+
$parcel$export(module.exports, "ModalControls", () => $8b06e393320a8e77$export$c63fb08199be8e0e);
|
|
22
|
+
$parcel$export(module.exports, "ModalHeader", () => $2679bd8c144d3995$export$f50a68e3694789ee);
|
|
23
|
+
$parcel$export(module.exports, "ModalLauncher", () => $f6dfceab072669eb$export$e21b828b42c54a37);
|
|
41
24
|
|
|
42
25
|
|
|
43
26
|
|
|
@@ -51,19 +34,19 @@ $parcel$export($4eddba25b642b7ac$exports, "ModalLauncher", () => $f6dfceab072669
|
|
|
51
34
|
|
|
52
35
|
function $2e9361382cc113aa$export$4bef00d568400c9b() {
|
|
53
36
|
return {
|
|
54
|
-
root: /*#__PURE__*/ $
|
|
37
|
+
root: /*#__PURE__*/ $a6cQm$emotion.css({
|
|
55
38
|
position: 'relative',
|
|
56
|
-
padding: `${($parcel$interopDefault($
|
|
57
|
-
borderRadius: `${($parcel$interopDefault($
|
|
58
|
-
borderBottom: `1px solid ${($parcel$interopDefault($
|
|
39
|
+
padding: `${($parcel$interopDefault($a6cQm$contentfulf36tokens)).spacingM} ${($parcel$interopDefault($a6cQm$contentfulf36tokens)).spacingM} ${($parcel$interopDefault($a6cQm$contentfulf36tokens)).spacingM} ${($parcel$interopDefault($a6cQm$contentfulf36tokens)).spacingL}`,
|
|
40
|
+
borderRadius: `${($parcel$interopDefault($a6cQm$contentfulf36tokens)).borderRadiusMedium} ${($parcel$interopDefault($a6cQm$contentfulf36tokens)).borderRadiusMedium} 0 0`,
|
|
41
|
+
borderBottom: `1px solid ${($parcel$interopDefault($a6cQm$contentfulf36tokens)).gray300}`
|
|
59
42
|
}),
|
|
60
|
-
buttonContainer: /*#__PURE__*/ $
|
|
43
|
+
buttonContainer: /*#__PURE__*/ $a6cQm$emotion.css({
|
|
61
44
|
position: 'relative',
|
|
62
|
-
width: ($parcel$interopDefault($
|
|
63
|
-
height: ($parcel$interopDefault($
|
|
45
|
+
width: ($parcel$interopDefault($a6cQm$contentfulf36tokens)).spacing2Xl,
|
|
46
|
+
height: ($parcel$interopDefault($a6cQm$contentfulf36tokens)).spacingL,
|
|
64
47
|
button: {
|
|
65
48
|
position: 'absolute',
|
|
66
|
-
top: `calc(-1 * ${($parcel$interopDefault($
|
|
49
|
+
top: `calc(-1 * ${($parcel$interopDefault($a6cQm$contentfulf36tokens)).spacing2Xs})`,
|
|
67
50
|
right: 0
|
|
68
51
|
}
|
|
69
52
|
})
|
|
@@ -73,23 +56,23 @@ function $2e9361382cc113aa$export$4bef00d568400c9b() {
|
|
|
73
56
|
|
|
74
57
|
function $2679bd8c144d3995$export$f50a68e3694789ee({ onClose: onClose , title: title , testId: testId = 'cf-ui-modal-header' , className: className , ...otherProps }) {
|
|
75
58
|
const styles = $2e9361382cc113aa$export$4bef00d568400c9b();
|
|
76
|
-
return(/*#__PURE__*/ ($parcel$interopDefault($
|
|
59
|
+
return(/*#__PURE__*/ ($parcel$interopDefault($a6cQm$react)).createElement($a6cQm$contentfulf36core.Flex, {
|
|
77
60
|
...otherProps,
|
|
78
|
-
className: $
|
|
61
|
+
className: $a6cQm$emotion.cx(styles.root, className),
|
|
79
62
|
testId: testId,
|
|
80
63
|
alignItems: "center",
|
|
81
64
|
justifyContent: "space-between"
|
|
82
|
-
}, /*#__PURE__*/ ($parcel$interopDefault($
|
|
65
|
+
}, /*#__PURE__*/ ($parcel$interopDefault($a6cQm$react)).createElement($a6cQm$contentfulf36typography.Subheading, {
|
|
83
66
|
as: "h1",
|
|
84
67
|
isTruncated: true,
|
|
85
68
|
marginBottom: "none"
|
|
86
|
-
}, title), onClose && /*#__PURE__*/ ($parcel$interopDefault($
|
|
69
|
+
}, title), onClose && /*#__PURE__*/ ($parcel$interopDefault($a6cQm$react)).createElement($a6cQm$contentfulf36core.Flex, {
|
|
87
70
|
alignItems: "center",
|
|
88
71
|
className: styles.buttonContainer
|
|
89
|
-
}, /*#__PURE__*/ ($parcel$interopDefault($
|
|
72
|
+
}, /*#__PURE__*/ ($parcel$interopDefault($a6cQm$react)).createElement($a6cQm$contentfulf36button.Button, {
|
|
90
73
|
variant: "transparent",
|
|
91
74
|
"aria-label": "Close",
|
|
92
|
-
startIcon: /*#__PURE__*/ ($parcel$interopDefault($
|
|
75
|
+
startIcon: /*#__PURE__*/ ($parcel$interopDefault($a6cQm$react)).createElement($a6cQm$contentfulf36icons.CloseIcon, {
|
|
93
76
|
size: "small"
|
|
94
77
|
}),
|
|
95
78
|
onClick: ()=>{
|
|
@@ -108,12 +91,12 @@ $2679bd8c144d3995$export$f50a68e3694789ee.displayName = 'ModalHeader';
|
|
|
108
91
|
|
|
109
92
|
function $32e971b34c262557$export$5168abbf3ad664a0() {
|
|
110
93
|
return {
|
|
111
|
-
root: /*#__PURE__*/ $
|
|
112
|
-
padding: `${($parcel$interopDefault($
|
|
113
|
-
color: ($parcel$interopDefault($
|
|
114
|
-
fontSize: ($parcel$interopDefault($
|
|
115
|
-
fontFamily: ($parcel$interopDefault($
|
|
116
|
-
lineHeight: ($parcel$interopDefault($
|
|
94
|
+
root: /*#__PURE__*/ $a6cQm$emotion.css({
|
|
95
|
+
padding: `${($parcel$interopDefault($a6cQm$contentfulf36tokens)).spacingM} ${($parcel$interopDefault($a6cQm$contentfulf36tokens)).spacingL}`,
|
|
96
|
+
color: ($parcel$interopDefault($a6cQm$contentfulf36tokens)).gray700,
|
|
97
|
+
fontSize: ($parcel$interopDefault($a6cQm$contentfulf36tokens)).fontSizeM,
|
|
98
|
+
fontFamily: ($parcel$interopDefault($a6cQm$contentfulf36tokens)).fontStackPrimary,
|
|
99
|
+
lineHeight: ($parcel$interopDefault($a6cQm$contentfulf36tokens)).lineHeightM,
|
|
117
100
|
overflowY: 'auto',
|
|
118
101
|
overflowX: 'auto',
|
|
119
102
|
boxSizing: 'border-box'
|
|
@@ -124,10 +107,10 @@ function $32e971b34c262557$export$5168abbf3ad664a0() {
|
|
|
124
107
|
|
|
125
108
|
function $66391c55bbcf9065$export$6da19a24bf249f17({ testId: testId = 'cf-ui-modal-content' , className: className , children: children , ...otherProps }) {
|
|
126
109
|
const styles = $32e971b34c262557$export$5168abbf3ad664a0();
|
|
127
|
-
return(/*#__PURE__*/ ($parcel$interopDefault($
|
|
110
|
+
return(/*#__PURE__*/ ($parcel$interopDefault($a6cQm$react)).createElement($a6cQm$contentfulf36core.Box, {
|
|
128
111
|
...otherProps,
|
|
129
112
|
as: "div",
|
|
130
|
-
className: $
|
|
113
|
+
className: $a6cQm$emotion.cx(styles.root, className),
|
|
131
114
|
testId: testId
|
|
132
115
|
}, children));
|
|
133
116
|
}
|
|
@@ -138,54 +121,53 @@ $66391c55bbcf9065$export$6da19a24bf249f17.displayName = 'ModalContent';
|
|
|
138
121
|
|
|
139
122
|
|
|
140
123
|
function $a1d799ea27882387$export$9af97f4b0b4c597a(props) {
|
|
141
|
-
const modal = $
|
|
142
|
-
margin: ($parcel$interopDefault($
|
|
143
|
-
backgroundColor: ($parcel$interopDefault($
|
|
144
|
-
borderRadius: ($parcel$interopDefault($
|
|
145
|
-
boxShadow: ($parcel$interopDefault($
|
|
146
|
-
maxHeight: `calc(100vh - 1rem * (100 / ${($parcel$interopDefault($
|
|
147
|
-
maxWidth: `calc(100vw - 1rem * (100 / ${($parcel$interopDefault($
|
|
124
|
+
const modal = $a6cQm$emotion.cx(/*#__PURE__*/ $a6cQm$emotion.css({
|
|
125
|
+
margin: ($parcel$interopDefault($a6cQm$contentfulf36tokens)).spacing2Xl,
|
|
126
|
+
backgroundColor: ($parcel$interopDefault($a6cQm$contentfulf36tokens)).colorWhite,
|
|
127
|
+
borderRadius: props.size === 'zen' ? 0 : ($parcel$interopDefault($a6cQm$contentfulf36tokens)).borderRadiusMedium,
|
|
128
|
+
boxShadow: ($parcel$interopDefault($a6cQm$contentfulf36tokens)).boxShadowHeavy,
|
|
129
|
+
maxHeight: `calc(100vh - 1rem * (100 / ${($parcel$interopDefault($a6cQm$contentfulf36tokens)).fontBaseDefault}))`,
|
|
130
|
+
maxWidth: `calc(100vw - 1rem * (100 / ${($parcel$interopDefault($a6cQm$contentfulf36tokens)).fontBaseDefault}))`,
|
|
148
131
|
overflow: 'hidden',
|
|
149
132
|
display: 'flex',
|
|
150
133
|
flexDirection: 'column'
|
|
151
|
-
}), props.allowHeightOverflow ? /*#__PURE__*/ $
|
|
134
|
+
}), props.allowHeightOverflow ? /*#__PURE__*/ $a6cQm$emotion.css({
|
|
152
135
|
name: "1evlo53",
|
|
153
136
|
styles: "overflow:auto;max-height:none;"
|
|
154
|
-
}) : null, props.size === 'zen' ? /*#__PURE__*/ $
|
|
137
|
+
}) : null, props.size === 'zen' ? /*#__PURE__*/ $a6cQm$emotion.css({
|
|
155
138
|
name: "11c88st",
|
|
156
139
|
styles: "max-width:none;max-height:none;margin:0;height:100%;width:100%;"
|
|
157
140
|
}) : null, props.className);
|
|
158
141
|
return {
|
|
159
|
-
portal: /*#__PURE__*/ $
|
|
142
|
+
portal: /*#__PURE__*/ $a6cQm$emotion.css({
|
|
160
143
|
name: "13o7eu2",
|
|
161
144
|
styles: "display:block;"
|
|
162
145
|
}),
|
|
163
146
|
base: {
|
|
164
|
-
root: $
|
|
165
|
-
zIndex: ($parcel$interopDefault($
|
|
147
|
+
root: $a6cQm$emotion.cx(/*#__PURE__*/ $a6cQm$emotion.css({
|
|
148
|
+
zIndex: ($parcel$interopDefault($a6cQm$contentfulf36tokens)).zIndexModalContent,
|
|
166
149
|
position: 'relative',
|
|
167
150
|
padding: 0,
|
|
168
151
|
display: 'inline-block',
|
|
169
152
|
margin: '0 auto',
|
|
170
153
|
textAlign: 'left',
|
|
171
154
|
outline: 'none',
|
|
172
|
-
transform: 'scale(0.85)',
|
|
173
|
-
transition: `transform ${($parcel$interopDefault($
|
|
174
|
-
}), props.size === 'zen' ? /*#__PURE__*/ $
|
|
155
|
+
transform: props.size === 'zen' ? 'scale(1)' : 'scale(0.85)',
|
|
156
|
+
transition: `transform ${($parcel$interopDefault($a6cQm$contentfulf36tokens)).transitionDurationDefault} ${($parcel$interopDefault($a6cQm$contentfulf36tokens)).transitionEasingDefault}`
|
|
157
|
+
}), props.size === 'zen' ? /*#__PURE__*/ $a6cQm$emotion.css({
|
|
175
158
|
name: "uwwqev",
|
|
176
159
|
styles: "width:100%;height:100%;"
|
|
177
160
|
}) : null),
|
|
178
|
-
afterOpen: /*#__PURE__*/ $
|
|
179
|
-
name: "
|
|
180
|
-
styles: "transform:scale(1);"
|
|
161
|
+
afterOpen: /*#__PURE__*/ $a6cQm$emotion.css({
|
|
162
|
+
name: "plgkgv",
|
|
163
|
+
styles: "transform:scale(1) !important;"
|
|
181
164
|
}),
|
|
182
|
-
beforeClose: /*#__PURE__*/ $
|
|
183
|
-
|
|
184
|
-
styles: "transform:scale(0.85);"
|
|
165
|
+
beforeClose: /*#__PURE__*/ $a6cQm$emotion.css({
|
|
166
|
+
transform: props.size === 'zen' ? 'scale(1)' : 'scale(0.85)'
|
|
185
167
|
})
|
|
186
168
|
},
|
|
187
169
|
modalOverlay: {
|
|
188
|
-
root: $
|
|
170
|
+
root: $a6cQm$emotion.cx(/*#__PURE__*/ $a6cQm$emotion.css({
|
|
189
171
|
display: 'flex',
|
|
190
172
|
alignItems: 'baseline',
|
|
191
173
|
flexWrap: 'wrap',
|
|
@@ -193,22 +175,22 @@ function $a1d799ea27882387$export$9af97f4b0b4c597a(props) {
|
|
|
193
175
|
right: 0,
|
|
194
176
|
bottom: 0,
|
|
195
177
|
left: 0,
|
|
196
|
-
zIndex: ($parcel$interopDefault($
|
|
178
|
+
zIndex: ($parcel$interopDefault($a6cQm$contentfulf36tokens)).zIndexModal,
|
|
197
179
|
opacity: 0,
|
|
198
|
-
transition: `opacity ${($parcel$interopDefault($
|
|
180
|
+
transition: `opacity ${($parcel$interopDefault($a6cQm$contentfulf36tokens)).transitionDurationDefault} ${($parcel$interopDefault($a6cQm$contentfulf36tokens)).transitionEasingDefault}`,
|
|
199
181
|
position: 'fixed',
|
|
200
182
|
overflowY: 'auto',
|
|
201
183
|
backgroundColor: 'rgba(12, 20, 28, 0.74902)',
|
|
202
184
|
textAlign: 'center'
|
|
203
|
-
}), props.position === 'center' ? /*#__PURE__*/ $
|
|
185
|
+
}), props.position === 'center' ? /*#__PURE__*/ $a6cQm$emotion.css({
|
|
204
186
|
name: "1qe4tyl",
|
|
205
187
|
styles: "align-items:center;justify-content:center;"
|
|
206
188
|
}) : null),
|
|
207
|
-
afterOpen: /*#__PURE__*/ $
|
|
189
|
+
afterOpen: /*#__PURE__*/ $a6cQm$emotion.css({
|
|
208
190
|
name: "whh5e5",
|
|
209
191
|
styles: "opacity:1;"
|
|
210
192
|
}),
|
|
211
|
-
beforeClose: /*#__PURE__*/ $
|
|
193
|
+
beforeClose: /*#__PURE__*/ $a6cQm$emotion.css({
|
|
212
194
|
name: "q7lffx",
|
|
213
195
|
styles: "opacity:0;"
|
|
214
196
|
})
|
|
@@ -235,8 +217,8 @@ function $854b6d713fe70fc9$var$focusFirstWithinNode(node) {
|
|
|
235
217
|
}
|
|
236
218
|
}
|
|
237
219
|
}
|
|
238
|
-
|
|
239
|
-
const contentRef = $
|
|
220
|
+
const $854b6d713fe70fc9$export$2b77a92f1a5ad772 = ({ allowHeightOverflow: allowHeightOverflow = false , position: position = 'center' , shouldCloseOnEscapePress: shouldCloseOnEscapePress = true , shouldCloseOnOverlayClick: shouldCloseOnOverlayClick = true , size: size = 'medium' , testId: testId = 'cf-ui-modal' , topOffset: topOffset = '50px' , aria: aria , ...otherProps })=>{
|
|
221
|
+
const contentRef = $a6cQm$react.useRef(null);
|
|
240
222
|
const props = {
|
|
241
223
|
...otherProps,
|
|
242
224
|
allowHeightOverflow: allowHeightOverflow,
|
|
@@ -253,7 +235,7 @@ function $854b6d713fe70fc9$export$2b77a92f1a5ad772({ allowHeightOverflow: allowH
|
|
|
253
235
|
allowHeightOverflow: allowHeightOverflow,
|
|
254
236
|
className: otherProps.className
|
|
255
237
|
});
|
|
256
|
-
$
|
|
238
|
+
$a6cQm$react.useEffect(()=>{
|
|
257
239
|
if (props.isShown) setTimeout(()=>{
|
|
258
240
|
if (props.initialFocusRef && props.initialFocusRef.current) {
|
|
259
241
|
if (props.initialFocusRef.current.focus) props.initialFocusRef.current.focus();
|
|
@@ -264,13 +246,13 @@ function $854b6d713fe70fc9$export$2b77a92f1a5ad772({ allowHeightOverflow: allowH
|
|
|
264
246
|
props.initialFocusRef
|
|
265
247
|
]);
|
|
266
248
|
const renderDefault = ()=>{
|
|
267
|
-
return(/*#__PURE__*/ $
|
|
249
|
+
return(/*#__PURE__*/ $a6cQm$react.createElement($a6cQm$react.Fragment, null, otherProps.title && /*#__PURE__*/ $a6cQm$react.createElement($2679bd8c144d3995$export$f50a68e3694789ee, {
|
|
268
250
|
title: otherProps.title,
|
|
269
251
|
onClose: props.onClose,
|
|
270
252
|
...otherProps.modalHeaderProps
|
|
271
|
-
}), /*#__PURE__*/ $
|
|
253
|
+
}), /*#__PURE__*/ $a6cQm$react.createElement($66391c55bbcf9065$export$6da19a24bf249f17, otherProps.modalContentProps, otherProps.children)));
|
|
272
254
|
};
|
|
273
|
-
return(/*#__PURE__*/ $
|
|
255
|
+
return(/*#__PURE__*/ $a6cQm$react.createElement(($parcel$interopDefault($a6cQm$reactmodal)), {
|
|
274
256
|
ariaHideApp: false,
|
|
275
257
|
aria: aria,
|
|
276
258
|
onRequestClose: props.onClose,
|
|
@@ -300,7 +282,7 @@ function $854b6d713fe70fc9$export$2b77a92f1a5ad772({ allowHeightOverflow: allowH
|
|
|
300
282
|
contentRef: (ref)=>{
|
|
301
283
|
contentRef.current = ref;
|
|
302
284
|
}
|
|
303
|
-
}, /*#__PURE__*/ $
|
|
285
|
+
}, /*#__PURE__*/ $a6cQm$react.createElement($a6cQm$contentfulf36core.Box, {
|
|
304
286
|
testId: testId,
|
|
305
287
|
style: {
|
|
306
288
|
width: $854b6d713fe70fc9$var$ModalSizesMapper[size] || size
|
|
@@ -308,7 +290,7 @@ function $854b6d713fe70fc9$export$2b77a92f1a5ad772({ allowHeightOverflow: allowH
|
|
|
308
290
|
className: styles.modal,
|
|
309
291
|
"data-modal-root": true
|
|
310
292
|
}, typeof otherProps.children === 'function' ? otherProps.children(props) : renderDefault())));
|
|
311
|
-
}
|
|
293
|
+
};
|
|
312
294
|
$854b6d713fe70fc9$export$2b77a92f1a5ad772.displayName = 'Modal';
|
|
313
295
|
|
|
314
296
|
|
|
@@ -318,7 +300,7 @@ $854b6d713fe70fc9$export$2b77a92f1a5ad772.displayName = 'Modal';
|
|
|
318
300
|
|
|
319
301
|
|
|
320
302
|
function $8b06e393320a8e77$export$c63fb08199be8e0e({ testId: testId = 'cf-ui-modal-controls' , className: className , children: children , ...otherProps }) {
|
|
321
|
-
return(/*#__PURE__*/ ($parcel$interopDefault($
|
|
303
|
+
return(/*#__PURE__*/ ($parcel$interopDefault($a6cQm$react)).createElement($a6cQm$contentfulf36core.Flex, {
|
|
322
304
|
...otherProps,
|
|
323
305
|
className: className,
|
|
324
306
|
testId: testId,
|
|
@@ -326,7 +308,7 @@ function $8b06e393320a8e77$export$c63fb08199be8e0e({ testId: testId = 'cf-ui-mod
|
|
|
326
308
|
justifyContent: "flex-end",
|
|
327
309
|
margin: "spacingL",
|
|
328
310
|
marginTop: "none"
|
|
329
|
-
}, /*#__PURE__*/ ($parcel$interopDefault($
|
|
311
|
+
}, /*#__PURE__*/ ($parcel$interopDefault($a6cQm$react)).createElement($a6cQm$contentfulf36button.ButtonGroup, {
|
|
330
312
|
variant: "spaced",
|
|
331
313
|
spacing: "spacingS"
|
|
332
314
|
}, children)));
|
|
@@ -344,8 +326,8 @@ $2132db66f9439432$export$2b77a92f1a5ad772.Controls = $8b06e393320a8e77$export$c6
|
|
|
344
326
|
|
|
345
327
|
|
|
346
328
|
function $657ddd6e4548962f$export$427af6990c8ff682({ allowHeightOverflow: allowHeightOverflow = false , cancelLabel: cancelLabel = 'Cancel' , cancelTestId: cancelTestId = 'cf-ui-modal-confirm-cancel-button' , children: children , confirmLabel: confirmLabel = 'Confirm' , confirmTestId: confirmTestId = 'cf-ui-modal-confirm-confirm-button' , intent: intent = 'positive' , isConfirmDisabled: isConfirmDisabled = false , isConfirmLoading: isConfirmLoading = false , isShown: isShown , modalContentProps: modalContentProps , modalControlsProps: modalControlsProps , modalHeaderProps: modalHeaderProps , onCancel: onCancel , onConfirm: onConfirm , shouldCloseOnEscapePress: shouldCloseOnEscapePress = true , shouldCloseOnOverlayClick: shouldCloseOnOverlayClick = true , size: size = 'medium' , testId: testId = 'cf-ui-modal-confirm' , title: title = 'Are you sure?' , initialFocusRef: initialFocusRef }) {
|
|
347
|
-
const cancelRef = ($parcel$interopDefault($
|
|
348
|
-
const confirmButton = confirmLabel ? /*#__PURE__*/ ($parcel$interopDefault($
|
|
329
|
+
const cancelRef = ($parcel$interopDefault($a6cQm$react)).useRef(null);
|
|
330
|
+
const confirmButton = confirmLabel ? /*#__PURE__*/ ($parcel$interopDefault($a6cQm$react)).createElement($a6cQm$contentfulf36button.Button, {
|
|
349
331
|
testId: confirmTestId,
|
|
350
332
|
isDisabled: isConfirmDisabled,
|
|
351
333
|
isLoading: isConfirmLoading,
|
|
@@ -353,14 +335,14 @@ function $657ddd6e4548962f$export$427af6990c8ff682({ allowHeightOverflow: allowH
|
|
|
353
335
|
size: "small",
|
|
354
336
|
onClick: ()=>onConfirm()
|
|
355
337
|
}, confirmLabel) : null;
|
|
356
|
-
const cancelButton = cancelLabel ? /*#__PURE__*/ ($parcel$interopDefault($
|
|
338
|
+
const cancelButton = cancelLabel ? /*#__PURE__*/ ($parcel$interopDefault($a6cQm$react)).createElement($a6cQm$contentfulf36button.Button, {
|
|
357
339
|
testId: cancelTestId,
|
|
358
340
|
variant: "secondary",
|
|
359
341
|
onClick: onCancel,
|
|
360
342
|
size: "small",
|
|
361
343
|
ref: initialFocusRef || cancelRef
|
|
362
344
|
}, cancelLabel) : null;
|
|
363
|
-
return(/*#__PURE__*/ ($parcel$interopDefault($
|
|
345
|
+
return(/*#__PURE__*/ ($parcel$interopDefault($a6cQm$react)).createElement($2132db66f9439432$export$2b77a92f1a5ad772, {
|
|
364
346
|
testId: testId,
|
|
365
347
|
isShown: isShown,
|
|
366
348
|
onClose: onCancel,
|
|
@@ -370,10 +352,10 @@ function $657ddd6e4548962f$export$427af6990c8ff682({ allowHeightOverflow: allowH
|
|
|
370
352
|
allowHeightOverflow: allowHeightOverflow,
|
|
371
353
|
initialFocusRef: cancelRef
|
|
372
354
|
}, ()=>{
|
|
373
|
-
return(/*#__PURE__*/ ($parcel$interopDefault($
|
|
355
|
+
return(/*#__PURE__*/ ($parcel$interopDefault($a6cQm$react)).createElement(($parcel$interopDefault($a6cQm$react)).Fragment, null, /*#__PURE__*/ ($parcel$interopDefault($a6cQm$react)).createElement($2132db66f9439432$export$2b77a92f1a5ad772.Header, {
|
|
374
356
|
title: title || '',
|
|
375
357
|
...modalHeaderProps
|
|
376
|
-
}), /*#__PURE__*/ ($parcel$interopDefault($
|
|
358
|
+
}), /*#__PURE__*/ ($parcel$interopDefault($a6cQm$react)).createElement($2132db66f9439432$export$2b77a92f1a5ad772.Content, modalContentProps, children), /*#__PURE__*/ ($parcel$interopDefault($a6cQm$react)).createElement($2132db66f9439432$export$2b77a92f1a5ad772.Controls, modalControlsProps, cancelButton, confirmButton)));
|
|
377
359
|
}));
|
|
378
360
|
}
|
|
379
361
|
$657ddd6e4548962f$export$427af6990c8ff682.displayName = 'ModalConfirm';
|
|
@@ -403,7 +385,7 @@ function $f6dfceab072669eb$var$closeAll() {
|
|
|
403
385
|
render(config);
|
|
404
386
|
await new Promise((resolveDelay)=>setTimeout(resolveDelay, delay)
|
|
405
387
|
);
|
|
406
|
-
($parcel$interopDefault($
|
|
388
|
+
($parcel$interopDefault($a6cQm$reactdom)).unmountComponentAtNode($f6dfceab072669eb$var$getRoot(rootElId));
|
|
407
389
|
$f6dfceab072669eb$var$openModalsIds.delete(rootElId);
|
|
408
390
|
});
|
|
409
391
|
} // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -421,7 +403,7 @@ function $f6dfceab072669eb$var$open(componentRenderer, options = {
|
|
|
421
403
|
isShown: true
|
|
422
404
|
};
|
|
423
405
|
function render({ onClose: onClose , isShown: isShown }) {
|
|
424
|
-
($parcel$interopDefault($
|
|
406
|
+
($parcel$interopDefault($a6cQm$reactdom)).render(componentRenderer({
|
|
425
407
|
onClose: onClose,
|
|
426
408
|
isShown: isShown
|
|
427
409
|
}), rootDom);
|
|
@@ -434,7 +416,7 @@ function $f6dfceab072669eb$var$open(componentRenderer, options = {
|
|
|
434
416
|
render(currentConfig);
|
|
435
417
|
await new Promise((resolveDelay)=>setTimeout(resolveDelay, options.delay)
|
|
436
418
|
);
|
|
437
|
-
($parcel$interopDefault($
|
|
419
|
+
($parcel$interopDefault($a6cQm$reactdom)).unmountComponentAtNode(rootDom);
|
|
438
420
|
rootDom.remove();
|
|
439
421
|
$f6dfceab072669eb$var$openModalsIds.delete(rootElId);
|
|
440
422
|
resolve(arg);
|
|
@@ -455,7 +437,4 @@ const $f6dfceab072669eb$export$e21b828b42c54a37 = {
|
|
|
455
437
|
|
|
456
438
|
|
|
457
439
|
|
|
458
|
-
$parcel$exportWildcard(module.exports, $4eddba25b642b7ac$exports);
|
|
459
|
-
|
|
460
|
-
|
|
461
440
|
//# sourceMappingURL=main.js.map
|