@elliemae/ds-modal-slide 2.2.0 → 2.3.0-alpha.3

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.
@@ -1,69 +1,78 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _jsx = require('@babel/runtime/helpers/jsx');
6
- require('react');
7
- var reactDesc = require('react-desc');
8
- var styled = require('styled-components');
9
- var DSSeparator = require('@elliemae/ds-separator');
10
- var dsIcons = require('@elliemae/ds-icons');
11
- var DSButton = require('@elliemae/ds-button');
12
- var blocks = require('./blocks.js');
13
-
14
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
15
-
16
- var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
17
- var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
18
- var DSSeparator__default = /*#__PURE__*/_interopDefaultLegacy(DSSeparator);
19
- var DSButton__default = /*#__PURE__*/_interopDefaultLegacy(DSButton);
20
-
21
- var _StyledSeparator, _Close;
22
-
23
- const ModalHeader = _ref => {
24
- let {
25
- title: headerTitle = '',
26
- onClose = () => null,
27
- toolbar = null
28
- } = _ref;
29
- return /*#__PURE__*/_jsx__default["default"](HeaderWrapper, {}, void 0, /*#__PURE__*/_jsx__default["default"](blocks.HeaderLeftSide, {}, void 0, /*#__PURE__*/_jsx__default["default"](blocks.Header, {}, void 0, /*#__PURE__*/_jsx__default["default"](blocks.Title, {}, void 0, headerTitle))), toolbar, toolbar && (_StyledSeparator || (_StyledSeparator = /*#__PURE__*/_jsx__default["default"](StyledSeparator, {
30
- position: "initial",
31
- margin: "none",
32
- orientation: "vertical",
33
- type: "non-form"
34
- }))), /*#__PURE__*/_jsx__default["default"](StyledCloseButton, {
35
- "data-testid": "modal-slider-header-close",
36
- "aria-label": "Close modal slide",
37
- buttonType: "text",
38
- icon: _Close || (_Close = /*#__PURE__*/_jsx__default["default"](dsIcons.Close, {
39
- "aria-label": "Close modal slide",
40
- size: "s"
41
- })),
42
- onClick: onClose
43
- }));
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __reExport = (target, module2, copyDefault, desc) => {
13
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
+ for (let key of __getOwnPropNames(module2))
15
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
+ }
18
+ return target;
44
19
  };
45
-
46
- const HeaderWrapper = /*#__PURE__*/styled__default["default"].div.withConfig({
47
- componentId: "sc-oxqqo8-0"
48
- })(["display:flex;justify-content:space-between;width:100%;align-items:center;"]);
49
- const StyledSeparator = /*#__PURE__*/styled__default["default"](DSSeparator__default["default"]).withConfig({
50
- componentId: "sc-oxqqo8-1"
51
- })(["padding:", " 0;"], props => props.theme.space.xs);
52
- const StyledCloseButton = /*#__PURE__*/styled__default["default"](DSButton__default["default"]).withConfig({
53
- componentId: "sc-oxqqo8-2"
54
- })(["margin:", ";"], props => props.theme.space.xs);
20
+ var __toESM = (module2, isNodeMode) => {
21
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
+ };
23
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
+ return (module2, temp) => {
25
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
+ };
27
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
+ var Header_exports = {};
29
+ __export(Header_exports, {
30
+ DSModalSlideHeaderWithSchema: () => DSModalSlideHeaderWithSchema,
31
+ default: () => Header_default
32
+ });
33
+ var React = __toESM(require("react"));
34
+ var import_react = __toESM(require("react"));
35
+ var import_react_desc = require("react-desc");
36
+ var import_styled_components = __toESM(require("styled-components"));
37
+ var import_ds_separator = __toESM(require("@elliemae/ds-separator"));
38
+ var import_ds_icons = require("@elliemae/ds-icons");
39
+ var import_ds_button = __toESM(require("@elliemae/ds-button"));
40
+ var import_blocks = require("./blocks");
41
+ const ModalHeader = ({ title: headerTitle = "", onClose = () => null, toolbar = null }) => /* @__PURE__ */ import_react.default.createElement(HeaderWrapper, null, /* @__PURE__ */ import_react.default.createElement(import_blocks.HeaderLeftSide, null, /* @__PURE__ */ import_react.default.createElement(import_blocks.Header, null, /* @__PURE__ */ import_react.default.createElement(import_blocks.Title, null, headerTitle))), toolbar, toolbar && /* @__PURE__ */ import_react.default.createElement(StyledSeparator, {
42
+ position: "initial",
43
+ margin: "none",
44
+ orientation: "vertical",
45
+ type: "non-form"
46
+ }), /* @__PURE__ */ import_react.default.createElement(StyledCloseButton, {
47
+ "data-testid": "modal-slider-header-close",
48
+ "aria-label": "Close modal slide",
49
+ buttonType: "text",
50
+ icon: /* @__PURE__ */ import_react.default.createElement(import_ds_icons.Close, {
51
+ "aria-label": "Close modal slide",
52
+ size: "s"
53
+ }),
54
+ onClick: onClose
55
+ }));
56
+ const HeaderWrapper = import_styled_components.default.div`
57
+ display: flex;
58
+ justify-content: space-between;
59
+ width: 100%;
60
+ align-items: center;
61
+ `;
62
+ const StyledSeparator = (0, import_styled_components.default)(import_ds_separator.default)`
63
+ padding: ${(props2) => props2.theme.space.xs} 0;
64
+ `;
65
+ const StyledCloseButton = (0, import_styled_components.default)(import_ds_button.default)`
66
+ margin: ${(props2) => props2.theme.space.xs};
67
+ `;
55
68
  const props = {
56
- /** on modal close callback */
57
- onClose: reactDesc.PropTypes.func.description('on modal close callback'),
58
-
59
- /** modal toolbar component */
60
- toolbar: reactDesc.PropTypes.node.description('modal toolbar comoponent'),
61
-
62
- /** modal title */
63
- title: reactDesc.PropTypes.string.description('modal title')
69
+ onClose: import_react_desc.PropTypes.func.description("on modal close callback"),
70
+ toolbar: import_react_desc.PropTypes.node.description("modal toolbar comoponent"),
71
+ title: import_react_desc.PropTypes.string.description("modal title")
64
72
  };
