@elliemae/ds-dialog 3.16.0-next.2 → 3.16.0-next.21

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 (56) hide show
  1. package/dist/cjs/DSDialog.js +10 -6
  2. package/dist/cjs/DSDialog.js.map +2 -2
  3. package/dist/cjs/DSDialogCTX.js +4 -0
  4. package/dist/cjs/DSDialogCTX.js.map +2 -2
  5. package/dist/cjs/DSDialogDatatestid.js +4 -0
  6. package/dist/cjs/DSDialogDatatestid.js.map +1 -1
  7. package/dist/cjs/config/useDialog.js +10 -6
  8. package/dist/cjs/config/useDialog.js.map +2 -2
  9. package/dist/cjs/defaultProps.js +6 -1
  10. package/dist/cjs/defaultProps.js.map +2 -2
  11. package/dist/cjs/index.js +36 -32
  12. package/dist/cjs/index.js.map +2 -2
  13. package/dist/cjs/package.json +7 -0
  14. package/dist/cjs/parts/DSDialogPortal.js +6 -2
  15. package/dist/cjs/parts/DSDialogPortal.js.map +2 -2
  16. package/dist/cjs/parts/dialogContent/DSDialogContent.js +13 -8
  17. package/dist/cjs/parts/dialogContent/DSDialogContent.js.map +2 -2
  18. package/dist/cjs/parts/dialogContent/useDialogContent.js +5 -1
  19. package/dist/cjs/parts/dialogContent/useDialogContent.js.map +2 -2
  20. package/dist/cjs/propTypes.js +15 -10
  21. package/dist/cjs/propTypes.js.map +2 -2
  22. package/dist/cjs/sharedTypes.js +4 -0
  23. package/dist/cjs/sharedTypes.js.map +2 -2
  24. package/dist/cjs/styles.js +6 -2
  25. package/dist/cjs/styles.js.map +2 -2
  26. package/dist/cjs/utils.js +4 -0
  27. package/dist/cjs/utils.js.map +1 -1
  28. package/dist/esm/DSDialog.js +5 -5
  29. package/dist/esm/DSDialog.js.map +1 -1
  30. package/dist/esm/DSDialogCTX.js.map +1 -1
  31. package/dist/esm/config/useDialog.js +4 -4
  32. package/dist/esm/config/useDialog.js.map +2 -2
  33. package/dist/esm/defaultProps.js +2 -1
  34. package/dist/esm/defaultProps.js.map +2 -2
  35. package/dist/esm/index.js +5 -5
  36. package/dist/esm/index.js.map +1 -1
  37. package/dist/esm/package.json +7 -0
  38. package/dist/esm/parts/DSDialogPortal.js +2 -2
  39. package/dist/esm/parts/DSDialogPortal.js.map +1 -1
  40. package/dist/esm/parts/dialogContent/DSDialogContent.js +8 -7
  41. package/dist/esm/parts/dialogContent/DSDialogContent.js.map +2 -2
  42. package/dist/esm/parts/dialogContent/useDialogContent.js +1 -1
  43. package/dist/esm/parts/dialogContent/useDialogContent.js.map +1 -1
  44. package/dist/esm/propTypes.js +4 -3
  45. package/dist/esm/propTypes.js.map +2 -2
  46. package/dist/esm/styles.js +2 -2
  47. package/dist/esm/styles.js.map +2 -2
  48. package/dist/types/DSDialog.d.ts +2 -2
  49. package/dist/types/DSDialogCTX.d.ts +1 -1
  50. package/dist/types/config/useDialog.d.ts +2 -2
  51. package/dist/types/defaultProps.d.ts +1 -1
  52. package/dist/types/index.d.ts +13 -13
  53. package/dist/types/propTypes.d.ts +372 -371
  54. package/dist/types/sharedTypes.d.ts +1 -1
  55. package/dist/types/styles.d.ts +48 -0
  56. package/package.json +9 -8
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
18
18
  return to;
19
19
  };
20
20
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
25
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
26
  mod
23
27
  ));
@@ -30,16 +34,16 @@ __export(DSDialog_exports, {
30
34
  module.exports = __toCommonJS(DSDialog_exports);
31
35
  var React = __toESM(require("react"));
32
36
  var import_jsx_runtime = require("react/jsx-runtime");
33
- var import_ds_utilities = require("@elliemae/ds-utilities");
34
- var import_propTypes = require("./propTypes");
35
- var import_useDialog = require("./config/useDialog");
36
- var import_DSDialogPortal = require("./parts/DSDialogPortal");
37
- var import_DSDialogCTX = require("./DSDialogCTX");
37
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
38
+ var import_propTypes = require("./propTypes.js");
39
+ var import_useDialog = require("./config/useDialog.js");
40
+ var import_DSDialogPortal = require("./parts/DSDialogPortal.js");
41
+ var import_DSDialogCTX = require("./DSDialogCTX.js");
38
42
  const DSDialog = (props) => {
39
43
  const ctx = (0, import_useDialog.useDialog)(props);
40
44
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DSDialogCTX.DSDialogContext.Provider, { value: ctx, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DSDialogPortal.DSDialogPortal, {}) });
41
45
  };
42
46
  DSDialog.displayName = "DSDialog";
43
- const DSDialogWithSchema = (0, import_ds_utilities.describe)(DSDialog);
47
+ const DSDialogWithSchema = (0, import_ds_props_helpers.describe)(DSDialog);
44
48
  DSDialogWithSchema.propTypes = import_propTypes.propTypes;
45
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-utilities';\nimport { propTypes } from './propTypes';\nimport { useDialog } from './config/useDialog';\nimport { DSDialogPortal } from './parts/DSDialogPortal';\nimport { DSDialogContext } from './DSDialogCTX';\nimport type { DSDialogT } from './propTypes';\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,0BAAyB;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,8BAAS,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 './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;",
6
6
  "names": []
7
7
  }
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
18
18
  return to;
19
19
  };
20
20
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
25
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
26
  mod
23
27
  ));
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/DSDialogCTX.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { createContext } from 'react';\nimport type { DSDialogInternalsT } from './sharedTypes';\n\nconst defaultContext = {} as DSDialogInternalsT.DSDialogContext;\n\nexport const DSDialogContext = createContext<DSDialogInternalsT.DSDialogContext>(defaultContext);\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA8B;AAG9B,MAAM,iBAAiB,CAAC;AAEjB,MAAM,sBAAkB,4BAAkD,cAAc;",
4
+ "sourcesContent": ["import { createContext } from 'react';\nimport type { DSDialogInternalsT } from './sharedTypes.js';\n\nconst defaultContext = {} as DSDialogInternalsT.DSDialogContext;\n\nexport const DSDialogContext = createContext<DSDialogInternalsT.DSDialogContext>(defaultContext);\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA8B;AAG9B,MAAM,iBAAiB,CAAC;AAEjB,MAAM,sBAAkB,4BAAkD,cAAc;",
6
6
  "names": []
7
7
  }
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
18
18
  return to;
