@elliemae/ds-accessibility 3.14.0-next.1 → 3.14.0-next.11

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.
@@ -35,7 +35,7 @@ var import_react = require("react");
35
35
  var import_ds_utilities = require("@elliemae/ds-utilities");
36
36
  var import_styles = require("./styles");
37
37
  var import_propTypes = require("./propTypes");
38
- const DSLiveRegion = (0, import_react.memo)((props) => {
38
+ const DSLiveRegion = (props) => {
39
39
  const [text, setText] = (0, import_react.useState)(" ");
40
40
  (0, import_react.useEffect)(() => {
41
41
  if (props.methods && props.methods.current) {
@@ -45,12 +45,12 @@ const DSLiveRegion = (0, import_react.memo)((props) => {
45
45
  if (text === "")
46
46
  return null;
47
47
  return import_react_dom.default.createPortal(
48
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.StyledContainer, { "aria-atomic": true, id: props.id, role: props.role, "aria-live": props["aria-live"] || "polite", children: text }),
49
- props.portal?.current || document.body
48
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.StyledContainer, { "aria-atomic": true, id: props.id, role: props.role, "aria-live": props["aria-live"] ?? "polite", children: text }),
49
+ props.portal?.current ?? document.body
50
50
  );
51
- });
52
- DSLiveRegion.propTypes = import_propTypes.propTypes;
51
+ };
52
+ DSLiveRegion.propTypes = import_propTypes.DSLiveRegionPropTypes;
53
53
  DSLiveRegion.displayName = "DSLiveRegion";
54
54
  const DSLiveRegionWithSchema = (0, import_ds_utilities.describe)(DSLiveRegion);
55
- DSLiveRegionWithSchema.propTypes = import_propTypes.propTypes;
55
+ DSLiveRegionWithSchema.propTypes = import_propTypes.DSLiveRegionPropTypes;
56
56
  //# sourceMappingURL=DSLiveRegion.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/live-region/DSLiveRegion.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import ReactDOM from 'react-dom';\nimport React, { memo, useEffect, useState } from 'react';\nimport { describe } from '@elliemae/ds-utilities';\nimport { StyledContainer } from './styles';\nimport { propTypes } from './propTypes';\nimport type { DSLiveRegionT } from './propTypes';\n\nconst DSLiveRegion = memo((props: DSLiveRegionT.Props): JSX.Element | null => {\n const [text, setText] = useState(' ');\n\n useEffect(() => {\n if (props.methods && props.methods.current) {\n props.methods.current.read = setText;\n }\n }, [props.methods]);\n\n if (text === '') return null;\n\n return ReactDOM.createPortal(\n <StyledContainer aria-atomic id={props.id} role={props.role} aria-live={props['aria-live'] || 'polite'}>\n {text}\n </StyledContainer>,\n props.portal?.current || document.body,\n );\n});\n\nDSLiveRegion.propTypes = propTypes;\nDSLiveRegion.displayName = 'DSLiveRegion';\nconst DSLiveRegionWithSchema = describe(DSLiveRegion);\nDSLiveRegionWithSchema.propTypes = propTypes;\n\nexport { DSLiveRegion, DSLiveRegionWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADmBnB;AAnBJ,uBAAqB;AACrB,mBAAiD;AACjD,0BAAyB;AACzB,oBAAgC;AAChC,uBAA0B;AAG1B,MAAM,mBAAe,mBAAK,CAAC,UAAmD;AAC5E,QAAM,CAAC,MAAM,OAAO,QAAI,uBAAS,GAAG;AAEpC,8BAAU,MAAM;AACd,QAAI,MAAM,WAAW,MAAM,QAAQ,SAAS;AAC1C,YAAM,QAAQ,QAAQ,OAAO;AAAA,IAC/B;AAAA,EACF,GAAG,CAAC,MAAM,OAAO,CAAC;AAElB,MAAI,SAAS;AAAI,WAAO;AAExB,SAAO,iBAAAA,QAAS;AAAA,IACd,4CAAC,iCAAgB,eAAW,MAAC,IAAI,MAAM,IAAI,MAAM,MAAM,MAAM,aAAW,MAAM,gBAAgB,UAC3F,gBACH;AAAA,IACA,MAAM,QAAQ,WAAW,SAAS;AAAA,EACpC;AACF,CAAC;AAED,aAAa,YAAY;AACzB,aAAa,cAAc;AAC3B,MAAM,6BAAyB,8BAAS,YAAY;AACpD,uBAAuB,YAAY;",
4
+ "sourcesContent": ["import ReactDOM from 'react-dom';\nimport React, { useEffect, useState } from 'react';\nimport { describe } from '@elliemae/ds-utilities';\nimport { StyledContainer } from './styles';\nimport { DSLiveRegionPropTypes } from './propTypes';\nimport type { DSLiveRegionT } from './propTypes';\n\nconst DSLiveRegion = (props: DSLiveRegionT.Props): JSX.Element | null => {\n const [text, setText] = useState(' ');\n\n useEffect(() => {\n if (props.methods && props.methods.current) {\n props.methods.current.read = setText;\n }\n }, [props.methods]);\n\n if (text === '') return null;\n\n return ReactDOM.createPortal(\n <StyledContainer aria-atomic id={props.id} role={props.role} aria-live={props['aria-live'] ?? 'polite'}>\n {text}\n </StyledContainer>,\n props.portal?.current ?? document.body,\n );\n};\n\nDSLiveRegion.propTypes = DSLiveRegionPropTypes;\nDSLiveRegion.displayName = 'DSLiveRegion';\nconst DSLiveRegionWithSchema = describe(DSLiveRegion);\nDSLiveRegionWithSchema.propTypes = DSLiveRegionPropTypes;\n\nexport { DSLiveRegion, DSLiveRegionWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADmBnB;AAnBJ,uBAAqB;AACrB,mBAA2C;AAC3C,0BAAyB;AACzB,oBAAgC;AAChC,uBAAsC;AAGtC,MAAM,eAAe,CAAC,UAAmD;AACvE,QAAM,CAAC,MAAM,OAAO,QAAI,uBAAS,GAAG;AAEpC,8BAAU,MAAM;AACd,QAAI,MAAM,WAAW,MAAM,QAAQ,SAAS;AAC1C,YAAM,QAAQ,QAAQ,OAAO;AAAA,IAC/B;AAAA,EACF,GAAG,CAAC,MAAM,OAAO,CAAC;AAElB,MAAI,SAAS;AAAI,WAAO;AAExB,SAAO,iBAAAA,QAAS;AAAA,IACd,4CAAC,iCAAgB,eAAW,MAAC,IAAI,MAAM,IAAI,MAAM,MAAM,MAAM,aAAW,MAAM,gBAAgB,UAC3F,gBACH;AAAA,IACA,MAAM,QAAQ,WAAW,SAAS;AAAA,EACpC;AACF;AAEA,aAAa,YAAY;AACzB,aAAa,cAAc;AAC3B,MAAM,6BAAyB,8BAAS,YAAY;AACpD,uBAAuB,YAAY;",
6
6
  "names": ["ReactDOM"]
7
7
  }
@@ -24,9 +24,21 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
24
24
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
25
  var propTypes_exports = {};
26
26
  __export(propTypes_exports, {
27
- propTypes: () => propTypes
27
+ DSLiveRegionPropTypes: () => DSLiveRegionPropTypes,
28
+ UseLiveRegionPropTypes: () => UseLiveRegionPropTypes
28
29
  });
29
30
  module.exports = __toCommonJS(propTypes_exports);
30
31
  var React = __toESM(require("react"));
31
- const propTypes = {};
32
+ var import_ds_utilities = require("@elliemae/ds-utilities");
33
+ const UseLiveRegionPropTypes = {
34
+ id: import_ds_utilities.PropTypes.string.description("Id of the live region"),
35
+ portal: import_ds_utilities.PropTypes.object.description("Portal to render the live region")
36
+ };
37
+ const DSLiveRegionPropTypes = {
38
+ id: import_ds_utilities.PropTypes.string.description("Id of the live region"),
39
+ portal: import_ds_utilities.PropTypes.object.description("Portal to render the live region"),
40
+ role: import_ds_utilities.PropTypes.string.description("Role of the live region"),
41
+ "aria-live": import_ds_utilities.PropTypes.string.description("Aria live attribute"),
42
+ methods: import_ds_utilities.PropTypes.object.description("Methods to read the live region")
43
+ };
32
44
  //# sourceMappingURL=propTypes.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/live-region/propTypes.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import type React from 'react';\n\nexport declare namespace UseLiveRegionT {\n export interface Props {\n id?: string;\n portal?: React.MutableRefObject<HTMLElement>;\n }\n}\n\nexport const propTypes = {};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADShB,MAAM,YAAY,CAAC;",
4
+ "sourcesContent": ["import { PropTypes } from '@elliemae/ds-utilities';\nimport type { Dispatch, MutableRefObject, SetStateAction, WeakValidationMap } from 'react';\n\nexport declare namespace UseLiveRegionT {\n export interface Props {\n id?: string;\n portal?: React.MutableRefObject<HTMLElement>;\n }\n}\n\nexport declare namespace DSLiveRegionT {\n export interface Props {\n id?: string;\n portal?: MutableRefObject<HTMLElement>;\n role?: string;\n 'aria-live'?: string;\n methods?: MutableRefObject<{ read?: Dispatch<SetStateAction<string>> }>;\n }\n}\n\nexport const UseLiveRegionPropTypes = {\n id: PropTypes.string.description('Id of the live region'),\n portal: PropTypes.object.description('Portal to render the live region'),\n} as WeakValidationMap<unknown>;\n\nexport const DSLiveRegionPropTypes = {\n id: PropTypes.string.description('Id of the live region'),\n portal: PropTypes.object.description('Portal to render the live region'),\n role: PropTypes.string.description('Role of the live region'),\n 'aria-live': PropTypes.string.description('Aria live attribute'),\n methods: PropTypes.object.description('Methods to read the live region'),\n} as WeakValidationMap<unknown>;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,0BAA0B;AAoBnB,MAAM,yBAAyB;AAAA,EACpC,IAAI,8BAAU,OAAO,YAAY,uBAAuB;AAAA,EACxD,QAAQ,8BAAU,OAAO,YAAY,kCAAkC;AACzE;AAEO,MAAM,wBAAwB;AAAA,EACnC,IAAI,8BAAU,OAAO,YAAY,uBAAuB;AAAA,EACxD,QAAQ,8BAAU,OAAO,YAAY,kCAAkC;AAAA,EACvE,MAAM,8BAAU,OAAO,YAAY,yBAAyB;AAAA,EAC5D,aAAa,8BAAU,OAAO,YAAY,qBAAqB;AAAA,EAC/D,SAAS,8BAAU,OAAO,YAAY,iCAAiC;AACzE;",
6
6
  "names": []
7
7
  }
@@ -92,7 +92,7 @@ const useLiveRegion = (props) => {
92
92
  const read = (0, import_react.useCallback)((message, options) => methods.current.read?.(message, options), []);
93
93
  return (0, import_react.useMemo)(
94
94
  () => ({
95
- LiveRegion: () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DSLiveRegion, { methods, id: instanceUID || id, portal }),
95
+ LiveRegion: () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DSLiveRegion, { methods, id: id ?? instanceUID, portal }),
96
96
  read
97
97
  }),
98
98
  [id, instanceUID, portal, read]
@@ -100,5 +100,5 @@ const useLiveRegion = (props) => {
100
100
  };
101
101
  useLiveRegion.displayName = "useLiveRegion";
102
102
  const UseLiveRegionWithSchema = (0, import_ds_utilities.describe)(useLiveRegion);
103
- UseLiveRegionWithSchema.propTypes = import_propTypes.propTypes;
103
+ UseLiveRegionWithSchema.propTypes = import_propTypes.UseLiveRegionPropTypes;
104
104
  //# sourceMappingURL=useLiveRegion.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/live-region/useLiveRegion.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable max-nested-callbacks */\nimport ReactDOM from 'react-dom';\nimport React, { memo, useEffect, useState, useCallback, useRef, useMemo } from 'react';\nimport { describe } from '@elliemae/ds-utilities';\nimport { uid } from 'uid';\nimport { StyledContainer } from './styles';\nimport { propTypes } from './propTypes';\nimport type { UseLiveRegionT } from './propTypes';\n\ninterface Options {\n assertive?: boolean;\n unsafe_emulateAssertiveNVDA?: boolean;\n delay?: number;\n}\ninterface Methods {\n read?: (message: string, options: Options) => void;\n}\nexport interface Props {\n methods?: React.MutableRefObject<Methods>;\n id?: string;\n portal?: React.MutableRefObject<HTMLElement>;\n}\n\nconst DSLiveRegion = memo((props: Props): JSX.Element | null => {\n const [internalMessage, setInternalMessage] = useState<string>('');\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const [unsafe_emulateAssertiveNVDA, setUnsafe_emulateAssertiveNVDA] = useState(false);\n const [role, setRole] = useState<undefined | string>(undefined);\n const [ariaLive, setAriaLive] = useState('polite');\n const { id, portal } = props || {};\n\n const reset = useCallback(() => {\n setInternalMessage('');\n setUnsafe_emulateAssertiveNVDA(false);\n setAriaLive('polite');\n setRole(undefined);\n }, []);\n\n const configure = useCallback(\n (message: string, options: Options) => {\n reset();\n setTimeout(() => {\n if (options?.unsafe_emulateAssertiveNVDA) setUnsafe_emulateAssertiveNVDA(true);\n setTimeout(() => {\n if (options?.assertive || options?.unsafe_emulateAssertiveNVDA) setAriaLive('assertive');\n if (options?.unsafe_emulateAssertiveNVDA) {\n setRole('alert');\n setUnsafe_emulateAssertiveNVDA(false);\n }\n if (options?.delay) {\n setTimeout(() => {\n setInternalMessage(message);\n }, options?.delay);\n } else {\n setInternalMessage(message);\n }\n });\n });\n },\n [reset],\n );\n\n useEffect(() => {\n if (props.methods) {\n props.methods.current.read = configure;\n }\n }, [configure, props.methods]);\n\n if (unsafe_emulateAssertiveNVDA) return null;\n\n return ReactDOM.createPortal(\n <StyledContainer aria-atomic id={id} role={role} aria-live={ariaLive}>\n {internalMessage}\n </StyledContainer>,\n portal?.current || document.body,\n );\n});\n\nconst useLiveRegion = (props: UseLiveRegionT.Props) => {\n const methods = useRef<Methods>({});\n\n const { id, portal } = props || {};\n\n const instanceUID = useMemo(() => `ds-live-region-${uid(5)}`, []);\n\n const read = useCallback((message: string, options: Options) => methods.current.read?.(message, options), []);\n\n return useMemo(\n () => ({\n LiveRegion: () => <DSLiveRegion methods={methods} id={instanceUID || id} portal={portal} />,\n read,\n }),\n [id, instanceUID, portal, read],\n );\n};\n\nuseLiveRegion.displayName = 'useLiveRegion';\nconst UseLiveRegionWithSchema = describe(useLiveRegion);\nUseLiveRegionWithSchema.propTypes = propTypes;\nexport { useLiveRegion, UseLiveRegionWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADuEnB;AAtEJ,uBAAqB;AACrB,mBAA+E;AAC/E,0BAAyB;AACzB,iBAAoB;AACpB,oBAAgC;AAChC,uBAA0B;AAiB1B,MAAM,mBAAe,mBAAK,CAAC,UAAqC;AAC9D,QAAM,CAAC,iBAAiB,kBAAkB,QAAI,uBAAiB,EAAE;AAEjE,QAAM,CAAC,6BAA6B,8BAA8B,QAAI,uBAAS,KAAK;AACpF,QAAM,CAAC,MAAM,OAAO,QAAI,uBAA6B,MAAS;AAC9D,QAAM,CAAC,UAAU,WAAW,QAAI,uBAAS,QAAQ;AACjD,QAAM,EAAE,IAAI,OAAO,IAAI,SAAS,CAAC;AAEjC,QAAM,YAAQ,0BAAY,MAAM;AAC9B,uBAAmB,EAAE;AACrB,mCAA+B,KAAK;AACpC,gBAAY,QAAQ;AACpB,YAAQ,MAAS;AAAA,EACnB,GAAG,CAAC,CAAC;AAEL,QAAM,gBAAY;AAAA,IAChB,CAAC,SAAiB,YAAqB;AACrC,YAAM;AACN,iBAAW,MAAM;AACf,YAAI,SAAS;AAA6B,yCAA+B,IAAI;AAC7E,mBAAW,MAAM;AACf,cAAI,SAAS,aAAa,SAAS;AAA6B,wBAAY,WAAW;AACvF,cAAI,SAAS,6BAA6B;AACxC,oBAAQ,OAAO;AACf,2CAA+B,KAAK;AAAA,UACtC;AACA,cAAI,SAAS,OAAO;AAClB,uBAAW,MAAM;AACf,iCAAmB,OAAO;AAAA,YAC5B,GAAG,SAAS,KAAK;AAAA,UACnB,OAAO;AACL,+BAAmB,OAAO;AAAA,UAC5B;AAAA,QACF,CAAC;AAAA,MACH,CAAC;AAAA,IACH;AAAA,IACA,CAAC,KAAK;AAAA,EACR;AAEA,8BAAU,MAAM;AACd,QAAI,MAAM,SAAS;AACjB,YAAM,QAAQ,QAAQ,OAAO;AAAA,IAC/B;AAAA,EACF,GAAG,CAAC,WAAW,MAAM,OAAO,CAAC;AAE7B,MAAI;AAA6B,WAAO;AAExC,SAAO,iBAAAA,QAAS;AAAA,IACd,4CAAC,iCAAgB,eAAW,MAAC,IAAQ,MAAY,aAAW,UACzD,2BACH;AAAA,IACA,QAAQ,WAAW,SAAS;AAAA,EAC9B;AACF,CAAC;AAED,MAAM,gBAAgB,CAAC,UAAgC;AACrD,QAAM,cAAU,qBAAgB,CAAC,CAAC;AAElC,QAAM,EAAE,IAAI,OAAO,IAAI,SAAS,CAAC;AAEjC,QAAM,kBAAc,sBAAQ,MAAM,sBAAkB,gBAAI,CAAC,KAAK,CAAC,CAAC;AAEhE,QAAM,WAAO,0BAAY,CAAC,SAAiB,YAAqB,QAAQ,QAAQ,OAAO,SAAS,OAAO,GAAG,CAAC,CAAC;AAE5G,aAAO;AAAA,IACL,OAAO;AAAA,MACL,YAAY,MAAM,4CAAC,gBAAa,SAAkB,IAAI,eAAe,IAAI,QAAgB;AAAA,MACzF;AAAA,IACF;AAAA,IACA,CAAC,IAAI,aAAa,QAAQ,IAAI;AAAA,EAChC;AACF;AAEA,cAAc,cAAc;AAC5B,MAAM,8BAA0B,8BAAS,aAAa;AACtD,wBAAwB,YAAY;",
4
+ "sourcesContent": ["/* eslint-disable max-nested-callbacks */\nimport ReactDOM from 'react-dom';\nimport React, { memo, useEffect, useState, useCallback, useRef, useMemo } from 'react';\nimport { describe } from '@elliemae/ds-utilities';\nimport { uid } from 'uid';\nimport { StyledContainer } from './styles';\nimport { UseLiveRegionPropTypes } from './propTypes';\nimport type { UseLiveRegionT } from './propTypes';\n\ninterface Options {\n assertive?: boolean;\n unsafe_emulateAssertiveNVDA?: boolean;\n delay?: number;\n}\ninterface Methods {\n read?: (message: string, options: Options) => void;\n}\nexport interface Props {\n methods?: React.MutableRefObject<Methods>;\n id?: string;\n portal?: React.MutableRefObject<HTMLElement>;\n}\n\nconst DSLiveRegion = memo((props: Props): JSX.Element | null => {\n const [internalMessage, setInternalMessage] = useState<string>('');\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const [unsafe_emulateAssertiveNVDA, setUnsafe_emulateAssertiveNVDA] = useState(false);\n const [role, setRole] = useState<undefined | string>(undefined);\n const [ariaLive, setAriaLive] = useState('polite');\n const { id, portal } = props || {};\n\n const reset = useCallback(() => {\n setInternalMessage('');\n setUnsafe_emulateAssertiveNVDA(false);\n setAriaLive('polite');\n setRole(undefined);\n }, []);\n\n const configure = useCallback(\n (message: string, options: Options) => {\n reset();\n setTimeout(() => {\n if (options?.unsafe_emulateAssertiveNVDA) setUnsafe_emulateAssertiveNVDA(true);\n setTimeout(() => {\n if (options?.assertive || options?.unsafe_emulateAssertiveNVDA) setAriaLive('assertive');\n if (options?.unsafe_emulateAssertiveNVDA) {\n setRole('alert');\n setUnsafe_emulateAssertiveNVDA(false);\n }\n if (options?.delay) {\n setTimeout(() => {\n setInternalMessage(message);\n }, options?.delay);\n } else {\n setInternalMessage(message);\n }\n });\n });\n },\n [reset],\n );\n\n useEffect(() => {\n if (props.methods) {\n props.methods.current.read = configure;\n }\n }, [configure, props.methods]);\n\n if (unsafe_emulateAssertiveNVDA) return null;\n\n return ReactDOM.createPortal(\n <StyledContainer aria-atomic id={id} role={role} aria-live={ariaLive}>\n {internalMessage}\n </StyledContainer>,\n portal?.current || document.body,\n );\n});\n\nconst useLiveRegion = (props: UseLiveRegionT.Props) => {\n const methods = useRef<Methods>({});\n\n const { id, portal } = props || {};\n\n const instanceUID = useMemo(() => `ds-live-region-${uid(5)}`, []);\n\n const read = useCallback((message: string, options: Options) => methods.current.read?.(message, options), []);\n\n return useMemo(\n () => ({\n LiveRegion: () => <DSLiveRegion methods={methods} id={id ?? instanceUID} portal={portal} />,\n read,\n }),\n [id, instanceUID, portal, read],\n );\n};\n\nuseLiveRegion.displayName = 'useLiveRegion';\nconst UseLiveRegionWithSchema = describe(useLiveRegion);\nUseLiveRegionWithSchema.propTypes = UseLiveRegionPropTypes;\nexport { useLiveRegion, UseLiveRegionWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADuEnB;AAtEJ,uBAAqB;AACrB,mBAA+E;AAC/E,0BAAyB;AACzB,iBAAoB;AACpB,oBAAgC;AAChC,uBAAuC;AAiBvC,MAAM,mBAAe,mBAAK,CAAC,UAAqC;AAC9D,QAAM,CAAC,iBAAiB,kBAAkB,QAAI,uBAAiB,EAAE;AAEjE,QAAM,CAAC,6BAA6B,8BAA8B,QAAI,uBAAS,KAAK;AACpF,QAAM,CAAC,MAAM,OAAO,QAAI,uBAA6B,MAAS;AAC9D,QAAM,CAAC,UAAU,WAAW,QAAI,uBAAS,QAAQ;AACjD,QAAM,EAAE,IAAI,OAAO,IAAI,SAAS,CAAC;AAEjC,QAAM,YAAQ,0BAAY,MAAM;AAC9B,uBAAmB,EAAE;AACrB,mCAA+B,KAAK;AACpC,gBAAY,QAAQ;AACpB,YAAQ,MAAS;AAAA,EACnB,GAAG,CAAC,CAAC;AAEL,QAAM,gBAAY;AAAA,IAChB,CAAC,SAAiB,YAAqB;AACrC,YAAM;AACN,iBAAW,MAAM;AACf,YAAI,SAAS;AAA6B,yCAA+B,IAAI;AAC7E,mBAAW,MAAM;AACf,cAAI,SAAS,aAAa,SAAS;AAA6B,wBAAY,WAAW;AACvF,cAAI,SAAS,6BAA6B;AACxC,oBAAQ,OAAO;AACf,2CAA+B,KAAK;AAAA,UACtC;AACA,cAAI,SAAS,OAAO;AAClB,uBAAW,MAAM;AACf,iCAAmB,OAAO;AAAA,YAC5B,GAAG,SAAS,KAAK;AAAA,UACnB,OAAO;AACL,+BAAmB,OAAO;AAAA,UAC5B;AAAA,QACF,CAAC;AAAA,MACH,CAAC;AAAA,IACH;AAAA,IACA,CAAC,KAAK;AAAA,EACR;AAEA,8BAAU,MAAM;AACd,QAAI,MAAM,SAAS;AACjB,YAAM,QAAQ,QAAQ,OAAO;AAAA,IAC/B;AAAA,EACF,GAAG,CAAC,WAAW,MAAM,OAAO,CAAC;AAE7B,MAAI;AAA6B,WAAO;AAExC,SAAO,iBAAAA,QAAS;AAAA,IACd,4CAAC,iCAAgB,eAAW,MAAC,IAAQ,MAAY,aAAW,UACzD,2BACH;AAAA,IACA,QAAQ,WAAW,SAAS;AAAA,EAC9B;AACF,CAAC;AAED,MAAM,gBAAgB,CAAC,UAAgC;AACrD,QAAM,cAAU,qBAAgB,CAAC,CAAC;AAElC,QAAM,EAAE,IAAI,OAAO,IAAI,SAAS,CAAC;AAEjC,QAAM,kBAAc,sBAAQ,MAAM,sBAAkB,gBAAI,CAAC,KAAK,CAAC,CAAC;AAEhE,QAAM,WAAO,0BAAY,CAAC,SAAiB,YAAqB,QAAQ,QAAQ,OAAO,SAAS,OAAO,GAAG,CAAC,CAAC;AAE5G,aAAO;AAAA,IACL,OAAO;AAAA,MACL,YAAY,MAAM,4CAAC,gBAAa,SAAkB,IAAI,MAAM,aAAa,QAAgB;AAAA,MACzF;AAAA,IACF;AAAA,IACA,CAAC,IAAI,aAAa,QAAQ,IAAI;AAAA,EAChC;AACF;AAEA,cAAc,cAAc;AAC5B,MAAM,8BAA0B,8BAAS,aAAa;AACtD,wBAAwB,YAAY;",
6
6
  "names": ["ReactDOM"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/skip-to/propTypes.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { PropTypes } from '@elliemae/ds-utilities';\n\nexport const propTypes = {\n goTo: PropTypes.string.isRequired.description(\"String containing content's id that you want to go.\"),\n message: PropTypes.string.description(\"Message for the Skip To component, default is 'Skip to main content'.\"),\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,0BAA0B;AAEnB,MAAM,YAAY;AAAA,EACvB,MAAM,8BAAU,OAAO,WAAW,YAAY,qDAAqD;AAAA,EACnG,SAAS,8BAAU,OAAO,YAAY,uEAAuE;AAC/G;",
4
+ "sourcesContent": ["import type { WeakValidationMap } from 'react';\nimport { PropTypes } from '@elliemae/ds-utilities';\n\nexport const propTypes = {\n goTo: PropTypes.string.isRequired.description(\"String containing content's id that you want to go.\"),\n message: PropTypes.string.description(\"Message for the Skip To component, default is 'Skip to main content'.\"),\n} as WeakValidationMap<unknown>;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,0BAA0B;AAEnB,MAAM,YAAY;AAAA,EACvB,MAAM,8BAAU,OAAO,WAAW,YAAY,qDAAqD;AAAA,EACnG,SAAS,8BAAU,OAAO,YAAY,uEAAuE;AAC/G;",
6
6
  "names": []
7
7
  }
@@ -1,11 +1,11 @@
1
1
  import * as React from "react";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import ReactDOM from "react-dom";
4
- import { memo, useEffect, useState } from "react";
4
+ import { useEffect, useState } from "react";
5
5
  import { describe } from "@elliemae/ds-utilities";
6
6
  import { StyledContainer } from "./styles";
7
- import { propTypes } from "./propTypes";
8
- const DSLiveRegion = memo((props) => {
7
+ import { DSLiveRegionPropTypes } from "./propTypes";
8
+ const DSLiveRegion = (props) => {
9
9
  const [text, setText] = useState(" ");
10
10
  useEffect(() => {
11
11
  if (props.methods && props.methods.current) {
@@ -15,14 +15,14 @@ const DSLiveRegion = memo((props) => {
15
15
  if (text === "")
16
16
  return null;
17
17
  return ReactDOM.createPortal(
18
- /* @__PURE__ */ jsx(StyledContainer, { "aria-atomic": true, id: props.id, role: props.role, "aria-live": props["aria-live"] || "polite", children: text }),
19
- props.portal?.current || document.body
18
+ /* @__PURE__ */ jsx(StyledContainer, { "aria-atomic": true, id: props.id, role: props.role, "aria-live": props["aria-live"] ?? "polite", children: text }),
19
+ props.portal?.current ?? document.body
20
20
  );
21
- });
22
- DSLiveRegion.propTypes = propTypes;
21
+ };
22
+ DSLiveRegion.propTypes = DSLiveRegionPropTypes;
23
23
  DSLiveRegion.displayName = "DSLiveRegion";
24
24
  const DSLiveRegionWithSchema = describe(DSLiveRegion);
25
- DSLiveRegionWithSchema.propTypes = propTypes;
25
+ DSLiveRegionWithSchema.propTypes = DSLiveRegionPropTypes;
26
26
  export {
27
27
  DSLiveRegion,
28
28
  DSLiveRegionWithSchema
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/live-region/DSLiveRegion.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import ReactDOM from 'react-dom';\nimport React, { memo, useEffect, useState } from 'react';\nimport { describe } from '@elliemae/ds-utilities';\nimport { StyledContainer } from './styles';\nimport { propTypes } from './propTypes';\nimport type { DSLiveRegionT } from './propTypes';\n\nconst DSLiveRegion = memo((props: DSLiveRegionT.Props): JSX.Element | null => {\n const [text, setText] = useState(' ');\n\n useEffect(() => {\n if (props.methods && props.methods.current) {\n props.methods.current.read = setText;\n }\n }, [props.methods]);\n\n if (text === '') return null;\n\n return ReactDOM.createPortal(\n <StyledContainer aria-atomic id={props.id} role={props.role} aria-live={props['aria-live'] || 'polite'}>\n {text}\n </StyledContainer>,\n props.portal?.current || document.body,\n );\n});\n\nDSLiveRegion.propTypes = propTypes;\nDSLiveRegion.displayName = 'DSLiveRegion';\nconst DSLiveRegionWithSchema = describe(DSLiveRegion);\nDSLiveRegionWithSchema.propTypes = propTypes;\n\nexport { DSLiveRegion, DSLiveRegionWithSchema };\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACmBnB;AAnBJ,OAAO,cAAc;AACrB,SAAgB,MAAM,WAAW,gBAAgB;AACjD,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAChC,SAAS,iBAAiB;AAG1B,MAAM,eAAe,KAAK,CAAC,UAAmD;AAC5E,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,GAAG;AAEpC,YAAU,MAAM;AACd,QAAI,MAAM,WAAW,MAAM,QAAQ,SAAS;AAC1C,YAAM,QAAQ,QAAQ,OAAO;AAAA,IAC/B;AAAA,EACF,GAAG,CAAC,MAAM,OAAO,CAAC;AAElB,MAAI,SAAS;AAAI,WAAO;AAExB,SAAO,SAAS;AAAA,IACd,oBAAC,mBAAgB,eAAW,MAAC,IAAI,MAAM,IAAI,MAAM,MAAM,MAAM,aAAW,MAAM,gBAAgB,UAC3F,gBACH;AAAA,IACA,MAAM,QAAQ,WAAW,SAAS;AAAA,EACpC;AACF,CAAC;AAED,aAAa,YAAY;AACzB,aAAa,cAAc;AAC3B,MAAM,yBAAyB,SAAS,YAAY;AACpD,uBAAuB,YAAY;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import ReactDOM from 'react-dom';\nimport React, { useEffect, useState } from 'react';\nimport { describe } from '@elliemae/ds-utilities';\nimport { StyledContainer } from './styles';\nimport { DSLiveRegionPropTypes } from './propTypes';\nimport type { DSLiveRegionT } from './propTypes';\n\nconst DSLiveRegion = (props: DSLiveRegionT.Props): JSX.Element | null => {\n const [text, setText] = useState(' ');\n\n useEffect(() => {\n if (props.methods && props.methods.current) {\n props.methods.current.read = setText;\n }\n }, [props.methods]);\n\n if (text === '') return null;\n\n return ReactDOM.createPortal(\n <StyledContainer aria-atomic id={props.id} role={props.role} aria-live={props['aria-live'] ?? 'polite'}>\n {text}\n </StyledContainer>,\n props.portal?.current ?? document.body,\n );\n};\n\nDSLiveRegion.propTypes = DSLiveRegionPropTypes;\nDSLiveRegion.displayName = 'DSLiveRegion';\nconst DSLiveRegionWithSchema = describe(DSLiveRegion);\nDSLiveRegionWithSchema.propTypes = DSLiveRegionPropTypes;\n\nexport { DSLiveRegion, DSLiveRegionWithSchema };\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACmBnB;AAnBJ,OAAO,cAAc;AACrB,SAAgB,WAAW,gBAAgB;AAC3C,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAChC,SAAS,6BAA6B;AAGtC,MAAM,eAAe,CAAC,UAAmD;AACvE,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,GAAG;AAEpC,YAAU,MAAM;AACd,QAAI,MAAM,WAAW,MAAM,QAAQ,SAAS;AAC1C,YAAM,QAAQ,QAAQ,OAAO;AAAA,IAC/B;AAAA,EACF,GAAG,CAAC,MAAM,OAAO,CAAC;AAElB,MAAI,SAAS;AAAI,WAAO;AAExB,SAAO,SAAS;AAAA,IACd,oBAAC,mBAAgB,eAAW,MAAC,IAAI,MAAM,IAAI,MAAM,MAAM,MAAM,aAAW,MAAM,gBAAgB,UAC3F,gBACH;AAAA,IACA,MAAM,QAAQ,WAAW,SAAS;AAAA,EACpC;AACF;AAEA,aAAa,YAAY;AACzB,aAAa,cAAc;AAC3B,MAAM,yBAAyB,SAAS,YAAY;AACpD,uBAAuB,YAAY;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,18 @@
1
1
  import * as React from "react";
2
- const propTypes = {};
2
+ import { PropTypes } from "@elliemae/ds-utilities";
3
+ const UseLiveRegionPropTypes = {
4
+ id: PropTypes.string.description("Id of the live region"),
5
+ portal: PropTypes.object.description("Portal to render the live region")
6
+ };
7
+ const DSLiveRegionPropTypes = {
8
+ id: PropTypes.string.description("Id of the live region"),
9
+ portal: PropTypes.object.description("Portal to render the live region"),
10
+ role: PropTypes.string.description("Role of the live region"),
11
+ "aria-live": PropTypes.string.description("Aria live attribute"),
12
+ methods: PropTypes.object.description("Methods to read the live region")
13
+ };
3
14
  export {
4
- propTypes
15
+ DSLiveRegionPropTypes,
16
+ UseLiveRegionPropTypes
5
17
  };
6
18
  //# sourceMappingURL=propTypes.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/live-region/propTypes.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type React from 'react';\n\nexport declare namespace UseLiveRegionT {\n export interface Props {\n id?: string;\n portal?: React.MutableRefObject<HTMLElement>;\n }\n}\n\nexport const propTypes = {};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACShB,MAAM,YAAY,CAAC;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes } from '@elliemae/ds-utilities';\nimport type { Dispatch, MutableRefObject, SetStateAction, WeakValidationMap } from 'react';\n\nexport declare namespace UseLiveRegionT {\n export interface Props {\n id?: string;\n portal?: React.MutableRefObject<HTMLElement>;\n }\n}\n\nexport declare namespace DSLiveRegionT {\n export interface Props {\n id?: string;\n portal?: MutableRefObject<HTMLElement>;\n role?: string;\n 'aria-live'?: string;\n methods?: MutableRefObject<{ read?: Dispatch<SetStateAction<string>> }>;\n }\n}\n\nexport const UseLiveRegionPropTypes = {\n id: PropTypes.string.description('Id of the live region'),\n portal: PropTypes.object.description('Portal to render the live region'),\n} as WeakValidationMap<unknown>;\n\nexport const DSLiveRegionPropTypes = {\n id: PropTypes.string.description('Id of the live region'),\n portal: PropTypes.object.description('Portal to render the live region'),\n role: PropTypes.string.description('Role of the live region'),\n 'aria-live': PropTypes.string.description('Aria live attribute'),\n methods: PropTypes.object.description('Methods to read the live region'),\n} as WeakValidationMap<unknown>;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,iBAAiB;AAoBnB,MAAM,yBAAyB;AAAA,EACpC,IAAI,UAAU,OAAO,YAAY,uBAAuB;AAAA,EACxD,QAAQ,UAAU,OAAO,YAAY,kCAAkC;AACzE;AAEO,MAAM,wBAAwB;AAAA,EACnC,IAAI,UAAU,OAAO,YAAY,uBAAuB;AAAA,EACxD,QAAQ,UAAU,OAAO,YAAY,kCAAkC;AAAA,EACvE,MAAM,UAAU,OAAO,YAAY,yBAAyB;AAAA,EAC5D,aAAa,UAAU,OAAO,YAAY,qBAAqB;AAAA,EAC/D,SAAS,UAAU,OAAO,YAAY,iCAAiC;AACzE;",
6
6
  "names": []
7
7
  }
@@ -5,7 +5,7 @@ import { memo, useEffect, useState, useCallback, useRef, useMemo } from "react";
5
5
  import { describe } from "@elliemae/ds-utilities";
6
6
  import { uid } from "uid";
7
7
  import { StyledContainer } from "./styles";
8
- import { propTypes } from "./propTypes";
8
+ import { UseLiveRegionPropTypes } from "./propTypes";
9
9
  const DSLiveRegion = memo((props) => {
10
10
  const [internalMessage, setInternalMessage] = useState("");
11
11
  const [unsafe_emulateAssertiveNVDA, setUnsafe_emulateAssertiveNVDA] = useState(false);
@@ -62,7 +62,7 @@ const useLiveRegion = (props) => {
62
62
  const read = useCallback((message, options) => methods.current.read?.(message, options), []);
63
63
  return useMemo(
64
64
  () => ({
65
- LiveRegion: () => /* @__PURE__ */ jsx(DSLiveRegion, { methods, id: instanceUID || id, portal }),
65
+ LiveRegion: () => /* @__PURE__ */ jsx(DSLiveRegion, { methods, id: id ?? instanceUID, portal }),
66
66
  read
67
67
  }),
68
68
  [id, instanceUID, portal, read]
@@ -70,7 +70,7 @@ const useLiveRegion = (props) => {
70
70
  };
71
71
  useLiveRegion.displayName = "useLiveRegion";
72
72
  const UseLiveRegionWithSchema = describe(useLiveRegion);
73
- UseLiveRegionWithSchema.propTypes = propTypes;
73
+ UseLiveRegionWithSchema.propTypes = UseLiveRegionPropTypes;
74
74
  export {
75
75
  UseLiveRegionWithSchema,
76
76
  useLiveRegion
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/live-region/useLiveRegion.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-nested-callbacks */\nimport ReactDOM from 'react-dom';\nimport React, { memo, useEffect, useState, useCallback, useRef, useMemo } from 'react';\nimport { describe } from '@elliemae/ds-utilities';\nimport { uid } from 'uid';\nimport { StyledContainer } from './styles';\nimport { propTypes } from './propTypes';\nimport type { UseLiveRegionT } from './propTypes';\n\ninterface Options {\n assertive?: boolean;\n unsafe_emulateAssertiveNVDA?: boolean;\n delay?: number;\n}\ninterface Methods {\n read?: (message: string, options: Options) => void;\n}\nexport interface Props {\n methods?: React.MutableRefObject<Methods>;\n id?: string;\n portal?: React.MutableRefObject<HTMLElement>;\n}\n\nconst DSLiveRegion = memo((props: Props): JSX.Element | null => {\n const [internalMessage, setInternalMessage] = useState<string>('');\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const [unsafe_emulateAssertiveNVDA, setUnsafe_emulateAssertiveNVDA] = useState(false);\n const [role, setRole] = useState<undefined | string>(undefined);\n const [ariaLive, setAriaLive] = useState('polite');\n const { id, portal } = props || {};\n\n const reset = useCallback(() => {\n setInternalMessage('');\n setUnsafe_emulateAssertiveNVDA(false);\n setAriaLive('polite');\n setRole(undefined);\n }, []);\n\n const configure = useCallback(\n (message: string, options: Options) => {\n reset();\n setTimeout(() => {\n if (options?.unsafe_emulateAssertiveNVDA) setUnsafe_emulateAssertiveNVDA(true);\n setTimeout(() => {\n if (options?.assertive || options?.unsafe_emulateAssertiveNVDA) setAriaLive('assertive');\n if (options?.unsafe_emulateAssertiveNVDA) {\n setRole('alert');\n setUnsafe_emulateAssertiveNVDA(false);\n }\n if (options?.delay) {\n setTimeout(() => {\n setInternalMessage(message);\n }, options?.delay);\n } else {\n setInternalMessage(message);\n }\n });\n });\n },\n [reset],\n );\n\n useEffect(() => {\n if (props.methods) {\n props.methods.current.read = configure;\n }\n }, [configure, props.methods]);\n\n if (unsafe_emulateAssertiveNVDA) return null;\n\n return ReactDOM.createPortal(\n <StyledContainer aria-atomic id={id} role={role} aria-live={ariaLive}>\n {internalMessage}\n </StyledContainer>,\n portal?.current || document.body,\n );\n});\n\nconst useLiveRegion = (props: UseLiveRegionT.Props) => {\n const methods = useRef<Methods>({});\n\n const { id, portal } = props || {};\n\n const instanceUID = useMemo(() => `ds-live-region-${uid(5)}`, []);\n\n const read = useCallback((message: string, options: Options) => methods.current.read?.(message, options), []);\n\n return useMemo(\n () => ({\n LiveRegion: () => <DSLiveRegion methods={methods} id={instanceUID || id} portal={portal} />,\n read,\n }),\n [id, instanceUID, portal, read],\n );\n};\n\nuseLiveRegion.displayName = 'useLiveRegion';\nconst UseLiveRegionWithSchema = describe(useLiveRegion);\nUseLiveRegionWithSchema.propTypes = propTypes;\nexport { useLiveRegion, UseLiveRegionWithSchema };\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACuEnB;AAtEJ,OAAO,cAAc;AACrB,SAAgB,MAAM,WAAW,UAAU,aAAa,QAAQ,eAAe;AAC/E,SAAS,gBAAgB;AACzB,SAAS,WAAW;AACpB,SAAS,uBAAuB;AAChC,SAAS,iBAAiB;AAiB1B,MAAM,eAAe,KAAK,CAAC,UAAqC;AAC9D,QAAM,CAAC,iBAAiB,kBAAkB,IAAI,SAAiB,EAAE;AAEjE,QAAM,CAAC,6BAA6B,8BAA8B,IAAI,SAAS,KAAK;AACpF,QAAM,CAAC,MAAM,OAAO,IAAI,SAA6B,MAAS;AAC9D,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,QAAQ;AACjD,QAAM,EAAE,IAAI,OAAO,IAAI,SAAS,CAAC;AAEjC,QAAM,QAAQ,YAAY,MAAM;AAC9B,uBAAmB,EAAE;AACrB,mCAA+B,KAAK;AACpC,gBAAY,QAAQ;AACpB,YAAQ,MAAS;AAAA,EACnB,GAAG,CAAC,CAAC;AAEL,QAAM,YAAY;AAAA,IAChB,CAAC,SAAiB,YAAqB;AACrC,YAAM;AACN,iBAAW,MAAM;AACf,YAAI,SAAS;AAA6B,yCAA+B,IAAI;AAC7E,mBAAW,MAAM;AACf,cAAI,SAAS,aAAa,SAAS;AAA6B,wBAAY,WAAW;AACvF,cAAI,SAAS,6BAA6B;AACxC,oBAAQ,OAAO;AACf,2CAA+B,KAAK;AAAA,UACtC;AACA,cAAI,SAAS,OAAO;AAClB,uBAAW,MAAM;AACf,iCAAmB,OAAO;AAAA,YAC5B,GAAG,SAAS,KAAK;AAAA,UACnB,OAAO;AACL,+BAAmB,OAAO;AAAA,UAC5B;AAAA,QACF,CAAC;AAAA,MACH,CAAC;AAAA,IACH;AAAA,IACA,CAAC,KAAK;AAAA,EACR;AAEA,YAAU,MAAM;AACd,QAAI,MAAM,SAAS;AACjB,YAAM,QAAQ,QAAQ,OAAO;AAAA,IAC/B;AAAA,EACF,GAAG,CAAC,WAAW,MAAM,OAAO,CAAC;AAE7B,MAAI;AAA6B,WAAO;AAExC,SAAO,SAAS;AAAA,IACd,oBAAC,mBAAgB,eAAW,MAAC,IAAQ,MAAY,aAAW,UACzD,2BACH;AAAA,IACA,QAAQ,WAAW,SAAS;AAAA,EAC9B;AACF,CAAC;AAED,MAAM,gBAAgB,CAAC,UAAgC;AACrD,QAAM,UAAU,OAAgB,CAAC,CAAC;AAElC,QAAM,EAAE,IAAI,OAAO,IAAI,SAAS,CAAC;AAEjC,QAAM,cAAc,QAAQ,MAAM,kBAAkB,IAAI,CAAC,KAAK,CAAC,CAAC;AAEhE,QAAM,OAAO,YAAY,CAAC,SAAiB,YAAqB,QAAQ,QAAQ,OAAO,SAAS,OAAO,GAAG,CAAC,CAAC;AAE5G,SAAO;AAAA,IACL,OAAO;AAAA,MACL,YAAY,MAAM,oBAAC,gBAAa,SAAkB,IAAI,eAAe,IAAI,QAAgB;AAAA,MACzF;AAAA,IACF;AAAA,IACA,CAAC,IAAI,aAAa,QAAQ,IAAI;AAAA,EAChC;AACF;AAEA,cAAc,cAAc;AAC5B,MAAM,0BAA0B,SAAS,aAAa;AACtD,wBAAwB,YAAY;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-nested-callbacks */\nimport ReactDOM from 'react-dom';\nimport React, { memo, useEffect, useState, useCallback, useRef, useMemo } from 'react';\nimport { describe } from '@elliemae/ds-utilities';\nimport { uid } from 'uid';\nimport { StyledContainer } from './styles';\nimport { UseLiveRegionPropTypes } from './propTypes';\nimport type { UseLiveRegionT } from './propTypes';\n\ninterface Options {\n assertive?: boolean;\n unsafe_emulateAssertiveNVDA?: boolean;\n delay?: number;\n}\ninterface Methods {\n read?: (message: string, options: Options) => void;\n}\nexport interface Props {\n methods?: React.MutableRefObject<Methods>;\n id?: string;\n portal?: React.MutableRefObject<HTMLElement>;\n}\n\nconst DSLiveRegion = memo((props: Props): JSX.Element | null => {\n const [internalMessage, setInternalMessage] = useState<string>('');\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const [unsafe_emulateAssertiveNVDA, setUnsafe_emulateAssertiveNVDA] = useState(false);\n const [role, setRole] = useState<undefined | string>(undefined);\n const [ariaLive, setAriaLive] = useState('polite');\n const { id, portal } = props || {};\n\n const reset = useCallback(() => {\n setInternalMessage('');\n setUnsafe_emulateAssertiveNVDA(false);\n setAriaLive('polite');\n setRole(undefined);\n }, []);\n\n const configure = useCallback(\n (message: string, options: Options) => {\n reset();\n setTimeout(() => {\n if (options?.unsafe_emulateAssertiveNVDA) setUnsafe_emulateAssertiveNVDA(true);\n setTimeout(() => {\n if (options?.assertive || options?.unsafe_emulateAssertiveNVDA) setAriaLive('assertive');\n if (options?.unsafe_emulateAssertiveNVDA) {\n setRole('alert');\n setUnsafe_emulateAssertiveNVDA(false);\n }\n if (options?.delay) {\n setTimeout(() => {\n setInternalMessage(message);\n }, options?.delay);\n } else {\n setInternalMessage(message);\n }\n });\n });\n },\n [reset],\n );\n\n useEffect(() => {\n if (props.methods) {\n props.methods.current.read = configure;\n }\n }, [configure, props.methods]);\n\n if (unsafe_emulateAssertiveNVDA) return null;\n\n return ReactDOM.createPortal(\n <StyledContainer aria-atomic id={id} role={role} aria-live={ariaLive}>\n {internalMessage}\n </StyledContainer>,\n portal?.current || document.body,\n );\n});\n\nconst useLiveRegion = (props: UseLiveRegionT.Props) => {\n const methods = useRef<Methods>({});\n\n const { id, portal } = props || {};\n\n const instanceUID = useMemo(() => `ds-live-region-${uid(5)}`, []);\n\n const read = useCallback((message: string, options: Options) => methods.current.read?.(message, options), []);\n\n return useMemo(\n () => ({\n LiveRegion: () => <DSLiveRegion methods={methods} id={id ?? instanceUID} portal={portal} />,\n read,\n }),\n [id, instanceUID, portal, read],\n );\n};\n\nuseLiveRegion.displayName = 'useLiveRegion';\nconst UseLiveRegionWithSchema = describe(useLiveRegion);\nUseLiveRegionWithSchema.propTypes = UseLiveRegionPropTypes;\nexport { useLiveRegion, UseLiveRegionWithSchema };\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACuEnB;AAtEJ,OAAO,cAAc;AACrB,SAAgB,MAAM,WAAW,UAAU,aAAa,QAAQ,eAAe;AAC/E,SAAS,gBAAgB;AACzB,SAAS,WAAW;AACpB,SAAS,uBAAuB;AAChC,SAAS,8BAA8B;AAiBvC,MAAM,eAAe,KAAK,CAAC,UAAqC;AAC9D,QAAM,CAAC,iBAAiB,kBAAkB,IAAI,SAAiB,EAAE;AAEjE,QAAM,CAAC,6BAA6B,8BAA8B,IAAI,SAAS,KAAK;AACpF,QAAM,CAAC,MAAM,OAAO,IAAI,SAA6B,MAAS;AAC9D,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,QAAQ;AACjD,QAAM,EAAE,IAAI,OAAO,IAAI,SAAS,CAAC;AAEjC,QAAM,QAAQ,YAAY,MAAM;AAC9B,uBAAmB,EAAE;AACrB,mCAA+B,KAAK;AACpC,gBAAY,QAAQ;AACpB,YAAQ,MAAS;AAAA,EACnB,GAAG,CAAC,CAAC;AAEL,QAAM,YAAY;AAAA,IAChB,CAAC,SAAiB,YAAqB;AACrC,YAAM;AACN,iBAAW,MAAM;AACf,YAAI,SAAS;AAA6B,yCAA+B,IAAI;AAC7E,mBAAW,MAAM;AACf,cAAI,SAAS,aAAa,SAAS;AAA6B,wBAAY,WAAW;AACvF,cAAI,SAAS,6BAA6B;AACxC,oBAAQ,OAAO;AACf,2CAA+B,KAAK;AAAA,UACtC;AACA,cAAI,SAAS,OAAO;AAClB,uBAAW,MAAM;AACf,iCAAmB,OAAO;AAAA,YAC5B,GAAG,SAAS,KAAK;AAAA,UACnB,OAAO;AACL,+BAAmB,OAAO;AAAA,UAC5B;AAAA,QACF,CAAC;AAAA,MACH,CAAC;AAAA,IACH;AAAA,IACA,CAAC,KAAK;AAAA,EACR;AAEA,YAAU,MAAM;AACd,QAAI,MAAM,SAAS;AACjB,YAAM,QAAQ,QAAQ,OAAO;AAAA,IAC/B;AAAA,EACF,GAAG,CAAC,WAAW,MAAM,OAAO,CAAC;AAE7B,MAAI;AAA6B,WAAO;AAExC,SAAO,SAAS;AAAA,IACd,oBAAC,mBAAgB,eAAW,MAAC,IAAQ,MAAY,aAAW,UACzD,2BACH;AAAA,IACA,QAAQ,WAAW,SAAS;AAAA,EAC9B;AACF,CAAC;AAED,MAAM,gBAAgB,CAAC,UAAgC;AACrD,QAAM,UAAU,OAAgB,CAAC,CAAC;AAElC,QAAM,EAAE,IAAI,OAAO,IAAI,SAAS,CAAC;AAEjC,QAAM,cAAc,QAAQ,MAAM,kBAAkB,IAAI,CAAC,KAAK,CAAC,CAAC;AAEhE,QAAM,OAAO,YAAY,CAAC,SAAiB,YAAqB,QAAQ,QAAQ,OAAO,SAAS,OAAO,GAAG,CAAC,CAAC;AAE5G,SAAO;AAAA,IACL,OAAO;AAAA,MACL,YAAY,MAAM,oBAAC,gBAAa,SAAkB,IAAI,MAAM,aAAa,QAAgB;AAAA,MACzF;AAAA,IACF;AAAA,IACA,CAAC,IAAI,aAAa,QAAQ,IAAI;AAAA,EAChC;AACF;AAEA,cAAc,cAAc;AAC5B,MAAM,0BAA0B,SAAS,aAAa;AACtD,wBAAwB,YAAY;",
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/skip-to/propTypes.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes } from '@elliemae/ds-utilities';\n\nexport const propTypes = {\n goTo: PropTypes.string.isRequired.description(\"String containing content's id that you want to go.\"),\n message: PropTypes.string.description(\"Message for the Skip To component, default is 'Skip to main content'.\"),\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,iBAAiB;AAEnB,MAAM,YAAY;AAAA,EACvB,MAAM,UAAU,OAAO,WAAW,YAAY,qDAAqD;AAAA,EACnG,SAAS,UAAU,OAAO,YAAY,uEAAuE;AAC/G;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { WeakValidationMap } from 'react';\nimport { PropTypes } from '@elliemae/ds-utilities';\n\nexport const propTypes = {\n goTo: PropTypes.string.isRequired.description(\"String containing content's id that you want to go.\"),\n message: PropTypes.string.description(\"Message for the Skip To component, default is 'Skip to main content'.\"),\n} as WeakValidationMap<unknown>;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,iBAAiB;AAEnB,MAAM,YAAY;AAAA,EACvB,MAAM,UAAU,OAAO,WAAW,YAAY,qDAAqD;AAAA,EACnG,SAAS,UAAU,OAAO,YAAY,uEAAuE;AAC/G;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-accessibility",
3
- "version": "3.14.0-next.1",
3
+ "version": "3.14.0-next.11",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Accessibility",
6
6
  "files": [
@@ -52,8 +52,8 @@
52
52
  },
53
53
  "dependencies": {
54
54
  "uid": "~2.0.0",
55
- "@elliemae/ds-system": "3.14.0-next.1",
56
- "@elliemae/ds-utilities": "3.14.0-next.1"
55
+ "@elliemae/ds-system": "3.14.0-next.11",
56
+ "@elliemae/ds-utilities": "3.14.0-next.11"
57
57
  },
58
58
  "devDependencies": {
59
59
  "styled-components": "~5.3.6"