@elliemae/ds-dialog 1.61.12 → 1.61.13
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/cjs/DSDialog.js.map +1 -1
- package/cjs/defaultProps.js.map +1 -1
- package/cjs/propTypes.js.map +1 -1
- package/cjs/styles.js.map +1 -1
- package/cjs/utils.js.map +1 -1
- package/esm/DSDialog.js.map +1 -1
- package/esm/defaultProps.js.map +1 -1
- package/esm/propTypes.js.map +1 -1
- package/esm/styles.js.map +1 -1
- package/esm/utils.js.map +1 -1
- package/package.json +3 -3
package/cjs/DSDialog.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DSDialog.js","sources":["../../src/DSDialog.tsx"],"sourcesContent":["import ReactDOM from 'react-dom';\nimport React, { useCallback, useRef, useEffect } from 'react';\nimport { describe } from 'react-desc';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport type { DSDialogPropsT, DSDialogPropsWithDefaultT } from './types/index.d';\nimport { FixedBody, StyledDialogBackground, StyledDialogContainer } from './styles';\nimport { propTypes } from './propTypes';\nimport { defaultProps } from './defaultProps';\nimport { getSpaceProps } from './utils';\n\nconst DSDialog = (props: DSDialogPropsT): React.ReactNode => {\n const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps) as DSDialogPropsWithDefaultT;\n\n useValidateTypescriptPropTypes(propsWithDefault, DSDialogWithSchema.toTypescript());\n const { children, isOpen, onClickOutside, centered, size, removeAutoFocus, ...rest } = propsWithDefault;\n\n const containerRef = useRef<HTMLDivElement | null>(null);\n\n const handleOutsideClick = useCallback(\n (e) => {\n if (e.target.dataset.portalbg) onClickOutside();\n },\n [onClickOutside],\n );\n\n const handleOnKeyDown = useCallback(\n (e) => {\n if (e.key === 'Escape') onClickOutside();\n },\n [onClickOutside],\n );\n\n useEffect(() => {\n if (isOpen && !removeAutoFocus) containerRef?.current?.focus();\n }, [isOpen, removeAutoFocus]);\n\n if (isOpen) {\n return ReactDOM.createPortal(\n <StyledDialogBackground onClick={handleOutsideClick} data-portalbg>\n <FixedBody />\n <StyledDialogContainer\n role=\"dialog\"\n aria-modal\n ref={containerRef}\n tabIndex={!removeAutoFocus ? 0 : undefined}\n onKeyDown={handleOnKeyDown}\n {...getSpaceProps(rest)}\n size={size}\n centered={centered}\n >\n {children}\n </StyledDialogContainer>\n </StyledDialogBackground>,\n document.getElementsByTagName('body')[0],\n );\n }\n\n return null;\n};\n\nDSDialog.propTypes = propTypes;\n\nconst DSDialogWithSchema = describe(DSDialog);\nDSDialogWithSchema.propTypes = propTypes;\n\nexport { DSDialog, DSDialogWithSchema };\n"],"names":["DSDialog","props","propsWithDefault","useMemoMergePropsWithDefault","defaultProps","useValidateTypescriptPropTypes","DSDialogWithSchema","toTypescript","children","isOpen","onClickOutside","centered","size","removeAutoFocus","rest","containerRef","useRef","handleOutsideClick","useCallback","e","target","dataset","portalbg","handleOnKeyDown","key","useEffect","current","focus","ReactDOM","createPortal","React","StyledDialogBackground","FixedBody","StyledDialogContainer","undefined","getSpaceProps","document","getElementsByTagName","propTypes","describe"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAUMA,QAAQ,GAAG,SAAXA,QAAW,CAACC,KAAD,EAA4C;
|
|
1
|
+
{"version":3,"file":"DSDialog.js","sources":["../../src/DSDialog.tsx"],"sourcesContent":["import ReactDOM from 'react-dom';\nimport React, { useCallback, useRef, useEffect } from 'react';\nimport { describe } from 'react-desc';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport type { DSDialogPropsT, DSDialogPropsWithDefaultT } from './types/index.d';\nimport { FixedBody, StyledDialogBackground, StyledDialogContainer } from './styles';\nimport { propTypes } from './propTypes';\nimport { defaultProps } from './defaultProps';\nimport { getSpaceProps } from './utils';\n\nconst DSDialog = (props: DSDialogPropsT): React.ReactNode => {\n const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps) as DSDialogPropsWithDefaultT;\n\n useValidateTypescriptPropTypes(propsWithDefault, DSDialogWithSchema.toTypescript());\n const { children, isOpen, onClickOutside, centered, size, removeAutoFocus, ...rest } = propsWithDefault;\n\n const containerRef = useRef<HTMLDivElement | null>(null);\n\n const handleOutsideClick = useCallback(\n (e) => {\n if (e.target.dataset.portalbg) onClickOutside();\n },\n [onClickOutside],\n );\n\n const handleOnKeyDown = useCallback(\n (e) => {\n if (e.key === 'Escape') onClickOutside();\n },\n [onClickOutside],\n );\n\n useEffect(() => {\n if (isOpen && !removeAutoFocus) containerRef?.current?.focus();\n }, [isOpen, removeAutoFocus]);\n\n if (isOpen) {\n return ReactDOM.createPortal(\n <StyledDialogBackground onClick={handleOutsideClick} data-portalbg>\n <FixedBody />\n <StyledDialogContainer\n role=\"dialog\"\n aria-modal\n ref={containerRef}\n tabIndex={!removeAutoFocus ? 0 : undefined}\n onKeyDown={handleOnKeyDown}\n {...getSpaceProps(rest)}\n size={size}\n centered={centered}\n >\n {children}\n </StyledDialogContainer>\n </StyledDialogBackground>,\n document.getElementsByTagName('body')[0],\n );\n }\n\n return null;\n};\n\nDSDialog.propTypes = propTypes;\n\nconst DSDialogWithSchema = describe(DSDialog);\nDSDialogWithSchema.propTypes = propTypes;\n\nexport { DSDialog, DSDialogWithSchema };\n"],"names":["DSDialog","props","propsWithDefault","useMemoMergePropsWithDefault","defaultProps","useValidateTypescriptPropTypes","DSDialogWithSchema","toTypescript","children","isOpen","onClickOutside","centered","size","removeAutoFocus","rest","containerRef","useRef","handleOutsideClick","useCallback","e","target","dataset","portalbg","handleOnKeyDown","key","useEffect","current","focus","ReactDOM","createPortal","React","StyledDialogBackground","FixedBody","StyledDialogContainer","undefined","getSpaceProps","document","getElementsByTagName","propTypes","describe"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAUMA,QAAQ,GAAG,SAAXA,QAAW,CAACC,KAAD,EAA4C;EAC3D,IAAMC,gBAAgB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BAFF;MAGE,GAAG,EAAElB,YAHP;MAIE,QAAQ,EAAE,CAACF,eAAD,GAAmB,CAAnB,GAAuBqB,SAJnC;MAKE,SAAS,EAAEX;OACPY,mBAAa,CAACrB,IAAD,CANnB;MAOE,IAAI,EAAEF,IAPR;MAQE,QAAQ,EAAED;QAETH,QAVH,CAFF,CADK,EAgBL4B,QAAQ,CAACC,oBAAT,CAA8B,MAA9B,EAAsC,CAAtC,CAhBK,CAAP;;;EAoBF,OAAO,IAAP;AACD;;AAEDrC,QAAQ,CAACsC,SAAT,GAAqBA,mBAArB;IAEMhC,kBAAkB,GAAGiC,kBAAQ,CAACvC,QAAD;AACnCM,kBAAkB,CAACgC,SAAnB,GAA+BA,mBAA/B;;;;;"}
|
package/cjs/defaultProps.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultProps.js","sources":["../../src/defaultProps.tsx"],"sourcesContent":["import type { DSDialogPropsT } from './types/index.d';\n\nexport const defaultProps: Partial<DSDialogPropsT> = {\n isOpen: false,\n centered: false,\n size: 'default',\n removeAutoFocus: false,\n onClickOutside: () => {},\n};\n"],"names":["defaultProps","isOpen","centered","size","removeAutoFocus","onClickOutside"],"mappings":";;;;IAEaA,YAAqC,GAAG;
|
|
1
|
+
{"version":3,"file":"defaultProps.js","sources":["../../src/defaultProps.tsx"],"sourcesContent":["import type { DSDialogPropsT } from './types/index.d';\n\nexport const defaultProps: Partial<DSDialogPropsT> = {\n isOpen: false,\n centered: false,\n size: 'default',\n removeAutoFocus: false,\n onClickOutside: () => {},\n};\n"],"names":["defaultProps","isOpen","centered","size","removeAutoFocus","onClickOutside"],"mappings":";;;;IAEaA,YAAqC,GAAG;EACnDC,MAAM,EAAE,KAD2C;EAEnDC,QAAQ,EAAE,KAFyC;EAGnDC,IAAI,EAAE,SAH6C;EAInDC,eAAe,EAAE,KAJkC;EAKnDC,cAAc,EAAE,0BAAM;AAL6B;;;;"}
|
package/cjs/propTypes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propTypes.js","sources":["../../src/propTypes.tsx"],"sourcesContent":["/* eslint-disable max-len */\nimport { PropTypes } from 'react-desc';\n\nexport const propTypes = {\n isOpen: PropTypes.bool.description('Wether the Dialog is open or not.').defaultValue(false),\n children: PropTypes.node.description('Nested components.').isRequired,\n centered: PropTypes.bool.description('Centers the Dialog.').defaultValue(false),\n removeAutoFocus: PropTypes.bool\n .description(\n 'Removes focus in the Dialog container when is open. If you want to focus an specific element in the Dialog, it should be set to true.',\n )\n .defaultValue(false),\n onClickOutside: PropTypes.func\n .description(\n 'Callback that should be used to close the modal when the user clicks outside. Cb also triggers when the user press ESC key for accessibility purposes.',\n )\n .defaultValue(() => {}),\n};\n"],"names":["propTypes","isOpen","PropTypes","bool","description","defaultValue","children","node","isRequired","centered","removeAutoFocus","onClickOutside","func"],"mappings":";;;;;;AAAA;IAGaA,SAAS,GAAG;
|
|
1
|
+
{"version":3,"file":"propTypes.js","sources":["../../src/propTypes.tsx"],"sourcesContent":["/* eslint-disable max-len */\nimport { PropTypes } from 'react-desc';\n\nexport const propTypes = {\n isOpen: PropTypes.bool.description('Wether the Dialog is open or not.').defaultValue(false),\n children: PropTypes.node.description('Nested components.').isRequired,\n centered: PropTypes.bool.description('Centers the Dialog.').defaultValue(false),\n removeAutoFocus: PropTypes.bool\n .description(\n 'Removes focus in the Dialog container when is open. If you want to focus an specific element in the Dialog, it should be set to true.',\n )\n .defaultValue(false),\n onClickOutside: PropTypes.func\n .description(\n 'Callback that should be used to close the modal when the user clicks outside. Cb also triggers when the user press ESC key for accessibility purposes.',\n )\n .defaultValue(() => {}),\n};\n"],"names":["propTypes","isOpen","PropTypes","bool","description","defaultValue","children","node","isRequired","centered","removeAutoFocus","onClickOutside","func"],"mappings":";;;;;;AAAA;IAGaA,SAAS,GAAG;EACvBC,MAAM,EAAEC,mBAAS,CAACC,IAAV,CAAeC,WAAf,CAA2B,mCAA3B,EAAgEC,YAAhE,CAA6E,KAA7E,CADe;EAEvBC,QAAQ,EAAEJ,mBAAS,CAACK,IAAV,CAAeH,WAAf,CAA2B,oBAA3B,EAAiDI,UAFpC;EAGvBC,QAAQ,EAAEP,mBAAS,CAACC,IAAV,CAAeC,WAAf,CAA2B,qBAA3B,EAAkDC,YAAlD,CAA+D,KAA/D,CAHa;EAIvBK,eAAe,EAAER,mBAAS,CAACC,IAAV,CACdC,WADc,CAEb,uIAFa,EAIdC,YAJc,CAID,KAJC,CAJM;EASvBM,cAAc,EAAET,mBAAS,CAACU,IAAV,CACbR,WADa,CAEZ,wJAFY,EAIbC,YAJa,CAIA,YAAM,EAJN;AATO;;;;"}
|
package/cjs/styles.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../src/styles.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport { createGlobalStyle } from '@elliemae/ds-system';\nimport { space, flexbox, layout } from 'styled-system';\nimport type { StyledDialogContainerT } from './types/index.d';\n\nconst allSizes = {\n default: '576px',\n small: '320px',\n medium: '656px',\n large: '848px',\n 'x-large': '1042px',\n 'xx-large': '1440px',\n};\n\nexport const FixedBody = createGlobalStyle`\n body {\n overflow: hidden;\n }\n`;\n\nexport const StyledDialogBackground = styled.div`\n position: fixed;\n top: 0;\n bottom: 0;\n width: 100%;\n height: 100%;\n background: rgba(37, 41, 47, 50%);\n overflow-y: auto;\n`;\n\nexport const StyledDialogContainer = styled.div<StyledDialogContainerT>`\n height: fit-content;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n margin: ${({ centered }) => (centered ? 'auto' : '20vh auto auto auto')};\n width: ${({ size }) => allSizes[size]};\n min-width: 300px;\n box-shadow: 0 10px 20px 0 ${({ theme }) => theme.colors.neutral[500]};\n background: ${({ theme }) => theme.colors.neutral['000']};\n overflow-y: scroll;\n ${space}\n &:focus {\n outline: none;\n }\n`;\n\nexport const DSDialogTitle = styled.h3`\n font-size: ${({ theme }) => theme.fontSizes.title[700]};\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n margin: 0;\n`;\n\nexport const DSDialogAddon = styled.div``;\n\nexport const DSDialogHeader = styled.div`\n display: grid;\n align-items: center;\n grid-auto-flow: column;\n min-height: ${({ theme }) => theme.space.m};\n padding: 10px ${({ theme }) => theme.space.xs};\n & ${DSDialogTitle} + ${DSDialogAddon} {\n align-self: flex-start;\n justify-self: flex-end;\n }\n & ${DSDialogAddon}:only-child {\n justify-self: flex-end;\n }\n ${space}\n`;\n\nexport const DSDialogSeparator = styled.hr.attrs(() => ({ 'aria-hidden': true }))`\n margin: 0;\n border-top: 1px solid ${({ theme }) => theme.colors.neutral['080']};\n`;\n\nexport const DSDialogBody = styled.div`\n padding: ${({ theme }) => theme.space.xs};\n overflow-y: auto;\n ${layout}\n ${space}\n ${flexbox}\n`;\n\nexport const DSDialogPrimaryMessage = styled.h3`\n margin: 0;\n`;\n\nexport const DSDialogSecondaryMessage = styled.p`\n margin: 0;\n color: ${({ theme }) => theme.colors.neutral[500]};\n`;\n\nexport const DSDialogDefaultLayout = styled.div`\n display: grid;\n grid-auto-flow: row;\n justify-items: center;\n align-items: center;\n grid-gap: ${({ theme }) => theme.space.xxs};\n\n ${DSDialogSecondaryMessage} {\n text-align: center;\n }\n`;\n\nexport const DSDialogFooter = styled.div`\n display: grid;\n grid-auto-flow: column;\n align-items: center;\n justify-content: flex-end;\n grid-gap: ${({ theme }) => theme.space.xxs};\n min-height: ${({ theme }) => theme.space.m};\n padding: 0 ${({ theme }) => theme.space.xs};\n ${space}\n ${flexbox}\n`;\n"],"names":["allSizes","default","small","medium","large","FixedBody","createGlobalStyle","StyledDialogBackground","styled","div","StyledDialogContainer","centered","size","theme","colors","neutral","space","DSDialogTitle","h3","fontSizes","title","DSDialogAddon","DSDialogHeader","m","xs","DSDialogSeparator","hr","attrs","DSDialogBody","layout","flexbox","DSDialogPrimaryMessage","DSDialogSecondaryMessage","p","DSDialogDefaultLayout","xxs","DSDialogFooter"],"mappings":";;;;;;;;;;;;;;;AAKA,IAAMA,QAAQ,GAAG;
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../src/styles.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport { createGlobalStyle } from '@elliemae/ds-system';\nimport { space, flexbox, layout } from 'styled-system';\nimport type { StyledDialogContainerT } from './types/index.d';\n\nconst allSizes = {\n default: '576px',\n small: '320px',\n medium: '656px',\n large: '848px',\n 'x-large': '1042px',\n 'xx-large': '1440px',\n};\n\nexport const FixedBody = createGlobalStyle`\n body {\n overflow: hidden;\n }\n`;\n\nexport const StyledDialogBackground = styled.div`\n position: fixed;\n top: 0;\n bottom: 0;\n width: 100%;\n height: 100%;\n background: rgba(37, 41, 47, 50%);\n overflow-y: auto;\n`;\n\nexport const StyledDialogContainer = styled.div<StyledDialogContainerT>`\n height: fit-content;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n margin: ${({ centered }) => (centered ? 'auto' : '20vh auto auto auto')};\n width: ${({ size }) => allSizes[size]};\n min-width: 300px;\n box-shadow: 0 10px 20px 0 ${({ theme }) => theme.colors.neutral[500]};\n background: ${({ theme }) => theme.colors.neutral['000']};\n overflow-y: scroll;\n ${space}\n &:focus {\n outline: none;\n }\n`;\n\nexport const DSDialogTitle = styled.h3`\n font-size: ${({ theme }) => theme.fontSizes.title[700]};\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n margin: 0;\n`;\n\nexport const DSDialogAddon = styled.div``;\n\nexport const DSDialogHeader = styled.div`\n display: grid;\n align-items: center;\n grid-auto-flow: column;\n min-height: ${({ theme }) => theme.space.m};\n padding: 10px ${({ theme }) => theme.space.xs};\n & ${DSDialogTitle} + ${DSDialogAddon} {\n align-self: flex-start;\n justify-self: flex-end;\n }\n & ${DSDialogAddon}:only-child {\n justify-self: flex-end;\n }\n ${space}\n`;\n\nexport const DSDialogSeparator = styled.hr.attrs(() => ({ 'aria-hidden': true }))`\n margin: 0;\n border-top: 1px solid ${({ theme }) => theme.colors.neutral['080']};\n`;\n\nexport const DSDialogBody = styled.div`\n padding: ${({ theme }) => theme.space.xs};\n overflow-y: auto;\n ${layout}\n ${space}\n ${flexbox}\n`;\n\nexport const DSDialogPrimaryMessage = styled.h3`\n margin: 0;\n`;\n\nexport const DSDialogSecondaryMessage = styled.p`\n margin: 0;\n color: ${({ theme }) => theme.colors.neutral[500]};\n`;\n\nexport const DSDialogDefaultLayout = styled.div`\n display: grid;\n grid-auto-flow: row;\n justify-items: center;\n align-items: center;\n grid-gap: ${({ theme }) => theme.space.xxs};\n\n ${DSDialogSecondaryMessage} {\n text-align: center;\n }\n`;\n\nexport const DSDialogFooter = styled.div`\n display: grid;\n grid-auto-flow: column;\n align-items: center;\n justify-content: flex-end;\n grid-gap: ${({ theme }) => theme.space.xxs};\n min-height: ${({ theme }) => theme.space.m};\n padding: 0 ${({ theme }) => theme.space.xs};\n ${space}\n ${flexbox}\n`;\n"],"names":["allSizes","default","small","medium","large","FixedBody","createGlobalStyle","StyledDialogBackground","styled","div","StyledDialogContainer","centered","size","theme","colors","neutral","space","DSDialogTitle","h3","fontSizes","title","DSDialogAddon","DSDialogHeader","m","xs","DSDialogSeparator","hr","attrs","DSDialogBody","layout","flexbox","DSDialogPrimaryMessage","DSDialogSecondaryMessage","p","DSDialogDefaultLayout","xxs","DSDialogFooter"],"mappings":";;;;;;;;;;;;;;;AAKA,IAAMA,QAAQ,GAAG;EACfC,OAAO,EAAE,OADM;EAEfC,KAAK,EAAE,OAFQ;EAGfC,MAAM,EAAE,OAHO;EAIfC,KAAK,EAAE,OAJQ;EAKf,WAAW,QALI;EAMf,YAAY;AANG,CAAjB;IASaC,SAAS,GAAGC,0BAAH;IAMTC,sBAAsB,gBAAGC,0BAAM,CAACC,GAAV;EAAA;AAAA;IAUtBC,qBAAqB,gBAAGF,0BAAM,CAACC,GAAV;EAAA;AAAA,8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BAAGpB,0BAAM,CAACC,GAAV;EAAA;AAAA,oDACZ;EAAA,IAAGI,KAAH,SAAGA,KAAH;EAAA,OAAeA,KAAK,CAACG,KAAN,CAAYQ,EAA3B;AAAA,CADY,EAGrBK,mBAHqB,EAIrBb,kBAJqB,EAKrBc,oBALqB;IAQZC,sBAAsB,gBAAGvB,0BAAM,CAACU,EAAV;EAAA;AAAA;IAItBc,wBAAwB,gBAAGxB,0BAAM,CAACyB,CAAV;EAAA;AAAA,6BAE1B;EAAA,IAAGpB,KAAH,UAAGA,KAAH;EAAA,OAAeA,KAAK,CAACC,MAAN,CAAaC,OAAb,CAAqB,GAArB,CAAf;AAAA,CAF0B;IAKxBmB,qBAAqB,gBAAG1B,0BAAM,CAACC,GAAV;EAAA;AAAA,uHAKpB;EAAA,IAAGI,KAAH,UAAGA,KAAH;EAAA,OAAeA,KAAK,CAACG,KAAN,CAAYmB,GAA3B;AAAA,CALoB,EAO9BH,wBAP8B;IAYrBI,cAAc,gBAAG5B,0BAAM,CAACC,GAAV;EAAA;AAAA,8IAKb;EAAA,IAAGI,KAAH,UAAGA,KAAH;EAAA,OAAeA,KAAK,CAACG,KAAN,CAAYmB,GAA3B;AAAA,CALa,EAMX;EAAA,IAAGtB,KAAH,UAAGA,KAAH;EAAA,OAAeA,KAAK,CAACG,KAAN,CAAYO,CAA3B;AAAA,CANW,EAOZ;EAAA,IAAGV,KAAH,UAAGA,KAAH;EAAA,OAAeA,KAAK,CAACG,KAAN,CAAYQ,EAA3B;AAAA,CAPY,EAQvBR,kBARuB,EASvBc,oBATuB;;;;;;;;;;;;;;;"}
|
package/cjs/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../src/utils.tsx"],"sourcesContent":["import type { GetSpaceArgsT } from './types/index.d';\n\nexport const getSpaceProps = (props: GetSpaceArgsT): GetSpaceArgsT =>\n Object.fromEntries(Object.entries(props).filter(([key]) => /^[pm][xytblr]?$/.exec(key)));\n"],"names":["getSpaceProps","props","Object","fromEntries","entries","filter","key","exec"],"mappings":";;;;;;;;;;IAEaA,aAAa,GAAG,SAAhBA,aAAgB,CAACC,KAAD;
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../src/utils.tsx"],"sourcesContent":["import type { GetSpaceArgsT } from './types/index.d';\n\nexport const getSpaceProps = (props: GetSpaceArgsT): GetSpaceArgsT =>\n Object.fromEntries(Object.entries(props).filter(([key]) => /^[pm][xytblr]?$/.exec(key)));\n"],"names":["getSpaceProps","props","Object","fromEntries","entries","filter","key","exec"],"mappings":";;;;;;;;;;IAEaA,aAAa,GAAG,SAAhBA,aAAgB,CAACC,KAAD;EAAA,OAC3BC,MAAM,CAACC,WAAP,CAAmBD,MAAM,CAACE,OAAP,CAAeH,KAAf,EAAsBI,MAAtB,CAA6B;IAAA;QAAEC,GAAF;;IAAA,OAAW,kBAAkBC,IAAlB,CAAuBD,GAAvB,CAAX;GAA7B,CAAnB,CAD2B;AAAA;;;;"}
|
package/esm/DSDialog.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DSDialog.js","sources":["../../src/DSDialog.tsx"],"sourcesContent":["import ReactDOM from 'react-dom';\nimport React, { useCallback, useRef, useEffect } from 'react';\nimport { describe } from 'react-desc';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport type { DSDialogPropsT, DSDialogPropsWithDefaultT } from './types/index.d';\nimport { FixedBody, StyledDialogBackground, StyledDialogContainer } from './styles';\nimport { propTypes } from './propTypes';\nimport { defaultProps } from './defaultProps';\nimport { getSpaceProps } from './utils';\n\nconst DSDialog = (props: DSDialogPropsT): React.ReactNode => {\n const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps) as DSDialogPropsWithDefaultT;\n\n useValidateTypescriptPropTypes(propsWithDefault, DSDialogWithSchema.toTypescript());\n const { children, isOpen, onClickOutside, centered, size, removeAutoFocus, ...rest } = propsWithDefault;\n\n const containerRef = useRef<HTMLDivElement | null>(null);\n\n const handleOutsideClick = useCallback(\n (e) => {\n if (e.target.dataset.portalbg) onClickOutside();\n },\n [onClickOutside],\n );\n\n const handleOnKeyDown = useCallback(\n (e) => {\n if (e.key === 'Escape') onClickOutside();\n },\n [onClickOutside],\n );\n\n useEffect(() => {\n if (isOpen && !removeAutoFocus) containerRef?.current?.focus();\n }, [isOpen, removeAutoFocus]);\n\n if (isOpen) {\n return ReactDOM.createPortal(\n <StyledDialogBackground onClick={handleOutsideClick} data-portalbg>\n <FixedBody />\n <StyledDialogContainer\n role=\"dialog\"\n aria-modal\n ref={containerRef}\n tabIndex={!removeAutoFocus ? 0 : undefined}\n onKeyDown={handleOnKeyDown}\n {...getSpaceProps(rest)}\n size={size}\n centered={centered}\n >\n {children}\n </StyledDialogContainer>\n </StyledDialogBackground>,\n document.getElementsByTagName('body')[0],\n );\n }\n\n return null;\n};\n\nDSDialog.propTypes = propTypes;\n\nconst DSDialogWithSchema = describe(DSDialog);\nDSDialogWithSchema.propTypes = propTypes;\n\nexport { DSDialog, DSDialogWithSchema };\n"],"names":["DSDialog","props","propsWithDefault","useMemoMergePropsWithDefault","defaultProps","useValidateTypescriptPropTypes","DSDialogWithSchema","toTypescript","children","isOpen","onClickOutside","centered","size","removeAutoFocus","rest","containerRef","useRef","handleOutsideClick","useCallback","e","target","dataset","portalbg","handleOnKeyDown","key","useEffect","current","focus","ReactDOM","createPortal","undefined","getSpaceProps","document","getElementsByTagName","propTypes","describe"],"mappings":";;;;;;;;;;;;;;;;;;IAUMA,QAAQ,GAAG,SAAXA,QAAW,CAACC,KAAD,EAA4C;
|
|
1
|
+
{"version":3,"file":"DSDialog.js","sources":["../../src/DSDialog.tsx"],"sourcesContent":["import ReactDOM from 'react-dom';\nimport React, { useCallback, useRef, useEffect } from 'react';\nimport { describe } from 'react-desc';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport type { DSDialogPropsT, DSDialogPropsWithDefaultT } from './types/index.d';\nimport { FixedBody, StyledDialogBackground, StyledDialogContainer } from './styles';\nimport { propTypes } from './propTypes';\nimport { defaultProps } from './defaultProps';\nimport { getSpaceProps } from './utils';\n\nconst DSDialog = (props: DSDialogPropsT): React.ReactNode => {\n const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps) as DSDialogPropsWithDefaultT;\n\n useValidateTypescriptPropTypes(propsWithDefault, DSDialogWithSchema.toTypescript());\n const { children, isOpen, onClickOutside, centered, size, removeAutoFocus, ...rest } = propsWithDefault;\n\n const containerRef = useRef<HTMLDivElement | null>(null);\n\n const handleOutsideClick = useCallback(\n (e) => {\n if (e.target.dataset.portalbg) onClickOutside();\n },\n [onClickOutside],\n );\n\n const handleOnKeyDown = useCallback(\n (e) => {\n if (e.key === 'Escape') onClickOutside();\n },\n [onClickOutside],\n );\n\n useEffect(() => {\n if (isOpen && !removeAutoFocus) containerRef?.current?.focus();\n }, [isOpen, removeAutoFocus]);\n\n if (isOpen) {\n return ReactDOM.createPortal(\n <StyledDialogBackground onClick={handleOutsideClick} data-portalbg>\n <FixedBody />\n <StyledDialogContainer\n role=\"dialog\"\n aria-modal\n ref={containerRef}\n tabIndex={!removeAutoFocus ? 0 : undefined}\n onKeyDown={handleOnKeyDown}\n {...getSpaceProps(rest)}\n size={size}\n centered={centered}\n >\n {children}\n </StyledDialogContainer>\n </StyledDialogBackground>,\n document.getElementsByTagName('body')[0],\n );\n }\n\n return null;\n};\n\nDSDialog.propTypes = propTypes;\n\nconst DSDialogWithSchema = describe(DSDialog);\nDSDialogWithSchema.propTypes = propTypes;\n\nexport { DSDialog, DSDialogWithSchema };\n"],"names":["DSDialog","props","propsWithDefault","useMemoMergePropsWithDefault","defaultProps","useValidateTypescriptPropTypes","DSDialogWithSchema","toTypescript","children","isOpen","onClickOutside","centered","size","removeAutoFocus","rest","containerRef","useRef","handleOutsideClick","useCallback","e","target","dataset","portalbg","handleOnKeyDown","key","useEffect","current","focus","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Q,CAACC,YAAT,eACL,oBAAC,sBAAD;MAAwB,OAAO,EAAEZ,kBAAjC;MAAqD;oBACnD,oBAAC,SAAD,OADF,eAEE,oBAAC,qBAAD;MACE,IAAI,EAAC,QADP;MAEE,kBAFF;MAGE,GAAG,EAAEF,YAHP;MAIE,QAAQ,EAAE,CAACF,eAAD,GAAmB,CAAnB,GAAuBiB,SAJnC;MAKE,SAAS,EAAEP;OACPQ,aAAa,CAACjB,IAAD,CANnB;MAOE,IAAI,EAAEF,IAPR;MAQE,QAAQ,EAAED;QAETH,QAVH,CAFF,CADK,EAgBLwB,QAAQ,CAACC,oBAAT,CAA8B,MAA9B,EAAsC,CAAtC,CAhBK,CAAP;;;EAoBF,OAAO,IAAP;AACD;;AAEDjC,QAAQ,CAACkC,SAAT,GAAqBA,SAArB;IAEM5B,kBAAkB,GAAG6B,QAAQ,CAACnC,QAAD;AACnCM,kBAAkB,CAAC4B,SAAnB,GAA+BA,SAA/B;;;;"}
|
package/esm/defaultProps.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultProps.js","sources":["../../src/defaultProps.tsx"],"sourcesContent":["import type { DSDialogPropsT } from './types/index.d';\n\nexport const defaultProps: Partial<DSDialogPropsT> = {\n isOpen: false,\n centered: false,\n size: 'default',\n removeAutoFocus: false,\n onClickOutside: () => {},\n};\n"],"names":["defaultProps","isOpen","centered","size","removeAutoFocus","onClickOutside"],"mappings":"IAEaA,YAAqC,GAAG;
|
|
1
|
+
{"version":3,"file":"defaultProps.js","sources":["../../src/defaultProps.tsx"],"sourcesContent":["import type { DSDialogPropsT } from './types/index.d';\n\nexport const defaultProps: Partial<DSDialogPropsT> = {\n isOpen: false,\n centered: false,\n size: 'default',\n removeAutoFocus: false,\n onClickOutside: () => {},\n};\n"],"names":["defaultProps","isOpen","centered","size","removeAutoFocus","onClickOutside"],"mappings":"IAEaA,YAAqC,GAAG;EACnDC,MAAM,EAAE,KAD2C;EAEnDC,QAAQ,EAAE,KAFyC;EAGnDC,IAAI,EAAE,SAH6C;EAInDC,eAAe,EAAE,KAJkC;EAKnDC,cAAc,EAAE,0BAAM;AAL6B;;;;"}
|
package/esm/propTypes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propTypes.js","sources":["../../src/propTypes.tsx"],"sourcesContent":["/* eslint-disable max-len */\nimport { PropTypes } from 'react-desc';\n\nexport const propTypes = {\n isOpen: PropTypes.bool.description('Wether the Dialog is open or not.').defaultValue(false),\n children: PropTypes.node.description('Nested components.').isRequired,\n centered: PropTypes.bool.description('Centers the Dialog.').defaultValue(false),\n removeAutoFocus: PropTypes.bool\n .description(\n 'Removes focus in the Dialog container when is open. If you want to focus an specific element in the Dialog, it should be set to true.',\n )\n .defaultValue(false),\n onClickOutside: PropTypes.func\n .description(\n 'Callback that should be used to close the modal when the user clicks outside. Cb also triggers when the user press ESC key for accessibility purposes.',\n )\n .defaultValue(() => {}),\n};\n"],"names":["propTypes","isOpen","PropTypes","bool","description","defaultValue","children","node","isRequired","centered","removeAutoFocus","onClickOutside","func"],"mappings":";;AAAA;IAGaA,SAAS,GAAG;
|
|
1
|
+
{"version":3,"file":"propTypes.js","sources":["../../src/propTypes.tsx"],"sourcesContent":["/* eslint-disable max-len */\nimport { PropTypes } from 'react-desc';\n\nexport const propTypes = {\n isOpen: PropTypes.bool.description('Wether the Dialog is open or not.').defaultValue(false),\n children: PropTypes.node.description('Nested components.').isRequired,\n centered: PropTypes.bool.description('Centers the Dialog.').defaultValue(false),\n removeAutoFocus: PropTypes.bool\n .description(\n 'Removes focus in the Dialog container when is open. If you want to focus an specific element in the Dialog, it should be set to true.',\n )\n .defaultValue(false),\n onClickOutside: PropTypes.func\n .description(\n 'Callback that should be used to close the modal when the user clicks outside. Cb also triggers when the user press ESC key for accessibility purposes.',\n )\n .defaultValue(() => {}),\n};\n"],"names":["propTypes","isOpen","PropTypes","bool","description","defaultValue","children","node","isRequired","centered","removeAutoFocus","onClickOutside","func"],"mappings":";;AAAA;IAGaA,SAAS,GAAG;EACvBC,MAAM,EAAEC,SAAS,CAACC,IAAV,CAAeC,WAAf,CAA2B,mCAA3B,EAAgEC,YAAhE,CAA6E,KAA7E,CADe;EAEvBC,QAAQ,EAAEJ,SAAS,CAACK,IAAV,CAAeH,WAAf,CAA2B,oBAA3B,EAAiDI,UAFpC;EAGvBC,QAAQ,EAAEP,SAAS,CAACC,IAAV,CAAeC,WAAf,CAA2B,qBAA3B,EAAkDC,YAAlD,CAA+D,KAA/D,CAHa;EAIvBK,eAAe,EAAER,SAAS,CAACC,IAAV,CACdC,WADc,CAEb,uIAFa,EAIdC,YAJc,CAID,KAJC,CAJM;EASvBM,cAAc,EAAET,SAAS,CAACU,IAAV,CACbR,WADa,CAEZ,wJAFY,EAIbC,YAJa,CAIA,YAAM,EAJN;AATO;;;;"}
|
package/esm/styles.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../src/styles.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport { createGlobalStyle } from '@elliemae/ds-system';\nimport { space, flexbox, layout } from 'styled-system';\nimport type { StyledDialogContainerT } from './types/index.d';\n\nconst allSizes = {\n default: '576px',\n small: '320px',\n medium: '656px',\n large: '848px',\n 'x-large': '1042px',\n 'xx-large': '1440px',\n};\n\nexport const FixedBody = createGlobalStyle`\n body {\n overflow: hidden;\n }\n`;\n\nexport const StyledDialogBackground = styled.div`\n position: fixed;\n top: 0;\n bottom: 0;\n width: 100%;\n height: 100%;\n background: rgba(37, 41, 47, 50%);\n overflow-y: auto;\n`;\n\nexport const StyledDialogContainer = styled.div<StyledDialogContainerT>`\n height: fit-content;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n margin: ${({ centered }) => (centered ? 'auto' : '20vh auto auto auto')};\n width: ${({ size }) => allSizes[size]};\n min-width: 300px;\n box-shadow: 0 10px 20px 0 ${({ theme }) => theme.colors.neutral[500]};\n background: ${({ theme }) => theme.colors.neutral['000']};\n overflow-y: scroll;\n ${space}\n &:focus {\n outline: none;\n }\n`;\n\nexport const DSDialogTitle = styled.h3`\n font-size: ${({ theme }) => theme.fontSizes.title[700]};\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n margin: 0;\n`;\n\nexport const DSDialogAddon = styled.div``;\n\nexport const DSDialogHeader = styled.div`\n display: grid;\n align-items: center;\n grid-auto-flow: column;\n min-height: ${({ theme }) => theme.space.m};\n padding: 10px ${({ theme }) => theme.space.xs};\n & ${DSDialogTitle} + ${DSDialogAddon} {\n align-self: flex-start;\n justify-self: flex-end;\n }\n & ${DSDialogAddon}:only-child {\n justify-self: flex-end;\n }\n ${space}\n`;\n\nexport const DSDialogSeparator = styled.hr.attrs(() => ({ 'aria-hidden': true }))`\n margin: 0;\n border-top: 1px solid ${({ theme }) => theme.colors.neutral['080']};\n`;\n\nexport const DSDialogBody = styled.div`\n padding: ${({ theme }) => theme.space.xs};\n overflow-y: auto;\n ${layout}\n ${space}\n ${flexbox}\n`;\n\nexport const DSDialogPrimaryMessage = styled.h3`\n margin: 0;\n`;\n\nexport const DSDialogSecondaryMessage = styled.p`\n margin: 0;\n color: ${({ theme }) => theme.colors.neutral[500]};\n`;\n\nexport const DSDialogDefaultLayout = styled.div`\n display: grid;\n grid-auto-flow: row;\n justify-items: center;\n align-items: center;\n grid-gap: ${({ theme }) => theme.space.xxs};\n\n ${DSDialogSecondaryMessage} {\n text-align: center;\n }\n`;\n\nexport const DSDialogFooter = styled.div`\n display: grid;\n grid-auto-flow: column;\n align-items: center;\n justify-content: flex-end;\n grid-gap: ${({ theme }) => theme.space.xxs};\n min-height: ${({ theme }) => theme.space.m};\n padding: 0 ${({ theme }) => theme.space.xs};\n ${space}\n ${flexbox}\n`;\n"],"names":["allSizes","default","small","medium","large","FixedBody","createGlobalStyle","StyledDialogBackground","styled","div","StyledDialogContainer","centered","size","theme","colors","neutral","space","DSDialogTitle","h3","fontSizes","title","DSDialogAddon","DSDialogHeader","m","xs","DSDialogSeparator","hr","attrs","DSDialogBody","layout","flexbox","DSDialogPrimaryMessage","DSDialogSecondaryMessage","p","DSDialogDefaultLayout","xxs","DSDialogFooter"],"mappings":";;;;;;AAKA,IAAMA,QAAQ,GAAG;
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../src/styles.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport { createGlobalStyle } from '@elliemae/ds-system';\nimport { space, flexbox, layout } from 'styled-system';\nimport type { StyledDialogContainerT } from './types/index.d';\n\nconst allSizes = {\n default: '576px',\n small: '320px',\n medium: '656px',\n large: '848px',\n 'x-large': '1042px',\n 'xx-large': '1440px',\n};\n\nexport const FixedBody = createGlobalStyle`\n body {\n overflow: hidden;\n }\n`;\n\nexport const StyledDialogBackground = styled.div`\n position: fixed;\n top: 0;\n bottom: 0;\n width: 100%;\n height: 100%;\n background: rgba(37, 41, 47, 50%);\n overflow-y: auto;\n`;\n\nexport const StyledDialogContainer = styled.div<StyledDialogContainerT>`\n height: fit-content;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n margin: ${({ centered }) => (centered ? 'auto' : '20vh auto auto auto')};\n width: ${({ size }) => allSizes[size]};\n min-width: 300px;\n box-shadow: 0 10px 20px 0 ${({ theme }) => theme.colors.neutral[500]};\n background: ${({ theme }) => theme.colors.neutral['000']};\n overflow-y: scroll;\n ${space}\n &:focus {\n outline: none;\n }\n`;\n\nexport const DSDialogTitle = styled.h3`\n font-size: ${({ theme }) => theme.fontSizes.title[700]};\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n margin: 0;\n`;\n\nexport const DSDialogAddon = styled.div``;\n\nexport const DSDialogHeader = styled.div`\n display: grid;\n align-items: center;\n grid-auto-flow: column;\n min-height: ${({ theme }) => theme.space.m};\n padding: 10px ${({ theme }) => theme.space.xs};\n & ${DSDialogTitle} + ${DSDialogAddon} {\n align-self: flex-start;\n justify-self: flex-end;\n }\n & ${DSDialogAddon}:only-child {\n justify-self: flex-end;\n }\n ${space}\n`;\n\nexport const DSDialogSeparator = styled.hr.attrs(() => ({ 'aria-hidden': true }))`\n margin: 0;\n border-top: 1px solid ${({ theme }) => theme.colors.neutral['080']};\n`;\n\nexport const DSDialogBody = styled.div`\n padding: ${({ theme }) => theme.space.xs};\n overflow-y: auto;\n ${layout}\n ${space}\n ${flexbox}\n`;\n\nexport const DSDialogPrimaryMessage = styled.h3`\n margin: 0;\n`;\n\nexport const DSDialogSecondaryMessage = styled.p`\n margin: 0;\n color: ${({ theme }) => theme.colors.neutral[500]};\n`;\n\nexport const DSDialogDefaultLayout = styled.div`\n display: grid;\n grid-auto-flow: row;\n justify-items: center;\n align-items: center;\n grid-gap: ${({ theme }) => theme.space.xxs};\n\n ${DSDialogSecondaryMessage} {\n text-align: center;\n }\n`;\n\nexport const DSDialogFooter = styled.div`\n display: grid;\n grid-auto-flow: column;\n align-items: center;\n justify-content: flex-end;\n grid-gap: ${({ theme }) => theme.space.xxs};\n min-height: ${({ theme }) => theme.space.m};\n padding: 0 ${({ theme }) => theme.space.xs};\n ${space}\n ${flexbox}\n`;\n"],"names":["allSizes","default","small","medium","large","FixedBody","createGlobalStyle","StyledDialogBackground","styled","div","StyledDialogContainer","centered","size","theme","colors","neutral","space","DSDialogTitle","h3","fontSizes","title","DSDialogAddon","DSDialogHeader","m","xs","DSDialogSeparator","hr","attrs","DSDialogBody","layout","flexbox","DSDialogPrimaryMessage","DSDialogSecondaryMessage","p","DSDialogDefaultLayout","xxs","DSDialogFooter"],"mappings":";;;;;;AAKA,IAAMA,QAAQ,GAAG;EACfC,OAAO,EAAE,OADM;EAEfC,KAAK,EAAE,OAFQ;EAGfC,MAAM,EAAE,OAHO;EAIfC,KAAK,EAAE,OAJQ;EAKf,WAAW,QALI;EAMf,YAAY;AANG,CAAjB;IASaC,SAAS,GAAGC,iBAAH;IAMTC,sBAAsB,gB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OAAeA,KAAK,CAACC,MAAN,CAAaC,OAAb,CAAqB,KAArB,CAAf;AAAA,CAFI;IAKjBa,YAAY,gBAAGpB,MAAM,CAACC,GAAV;EAAA;AAAA,oDACZ;EAAA,IAAGI,KAAH,SAAGA,KAAH;EAAA,OAAeA,KAAK,CAACG,KAAN,CAAYQ,EAA3B;AAAA,CADY,EAGrBK,MAHqB,EAIrBb,KAJqB,EAKrBc,OALqB;IAQZC,sBAAsB,gBAAGvB,MAAM,CAACU,EAAV;EAAA;AAAA;IAItBc,wBAAwB,gBAAGxB,MAAM,CAACyB,CAAV;EAAA;AAAA,6BAE1B;EAAA,IAAGpB,KAAH,UAAGA,KAAH;EAAA,OAAeA,KAAK,CAACC,MAAN,CAAaC,OAAb,CAAqB,GAArB,CAAf;AAAA,CAF0B;IAKxBmB,qBAAqB,gBAAG1B,MAAM,CAACC,GAAV;EAAA;AAAA,uHAKpB;EAAA,IAAGI,KAAH,UAAGA,KAAH;EAAA,OAAeA,KAAK,CAACG,KAAN,CAAYmB,GAA3B;AAAA,CALoB,EAO9BH,wBAP8B;IAYrBI,cAAc,gBAAG5B,MAAM,CAACC,GAAV;EAAA;AAAA,8IAKb;EAAA,IAAGI,KAAH,UAAGA,KAAH;EAAA,OAAeA,KAAK,CAACG,KAAN,CAAYmB,GAA3B;AAAA,CALa,EAMX;EAAA,IAAGtB,KAAH,UAAGA,KAAH;EAAA,OAAeA,KAAK,CAACG,KAAN,CAAYO,CAA3B;AAAA,CANW,EAOZ;EAAA,IAAGV,KAAH,UAAGA,KAAH;EAAA,OAAeA,KAAK,CAACG,KAAN,CAAYQ,EAA3B;AAAA,CAPY,EAQvBR,KARuB,EASvBc,OATuB;;;;"}
|
package/esm/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../src/utils.tsx"],"sourcesContent":["import type { GetSpaceArgsT } from './types/index.d';\n\nexport const getSpaceProps = (props: GetSpaceArgsT): GetSpaceArgsT =>\n Object.fromEntries(Object.entries(props).filter(([key]) => /^[pm][xytblr]?$/.exec(key)));\n"],"names":["getSpaceProps","props","Object","fromEntries","entries","filter","key","exec"],"mappings":";;IAEaA,aAAa,GAAG,SAAhBA,aAAgB,CAACC,KAAD;
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../src/utils.tsx"],"sourcesContent":["import type { GetSpaceArgsT } from './types/index.d';\n\nexport const getSpaceProps = (props: GetSpaceArgsT): GetSpaceArgsT =>\n Object.fromEntries(Object.entries(props).filter(([key]) => /^[pm][xytblr]?$/.exec(key)));\n"],"names":["getSpaceProps","props","Object","fromEntries","entries","filter","key","exec"],"mappings":";;IAEaA,aAAa,GAAG,SAAhBA,aAAgB,CAACC,KAAD;EAAA,OAC3BC,MAAM,CAACC,WAAP,CAAmBD,MAAM,CAACE,OAAP,CAAeH,KAAf,EAAsBI,MAAtB,CAA6B;IAAA;QAAEC,GAAF;;IAAA,OAAW,kBAAkBC,IAAlB,CAAuBD,GAAvB,CAAX;GAA7B,CAAnB,CAD2B;AAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-dialog",
|
|
3
|
-
"version": "1.61.
|
|
3
|
+
"version": "1.61.13",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Ellie Mae - Dim Sum - Dialog",
|
|
6
6
|
"main": "cjs/index.js",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"build": "node ../../scripts/build/build.js"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@elliemae/ds-props-helpers": "1.61.
|
|
20
|
-
"@elliemae/ds-system": "1.61.
|
|
19
|
+
"@elliemae/ds-props-helpers": "1.61.13",
|
|
20
|
+
"@elliemae/ds-system": "1.61.13",
|
|
21
21
|
"styled-system": "~5.1.5"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|