@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.
- package/dist/cjs/DSModalSlide.js +61 -109
- package/dist/cjs/DSModalSlide.js.map +3 -3
- package/dist/cjs/DSModalSlideDefinitions.js +58 -0
- package/dist/cjs/DSModalSlideDefinitions.js.map +7 -0
- package/dist/cjs/components/Footer.js +32 -69
- package/dist/cjs/components/Footer.js.map +2 -2
- package/dist/cjs/components/Header.js +23 -44
- package/dist/cjs/components/Header.js.map +3 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/react-desc-prop-types.js +150 -0
- package/dist/cjs/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/styled.js +223 -0
- package/dist/cjs/styled.js.map +7 -0
- package/dist/esm/DSModalSlide.js +69 -110
- package/dist/esm/DSModalSlide.js.map +3 -3
- package/dist/esm/DSModalSlideDefinitions.js +28 -0
- package/dist/esm/DSModalSlideDefinitions.js.map +7 -0
- package/dist/esm/components/Footer.js +33 -70
- package/dist/esm/components/Footer.js.map +2 -2
- package/dist/esm/components/Header.js +31 -45
- package/dist/esm/components/Header.js.map +3 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/react-desc-prop-types.js +120 -0
- package/dist/esm/react-desc-prop-types.js.map +7 -0
- package/dist/esm/styled.js +193 -0
- package/dist/esm/styled.js.map +7 -0
- package/dist/types/DSModalSlide.d.ts +3 -36
- package/dist/types/DSModalSlideDefinitions.d.ts +19 -0
- package/dist/types/components/Footer.d.ts +3 -50
- package/dist/types/components/Header.d.ts +3 -21
- package/dist/types/index.d.ts +1 -0
- package/dist/types/react-desc-prop-types.d.ts +64 -0
- package/dist/types/styled.d.ts +43 -0
- package/package.json +10 -9
- package/dist/cjs/components/blocks.js +0 -66
- package/dist/cjs/components/blocks.js.map +0 -7
- package/dist/esm/components/blocks.js +0 -36
- package/dist/esm/components/blocks.js.map +0 -7
- package/dist/types/components/blocks.d.ts +0 -11
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSModalSlide.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
6
|
-
"names": ["React"
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useState, useEffect, useCallback, useMemo } from 'react';\nimport { describe, useGetGlobalAttributes, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { debounce } from 'lodash';\nimport ReactDOM from 'react-dom';\nimport { useTheme, styled } from '@elliemae/ds-system';\nimport { useOwnerProps } from '@elliemae/ds-utilities';\nimport { Grid } from '@elliemae/ds-grid';\nimport DSSeparator from '@elliemae/ds-separator';\nimport ModalHeader from './components/Header.js';\nimport ModalFooter from './components/Footer.js';\nimport { defaultProps, DSModalSlidePropTypesSchema, type DSModalSlideT } from './react-desc-prop-types.js';\nimport {\n StyledActualContent,\n StyledContent,\n StyledModalWrapper,\n StyledOverlay,\n StyledContentWrapper,\n StyledGridContent,\n} from './styled.js';\nimport { DSModalSlideName } from './DSModalSlideDefinitions.js';\n\n// js engine and css engine can't be guaranteed to be in sync due to how they run on different threads in the browsers\n// this means that in some edge-cases react may have \"out-dated\" information like \"isMoving\" in this case\n// this can cause some animation frame to have the animation \"after\" end but before react has updated the state\n// if the css animation is not configured to stay in the end state,\n// in those edge-cases,\n// the animation will \"jump\" back to the start and cause a flicker\n// this is the fix for that, it's an hack because the component is still css classname based\n// when we re-do the modal slide, we should integrate this as the styled component css itself instead of this extra wrapper\nconst ModalSlideAnimationFix = styled.div`\n .em-ds-modal-slide__overlay--disappearing,\n .em-ds-modal-slide__content--disappearing {\n animation-fill-mode: forwards;\n }\n`;\nconst DSModalSlide = (props: DSModalSlideT.Props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSModalSlideT.InternalProps>(props, defaultProps);\n const { isOpen, children, getContainer, fullWidth, header, footer, fadeOut, fadeIn, overrideHeight, innerRef } =\n propsWithDefault;\n const [, setMoving] = useState(false);\n const [show, setShow] = useState(isOpen);\n const [width, setWidth] = useState(50);\n const [height, setHeight] = useState<string | number>('100%');\n const theme = useTheme();\n const contentRows = [...(header ? ['auto', '1px'] : []), '1fr', ...(footer ? ['1px', theme.space.m] : [])];\n const globalAttrs = useGetGlobalAttributes(props);\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 }, [fullWidth, isOpen, show]);\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(propsWithDefault);\n\n useEffect(updateShow, [updateShow]);\n\n const container = getContainer();\n\n const handleHeight = useCallback(() => {\n const newHeight =\n overrideHeight && container.scrollHeight > container.getBoundingClientRect().height\n ? container.scrollHeight\n : container.getBoundingClientRect().height;\n setHeight(newHeight);\n }, [container, overrideHeight]);\n\n const onChangeParent = useMemo(() => debounce(handleHeight, 300, { leading: true }), [handleHeight]);\n\n useEffect(() => {\n const resizeObserver = new ResizeObserver(() => onChangeParent());\n if (container) {\n resizeObserver.observe(container);\n if (!container.style.position) {\n container.style.position = 'relative';\n }\n onChangeParent();\n }\n return () => {\n if (container) resizeObserver.unobserve(container);\n };\n }, [container, onChangeParent]);\n\n if (!show) return null;\n if (!container) return null;\n\n const handleAnimationEnd = () => {\n setMoving(false);\n if (!isOpen) setShow(isOpen);\n };\n\n return ReactDOM.createPortal(\n <ModalSlideAnimationFix>\n <StyledModalWrapper\n className=\"em-ds-modal-slide__wrapper\"\n {...globalAttrs}\n height={height}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledOverlay\n className={`em-ds-modal-slide__overlay ${\n !isOpen ? 'em-ds-modal-slide__overlay--disappearing' : 'em-ds-modal-slide__overlay--showing'\n }`}\n fadeIn={fadeIn}\n fadeOut={fadeOut}\n showing={isOpen}\n disappearing={!isOpen}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledContent\n className={`em-ds-modal-slide__content ${\n !isOpen ? 'em-ds-modal-slide__content--disappearing' : 'em-ds-modal-slide__content--showing'\n }`}\n onAnimationEnd={handleAnimationEnd}\n width={width}\n height={height}\n fadeIn={fadeIn}\n fadeOut={fadeOut}\n disappearing={!isOpen}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledGridContent rows={contentRows} data-testid=\"ds-modal-slide\">\n {header && React.cloneElement(header, { fullWidth })}\n {header && <DSSeparator position=\"initial\" type=\"non-form\" />}\n <Grid style={{ overflow: 'hidden' }}>\n <StyledContentWrapper\n innerRef={innerRef}\n tabIndex={0}\n role=\"contentinfo\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledActualContent\n className=\"em-ds-modal-slide__actual-content\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {children}\n </StyledActualContent>\n </StyledContentWrapper>\n </Grid>\n {footer && <DSSeparator position=\"initial\" type=\"non-form\" />}\n {footer}\n </StyledGridContent>\n </StyledContent>\n </StyledOverlay>\n </StyledModalWrapper>\n </ModalSlideAnimationFix>,\n container,\n );\n};\n\nDSModalSlide.displayName = DSModalSlideName;\nconst DSModalSlideWithSchema = describe(DSModalSlide);\nDSModalSlideWithSchema.propTypes = DSModalSlidePropTypesSchema;\n\nexport { ModalHeader, ModalFooter, DSModalSlide, DSModalSlideWithSchema };\n\nexport default DSModalSlide;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC+HX,SAEa,KAFb;AA/HZ,OAAOA,UAAS,UAAU,WAAW,aAAa,eAAe;AACjE,SAAS,UAAU,wBAAwB,oCAAoC;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A,gBACA,cAAc,CAAC;AAAA,gBACf;AAAA,gBACA;AAAA,gBAEA,+BAAC,qBAAkB,MAAM,aAAa,eAAY,kBAC/C;AAAA,4BAAUA,OAAM,aAAa,QAAQ,EAAE,UAAU,CAAC;AAAA,kBAClD,UAAU,oBAAC,eAAY,UAAS,WAAU,MAAK,YAAW;AAAA,kBAC3D,oBAAC,QAAK,OAAO,EAAE,UAAU,SAAS,GAChC;AAAA,oBAAC;AAAA;AAAA,sBACC;AAAA,sBACA,UAAU;AAAA,sBACV,MAAK;AAAA,sBACL;AAAA,sBACA;AAAA,sBAEA;AAAA,wBAAC;AAAA;AAAA,0BACC,WAAU;AAAA,0BACV;AAAA,0BACA;AAAA,0BAEC;AAAA;AAAA,sBACH;AAAA;AAAA,kBACF,GACF;AAAA,kBACC,UAAU,oBAAC,eAAY,UAAS,WAAU,MAAK,YAAW;AAAA,kBAC1D;AAAA,mBACH;AAAA;AAAA,YACF;AAAA;AAAA,QACF;AAAA;AAAA,IACF,GACF;AAAA,IACA;AAAA,EACF;AACF;AAEA,aAAa,cAAc;AAC3B,MAAM,yBAAyB,SAAS,YAAY;AACpD,uBAAuB,YAAY;AAInC,IAAO,uBAAQ;",
|
|
6
|
+
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { slotObjectToDataTestIds } from "@elliemae/ds-system";
|
|
3
|
+
const DSModalSlideName = "DSModalSlide";
|
|
4
|
+
const DSModalSlideSlots = {
|
|
5
|
+
ROOT: "root",
|
|
6
|
+
OVERLAY: "overlay",
|
|
7
|
+
CONTENT: "content",
|
|
8
|
+
TITLE: "title",
|
|
9
|
+
HEADER_LEFT_SIDE: "header-left-side",
|
|
10
|
+
ACTUAL_CONTENT: "actual-content",
|
|
11
|
+
HEADER: "header",
|
|
12
|
+
FOOTER: "footer",
|
|
13
|
+
FOOTER_WRAPPER: "footer-wrapper",
|
|
14
|
+
HEADER_WRAPPER: "header-wrapper",
|
|
15
|
+
SEPARATOR: "separator",
|
|
16
|
+
CLOSE_BUTTON: "close-button",
|
|
17
|
+
CONTENT_WRAPPER: "content-wrapper"
|
|
18
|
+
};
|
|
19
|
+
const DSModalSlideDataTestIds = {
|
|
20
|
+
...slotObjectToDataTestIds(DSModalSlideName, DSModalSlideSlots),
|
|
21
|
+
CLOSE_BUTTON: "modal-slider-header-close"
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
DSModalSlideDataTestIds,
|
|
25
|
+
DSModalSlideName,
|
|
26
|
+
DSModalSlideSlots
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=DSModalSlideDefinitions.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSModalSlideDefinitions.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSModalSlideName = 'DSModalSlide';\n\nexport const DSModalSlideSlots = {\n ROOT: 'root',\n OVERLAY: 'overlay',\n CONTENT: 'content',\n TITLE: 'title',\n HEADER_LEFT_SIDE: 'header-left-side',\n ACTUAL_CONTENT: 'actual-content',\n HEADER: 'header',\n FOOTER: 'footer',\n FOOTER_WRAPPER: 'footer-wrapper',\n HEADER_WRAPPER: 'header-wrapper',\n SEPARATOR: 'separator',\n CLOSE_BUTTON: 'close-button',\n CONTENT_WRAPPER: 'content-wrapper',\n};\n\nexport const DSModalSlideDataTestIds = {\n ...slotObjectToDataTestIds(DSModalSlideName, DSModalSlideSlots),\n CLOSE_BUTTON: 'modal-slider-header-close',\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AAEjC,MAAM,mBAAmB;AAEzB,MAAM,oBAAoB;AAAA,EAC/B,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AAAA,EACP,kBAAkB;AAAA,EAClB,gBAAgB;AAAA,EAChB,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,WAAW;AAAA,EACX,cAAc;AAAA,EACd,iBAAiB;AACnB;AAEO,MAAM,0BAA0B;AAAA,EACrC,GAAG,wBAAwB,kBAAkB,iBAAiB;AAAA,EAC9D,cAAc;AAChB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,79 +1,42 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { describe, useMemoMergePropsWithDefault } from "@elliemae/ds-props-helpers";
|
|
4
4
|
import { DSButtonV2 } from "@elliemae/ds-button-v2";
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
onConfirm,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
onClick: onConfirm,
|
|
37
|
-
...confirmProps,
|
|
38
|
-
ml: "xs",
|
|
39
|
-
children: confirmLabel
|
|
40
|
-
}
|
|
41
|
-
)
|
|
42
|
-
] }) });
|
|
43
|
-
const props = {
|
|
44
|
-
/**
|
|
45
|
-
* Confirm Label
|
|
46
|
-
*/
|
|
47
|
-
confirmLabel: PropTypes.string.description("Confirm Label"),
|
|
48
|
-
/**
|
|
49
|
-
* Reject Label
|
|
50
|
-
*/
|
|
51
|
-
rejectLabel: PropTypes.string.description("Reject Label"),
|
|
52
|
-
/**
|
|
53
|
-
* Callback
|
|
54
|
-
*/
|
|
55
|
-
onConfirm: PropTypes.func.description("Callback"),
|
|
56
|
-
/**
|
|
57
|
-
* Callback
|
|
58
|
-
*/
|
|
59
|
-
onReject: PropTypes.func.description("Callback"),
|
|
60
|
-
/**
|
|
61
|
-
* Extra DSButton props for confirm btn.
|
|
62
|
-
*/
|
|
63
|
-
confirmProps: PropTypes.shape({
|
|
64
|
-
disabled: PropTypes.bool
|
|
65
|
-
}).description("Extra DSButton props for confirm btn."),
|
|
66
|
-
/**
|
|
67
|
-
* Extra DSButton props for reject btn.
|
|
68
|
-
*/
|
|
69
|
-
rejectProps: PropTypes.shape({
|
|
70
|
-
disabled: PropTypes.bool
|
|
71
|
-
}).description("Extra DSButton props for reject btn.")
|
|
5
|
+
import { footerDefaultProps, DSModalSlideFooterPropTypesSchema } from "../react-desc-prop-types.js";
|
|
6
|
+
import { StyledFooterWrapper } from "../styled.js";
|
|
7
|
+
const ModalFooter = (props) => {
|
|
8
|
+
const propsWithDefault = useMemoMergePropsWithDefault(props, footerDefaultProps);
|
|
9
|
+
const { confirmLabel, rejectLabel, onConfirm, onReject, confirmProps, rejectProps } = propsWithDefault;
|
|
10
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(StyledFooterWrapper, { className: "em-ds-modal-slide__footer-wrapper", children: [
|
|
11
|
+
!!onReject && /* @__PURE__ */ jsx(
|
|
12
|
+
DSButtonV2,
|
|
13
|
+
{
|
|
14
|
+
buttonType: "outline",
|
|
15
|
+
className: "action-reject",
|
|
16
|
+
"data-testid": "modal-footer-reject-btn",
|
|
17
|
+
onClick: onReject,
|
|
18
|
+
...rejectProps,
|
|
19
|
+
ml: "xs",
|
|
20
|
+
children: rejectLabel
|
|
21
|
+
}
|
|
22
|
+
),
|
|
23
|
+
!!onConfirm && /* @__PURE__ */ jsx(
|
|
24
|
+
DSButtonV2,
|
|
25
|
+
{
|
|
26
|
+
buttonType: "filled",
|
|
27
|
+
className: "action-confirm",
|
|
28
|
+
"data-testid": "modal-footer-confirm-btn",
|
|
29
|
+
onClick: onConfirm,
|
|
30
|
+
...confirmProps,
|
|
31
|
+
ml: "xs",
|
|
32
|
+
children: confirmLabel
|
|
33
|
+
}
|
|
34
|
+
)
|
|
35
|
+
] }) });
|
|
72
36
|
};
|
|
73
|
-
ModalFooter.propTypes = props;
|
|
74
37
|
ModalFooter.displayName = "ModalFooter";
|
|
75
38
|
const DSModalSlideFooterWithSchema = describe(ModalFooter);
|
|
76
|
-
DSModalSlideFooterWithSchema.propTypes =
|
|
39
|
+
DSModalSlideFooterWithSchema.propTypes = DSModalSlideFooterPropTypesSchema;
|
|
77
40
|
var Footer_default = ModalFooter;
|
|
78
41
|
export {
|
|
79
42
|
DSModalSlideFooterWithSchema,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/Footer.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { DSButtonV2 } from '@elliemae/ds-button-v2';\nimport { type DSModalSlideT, footerDefaultProps, DSModalSlideFooterPropTypesSchema } from '../react-desc-prop-types.js';\nimport { StyledFooterWrapper } from '../styled.js';\n\nconst ModalFooter = (props: DSModalSlideT.FooterProps) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSModalSlideT.FooterInternalProps>(props, footerDefaultProps);\n const { confirmLabel, rejectLabel, onConfirm, onReject, confirmProps, rejectProps } = propsWithDefault;\n return (\n <>\n <StyledFooterWrapper className=\"em-ds-modal-slide__footer-wrapper\">\n {!!onReject && (\n <DSButtonV2\n buttonType=\"outline\"\n className=\"action-reject\"\n data-testid=\"modal-footer-reject-btn\"\n onClick={onReject}\n {...rejectProps}\n ml=\"xs\"\n >\n {rejectLabel}\n </DSButtonV2>\n )}\n {!!onConfirm && (\n <DSButtonV2\n buttonType=\"filled\"\n className=\"action-confirm\"\n data-testid=\"modal-footer-confirm-btn\"\n onClick={onConfirm}\n {...confirmProps}\n ml=\"xs\"\n >\n {confirmLabel}\n </DSButtonV2>\n )}\n </StyledFooterWrapper>\n </>\n );\n};\n\nModalFooter.displayName = 'ModalFooter';\nconst DSModalSlideFooterWithSchema = describe(ModalFooter);\nDSModalSlideFooterWithSchema.propTypes = DSModalSlideFooterPropTypesSchema;\n\nexport { DSModalSlideFooterWithSchema };\n\nexport default ModalFooter;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACUnB,mBAGM,KAFJ,YADF;AATJ,SAAS,UAAU,oCAAoC;AACvD,SAAS,kBAAkB;AAC3B,SAA6B,oBAAoB,yCAAyC;AAC1F,SAAS,2BAA2B;AAEpC,MAAM,cAAc,CAAC,UAAqC;AACxD,QAAM,mBAAmB,6BAAgE,OAAO,kBAAkB;AAClH,QAAM,EAAE,cAAc,aAAa,WAAW,UAAU,cAAc,YAAY,IAAI;AACtF,SACE,gCACE,+BAAC,uBAAoB,WAAU,qCAC5B;AAAA,KAAC,CAAC,YACD;AAAA,MAAC;AAAA;AAAA,QACC,YAAW;AAAA,QACX,WAAU;AAAA,QACV,eAAY;AAAA,QACZ,SAAS;AAAA,QACR,GAAG;AAAA,QACJ,IAAG;AAAA,QAEF;AAAA;AAAA,IACH;AAAA,IAED,CAAC,CAAC,aACD;AAAA,MAAC;AAAA;AAAA,QACC,YAAW;AAAA,QACX,WAAU;AAAA,QACV,eAAY;AAAA,QACZ,SAAS;AAAA,QACR,GAAG;AAAA,QACJ,IAAG;AAAA,QAEF;AAAA;AAAA,IACH;AAAA,KAEJ,GACF;AAEJ;AAEA,YAAY,cAAc;AAC1B,MAAM,+BAA+B,SAAS,WAAW;AACzD,6BAA6B,YAAY;AAIzC,IAAO,iBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,54 +1,40 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import { styled } from "@elliemae/ds-system";
|
|
5
|
-
import DSSeparator from "@elliemae/ds-separator";
|
|
3
|
+
import { describe, useMemoMergePropsWithDefault } from "@elliemae/ds-props-helpers";
|
|
6
4
|
import { Close } from "@elliemae/ds-icons";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const StyledCloseButton = styled(DSButtonV2)`
|
|
37
|
-
margin: ${(props2) => props2.theme.space.xs};
|
|
38
|
-
`;
|
|
39
|
-
const props = {
|
|
40
|
-
/** on modal close callback */
|
|
41
|
-
onClose: PropTypes.func.description("on modal close callback"),
|
|
42
|
-
/** modal toolbar component */
|
|
43
|
-
toolbar: PropTypes.node.description("modal toolbar comoponent"),
|
|
44
|
-
/** modal title */
|
|
45
|
-
title: PropTypes.string.description("modal title"),
|
|
46
|
-
innerRef: PropTypes.func.description("button close ref ")
|
|
5
|
+
import { headerDefaultProps, DSModalSlideHeaderPropTypesSchema } from "../react-desc-prop-types.js";
|
|
6
|
+
import {
|
|
7
|
+
StyledHeader,
|
|
8
|
+
StyledHeaderLeftSide,
|
|
9
|
+
StyledTitle,
|
|
10
|
+
HeaderWrapper,
|
|
11
|
+
StyledSeparator,
|
|
12
|
+
StyledCloseButton
|
|
13
|
+
} from "../styled.js";
|
|
14
|
+
import { DSModalSlideDataTestIds } from "../DSModalSlideDefinitions.js";
|
|
15
|
+
const ModalHeader = (props) => {
|
|
16
|
+
const propsWithDefault = useMemoMergePropsWithDefault(props, headerDefaultProps);
|
|
17
|
+
const { innerRef, title: headerTitle, onClose, toolbar } = propsWithDefault;
|
|
18
|
+
return /* @__PURE__ */ jsxs(HeaderWrapper, { children: [
|
|
19
|
+
/* @__PURE__ */ jsx(StyledHeaderLeftSide, { className: "em-ds-modal-slide__header-left-side", children: /* @__PURE__ */ jsx(StyledHeader, { className: "em-ds-modal-slide__header", children: /* @__PURE__ */ jsx(StyledTitle, { className: "em-ds-modal-slide__title", children: headerTitle }) }) }),
|
|
20
|
+
toolbar,
|
|
21
|
+
toolbar && /* @__PURE__ */ jsx(StyledSeparator, { isVertical: true }),
|
|
22
|
+
/* @__PURE__ */ jsx(
|
|
23
|
+
StyledCloseButton,
|
|
24
|
+
{
|
|
25
|
+
"data-testid": DSModalSlideDataTestIds.CLOSE_BUTTON,
|
|
26
|
+
"aria-label": "Close modal slide",
|
|
27
|
+
buttonType: "icon",
|
|
28
|
+
onClick: onClose,
|
|
29
|
+
innerRef,
|
|
30
|
+
children: /* @__PURE__ */ jsx(Close, { "aria-label": "Close modal slide", size: "s" })
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
] });
|
|
47
34
|
};
|
|
48
|
-
ModalHeader.propTypes = props;
|
|
49
35
|
ModalHeader.displayName = "ModalHeader";
|
|
50
36
|
const DSModalSlideHeaderWithSchema = describe(ModalHeader);
|
|
51
|
-
DSModalSlideHeaderWithSchema.propTypes =
|
|
37
|
+
DSModalSlideHeaderWithSchema.propTypes = DSModalSlideHeaderPropTypesSchema;
|
|
52
38
|
var Header_default = ModalHeader;
|
|
53
39
|
export {
|
|
54
40
|
DSModalSlideHeaderWithSchema,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/Header.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
6
|
-
"names": [
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { Close } from '@elliemae/ds-icons';\nimport { type DSModalSlideT, headerDefaultProps, DSModalSlideHeaderPropTypesSchema } from '../react-desc-prop-types.js';\nimport {\n StyledHeader,\n StyledHeaderLeftSide,\n StyledTitle,\n HeaderWrapper,\n StyledSeparator,\n StyledCloseButton,\n} from '../styled.js';\nimport { DSModalSlideDataTestIds } from '../DSModalSlideDefinitions.js';\n\nconst ModalHeader = (props: DSModalSlideT.HeaderProps) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSModalSlideT.HeaderInternalProps>(props, headerDefaultProps);\n const { innerRef, title: headerTitle, onClose, toolbar } = propsWithDefault;\n return (\n <HeaderWrapper>\n <StyledHeaderLeftSide className=\"em-ds-modal-slide__header-left-side\">\n <StyledHeader className=\"em-ds-modal-slide__header\">\n <StyledTitle className=\"em-ds-modal-slide__title\">{headerTitle}</StyledTitle>\n </StyledHeader>\n </StyledHeaderLeftSide>\n {toolbar}\n {toolbar && <StyledSeparator isVertical />}\n <StyledCloseButton\n data-testid={DSModalSlideDataTestIds.CLOSE_BUTTON}\n aria-label=\"Close modal slide\"\n buttonType=\"icon\"\n onClick={onClose}\n innerRef={innerRef}\n >\n {<Close aria-label=\"Close modal slide\" size=\"s\" />}\n </StyledCloseButton>\n </HeaderWrapper>\n );\n};\n\nModalHeader.displayName = 'ModalHeader';\nconst DSModalSlideHeaderWithSchema = describe(ModalHeader);\nDSModalSlideHeaderWithSchema.propTypes = DSModalSlideHeaderPropTypesSchema;\n\nexport { DSModalSlideHeaderWithSchema };\n\nexport default ModalHeader;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACkBnB,SAGM,KAHN;AAjBJ,SAAS,UAAU,oCAAoC;AACvD,SAAS,aAAa;AACtB,SAA6B,oBAAoB,yCAAyC;AAC1F;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,+BAA+B;AAExC,MAAM,cAAc,CAAC,UAAqC;AACxD,QAAM,mBAAmB,6BAAgE,OAAO,kBAAkB;AAClH,QAAM,EAAE,UAAU,OAAO,aAAa,SAAS,QAAQ,IAAI;AAC3D,SACE,qBAAC,iBACC;AAAA,wBAAC,wBAAqB,WAAU,uCAC9B,8BAAC,gBAAa,WAAU,6BACtB,8BAAC,eAAY,WAAU,4BAA4B,uBAAY,GACjE,GACF;AAAA,IACC;AAAA,IACA,WAAW,oBAAC,mBAAgB,YAAU,MAAC;AAAA,IACxC;AAAA,MAAC;AAAA;AAAA,QACC,eAAa,wBAAwB;AAAA,QACrC,cAAW;AAAA,QACX,YAAW;AAAA,QACX,SAAS;AAAA,QACT;AAAA,QAEC,8BAAC,SAAM,cAAW,qBAAoB,MAAK,KAAI;AAAA;AAAA,IAClD;AAAA,KACF;AAEJ;AAEA,YAAY,cAAc;AAC1B,MAAM,+BAA+B,SAAS,WAAW;AACzD,6BAA6B,YAAY;AAIzC,IAAO,iBAAQ;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './DSModalSlide.js';\nexport { default } from './DSModalSlide.js';\nexport { DSModalSlideHeaderWithSchema } from './components/Header.js';\nexport { DSModalSlideFooterWithSchema } from './components/Footer.js';\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './DSModalSlide.js';\nexport { default } from './DSModalSlide.js';\nexport { DSModalSlideHeaderWithSchema } from './components/Header.js';\nexport { DSModalSlideFooterWithSchema } from './components/Footer.js';\nexport type { DSModalSlideT } from './react-desc-prop-types.js';\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,SAAS,WAAAA,gBAAe;AACxB,SAAS,oCAAoC;AAC7C,SAAS,oCAAoC;",
|
|
6
6
|
"names": ["default"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from "@elliemae/ds-props-helpers";
|
|
3
|
+
import { getPropsPerDatatestIdPropTypes } from "@elliemae/ds-utilities";
|
|
4
|
+
import { DSModalSlideDataTestIds } from "./DSModalSlideDefinitions.js";
|
|
5
|
+
const defaultProps = {
|
|
6
|
+
isOpen: false,
|
|
7
|
+
centered: false,
|
|
8
|
+
fullWidth: false,
|
|
9
|
+
fadeOut: 1500,
|
|
10
|
+
fadeIn: 1500,
|
|
11
|
+
overrideHeight: false
|
|
12
|
+
};
|
|
13
|
+
const headerDefaultProps = {
|
|
14
|
+
title: "",
|
|
15
|
+
onClose: () => null
|
|
16
|
+
};
|
|
17
|
+
const footerDefaultProps = {
|
|
18
|
+
confirmLabel: "Confirm",
|
|
19
|
+
rejectLabel: "Cancel",
|
|
20
|
+
confirmProps: { disabled: false },
|
|
21
|
+
rejectProps: { disabled: false }
|
|
22
|
+
};
|
|
23
|
+
const DSModalSlidePropTypes = {
|
|
24
|
+
...globalAttributesPropTypes,
|
|
25
|
+
...xstyledPropTypes,
|
|
26
|
+
/**
|
|
27
|
+
* If the modal slide is centered or not
|
|
28
|
+
*/
|
|
29
|
+
centered: PropTypes.bool.description("If the modal slide is centered or not"),
|
|
30
|
+
/**
|
|
31
|
+
* If the modal slide is visible or not
|
|
32
|
+
*/
|
|
33
|
+
isOpen: PropTypes.bool.description("If the modal slide is visible or not"),
|
|
34
|
+
/**
|
|
35
|
+
* Main content of the modal
|
|
36
|
+
*/
|
|
37
|
+
children: PropTypes.oneOfType([PropTypes.node]).isRequired.description("Main content of the modal"),
|
|
38
|
+
/**
|
|
39
|
+
* If the modal slide takes the full width or not
|
|
40
|
+
*/
|
|
41
|
+
fullWidth: PropTypes.bool.description("If the modal slide takes the full width or not"),
|
|
42
|
+
/**
|
|
43
|
+
* If the modal slide has a header, only available for full width option
|
|
44
|
+
*/
|
|
45
|
+
header: PropTypes.element.description("If the modal slide has a header, only available for full width option"),
|
|
46
|
+
/**
|
|
47
|
+
* If the modal slide has a footer
|
|
48
|
+
*/
|
|
49
|
+
footer: PropTypes.element.description("If the modal slide has a footer"),
|
|
50
|
+
/**
|
|
51
|
+
* Ratio of fade out
|
|
52
|
+
*/
|
|
53
|
+
fadeOut: PropTypes.number.description("Ratio of fade out"),
|
|
54
|
+
/**
|
|
55
|
+
* Ratio of fade in
|
|
56
|
+
*/
|
|
57
|
+
fadeIn: PropTypes.number.description("Ratio of fade in"),
|
|
58
|
+
/**
|
|
59
|
+
* Override the panel height to scroll height of the container
|
|
60
|
+
*/
|
|
61
|
+
overrideHeight: PropTypes.bool.description("Override the panel height to scroll height of the container"),
|
|
62
|
+
getContainer: PropTypes.func.description("Should return the container of the modal slide").isRequired,
|
|
63
|
+
innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).description("Ref to the modal slide")
|
|
64
|
+
};
|
|
65
|
+
const DSModalSlidePropTypesSchema = DSModalSlidePropTypes;
|
|
66
|
+
const DSModalSlideHeaderPropTypes = {
|
|
67
|
+
...globalAttributesPropTypes,
|
|
68
|
+
...xstyledPropTypes,
|
|
69
|
+
title: PropTypes.string.description("modal title"),
|
|
70
|
+
onClose: PropTypes.func.description("on modal close callback"),
|
|
71
|
+
toolbar: PropTypes.node.description("modal toolbar comoponent"),
|
|
72
|
+
innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).description("Ref to the modal slide")
|
|
73
|
+
};
|
|
74
|
+
const DSModalSlideHeaderPropTypesSchema = DSModalSlideHeaderPropTypes;
|
|
75
|
+
const DSModalSlideFooterPropTypes = {
|
|
76
|
+
...globalAttributesPropTypes,
|
|
77
|
+
...xstyledPropTypes,
|
|
78
|
+
/**
|
|
79
|
+
* Confirm Label
|
|
80
|
+
*/
|
|
81
|
+
confirmLabel: PropTypes.string.description("Confirm Label"),
|
|
82
|
+
/**
|
|
83
|
+
* Reject Label
|
|
84
|
+
*/
|
|
85
|
+
rejectLabel: PropTypes.string.description("Reject Label"),
|
|
86
|
+
/**
|
|
87
|
+
* Callback
|
|
88
|
+
*/
|
|
89
|
+
onConfirm: PropTypes.func.description("Callback"),
|
|
90
|
+
/**
|
|
91
|
+
* Callback
|
|
92
|
+
*/
|
|
93
|
+
onReject: PropTypes.func.description("Callback"),
|
|
94
|
+
/**
|
|
95
|
+
* Extra DSButton props for confirm btn.
|
|
96
|
+
*/
|
|
97
|
+
confirmProps: PropTypes.shape({
|
|
98
|
+
disabled: PropTypes.bool
|
|
99
|
+
}).description("Extra DSButton props for confirm btn."),
|
|
100
|
+
/**
|
|
101
|
+
* Extra DSButton props for reject btn.
|
|
102
|
+
*/
|
|
103
|
+
rejectProps: PropTypes.shape({
|
|
104
|
+
disabled: PropTypes.bool
|
|
105
|
+
}).description("Extra DSButton props for reject btn."),
|
|
106
|
+
...getPropsPerDatatestIdPropTypes(DSModalSlideDataTestIds)
|
|
107
|
+
};
|
|
108
|
+
const DSModalSlideFooterPropTypesSchema = DSModalSlideFooterPropTypes;
|
|
109
|
+
export {
|
|
110
|
+
DSModalSlideFooterPropTypes,
|
|
111
|
+
DSModalSlideFooterPropTypesSchema,
|
|
112
|
+
DSModalSlideHeaderPropTypes,
|
|
113
|
+
DSModalSlideHeaderPropTypesSchema,
|
|
114
|
+
DSModalSlidePropTypes,
|
|
115
|
+
DSModalSlidePropTypesSchema,
|
|
116
|
+
defaultProps,
|
|
117
|
+
footerDefaultProps,
|
|
118
|
+
headerDefaultProps
|
|
119
|
+
};
|
|
120
|
+
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* 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"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,WAAW,2BAA2B,wBAAwB;AACvE,SAAS,sCAAsC;AAC/C,SAAS,+BAA+B;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,UAAU,KAAK,YAAY,uCAAuC;AAAA;AAAA;AAAA;AAAA,EAI5E,QAAQ,UAAU,KAAK,YAAY,sCAAsC;AAAA;AAAA;AAAA;AAAA,EAIzE,UAAU,UAAU,UAAU,CAAC,UAAU,IAAI,CAAC,EAAE,WAAW,YAAY,2BAA2B;AAAA;AAAA;AAAA;AAAA,EAIlG,WAAW,UAAU,KAAK,YAAY,gDAAgD;AAAA;AAAA;AAAA;AAAA,EAItF,QAAQ,UAAU,QAAQ,YAAY,uEAAuE;AAAA;AAAA;AAAA;AAAA,EAI7G,QAAQ,UAAU,QAAQ,YAAY,iCAA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