@elliemae/ds-dialog 3.33.0-next.3 → 3.33.0-next.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/cjs/DSDialog.js +2 -2
  2. package/dist/cjs/DSDialog.js.map +2 -2
  3. package/dist/cjs/config/useDialog.js +3 -3
  4. package/dist/cjs/config/useDialog.js.map +2 -2
  5. package/dist/cjs/index.js.map +1 -1
  6. package/dist/cjs/{propTypes.js → react-desc-prop-types.js} +5 -6
  7. package/dist/cjs/react-desc-prop-types.js.map +7 -0
  8. package/dist/cjs/sharedTypes.js.map +1 -1
  9. package/dist/cjs/styles.js.map +1 -1
  10. package/dist/cjs/typescript-testing/typescript-dialog-valid.js +128 -0
  11. package/dist/cjs/typescript-testing/typescript-dialog-valid.js.map +7 -0
  12. package/dist/esm/DSDialog.js +1 -1
  13. package/dist/esm/DSDialog.js.map +1 -1
  14. package/dist/esm/config/useDialog.js +1 -1
  15. package/dist/esm/config/useDialog.js.map +2 -2
  16. package/dist/esm/index.js.map +1 -1
  17. package/dist/esm/{propTypes.js → react-desc-prop-types.js} +2 -3
  18. package/dist/esm/react-desc-prop-types.js.map +7 -0
  19. package/dist/esm/styles.js.map +1 -1
  20. package/dist/esm/typescript-testing/typescript-dialog-valid.js +105 -0
  21. package/dist/esm/typescript-testing/typescript-dialog-valid.js.map +7 -0
  22. package/dist/types/DSDialog.d.ts +1 -2
  23. package/dist/types/config/useDialog.d.ts +1 -1
  24. package/dist/types/index.d.ts +1 -0
  25. package/dist/types/parts/DSDialogPortal.d.ts +0 -1
  26. package/dist/types/{propTypes.d.ts → react-desc-prop-types.d.ts} +5 -5
  27. package/dist/types/sharedTypes.d.ts +1 -1
  28. package/dist/types/styles.d.ts +1 -1
  29. package/dist/types/typescript-testing/typescript-dialog-valid.d.ts +1 -0
  30. package/package.json +8 -8
  31. package/dist/cjs/propTypes.js.map +0 -7
  32. package/dist/esm/propTypes.js.map +0 -7
@@ -35,7 +35,7 @@ module.exports = __toCommonJS(DSDialog_exports);
35
35
  var React = __toESM(require("react"));
36
36
  var import_jsx_runtime = require("react/jsx-runtime");
37
37
  var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
38
- var import_propTypes = require("./propTypes.js");
38
+ var import_react_desc_prop_types = require("./react-desc-prop-types.js");
39
39
  var import_useDialog = require("./config/useDialog.js");
40
40
  var import_DSDialogPortal = require("./parts/DSDialogPortal.js");
41
41
  var import_DSDialogCTX = require("./DSDialogCTX.js");
@@ -45,5 +45,5 @@ const DSDialog = (props) => {
45
45
  };
46
46
  DSDialog.displayName = "DSDialog";
47
47
  const DSDialogWithSchema = (0, import_ds_props_helpers.describe)(DSDialog);
48
- DSDialogWithSchema.propTypes = import_propTypes.propTypes;
48
+ DSDialogWithSchema.propTypes = import_react_desc_prop_types.propTypes;
49
49
  //# sourceMappingURL=DSDialog.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/DSDialog.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import type { WeakValidationMap } from 'react';\nimport React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { propTypes } from './propTypes.js';\nimport { useDialog } from './config/useDialog.js';\nimport { DSDialogPortal } from './parts/DSDialogPortal.js';\nimport { DSDialogContext } from './DSDialogCTX.js';\nimport type { DSDialogT } from './propTypes.js';\n\nconst DSDialog = (props: DSDialogT.Props): JSX.Element => {\n const ctx = useDialog(props);\n\n return (\n <DSDialogContext.Provider value={ctx}>\n <DSDialogPortal />\n </DSDialogContext.Provider>\n );\n};\nDSDialog.displayName = 'DSDialog';\nconst DSDialogWithSchema = describe(DSDialog);\nDSDialogWithSchema.propTypes = propTypes as WeakValidationMap<unknown>;\n\nexport { DSDialog, DSDialogWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADcjB;AAZN,8BAAyB;AACzB,uBAA0B;AAC1B,uBAA0B;AAC1B,4BAA+B;AAC/B,yBAAgC;AAGhC,MAAM,WAAW,CAAC,UAAwC;AACxD,QAAM,UAAM,4BAAU,KAAK;AAE3B,SACE,4CAAC,mCAAgB,UAAhB,EAAyB,OAAO,KAC/B,sDAAC,wCAAe,GAClB;AAEJ;AACA,SAAS,cAAc;AACvB,MAAM,yBAAqB,kCAAS,QAAQ;AAC5C,mBAAmB,YAAY;",
4
+ "sourcesContent": ["import type { WeakValidationMap } from 'react';\nimport React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { propTypes } from './react-desc-prop-types.js';\nimport { useDialog } from './config/useDialog.js';\nimport { DSDialogPortal } from './parts/DSDialogPortal.js';\nimport { DSDialogContext } from './DSDialogCTX.js';\nimport type { DSDialogT } from './react-desc-prop-types.js';\n\nconst DSDialog = (props: DSDialogT.Props): JSX.Element => {\n const ctx = useDialog(props);\n\n return (\n <DSDialogContext.Provider value={ctx}>\n <DSDialogPortal />\n </DSDialogContext.Provider>\n );\n};\nDSDialog.displayName = 'DSDialog';\nconst DSDialogWithSchema = describe(DSDialog);\nDSDialogWithSchema.propTypes = propTypes as WeakValidationMap<unknown>;\n\nexport { DSDialog, DSDialogWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADcjB;AAZN,8BAAyB;AACzB,mCAA0B;AAC1B,uBAA0B;AAC1B,4BAA+B;AAC/B,yBAAgC;AAGhC,MAAM,WAAW,CAAC,UAAwC;AACxD,QAAM,UAAM,4BAAU,KAAK;AAE3B,SACE,4CAAC,mCAAgB,UAAhB,EAAyB,OAAO,KAC/B,sDAAC,wCAAe,GAClB;AAEJ;AACA,SAAS,cAAc;AACvB,MAAM,yBAAqB,kCAAS,QAAQ;AAC5C,mBAAmB,YAAY;",
6
6
  "names": []
7
7
  }
@@ -36,11 +36,11 @@ var import_react = require("react");
36
36
  var import_lodash = require("lodash");
37
37
  var import_uid = require("uid");
38
38
  var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
39
- var import_propTypes = require("../propTypes.js");
39
+ var import_react_desc_prop_types = require("../react-desc-prop-types.js");
40
40
  var import_utils = require("../utils.js");