19
19
  };
20
20
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
25
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
26
  mod
23
27
  ));
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/DSDialogDatatestid.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["export const DSDialogDatatestid = {\n CONTAINER: 'ds-dialog-container',\n BACKGROUND: 'ds-dialog-background',\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,qBAAqB;AAAA,EAChC,WAAW;AAAA,EACX,YAAY;AACd;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,qBAAqB;AAAA,EAChC,WAAW;AAAA,EACX,YAAY;AACd;",
6
6
  "names": []
7
7
  }
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
18
18
  return to;
19
19
  };
20
20
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
25
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
26
  mod
23
27
  ));
@@ -31,13 +35,13 @@ var React = __toESM(require("react"));
31
35
  var import_react = require("react");
32
36
  var import_lodash = require("lodash");
33
37
  var import_uid = require("uid");
34
- var import_ds_utilities = require("@elliemae/ds-utilities");
35
- var import_defaultProps = require("../defaultProps");
36
- var import_propTypes = require("../propTypes");
37
- var import_utils = require("../utils");
38
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
39
+ var import_defaultProps = require("../defaultProps.js");
40
+ var import_propTypes = require("../propTypes.js");
41
+ var import_utils = require("../utils.js");
38
42
  const useDialog = (props) => {
39
- (0, import_ds_utilities.useValidateTypescriptPropTypes)(props, import_propTypes.propTypes, "DSDialog");
40
- const propsWithDefault = (0, import_ds_utilities.useMemoMergePropsWithDefault)(props, import_defaultProps.defaultProps);
43
+ (0, import_ds_props_helpers.useValidateTypescriptPropTypes)(props, import_propTypes.propTypes, "DSDialog");
44
+ const propsWithDefault = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(props, import_defaultProps.defaultProps);
41
45
  const { portalRef, isOpen } = propsWithDefault;
42
46
  const actualPortalRef = (0, import_react.useRef)(null);
43
47
  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 React, { useEffect, useMemo, useState, useCallback, useRef, useLayoutEffect } from 'react';\nimport { debounce } from 'lodash';\nimport { uid } from 'uid';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-utilities';\nimport { defaultProps } from '../defaultProps';\nimport { propTypes } from '../propTypes';\nimport { getScrollbarWidth, getCurrentRightPadding } from '../utils';\nimport type { DSDialogT } from '../propTypes';\nimport type { DSDialogInternalsT } from '../sharedTypes';\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,mBAA0F;AAC1F,oBAAyB;AACzB,iBAAoB;AACpB,0BAA6E;AAC7E,0BAA6B;AAC7B,uBAA0B;AAC1B,mBAA0D;AAInD,MAAM,YAAY,CAAC,UAA+D;AACvF,0DAAgD,OAAO,4BAAW,UAAU;AAC5E,QAAM,uBAAmB,kDAAsD,OAAO,gCAAY;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;AAAA,EACvE,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 React, { 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 } from '../defaultProps.js';\nimport { propTypes } 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,mBAA0F;AAC1F,oBAAyB;AACzB,iBAAoB;AACpB,8BAA6E;AAC7E,0BAA6B;AAC7B,uBAA0B;AAC1B,mBAA0D;AAInD,MAAM,YAAY,CAAC,UAA+D;AACvF,8DAAgD,OAAO,4BAAW,UAAU;AAC5E,QAAM,uBAAmB,sDAAsD,OAAO,gCAAY;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
  }
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
18
18
  return to;
19
19
  };
20
20
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
25
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
26
  mod
23
27
  ));
@@ -28,13 +32,14 @@ __export(defaultProps_exports, {
28
32
  });
29
33
  module.exports = __toCommonJS(defaultProps_exports);
30
34
  var React = __toESM(require("react"));
31
- var import_utils = require("./utils");
35
+ var import_utils = require("./utils.js");
32
36
  const noop = () => {
33
37
  };
34
38
  const defaultProps = {
35
39
  isOpen: false,
36
40
  centered: false,
37
41
  size: import_utils.DSDialogSizes.DEFAULT,
42
+ width: "",
38
43
  removeAutoFocus: false,
39
44
  onClickOutside: noop,
40
45
  onClose: noop,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/defaultProps.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { DSDialogSizes } from './utils';\nimport type { DSDialogT } from './propTypes';\n\nconst noop = () => {};\n\nexport const defaultProps: DSDialogT.DefaultProps = {\n isOpen: false,\n centered: false,\n size: DSDialogSizes.DEFAULT,\n removeAutoFocus: false,\n onClickOutside: noop,\n onClose: noop,\n portalRef: null,\n children: [],\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA8B;AAG9B,MAAM,OAAO,MAAM;AAAC;AAEb,MAAM,eAAuC;AAAA,EAClD,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,MAAM,2BAAc;AAAA,EACpB,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,SAAS;AAAA,EACT,WAAW;AAAA,EACX,UAAU,CAAC;AACb;",
4
+ "sourcesContent": ["import { DSDialogSizes } from './utils.js';\nimport type { DSDialogT } from './propTypes.js';\n\nconst noop = () => {};\n\nexport const defaultProps: DSDialogT.DefaultProps = {\n isOpen: false,\n centered: false,\n size: DSDialogSizes.DEFAULT,\n width: '',\n removeAutoFocus: false,\n onClickOutside: noop,\n onClose: noop,\n portalRef: null,\n children: [],\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA8B;AAG9B,MAAM,OAAO,MAAM;AAAC;AAEb,MAAM,eAAuC;AAAA,EAClD,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,MAAM,2BAAc;AAAA,EACpB,OAAO;AAAA,EACP,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,SAAS;AAAA,EACT,WAAW;AAAA,EACX,UAAU,CAAC;AACb;",
6
6
  "names": []
7
7
  }
package/dist/cjs/index.js CHANGED
@@ -19,6 +19,10 @@ var __copyProps = (to, from, except, desc) => {
19
19
  };
20
20
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
21
21
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
22
26
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
23
27
  mod
24
28
  ));
@@ -47,20 +51,20 @@ __export(src_exports, {
47
51
  });
48
52
  module.exports = __toCommonJS(src_exports);
49
53
  var React = __toESM(require("react"));