65
- const DSModalSlideHeaderWithSchema = reactDesc.describe(ModalHeader);
73
+ ModalHeader.propTypes = props;
74
+ const DSModalSlideHeaderWithSchema = (0, import_react_desc.describe)(ModalHeader);
66
75
  DSModalSlideHeaderWithSchema.propTypes = props;
67
-
68
- exports.DSModalSlideHeaderWithSchema = DSModalSlideHeaderWithSchema;
69
- exports["default"] = ModalHeader;
76
+ var Header_default = ModalHeader;
77
+ module.exports = __toCommonJS(Header_exports);
78
+ //# sourceMappingURL=Header.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/Header.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import React from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport styled from 'styled-components';\nimport DSSeparator from '@elliemae/ds-separator';\nimport { Close } from '@elliemae/ds-icons';\nimport DSButton from '@elliemae/ds-button';\nimport { Header, HeaderLeftSide, Title } from './blocks';\n\nconst ModalHeader = ({ title: headerTitle = '', onClose = () => null, toolbar = null }) => (\n <HeaderWrapper>\n <HeaderLeftSide>\n <Header>\n <Title>{headerTitle}</Title>\n </Header>\n </HeaderLeftSide>\n {toolbar}\n {toolbar && <StyledSeparator position=\"initial\" margin=\"none\" orientation=\"vertical\" type=\"non-form\" />}\n <StyledCloseButton\n data-testid=\"modal-slider-header-close\"\n aria-label=\"Close modal slide\"\n buttonType=\"text\"\n icon={<Close aria-label=\"Close modal slide\" size=\"s\" />}\n onClick={onClose}\n />\n </HeaderWrapper>\n);\n\nconst HeaderWrapper = styled.div`\n display: flex;\n justify-content: space-between;\n width: 100%;\n align-items: center;\n`;\n\nconst StyledSeparator = styled(DSSeparator)`\n padding: ${(props) => props.theme.space.xs} 0;\n`;\n\nconst StyledCloseButton = styled(DSButton)`\n margin: ${(props) => props.theme.space.xs};\n`;\n\nconst props = {\n /** on modal close callback */\n onClose: PropTypes.func.description('on modal close callback'),\n /** modal toolbar component */\n toolbar: PropTypes.node.description('modal toolbar comoponent'),\n /** modal title */\n title: PropTypes.string.description('modal title'),\n};\n\nModalHeader.propTypes = props;\n\nconst DSModalSlideHeaderWithSchema = describe(ModalHeader);\nDSModalSlideHeaderWithSchema.propTypes = props;\n\nexport { DSModalSlideHeaderWithSchema };\n\nexport default ModalHeader;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,wBAAoC;AACpC,+BAAmB;AACnB,0BAAwB;AACxB,sBAAsB;AACtB,uBAAqB;AACrB,oBAA8C;AAE9C,MAAM,cAAc,CAAC,EAAE,OAAO,cAAc,IAAI,UAAU,MAAM,MAAM,UAAU,WAC9E,mDAAC,eAAD,MACE,mDAAC,8BAAD,MACE,mDAAC,sBAAD,MACE,mDAAC,qBAAD,MAAQ,gBAGX,SACA,WAAW,mDAAC,iBAAD;AAAA,EAAiB,UAAS;AAAA,EAAU,QAAO;AAAA,EAAO,aAAY;AAAA,EAAW,MAAK;AAAA,IAC1F,mDAAC,mBAAD;AAAA,EACE,eAAY;AAAA,EACZ,cAAW;AAAA,EACX,YAAW;AAAA,EACX,MAAM,mDAAC,uBAAD;AAAA,IAAO,cAAW;AAAA,IAAoB,MAAK;AAAA;AAAA,EACjD,SAAS;AAAA;AAKf,MAAM,gBAAgB,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAO7B,MAAM,kBAAkB,sCAAO;AAAA,aAClB,CAAC,WAAU,OAAM,MAAM,MAAM;AAAA;AAG1C,MAAM,oBAAoB,sCAAO;AAAA,YACrB,CAAC,WAAU,OAAM,MAAM,MAAM;AAAA;AAGzC,MAAM,QAAQ;AAAA,EAEZ,SAAS,4BAAU,KAAK,YAAY;AAAA,EAEpC,SAAS,4BAAU,KAAK,YAAY;AAAA,EAEpC,OAAO,4BAAU,OAAO,YAAY;AAAA;AAGtC,YAAY,YAAY;AAExB,MAAM,+BAA+B,gCAAS;AAC9C,6BAA6B,YAAY;AAIzC,IAAO,iBAAQ;",
6
+ "names": []
7
+ }
@@ -1,54 +1,65 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var dsClassnames = require('@elliemae/ds-classnames');
6
-
7
- const blockName = 'modal-slide';
8
- const Wrapper = dsClassnames.aggregatedClasses('div')(blockName, 'wrapper', _ref => {
9
- let {
10
- show,
11
- centered
12
- } = _ref;
13
- return {
14
- showing: show,
15
- disappearing: !show,
16
- centered
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __reExport = (target, module2, copyDefault, desc) => {
13
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
+ for (let key of __getOwnPropNames(module2))
15
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
+ }
18
+ return target;
19
+ };
20
+ var __toESM = (module2, isNodeMode) => {
21
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
+ };
23
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
+ return (module2, temp) => {
25
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
17
26
  };
27
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
+ var blocks_exports = {};
29
+ __export(blocks_exports, {
30
+ ActualContent: () => ActualContent,
31
+ BreadcrumTitle: () => BreadcrumTitle,
32
+ Content: () => Content,
33
+ Footer: () => Footer,
34
+ FooterWrapper: () => FooterWrapper,
35
+ Header: () => Header,
36
+ HeaderLeftSide: () => HeaderLeftSide,
37
+ Overlay: () => Overlay,
38
+ Title: () => Title,
39
+ Wrapper: () => Wrapper
18
40
  });
19
- const Overlay = dsClassnames.aggregatedClasses('div')(blockName, 'overlay', _ref2 => {
20
- let {
21
- show
22
- } = _ref2;
23
- return {
24
- showing: show,
25
- disappearing: !show
26
- };
27
- });
28
- const Content = dsClassnames.aggregatedClasses('div')(blockName, 'content', _ref3 => {
29
- let {
30
- show
31
- } = _ref3;
32
- return {
33
- showing: show,
34
- disappearing: !show
35
- };
36
- });
37
- const Title = dsClassnames.aggregatedClasses('div')(blockName, 'title', () => ({}));
38
- const BreadcrumTitle = dsClassnames.aggregatedClasses('div')(blockName, 'breadcrum-title', () => ({}));
39
- const HeaderLeftSide = dsClassnames.aggregatedClasses('div')(blockName, 'header-left-side', () => ({}));
40
- const ActualContent = dsClassnames.aggregatedClasses('div')(blockName, 'actual-content', () => ({}));
41
- const Header = dsClassnames.aggregatedClasses('div')(blockName, 'header', () => ({}));
42
- const Footer = dsClassnames.aggregatedClasses('div')(blockName, 'footer', () => ({}));
43
- const FooterWrapper = dsClassnames.aggregatedClasses('div')(blockName, 'footer-wrapper', () => ({}));
44
-
45
- exports.ActualContent = ActualContent;
46
- exports.BreadcrumTitle = BreadcrumTitle;
47
- exports.Content = Content;
48
- exports.Footer = Footer;
49
- exports.FooterWrapper = FooterWrapper;
50
- exports.Header = Header;
51
- exports.HeaderLeftSide = HeaderLeftSide;
52
- exports.Overlay = Overlay;
53
- exports.Title = Title;
54
- exports.Wrapper = Wrapper;
41
+ var React = __toESM(require("react"));
42
+ var import_ds_classnames = require("@elliemae/ds-classnames");
43
+ const blockName = "modal-slide";
44
+ const Wrapper = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "wrapper", ({ show, centered }) => ({
45
+ showing: show,
46
+ disappearing: !show,
47
+ centered
48
+ }));
49
+ const Overlay = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "overlay", ({ show }) => ({
50
+ showing: show,
51
+ disappearing: !show
52
+ }));
53
+ const Content = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "content", ({ show }) => ({
54
+ showing: show,
55
+ disappearing: !show
56
+ }));
57
+ const Title = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "title", () => ({}));
58
+ const BreadcrumTitle = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "breadcrum-title", () => ({}));
59
+ const HeaderLeftSide = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "header-left-side", () => ({}));
60
+ const ActualContent = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "actual-content", () => ({}));
61
+ const Header = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "header", () => ({}));
62
+ const Footer = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "footer", () => ({}));
63
+ const FooterWrapper = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "footer-wrapper", () => ({}));
64
+ module.exports = __toCommonJS(blocks_exports);
65
+ //# sourceMappingURL=blocks.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/blocks.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { aggregatedClasses } from '@elliemae/ds-classnames';\n\nconst blockName = 'modal-slide';\n\nexport const Wrapper = aggregatedClasses('div')(\n blockName,\n 'wrapper',\n ({ show, centered }) => ({\n showing: show,\n disappearing: !show,\n centered,\n }),\n);\n\nexport const Overlay = aggregatedClasses('div')(\n blockName,\n 'overlay',\n ({ show }) => ({\n showing: show,\n disappearing: !show,\n }),\n);\n\nexport const Content = aggregatedClasses('div')(\n blockName,\n 'content',\n ({ show }) => ({\n showing: show,\n disappearing: !show,\n }),\n);\n\nexport const Title = aggregatedClasses('div')(blockName, 'title', () => ({}));\n\nexport const BreadcrumTitle = aggregatedClasses('div')(\n blockName,\n 'breadcrum-title',\n () => ({}),\n);\n\nexport const HeaderLeftSide = aggregatedClasses('div')(\n blockName,\n 'header-left-side',\n () => ({}),\n);\n\nexport const ActualContent = aggregatedClasses('div')(\n blockName,\n 'actual-content',\n () => ({}),\n);\nexport const Header = aggregatedClasses('div')(blockName, 'header', () => ({}));\nexport const Footer = aggregatedClasses('div')(blockName, 'footer', () => ({}));\n\nexport const FooterWrapper = aggregatedClasses('div')(\n blockName,\n 'footer-wrapper',\n () => ({}),\n);\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,2BAAkC;AAElC,MAAM,YAAY;AAEX,MAAM,UAAU,4CAAkB,OACvC,WACA,WACA,CAAC,EAAE,MAAM,eAAgB;AAAA,EACvB,SAAS;AAAA,EACT,cAAc,CAAC;AAAA,EACf;AAAA;AAIG,MAAM,UAAU,4CAAkB,OACvC,WACA,WACA,CAAC,EAAE,WAAY;AAAA,EACb,SAAS;AAAA,EACT,cAAc,CAAC;AAAA;AAIZ,MAAM,UAAU,4CAAkB,OACvC,WACA,WACA,CAAC,EAAE,WAAY;AAAA,EACb,SAAS;AAAA,EACT,cAAc,CAAC;AAAA;AAIZ,MAAM,QAAQ,4CAAkB,OAAO,WAAW,SAAS,MAAO;AAElE,MAAM,iBAAiB,4CAAkB,OAC9C,WACA,mBACA,MAAO;AAGF,MAAM,iBAAiB,4CAAkB,OAC9C,WACA,oBACA,MAAO;AAGF,MAAM,gBAAgB,4CAAkB,OAC7C,WACA,kBACA,MAAO;AAEF,MAAM,SAAS,4CAAkB,OAAO,WAAW,UAAU,MAAO;AACpE,MAAM,SAAS,4CAAkB,OAAO,WAAW,UAAU,MAAO;AAEpE,MAAM,gBAAgB,4CAAkB,OAC7C,WACA,kBACA,MAAO;",
6
+ "names": []
7
+ }
package/cjs/index.js CHANGED
@@ -1,17 +1,40 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var DSModalSlide = require('./DSModalSlide.js');
6
- var Header = require('./components/Header.js');
7
- var Footer = require('./components/Footer.js');
8
-
9
-
10
-
11
- exports.DSModalSlide = DSModalSlide.DSModalSlide;
12
- exports.DSModalSlideWithSchema = DSModalSlide.DSModalSlideWithSchema;
13
- exports["default"] = DSModalSlide.DSModalSlide;
14
- exports.DSModalSlideHeaderWithSchema = Header.DSModalSlideHeaderWithSchema;
15
- exports.ModalHeader = Header["default"];
16
- exports.DSModalSlideFooterWithSchema = Footer.DSModalSlideFooterWithSchema;
17
- exports.ModalFooter = Footer["default"];
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __reExport = (target, module2, copyDefault, desc) => {
13
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
+ for (let key of __getOwnPropNames(module2))
15
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
+ }
18
+ return target;
19
+ };
20
+ var __toESM = (module2, isNodeMode) => {
21
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
+ };
23
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
+ return (module2, temp) => {
25
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
+ };
27
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
+ var src_exports = {};
29
+ __export(src_exports, {
30
+ DSModalSlideFooterWithSchema: () => import_Footer.DSModalSlideFooterWithSchema,
31
+ DSModalSlideHeaderWithSchema: () => import_Header.DSModalSlideHeaderWithSchema,
32
+ default: () => import_DSModalSlide.default
33
+ });
34
+ var React = __toESM(require("react"));
35
+ __reExport(src_exports, require("./DSModalSlide"));
36
+ var import_DSModalSlide = __toESM(require("./DSModalSlide"));
37
+ var import_Header = require("./components/Header");
38
+ var import_Footer = require("./components/Footer");
39
+ module.exports = __toCommonJS(src_exports);
40
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["export * from './DSModalSlide';\nexport { default } from './DSModalSlide';\nexport { DSModalSlideHeaderWithSchema } from './components/Header';\nexport { DSModalSlideFooterWithSchema } from './components/Footer';", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAc;AACd,0BAAwB;AACxB,oBAA6C;AAC7C,oBAA6C;",
6
+ "names": []
7
+ }
@@ -1,161 +1,123 @@
1
- import _jsx from '@babel/runtime/helpers/esm/jsx';
2
- import 'core-js/modules/web.dom-collections.iterator.js';
3
- import React, { useState, useCallback, useEffect } from 'react';
4
- import { PropTypes, describe } from 'react-desc';
5
- import ReactDOM from 'react-dom';
6
- import { useTheme } from '@elliemae/ds-system';
7
- import { Grid } from '@elliemae/ds-grid';
8
- import DSSeparator from '@elliemae/ds-separator';
9
- import { Wrapper, Overlay, Content, ActualContent } from './components/blocks.js';
10
- export { default as ModalHeader } from './components/Header.js';
11
- export { default as ModalFooter } from './components/Footer.js';
12
-
13
- var _DSSeparator, _DSSeparator2;
14
-
15
- const DSModalSlide = _ref => {
16
- let {
17
- isOpen = false,
18
- children,
19
- getContainer,
20
- centered = false,
21
- fullWidth = false,
22
- header = null,
23
- footer = null,
24
- fadeOut = 1500,
25
- fadeIn = 1500,
26
- overrideHeight = false
27
- } = _ref;
1
+ import * as React from "react";
2
+ import React2, { useState, useEffect, useCallback } from "react";
3
+ import { PropTypes, describe } from "react-desc";
4
+ import ReactDOM from "react-dom";
5
+ import { useTheme } from "@elliemae/ds-system";
6
+ import { Grid } from "@elliemae/ds-grid";
7
+ import DSSeparator from "@elliemae/ds-separator";
8
+ import { Wrapper, Overlay, Content, ActualContent } from "./components/blocks";
9
+ import ModalHeader from "./components/Header";
10
+ import ModalFooter from "./components/Footer";
11
+ const DSModalSlide = ({
12
+ isOpen = false,
13
+ children,
14
+ getContainer,
15
+ centered = false,
16
+ fullWidth = false,
17
+ header = null,
18
+ footer = null,
19
+ fadeOut = 1500,
20
+ fadeIn = 1500,
21
+ overrideHeight = false
22
+ }) => {
28
23
  const [isMoving, setMoving] = useState(false);
29
24
  const [show, setShow] = useState(isOpen);
30
25
  const [width, setWidth] = useState(50);
31
26
  const theme = useTheme();
32
- const contentRows = [...(header ? [theme.space.m] : []), '0px', 'auto', '0px', ...(footer ? [theme.space.m] : [])];
27
+ const contentRows = [...header ? [theme.space.m] : [], "0px", "auto", "0px", ...footer ? [theme.space.m] : []];
33
28
  const updateShow = useCallback(() => {
34
- if (fullWidth) setWidth(100);else setWidth(50);
35
-
29
+ if (fullWidth)
30
+ setWidth(100);
31
+ else
32
+ setWidth(50);
36
33
  if (isOpen !== show) {
37
34
  setMoving(true);
38
-
39
35
  if (isOpen) {
40
36
  setShow(isOpen);
41
37
  }
42
38
  }
43
39
  }, [isOpen, fullWidth, isMoving]);
44
40
  useEffect(updateShow, [isOpen, fullWidth]);
45
- if (!show) return null;
41
+ if (!show)
42
+ return null;
46
43
  const container = getContainer();
47
- if (!container) return null;
48
-
44
+ if (!container)
45
+ return null;
49
46
  const handleAnimationEnd = () => {
50
47
  setMoving(false);
51
- if (!isOpen) setShow(isOpen);
48
+ if (!isOpen)
49
+ setShow(isOpen);
52
50
  };
53
-
54
- let {
55
- height
56
- } = container.getBoundingClientRect();
57
-
51
+ let { height } = container.getBoundingClientRect();
58
52
  if (overrideHeight && container.scrollHeight > height) {
59
53
  height = container.scrollHeight;
60
54
  }
61
-
62
55
  if (!container.style.position) {
63
- container.style.position = 'relative';
56
+ container.style.position = "relative";
64
57
  }
65
-
66
- return /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/_jsx(Wrapper, {
58
+ return ReactDOM.createPortal(/* @__PURE__ */ React2.createElement(Wrapper, {
67
59
  classProps: {
68
60
  show: isOpen,
69
61
  centered
70
62
  },
71
63
  style: {
72
- '--height': height,
73
- '--fade-in': fadeIn,
74
- '--fade-out': fadeOut,
75
- '--width': width
64
+ "--height": height,
65
+ "--fade-in": fadeIn,
66
+ "--fade-out": fadeOut,
67
+ "--width": width
76
68
  }
77
- }, void 0, /*#__PURE__*/_jsx(Overlay, {
69
+ }, /* @__PURE__ */ React2.createElement(Overlay, {
78
70
  classProps: {
79
71
  show: isOpen
80
72
  }
81
- }, void 0, /*#__PURE__*/_jsx(Content, {
73
+ }, /* @__PURE__ */ React2.createElement(Content, {
82
74
  onAnimationEnd: handleAnimationEnd,
83
75
  classProps: {
84
76
  show: isOpen
85
77
  }
86
- }, void 0, /*#__PURE__*/_jsx(Grid, {
78
+ }, /* @__PURE__ */ React2.createElement(Grid, {
87
79
  style: {
88
- height: '100%',
89
- width: '100%',
90
- maxHeight: '100%',
91
- overflow: 'hidden',
92
- '-webkit-backface-visibility': 'hidden',
93
- 'backface-visibility': 'hidden',
94
- '-webkit-transform-style': 'preserve-3d'
80
+ height: "100%",
81
+ width: "100%",
82
+ maxHeight: "100%",
83
+ overflow: "hidden",
84
+ "-webkit-backface-visibility": "hidden",
85
+ "backface-visibility": "hidden",
86
+ "-webkit-transform-style": "preserve-3d"
95
87
  },
96
88
  rows: contentRows,
97
89
  "data-testid": "ds-modal-slide"
98
- }, void 0, header && /*#__PURE__*/React.cloneElement(header, {
99
- fullWidth
100
- }), header && (_DSSeparator || (_DSSeparator = /*#__PURE__*/_jsx(DSSeparator, {
90
+ }, header && React2.cloneElement(header, { fullWidth }), header && /* @__PURE__ */ React2.createElement(DSSeparator, {
101
91
  position: "initial",
102
92
  type: "non-form"
103
- }))), /*#__PURE__*/_jsx(Grid, {
104
- style: {
105
- overflow: 'hidden'
106
- }
107
- }, void 0, /*#__PURE__*/_jsx(Grid, {
108
- style: {
109
- overflow: 'auto'
110
- }
111
- }, void 0, /*#__PURE__*/_jsx(ActualContent, {}, void 0, children))), footer && (_DSSeparator2 || (_DSSeparator2 = /*#__PURE__*/_jsx(DSSeparator, {
93
+ }), /* @__PURE__ */ React2.createElement(Grid, {
94
+ style: { overflow: "hidden" }
95
+ }, /* @__PURE__ */ React2.createElement(Grid, {
96
+ style: { overflow: "auto" }
97
+ }, /* @__PURE__ */ React2.createElement(ActualContent, null, children))), footer && /* @__PURE__ */ React2.createElement(DSSeparator, {
112
98
  position: "initial",
113
99
  type: "non-form"
114
- }))), footer)))), container);
100
+ }), footer)))), container);
115
101
  };