41
41
  const useDialog = (props) => {
42
- (0, import_ds_props_helpers.useValidateTypescriptPropTypes)(props, import_propTypes.propTypes, "DSDialog");
43
- const propsWithDefault = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(props, import_propTypes.defaultProps);
42
+ (0, import_ds_props_helpers.useValidateTypescriptPropTypes)(props, import_react_desc_prop_types.propTypes, "DSDialog");
43
+ const propsWithDefault = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(props, import_react_desc_prop_types.defaultProps);
44
44
  const { portalRef, isOpen } = propsWithDefault;
45
45
  const actualPortalRef = (0, import_react.useRef)(null);
46
46
  const containerRef = (0, import_react.useRef)(null);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/config/useDialog.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { useEffect, useMemo, useState, useCallback, useRef, useLayoutEffect } from 'react';\nimport { debounce } from 'lodash';\nimport { uid } from 'uid';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { propTypes, defaultProps } from '../propTypes.js';\nimport { getScrollbarWidth, getCurrentRightPadding } from '../utils.js';\nimport type { DSDialogT } from '../propTypes.js';\nimport type { DSDialogInternalsT } from '../sharedTypes.js';\n\nexport const useDialog = (props: DSDialogT.Props): DSDialogInternalsT.DSDialogContext => {\n useValidateTypescriptPropTypes<DSDialogT.Props>(props, propTypes, 'DSDialog');\n const propsWithDefault = useMemoMergePropsWithDefault<DSDialogT.InternalProps>(props, defaultProps);\n const { portalRef, isOpen } = propsWithDefault;\n\n const actualPortalRef = useRef<HTMLElement | null>(null);\n const containerRef = useRef<HTMLDivElement | null>(null);\n\n const [portalInfo, setPortalInfo] = useState<DSDialogInternalsT.PortalInfo>({\n paddingRight: '0px',\n scrollbarWidth: '0px',\n });\n\n const portalClassName = useMemo(() => `ds-dialog-${uid(8)}`, []);\n\n useEffect(() => {\n if (portalRef) actualPortalRef.current = portalRef.current;\n else actualPortalRef.current = document.getElementsByTagName('body')['0'];\n }, [portalRef]);\n\n useLayoutEffect(() => {\n if (actualPortalRef.current) {\n if (isOpen) {\n actualPortalRef.current.classList.add(portalClassName);\n } else {\n actualPortalRef.current.classList.remove(portalClassName);\n }\n }\n }, [actualPortalRef, isOpen, portalClassName]);\n\n useEffect(() => {\n if (actualPortalRef.current) {\n setPortalInfo((prev) => ({\n ...prev,\n paddingRight: getCurrentRightPadding(actualPortalRef.current as HTMLElement),\n }));\n }\n }, []);\n\n const calculateScrollbar = useCallback(() => {\n if (actualPortalRef.current && !isOpen) {\n setPortalInfo((prev) => ({\n ...prev,\n scrollbarWidth: getScrollbarWidth(actualPortalRef.current as HTMLElement),\n }));\n }\n }, [isOpen]);\n\n const debouncedCalculateScrollbar = useMemo(() => debounce(calculateScrollbar, 300), [calculateScrollbar]);\n\n useEffect(() => {\n window.addEventListener('resize', debouncedCalculateScrollbar);\n return () => {\n window.removeEventListener('resize', debouncedCalculateScrollbar);\n };\n }, [calculateScrollbar, debouncedCalculateScrollbar]);\n\n useEffect(() => {\n calculateScrollbar();\n }, [calculateScrollbar, isOpen]);\n\n const ctx = useMemo(\n () => ({\n props: propsWithDefault,\n actualPortalRef,\n containerRef,\n portalInfo,\n portalClassName,\n }),\n [portalClassName, portalInfo, propsWithDefault],\n );\n\n return ctx;\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAmF;AACnF,oBAAyB;AACzB,iBAAoB;AACpB,8BAA6E;AAC7E,uBAAwC;AACxC,mBAA0D;AAInD,MAAM,YAAY,CAAC,UAA+D;AACvF,8DAAgD,OAAO,4BAAW,UAAU;AAC5E,QAAM,uBAAmB,sDAAsD,OAAO,6BAAY;AAClG,QAAM,EAAE,WAAW,OAAO,IAAI;AAE9B,QAAM,sBAAkB,qBAA2B,IAAI;AACvD,QAAM,mBAAe,qBAA8B,IAAI;AAEvD,QAAM,CAAC,YAAY,aAAa,QAAI,uBAAwC;AAAA,IAC1E,cAAc;AAAA,IACd,gBAAgB;AAAA,EAClB,CAAC;AAED,QAAM,sBAAkB,sBAAQ,MAAM,iBAAa,gBAAI,CAAC,KAAK,CAAC,CAAC;AAE/D,8BAAU,MAAM;AACd,QAAI;AAAW,sBAAgB,UAAU,UAAU;AAAA;AAC9C,sBAAgB,UAAU,SAAS,qBAAqB,MAAM,EAAE,GAAG;AAAA,EAC1E,GAAG,CAAC,SAAS,CAAC;AAEd,oCAAgB,MAAM;AACpB,QAAI,gBAAgB,SAAS;AAC3B,UAAI,QAAQ;AACV,wBAAgB,QAAQ,UAAU,IAAI,eAAe;AAAA,MACvD,OAAO;AACL,wBAAgB,QAAQ,UAAU,OAAO,eAAe;AAAA,MAC1D;AAAA,IACF;AAAA,EACF,GAAG,CAAC,iBAAiB,QAAQ,eAAe,CAAC;AAE7C,8BAAU,MAAM;AACd,QAAI,gBAAgB,SAAS;AAC3B,oBAAc,CAAC,UAAU;AAAA,QACvB,GAAG;AAAA,QACH,kBAAc,qCAAuB,gBAAgB,OAAsB;AAAA,MAC7E,EAAE;AAAA,IACJ;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,QAAM,yBAAqB,0BAAY,MAAM;AAC3C,QAAI,gBAAgB,WAAW,CAAC,QAAQ;AACtC,oBAAc,CAAC,UAAU;AAAA,QACvB,GAAG;AAAA,QACH,oBAAgB,gCAAkB,gBAAgB,OAAsB;AAAA,MAC1E,EAAE;AAAA,IACJ;AAAA,EACF,GAAG,CAAC,MAAM,CAAC;AAEX,QAAM,kCAA8B,sBAAQ,UAAM,wBAAS,oBAAoB,GAAG,GAAG,CAAC,kBAAkB,CAAC;AAEzG,8BAAU,MAAM;AACd,WAAO,iBAAiB,UAAU,2BAA2B;AAC7D,WAAO,MAAM;AACX,aAAO,oBAAoB,UAAU,2BAA2B;AAAA,IAClE;AAAA,EACF,GAAG,CAAC,oBAAoB,2BAA2B,CAAC;AAEpD,8BAAU,MAAM;AACd,uBAAmB;AAAA,EACrB,GAAG,CAAC,oBAAoB,MAAM,CAAC;AAE/B,QAAM,UAAM;AAAA,IACV,OAAO;AAAA,MACL,OAAO;AAAA,MACP;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,iBAAiB,YAAY,gBAAgB;AAAA,EAChD;AAEA,SAAO;AACT;",
4
+ "sourcesContent": ["import { useEffect, useMemo, useState, useCallback, useRef, useLayoutEffect } from 'react';\nimport { debounce } from 'lodash';\nimport { uid } from 'uid';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { defaultProps, propTypes } from '../react-desc-prop-types.js';\nimport { getScrollbarWidth, getCurrentRightPadding } from '../utils.js';\nimport type { DSDialogT } from '../react-desc-prop-types.js';\nimport type { DSDialogInternalsT } from '../sharedTypes.js';\n\nexport const useDialog = (props: DSDialogT.Props): DSDialogInternalsT.DSDialogContext => {\n useValidateTypescriptPropTypes<DSDialogT.Props>(props, propTypes, 'DSDialog');\n const propsWithDefault = useMemoMergePropsWithDefault<DSDialogT.InternalProps>(props, defaultProps);\n const { portalRef, isOpen } = propsWithDefault;\n\n const actualPortalRef = useRef<HTMLElement | null>(null);\n const containerRef = useRef<HTMLDivElement | null>(null);\n\n const [portalInfo, setPortalInfo] = useState<DSDialogInternalsT.PortalInfo>({\n paddingRight: '0px',\n scrollbarWidth: '0px',\n });\n\n const portalClassName = useMemo(() => `ds-dialog-${uid(8)}`, []);\n\n useEffect(() => {\n if (portalRef) actualPortalRef.current = portalRef.current;\n else actualPortalRef.current = document.getElementsByTagName('body')['0'];\n }, [portalRef]);\n\n useLayoutEffect(() => {\n if (actualPortalRef.current) {\n if (isOpen) {\n actualPortalRef.current.classList.add(portalClassName);\n } else {\n actualPortalRef.current.classList.remove(portalClassName);\n }\n }\n }, [actualPortalRef, isOpen, portalClassName]);\n\n useEffect(() => {\n if (actualPortalRef.current) {\n setPortalInfo((prev) => ({\n ...prev,\n paddingRight: getCurrentRightPadding(actualPortalRef.current as HTMLElement),\n }));\n }\n }, []);\n\n const calculateScrollbar = useCallback(() => {\n if (actualPortalRef.current && !isOpen) {\n setPortalInfo((prev) => ({\n ...prev,\n scrollbarWidth: getScrollbarWidth(actualPortalRef.current as HTMLElement),\n }));\n }\n }, [isOpen]);\n\n const debouncedCalculateScrollbar = useMemo(() => debounce(calculateScrollbar, 300), [calculateScrollbar]);\n\n useEffect(() => {\n window.addEventListener('resize', debouncedCalculateScrollbar);\n return () => {\n window.removeEventListener('resize', debouncedCalculateScrollbar);\n };\n }, [calculateScrollbar, debouncedCalculateScrollbar]);\n\n useEffect(() => {\n calculateScrollbar();\n }, [calculateScrollbar, isOpen]);\n\n const ctx = useMemo(\n () => ({\n props: propsWithDefault,\n actualPortalRef,\n containerRef,\n portalInfo,\n portalClassName,\n }),\n [portalClassName, portalInfo, propsWithDefault],\n );\n\n return ctx;\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAmF;AACnF,oBAAyB;AACzB,iBAAoB;AACpB,8BAA6E;AAC7E,mCAAwC;AACxC,mBAA0D;AAInD,MAAM,YAAY,CAAC,UAA+D;AACvF,8DAAgD,OAAO,wCAAW,UAAU;AAC5E,QAAM,uBAAmB,sDAAsD,OAAO,yCAAY;AAClG,QAAM,EAAE,WAAW,OAAO,IAAI;AAE9B,QAAM,sBAAkB,qBAA2B,IAAI;AACvD,QAAM,mBAAe,qBAA8B,IAAI;AAEvD,QAAM,CAAC,YAAY,aAAa,QAAI,uBAAwC;AAAA,IAC1E,cAAc;AAAA,IACd,gBAAgB;AAAA,EAClB,CAAC;AAED,QAAM,sBAAkB,sBAAQ,MAAM,iBAAa,gBAAI,CAAC,KAAK,CAAC,CAAC;AAE/D,8BAAU,MAAM;AACd,QAAI;AAAW,sBAAgB,UAAU,UAAU;AAAA;AAC9C,sBAAgB,UAAU,SAAS,qBAAqB,MAAM,EAAE,GAAG;AAAA,EAC1E,GAAG,CAAC,SAAS,CAAC;AAEd,oCAAgB,MAAM;AACpB,QAAI,gBAAgB,SAAS;AAC3B,UAAI,QAAQ;AACV,wBAAgB,QAAQ,UAAU,IAAI,eAAe;AAAA,MACvD,OAAO;AACL,wBAAgB,QAAQ,UAAU,OAAO,eAAe;AAAA,MAC1D;AAAA,IACF;AAAA,EACF,GAAG,CAAC,iBAAiB,QAAQ,eAAe,CAAC;AAE7C,8BAAU,MAAM;AACd,QAAI,gBAAgB,SAAS;AAC3B,oBAAc,CAAC,UAAU;AAAA,QACvB,GAAG;AAAA,QACH,kBAAc,qCAAuB,gBAAgB,OAAsB;AAAA,MAC7E,EAAE;AAAA,IACJ;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,QAAM,yBAAqB,0BAAY,MAAM;AAC3C,QAAI,gBAAgB,WAAW,CAAC,QAAQ;AACtC,oBAAc,CAAC,UAAU;AAAA,QACvB,GAAG;AAAA,QACH,oBAAgB,gCAAkB,gBAAgB,OAAsB;AAAA,MAC1E,EAAE;AAAA,IACJ;AAAA,EACF,GAAG,CAAC,MAAM,CAAC;AAEX,QAAM,kCAA8B,sBAAQ,UAAM,wBAAS,oBAAoB,GAAG,GAAG,CAAC,kBAAkB,CAAC;AAEzG,8BAAU,MAAM;AACd,WAAO,iBAAiB,UAAU,2BAA2B;AAC7D,WAAO,MAAM;AACX,aAAO,oBAAoB,UAAU,2BAA2B;AAAA,IAClE;AAAA,EACF,GAAG,CAAC,oBAAoB,2BAA2B,CAAC;AAEpD,8BAAU,MAAM;AACd,uBAAmB;AAAA,EACrB,GAAG,CAAC,oBAAoB,MAAM,CAAC;AAE/B,QAAM,UAAM;AAAA,IACV,OAAO;AAAA,MACL,OAAO;AAAA,MACP;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,iBAAiB,YAAY,gBAAgB;AAAA,EAChD;AAEA,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { describe, globalAttributesPropTypes } from '@elliemae/ds-props-helpers';\nimport {\n DSDialogBody,\n DSDialogHeader,\n DSDialogFooter,\n DSDialogSeparator,\n DSDialogTitle,\n DSDialogAddon,\n DSDialogDefaultLayout,\n DSDialogPrimaryMessage,\n DSDialogSecondaryMessage,\n} from './styles.js';\nimport type { WeakValidationMap } from 'react';\nimport type {} from '@xstyled/system';\nimport type {} from '@xstyled/util';\n\nDSDialogBody.displayName = 'DSDialogBody';\nDSDialogHeader.displayName = 'DSDialogHeader';\nDSDialogFooter.displayName = 'DSDialogFooter';\nDSDialogSeparator.displayName = 'DSDialogSeparator';\nDSDialogTitle.displayName = 'DSDialogTitle';\nDSDialogAddon.displayName = 'DSDialogAddon';\nDSDialogDefaultLayout.displayName = 'DSDialogDefaultLayout';\nDSDialogPrimaryMessage.displayName = 'DSDialogPrimaryMessage';\nDSDialogSecondaryMessage.displayName = 'DSDialogSecondaryMessage';\n\nconst DSDialogBodyWithSchema = describe(DSDialogBody as React.FC);\nconst DSDialogHeaderWithSchema = describe(DSDialogHeader as React.FC);\nconst DSDialogFooterWithSchema = describe(DSDialogFooter as React.FC);\nconst DSDialogSeparatorWithSchema = describe(DSDialogSeparator as React.FC);\nconst DSDialogTitleWithSchema = describe(DSDialogTitle as React.FC);\nconst DSDialogAddonWithSchema = describe(DSDialogAddon as React.FC);\nconst DSDialogDefaultLayoutWithSchema = describe(DSDialogDefaultLayout as React.FC);\nconst DSDialogPrimaryMessageWithSchema = describe(DSDialogPrimaryMessage as React.FC);\nconst DSDialogSecondaryMessageWithSchema = describe(DSDialogSecondaryMessage as React.FC);\n\nDSDialogBodyWithSchema.propTypes = globalAttributesPropTypes as WeakValidationMap<unknown>;\nDSDialogHeaderWithSchema.propTypes = globalAttributesPropTypes as WeakValidationMap<unknown>;\nDSDialogFooterWithSchema.propTypes = globalAttributesPropTypes as WeakValidationMap<unknown>;\nDSDialogSeparatorWithSchema.propTypes = globalAttributesPropTypes as WeakValidationMap<unknown>;\nDSDialogTitleWithSchema.propTypes = globalAttributesPropTypes as WeakValidationMap<unknown>;\nDSDialogAddonWithSchema.propTypes = globalAttributesPropTypes as WeakValidationMap<unknown>;\nDSDialogDefaultLayoutWithSchema.propTypes = globalAttributesPropTypes as WeakValidationMap<unknown>;\nDSDialogPrimaryMessageWithSchema.propTypes = globalAttributesPropTypes as WeakValidationMap<unknown>;\nDSDialogSecondaryMessageWithSchema.propTypes = globalAttributesPropTypes as WeakValidationMap<unknown>;\n\nexport * from './DSDialog.js';\nexport * from './DSDialogDatatestid.js';\nexport { DSDialogSizes } from './utils.js';\nexport {\n DSDialogBody,\n DSDialogHeader,\n DSDialogFooter,\n DSDialogSeparator,\n DSDialogTitle,\n DSDialogAddon,\n DSDialogDefaultLayout,\n DSDialogPrimaryMessage,\n DSDialogSecondaryMessage,\n DSDialogBodyWithSchema,\n DSDialogHeaderWithSchema,\n DSDialogFooterWithSchema,\n DSDialogSeparatorWithSchema,\n DSDialogTitleWithSchema,\n DSDialogAddonWithSchema,\n DSDialogDefaultLayoutWithSchema,\n DSDialogPrimaryMessageWithSchema,\n DSDialogSecondaryMessageWithSchema,\n};\n", "import * as React from 'react';\nexport { React };\n"],
4
+ "sourcesContent": ["import { describe, globalAttributesPropTypes } from '@elliemae/ds-props-helpers';\nimport {\n DSDialogBody,\n DSDialogHeader,\n DSDialogFooter,\n DSDialogSeparator,\n DSDialogTitle,\n DSDialogAddon,\n DSDialogDefaultLayout,\n DSDialogPrimaryMessage,\n DSDialogSecondaryMessage,\n} from './styles.js';\nimport type { WeakValidationMap } from 'react';\nimport type {} from '@xstyled/system';\nimport type {} from '@xstyled/util';\n\nDSDialogBody.displayName = 'DSDialogBody';\nDSDialogHeader.displayName = 'DSDialogHeader';\nDSDialogFooter.displayName = 'DSDialogFooter';\nDSDialogSeparator.displayName = 'DSDialogSeparator';\nDSDialogTitle.displayName = 'DSDialogTitle';\nDSDialogAddon.displayName = 'DSDialogAddon';\nDSDialogDefaultLayout.displayName = 'DSDialogDefaultLayout';\nDSDialogPrimaryMessage.displayName = 'DSDialogPrimaryMessage';\nDSDialogSecondaryMessage.displayName = 'DSDialogSecondaryMessage';\n\nconst DSDialogBodyWithSchema = describe(DSDialogBody as React.FC);\nconst DSDialogHeaderWithSchema = describe(DSDialogHeader as React.FC);\nconst DSDialogFooterWithSchema = describe(DSDialogFooter as React.FC);\nconst DSDialogSeparatorWithSchema = describe(DSDialogSeparator as React.FC);\nconst DSDialogTitleWithSchema = describe(DSDialogTitle as React.FC);\nconst DSDialogAddonWithSchema = describe(DSDialogAddon as React.FC);\nconst DSDialogDefaultLayoutWithSchema = describe(DSDialogDefaultLayout as React.FC);\nconst DSDialogPrimaryMessageWithSchema = describe(DSDialogPrimaryMessage as React.FC);\nconst DSDialogSecondaryMessageWithSchema = describe(DSDialogSecondaryMessage as React.FC);\n\nDSDialogBodyWithSchema.propTypes = globalAttributesPropTypes as WeakValidationMap<unknown>;\nDSDialogHeaderWithSchema.propTypes = globalAttributesPropTypes as WeakValidationMap<unknown>;\nDSDialogFooterWithSchema.propTypes = globalAttributesPropTypes as WeakValidationMap<unknown>;\nDSDialogSeparatorWithSchema.propTypes = globalAttributesPropTypes as WeakValidationMap<unknown>;\nDSDialogTitleWithSchema.propTypes = globalAttributesPropTypes as WeakValidationMap<unknown>;\nDSDialogAddonWithSchema.propTypes = globalAttributesPropTypes as WeakValidationMap<unknown>;\nDSDialogDefaultLayoutWithSchema.propTypes = globalAttributesPropTypes as WeakValidationMap<unknown>;\nDSDialogPrimaryMessageWithSchema.propTypes = globalAttributesPropTypes as WeakValidationMap<unknown>;\nDSDialogSecondaryMessageWithSchema.propTypes = globalAttributesPropTypes as WeakValidationMap<unknown>;\n\nexport * from './DSDialog.js';\nexport * from './DSDialogDatatestid.js';\nexport { DSDialogSizes } from './utils.js';\nexport {\n DSDialogBody,\n DSDialogHeader,\n DSDialogFooter,\n DSDialogSeparator,\n DSDialogTitle,\n DSDialogAddon,\n DSDialogDefaultLayout,\n DSDialogPrimaryMessage,\n DSDialogSecondaryMessage,\n DSDialogBodyWithSchema,\n DSDialogHeaderWithSchema,\n DSDialogFooterWithSchema,\n DSDialogSeparatorWithSchema,\n DSDialogTitleWithSchema,\n DSDialogAddonWithSchema,\n DSDialogDefaultLayoutWithSchema,\n DSDialogPrimaryMessageWithSchema,\n DSDialogSecondaryMessageWithSchema,\n};\nexport type { DSDialogT } from './react-desc-prop-types.js';\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAAoD;AACpD,oBAUO;AAmCP,wBAAc,0BA9Cd;AA+CA,wBAAc,oCA/Cd;AAgDA,mBAA8B;AAhC9B,2BAAa,cAAc;AAC3B,6BAAe,cAAc;AAC7B,6BAAe,cAAc;AAC7B,gCAAkB,cAAc;AAChC,4BAAc,cAAc;AAC5B,4BAAc,cAAc;AAC5B,oCAAsB,cAAc;AACpC,qCAAuB,cAAc;AACrC,uCAAyB,cAAc;AAEvC,MAAM,6BAAyB,kCAAS,0BAAwB;AAChE,MAAM,+BAA2B,kCAAS,4BAA0B;AACpE,MAAM,+BAA2B,kCAAS,4BAA0B;AACpE,MAAM,kCAA8B,kCAAS,+BAA6B;AAC1E,MAAM,8BAA0B,kCAAS,2BAAyB;AAClE,MAAM,8BAA0B,kCAAS,2BAAyB;AAClE,MAAM,sCAAkC,kCAAS,mCAAiC;AAClF,MAAM,uCAAmC,kCAAS,oCAAkC;AACpF,MAAM,yCAAqC,kCAAS,sCAAoC;AAExF,uBAAuB,YAAY;AACnC,yBAAyB,YAAY;AACrC,yBAAyB,YAAY;AACrC,4BAA4B,YAAY;AACxC,wBAAwB,YAAY;AACpC,wBAAwB,YAAY;AACpC,gCAAgC,YAAY;AAC5C,iCAAiC,YAAY;AAC7C,mCAAmC,YAAY;",
6
6
  "names": []
7
7
  }
@@ -26,12 +26,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var propTypes_exports = {};
30
- __export(propTypes_exports, {
29
+ var react_desc_prop_types_exports = {};
30
+ __export(react_desc_prop_types_exports, {
31
31
  defaultProps: () => defaultProps,
32
32
  propTypes: () => propTypes
33
33
  });
34
- module.exports = __toCommonJS(propTypes_exports);
34
+ module.exports = __toCommonJS(react_desc_prop_types_exports);
35
35
  var React = __toESM(require("react"));
36
36
  var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
37
37
  var import_utils = require("./utils.js");
@@ -44,8 +44,7 @@ const defaultProps = {
44
44
  onClickOutside: () => {
45
45
  },
46
46
  onClose: () => {
47
- },
48
- portalRef: null
47
+ }
49
48
  };
50
49
  const propTypes = {
51
50
  ...import_ds_props_helpers.globalAttributesPropTypes,
@@ -62,4 +61,4 @@ const propTypes = {
62
61
  size: import_ds_props_helpers.PropTypes.oneOf(import_utils.DSDialogSizesArrayValues).description(`Dialog's width size.`).defaultValue(import_utils.DSDialogSizes.DEFAULT),
63
62
  width: import_ds_props_helpers.PropTypes.string.description("Dialog width.")
64
63
  };
65
- //# sourceMappingURL=propTypes.js.map
64
+ //# sourceMappingURL=react-desc-prop-types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/react-desc-prop-types.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import type {} from '@elliemae/ds-utilities';\nimport type { GlobalAttributesT } from '@elliemae/ds-props-helpers';\nimport { globalAttributesPropTypes, PropTypes } from '@elliemae/ds-props-helpers';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport { DSDialogSizes, DSDialogSizesArrayValues } from './utils.js';\n\nexport declare namespace DSDialogT {\n export type Sizes = 'default' | 'small' | 'medium' | 'large' | 'x-large' | 'xx-large';\n\n export interface DefaultProps {\n isOpen: boolean;\n centered: boolean;\n size: Sizes;\n removeAutoFocus: boolean;\n onClickOutside: () => void;\n onClose: () => void;\n width: string | number;\n }\n\n export interface RequiredProps {\n children: TypescriptHelpersT.ReactChildrenComplete;\n }\n\n export interface OptionalProps {\n zIndex?: number;\n portalRef?: React.MutableRefObject<HTMLElement | null> | null;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n RequiredProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLDivElement>, 'size' | 'width' | 'children'> {}\n\n export interface InternalProps extends DefaultProps, RequiredProps, OptionalProps {}\n}\n\nexport const defaultProps: DSDialogT.DefaultProps = {\n isOpen: false,\n centered: false,\n size: DSDialogSizes.DEFAULT,\n width: '',\n removeAutoFocus: false,\n onClickOutside: () => {},\n onClose: () => {},\n};\n\nexport const propTypes = {\n ...globalAttributesPropTypes,\n isOpen: PropTypes.bool.description('Whether 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('Callback that should be used to close the modal when the user clicks outside.')\n .defaultValue(() => {}),\n onClose: PropTypes.func.description('Callback triggered with ESC key.').defaultValue(() => {}),\n size: PropTypes.oneOf(DSDialogSizesArrayValues)\n .description(`Dialog's width size.`)\n .defaultValue(DSDialogSizes.DEFAULT),\n width: PropTypes.string.description('Dialog width.'),\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,8BAAqD;AAErD,mBAAwD;AAiCjD,MAAM,eAAuC;AAAA,EAClD,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,MAAM,2BAAc;AAAA,EACpB,OAAO;AAAA,EACP,iBAAiB;AAAA,EACjB,gBAAgB,MAAM;AAAA,EAAC;AAAA,EACvB,SAAS,MAAM;AAAA,EAAC;AAClB;AAEO,MAAM,YAAY;AAAA,EACvB,GAAG;AAAA,EACH,QAAQ,kCAAU,KAAK,YAAY,oCAAoC,EAAE,aAAa,KAAK;AAAA,EAC3F,UAAU,kCAAU,KAAK,YAAY,oBAAoB,EAAE;AAAA,EAC3D,UAAU,kCAAU,KAAK,YAAY,qBAAqB,EAAE,aAAa,KAAK;AAAA,EAC9E,iBAAiB,kCAAU,KACxB;AAAA,IACC;AAAA,EACF,EACC,aAAa,KAAK;AAAA,EACrB,gBAAgB,kCAAU,KACvB,YAAY,+EAA+E,EAC3F,aAAa,MAAM;AAAA,EAAC,CAAC;AAAA,EACxB,SAAS,kCAAU,KAAK,YAAY,kCAAkC,EAAE,aAAa,MAAM;AAAA,EAAC,CAAC;AAAA,EAC7F,MAAM,kCAAU,MAAM,qCAAwB,EAC3C,YAAY,sBAAsB,EAClC,aAAa,2BAAc,OAAO;AAAA,EACrC,OAAO,kCAAU,OAAO,YAAY,eAAe;AACrD;",
6
+ "names": []
7
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/sharedTypes.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import type { DSDialogT } from './propTypes.js';\nexport namespace DSDialogInternalsT {\n export interface PortalInfo {\n scrollbarWidth: string;\n paddingRight: string;\n }\n\n export interface DSDialogContext {\n props: DSDialogT.InternalProps;\n actualPortalRef: React.MutableRefObject<HTMLElement | null>;\n containerRef: React.MutableRefObject<HTMLDivElement | null>;\n portalInfo: DSDialogInternalsT.PortalInfo;\n portalClassName: string;\n }\n}\n", "import * as React from 'react';\nexport { React };\n"],
4
+ "sourcesContent": ["import type { DSDialogT } from './react-desc-prop-types.js';\nexport namespace DSDialogInternalsT {\n export interface PortalInfo {\n scrollbarWidth: string;\n paddingRight: string;\n }\n\n export interface DSDialogContext {\n props: DSDialogT.InternalProps;\n actualPortalRef: React.MutableRefObject<HTMLElement | null>;\n containerRef: React.MutableRefObject<HTMLDivElement | null>;\n portalInfo: DSDialogInternalsT.PortalInfo;\n portalClassName: string;\n }\n}\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/styles.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable max-lines */\nimport { styled, createGlobalStyle, xStyledCommonProps } from '@elliemae/ds-system';\nimport type { XstyledProps } from '@elliemae/ds-props-helpers';\nimport { allSizes } from './utils.js';\nimport type { DSDialogT } from './propTypes.js';\nimport type { DSDialogInternalsT } from './sharedTypes.js';\n\ninterface PortalStylesT {\n portalInfo: DSDialogInternalsT.PortalInfo;\n portalClassName: string;\n}\n\ninterface StyledDialogBackgroundT {\n zIndex?: number;\n}\n\ninterface StyledDialogContainerT {\n size: DSDialogT.Sizes;\n centered: boolean;\n width: number | string;\n}\n\nexport const PortalStyles = createGlobalStyle<PortalStylesT>`\n ${({ portalClassName }) => `.${portalClassName}`} {\n overflow: hidden;\n ${({ portalInfo }) =>\n portalInfo.scrollbarWidth !== '0px'\n ? `padding-right: calc( ${portalInfo.paddingRight} + ${portalInfo.scrollbarWidth} ) !important;`\n : ``}\n }\n`;\n\nexport const StyledDialogBackground = styled.div<StyledDialogBackgroundT>`\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(37, 41, 47, 50%);\n overflow-y: auto;\n z-index: ${({ zIndex, theme }) => zIndex ?? theme.zIndex.dialog};\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, width }) => (width === '' ? allSizes[size] : width)};\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: auto;\n &:focus {\n outline: none;\n }\n max-height: 100vh;\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 line-height: 28px;\n margin: 0;\n`;\n\nexport const DSDialogAddon = styled.div``;\n\nexport const DSDialogHeader = styled('div')<React.PropsWithChildren & XstyledProps>`\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 ${xStyledCommonProps}\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 ${xStyledCommonProps}\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')<React.PropsWithChildren>`\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 ${xStyledCommonProps}\n`;\n", "import * as React from 'react';\nexport { React };\n"],
4
+ "sourcesContent": ["/* eslint-disable max-lines */\nimport { styled, createGlobalStyle, xStyledCommonProps } from '@elliemae/ds-system';\nimport type { XstyledProps } from '@elliemae/ds-props-helpers';\nimport { allSizes } from './utils.js';\nimport type { DSDialogT } from './react-desc-prop-types.js';\nimport type { DSDialogInternalsT } from './sharedTypes.js';\n\ninterface PortalStylesT {\n portalInfo: DSDialogInternalsT.PortalInfo;\n portalClassName: string;\n}\n\ninterface StyledDialogBackgroundT {\n zIndex?: number;\n}\n\ninterface StyledDialogContainerT {\n size: DSDialogT.Sizes;\n centered: boolean;\n width: number | string;\n}\n\nexport const PortalStyles = createGlobalStyle<PortalStylesT>`\n ${({ portalClassName }) => `.${portalClassName}`} {\n overflow: hidden;\n ${({ portalInfo }) =>\n portalInfo.scrollbarWidth !== '0px'\n ? `padding-right: calc( ${portalInfo.paddingRight} + ${portalInfo.scrollbarWidth} ) !important;`\n : ``}\n }\n`;\n\nexport const StyledDialogBackground = styled.div<StyledDialogBackgroundT>`\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(37, 41, 47, 50%);\n overflow-y: auto;\n z-index: ${({ zIndex, theme }) => zIndex ?? theme.zIndex.dialog};\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, width }) => (width === '' ? allSizes[size] : width)};\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: auto;\n &:focus {\n outline: none;\n }\n max-height: 100vh;\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 line-height: 28px;\n margin: 0;\n`;\n\nexport const DSDialogAddon = styled.div``;\n\nexport const DSDialogHeader = styled('div')<React.PropsWithChildren & XstyledProps>`\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 ${xStyledCommonProps}\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 ${xStyledCommonProps}\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')<React.PropsWithChildren>`\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 ${xStyledCommonProps}\n`;\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,uBAA8D;AAE9D,mBAAyB;AAmBlB,MAAM,eAAe;AAAA,IACxB,CAAC,EAAE,gBAAgB,MAAM,IAAI;AAAA;AAAA,MAE3B,CAAC,EAAE,WAAW,MACd,WAAW,mBAAmB,QAC1B,wBAAwB,WAAW,kBAAkB,WAAW,iCAChE;AAAA;AAAA;AAIH,MAAM,yBAAyB,wBAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAShC,CAAC,EAAE,QAAQ,MAAM,MAAM,UAAU,MAAM,OAAO;AAAA;AAGpD,MAAM,wBAAwB,wBAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAOhC,CAAC,EAAE,SAAS,MAAO,WAAW,SAAS;AAAA,WACxC,CAAC,EAAE,MAAM,MAAM,MAAO,UAAU,KAAK,sBAAS,IAAI,IAAI;AAAA;AAAA,8BAEnC,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA,gBACrD,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQlD,MAAM,gBAAgB,wBAAO;AAAA,eACrB,CAAC,EAAE,MAAM,MAAM,MAAM,UAAU,MAAM,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAShD,MAAM,gBAAgB,wBAAO;AAE7B,MAAM,qBAAiB,yBAAO,KAAK;AAAA;AAAA;AAAA;AAAA,gBAI1B,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM;AAAA,kBACzB,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM;AAAA,MACvC,mBAAmB;AAAA;AAAA;AAAA;AAAA,MAInB;AAAA;AAAA;AAAA,IAGF;AAAA;AAGG,MAAM,oBAAoB,wBAAO,GAAG,MAAM,OAAO,EAAE,eAAe,KAAK,EAAE;AAAA;AAAA,0BAEtD,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,KAAK;AAAA;AAG5D,MAAM,mBAAe,yBAAO,KAAK;AAAA,aAC3B,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM;AAAA;AAAA,IAEpC;AAAA;AAGG,MAAM,yBAAyB,wBAAO;AAAA;AAAA;AAItC,MAAM,2BAA2B,wBAAO;AAAA;AAAA,WAEpC,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA;AAG3C,MAAM,4BAAwB,yBAAO,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA,cAKnC,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM;AAAA;AAAA,IAErC;AAAA;AAAA;AAAA;AAKG,MAAM,qBAAiB,yBAAO,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA,cAK5B,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM;AAAA,gBACzB,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM;AAAA,eAC5B,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM;AAAA,IACtC;AAAA;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,128 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from))
11
+ if (!__hasOwnProp.call(to, key) && key !== except)
12
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ }
14
+ return to;
15
+ };
16
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
+ // If the importer is in node compatibility mode or this is not an ESM
18
+ // file that has been converted to a CommonJS file using a Babel-
19
+ // compatible transform (i.e. "__esModule" has not been set), then set
20
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
24
+ var React = __toESM(require("react"));
25
+ var import_jsx_runtime = require("react/jsx-runtime");
26
+ var import_react = __toESM(require("react"));
27
+ var import__ = require("../index.js");
28
+ const ref = import_react.default.createRef();
29
+ const noop = () => {
30
+ };
31
+ const testRequiredProps = {
32
+ children: "Content"
33
+ };
34
+ const testOptionalProps = {
35
+ portalRef: ref,
36
+ zIndex: 10
37
+ };
38
+ const testPartialDefaults = {
39
+ onClose: noop,
40
+ isOpen: true,
41
+ size: "medium"
42
+ };
43
+ const testProps = {
44
+ ...testRequiredProps,
45
+ ...testOptionalProps,
46
+ ...testPartialDefaults
47
+ };
48
+ const testPropsAsSyntax = {
49
+ ...testRequiredProps,
50
+ ...testOptionalProps,
51
+ ...testPartialDefaults
52
+ };
53
+ const testCompleteDefaults = {
54
+ centered: true,
55
+ isOpen: true,
56
+ onClickOutside: noop,
57
+ onClose: noop,
58
+ removeAutoFocus: false,
59
+ size: "default",
60
+ width: 300
61
+ };
62
+ const testInternalProps = {
63
+ ...testRequiredProps,
64
+ ...testOptionalProps,
65
+ ...testCompleteDefaults
66
+ };
67
+ const testInternalPropsAsSyntax = {
68
+ ...testRequiredProps,
69
+ ...testOptionalProps,
70
+ ...testCompleteDefaults
71
+ };
72
+ const testExplicitDefinition = {
73
+ centered: true,
74
+ isOpen: true,
75
+ onClickOutside: noop,
76
+ onClose: noop,
77
+ removeAutoFocus: false,
78
+ size: "default",
79
+ width: 300,
80
+ children: "Content",
81
+ portalRef: ref,
82
+ zIndex: 10
83
+ };
84
+ const testInferedTypeCompatibility = {
85
+ centered: true,
86
+ isOpen: true,
87
+ onClickOutside: noop,
88
+ onClose: noop,
89
+ removeAutoFocus: false,
90
+ size: "default",
91
+ width: 300,
92
+ children: "Content",
93
+ portalRef: ref,
94
+ zIndex: 10
95
+ };
96
+ const testDefinitionAsConst = {
97
+ centered: true,
98
+ isOpen: true,
99
+ onClickOutside: noop,
100
+ onClose: noop,
101
+ removeAutoFocus: false,
102
+ size: "default",
103
+ width: 300,
104
+ children: "Content",
105
+ portalRef: ref,
106
+ zIndex: 10
107
+ };
108
+ const ExampleUsageComponent = () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
109
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSDialog, { ...testExplicitDefinition }),
110
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSDialog, { ...testInferedTypeCompatibility }),
111
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSDialog, { ...testDefinitionAsConst }),
112
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
113
+ import__.DSDialog,
114
+ {
115
+ centered: true,
116
+ isOpen: true,
117
+ onClickOutside: noop,
118
+ onClose: noop,
119
+ removeAutoFocus: false,
120
+ size: "default",
121
+ width: 300,
122
+ children: "Content",
123
+ portalRef: ref,
124
+ zIndex: 10
125
+ }
126
+ )
127
+ ] });
128
+ //# sourceMappingURL=typescript-dialog-valid.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/typescript-dialog-valid.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport React, { type MutableRefObject } from 'react';\nimport { DSDialog } from '../index.js';\nimport type { DSDialogT } from '../index.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForApp = DSDialogT.Props;\ntype ComponentPropsInternals = DSDialogT.InternalProps;\ntype ComponentPropsDefaultProps = DSDialogT.DefaultProps;\ntype ComponentPropsOptionalProps = DSDialogT.OptionalProps;\ntype ComponentPropsRequiredProps = DSDialogT.RequiredProps;\n\nconst ref = React.createRef() as MutableRefObject<HTMLElement>;\nconst noop = () => {};\n\nconst testRequiredProps: ComponentPropsRequiredProps = {\n children: 'Content',\n};\n\nconst testOptionalProps: ComponentPropsOptionalProps = {\n portalRef: ref,\n zIndex: 10,\n};\n\n// difference Props and InternalProps is that InternalProps has all the default props filled in\n// Props allows for partial defaults\nconst testPartialDefaults: Partial<ComponentPropsDefaultProps> = {\n onClose: noop,\n isOpen: true,\n size: 'medium',\n};\n\nconst testProps: ComponentPropsForApp = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n};\n\nconst testPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {\n centered: true,\n isOpen: true,\n onClickOutside: noop,\n onClose: noop,\n removeAutoFocus: false,\n size: 'default',\n width: 300,\n};\n\nconst testInternalProps: ComponentPropsInternals = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n};\n\nconst testInternalPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n} as ComponentPropsInternals;\n\n// using the explicit type definition, if there is an error, it will be marked on the key that is wrong\nconst testExplicitDefinition: ComponentPropsForApp = {\n centered: true,\n isOpen: true,\n onClickOutside: noop,\n onClose: noop,\n removeAutoFocus: false,\n size: 'default',\n width: 300,\n children: 'Content',\n portalRef: ref,\n zIndex: 10,\n};\n\n// using the \"as\" syntax, if there is an error, it will be marking the whole object as wrong because it is not compatible with the type\nconst testInferedTypeCompatibility = {\n centered: true,\n isOpen: true,\n onClickOutside: noop,\n onClose: noop,\n removeAutoFocus: false,\n size: 'default',\n width: 300,\n children: 'Content',\n portalRef: ref,\n zIndex: 10,\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n centered: true,\n isOpen: true,\n onClickOutside: noop,\n onClose: noop,\n removeAutoFocus: false,\n size: 'default',\n width: 300,\n children: 'Content',\n portalRef: ref,\n zIndex: 10,\n} as const;\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <DSDialog {...testExplicitDefinition} />\n <DSDialog {...testInferedTypeCompatibility} />\n <DSDialog {...testDefinitionAsConst} />\n {/* works with inline values */}\n <DSDialog\n centered\n isOpen\n onClickOutside={noop}\n onClose={noop}\n removeAutoFocus={false}\n size={'default'}\n width={300}\n children=\"Content\"\n portalRef={ref}\n zIndex={10}\n />\n </>\n);\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;AC6GrB;AA5GF,mBAA6C;AAC7C,eAAyB;AAUzB,MAAM,MAAM,aAAAA,QAAM,UAAU;AAC5B,MAAM,OAAO,MAAM;AAAC;AAEpB,MAAM,oBAAiD;AAAA,EACrD,UAAU;AACZ;AAEA,MAAM,oBAAiD;AAAA,EACrD,WAAW;AAAA,EACX,QAAQ;AACV;AAIA,MAAM,sBAA2D;AAAA,EAC/D,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,MAAM;AACR;AAEA,MAAM,YAAkC;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,oBAAoB;AAAA,EACxB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,uBAA6D;AAAA,EACjE,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,SAAS;AAAA,EACT,iBAAiB;AAAA,EACjB,MAAM;AAAA,EACN,OAAO;AACT;AAEA,MAAM,oBAA6C;AAAA,EACjD,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,4BAA4B;AAAA,EAChC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,yBAA+C;AAAA,EACnD,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,SAAS;AAAA,EACT,iBAAiB;AAAA,EACjB,MAAM;AAAA,EACN,OAAO;AAAA,EACP,UAAU;AAAA,EACV,WAAW;AAAA,EACX,QAAQ;AACV;AAGA,MAAM,+BAA+B;AAAA,EACnC,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,SAAS;AAAA,EACT,iBAAiB;AAAA,EACjB,MAAM;AAAA,EACN,OAAO;AAAA,EACP,UAAU;AAAA,EACV,WAAW;AAAA,EACX,QAAQ;AACV;AAEA,MAAM,wBAAwB;AAAA,EAC5B,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,SAAS;AAAA,EACT,iBAAiB;AAAA,EACjB,MAAM;AAAA,EACN,OAAO;AAAA,EACP,UAAU;AAAA,EACV,WAAW;AAAA,EACX,QAAQ;AACV;AAEA,MAAM,wBAAwB,MAC5B,4EAEE;AAAA,8CAAC,qBAAU,GAAG,wBAAwB;AAAA,EACtC,4CAAC,qBAAU,GAAG,8BAA8B;AAAA,EAC5C,4CAAC,qBAAU,GAAG,uBAAuB;AAAA,EAErC;AAAA,IAAC;AAAA;AAAA,MACC,UAAQ;AAAA,MACR,QAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,SAAS;AAAA,MACT,iBAAiB;AAAA,MACjB,MAAM;AAAA,MACN,OAAO;AAAA,MACP,UAAS;AAAA,MACT,WAAW;AAAA,MACX,QAAQ;AAAA;AAAA,EACV;AAAA,GACF;",
6
+ "names": ["React"]
7
+ }
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import { describe } from "@elliemae/ds-props-helpers";
4
- import { propTypes } from "./propTypes.js";
4
+ import { propTypes } from "./react-desc-prop-types.js";
5
5
  import { useDialog } from "./config/useDialog.js";