50
- var import_ds_utilities = require("@elliemae/ds-utilities");
51
- var import_styles = require("./styles");
52
- __reExport(src_exports, require("./DSDialog"), module.exports);
53
- __reExport(src_exports, require("./DSDialogDatatestid"), module.exports);
54
- var import_utils = require("./utils");
55
- import_styles.DSDialogBody.propTypes = import_ds_utilities.globalAttributesPropTypes;
56
- import_styles.DSDialogHeader.propTypes = import_ds_utilities.globalAttributesPropTypes;
57
- import_styles.DSDialogFooter.propTypes = import_ds_utilities.globalAttributesPropTypes;
58
- import_styles.DSDialogSeparator.propTypes = import_ds_utilities.globalAttributesPropTypes;
59
- import_styles.DSDialogTitle.propTypes = import_ds_utilities.globalAttributesPropTypes;
60
- import_styles.DSDialogAddon.propTypes = import_ds_utilities.globalAttributesPropTypes;
61
- import_styles.DSDialogDefaultLayout.propTypes = import_ds_utilities.globalAttributesPropTypes;
62
- import_styles.DSDialogPrimaryMessage.propTypes = import_ds_utilities.globalAttributesPropTypes;
63
- import_styles.DSDialogSecondaryMessage.propTypes = import_ds_utilities.globalAttributesPropTypes;
54
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
55
+ var import_styles = require("./styles.js");
56
+ __reExport(src_exports, require("./DSDialog.js"), module.exports);
57
+ __reExport(src_exports, require("./DSDialogDatatestid.js"), module.exports);
58
+ var import_utils = require("./utils.js");
59
+ import_styles.DSDialogBody.propTypes = import_ds_props_helpers.globalAttributesPropTypes;
60
+ import_styles.DSDialogHeader.propTypes = import_ds_props_helpers.globalAttributesPropTypes;
61
+ import_styles.DSDialogFooter.propTypes = import_ds_props_helpers.globalAttributesPropTypes;
62
+ import_styles.DSDialogSeparator.propTypes = import_ds_props_helpers.globalAttributesPropTypes;
63
+ import_styles.DSDialogTitle.propTypes = import_ds_props_helpers.globalAttributesPropTypes;
64
+ import_styles.DSDialogAddon.propTypes = import_ds_props_helpers.globalAttributesPropTypes;
65
+ import_styles.DSDialogDefaultLayout.propTypes = import_ds_props_helpers.globalAttributesPropTypes;
66
+ import_styles.DSDialogPrimaryMessage.propTypes = import_ds_props_helpers.globalAttributesPropTypes;
67
+ import_styles.DSDialogSecondaryMessage.propTypes = import_ds_props_helpers.globalAttributesPropTypes;
64
68
  import_styles.DSDialogBody.displayName = "DSDialogBody";
65
69
  import_styles.DSDialogHeader.displayName = "DSDialogHeader";
66
70
  import_styles.DSDialogFooter.displayName = "DSDialogFooter";
@@ -70,22 +74,22 @@ import_styles.DSDialogAddon.displayName = "DSDialogAddon";
70
74
  import_styles.DSDialogDefaultLayout.displayName = "DSDialogDefaultLayout";
71
75
  import_styles.DSDialogPrimaryMessage.displayName = "DSDialogPrimaryMessage";
72
76
  import_styles.DSDialogSecondaryMessage.displayName = "DSDialogSecondaryMessage";
73
- const DSDialogBodyWithSchema = (0, import_ds_utilities.describe)(import_styles.DSDialogBody);
74
- const DSDialogHeaderWithSchema = (0, import_ds_utilities.describe)(import_styles.DSDialogHeader);
75
- const DSDialogFooterWithSchema = (0, import_ds_utilities.describe)(import_styles.DSDialogFooter);
76
- const DSDialogSeparatorWithSchema = (0, import_ds_utilities.describe)(import_styles.DSDialogSeparator);
77
- const DSDialogTitleWithSchema = (0, import_ds_utilities.describe)(import_styles.DSDialogTitle);
78
- const DSDialogAddonWithSchema = (0, import_ds_utilities.describe)(import_styles.DSDialogAddon);
79
- const DSDialogDefaultLayoutWithSchema = (0, import_ds_utilities.describe)(import_styles.DSDialogDefaultLayout);
80
- const DSDialogPrimaryMessageWithSchema = (0, import_ds_utilities.describe)(import_styles.DSDialogPrimaryMessage);
81
- const DSDialogSecondaryMessageWithSchema = (0, import_ds_utilities.describe)(import_styles.DSDialogSecondaryMessage);
82
- DSDialogBodyWithSchema.propTypes = import_ds_utilities.globalAttributesPropTypes;
83
- DSDialogHeaderWithSchema.propTypes = import_ds_utilities.globalAttributesPropTypes;
84
- DSDialogFooterWithSchema.propTypes = import_ds_utilities.globalAttributesPropTypes;
85
- DSDialogSeparatorWithSchema.propTypes = import_ds_utilities.globalAttributesPropTypes;
86
- DSDialogTitleWithSchema.propTypes = import_ds_utilities.globalAttributesPropTypes;
87
- DSDialogAddonWithSchema.propTypes = import_ds_utilities.globalAttributesPropTypes;
88
- DSDialogDefaultLayoutWithSchema.propTypes = import_ds_utilities.globalAttributesPropTypes;
89
- DSDialogPrimaryMessageWithSchema.propTypes = import_ds_utilities.globalAttributesPropTypes;
90
- DSDialogSecondaryMessageWithSchema.propTypes = import_ds_utilities.globalAttributesPropTypes;
77
+ const DSDialogBodyWithSchema = (0, import_ds_props_helpers.describe)(import_styles.DSDialogBody);
78
+ const DSDialogHeaderWithSchema = (0, import_ds_props_helpers.describe)(import_styles.DSDialogHeader);
79
+ const DSDialogFooterWithSchema = (0, import_ds_props_helpers.describe)(import_styles.DSDialogFooter);
80
+ const DSDialogSeparatorWithSchema = (0, import_ds_props_helpers.describe)(import_styles.DSDialogSeparator);
81
+ const DSDialogTitleWithSchema = (0, import_ds_props_helpers.describe)(import_styles.DSDialogTitle);
82
+ const DSDialogAddonWithSchema = (0, import_ds_props_helpers.describe)(import_styles.DSDialogAddon);
83
+ const DSDialogDefaultLayoutWithSchema = (0, import_ds_props_helpers.describe)(import_styles.DSDialogDefaultLayout);
84
+ const DSDialogPrimaryMessageWithSchema = (0, import_ds_props_helpers.describe)(import_styles.DSDialogPrimaryMessage);
85
+ const DSDialogSecondaryMessageWithSchema = (0, import_ds_props_helpers.describe)(import_styles.DSDialogSecondaryMessage);
86
+ DSDialogBodyWithSchema.propTypes = import_ds_props_helpers.globalAttributesPropTypes;
87
+ DSDialogHeaderWithSchema.propTypes = import_ds_props_helpers.globalAttributesPropTypes;
88
+ DSDialogFooterWithSchema.propTypes = import_ds_props_helpers.globalAttributesPropTypes;
89
+ DSDialogSeparatorWithSchema.propTypes = import_ds_props_helpers.globalAttributesPropTypes;
90
+ DSDialogTitleWithSchema.propTypes = import_ds_props_helpers.globalAttributesPropTypes;
91
+ DSDialogAddonWithSchema.propTypes = import_ds_props_helpers.globalAttributesPropTypes;
92
+ DSDialogDefaultLayoutWithSchema.propTypes = import_ds_props_helpers.globalAttributesPropTypes;
93
+ DSDialogPrimaryMessageWithSchema.propTypes = import_ds_props_helpers.globalAttributesPropTypes;
94
+ DSDialogSecondaryMessageWithSchema.propTypes = import_ds_props_helpers.globalAttributesPropTypes;
91
95
  //# sourceMappingURL=index.js.map
