@phillips/seldon 1.23.0 → 1.24.0

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.
Files changed (68) hide show
  1. package/dist/_virtual/Modal.js +4 -0
  2. package/dist/_virtual/ModalPortal.js +4 -0
  3. package/dist/_virtual/_commonjsHelpers.js +25 -3
  4. package/dist/_virtual/ariaAppHider.js +4 -0
  5. package/dist/_virtual/bodyTrap.js +4 -0
  6. package/dist/_virtual/classList.js +4 -0
  7. package/dist/_virtual/focusManager.js +4 -0
  8. package/dist/_virtual/index2.js +4 -0
  9. package/dist/_virtual/index3.js +4 -0
  10. package/dist/_virtual/index4.js +4 -0
  11. package/dist/_virtual/index5.js +4 -0
  12. package/dist/_virtual/portalOpenInstances.js +4 -0
  13. package/dist/_virtual/react-is.development.js +4 -0
  14. package/dist/_virtual/react-is.production.min.js +4 -0
  15. package/dist/_virtual/react-lifecycles-compat.es.js +6 -0
  16. package/dist/_virtual/safeHTMLElement.js +4 -0
  17. package/dist/_virtual/scopeTab.js +4 -0
  18. package/dist/_virtual/tabbable.js +4 -0
  19. package/dist/assets/close.svg.js +5 -0
  20. package/dist/components/Button/Button.d.ts +9 -0
  21. package/dist/components/Footer/Footer.d.ts +3 -1
  22. package/dist/components/Grid/Grid.d.ts +9 -0
  23. package/dist/components/GridItem/GridItem.d.ts +3 -1
  24. package/dist/components/HeroBanner/HeroBanner.d.ts +9 -0
  25. package/dist/components/IconButton/IconButton.d.ts +12 -0
  26. package/dist/components/IconButton/IconButton.js +16 -0
  27. package/dist/components/Input/Input.d.ts +13 -0
  28. package/dist/components/Link/Link.d.ts +3 -1
  29. package/dist/components/LinkBlock/LinkBlock.d.ts +3 -1
  30. package/dist/components/LinkList/LinkList.d.ts +3 -1
  31. package/dist/components/Modal/Modal.d.ts +23 -0
  32. package/dist/components/Modal/Modal.js +45 -0
  33. package/dist/components/Row/Row.d.ts +3 -1
  34. package/dist/components/Select/Select.d.ts +9 -0
  35. package/dist/components/Social/Social.d.ts +3 -1
  36. package/dist/components/Subscribe/Subscribe.d.ts +3 -1
  37. package/dist/components/Text/Text.d.ts +3 -1
  38. package/dist/index.d.ts +2 -0
  39. package/dist/index.js +54 -50
  40. package/dist/node_modules/exenv/index.js +21 -0
  41. package/dist/node_modules/object-assign/index.js +55 -0
  42. package/dist/node_modules/prop-types/checkPropTypes.js +55 -0
  43. package/dist/node_modules/prop-types/factoryWithThrowingShims.js +53 -0
  44. package/dist/node_modules/prop-types/factoryWithTypeCheckers.js +330 -0
  45. package/dist/node_modules/prop-types/index.js +13 -0
  46. package/dist/node_modules/prop-types/lib/ReactPropTypesSecret.js +11 -0
  47. package/dist/node_modules/prop-types/lib/has.js +7 -0
  48. package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js +95 -0
  49. package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js +79 -0
  50. package/dist/node_modules/prop-types/node_modules/react-is/index.js +10 -0
  51. package/dist/node_modules/react-lifecycles-compat/react-lifecycles-compat.es.js +63 -0
  52. package/dist/node_modules/react-modal/lib/components/Modal.js +237 -0
  53. package/dist/node_modules/react-modal/lib/components/ModalPortal.js +249 -0
  54. package/dist/node_modules/react-modal/lib/helpers/ariaAppHider.js +91 -0
  55. package/dist/node_modules/react-modal/lib/helpers/bodyTrap.js +42 -0
  56. package/dist/node_modules/react-modal/lib/helpers/classList.js +62 -0
  57. package/dist/node_modules/react-modal/lib/helpers/focusManager.js +67 -0
  58. package/dist/node_modules/react-modal/lib/helpers/portalOpenInstances.js +46 -0
  59. package/dist/node_modules/react-modal/lib/helpers/safeHTMLElement.js +15 -0
  60. package/dist/node_modules/react-modal/lib/helpers/scopeTab.js +46 -0
  61. package/dist/node_modules/react-modal/lib/helpers/tabbable.js +62 -0
  62. package/dist/node_modules/react-modal/lib/index.js +19 -0
  63. package/dist/node_modules/warning/warning.js +33 -0
  64. package/dist/scss/components/IconButton/_iconButton.scss +47 -0
  65. package/dist/scss/components/Modal/_modal.scss +29 -0
  66. package/dist/scss/components/Modal/_modal.stories.scss +5 -0
  67. package/dist/scss/styles.scss +2 -0
  68. package/package.json +4 -2