6
6
  import { DSDialogPortal } from "./parts/DSDialogPortal.js";
7
7
  import { DSDialogContext } from "./DSDialogCTX.js";
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSDialog.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { WeakValidationMap } from 'react';\nimport React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { propTypes } from './propTypes.js';\nimport { useDialog } from './config/useDialog.js';\nimport { DSDialogPortal } from './parts/DSDialogPortal.js';\nimport { DSDialogContext } from './DSDialogCTX.js';\nimport type { DSDialogT } from './propTypes.js';\n\nconst DSDialog = (props: DSDialogT.Props): JSX.Element => {\n const ctx = useDialog(props);\n\n return (\n <DSDialogContext.Provider value={ctx}>\n <DSDialogPortal />\n </DSDialogContext.Provider>\n );\n};\nDSDialog.displayName = 'DSDialog';\nconst DSDialogWithSchema = describe(DSDialog);\nDSDialogWithSchema.propTypes = propTypes as WeakValidationMap<unknown>;\n\nexport { DSDialog, DSDialogWithSchema };\n"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { WeakValidationMap } from 'react';\nimport React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { propTypes } from './react-desc-prop-types.js';\nimport { useDialog } from './config/useDialog.js';\nimport { DSDialogPortal } from './parts/DSDialogPortal.js';\nimport { DSDialogContext } from './DSDialogCTX.js';\nimport type { DSDialogT } from './react-desc-prop-types.js';\n\nconst DSDialog = (props: DSDialogT.Props): JSX.Element => {\n const ctx = useDialog(props);\n\n return (\n <DSDialogContext.Provider value={ctx}>\n <DSDialogPortal />\n </DSDialogContext.Provider>\n );\n};\nDSDialog.displayName = 'DSDialog';\nconst DSDialogWithSchema = describe(DSDialog);\nDSDialogWithSchema.propTypes = propTypes as WeakValidationMap<unknown>;\n\nexport { DSDialog, DSDialogWithSchema };\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACcjB;AAZN,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAC1B,SAAS,iBAAiB;AAC1B,SAAS,sBAAsB;AAC/B,SAAS,uBAAuB;AAGhC,MAAM,WAAW,CAAC,UAAwC;AACxD,QAAM,MAAM,UAAU,KAAK;AAE3B,SACE,oBAAC,gBAAgB,UAAhB,EAAyB,OAAO,KAC/B,8BAAC,kBAAe,GAClB;AAEJ;AACA,SAAS,cAAc;AACvB,MAAM,qBAAqB,SAAS,QAAQ;AAC5C,mBAAmB,YAAY;",
6
6
  "names": []
