@phillips/seldon 1.22.2 → 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 (83) 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/Link/Link.js +21 -19
  30. package/dist/components/LinkBlock/LinkBlock.d.ts +3 -1
  31. package/dist/components/LinkList/LinkList.d.ts +3 -1
  32. package/dist/components/Modal/Modal.d.ts +23 -0
  33. package/dist/components/Modal/Modal.js +45 -0
  34. package/dist/components/Row/Row.d.ts +3 -1
  35. package/dist/components/Select/Select.d.ts +9 -0
  36. package/dist/components/Social/Social.d.ts +3 -1
  37. package/dist/components/Subscribe/Subscribe.d.ts +3 -1
  38. package/dist/components/Text/Text.d.ts +3 -1
  39. package/dist/components/Text/types.d.ts +2 -2
  40. package/dist/components/Text/types.js +1 -1
  41. package/dist/components/Text/utils.js +8 -8
  42. package/dist/index.d.ts +2 -0
  43. package/dist/index.js +54 -50
  44. package/dist/node_modules/exenv/index.js +21 -0
  45. package/dist/node_modules/object-assign/index.js +55 -0
  46. package/dist/node_modules/prop-types/checkPropTypes.js +55 -0
  47. package/dist/node_modules/prop-types/factoryWithThrowingShims.js +53 -0
  48. package/dist/node_modules/prop-types/factoryWithTypeCheckers.js +330 -0
  49. package/dist/node_modules/prop-types/index.js +13 -0
  50. package/dist/node_modules/prop-types/lib/ReactPropTypesSecret.js +11 -0
  51. package/dist/node_modules/prop-types/lib/has.js +7 -0
  52. package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js +95 -0
  53. package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js +79 -0
  54. package/dist/node_modules/prop-types/node_modules/react-is/index.js +10 -0
  55. package/dist/node_modules/react-lifecycles-compat/react-lifecycles-compat.es.js +63 -0
  56. package/dist/node_modules/react-modal/lib/components/Modal.js +237 -0
  57. package/dist/node_modules/react-modal/lib/components/ModalPortal.js +249 -0
  58. package/dist/node_modules/react-modal/lib/helpers/ariaAppHider.js +91 -0
  59. package/dist/node_modules/react-modal/lib/helpers/bodyTrap.js +42 -0
  60. package/dist/node_modules/react-modal/lib/helpers/classList.js +62 -0
  61. package/dist/node_modules/react-modal/lib/helpers/focusManager.js +67 -0
  62. package/dist/node_modules/react-modal/lib/helpers/portalOpenInstances.js +46 -0
  63. package/dist/node_modules/react-modal/lib/helpers/safeHTMLElement.js +15 -0
  64. package/dist/node_modules/react-modal/lib/helpers/scopeTab.js +46 -0
  65. package/dist/node_modules/react-modal/lib/helpers/tabbable.js +62 -0
  66. package/dist/node_modules/react-modal/lib/index.js +19 -0
  67. package/dist/node_modules/warning/warning.js +33 -0
  68. package/dist/scss/_type.scss +6 -6
  69. package/dist/scss/_utils.scss +16 -16
  70. package/dist/scss/_vars.scss +17 -19
  71. package/dist/scss/components/Footer/_footer.scss +7 -7
  72. package/dist/scss/components/GridItem/_gridItem.scss +3 -3
  73. package/dist/scss/components/HeroBanner/_heroBanner.scss +4 -4
  74. package/dist/scss/components/IconButton/_iconButton.scss +47 -0
  75. package/dist/scss/components/Link/_link.scss +0 -6
  76. package/dist/scss/components/LinkList/_linkList.scss +1 -1
  77. package/dist/scss/components/Modal/_modal.scss +29 -0
  78. package/dist/scss/components/Modal/_modal.stories.scss +5 -0
  79. package/dist/scss/components/Social/_social.scss +2 -2
  80. package/dist/scss/components/SplitPanel/_splitPanel.scss +1 -1
  81. package/dist/scss/components/Subscribe/_subscribe.scss +1 -1
  82. package/dist/scss/styles.scss +2 -0
  83. package/package.json +7 -5