@@ -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-utilities';\nimport {\n DSDialogBody,\n DSDialogHeader,\n DSDialogFooter,\n DSDialogSeparator,\n DSDialogTitle,\n DSDialogAddon,\n DSDialogDefaultLayout,\n DSDialogPrimaryMessage,\n DSDialogSecondaryMessage,\n} from './styles';\n\nDSDialogBody.propTypes = globalAttributesPropTypes;\nDSDialogHeader.propTypes = globalAttributesPropTypes;\nDSDialogFooter.propTypes = globalAttributesPropTypes;\nDSDialogSeparator.propTypes = globalAttributesPropTypes;\nDSDialogTitle.propTypes = globalAttributesPropTypes;\nDSDialogAddon.propTypes = globalAttributesPropTypes;\nDSDialogDefaultLayout.propTypes = globalAttributesPropTypes;\nDSDialogPrimaryMessage.propTypes = globalAttributesPropTypes;\nDSDialogSecondaryMessage.propTypes = globalAttributesPropTypes;\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);\nconst DSDialogHeaderWithSchema = describe(DSDialogHeader);\nconst DSDialogFooterWithSchema = describe(DSDialogFooter);\nconst DSDialogSeparatorWithSchema = describe(DSDialogSeparator);\nconst DSDialogTitleWithSchema = describe(DSDialogTitle);\nconst DSDialogAddonWithSchema = describe(DSDialogAddon);\nconst DSDialogDefaultLayoutWithSchema = describe(DSDialogDefaultLayout);\nconst DSDialogPrimaryMessageWithSchema = describe(DSDialogPrimaryMessage);\nconst DSDialogSecondaryMessageWithSchema = describe(DSDialogSecondaryMessage);\n\nDSDialogBodyWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogHeaderWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogFooterWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogSeparatorWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogTitleWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogAddonWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogDefaultLayoutWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogPrimaryMessageWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogSecondaryMessageWithSchema.propTypes = globalAttributesPropTypes;\n\nexport * from './DSDialog';\nexport * from './DSDialogDatatestid';\nexport { DSDialogSizes } from './utils';\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"],
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,0BAAoD;AACpD,oBAUO;AA0CP,wBAAc,uBArDd;AAsDA,wBAAc,iCAtDd;AAuDA,mBAA8B;AA1C9B,2BAAa,YAAY;AACzB,6BAAe,YAAY;AAC3B,6BAAe,YAAY;AAC3B,gCAAkB,YAAY;AAC9B,4BAAc,YAAY;AAC1B,4BAAc,YAAY;AAC1B,oCAAsB,YAAY;AAClC,qCAAuB,YAAY;AACnC,uCAAyB,YAAY;AAErC,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,8BAAS,0BAAY;AACpD,MAAM,+BAA2B,8BAAS,4BAAc;AACxD,MAAM,+BAA2B,8BAAS,4BAAc;AACxD,MAAM,kCAA8B,8BAAS,+BAAiB;AAC9D,MAAM,8BAA0B,8BAAS,2BAAa;AACtD,MAAM,8BAA0B,8BAAS,2BAAa;AACtD,MAAM,sCAAkC,8BAAS,mCAAqB;AACtE,MAAM,uCAAmC,8BAAS,oCAAsB;AACxE,MAAM,yCAAqC,8BAAS,sCAAwB;AAE5E,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;",
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';\n\nDSDialogBody.propTypes = globalAttributesPropTypes;\nDSDialogHeader.propTypes = globalAttributesPropTypes;\nDSDialogFooter.propTypes = globalAttributesPropTypes;\nDSDialogSeparator.propTypes = globalAttributesPropTypes;\nDSDialogTitle.propTypes = globalAttributesPropTypes;\nDSDialogAddon.propTypes = globalAttributesPropTypes;\nDSDialogDefaultLayout.propTypes = globalAttributesPropTypes;\nDSDialogPrimaryMessage.propTypes = globalAttributesPropTypes;\nDSDialogSecondaryMessage.propTypes = globalAttributesPropTypes;\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);\nconst DSDialogHeaderWithSchema = describe(DSDialogHeader);\nconst DSDialogFooterWithSchema = describe(DSDialogFooter);\nconst DSDialogSeparatorWithSchema = describe(DSDialogSeparator);\nconst DSDialogTitleWithSchema = describe(DSDialogTitle);\nconst DSDialogAddonWithSchema = describe(DSDialogAddon);\nconst DSDialogDefaultLayoutWithSchema = describe(DSDialogDefaultLayout);\nconst DSDialogPrimaryMessageWithSchema = describe(DSDialogPrimaryMessage);\nconst DSDialogSecondaryMessageWithSchema = describe(DSDialogSecondaryMessage);\n\nDSDialogBodyWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogHeaderWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogFooterWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogSeparatorWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogTitleWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogAddonWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogDefaultLayoutWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogPrimaryMessageWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogSecondaryMessageWithSchema.propTypes = globalAttributesPropTypes;\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"],
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;AA0CP,wBAAc,0BArDd;AAsDA,wBAAc,oCAtDd;AAuDA,mBAA8B;AA1C9B,2BAAa,YAAY;AACzB,6BAAe,YAAY;AAC3B,6BAAe,YAAY;AAC3B,gCAAkB,YAAY;AAC9B,4BAAc,YAAY;AAC1B,4BAAc,YAAY;AAC1B,oCAAsB,YAAY;AAClC,qCAAuB,YAAY;AACnC,uCAAyB,YAAY;AAErC,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,0BAAY;AACpD,MAAM,+BAA2B,kCAAS,4BAAc;AACxD,MAAM,+BAA2B,kCAAS,4BAAc;AACxD,MAAM,kCAA8B,kCAAS,+BAAiB;AAC9D,MAAM,8BAA0B,kCAAS,2BAAa;AACtD,MAAM,8BAA0B,kCAAS,2BAAa;AACtD,MAAM,sCAAkC,kCAAS,mCAAqB;AACtE,MAAM,uCAAmC,kCAAS,oCAAsB;AACxE,MAAM,yCAAqC,kCAAS,sCAAwB;AAE5E,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
  }