@@ -0,0 +1,79 @@
1
+ import { __exports as r } from "../../../../../_virtual/react-is.production.min.js";
2
+ /** @license React v16.13.1
3
+ * react-is.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its 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
+ */
10
+ var _;
11
+ function g() {
12
+ if (_)
13
+ return r;
14
+ _ = 1;
15
+ var t = typeof Symbol == "function" && Symbol.for, a = t ? Symbol.for("react.element") : 60103, b = t ? Symbol.for("react.portal") : 60106, n = t ? Symbol.for("react.fragment") : 60107, c = t ? Symbol.for("react.strict_mode") : 60108, f = t ? Symbol.for("react.profiler") : 60114, i = t ? Symbol.for("react.provider") : 60109, s = t ? Symbol.for("react.context") : 60110, d = t ? Symbol.for("react.async_mode") : 60111, u = t ? Symbol.for("react.concurrent_mode") : 60111, y = t ? Symbol.for("react.forward_ref") : 60112, l = t ? Symbol.for("react.suspense") : 60113, x = t ? Symbol.for("react.suspense_list") : 60120, m = t ? Symbol.for("react.memo") : 60115, p = t ? Symbol.for("react.lazy") : 60116, C = t ? Symbol.for("react.block") : 60121, M = t ? Symbol.for("react.fundamental") : 60117, v = t ? Symbol.for("react.responder") : 60118, w = t ? Symbol.for("react.scope") : 60119;
16
+ function o(e) {
17
+ if (typeof e == "object" && e !== null) {
18
+ var S = e.$$typeof;
19
+ switch (S) {
20
+ case a:
21
+ switch (e = e.type, e) {
22
+ case d:
23
+ case u:
24
+ case n:
25
+ case f:
26
+ case c:
27
+ case l:
28
+ return e;
29
+ default:
30
+ switch (e = e && e.$$typeof, e) {
31
+ case s:
32
+ case y:
33
+ case p:
34
+ case m:
35
+ case i:
36
+ return e;
37
+ default:
38
+ return S;
39
+ }
40
+ }
41
+ case b:
42
+ return S;
43
+ }
44
+ }
45
+ }
46
+ function $(e) {
47
+ return o(e) === u;
48
+ }
49
+ return r.AsyncMode = d, r.ConcurrentMode = u, r.ContextConsumer = s, r.ContextProvider = i, r.Element = a, r.ForwardRef = y, r.Fragment = n, r.Lazy = p, r.Memo = m, r.Portal = b, r.Profiler = f, r.StrictMode = c, r.Suspense = l, r.isAsyncMode = function(e) {
50
+ return $(e) || o(e) === d;
51
+ }, r.isConcurrentMode = $, r.isContextConsumer = function(e) {
52
+ return o(e) === s;
53
+ }, r.isContextProvider = function(e) {
54
+ return o(e) === i;
55
+ }, r.isElement = function(e) {
56
+ return typeof e == "object" && e !== null && e.$$typeof === a;
57
+ }, r.isForwardRef = function(e) {
58
+ return o(e) === y;
59
+ }, r.isFragment = function(e) {
60
+ return o(e) === n;
61
+ }, r.isLazy = function(e) {
62
+ return o(e) === p;
63
+ }, r.isMemo = function(e) {
64
+ return o(e) === m;
65
+ }, r.isPortal = function(e) {
66
+ return o(e) === b;
67
+ }, r.isProfiler = function(e) {
68
+ return o(e) === f;
69
+ }, r.isStrictMode = function(e) {
70
+ return o(e) === c;
71
+ }, r.isSuspense = function(e) {
72
+ return o(e) === l;
73
+ }, r.isValidElementType = function(e) {
74
+ return typeof e == "string" || typeof e == "function" || e === n || e === u || e === f || e === c || e === l || e === x || typeof e == "object" && e !== null && (e.$$typeof === p || e.$$typeof === m || e.$$typeof === i || e.$$typeof === s || e.$$typeof === y || e.$$typeof === M || e.$$typeof === v || e.$$typeof === w || e.$$typeof === C);
75
+ }, r.typeOf = o, r;
76
+ }
77
+ export {
78
+ g as __require
79
+ };
@@ -0,0 +1,10 @@
1
+ import { __module as e } from "../../../../_virtual/index5.js";
2
+ import { __require as o } from "./cjs/react-is.production.min.js";
3
+ import { __require as t } from "./cjs/react-is.development.js";
4
+ var r;
5
+ function p() {
6
+ return r ? e.exports : (r = 1, process.env.NODE_ENV === "production" ? e.exports = o() : e.exports = t(), e.exports);
7
+ }
8
+ export {
9
+ p as __require
10
+ };
@@ -0,0 +1,63 @@
1
+ function l() {
2
+ var t = this.constructor.getDerivedStateFromProps(this.props, this.state);
3
+ t != null && this.setState(t);
4
+ }
5
+ function p(t) {
6
+ function e(o) {
7
+ var n = this.constructor.getDerivedStateFromProps(t, o);
8
+ return n != null ? n : null;
9
+ }
10
+ this.setState(e.bind(this));
11
+ }
12
+ function r(t, e) {
13
+ try {
14
+ var o = this.props, n = this.state;
15
+ this.props = t, this.state = e, this.__reactInternalSnapshotFlag = !0, this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(
16
+ o,
17
+ n
18
+ );
19
+ } finally {
20
+ this.props = o, this.state = n;
21
+ }
22
+ }
23
+ l.__suppressDeprecationWarning = !0;
24
+ p.__suppressDeprecationWarning = !0;
25
+ r.__suppressDeprecationWarning = !0;
26
+ function y(t) {
27
+ var e = t.prototype;
28
+ if (!e || !e.isReactComponent)
29
+ throw new Error("Can only polyfill class components");
30
+ if (typeof t.getDerivedStateFromProps != "function" && typeof e.getSnapshotBeforeUpdate != "function")
31
+ return t;
32
+ var o = null, n = null, i = null;
33
+ if (typeof e.componentWillMount == "function" ? o = "componentWillMount" : typeof e.UNSAFE_componentWillMount == "function" && (o = "UNSAFE_componentWillMount"), typeof e.componentWillReceiveProps == "function" ? n = "componentWillReceiveProps" : typeof e.UNSAFE_componentWillReceiveProps == "function" && (n = "UNSAFE_componentWillReceiveProps"), typeof e.componentWillUpdate == "function" ? i = "componentWillUpdate" : typeof e.UNSAFE_componentWillUpdate == "function" && (i = "UNSAFE_componentWillUpdate"), o !== null || n !== null || i !== null) {
34
+ var a = t.displayName || t.name, s = typeof t.getDerivedStateFromProps == "function" ? "getDerivedStateFromProps()" : "getSnapshotBeforeUpdate()";
35
+ throw Error(
36
+ `Unsafe legacy lifecycles will not be called for components using new component APIs.
37
+
38
+ ` + a + " uses " + s + " but also contains the following legacy lifecycles:" + (o !== null ? `
39
+ ` + o : "") + (n !== null ? `
40
+ ` + n : "") + (i !== null ? `
41
+ ` + i : "") + `
42
+
43
+ The above lifecycles should be removed. Learn more about this warning here:
44
+ https://fb.me/react-async-component-lifecycle-hooks`
45
+ );
46
+ }
47
+ if (typeof t.getDerivedStateFromProps == "function" && (e.componentWillMount = l, e.componentWillReceiveProps = p), typeof e.getSnapshotBeforeUpdate == "function") {
48
+ if (typeof e.componentDidUpdate != "function")
49
+ throw new Error(
50
+ "Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype"
51
+ );
52
+ e.componentWillUpdate = r;
53
+ var c = e.componentDidUpdate;
54
+ e.componentDidUpdate = function(f, u, d) {
55
+ var h = this.__reactInternalSnapshotFlag ? this.__reactInternalSnapshot : d;
56
+ c.call(this, f, u, h);
57
+ };
58
+ }
59
+ return t;
60
+ }
61
+ export {
62
+ y as polyfill
63
+ };
@@ -0,0 +1,237 @@
1
+ import { __exports as d } from "../../../../_virtual/Modal.js";
2
+ import N from "react";
3
+ import T from "react-dom";
4
+ import { p as x } from "../../../prop-types/index.js";
5
+ import { M as A } from "./ModalPortal.js";
6
+ import "../helpers/ariaAppHider.js";
7
+ import "../helpers/safeHTMLElement.js";
8
+ import D from "../../../../_virtual/react-lifecycles-compat.es.js";
9
+ import { __exports as w } from "../../../../_virtual/safeHTMLElement.js";
10
+ import { __exports as q } from "../../../../_virtual/ariaAppHider.js";
11
+ Object.defineProperty(d, "__esModule", {
12
+ value: !0
13
+ });
14
+ d.bodyOpenClassName = d.portalClassName = void 0;
15
+ var g = Object.assign || function(r) {
16
+ for (var e = 1; e < arguments.length; e++) {
17
+ var o = arguments[e];
18
+ for (var a in o)
19
+ Object.prototype.hasOwnProperty.call(o, a) && (r[a] = o[a]);
20
+ }
21
+ return r;
22
+ }, H = /* @__PURE__ */ function() {
23
+ function r(e, o) {
24
+ for (var a = 0; a < o.length; a++) {
25
+ var n = o[a];
26
+ n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n);
27
+ }
28
+ }
29
+ return function(e, o, a) {
30
+ return o && r(e.prototype, o), a && r(e, a), e;
31
+ };
32
+ }(), R = N, O = m(R), U = T, _ = m(U), L = x, t = m(L), k = A, C = m(k), $ = q, W = B($), u = w, M = m(u), F = D;
33
+ function B(r) {
34
+ if (r && r.__esModule)
35
+ return r;
36
+ var e = {};
37
+ if (r != null)
38
+ for (var o in r)
39
+ Object.prototype.hasOwnProperty.call(r, o) && (e[o] = r[o]);
40
+ return e.default = r, e;
41
+ }
42
+ function m(r) {
43
+ return r && r.__esModule ? r : { default: r };
44
+ }
45
+ function j(r, e) {
46
+ if (!(r instanceof e))
47
+ throw new TypeError("Cannot call a class as a function");
48
+ }
49
+ function E(r, e) {
50
+ if (!r)
51
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
52
+ return e && (typeof e == "object" || typeof e == "function") ? e : r;
53
+ }
54
+ function I(r, e) {
55
+ if (typeof e != "function" && e !== null)
56
+ throw new TypeError("Super expression must either be null or a function, not " + typeof e);
57
+ r.prototype = Object.create(e && e.prototype, { constructor: { value: r, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(r, e) : r.__proto__ = e);
58
+ }
59
+ var V = d.portalClassName = "ReactModalPortal", z = d.bodyOpenClassName = "ReactModal__Body--open", s = u.canUseDOM && _.default.createPortal !== void 0, b = function(e) {
60
+ return document.createElement(e);
61
+ }, P = function() {
62
+ return s ? _.default.createPortal : _.default.unstable_renderSubtreeIntoContainer;
63
+ };
64
+ function y(r) {
65
+ return r();
66
+ }
67
+ var p = function(r) {
68
+ I(e, r);
69
+ function e() {
70
+ var o, a, n, l;
71
+ j(this, e);
72
+ for (var c = arguments.length, v = Array(c), f = 0; f < c; f++)
73
+ v[f] = arguments[f];
74
+ return l = (a = (n = E(this, (o = e.__proto__ || Object.getPrototypeOf(e)).call.apply(o, [this].concat(v))), n), n.removePortal = function() {
75
+ !s && _.default.unmountComponentAtNode(n.node);
76
+ var i = y(n.props.parentSelector);
77
+ i && i.contains(n.node) ? i.removeChild(n.node) : console.warn('React-Modal: "parentSelector" prop did not returned any DOM element. Make sure that the parent element is unmounted to avoid any memory leaks.');
78
+ }, n.portalRef = function(i) {
79
+ n.portal = i;
80
+ }, n.renderPortal = function(i) {
81
+ var h = P(), S = h(n, O.default.createElement(C.default, g({ defaultStyles: e.defaultStyles }, i)), n.node);
82
+ n.portalRef(S);
83
+ }, a), E(n, l);
84
+ }
85
+ return H(e, [{
86
+ key: "componentDidMount",
87
+ value: function() {
88
+ if (u.canUseDOM) {
89
+ s || (this.node = b("div")), this.node.className = this.props.portalClassName;
90
+ var a = y(this.props.parentSelector);
91
+ a.appendChild(this.node), !s && this.renderPortal(this.props);
92
+ }
93
+ }
94
+ }, {
95
+ key: "getSnapshotBeforeUpdate",
96
+ value: function(a) {
97
+ var n = y(a.parentSelector), l = y(this.props.parentSelector);
98
+ return { prevParent: n, nextParent: l };
99
+ }
100
+ }, {
101
+ key: "componentDidUpdate",
102
+ value: function(a, n, l) {
103
+ if (u.canUseDOM) {
104
+ var c = this.props, v = c.isOpen, f = c.portalClassName;
105
+ a.portalClassName !== f && (this.node.className = f);
106
+ var i = l.prevParent, h = l.nextParent;
107
+ h !== i && (i.removeChild(this.node), h.appendChild(this.node)), !(!a.isOpen && !v) && !s && this.renderPortal(this.props);
108
+ }
109
+ }
110
+ }, {
111
+ key: "componentWillUnmount",
112
+ value: function() {
113
+ if (!(!u.canUseDOM || !this.node || !this.portal)) {
114
+ var a = this.portal.state, n = Date.now(), l = a.isOpen && this.props.closeTimeoutMS && (a.closesAt || n + this.props.closeTimeoutMS);
115
+ l ? (a.beforeClose || this.portal.closeWithTimeout(), setTimeout(this.removePortal, l - n)) : this.removePortal();
116
+ }
117
+ }
118
+ }, {
119
+ key: "render",
120
+ value: function() {
121
+ if (!u.canUseDOM || !s)
122
+ return null;
123
+ !this.node && s && (this.node = b("div"));
124
+ var a = P();
125
+ return a(O.default.createElement(C.default, g({
126
+ ref: this.portalRef,
127
+ defaultStyles: e.defaultStyles
128
+ }, this.props)), this.node);
129
+ }
130
+ }], [{
131
+ key: "setAppElement",
132
+ value: function(a) {
133
+ W.setElement(a);
134
+ }
135
+ /* eslint-disable react/no-unused-prop-types */
136
+ /* eslint-enable react/no-unused-prop-types */
137
+ }]), e;
138
+ }(R.Component);
139
+ p.propTypes = {
140
+ isOpen: t.default.bool.isRequired,
141
+ style: t.default.shape({
142
+ content: t.default.object,
143
+ overlay: t.default.object
144
+ }),
145
+ portalClassName: t.default.string,
146
+ bodyOpenClassName: t.default.string,
147
+ htmlOpenClassName: t.default.string,
148
+ className: t.default.oneOfType([t.default.string, t.default.shape({
149
+ base: t.default.string.isRequired,
150
+ afterOpen: t.default.string.isRequired,
151
+ beforeClose: t.default.string.isRequired
152
+ })]),
153
+ overlayClassName: t.default.oneOfType([t.default.string, t.default.shape({
154
+ base: t.default.string.isRequired,
155
+ afterOpen: t.default.string.isRequired,
156
+ beforeClose: t.default.string.isRequired
157
+ })]),
158
+ appElement: t.default.oneOfType([t.default.instanceOf(M.default), t.default.instanceOf(u.SafeHTMLCollection), t.default.instanceOf(u.SafeNodeList), t.default.arrayOf(t.default.instanceOf(M.default))]),
159
+ onAfterOpen: t.default.func,
160
+ onRequestClose: t.default.func,
161
+ closeTimeoutMS: t.default.number,
162
+ ariaHideApp: t.default.bool,
163
+ shouldFocusAfterRender: t.default.bool,
164
+ shouldCloseOnOverlayClick: t.default.bool,
165
+ shouldReturnFocusAfterClose: t.default.bool,
166
+ preventScroll: t.default.bool,
167
+ parentSelector: t.default.func,
168
+ aria: t.default.object,
169
+ data: t.default.object,
170
+ role: t.default.string,
171
+ contentLabel: t.default.string,
172
+ shouldCloseOnEsc: t.default.bool,
173
+ overlayRef: t.default.func,
174
+ contentRef: t.default.func,
175
+ id: t.default.string,
176
+ overlayElement: t.default.func,
177
+ contentElement: t.default.func
178
+ };
179
+ p.defaultProps = {
180
+ isOpen: !1,
181
+ portalClassName: V,
182
+ bodyOpenClassName: z,
183
+ role: "dialog",
184
+ ariaHideApp: !0,
185
+ closeTimeoutMS: 0,
186
+ shouldFocusAfterRender: !0,
187
+ shouldCloseOnEsc: !0,
188
+ shouldCloseOnOverlayClick: !0,
189
+ shouldReturnFocusAfterClose: !0,
190
+ preventScroll: !1,
191
+ parentSelector: function() {
192
+ return document.body;
193
+ },
194
+ overlayElement: function(e, o) {
195
+ return O.default.createElement(
196
+ "div",
197
+ e,
198
+ o
199
+ );
200
+ },
201
+ contentElement: function(e, o) {
202
+ return O.default.createElement(
203
+ "div",
204
+ e,
205
+ o
206
+ );
207
+ }
208
+ };
209
+ p.defaultStyles = {
210
+ overlay: {
211
+ position: "fixed",
212
+ top: 0,
213
+ left: 0,
214
+ right: 0,
215
+ bottom: 0,
216
+ backgroundColor: "rgba(255, 255, 255, 0.75)"
217
+ },
218
+ content: {
219
+ position: "absolute",
220
+ top: "40px",
221
+ left: "40px",
222
+ right: "40px",
223
+ bottom: "40px",
224
+ border: "1px solid #ccc",
225
+ background: "#fff",
226
+ overflow: "auto",
227
+ WebkitOverflowScrolling: "touch",
228
+ borderRadius: "4px",
229
+ outline: "none",
230
+ padding: "20px"
231
+ }
232
+ };
233
+ (0, F.polyfill)(p);
234
+ process.env.NODE_ENV !== "production" && (p.setCreateHTMLElement = function(r) {
235
+ return b = r;
236
+ });
237
+ d.default = p;
@@ -0,0 +1,249 @@
1
+ import { __module as T } from "../../../../_virtual/ModalPortal.js";
2
+ import $ from "react";
3
+ import { p as V } from "../../../prop-types/index.js";
4
+ import "../helpers/focusManager.js";
5
+ import { s as z } from "../helpers/scopeTab.js";
6
+ import "../helpers/ariaAppHider.js";
7
+ import "../helpers/classList.js";
8
+ import "../helpers/safeHTMLElement.js";
9
+ import "../helpers/portalOpenInstances.js";
10
+ import "../helpers/bodyTrap.js";
11
+ import { __exports as G } from "../../../../_virtual/safeHTMLElement.js";
12
+ import { __exports as J } from "../../../../_virtual/focusManager.js";
13
+ import { __exports as Q } from "../../../../_virtual/ariaAppHider.js";
14
+ import { __exports as X } from "../../../../_virtual/classList.js";
15
+ import { __exports as Y } from "../../../../_virtual/portalOpenInstances.js";
16
+ (function(E, O) {
17
+ Object.defineProperty(O, "__esModule", {
18
+ value: !0
19
+ });
20
+ var c = Object.assign || function(a) {
21
+ for (var n = 1; n < arguments.length; n++) {
22
+ var s = arguments[n];
23
+ for (var e in s)
24
+ Object.prototype.hasOwnProperty.call(s, e) && (a[e] = s[e]);
25
+ }
26
+ return a;
27
+ }, A = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(a) {
28
+ return typeof a;
29
+ } : function(a) {
30
+ return a && typeof Symbol == "function" && a.constructor === Symbol && a !== Symbol.prototype ? "symbol" : typeof a;
31
+ }, R = /* @__PURE__ */ function() {
32
+ function a(n, s) {
33
+ for (var e = 0; e < s.length; e++) {
34
+ var t = s[e];
35
+ t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(n, t.key, t);
36
+ }
37
+ }
38
+ return function(n, s, e) {
39
+ return s && a(n.prototype, s), e && a(n, e), n;
40
+ };
41
+ }(), w = $, g = V, o = m(g), D = J, p = C(D), F = z, H = m(F), k = Q, N = C(k), x = X, d = C(x), v = G, S = m(v), L = Y, M = m(L);
42
+ function C(a) {
43
+ if (a && a.__esModule)
44
+ return a;
45
+ var n = {};
46
+ if (a != null)
47
+ for (var s in a)
48
+ Object.prototype.hasOwnProperty.call(a, s) && (n[s] = a[s]);
49
+ return n.default = a, n;
50
+ }
51
+ function m(a) {
52
+ return a && a.__esModule ? a : { default: a };
53
+ }
54
+ function P(a, n) {
55
+ if (!(a instanceof n))
56
+ throw new TypeError("Cannot call a class as a function");
57
+ }
58
+ function q(a, n) {
59
+ if (!a)
60
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
61
+ return n && (typeof n == "object" || typeof n == "function") ? n : a;
62
+ }
63
+ function W(a, n) {
64
+ if (typeof n != "function" && n !== null)
65
+ throw new TypeError("Super expression must either be null or a function, not " + typeof n);
66
+ a.prototype = Object.create(n && n.prototype, { constructor: { value: a, enumerable: !1, writable: !0, configurable: !0 } }), n && (Object.setPrototypeOf ? Object.setPrototypeOf(a, n) : a.__proto__ = n);
67
+ }
68
+ var b = {
69
+ overlay: "ReactModal__Overlay",
70
+ content: "ReactModal__Content"
71
+ }, j = function(n) {
72
+ return n.code === "Tab" || n.keyCode === 9;
73
+ }, I = function(n) {
74
+ return n.code === "Escape" || n.keyCode === 27;
75
+ }, h = 0, _ = function(a) {
76
+ W(n, a);
77
+ function n(s) {
78
+ P(this, n);
79
+ var e = q(this, (n.__proto__ || Object.getPrototypeOf(n)).call(this, s));
80
+ return e.setOverlayRef = function(t) {
81
+ e.overlay = t, e.props.overlayRef && e.props.overlayRef(t);
82
+ }, e.setContentRef = function(t) {
83
+ e.content = t, e.props.contentRef && e.props.contentRef(t);
84
+ }, e.afterClose = function() {
85
+ var t = e.props, l = t.appElement, i = t.ariaHideApp, r = t.htmlOpenClassName, u = t.bodyOpenClassName, f = t.parentSelector, y = f && f().ownerDocument || document;
86
+ u && d.remove(y.body, u), r && d.remove(y.getElementsByTagName("html")[0], r), i && h > 0 && (h -= 1, h === 0 && N.show(l)), e.props.shouldFocusAfterRender && (e.props.shouldReturnFocusAfterClose ? (p.returnFocus(e.props.preventScroll), p.teardownScopedFocus()) : p.popWithoutFocus()), e.props.onAfterClose && e.props.onAfterClose(), M.default.deregister(e);
87
+ }, e.open = function() {
88
+ e.beforeOpen(), e.state.afterOpen && e.state.beforeClose ? (clearTimeout(e.closeTimer), e.setState({ beforeClose: !1 })) : (e.props.shouldFocusAfterRender && (p.setupScopedFocus(e.node), p.markForFocusLater()), e.setState({ isOpen: !0 }, function() {
89
+ e.openAnimationFrame = requestAnimationFrame(function() {
90
+ e.setState({ afterOpen: !0 }), e.props.isOpen && e.props.onAfterOpen && e.props.onAfterOpen({
91
+ overlayEl: e.overlay,
92
+ contentEl: e.content
93
+ });
94
+ });
95
+ }));
96
+ }, e.close = function() {
97
+ e.props.closeTimeoutMS > 0 ? e.closeWithTimeout() : e.closeWithoutTimeout();
98
+ }, e.focusContent = function() {
99
+ return e.content && !e.contentHasFocus() && e.content.focus({ preventScroll: !0 });
100
+ }, e.closeWithTimeout = function() {
101
+ var t = Date.now() + e.props.closeTimeoutMS;
102
+ e.setState({ beforeClose: !0, closesAt: t }, function() {
103
+ e.closeTimer = setTimeout(e.closeWithoutTimeout, e.state.closesAt - Date.now());
104
+ });
105
+ }, e.closeWithoutTimeout = function() {
106
+ e.setState({
107
+ beforeClose: !1,
108
+ isOpen: !1,
109
+ afterOpen: !1,
110
+ closesAt: null
111
+ }, e.afterClose);
112
+ }, e.handleKeyDown = function(t) {
113
+ j(t) && (0, H.default)(e.content, t), e.props.shouldCloseOnEsc && I(t) && (t.stopPropagation(), e.requestClose(t));
114
+ }, e.handleOverlayOnClick = function(t) {
115
+ e.shouldClose === null && (e.shouldClose = !0), e.shouldClose && e.props.shouldCloseOnOverlayClick && (e.ownerHandlesClose() ? e.requestClose(t) : e.focusContent()), e.shouldClose = null;
116
+ }, e.handleContentOnMouseUp = function() {
117
+ e.shouldClose = !1;
118
+ }, e.handleOverlayOnMouseDown = function(t) {
119
+ !e.props.shouldCloseOnOverlayClick && t.target == e.overlay && t.preventDefault();
120
+ }, e.handleContentOnClick = function() {
121
+ e.shouldClose = !1;
122
+ }, e.handleContentOnMouseDown = function() {
123
+ e.shouldClose = !1;
124
+ }, e.requestClose = function(t) {
125
+ return e.ownerHandlesClose() && e.props.onRequestClose(t);
126
+ }, e.ownerHandlesClose = function() {
127
+ return e.props.onRequestClose;
128
+ }, e.shouldBeClosed = function() {
129
+ return !e.state.isOpen && !e.state.beforeClose;
130
+ }, e.contentHasFocus = function() {
131
+ return document.activeElement === e.content || e.content.contains(document.activeElement);
132
+ }, e.buildClassName = function(t, l) {
133
+ var i = (typeof l == "undefined" ? "undefined" : A(l)) === "object" ? l : {
134
+ base: b[t],
135
+ afterOpen: b[t] + "--after-open",
136
+ beforeClose: b[t] + "--before-close"
137
+ }, r = i.base;
138
+ return e.state.afterOpen && (r = r + " " + i.afterOpen), e.state.beforeClose && (r = r + " " + i.beforeClose), typeof l == "string" && l ? r + " " + l : r;
139
+ }, e.attributesFromObject = function(t, l) {
140
+ return Object.keys(l).reduce(function(i, r) {
141
+ return i[t + "-" + r] = l[r], i;
142
+ }, {});
143
+ }, e.state = {
144
+ afterOpen: !1,
145
+ beforeClose: !1
146
+ }, e.shouldClose = null, e.moveFromContentToOverlay = null, e;
147
+ }
148
+ return R(n, [{
149
+ key: "componentDidMount",
150
+ value: function() {
151
+ this.props.isOpen && this.open();
152
+ }
153
+ }, {
154
+ key: "componentDidUpdate",
155
+ value: function(e, t) {
156
+ process.env.NODE_ENV !== "production" && (e.bodyOpenClassName !== this.props.bodyOpenClassName && console.warn('React-Modal: "bodyOpenClassName" prop has been modified. This may cause unexpected behavior when multiple modals are open.'), e.htmlOpenClassName !== this.props.htmlOpenClassName && console.warn('React-Modal: "htmlOpenClassName" prop has been modified. This may cause unexpected behavior when multiple modals are open.')), this.props.isOpen && !e.isOpen ? this.open() : !this.props.isOpen && e.isOpen && this.close(), this.props.shouldFocusAfterRender && this.state.isOpen && !t.isOpen && this.focusContent();
157
+ }
158
+ }, {
159
+ key: "componentWillUnmount",
160
+ value: function() {
161
+ this.state.isOpen && this.afterClose(), clearTimeout(this.closeTimer), cancelAnimationFrame(this.openAnimationFrame);
162
+ }
163
+ }, {
164
+ key: "beforeOpen",
165
+ value: function() {
166
+ var e = this.props, t = e.appElement, l = e.ariaHideApp, i = e.htmlOpenClassName, r = e.bodyOpenClassName, u = e.parentSelector, f = u && u().ownerDocument || document;
167
+ r && d.add(f.body, r), i && d.add(f.getElementsByTagName("html")[0], i), l && (h += 1, N.hide(t)), M.default.register(this);
168
+ }
169
+ // Don't steal focus from inner elements
170
+ }, {
171
+ key: "render",
172
+ value: function() {
173
+ var e = this.props, t = e.id, l = e.className, i = e.overlayClassName, r = e.defaultStyles, u = e.children, f = l ? {} : r.content, y = i ? {} : r.overlay;
174
+ if (this.shouldBeClosed())
175
+ return null;
176
+ var K = {
177
+ ref: this.setOverlayRef,
178
+ className: this.buildClassName("overlay", i),
179
+ style: c({}, y, this.props.style.overlay),
180
+ onClick: this.handleOverlayOnClick,
181
+ onMouseDown: this.handleOverlayOnMouseDown
182
+ }, U = c({
183
+ id: t,
184
+ ref: this.setContentRef,
185
+ style: c({}, f, this.props.style.content),
186
+ className: this.buildClassName("content", l),
187
+ tabIndex: "-1",
188
+ onKeyDown: this.handleKeyDown,
189
+ onMouseDown: this.handleContentOnMouseDown,
190
+ onMouseUp: this.handleContentOnMouseUp,
191
+ onClick: this.handleContentOnClick,
192
+ role: this.props.role,
193
+ "aria-label": this.props.contentLabel
194
+ }, this.attributesFromObject("aria", c({ modal: !0 }, this.props.aria)), this.attributesFromObject("data", this.props.data || {}), {
195
+ "data-testid": this.props.testId
196
+ }), B = this.props.contentElement(U, u);
197
+ return this.props.overlayElement(K, B);
198
+ }
199
+ }]), n;
200
+ }(w.Component);
201
+ _.defaultProps = {
202
+ style: {
203
+ overlay: {},
204
+ content: {}
205
+ },
206
+ defaultStyles: {}
207
+ }, _.propTypes = {
208
+ isOpen: o.default.bool.isRequired,
209
+ defaultStyles: o.default.shape({
210
+ content: o.default.object,
211
+ overlay: o.default.object
212
+ }),
213
+ style: o.default.shape({
214
+ content: o.default.object,
215
+ overlay: o.default.object
216
+ }),
217
+ className: o.default.oneOfType([o.default.string, o.default.object]),
218
+ overlayClassName: o.default.oneOfType([o.default.string, o.default.object]),
219
+ parentSelector: o.default.func,
220
+ bodyOpenClassName: o.default.string,
221
+ htmlOpenClassName: o.default.string,
222
+ ariaHideApp: o.default.bool,
223
+ appElement: o.default.oneOfType([o.default.instanceOf(S.default), o.default.instanceOf(v.SafeHTMLCollection), o.default.instanceOf(v.SafeNodeList), o.default.arrayOf(o.default.instanceOf(S.default))]),
224
+ onAfterOpen: o.default.func,
225
+ onAfterClose: o.default.func,
226
+ onRequestClose: o.default.func,
227
+ closeTimeoutMS: o.default.number,
228
+ shouldFocusAfterRender: o.default.bool,
229
+ shouldCloseOnOverlayClick: o.default.bool,
230
+ shouldReturnFocusAfterClose: o.default.bool,
231
+ preventScroll: o.default.bool,
232
+ role: o.default.string,
233
+ contentLabel: o.default.string,
234
+ aria: o.default.object,
235
+ data: o.default.object,
236
+ children: o.default.node,
237
+ shouldCloseOnEsc: o.default.bool,
238
+ overlayRef: o.default.func,
239
+ contentRef: o.default.func,
240
+ id: o.default.string,
241
+ overlayElement: o.default.func,
242
+ contentElement: o.default.func,
243
+ testId: o.default.string
244
+ }, O.default = _, E.exports = O.default;
245
+ })(T, T.exports);
246
+ var me = T.exports;
247
+ export {
248
+ me as M
249
+ };