116
-
117
102
  const props = {
118
- /**
119
- * If the modal slide is centered or not
120
- */
121
- centered: PropTypes.bool.description('If the modal slide is centered or not'),
122
-
123
- /**
124
- * If the modal slide is visible or not
125
- */
126
- isOpen: PropTypes.bool.description('If the modal slide is visible or not'),
127
-
128
- /**
129
- * Main content of the modal
130
- */
131
- children: PropTypes.oneOfType([PropTypes.element, PropTypes.string, PropTypes.any]).isRequired.description('Main content of the modal'),
132
-
133
- /**
134
- * If the modal slide takes the full width or not
135
- */
136
- fullWidth: PropTypes.bool.description('If the modal slide takes the full width or not'),
137
-
138
- /**
139
- * If the modal slide has a header, only available for full width option
140
- */
141
- header: PropTypes.element.description('If the modal slide has a header, only available for full width option'),
142
-
143
- /**
144
- * Ratio of fade out
145
- */
146
- fadeOut: PropTypes.number.description('Ratio of fade out'),
147
-
148
- /**
149
- * Ratio of fade in
150
- */
151
- fadeIn: PropTypes.number.description('Ratio of fade in'),
152
-
153
- /**
154
- * Override the panel height to scroll height of the container
155
- */
156
- overrideHeight: PropTypes.bool.description('Override the panel height to scroll height of the container')
103
+ centered: PropTypes.bool.description("If the modal slide is centered or not"),
104
+ isOpen: PropTypes.bool.description("If the modal slide is visible or not"),
105
+ children: PropTypes.oneOfType([PropTypes.element, PropTypes.string, PropTypes.any]).isRequired.description("Main content of the modal"),
106
+ fullWidth: PropTypes.bool.description("If the modal slide takes the full width or not"),
107
+ header: PropTypes.element.description("If the modal slide has a header, only available for full width option"),
108
+ fadeOut: PropTypes.number.description("Ratio of fade out"),
109
+ fadeIn: PropTypes.number.description("Ratio of fade in"),
110
+ overrideHeight: PropTypes.bool.description("Override the panel height to scroll height of the container")
157
111
  };