7
7
  }
@@ -3,7 +3,7 @@ import { useEffect, useMemo, useState, useCallback, useRef, useLayoutEffect } fr
3
3
  import { debounce } from "lodash";
4
4
  import { uid } from "uid";
5
5
  import { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from "@elliemae/ds-props-helpers";
6
- import { propTypes, defaultProps } from "../propTypes.js";
6
+ import { defaultProps, propTypes } from "../react-desc-prop-types.js";
7
7
  import { getScrollbarWidth, getCurrentRightPadding } from "../utils.js";
8
8
  const useDialog = (props) => {
9
9
  useValidateTypescriptPropTypes(props, propTypes, "DSDialog");
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useDialog.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useEffect, useMemo, useState, useCallback, useRef, useLayoutEffect } from 'react';\nimport { debounce } from 'lodash';\nimport { uid } from 'uid';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { propTypes, defaultProps } from '../propTypes.js';\nimport { getScrollbarWidth, getCurrentRightPadding } from '../utils.js';\nimport type { DSDialogT } from '../propTypes.js';\nimport type { DSDialogInternalsT } from '../sharedTypes.js';\n\nexport const useDialog = (props: DSDialogT.Props): DSDialogInternalsT.DSDialogContext => {\n useValidateTypescriptPropTypes<DSDialogT.Props>(props, propTypes, 'DSDialog');\n const propsWithDefault = useMemoMergePropsWithDefault<DSDialogT.InternalProps>(props, defaultProps);\n const { portalRef, isOpen } = propsWithDefault;\n\n const actualPortalRef = useRef<HTMLElement | null>(null);\n const containerRef = useRef<HTMLDivElement | null>(null);\n\n const [portalInfo, setPortalInfo] = useState<DSDialogInternalsT.PortalInfo>({\n paddingRight: '0px',\n scrollbarWidth: '0px',\n });\n\n const portalClassName = useMemo(() => `ds-dialog-${uid(8)}`, []);\n\n useEffect(() => {\n if (portalRef) actualPortalRef.current = portalRef.current;\n else actualPortalRef.current = document.getElementsByTagName('body')['0'];\n }, [portalRef]);\n\n useLayoutEffect(() => {\n if (actualPortalRef.current) {\n if (isOpen) {\n actualPortalRef.current.classList.add(portalClassName);\n } else {\n actualPortalRef.current.classList.remove(portalClassName);\n }\n }\n }, [actualPortalRef, isOpen, portalClassName]);\n\n useEffect(() => {\n if (actualPortalRef.current) {\n setPortalInfo((prev) => ({\n ...prev,\n paddingRight: getCurrentRightPadding(actualPortalRef.current as HTMLElement),\n }));\n }\n }, []);\n\n const calculateScrollbar = useCallback(() => {\n if (actualPortalRef.current && !isOpen) {\n setPortalInfo((prev) => ({\n ...prev,\n scrollbarWidth: getScrollbarWidth(actualPortalRef.current as HTMLElement),\n }));\n }\n }, [isOpen]);\n\n const debouncedCalculateScrollbar = useMemo(() => debounce(calculateScrollbar, 300), [calculateScrollbar]);\n\n useEffect(() => {\n window.addEventListener('resize', debouncedCalculateScrollbar);\n return () => {\n window.removeEventListener('resize', debouncedCalculateScrollbar);\n };\n }, [calculateScrollbar, debouncedCalculateScrollbar]);\n\n useEffect(() => {\n calculateScrollbar();\n }, [calculateScrollbar, isOpen]);\n\n const ctx = useMemo(\n () => ({\n props: propsWithDefault,\n actualPortalRef,\n containerRef,\n portalInfo,\n portalClassName,\n }),\n [portalClassName, portalInfo, propsWithDefault],\n );\n\n return ctx;\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,WAAW,SAAS,UAAU,aAAa,QAAQ,uBAAuB;AACnF,SAAS,gBAAgB;AACzB,SAAS,WAAW;AACpB,SAAS,8BAA8B,sCAAsC;AAC7E,SAAS,WAAW,oBAAoB;AACxC,SAAS,mBAAmB,8BAA8B;AAInD,MAAM,YAAY,CAAC,UAA+D;AACvF,iCAAgD,OAAO,WAAW,UAAU;AAC5E,QAAM,mBAAmB,6BAAsD,OAAO,YAAY;AAClG,QAAM,EAAE,WAAW,OAAO,IAAI;AAE9B,QAAM,kBAAkB,OAA2B,IAAI;AACvD,QAAM,eAAe,OAA8B,IAAI;AAEvD,QAAM,CAAC,YAAY,aAAa,IAAI,SAAwC;AAAA,IAC1E,cAAc;AAAA,IACd,gBAAgB;AAAA,EAClB,CAAC;AAED,QAAM,kBAAkB,QAAQ,MAAM,aAAa,IAAI,CAAC,KAAK,CAAC,CAAC;AAE/D,YAAU,MAAM;AACd,QAAI;AAAW,sBAAgB,UAAU,UAAU;AAAA;AAC9C,sBAAgB,UAAU,SAAS,qBAAqB,MAAM,EAAE,GAAG;AAAA,EAC1E,GAAG,CAAC,SAAS,CAAC;AAEd,kBAAgB,MAAM;AACpB,QAAI,gBAAgB,SAAS;AAC3B,UAAI,QAAQ;AACV,wBAAgB,QAAQ,UAAU,IAAI,eAAe;AAAA,MACvD,OAAO;AACL,wBAAgB,QAAQ,UAAU,OAAO,eAAe;AAAA,MAC1D;AAAA,IACF;AAAA,EACF,GAAG,CAAC,iBAAiB,QAAQ,eAAe,CAAC;AAE7C,YAAU,MAAM;AACd,QAAI,gBAAgB,SAAS;AAC3B,oBAAc,CAAC,UAAU;AAAA,QACvB,GAAG;AAAA,QACH,cAAc,uBAAuB,gBAAgB,OAAsB;AAAA,MAC7E,EAAE;AAAA,IACJ;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,QAAM,qBAAqB,YAAY,MAAM;AAC3C,QAAI,gBAAgB,WAAW,CAAC,QAAQ;AACtC,oBAAc,CAAC,UAAU;AAAA,QACvB,GAAG;AAAA,QACH,gBAAgB,kBAAkB,gBAAgB,OAAsB;AAAA,MAC1E,EAAE;AAAA,IACJ;AAAA,EACF,GAAG,CAAC,MAAM,CAAC;AAEX,QAAM,8BAA8B,QAAQ,MAAM,SAAS,oBAAoB,GAAG,GAAG,CAAC,kBAAkB,CAAC;AAEzG,YAAU,MAAM;AACd,WAAO,iBAAiB,UAAU,2BAA2B;AAC7D,WAAO,MAAM;AACX,aAAO,oBAAoB,UAAU,2BAA2B;AAAA,IAClE;AAAA,EACF,GAAG,CAAC,oBAAoB,2BAA2B,CAAC;AAEpD,YAAU,MAAM;AACd,uBAAmB;AAAA,EACrB,GAAG,CAAC,oBAAoB,MAAM,CAAC;AAE/B,QAAM,MAAM;AAAA,IACV,OAAO;AAAA,MACL,OAAO;AAAA,MACP;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,iBAAiB,YAAY,gBAAgB;AAAA,EAChD;AAEA,SAAO;AACT;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useEffect, useMemo, useState, useCallback, useRef, useLayoutEffect } from 'react';\nimport { debounce } from 'lodash';\nimport { uid } from 'uid';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { defaultProps, propTypes } from '../react-desc-prop-types.js';\nimport { getScrollbarWidth, getCurrentRightPadding } from '../utils.js';\nimport type { DSDialogT } from '../react-desc-prop-types.js';\nimport type { DSDialogInternalsT } from '../sharedTypes.js';\n\nexport const useDialog = (props: DSDialogT.Props): DSDialogInternalsT.DSDialogContext => {\n useValidateTypescriptPropTypes<DSDialogT.Props>(props, propTypes, 'DSDialog');\n const propsWithDefault = useMemoMergePropsWithDefault<DSDialogT.InternalProps>(props, defaultProps);\n const { portalRef, isOpen } = propsWithDefault;\n\n const actualPortalRef = useRef<HTMLElement | null>(null);\n const containerRef = useRef<HTMLDivElement | null>(null);\n\n const [portalInfo, setPortalInfo] = useState<DSDialogInternalsT.PortalInfo>({\n paddingRight: '0px',\n scrollbarWidth: '0px',\n });\n\n const portalClassName = useMemo(() => `ds-dialog-${uid(8)}`, []);\n\n useEffect(() => {\n if (portalRef) actualPortalRef.current = portalRef.current;\n else actualPortalRef.current = document.getElementsByTagName('body')['0'];\n }, [portalRef]);\n\n useLayoutEffect(() => {\n if (actualPortalRef.current) {\n if (isOpen) {\n actualPortalRef.current.classList.add(portalClassName);\n } else {\n actualPortalRef.current.classList.remove(portalClassName);\n }\n }\n }, [actualPortalRef, isOpen, portalClassName]);\n\n useEffect(() => {\n if (actualPortalRef.current) {\n setPortalInfo((prev) => ({\n ...prev,\n paddingRight: getCurrentRightPadding(actualPortalRef.current as HTMLElement),\n }));\n }\n }, []);\n\n const calculateScrollbar = useCallback(() => {\n if (actualPortalRef.current && !isOpen) {\n setPortalInfo((prev) => ({\n ...prev,\n scrollbarWidth: getScrollbarWidth(actualPortalRef.current as HTMLElement),\n }));\n }\n }, [isOpen]);\n\n const debouncedCalculateScrollbar = useMemo(() => debounce(calculateScrollbar, 300), [calculateScrollbar]);\n\n useEffect(() => {\n window.addEventListener('resize', debouncedCalculateScrollbar);\n return () => {\n window.removeEventListener('resize', debouncedCalculateScrollbar);\n };\n }, [calculateScrollbar, debouncedCalculateScrollbar]);\n\n useEffect(() => {\n calculateScrollbar();\n }, [calculateScrollbar, isOpen]);\n\n const ctx = useMemo(\n () => ({\n props: propsWithDefault,\n actualPortalRef,\n containerRef,\n portalInfo,\n portalClassName,\n }),\n [portalClassName, portalInfo, propsWithDefault],\n );\n\n return ctx;\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,WAAW,SAAS,UAAU,aAAa,QAAQ,uBAAuB;AACnF,SAAS,gBAAgB;AACzB,SAAS,WAAW;AACpB,SAAS,8BAA8B,sCAAsC;AAC7E,SAAS,cAAc,iBAAiB;AACxC,SAAS,mBAAmB,8BAA8B;AAInD,MAAM,YAAY,CAAC,UAA+D;AACvF,iCAAgD,OAAO,WAAW,UAAU;AAC5E,QAAM,mBAAmB,6BAAsD,OAAO,YAAY;AAClG,QAAM,EAAE,WAAW,OAAO,IAAI;AAE9B,QAAM,kBAAkB,OAA2B,IAAI;AACvD,QAAM,eAAe,OAA8B,IAAI;AAEvD,QAAM,CAAC,YAAY,aAAa,IAAI,SAAwC;AAAA,IAC1E,cAAc;AAAA,IACd,gBAAgB;AAAA,EAClB,CAAC;AAED,QAAM,kBAAkB,QAAQ,MAAM,aAAa,IAAI,CAAC,KAAK,CAAC,CAAC;AAE/D,YAAU,MAAM;AACd,QAAI;AAAW,sBAAgB,UAAU,UAAU;AAAA;AAC9C,sBAAgB,UAAU,SAAS,qBAAqB,MAAM,EAAE,GAAG;AAAA,EAC1E,GAAG,CAAC,SAAS,CAAC;AAEd,kBAAgB,MAAM;AACpB,QAAI,gBAAgB,SAAS;AAC3B,UAAI,QAAQ;AACV,wBAAgB,QAAQ,UAAU,IAAI,eAAe;AAAA,MACvD,OAAO;AACL,wBAAgB,QAAQ,UAAU,OAAO,eAAe;AAAA,MAC1D;AAAA,IACF;AAAA,EACF,GAAG,CAAC,iBAAiB,QAAQ,eAAe,CAAC;AAE7C,YAAU,MAAM;AACd,QAAI,gBAAgB,SAAS;AAC3B,oBAAc,CAAC,UAAU;AAAA,QACvB,GAAG;AAAA,QACH,cAAc,uBAAuB,gBAAgB,OAAsB;AAAA,MAC7E,EAAE;AAAA,IACJ;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,QAAM,qBAAqB,YAAY,MAAM;AAC3C,QAAI,gBAAgB,WAAW,CAAC,QAAQ;AACtC,oBAAc,CAAC,UAAU;AAAA,QACvB,GAAG;AAAA,QACH,gBAAgB,kBAAkB,gBAAgB,OAAsB;AAAA,MAC1E,EAAE;AAAA,IACJ;AAAA,EACF,GAAG,CAAC,MAAM,CAAC;AAEX,QAAM,8BAA8B,QAAQ,MAAM,SAAS,oBAAoB,GAAG,GAAG,CAAC,kBAAkB,CAAC;AAEzG,YAAU,MAAM;AACd,WAAO,iBAAiB,UAAU,2BAA2B;AAC7D,WAAO,MAAM;AACX,aAAO,oBAAoB,UAAU,2BAA2B;AAAA,IAClE;AAAA,EACF,GAAG,CAAC,oBAAoB,2BAA2B,CAAC;AAEpD,YAAU,MAAM;AACd,uBAAmB;AAAA,EACrB,GAAG,CAAC,oBAAoB,MAAM,CAAC;AAE/B,QAAM,MAAM;AAAA,IACV,OAAO;AAAA,MACL,OAAO;AAAA,MACP;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,iBAAiB,YAAY,gBAAgB;AAAA,EAChD;AAEA,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -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", "import { describe, globalAttributesPropTypes } from '@elliemae/ds-props-helpers';\nimport {\n DSDialogBody,\n DSDialogHeader,\n DSDialogFooter,\n DSDialogSeparator,\n DSDialogTitle,\n DSDialogAddon,\n DSDialogDefaultLayout,\n DSDialogPrimaryMessage,\n DSDialogSecondaryMessage,\n} from './styles.js';\nimport type { WeakValidationMap } from 'react';\nimport type {} from '@xstyled/system';\nimport type {} from '@xstyled/util';\n\nDSDialogBody.displayName = 'DSDialogBody';\nDSDialogHeader.displayName = 'DSDialogHeader';\nDSDialogFooter.displayName = 'DSDialogFooter';\nDSDialogSeparator.displayName = 'DSDialogSeparator';\nDSDialogTitle.displayName = 'DSDialogTitle';\nDSDialogAddon.displayName = 'DSDialogAddon';\nDSDialogDefaultLayout.displayName = 'DSDialogDefaultLayout';\nDSDialogPrimaryMessage.displayName = 'DSDialogPrimaryMessage';\nDSDialogSecondaryMessage.displayName = 'DSDialogSecondaryMessage';\n\nconst DSDialogBodyWithSchema = describe(DSDialogBody as React.FC);\nconst DSDialogHeaderWithSchema = describe(DSDialogHeader as React.FC);\nconst DSDialogFooterWithSchema = describe(DSDialogFooter as React.FC);\nconst DSDialogSeparatorWithSchema = describe(DSDialogSeparator as React.FC);\nconst DSDialogTitleWithSchema = describe(DSDialogTitle as React.FC);\nconst DSDialogAddonWithSchema = describe(DSDialogAddon as React.FC);\nconst DSDialogDefaultLayoutWithSchema = describe(DSDialogDefaultLayout as React.FC);\nconst DSDialogPrimaryMessageWithSchema = describe(DSDialogPrimaryMessage as React.FC);\nconst DSDialogSecondaryMessageWithSchema = describe(DSDialogSecondaryMessage as React.FC);\n\nDSDialogBodyWithSchema.propTypes = globalAttributesPropTypes as WeakValidationMap<unknown>;\nDSDialogHeaderWithSchema.propTypes = globalAttributesPropTypes as WeakValidationMap<unknown>;\nDSDialogFooterWithSchema.propTypes = globalAttributesPropTypes as WeakValidationMap<unknown>;\nDSDialogSeparatorWithSchema.propTypes = globalAttributesPropTypes as WeakValidationMap<unknown>;\nDSDialogTitleWithSchema.propTypes = globalAttributesPropTypes as WeakValidationMap<unknown>;\nDSDialogAddonWithSchema.propTypes = globalAttributesPropTypes as WeakValidationMap<unknown>;\nDSDialogDefaultLayoutWithSchema.propTypes = globalAttributesPropTypes as WeakValidationMap<unknown>;\nDSDialogPrimaryMessageWithSchema.propTypes = globalAttributesPropTypes as WeakValidationMap<unknown>;\nDSDialogSecondaryMessageWithSchema.propTypes = globalAttributesPropTypes as WeakValidationMap<unknown>;\n\nexport * from './DSDialog.js';\nexport * from './DSDialogDatatestid.js';\nexport { DSDialogSizes } from './utils.js';\nexport {\n DSDialogBody,\n DSDialogHeader,\n DSDialogFooter,\n DSDialogSeparator,\n DSDialogTitle,\n DSDialogAddon,\n DSDialogDefaultLayout,\n DSDialogPrimaryMessage,\n DSDialogSecondaryMessage,\n DSDialogBodyWithSchema,\n DSDialogHeaderWithSchema,\n DSDialogFooterWithSchema,\n DSDialogSeparatorWithSchema,\n DSDialogTitleWithSchema,\n DSDialogAddonWithSchema,\n DSDialogDefaultLayoutWithSchema,\n DSDialogPrimaryMessageWithSchema,\n DSDialogSecondaryMessageWithSchema,\n};\n"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { describe, globalAttributesPropTypes } from '@elliemae/ds-props-helpers';\nimport {\n DSDialogBody,\n DSDialogHeader,\n DSDialogFooter,\n DSDialogSeparator,\n DSDialogTitle,\n DSDialogAddon,\n DSDialogDefaultLayout,\n DSDialogPrimaryMessage,\n DSDialogSecondaryMessage,\n} from './styles.js';\nimport type { WeakValidationMap } from 'react';\nimport type {} from '@xstyled/system';\nimport type {} from '@xstyled/util';\n\nDSDialogBody.displayName = 'DSDialogBody';\nDSDialogHeader.displayName = 'DSDialogHeader';\nDSDialogFooter.displayName = 'DSDialogFooter';\nDSDialogSeparator.displayName = 'DSDialogSeparator';\nDSDialogTitle.displayName = 'DSDialogTitle';\nDSDialogAddon.displayName = 'DSDialogAddon';\nDSDialogDefaultLayout.displayName = 'DSDialogDefaultLayout';\nDSDialogPrimaryMessage.displayName = 'DSDialogPrimaryMessage';\nDSDialogSecondaryMessage.displayName = 'DSDialogSecondaryMessage';\n\nconst DSDialogBodyWithSchema = describe(DSDialogBody as React.FC);\nconst DSDialogHeaderWithSchema = describe(DSDialogHeader as React.FC);\nconst DSDialogFooterWithSchema = describe(DSDialogFooter as React.FC);\nconst DSDialogSeparatorWithSchema = describe(DSDialogSeparator as React.FC);\nconst DSDialogTitleWithSchema = describe(DSDialogTitle as React.FC);\nconst DSDialogAddonWithSchema = describe(DSDialogAddon as React.FC);\nconst DSDialogDefaultLayoutWithSchema = describe(DSDialogDefaultLayout as React.FC);\nconst DSDialogPrimaryMessageWithSchema = describe(DSDialogPrimaryMessage as React.FC);\nconst DSDialogSecondaryMessageWithSchema = describe(DSDialogSecondaryMessage as React.FC);\n\nDSDialogBodyWithSchema.propTypes = globalAttributesPropTypes as WeakValidationMap<unknown>;\nDSDialogHeaderWithSchema.propTypes = globalAttributesPropTypes as WeakValidationMap<unknown>;\nDSDialogFooterWithSchema.propTypes = globalAttributesPropTypes as WeakValidationMap<unknown>;\nDSDialogSeparatorWithSchema.propTypes = globalAttributesPropTypes as WeakValidationMap<unknown>;\nDSDialogTitleWithSchema.propTypes = globalAttributesPropTypes as WeakValidationMap<unknown>;\nDSDialogAddonWithSchema.propTypes = globalAttributesPropTypes as WeakValidationMap<unknown>;\nDSDialogDefaultLayoutWithSchema.propTypes = globalAttributesPropTypes as WeakValidationMap<unknown>;\nDSDialogPrimaryMessageWithSchema.propTypes = globalAttributesPropTypes as WeakValidationMap<unknown>;\nDSDialogSecondaryMessageWithSchema.propTypes = globalAttributesPropTypes as WeakValidationMap<unknown>;\n\nexport * from './DSDialog.js';\nexport * from './DSDialogDatatestid.js';\nexport { DSDialogSizes } from './utils.js';\nexport {\n DSDialogBody,\n DSDialogHeader,\n DSDialogFooter,\n DSDialogSeparator,\n DSDialogTitle,\n DSDialogAddon,\n DSDialogDefaultLayout,\n DSDialogPrimaryMessage,\n DSDialogSecondaryMessage,\n DSDialogBodyWithSchema,\n DSDialogHeaderWithSchema,\n DSDialogFooterWithSchema,\n DSDialogSeparatorWithSchema,\n DSDialogTitleWithSchema,\n DSDialogAddonWithSchema,\n DSDialogDefaultLayoutWithSchema,\n DSDialogPrimaryMessageWithSchema,\n DSDialogSecondaryMessageWithSchema,\n};\nexport type { DSDialogT } from './react-desc-prop-types.js';\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,UAAU,iCAAiC;AACpD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAKP,aAAa,cAAc;AAC3B,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,kBAAkB,cAAc;AAChC,cAAc,cAAc;AAC5B,cAAc,cAAc;AAC5B,sBAAsB,cAAc;AACpC,uBAAuB,cAAc;AACrC,yBAAyB,cAAc;AAEvC,MAAM,yBAAyB,SAAS,YAAwB;AAChE,MAAM,2BAA2B,SAAS,cAA0B;AACpE,MAAM,2BAA2B,SAAS,cAA0B;AACpE,MAAM,8BAA8B,SAAS,iBAA6B;AAC1E,MAAM,0BAA0B,SAAS,aAAyB;AAClE,MAAM,0BAA0B,SAAS,aAAyB;AAClE,MAAM,kCAAkC,SAAS,qBAAiC;AAClF,MAAM,mCAAmC,SAAS,sBAAkC;AACpF,MAAM,qCAAqC,SAAS,wBAAoC;AAExF,uBAAuB,YAAY;AACnC,yBAAyB,YAAY;AACrC,yBAAyB,YAAY;AACrC,4BAA4B,YAAY;AACxC,wBAAwB,YAAY;AACpC,wBAAwB,YAAY;AACpC,gCAAgC,YAAY;AAC5C,iCAAiC,YAAY;AAC7C,mCAAmC,YAAY;AAE/C,cAAc;AACd,cAAc;AACd,SAAS,qBAAqB;",
6
6
  "names": []
7
7
  }
@@ -10,8 +10,7 @@ const defaultProps = {
10
10
  onClickOutside: () => {
11
11
  },
12
12
  onClose: () => {
13
- },
14
- portalRef: null
13
+ }
15
14
  };
