@phillips/seldon 1.156.0 → 1.158.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 (66) hide show
  1. package/dist/_virtual/index10.js +2 -2
  2. package/dist/_virtual/index3.js +2 -2
  3. package/dist/_virtual/index4.js +2 -2
  4. package/dist/_virtual/index5.js +2 -2
  5. package/dist/_virtual/index8.js +2 -2
  6. package/dist/_virtual/index9.js +2 -2
  7. package/dist/components/Modal/Modal.d.ts +8 -8
  8. package/dist/components/Modal/Modal.js +59 -50
  9. package/dist/components/Modal/Modal.stories.d.ts +2 -1
  10. package/dist/components/SaleCard/SaleCard.d.ts +48 -0
  11. package/dist/components/SaleCard/SaleCard.js +85 -0
  12. package/dist/components/SaleCard/SaleCard.stories.d.ts +23 -0
  13. package/dist/components/SaleCard/index.d.ts +1 -0
  14. package/dist/components/SaleCard/types.d.ts +4 -0
  15. package/dist/components/SaleCard/types.js +4 -0
  16. package/dist/index.d.ts +1 -1
  17. package/dist/index.js +24 -24
  18. package/dist/node_modules/ics/dist/index.js +2 -2
  19. package/dist/node_modules/ics/dist/pipeline/format.js +1 -1
  20. package/dist/node_modules/ics/dist/pipeline/index.js +1 -1
  21. package/dist/node_modules/ics/dist/pipeline/validate.js +1 -1
  22. package/dist/node_modules/ics/dist/schema/index.js +1 -1
  23. package/dist/node_modules/ics/dist/utils/index.js +1 -1
  24. package/dist/node_modules/prop-types/index.js +8 -9
  25. package/dist/node_modules/runes2/dist/index.js +1 -1
  26. package/dist/node_modules/toposort/index.js +1 -1
  27. package/dist/scss/_vars.scss +1 -0
  28. package/dist/scss/_vars.scss.js +1 -0
  29. package/dist/scss/componentStyles.scss +1 -1
  30. package/dist/scss/components/Modal/_modal.scss +6 -8
  31. package/dist/scss/components/Modal/_modal.stories.scss +11 -0
  32. package/dist/scss/components/SaleCard/_saleCard.scss +120 -0
  33. package/package.json +1 -3
  34. package/dist/_virtual/Modal.js +0 -4
  35. package/dist/_virtual/ModalPortal.js +0 -4
  36. package/dist/_virtual/ariaAppHider.js +0 -4
  37. package/dist/_virtual/bodyTrap.js +0 -4
  38. package/dist/_virtual/classList.js +0 -4
  39. package/dist/_virtual/focusManager.js +0 -4
  40. package/dist/_virtual/index11.js +0 -4
  41. package/dist/_virtual/index12.js +0 -4
  42. package/dist/_virtual/portalOpenInstances.js +0 -4
  43. package/dist/_virtual/react-lifecycles-compat.es.js +0 -6
  44. package/dist/_virtual/safeHTMLElement.js +0 -4
  45. package/dist/_virtual/scopeTab.js +0 -4
  46. package/dist/_virtual/tabbable.js +0 -4
  47. package/dist/components/AuctionTile/AuctionTile.d.ts +0 -20
  48. package/dist/components/AuctionTile/AuctionTile.js +0 -27
  49. package/dist/components/AuctionTile/AuctionTile.stories.d.ts +0 -18
  50. package/dist/components/AuctionTile/index.d.ts +0 -1
  51. package/dist/node_modules/exenv/index.js +0 -21
  52. package/dist/node_modules/react-lifecycles-compat/react-lifecycles-compat.es.js +0 -63
  53. package/dist/node_modules/react-modal/lib/components/Modal.js +0 -237
  54. package/dist/node_modules/react-modal/lib/components/ModalPortal.js +0 -249
  55. package/dist/node_modules/react-modal/lib/helpers/ariaAppHider.js +0 -91
  56. package/dist/node_modules/react-modal/lib/helpers/bodyTrap.js +0 -42
  57. package/dist/node_modules/react-modal/lib/helpers/classList.js +0 -62
  58. package/dist/node_modules/react-modal/lib/helpers/focusManager.js +0 -67
  59. package/dist/node_modules/react-modal/lib/helpers/portalOpenInstances.js +0 -46
  60. package/dist/node_modules/react-modal/lib/helpers/safeHTMLElement.js +0 -15
  61. package/dist/node_modules/react-modal/lib/helpers/scopeTab.js +0 -45
  62. package/dist/node_modules/react-modal/lib/helpers/tabbable.js +0 -60
  63. package/dist/node_modules/react-modal/lib/index.js +0 -19
  64. package/dist/node_modules/warning/warning.js +0 -33
  65. package/dist/scss/components/AuctionTile/_auctionTile.scss +0 -38
  66. /package/dist/components/{AuctionTile/AuctionTile.test.d.ts → SaleCard/SaleCard.test.d.ts} +0 -0