@@ -0,0 +1,7 @@
1
+ {
2
+ "type": "commonjs",
3
+ "sideEffects": [
4
+ "*.css",
5
+ "*.scss"
6
+ ]
7
+ }
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
18
18
  return to;
19
19
  };
20
20
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
25
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
26
  mod
23
27
  ));
@@ -31,8 +35,8 @@ var React = __toESM(require("react"));
31
35
  var import_jsx_runtime = require("react/jsx-runtime");
32
36
  var import_react = require("react");
33
37
  var import_react_dom = __toESM(require("react-dom"));
34
- var import_DSDialogCTX = require("../DSDialogCTX");
35
- var import_DSDialogContent = require("./dialogContent/DSDialogContent");
38
+ var import_DSDialogCTX = require("../DSDialogCTX.js");
39
+ var import_DSDialogContent = require("./dialogContent/DSDialogContent.js");
36
40
  const DSDialogPortal = () => {
37
41
  const {
38
42
  props: { isOpen },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/parts/DSDialogPortal.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import React, { useContext } from 'react';\nimport ReactDOM from 'react-dom';\nimport { DSDialogContext } from '../DSDialogCTX';\nimport { DSDialogContent } from './dialogContent/DSDialogContent';\n\nexport const DSDialogPortal = (): JSX.Element | null => {\n const {\n props: { isOpen },\n actualPortalRef,\n } = useContext(DSDialogContext);\n\n if (isOpen && actualPortalRef.current) {\n return ReactDOM.createPortal(<DSDialogContent />, actualPortalRef.current);\n }\n\n return null;\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADYU;AAZjC,mBAAkC;AAClC,uBAAqB;AACrB,yBAAgC;AAChC,6BAAgC;AAEzB,MAAM,iBAAiB,MAA0B;AACtD,QAAM;AAAA,IACJ,OAAO,EAAE,OAAO;AAAA,IAChB;AAAA,EACF,QAAI,yBAAW,kCAAe;AAE9B,MAAI,UAAU,gBAAgB,SAAS;AACrC,WAAO,iBAAAA,QAAS,aAAa,4CAAC,0CAAgB,GAAI,gBAAgB,OAAO;AAAA,EAC3E;AAEA,SAAO;AACT;",
4
+ "sourcesContent": ["import React, { useContext } from 'react';\nimport ReactDOM from 'react-dom';\nimport { DSDialogContext } from '../DSDialogCTX.js';\nimport { DSDialogContent } from './dialogContent/DSDialogContent.js';\n\nexport const DSDialogPortal = (): JSX.Element | null => {\n const {\n props: { isOpen },\n actualPortalRef,\n } = useContext(DSDialogContext);\n\n if (isOpen && actualPortalRef.current) {\n return ReactDOM.createPortal(<DSDialogContent />, actualPortalRef.current);\n }\n\n return null;\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADYU;AAZjC,mBAAkC;AAClC,uBAAqB;AACrB,yBAAgC;AAChC,6BAAgC;AAEzB,MAAM,iBAAiB,MAA0B;AACtD,QAAM;AAAA,IACJ,OAAO,EAAE,OAAO;AAAA,IAChB;AAAA,EACF,QAAI,yBAAW,kCAAe;AAE9B,MAAI,UAAU,gBAAgB,SAAS;AACrC,WAAO,iBAAAA,QAAS,aAAa,4CAAC,0CAAgB,GAAI,gBAAgB,OAAO;AAAA,EAC3E;AAEA,SAAO;AACT;",
6
6
  "names": ["ReactDOM"]
7
7
  }
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
18
18
  return to;
19
19
  };
20
20
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
25
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
26
  mod
23
27
  ));
@@ -30,17 +34,17 @@ module.exports = __toCommonJS(DSDialogContent_exports);
30
34
  var React = __toESM(require("react"));
31
35
  var import_jsx_runtime = require("react/jsx-runtime");
32
36
  var import_react = require("react");