16
15
  const propTypes = {
17
16
  ...globalAttributesPropTypes,
@@ -32,4 +31,4 @@ export {
32
31
  defaultProps,
33
32
  propTypes
34
33
  };
35
- //# sourceMappingURL=propTypes.js.map
34
+ //# 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.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type {} from '@elliemae/ds-utilities';\nimport type { GlobalAttributesT } from '@elliemae/ds-props-helpers';\nimport { globalAttributesPropTypes, PropTypes } from '@elliemae/ds-props-helpers';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport { DSDialogSizes, DSDialogSizesArrayValues } from './utils.js';\n\nexport declare namespace DSDialogT {\n export type Sizes = 'default' | 'small' | 'medium' | 'large' | 'x-large' | 'xx-large';\n\n export interface DefaultProps {\n isOpen: boolean;\n centered: boolean;\n size: Sizes;\n removeAutoFocus: boolean;\n onClickOutside: () => void;\n onClose: () => void;\n width: string | number;\n }\n\n export interface RequiredProps {\n children: TypescriptHelpersT.ReactChildrenComplete;\n }\n\n export interface OptionalProps {\n zIndex?: number;\n portalRef?: React.MutableRefObject<HTMLElement | null> | null;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n RequiredProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLDivElement>, 'size' | 'width' | 'children'> {}\n\n export interface InternalProps extends DefaultProps, RequiredProps, OptionalProps {}\n}\n\nexport const defaultProps: DSDialogT.DefaultProps = {\n isOpen: false,\n centered: false,\n size: DSDialogSizes.DEFAULT,\n width: '',\n removeAutoFocus: false,\n onClickOutside: () => {},\n onClose: () => {},\n};\n\nexport const propTypes = {\n ...globalAttributesPropTypes,\n isOpen: PropTypes.bool.description('Whether 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('Callback that should be used to close the modal when the user clicks outside.')\n .defaultValue(() => {}),\n onClose: PropTypes.func.description('Callback triggered with ESC key.').defaultValue(() => {}),\n size: PropTypes.oneOf(DSDialogSizesArrayValues)\n .description(`Dialog's width size.`)\n .defaultValue(DSDialogSizes.DEFAULT),\n width: PropTypes.string.description('Dialog width.'),\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,2BAA2B,iBAAiB;AAErD,SAAS,eAAe,gCAAgC;AAiCjD,MAAM,eAAuC;AAAA,EAClD,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,MAAM,cAAc;AAAA,EACpB,OAAO;AAAA,EACP,iBAAiB;AAAA,EACjB,gBAAgB,MAAM;AAAA,EAAC;AAAA,EACvB,SAAS,MAAM;AAAA,EAAC;AAClB;AAEO,MAAM,YAAY;AAAA,EACvB,GAAG;AAAA,EACH,QAAQ,UAAU,KAAK,YAAY,oCAAoC,EAAE,aAAa,KAAK;AAAA,EAC3F,UAAU,UAAU,KAAK,YAAY,oBAAoB,EAAE;AAAA,EAC3D,UAAU,UAAU,KAAK,YAAY,qBAAqB,EAAE,aAAa,KAAK;AAAA,EAC9E,iBAAiB,UAAU,KACxB;AAAA,IACC;AAAA,EACF,EACC,aAAa,KAAK;AAAA,EACrB,gBAAgB,UAAU,KACvB,YAAY,+EAA+E,EAC3F,aAAa,MAAM;AAAA,EAAC,CAAC;AAAA,EACxB,SAAS,UAAU,KAAK,YAAY,kCAAkC,EAAE,aAAa,MAAM;AAAA,EAAC,CAAC;AAAA,EAC7F,MAAM,UAAU,MAAM,wBAAwB,EAC3C,YAAY,sBAAsB,EAClC,aAAa,cAAc,OAAO;AAAA,EACrC,OAAO,UAAU,OAAO,YAAY,eAAe;AACrD;",
6
+ "names": []
7
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/styles.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport { styled, createGlobalStyle, xStyledCommonProps } from '@elliemae/ds-system';\nimport type { XstyledProps } from '@elliemae/ds-props-helpers';\nimport { allSizes } from './utils.js';\nimport type { DSDialogT } from './propTypes.js';\nimport type { DSDialogInternalsT } from './sharedTypes.js';\n\ninterface PortalStylesT {\n portalInfo: DSDialogInternalsT.PortalInfo;\n portalClassName: string;\n}\n\ninterface StyledDialogBackgroundT {\n zIndex?: number;\n}\n\ninterface StyledDialogContainerT {\n size: DSDialogT.Sizes;\n centered: boolean;\n width: number | string;\n}\n\nexport const PortalStyles = createGlobalStyle<PortalStylesT>`\n ${({ portalClassName }) => `.${portalClassName}`} {\n overflow: hidden;\n ${({ portalInfo }) =>\n portalInfo.scrollbarWidth !== '0px'\n ? `padding-right: calc( ${portalInfo.paddingRight} + ${portalInfo.scrollbarWidth} ) !important;`\n : ``}\n }\n`;\n\nexport const StyledDialogBackground = styled.div<StyledDialogBackgroundT>`\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(37, 41, 47, 50%);\n overflow-y: auto;\n z-index: ${({ zIndex, theme }) => zIndex ?? theme.zIndex.dialog};\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, width }) => (width === '' ? allSizes[size] : width)};\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: auto;\n &:focus {\n outline: none;\n }\n max-height: 100vh;\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 line-height: 28px;\n margin: 0;\n`;\n\nexport const DSDialogAddon = styled.div``;\n\nexport const DSDialogHeader = styled('div')<React.PropsWithChildren & XstyledProps>`\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 ${xStyledCommonProps}\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 ${xStyledCommonProps}\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')<React.PropsWithChildren>`\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 ${xStyledCommonProps}\n`;\n"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport { styled, createGlobalStyle, xStyledCommonProps } from '@elliemae/ds-system';\nimport type { XstyledProps } from '@elliemae/ds-props-helpers';\nimport { allSizes } from './utils.js';\nimport type { DSDialogT } from './react-desc-prop-types.js';\nimport type { DSDialogInternalsT } from './sharedTypes.js';\n\ninterface PortalStylesT {\n portalInfo: DSDialogInternalsT.PortalInfo;\n portalClassName: string;\n}\n\ninterface StyledDialogBackgroundT {\n zIndex?: number;\n}\n\ninterface StyledDialogContainerT {\n size: DSDialogT.Sizes;\n centered: boolean;\n width: number | string;\n}\n\nexport const PortalStyles = createGlobalStyle<PortalStylesT>`\n ${({ portalClassName }) => `.${portalClassName}`} {\n overflow: hidden;\n ${({ portalInfo }) =>\n portalInfo.scrollbarWidth !== '0px'\n ? `padding-right: calc( ${portalInfo.paddingRight} + ${portalInfo.scrollbarWidth} ) !important;`\n : ``}\n }\n`;\n\nexport const StyledDialogBackground = styled.div<StyledDialogBackgroundT>`\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(37, 41, 47, 50%);\n overflow-y: auto;\n z-index: ${({ zIndex, theme }) => zIndex ?? theme.zIndex.dialog};\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, width }) => (width === '' ? allSizes[size] : width)};\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: auto;\n &:focus {\n outline: none;\n }\n max-height: 100vh;\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 line-height: 28px;\n margin: 0;\n`;\n\nexport const DSDialogAddon = styled.div``;\n\nexport const DSDialogHeader = styled('div')<React.PropsWithChildren & XstyledProps>`\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 ${xStyledCommonProps}\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 ${xStyledCommonProps}\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')<React.PropsWithChildren>`\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 ${xStyledCommonProps}\n`;\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,QAAQ,mBAAmB,0BAA0B;AAE9D,SAAS,gBAAgB;AAmBlB,MAAM,eAAe;AAAA,IACxB,CAAC,EAAE,gBAAgB,MAAM,IAAI;AAAA;AAAA,MAE3B,CAAC,EAAE,WAAW,MACd,WAAW,mBAAmB,QAC1B,wBAAwB,WAAW,kBAAkB,WAAW,iCAChE;AAAA;AAAA;AAIH,MAAM,yBAAyB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAShC,CAAC,EAAE,QAAQ,MAAM,MAAM,UAAU,MAAM,OAAO;AAAA;AAGpD,MAAM,wBAAwB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAOhC,CAAC,EAAE,SAAS,MAAO,WAAW,SAAS;AAAA,WACxC,CAAC,EAAE,MAAM,MAAM,MAAO,UAAU,KAAK,SAAS,IAAI,IAAI;AAAA;AAAA,8BAEnC,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA,gBACrD,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQlD,MAAM,gBAAgB,OAAO;AAAA,eACrB,CAAC,EAAE,MAAM,MAAM,MAAM,UAAU,MAAM,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAShD,MAAM,gBAAgB,OAAO;AAE7B,MAAM,iBAAiB,OAAO,KAAK;AAAA;AAAA;AAAA;AAAA,gBAI1B,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM;AAAA,kBACzB,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM;AAAA,MACvC,mBAAmB;AAAA;AAAA;AAAA;AAAA,MAInB;AAAA;AAAA;AAAA,IAGF;AAAA;AAGG,MAAM,oBAAoB,OAAO,GAAG,MAAM,OAAO,EAAE,eAAe,KAAK,EAAE;AAAA;AAAA,0BAEtD,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,KAAK;AAAA;AAG5D,MAAM,eAAe,OAAO,KAAK;AAAA,aAC3B,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM;AAAA;AAAA,IAEpC;AAAA;AAGG,MAAM,yBAAyB,OAAO;AAAA;AAAA;AAItC,MAAM,2BAA2B,OAAO;AAAA;AAAA,WAEpC,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA;AAG3C,MAAM,wBAAwB,OAAO,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA,cAKnC,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM;AAAA;AAAA,IAErC;AAAA;AAAA;AAAA;AAKG,MAAM,iBAAiB,OAAO,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA,cAK5B,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM;AAAA,gBACzB,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM;AAAA,eAC5B,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM;AAAA,IACtC;AAAA;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,105 @@
1
+ import * as React from "react";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import React2 from "react";
4
+ import { DSDialog } from "../index.js";
5
+ const ref = React2.createRef();
6
+ const noop = () => {
7
+ };
8
+ const testRequiredProps = {
9
+ children: "Content"
10
+ };
11
+ const testOptionalProps = {
12
+ portalRef: ref,
13
+ zIndex: 10
14
+ };
15
+ const testPartialDefaults = {
16
+ onClose: noop,
17
+ isOpen: true,
18
+ size: "medium"
19
+ };
20
+ const testProps = {
21
+ ...testRequiredProps,
22
+ ...testOptionalProps,
23
+ ...testPartialDefaults
24
+ };
25
+ const testPropsAsSyntax = {
26
+ ...testRequiredProps,
27
+ ...testOptionalProps,
28
+ ...testPartialDefaults
29
+ };
30
+ const testCompleteDefaults = {
31
+ centered: true,
32
+ isOpen: true,
33
+ onClickOutside: noop,
34
+ onClose: noop,
35
+ removeAutoFocus: false,
36
+ size: "default",
37
+ width: 300
38
+ };
39
+ const testInternalProps = {
40
+ ...testRequiredProps,
41
+ ...testOptionalProps,
42
+ ...testCompleteDefaults
43
+ };
44
+ const testInternalPropsAsSyntax = {
45
+ ...testRequiredProps,
46
+ ...testOptionalProps,
47
+ ...testCompleteDefaults
48
+ };
49
+ const testExplicitDefinition = {
50
+ centered: true,
51
+ isOpen: true,
52
+ onClickOutside: noop,
53
+ onClose: noop,
54
+ removeAutoFocus: false,
55
+ size: "default",
56
+ width: 300,
57
+ children: "Content",
58
+ portalRef: ref,
59
+ zIndex: 10
60
+ };
61
+ const testInferedTypeCompatibility = {
62
+ centered: true,
63
+ isOpen: true,
64
+ onClickOutside: noop,
65
+ onClose: noop,
66
+ removeAutoFocus: false,
67
+ size: "default",
68
+ width: 300,
69
+ children: "Content",
70
+ portalRef: ref,
71
+ zIndex: 10
72
+ };
73
+ const testDefinitionAsConst = {
74
+ centered: true,
75
+ isOpen: true,
76
+ onClickOutside: noop,
77
+ onClose: noop,
78
+ removeAutoFocus: false,
79
+ size: "default",
80
+ width: 300,
81
+ children: "Content",
82
+ portalRef: ref,
83
+ zIndex: 10
84
+ };
85
+ const ExampleUsageComponent = () => /* @__PURE__ */ jsxs(Fragment, { children: [
86
+ /* @__PURE__ */ jsx(DSDialog, { ...testExplicitDefinition }),
87
+ /* @__PURE__ */ jsx(DSDialog, { ...testInferedTypeCompatibility }),
88
+ /* @__PURE__ */ jsx(DSDialog, { ...testDefinitionAsConst }),
89
+ /* @__PURE__ */ jsx(
90
+ DSDialog,
91
+ {
92
+ centered: true,
93
+ isOpen: true,
94
+ onClickOutside: noop,
95
+ onClose: noop,
96
+ removeAutoFocus: false,
97
+ size: "default",
98
+ width: 300,
99
+ children: "Content",
100
+ portalRef: ref,
101
+ zIndex: 10
102
+ }
103
+ )
104
+ ] });
105
+ //# sourceMappingURL=typescript-dialog-valid.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/typescript-dialog-valid.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport React, { type MutableRefObject } from 'react';\nimport { DSDialog } from '../index.js';\nimport type { DSDialogT } from '../index.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForApp = DSDialogT.Props;\ntype ComponentPropsInternals = DSDialogT.InternalProps;\ntype ComponentPropsDefaultProps = DSDialogT.DefaultProps;\ntype ComponentPropsOptionalProps = DSDialogT.OptionalProps;\ntype ComponentPropsRequiredProps = DSDialogT.RequiredProps;\n\nconst ref = React.createRef() as MutableRefObject<HTMLElement>;\nconst noop = () => {};\n\nconst testRequiredProps: ComponentPropsRequiredProps = {\n children: 'Content',\n};\n\nconst testOptionalProps: ComponentPropsOptionalProps = {\n portalRef: ref,\n zIndex: 10,\n};\n\n// difference Props and InternalProps is that InternalProps has all the default props filled in\n// Props allows for partial defaults\nconst testPartialDefaults: Partial<ComponentPropsDefaultProps> = {\n onClose: noop,\n isOpen: true,\n size: 'medium',\n};\n\nconst testProps: ComponentPropsForApp = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n};\n\nconst testPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {\n centered: true,\n isOpen: true,\n onClickOutside: noop,\n onClose: noop,\n removeAutoFocus: false,\n size: 'default',\n width: 300,\n};\n\nconst testInternalProps: ComponentPropsInternals = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n};\n\nconst testInternalPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n} as ComponentPropsInternals;\n\n// using the explicit type definition, if there is an error, it will be marked on the key that is wrong\nconst testExplicitDefinition: ComponentPropsForApp = {\n centered: true,\n isOpen: true,\n onClickOutside: noop,\n onClose: noop,\n removeAutoFocus: false,\n size: 'default',\n width: 300,\n children: 'Content',\n portalRef: ref,\n zIndex: 10,\n};\n\n// using the \"as\" syntax, if there is an error, it will be marking the whole object as wrong because it is not compatible with the type\nconst testInferedTypeCompatibility = {\n centered: true,\n isOpen: true,\n onClickOutside: noop,\n onClose: noop,\n removeAutoFocus: false,\n size: 'default',\n width: 300,\n children: 'Content',\n portalRef: ref,\n zIndex: 10,\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n centered: true,\n isOpen: true,\n onClickOutside: noop,\n onClose: noop,\n removeAutoFocus: false,\n size: 'default',\n width: 300,\n children: 'Content',\n portalRef: ref,\n zIndex: 10,\n} as const;\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <DSDialog {...testExplicitDefinition} />\n <DSDialog {...testInferedTypeCompatibility} />\n <DSDialog {...testDefinitionAsConst} />\n {/* works with inline values */}\n <DSDialog\n centered\n isOpen\n onClickOutside={noop}\n onClose={noop}\n removeAutoFocus={false}\n size={'default'}\n width={300}\n children=\"Content\"\n portalRef={ref}\n zIndex={10}\n />\n </>\n);\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;AC6GrB,mBAEE,KAFF;AA5GF,OAAOA,YAAsC;AAC7C,SAAS,gBAAgB;AAUzB,MAAM,MAAMA,OAAM,UAAU;AAC5B,MAAM,OAAO,MAAM;AAAC;AAEpB,MAAM,oBAAiD;AAAA,EACrD,UAAU;AACZ;AAEA,MAAM,oBAAiD;AAAA,EACrD,WAAW;AAAA,EACX,QAAQ;AACV;AAIA,MAAM,sBAA2D;AAAA,EAC/D,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,MAAM;AACR;AAEA,MAAM,YAAkC;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,oBAAoB;AAAA,EACxB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,uBAA6D;AAAA,EACjE,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,SAAS;AAAA,EACT,iBAAiB;AAAA,EACjB,MAAM;AAAA,EACN,OAAO;AACT;AAEA,MAAM,oBAA6C;AAAA,EACjD,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,4BAA4B;AAAA,EAChC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,yBAA+C;AAAA,EACnD,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,SAAS;AAAA,EACT,iBAAiB;AAAA,EACjB,MAAM;AAAA,EACN,OAAO;AAAA,EACP,UAAU;AAAA,EACV,WAAW;AAAA,EACX,QAAQ;AACV;AAGA,MAAM,+BAA+B;AAAA,EACnC,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,SAAS;AAAA,EACT,iBAAiB;AAAA,EACjB,MAAM;AAAA,EACN,OAAO;AAAA,EACP,UAAU;AAAA,EACV,WAAW;AAAA,EACX,QAAQ;AACV;AAEA,MAAM,wBAAwB;AAAA,EAC5B,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,SAAS;AAAA,EACT,iBAAiB;AAAA,EACjB,MAAM;AAAA,EACN,OAAO;AAAA,EACP,UAAU;AAAA,EACV,WAAW;AAAA,EACX,QAAQ;AACV;AAEA,MAAM,wBAAwB,MAC5B,iCAEE;AAAA,sBAAC,YAAU,GAAG,wBAAwB;AAAA,EACtC,oBAAC,YAAU,GAAG,8BAA8B;AAAA,EAC5C,oBAAC,YAAU,GAAG,uBAAuB;AAAA,EAErC;AAAA,IAAC;AAAA;AAAA,MACC,UAAQ;AAAA,MACR,QAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,SAAS;AAAA,MACT,iBAAiB;AAAA,MACjB,MAAM;AAAA,MACN,OAAO;AAAA,MACP,UAAS;AAAA,MACT,WAAW;AAAA,MACX,QAAQ;AAAA;AAAA,EACV;AAAA,GACF;",
6
+ "names": ["React"]
7
+ }
@@ -1,5 +1,4 @@
1
- /// <reference types="react" />
2
- import type { DSDialogT } from './propTypes.js';
1
+ import type { DSDialogT } from './react-desc-prop-types.js';
3
2
  declare const DSDialog: {
4
3
  (props: DSDialogT.Props): JSX.Element;
5
4
  displayName: string;
@@ -1,3 +1,3 @@
1
- import type { DSDialogT } from '../propTypes.js';
1
+ import type { DSDialogT } from '../react-desc-prop-types.js';
2
2
  import type { DSDialogInternalsT } from '../sharedTypes.js';
3
3
  export declare const useDialog: (props: DSDialogT.Props) => DSDialogInternalsT.DSDialogContext;
@@ -12,3 +12,4 @@ export * from './DSDialog.js';
12
12
  export * from './DSDialogDatatestid.js';
13
13
  export { DSDialogSizes } from './utils.js';
14
14
  export { DSDialogBody, DSDialogHeader, DSDialogFooter, DSDialogSeparator, DSDialogTitle, DSDialogAddon, DSDialogDefaultLayout, DSDialogPrimaryMessage, DSDialogSecondaryMessage, DSDialogBodyWithSchema, DSDialogHeaderWithSchema, DSDialogFooterWithSchema, DSDialogSeparatorWithSchema, DSDialogTitleWithSchema, DSDialogAddonWithSchema, DSDialogDefaultLayoutWithSchema, DSDialogPrimaryMessageWithSchema, DSDialogSecondaryMessageWithSchema, };
15
+ export type { DSDialogT } from './react-desc-prop-types.js';
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const DSDialogPortal: () => JSX.Element | null;
@@ -10,18 +10,18 @@ export declare namespace DSDialogT {
10
10
  removeAutoFocus: boolean;
11
11
  onClickOutside: () => void;
12
12
  onClose: () => void;
13
- portalRef: React.MutableRefObject<HTMLElement | null> | null;
14
13
  width: string | number;
15
14
  }
16
- interface PropsRequired {
15
+ interface RequiredProps {
17
16
  children: TypescriptHelpersT.ReactChildrenComplete;
18
17
  }
19
- interface PropsOptional {
18
+ interface OptionalProps {
20
19
  zIndex?: number;
20
+ portalRef?: React.MutableRefObject<HTMLElement | null> | null;
21
21
  }
22
- interface InternalProps extends DefaultProps, PropsRequired, PropsOptional {
22
+ interface Props extends Partial<DefaultProps>, RequiredProps, OptionalProps, Omit<GlobalAttributesT<HTMLDivElement>, 'size' | 'width' | 'children'> {
23
23
  }
24
- interface Props extends Partial<DefaultProps>, PropsRequired, PropsOptional, Omit<GlobalAttributesT<HTMLDivElement>, 'size' | 'width' | 'children'> {
24
+ interface InternalProps extends DefaultProps, RequiredProps, OptionalProps {
25
25
  }
26
26
  }
27
27
  export declare const defaultProps: DSDialogT.DefaultProps;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import type { DSDialogT } from './propTypes.js';
2
+ import type { DSDialogT } from './react-desc-prop-types.js';
3
3
  export declare namespace DSDialogInternalsT {
4
4
  interface PortalInfo {
5
5
  scrollbarWidth: string;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import type { XstyledProps } from '@elliemae/ds-props-helpers';
3
- import type { DSDialogT } from './propTypes.js';
3
+ import type { DSDialogT } from './react-desc-prop-types.js';
4
4
  import type { DSDialogInternalsT } from './sharedTypes.js';
5
5
  interface PortalStylesT {
6
6
  portalInfo: DSDialogInternalsT.PortalInfo;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-dialog",
3
- "version": "3.33.0-next.3",
3
+ "version": "3.33.0-next.5",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Dialog",
6
6
  "files": [
@@ -69,17 +69,17 @@
69
69
  "dependencies": {
70
70
  "lodash": "~4.17.21",
71
71
  "uid": "~2.0.1",
72
- "@elliemae/ds-button": "3.33.0-next.3",
73
- "@elliemae/ds-icons": "3.33.0-next.3",
74
- "@elliemae/ds-props-helpers": "3.33.0-next.3",
75
- "@elliemae/ds-system": "3.33.0-next.3",
76
- "@elliemae/ds-typescript-helpers": "3.33.0-next.3",
77
- "@elliemae/ds-utilities": "3.33.0-next.3"
72
+ "@elliemae/ds-utilities": "3.33.0-next.5",
73
+ "@elliemae/ds-typescript-helpers": "3.33.0-next.5",
74
+ "@elliemae/ds-props-helpers": "3.33.0-next.5",
75
+ "@elliemae/ds-button": "3.33.0-next.5",
76
+ "@elliemae/ds-icons": "3.33.0-next.5",
77
+ "@elliemae/ds-system": "3.33.0-next.5"
78
78
  },
79
79
  "devDependencies": {
80
80
  "@elliemae/pui-cli": "~9.0.0-next.31",
81
81
  "styled-components": "~5.3.9",
82
- "@elliemae/ds-monorepo-devops": "3.33.0-next.3"
82
+ "@elliemae/ds-monorepo-devops": "3.33.0-next.5"
83
83
  },
84
84
  "peerDependencies": {
85
85
  "react": "^17.0.2",
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/propTypes.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import type {} from '@elliemae/ds-utilities';\nimport type { GlobalAttributesT } from '@elliemae/ds-props-helpers';\nimport { globalAttributesPropTypes, PropTypes } from '@elliemae/ds-props-helpers';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport { DSDialogSizes, DSDialogSizesArrayValues } from './utils.js';\n\nexport declare namespace DSDialogT {\n export type Sizes = 'default' | 'small' | 'medium' | 'large' | 'x-large' | 'xx-large';\n export interface DefaultProps {\n isOpen: boolean;\n centered: boolean;\n size: Sizes;\n removeAutoFocus: boolean;\n onClickOutside: () => void;\n onClose: () => void;\n portalRef: React.MutableRefObject<HTMLElement | null> | null;\n width: string | number;\n }\n\n export interface PropsRequired {\n children: TypescriptHelpersT.ReactChildrenComplete;\n }\n\n export interface PropsOptional {\n zIndex?: number;\n }\n\n export interface InternalProps extends DefaultProps, PropsRequired, PropsOptional {}\n\n export interface Props\n extends Partial<DefaultProps>,\n PropsRequired,\n PropsOptional,\n Omit<GlobalAttributesT<HTMLDivElement>, 'size' | 'width' | 'children'> {}\n}\n\nexport const defaultProps: DSDialogT.DefaultProps = {\n isOpen: false,\n centered: false,\n size: DSDialogSizes.DEFAULT,\n width: '',\n removeAutoFocus: false,\n onClickOutside: () => {},\n onClose: () => {},\n portalRef: null,\n};\n\nexport const propTypes = {\n ...globalAttributesPropTypes,\n isOpen: PropTypes.bool.description('Whether 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('Callback that should be used to close the modal when the user clicks outside.')\n .defaultValue(() => {}),\n onClose: PropTypes.func.description('Callback triggered with ESC key.').defaultValue(() => {}),\n size: PropTypes.oneOf(DSDialogSizesArrayValues)\n .description(`Dialog's width size.`)\n .defaultValue(DSDialogSizes.DEFAULT),\n width: PropTypes.string.description('Dialog width.'),\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,8BAAqD;AAErD,mBAAwD;AAgCjD,MAAM,eAAuC;AAAA,EAClD,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,MAAM,2BAAc;AAAA,EACpB,OAAO;AAAA,EACP,iBAAiB;AAAA,EACjB,gBAAgB,MAAM;AAAA,EAAC;AAAA,EACvB,SAAS,MAAM;AAAA,EAAC;AAAA,EAChB,WAAW;AACb;AAEO,MAAM,YAAY;AAAA,EACvB,GAAG;AAAA,EACH,QAAQ,kCAAU,KAAK,YAAY,oCAAoC,EAAE,aAAa,KAAK;AAAA,EAC3F,UAAU,kCAAU,KAAK,YAAY,oBAAoB,EAAE;AAAA,EAC3D,UAAU,kCAAU,KAAK,YAAY,qBAAqB,EAAE,aAAa,KAAK;AAAA,EAC9E,iBAAiB,kCAAU,KACxB;AAAA,IACC;AAAA,EACF,EACC,aAAa,KAAK;AAAA,EACrB,gBAAgB,kCAAU,KACvB,YAAY,+EAA+E,EAC3F,aAAa,MAAM;AAAA,EAAC,CAAC;AAAA,EACxB,SAAS,kCAAU,KAAK,YAAY,kCAAkC,EAAE,aAAa,MAAM;AAAA,EAAC,CAAC;AAAA,EAC7F,MAAM,kCAAU,MAAM,qCAAwB,EAC3C,YAAY,sBAAsB,EAClC,aAAa,2BAAc,OAAO;AAAA,EACrC,OAAO,kCAAU,OAAO,YAAY,eAAe;AACrD;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/propTypes.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type {} from '@elliemae/ds-utilities';\nimport type { GlobalAttributesT } from '@elliemae/ds-props-helpers';\nimport { globalAttributesPropTypes, PropTypes } from '@elliemae/ds-props-helpers';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport { DSDialogSizes, DSDialogSizesArrayValues } from './utils.js';\n\nexport declare namespace DSDialogT {\n export type Sizes = 'default' | 'small' | 'medium' | 'large' | 'x-large' | 'xx-large';\n export interface DefaultProps {\n isOpen: boolean;\n centered: boolean;\n size: Sizes;\n removeAutoFocus: boolean;\n onClickOutside: () => void;\n onClose: () => void;\n portalRef: React.MutableRefObject<HTMLElement | null> | null;\n width: string | number;\n }\n\n export interface PropsRequired {\n children: TypescriptHelpersT.ReactChildrenComplete;\n }\n\n export interface PropsOptional {\n zIndex?: number;\n }\n\n export interface InternalProps extends DefaultProps, PropsRequired, PropsOptional {}\n\n export interface Props\n extends Partial<DefaultProps>,\n PropsRequired,\n PropsOptional,\n Omit<GlobalAttributesT<HTMLDivElement>, 'size' | 'width' | 'children'> {}\n}\n\nexport const defaultProps: DSDialogT.DefaultProps = {\n isOpen: false,\n centered: false,\n size: DSDialogSizes.DEFAULT,\n width: '',\n removeAutoFocus: false,\n onClickOutside: () => {},\n onClose: () => {},\n portalRef: null,\n};\n\nexport const propTypes = {\n ...globalAttributesPropTypes,\n isOpen: PropTypes.bool.description('Whether 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('Callback that should be used to close the modal when the user clicks outside.')\n .defaultValue(() => {}),\n onClose: PropTypes.func.description('Callback triggered with ESC key.').defaultValue(() => {}),\n size: PropTypes.oneOf(DSDialogSizesArrayValues)\n .description(`Dialog's width size.`)\n .defaultValue(DSDialogSizes.DEFAULT),\n width: PropTypes.string.description('Dialog width.'),\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,2BAA2B,iBAAiB;AAErD,SAAS,eAAe,gCAAgC;AAgCjD,MAAM,eAAuC;AAAA,EAClD,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,MAAM,cAAc;AAAA,EACpB,OAAO;AAAA,EACP,iBAAiB;AAAA,EACjB,gBAAgB,MAAM;AAAA,EAAC;AAAA,EACvB,SAAS,MAAM;AAAA,EAAC;AAAA,EAChB,WAAW;AACb;AAEO,MAAM,YAAY;AAAA,EACvB,GAAG;AAAA,EACH,QAAQ,UAAU,KAAK,YAAY,oCAAoC,EAAE,aAAa,KAAK;AAAA,EAC3F,UAAU,UAAU,KAAK,YAAY,oBAAoB,EAAE;AAAA,EAC3D,UAAU,UAAU,KAAK,YAAY,qBAAqB,EAAE,aAAa,KAAK;AAAA,EAC9E,iBAAiB,UAAU,KACxB;AAAA,IACC;AAAA,EACF,EACC,aAAa,KAAK;AAAA,EACrB,gBAAgB,UAAU,KACvB,YAAY,+EAA+E,EAC3F,aAAa,MAAM;AAAA,EAAC,CAAC;AAAA,EACxB,SAAS,UAAU,KAAK,YAAY,kCAAkC,EAAE,aAAa,MAAM;AAAA,EAAC,CAAC;AAAA,EAC7F,MAAM,UAAU,MAAM,wBAAwB,EAC3C,YAAY,sBAAsB,EAClC,aAAa,cAAc,OAAO;AAAA,EACrC,OAAO,UAAU,OAAO,YAAY,eAAe;AACrD;",
6
- "names": []
7
- }