@@ -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
+ };
@@ -0,0 +1,91 @@
1
+ import { __exports as n } from "../../../../_virtual/ariaAppHider.js";
2
+ import { w as m } from "../../../warning/warning.js";
3
+ import "./safeHTMLElement.js";
4
+ import { __exports as c } from "../../../../_virtual/safeHTMLElement.js";
5
+ Object.defineProperty(n, "__esModule", {
6
+ value: !0
7
+ });
8
+ n.resetState = h;
9
+ n.log = A;
10
+ n.assertNodeList = f;
11
+ n.setElement = g;
12
+ n.validateElement = s;
13
+ n.hide = _;
14
+ n.show = w;
15
+ n.documentNotReadyOrSSRTesting = N;
16
+ var v = m, p = E(v), y = c;
17
+ function E(e) {
18
+ return e && e.__esModule ? e : { default: e };
19
+ }
20
+ var t = null;
21
+ function h() {
22
+ t && (t.removeAttribute ? t.removeAttribute("aria-hidden") : t.length != null ? t.forEach(function(e) {
23
+ return e.removeAttribute("aria-hidden");
24
+ }) : document.querySelectorAll(t).forEach(function(e) {
25
+ return e.removeAttribute("aria-hidden");
26
+ })), t = null;
27
+ }
28
+ function A() {
29
+ if (process.env.NODE_ENV !== "production") {
30
+ var e = t || {};
31
+ console.log("ariaAppHider ----------"), console.log(e.nodeName, e.className, e.id), console.log("end ariaAppHider ----------");
32
+ }
33
+ }
34
+ function f(e, r) {
35
+ if (!e || !e.length)
36
+ throw new Error("react-modal: No elements were found for selector " + r + ".");
37
+ }
38
+ function g(e) {
39
+ var r = e;
40
+ if (typeof r == "string" && y.canUseDOM) {
41
+ var o = document.querySelectorAll(r);
42
+ f(o, r), r = o;
43
+ }
44
+ return t = r || t, t;
45
+ }
46
+ function s(e) {
47
+ var r = e || t;
48
+ return r ? Array.isArray(r) || r instanceof HTMLCollection || r instanceof NodeList ? r : [r] : ((0, p.default)(!1, ["react-modal: App element is not defined.", "Please use `Modal.setAppElement(el)` or set `appElement={el}`.", "This is needed so screen readers don't see main content", "when modal is opened. It is not recommended, but you can opt-out", "by setting `ariaHideApp={false}`."].join(" ")), []);
49
+ }
50
+ function _(e) {
51
+ var r = !0, o = !1, i = void 0;
52
+ try {
53
+ for (var a = s(e)[Symbol.iterator](), l; !(r = (l = a.next()).done); r = !0) {
54
+ var u = l.value;
55
+ u.setAttribute("aria-hidden", "true");
56
+ }
57
+ } catch (d) {
58
+ o = !0, i = d;
59
+ } finally {
60
+ try {
61
+ !r && a.return && a.return();
62
+ } finally {
63
+ if (o)
64
+ throw i;
65
+ }
66
+ }
67
+ }
68
+ function w(e) {
69
+ var r = !0, o = !1, i = void 0;
70
+ try {
71
+ for (var a = s(e)[Symbol.iterator](), l; !(r = (l = a.next()).done); r = !0) {
72
+ var u = l.value;
73
+ u.removeAttribute("aria-hidden");
74
+ }
75
+ } catch (d) {
76
+ o = !0, i = d;
77
+ } finally {
78
+ try {
79
+ !r && a.return && a.return();
80
+ } finally {
81
+ if (o)
82
+ throw i;
83
+ }
84
+ }
85
+ }
86
+ function N() {
87
+ t = null;
88
+ }
89
+ export {
90
+ n as default
91
+ };
@@ -0,0 +1,42 @@
1
+ import { __exports as d } from "../../../../_virtual/bodyTrap.js";
2
+ import "./portalOpenInstances.js";
3
+ import { __exports as i } from "../../../../_virtual/portalOpenInstances.js";
4
+ Object.defineProperty(d, "__esModule", {
5
+ value: !0
6
+ });
7
+ d.resetState = f;
8
+ d.log = v;
9
+ var p = i, c = u(p);
10
+ function u(t) {
11
+ return t && t.__esModule ? t : { default: t };
12
+ }
13
+ var e = void 0, o = void 0, r = [];
14
+ function f() {
15
+ for (var t = [e, o], n = 0; n < t.length; n++) {
16
+ var a = t[n];
17
+ a && a.parentNode && a.parentNode.removeChild(a);
18
+ }
19
+ e = o = null, r = [];
20
+ }
21
+ function v() {
22
+ console.log("bodyTrap ----------"), console.log(r.length);
23
+ for (var t = [e, o], n = 0; n < t.length; n++) {
24
+ var a = t[n], l = a || {};
25
+ console.log(l.nodeName, l.className, l.id);
26
+ }
27
+ console.log("edn bodyTrap ----------");
28
+ }
29
+ function s() {
30
+ if (r.length === 0) {
31
+ process.env.NODE_ENV !== "production" && console.warn("React-Modal: Open instances > 0 expected");
32
+ return;
33
+ }
34
+ r[r.length - 1].focusContent();
35
+ }
36
+ function m(t, n) {
37
+ !e && !o && (e = document.createElement("div"), e.setAttribute("data-react-modal-body-trap", ""), e.style.position = "absolute", e.style.opacity = "0", e.setAttribute("tabindex", "0"), e.addEventListener("focus", s), o = e.cloneNode(), o.addEventListener("focus", s)), r = n, r.length > 0 ? (document.body.firstChild !== e && document.body.insertBefore(e, document.body.firstChild), document.body.lastChild !== o && document.body.appendChild(o)) : (e.parentElement && e.parentElement.removeChild(e), o.parentElement && o.parentElement.removeChild(o));
38
+ }
39
+ c.default.subscribe(m);
40
+ export {
41
+ d as default
42
+ };
@@ -0,0 +1,62 @@
1
+ import { __exports as i } from "../../../../_virtual/classList.js";
2
+ Object.defineProperty(i, "__esModule", {
3
+ value: !0
4
+ });
5
+ i.resetState = d;
6
+ i.log = m;
7
+ var o = {}, a = {};
8
+ function s(t, e) {
9
+ t.classList.remove(e);
10
+ }
11
+ function d() {
12
+ var t = document.getElementsByTagName("html")[0];
13
+ for (var e in o)
14
+ s(t, o[e]);
15
+ var n = document.body;
16
+ for (var r in a)
17
+ s(n, a[r]);
18
+ o = {}, a = {};
19
+ }
20
+ function m() {
21
+ if (process.env.NODE_ENV !== "production") {
22
+ var t = document.getElementsByTagName("html")[0].className, e = `Show tracked classes:
23
+
24
+ `;
25
+ e += "<html /> (" + t + `):
26
+ `;
27
+ for (var n in o)
28
+ e += " " + n + " " + o[n] + `
29
+ `;
30
+ t = document.body.className, e += `
31
+
32
+ doc.body (` + t + `):
33
+ `;
34
+ for (var r in a)
35
+ e += " " + r + " " + a[r] + `
36
+ `;
37
+ e += `
38
+ `, console.log(e);
39
+ }
40
+ }
41
+ var u = function(e, n) {
42
+ return e[n] || (e[n] = 0), e[n] += 1, n;
43
+ }, v = function(e, n) {
44
+ return e[n] && (e[n] -= 1), n;
45
+ }, f = function(e, n, r) {
46
+ r.forEach(function(c) {
47
+ u(n, c), e.add(c);
48
+ });
49
+ }, l = function(e, n, r) {
50
+ r.forEach(function(c) {
51
+ v(n, c), n[c] === 0 && e.remove(c);
52
+ });
53
+ };
54
+ i.add = function(e, n) {
55
+ return f(e.classList, e.nodeName.toLowerCase() == "html" ? o : a, n.split(" "));
56
+ };
57
+ i.remove = function(e, n) {
58
+ return l(e.classList, e.nodeName.toLowerCase() == "html" ? o : a, n.split(" "));
59
+ };
60
+ export {
61
+ i as default
62
+ };
@@ -0,0 +1,67 @@
1
+ import { __exports as t } from "../../../../_virtual/focusManager.js";
2
+ import { t as s } from "./tabbable.js";
3
+ Object.defineProperty(t, "__esModule", {
4
+ value: !0
5
+ });
6
+ t.resetState = f;
7
+ t.log = v;
8
+ t.handleBlur = r;
9
+ t.handleFocus = a;
10
+ t.markForFocusLater = m;
11
+ t.returnFocus = p;
12
+ t.popWithoutFocus = h;
13
+ t.setupScopedFocus = E;
14
+ t.teardownScopedFocus = F;
15
+ var l = s, i = d(l);
16
+ function d(e) {
17
+ return e && e.__esModule ? e : { default: e };
18
+ }
19
+ var n = [], u = null, c = !1;
20
+ function f() {
21
+ n = [];
22
+ }
23
+ function v() {
24
+ process.env.NODE_ENV !== "production" && (console.log("focusManager ----------"), n.forEach(function(e) {
25
+ var o = e || {};
26
+ console.log(o.nodeName, o.className, o.id);
27
+ }), console.log("end focusManager ----------"));
28
+ }
29
+ function r() {
30
+ c = !0;
31
+ }
32
+ function a() {
33
+ if (c) {
34
+ if (c = !1, !u)
35
+ return;
36
+ setTimeout(function() {
37
+ if (!u.contains(document.activeElement)) {
38
+ var e = (0, i.default)(u)[0] || u;
39
+ e.focus();
40
+ }
41
+ }, 0);
42
+ }
43
+ }
44
+ function m() {
45
+ n.push(document.activeElement);
46
+ }
47
+ function p() {
48
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, o = null;
49
+ try {
50
+ n.length !== 0 && (o = n.pop(), o.focus({ preventScroll: e }));
51
+ return;
52
+ } catch {
53
+ console.warn(["You tried to return focus to", o, "but it is not in the DOM anymore"].join(" "));
54
+ }
55
+ }
56
+ function h() {
57
+ n.length > 0 && n.pop();
58
+ }
59
+ function E(e) {
60
+ u = e, window.addEventListener ? (window.addEventListener("blur", r, !1), document.addEventListener("focus", a, !0)) : (window.attachEvent("onBlur", r), document.attachEvent("onFocus", a));
61
+ }
62
+ function F() {
63
+ u = null, window.addEventListener ? (window.removeEventListener("blur", r), document.removeEventListener("focus", a)) : (window.detachEvent("onBlur", r), document.detachEvent("onFocus", a));
64
+ }
65
+ export {
66
+ t as default
67
+ };
@@ -0,0 +1,46 @@
1
+ import { __exports as r } from "../../../../_virtual/portalOpenInstances.js";
2
+ Object.defineProperty(r, "__esModule", {
3
+ value: !0
4
+ });
5
+ r.log = c;
6
+ r.resetState = l;
7
+ function i(s, e) {
8
+ if (!(s instanceof e))
9
+ throw new TypeError("Cannot call a class as a function");
10
+ }
11
+ var a = function s() {
12
+ var e = this;
13
+ i(this, s), this.register = function(n) {
14
+ if (e.openInstances.indexOf(n) !== -1) {
15
+ process.env.NODE_ENV !== "production" && console.warn("React-Modal: Cannot register modal instance that's already open");
16
+ return;
17
+ }
18
+ e.openInstances.push(n), e.emit("register");
19
+ }, this.deregister = function(n) {
20
+ var t = e.openInstances.indexOf(n);
21
+ if (t === -1) {
22
+ process.env.NODE_ENV !== "production" && console.warn("React-Modal: Unable to deregister " + n + " as it was never registered");
23
+ return;
24
+ }
25
+ e.openInstances.splice(t, 1), e.emit("deregister");
26
+ }, this.subscribe = function(n) {
27
+ e.subscribers.push(n);
28
+ }, this.emit = function(n) {
29
+ e.subscribers.forEach(function(t) {
30
+ return t(
31
+ n,
32
+ // shallow copy to avoid accidental mutation
33
+ e.openInstances.slice()
34
+ );
35
+ });
36
+ }, this.openInstances = [], this.subscribers = [];
37
+ }, o = new a();
38
+ function c() {
39
+ console.log("portalOpenInstances ----------"), console.log(o.openInstances.length), o.openInstances.forEach(function(s) {
40
+ return console.log(s);
41
+ }), console.log("end portalOpenInstances ----------");
42
+ }
43
+ function l() {
44
+ o = new a();
45
+ }
46
+ r.default = o;
@@ -0,0 +1,15 @@
1
+ import { __exports as e } from "../../../../_virtual/safeHTMLElement.js";
2
+ import { e as t } from "../../../exenv/index.js";
3
+ Object.defineProperty(e, "__esModule", {
4
+ value: !0
5
+ });
6
+ e.canUseDOM = e.SafeNodeList = e.SafeHTMLCollection = void 0;
7
+ var o = t, r = i(o);
8
+ function i(n) {
9
+ return n && n.__esModule ? n : { default: n };
10
+ }
11
+ var a = r.default, l = a.canUseDOM ? window.HTMLElement : {};
12
+ e.SafeHTMLCollection = a.canUseDOM ? window.HTMLCollection : {};
13
+ e.SafeNodeList = a.canUseDOM ? window.NodeList : {};
14
+ e.canUseDOM = a.canUseDOM;
15
+ e.default = l;
@@ -0,0 +1,46 @@
1
+ import { __module as s } from "../../../../_virtual/scopeTab.js";
2
+ import { t as _ } from "./tabbable.js";
3
+ (function(c, f) {
4
+ Object.defineProperty(f, "__esModule", {
5
+ value: !0
6
+ }), f.default = g;
7
+ var d = _, p = m(d);
8
+ function m(e) {
9
+ return e && e.__esModule ? e : { default: e };
10
+ }
11
+ function v() {
12
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : document;
13
+ return e.activeElement.shadowRoot ? v(e.activeElement.shadowRoot) : e.activeElement;
14
+ }
15
+ function g(e, r) {
16
+ var a = (0, p.default)(e);
17
+ if (!a.length) {
18
+ r.preventDefault();
19
+ return;
20
+ }
21
+ var t = void 0, n = r.shiftKey, o = a[0], u = a[a.length - 1], i = v();
22
+ if (e === i) {
23
+ if (!n)
24
+ return;
25
+ t = u;
26
+ }
27
+ if (u === i && !n && (t = o), o === i && n && (t = u), t) {
28
+ r.preventDefault(), t.focus();
29
+ return;
30
+ }
31
+ var b = /(\bChrome\b|\bSafari\b)\//.exec(navigator.userAgent), h = b != null && b[1] != "Chrome" && /\biPod\b|\biPad\b/g.exec(navigator.userAgent) == null;
32
+ if (h) {
33
+ var l = a.indexOf(i);
34
+ if (l > -1 && (l += n ? -1 : 1), t = a[l], typeof t == "undefined") {
35
+ r.preventDefault(), t = n ? u : o, t.focus();
36
+ return;
37
+ }
38
+ r.preventDefault(), t.focus();
39
+ }
40
+ }
41
+ c.exports = f.default;
42
+ })(s, s.exports);
43
+ var D = s.exports;
44
+ export {
45
+ D as s
46
+ };
@@ -0,0 +1,62 @@
1
+ import { __module as n } from "../../../../_virtual/tabbable.js";
2
+ (function(u, a) {
3
+ Object.defineProperty(a, "__esModule", {
4
+ value: !0
5
+ }), a.default = i;
6
+ /*!
7
+ * Adapted from jQuery UI core
8
+ *
9
+ * http://jqueryui.com
10
+ *
11
+ * Copyright 2014 jQuery Foundation and other contributors
12
+ * Released under the MIT license.
13
+ * http://jquery.org/license
14
+ *
15
+ * http://api.jqueryui.com/category/ui-core/
16
+ */
17
+ var d = "none", s = "contents", f = /input|select|textarea|button|object|iframe/;
18
+ function c(t, e) {
19
+ return e.getPropertyValue("overflow") !== "visible" || // if 'overflow: visible' set, check if there is actually any overflow
20
+ t.scrollWidth <= 0 && t.scrollHeight <= 0;
21
+ }
22
+ function b(t) {
23
+ var e = t.offsetWidth <= 0 && t.offsetHeight <= 0;
24
+ if (e && !t.innerHTML)
25
+ return !0;
26
+ try {
27
+ var r = window.getComputedStyle(t), o = r.getPropertyValue("display");
28
+ return e ? o !== s && c(t, r) : o === d;
29
+ } catch {
30
+ return console.warn("Failed to inspect element style"), !1;
31
+ }
32
+ }
33
+ function l(t) {
34
+ for (var e = t, r = t.getRootNode && t.getRootNode(); e && e !== document.body; ) {
35
+ if (r && e === r && (e = r.host.parentNode), b(e))
36
+ return !1;
37
+ e = e.parentNode;
38
+ }
39
+ return !0;
40
+ }
41
+ function v(t, e) {
42
+ var r = t.nodeName.toLowerCase(), o = f.test(r) && !t.disabled || r === "a" && t.href || e;
43
+ return o && l(t);
44
+ }
45
+ function p(t) {
46
+ var e = t.getAttribute("tabindex");
47
+ e === null && (e = void 0);
48
+ var r = isNaN(e);
49
+ return (r || e >= 0) && v(t, !r);
50
+ }
51
+ function i(t) {
52
+ var e = [].slice.call(t.querySelectorAll("*"), 0).reduce(function(r, o) {
53
+ return r.concat(o.shadowRoot ? i(o.shadowRoot) : [o]);
54
+ }, []);
55
+ return e.filter(p);
56
+ }
57
+ u.exports = a.default;
58
+ })(n, n.exports);
59
+ var g = n.exports;
60
+ export {
61
+ g as t
62
+ };