112
+ DSModalSlide.propTypes = props;
158
113
  const DSModalSlideWithSchema = describe(DSModalSlide);
159
114
  DSModalSlideWithSchema.propTypes = props;
160
-
161
- export { DSModalSlide, DSModalSlideWithSchema, DSModalSlide as default };
115
+ var DSModalSlide_default = DSModalSlide;
116
+ export {
117
+ DSModalSlide,
118
+ DSModalSlideWithSchema,
119
+ ModalFooter,
120
+ ModalHeader,
121
+ DSModalSlide_default as default
122
+ };
123
+ //# sourceMappingURL=DSModalSlide.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSModalSlide.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useState, useEffect, useCallback } from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport ReactDOM from 'react-dom';\nimport { useTheme } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport DSSeparator from '@elliemae/ds-separator';\nimport { Wrapper, Overlay, Content, ActualContent } from './components/blocks';\nimport ModalHeader from './components/Header';\nimport ModalFooter from './components/Footer';\n\n// eslint-disable-next-line complexity\nconst DSModalSlide = ({\n isOpen = false,\n children,\n getContainer,\n centered = false,\n fullWidth = false,\n header = null,\n footer = null,\n fadeOut = 1500,\n fadeIn = 1500,\n overrideHeight = false,\n}) => {\n const [isMoving, setMoving] = useState(false);\n const [show, setShow] = useState(isOpen);\n const [width, setWidth] = useState(50);\n const theme = useTheme();\n const contentRows = [...(header ? [theme.space.m] : []), '0px', 'auto', '0px', ...(footer ? [theme.space.m] : [])];\n\n const updateShow = useCallback(() => {\n if (fullWidth) setWidth(100);\n else setWidth(50);\n if (isOpen !== show) {\n setMoving(true);\n if (isOpen) {\n setShow(isOpen);\n }\n }\n }, [isOpen, fullWidth, isMoving]);\n\n useEffect(updateShow, [isOpen, fullWidth]);\n\n if (!show) return null;\n\n const container = getContainer();\n if (!container) return null;\n\n const handleAnimationEnd = () => {\n setMoving(false);\n if (!isOpen) setShow(isOpen);\n };\n\n let { height } = container.getBoundingClientRect();\n if (overrideHeight && container.scrollHeight > height) {\n height = container.scrollHeight;\n }\n if (!container.style.position) {\n container.style.position = 'relative';\n }\n\n return ReactDOM.createPortal(\n <Wrapper\n classProps={{\n show: isOpen,\n centered,\n }}\n style={{\n '--height': height,\n '--fade-in': fadeIn,\n '--fade-out': fadeOut,\n '--width': width,\n }}\n >\n <Overlay\n classProps={{\n show: isOpen,\n }}\n >\n <Content\n onAnimationEnd={handleAnimationEnd}\n classProps={{\n show: isOpen,\n }}\n >\n <Grid\n style={{\n height: '100%',\n width: '100%',\n maxHeight: '100%',\n overflow: 'hidden',\n '-webkit-backface-visibility': 'hidden',\n 'backface-visibility': 'hidden',\n '-webkit-transform-style': 'preserve-3d',\n }}\n rows={contentRows}\n data-testid=\"ds-modal-slide\"\n >\n {header && React.cloneElement(header, { fullWidth })}\n {header && <DSSeparator position=\"initial\" type=\"non-form\" />}\n <Grid style={{ overflow: 'hidden' }}>\n <Grid style={{ overflow: 'auto' }}>\n <ActualContent>{children}</ActualContent>\n </Grid>\n </Grid>\n {footer && <DSSeparator position=\"initial\" type=\"non-form\" />}\n {footer}\n </Grid>\n </Content>\n </Overlay>\n </Wrapper>,\n container,\n );\n};\n\nconst props = {\n /**\n * If the modal slide is centered or not\n */\n centered: PropTypes.bool.description('If the modal slide is centered or not'),\n /**\n * If the modal slide is visible or not\n */\n isOpen: PropTypes.bool.description('If the modal slide is visible or not'),\n /**\n * Main content of the modal\n */\n children: PropTypes.oneOfType([PropTypes.element, PropTypes.string, PropTypes.any]).isRequired.description(\n 'Main content of the modal',\n ),\n /**\n * If the modal slide takes the full width or not\n */\n fullWidth: PropTypes.bool.description('If the modal slide takes the full width or not'),\n /**\n * If the modal slide has a header, only available for full width option\n */\n header: PropTypes.element.description('If the modal slide has a header, only available for full width option'),\n /**\n * Ratio of fade out\n */\n fadeOut: PropTypes.number.description('Ratio of fade out'),\n /**\n * Ratio of fade in\n */\n fadeIn: PropTypes.number.description('Ratio of fade in'),\n /**\n * Override the panel height to scroll height of the container\n */\n overrideHeight: PropTypes.bool.description('Override the panel height to scroll height of the container'),\n};\n\nDSModalSlide.propTypes = props;\n\nconst DSModalSlideWithSchema = describe(DSModalSlide);\nDSModalSlideWithSchema.propTypes = props;\n\nexport { ModalHeader, ModalFooter, DSModalSlide, DSModalSlideWithSchema };\n\nexport default DSModalSlide;\n"],
5
+ "mappings": "AAAA;ACCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,MAAM,eAAe,CAAC;AAAA,EACpB,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,SAAS;AAAA,EACT,UAAU;AAAA,EACV,SAAS;AAAA,EACT,iBAAiB;AAAA,MACb;AACJ,QAAM,CAAC,UAAU,aAAa,SAAS;AACvC,QAAM,CAAC,MAAM,WAAW,SAAS;AACjC,QAAM,CAAC,OAAO,YAAY,SAAS;AACnC,QAAM,QAAQ;AACd,QAAM,cAAc,CAAC,GAAI,SAAS,CAAC,MAAM,MAAM,KAAK,IAAK,OAAO,QAAQ,OAAO,GAAI,SAAS,CAAC,MAAM,MAAM,KAAK;AAE9G,QAAM,aAAa,YAAY,MAAM;AACnC,QAAI;AAAW,eAAS;AAAA;AACnB,eAAS;AACd,QAAI,WAAW,MAAM;AACnB,gBAAU;AACV,UAAI,QAAQ;AACV,gBAAQ;AAAA;AAAA;AAAA,KAGX,CAAC,QAAQ,WAAW;AAEvB,YAAU,YAAY,CAAC,QAAQ;AAE/B,MAAI,CAAC;AAAM,WAAO;AAElB,QAAM,YAAY;AAClB,MAAI,CAAC;AAAW,WAAO;AAEvB,QAAM,qBAAqB,MAAM;AAC/B,cAAU;AACV,QAAI,CAAC;AAAQ,cAAQ;AAAA;AAGvB,MAAI,EAAE,WAAW,UAAU;AAC3B,MAAI,kBAAkB,UAAU,eAAe,QAAQ;AACrD,aAAS,UAAU;AAAA;AAErB,MAAI,CAAC,UAAU,MAAM,UAAU;AAC7B,cAAU,MAAM,WAAW;AAAA;AAG7B,SAAO,SAAS,aACd,qCAAC,SAAD;AAAA,IACE,YAAY;AAAA,MACV,MAAM;AAAA,MACN;AAAA;AAAA,IAEF,OAAO;AAAA,MACL,YAAY;AAAA,MACZ,aAAa;AAAA,MACb,cAAc;AAAA,MACd,WAAW;AAAA;AAAA,KAGb,qCAAC,SAAD;AAAA,IACE,YAAY;AAAA,MACV,MAAM;AAAA;AAAA,KAGR,qCAAC,SAAD;AAAA,IACE,gBAAgB;AAAA,IAChB,YAAY;AAAA,MACV,MAAM;AAAA;AAAA,KAGR,qCAAC,MAAD;AAAA,IACE,OAAO;AAAA,MACL,QAAQ;AAAA,MACR,OAAO;AAAA,MACP,WAAW;AAAA,MACX,UAAU;AAAA,MACV,+BAA+B;AAAA,MAC/B,uBAAuB;AAAA,MACvB,2BAA2B;AAAA;AAAA,IAE7B,MAAM;AAAA,IACN,eAAY;AAAA,KAEX,UAAU,OAAM,aAAa,QAAQ,EAAE,cACvC,UAAU,qCAAC,aAAD;AAAA,IAAa,UAAS;AAAA,IAAU,MAAK;AAAA,MAChD,qCAAC,MAAD;AAAA,IAAM,OAAO,EAAE,UAAU;AAAA,KACvB,qCAAC,MAAD;AAAA,IAAM,OAAO,EAAE,UAAU;AAAA,KACvB,qCAAC,eAAD,MAAgB,aAGnB,UAAU,qCAAC,aAAD;AAAA,IAAa,UAAS;AAAA,IAAU,MAAK;AAAA,MAC/C,YAKT;AAAA;AAIJ,MAAM,QAAQ;AAAA,EAIZ,UAAU,UAAU,KAAK,YAAY;AAAA,EAIrC,QAAQ,UAAU,KAAK,YAAY;AAAA,EAInC,UAAU,UAAU,UAAU,CAAC,UAAU,SAAS,UAAU,QAAQ,UAAU,MAAM,WAAW,YAC7F;AAAA,EAKF,WAAW,UAAU,KAAK,YAAY;AAAA,EAItC,QAAQ,UAAU,QAAQ,YAAY;AAAA,EAItC,SAAS,UAAU,OAAO,YAAY;AAAA,EAItC,QAAQ,UAAU,OAAO,YAAY;AAAA,EAIrC,gBAAgB,UAAU,KAAK,YAAY;AAAA;AAG7C,aAAa,YAAY;AAEzB,MAAM,yBAAyB,SAAS;AACxC,uBAAuB,YAAY;AAInC,IAAO,uBAAQ;",
6
+ "names": []
7
+ }