@elliemae/ds-mobile 3.7.2-rc.2 → 3.8.0-next.1

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.
@@ -34,16 +34,9 @@ var import_react = __toESM(require("react"));
34
34
  var import_ds_utilities = require("@elliemae/ds-utilities");
35
35
  var import_ds_grid = require("@elliemae/ds-grid");
36
36
  var import_Loader = require("./Loader");
37
- const useMakeMutable = (referenceVar) => {
38
- const mutable = (0, import_react.useRef)(referenceVar);
39
- (0, import_react.useEffect)(() => {
40
- mutable.current = referenceVar;
41
- }, [referenceVar]);
42
- return mutable;
43
- };
44
37
  function useIntersectionObserver(elementRef, { threshold = 0, root = null, rootMargin = "0%", freezeOnceVisible = false }, onIntersectionCb = (entry) => {
45
38
  }) {
46
- const mutableIntersectionCb = useMakeMutable(onIntersectionCb);
39
+ const mutableIntersectionCb = (0, import_ds_utilities.useMakeMutable)(onIntersectionCb);
47
40
  const [entry, setEntry] = (0, import_react.useState)();
48
41
  const frozen = entry?.isIntersecting && freezeOnceVisible;
49
42
  const updateEntry = ([newEntry]) => {
@@ -67,8 +60,8 @@ function useIntersectionObserver(elementRef, { threshold = 0, root = null, rootM
67
60
  const InfiniteLoader = ({ isFetching, fetchData, children, height, hasMoreItems = true }) => {
68
61
  const [viewportHeight, setViewportHeight] = (0, import_react.useState)(height);
69
62
  const baselineRef = (0, import_react.useRef)(null);
70
- const mutableIsFetching = useMakeMutable(isFetching);
71
- const mutableFetchData = useMakeMutable(fetchData);
63
+ const mutableIsFetching = (0, import_ds_utilities.useMakeMutable)(isFetching);
64
+ const mutableFetchData = (0, import_ds_utilities.useMakeMutable)(fetchData);
72
65
  const onIntersectionCb = import_react.default.useCallback(() => {
73
66
  if (hasMoreItems && !mutableIsFetching.current) {
74
67
  mutableFetchData.current();
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/InfiniteLoader/Infiniteloader.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import React, { useEffect, useRef, useCallback, useState, type RefObject, type WeakValidationMap } from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-utilities';\nimport { Grid } from '@elliemae/ds-grid';\nimport { Loader } from './Loader';\n\ninterface Props {\n isFetching: boolean;\n hasMoreItems?: boolean;\n fetchData: () => void;\n children: React.ReactNode;\n height?: number | string;\n}\n\nconst useMakeMutable = <T,>(referenceVar: T): React.MutableRefObject<T> => {\n const mutable = useRef(referenceVar);\n useEffect(() => {\n mutable.current = referenceVar;\n }, [referenceVar]);\n return mutable;\n};\n\ninterface Args extends IntersectionObserverInit {\n freezeOnceVisible?: boolean;\n}\n\nfunction useIntersectionObserver(\n elementRef: RefObject<Element>,\n { threshold = 0, root = null, rootMargin = '0%', freezeOnceVisible = false }: Args,\n // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars\n onIntersectionCb = (entry: IntersectionObserverEntry): void => {},\n): IntersectionObserverEntry | undefined {\n const mutableIntersectionCb = useMakeMutable(onIntersectionCb);\n const [entry, setEntry] = useState<IntersectionObserverEntry>();\n\n const frozen = entry?.isIntersecting && freezeOnceVisible;\n\n const updateEntry = ([newEntry]: IntersectionObserverEntry[]): void => {\n setEntry(newEntry);\n if (newEntry.isIntersecting) mutableIntersectionCb.current(newEntry);\n };\n\n useEffect(() => {\n const node = elementRef?.current; // DOM Ref\n const hasIOSupport = !!window.IntersectionObserver;\n\n if (!hasIOSupport || frozen || !node) return () => {};\n\n const observerParams = { threshold, root, rootMargin };\n const observer = new IntersectionObserver(updateEntry, observerParams);\n\n observer.observe(node);\n\n return () => observer.disconnect();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [elementRef, JSON.stringify(threshold), root, rootMargin, frozen]);\n\n return entry;\n}\n\nconst InfiniteLoader = ({ isFetching, fetchData, children, height, hasMoreItems = true }: Props) => {\n const [viewportHeight, setViewportHeight] = useState<number | undefined | string>(height);\n\n const baselineRef = useRef<HTMLDivElement | null>(null);\n const mutableIsFetching = useMakeMutable(isFetching);\n const mutableFetchData = useMakeMutable(fetchData);\n const onIntersectionCb = React.useCallback(() => {\n if (hasMoreItems && !mutableIsFetching.current) {\n mutableFetchData.current();\n }\n }, [hasMoreItems, mutableFetchData, mutableIsFetching]);\n useIntersectionObserver(\n baselineRef,\n {\n root: null,\n rootMargin: '0px',\n threshold: 0.1,\n },\n onIntersectionCb,\n );\n\n const handleResize = useCallback(() => {\n setViewportHeight(window.innerHeight);\n }, []);\n\n useEffect(() => {\n if (!height) {\n window.addEventListener('resize', handleResize);\n handleResize();\n }\n return () => {\n if (!height) window.removeEventListener('resize', handleResize);\n };\n }, [handleResize, height]);\n\n return (\n <Grid style={{ position: 'relative', overflow: 'hidden', height: viewportHeight }}>\n <Grid style={{ overflow: isFetching ? 'hidden' : 'auto', height: viewportHeight }}>\n {children}\n <div ref={baselineRef} style={{ height: 1 }} />\n </Grid>\n <Loader isOpen={isFetching} />\n </Grid>\n );\n};\n\nconst listProps = {\n isFetching: PropTypes.bool.description('toggle loading state'),\n hasMoreItems: PropTypes.bool\n .description('wheter or not you have more items that need to be loaded')\n .defaultValue(true),\n fetchData: PropTypes.func.description('callback to fetch new items'),\n children: PropTypes.element.description('row items for infinite loader'),\n height: PropTypes.number.description('infinite loader list height'),\n} as WeakValidationMap<unknown>;\n\nconst InfiniteLoaderWithSchema = describe(InfiniteLoader);\nInfiniteLoaderWithSchema.propTypes = listProps;\nexport { InfiniteLoader, InfiniteLoaderWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB;AAAA,mBAAwG;AACxG,0BAAoC;AACpC,qBAAqB;AACrB,oBAAuB;AAUvB,MAAM,iBAAiB,CAAK,iBAA+C;AACzE,QAAM,cAAU,qBAAO,YAAY;AACnC,8BAAU,MAAM;AACd,YAAQ,UAAU;AAAA,EAC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A,MACE,MAAM;AAAA,MACN,YAAY;AAAA,MACZ,WAAW;AAAA,IACb;AAAA,IACA;AAAA,EACF;AAEA,QAAM,mBAAe,0BAAY,MAAM;AACrC,sBAAkB,OAAO,WAAW;AAAA,EACtC,GAAG,CAAC,CAAC;AAEL,8BAAU,MAAM;AACd,QAAI,CAAC,QAAQ;AACX,aAAO,iBAAiB,UAAU,YAAY;AAC9C,mBAAa;AAAA,IACf;AACA,WAAO,MAAM;AACX,UAAI,CAAC;AAAQ,eAAO,oBAAoB,UAAU,YAAY;AAAA,IAChE;AAAA,EACF,GAAG,CAAC,cAAc,MAAM,CAAC;AAEzB,SACE,6CAAC;AAAA,IAAK,OAAO,EAAE,UAAU,YAAY,UAAU,UAAU,QAAQ,eAAe;AAAA,IAC9E;AAAA,mDAAC;AAAA,QAAK,OAAO,EAAE,UAAU,aAAa,WAAW,QAAQ,QAAQ,eAAe;AAAA,QAC7E;AAAA;AAAA,UACD,4CAAC;AAAA,YAAI,KAAK;AAAA,YAAa,OAAO,EAAE,QAAQ,EAAE;AAAA,WAAG;AAAA;AAAA,OAC/C;AAAA,MACA,4CAAC;AAAA,QAAO,QAAQ;AAAA,OAAY;AAAA;AAAA,GAC9B;AAEJ;AAEA,MAAM,YAAY;AAAA,EAChB,YAAY,8BAAU,KAAK,YAAY,sBAAsB;AAAA,EAC7D,cAAc,8BAAU,KACrB,YAAY,0DAA0D,EACtE,aAAa,IAAI;AAAA,EACpB,WAAW,8BAAU,KAAK,YAAY,6BAA6B;AAAA,EACnE,UAAU,8BAAU,QAAQ,YAAY,+BAA+B;AAAA,EACvE,QAAQ,8BAAU,OAAO,YAAY,6BAA6B;AACpE;AAEA,MAAM,+BAA2B,8BAAS,cAAc;AACxD,yBAAyB,YAAY;",
4
+ "sourcesContent": ["import React, { useEffect, useRef, useCallback, useState, type RefObject, type WeakValidationMap } from 'react';\nimport { PropTypes, describe, useMakeMutable } from '@elliemae/ds-utilities';\nimport { Grid } from '@elliemae/ds-grid';\nimport { Loader } from './Loader';\n\ninterface Props {\n isFetching: boolean;\n hasMoreItems?: boolean;\n fetchData: () => void;\n children: React.ReactNode;\n height?: number | string;\n}\n\ninterface Args extends IntersectionObserverInit {\n freezeOnceVisible?: boolean;\n}\n\nfunction useIntersectionObserver(\n elementRef: RefObject<Element>,\n { threshold = 0, root = null, rootMargin = '0%', freezeOnceVisible = false }: Args,\n // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars\n onIntersectionCb = (entry: IntersectionObserverEntry): void => {},\n): IntersectionObserverEntry | undefined {\n const mutableIntersectionCb = useMakeMutable(onIntersectionCb);\n const [entry, setEntry] = useState<IntersectionObserverEntry>();\n\n const frozen = entry?.isIntersecting && freezeOnceVisible;\n\n const updateEntry = ([newEntry]: IntersectionObserverEntry[]): void => {\n setEntry(newEntry);\n if (newEntry.isIntersecting) mutableIntersectionCb.current(newEntry);\n };\n\n useEffect(() => {\n const node = elementRef?.current; // DOM Ref\n const hasIOSupport = !!window.IntersectionObserver;\n\n if (!hasIOSupport || frozen || !node) return () => {};\n\n const observerParams = { threshold, root, rootMargin };\n const observer = new IntersectionObserver(updateEntry, observerParams);\n\n observer.observe(node);\n\n return () => observer.disconnect();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [elementRef, JSON.stringify(threshold), root, rootMargin, frozen]);\n\n return entry;\n}\n\nconst InfiniteLoader = ({ isFetching, fetchData, children, height, hasMoreItems = true }: Props) => {\n const [viewportHeight, setViewportHeight] = useState<number | undefined | string>(height);\n\n const baselineRef = useRef<HTMLDivElement | null>(null);\n const mutableIsFetching = useMakeMutable(isFetching);\n const mutableFetchData = useMakeMutable(fetchData);\n const onIntersectionCb = React.useCallback(() => {\n if (hasMoreItems && !mutableIsFetching.current) {\n mutableFetchData.current();\n }\n }, [hasMoreItems, mutableFetchData, mutableIsFetching]);\n useIntersectionObserver(\n baselineRef,\n {\n root: null,\n rootMargin: '0px',\n threshold: 0.1,\n },\n onIntersectionCb,\n );\n\n const handleResize = useCallback(() => {\n setViewportHeight(window.innerHeight);\n }, []);\n\n useEffect(() => {\n if (!height) {\n window.addEventListener('resize', handleResize);\n handleResize();\n }\n return () => {\n if (!height) window.removeEventListener('resize', handleResize);\n };\n }, [handleResize, height]);\n\n return (\n <Grid style={{ position: 'relative', overflow: 'hidden', height: viewportHeight }}>\n <Grid style={{ overflow: isFetching ? 'hidden' : 'auto', height: viewportHeight }}>\n {children}\n <div ref={baselineRef} style={{ height: 1 }} />\n </Grid>\n <Loader isOpen={isFetching} />\n </Grid>\n );\n};\n\nconst listProps = {\n isFetching: PropTypes.bool.description('toggle loading state'),\n hasMoreItems: PropTypes.bool\n .description('wheter or not you have more items that need to be loaded')\n .defaultValue(true),\n fetchData: PropTypes.func.description('callback to fetch new items'),\n children: PropTypes.element.description('row items for infinite loader'),\n height: PropTypes.number.description('infinite loader list height'),\n} as WeakValidationMap<unknown>;\n\nconst InfiniteLoaderWithSchema = describe(InfiniteLoader);\nInfiniteLoaderWithSchema.propTypes = listProps;\nexport { InfiniteLoader, InfiniteLoaderWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB;AAAA,mBAAwG;AACxG,0BAAoD;AACpD,qBAAqB;AACrB,oBAAuB;AAcvB,SAAS,wBACP,YACA,EAAE,YAAY,GAAG,OAAO,MAAM,aAAa,MAAM,oBAAoB,MAAM,GAE3E,mBAAmB,CAAC,UAA2C;AAAC,GACzB;AACvC,QAAM,4BAAwB,oCAAe,gBAAgB;AAC7D,QAAM,CAAC,OAAO,QAAQ,QAAI,uBAAoC;AAE9D,QAAM,SAAS,OAAO,kBAAkB;AAExC,QAAM,cAAc,CAAC,CAAC,QAAQ,MAAyC;AACrE,aAAS,QAAQ;AACjB,QAAI,SAAS;AAAgB,4BAAsB,QAAQ,QAAQ;AAAA,EACrE;AAEA,8BAAU,MAAM;AACd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O,EAAE,UAAU,YAAY,UAAU,UAAU,QAAQ,eAAe;AAAA,IAC9E;AAAA,mDAAC;AAAA,QAAK,OAAO,EAAE,UAAU,aAAa,WAAW,QAAQ,QAAQ,eAAe;AAAA,QAC7E;AAAA;AAAA,UACD,4CAAC;AAAA,YAAI,KAAK;AAAA,YAAa,OAAO,EAAE,QAAQ,EAAE;AAAA,WAAG;AAAA;AAAA,OAC/C;AAAA,MACA,4CAAC;AAAA,QAAO,QAAQ;AAAA,OAAY;AAAA;AAAA,GAC9B;AAEJ;AAEA,MAAM,YAAY;AAAA,EAChB,YAAY,8BAAU,KAAK,YAAY,sBAAsB;AAAA,EAC7D,cAAc,8BAAU,KACrB,YAAY,0DAA0D,EACtE,aAAa,IAAI;AAAA,EACpB,WAAW,8BAAU,KAAK,YAAY,6BAA6B;AAAA,EACnE,UAAU,8BAAU,QAAQ,YAAY,+BAA+B;AAAA,EACvE,QAAQ,8BAAU,OAAO,YAAY,6BAA6B;AACpE;AAEA,MAAM,+BAA2B,8BAAS,cAAc;AACxD,yBAAyB,YAAY;",
6
6
  "names": ["React"]
7
7
  }
@@ -51,7 +51,8 @@ const Modal = ({
51
51
  onClick: import_lodash.noop,
52
52
  labelText: "Accept"
53
53
  },
54
- isOpen = false
54
+ isOpen = false,
55
+ children = void 0
55
56
  }) => {
56
57
  const theme = (0, import_ds_system.useTheme)();
57
58
  if (!isOpen)
@@ -68,7 +69,9 @@ const Modal = ({
68
69
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.ModalPosition, {
69
70
  zIndex,
70
71
  cols: ["auto"],
71
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.ModalBox, {
72
+ children: children !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
73
+ children
74
+ }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.ModalBox, {
72
75
  maxHeight: `${window.innerHeight * 0.75}px`,
73
76
  rows: [1, "80px"],
74
77
  style: {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/Modal/Modal.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable max-lines */\nimport React from 'react';\nimport { describe, PropTypes } from '@elliemae/ds-utilities';\nimport { noop } from 'lodash';\nimport { Grid } from '@elliemae/ds-grid';\nimport { WarningTriangle } from '@elliemae/ds-icons';\nimport DSButton from '@elliemae/ds-button';\nimport { useTheme } from '@elliemae/ds-system';\nimport { ModalPosition, ModalBox, BackShadow, ModalIcon, ModalTitle, ModalDescription, BodyFix } from './styled';\n\nconst Modal = ({\n zIndex = 1,\n title = '',\n description = '',\n onClose = noop,\n showSecondaryAction = true,\n secondaryActionProps = {\n onClick: noop,\n labelText: 'Cancel',\n },\n primaryActionProps = {\n onClick: noop,\n labelText: 'Accept',\n },\n isOpen = false,\n}) => {\n const theme = useTheme();\n if (!isOpen) return null;\n return (\n <>\n <BodyFix isOpen={isOpen} />\n <BackShadow onClick={onClose} zIndex={zIndex} />\n <ModalPosition zIndex={zIndex} cols={['auto']}>\n <ModalBox\n maxHeight={`${window.innerHeight * 0.75}px`}\n rows={[1, '80px']}\n style={{\n overflow: 'hidden',\n }}\n >\n <Grid\n pl=\"xs\"\n pr=\"xs\"\n style={{\n overflow: 'hidden',\n }}\n >\n <Grid\n rows={['auto', 'auto', 1]}\n style={{\n overflow: 'hidden',\n }}\n >\n <ModalIcon>\n <WarningTriangle size=\"xxl\" />\n </ModalIcon>\n <ModalTitle data-testid=\"modal-title\">{title}</ModalTitle>\n <ModalDescription\n data-testid=\"modal-desc\"\n style={{\n overflow: 'auto',\n }}\n >\n {description}\n </ModalDescription>\n </Grid>\n </Grid>\n <Grid pt=\"24px\">\n <Grid\n pl=\"xs\"\n pr=\"xs\"\n cols={showSecondaryAction ? [1, 1] : [1]}\n gutter=\"xs\"\n justifyContent=\"center\"\n alignItems=\"center\"\n style={{\n borderTop: `1px solid ${theme.colors.neutral[100]}`,\n }}\n >\n {showSecondaryAction && (\n <DSButton\n {...secondaryActionProps}\n labelText={secondaryActionProps.labelText || ' Cancel'}\n buttonType=\"secondary\"\n data-testid=\"modal-secondary-btn\"\n />\n )}\n <DSButton\n labelText={primaryActionProps.labelText || ' Accept'}\n {...primaryActionProps}\n buttonType=\"primary\"\n data-testid=\"modal-primary-btn\"\n />\n </Grid>\n </Grid>\n </ModalBox>\n </ModalPosition>\n </>\n );\n};\n\nconst modalProps = {\n isOpen: PropTypes.bool.description('Wheter the modal is open or closed').defaultValue(false),\n zIndex: PropTypes.number.description('z-index value').defaultValue(1),\n title: PropTypes.string.description('Modal s title').isRequired,\n description: PropTypes.string.description('Modal s content').isRequired,\n onClose: PropTypes.func.description('Function executed when the modal closes'),\n showSecondaryAction: PropTypes.bool.description('Wheter to show secondary action button or not').defaultValue(true),\n secondaryActionProps: PropTypes.shape({\n onClick: PropTypes.func,\n labelText: PropTypes.string,\n }).description('Secondary action props'),\n primaryActionProps: PropTypes.shape({\n onClick: PropTypes.func,\n labelText: PropTypes.string,\n }).description('Primary action props'),\n};\n\nModal.propTypes = modalProps;\nModal.displayName = 'Modal';\nconst ModalWithSchema = describe(Modal);\nModalWithSchema.propTypes = modalProps;\n\nexport { Modal, ModalWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB;AAEA,0BAAoC;AACpC,oBAAqB;AACrB,qBAAqB;AACrB,sBAAgC;AAChC,uBAAqB;AACrB,uBAAyB;AACzB,oBAAsG;AAEtG,MAAM,QAAQ,CAAC;AAAA,EACb,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,UAAU;AAAA,EACV,sBAAsB;AAAA,EACtB,uBAAuB;AAAA,IACrB,SAAS;AAAA,IACT,WAAW;AAAA,EACb;AAAA,EACA,qBAAqB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MAAM,OAAO,QAAQ;AAAA,gBAC/C;AAAA,gBAEC;AAAA,yCACC,4CAAC,iBAAAA,SAAA;AAAA,oBACE,GAAG;AAAA,oBACJ,WAAW,qBAAqB,aAAa;AAAA,oBAC7C,YAAW;AAAA,oBACX,eAAY;AAAA,mBACd;AAAA,kBAEF,4CAAC,iBAAAA,SAAA;AAAA,oBACC,WAAW,mBAAmB,aAAa;AAAA,oBAC1C,GAAG;AAAA,oBACJ,YAAW;AAAA,oBACX,eAAY;AAAA,mBACd;AAAA;AAAA,eACF;AAAA,aACF;AAAA;AAAA,SACF;AAAA,OACF;AAAA;AAAA,GACF;AAEJ;AAEA,MAAM,aAAa;AAAA,EACjB,QAAQ,8BAAU,KAAK,YAAY,oCAAoC,EAAE,aAAa,KAAK;AAAA,EAC3F,QAAQ,8BAAU,OAAO,YAAY,eAAe,EAAE,aAAa,CAAC;AAAA,EACpE,OAAO,8BAAU,OAAO,YAAY,eAAe,EAAE;AAAA,EACrD,aAAa,8BAAU,OAAO,YAAY,iBAAiB,EAAE;AAAA,EAC7D,SAAS,8BAAU,KAAK,YAAY,yCAAyC;AAAA,EAC7E,qBAAqB,8BAAU,KAAK,YAAY,+CAA+C,EAAE,aAAa,IAAI;AAAA,EAClH,sBAAsB,8BAAU,MAAM;AAAA,IACpC,SAAS,8BAAU;AAAA,IACnB,WAAW,8BAAU;AAAA,EACvB,CAAC,EAAE,YAAY,wBAAwB;AAAA,EACvC,oBAAoB,8BAAU,MAAM;AAAA,IAClC,SAAS,8BAAU;AAAA,IACnB,WAAW,8BAAU;AAAA,EACvB,CAAC,EAAE,YAAY,sBAAsB;AACvC;AAEA,MAAM,YAAY;AAClB,MAAM,cAAc;AACpB,MAAM,sBAAkB,8BAAS,KAAK;AACtC,gBAAgB,YAAY;",
4
+ "sourcesContent": ["/* eslint-disable max-lines */\nimport React from 'react';\nimport { describe, PropTypes } from '@elliemae/ds-utilities';\nimport { noop } from 'lodash';\nimport { Grid } from '@elliemae/ds-grid';\nimport { WarningTriangle } from '@elliemae/ds-icons';\nimport DSButton from '@elliemae/ds-button';\nimport { useTheme } from '@elliemae/ds-system';\nimport { ModalPosition, ModalBox, BackShadow, ModalIcon, ModalTitle, ModalDescription, BodyFix } from './styled';\n\nconst Modal = ({\n zIndex = 1,\n title = '',\n description = '',\n onClose = noop,\n showSecondaryAction = true,\n secondaryActionProps = {\n onClick: noop,\n labelText: 'Cancel',\n },\n primaryActionProps = {\n onClick: noop,\n labelText: 'Accept',\n },\n isOpen = false,\n children = undefined,\n}) => {\n const theme = useTheme();\n if (!isOpen) return null;\n return (\n <>\n <BodyFix isOpen={isOpen} />\n <BackShadow onClick={onClose} zIndex={zIndex} />\n <ModalPosition zIndex={zIndex} cols={['auto']}>\n {children !== undefined ? (\n <>{children}</>\n ) : (\n <ModalBox\n maxHeight={`${window.innerHeight * 0.75}px`}\n rows={[1, '80px']}\n style={{\n overflow: 'hidden',\n }}\n >\n <Grid\n pl=\"xs\"\n pr=\"xs\"\n style={{\n overflow: 'hidden',\n }}\n >\n <Grid\n rows={['auto', 'auto', 1]}\n style={{\n overflow: 'hidden',\n }}\n >\n <ModalIcon>\n <WarningTriangle size=\"xxl\" />\n </ModalIcon>\n <ModalTitle data-testid=\"modal-title\">{title}</ModalTitle>\n <ModalDescription\n data-testid=\"modal-desc\"\n style={{\n overflow: 'auto',\n }}\n >\n {description}\n </ModalDescription>\n </Grid>\n </Grid>\n <Grid pt=\"24px\">\n <Grid\n pl=\"xs\"\n pr=\"xs\"\n cols={showSecondaryAction ? [1, 1] : [1]}\n gutter=\"xs\"\n justifyContent=\"center\"\n alignItems=\"center\"\n style={{\n borderTop: `1px solid ${theme.colors.neutral[100]}`,\n }}\n >\n {showSecondaryAction && (\n <DSButton\n {...secondaryActionProps}\n labelText={secondaryActionProps.labelText || ' Cancel'}\n buttonType=\"secondary\"\n data-testid=\"modal-secondary-btn\"\n />\n )}\n <DSButton\n labelText={primaryActionProps.labelText || ' Accept'}\n {...primaryActionProps}\n buttonType=\"primary\"\n data-testid=\"modal-primary-btn\"\n />\n </Grid>\n </Grid>\n </ModalBox>\n )}\n </ModalPosition>\n </>\n );\n};\n\nconst modalProps = {\n isOpen: PropTypes.bool.description('Wheter the modal is open or closed').defaultValue(false),\n zIndex: PropTypes.number.description('z-index value').defaultValue(1),\n title: PropTypes.string.description('Modal s title').isRequired,\n description: PropTypes.string.description('Modal s content').isRequired,\n onClose: PropTypes.func.description('Function executed when the modal closes'),\n showSecondaryAction: PropTypes.bool.description('Wheter to show secondary action button or not').defaultValue(true),\n secondaryActionProps: PropTypes.shape({\n onClick: PropTypes.func,\n labelText: PropTypes.string,\n }).description('Secondary action props'),\n primaryActionProps: PropTypes.shape({\n onClick: PropTypes.func,\n labelText: PropTypes.string,\n }).description('Primary action props'),\n};\n\nModal.propTypes = modalProps;\nModal.displayName = 'Modal';\nconst ModalWithSchema = describe(Modal);\nModalWithSchema.propTypes = modalProps;\n\nexport { Modal, ModalWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB;AAEA,0BAAoC;AACpC,oBAAqB;AACrB,qBAAqB;AACrB,sBAAgC;AAChC,uBAAqB;AACrB,uBAAyB;AACzB,oBAAsG;AAEtG,MAAM,QAAQ,CAAC;AAAA,EACb,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,UAAU;AAAA,EACV,sBAAsB;AAAA,EACtB,uBAAuB;AAAA,IACrB,SAAS;AAAA,IACT,WAAW;AAAA,EACb;AAAA,EACA,qBAAqB;AAAA,IACnB,SAAS;AAAA,IACT,WAAW;AAAA,EACb;AAAA,EACA,SAAS;AAAA,EACT,WAAW;AACb,MAAM;AACJ,QAAM,YAAQ,2BAAS;AACvB,MAAI,CAAC;AAAQ,WAAO;AACpB,SACE;AAAA,IACE;AAAA,kDAAC;AAAA,QAAQ;AAAA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C7C,YAAW;AAAA,oBACX,eAAY;AAAA,mBACd;AAAA,kBAEF,4CAAC,iBAAAA,SAAA;AAAA,oBACC,WAAW,mBAAmB,aAAa;AAAA,oBAC1C,GAAG;AAAA,oBACJ,YAAW;AAAA,oBACX,eAAY;AAAA,mBACd;AAAA;AAAA,eACF;AAAA,aACF;AAAA;AAAA,SACF;AAAA,OAEJ;AAAA;AAAA,GACF;AAEJ;AAEA,MAAM,aAAa;AAAA,EACjB,QAAQ,8BAAU,KAAK,YAAY,oCAAoC,EAAE,aAAa,KAAK;AAAA,EAC3F,QAAQ,8BAAU,OAAO,YAAY,eAAe,EAAE,aAAa,CAAC;AAAA,EACpE,OAAO,8BAAU,OAAO,YAAY,eAAe,EAAE;AAAA,EACrD,aAAa,8BAAU,OAAO,YAAY,iBAAiB,EAAE;AAAA,EAC7D,SAAS,8BAAU,KAAK,YAAY,yCAAyC;AAAA,EAC7E,qBAAqB,8BAAU,KAAK,YAAY,+CAA+C,EAAE,aAAa,IAAI;AAAA,EAClH,sBAAsB,8BAAU,MAAM;AAAA,IACpC,SAAS,8BAAU;AAAA,IACnB,WAAW,8BAAU;AAAA,EACvB,CAAC,EAAE,YAAY,wBAAwB;AAAA,EACvC,oBAAoB,8BAAU,MAAM;AAAA,IAClC,SAAS,8BAAU;AAAA,IACnB,WAAW,8BAAU;AAAA,EACvB,CAAC,EAAE,YAAY,sBAAsB;AACvC;AAEA,MAAM,YAAY;AAClB,MAAM,cAAc;AACpB,MAAM,sBAAkB,8BAAS,KAAK;AACtC,gBAAgB,YAAY;",
6
6
  "names": ["DSButton"]
7
7
  }
@@ -1,16 +1,9 @@
1
1
  import * as React from "react";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import React2, { useEffect, useRef, useCallback, useState } from "react";
4
- import { PropTypes, describe } from "@elliemae/ds-utilities";
4
+ import { PropTypes, describe, useMakeMutable } from "@elliemae/ds-utilities";
5
5
  import { Grid } from "@elliemae/ds-grid";
6
6
  import { Loader } from "./Loader";
7
- const useMakeMutable = (referenceVar) => {
8
- const mutable = useRef(referenceVar);
9
- useEffect(() => {
10
- mutable.current = referenceVar;
11
- }, [referenceVar]);
12
- return mutable;
13
- };
14
7
  function useIntersectionObserver(elementRef, { threshold = 0, root = null, rootMargin = "0%", freezeOnceVisible = false }, onIntersectionCb = (entry) => {
15
8
  }) {
16
9
  const mutableIntersectionCb = useMakeMutable(onIntersectionCb);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/InfiniteLoader/Infiniteloader.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useEffect, useRef, useCallback, useState, type RefObject, type WeakValidationMap } from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-utilities';\nimport { Grid } from '@elliemae/ds-grid';\nimport { Loader } from './Loader';\n\ninterface Props {\n isFetching: boolean;\n hasMoreItems?: boolean;\n fetchData: () => void;\n children: React.ReactNode;\n height?: number | string;\n}\n\nconst useMakeMutable = <T,>(referenceVar: T): React.MutableRefObject<T> => {\n const mutable = useRef(referenceVar);\n useEffect(() => {\n mutable.current = referenceVar;\n }, [referenceVar]);\n return mutable;\n};\n\ninterface Args extends IntersectionObserverInit {\n freezeOnceVisible?: boolean;\n}\n\nfunction useIntersectionObserver(\n elementRef: RefObject<Element>,\n { threshold = 0, root = null, rootMargin = '0%', freezeOnceVisible = false }: Args,\n // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars\n onIntersectionCb = (entry: IntersectionObserverEntry): void => {},\n): IntersectionObserverEntry | undefined {\n const mutableIntersectionCb = useMakeMutable(onIntersectionCb);\n const [entry, setEntry] = useState<IntersectionObserverEntry>();\n\n const frozen = entry?.isIntersecting && freezeOnceVisible;\n\n const updateEntry = ([newEntry]: IntersectionObserverEntry[]): void => {\n setEntry(newEntry);\n if (newEntry.isIntersecting) mutableIntersectionCb.current(newEntry);\n };\n\n useEffect(() => {\n const node = elementRef?.current; // DOM Ref\n const hasIOSupport = !!window.IntersectionObserver;\n\n if (!hasIOSupport || frozen || !node) return () => {};\n\n const observerParams = { threshold, root, rootMargin };\n const observer = new IntersectionObserver(updateEntry, observerParams);\n\n observer.observe(node);\n\n return () => observer.disconnect();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [elementRef, JSON.stringify(threshold), root, rootMargin, frozen]);\n\n return entry;\n}\n\nconst InfiniteLoader = ({ isFetching, fetchData, children, height, hasMoreItems = true }: Props) => {\n const [viewportHeight, setViewportHeight] = useState<number | undefined | string>(height);\n\n const baselineRef = useRef<HTMLDivElement | null>(null);\n const mutableIsFetching = useMakeMutable(isFetching);\n const mutableFetchData = useMakeMutable(fetchData);\n const onIntersectionCb = React.useCallback(() => {\n if (hasMoreItems && !mutableIsFetching.current) {\n mutableFetchData.current();\n }\n }, [hasMoreItems, mutableFetchData, mutableIsFetching]);\n useIntersectionObserver(\n baselineRef,\n {\n root: null,\n rootMargin: '0px',\n threshold: 0.1,\n },\n onIntersectionCb,\n );\n\n const handleResize = useCallback(() => {\n setViewportHeight(window.innerHeight);\n }, []);\n\n useEffect(() => {\n if (!height) {\n window.addEventListener('resize', handleResize);\n handleResize();\n }\n return () => {\n if (!height) window.removeEventListener('resize', handleResize);\n };\n }, [handleResize, height]);\n\n return (\n <Grid style={{ position: 'relative', overflow: 'hidden', height: viewportHeight }}>\n <Grid style={{ overflow: isFetching ? 'hidden' : 'auto', height: viewportHeight }}>\n {children}\n <div ref={baselineRef} style={{ height: 1 }} />\n </Grid>\n <Loader isOpen={isFetching} />\n </Grid>\n );\n};\n\nconst listProps = {\n isFetching: PropTypes.bool.description('toggle loading state'),\n hasMoreItems: PropTypes.bool\n .description('wheter or not you have more items that need to be loaded')\n .defaultValue(true),\n fetchData: PropTypes.func.description('callback to fetch new items'),\n children: PropTypes.element.description('row items for infinite loader'),\n height: PropTypes.number.description('infinite loader list height'),\n} as WeakValidationMap<unknown>;\n\nconst Infinite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ACpB,WAAW,UAAU,KAAK,YAAY,6BAA6B;AAAA,EACnE,UAAU,UAAU,QAAQ,YAAY,+BAA+B;AAAA,EACvE,QAAQ,UAAU,OAAO,YAAY,6BAA6B;AACpE;AAEA,MAAM,2BAA2B,SAAS,cAAc;AACxD,yBAAyB,YAAY;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useEffect, useRef, useCallback, useState, type RefObject, type WeakValidationMap } from 'react';\nimport { PropTypes, describe, useMakeMutable } from '@elliemae/ds-utilities';\nimport { Grid } from '@elliemae/ds-grid';\nimport { Loader } from './Loader';\n\ninterface Props {\n isFetching: boolean;\n hasMoreItems?: boolean;\n fetchData: () => void;\n children: React.ReactNode;\n height?: number | string;\n}\n\ninterface Args extends IntersectionObserverInit {\n freezeOnceVisible?: boolean;\n}\n\nfunction useIntersectionObserver(\n elementRef: RefObject<Element>,\n { threshold = 0, root = null, rootMargin = '0%', freezeOnceVisible = false }: Args,\n // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars\n onIntersectionCb = (entry: IntersectionObserverEntry): void => {},\n): IntersectionObserverEntry | undefined {\n const mutableIntersectionCb = useMakeMutable(onIntersectionCb);\n const [entry, setEntry] = useState<IntersectionObserverEntry>();\n\n const frozen = entry?.isIntersecting && freezeOnceVisible;\n\n const updateEntry = ([newEntry]: IntersectionObserverEntry[]): void => {\n setEntry(newEntry);\n if (newEntry.isIntersecting) mutableIntersectionCb.current(newEntry);\n };\n\n useEffect(() => {\n const node = elementRef?.current; // DOM Ref\n const hasIOSupport = !!window.IntersectionObserver;\n\n if (!hasIOSupport || frozen || !node) return () => {};\n\n const observerParams = { threshold, root, rootMargin };\n const observer = new IntersectionObserver(updateEntry, observerParams);\n\n observer.observe(node);\n\n return () => observer.disconnect();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [elementRef, JSON.stringify(threshold), root, rootMargin, frozen]);\n\n return entry;\n}\n\nconst InfiniteLoader = ({ isFetching, fetchData, children, height, hasMoreItems = true }: Props) => {\n const [viewportHeight, setViewportHeight] = useState<number | undefined | string>(height);\n\n const baselineRef = useRef<HTMLDivElement | null>(null);\n const mutableIsFetching = useMakeMutable(isFetching);\n const mutableFetchData = useMakeMutable(fetchData);\n const onIntersectionCb = React.useCallback(() => {\n if (hasMoreItems && !mutableIsFetching.current) {\n mutableFetchData.current();\n }\n }, [hasMoreItems, mutableFetchData, mutableIsFetching]);\n useIntersectionObserver(\n baselineRef,\n {\n root: null,\n rootMargin: '0px',\n threshold: 0.1,\n },\n onIntersectionCb,\n );\n\n const handleResize = useCallback(() => {\n setViewportHeight(window.innerHeight);\n }, []);\n\n useEffect(() => {\n if (!height) {\n window.addEventListener('resize', handleResize);\n handleResize();\n }\n return () => {\n if (!height) window.removeEventListener('resize', handleResize);\n };\n }, [handleResize, height]);\n\n return (\n <Grid style={{ position: 'relative', overflow: 'hidden', height: viewportHeight }}>\n <Grid style={{ overflow: isFetching ? 'hidden' : 'auto', height: viewportHeight }}>\n {children}\n <div ref={baselineRef} style={{ height: 1 }} />\n </Grid>\n <Loader isOpen={isFetching} />\n </Grid>\n );\n};\n\nconst listProps = {\n isFetching: PropTypes.bool.description('toggle loading state'),\n hasMoreItems: PropTypes.bool\n .description('wheter or not you have more items that need to be loaded')\n .defaultValue(true),\n fetchData: PropTypes.func.description('callback to fetch new items'),\n children: PropTypes.element.description('row items for infinite loader'),\n height: PropTypes.number.description('infinite loader list height'),\n} as WeakValidationMap<unknown>;\n\nconst InfiniteLoaderWithSchema = describe(InfiniteLoader);\nInfiniteLoaderWithSchema.propTypes = listProps;\nexport { InfiniteLoader, InfiniteLoaderWithSchema };\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB;AAAA,OAAOA,UAAS,WAAW,QAAQ,aAAa,gBAAwD;AACxG,SAAS,WAAW,UAAU,sBAAsB;AACpD,SAAS,YAAY;AACrB,SAAS,cAAc;AAcvB,SAAS,wBACP,YACA,EAAE,YAAY,GAAG,OAAO,MAAM,a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AACrC,sBAAkB,OAAO,WAAW;AAAA,EACtC,GAAG,CAAC,CAAC;AAEL,YAAU,MAAM;AACd,QAAI,CAAC,QAAQ;AACX,aAAO,iBAAiB,UAAU,YAAY;AAC9C,mBAAa;AAAA,IACf;AACA,WAAO,MAAM;AACX,UAAI,CAAC;AAAQ,eAAO,oBAAoB,UAAU,YAAY;AAAA,IAChE;AAAA,EACF,GAAG,CAAC,cAAc,MAAM,CAAC;AAEzB,SACE,qBAAC;AAAA,IAAK,OAAO,EAAE,UAAU,YAAY,UAAU,UAAU,QAAQ,eAAe;AAAA,IAC9E;AAAA,2BAAC;AAAA,QAAK,OAAO,EAAE,UAAU,aAAa,WAAW,QAAQ,QAAQ,eAAe;AAAA,QAC7E;AAAA;AAAA,UACD,oBAAC;AAAA,YAAI,KAAK;AAAA,YAAa,OAAO,EAAE,QAAQ,EAAE;AAAA,WAAG;AAAA;AAAA,OAC/C;AAAA,MACA,oBAAC;AAAA,QAAO,QAAQ;AAAA,OAAY;AAAA;AAAA,GAC9B;AAEJ;AAEA,MAAM,YAAY;AAAA,EAChB,YAAY,UAAU,KAAK,YAAY,sBAAsB;AAAA,EAC7D,cAAc,UAAU,KACrB,YAAY,0DAA0D,EACtE,aAAa,IAAI;AAAA,EACpB,WAAW,UAAU,KAAK,YAAY,6BAA6B;AAAA,EACnE,UAAU,UAAU,QAAQ,YAAY,+BAA+B;AAAA,EACvE,QAAQ,UAAU,OAAO,YAAY,6BAA6B;AACpE;AAEA,MAAM,2BAA2B,SAAS,cAAc;AACxD,yBAAyB,YAAY;",
6
6
  "names": ["React"]
7
7
  }
@@ -21,7 +21,8 @@ const Modal = ({
21
21
  onClick: noop,
22
22
  labelText: "Accept"
23
23
  },
24
- isOpen = false
24
+ isOpen = false,
25
+ children = void 0
25
26
  }) => {
26
27
  const theme = useTheme();
27
28
  if (!isOpen)
@@ -38,7 +39,9 @@ const Modal = ({
38
39
  /* @__PURE__ */ jsx(ModalPosition, {
39
40
  zIndex,
40
41
  cols: ["auto"],
41
- children: /* @__PURE__ */ jsxs(ModalBox, {
42
+ children: children !== void 0 ? /* @__PURE__ */ jsx(Fragment, {
43
+ children
44
+ }) : /* @__PURE__ */ jsxs(ModalBox, {
42
45
  maxHeight: `${window.innerHeight * 0.75}px`,
43
46
  rows: [1, "80px"],
44
47
  style: {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/Modal/Modal.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React from 'react';\nimport { describe, PropTypes } from '@elliemae/ds-utilities';\nimport { noop } from 'lodash';\nimport { Grid } from '@elliemae/ds-grid';\nimport { WarningTriangle } from '@elliemae/ds-icons';\nimport DSButton from '@elliemae/ds-button';\nimport { useTheme } from '@elliemae/ds-system';\nimport { ModalPosition, ModalBox, BackShadow, ModalIcon, ModalTitle, ModalDescription, BodyFix } from './styled';\n\nconst Modal = ({\n zIndex = 1,\n title = '',\n description = '',\n onClose = noop,\n showSecondaryAction = true,\n secondaryActionProps = {\n onClick: noop,\n labelText: 'Cancel',\n },\n primaryActionProps = {\n onClick: noop,\n labelText: 'Accept',\n },\n isOpen = false,\n}) => {\n const theme = useTheme();\n if (!isOpen) return null;\n return (\n <>\n <BodyFix isOpen={isOpen} />\n <BackShadow onClick={onClose} zIndex={zIndex} />\n <ModalPosition zIndex={zIndex} cols={['auto']}>\n <ModalBox\n maxHeight={`${window.innerHeight * 0.75}px`}\n rows={[1, '80px']}\n style={{\n overflow: 'hidden',\n }}\n >\n <Grid\n pl=\"xs\"\n pr=\"xs\"\n style={{\n overflow: 'hidden',\n }}\n >\n <Grid\n rows={['auto', 'auto', 1]}\n style={{\n overflow: 'hidden',\n }}\n >\n <ModalIcon>\n <WarningTriangle size=\"xxl\" />\n </ModalIcon>\n <ModalTitle data-testid=\"modal-title\">{title}</ModalTitle>\n <ModalDescription\n data-testid=\"modal-desc\"\n style={{\n overflow: 'auto',\n }}\n >\n {description}\n </ModalDescription>\n </Grid>\n </Grid>\n <Grid pt=\"24px\">\n <Grid\n pl=\"xs\"\n pr=\"xs\"\n cols={showSecondaryAction ? [1, 1] : [1]}\n gutter=\"xs\"\n justifyContent=\"center\"\n alignItems=\"center\"\n style={{\n borderTop: `1px solid ${theme.colors.neutral[100]}`,\n }}\n >\n {showSecondaryAction && (\n <DSButton\n {...secondaryActionProps}\n labelText={secondaryActionProps.labelText || ' Cancel'}\n buttonType=\"secondary\"\n data-testid=\"modal-secondary-btn\"\n />\n )}\n <DSButton\n labelText={primaryActionProps.labelText || ' Accept'}\n {...primaryActionProps}\n buttonType=\"primary\"\n data-testid=\"modal-primary-btn\"\n />\n </Grid>\n </Grid>\n </ModalBox>\n </ModalPosition>\n </>\n );\n};\n\nconst modalProps = {\n isOpen: PropTypes.bool.description('Wheter the modal is open or closed').defaultValue(false),\n zIndex: PropTypes.number.description('z-index value').defaultValue(1),\n title: PropTypes.string.description('Modal s title').isRequired,\n description: PropTypes.string.description('Modal s content').isRequired,\n onClose: PropTypes.func.description('Function executed when the modal closes'),\n showSecondaryAction: PropTypes.bool.description('Wheter to show secondary action button or not').defaultValue(true),\n secondaryActionProps: PropTypes.shape({\n onClick: PropTypes.func,\n labelText: PropTypes.string,\n }).description('Secondary action props'),\n primaryActionProps: PropTypes.shape({\n onClick: PropTypes.func,\n labelText: PropTypes.string,\n }).description('Primary action props'),\n};\n\nModal.propTypes = modalProps;\nModal.displayName = 'Modal';\nconst ModalWithSchema = describe(Modal);\nModalWithSchema.propTypes = modalProps;\n\nexport { Modal, ModalWithSchema };\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB;AAEA,SAAS,UAAU,iBAAiB;AACpC,SAAS,YAAY;AACrB,SAAS,YAAY;AACrB,SAAS,uBAAuB;AAChC,OAAO,cAAc;AACrB,SAAS,gBAAgB;AACzB,SAAS,eAAe,UAAU,YAAY,WAAW,YAAY,kBAAkB,eA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,KAAK;AACtC,gBAAgB,YAAY;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React from 'react';\nimport { describe, PropTypes } from '@elliemae/ds-utilities';\nimport { noop } from 'lodash';\nimport { Grid } from '@elliemae/ds-grid';\nimport { WarningTriangle } from '@elliemae/ds-icons';\nimport DSButton from '@elliemae/ds-button';\nimport { useTheme } from '@elliemae/ds-system';\nimport { ModalPosition, ModalBox, BackShadow, ModalIcon, ModalTitle, ModalDescription, BodyFix } from './styled';\n\nconst Modal = ({\n zIndex = 1,\n title = '',\n description = '',\n onClose = noop,\n showSecondaryAction = true,\n secondaryActionProps = {\n onClick: noop,\n labelText: 'Cancel',\n },\n primaryActionProps = {\n onClick: noop,\n labelText: 'Accept',\n },\n isOpen = false,\n children = undefined,\n}) => {\n const theme = useTheme();\n if (!isOpen) return null;\n return (\n <>\n <BodyFix isOpen={isOpen} />\n <BackShadow onClick={onClose} zIndex={zIndex} />\n <ModalPosition zIndex={zIndex} cols={['auto']}>\n {children !== undefined ? (\n <>{children}</>\n ) : (\n <ModalBox\n maxHeight={`${window.innerHeight * 0.75}px`}\n rows={[1, '80px']}\n style={{\n overflow: 'hidden',\n }}\n >\n <Grid\n pl=\"xs\"\n pr=\"xs\"\n style={{\n overflow: 'hidden',\n }}\n >\n <Grid\n rows={['auto', 'auto', 1]}\n style={{\n overflow: 'hidden',\n }}\n >\n <ModalIcon>\n <WarningTriangle size=\"xxl\" />\n </ModalIcon>\n <ModalTitle data-testid=\"modal-title\">{title}</ModalTitle>\n <ModalDescription\n data-testid=\"modal-desc\"\n style={{\n overflow: 'auto',\n }}\n >\n {description}\n </ModalDescription>\n </Grid>\n </Grid>\n <Grid pt=\"24px\">\n <Grid\n pl=\"xs\"\n pr=\"xs\"\n cols={showSecondaryAction ? [1, 1] : [1]}\n gutter=\"xs\"\n justifyContent=\"center\"\n alignItems=\"center\"\n style={{\n borderTop: `1px solid ${theme.colors.neutral[100]}`,\n }}\n >\n {showSecondaryAction && (\n <DSButton\n {...secondaryActionProps}\n labelText={secondaryActionProps.labelText || ' Cancel'}\n buttonType=\"secondary\"\n data-testid=\"modal-secondary-btn\"\n />\n )}\n <DSButton\n labelText={primaryActionProps.labelText || ' Accept'}\n {...primaryActionProps}\n buttonType=\"primary\"\n data-testid=\"modal-primary-btn\"\n />\n </Grid>\n </Grid>\n </ModalBox>\n )}\n </ModalPosition>\n </>\n );\n};\n\nconst modalProps = {\n isOpen: PropTypes.bool.description('Wheter the modal is open or closed').defaultValue(false),\n zIndex: PropTypes.number.description('z-index value').defaultValue(1),\n title: PropTypes.string.description('Modal s title').isRequired,\n description: PropTypes.string.description('Modal s content').isRequired,\n onClose: PropTypes.func.description('Function executed when the modal closes'),\n showSecondaryAction: PropTypes.bool.description('Wheter to show secondary action button or not').defaultValue(true),\n secondaryActionProps: PropTypes.shape({\n onClick: PropTypes.func,\n labelText: PropTypes.string,\n }).description('Secondary action props'),\n primaryActionProps: PropTypes.shape({\n onClick: PropTypes.func,\n labelText: PropTypes.string,\n }).description('Primary action props'),\n};\n\nModal.propTypes = modalProps;\nModal.displayName = 'Modal';\nconst ModalWithSchema = describe(Modal);\nModalWithSchema.propTypes = modalProps;\n\nexport { Modal, ModalWithSchema };\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB;AAEA,SAAS,UAAU,iBAAiB;AACpC,SAAS,YAAY;AACrB,SAAS,YAAY;AACrB,SAAS,uBAAuB;AAChC,OAAO,cAAc;AACrB,SAAS,gBAAgB;AACzB,SAAS,eAAe,UAAU,YAAY,WAAW,YAAY,kBAAkB,eAAe;AAEtG,MAAM,QAAQ,CAAC;AAAA,EACb,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,UAAU;AAAA,EACV,sBAAsB;AAAA,EACtB,uBAAuB;AAAA,IACrB,SAAS;AAAA,IACT,WAAW;AAAA,EACb;AAAA,EACA,qBAAqB;AAAA,IACnB,SAAS;AAAA,IACT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
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - System",
6
6
  "files": [
@@ -435,21 +435,21 @@
435
435
  "typeSafety": false
436
436
  },
437
437
  "dependencies": {
438
- "@elliemae/ds-accordion": "3.7.2-rc.2",
439
- "@elliemae/ds-backdrop": "3.7.2-rc.2",
440
- "@elliemae/ds-button": "3.7.2-rc.2",
441
- "@elliemae/ds-circular-progress-indicator": "3.7.2-rc.2",
442
- "@elliemae/ds-form": "3.7.2-rc.2",
443
- "@elliemae/ds-form-checkbox": "3.7.2-rc.2",
444
- "@elliemae/ds-grid": "3.7.2-rc.2",
445
- "@elliemae/ds-icon": "3.7.2-rc.2",
446
- "@elliemae/ds-icons": "3.7.2-rc.2",
447
- "@elliemae/ds-indeterminate-progress-indicator": "3.7.2-rc.2",
448
- "@elliemae/ds-shared": "3.7.2-rc.2",
449
- "@elliemae/ds-system": "3.7.2-rc.2",
450
- "@elliemae/ds-tabs": "3.7.2-rc.2",
451
- "@elliemae/ds-truncated-expandable-text": "3.7.2-rc.2",
452
- "@elliemae/ds-utilities": "3.7.2-rc.2",
438
+ "@elliemae/ds-accordion": "3.8.0-next.1",
439
+ "@elliemae/ds-backdrop": "3.8.0-next.1",
440
+ "@elliemae/ds-button": "3.8.0-next.1",
441
+ "@elliemae/ds-circular-progress-indicator": "3.8.0-next.1",
442
+ "@elliemae/ds-form": "3.8.0-next.1",
443
+ "@elliemae/ds-form-checkbox": "3.8.0-next.1",
444
+ "@elliemae/ds-grid": "3.8.0-next.1",
445
+ "@elliemae/ds-icon": "3.8.0-next.1",
446
+ "@elliemae/ds-icons": "3.8.0-next.1",
447
+ "@elliemae/ds-indeterminate-progress-indicator": "3.8.0-next.1",
448
+ "@elliemae/ds-shared": "3.8.0-next.1",
449
+ "@elliemae/ds-system": "3.8.0-next.1",
450
+ "@elliemae/ds-tabs": "3.8.0-next.1",
451
+ "@elliemae/ds-truncated-expandable-text": "3.8.0-next.1",
452
+ "@elliemae/ds-utilities": "3.8.0-next.1",
453
453
  "polished": "~3.6.7",
454
454
  "prop-types": "~15.8.1",
455
455
  "react-window": "~1.8.7",