@elliemae/ds-modal-slide 3.25.0-rc.1 → 3.26.0-next.2

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 (39) hide show
  1. package/dist/cjs/DSModalSlide.js +61 -109
  2. package/dist/cjs/DSModalSlide.js.map +3 -3
  3. package/dist/cjs/DSModalSlideDefinitions.js +58 -0
  4. package/dist/cjs/DSModalSlideDefinitions.js.map +7 -0
  5. package/dist/cjs/components/Footer.js +32 -69
  6. package/dist/cjs/components/Footer.js.map +2 -2
  7. package/dist/cjs/components/Header.js +23 -44
  8. package/dist/cjs/components/Header.js.map +3 -3
  9. package/dist/cjs/index.js.map +1 -1
  10. package/dist/cjs/react-desc-prop-types.js +150 -0
  11. package/dist/cjs/react-desc-prop-types.js.map +7 -0
  12. package/dist/cjs/styled.js +223 -0
  13. package/dist/cjs/styled.js.map +7 -0
  14. package/dist/esm/DSModalSlide.js +69 -110
  15. package/dist/esm/DSModalSlide.js.map +3 -3
  16. package/dist/esm/DSModalSlideDefinitions.js +28 -0
  17. package/dist/esm/DSModalSlideDefinitions.js.map +7 -0
  18. package/dist/esm/components/Footer.js +33 -70
  19. package/dist/esm/components/Footer.js.map +2 -2
  20. package/dist/esm/components/Header.js +31 -45
  21. package/dist/esm/components/Header.js.map +3 -3
  22. package/dist/esm/index.js.map +1 -1
  23. package/dist/esm/react-desc-prop-types.js +120 -0
  24. package/dist/esm/react-desc-prop-types.js.map +7 -0
  25. package/dist/esm/styled.js +193 -0
  26. package/dist/esm/styled.js.map +7 -0
  27. package/dist/types/DSModalSlide.d.ts +3 -36
  28. package/dist/types/DSModalSlideDefinitions.d.ts +19 -0
  29. package/dist/types/components/Footer.d.ts +3 -50
  30. package/dist/types/components/Header.d.ts +3 -21
  31. package/dist/types/index.d.ts +1 -0
  32. package/dist/types/react-desc-prop-types.d.ts +64 -0
  33. package/dist/types/styled.d.ts +43 -0
  34. package/package.json +10 -9
  35. package/dist/cjs/components/blocks.js +0 -66
  36. package/dist/cjs/components/blocks.js.map +0 -7
  37. package/dist/esm/components/blocks.js +0 -36
  38. package/dist/esm/components/blocks.js.map +0 -7
  39. package/dist/types/components/blocks.d.ts +0 -11
