benal18-modal 1.0.2 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BenalModal.es.js +122 -142
- package/dist/BenalModal.umd.js +5 -21
- package/package.json +22 -14
package/dist/BenalModal.es.js
CHANGED
|
@@ -1,88 +1,70 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
if (s !== void 0 && (c = "" + s), a.key !== void 0 && (c = "" + a.key), "key" in a) {
|
|
21
|
-
s = {};
|
|
22
|
-
for (var b in a)
|
|
23
|
-
b !== "key" && (s[b] = a[b]);
|
|
24
|
-
} else s = a;
|
|
25
|
-
return a = s.ref, {
|
|
26
|
-
$$typeof: u,
|
|
27
|
-
type: f,
|
|
28
|
-
key: c,
|
|
1
|
+
import re, { useEffect as te } from "react";
|
|
2
|
+
import w from "styled-components";
|
|
3
|
+
var v = { exports: {} }, p = {};
|
|
4
|
+
var I;
|
|
5
|
+
function ne() {
|
|
6
|
+
if (I) return p;
|
|
7
|
+
I = 1;
|
|
8
|
+
var s = /* @__PURE__ */ Symbol.for("react.transitional.element"), i = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
9
|
+
function f(c, a, l) {
|
|
10
|
+
var u = null;
|
|
11
|
+
if (l !== void 0 && (u = "" + l), a.key !== void 0 && (u = "" + a.key), "key" in a) {
|
|
12
|
+
l = {};
|
|
13
|
+
for (var d in a)
|
|
14
|
+
d !== "key" && (l[d] = a[d]);
|
|
15
|
+
} else l = a;
|
|
16
|
+
return a = l.ref, {
|
|
17
|
+
$$typeof: s,
|
|
18
|
+
type: c,
|
|
19
|
+
key: u,
|
|
29
20
|
ref: a !== void 0 ? a : null,
|
|
30
|
-
props:
|
|
21
|
+
props: l
|
|
31
22
|
};
|
|
32
23
|
}
|
|
33
|
-
return p.Fragment = i, p.jsx =
|
|
24
|
+
return p.Fragment = i, p.jsx = f, p.jsxs = f, p;
|
|
34
25
|
}
|
|
35
|
-
var
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
41
|
-
*
|
|
42
|
-
* This source code is licensed under the MIT license found in the
|
|
43
|
-
* LICENSE file in the root directory of this source tree.
|
|
44
|
-
*/
|
|
45
|
-
var M;
|
|
46
|
-
function ae() {
|
|
47
|
-
return M || (M = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
48
|
-
function u(e) {
|
|
26
|
+
var E = {};
|
|
27
|
+
var D;
|
|
28
|
+
function oe() {
|
|
29
|
+
return D || (D = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
30
|
+
function s(e) {
|
|
49
31
|
if (e == null) return null;
|
|
50
32
|
if (typeof e == "function")
|
|
51
|
-
return e.$$typeof ===
|
|
33
|
+
return e.$$typeof === Q ? null : e.displayName || e.name || null;
|
|
52
34
|
if (typeof e == "string") return e;
|
|
53
35
|
switch (e) {
|
|
54
|
-
case
|
|
36
|
+
case R:
|
|
55
37
|
return "Fragment";
|
|
56
|
-
case J:
|
|
57
|
-
return "Profiler";
|
|
58
38
|
case q:
|
|
39
|
+
return "Profiler";
|
|
40
|
+
case z:
|
|
59
41
|
return "StrictMode";
|
|
60
|
-
case
|
|
42
|
+
case X:
|
|
61
43
|
return "Suspense";
|
|
62
|
-
case
|
|
44
|
+
case B:
|
|
63
45
|
return "SuspenseList";
|
|
64
|
-
case
|
|
46
|
+
case Z:
|
|
65
47
|
return "Activity";
|
|
66
48
|
}
|
|
67
49
|
if (typeof e == "object")
|
|
68
50
|
switch (typeof e.tag == "number" && console.error(
|
|
69
51
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
70
52
|
), e.$$typeof) {
|
|
71
|
-
case
|
|
53
|
+
case U:
|
|
72
54
|
return "Portal";
|
|
73
|
-
case G:
|
|
74
|
-
return (e.displayName || "Context") + ".Provider";
|
|
75
55
|
case V:
|
|
56
|
+
return e.displayName || "Context";
|
|
57
|
+
case J:
|
|
76
58
|
return (e._context.displayName || "Context") + ".Consumer";
|
|
77
|
-
case
|
|
59
|
+
case G:
|
|
78
60
|
var r = e.render;
|
|
79
61
|
return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
80
|
-
case
|
|
81
|
-
return r = e.displayName || null, r !== null ? r :
|
|
82
|
-
case
|
|
62
|
+
case H:
|
|
63
|
+
return r = e.displayName || null, r !== null ? r : s(e.type) || "Memo";
|
|
64
|
+
case T:
|
|
83
65
|
r = e._payload, e = e._init;
|
|
84
66
|
try {
|
|
85
|
-
return
|
|
67
|
+
return s(e(r));
|
|
86
68
|
} catch {
|
|
87
69
|
}
|
|
88
70
|
}
|
|
@@ -91,7 +73,7 @@ function ae() {
|
|
|
91
73
|
function i(e) {
|
|
92
74
|
return "" + e;
|
|
93
75
|
}
|
|
94
|
-
function
|
|
76
|
+
function f(e) {
|
|
95
77
|
try {
|
|
96
78
|
i(e);
|
|
97
79
|
var r = !1;
|
|
@@ -108,12 +90,12 @@ function ae() {
|
|
|
108
90
|
), i(e);
|
|
109
91
|
}
|
|
110
92
|
}
|
|
111
|
-
function
|
|
112
|
-
if (e ===
|
|
113
|
-
if (typeof e == "object" && e !== null && e.$$typeof ===
|
|
93
|
+
function c(e) {
|
|
94
|
+
if (e === R) return "<>";
|
|
95
|
+
if (typeof e == "object" && e !== null && e.$$typeof === T)
|
|
114
96
|
return "<...>";
|
|
115
97
|
try {
|
|
116
|
-
var r =
|
|
98
|
+
var r = s(e);
|
|
117
99
|
return r ? "<" + r + ">" : "<...>";
|
|
118
100
|
} catch {
|
|
119
101
|
return "<...>";
|
|
@@ -123,19 +105,19 @@ function ae() {
|
|
|
123
105
|
var e = k.A;
|
|
124
106
|
return e === null ? null : e.getOwner();
|
|
125
107
|
}
|
|
126
|
-
function
|
|
108
|
+
function l() {
|
|
127
109
|
return Error("react-stack-top-frame");
|
|
128
110
|
}
|
|
129
|
-
function
|
|
130
|
-
if (
|
|
111
|
+
function u(e) {
|
|
112
|
+
if (P.call(e, "key")) {
|
|
131
113
|
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
132
114
|
if (r && r.isReactWarning) return !1;
|
|
133
115
|
}
|
|
134
116
|
return e.key !== void 0;
|
|
135
117
|
}
|
|
136
|
-
function
|
|
118
|
+
function d(e, r) {
|
|
137
119
|
function t() {
|
|
138
|
-
|
|
120
|
+
N || (N = !0, console.error(
|
|
139
121
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
140
122
|
r
|
|
141
123
|
));
|
|
@@ -145,22 +127,23 @@ function ae() {
|
|
|
145
127
|
configurable: !0
|
|
146
128
|
});
|
|
147
129
|
}
|
|
148
|
-
function
|
|
149
|
-
var e =
|
|
150
|
-
return
|
|
130
|
+
function L() {
|
|
131
|
+
var e = s(this.type);
|
|
132
|
+
return C[e] || (C[e] = !0, console.error(
|
|
151
133
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
152
134
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
153
135
|
}
|
|
154
|
-
function
|
|
155
|
-
|
|
136
|
+
function W(e, r, t, n, _, h) {
|
|
137
|
+
var o = t.ref;
|
|
138
|
+
return e = {
|
|
156
139
|
$$typeof: S,
|
|
157
140
|
type: e,
|
|
158
141
|
key: r,
|
|
159
|
-
props:
|
|
160
|
-
_owner:
|
|
161
|
-
}, (
|
|
142
|
+
props: t,
|
|
143
|
+
_owner: n
|
|
144
|
+
}, (o !== void 0 ? o : null) !== null ? Object.defineProperty(e, "ref", {
|
|
162
145
|
enumerable: !1,
|
|
163
|
-
get:
|
|
146
|
+
get: L
|
|
164
147
|
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
165
148
|
configurable: !1,
|
|
166
149
|
enumerable: !1,
|
|
@@ -175,19 +158,19 @@ function ae() {
|
|
|
175
158
|
configurable: !1,
|
|
176
159
|
enumerable: !1,
|
|
177
160
|
writable: !0,
|
|
178
|
-
value:
|
|
161
|
+
value: _
|
|
179
162
|
}), Object.defineProperty(e, "_debugTask", {
|
|
180
163
|
configurable: !1,
|
|
181
164
|
enumerable: !1,
|
|
182
165
|
writable: !0,
|
|
183
|
-
value:
|
|
166
|
+
value: h
|
|
184
167
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
185
168
|
}
|
|
186
|
-
function
|
|
169
|
+
function O(e, r, t, n, _, h) {
|
|
187
170
|
var o = r.children;
|
|
188
171
|
if (o !== void 0)
|
|
189
172
|
if (n)
|
|
190
|
-
if (
|
|
173
|
+
if (K(o)) {
|
|
191
174
|
for (n = 0; n < o.length; n++)
|
|
192
175
|
A(o[n]);
|
|
193
176
|
Object.freeze && Object.freeze(o);
|
|
@@ -196,12 +179,12 @@ function ae() {
|
|
|
196
179
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
197
180
|
);
|
|
198
181
|
else A(o);
|
|
199
|
-
if (
|
|
200
|
-
o =
|
|
201
|
-
var
|
|
202
|
-
return
|
|
182
|
+
if (P.call(r, "key")) {
|
|
183
|
+
o = s(e);
|
|
184
|
+
var m = Object.keys(r).filter(function(ee) {
|
|
185
|
+
return ee !== "key";
|
|
203
186
|
});
|
|
204
|
-
n = 0 <
|
|
187
|
+
n = 0 < m.length ? "{key: someKey, " + m.join(": ..., ") + ": ...}" : "{key: someKey}", F[o + n] || (m = 0 < m.length ? "{" + m.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
205
188
|
`A props object containing a "key" prop is being spread into JSX:
|
|
206
189
|
let props = %s;
|
|
207
190
|
<%s {...props} />
|
|
@@ -210,98 +193,95 @@ React keys must be passed directly to JSX without using spread:
|
|
|
210
193
|
<%s key={someKey} {...props} />`,
|
|
211
194
|
n,
|
|
212
195
|
o,
|
|
213
|
-
|
|
196
|
+
m,
|
|
214
197
|
o
|
|
215
|
-
),
|
|
198
|
+
), F[o + n] = !0);
|
|
216
199
|
}
|
|
217
|
-
if (o = null, t !== void 0 && (
|
|
200
|
+
if (o = null, t !== void 0 && (f(t), o = "" + t), u(r) && (f(r.key), o = "" + r.key), "key" in r) {
|
|
218
201
|
t = {};
|
|
219
|
-
for (var
|
|
220
|
-
|
|
202
|
+
for (var g in r)
|
|
203
|
+
g !== "key" && (t[g] = r[g]);
|
|
221
204
|
} else t = r;
|
|
222
|
-
return o &&
|
|
205
|
+
return o && d(
|
|
223
206
|
t,
|
|
224
207
|
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
225
|
-
),
|
|
208
|
+
), W(
|
|
226
209
|
e,
|
|
227
210
|
o,
|
|
228
|
-
l,
|
|
229
|
-
d,
|
|
230
|
-
a(),
|
|
231
211
|
t,
|
|
232
|
-
|
|
233
|
-
|
|
212
|
+
a(),
|
|
213
|
+
_,
|
|
214
|
+
h
|
|
234
215
|
);
|
|
235
216
|
}
|
|
236
217
|
function A(e) {
|
|
237
|
-
typeof e == "object" && e !== null && e.$$typeof ===
|
|
218
|
+
j(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === T && (e._payload.status === "fulfilled" ? j(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
238
219
|
}
|
|
239
|
-
|
|
220
|
+
function j(e) {
|
|
221
|
+
return typeof e == "object" && e !== null && e.$$typeof === S;
|
|
222
|
+
}
|
|
223
|
+
var b = re, S = /* @__PURE__ */ Symbol.for("react.transitional.element"), U = /* @__PURE__ */ Symbol.for("react.portal"), R = /* @__PURE__ */ Symbol.for("react.fragment"), z = /* @__PURE__ */ Symbol.for("react.strict_mode"), q = /* @__PURE__ */ Symbol.for("react.profiler"), J = /* @__PURE__ */ Symbol.for("react.consumer"), V = /* @__PURE__ */ Symbol.for("react.context"), G = /* @__PURE__ */ Symbol.for("react.forward_ref"), X = /* @__PURE__ */ Symbol.for("react.suspense"), B = /* @__PURE__ */ Symbol.for("react.suspense_list"), H = /* @__PURE__ */ Symbol.for("react.memo"), T = /* @__PURE__ */ Symbol.for("react.lazy"), Z = /* @__PURE__ */ Symbol.for("react.activity"), Q = /* @__PURE__ */ Symbol.for("react.client.reference"), k = b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, P = Object.prototype.hasOwnProperty, K = Array.isArray, x = console.createTask ? console.createTask : function() {
|
|
240
224
|
return null;
|
|
241
225
|
};
|
|
242
|
-
|
|
226
|
+
b = {
|
|
243
227
|
react_stack_bottom_frame: function(e) {
|
|
244
228
|
return e();
|
|
245
229
|
}
|
|
246
230
|
};
|
|
247
|
-
var
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
)(),
|
|
251
|
-
|
|
252
|
-
var
|
|
253
|
-
return
|
|
231
|
+
var N, C = {}, Y = b.react_stack_bottom_frame.bind(
|
|
232
|
+
b,
|
|
233
|
+
l
|
|
234
|
+
)(), $ = x(c(l)), F = {};
|
|
235
|
+
E.Fragment = R, E.jsx = function(e, r, t) {
|
|
236
|
+
var n = 1e4 > k.recentlyCreatedOwnerStacks++;
|
|
237
|
+
return O(
|
|
254
238
|
e,
|
|
255
239
|
r,
|
|
256
240
|
t,
|
|
257
241
|
!1,
|
|
258
|
-
n,
|
|
259
|
-
|
|
260
|
-
l ? Error("react-stack-top-frame") : F,
|
|
261
|
-
l ? x(f(e)) : I
|
|
242
|
+
n ? Error("react-stack-top-frame") : Y,
|
|
243
|
+
n ? x(c(e)) : $
|
|
262
244
|
);
|
|
263
|
-
},
|
|
264
|
-
var
|
|
265
|
-
return
|
|
245
|
+
}, E.jsxs = function(e, r, t) {
|
|
246
|
+
var n = 1e4 > k.recentlyCreatedOwnerStacks++;
|
|
247
|
+
return O(
|
|
266
248
|
e,
|
|
267
249
|
r,
|
|
268
250
|
t,
|
|
269
251
|
!0,
|
|
270
|
-
n,
|
|
271
|
-
|
|
272
|
-
l ? Error("react-stack-top-frame") : F,
|
|
273
|
-
l ? x(f(e)) : I
|
|
252
|
+
n ? Error("react-stack-top-frame") : Y,
|
|
253
|
+
n ? x(c(e)) : $
|
|
274
254
|
);
|
|
275
255
|
};
|
|
276
|
-
})()),
|
|
256
|
+
})()), E;
|
|
277
257
|
}
|
|
278
|
-
var
|
|
279
|
-
function
|
|
280
|
-
return
|
|
258
|
+
var M;
|
|
259
|
+
function ae() {
|
|
260
|
+
return M || (M = 1, process.env.NODE_ENV === "production" ? v.exports = ne() : v.exports = oe()), v.exports;
|
|
281
261
|
}
|
|
282
|
-
var y =
|
|
283
|
-
function
|
|
284
|
-
isOpen:
|
|
262
|
+
var y = ae();
|
|
263
|
+
function fe({
|
|
264
|
+
isOpen: s,
|
|
285
265
|
onClose: i,
|
|
286
|
-
closeOnOverlayClick:
|
|
287
|
-
closeOnEsc:
|
|
266
|
+
closeOnOverlayClick: f = !0,
|
|
267
|
+
closeOnEsc: c = !0,
|
|
288
268
|
children: a
|
|
289
269
|
}) {
|
|
290
|
-
const
|
|
291
|
-
|
|
270
|
+
const l = (u) => {
|
|
271
|
+
f && u.target === u.currentTarget && i();
|
|
292
272
|
};
|
|
293
|
-
return
|
|
294
|
-
if (!
|
|
295
|
-
const
|
|
296
|
-
|
|
273
|
+
return te(() => {
|
|
274
|
+
if (!s || !c) return;
|
|
275
|
+
const u = (d) => {
|
|
276
|
+
d.key === "Escape" && i();
|
|
297
277
|
};
|
|
298
|
-
return document.addEventListener("keydown",
|
|
299
|
-
}, [
|
|
300
|
-
/* @__PURE__ */ y.jsx(
|
|
278
|
+
return document.addEventListener("keydown", u), () => document.removeEventListener("keydown", u);
|
|
279
|
+
}, [s, c, i]), s ? /* @__PURE__ */ y.jsx(le, { onClick: l, children: /* @__PURE__ */ y.jsxs(se, { children: [
|
|
280
|
+
/* @__PURE__ */ y.jsx(ue, { onClick: i, "aria-label": "Fermer la modale", children: "×" }),
|
|
301
281
|
a
|
|
302
282
|
] }) }) : null;
|
|
303
283
|
}
|
|
304
|
-
const
|
|
284
|
+
const le = w.div`
|
|
305
285
|
position: fixed;
|
|
306
286
|
top: 0;
|
|
307
287
|
left: 0;
|
|
@@ -312,7 +292,7 @@ const ue = O.div`
|
|
|
312
292
|
align-items: center;
|
|
313
293
|
justify-content: center;
|
|
314
294
|
z-index: 50;
|
|
315
|
-
`,
|
|
295
|
+
`, se = w.div`
|
|
316
296
|
background-color: white;
|
|
317
297
|
border-radius: 12px;
|
|
318
298
|
padding: 24px;
|
|
@@ -321,7 +301,7 @@ const ue = O.div`
|
|
|
321
301
|
max-width: 90vw;
|
|
322
302
|
max-height: 90vh;
|
|
323
303
|
overflow: auto;
|
|
324
|
-
`,
|
|
304
|
+
`, ue = w.button`
|
|
325
305
|
position: absolute;
|
|
326
306
|
top: 8px;
|
|
327
307
|
right: 8px;
|
|
@@ -342,5 +322,5 @@ const ue = O.div`
|
|
|
342
322
|
}
|
|
343
323
|
`;
|
|
344
324
|
export {
|
|
345
|
-
|
|
325
|
+
fe as default
|
|
346
326
|
};
|
package/dist/BenalModal.umd.js
CHANGED
|
@@ -1,25 +1,9 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var A;function U(){if(A)return R;A=1;var u=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function E(d,a,s){var c=null;if(s!==void 0&&(c=""+s),a.key!==void 0&&(c=""+a.key),"key"in a){s={};for(var b in a)b!=="key"&&(s[b]=a[b])}else s=a;return a=s.ref,{$$typeof:u,type:d,key:c,ref:a!==void 0?a:null,props:s}}return R.Fragment=l,R.jsx=E,R.jsxs=E,R}var _={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.development.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var S;function z(){return S||(S=1,process.env.NODE_ENV!=="production"&&(function(){function u(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ue?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case h:return"Fragment";case K:return"Profiler";case Q:return"StrictMode";case ne:return"Suspense";case oe:return"SuspenseList";case se:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case Z:return"Portal";case re:return(e.displayName||"Context")+".Provider";case ee:return(e._context.displayName||"Context")+".Consumer";case te:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ae:return r=e.displayName||null,r!==null?r:u(e.type)||"Memo";case F:r=e._payload,e=e._init;try{return u(e(r))}catch{}}return null}function l(e){return""+e}function E(e){try{l(e);var r=!1}catch{r=!0}if(r){r=console;var t=r.error,n=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",n),l(e)}}function d(e){if(e===h)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===F)return"<...>";try{var r=u(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function a(){var e=g.A;return e===null?null:e.getOwner()}function s(){return Error("react-stack-top-frame")}function c(e){if(I.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function b(e,r){function t(){M||(M=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}function B(){var e=u(this.type);return D[e]||(D[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function H(e,r,t,n,m,i,y,j){return t=i.ref,e={$$typeof:Y,type:e,key:r,props:i,_owner:m},(t!==void 0?t:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:B}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:y}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:j}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function N(e,r,t,n,m,i,y,j){var o=r.children;if(o!==void 0)if(n)if(ce(o)){for(n=0;n<o.length;n++)C(o[n]);Object.freeze&&Object.freeze(o)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else C(o);if(I.call(r,"key")){o=u(e);var v=Object.keys(r).filter(function(ie){return ie!=="key"});n=0<v.length?"{key: someKey, "+v.join(": ..., ")+": ...}":"{key: someKey}",$[o+n]||(v=0<v.length?"{"+v.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
1
|
+
(function(c,d){typeof exports=="object"&&typeof module<"u"?module.exports=d(require("react"),require("styled-components")):typeof define=="function"&&define.amd?define(["react","styled-components"],d):(c=typeof globalThis<"u"?globalThis:c||self,c.BenalModal=d(c.React,c.styled))})(this,(function(c,d){"use strict";var v={exports:{}},_={};var j;function W(){if(j)return _;j=1;var u=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function m(f,a,s){var l=null;if(s!==void 0&&(l=""+s),a.key!==void 0&&(l=""+a.key),"key"in a){s={};for(var p in a)p!=="key"&&(s[p]=a[p])}else s=a;return a=s.ref,{$$typeof:u,type:f,key:l,ref:a!==void 0?a:null,props:s}}return _.Fragment=i,_.jsx=m,_.jsxs=m,_}var b={};var A;function U(){return A||(A=1,process.env.NODE_ENV!=="production"&&(function(){function u(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===se?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case x:return"Fragment";case Q:return"Profiler";case Z:return"StrictMode";case te:return"Suspense";case ne:return"SuspenseList";case ae:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case H:return"Portal";case ee:return e.displayName||"Context";case K:return(e._context.displayName||"Context")+".Consumer";case re:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case oe:return r=e.displayName||null,r!==null?r:u(e.type)||"Memo";case h:r=e._payload,e=e._init;try{return u(e(r))}catch{}}return null}function i(e){return""+e}function m(e){try{i(e);var r=!1}catch{r=!0}if(r){r=console;var t=r.error,n=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",n),i(e)}}function f(e){if(e===x)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===h)return"<...>";try{var r=u(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function a(){var e=y.A;return e===null?null:e.getOwner()}function s(){return Error("react-stack-top-frame")}function l(e){if(F.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function p(e,r){function t(){I||(I=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}function X(){var e=u(this.type);return M[e]||(M[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function B(e,r,t,n,T,w){var o=t.ref;return e={$$typeof:Y,type:e,key:r,props:t,_owner:n},(o!==void 0?o:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:X}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:T}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:w}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function P(e,r,t,n,T,w){var o=r.children;if(o!==void 0)if(n)if(ue(o)){for(n=0;n<o.length;n++)N(o[n]);Object.freeze&&Object.freeze(o)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else N(o);if(F.call(r,"key")){o=u(e);var E=Object.keys(r).filter(function(le){return le!=="key"});n=0<E.length?"{key: someKey, "+E.join(": ..., ")+": ...}":"{key: someKey}",$[o+n]||(E=0<E.length?"{"+E.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
2
|
let props = %s;
|
|
19
3
|
<%s {...props} />
|
|
20
4
|
React keys must be passed directly to JSX without using spread:
|
|
21
5
|
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,n,o,
|
|
6
|
+
<%s key={someKey} {...props} />`,n,o,E,o),$[o+n]=!0)}if(o=null,t!==void 0&&(m(t),o=""+t),l(r)&&(m(r.key),o=""+r.key),"key"in r){t={};for(var O in r)O!=="key"&&(t[O]=r[O])}else t=r;return o&&p(t,typeof e=="function"?e.displayName||e.name||"Unknown":e),B(e,o,t,a(),T,w)}function N(e){C(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===h&&(e._payload.status==="fulfilled"?C(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function C(e){return typeof e=="object"&&e!==null&&e.$$typeof===Y}var R=c,Y=Symbol.for("react.transitional.element"),H=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),Z=Symbol.for("react.strict_mode"),Q=Symbol.for("react.profiler"),K=Symbol.for("react.consumer"),ee=Symbol.for("react.context"),re=Symbol.for("react.forward_ref"),te=Symbol.for("react.suspense"),ne=Symbol.for("react.suspense_list"),oe=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),ae=Symbol.for("react.activity"),se=Symbol.for("react.client.reference"),y=R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=Object.prototype.hasOwnProperty,ue=Array.isArray,g=console.createTask?console.createTask:function(){return null};R={react_stack_bottom_frame:function(e){return e()}};var I,M={},D=R.react_stack_bottom_frame.bind(R,s)(),L=g(f(s)),$={};b.Fragment=x,b.jsx=function(e,r,t){var n=1e4>y.recentlyCreatedOwnerStacks++;return P(e,r,t,!1,n?Error("react-stack-top-frame"):D,n?g(f(e)):L)},b.jsxs=function(e,r,t){var n=1e4>y.recentlyCreatedOwnerStacks++;return P(e,r,t,!0,n?Error("react-stack-top-frame"):D,n?g(f(e)):L)}})()),b}var S;function z(){return S||(S=1,process.env.NODE_ENV==="production"?v.exports=W():v.exports=U()),v.exports}var k=z();function q({isOpen:u,onClose:i,closeOnOverlayClick:m=!0,closeOnEsc:f=!0,children:a}){const s=l=>{m&&l.target===l.currentTarget&&i()};return c.useEffect(()=>{if(!u||!f)return;const l=p=>{p.key==="Escape"&&i()};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[u,f,i]),u?k.jsx(J,{onClick:s,children:k.jsxs(V,{children:[k.jsx(G,{onClick:i,"aria-label":"Fermer la modale",children:"×"}),a]})}):null}const J=d.div`
|
|
23
7
|
position: fixed;
|
|
24
8
|
top: 0;
|
|
25
9
|
left: 0;
|
|
@@ -30,7 +14,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
30
14
|
align-items: center;
|
|
31
15
|
justify-content: center;
|
|
32
16
|
z-index: 50;
|
|
33
|
-
`,
|
|
17
|
+
`,V=d.div`
|
|
34
18
|
background-color: white;
|
|
35
19
|
border-radius: 12px;
|
|
36
20
|
padding: 24px;
|
|
@@ -39,7 +23,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
39
23
|
max-width: 90vw;
|
|
40
24
|
max-height: 90vh;
|
|
41
25
|
overflow: auto;
|
|
42
|
-
`,
|
|
26
|
+
`,G=d.button`
|
|
43
27
|
position: absolute;
|
|
44
28
|
top: 8px;
|
|
45
29
|
right: 8px;
|
|
@@ -58,4 +42,4 @@ React keys must be passed directly to JSX without using spread:
|
|
|
58
42
|
color: #000;
|
|
59
43
|
background-color: #f5f5f5;
|
|
60
44
|
}
|
|
61
|
-
`;return
|
|
45
|
+
`;return q}));
|
package/package.json
CHANGED
|
@@ -1,30 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "benal18-modal",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "Modale réutilisable",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"Modale",
|
|
7
|
-
"react"
|
|
8
|
-
],
|
|
9
5
|
"author": "BEN SALAH Walid",
|
|
6
|
+
"license": "MIT",
|
|
10
7
|
"type": "module",
|
|
11
|
-
"main": "dist/BenalModal.
|
|
12
|
-
"module": "dist/BenalModal.
|
|
13
|
-
"types": "dist/
|
|
8
|
+
"main": "./dist/BenalModal.umd.js",
|
|
9
|
+
"module": "./dist/BenalModal.es.js",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"import": "./dist/BenalModal.es.js",
|
|
14
|
+
"require": "./dist/BenalModal.umd.js",
|
|
15
|
+
"types": "./dist/index.d.ts"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
14
18
|
"files": [
|
|
15
19
|
"dist"
|
|
16
20
|
],
|
|
21
|
+
"peerDependencies": {
|
|
22
|
+
"react": ">=18",
|
|
23
|
+
"react-dom": ">=18"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"styled-components": "^6.1.19"
|
|
27
|
+
},
|
|
17
28
|
"scripts": {
|
|
18
29
|
"dev": "vite",
|
|
19
30
|
"build": "vite build",
|
|
20
31
|
"lint": "eslint .",
|
|
21
32
|
"preview": "vite preview"
|
|
22
33
|
},
|
|
23
|
-
"dependencies": {
|
|
24
|
-
"react": "^19.1.1",
|
|
25
|
-
"react-dom": "^19.1.1",
|
|
26
|
-
"styled-components": "^6.1.19"
|
|
27
|
-
},
|
|
28
34
|
"devDependencies": {
|
|
29
35
|
"@eslint/js": "^9.36.0",
|
|
30
36
|
"@types/react": "^19.1.13",
|
|
@@ -34,6 +40,8 @@
|
|
|
34
40
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
35
41
|
"eslint-plugin-react-refresh": "^0.4.20",
|
|
36
42
|
"globals": "^16.4.0",
|
|
37
|
-
"vite": "^7.1.7"
|
|
43
|
+
"vite": "^7.1.7",
|
|
44
|
+
"react": "^19.1.1",
|
|
45
|
+
"react-dom": "^19.1.1"
|
|
38
46
|
}
|
|
39
47
|
}
|