@openedx/paragon 23.0.0-alpha.4 → 23.0.0-alpha.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/Card/index.scss +2 -0
- package/dist/Container/index.d.ts +16 -0
- package/dist/Container/index.js +15 -13
- package/dist/Container/index.js.map +1 -1
- package/dist/IconButton/index.js +1 -1
- package/dist/IconButton/index.js.map +1 -1
- package/dist/Menu/SelectMenu.js +9 -4
- package/dist/Menu/SelectMenu.js.map +1 -1
- package/dist/Modal/ModalContext.d.ts +15 -0
- package/dist/Modal/ModalContext.js +7 -14
- package/dist/Modal/ModalContext.js.map +1 -1
- package/dist/Modal/ModalDialog.d.ts +110 -0
- package/dist/Modal/ModalDialog.js +23 -21
- package/dist/Modal/ModalDialog.js.map +1 -1
- package/dist/Modal/ModalDialogHeader.d.ts +10 -0
- package/dist/Modal/ModalDialogHeader.js +6 -7
- package/dist/Modal/ModalDialogHeader.js.map +1 -1
- package/dist/Modal/ModalLayer.d.ts +53 -0
- package/dist/Modal/ModalLayer.js +5 -14
- package/dist/Modal/ModalLayer.js.map +1 -1
- package/dist/Modal/Portal.d.ts +11 -0
- package/dist/Modal/Portal.js +5 -6
- package/dist/Modal/Portal.js.map +1 -1
- package/dist/core.css +2 -0
- package/dist/core.css.map +1 -1
- package/dist/core.min.css +1 -1
- package/dist/hooks/useArrowKeyNavigation.js +2 -3
- package/dist/hooks/useArrowKeyNavigation.js.map +1 -1
- package/dist/index.d.ts +19 -5
- package/dist/index.js +5 -5
- package/icons/es5/Newsstand.js +15 -0
- package/icons/es5/index.js +1 -0
- package/icons/es5/index.ts +1 -0
- package/icons/jsx/Newsstand.jsx +17 -0
- package/icons/jsx/index.jsx +1 -0
- package/icons/svg/newsstand.svg +1 -0
- package/package.json +2 -2
- package/src/Card/index.scss +2 -0
- package/src/Container/{Container.test.jsx → Container.test.tsx} +14 -8
- package/src/Container/README.md +4 -0
- package/src/Container/index.tsx +64 -0
- package/src/DataTable/selection/tests/ControlledSelectHeader.test.jsx +7 -7
- package/src/IconButton/index.tsx +1 -1
- package/src/Menu/SelectMenu.jsx +5 -0
- package/src/Menu/SelectMenu.test.jsx +6 -0
- package/src/Menu/select-menu.md +8 -0
- package/src/Modal/{ModalContext.jsx → ModalContext.tsx} +19 -16
- package/src/Modal/{ModalDialog.jsx → ModalDialog.tsx} +50 -23
- package/src/Modal/{ModalDialogHeader.jsx → ModalDialogHeader.tsx} +17 -11
- package/src/Modal/{ModalLayer.jsx → ModalLayer.tsx} +17 -17
- package/src/Modal/{Portal.jsx → Portal.tsx} +10 -7
- package/src/Modal/tests/{ModalDialog.test.jsx → ModalDialog.test.tsx} +16 -10
- package/src/Modal/tests/{ModalLayer.test.jsx → ModalLayer.test.tsx} +5 -5
- package/src/Modal/tests/{Portal.test.jsx → Portal.test.tsx} +3 -3
- package/src/hooks/useArrowKeyNavigation.jsx +1 -2
- package/src/index.d.ts +19 -5
- package/src/index.js +5 -5
- package/src/Container/index.jsx +0 -49
- /package/src/Truncate/{Truncate.test.js → utils.test.js} +0 -0
|
@@ -7,17 +7,20 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
7
7
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
8
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
9
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
+
/* eslint-disable react/require-default-props */
|
|
10
11
|
import React from 'react';
|
|
11
12
|
import PropTypes from 'prop-types';
|
|
12
13
|
import classNames from 'classnames';
|
|
13
|
-
|
|
14
|
-
var as = _ref.as,
|
|
14
|
+
var ModalDialogHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
15
|
+
var _ref$as = _ref.as,
|
|
16
|
+
as = _ref$as === void 0 ? 'div' : _ref$as,
|
|
15
17
|
children = _ref.children,
|
|
16
18
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
17
19
|
return /*#__PURE__*/React.createElement(as, _objectSpread(_objectSpread({}, props), {}, {
|
|
20
|
+
ref: ref,
|
|
18
21
|
className: classNames('pgn__modal-header', props.className)
|
|
19
22
|
}), children);
|
|
20
|
-
}
|
|
23
|
+
});
|
|
21
24
|
ModalDialogHeader.propTypes = {
|
|
22
25
|
/** Specifies the base element */
|
|
23
26
|
as: PropTypes.elementType,
|
|
@@ -26,9 +29,5 @@ ModalDialogHeader.propTypes = {
|
|
|
26
29
|
/** Specifies class name to append to the base element */
|
|
27
30
|
className: PropTypes.string
|
|
28
31
|
};
|
|
29
|
-
ModalDialogHeader.defaultProps = {
|
|
30
|
-
as: 'div',
|
|
31
|
-
className: undefined
|
|
32
|
-
};
|
|
33
32
|
export default ModalDialogHeader;
|
|
34
33
|
//# sourceMappingURL=ModalDialogHeader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalDialogHeader.js","names":["React","PropTypes","classNames","ModalDialogHeader","_ref","as","children","props","_objectWithoutProperties","_excluded","createElement","_objectSpread","className","propTypes","elementType","node","isRequired","string"
|
|
1
|
+
{"version":3,"file":"ModalDialogHeader.js","names":["React","PropTypes","classNames","ModalDialogHeader","forwardRef","_ref","ref","_ref$as","as","children","props","_objectWithoutProperties","_excluded","createElement","_objectSpread","className","propTypes","elementType","node","isRequired","string"],"sources":["../../src/Modal/ModalDialogHeader.tsx"],"sourcesContent":["/* eslint-disable react/require-default-props */\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport type { ComponentWithAsProp } from '../utils/types/bootstrap';\n\nexport interface Props {\n as?: string;\n children: React.ReactNode;\n className?: string;\n}\n\ntype HeaderType = ComponentWithAsProp<'div', Props>;\n\nconst ModalDialogHeader: HeaderType = React.forwardRef<HTMLDivElement, Props>(({\n as = 'div',\n children,\n ...props\n}, ref) => (\n React.createElement(\n as,\n {\n ...props,\n ref,\n className: classNames('pgn__modal-header', props.className),\n },\n children,\n )\n));\n\nModalDialogHeader.propTypes = {\n /** Specifies the base element */\n as: PropTypes.elementType,\n /** Specifies the contents of the header */\n children: PropTypes.node.isRequired,\n /** Specifies class name to append to the base element */\n className: PropTypes.string,\n};\n\nexport default ModalDialogHeader;\n"],"mappings":";;;;;;;;;AAAA;AACA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAWnC,IAAMC,iBAA6B,gBAAGH,KAAK,CAACI,UAAU,CAAwB,UAAAC,IAAA,EAI3EC,GAAG;EAAA,IAAAC,OAAA,GAAAF,IAAA,CAHJG,EAAE;IAAFA,EAAE,GAAAD,OAAA,cAAG,KAAK,GAAAA,OAAA;IACVE,QAAQ,GAAAJ,IAAA,CAARI,QAAQ;IACLC,KAAK,GAAAC,wBAAA,CAAAN,IAAA,EAAAO,SAAA;EAAA,oBAERZ,KAAK,CAACa,aAAa,CACjBL,EAAE,EAAAM,aAAA,CAAAA,aAAA,KAEGJ,KAAK;IACRJ,GAAG,EAAHA,GAAG;IACHS,SAAS,EAAEb,UAAU,CAAC,mBAAmB,EAAEQ,KAAK,CAACK,SAAS;EAAC,IAE7DN,QACF,CAAC;AAAA,CACF,CAAC;AAEFN,iBAAiB,CAACa,SAAS,GAAG;EAC5B;EACAR,EAAE,EAAEP,SAAS,CAACgB,WAAW;EACzB;EACAR,QAAQ,EAAER,SAAS,CAACiB,IAAI,CAACC,UAAU;EACnC;EACAJ,SAAS,EAAEd,SAAS,CAACmB;AACvB,CAAC;AAED,eAAejB,iBAAiB","ignoreList":[]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
declare function ModalBackdrop({ onClick }: {
|
|
4
|
+
onClick?: () => void;
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare namespace ModalBackdrop {
|
|
7
|
+
var propTypes: {
|
|
8
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
declare function ModalContentContainer({ children }: {
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare namespace ModalContentContainer {
|
|
15
|
+
var propTypes: {
|
|
16
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
interface Props {
|
|
20
|
+
/** Specifies the contents of the modal */
|
|
21
|
+
children: React.ReactNode;
|
|
22
|
+
/** A callback function for when the modal is dismissed */
|
|
23
|
+
onClose: () => void;
|
|
24
|
+
/** Is the modal dialog open or closed */
|
|
25
|
+
isOpen: boolean;
|
|
26
|
+
/** Prevent clicking on the backdrop or pressing Esc to close the modal */
|
|
27
|
+
isBlocking?: boolean;
|
|
28
|
+
/** Specifies the z-index of the modal */
|
|
29
|
+
zIndex?: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The ModalLayer should be used for any component that wishes to engage the user
|
|
33
|
+
* in a "mode" where a layer on top of the application is interactive while the
|
|
34
|
+
* rest of the application is made non-interactive. The assumption made by this
|
|
35
|
+
* component is that if a modal object is visible then it is "enabled"
|
|
36
|
+
*/
|
|
37
|
+
declare function ModalLayer({ children, onClose, isOpen, isBlocking, zIndex, }: Props): import("react/jsx-runtime").JSX.Element | null;
|
|
38
|
+
declare namespace ModalLayer {
|
|
39
|
+
var propTypes: {
|
|
40
|
+
/** Specifies the contents of the modal */
|
|
41
|
+
children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
|
42
|
+
/** A callback function for when the modal is dismissed */
|
|
43
|
+
onClose: PropTypes.Validator<(...args: any[]) => any>;
|
|
44
|
+
/** Is the modal dialog open or closed */
|
|
45
|
+
isOpen: PropTypes.Validator<boolean>;
|
|
46
|
+
/** Prevent clicking on the backdrop or pressing Esc to close the modal */
|
|
47
|
+
isBlocking: PropTypes.Requireable<boolean>;
|
|
48
|
+
/** Specifies the z-index of the modal */
|
|
49
|
+
zIndex: PropTypes.Requireable<number>;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
export { ModalBackdrop, ModalContentContainer };
|
|
53
|
+
export default ModalLayer;
|
package/dist/Modal/ModalLayer.js
CHANGED
|
@@ -22,13 +22,11 @@ function ModalBackdrop(_ref) {
|
|
|
22
22
|
ModalBackdrop.propTypes = {
|
|
23
23
|
onClick: PropTypes.func
|
|
24
24
|
};
|
|
25
|
-
ModalBackdrop.defaultProps = {
|
|
26
|
-
onClick: undefined
|
|
27
|
-
};
|
|
28
25
|
|
|
29
26
|
// istanbul ignore next
|
|
30
27
|
function ModalContentContainer(_ref2) {
|
|
31
|
-
var children = _ref2.children
|
|
28
|
+
var _ref2$children = _ref2.children,
|
|
29
|
+
children = _ref2$children === void 0 ? null : _ref2$children;
|
|
32
30
|
return /*#__PURE__*/React.createElement("div", {
|
|
33
31
|
className: "pgn__modal-content-container"
|
|
34
32
|
}, children);
|
|
@@ -36,10 +34,6 @@ function ModalContentContainer(_ref2) {
|
|
|
36
34
|
ModalContentContainer.propTypes = {
|
|
37
35
|
children: PropTypes.node
|
|
38
36
|
};
|
|
39
|
-
ModalContentContainer.defaultProps = {
|
|
40
|
-
children: null
|
|
41
|
-
};
|
|
42
|
-
|
|
43
37
|
/**
|
|
44
38
|
* The ModalLayer should be used for any component that wishes to engage the user
|
|
45
39
|
* in a "mode" where a layer on top of the application is interactive while the
|
|
@@ -50,7 +44,8 @@ function ModalLayer(_ref3) {
|
|
|
50
44
|
var children = _ref3.children,
|
|
51
45
|
onClose = _ref3.onClose,
|
|
52
46
|
isOpen = _ref3.isOpen,
|
|
53
|
-
isBlocking = _ref3.isBlocking,
|
|
47
|
+
_ref3$isBlocking = _ref3.isBlocking,
|
|
48
|
+
isBlocking = _ref3$isBlocking === void 0 ? false : _ref3$isBlocking,
|
|
54
49
|
zIndex = _ref3.zIndex;
|
|
55
50
|
useEffect(function () {
|
|
56
51
|
if (isOpen) {
|
|
@@ -65,7 +60,7 @@ function ModalLayer(_ref3) {
|
|
|
65
60
|
if (!isOpen) {
|
|
66
61
|
return null;
|
|
67
62
|
}
|
|
68
|
-
var handleClose = isBlocking ?
|
|
63
|
+
var handleClose = isBlocking ? undefined : onClose;
|
|
69
64
|
return /*#__PURE__*/React.createElement(ModalContextProvider, {
|
|
70
65
|
onClose: onClose,
|
|
71
66
|
isOpen: isOpen,
|
|
@@ -93,10 +88,6 @@ ModalLayer.propTypes = {
|
|
|
93
88
|
/** Specifies the z-index of the modal */
|
|
94
89
|
zIndex: PropTypes.number
|
|
95
90
|
};
|
|
96
|
-
ModalLayer.defaultProps = {
|
|
97
|
-
isBlocking: false,
|
|
98
|
-
zIndex: undefined
|
|
99
|
-
};
|
|
100
91
|
export { ModalBackdrop, ModalContentContainer };
|
|
101
92
|
export default ModalLayer;
|
|
102
93
|
//# sourceMappingURL=ModalLayer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalLayer.js","names":["React","useEffect","classNames","PropTypes","FocusOn","Portal","ModalContextProvider","ModalBackdrop","_ref","onClick","createElement","className","onKeyDown","propTypes","func","
|
|
1
|
+
{"version":3,"file":"ModalLayer.js","names":["React","useEffect","classNames","PropTypes","FocusOn","Portal","ModalContextProvider","ModalBackdrop","_ref","onClick","createElement","className","onKeyDown","propTypes","func","ModalContentContainer","_ref2","_ref2$children","children","node","ModalLayer","_ref3","onClose","isOpen","_ref3$isBlocking","isBlocking","zIndex","document","body","classList","add","remove","handleClose","undefined","allowPinchZoom","scrollLock","enabled","onEscapeKey","onClickOutside","concat","isRequired","bool","number"],"sources":["../../src/Modal/ModalLayer.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\nimport classNames from 'classnames';\nimport PropTypes from 'prop-types';\nimport { FocusOn } from 'react-focus-on';\nimport Portal from './Portal';\nimport { ModalContextProvider } from './ModalContext';\n\n// istanbul ignore next\nfunction ModalBackdrop({ onClick }: { onClick?: () => void }) {\n return (\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions\n <div\n className=\"pgn__modal-backdrop\"\n onClick={onClick}\n onKeyDown={onClick}\n data-testid=\"modal-backdrop\"\n />\n );\n}\n\nModalBackdrop.propTypes = {\n onClick: PropTypes.func,\n};\n\n// istanbul ignore next\nfunction ModalContentContainer({ children = null }: { children?: React.ReactNode }) {\n return <div className=\"pgn__modal-content-container\">{children}</div>;\n}\n\nModalContentContainer.propTypes = {\n children: PropTypes.node,\n};\n\ninterface Props {\n /** Specifies the contents of the modal */\n children: React.ReactNode;\n /** A callback function for when the modal is dismissed */\n onClose: () => void;\n /** Is the modal dialog open or closed */\n isOpen: boolean;\n /** Prevent clicking on the backdrop or pressing Esc to close the modal */\n isBlocking?: boolean;\n /** Specifies the z-index of the modal */\n zIndex?: number;\n}\n\n/**\n * The ModalLayer should be used for any component that wishes to engage the user\n * in a \"mode\" where a layer on top of the application is interactive while the\n * rest of the application is made non-interactive. The assumption made by this\n * component is that if a modal object is visible then it is \"enabled\"\n */\nfunction ModalLayer({\n children, onClose, isOpen, isBlocking = false, zIndex,\n}: Props) {\n useEffect(() => {\n if (isOpen) {\n document.body.classList.add('pgn__hidden-scroll-padding-right');\n } else {\n document.body.classList.remove('pgn__hidden-scroll-padding-right');\n }\n return () => {\n document.body.classList.remove('pgn__hidden-scroll-padding-right');\n };\n }, [isOpen]);\n\n if (!isOpen) {\n return null;\n }\n\n const handleClose = isBlocking ? undefined : onClose;\n\n return (\n <ModalContextProvider onClose={onClose} isOpen={isOpen} isBlocking={isBlocking}>\n <Portal>\n <FocusOn\n allowPinchZoom\n scrollLock\n enabled={isOpen}\n onEscapeKey={handleClose}\n onClickOutside={handleClose}\n className={classNames(\n 'pgn__modal-layer',\n zIndex ? `zindex-${zIndex}` : '',\n )}\n >\n <ModalContentContainer>\n <ModalBackdrop onClick={handleClose} />\n {children}\n </ModalContentContainer>\n </FocusOn>\n </Portal>\n </ModalContextProvider>\n );\n}\n\nModalLayer.propTypes = {\n /** Specifies the contents of the modal */\n children: PropTypes.node.isRequired,\n /** A callback function for when the modal is dismissed */\n onClose: PropTypes.func.isRequired,\n /** Is the modal dialog open or closed */\n isOpen: PropTypes.bool.isRequired,\n /** Prevent clicking on the backdrop or pressing Esc to close the modal */\n isBlocking: PropTypes.bool,\n /** Specifies the z-index of the modal */\n zIndex: PropTypes.number,\n};\n\nexport { ModalBackdrop, ModalContentContainer };\nexport default ModalLayer;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,OAAO,QAAQ,gBAAgB;AACxC,OAAOC,MAAM,MAAM,UAAU;AAC7B,SAASC,oBAAoB,QAAQ,gBAAgB;;AAErD;AACA,SAASC,aAAaA,CAAAC,IAAA,EAAwC;EAAA,IAArCC,OAAO,GAAAD,IAAA,CAAPC,OAAO;EAC9B;IAAA;IACE;IACAT,KAAA,CAAAU,aAAA;MACEC,SAAS,EAAC,qBAAqB;MAC/BF,OAAO,EAAEA,OAAQ;MACjBG,SAAS,EAAEH,OAAQ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oBACEtB,KAAA,CAAAU,aAAA,CAACJ,oBAAoB;IAACgB,OAAO,EAAEA,OAAQ;IAACC,MAAM,EAAEA,MAAO;IAACE,UAAU,EAAEA;EAAW,gBAC7EzB,KAAA,CAAAU,aAAA,CAACL,MAAM,qBACLL,KAAA,CAAAU,aAAA,CAACN,OAAO;IACN8B,cAAc;IACdC,UAAU;IACVC,OAAO,EAAEb,MAAO;IAChBc,WAAW,EAAEL,WAAY;IACzBM,cAAc,EAAEN,WAAY;IAC5BrB,SAAS,EAAET,UAAU,CACnB,kBAAkB,EAClBwB,MAAM,aAAAa,MAAA,CAAab,MAAM,IAAK,EAChC;EAAE,gBAEF1B,KAAA,CAAAU,aAAA,CAACK,qBAAqB,qBACpBf,KAAA,CAAAU,aAAA,CAACH,aAAa;IAACE,OAAO,EAAEuB;EAAY,CAAE,CAAC,EACtCd,QACoB,CAChB,CACH,CACY,CAAC;AAE3B;AAEAE,UAAU,CAACP,SAAS,GAAG;EACrB;EACAK,QAAQ,EAAEf,SAAS,CAACgB,IAAI,CAACqB,UAAU;EACnC;EACAlB,OAAO,EAAEnB,SAAS,CAACW,IAAI,CAAC0B,UAAU;EAClC;EACAjB,MAAM,EAAEpB,SAAS,CAACsC,IAAI,CAACD,UAAU;EACjC;EACAf,UAAU,EAAEtB,SAAS,CAACsC,IAAI;EAC1B;EACAf,MAAM,EAAEvB,SAAS,CAACuC;AACpB,CAAC;AAED,SAASnC,aAAa,EAAEQ,qBAAqB;AAC7C,eAAeK,UAAU","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
}
|
|
5
|
+
declare class Portal extends React.Component<Props> {
|
|
6
|
+
private rootName;
|
|
7
|
+
private rootElement;
|
|
8
|
+
constructor(props: Props);
|
|
9
|
+
render(): React.ReactPortal | null;
|
|
10
|
+
}
|
|
11
|
+
export default Portal;
|
package/dist/Modal/Portal.js
CHANGED
|
@@ -2,8 +2,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2
2
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3
3
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
4
4
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
5
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
8
6
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
9
7
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
@@ -11,9 +9,11 @@ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) ===
|
|
|
11
9
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
12
10
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
13
11
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
12
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
14
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
14
15
|
import React from 'react';
|
|
15
16
|
import ReactDOM from 'react-dom';
|
|
16
|
-
import PropTypes from 'prop-types';
|
|
17
17
|
var Portal = /*#__PURE__*/function (_React$Component) {
|
|
18
18
|
_inherits(Portal, _React$Component);
|
|
19
19
|
var _super = _createSuper(Portal);
|
|
@@ -21,6 +21,8 @@ var Portal = /*#__PURE__*/function (_React$Component) {
|
|
|
21
21
|
var _this;
|
|
22
22
|
_classCallCheck(this, Portal);
|
|
23
23
|
_this = _super.call(this, props);
|
|
24
|
+
_defineProperty(_assertThisInitialized(_this), "rootName", void 0);
|
|
25
|
+
_defineProperty(_assertThisInitialized(_this), "rootElement", void 0);
|
|
24
26
|
_this.rootName = 'paragon-portal-root';
|
|
25
27
|
// istanbul ignore if
|
|
26
28
|
if (typeof document === 'undefined') {
|
|
@@ -47,8 +49,5 @@ var Portal = /*#__PURE__*/function (_React$Component) {
|
|
|
47
49
|
}]);
|
|
48
50
|
return Portal;
|
|
49
51
|
}(React.Component);
|
|
50
|
-
Portal.propTypes = {
|
|
51
|
-
children: PropTypes.node.isRequired
|
|
52
|
-
};
|
|
53
52
|
export default Portal;
|
|
54
53
|
//# sourceMappingURL=Portal.js.map
|
package/dist/Modal/Portal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Portal.js","names":["React","ReactDOM","
|
|
1
|
+
{"version":3,"file":"Portal.js","names":["React","ReactDOM","Portal","_React$Component","_inherits","_super","_createSuper","props","_this","_classCallCheck","call","_defineProperty","_assertThisInitialized","rootName","document","rootElement","getElementById","createElement","setAttribute","body","appendChild","_createClass","key","value","render","createPortal","children","Component"],"sources":["../../src/Modal/Portal.tsx"],"sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\n\ninterface Props {\n children: React.ReactNode;\n}\n\nclass Portal extends React.Component<Props> {\n private rootName: string;\n\n private rootElement: HTMLElement | null;\n\n constructor(props: Props) {\n super(props);\n this.rootName = 'paragon-portal-root';\n // istanbul ignore if\n if (typeof document === 'undefined') {\n this.rootElement = null;\n } else if (document.getElementById(this.rootName)) {\n this.rootElement = document.getElementById(this.rootName);\n } else {\n const rootElement = document.createElement('div');\n rootElement.setAttribute('id', this.rootName);\n this.rootElement = document.body.appendChild(rootElement);\n }\n }\n\n render() {\n // istanbul ignore else\n if (this.rootElement) {\n return ReactDOM.createPortal(\n this.props.children,\n this.rootElement,\n );\n }\n // istanbul ignore next\n return null;\n }\n}\n\nexport default Portal;\n"],"mappings":";;;;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAO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,SAAS;AAiCpC,eAAezB,MAAM","ignoreList":[]}
|
package/dist/core.css
CHANGED
|
@@ -11099,6 +11099,8 @@ a.pgn__card {
|
|
|
11099
11099
|
bottom: calc(-1 * var(--pgn-spacing-card-logo-bottom-offset-base));
|
|
11100
11100
|
width: var(--pgn-size-card-logo-width);
|
|
11101
11101
|
height: var(--pgn-size-card-logo-height);
|
|
11102
|
+
object-fit: scale-down;
|
|
11103
|
+
object-position: center center;
|
|
11102
11104
|
border-radius: var(--pgn-size-card-border-radius-logo);
|
|
11103
11105
|
box-shadow: var(--pgn-elevation-box-shadow-level-1);
|
|
11104
11106
|
padding: calc(var(--pgn-spacing-spacer-base) * .5);
|