@@ -0,0 +1,150 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var react_desc_prop_types_exports = {};
30
+ __export(react_desc_prop_types_exports, {
31
+ DSModalSlideFooterPropTypes: () => DSModalSlideFooterPropTypes,
32
+ DSModalSlideFooterPropTypesSchema: () => DSModalSlideFooterPropTypesSchema,
33
+ DSModalSlideHeaderPropTypes: () => DSModalSlideHeaderPropTypes,
34
+ DSModalSlideHeaderPropTypesSchema: () => DSModalSlideHeaderPropTypesSchema,
35
+ DSModalSlidePropTypes: () => DSModalSlidePropTypes,
36
+ DSModalSlidePropTypesSchema: () => DSModalSlidePropTypesSchema,
37
+ defaultProps: () => defaultProps,
38
+ footerDefaultProps: () => footerDefaultProps,
39
+ headerDefaultProps: () => headerDefaultProps
40
+ });
41
+ module.exports = __toCommonJS(react_desc_prop_types_exports);
42
+ var React = __toESM(require("react"));
43
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
44
+ var import_ds_utilities = require("@elliemae/ds-utilities");
45
+ var import_DSModalSlideDefinitions = require("./DSModalSlideDefinitions.js");
46
+ const defaultProps = {
47
+ isOpen: false,
48
+ centered: false,
49
+ fullWidth: false,
50
+ fadeOut: 1500,
51
+ fadeIn: 1500,
52
+ overrideHeight: false
53
+ };
54
+ const headerDefaultProps = {
55
+ title: "",
56
+ onClose: () => null
57
+ };
58
+ const footerDefaultProps = {
59
+ confirmLabel: "Confirm",
60
+ rejectLabel: "Cancel",
61
+ confirmProps: { disabled: false },
62
+ rejectProps: { disabled: false }
63
+ };
64
+ const DSModalSlidePropTypes = {
65
+ ...import_ds_props_helpers.globalAttributesPropTypes,
66
+ ...import_ds_props_helpers.xstyledPropTypes,
67
+ /**
68
+ * If the modal slide is centered or not
69
+ */
70
+ centered: import_ds_props_helpers.PropTypes.bool.description("If the modal slide is centered or not"),
71
+ /**
72
+ * If the modal slide is visible or not
73
+ */
74
+ isOpen: import_ds_props_helpers.PropTypes.bool.description("If the modal slide is visible or not"),
75
+ /**
76
+ * Main content of the modal
77
+ */
78
+ children: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.node]).isRequired.description("Main content of the modal"),
79
+ /**
80
+ * If the modal slide takes the full width or not
81
+ */
82
+ fullWidth: import_ds_props_helpers.PropTypes.bool.description("If the modal slide takes the full width or not"),
83
+ /**
84
+ * If the modal slide has a header, only available for full width option
85
+ */
86
+ header: import_ds_props_helpers.PropTypes.element.description("If the modal slide has a header, only available for full width option"),
87
+ /**
88
+ * If the modal slide has a footer
89
+ */
90
+ footer: import_ds_props_helpers.PropTypes.element.description("If the modal slide has a footer"),
91
+ /**
92
+ * Ratio of fade out
93
+ */
94
+ fadeOut: import_ds_props_helpers.PropTypes.number.description("Ratio of fade out"),
95
+ /**
96
+ * Ratio of fade in
97
+ */
98
+ fadeIn: import_ds_props_helpers.PropTypes.number.description("Ratio of fade in"),
99
+ /**
100
+ * Override the panel height to scroll height of the container
101
+ */
102
+ overrideHeight: import_ds_props_helpers.PropTypes.bool.description("Override the panel height to scroll height of the container"),
103
+ getContainer: import_ds_props_helpers.PropTypes.func.description("Should return the container of the modal slide").isRequired,
104
+ innerRef: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.func, import_ds_props_helpers.PropTypes.object]).description("Ref to the modal slide")
105
+ };
106
+ const DSModalSlidePropTypesSchema = DSModalSlidePropTypes;
107
+ const DSModalSlideHeaderPropTypes = {
108
+ ...import_ds_props_helpers.globalAttributesPropTypes,
109
+ ...import_ds_props_helpers.xstyledPropTypes,
110
+ title: import_ds_props_helpers.PropTypes.string.description("modal title"),
111
+ onClose: import_ds_props_helpers.PropTypes.func.description("on modal close callback"),
112
+ toolbar: import_ds_props_helpers.PropTypes.node.description("modal toolbar comoponent"),
113
+ innerRef: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.func, import_ds_props_helpers.PropTypes.object]).description("Ref to the modal slide")
114
+ };
115
+ const DSModalSlideHeaderPropTypesSchema = DSModalSlideHeaderPropTypes;
116
+ const DSModalSlideFooterPropTypes = {
117
+ ...import_ds_props_helpers.globalAttributesPropTypes,
118
+ ...import_ds_props_helpers.xstyledPropTypes,
119
+ /**
120
+ * Confirm Label
121
+ */
122
+ confirmLabel: import_ds_props_helpers.PropTypes.string.description("Confirm Label"),
123
+ /**
124
+ * Reject Label
125
+ */
126
+ rejectLabel: import_ds_props_helpers.PropTypes.string.description("Reject Label"),
127
+ /**
128
+ * Callback
129
+ */
130
+ onConfirm: import_ds_props_helpers.PropTypes.func.description("Callback"),
131
+ /**
132
+ * Callback
133
+ */
134
+ onReject: import_ds_props_helpers.PropTypes.func.description("Callback"),
135
+ /**
136
+ * Extra DSButton props for confirm btn.
137
+ */
138
+ confirmProps: import_ds_props_helpers.PropTypes.shape({
139
+ disabled: import_ds_props_helpers.PropTypes.bool
140
+ }).description("Extra DSButton props for confirm btn."),
141
+ /**
142
+ * Extra DSButton props for reject btn.
143
+ */
144
+ rejectProps: import_ds_props_helpers.PropTypes.shape({
145
+ disabled: import_ds_props_helpers.PropTypes.bool
146
+ }).description("Extra DSButton props for reject btn."),
147
+ ...(0, import_ds_utilities.getPropsPerDatatestIdPropTypes)(import_DSModalSlideDefinitions.DSModalSlideDataTestIds)
148
+ };
149
+ const DSModalSlideFooterPropTypesSchema = DSModalSlideFooterPropTypes;
150
+ //# sourceMappingURL=react-desc-prop-types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/react-desc-prop-types.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\n/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport { getPropsPerDatatestIdPropTypes } from '@elliemae/ds-utilities';\nimport { DSModalSlideDataTestIds } from './DSModalSlideDefinitions.js';\n\nexport declare namespace DSModalSlideT {\n type PropsT<D, R, O, E> = Partial<D> & R & O & Omit<GlobalAttributesT<E>, keyof D | keyof R | keyof O> & XstyledProps;\n type InternalPropsT<D, R, O, E> = D & R & O & Omit<GlobalAttributesT<E>, keyof D | keyof R | keyof O> & XstyledProps;\n\n export interface RequiredProps {\n getContainer: () => HTMLElement;\n }\n\n export interface DefaultProps {\n isOpen: boolean;\n centered: boolean;\n fullWidth: boolean;\n fadeOut: number;\n fadeIn: number;\n overrideHeight: boolean;\n }\n\n export interface OptionalProps {\n header: JSX.Element;\n footer: React.ReactNode;\n children?: React.ReactNode;\n innerRef?: React.MutableRefObject<HTMLDivElement | null> | React.RefCallback<HTMLDivElement>;\n }\n\n export interface FooterRequiredProps {}\n\n export interface FooterDefaultProps {\n confirmLabel: string;\n rejectLabel: string;\n confirmProps: { disabled: boolean };\n rejectProps: { disabled: boolean };\n }\n\n export interface FooterOptionalProps {\n onConfirm: () => void;\n onReject: () => void;\n }\n\n export interface HeaderRequiredProps {}\n\n export interface HeaderDefaultProps {\n title: string;\n onClose: () => void;\n }\n\n export interface HeaderOptionalProps {\n toolbar?: React.ReactNode;\n innerRef?: React.MutableRefObject<HTMLButtonElement | null> | React.RefCallback<HTMLButtonElement>;\n }\n\n export type Props = PropsT<DefaultProps, RequiredProps, OptionalProps, HTMLElement>;\n\n export type InternalProps = InternalPropsT<DefaultProps, RequiredProps, OptionalProps, HTMLElement>;\n\n export type HeaderProps = PropsT<HeaderDefaultProps, HeaderRequiredProps, HeaderOptionalProps, HTMLButtonElement>;\n\n export type HeaderInternalProps = InternalPropsT<\n HeaderDefaultProps,\n HeaderRequiredProps,\n HeaderOptionalProps,\n HTMLButtonElement\n >;\n\n export type FooterProps = PropsT<FooterDefaultProps, FooterRequiredProps, FooterOptionalProps, HTMLDivElement>;\n\n export type FooterInternalProps = InternalPropsT<\n FooterDefaultProps,\n FooterRequiredProps,\n FooterOptionalProps,\n HTMLDivElement\n >;\n}\n\nexport const defaultProps: DSModalSlideT.DefaultProps = {\n isOpen: false,\n centered: false,\n fullWidth: false,\n fadeOut: 1500,\n fadeIn: 1500,\n overrideHeight: false,\n};\n\nexport const headerDefaultProps: DSModalSlideT.HeaderDefaultProps = {\n title: '',\n onClose: () => null,\n};\n\nexport const footerDefaultProps: DSModalSlideT.FooterDefaultProps = {\n confirmLabel: 'Confirm',\n rejectLabel: 'Cancel',\n confirmProps: { disabled: false },\n rejectProps: { disabled: false },\n};\n\nexport const DSModalSlidePropTypes: DSPropTypesSchema<DSModalSlideT.Props> = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\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.node]).isRequired.description('Main content of the modal'),\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 * If the modal slide has a footer\n */\n footer: PropTypes.element.description('If the modal slide has a footer'),\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 getContainer: PropTypes.func.description('Should return the container of the modal slide').isRequired,\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).description('Ref to the modal slide'),\n};\n\nexport const DSModalSlidePropTypesSchema =\n DSModalSlidePropTypes as unknown as React.WeakValidationMap<DSModalSlideT.Props>;\n\nexport const DSModalSlideHeaderPropTypes: DSPropTypesSchema<DSModalSlideT.HeaderProps> = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n title: PropTypes.string.description('modal title'),\n onClose: PropTypes.func.description('on modal close callback'),\n toolbar: PropTypes.node.description('modal toolbar comoponent'),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).description('Ref to the modal slide'),\n};\n\nexport const DSModalSlideHeaderPropTypesSchema =\n DSModalSlideHeaderPropTypes as unknown as React.WeakValidationMap<DSModalSlideT.HeaderProps>;\n\nexport const DSModalSlideFooterPropTypes: DSPropTypesSchema<DSModalSlideT.FooterProps> = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n /**\n * Confirm Label\n */\n confirmLabel: PropTypes.string.description('Confirm Label'),\n /**\n * Reject Label\n */\n rejectLabel: PropTypes.string.description('Reject Label'),\n /**\n * Callback\n */\n onConfirm: PropTypes.func.description('Callback'),\n /**\n * Callback\n */\n onReject: PropTypes.func.description('Callback'),\n /**\n * Extra DSButton props for confirm btn.\n */\n confirmProps: PropTypes.shape({\n disabled: PropTypes.bool,\n }).description('Extra DSButton props for confirm btn.'),\n /**\n * Extra DSButton props for reject btn.\n */\n rejectProps: PropTypes.shape({\n disabled: PropTypes.bool,\n }).description('Extra DSButton props for reject btn.'),\n ...getPropsPerDatatestIdPropTypes(DSModalSlideDataTestIds),\n};\n\nexport const DSModalSlideFooterPropTypesSchema =\n DSModalSlideFooterPropTypes as unknown as React.WeakValidationMap<DSModalSlideT.FooterProps>;\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;ADGvB,8BAAuE;AACvE,0BAA+C;AAC/C,qCAAwC;AA2EjC,MAAM,eAA2C;AAAA,EACtD,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,WAAW;AAAA,EACX,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,gBAAgB;AAClB;AAEO,MAAM,qBAAuD;AAAA,EAClE,OAAO;AAAA,EACP,SAAS,MAAM;AACjB;AAEO,MAAM,qBAAuD;AAAA,EAClE,cAAc;AAAA,EACd,aAAa;AAAA,EACb,cAAc,EAAE,UAAU,MAAM;AAAA,EAChC,aAAa,EAAE,UAAU,MAAM;AACjC;AAEO,MAAM,wBAAgE;AAAA,EAC3E,GAAG;AAAA,EACH,GAAG;AAAA;AAAA;AAAA;AAAA,EAIH,UAAU,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,YAAY,cAAc;AAAA;AAAA;AAAA;AAAA,EAIxD,WAAW,kCAAU,KAAK,YAAY,UAAU;AAAA;AAAA;AAAA;AAAA,EAIhD,UAAU,kCAAU,KAAK,YAAY,UAAU;AAAA;AAAA;AAAA;AAAA,EAI/C,cAAc,kCAAU,MAAM;AAAA,IAC5B,UAAU,kCAAU;AAAA,EACtB,CAAC,EAAE,YAAY,uCAAuC;AAAA;AAAA;AAAA;AAAA,EAItD,aAAa,kCAAU,MAAM;AAAA,IAC3B,UAAU,kCAAU;AAAA,EACtB,CAAC,EAAE,YAAY,sCAAsC;AAAA,EACrD,OAAG,oDAA+B,sDAAuB;AAC3D;AAEO,MAAM,oCACX;",
6
+ "names": []
7
+ }
@@ -0,0 +1,223 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var styled_exports = {};
30
+ __export(styled_exports, {
31
+ HeaderWrapper: () => HeaderWrapper,
32
+ StyledActualContent: () => StyledActualContent,
33
+ StyledCloseButton: () => StyledCloseButton,
34
+ StyledContent: () => StyledContent,
35
+ StyledContentWrapper: () => StyledContentWrapper,
36
+ StyledFooter: () => StyledFooter,
37
+ StyledFooterWrapper: () => StyledFooterWrapper,
38
+ StyledGridContent: () => StyledGridContent,
39
+ StyledHeader: () => StyledHeader,
40
+ StyledHeaderLeftSide: () => StyledHeaderLeftSide,
41
+ StyledModalWrapper: () => StyledModalWrapper,
42
+ StyledOverlay: () => StyledOverlay,
43
+ StyledSeparator: () => StyledSeparator,
44
+ StyledTitle: () => StyledTitle
45
+ });
46
+ module.exports = __toCommonJS(styled_exports);
47
+ var React = __toESM(require("react"));
48
+ var import_ds_button_v2 = require("@elliemae/ds-button-v2");
49
+ var import_ds_grid = require("@elliemae/ds-grid");
50
+ var import_ds_separator = require("@elliemae/ds-separator");
51
+ var import_ds_system = require("@elliemae/ds-system");
52
+ var import_DSModalSlideDefinitions = require("./DSModalSlideDefinitions.js");
53
+ const overlayAnimation = import_ds_system.kfrm`{
54
+ 0% {
55
+ background: rgba(37, 41, 47, 0);
56
+ }
57
+ 100% {
58
+ background: rgba(37, 41, 47, 0.25);
59
+ }
60
+ }`;
61
+ const overlayAnimationOut = import_ds_system.kfrm`{
62
+ 0% {
63
+ background: rgba(37, 41, 47, 0.25);
64
+ }
65
+ 100% {
66
+ background: rgba(37, 41, 47, 0);
67
+ }
68
+ }`;
69
+ const contentAnimationOut = import_ds_system.kfrm`{
70
+ 0% {
71
+ transform: translateX(0);
72
+ }
73
+ 100% {
74
+ transform: translateX(100%);
75
+ }
76
+ }`;
77
+ const contentAnimationIn = import_ds_system.kfrm`{
78
+ 0% {
79
+ transform: translateX(100%);
80
+ }
81
+ 100% {
82
+ transform: translateX(0);
83
+ }
84
+ }`;
85
+ const StyledModalWrapper = (0, import_ds_system.styled)("div", {
86
+ name: import_DSModalSlideDefinitions.DSModalSlideName,
87
+ slot: import_DSModalSlideDefinitions.DSModalSlideSlots.ROOT
88
+ })`
89
+ position: absolute;
90
+ display: flex;
91
+ height: calc(${(props) => props.height} * 1px);
92
+ width: 100%;
93
+ overflow: hidden;
94
+ top: 0;
95
+ left: 0;
96
+ z-index: 10;
97
+
98
+ .em-ds-modal-v2__modal-wrapper {
99
+ flex: 1;
100
+ padding: 2.46rem 0;
101
+ }
102
+
103
+ .em-ds-modal-v2__modal-title {
104
+ max-width: 80%;
105
+ margin: 0 auto;
106
+ }
107
+ `;
108
+ const StyledOverlay = (0, import_ds_system.styled)("div", {
109
+ name: import_DSModalSlideDefinitions.DSModalSlideName,
110
+ slot: import_DSModalSlideDefinitions.DSModalSlideSlots.OVERLAY
111
+ })`
112
+ height: 100%;
113
+ width: 100%;
114
+ background: rgba(37, 41, 47, 0.25);
115
+ display: flex;
116
+ animation: ${(props) => props.disappearing ? overlayAnimationOut : overlayAnimation}
117
+ calc(${(props) => props.disappearing ? props.fadeOut : props.fadeIn} * 1ms) linear;
118
+
119
+ ${(props) => props.showing && `display: flex;
120
+ height: 100%;`}
121
+ `;
122
+ const StyledContent = (0, import_ds_system.styled)("div", { name: import_DSModalSlideDefinitions.DSModalSlideName, slot: import_DSModalSlideDefinitions.DSModalSlideSlots.CONTENT })`
123
+ height: calc(${(props) => props.height} * 1px);
124
+ background: neutral-000;
125
+ box-shadow:
126
+ 0 6px 20px 0 rgba(0, 0, 0, 0.24),
127
+ 0 8px 17px 0 rgba(0, 0, 0, 0.19);
128
+ width: calc(${(props) => props.width} * 1%);
129
+ margin-left: auto;
130
+ align-items: center;
131
+ flex-direction: column;
132
+ display: flex;
133
+ overflow-y: auto;
134
+ border: 1px solid neutral-300;
135
+ border-left: 2px solid neutral-300;
136
+ animation: ${(props) => props.disappearing ? contentAnimationOut : contentAnimationIn}
137
+ calc(${(props) => props.disappearing ? props.fadeOut / 2 : props.fadeIn / 2} * 1ms) linear;
138
+ .em-ds-separator-wrapper {
139
+ margin-top: unset;
140
+ }
141
+ `;
142
+ const StyledGridContent = (0, import_ds_system.styled)(import_ds_grid.Grid)`
143
+ height: 100%;
144
+ width: 100%;
145
+ max-height: 100%;
146
+ overflow: hidden;
147
+ -webkit-backface-visibility: hidden;
148
+ backface-visibility: hidden;
149
+ -webkit-transform-style: preserve-3d;
150
+ transform-style: preserve-3d;
151
+ `;
152
+ const StyledTitle = (0, import_ds_system.styled)("div", { name: import_DSModalSlideDefinitions.DSModalSlideName, slot: import_DSModalSlideDefinitions.DSModalSlideSlots.TITLE })``;
153
+ const StyledHeaderLeftSide = (0, import_ds_system.styled)("div", { name: import_DSModalSlideDefinitions.DSModalSlideName, slot: import_DSModalSlideDefinitions.DSModalSlideSlots.HEADER_LEFT_SIDE })`
154
+ width: 100%;
155
+ display: flex;
156
+ flex-direction: row;
157
+ text-align: left;
158
+ padding: 0.61538rem 1.23077rem 0.61538rem 0;
159
+ height: 3.69231rem;
160
+
161
+ .em-ds-button {
162
+ .em-ds-icon {
163
+ fill: brand-primary-600;
164
+ }
165
+ }
166
+ .close-button {
167
+ padding-left: 18px;
168
+ }
169
+ `;
170
+ const StyledActualContent = (0, import_ds_system.styled)("div", { name: import_DSModalSlideDefinitions.DSModalSlideName, slot: import_DSModalSlideDefinitions.DSModalSlideSlots.ACTUAL_CONTENT })`
171
+ display: flex;
172
+ flex-direction: column;
173
+ `;
174
+ const StyledHeader = (0, import_ds_system.styled)("div", { name: import_DSModalSlideDefinitions.DSModalSlideName, slot: import_DSModalSlideDefinitions.DSModalSlideSlots.HEADER })`
175
+ padding: 0 1.23077rem;
176
+ display: flex;
177
+ flex-direction: column;
178
+ justify-content: center;
179
+
180
+ ${StyledTitle} {
181
+ font-size: 1.3846rem;
182
+ color: neutral-700;
183
+ }
184
+ `;
185
+ const StyledFooter = (0, import_ds_system.styled)("div", { name: import_DSModalSlideDefinitions.DSModalSlideName, slot: import_DSModalSlideDefinitions.DSModalSlideSlots.FOOTER })``;
186
+ const StyledFooterWrapper = (0, import_ds_system.styled)("div", { name: import_DSModalSlideDefinitions.DSModalSlideName, slot: import_DSModalSlideDefinitions.DSModalSlideSlots.FOOTER_WRAPPER })`
187
+ width: 100%;
188
+ display: flex;
189
+ flex-direction: row;
190
+ text-align: left;
191
+ align-items: center;
192
+ justify-content: flex-end;
193
+ padding: 0.61538rem 1.23077rem 0.61538rem 0;
194
+ height: 3.69231rem;
195
+ .em-ds-button {
196
+ margin-left: 1.23077rem;
197
+ }
198
+ `;
199
+ const HeaderWrapper = (0, import_ds_system.styled)("div", { name: import_DSModalSlideDefinitions.DSModalSlideName, slot: import_DSModalSlideDefinitions.DSModalSlideSlots.HEADER_WRAPPER })`
200
+ display: flex;
201
+ justify-content: space-between;
202
+ width: 100%;
203
+ align-items: center;
204
+ height: 48px;
205
+ overflow: hidden;
206
+ `;
207
+ const StyledSeparator = (0, import_ds_system.styled)(import_ds_separator.DSSeparatorV2, { name: import_DSModalSlideDefinitions.DSModalSlideName, slot: import_DSModalSlideDefinitions.DSModalSlideSlots.SEPARATOR })`
208
+ padding: ${(props) => props.theme.space.xs} 0;
209
+ position: initial;
210
+ margin: none;
211
+ `;
212
+ const StyledCloseButton = (0, import_ds_system.styled)(import_ds_button_v2.DSButtonV2, { name: import_DSModalSlideDefinitions.DSModalSlideName, slot: import_DSModalSlideDefinitions.DSModalSlideSlots.CLOSE_BUTTON })`
213
+ margin: ${(props) => props.theme.space.xs};
214
+ `;
215
+ const StyledContentWrapper = (0, import_ds_system.styled)(import_ds_grid.Grid, { name: import_DSModalSlideDefinitions.DSModalSlideName, slot: import_DSModalSlideDefinitions.DSModalSlideSlots.CONTENT_WRAPPER })`
216
+ overflow: auto;
217
+ &:focus,
218
+ &:focus-visible {
219
+ outline: 1px solid ${({ theme }) => theme.colors.brand["600"]};
220
+ outline-offset: -1px;
221
+ }
222
+ `;
223
+ //# sourceMappingURL=styled.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/styled.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["/* eslint-disable max-lines */\nimport { DSButtonV2 } from '@elliemae/ds-button-v2';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSSeparatorV2 } from '@elliemae/ds-separator';\nimport { styled, kfrm } from '@elliemae/ds-system';\nimport { DSModalSlideName, DSModalSlideSlots } from './DSModalSlideDefinitions.js';\n\nconst overlayAnimation = kfrm`{\n 0% {\n background: rgba(37, 41, 47, 0);\n }\n 100% {\n background: rgba(37, 41, 47, 0.25);\n }\n}`;\n\nconst overlayAnimationOut = kfrm`{\n 0% {\n background: rgba(37, 41, 47, 0.25);\n }\n 100% {\n background: rgba(37, 41, 47, 0);\n }\n}`;\n\nconst contentAnimationOut = kfrm`{\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(100%);\n }\n}`;\n\nconst contentAnimationIn = kfrm`{\n 0% {\n transform: translateX(100%);\n }\n 100% {\n transform: translateX(0);\n }\n}`;\n\nexport const StyledModalWrapper = styled('div', {\n name: DSModalSlideName,\n slot: DSModalSlideSlots.ROOT,\n})<{ height: string | number }>`\n position: absolute;\n display: flex;\n height: calc(${(props) => props.height} * 1px);\n width: 100%;\n overflow: hidden;\n top: 0;\n left: 0;\n z-index: 10;\n\n .em-ds-modal-v2__modal-wrapper {\n flex: 1;\n padding: 2.46rem 0;\n }\n\n .em-ds-modal-v2__modal-title {\n max-width: 80%;\n margin: 0 auto;\n }\n`;\n\nexport const StyledOverlay = styled('div', {\n name: DSModalSlideName,\n slot: DSModalSlideSlots.OVERLAY,\n})<{ disappearing: boolean; showing: boolean; fadeIn: number; fadeOut: number }>`\n height: 100%;\n width: 100%;\n background: rgba(37, 41, 47, 0.25);\n display: flex;\n animation: ${(props) => (props.disappearing ? overlayAnimationOut : overlayAnimation)}\n calc(${(props) => (props.disappearing ? props.fadeOut : props.fadeIn)} * 1ms) linear;\n\n ${(props) =>\n props.showing &&\n `display: flex;\n height: 100%;`}\n`;\n\nexport const StyledContent = styled('div', { name: DSModalSlideName, slot: DSModalSlideSlots.CONTENT })<{\n height: number | string;\n width: number | string;\n disappearing: boolean;\n fadeIn: number;\n fadeOut: number;\n}>`\n height: calc(${(props) => props.height} * 1px);\n background: neutral-000;\n box-shadow:\n 0 6px 20px 0 rgba(0, 0, 0, 0.24),\n 0 8px 17px 0 rgba(0, 0, 0, 0.19);\n width: calc(${(props) => props.width} * 1%);\n margin-left: auto;\n align-items: center;\n flex-direction: column;\n display: flex;\n overflow-y: auto;\n border: 1px solid neutral-300;\n border-left: 2px solid neutral-300;\n animation: ${(props) => (props.disappearing ? contentAnimationOut : contentAnimationIn)}\n calc(${(props) => (props.disappearing ? props.fadeOut / 2 : props.fadeIn / 2)} * 1ms) linear;\n .em-ds-separator-wrapper {\n margin-top: unset;\n }\n`;\n\nexport const StyledGridContent = styled(Grid)`\n height: 100%;\n width: 100%;\n max-height: 100%;\n overflow: hidden;\n -webkit-backface-visibility: hidden;\n backface-visibility: hidden;\n -webkit-transform-style: preserve-3d;\n transform-style: preserve-3d;\n`;\n\nexport const StyledTitle = styled('div', { name: DSModalSlideName, slot: DSModalSlideSlots.TITLE })``;\n\nexport const StyledHeaderLeftSide = styled('div', { name: DSModalSlideName, slot: DSModalSlideSlots.HEADER_LEFT_SIDE })`\n width: 100%;\n display: flex;\n flex-direction: row;\n text-align: left;\n padding: 0.61538rem 1.23077rem 0.61538rem 0;\n height: 3.69231rem;\n\n .em-ds-button {\n .em-ds-icon {\n fill: brand-primary-600;\n }\n }\n .close-button {\n padding-left: 18px;\n }\n`;\n\nexport const StyledActualContent = styled('div', { name: DSModalSlideName, slot: DSModalSlideSlots.ACTUAL_CONTENT })`\n display: flex;\n flex-direction: column;\n`;\n\nexport const StyledHeader = styled('div', { name: DSModalSlideName, slot: DSModalSlideSlots.HEADER })`\n padding: 0 1.23077rem;\n display: flex;\n flex-direction: column;\n justify-content: center;\n\n ${StyledTitle} {\n font-size: 1.3846rem;\n color: neutral-700;\n }\n`;\n\nexport const StyledFooter = styled('div', { name: DSModalSlideName, slot: DSModalSlideSlots.FOOTER })``;\n\nexport const StyledFooterWrapper = styled('div', { name: DSModalSlideName, slot: DSModalSlideSlots.FOOTER_WRAPPER })`\n width: 100%;\n display: flex;\n flex-direction: row;\n text-align: left;\n align-items: center;\n justify-content: flex-end;\n padding: 0.61538rem 1.23077rem 0.61538rem 0;\n height: 3.69231rem;\n .em-ds-button {\n margin-left: 1.23077rem;\n }\n`;\n\nexport const HeaderWrapper = styled('div', { name: DSModalSlideName, slot: DSModalSlideSlots.HEADER_WRAPPER })`\n display: flex;\n justify-content: space-between;\n width: 100%;\n align-items: center;\n height: 48px;\n overflow: hidden;\n`;\n\nexport const StyledSeparator = styled(DSSeparatorV2, { name: DSModalSlideName, slot: DSModalSlideSlots.SEPARATOR })`\n padding: ${(props) => props.theme.space.xs} 0;\n position: initial;\n margin: none;\n`;\n\nexport const StyledCloseButton = styled(DSButtonV2, { name: DSModalSlideName, slot: DSModalSlideSlots.CLOSE_BUTTON })`\n margin: ${(props) => props.theme.space.xs};\n`;\n\nexport const StyledContentWrapper = styled(Grid, { name: DSModalSlideName, slot: DSModalSlideSlots.CONTENT_WRAPPER })`\n overflow: auto;\n &:focus,\n &:focus-visible {\n outline: 1px solid ${({ theme }) => theme.colors.brand['600']};\n outline-offset: -1px;\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;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,0BAA2B;AAC3B,qBAAqB;AACrB,0BAA8B;AAC9B,uBAA6B;AAC7B,qCAAoD;AAEpD,MAAM,mBAAmB;AAAA;AAAA;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AAK;AAAA;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -1,50 +1,41 @@
1
1
  import * as React from "react";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import React2, { useState, useEffect, useCallback, useMemo } from "react";