33
- var import_ds_utilities = require("@elliemae/ds-utilities");
34
- var import_styles = require("../../styles");
35
- var import_utils = require("../../utils");
36
- var import_DSDialogDatatestid = require("../../DSDialogDatatestid");
37
- var import_DSDialogCTX = require("../../DSDialogCTX");
38
- var import_useDialogContent = require("./useDialogContent");
37
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
38
+ var import_styles = require("../../styles.js");
39
+ var import_utils = require("../../utils.js");
40
+ var import_DSDialogDatatestid = require("../../DSDialogDatatestid.js");
41
+ var import_DSDialogCTX = require("../../DSDialogCTX.js");
42
+ var import_useDialogContent = require("./useDialogContent.js");
39
43
  const DSDialogContent = () => {
40
44
  const { handleOutsideClick, handleOnKeyDown } = (0, import_useDialogContent.useDialogContent)();
41
45
  const { props, containerRef, portalInfo, portalClassName } = (0, import_react.useContext)(import_DSDialogCTX.DSDialogContext);
42
- const { removeAutoFocus, zIndex, centered, size, children, ...rest } = props;
43
- const { className, ...restOfGlobalAttributes } = (0, import_ds_utilities.useGetGlobalAttributes)(props, {
46
+ const { removeAutoFocus, zIndex, centered, size, width, children, ...rest } = props;
47
+ const { className, ...restOfGlobalAttributes } = (0, import_ds_props_helpers.useGetGlobalAttributes)(props, {
44
48
  onClick: handleOutsideClick,
45
49
  onKeyDown: handleOnKeyDown
46
50
  });
@@ -77,6 +81,7 @@ const DSDialogContent = () => {
77
81
  "data-testid": import_DSDialogDatatestid.DSDialogDatatestid.CONTAINER,
78
82
  ...restOfGlobalAttributes,
79
83
  size,
84
+ width,
80
85
  children
81
86
  }
82
87
  )
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/parts/dialogContent/DSDialogContent.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import React, { useCallback, useContext } from 'react';\nimport { useGetGlobalAttributes } from '@elliemae/ds-utilities';\nimport { PortalStyles, StyledDialogBackground, StyledDialogContainer } from '../../styles';\nimport { getSpaceProps } from '../../utils';\nimport { DSDialogDatatestid } from '../../DSDialogDatatestid';\nimport { DSDialogContext } from '../../DSDialogCTX';\nimport { useDialogContent } from './useDialogContent';\n\nexport const DSDialogContent = () => {\n const { handleOutsideClick, handleOnKeyDown } = useDialogContent();\n const { props, containerRef, portalInfo, portalClassName } = useContext(DSDialogContext);\n\n const { removeAutoFocus, zIndex, centered, size, children, ...rest } = props;\n\n const { className, ...restOfGlobalAttributes } = useGetGlobalAttributes(props, {\n onClick: handleOutsideClick,\n onKeyDown: handleOnKeyDown,\n });\n\n const refCallback = useCallback(\n (_ref: HTMLDivElement | null) => {\n if (_ref) {\n containerRef.current = _ref;\n if (!removeAutoFocus) _ref.focus();\n }\n },\n [containerRef, removeAutoFocus],\n );\n\n return (\n <StyledDialogBackground\n className={className}\n onClick={handleOutsideClick}\n data-portalbg\n data-testid={DSDialogDatatestid.BACKGROUND}\n zIndex={zIndex}\n >\n <PortalStyles portalInfo={portalInfo} portalClassName={portalClassName} />\n <StyledDialogContainer\n role=\"dialog\"\n aria-modal\n ref={refCallback}\n tabIndex={!removeAutoFocus ? 0 : undefined}\n onKeyDown={handleOnKeyDown}\n {...getSpaceProps(rest as unknown as Record<string, unknown>)}\n centered={centered}\n data-testid={DSDialogDatatestid.CONTAINER}\n {...restOfGlobalAttributes}\n size={size}\n >\n {children}\n </StyledDialogContainer>\n </StyledDialogBackground>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD8BnB;AA9BJ,mBAA+C;AAC/C,0BAAuC;AACvC,oBAA4E;AAC5E,mBAA8B;AAC9B,gCAAmC;AACnC,yBAAgC;AAChC,8BAAiC;AAE1B,MAAM,kBAAkB,MAAM;AACnC,QAAM,EAAE,oBAAoB,gBAAgB,QAAI,0CAAiB;AACjE,QAAM,EAAE,OAAO,cAAc,YAAY,gBAAgB,QAAI,yBAAW,kCAAe;AAEvF,QAAM,EAAE,iBAAiB,QAAQ,UAAU,MAAM,aAAa,KAAK,IAAI;AAEvE,QAAM,EAAE,cAAc,uBAAuB,QAAI,4CAAuB,OAAO;AAAA,IAC7E,SAAS;AAAA,IACT,WAAW;AAAA,EACb,CAAC;AAED,QAAM,kBAAc;AAAA,IAClB,CAAC,SAAgC;AAC/B,UAAI,MAAM;AACR,qBAAa,UAAU;AACvB,YAAI,CAAC;AAAiB,eAAK,MAAM;AAAA,MACnC;AAAA,IACF;AAAA,IACA,CAAC,cAAc,eAAe;AAAA,EAChC;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,SAAS;AAAA,MACT,iBAAa;AAAA,MACb,eAAa,6CAAmB;AAAA,MAChC;AAAA,MAEA;AAAA,oDAAC,8BAAa,YAAwB,iBAAkC;AAAA,QACxE;AAAA,UAAC;AAAA;AAAA,YACC,MAAK;AAAA,YACL,cAAU;AAAA,YACV,KAAK;AAAA,YACL,UAAU,CAAC,kBAAkB,IAAI;AAAA,YACjC,WAAW;AAAA,YACV,OAAG,4BAAc,IAA0C;AAAA,YAC5D;AAAA,YACA,eAAa,6CAAmB;AAAA,YAC/B,GAAG;AAAA,YACJ;AAAA,YAEC;AAAA;AAAA,QACH;AAAA;AAAA;AAAA,EACF;AAEJ;",
4
+ "sourcesContent": ["import React, { useCallback, useContext } from 'react';\nimport { useGetGlobalAttributes } from '@elliemae/ds-props-helpers';\nimport { PortalStyles, StyledDialogBackground, StyledDialogContainer } from '../../styles.js';\nimport { getSpaceProps } from '../../utils.js';\nimport { DSDialogDatatestid } from '../../DSDialogDatatestid.js';\nimport { DSDialogContext } from '../../DSDialogCTX.js';\nimport { useDialogContent } from './useDialogContent.js';\n\nexport const DSDialogContent = () => {\n const { handleOutsideClick, handleOnKeyDown } = useDialogContent();\n const { props, containerRef, portalInfo, portalClassName } = useContext(DSDialogContext);\n\n const { removeAutoFocus, zIndex, centered, size, width, children, ...rest } = props;\n\n const { className, ...restOfGlobalAttributes } = useGetGlobalAttributes(props, {\n onClick: handleOutsideClick,\n onKeyDown: handleOnKeyDown,\n });\n\n const refCallback = useCallback(\n (_ref: HTMLDivElement | null) => {\n if (_ref) {\n containerRef.current = _ref;\n if (!removeAutoFocus) _ref.focus();\n }\n },\n [containerRef, removeAutoFocus],\n );\n\n return (\n <StyledDialogBackground\n className={className}\n onClick={handleOutsideClick}\n data-portalbg\n data-testid={DSDialogDatatestid.BACKGROUND}\n zIndex={zIndex}\n >\n <PortalStyles portalInfo={portalInfo} portalClassName={portalClassName} />\n <StyledDialogContainer\n role=\"dialog\"\n aria-modal\n ref={refCallback}\n tabIndex={!removeAutoFocus ? 0 : undefined}\n onKeyDown={handleOnKeyDown}\n {...getSpaceProps(rest as unknown as Record<string, unknown>)}\n centered={centered}\n data-testid={DSDialogDatatestid.CONTAINER}\n {...restOfGlobalAttributes}\n size={size}\n width={width}\n >\n {children}\n </StyledDialogContainer>\n </StyledDialogBackground>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD8BnB;AA9BJ,mBAA+C;AAC/C,8BAAuC;AACvC,oBAA4E;AAC5E,mBAA8B;AAC9B,gCAAmC;AACnC,yBAAgC;AAChC,8BAAiC;AAE1B,MAAM,kBAAkB,MAAM;AACnC,QAAM,EAAE,oBAAoB,gBAAgB,QAAI,0CAAiB;AACjE,QAAM,EAAE,OAAO,cAAc,YAAY,gBAAgB,QAAI,yBAAW,kCAAe;AAEvF,QAAM,EAAE,iBAAiB,QAAQ,UAAU,MAAM,OAAO,UAAU,GAAG,KAAK,IAAI;AAE9E,QAAM,EAAE,WAAW,GAAG,uBAAuB,QAAI,gDAAuB,OAAO;AAAA,IAC7E,SAAS;AAAA,IACT,WAAW;AAAA,EACb,CAAC;AAED,QAAM,kBAAc;AAAA,IAClB,CAAC,SAAgC;AAC/B,UAAI,MAAM;AACR,qBAAa,UAAU;AACvB,YAAI,CAAC;AAAiB,eAAK,MAAM;AAAA,MACnC;AAAA,IACF;AAAA,IACA,CAAC,cAAc,eAAe;AAAA,EAChC;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,SAAS;AAAA,MACT,iBAAa;AAAA,MACb,eAAa,6CAAmB;AAAA,MAChC;AAAA,MAEA;AAAA,oDAAC,8BAAa,YAAwB,iBAAkC;AAAA,QACxE;AAAA,UAAC;AAAA;AAAA,YACC,MAAK;AAAA,YACL,cAAU;AAAA,YACV,KAAK;AAAA,YACL,UAAU,CAAC,kBAAkB,IAAI;AAAA,YACjC,WAAW;AAAA,YACV,OAAG,4BAAc,IAA0C;AAAA,YAC5D;AAAA,YACA,eAAa,6CAAmB;AAAA,YAC/B,GAAG;AAAA,YACJ;AAAA,YACA;AAAA,YAEC;AAAA;AAAA,QACH;AAAA;AAAA;AAAA,EACF;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
18
18
  return to;
19
19
  };
20
20
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
25
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
26
  mod
23
27
  ));
@@ -29,7 +33,7 @@ __export(useDialogContent_exports, {
29
33
  module.exports = __toCommonJS(useDialogContent_exports);
30
34
  var React = __toESM(require("react"));
31
35
  var import_react = require("react");
32
- var import_DSDialogCTX = require("../../DSDialogCTX");
36
+ var import_DSDialogCTX = require("../../DSDialogCTX.js");
33
37
  const useDialogContent = () => {
34
38
  const {
35
39
  props: { onClickOutside, onClose }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/parts/dialogContent/useDialogContent.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import type React from 'react';\nimport { useCallback, useContext } from 'react';\nimport { DSDialogContext } from '../../DSDialogCTX';\n\nexport const useDialogContent = () => {\n const {\n props: { onClickOutside, onClose },\n } = useContext(DSDialogContext);\n\n const handleOutsideClick = useCallback(\n (e: React.MouseEvent) => {\n if ((e.target as HTMLDivElement).dataset.portalbg) onClickOutside();\n },\n [onClickOutside],\n );\n\n const handleOnKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (e.key === 'Escape') onClose();\n },\n [onClose],\n );\n\n return {\n handleOutsideClick,\n handleOnKeyDown,\n };\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAwC;AACxC,yBAAgC;AAEzB,MAAM,mBAAmB,MAAM;AACpC,QAAM;AAAA,IACJ,OAAO,EAAE,gBAAgB,QAAQ;AAAA,EACnC,QAAI,yBAAW,kCAAe;AAE9B,QAAM,yBAAqB;AAAA,IACzB,CAAC,MAAwB;AACvB,UAAK,EAAE,OAA0B,QAAQ;AAAU,uBAAe;AAAA,IACpE;AAAA,IACA,CAAC,cAAc;AAAA,EACjB;AAEA,QAAM,sBAAkB;AAAA,IACtB,CAAC,MAA2B;AAC1B,UAAI,EAAE,QAAQ;AAAU,gBAAQ;AAAA,IAClC;AAAA,IACA,CAAC,OAAO;AAAA,EACV;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import type React from 'react';\nimport { useCallback, useContext } from 'react';\nimport { DSDialogContext } from '../../DSDialogCTX.js';\n\nexport const useDialogContent = () => {\n const {\n props: { onClickOutside, onClose },\n } = useContext(DSDialogContext);\n\n const handleOutsideClick = useCallback(\n (e: React.MouseEvent) => {\n if ((e.target as HTMLDivElement).dataset.portalbg) onClickOutside();\n },\n [onClickOutside],\n );\n\n const handleOnKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (e.key === 'Escape') onClose();\n },\n [onClose],\n );\n\n return {\n handleOutsideClick,\n handleOnKeyDown,\n };\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAwC;AACxC,yBAAgC;AAEzB,MAAM,mBAAmB,MAAM;AACpC,QAAM;AAAA,IACJ,OAAO,EAAE,gBAAgB,QAAQ;AAAA,EACnC,QAAI,yBAAW,kCAAe;AAE9B,QAAM,yBAAqB;AAAA,IACzB,CAAC,MAAwB;AACvB,UAAK,EAAE,OAA0B,QAAQ;AAAU,uBAAe;AAAA,IACpE;AAAA,IACA,CAAC,cAAc;AAAA,EACjB;AAEA,QAAM,sBAAkB;AAAA,IACtB,CAAC,MAA2B;AAC1B,UAAI,EAAE,QAAQ;AAAU,gBAAQ;AAAA,IAClC;AAAA,IACA,CAAC,OAAO;AAAA,EACV;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
18
18
  return to;
19
19
  };
20
20
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
25
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
26
  mod
23
27
  ));
@@ -28,20 +32,21 @@ __export(propTypes_exports, {
28
32
  });
29
33
  module.exports = __toCommonJS(propTypes_exports);
30
34
  var React = __toESM(require("react"));
31
- var import_ds_utilities = require("@elliemae/ds-utilities");
32
- var import_utils = require("./utils");
35
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
36
+ var import_utils = require("./utils.js");
33
37
  const propTypes = {
34
- ...import_ds_utilities.globalAttributesPropTypes,
35
- isOpen: import_ds_utilities.PropTypes.bool.description("Whether the Dialog is open or not.").defaultValue(false),
36
- children: import_ds_utilities.PropTypes.node.description("Nested components.").isRequired,
37
- centered: import_ds_utilities.PropTypes.bool.description("Centers the Dialog.").defaultValue(false),
38
- removeAutoFocus: import_ds_utilities.PropTypes.bool.description(
38
+ ...import_ds_props_helpers.globalAttributesPropTypes,
39
+ isOpen: import_ds_props_helpers.PropTypes.bool.description("Whether the Dialog is open or not.").defaultValue(false),
40
+ children: import_ds_props_helpers.PropTypes.node.description("Nested components.").isRequired,
41
+ centered: import_ds_props_helpers.PropTypes.bool.description("Centers the Dialog.").defaultValue(false),
42
+ removeAutoFocus: import_ds_props_helpers.PropTypes.bool.description(
39
43
  "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."
40
44
  ).defaultValue(false),
41
- onClickOutside: import_ds_utilities.PropTypes.func.description("Callback that should be used to close the modal when the user clicks outside.").defaultValue(() => {
45
+ onClickOutside: import_ds_props_helpers.PropTypes.func.description("Callback that should be used to close the modal when the user clicks outside.").defaultValue(() => {
42
46
  }),
43
- onClose: import_ds_utilities.PropTypes.func.description("Callback triggered with ESC key.").defaultValue(() => {
47
+ onClose: import_ds_props_helpers.PropTypes.func.description("Callback triggered with ESC key.").defaultValue(() => {
44
48
  }),
45
- size: import_ds_utilities.PropTypes.oneOf(import_utils.DSDialogSizesArrayValues).description(`Dialog's width size.`).defaultValue(import_utils.DSDialogSizes.DEFAULT)
49
+ size: import_ds_props_helpers.PropTypes.oneOf(import_utils.DSDialogSizesArrayValues).description(`Dialog's width size.`).defaultValue(import_utils.DSDialogSizes.DEFAULT),
50
+ width: import_ds_props_helpers.PropTypes.string.description("Dialog width.")
46
51
  };
47
52
  //# sourceMappingURL=propTypes.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/propTypes.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable max-len */\nimport type { GlobalAttributesT } from '@elliemae/ds-utilities';\nimport { globalAttributesPropTypes, PropTypes } from '@elliemae/ds-utilities';\nimport { DSDialogSizes, DSDialogSizesArrayValues } from './utils';\n\nexport declare namespace DSDialogT {\n export type Sizes = 'default' | 'small' | 'medium' | 'large' | 'x-large' | 'xx-large';\n export interface DefaultProps {\n [key: string]: unknown;\n isOpen: boolean;\n centered: boolean;\n size: Sizes;\n removeAutoFocus: boolean;\n onClickOutside: () => void;\n onClose: () => void;\n portalRef: null;\n children: React.ReactNode[] | [];\n }\n\n export interface PropsRequired {\n children: React.ReactNode[] | [];\n }\n\n export interface PropsOptional {\n portalRef: React.MutableRefObject<HTMLElement | null> | null;\n zIndex: number;\n }\n\n export interface InternalProps extends Omit<DefaultProps, 'portalRef'>, PropsRequired, PropsOptional {}\n\n export interface Props\n extends Omit<DefaultProps, 'portalRef'>,\n PropsRequired,\n PropsOptional,\n Omit<GlobalAttributesT<HTMLDivElement>, 'size' | 'children'> {}\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};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,0BAAqD;AACrD,mBAAwD;AAkCjD,MAAM,YAAY;AAAA,EACvB,GAAG;AAAA,EACH,QAAQ,8BAAU,KAAK,YAAY,oCAAoC,EAAE,aAAa,KAAK;AAAA,EAC3F,UAAU,8BAAU,KAAK,YAAY,oBAAoB,EAAE;AAAA,EAC3D,UAAU,8BAAU,KAAK,YAAY,qBAAqB,EAAE,aAAa,KAAK;AAAA,EAC9E,iBAAiB,8BAAU,KACxB;AAAA,IACC;AAAA,EACF,EACC,aAAa,KAAK;AAAA,EACrB,gBAAgB,8BAAU,KACvB,YAAY,+EAA+E,EAC3F,aAAa,MAAM;AAAA,EAAC,CAAC;AAAA,EACxB,SAAS,8BAAU,KAAK,YAAY,kCAAkC,EAAE,aAAa,MAAM;AAAA,EAAC,CAAC;AAAA,EAC7F,MAAM,8BAAU,MAAM,qCAAwB,EAC3C,YAAY,sBAAsB,EAClC,aAAa,2BAAc,OAAO;AACvC;",
4
+ "sourcesContent": ["/* eslint-disable max-len */\nimport type {} from '@elliemae/ds-utilities';\nimport type { GlobalAttributesT } from '@elliemae/ds-props-helpers';\nimport { globalAttributesPropTypes, PropTypes } from '@elliemae/ds-props-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 [key: string]: unknown;\n isOpen: boolean;\n centered: boolean;\n size: Sizes;\n removeAutoFocus: boolean;\n onClickOutside: () => void;\n onClose: () => void;\n portalRef: null;\n children: React.ReactNode[] | [];\n }\n\n export interface PropsRequired {\n children: React.ReactNode[] | [];\n }\n\n export interface PropsOptional {\n portalRef: React.MutableRefObject<HTMLElement | null> | null;\n zIndex: number;\n width?: '';\n }\n\n export interface InternalProps extends Omit<DefaultProps, 'portalRef'>, PropsRequired, PropsOptional {}\n\n export interface Props\n extends Omit<DefaultProps, 'portalRef'>,\n PropsRequired,\n PropsOptional,\n Omit<GlobalAttributesT<HTMLDivElement>, 'size' | 'width' | 'children'> {}\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;ACAA,YAAuB;ADGvB,8BAAqD;AACrD,mBAAwD;AAmCjD,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
6
  "names": []
7
7
  }
@@ -14,6 +14,10 @@ var __copyProps = (to, from, except, desc) => {
14
14
  return to;
15
15
  };
16
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.
17
21
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
18
22
  mod
19
23
  ));
@@ -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';\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
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;",
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"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;",
6
6
  "names": []
7
7
  }
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
18
18
  return to;
19
19
  };
20
20
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
25
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
26
  mod
23
27
  ));
@@ -40,7 +44,7 @@ __export(styles_exports, {
40
44
  module.exports = __toCommonJS(styles_exports);
41
45
  var React = __toESM(require("react"));
42
46
  var import_ds_system = require("@elliemae/ds-system");
43
- var import_utils = require("./utils");
47
+ var import_utils = require("./utils.js");
44
48
  const PortalStyles = import_ds_system.createGlobalStyle`
45
49
  ${({ portalClassName }) => `.${portalClassName}`} {
46
50
  overflow: hidden;
@@ -66,7 +70,7 @@ const StyledDialogContainer = import_ds_system.styled.div`
66
70
  left: 0;
67
71
  right: 0;
68
72
  margin: ${({ centered }) => centered ? "auto" : "20vh auto auto auto"};
69
- width: ${({ size }) => import_utils.allSizes[size]};
73
+ width: ${({ size, width }) => width === "" ? import_utils.allSizes[size] : width};
70
74
  min-width: 300px;
71
75
  box-shadow: 0 10px 20px 0 ${({ theme }) => theme.colors.neutral[500]};
72
76
  background: ${({ theme }) => theme.colors.neutral["000"]};