@hh.ru/magritte-ui-modal 11.0.16 → 11.0.18
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/actionBarDefaults.d.ts +19 -0
- package/actionBarDefaults.js +23 -0
- package/actionBarDefaults.js.map +1 -0
- package/index.css +86 -86
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/internal/ModalBody.js +1 -1
- package/internal/ModalContent.js +1 -1
- package/internal/ModalInner.js +3 -2
- package/internal/ModalInner.js.map +1 -1
- package/internal/ModalStickyHeader.js +1 -1
- package/internal/constants.js +1 -1
- package/modal-D7proB4O.js +5 -0
- package/modal-D7proB4O.js.map +1 -0
- package/package.json +15 -11
- package/public/Modal.js +2 -1
- package/public/Modal.js.map +1 -1
- package/public/ModalMedia.js +1 -1
- package/public/ModalWithImage.js +5 -10
- package/public/ModalWithImage.js.map +1 -1
- package/withImageDefaults.d.ts +22 -0
- package/withImageDefaults.js +26 -0
- package/withImageDefaults.js.map +1 -0
- package/modal-C1eQijuX.js +0 -5
- package/modal-C1eQijuX.js.map +0 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ActionBar props a Modal supplies to whatever sits in its `footer` slot, at runtime through
|
|
3
|
+
* `ActionBarDefaultPropsContext` (see `internal/ModalInner.tsx`).
|
|
4
|
+
*
|
|
5
|
+
* They live in their own module, as plain data with no imports, because they are read from TWO sides: the
|
|
6
|
+
* component applies them, and the Code Connect template declares them as contextual defaults so a footer
|
|
7
|
+
* snippet stops repeating what the modal already provides. A literal copied into the template would drift
|
|
8
|
+
* silently — change the value here and the published snippet would keep asserting the old one, with no build
|
|
9
|
+
* error and no render error. The bundler inlines this file into every template that imports it, which is the
|
|
10
|
+
* other reason it must stay free of runtime imports.
|
|
11
|
+
*
|
|
12
|
+
* `scrollContainer` is deliberately absent: it is a live DOM node the modal resolves per render, not a value
|
|
13
|
+
* anyone writes in code.
|
|
14
|
+
*/
|
|
15
|
+
export declare const MODAL_ACTION_BAR_DEFAULTS: {
|
|
16
|
+
readonly type: "auto";
|
|
17
|
+
readonly padding: 24;
|
|
18
|
+
readonly showDivider: "with-scroll";
|
|
19
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import './index.css';
|
|
2
|
+
/**
|
|
3
|
+
* The ActionBar props a Modal supplies to whatever sits in its `footer` slot, at runtime through
|
|
4
|
+
* `ActionBarDefaultPropsContext` (see `internal/ModalInner.tsx`).
|
|
5
|
+
*
|
|
6
|
+
* They live in their own module, as plain data with no imports, because they are read from TWO sides: the
|
|
7
|
+
* component applies them, and the Code Connect template declares them as contextual defaults so a footer
|
|
8
|
+
* snippet stops repeating what the modal already provides. A literal copied into the template would drift
|
|
9
|
+
* silently — change the value here and the published snippet would keep asserting the old one, with no build
|
|
10
|
+
* error and no render error. The bundler inlines this file into every template that imports it, which is the
|
|
11
|
+
* other reason it must stay free of runtime imports.
|
|
12
|
+
*
|
|
13
|
+
* `scrollContainer` is deliberately absent: it is a live DOM node the modal resolves per render, not a value
|
|
14
|
+
* anyone writes in code.
|
|
15
|
+
*/
|
|
16
|
+
const MODAL_ACTION_BAR_DEFAULTS = {
|
|
17
|
+
type: 'auto',
|
|
18
|
+
padding: 24,
|
|
19
|
+
showDivider: 'with-scroll',
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { MODAL_ACTION_BAR_DEFAULTS };
|
|
23
|
+
//# sourceMappingURL=actionBarDefaults.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actionBarDefaults.js","sources":["src/actionBarDefaults.ts"],"sourcesContent":["/**\n * The ActionBar props a Modal supplies to whatever sits in its `footer` slot, at runtime through\n * `ActionBarDefaultPropsContext` (see `internal/ModalInner.tsx`).\n *\n * They live in their own module, as plain data with no imports, because they are read from TWO sides: the\n * component applies them, and the Code Connect template declares them as contextual defaults so a footer\n * snippet stops repeating what the modal already provides. A literal copied into the template would drift\n * silently — change the value here and the published snippet would keep asserting the old one, with no build\n * error and no render error. The bundler inlines this file into every template that imports it, which is the\n * other reason it must stay free of runtime imports.\n *\n * `scrollContainer` is deliberately absent: it is a live DOM node the modal resolves per render, not a value\n * anyone writes in code.\n */\nexport const MODAL_ACTION_BAR_DEFAULTS = {\n type: 'auto',\n padding: 24,\n showDivider: 'with-scroll',\n} as const;\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;AAaG;AACU,MAAA,yBAAyB,GAAG;AACrC,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,OAAO,EAAE,EAAE;AACX,IAAA,WAAW,EAAE,aAAa;;;;;"}
|
package/index.css
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
--magritte-color-stroke-neutral-v25-0-0:#303030;
|
|
16
16
|
--magritte-color-component-modal-background-content-v25-0-0:#111;
|
|
17
17
|
}
|
|
18
|
-
.magritte-sticky-header___TPafy_11-0-
|
|
18
|
+
.magritte-sticky-header___TPafy_11-0-18{
|
|
19
19
|
position:sticky;
|
|
20
20
|
top:0;
|
|
21
21
|
z-index:10;
|
|
@@ -27,14 +27,14 @@
|
|
|
27
27
|
--magritte-ui-nav-bar-stage-horizontal-padding-override:24px;
|
|
28
28
|
}
|
|
29
29
|
@supports selector(:has(*)){
|
|
30
|
-
.magritte-sticky-header___TPafy_11-0-
|
|
30
|
+
.magritte-sticky-header___TPafy_11-0-18{
|
|
31
31
|
--magritte-ui-nav-bar-stage-horizontal-padding-override:24px;
|
|
32
32
|
}
|
|
33
|
-
.magritte-sticky-header-inner___u5p8h_11-0-
|
|
33
|
+
.magritte-sticky-header-inner___u5p8h_11-0-18{
|
|
34
34
|
margin:0 calc(-1 * var(--magritte-ui-modal-hor-padding-mul) * 24px);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
.magritte-modal-media___UqHGM_11-0-
|
|
37
|
+
.magritte-modal-media___UqHGM_11-0-18{
|
|
38
38
|
display:flex;
|
|
39
39
|
position:relative;
|
|
40
40
|
overflow:hidden;
|
|
@@ -44,35 +44,35 @@
|
|
|
44
44
|
background-position:center;
|
|
45
45
|
background-repeat:no-repeat;
|
|
46
46
|
}
|
|
47
|
-
.magritte-modal-media___UqHGM_11-0-
|
|
47
|
+
.magritte-modal-media___UqHGM_11-0-18 img{
|
|
48
48
|
max-width:100%;
|
|
49
49
|
max-height:100%;
|
|
50
50
|
}
|
|
51
|
-
.magritte-fixed-height___wyJ7-_11-0-
|
|
51
|
+
.magritte-fixed-height___wyJ7-_11-0-18{
|
|
52
52
|
aspect-ratio:auto;
|
|
53
53
|
height:var(--height, auto);
|
|
54
54
|
}
|
|
55
|
-
.magritte-contain___3QD0Z_11-0-
|
|
55
|
+
.magritte-contain___3QD0Z_11-0-18{
|
|
56
56
|
background-size:contain;
|
|
57
57
|
}
|
|
58
|
-
.magritte-contain___3QD0Z_11-0-
|
|
58
|
+
.magritte-contain___3QD0Z_11-0-18 img{
|
|
59
59
|
object-fit:contain;
|
|
60
60
|
}
|
|
61
|
-
.magritte-cover___nry9O_11-0-
|
|
61
|
+
.magritte-cover___nry9O_11-0-18{
|
|
62
62
|
background-size:cover;
|
|
63
63
|
}
|
|
64
|
-
.magritte-cover___nry9O_11-0-
|
|
64
|
+
.magritte-cover___nry9O_11-0-18 img{
|
|
65
65
|
object-fit:cover;
|
|
66
66
|
}
|
|
67
67
|
@supports selector(:has(*)){
|
|
68
|
-
.magritte-modal-media___UqHGM_11-0-
|
|
68
|
+
.magritte-modal-media___UqHGM_11-0-18{
|
|
69
69
|
margin:0 calc(var(--magritte-ui-modal-hor-padding-mul) * -12px);
|
|
70
70
|
}
|
|
71
|
-
.magritte-content-overlay-top___6snWk_11-0-
|
|
71
|
+
.magritte-content-overlay-top___6snWk_11-0-18 + .magritte-grow-limiter___GmpBj_11-0-18 .magritte-modal-media___UqHGM_11-0-18:first-child{
|
|
72
72
|
margin-top:0;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
.magritte-modal-overlay___WwfCg_11-0-
|
|
75
|
+
.magritte-modal-overlay___WwfCg_11-0-18{
|
|
76
76
|
position:fixed;
|
|
77
77
|
top:0;
|
|
78
78
|
right:0;
|
|
@@ -82,25 +82,25 @@
|
|
|
82
82
|
align-items:center;
|
|
83
83
|
justify-content:center;
|
|
84
84
|
}
|
|
85
|
-
.magritte-modal-overlay-with-background___DDxJn_11-0-
|
|
85
|
+
.magritte-modal-overlay-with-background___DDxJn_11-0-18{
|
|
86
86
|
background-color:var(--magritte-color-background-overlay-v25-0-0);
|
|
87
87
|
transition-property:opacity, transform;
|
|
88
88
|
user-select:text;
|
|
89
89
|
z-index:1;
|
|
90
90
|
}
|
|
91
|
-
.magritte-modal-overlay___WwfCg_11-0-
|
|
91
|
+
.magritte-modal-overlay___WwfCg_11-0-18:not(.magritte-modal-overlay-with-background___DDxJn_11-0-18){
|
|
92
92
|
pointer-events:none;
|
|
93
93
|
}
|
|
94
|
-
.magritte-modal-overlay___WwfCg_11-0-
|
|
94
|
+
.magritte-modal-overlay___WwfCg_11-0-18:not(.magritte-modal-overlay-with-background___DDxJn_11-0-18) .magritte-modal___C4o5U_11-0-18{
|
|
95
95
|
pointer-events:auto;
|
|
96
96
|
}
|
|
97
|
-
.magritte-modal-overlay-left___agPyC_11-0-
|
|
97
|
+
.magritte-modal-overlay-left___agPyC_11-0-18{
|
|
98
98
|
justify-content:flex-start;
|
|
99
99
|
}
|
|
100
|
-
.magritte-modal-overlay-right___-XDAx_11-0-
|
|
100
|
+
.magritte-modal-overlay-right___-XDAx_11-0-18{
|
|
101
101
|
justify-content:flex-end;
|
|
102
102
|
}
|
|
103
|
-
.magritte-modal___C4o5U_11-0-
|
|
103
|
+
.magritte-modal___C4o5U_11-0-18{
|
|
104
104
|
display:flex;
|
|
105
105
|
box-sizing:border-box;
|
|
106
106
|
margin:0 12px;
|
|
@@ -122,25 +122,25 @@
|
|
|
122
122
|
--magritte-ui-modal-vert-padding-mul:1;
|
|
123
123
|
--magritte-ui-snackbar-container-overflow-override:visible;
|
|
124
124
|
}
|
|
125
|
-
.magritte-modal___C4o5U_11-0-
|
|
125
|
+
.magritte-modal___C4o5U_11-0-18.magritte-size-small___cI-Ql_11-0-18{
|
|
126
126
|
width:480px;
|
|
127
127
|
}
|
|
128
|
-
.magritte-modal___C4o5U_11-0-
|
|
128
|
+
.magritte-modal___C4o5U_11-0-18.magritte-size-medium___jnqfu_11-0-18{
|
|
129
129
|
width:620px;
|
|
130
130
|
}
|
|
131
|
-
.magritte-no-vertical-paddings___dxyot_11-0-
|
|
131
|
+
.magritte-no-vertical-paddings___dxyot_11-0-18{
|
|
132
132
|
--magritte-ui-modal-vert-padding-mul:0;
|
|
133
133
|
}
|
|
134
|
-
.magritte-no-horizontal-paddings___Q-i-5_11-0-
|
|
134
|
+
.magritte-no-horizontal-paddings___Q-i-5_11-0-18{
|
|
135
135
|
--magritte-ui-modal-hor-padding-mul:0;
|
|
136
136
|
}
|
|
137
|
-
.magritte-modal-full-height___Aew5F_11-0-
|
|
137
|
+
.magritte-modal-full-height___Aew5F_11-0-18{
|
|
138
138
|
height:100%;
|
|
139
139
|
}
|
|
140
|
-
.magritte-modal-with-border___KSnhf_11-0-
|
|
140
|
+
.magritte-modal-with-border___KSnhf_11-0-18{
|
|
141
141
|
outline:1px solid var(--magritte-color-stroke-neutral-v25-0-0);
|
|
142
142
|
}
|
|
143
|
-
.magritte-modal-content-wrapper___VzoTN_11-0-
|
|
143
|
+
.magritte-modal-content-wrapper___VzoTN_11-0-18{
|
|
144
144
|
position:relative;
|
|
145
145
|
display:flex;
|
|
146
146
|
flex-direction:column;
|
|
@@ -148,188 +148,188 @@
|
|
|
148
148
|
flex:1 1;
|
|
149
149
|
padding:24px 0 0;
|
|
150
150
|
}
|
|
151
|
-
.magritte-no-horizontal-paddings___Q-i-5_11-0-
|
|
151
|
+
.magritte-no-horizontal-paddings___Q-i-5_11-0-18 .magritte-modal-content-wrapper___VzoTN_11-0-18{
|
|
152
152
|
padding-right:0;
|
|
153
153
|
padding-left:0;
|
|
154
154
|
}
|
|
155
|
-
.magritte-no-vertical-paddings___dxyot_11-0-
|
|
155
|
+
.magritte-no-vertical-paddings___dxyot_11-0-18 .magritte-modal-content-wrapper___VzoTN_11-0-18{
|
|
156
156
|
padding-top:0;
|
|
157
157
|
padding-bottom:0;
|
|
158
158
|
}
|
|
159
|
-
.magritte-modal-footer___Ha-sZ_11-0-
|
|
159
|
+
.magritte-modal-footer___Ha-sZ_11-0-18{
|
|
160
160
|
background-color:var(--magritte-color-component-modal-background-content-v25-0-0);
|
|
161
161
|
z-index:1;
|
|
162
162
|
--magritte-ui-container-background-color-override:var(--magritte-color-component-modal-background-content-v25-0-0);
|
|
163
163
|
}
|
|
164
|
-
.magritte-modal-footer___Ha-sZ_11-0-
|
|
164
|
+
.magritte-modal-footer___Ha-sZ_11-0-18.magritte-modal-footer-empty___tmH-x_11-0-18{
|
|
165
165
|
flex:0 0 calc(var(--magritte-ui-modal-vert-padding-mul) * 24px);
|
|
166
166
|
}
|
|
167
|
-
.magritte-animation-timeout___G4Hl1_11-0-
|
|
167
|
+
.magritte-animation-timeout___G4Hl1_11-0-18{
|
|
168
168
|
--enter-animation-duration:0;
|
|
169
169
|
--exit-animation-duration:0;
|
|
170
170
|
}
|
|
171
171
|
@media (prefers-reduced-motion: no-preference){
|
|
172
|
-
.magritte-animation-timeout___G4Hl1_11-0-
|
|
172
|
+
.magritte-animation-timeout___G4Hl1_11-0-18{
|
|
173
173
|
--enter-animation-duration:var(--magritte-semantic-animation-ease-in-out-300-duration-v25-0-0);
|
|
174
174
|
--exit-animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v25-0-0);
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
|
-
.magritte-animation-enter-center___sq8j7_11-0-
|
|
177
|
+
.magritte-animation-enter-center___sq8j7_11-0-18.magritte-modal-overlay-with-background___DDxJn_11-0-18{
|
|
178
178
|
opacity:0;
|
|
179
179
|
}
|
|
180
|
-
.magritte-animation-enter-center___sq8j7_11-0-
|
|
180
|
+
.magritte-animation-enter-center___sq8j7_11-0-18 .magritte-modal___C4o5U_11-0-18{
|
|
181
181
|
opacity:0;
|
|
182
182
|
}
|
|
183
|
-
.magritte-animation-enter-center-active___ORYEh_11-0-
|
|
183
|
+
.magritte-animation-enter-center-active___ORYEh_11-0-18{
|
|
184
184
|
--enter-animation-duration:0;
|
|
185
185
|
--exit-animation-duration:0;
|
|
186
186
|
}
|
|
187
187
|
@media (prefers-reduced-motion: no-preference){
|
|
188
|
-
.magritte-animation-enter-center-active___ORYEh_11-0-
|
|
188
|
+
.magritte-animation-enter-center-active___ORYEh_11-0-18{
|
|
189
189
|
--enter-animation-duration:var(--magritte-semantic-animation-ease-in-out-300-duration-v25-0-0);
|
|
190
190
|
--exit-animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v25-0-0);
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
|
-
.magritte-animation-enter-center-active___ORYEh_11-0-
|
|
194
|
-
.magritte-animation-enter-center-active___ORYEh_11-0-
|
|
193
|
+
.magritte-animation-enter-center-active___ORYEh_11-0-18 .magritte-modal___C4o5U_11-0-18,
|
|
194
|
+
.magritte-animation-enter-center-active___ORYEh_11-0-18.magritte-modal-overlay-with-background___DDxJn_11-0-18{
|
|
195
195
|
opacity:1;
|
|
196
196
|
transition-duration:var(--enter-animation-duration);
|
|
197
197
|
transition-timing-function:var(--magritte-semantic-animation-ease-in-out-300-timing-function-v25-0-0);
|
|
198
198
|
}
|
|
199
|
-
.magritte-animation-exit-center___lLCX1_11-0-
|
|
199
|
+
.magritte-animation-exit-center___lLCX1_11-0-18.magritte-modal-overlay-with-background___DDxJn_11-0-18{
|
|
200
200
|
opacity:1;
|
|
201
201
|
}
|
|
202
|
-
.magritte-animation-exit-center___lLCX1_11-0-
|
|
202
|
+
.magritte-animation-exit-center___lLCX1_11-0-18 .magritte-modal___C4o5U_11-0-18{
|
|
203
203
|
opacity:1;
|
|
204
204
|
}
|
|
205
|
-
.magritte-animation-exit-center-active___Ik2Yl_11-0-
|
|
205
|
+
.magritte-animation-exit-center-active___Ik2Yl_11-0-18{
|
|
206
206
|
--enter-animation-duration:0;
|
|
207
207
|
--exit-animation-duration:0;
|
|
208
208
|
}
|
|
209
209
|
@media (prefers-reduced-motion: no-preference){
|
|
210
|
-
.magritte-animation-exit-center-active___Ik2Yl_11-0-
|
|
210
|
+
.magritte-animation-exit-center-active___Ik2Yl_11-0-18{
|
|
211
211
|
--enter-animation-duration:var(--magritte-semantic-animation-ease-in-out-300-duration-v25-0-0);
|
|
212
212
|
--exit-animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v25-0-0);
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
|
-
.magritte-animation-exit-center-active___Ik2Yl_11-0-
|
|
215
|
+
.magritte-animation-exit-center-active___Ik2Yl_11-0-18.magritte-modal-overlay-with-background___DDxJn_11-0-18{
|
|
216
216
|
opacity:0;
|
|
217
217
|
}
|
|
218
|
-
.magritte-animation-exit-center-active___Ik2Yl_11-0-
|
|
218
|
+
.magritte-animation-exit-center-active___Ik2Yl_11-0-18 .magritte-modal___C4o5U_11-0-18{
|
|
219
219
|
opacity:0;
|
|
220
220
|
}
|
|
221
|
-
.magritte-animation-exit-center-active___Ik2Yl_11-0-
|
|
222
|
-
.magritte-animation-exit-center-active___Ik2Yl_11-0-
|
|
221
|
+
.magritte-animation-exit-center-active___Ik2Yl_11-0-18 .magritte-modal___C4o5U_11-0-18,
|
|
222
|
+
.magritte-animation-exit-center-active___Ik2Yl_11-0-18.magritte-modal-overlay-with-background___DDxJn_11-0-18{
|
|
223
223
|
transition-duration:var(--exit-animation-duration);
|
|
224
224
|
transition-timing-function:var(--magritte-semantic-animation-ease-in-out-200-timing-function-v25-0-0);
|
|
225
225
|
}
|
|
226
|
-
.magritte-animation-enter-left___jJDlv_11-0-
|
|
226
|
+
.magritte-animation-enter-left___jJDlv_11-0-18.magritte-modal-overlay-with-background___DDxJn_11-0-18{
|
|
227
227
|
opacity:0;
|
|
228
228
|
}
|
|
229
|
-
.magritte-animation-enter-left___jJDlv_11-0-
|
|
229
|
+
.magritte-animation-enter-left___jJDlv_11-0-18 .magritte-modal___C4o5U_11-0-18{
|
|
230
230
|
opacity:0;
|
|
231
231
|
transform:translateX(-100%);
|
|
232
232
|
}
|
|
233
|
-
.magritte-animation-enter-left-active___-kFij_11-0-
|
|
233
|
+
.magritte-animation-enter-left-active___-kFij_11-0-18{
|
|
234
234
|
--enter-animation-duration:0;
|
|
235
235
|
--exit-animation-duration:0;
|
|
236
236
|
}
|
|
237
237
|
@media (prefers-reduced-motion: no-preference){
|
|
238
|
-
.magritte-animation-enter-left-active___-kFij_11-0-
|
|
238
|
+
.magritte-animation-enter-left-active___-kFij_11-0-18{
|
|
239
239
|
--enter-animation-duration:var(--magritte-semantic-animation-ease-in-out-300-duration-v25-0-0);
|
|
240
240
|
--exit-animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v25-0-0);
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
|
-
.magritte-animation-enter-left-active___-kFij_11-0-
|
|
244
|
-
.magritte-animation-enter-left-active___-kFij_11-0-
|
|
243
|
+
.magritte-animation-enter-left-active___-kFij_11-0-18 .magritte-modal___C4o5U_11-0-18,
|
|
244
|
+
.magritte-animation-enter-left-active___-kFij_11-0-18.magritte-modal-overlay-with-background___DDxJn_11-0-18{
|
|
245
245
|
opacity:1;
|
|
246
246
|
transition-duration:var(--enter-animation-duration);
|
|
247
247
|
transition-timing-function:var(--magritte-semantic-animation-ease-in-out-300-timing-function-v25-0-0);
|
|
248
248
|
transform:translateX(0);
|
|
249
249
|
}
|
|
250
|
-
.magritte-animation-exit-left___G2Plq_11-0-
|
|
250
|
+
.magritte-animation-exit-left___G2Plq_11-0-18.magritte-modal-overlay-with-background___DDxJn_11-0-18{
|
|
251
251
|
opacity:1;
|
|
252
252
|
}
|
|
253
|
-
.magritte-animation-exit-left___G2Plq_11-0-
|
|
253
|
+
.magritte-animation-exit-left___G2Plq_11-0-18 .magritte-modal___C4o5U_11-0-18{
|
|
254
254
|
opacity:1;
|
|
255
255
|
transform:translateX(0);
|
|
256
256
|
}
|
|
257
|
-
.magritte-animation-exit-left-active___XW2K4_11-0-
|
|
257
|
+
.magritte-animation-exit-left-active___XW2K4_11-0-18{
|
|
258
258
|
--enter-animation-duration:0;
|
|
259
259
|
--exit-animation-duration:0;
|
|
260
260
|
}
|
|
261
261
|
@media (prefers-reduced-motion: no-preference){
|
|
262
|
-
.magritte-animation-exit-left-active___XW2K4_11-0-
|
|
262
|
+
.magritte-animation-exit-left-active___XW2K4_11-0-18{
|
|
263
263
|
--enter-animation-duration:var(--magritte-semantic-animation-ease-in-out-300-duration-v25-0-0);
|
|
264
264
|
--exit-animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v25-0-0);
|
|
265
265
|
}
|
|
266
266
|
}
|
|
267
|
-
.magritte-animation-exit-left-active___XW2K4_11-0-
|
|
267
|
+
.magritte-animation-exit-left-active___XW2K4_11-0-18.magritte-modal-overlay-with-background___DDxJn_11-0-18{
|
|
268
268
|
opacity:0;
|
|
269
269
|
}
|
|
270
|
-
.magritte-animation-exit-left-active___XW2K4_11-0-
|
|
270
|
+
.magritte-animation-exit-left-active___XW2K4_11-0-18 .magritte-modal___C4o5U_11-0-18{
|
|
271
271
|
opacity:0;
|
|
272
272
|
transform:translateX(-100%);
|
|
273
273
|
}
|
|
274
|
-
.magritte-animation-exit-left-active___XW2K4_11-0-
|
|
275
|
-
.magritte-animation-exit-left-active___XW2K4_11-0-
|
|
274
|
+
.magritte-animation-exit-left-active___XW2K4_11-0-18 .magritte-modal___C4o5U_11-0-18,
|
|
275
|
+
.magritte-animation-exit-left-active___XW2K4_11-0-18.magritte-modal-overlay-with-background___DDxJn_11-0-18{
|
|
276
276
|
transition-duration:var(--exit-animation-duration);
|
|
277
277
|
transition-timing-function:var(--magritte-semantic-animation-ease-in-out-200-timing-function-v25-0-0);
|
|
278
278
|
}
|
|
279
|
-
.magritte-animation-enter-right___rrMS0_11-0-
|
|
279
|
+
.magritte-animation-enter-right___rrMS0_11-0-18.magritte-modal-overlay-with-background___DDxJn_11-0-18{
|
|
280
280
|
opacity:0;
|
|
281
281
|
}
|
|
282
|
-
.magritte-animation-enter-right___rrMS0_11-0-
|
|
282
|
+
.magritte-animation-enter-right___rrMS0_11-0-18 .magritte-modal___C4o5U_11-0-18{
|
|
283
283
|
opacity:0;
|
|
284
284
|
transform:translateX(100%);
|
|
285
285
|
}
|
|
286
|
-
.magritte-animation-enter-right-active___p7rg-_11-0-
|
|
286
|
+
.magritte-animation-enter-right-active___p7rg-_11-0-18{
|
|
287
287
|
--enter-animation-duration:0;
|
|
288
288
|
--exit-animation-duration:0;
|
|
289
289
|
}
|
|
290
290
|
@media (prefers-reduced-motion: no-preference){
|
|
291
|
-
.magritte-animation-enter-right-active___p7rg-_11-0-
|
|
291
|
+
.magritte-animation-enter-right-active___p7rg-_11-0-18{
|
|
292
292
|
--enter-animation-duration:var(--magritte-semantic-animation-ease-in-out-300-duration-v25-0-0);
|
|
293
293
|
--exit-animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v25-0-0);
|
|
294
294
|
}
|
|
295
295
|
}
|
|
296
|
-
.magritte-animation-enter-right-active___p7rg-_11-0-
|
|
297
|
-
.magritte-animation-enter-right-active___p7rg-_11-0-
|
|
296
|
+
.magritte-animation-enter-right-active___p7rg-_11-0-18 .magritte-modal___C4o5U_11-0-18,
|
|
297
|
+
.magritte-animation-enter-right-active___p7rg-_11-0-18.magritte-modal-overlay-with-background___DDxJn_11-0-18{
|
|
298
298
|
opacity:1;
|
|
299
299
|
transition-duration:var(--enter-animation-duration);
|
|
300
300
|
transition-timing-function:var(--magritte-semantic-animation-ease-in-out-300-timing-function-v25-0-0);
|
|
301
301
|
transform:translateX(0);
|
|
302
302
|
}
|
|
303
|
-
.magritte-animation-exit-right___f3qIC_11-0-
|
|
303
|
+
.magritte-animation-exit-right___f3qIC_11-0-18.magritte-modal-overlay-with-background___DDxJn_11-0-18{
|
|
304
304
|
opacity:1;
|
|
305
305
|
}
|
|
306
|
-
.magritte-animation-exit-right___f3qIC_11-0-
|
|
306
|
+
.magritte-animation-exit-right___f3qIC_11-0-18 .magritte-modal___C4o5U_11-0-18{
|
|
307
307
|
opacity:1;
|
|
308
308
|
transform:translateX(0);
|
|
309
309
|
}
|
|
310
|
-
.magritte-animation-exit-right-active___-sG1k_11-0-
|
|
310
|
+
.magritte-animation-exit-right-active___-sG1k_11-0-18{
|
|
311
311
|
--enter-animation-duration:0;
|
|
312
312
|
--exit-animation-duration:0;
|
|
313
313
|
}
|
|
314
314
|
@media (prefers-reduced-motion: no-preference){
|
|
315
|
-
.magritte-animation-exit-right-active___-sG1k_11-0-
|
|
315
|
+
.magritte-animation-exit-right-active___-sG1k_11-0-18{
|
|
316
316
|
--enter-animation-duration:var(--magritte-semantic-animation-ease-in-out-300-duration-v25-0-0);
|
|
317
317
|
--exit-animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v25-0-0);
|
|
318
318
|
}
|
|
319
319
|
}
|
|
320
|
-
.magritte-animation-exit-right-active___-sG1k_11-0-
|
|
320
|
+
.magritte-animation-exit-right-active___-sG1k_11-0-18.magritte-modal-overlay-with-background___DDxJn_11-0-18{
|
|
321
321
|
opacity:0;
|
|
322
322
|
}
|
|
323
|
-
.magritte-animation-exit-right-active___-sG1k_11-0-
|
|
323
|
+
.magritte-animation-exit-right-active___-sG1k_11-0-18 .magritte-modal___C4o5U_11-0-18{
|
|
324
324
|
opacity:0;
|
|
325
325
|
transform:translateX(100%);
|
|
326
326
|
}
|
|
327
|
-
.magritte-animation-exit-right-active___-sG1k_11-0-
|
|
328
|
-
.magritte-animation-exit-right-active___-sG1k_11-0-
|
|
327
|
+
.magritte-animation-exit-right-active___-sG1k_11-0-18 .magritte-modal___C4o5U_11-0-18,
|
|
328
|
+
.magritte-animation-exit-right-active___-sG1k_11-0-18.magritte-modal-overlay-with-background___DDxJn_11-0-18{
|
|
329
329
|
transition-duration:var(--exit-animation-duration);
|
|
330
330
|
transition-timing-function:var(--magritte-semantic-animation-ease-in-out-200-timing-function-v25-0-0);
|
|
331
331
|
}
|
|
332
|
-
.magritte-tree-selector-container___4cdf5_11-0-
|
|
332
|
+
.magritte-tree-selector-container___4cdf5_11-0-18{
|
|
333
333
|
height:100%;
|
|
334
334
|
overflow:hidden;
|
|
335
335
|
max-width:calc(100% - 24px);
|
|
@@ -339,16 +339,16 @@
|
|
|
339
339
|
--magritte-ui-scrollbar-offset-right:-24px;
|
|
340
340
|
--magritte-ui-scrollbar-offset-top:0;
|
|
341
341
|
}
|
|
342
|
-
.magritte-no-horizontal-paddings___Q-i-5_11-0-
|
|
342
|
+
.magritte-no-horizontal-paddings___Q-i-5_11-0-18 .magritte-tree-selector-container___4cdf5_11-0-18{
|
|
343
343
|
margin:0;
|
|
344
344
|
padding:0;
|
|
345
345
|
--magritte-ui-scrollbar-offset-right:0;
|
|
346
346
|
}
|
|
347
|
-
.magritte-grow-limiter___GmpBj_11-0-
|
|
347
|
+
.magritte-grow-limiter___GmpBj_11-0-18{
|
|
348
348
|
flex:1 0;
|
|
349
349
|
--magritte-ui-scrollbar-offset-top:0;
|
|
350
350
|
}
|
|
351
|
-
.magritte-modal-scroll-container___hOCdh_11-0-
|
|
351
|
+
.magritte-modal-scroll-container___hOCdh_11-0-18{
|
|
352
352
|
display:flex;
|
|
353
353
|
flex-direction:column;
|
|
354
354
|
flex:1 1;
|
|
@@ -359,23 +359,23 @@
|
|
|
359
359
|
padding:0 calc(var(--magritte-ui-modal-hor-padding-mul) * 24px);
|
|
360
360
|
margin:0;
|
|
361
361
|
}
|
|
362
|
-
.magritte-modal-scroll-container___hOCdh_11-0-
|
|
362
|
+
.magritte-modal-scroll-container___hOCdh_11-0-18::-webkit-scrollbar{
|
|
363
363
|
display:none;
|
|
364
364
|
}
|
|
365
|
-
.magritte-content-overlay-top___6snWk_11-0-
|
|
365
|
+
.magritte-content-overlay-top___6snWk_11-0-18{
|
|
366
366
|
position:absolute;
|
|
367
367
|
height:0;
|
|
368
368
|
left:calc(var(--magritte-ui-modal-hor-padding-mul) * 24px);
|
|
369
369
|
right:calc(var(--magritte-ui-modal-hor-padding-mul) * 24px);
|
|
370
370
|
}
|
|
371
|
-
.magritte-content-overlay-top___6snWk_11-0-
|
|
372
|
-
.magritte-content-overlay-top___6snWk_11-0-
|
|
371
|
+
.magritte-content-overlay-top___6snWk_11-0-18.magritte-nav-bar___CL7d-_11-0-18,
|
|
372
|
+
.magritte-content-overlay-top___6snWk_11-0-18.magritte-header___pufwA_11-0-18{
|
|
373
373
|
bottom:0;
|
|
374
374
|
}
|
|
375
|
-
.magritte-content-overlay-top___6snWk_11-0-
|
|
375
|
+
.magritte-content-overlay-top___6snWk_11-0-18.magritte-static___3B6cn_11-0-18{
|
|
376
376
|
top:0;
|
|
377
377
|
}
|
|
378
|
-
.magritte-content-overlay-bottom___bDuPC_11-0-
|
|
378
|
+
.magritte-content-overlay-bottom___bDuPC_11-0-18{
|
|
379
379
|
position:absolute;
|
|
380
380
|
left:calc(var(--magritte-ui-modal-hor-padding-mul) * 24px);
|
|
381
381
|
right:calc(var(--magritte-ui-modal-hor-padding-mul) * 24px);
|
|
@@ -383,10 +383,10 @@
|
|
|
383
383
|
bottom:0;
|
|
384
384
|
}
|
|
385
385
|
@supports selector(:has(*)){
|
|
386
|
-
.magritte-modal-content-wrapper___VzoTN_11-0-
|
|
386
|
+
.magritte-modal-content-wrapper___VzoTN_11-0-18:has(.magritte-sticky-header___TPafy_11-0-18){
|
|
387
387
|
padding:0;
|
|
388
388
|
}
|
|
389
|
-
.magritte-modal-content-wrapper___VzoTN_11-0-
|
|
389
|
+
.magritte-modal-content-wrapper___VzoTN_11-0-18:not(:has(.magritte-sticky-header___TPafy_11-0-18)):has(.magritte-grow-limiter___GmpBj_11-0-18 > .magritte-modal-media___UqHGM_11-0-18:first-child){
|
|
390
390
|
padding-top:12px;
|
|
391
391
|
}
|
|
392
392
|
}
|
package/index.js
CHANGED
|
@@ -17,9 +17,10 @@ import './internal/ModalContent.js';
|
|
|
17
17
|
import './internal/isTreeSelectorChild.js';
|
|
18
18
|
import '@hh.ru/magritte-ui-tree-selector';
|
|
19
19
|
import '@hh.ru/magritte-ui-textarea';
|
|
20
|
-
import './modal-
|
|
20
|
+
import './modal-D7proB4O.js';
|
|
21
21
|
import './internal/ModalInner.js';
|
|
22
22
|
import '@hh.ru/magritte-ui-action-bar';
|
|
23
|
+
import './actionBarDefaults.js';
|
|
23
24
|
import './internal/ModalBody.js';
|
|
24
25
|
import '@hh.ru/magritte-ui-content-overlay';
|
|
25
26
|
import './internal/ModalSlotsContext.js';
|
|
@@ -38,5 +39,6 @@ import './internal/usePageHeaderScrollAnimation.js';
|
|
|
38
39
|
import './public/ModalMedia.js';
|
|
39
40
|
import '@hh.ru/magritte-ui-theme-wrapper';
|
|
40
41
|
import '@hh.ru/magritte-ui-layout';
|
|
42
|
+
import './withImageDefaults.js';
|
|
41
43
|
import '@hh.ru/magritte-ui-title';
|
|
42
44
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/internal/ModalBody.js
CHANGED
|
@@ -7,7 +7,7 @@ import { useContentOverlay, ContentOverlayRoot } from '@hh.ru/magritte-ui-conten
|
|
|
7
7
|
import { useRegisterTopOverlayCandidate, TOP_OVERLAY_PRIORITY, useResolvedTopOverlayElement } from './ModalSlotsContext.js';
|
|
8
8
|
import { ModalStickyHeader } from './ModalStickyHeader.js';
|
|
9
9
|
import { useScrollbar, Scrollbar } from '@hh.ru/magritte-ui-scrollbar';
|
|
10
|
-
import { s as styles } from '../modal-
|
|
10
|
+
import { s as styles } from '../modal-D7proB4O.js';
|
|
11
11
|
import '@hh.ru/magritte-internal-slot-registry';
|
|
12
12
|
import '@hh.ru/magritte-ui-nav-bar';
|
|
13
13
|
|
package/internal/ModalContent.js
CHANGED
|
@@ -2,7 +2,7 @@ import './../index.css';
|
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { isTreeSelectorChild } from './isTreeSelectorChild.js';
|
|
4
4
|
import { TextAreaGrowLimiter } from '@hh.ru/magritte-ui-textarea';
|
|
5
|
-
import { s as styles } from '../modal-
|
|
5
|
+
import { s as styles } from '../modal-D7proB4O.js';
|
|
6
6
|
import 'react';
|
|
7
7
|
import '@hh.ru/magritte-ui-tree-selector';
|
|
8
8
|
|
package/internal/ModalInner.js
CHANGED
|
@@ -4,9 +4,10 @@ import { useState, useMemo } from 'react';
|
|
|
4
4
|
import classnames from 'classnames';
|
|
5
5
|
import { useAccessibleRegionProps } from '@hh.ru/magritte-internal-accessible-region';
|
|
6
6
|
import { ActionBarDefaultPropsContext } from '@hh.ru/magritte-ui-action-bar';
|
|
7
|
+
import { MODAL_ACTION_BAR_DEFAULTS } from '../actionBarDefaults.js';
|
|
7
8
|
import { ModalBody } from './ModalBody.js';
|
|
8
9
|
import { NavBar } from '@hh.ru/magritte-ui-nav-bar';
|
|
9
|
-
import { s as styles } from '../modal-
|
|
10
|
+
import { s as styles } from '../modal-D7proB4O.js';
|
|
10
11
|
import '@hh.ru/magritte-common-use-multiple-refs';
|
|
11
12
|
import '@hh.ru/magritte-ui-content-overlay';
|
|
12
13
|
import './ModalSlotsContext.js';
|
|
@@ -14,7 +15,7 @@ import '@hh.ru/magritte-internal-slot-registry';
|
|
|
14
15
|
import './ModalStickyHeader.js';
|
|
15
16
|
import '@hh.ru/magritte-ui-scrollbar';
|
|
16
17
|
|
|
17
|
-
const ACTION_BAR_DEFAULT_PROPS =
|
|
18
|
+
const ACTION_BAR_DEFAULT_PROPS = MODAL_ACTION_BAR_DEFAULTS;
|
|
18
19
|
/**
|
|
19
20
|
* Внутренний контейнер модала — сам `role="dialog"`-узел. Рендерится **под** `AccessibleRegionProvider`
|
|
20
21
|
* и `ModalSlotsProvider`, что и делает его отдельным компонентом:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalInner.js","sources":["src/internal/ModalInner.tsx"],"sourcesContent":["import { type FC, type HTMLAttributes, type ReactNode, type Ref, useMemo, useState } from 'react';\nimport classnames from 'classnames';\n\nimport { useAccessibleRegionProps, type ExplicitRegionProps } from '@hh.ru/magritte-internal-accessible-region';\nimport { ActionBarDefaultPropsContext, type ActionBarProps } from '@hh.ru/magritte-ui-action-bar';\nimport { ModalBody } from '@hh.ru/magritte-ui-modal/internal/ModalBody';\nimport { type ModalProps } from '@hh.ru/magritte-ui-modal/public/types';\nimport { NavBar } from '@hh.ru/magritte-ui-nav-bar';\n\nimport styles from './modal.less';\n\nconst ACTION_BAR_DEFAULT_PROPS: Partial<ActionBarProps> =
|
|
1
|
+
{"version":3,"file":"ModalInner.js","sources":["src/internal/ModalInner.tsx"],"sourcesContent":["import { type FC, type HTMLAttributes, type ReactNode, type Ref, useMemo, useState } from 'react';\nimport classnames from 'classnames';\n\nimport { useAccessibleRegionProps, type ExplicitRegionProps } from '@hh.ru/magritte-internal-accessible-region';\nimport { ActionBarDefaultPropsContext, type ActionBarProps } from '@hh.ru/magritte-ui-action-bar';\nimport { MODAL_ACTION_BAR_DEFAULTS } from '@hh.ru/magritte-ui-modal/actionBarDefaults';\nimport { ModalBody } from '@hh.ru/magritte-ui-modal/internal/ModalBody';\nimport { type ModalProps } from '@hh.ru/magritte-ui-modal/public/types';\nimport { NavBar } from '@hh.ru/magritte-ui-nav-bar';\n\nimport styles from './modal.less';\n\nconst ACTION_BAR_DEFAULT_PROPS: Partial<ActionBarProps> = MODAL_ACTION_BAR_DEFAULTS;\n\nexport interface ModalInnerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {\n explicitAria: ExplicitRegionProps;\n ariaModal: boolean | undefined;\n refCallback: Ref<HTMLDivElement>;\n size: NonNullable<ModalProps['size']>;\n height: ModalProps['height'];\n minHeight: ModalProps['minHeight'];\n disableVerticalPaddings: boolean;\n disableHorizontalPaddings: boolean;\n showOverlay: boolean;\n header: ReactNode;\n footer: ReactNode;\n children: ReactNode;\n}\n\n/**\n * Внутренний контейнер модала — сам `role=\"dialog\"`-узел. Рендерится **под** `AccessibleRegionProvider`\n * и `ModalSlotsProvider`, что и делает его отдельным компонентом:\n * `useAccessibleRegionProps` видит заголовок/подзаголовок, зарегистрированные потомками\n * (`NavBar.TitleContainer` в проп `header`), и выставляет `aria-labelledby` / `aria-describedby`\n * (явные `aria-*` пропы при этом всё перекрывают).\n *\n * Футер приходит пропом и рендерится здесь — вне скролл-зоны, прижатым к низу. От его наличия зависят\n * классы паддингов и нижний divider контента (его прячем, когда у `ActionBar` футера есть progress bar).\n */\nexport const ModalInner: FC<ModalInnerProps> = ({\n explicitAria,\n ariaModal,\n refCallback,\n size,\n height,\n minHeight,\n disableVerticalPaddings,\n disableHorizontalPaddings,\n showOverlay,\n header,\n footer,\n children,\n ...rest\n}) => {\n const aria = useAccessibleRegionProps(explicitAria);\n\n const [scrollContainer, setScrollContainer] = useState<HTMLElement | null>(null);\n const actionBarDefaultProps = useMemo(() => ({ ...ACTION_BAR_DEFAULT_PROPS, scrollContainer }), [scrollContainer]);\n\n return (\n <div\n {...rest}\n {...aria}\n aria-modal={ariaModal}\n role=\"dialog\"\n ref={refCallback}\n tabIndex={-1}\n className={classnames(styles.modal, {\n [styles.sizeSmall]: size === 'small',\n [styles.sizeMedium]: size === 'medium',\n [styles.modalFullHeight]: height === 'full-screen',\n [styles.noVerticalPaddings]: disableVerticalPaddings,\n [styles.noHorizontalPaddings]: disableHorizontalPaddings,\n [styles.modalWithBorder]: !showOverlay,\n })}\n style={{\n height: typeof height === 'number' ? `${height}px` : undefined,\n minHeight: typeof minHeight === 'number' ? `min(calc(100vh - 12px * 2), ${minHeight}px)` : undefined,\n }}\n >\n <NavBar.TriggerProvider>\n <ModalBody header={header} scrollContainerRef={setScrollContainer}>\n {children}\n </ModalBody>\n </NavBar.TriggerProvider>\n {footer ? (\n <div className={styles.modalFooter} data-qa=\"modal-footer\">\n <ActionBarDefaultPropsContext props={actionBarDefaultProps}>{footer}</ActionBarDefaultPropsContext>\n </div>\n ) : (\n <div className={classnames(styles.modalFooter, styles.modalFooterEmpty)} />\n )}\n </div>\n );\n};\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;;;;;;;AAYA,MAAM,wBAAwB,GAA4B,yBAAyB,CAAC;AAiBpF;;;;;;;;;AASG;AACI,MAAM,UAAU,GAAwB,CAAC,EAC5C,YAAY,EACZ,SAAS,EACT,WAAW,EACX,IAAI,EACJ,MAAM,EACN,SAAS,EACT,uBAAuB,EACvB,yBAAyB,EACzB,WAAW,EACX,MAAM,EACN,MAAM,EACN,QAAQ,EACR,GAAG,IAAI,EACV,KAAI;AACD,IAAA,MAAM,IAAI,GAAG,wBAAwB,CAAC,YAAY,CAAC,CAAC;IAEpD,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,QAAQ,CAAqB,IAAI,CAAC,CAAC;IACjF,MAAM,qBAAqB,GAAG,OAAO,CAAC,OAAO,EAAE,GAAG,wBAAwB,EAAE,eAAe,EAAE,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC;AAEnH,IAAA,QACIA,IAAA,CAAA,KAAA,EAAA,EAAA,GACQ,IAAI,EAAA,GACJ,IAAI,EAAA,YAAA,EACI,SAAS,EACrB,IAAI,EAAC,QAAQ,EACb,GAAG,EAAE,WAAW,EAChB,QAAQ,EAAE,CAAC,CAAC,EACZ,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE;AAChC,YAAA,CAAC,MAAM,CAAC,SAAS,GAAG,IAAI,KAAK,OAAO;AACpC,YAAA,CAAC,MAAM,CAAC,UAAU,G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js';
|
|
6
6
|
import { NavBarDefaultPropsContext } from '@hh.ru/magritte-ui-nav-bar';
|
|
7
|
-
import { s as styles } from '../modal-
|
|
7
|
+
import { s as styles } from '../modal-D7proB4O.js';
|
|
8
8
|
import '@hh.ru/magritte-internal-slot-registry';
|
|
9
9
|
|
|
10
10
|
const NAV_BAR_ACTIONS_DEFAULT_PROPS = {
|
package/internal/constants.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './../index.css';
|
|
2
2
|
import coreTokens from '@hh.ru/magritte-design-tokens/core-tokens';
|
|
3
|
-
import { s as styles } from '../modal-
|
|
3
|
+
import { s as styles } from '../modal-D7proB4O.js';
|
|
4
4
|
|
|
5
5
|
/** Отступ сверху под page-header (px) — дефолт для `position=left|right` без оверлея. */
|
|
6
6
|
const DEFAULT_PAGE_HEADER_PADDING = 72;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import './index.css';
|
|
2
|
+
var styles = {"sticky-header":"magritte-sticky-header___TPafy_11-0-18","stickyHeader":"magritte-sticky-header___TPafy_11-0-18","sticky-header-inner":"magritte-sticky-header-inner___u5p8h_11-0-18","stickyHeaderInner":"magritte-sticky-header-inner___u5p8h_11-0-18","modal-media":"magritte-modal-media___UqHGM_11-0-18","modalMedia":"magritte-modal-media___UqHGM_11-0-18","fixed-height":"magritte-fixed-height___wyJ7-_11-0-18","fixedHeight":"magritte-fixed-height___wyJ7-_11-0-18","contain":"magritte-contain___3QD0Z_11-0-18","cover":"magritte-cover___nry9O_11-0-18","content-overlay-top":"magritte-content-overlay-top___6snWk_11-0-18","contentOverlayTop":"magritte-content-overlay-top___6snWk_11-0-18","grow-limiter":"magritte-grow-limiter___GmpBj_11-0-18","growLimiter":"magritte-grow-limiter___GmpBj_11-0-18","modal-overlay":"magritte-modal-overlay___WwfCg_11-0-18","modalOverlay":"magritte-modal-overlay___WwfCg_11-0-18","modal-overlay-with-background":"magritte-modal-overlay-with-background___DDxJn_11-0-18","modalOverlayWithBackground":"magritte-modal-overlay-with-background___DDxJn_11-0-18","modal":"magritte-modal___C4o5U_11-0-18","modal-overlay-left":"magritte-modal-overlay-left___agPyC_11-0-18","modalOverlayLeft":"magritte-modal-overlay-left___agPyC_11-0-18","modal-overlay-right":"magritte-modal-overlay-right___-XDAx_11-0-18","modalOverlayRight":"magritte-modal-overlay-right___-XDAx_11-0-18","size-small":"magritte-size-small___cI-Ql_11-0-18","sizeSmall":"magritte-size-small___cI-Ql_11-0-18","size-medium":"magritte-size-medium___jnqfu_11-0-18","sizeMedium":"magritte-size-medium___jnqfu_11-0-18","no-vertical-paddings":"magritte-no-vertical-paddings___dxyot_11-0-18","noVerticalPaddings":"magritte-no-vertical-paddings___dxyot_11-0-18","no-horizontal-paddings":"magritte-no-horizontal-paddings___Q-i-5_11-0-18","noHorizontalPaddings":"magritte-no-horizontal-paddings___Q-i-5_11-0-18","modal-full-height":"magritte-modal-full-height___Aew5F_11-0-18","modalFullHeight":"magritte-modal-full-height___Aew5F_11-0-18","modal-with-border":"magritte-modal-with-border___KSnhf_11-0-18","modalWithBorder":"magritte-modal-with-border___KSnhf_11-0-18","modal-content-wrapper":"magritte-modal-content-wrapper___VzoTN_11-0-18","modalContentWrapper":"magritte-modal-content-wrapper___VzoTN_11-0-18","modal-footer":"magritte-modal-footer___Ha-sZ_11-0-18","modalFooter":"magritte-modal-footer___Ha-sZ_11-0-18","modal-footer-empty":"magritte-modal-footer-empty___tmH-x_11-0-18","modalFooterEmpty":"magritte-modal-footer-empty___tmH-x_11-0-18","animation-timeout":"magritte-animation-timeout___G4Hl1_11-0-18","animationTimeout":"magritte-animation-timeout___G4Hl1_11-0-18","animation-enter-center":"magritte-animation-enter-center___sq8j7_11-0-18","animationEnterCenter":"magritte-animation-enter-center___sq8j7_11-0-18","animation-enter-center-active":"magritte-animation-enter-center-active___ORYEh_11-0-18","animationEnterCenterActive":"magritte-animation-enter-center-active___ORYEh_11-0-18","animation-exit-center":"magritte-animation-exit-center___lLCX1_11-0-18","animationExitCenter":"magritte-animation-exit-center___lLCX1_11-0-18","animation-exit-center-active":"magritte-animation-exit-center-active___Ik2Yl_11-0-18","animationExitCenterActive":"magritte-animation-exit-center-active___Ik2Yl_11-0-18","animation-enter-left":"magritte-animation-enter-left___jJDlv_11-0-18","animationEnterLeft":"magritte-animation-enter-left___jJDlv_11-0-18","animation-enter-left-active":"magritte-animation-enter-left-active___-kFij_11-0-18","animationEnterLeftActive":"magritte-animation-enter-left-active___-kFij_11-0-18","animation-exit-left":"magritte-animation-exit-left___G2Plq_11-0-18","animationExitLeft":"magritte-animation-exit-left___G2Plq_11-0-18","animation-exit-left-active":"magritte-animation-exit-left-active___XW2K4_11-0-18","animationExitLeftActive":"magritte-animation-exit-left-active___XW2K4_11-0-18","animation-enter-right":"magritte-animation-enter-right___rrMS0_11-0-18","animationEnterRight":"magritte-animation-enter-right___rrMS0_11-0-18","animation-enter-right-active":"magritte-animation-enter-right-active___p7rg-_11-0-18","animationEnterRightActive":"magritte-animation-enter-right-active___p7rg-_11-0-18","animation-exit-right":"magritte-animation-exit-right___f3qIC_11-0-18","animationExitRight":"magritte-animation-exit-right___f3qIC_11-0-18","animation-exit-right-active":"magritte-animation-exit-right-active___-sG1k_11-0-18","animationExitRightActive":"magritte-animation-exit-right-active___-sG1k_11-0-18","tree-selector-container":"magritte-tree-selector-container___4cdf5_11-0-18","treeSelectorContainer":"magritte-tree-selector-container___4cdf5_11-0-18","modal-scroll-container":"magritte-modal-scroll-container___hOCdh_11-0-18","modalScrollContainer":"magritte-modal-scroll-container___hOCdh_11-0-18","nav-bar":"magritte-nav-bar___CL7d-_11-0-18","navBar":"magritte-nav-bar___CL7d-_11-0-18","header":"magritte-header___pufwA_11-0-18","static":"magritte-static___3B6cn_11-0-18","content-overlay-bottom":"magritte-content-overlay-bottom___bDuPC_11-0-18","contentOverlayBottom":"magritte-content-overlay-bottom___bDuPC_11-0-18"};
|
|
3
|
+
|
|
4
|
+
export { styles as s };
|
|
5
|
+
//# sourceMappingURL=modal-D7proB4O.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modal-D7proB4O.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hh.ru/magritte-ui-modal",
|
|
3
|
-
"version": "11.0.
|
|
3
|
+
"version": "11.0.18",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"sideEffects": [
|
|
@@ -16,14 +16,18 @@
|
|
|
16
16
|
"ts-config": "yarn root:ts-config $(pwd)",
|
|
17
17
|
"ts-check": "yarn root:ts-check $(pwd)",
|
|
18
18
|
"test": "yarn root:test $(pwd)",
|
|
19
|
-
"watch": "yarn root:watch $(pwd)"
|
|
19
|
+
"watch": "yarn root:watch $(pwd)",
|
|
20
|
+
"figma-publish": "yarn root:figma-publish $(pwd)",
|
|
21
|
+
"figma-unpublish": "yarn root:figma-unpublish $(pwd)",
|
|
22
|
+
"figma-snapshot-check": "yarn root:figma-snapshot $(pwd)",
|
|
23
|
+
"figma-snapshot-update": "yarn root:figma-snapshot $(pwd) --update"
|
|
20
24
|
},
|
|
21
25
|
"dependencies": {
|
|
22
26
|
"@hh.ru/magritte-common-dom-storage": "1.0.9",
|
|
23
27
|
"@hh.ru/magritte-common-func-utils": "1.3.15",
|
|
24
28
|
"@hh.ru/magritte-common-is-server-env": "1.0.8",
|
|
25
29
|
"@hh.ru/magritte-common-keyboard": "4.3.4",
|
|
26
|
-
"@hh.ru/magritte-common-modal-helper": "1.3.
|
|
30
|
+
"@hh.ru/magritte-common-modal-helper": "1.3.4",
|
|
27
31
|
"@hh.ru/magritte-common-mouse": "1.2.0",
|
|
28
32
|
"@hh.ru/magritte-common-use-multiple-refs": "1.1.11",
|
|
29
33
|
"@hh.ru/magritte-common-use-no-bubbling": "1.0.8",
|
|
@@ -31,21 +35,21 @@
|
|
|
31
35
|
"@hh.ru/magritte-internal-accessible-region": "1.0.3",
|
|
32
36
|
"@hh.ru/magritte-internal-layer-name": "3.4.1",
|
|
33
37
|
"@hh.ru/magritte-internal-slot-registry": "1.1.0",
|
|
34
|
-
"@hh.ru/magritte-ui-action-bar": "5.4.
|
|
38
|
+
"@hh.ru/magritte-ui-action-bar": "5.4.13",
|
|
35
39
|
"@hh.ru/magritte-ui-breakpoint": "6.1.1",
|
|
36
40
|
"@hh.ru/magritte-ui-content-overlay": "1.2.1",
|
|
37
|
-
"@hh.ru/magritte-ui-divider": "3.2.
|
|
38
|
-
"@hh.ru/magritte-ui-icon": "15.0.
|
|
41
|
+
"@hh.ru/magritte-ui-divider": "3.2.7",
|
|
42
|
+
"@hh.ru/magritte-ui-icon": "15.0.1",
|
|
39
43
|
"@hh.ru/magritte-ui-layer": "3.2.6",
|
|
40
44
|
"@hh.ru/magritte-ui-layout": "2.1.0",
|
|
41
45
|
"@hh.ru/magritte-ui-mock-component": "1.1.7",
|
|
42
|
-
"@hh.ru/magritte-ui-nav-bar": "2.0.
|
|
43
|
-
"@hh.ru/magritte-ui-progress-bar": "5.0.
|
|
46
|
+
"@hh.ru/magritte-ui-nav-bar": "2.0.10",
|
|
47
|
+
"@hh.ru/magritte-ui-progress-bar": "5.0.32",
|
|
44
48
|
"@hh.ru/magritte-ui-scrollbar": "1.0.33",
|
|
45
|
-
"@hh.ru/magritte-ui-textarea": "3.3.
|
|
49
|
+
"@hh.ru/magritte-ui-textarea": "3.3.41",
|
|
46
50
|
"@hh.ru/magritte-ui-theme-wrapper": "1.1.24",
|
|
47
51
|
"@hh.ru/magritte-ui-title": "8.3.8",
|
|
48
|
-
"@hh.ru/magritte-ui-tree-selector": "5.5.
|
|
52
|
+
"@hh.ru/magritte-ui-tree-selector": "5.5.61"
|
|
49
53
|
},
|
|
50
54
|
"peerDependencies": {
|
|
51
55
|
"classnames": ">=2.3.2",
|
|
@@ -56,5 +60,5 @@
|
|
|
56
60
|
"publishConfig": {
|
|
57
61
|
"access": "public"
|
|
58
62
|
},
|
|
59
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "673159d3e2d52fa7608da8042b16148b9fed7fb4"
|
|
60
64
|
}
|
package/public/Modal.js
CHANGED
|
@@ -20,9 +20,10 @@ import { useModalTransition } from '../internal/useModalTransition.js';
|
|
|
20
20
|
import { usePageHeaderScrollAnimation } from '../internal/usePageHeaderScrollAnimation.js';
|
|
21
21
|
import { ModalMedia } from './ModalMedia.js';
|
|
22
22
|
import { ThemeWrapper } from '@hh.ru/magritte-ui-theme-wrapper';
|
|
23
|
-
import { s as styles } from '../modal-
|
|
23
|
+
import { s as styles } from '../modal-D7proB4O.js';
|
|
24
24
|
import '@hh.ru/magritte-ui-textarea';
|
|
25
25
|
import '@hh.ru/magritte-ui-action-bar';
|
|
26
|
+
import '../actionBarDefaults.js';
|
|
26
27
|
import '../internal/ModalBody.js';
|
|
27
28
|
import '@hh.ru/magritte-ui-content-overlay';
|
|
28
29
|
import '../internal/ModalStickyHeader.js';
|
package/public/Modal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","sources":["src/public/Modal.tsx"],"sourcesContent":["import {\n forwardRef,\n type HTMLAttributes,\n useRef,\n useState,\n type ForwardRefExoticComponent,\n type PropsWithoutRef,\n type RefAttributes,\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport { CSSTransition } from 'react-transition-group';\nimport classnames from 'classnames';\n\nimport { useServerEnv } from '@hh.ru/magritte-common-is-server-env';\nimport { keyboardMatch, keyboardKeys, useKeyboardNavigation } from '@hh.ru/magritte-common-keyboard';\nimport { CloseByClickOutsideContext } from '@hh.ru/magritte-common-mouse/useCloseByClickOutside';\nimport { useMultipleRefs } from '@hh.ru/magritte-common-use-multiple-refs';\nimport { useNoBubbling } from '@hh.ru/magritte-common-use-no-bubbling';\nimport { AccessibleRegionProvider, type ExplicitRegionProps } from '@hh.ru/magritte-internal-accessible-region';\nimport { Layer } from '@hh.ru/magritte-ui-layer';\nimport { ModalContent } from '@hh.ru/magritte-ui-modal/internal/ModalContent';\nimport { ModalInner } from '@hh.ru/magritte-ui-modal/internal/ModalInner';\nimport { ModalSlotsProvider } from '@hh.ru/magritte-ui-modal/internal/ModalSlotsContext';\nimport {\n CSS_CLASSES,\n DEFAULT_PAGE_HEADER_PADDING,\n getAnimationTimeout,\n noop,\n} from '@hh.ru/magritte-ui-modal/internal/constants';\nimport { isTreeSelectorChild } from '@hh.ru/magritte-ui-modal/internal/isTreeSelectorChild';\nimport { useModalTransition } from '@hh.ru/magritte-ui-modal/internal/useModalTransition';\nimport { usePageHeaderScrollAnimation } from '@hh.ru/magritte-ui-modal/internal/usePageHeaderScrollAnimation';\nimport { ModalMedia, type ModalMediaProps } from '@hh.ru/magritte-ui-modal/public/ModalMedia';\nimport { type ModalProps } from '@hh.ru/magritte-ui-modal/public/types';\nimport { ThemeWrapper } from '@hh.ru/magritte-ui-theme-wrapper';\n\nimport styles from '../internal/modal.less';\n\ntype ModalRootProps = ModalProps &\n ExplicitRegionProps &\n Omit<HTMLAttributes<HTMLDivElement>, keyof ModalProps | 'role' | 'tabIndex' | 'className'>;\n\ninterface ModalCompound {\n Media: ForwardRefExoticComponent<ModalMediaProps & RefAttributes<HTMLDivElement>>;\n}\n\nexport const Modal = forwardRef<HTMLDivElement, ModalRootProps>(\n (\n {\n visible,\n size = 'medium',\n header,\n footer,\n children,\n onClose = noop,\n host,\n disableVerticalPaddings = false,\n disableHorizontalPaddings = false,\n closeByClickOutside = true,\n onAppear,\n onBeforeExit,\n onAfterExit,\n position = 'center',\n height = position === 'center' ? 'content' : 'full-screen',\n minHeight,\n showOverlay: _showOverlay = true,\n pageHeaderPadding = DEFAULT_PAGE_HEADER_PADDING,\n returnFocusOnClose,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n 'aria-description': ariaDescription,\n ...rest\n },\n ref\n ) => {\n const isServerEnv = useServerEnv();\n const [animationTimeout] = useState(getAnimationTimeout);\n\n const modalRef = useRef<HTMLDivElement>(null);\n const overlayRef = useRef<HTMLDivElement>(null);\n const keyboardNavigationRef = useKeyboardNavigation({ enabled: visible && !isServerEnv, mode: 'loop' });\n const modalRefCallback = useMultipleRefs(ref, modalRef, keyboardNavigationRef);\n\n const showOverlay = position === 'center' || _showOverlay;\n\n // TreeSelector сам управляет своим скроллом и должен занимать всю высоту модала.\n const resolvedHeight = isTreeSelectorChild(children) ? 'full-screen' : height;\n\n const { onEntering, onEntered, onExit, onExited, isHiddenForBreakpoint } = useModalTransition({\n visible,\n isServerEnv,\n showOverlay,\n returnFocusOnClose,\n onAppear,\n onBeforeExit,\n onAfterExit,\n modalRef,\n animationTimeoutExit: animationTimeout.exit,\n });\n\n usePageHeaderScrollAnimation({\n overlayRef,\n showOverlay,\n pageHeaderPadding,\n visible: visible && !isHiddenForBreakpoint,\n });\n\n const overlayEventHandlers = useNoBubbling({\n onKeyDown: (event) => {\n if (keyboardMatch(event.nativeEvent as KeyboardEvent, keyboardKeys.Escape)) {\n onClose(event);\n }\n },\n onMouseDown: (event) => {\n if (closeByClickOutside && !modalRef.current?.contains(event.target as HTMLElement)) {\n onClose(event);\n }\n },\n });\n const overlayProps = showOverlay\n ? overlayEventHandlers\n : {\n onKeyDown: (event: React.KeyboardEvent) => {\n if (keyboardMatch(event.nativeEvent, keyboardKeys.Escape)) {\n onClose(event);\n }\n },\n };\n\n if (isHiddenForBreakpoint || isServerEnv) {\n return null;\n }\n\n return createPortal(\n <CSSTransition\n appear\n in={visible && !isServerEnv}\n nodeRef={overlayRef}\n onEntering={onEntering}\n onEntered={onEntered}\n onExit={onExit}\n onExited={onExited}\n classNames={CSS_CLASSES[position]}\n timeout={animationTimeout}\n unmountOnExit\n >\n <ThemeWrapper>\n {(themeClass) => (\n <Layer layer=\"modal\">\n <div\n {...overlayProps}\n ref={overlayRef}\n className={classnames(styles.modalOverlay, themeClass, {\n [styles.modalOverlayWithBackground]: showOverlay,\n [styles.modalOverlayLeft]: position === 'left',\n [styles.modalOverlayRight]: position === 'right',\n })}\n data-qa=\"modal-overlay\"\n >\n <CloseByClickOutsideContext.Provider value={overlayRef}>\n <AccessibleRegionProvider>\n <ModalSlotsProvider>\n <ModalInner\n {...rest}\n explicitAria={{\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n 'aria-description': ariaDescription,\n }}\n ariaModal={visible && showOverlay && !isServerEnv}\n refCallback={modalRefCallback}\n size={size}\n height={resolvedHeight}\n minHeight={minHeight}\n disableVerticalPaddings={disableVerticalPaddings}\n disableHorizontalPaddings={disableHorizontalPaddings}\n showOverlay={showOverlay}\n header={header}\n footer={footer}\n >\n <ModalContent>{children}</ModalContent>\n </ModalInner>\n </ModalSlotsProvider>\n </AccessibleRegionProvider>\n </CloseByClickOutsideContext.Provider>\n </div>\n </Layer>\n )}\n </ThemeWrapper>\n </CSSTransition>,\n host || document.body\n );\n }\n) as ForwardRefExoticComponent<PropsWithoutRef<ModalRootProps> & RefAttributes<HTMLDivElement>> & ModalCompound;\n\nModal.displayName = 'Modal';\nModal.Media = ModalMedia;\n"],"names":["_jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA8Ca,KAAK,GAAG,UAAU,CAC3B,CACI,EACI,OAAO,EACP,IAAI,GAAG,QAAQ,EACf,MAAM,EACN,MAAM,EACN,QAAQ,EACR,OAAO,GAAG,IAAI,EACd,IAAI,EACJ,uBAAuB,GAAG,KAAK,EAC/B,yBAAyB,GAAG,KAAK,EACjC,mBAAmB,GAAG,IAAI,EAC1B,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,QAAQ,GAAG,QAAQ,EACnB,MAAM,GAAG,QAAQ,KAAK,QAAQ,GAAG,SAAS,GAAG,aAAa,EAC1D,SAAS,EACT,WAAW,EAAE,YAAY,GAAG,IAAI,EAChC,iBAAiB,GAAG,2BAA2B,EAC/C,kBA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G,UAAU;;;;"}
|
|
1
|
+
{"version":3,"file":"Modal.js","sources":["src/public/Modal.tsx"],"sourcesContent":["import {\n forwardRef,\n type HTMLAttributes,\n useRef,\n useState,\n type ForwardRefExoticComponent,\n type PropsWithoutRef,\n type RefAttributes,\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport { CSSTransition } from 'react-transition-group';\nimport classnames from 'classnames';\n\nimport { useServerEnv } from '@hh.ru/magritte-common-is-server-env';\nimport { keyboardMatch, keyboardKeys, useKeyboardNavigation } from '@hh.ru/magritte-common-keyboard';\nimport { CloseByClickOutsideContext } from '@hh.ru/magritte-common-mouse/useCloseByClickOutside';\nimport { useMultipleRefs } from '@hh.ru/magritte-common-use-multiple-refs';\nimport { useNoBubbling } from '@hh.ru/magritte-common-use-no-bubbling';\nimport { AccessibleRegionProvider, type ExplicitRegionProps } from '@hh.ru/magritte-internal-accessible-region';\nimport { Layer } from '@hh.ru/magritte-ui-layer';\nimport { ModalContent } from '@hh.ru/magritte-ui-modal/internal/ModalContent';\nimport { ModalInner } from '@hh.ru/magritte-ui-modal/internal/ModalInner';\nimport { ModalSlotsProvider } from '@hh.ru/magritte-ui-modal/internal/ModalSlotsContext';\nimport {\n CSS_CLASSES,\n DEFAULT_PAGE_HEADER_PADDING,\n getAnimationTimeout,\n noop,\n} from '@hh.ru/magritte-ui-modal/internal/constants';\nimport { isTreeSelectorChild } from '@hh.ru/magritte-ui-modal/internal/isTreeSelectorChild';\nimport { useModalTransition } from '@hh.ru/magritte-ui-modal/internal/useModalTransition';\nimport { usePageHeaderScrollAnimation } from '@hh.ru/magritte-ui-modal/internal/usePageHeaderScrollAnimation';\nimport { ModalMedia, type ModalMediaProps } from '@hh.ru/magritte-ui-modal/public/ModalMedia';\nimport { type ModalProps } from '@hh.ru/magritte-ui-modal/public/types';\nimport { ThemeWrapper } from '@hh.ru/magritte-ui-theme-wrapper';\n\nimport styles from '../internal/modal.less';\n\ntype ModalRootProps = ModalProps &\n ExplicitRegionProps &\n Omit<HTMLAttributes<HTMLDivElement>, keyof ModalProps | 'role' | 'tabIndex' | 'className'>;\n\ninterface ModalCompound {\n Media: ForwardRefExoticComponent<ModalMediaProps & RefAttributes<HTMLDivElement>>;\n}\n\nexport const Modal = forwardRef<HTMLDivElement, ModalRootProps>(\n (\n {\n visible,\n size = 'medium',\n header,\n footer,\n children,\n onClose = noop,\n host,\n disableVerticalPaddings = false,\n disableHorizontalPaddings = false,\n closeByClickOutside = true,\n onAppear,\n onBeforeExit,\n onAfterExit,\n position = 'center',\n height = position === 'center' ? 'content' : 'full-screen',\n minHeight,\n showOverlay: _showOverlay = true,\n pageHeaderPadding = DEFAULT_PAGE_HEADER_PADDING,\n returnFocusOnClose,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n 'aria-description': ariaDescription,\n ...rest\n },\n ref\n ) => {\n const isServerEnv = useServerEnv();\n const [animationTimeout] = useState(getAnimationTimeout);\n\n const modalRef = useRef<HTMLDivElement>(null);\n const overlayRef = useRef<HTMLDivElement>(null);\n const keyboardNavigationRef = useKeyboardNavigation({ enabled: visible && !isServerEnv, mode: 'loop' });\n const modalRefCallback = useMultipleRefs(ref, modalRef, keyboardNavigationRef);\n\n const showOverlay = position === 'center' || _showOverlay;\n\n // TreeSelector сам управляет своим скроллом и должен занимать всю высоту модала.\n const resolvedHeight = isTreeSelectorChild(children) ? 'full-screen' : height;\n\n const { onEntering, onEntered, onExit, onExited, isHiddenForBreakpoint } = useModalTransition({\n visible,\n isServerEnv,\n showOverlay,\n returnFocusOnClose,\n onAppear,\n onBeforeExit,\n onAfterExit,\n modalRef,\n animationTimeoutExit: animationTimeout.exit,\n });\n\n usePageHeaderScrollAnimation({\n overlayRef,\n showOverlay,\n pageHeaderPadding,\n visible: visible && !isHiddenForBreakpoint,\n });\n\n const overlayEventHandlers = useNoBubbling({\n onKeyDown: (event) => {\n if (keyboardMatch(event.nativeEvent as KeyboardEvent, keyboardKeys.Escape)) {\n onClose(event);\n }\n },\n onMouseDown: (event) => {\n if (closeByClickOutside && !modalRef.current?.contains(event.target as HTMLElement)) {\n onClose(event);\n }\n },\n });\n const overlayProps = showOverlay\n ? overlayEventHandlers\n : {\n onKeyDown: (event: React.KeyboardEvent) => {\n if (keyboardMatch(event.nativeEvent, keyboardKeys.Escape)) {\n onClose(event);\n }\n },\n };\n\n if (isHiddenForBreakpoint || isServerEnv) {\n return null;\n }\n\n return createPortal(\n <CSSTransition\n appear\n in={visible && !isServerEnv}\n nodeRef={overlayRef}\n onEntering={onEntering}\n onEntered={onEntered}\n onExit={onExit}\n onExited={onExited}\n classNames={CSS_CLASSES[position]}\n timeout={animationTimeout}\n unmountOnExit\n >\n <ThemeWrapper>\n {(themeClass) => (\n <Layer layer=\"modal\">\n <div\n {...overlayProps}\n ref={overlayRef}\n className={classnames(styles.modalOverlay, themeClass, {\n [styles.modalOverlayWithBackground]: showOverlay,\n [styles.modalOverlayLeft]: position === 'left',\n [styles.modalOverlayRight]: position === 'right',\n })}\n data-qa=\"modal-overlay\"\n >\n <CloseByClickOutsideContext.Provider value={overlayRef}>\n <AccessibleRegionProvider>\n <ModalSlotsProvider>\n <ModalInner\n {...rest}\n explicitAria={{\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n 'aria-description': ariaDescription,\n }}\n ariaModal={visible && showOverlay && !isServerEnv}\n refCallback={modalRefCallback}\n size={size}\n height={resolvedHeight}\n minHeight={minHeight}\n disableVerticalPaddings={disableVerticalPaddings}\n disableHorizontalPaddings={disableHorizontalPaddings}\n showOverlay={showOverlay}\n header={header}\n footer={footer}\n >\n <ModalContent>{children}</ModalContent>\n </ModalInner>\n </ModalSlotsProvider>\n </AccessibleRegionProvider>\n </CloseByClickOutsideContext.Provider>\n </div>\n </Layer>\n )}\n </ThemeWrapper>\n </CSSTransition>,\n host || document.body\n );\n }\n) as ForwardRefExoticComponent<PropsWithoutRef<ModalRootProps>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AAS,EAAE,OAAO,IAAI,WAAW,IAAI,CAAC,WAAW,EACjD,WAAW,EAAE,gBAAgB,EAC7B,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,cAAc,EACtB,SAAS,EAAE,SAAS,EACpB,uBAAuB,EAAE,uBAAuB,EAChD,yBAAyB,EAAE,yBAAyB,EACpD,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EAAA,QAAA,EAEdA,GAAC,CAAA,YAAY,cAAE,QAAQ,EAAA,CAAgB,EAC9B,CAAA,EAAA,CACI,EACE,CAAA,EAAA,CACO,EACpC,CAAA,EAAA,CACF,CACX,EACU,CAAA,EAAA,CACH,EAChB,IAAI,IAAI,QAAQ,CAAC,IAAI,CACxB,CAAC;AACN,CAAC,EAC2G;AAEhH,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC;AAC5B,KAAK,CAAC,KAAK,GAAG,UAAU;;;;"}
|
package/public/ModalMedia.js
CHANGED
|
@@ -2,7 +2,7 @@ import './../index.css';
|
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
4
|
import classnames from 'classnames';
|
|
5
|
-
import { s as styles } from '../modal-
|
|
5
|
+
import { s as styles } from '../modal-D7proB4O.js';
|
|
6
6
|
|
|
7
7
|
const ModalMedia = forwardRef(({ ratio, height, backgroundUrl, className, style, children, imageSize = 'cover', ...rest }, ref) => {
|
|
8
8
|
const defaultRatio = children ? 'auto' : 1.9;
|
package/public/ModalWithImage.js
CHANGED
|
@@ -4,6 +4,7 @@ import { forwardRef } from 'react';
|
|
|
4
4
|
import { Flex } from '@hh.ru/magritte-ui-layout';
|
|
5
5
|
import { Modal } from './Modal.js';
|
|
6
6
|
import { ModalMedia } from './ModalMedia.js';
|
|
7
|
+
import { MODAL_WITH_IMAGE_NAV_BAR_DEFAULTS, MODAL_WITH_IMAGE_TITLE_DEFAULTS } from '../withImageDefaults.js';
|
|
7
8
|
import { NavBarDefaultPropsContext } from '@hh.ru/magritte-ui-nav-bar';
|
|
8
9
|
import { TitleDefaultPropsContext } from '@hh.ru/magritte-ui-title';
|
|
9
10
|
import 'react-dom';
|
|
@@ -20,9 +21,10 @@ import '../internal/ModalContent.js';
|
|
|
20
21
|
import '../internal/isTreeSelectorChild.js';
|
|
21
22
|
import '@hh.ru/magritte-ui-tree-selector';
|
|
22
23
|
import '@hh.ru/magritte-ui-textarea';
|
|
23
|
-
import '../modal-
|
|
24
|
+
import '../modal-D7proB4O.js';
|
|
24
25
|
import '../internal/ModalInner.js';
|
|
25
26
|
import '@hh.ru/magritte-ui-action-bar';
|
|
27
|
+
import '../actionBarDefaults.js';
|
|
26
28
|
import '../internal/ModalBody.js';
|
|
27
29
|
import '@hh.ru/magritte-ui-content-overlay';
|
|
28
30
|
import '../internal/ModalSlotsContext.js';
|
|
@@ -39,15 +41,8 @@ import '@hh.ru/magritte-common-dom-storage';
|
|
|
39
41
|
import '../internal/usePageHeaderScrollAnimation.js';
|
|
40
42
|
import '@hh.ru/magritte-ui-theme-wrapper';
|
|
41
43
|
|
|
42
|
-
const NAV_BAR_DEFAULT_PROPS =
|
|
43
|
-
|
|
44
|
-
snapScroll: false,
|
|
45
|
-
transparent: 'start',
|
|
46
|
-
};
|
|
47
|
-
const TITLE_DEFAULT_PROPS = {
|
|
48
|
-
size: 'medium',
|
|
49
|
-
alignment: 'center',
|
|
50
|
-
};
|
|
44
|
+
const NAV_BAR_DEFAULT_PROPS = MODAL_WITH_IMAGE_NAV_BAR_DEFAULTS;
|
|
45
|
+
const TITLE_DEFAULT_PROPS = MODAL_WITH_IMAGE_TITLE_DEFAULTS;
|
|
51
46
|
const ModalWithImage = forwardRef(({ image, title, children, ...rest }, ref) => (jsx(NavBarDefaultPropsContext, { rootProps: NAV_BAR_DEFAULT_PROPS, children: jsxs(Modal, { ...rest, ref: ref, children: [image, (!!title || !!children) && (jsxs(Flex, { gap: 24, direction: "column", my: 24, children: [!!title && (jsx("div", { children: jsx(TitleDefaultPropsContext, { props: TITLE_DEFAULT_PROPS, children: title }) })), !!children && jsx("div", { children: children })] }))] }) })));
|
|
52
47
|
ModalWithImage.displayName = 'ModalWithImage';
|
|
53
48
|
ModalWithImage.Media = ModalMedia;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalWithImage.js","sources":["src/public/ModalWithImage.tsx"],"sourcesContent":["import {\n forwardRef,\n type ForwardRefExoticComponent,\n type HTMLAttributes,\n type PropsWithoutRef,\n type ReactNode,\n type RefAttributes,\n} from 'react';\n\nimport { type ExplicitRegionProps } from '@hh.ru/magritte-internal-accessible-region';\nimport { Flex } from '@hh.ru/magritte-ui-layout';\nimport { Modal } from '@hh.ru/magritte-ui-modal/public/Modal';\nimport { ModalMedia, type ModalMediaProps } from '@hh.ru/magritte-ui-modal/public/ModalMedia';\nimport { type ModalProps } from '@hh.ru/magritte-ui-modal/public/types';\nimport { NavBarDefaultPropsContext } from '@hh.ru/magritte-ui-nav-bar';\nimport { TitleDefaultPropsContext } from '@hh.ru/magritte-ui-title';\n\nexport interface ModalWithImageProps extends ModalProps {\n /** Изображение (медиа), располагается над контентом */\n image?: ReactNode;\n /** Заголовок, располагается над контентом */\n title?: ReactNode;\n}\n\nconst NAV_BAR_DEFAULT_PROPS =
|
|
1
|
+
{"version":3,"file":"ModalWithImage.js","sources":["src/public/ModalWithImage.tsx"],"sourcesContent":["import {\n forwardRef,\n type ForwardRefExoticComponent,\n type HTMLAttributes,\n type PropsWithoutRef,\n type ReactNode,\n type RefAttributes,\n} from 'react';\n\nimport { type ExplicitRegionProps } from '@hh.ru/magritte-internal-accessible-region';\nimport { Flex } from '@hh.ru/magritte-ui-layout';\nimport { Modal } from '@hh.ru/magritte-ui-modal/public/Modal';\nimport { ModalMedia, type ModalMediaProps } from '@hh.ru/magritte-ui-modal/public/ModalMedia';\nimport { type ModalProps } from '@hh.ru/magritte-ui-modal/public/types';\nimport {\n MODAL_WITH_IMAGE_NAV_BAR_DEFAULTS,\n MODAL_WITH_IMAGE_TITLE_DEFAULTS,\n} from '@hh.ru/magritte-ui-modal/withImageDefaults';\nimport { NavBarDefaultPropsContext } from '@hh.ru/magritte-ui-nav-bar';\nimport { TitleDefaultPropsContext } from '@hh.ru/magritte-ui-title';\n\nexport interface ModalWithImageProps extends ModalProps {\n /** Изображение (медиа), располагается над контентом */\n image?: ReactNode;\n /** Заголовок, располагается над контентом */\n title?: ReactNode;\n}\n\nconst NAV_BAR_DEFAULT_PROPS = MODAL_WITH_IMAGE_NAV_BAR_DEFAULTS;\n\nconst TITLE_DEFAULT_PROPS = MODAL_WITH_IMAGE_TITLE_DEFAULTS;\n\ntype ModalWithImageRootProps = ModalWithImageProps &\n ExplicitRegionProps &\n Omit<HTMLAttributes<HTMLDivElement>, keyof ModalWithImageProps | 'role' | 'tabIndex' | 'className'>;\n\ninterface ModalWithImageCompound {\n Media: ForwardRefExoticComponent<ModalMediaProps & RefAttributes<HTMLDivElement>>;\n}\n\nexport const ModalWithImage = forwardRef<HTMLDivElement, ModalWithImageRootProps>(\n ({ image, title, children, ...rest }, ref) => (\n <NavBarDefaultPropsContext rootProps={NAV_BAR_DEFAULT_PROPS}>\n <Modal {...rest} ref={ref}>\n {image}\n {(!!title || !!children) && (\n <Flex gap={24} direction=\"column\" my={24}>\n {!!title && (\n <div>\n <TitleDefaultPropsContext props={TITLE_DEFAULT_PROPS}>{title}</TitleDefaultPropsContext>\n </div>\n )}\n {!!children && <div>{children}</div>}\n </Flex>\n )}\n </Modal>\n </NavBarDefaultPropsContext>\n )\n) as ForwardRefExoticComponent<PropsWithoutRef<ModalWithImageRootProps> & RefAttributes<HTMLDivElement>> &\n ModalWithImageCompound;\n\nModalWithImage.displayName = 'ModalWithImage';\nModalWithImage.Media = ModalMedia;\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAM,qBAAqB,GAAG,iCAAiC,CAAC;AAEhE,MAAM,mBAAmB,GAAG,+BAA+B,CAAC;MAU/C,cAAc,GAAG,UAAU,CACpC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,GAAG,MACrCA,IAAC,yBAAyB,EAAA,EAAC,SAAS,EAAE,qBAAqB,YACvDC,IAAC,CAAA,KAAK,EAAK,EAAA,GAAA,IAAI,EAAE,GAAG,EAAE,GAAG,EAAA,QAAA,EAAA,CACpB,KAAK,EACL,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,QAAQ,MACnBA,KAAC,IAAI,EAAA,EAAC,GAAG,EAAE,EAAE,EAAE,SAAS,EAAC,QAAQ,EAAC,EAAE,EAAE,EAAE,EAAA,QAAA,EAAA,CACnC,CAAC,CAAC,KAAK,KACJD,GACI,CAAA,KAAA,EAAA,EAAA,QAAA,EAAAA,GAAA,CAAC,wBAAwB,EAAC,EAAA,KAAK,EAAE,mBAAmB,EAAA,QAAA,EAAG,KAAK,EAA4B,CAAA,EAAA,CACtF,CACT,EACA,CAAC,CAAC,QAAQ,IAAIA,GAAA,CAAA,KAAA,EAAA,EAAA,QAAA,EAAM,QAAQ,EAAO,CAAA,CAAA,EAAA,CACjC,CACV,CACG,EAAA,CAAA,EAAA,CACgB,CAC/B,EAEsB;AAE3B,cAAc,CAAC,WAAW,GAAG,gBAAgB,CAAC;AAC9C,cAAc,CAAC,KAAK,GAAG,UAAU;;;;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The props `ModalWithImage` supplies to the two components it composes, at runtime through their
|
|
3
|
+
* `DefaultPropsContext` providers (see `public/ModalWithImage.tsx`).
|
|
4
|
+
*
|
|
5
|
+
* They live in their own module, as plain data with no imports, because they are read from TWO sides: the
|
|
6
|
+
* component applies them, and the Code Connect template declares them as contextual defaults so a nested
|
|
7
|
+
* snippet stops repeating — or worse, overriding — what the wrapper already provides. A literal copied into
|
|
8
|
+
* the template would drift silently: change the value here and the published snippet would keep asserting the
|
|
9
|
+
* old one, with no build error and no render error. The bundler inlines this file into every template that
|
|
10
|
+
* imports it, which is the other reason it must stay free of runtime imports.
|
|
11
|
+
*/
|
|
12
|
+
/** Applied to every NavBar in the subtree — the header lies over the image, transparent until it scrolls. */
|
|
13
|
+
export declare const MODAL_WITH_IMAGE_NAV_BAR_DEFAULTS: {
|
|
14
|
+
readonly overlay: true;
|
|
15
|
+
readonly snapScroll: false;
|
|
16
|
+
readonly transparent: "start";
|
|
17
|
+
};
|
|
18
|
+
/** Applied to whatever goes into the `title` prop. */
|
|
19
|
+
export declare const MODAL_WITH_IMAGE_TITLE_DEFAULTS: {
|
|
20
|
+
readonly size: "medium";
|
|
21
|
+
readonly alignment: "center";
|
|
22
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import './index.css';
|
|
2
|
+
/**
|
|
3
|
+
* The props `ModalWithImage` supplies to the two components it composes, at runtime through their
|
|
4
|
+
* `DefaultPropsContext` providers (see `public/ModalWithImage.tsx`).
|
|
5
|
+
*
|
|
6
|
+
* They live in their own module, as plain data with no imports, because they are read from TWO sides: the
|
|
7
|
+
* component applies them, and the Code Connect template declares them as contextual defaults so a nested
|
|
8
|
+
* snippet stops repeating — or worse, overriding — what the wrapper already provides. A literal copied into
|
|
9
|
+
* the template would drift silently: change the value here and the published snippet would keep asserting the
|
|
10
|
+
* old one, with no build error and no render error. The bundler inlines this file into every template that
|
|
11
|
+
* imports it, which is the other reason it must stay free of runtime imports.
|
|
12
|
+
*/
|
|
13
|
+
/** Applied to every NavBar in the subtree — the header lies over the image, transparent until it scrolls. */
|
|
14
|
+
const MODAL_WITH_IMAGE_NAV_BAR_DEFAULTS = {
|
|
15
|
+
overlay: true,
|
|
16
|
+
snapScroll: false,
|
|
17
|
+
transparent: 'start',
|
|
18
|
+
};
|
|
19
|
+
/** Applied to whatever goes into the `title` prop. */
|
|
20
|
+
const MODAL_WITH_IMAGE_TITLE_DEFAULTS = {
|
|
21
|
+
size: 'medium',
|
|
22
|
+
alignment: 'center',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export { MODAL_WITH_IMAGE_NAV_BAR_DEFAULTS, MODAL_WITH_IMAGE_TITLE_DEFAULTS };
|
|
26
|
+
//# sourceMappingURL=withImageDefaults.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withImageDefaults.js","sources":["src/withImageDefaults.ts"],"sourcesContent":["/**\n * The props `ModalWithImage` supplies to the two components it composes, at runtime through their\n * `DefaultPropsContext` providers (see `public/ModalWithImage.tsx`).\n *\n * They live in their own module, as plain data with no imports, because they are read from TWO sides: the\n * component applies them, and the Code Connect template declares them as contextual defaults so a nested\n * snippet stops repeating — or worse, overriding — what the wrapper already provides. A literal copied into\n * the template would drift silently: change the value here and the published snippet would keep asserting the\n * old one, with no build error and no render error. The bundler inlines this file into every template that\n * imports it, which is the other reason it must stay free of runtime imports.\n */\n\n/** Applied to every NavBar in the subtree — the header lies over the image, transparent until it scrolls. */\nexport const MODAL_WITH_IMAGE_NAV_BAR_DEFAULTS = {\n overlay: true,\n snapScroll: false,\n transparent: 'start',\n} as const;\n\n/** Applied to whatever goes into the `title` prop. */\nexport const MODAL_WITH_IMAGE_TITLE_DEFAULTS = {\n size: 'medium',\n alignment: 'center',\n} as const;\n"],"names":[],"mappings":"AAAA;;;;;;;;;;AAUG;AAEH;AACa,MAAA,iCAAiC,GAAG;AAC7C,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,UAAU,EAAE,KAAK;AACjB,IAAA,WAAW,EAAE,OAAO;EACb;AAEX;AACa,MAAA,+BAA+B,GAAG;AAC3C,IAAA,IAAI,EAAE,QAAQ;AACd,IAAA,SAAS,EAAE,QAAQ;;;;;"}
|
package/modal-C1eQijuX.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import './index.css';
|
|
2
|
-
var styles = {"sticky-header":"magritte-sticky-header___TPafy_11-0-16","stickyHeader":"magritte-sticky-header___TPafy_11-0-16","sticky-header-inner":"magritte-sticky-header-inner___u5p8h_11-0-16","stickyHeaderInner":"magritte-sticky-header-inner___u5p8h_11-0-16","modal-media":"magritte-modal-media___UqHGM_11-0-16","modalMedia":"magritte-modal-media___UqHGM_11-0-16","fixed-height":"magritte-fixed-height___wyJ7-_11-0-16","fixedHeight":"magritte-fixed-height___wyJ7-_11-0-16","contain":"magritte-contain___3QD0Z_11-0-16","cover":"magritte-cover___nry9O_11-0-16","content-overlay-top":"magritte-content-overlay-top___6snWk_11-0-16","contentOverlayTop":"magritte-content-overlay-top___6snWk_11-0-16","grow-limiter":"magritte-grow-limiter___GmpBj_11-0-16","growLimiter":"magritte-grow-limiter___GmpBj_11-0-16","modal-overlay":"magritte-modal-overlay___WwfCg_11-0-16","modalOverlay":"magritte-modal-overlay___WwfCg_11-0-16","modal-overlay-with-background":"magritte-modal-overlay-with-background___DDxJn_11-0-16","modalOverlayWithBackground":"magritte-modal-overlay-with-background___DDxJn_11-0-16","modal":"magritte-modal___C4o5U_11-0-16","modal-overlay-left":"magritte-modal-overlay-left___agPyC_11-0-16","modalOverlayLeft":"magritte-modal-overlay-left___agPyC_11-0-16","modal-overlay-right":"magritte-modal-overlay-right___-XDAx_11-0-16","modalOverlayRight":"magritte-modal-overlay-right___-XDAx_11-0-16","size-small":"magritte-size-small___cI-Ql_11-0-16","sizeSmall":"magritte-size-small___cI-Ql_11-0-16","size-medium":"magritte-size-medium___jnqfu_11-0-16","sizeMedium":"magritte-size-medium___jnqfu_11-0-16","no-vertical-paddings":"magritte-no-vertical-paddings___dxyot_11-0-16","noVerticalPaddings":"magritte-no-vertical-paddings___dxyot_11-0-16","no-horizontal-paddings":"magritte-no-horizontal-paddings___Q-i-5_11-0-16","noHorizontalPaddings":"magritte-no-horizontal-paddings___Q-i-5_11-0-16","modal-full-height":"magritte-modal-full-height___Aew5F_11-0-16","modalFullHeight":"magritte-modal-full-height___Aew5F_11-0-16","modal-with-border":"magritte-modal-with-border___KSnhf_11-0-16","modalWithBorder":"magritte-modal-with-border___KSnhf_11-0-16","modal-content-wrapper":"magritte-modal-content-wrapper___VzoTN_11-0-16","modalContentWrapper":"magritte-modal-content-wrapper___VzoTN_11-0-16","modal-footer":"magritte-modal-footer___Ha-sZ_11-0-16","modalFooter":"magritte-modal-footer___Ha-sZ_11-0-16","modal-footer-empty":"magritte-modal-footer-empty___tmH-x_11-0-16","modalFooterEmpty":"magritte-modal-footer-empty___tmH-x_11-0-16","animation-timeout":"magritte-animation-timeout___G4Hl1_11-0-16","animationTimeout":"magritte-animation-timeout___G4Hl1_11-0-16","animation-enter-center":"magritte-animation-enter-center___sq8j7_11-0-16","animationEnterCenter":"magritte-animation-enter-center___sq8j7_11-0-16","animation-enter-center-active":"magritte-animation-enter-center-active___ORYEh_11-0-16","animationEnterCenterActive":"magritte-animation-enter-center-active___ORYEh_11-0-16","animation-exit-center":"magritte-animation-exit-center___lLCX1_11-0-16","animationExitCenter":"magritte-animation-exit-center___lLCX1_11-0-16","animation-exit-center-active":"magritte-animation-exit-center-active___Ik2Yl_11-0-16","animationExitCenterActive":"magritte-animation-exit-center-active___Ik2Yl_11-0-16","animation-enter-left":"magritte-animation-enter-left___jJDlv_11-0-16","animationEnterLeft":"magritte-animation-enter-left___jJDlv_11-0-16","animation-enter-left-active":"magritte-animation-enter-left-active___-kFij_11-0-16","animationEnterLeftActive":"magritte-animation-enter-left-active___-kFij_11-0-16","animation-exit-left":"magritte-animation-exit-left___G2Plq_11-0-16","animationExitLeft":"magritte-animation-exit-left___G2Plq_11-0-16","animation-exit-left-active":"magritte-animation-exit-left-active___XW2K4_11-0-16","animationExitLeftActive":"magritte-animation-exit-left-active___XW2K4_11-0-16","animation-enter-right":"magritte-animation-enter-right___rrMS0_11-0-16","animationEnterRight":"magritte-animation-enter-right___rrMS0_11-0-16","animation-enter-right-active":"magritte-animation-enter-right-active___p7rg-_11-0-16","animationEnterRightActive":"magritte-animation-enter-right-active___p7rg-_11-0-16","animation-exit-right":"magritte-animation-exit-right___f3qIC_11-0-16","animationExitRight":"magritte-animation-exit-right___f3qIC_11-0-16","animation-exit-right-active":"magritte-animation-exit-right-active___-sG1k_11-0-16","animationExitRightActive":"magritte-animation-exit-right-active___-sG1k_11-0-16","tree-selector-container":"magritte-tree-selector-container___4cdf5_11-0-16","treeSelectorContainer":"magritte-tree-selector-container___4cdf5_11-0-16","modal-scroll-container":"magritte-modal-scroll-container___hOCdh_11-0-16","modalScrollContainer":"magritte-modal-scroll-container___hOCdh_11-0-16","nav-bar":"magritte-nav-bar___CL7d-_11-0-16","navBar":"magritte-nav-bar___CL7d-_11-0-16","header":"magritte-header___pufwA_11-0-16","static":"magritte-static___3B6cn_11-0-16","content-overlay-bottom":"magritte-content-overlay-bottom___bDuPC_11-0-16","contentOverlayBottom":"magritte-content-overlay-bottom___bDuPC_11-0-16"};
|
|
3
|
-
|
|
4
|
-
export { styles as s };
|
|
5
|
-
//# sourceMappingURL=modal-C1eQijuX.js.map
|
package/modal-C1eQijuX.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"modal-C1eQijuX.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|