@@ -73,4 +73,4 @@
73
73
  @use 'components/Divider/divider';
74
74
  @use 'components/TextArea/textArea';
75
75
  @use 'components/AddToCalendar/addToCalendar';
76
- @use 'components/AuctionTile/auctionTile';
76
+ @use 'components/SaleCard/saleCard';
@@ -1,24 +1,22 @@
1
1
  @use '../../allPartials' as *;
2
2
 
3
3
  .#{$px}-modal {
4
- background-color: white;
4
+ background-color: $white;
5
5
  left: 50%;
6
6
  max-height: 100%;
7
7
  max-width: 100%;
8
8
  overflow: auto;
9
9
  padding: $padding-md;
10
- position: absolute;
10
+ position: fixed;
11
11
  top: 50%;
12
12
  transform: translate(-50%, -50%);
13
+ z-index: 30;
13
14
 
14
15
  &__overlay {
15
- background-color: rgba(0, 0, 0, 75%);
16
- height: 100dvh;
17
- left: 0;
16
+ background-color: $overlay-black;
17
+ inset: 0;
18
18
  position: fixed;
19
- top: 0;
20
- width: 100%;
21
- z-index: $modal-z-index;
19
+ z-index: 15;
22
20
  }
23
21
 
24
22
  &__close {
@@ -2,4 +2,15 @@
2
2
  &__button {
3
3
  margin-bottom: 16px;
4
4
  }
5
+
6
+ &__drawer,
7
+ &__modal {
8
+ display: flex;
9
+ flex-direction: column;
10
+ gap: 24px;
11
+
12
+ &-heading.seldon-text {
13
+ margin-bottom: 0;
14
+ }
15
+ }
5
16
  }
@@ -0,0 +1,120 @@
1
+ @use '../../allPartials' as *;
2
+
3
+ .#{$px}-sale-card {
4
+ align-items: center;
5
+ display: flex;
6
+ flex-direction: column;
7
+ gap: $spacing-sm;
8
+
9
+ @include media($breakpoint-md) {
10
+ flex-direction: row;
11
+ gap: $spacing-md;
12
+ }
13
+
14
+ &__image {
15
+ aspect-ratio: 91/51;
16
+ border-radius: 4px;
17
+ min-width: 100%;
18
+
19
+ @include media($breakpoint-md) {
20
+ aspect-ratio: 107/60;
21
+ min-width: 428px;
22
+ }
23
+
24
+ img {
25
+ height: auto;
26
+ object-fit: cover;
27
+ width: 100%;
28
+ }
29
+ }
30
+
31
+ &__details {
32
+ align-items: flex-start;
33
+ display: flex;
34
+ flex-direction: column;
35
+ flex-grow: 1;
36
+ gap: $spacing-micro;
37
+
38
+ @include media($size-md, 'max') {
39
+ align-self: flex-start;
40
+ }
41
+ }
42
+
43
+ &__date_info {
44
+ display: flex;
45
+ flex-direction: row;
46
+ }
47
+
48
+ &__separator {
49
+ margin: 0 8px;
50
+ }
51
+
52
+ &__cta {
53
+ align-items: flex-start;
54
+ display: flex;
55
+ flex-direction: column;
56
+ gap: $spacing-sm;
57
+ justify-content: center;
58
+ min-width: 200px;
59
+ }
60
+
61
+ &__info {
62
+ display: flex;
63
+ flex-direction: column;
64
+ gap: $spacing-micro;
65
+ }
66
+
67
+ &__badge {
68
+ border: 1px solid $badge-blue;
69
+ color: $badge-blue;
70
+ padding: $spacing-micro 8px;
71
+ }
72
+
73
+ &__cta-button {
74
+ padding: $spacing-sm $spacing-lg;
75
+ white-space: nowrap;
76
+ width: 100%;
77
+ }
78
+
79
+ &__modal-link {
80
+ cursor: pointer;
81
+
82
+ @include underline;
83
+ }
84
+
85
+ &__modal-link-button {
86
+ padding: 0;
87
+
88
+ @include underline;
89
+ }
90
+
91
+ &__pdf-link {
92
+ align-items: center;
93
+ align-self: stretch;
94
+ display: flex;
95
+ gap: $spacing-micro;
96
+ justify-content: center;
97
+
98
+ a {
99
+ text-decoration: none;
100
+ }
101
+ }
102
+
103
+ &--relatedSaleTile {
104
+ align-items: flex-start;
105
+ gap: $spacing-sm;
106
+
107
+ @include media($size-md, 'max') {
108
+ flex-direction: row;
109
+ }
110
+
111
+ .#{$px}-sale-card__image {
112
+ max-width: $spacing-xxxl;
113
+ min-width: 94px;
114
+
115
+ @include media($size-xl) {
116
+ max-width: calc($spacing-xxxl * 1.25);
117
+ }
118
+ }
119
+ }
120
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.156.0",
3
+ "version": "1.158.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"
@@ -66,7 +66,6 @@
66
66
  "ics": "^3.8.1",
