@contentful/f36-modal 4.13.0 → 4.15.1
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 +30 -0
- package/dist/main.js +113 -115
- package/dist/main.js.map +1 -1
- package/dist/module.js +113 -115
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 4.15.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies []:
|
|
8
|
+
- @contentful/f36-button@4.15.1
|
|
9
|
+
- @contentful/f36-icons@4.15.1
|
|
10
|
+
- @contentful/f36-typography@4.15.1
|
|
11
|
+
- @contentful/f36-core@4.15.1
|
|
12
|
+
|
|
13
|
+
## 4.15.0
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies []:
|
|
18
|
+
- @contentful/f36-button@4.15.0
|
|
19
|
+
- @contentful/f36-icons@4.15.0
|
|
20
|
+
- @contentful/f36-typography@4.15.0
|
|
21
|
+
- @contentful/f36-core@4.15.0
|
|
22
|
+
|
|
23
|
+
## 4.14.0
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- Updated dependencies []:
|
|
28
|
+
- @contentful/f36-button@4.14.0
|
|
29
|
+
- @contentful/f36-icons@4.14.0
|
|
30
|
+
- @contentful/f36-typography@4.14.0
|
|
31
|
+
- @contentful/f36-core@4.14.0
|
|
32
|
+
|
|
3
33
|
## 4.13.0
|
|
4
34
|
|
|
5
35
|
### Patch Changes
|
package/dist/main.js
CHANGED
|
@@ -34,19 +34,19 @@ $parcel$export(module.exports, "ModalLauncher", () => $f6dfceab072669eb$export$e
|
|
|
34
34
|
|
|
35
35
|
function $2e9361382cc113aa$export$4bef00d568400c9b() {
|
|
36
36
|
return {
|
|
37
|
-
root: /*#__PURE__*/ $a6cQm$emotion.css({
|
|
38
|
-
position:
|
|
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}`
|
|
37
|
+
root: /*#__PURE__*/ (0, $a6cQm$emotion.css)({
|
|
38
|
+
position: "relative",
|
|
39
|
+
padding: `${(0, ($parcel$interopDefault($a6cQm$contentfulf36tokens))).spacingM} ${(0, ($parcel$interopDefault($a6cQm$contentfulf36tokens))).spacingM} ${(0, ($parcel$interopDefault($a6cQm$contentfulf36tokens))).spacingM} ${(0, ($parcel$interopDefault($a6cQm$contentfulf36tokens))).spacingL}`,
|
|
40
|
+
borderRadius: `${(0, ($parcel$interopDefault($a6cQm$contentfulf36tokens))).borderRadiusMedium} ${(0, ($parcel$interopDefault($a6cQm$contentfulf36tokens))).borderRadiusMedium} 0 0`,
|
|
41
|
+
borderBottom: `1px solid ${(0, ($parcel$interopDefault($a6cQm$contentfulf36tokens))).gray300}`
|
|
42
42
|
}),
|
|
43
|
-
buttonContainer: /*#__PURE__*/ $a6cQm$emotion.css({
|
|
44
|
-
position:
|
|
45
|
-
width: ($parcel$interopDefault($a6cQm$contentfulf36tokens)).spacing2Xl,
|
|
46
|
-
height: ($parcel$interopDefault($a6cQm$contentfulf36tokens)).spacingL,
|
|
43
|
+
buttonContainer: /*#__PURE__*/ (0, $a6cQm$emotion.css)({
|
|
44
|
+
position: "relative",
|
|
45
|
+
width: (0, ($parcel$interopDefault($a6cQm$contentfulf36tokens))).spacing2Xl,
|
|
46
|
+
height: (0, ($parcel$interopDefault($a6cQm$contentfulf36tokens))).spacingL,
|
|
47
47
|
button: {
|
|
48
|
-
position:
|
|
49
|
-
top: `calc(-1 * ${($parcel$interopDefault($a6cQm$contentfulf36tokens)).spacing2Xs})`,
|
|
48
|
+
position: "absolute",
|
|
49
|
+
top: `calc(-1 * ${(0, ($parcel$interopDefault($a6cQm$contentfulf36tokens))).spacing2Xs})`,
|
|
50
50
|
right: 0
|
|
51
51
|
}
|
|
52
52
|
})
|
|
@@ -54,25 +54,25 @@ function $2e9361382cc113aa$export$4bef00d568400c9b() {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
|
|
57
|
-
const $2679bd8c144d3995$export$f50a68e3694789ee = ({ onClose: onClose , title: title , testId: testId =
|
|
58
|
-
const styles = $2e9361382cc113aa$export$4bef00d568400c9b();
|
|
59
|
-
return /*#__PURE__*/ ($parcel$interopDefault($a6cQm$react)).createElement($a6cQm$contentfulf36core.Flex, {
|
|
57
|
+
const $2679bd8c144d3995$export$f50a68e3694789ee = ({ onClose: onClose , title: title , testId: testId = "cf-ui-modal-header" , className: className , ...otherProps })=>{
|
|
58
|
+
const styles = (0, $2e9361382cc113aa$export$4bef00d568400c9b)();
|
|
59
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($a6cQm$react))).createElement((0, $a6cQm$contentfulf36core.Flex), {
|
|
60
60
|
...otherProps,
|
|
61
|
-
className: $a6cQm$emotion.cx(styles.root, className),
|
|
61
|
+
className: (0, $a6cQm$emotion.cx)(styles.root, className),
|
|
62
62
|
testId: testId,
|
|
63
63
|
alignItems: "center",
|
|
64
64
|
justifyContent: "space-between"
|
|
65
|
-
}, /*#__PURE__*/ ($parcel$interopDefault($a6cQm$react)).createElement($a6cQm$contentfulf36typography.Subheading, {
|
|
65
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($a6cQm$react))).createElement((0, $a6cQm$contentfulf36typography.Subheading), {
|
|
66
66
|
as: "h2",
|
|
67
67
|
isTruncated: true,
|
|
68
68
|
marginBottom: "none"
|
|
69
|
-
}, title), onClose && /*#__PURE__*/ ($parcel$interopDefault($a6cQm$react)).createElement($a6cQm$contentfulf36core.Flex, {
|
|
69
|
+
}, title), onClose && /*#__PURE__*/ (0, ($parcel$interopDefault($a6cQm$react))).createElement((0, $a6cQm$contentfulf36core.Flex), {
|
|
70
70
|
alignItems: "center",
|
|
71
71
|
className: styles.buttonContainer
|
|
72
|
-
}, /*#__PURE__*/ ($parcel$interopDefault($a6cQm$react)).createElement($a6cQm$contentfulf36button.Button, {
|
|
72
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($a6cQm$react))).createElement((0, $a6cQm$contentfulf36button.Button), {
|
|
73
73
|
variant: "transparent",
|
|
74
74
|
"aria-label": "Close",
|
|
75
|
-
startIcon: /*#__PURE__*/ ($parcel$interopDefault($a6cQm$react)).createElement($a6cQm$contentfulf36icons.CloseIcon, {
|
|
75
|
+
startIcon: /*#__PURE__*/ (0, ($parcel$interopDefault($a6cQm$react))).createElement((0, $a6cQm$contentfulf36icons.CloseIcon), {
|
|
76
76
|
size: "small"
|
|
77
77
|
}),
|
|
78
78
|
onClick: ()=>{
|
|
@@ -81,7 +81,7 @@ const $2679bd8c144d3995$export$f50a68e3694789ee = ({ onClose: onClose , title: t
|
|
|
81
81
|
size: "small"
|
|
82
82
|
})));
|
|
83
83
|
};
|
|
84
|
-
$2679bd8c144d3995$export$f50a68e3694789ee.displayName =
|
|
84
|
+
$2679bd8c144d3995$export$f50a68e3694789ee.displayName = "ModalHeader";
|
|
85
85
|
|
|
86
86
|
|
|
87
87
|
|
|
@@ -91,106 +91,106 @@ $2679bd8c144d3995$export$f50a68e3694789ee.displayName = 'ModalHeader';
|
|
|
91
91
|
|
|
92
92
|
function $32e971b34c262557$export$5168abbf3ad664a0() {
|
|
93
93
|
return {
|
|
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,
|
|
100
|
-
overflowY:
|
|
101
|
-
overflowX:
|
|
102
|
-
boxSizing:
|
|
94
|
+
root: /*#__PURE__*/ (0, $a6cQm$emotion.css)({
|
|
95
|
+
padding: `${(0, ($parcel$interopDefault($a6cQm$contentfulf36tokens))).spacingM} ${(0, ($parcel$interopDefault($a6cQm$contentfulf36tokens))).spacingL}`,
|
|
96
|
+
color: (0, ($parcel$interopDefault($a6cQm$contentfulf36tokens))).gray700,
|
|
97
|
+
fontSize: (0, ($parcel$interopDefault($a6cQm$contentfulf36tokens))).fontSizeM,
|
|
98
|
+
fontFamily: (0, ($parcel$interopDefault($a6cQm$contentfulf36tokens))).fontStackPrimary,
|
|
99
|
+
lineHeight: (0, ($parcel$interopDefault($a6cQm$contentfulf36tokens))).lineHeightM,
|
|
100
|
+
overflowY: "auto",
|
|
101
|
+
overflowX: "auto",
|
|
102
|
+
boxSizing: "border-box"
|
|
103
103
|
})
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
|
|
108
|
-
const $66391c55bbcf9065$export$6da19a24bf249f17 = ({ testId: testId =
|
|
109
|
-
const styles = $32e971b34c262557$export$5168abbf3ad664a0();
|
|
110
|
-
return /*#__PURE__*/ ($parcel$interopDefault($a6cQm$react)).createElement($a6cQm$contentfulf36core.Box, {
|
|
108
|
+
const $66391c55bbcf9065$export$6da19a24bf249f17 = ({ testId: testId = "cf-ui-modal-content" , className: className , children: children , ...otherProps })=>{
|
|
109
|
+
const styles = (0, $32e971b34c262557$export$5168abbf3ad664a0)();
|
|
110
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($a6cQm$react))).createElement((0, $a6cQm$contentfulf36core.Box), {
|
|
111
111
|
...otherProps,
|
|
112
112
|
as: "div",
|
|
113
|
-
className: $a6cQm$emotion.cx(styles.root, className),
|
|
113
|
+
className: (0, $a6cQm$emotion.cx)(styles.root, className),
|
|
114
114
|
testId: testId
|
|
115
115
|
}, children);
|
|
116
116
|
};
|
|
117
|
-
$66391c55bbcf9065$export$6da19a24bf249f17.displayName =
|
|
117
|
+
$66391c55bbcf9065$export$6da19a24bf249f17.displayName = "ModalContent";
|
|
118
118
|
|
|
119
119
|
|
|
120
120
|
|
|
121
121
|
|
|
122
122
|
|
|
123
123
|
function $a1d799ea27882387$export$9af97f4b0b4c597a(props) {
|
|
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 ===
|
|
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}))`,
|
|
131
|
-
overflow:
|
|
132
|
-
display:
|
|
133
|
-
flexDirection:
|
|
134
|
-
}), props.allowHeightOverflow ? /*#__PURE__*/ $a6cQm$emotion.css({
|
|
124
|
+
const modal = (0, $a6cQm$emotion.cx)(/*#__PURE__*/ (0, $a6cQm$emotion.css)({
|
|
125
|
+
margin: (0, ($parcel$interopDefault($a6cQm$contentfulf36tokens))).spacing2Xl,
|
|
126
|
+
backgroundColor: (0, ($parcel$interopDefault($a6cQm$contentfulf36tokens))).colorWhite,
|
|
127
|
+
borderRadius: props.size === "zen" ? 0 : (0, ($parcel$interopDefault($a6cQm$contentfulf36tokens))).borderRadiusMedium,
|
|
128
|
+
boxShadow: (0, ($parcel$interopDefault($a6cQm$contentfulf36tokens))).boxShadowHeavy,
|
|
129
|
+
maxHeight: `calc(100vh - 1rem * (100 / ${(0, ($parcel$interopDefault($a6cQm$contentfulf36tokens))).fontBaseDefault}))`,
|
|
130
|
+
maxWidth: `calc(100vw - 1rem * (100 / ${(0, ($parcel$interopDefault($a6cQm$contentfulf36tokens))).fontBaseDefault}))`,
|
|
131
|
+
overflow: "hidden",
|
|
132
|
+
display: "flex",
|
|
133
|
+
flexDirection: "column"
|
|
134
|
+
}), props.allowHeightOverflow ? /*#__PURE__*/ (0, $a6cQm$emotion.css)({
|
|
135
135
|
name: "1evlo53",
|
|
136
136
|
styles: "overflow:auto;max-height:none;"
|
|
137
|
-
}) : null, props.size ===
|
|
137
|
+
}) : null, props.size === "zen" ? /*#__PURE__*/ (0, $a6cQm$emotion.css)({
|
|
138
138
|
name: "11c88st",
|
|
139
139
|
styles: "max-width:none;max-height:none;margin:0;height:100%;width:100%;"
|
|
140
140
|
}) : null, props.className);
|
|
141
141
|
return {
|
|
142
|
-
portal: /*#__PURE__*/ $a6cQm$emotion.css({
|
|
142
|
+
portal: /*#__PURE__*/ (0, $a6cQm$emotion.css)({
|
|
143
143
|
name: "13o7eu2",
|
|
144
144
|
styles: "display:block;"
|
|
145
145
|
}),
|
|
146
146
|
base: {
|
|
147
|
-
root: $a6cQm$emotion.cx(/*#__PURE__*/ $a6cQm$emotion.css({
|
|
148
|
-
zIndex: ($parcel$interopDefault($a6cQm$contentfulf36tokens)).zIndexModalContent,
|
|
149
|
-
position:
|
|
147
|
+
root: (0, $a6cQm$emotion.cx)(/*#__PURE__*/ (0, $a6cQm$emotion.css)({
|
|
148
|
+
zIndex: (0, ($parcel$interopDefault($a6cQm$contentfulf36tokens))).zIndexModalContent,
|
|
149
|
+
position: "relative",
|
|
150
150
|
padding: 0,
|
|
151
|
-
display:
|
|
152
|
-
margin:
|
|
153
|
-
textAlign:
|
|
154
|
-
outline:
|
|
155
|
-
transform: props.size ===
|
|
156
|
-
transition: `transform ${($parcel$interopDefault($a6cQm$contentfulf36tokens)).transitionDurationDefault} ${($parcel$interopDefault($a6cQm$contentfulf36tokens)).transitionEasingDefault}`
|
|
157
|
-
}), props.size ===
|
|
151
|
+
display: "inline-block",
|
|
152
|
+
margin: "0 auto",
|
|
153
|
+
textAlign: "left",
|
|
154
|
+
outline: "none",
|
|
155
|
+
transform: props.size === "zen" ? "scale(1)" : "scale(0.85)",
|
|
156
|
+
transition: `transform ${(0, ($parcel$interopDefault($a6cQm$contentfulf36tokens))).transitionDurationDefault} ${(0, ($parcel$interopDefault($a6cQm$contentfulf36tokens))).transitionEasingDefault}`
|
|
157
|
+
}), props.size === "zen" ? /*#__PURE__*/ (0, $a6cQm$emotion.css)({
|
|
158
158
|
name: "uwwqev",
|
|
159
159
|
styles: "width:100%;height:100%;"
|
|
160
160
|
}) : null),
|
|
161
|
-
afterOpen: /*#__PURE__*/ $a6cQm$emotion.css({
|
|
161
|
+
afterOpen: /*#__PURE__*/ (0, $a6cQm$emotion.css)({
|
|
162
162
|
name: "plgkgv",
|
|
163
163
|
styles: "transform:scale(1) !important;"
|
|
164
164
|
}),
|
|
165
|
-
beforeClose: /*#__PURE__*/ $a6cQm$emotion.css({
|
|
166
|
-
transform: props.size ===
|
|
165
|
+
beforeClose: /*#__PURE__*/ (0, $a6cQm$emotion.css)({
|
|
166
|
+
transform: props.size === "zen" ? "scale(1)" : "scale(0.85)"
|
|
167
167
|
})
|
|
168
168
|
},
|
|
169
169
|
modalOverlay: {
|
|
170
|
-
root: $a6cQm$emotion.cx(/*#__PURE__*/ $a6cQm$emotion.css({
|
|
171
|
-
display:
|
|
172
|
-
alignItems:
|
|
173
|
-
flexWrap:
|
|
170
|
+
root: (0, $a6cQm$emotion.cx)(/*#__PURE__*/ (0, $a6cQm$emotion.css)({
|
|
171
|
+
display: "flex",
|
|
172
|
+
alignItems: "baseline",
|
|
173
|
+
flexWrap: "wrap",
|
|
174
174
|
top: 0,
|
|
175
175
|
right: 0,
|
|
176
176
|
bottom: 0,
|
|
177
177
|
left: 0,
|
|
178
|
-
zIndex: ($parcel$interopDefault($a6cQm$contentfulf36tokens)).zIndexModal,
|
|
178
|
+
zIndex: (0, ($parcel$interopDefault($a6cQm$contentfulf36tokens))).zIndexModal,
|
|
179
179
|
opacity: 0,
|
|
180
|
-
transition: `opacity ${($parcel$interopDefault($a6cQm$contentfulf36tokens)).transitionDurationDefault} ${($parcel$interopDefault($a6cQm$contentfulf36tokens)).transitionEasingDefault}`,
|
|
181
|
-
position:
|
|
182
|
-
overflowY:
|
|
183
|
-
backgroundColor:
|
|
184
|
-
textAlign:
|
|
185
|
-
}), props.position ===
|
|
180
|
+
transition: `opacity ${(0, ($parcel$interopDefault($a6cQm$contentfulf36tokens))).transitionDurationDefault} ${(0, ($parcel$interopDefault($a6cQm$contentfulf36tokens))).transitionEasingDefault}`,
|
|
181
|
+
position: "fixed",
|
|
182
|
+
overflowY: "auto",
|
|
183
|
+
backgroundColor: "rgba(12, 20, 28, 0.74902)",
|
|
184
|
+
textAlign: "center"
|
|
185
|
+
}), props.position === "center" ? /*#__PURE__*/ (0, $a6cQm$emotion.css)({
|
|
186
186
|
name: "1qe4tyl",
|
|
187
187
|
styles: "align-items:center;justify-content:center;"
|
|
188
188
|
}) : null),
|
|
189
|
-
afterOpen: /*#__PURE__*/ $a6cQm$emotion.css({
|
|
189
|
+
afterOpen: /*#__PURE__*/ (0, $a6cQm$emotion.css)({
|
|
190
190
|
name: "whh5e5",
|
|
191
191
|
styles: "opacity:1;"
|
|
192
192
|
}),
|
|
193
|
-
beforeClose: /*#__PURE__*/ $a6cQm$emotion.css({
|
|
193
|
+
beforeClose: /*#__PURE__*/ (0, $a6cQm$emotion.css)({
|
|
194
194
|
name: "q7lffx",
|
|
195
195
|
styles: "opacity:0;"
|
|
196
196
|
})
|
|
@@ -201,23 +201,23 @@ function $a1d799ea27882387$export$9af97f4b0b4c597a(props) {
|
|
|
201
201
|
|
|
202
202
|
|
|
203
203
|
const $854b6d713fe70fc9$var$ModalSizesMapper = {
|
|
204
|
-
medium:
|
|
205
|
-
small:
|
|
206
|
-
large:
|
|
207
|
-
fullWidth:
|
|
208
|
-
zen:
|
|
204
|
+
medium: "520px",
|
|
205
|
+
small: "400px",
|
|
206
|
+
large: "700px",
|
|
207
|
+
fullWidth: "100vw",
|
|
208
|
+
zen: "100vw"
|
|
209
209
|
};
|
|
210
210
|
function $854b6d713fe70fc9$var$focusFirstWithinNode(node) {
|
|
211
211
|
if (node && node.querySelectorAll) {
|
|
212
|
-
const elements = node.querySelectorAll(
|
|
212
|
+
const elements = node.querySelectorAll("input, button");
|
|
213
213
|
if (elements.length > 0) {
|
|
214
214
|
const firstElement = elements[0]; // @ts-expect-error focus might be missing
|
|
215
|
-
if (typeof firstElement.focus ===
|
|
215
|
+
if (typeof firstElement.focus === "function") // @ts-expect-error focus might be missing
|
|
216
216
|
firstElement.focus();
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
|
-
const $854b6d713fe70fc9$export$2b77a92f1a5ad772 = ({ allowHeightOverflow: allowHeightOverflow = false , position: position =
|
|
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
221
|
const contentRef = $a6cQm$react.useRef(null);
|
|
222
222
|
const props = {
|
|
223
223
|
...otherProps,
|
|
@@ -229,7 +229,7 @@ const $854b6d713fe70fc9$export$2b77a92f1a5ad772 = ({ allowHeightOverflow: allowH
|
|
|
229
229
|
testId: testId,
|
|
230
230
|
topOffset: topOffset
|
|
231
231
|
};
|
|
232
|
-
const styles = $a1d799ea27882387$export$9af97f4b0b4c597a({
|
|
232
|
+
const styles = (0, $a1d799ea27882387$export$9af97f4b0b4c597a)({
|
|
233
233
|
position: position,
|
|
234
234
|
size: size,
|
|
235
235
|
allowHeightOverflow: allowHeightOverflow,
|
|
@@ -246,13 +246,13 @@ const $854b6d713fe70fc9$export$2b77a92f1a5ad772 = ({ allowHeightOverflow: allowH
|
|
|
246
246
|
props.initialFocusRef
|
|
247
247
|
]);
|
|
248
248
|
const renderDefault = ()=>{
|
|
249
|
-
return /*#__PURE__*/ $a6cQm$react.createElement($a6cQm$react.Fragment, null, otherProps.title && /*#__PURE__*/ $a6cQm$react.createElement($2679bd8c144d3995$export$f50a68e3694789ee, {
|
|
249
|
+
return /*#__PURE__*/ $a6cQm$react.createElement($a6cQm$react.Fragment, null, otherProps.title && /*#__PURE__*/ $a6cQm$react.createElement((0, $2679bd8c144d3995$export$f50a68e3694789ee), {
|
|
250
250
|
title: otherProps.title,
|
|
251
251
|
onClose: props.onClose,
|
|
252
252
|
...otherProps.modalHeaderProps
|
|
253
|
-
}), /*#__PURE__*/ $a6cQm$react.createElement($66391c55bbcf9065$export$6da19a24bf249f17, otherProps.modalContentProps, otherProps.children));
|
|
253
|
+
}), /*#__PURE__*/ $a6cQm$react.createElement((0, $66391c55bbcf9065$export$6da19a24bf249f17), otherProps.modalContentProps, otherProps.children));
|
|
254
254
|
};
|
|
255
|
-
return /*#__PURE__*/ $a6cQm$react.createElement(($parcel$interopDefault($a6cQm$reactmodal)), {
|
|
255
|
+
return /*#__PURE__*/ $a6cQm$react.createElement((0, ($parcel$interopDefault($a6cQm$reactmodal))), {
|
|
256
256
|
ariaHideApp: false,
|
|
257
257
|
aria: aria,
|
|
258
258
|
onRequestClose: props.onClose,
|
|
@@ -265,7 +265,7 @@ const $854b6d713fe70fc9$export$2b77a92f1a5ad772 = ({ allowHeightOverflow: allowH
|
|
|
265
265
|
portalClassName: styles.portal,
|
|
266
266
|
style: {
|
|
267
267
|
content: {
|
|
268
|
-
top: position ===
|
|
268
|
+
top: position === "center" ? 0 : topOffset
|
|
269
269
|
}
|
|
270
270
|
},
|
|
271
271
|
className: {
|
|
@@ -282,16 +282,16 @@ const $854b6d713fe70fc9$export$2b77a92f1a5ad772 = ({ allowHeightOverflow: allowH
|
|
|
282
282
|
contentRef: (ref)=>{
|
|
283
283
|
contentRef.current = ref;
|
|
284
284
|
}
|
|
285
|
-
}, /*#__PURE__*/ $a6cQm$react.createElement($a6cQm$contentfulf36core.Box, {
|
|
285
|
+
}, /*#__PURE__*/ $a6cQm$react.createElement((0, $a6cQm$contentfulf36core.Box), {
|
|
286
286
|
testId: testId,
|
|
287
287
|
style: {
|
|
288
288
|
width: $854b6d713fe70fc9$var$ModalSizesMapper[size] || size
|
|
289
289
|
},
|
|
290
290
|
className: styles.modal,
|
|
291
291
|
"data-modal-root": true
|
|
292
|
-
}, typeof otherProps.children ===
|
|
292
|
+
}, typeof otherProps.children === "function" ? otherProps.children(props) : renderDefault()));
|
|
293
293
|
};
|
|
294
|
-
$854b6d713fe70fc9$export$2b77a92f1a5ad772.displayName =
|
|
294
|
+
$854b6d713fe70fc9$export$2b77a92f1a5ad772.displayName = "Modal";
|
|
295
295
|
|
|
296
296
|
|
|
297
297
|
|
|
@@ -299,8 +299,8 @@ $854b6d713fe70fc9$export$2b77a92f1a5ad772.displayName = 'Modal';
|
|
|
299
299
|
|
|
300
300
|
|
|
301
301
|
|
|
302
|
-
const $8b06e393320a8e77$export$c63fb08199be8e0e = ({ testId: testId =
|
|
303
|
-
return /*#__PURE__*/ ($parcel$interopDefault($a6cQm$react)).createElement($a6cQm$contentfulf36core.Flex, {
|
|
302
|
+
const $8b06e393320a8e77$export$c63fb08199be8e0e = ({ testId: testId = "cf-ui-modal-controls" , className: className , children: children , ...otherProps })=>{
|
|
303
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($a6cQm$react))).createElement((0, $a6cQm$contentfulf36core.Flex), {
|
|
304
304
|
...otherProps,
|
|
305
305
|
className: className,
|
|
306
306
|
testId: testId,
|
|
@@ -308,26 +308,26 @@ const $8b06e393320a8e77$export$c63fb08199be8e0e = ({ testId: testId = 'cf-ui-mod
|
|
|
308
308
|
justifyContent: "flex-end",
|
|
309
309
|
margin: "spacingL",
|
|
310
310
|
marginTop: "none"
|
|
311
|
-
}, /*#__PURE__*/ ($parcel$interopDefault($a6cQm$react)).createElement($a6cQm$contentfulf36button.ButtonGroup, {
|
|
311
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($a6cQm$react))).createElement((0, $a6cQm$contentfulf36button.ButtonGroup), {
|
|
312
312
|
variant: "spaced",
|
|
313
313
|
spacing: "spacingS"
|
|
314
314
|
}, children));
|
|
315
315
|
};
|
|
316
|
-
$8b06e393320a8e77$export$c63fb08199be8e0e.displayName =
|
|
316
|
+
$8b06e393320a8e77$export$c63fb08199be8e0e.displayName = "ModalControls";
|
|
317
317
|
|
|
318
318
|
|
|
319
|
-
const $2132db66f9439432$export$2b77a92f1a5ad772 = $854b6d713fe70fc9$export$2b77a92f1a5ad772;
|
|
320
|
-
$2132db66f9439432$export$2b77a92f1a5ad772.Content = $66391c55bbcf9065$export$6da19a24bf249f17;
|
|
321
|
-
$2132db66f9439432$export$2b77a92f1a5ad772.Header = $2679bd8c144d3995$export$f50a68e3694789ee;
|
|
322
|
-
$2132db66f9439432$export$2b77a92f1a5ad772.Controls = $8b06e393320a8e77$export$c63fb08199be8e0e;
|
|
319
|
+
const $2132db66f9439432$export$2b77a92f1a5ad772 = (0, $854b6d713fe70fc9$export$2b77a92f1a5ad772);
|
|
320
|
+
$2132db66f9439432$export$2b77a92f1a5ad772.Content = (0, $66391c55bbcf9065$export$6da19a24bf249f17);
|
|
321
|
+
$2132db66f9439432$export$2b77a92f1a5ad772.Header = (0, $2679bd8c144d3995$export$f50a68e3694789ee);
|
|
322
|
+
$2132db66f9439432$export$2b77a92f1a5ad772.Controls = (0, $8b06e393320a8e77$export$c63fb08199be8e0e);
|
|
323
323
|
|
|
324
324
|
|
|
325
325
|
|
|
326
326
|
|
|
327
327
|
|
|
328
|
-
const $657ddd6e4548962f$export$427af6990c8ff682 = ({ allowHeightOverflow: allowHeightOverflow = false , cancelLabel: cancelLabel =
|
|
329
|
-
const cancelRef = ($parcel$interopDefault($a6cQm$react)).useRef(null);
|
|
330
|
-
const confirmButton = confirmLabel ? /*#__PURE__*/ ($parcel$interopDefault($a6cQm$react)).createElement($a6cQm$contentfulf36button.Button, {
|
|
328
|
+
const $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 })=>{
|
|
329
|
+
const cancelRef = (0, ($parcel$interopDefault($a6cQm$react))).useRef(null);
|
|
330
|
+
const confirmButton = confirmLabel ? /*#__PURE__*/ (0, ($parcel$interopDefault($a6cQm$react))).createElement((0, $a6cQm$contentfulf36button.Button), {
|
|
331
331
|
testId: confirmTestId,
|
|
332
332
|
isDisabled: isConfirmDisabled,
|
|
333
333
|
isLoading: isConfirmLoading,
|
|
@@ -335,14 +335,14 @@ const $657ddd6e4548962f$export$427af6990c8ff682 = ({ allowHeightOverflow: allowH
|
|
|
335
335
|
size: "small",
|
|
336
336
|
onClick: ()=>onConfirm()
|
|
337
337
|
}, confirmLabel) : null;
|
|
338
|
-
const cancelButton = cancelLabel ? /*#__PURE__*/ ($parcel$interopDefault($a6cQm$react)).createElement($a6cQm$contentfulf36button.Button, {
|
|
338
|
+
const cancelButton = cancelLabel ? /*#__PURE__*/ (0, ($parcel$interopDefault($a6cQm$react))).createElement((0, $a6cQm$contentfulf36button.Button), {
|
|
339
339
|
testId: cancelTestId,
|
|
340
340
|
variant: "secondary",
|
|
341
341
|
onClick: onCancel,
|
|
342
342
|
size: "small",
|
|
343
343
|
ref: initialFocusRef || cancelRef
|
|
344
344
|
}, cancelLabel) : null;
|
|
345
|
-
return /*#__PURE__*/ ($parcel$interopDefault($a6cQm$react)).createElement($2132db66f9439432$export$2b77a92f1a5ad772, {
|
|
345
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($a6cQm$react))).createElement((0, $2132db66f9439432$export$2b77a92f1a5ad772), {
|
|
346
346
|
testId: testId,
|
|
347
347
|
isShown: isShown,
|
|
348
348
|
onClose: onCancel,
|
|
@@ -352,13 +352,13 @@ const $657ddd6e4548962f$export$427af6990c8ff682 = ({ allowHeightOverflow: allowH
|
|
|
352
352
|
allowHeightOverflow: allowHeightOverflow,
|
|
353
353
|
initialFocusRef: cancelRef
|
|
354
354
|
}, ()=>{
|
|
355
|
-
return /*#__PURE__*/ ($parcel$interopDefault($a6cQm$react)).createElement(($parcel$interopDefault($a6cQm$react)).Fragment, null, /*#__PURE__*/ ($parcel$interopDefault($a6cQm$react)).createElement($2132db66f9439432$export$2b77a92f1a5ad772.Header, {
|
|
356
|
-
title: title ||
|
|
355
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($a6cQm$react))).createElement((0, ($parcel$interopDefault($a6cQm$react))).Fragment, null, /*#__PURE__*/ (0, ($parcel$interopDefault($a6cQm$react))).createElement((0, $2132db66f9439432$export$2b77a92f1a5ad772).Header, {
|
|
356
|
+
title: title || "",
|
|
357
357
|
...modalHeaderProps
|
|
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));
|
|
358
|
+
}), /*#__PURE__*/ (0, ($parcel$interopDefault($a6cQm$react))).createElement((0, $2132db66f9439432$export$2b77a92f1a5ad772).Content, modalContentProps, children), /*#__PURE__*/ (0, ($parcel$interopDefault($a6cQm$react))).createElement((0, $2132db66f9439432$export$2b77a92f1a5ad772).Controls, modalControlsProps, cancelButton, confirmButton));
|
|
359
359
|
});
|
|
360
360
|
};
|
|
361
|
-
$657ddd6e4548962f$export$427af6990c8ff682.displayName =
|
|
361
|
+
$657ddd6e4548962f$export$427af6990c8ff682.displayName = "ModalConfirm";
|
|
362
362
|
|
|
363
363
|
|
|
364
364
|
|
|
@@ -370,8 +370,8 @@ const $f6dfceab072669eb$var$getRoot = (rootElId)=>{
|
|
|
370
370
|
let rootDom = document.getElementById(rootElId);
|
|
371
371
|
if (rootDom !== null) return rootDom;
|
|
372
372
|
// Otherwise create it
|
|
373
|
-
rootDom = document.createElement(
|
|
374
|
-
rootDom.setAttribute(
|
|
373
|
+
rootDom = document.createElement("div");
|
|
374
|
+
rootDom.setAttribute("id", rootElId);
|
|
375
375
|
document.body.appendChild(rootDom);
|
|
376
376
|
return rootDom;
|
|
377
377
|
};
|
|
@@ -383,9 +383,8 @@ function $f6dfceab072669eb$var$closeAll() {
|
|
|
383
383
|
isShown: false
|
|
384
384
|
};
|
|
385
385
|
render(config);
|
|
386
|
-
await new Promise((resolveDelay)=>setTimeout(resolveDelay, delay)
|
|
387
|
-
);
|
|
388
|
-
($parcel$interopDefault($a6cQm$reactdom)).unmountComponentAtNode($f6dfceab072669eb$var$getRoot(rootElId));
|
|
386
|
+
await new Promise((resolveDelay)=>setTimeout(resolveDelay, delay));
|
|
387
|
+
(0, ($parcel$interopDefault($a6cQm$reactdom))).unmountComponentAtNode($f6dfceab072669eb$var$getRoot(rootElId));
|
|
389
388
|
$f6dfceab072669eb$var$openModalsIds.delete(rootElId);
|
|
390
389
|
});
|
|
391
390
|
} // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -402,7 +401,7 @@ function $f6dfceab072669eb$var$open(componentRenderer, options = {}) {
|
|
|
402
401
|
isShown: true
|
|
403
402
|
};
|
|
404
403
|
function render({ onClose: onClose , isShown: isShown }) {
|
|
405
|
-
($parcel$interopDefault($a6cQm$reactdom)).render(componentRenderer({
|
|
404
|
+
(0, ($parcel$interopDefault($a6cQm$reactdom))).render(componentRenderer({
|
|
406
405
|
onClose: onClose,
|
|
407
406
|
isShown: isShown
|
|
408
407
|
}), rootDom);
|
|
@@ -413,9 +412,8 @@ function $f6dfceab072669eb$var$open(componentRenderer, options = {}) {
|
|
|
413
412
|
isShown: false
|
|
414
413
|
};
|
|
415
414
|
render(currentConfig);
|
|
416
|
-
await new Promise((resolveDelay)=>setTimeout(resolveDelay, options.delay)
|
|
417
|
-
);
|
|
418
|
-
($parcel$interopDefault($a6cQm$reactdom)).unmountComponentAtNode(rootDom);
|
|
415
|
+
await new Promise((resolveDelay)=>setTimeout(resolveDelay, options.delay));
|
|
416
|
+
(0, ($parcel$interopDefault($a6cQm$reactdom))).unmountComponentAtNode(rootDom);
|
|
419
417
|
rootDom.remove();
|
|
420
418
|
$f6dfceab072669eb$var$openModalsIds.delete(rootElId);
|
|
421
419
|
resolve(arg);
|