4
- import { PropTypes, describe, useGetGlobalAttributes } from "@elliemae/ds-props-helpers";
4
+ import { describe, useGetGlobalAttributes, useMemoMergePropsWithDefault } from "@elliemae/ds-props-helpers";
5
5
  import { debounce } from "lodash";
6
6
  import ReactDOM from "react-dom";
7
7
  import { useTheme, styled } from "@elliemae/ds-system";
8
+ import { useOwnerProps } from "@elliemae/ds-utilities";
8
9
  import { Grid } from "@elliemae/ds-grid";
9
10
  import DSSeparator from "@elliemae/ds-separator";
10
- import { Wrapper, Overlay, Content, ActualContent } from "./components/blocks.js";
11
11
  import ModalHeader from "./components/Header.js";
12
12
  import ModalFooter from "./components/Footer.js";
13
- const StyledWrapper = styled(Grid)`
14
- overflow: auto;
15
- &:focus,
16
- &:focus-visible {
17
- outline: 1px solid ${({ theme }) => theme.colors.brand["600"]};
18
- outline-offset: -1px;
19
- }
20
- `;
13
+ import { defaultProps, DSModalSlidePropTypesSchema } from "./react-desc-prop-types.js";
14
+ import {
15
+ StyledActualContent,
16
+ StyledContent,
17
+ StyledModalWrapper,
18
+ StyledOverlay,
19
+ StyledContentWrapper,
20
+ StyledGridContent
21
+ } from "./styled.js";
22
+ import { DSModalSlideName } from "./DSModalSlideDefinitions.js";
21
23
  const ModalSlideAnimationFix = styled.div`
22
24
  .em-ds-modal-slide__overlay--disappearing,
23
25
  .em-ds-modal-slide__content--disappearing {
24
26
  animation-fill-mode: forwards;
25
27
  }
26
28
  `;