67
67
  "libphonenumber-js": "^1.12.6",
68
68
  "react-intersection-observer": "^9.13.1",
69
- "react-modal": "^3.16.1",
70
69
  "react-remove-scroll": "^2.6.3",
71
70
  "react-transition-group": "^4.4.5",
72
71
  "react-zoom-pan-pinch": "^3.6.1",
@@ -104,7 +103,6 @@
104
103
  "@types/node": "^22.12.0",
105
104
  "@types/react": "^18.3.3",
106
105
  "@types/react-dom": "^18.0.11",
107
- "@types/react-modal": "^3.16.3",
108
106
  "@types/react-transition-group": "^4.4.11",
109
107
  "@types/uuid": "^10.0.0",
110
108
  "@typescript-eslint/eslint-plugin": "^5.62.0",
@@ -1,4 +0,0 @@
1
- var a = {};
2
- export {
3
- a as __exports
4
- };
@@ -1,4 +0,0 @@
1
- var o = { exports: {} };
2
- export {
3
- o as __module
4
- };
@@ -1,4 +0,0 @@
1
- var r = {};
2
- export {
3
- r as __exports
4
- };
@@ -1,4 +0,0 @@
1
- var r = {};
2
- export {
3
- r as __exports
4
- };
@@ -1,4 +0,0 @@
1
- var s = {};
2
- export {
3
- s as __exports
4
- };
@@ -1,4 +0,0 @@
1
- var a = {};
2
- export {
3
- a as __exports
4
- };
@@ -1,4 +0,0 @@
1
- var e = { exports: {} };
2
- export {
3
- e as __module
4
- };
@@ -1,4 +0,0 @@
1
- var o = { exports: {} };
2
- export {
3
- o as __module
4
- };
@@ -1,4 +0,0 @@
1
- var a = {};
2
- export {
3
- a as __exports
4
- };
@@ -1,6 +0,0 @@
1
- import { getAugmentedNamespace as e } from "./_commonjsHelpers.js";
2
- import * as t from "../node_modules/react-lifecycles-compat/react-lifecycles-compat.es.js";
3
- const a = /* @__PURE__ */ e(t);
4
- export {
5
- a as default
6
- };
@@ -1,4 +0,0 @@
1
- var e = {};
2
- export {
3
- e as __exports
4
- };
@@ -1,4 +0,0 @@
1
- var e = { exports: {} };
2
- export {
3
- e as __module
4
- };
@@ -1,4 +0,0 @@
1
- var a = { exports: {} };
2
- export {
3
- a as __module
4
- };
@@ -1,20 +0,0 @@
1
- import { ComponentProps } from 'react';
2
- export type AuctionTileProps = ComponentProps<'div'> & {
3
- imageSrc: string;
4
- imageAlt?: string;
5
- type: string;
6
- title: string;
7
- date: string;
8
- location: string;
9
- };
10
- /**
11
- * ## Overview
12
- *
13
- * Overview of this widget
14
- *
15
- * [Figma Link](https://www.figma.com/design/hMu9IWH5N3KamJy8tLFdyV/RW-Design-System?node-id=22259-4172&m=dev)
16
- *
17
- * [Storybook Link](https://phillips-seldon.netlify.app/?path=/docs/components-auctiontile--overview)
18
- */
19
- declare const AuctionTile: import('react').ForwardRefExoticComponent<Omit<AuctionTileProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
20
- export default AuctionTile;
@@ -1,27 +0,0 @@
1
- import { jsxs as s, jsx as a } from "react/jsx-runtime";
2
- import { forwardRef as v } from "react";
3
- import { getCommonProps as N } from "../../utils/index.js";
4
- import g from "../../node_modules/classnames/index.js";
5
- import { TextVariants as r } from "../Text/types.js";
6
- import e from "../Text/Text.js";
7
- const u = v(
8
- ({ className: o, imageSrc: n, imageAlt: m = "Auction Image", type: c, title: l, date: d, location: p, ...t }, f) => {
9
- const { className: i, ...h } = N(t, "AuctionTile"), _ = { ...h, ...t };
10
- return /* @__PURE__ */ s("div", { ..._, className: g(i, o), ref: f, children: [
11
- /* @__PURE__ */ a("div", { className: `${i}__image`, children: /* @__PURE__ */ a("img", { src: n, alt: m }) }),
12
- /* @__PURE__ */ s("div", { className: `${i}__details`, children: [
13
- /* @__PURE__ */ a(e, { variant: r.badge, children: c }),
14
- /* @__PURE__ */ a(e, { variant: r.title4, children: l }),
15
- /* @__PURE__ */ s("div", { className: `${i}__date_location`, children: [
16
- /* @__PURE__ */ a(e, { variant: r.string2, children: d }),
17
- /* @__PURE__ */ a("span", { className: `${i}__separator`, children: "•" }),
18
- /* @__PURE__ */ a(e, { variant: r.string2, children: p })
19
- ] })
20
- ] })
21
- ] });
22
- }
23
- );
24
- u.displayName = "AuctionTile";
25
- export {
26
- u as default
27
- };
@@ -1,18 +0,0 @@
1
- import { AuctionTileProps } from './AuctionTile';
2
- declare const meta: {
3
- title: string;
4
- component: import('react').ForwardRefExoticComponent<Omit<AuctionTileProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
5
- };
6
- export default meta;
7
- export declare const Playground: {
8
- (props: AuctionTileProps): import("react/jsx-runtime").JSX.Element;
9
- args: {
10
- imageSrc: string;
11
- type: string;
12
- title: string;
13
- date: string;
14
- location: string;
15
- };
16
- argTypes: {};
17
- };
18
- export declare const MultipleAuctions: () => import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export { default as AuctionTile, type AuctionTileProps } from './AuctionTile';
@@ -1,21 +0,0 @@
1
- import { __module as t } from "../../_virtual/index5.js";
2
- /*!
3
- Copyright (c) 2015 Jed Watson.
4
- Based on code that is Copyright 2013-2015, Facebook, Inc.
5
- All rights reserved.
6
- */
7
- (function(n) {
8
- (function() {
9
- var e = !!(typeof window < "u" && window.document && window.document.createElement), o = {
10
- canUseDOM: e,
11
- canUseWorkers: typeof Worker < "u",
12
- canUseEventListeners: e && !!(window.addEventListener || window.attachEvent),
13
- canUseViewport: e && !!window.screen
14
- };
15
- n.exports ? n.exports = o : window.ExecutionEnvironment = o;
16
- })();
17
- })(t);
18
- var i = t.exports;
19
- export {
20
- i as e
21
- };
@@ -1,63 +0,0 @@
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;
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
- };
@@ -1,237 +0,0 @@
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 H } 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
- }, q = /* @__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), W = H, F = B(W), u = w, M = m(u), $ = 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 q(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
- F.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, $.polyfill)(p);
234
- process.env.NODE_ENV !== "production" && (p.setCreateHTMLElement = function(r) {
235
- return b = r;
236
- });
237
- d.default = p;