27
- const DSModalSlide = (props2) => {
28
- const {
29
- isOpen = false,
30
- children,
31
- getContainer,
32
- centered = false,
33
- fullWidth = false,
34
- header = null,
35
- footer = null,
36
- fadeOut = 1500,
37
- fadeIn = 1500,
38
- overrideHeight = false,
39
- innerRef = null
40
- } = props2;
41
- const [isMoving, setMoving] = useState(false);
29
+ const DSModalSlide = (props) => {
30
+ const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps);
31
+ const { isOpen, children, getContainer, fullWidth, header, footer, fadeOut, fadeIn, overrideHeight, innerRef } = propsWithDefault;
32
+ const [, setMoving] = useState(false);
42
33
  const [show, setShow] = useState(isOpen);
43
34
  const [width, setWidth] = useState(50);
44
35
  const [height, setHeight] = useState("100%");
45
36
  const theme = useTheme();
46
37
  const contentRows = [...header ? ["auto", "1px"] : [], "1fr", ...footer ? ["1px", theme.space.m] : []];
47
- const globalAttrs = useGetGlobalAttributes(props2);
38
+ const globalAttrs = useGetGlobalAttributes(props);
48
39
  const updateShow = useCallback(() => {
49
40
  if (fullWidth)
50
41
  setWidth(100);
@@ -56,8 +47,9 @@ const DSModalSlide = (props2) => {
56
47
  setShow(isOpen);
57
48
  }
58
49
  }
59
- }, [isOpen, fullWidth, isMoving]);
60
- useEffect(updateShow, [isOpen, fullWidth]);
50
+ }, [fullWidth, isOpen, show]);
51
+ const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(propsWithDefault);
52
+ useEffect(updateShow, [updateShow]);
61
53
  const container = getContainer();
62
54
  const handleHeight = useCallback(() => {
63
55
  const newHeight = overrideHeight && container.scrollHeight > container.getBoundingClientRect().height ? container.scrollHeight : container.getBoundingClientRect().height;
@@ -89,56 +81,60 @@ const DSModalSlide = (props2) => {
89
81
  };
90
82
  return ReactDOM.createPortal(
91
83
  /* @__PURE__ */ jsx(ModalSlideAnimationFix, { children: /* @__PURE__ */ jsx(
92
- Wrapper,
84
+ StyledModalWrapper,
93
85
  {
86
+ className: "em-ds-modal-slide__wrapper",
94
87
  ...globalAttrs,
95
- classProps: {
96
- show: isOpen,
97
- centered
98
- },
99
- style: {
100
- "--height": height,
101
- "--fade-in": fadeIn,
102
- "--fade-out": fadeOut,
103
- "--width": width,
104
- left: 0
105
- },
88
+ height,
89
+ getOwnerProps,
90
+ getOwnerPropsArguments,
106
91
  children: /* @__PURE__ */ jsx(
107
- Overlay,
92
+ StyledOverlay,
108
93
  {
109
- classProps: {
110
- show: isOpen
111
- },
94
+ className: `em-ds-modal-slide__overlay ${!isOpen ? "em-ds-modal-slide__overlay--disappearing" : "em-ds-modal-slide__overlay--showing"}`,
95
+ fadeIn,
96
+ fadeOut,
97
+ showing: isOpen,
98
+ disappearing: !isOpen,
99
+ getOwnerProps,
100
+ getOwnerPropsArguments,
112
101
  children: /* @__PURE__ */ jsx(
113
- Content,
102
+ StyledContent,
114
103
  {
104
+ className: `em-ds-modal-slide__content ${!isOpen ? "em-ds-modal-slide__content--disappearing" : "em-ds-modal-slide__content--showing"}`,
115
105
  onAnimationEnd: handleAnimationEnd,
116
- classProps: {
117
- show: isOpen
118
- },
119
- children: /* @__PURE__ */ jsxs(
120
- Grid,
121
- {
122
- style: {
123
- height: "100%",
124
- width: "100%",
125
- maxHeight: "100%",
126
- overflow: "hidden",
127
- "-webkit-backface-visibility": "hidden",
128
- "backface-visibility": "hidden",
129
- "-webkit-transform-style": "preserve-3d"
130
- },
131
- rows: contentRows,
132
- "data-testid": "ds-modal-slide",
133
- children: [
134
- header && React2.cloneElement(header, { fullWidth }),
135
- header && /* @__PURE__ */ jsx(DSSeparator, { position: "initial", type: "non-form" }),
136
- /* @__PURE__ */ jsx(Grid, { style: { overflow: "hidden" }, children: /* @__PURE__ */ jsx(StyledWrapper, { innerRef, tabIndex: 0, role: "contentinfo", children: /* @__PURE__ */ jsx(ActualContent, { children }) }) }),
137
- footer && /* @__PURE__ */ jsx(DSSeparator, { position: "initial", type: "non-form" }),
138
- footer
139
- ]
140
- }
141
- )
106
+ width,
107
+ height,
108
+ fadeIn,
109
+ fadeOut,
110
+ disappearing: !isOpen,
111
+ getOwnerProps,
112
+ getOwnerPropsArguments,
113
+ children: /* @__PURE__ */ jsxs(StyledGridContent, { rows: contentRows, "data-testid": "ds-modal-slide", children: [
114
+ header && React2.cloneElement(header, { fullWidth }),
115
+ header && /* @__PURE__ */ jsx(DSSeparator, { position: "initial", type: "non-form" }),
116
+ /* @__PURE__ */ jsx(Grid, { style: { overflow: "hidden" }, children: /* @__PURE__ */ jsx(
117
+ StyledContentWrapper,
118
+ {
119
+ innerRef,
120
+ tabIndex: 0,
121
+ role: "contentinfo",
122
+ getOwnerProps,
123
+ getOwnerPropsArguments,
124
+ children: /* @__PURE__ */ jsx(
125
+ StyledActualContent,
126
+ {
127
+ className: "em-ds-modal-slide__actual-content",
128
+ getOwnerProps,
129
+ getOwnerPropsArguments,
130
+ children
131
+ }
132
+ )
133
+ }
134
+ ) }),
135
+ footer && /* @__PURE__ */ jsx(DSSeparator, { position: "initial", type: "non-form" }),
136
+ footer
137
+ ] })
142
138
  }
143
139
  )
144
140
  }
@@ -148,46 +144,9 @@ const DSModalSlide = (props2) => {
148
144
  container
149
145
  );
150
146
  };
151
- const props = {
152
- /**
153
- * If the modal slide is centered or not
154
- */
155
- centered: PropTypes.bool.description("If the modal slide is centered or not"),
156
- /**
157
- * If the modal slide is visible or not
158
- */
159
- isOpen: PropTypes.bool.description("If the modal slide is visible or not"),
160
- /**
161
- * Main content of the modal
162
- */
163
- children: PropTypes.oneOfType([PropTypes.element, PropTypes.string, PropTypes.any]).isRequired.description(
164
- "Main content of the modal"
165
- ),
166
- /**
167
- * If the modal slide takes the full width or not
168
- */
169
- fullWidth: PropTypes.bool.description("If the modal slide takes the full width or not"),
170
- /**
171
- * If the modal slide has a header, only available for full width option
172
- */
173
- header: PropTypes.element.description("If the modal slide has a header, only available for full width option"),
174
- /**
175
- * Ratio of fade out
176
- */
177
- fadeOut: PropTypes.number.description("Ratio of fade out"),
178
- /**
179
- * Ratio of fade in
180
- */
181
- fadeIn: PropTypes.number.description("Ratio of fade in"),
182
- /**
183
- * Override the panel height to scroll height of the container
184
- */
185
- overrideHeight: PropTypes.bool.description("Override the panel height to scroll height of the container")
186
- };
187
- DSModalSlide.propTypes = props;
188
- DSModalSlide.displayName = "DSModalSlide";
147
+ DSModalSlide.displayName = DSModalSlideName;
189
148
  const DSModalSlideWithSchema = describe(DSModalSlide);
190
- DSModalSlideWithSchema.propTypes = props;
149
+ DSModalSlideWithSchema.propTypes = DSModalSlidePropTypesSchema;
191
150
  var DSModalSlide_default = DSModalSlide;
192
151
  export {
193
152
  DSModalSlide,