@elliemae/ds-accessibility 3.0.0-next.8 → 3.0.0-next.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +12 -17
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/live-region/DSLiveRegion.js +53 -0
- package/dist/cjs/live-region/DSLiveRegion.js.map +7 -0
- package/dist/cjs/live-region/index.js +22 -0
- package/dist/cjs/live-region/index.js.map +7 -0
- package/dist/cjs/live-region/propTypes.js +35 -0
- package/dist/cjs/live-region/propTypes.js.map +7 -0
- package/dist/cjs/live-region/styles.js +40 -0
- package/dist/cjs/live-region/styles.js.map +7 -0
- package/dist/cjs/skip-to/DSSkipTo.js +10 -16
- package/dist/cjs/skip-to/DSSkipTo.js.map +2 -2
- package/dist/cjs/skip-to/index.d.js +9 -16
- package/dist/cjs/skip-to/index.d.js.map +1 -1
- package/dist/cjs/skip-to/index.js +11 -17
- package/dist/cjs/skip-to/index.js.map +1 -1
- package/dist/cjs/skip-to/propTypes.js +9 -16
- package/dist/cjs/skip-to/propTypes.js.map +1 -1
- package/dist/cjs/skip-to/styles.js +9 -16
- package/dist/cjs/skip-to/styles.js.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/live-region/DSLiveRegion.js +31 -0
- package/dist/esm/live-region/DSLiveRegion.js.map +7 -0
- package/dist/esm/live-region/index.js +3 -0
- package/dist/esm/live-region/index.js.map +7 -0
- package/dist/esm/live-region/propTypes.js +13 -0
- package/dist/esm/live-region/propTypes.js.map +7 -0
- package/dist/esm/live-region/styles.js +18 -0
- package/dist/esm/live-region/styles.js.map +7 -0
- package/dist/esm/skip-to/DSSkipTo.js +1 -0
- package/dist/esm/skip-to/DSSkipTo.js.map +2 -2
- package/dist/esm/skip-to/propTypes.js.map +1 -1
- package/package.json +10 -10
package/dist/cjs/index.js
CHANGED
@@ -4,25 +4,20 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
-
var
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
9
|
+
for (let key of __getOwnPropNames(from))
|
10
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
11
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
13
12
|
}
|
14
|
-
return
|
13
|
+
return to;
|
15
14
|
};
|
16
|
-
var
|
17
|
-
|
18
|
-
};
|
19
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
20
|
-
return (module2, temp) => {
|
21
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
22
|
-
};
|
23
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
15
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
24
18
|
var src_exports = {};
|
25
|
-
var React = __toESM(require("react"));
|
26
|
-
__reExport(src_exports, require("./skip-to"));
|
27
19
|
module.exports = __toCommonJS(src_exports);
|
20
|
+
var React = __toESM(require("react"));
|
21
|
+
__reExport(src_exports, require("./skip-to"), module.exports);
|
22
|
+
__reExport(src_exports, require("./live-region"), module.exports);
|
28
23
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../src/index.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
4
|
-
"sourcesContent": ["export * from './skip-to';\n", "import * as React from 'react';\nexport { React };\n"],
|
5
|
-
"mappings": "
|
4
|
+
"sourcesContent": ["export * from './skip-to';\nexport * from './live-region';\n", "import * as React from 'react';\nexport { React };\n"],
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAc,sBAAd;AACA,wBAAc,0BADd;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -0,0 +1,53 @@
|
|
1
|
+
var __create = Object.create;
|
2
|
+
var __defProp = Object.defineProperty;
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
+
var __export = (target, all) => {
|
8
|
+
for (var name in all)
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
10
|
+
};
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
13
|
+
for (let key of __getOwnPropNames(from))
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
16
|
+
}
|
17
|
+
return to;
|
18
|
+
};
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
21
|
+
var DSLiveRegion_exports = {};
|
22
|
+
__export(DSLiveRegion_exports, {
|
23
|
+
DSLiveRegion: () => DSLiveRegion,
|
24
|
+
DSLiveRegionWithSchema: () => DSLiveRegionWithSchema
|
25
|
+
});
|
26
|
+
module.exports = __toCommonJS(DSLiveRegion_exports);
|
27
|
+
var React = __toESM(require("react"));
|
28
|
+
var import_react_dom = __toESM(require("react-dom"));
|
29
|
+
var import_react = __toESM(require("react"));
|
30
|
+
var import_ds_utilities = require("@elliemae/ds-utilities");
|
31
|
+
var import_styles = require("./styles");
|
32
|
+
var import_propTypes = require("./propTypes");
|
33
|
+
const DSLiveRegion = (0, import_react.memo)((props) => {
|
34
|
+
const [text, setText] = (0, import_react.useState)("");
|
35
|
+
(0, import_react.useEffect)(() => {
|
36
|
+
if (props.methods && props.methods.current) {
|
37
|
+
props.methods.current.read = setText;
|
38
|
+
}
|
39
|
+
}, [props.methods]);
|
40
|
+
if (text === "")
|
41
|
+
return null;
|
42
|
+
return import_react_dom.default.createPortal(/* @__PURE__ */ import_react.default.createElement(import_styles.StyledContainer, {
|
43
|
+
"aria-atomic": true,
|
44
|
+
id: props["id"],
|
45
|
+
role: props["role"],
|
46
|
+
"aria-live": props["aria-live"] || "polite"
|
47
|
+
}, text), props.portal?.current || document.body);
|
48
|
+
});
|
49
|
+
DSLiveRegion.propTypes = import_propTypes.propTypes;
|
50
|
+
DSLiveRegion.displayName = "DSLiveRegion";
|
51
|
+
const DSLiveRegionWithSchema = (0, import_ds_utilities.describe)(DSLiveRegion);
|
52
|
+
DSLiveRegionWithSchema.propTypes = import_propTypes.propTypes;
|
53
|
+
//# sourceMappingURL=DSLiveRegion.js.map
|
@@ -0,0 +1,7 @@
|
|
1
|
+
{
|
2
|
+
"version": 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;ADAvB,uBAAqB;AACrB,mBAAiD;AACjD,0BAAyB;AACzB,oBAAgC;AAChC,uBAA0B;AAG1B,MAAM,eAAe,uBAAK,CAAC,UAAmD;AAC5E,QAAM,CAAC,MAAM,WAAW,2BAAS,EAAE;AAEnC,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,yBAAS,aACd,mDAAC;AAAA,IAAgB,eAAW;AAAA,IAAC,IAAI,MAAM;AAAA,IAAO,MAAM,MAAM;AAAA,IAAS,aAAW,MAAM,gBAAgB;AAAA,KACjG,IACH,GACA,MAAM,QAAQ,WAAW,SAAS,IACpC;AACF,CAAC;AAED,aAAa,YAAY;AACzB,aAAa,cAAc;AAC3B,MAAM,yBAAyB,kCAAS,YAAY;AACpD,uBAAuB,YAAY;",
|
6
|
+
"names": []
|
7
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
var __create = Object.create;
|
2
|
+
var __defProp = Object.defineProperty;
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
9
|
+
for (let key of __getOwnPropNames(from))
|
10
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
11
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
12
|
+
}
|
13
|
+
return to;
|
14
|
+
};
|
15
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
18
|
+
var live_region_exports = {};
|
19
|
+
module.exports = __toCommonJS(live_region_exports);
|
20
|
+
var React = __toESM(require("react"));
|
21
|
+
__reExport(live_region_exports, require("./DSLiveRegion"), module.exports);
|
22
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1,7 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../src/live-region/index.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
4
|
+
"sourcesContent": ["export * from './DSLiveRegion';\n", "import * as React from 'react';\nexport { React };\n"],
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;ADAvB,gCAAc,2BAAd;",
|
6
|
+
"names": []
|
7
|
+
}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
var __create = Object.create;
|
2
|
+
var __defProp = Object.defineProperty;
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
+
var __export = (target, all) => {
|
8
|
+
for (var name in all)
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
10
|
+
};
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
13
|
+
for (let key of __getOwnPropNames(from))
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
16
|
+
}
|
17
|
+
return to;
|
18
|
+
};
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
21
|
+
var propTypes_exports = {};
|
22
|
+
__export(propTypes_exports, {
|
23
|
+
propTypes: () => propTypes
|
24
|
+
});
|
25
|
+
module.exports = __toCommonJS(propTypes_exports);
|
26
|
+
var React = __toESM(require("react"));
|
27
|
+
var import_ds_utilities = require("@elliemae/ds-utilities");
|
28
|
+
const propTypes = {
|
29
|
+
methods: import_ds_utilities.PropTypes.object.description("Ref Object."),
|
30
|
+
portal: import_ds_utilities.PropTypes.node.description("Sets a custom portal").defaultValue("Body Element."),
|
31
|
+
["aria-live"]: import_ds_utilities.PropTypes.oneOf(["assertive", "polite", "off"]).description("Selects your aria live mode."),
|
32
|
+
role: import_ds_utilities.PropTypes.oneOf(["log", "status", "alert", "progressbar", "marquee", "timer"]).description("Selects your specific role."),
|
33
|
+
id: import_ds_utilities.PropTypes.string.description("Unique id for the Live Region.")
|
34
|
+
};
|
35
|
+
//# sourceMappingURL=propTypes.js.map
|
@@ -0,0 +1,7 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../src/live-region/propTypes.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
4
|
+
"sourcesContent": ["import { PropTypes } from '@elliemae/ds-utilities';\nimport type React from 'react';\n\nexport declare module DSLiveRegionT {\n interface Methods {\n read: React.Dispatch<React.SetStateAction<string>>;\n }\n export interface Props {\n methods?: React.MutableRefObject<Methods>;\n portal?: React.MutableRefObject<HTMLElement>;\n ['aria-live']?: 'off' | 'assertive' | 'polite';\n role?: 'log' | 'status' | 'alert' | 'progressbar' | 'marquee' | 'timer';\n id?: string;\n }\n}\n\nexport const propTypes = {\n methods: PropTypes.object.description('Ref Object.'),\n portal: PropTypes.node.description('Sets a custom portal').defaultValue('Body Element.'),\n ['aria-live']: PropTypes.oneOf(['assertive', 'polite', 'off']).description('Selects your aria live mode.'),\n role: PropTypes.oneOf(['log', 'status', 'alert', 'progressbar', 'marquee', 'timer']).description(\n 'Selects your specific role.',\n ),\n id: PropTypes.string.description('Unique id for the Live Region.'),\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,0BAA0B;AAgBnB,MAAM,YAAY;AAAA,EACvB,SAAS,8BAAU,OAAO,YAAY,aAAa;AAAA,EACnD,QAAQ,8BAAU,KAAK,YAAY,sBAAsB,EAAE,aAAa,eAAe;AAAA,GACtF,cAAc,8BAAU,MAAM,CAAC,aAAa,UAAU,KAAK,CAAC,EAAE,YAAY,8BAA8B;AAAA,EACzG,MAAM,8BAAU,MAAM,CAAC,OAAO,UAAU,SAAS,eAAe,WAAW,OAAO,CAAC,EAAE,YACnF,6BACF;AAAA,EACA,IAAI,8BAAU,OAAO,YAAY,gCAAgC;AACnE;",
|
6
|
+
"names": []
|
7
|
+
}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
var __create = Object.create;
|
2
|
+
var __defProp = Object.defineProperty;
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
+
var __export = (target, all) => {
|
8
|
+
for (var name in all)
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
10
|
+
};
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
13
|
+
for (let key of __getOwnPropNames(from))
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
16
|
+
}
|
17
|
+
return to;
|
18
|
+
};
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
21
|
+
var styles_exports = {};
|
22
|
+
__export(styles_exports, {
|
23
|
+
StyledContainer: () => StyledContainer
|
24
|
+
});
|
25
|
+
module.exports = __toCommonJS(styles_exports);
|
26
|
+
var React = __toESM(require("react"));
|
27
|
+
var import_ds_system = require("@elliemae/ds-system");
|
28
|
+
const StyledContainer = import_ds_system.styled.div`
|
29
|
+
position: absolute;
|
30
|
+
width: 1px;
|
31
|
+
height: 1px;
|
32
|
+
margin: -1px;
|
33
|
+
border: 0;
|
34
|
+
padding: 0;
|
35
|
+
overflow: hidden;
|
36
|
+
clip: rect(0 0 0 0);
|
37
|
+
clip-path: inset(100%);
|
38
|
+
white-space: nowrap;
|
39
|
+
`;
|
40
|
+
//# sourceMappingURL=styles.js.map
|
@@ -0,0 +1,7 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../src/live-region/styles.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
4
|
+
"sourcesContent": ["import { styled } from '@elliemae/ds-system';\n\nexport const StyledContainer = styled.div`\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n border: 0;\n padding: 0;\n overflow: hidden;\n clip: rect(0 0 0 0);\n clip-path: inset(100%);\n white-space: nowrap;\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAuB;AAEhB,MAAM,kBAAkB,wBAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
|
6
|
+
"names": []
|
7
|
+
}
|
@@ -4,32 +4,26 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
8
7
|
var __export = (target, all) => {
|
9
8
|
for (var name in all)
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
11
10
|
};
|
12
|
-
var
|
13
|
-
if (
|
14
|
-
for (let key of __getOwnPropNames(
|
15
|
-
if (!__hasOwnProp.call(
|
16
|
-
__defProp(
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
13
|
+
for (let key of __getOwnPropNames(from))
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
17
16
|
}
|
18
|
-
return
|
17
|
+
return to;
|
19
18
|
};
|
20
|
-
var __toESM = (
|
21
|
-
|
22
|
-
};
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
24
|
-
return (module2, temp) => {
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
26
|
-
};
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
28
21
|
var DSSkipTo_exports = {};
|
29
22
|
__export(DSSkipTo_exports, {
|
30
23
|
DSSkipTo: () => DSSkipTo,
|
31
24
|
DSSkipToWithSchema: () => DSSkipToWithSchema
|
32
25
|
});
|
26
|
+
module.exports = __toCommonJS(DSSkipTo_exports);
|
33
27
|
var React = __toESM(require("react"));
|
34
28
|
var import_react = __toESM(require("react"));
|
35
29
|
var import_react_desc = require("react-desc");
|
@@ -45,7 +39,7 @@ const DSSkipTo = (props) => {
|
|
45
39
|
}, message);
|
46
40
|
};
|
47
41
|
DSSkipTo.propTypes = import_propTypes.propTypes;
|
42
|
+
DSSkipTo.displayName = "DSSkipTo";
|
48
43
|
const DSSkipToWithSchema = (0, import_react_desc.describe)(DSSkipTo);
|
49
44
|
DSSkipToWithSchema.propTypes = import_propTypes.propTypes;
|
50
|
-
module.exports = __toCommonJS(DSSkipTo_exports);
|
51
45
|
//# sourceMappingURL=DSSkipTo.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../src/skip-to/DSSkipTo.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
4
|
-
"sourcesContent": ["import React, { useCallback } from 'react';\nimport { describe } from 'react-desc';\nimport { propTypes } from './propTypes';\nimport type { DSSkipToPropsT as Props } from './index.d';\nimport { StyledButton } from './styles';\n\nconst DSSkipTo = (props: Props): JSX.Element => {\n const { goTo, message = 'Skip to main content' } = props;\n const handleOnClick = useCallback(() => {\n (document.getElementById(goTo) as HTMLElement).focus();\n }, [goTo]);\n return <StyledButton onClick={handleOnClick}>{message}</StyledButton>;\n};\n\nDSSkipTo.propTypes = propTypes;\nconst DSSkipToWithSchema = describe(DSSkipTo);\nDSSkipToWithSchema.propTypes = propTypes;\n\nexport { DSSkipTo, DSSkipToWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
5
|
-
"mappings": "
|
4
|
+
"sourcesContent": ["import React, { useCallback } from 'react';\nimport { describe } from 'react-desc';\nimport { propTypes } from './propTypes';\nimport type { DSSkipToPropsT as Props } from './index.d';\nimport { StyledButton } from './styles';\n\nconst DSSkipTo = (props: Props): JSX.Element => {\n const { goTo, message = 'Skip to main content' } = props;\n const handleOnClick = useCallback(() => {\n (document.getElementById(goTo) as HTMLElement).focus();\n }, [goTo]);\n return <StyledButton onClick={handleOnClick}>{message}</StyledButton>;\n};\n\nDSSkipTo.propTypes = propTypes;\nDSSkipTo.displayName = 'DSSkipTo';\nconst DSSkipToWithSchema = describe(DSSkipTo);\nDSSkipToWithSchema.propTypes = propTypes;\n\nexport { DSSkipTo, DSSkipToWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAmC;AACnC,wBAAyB;AACzB,uBAA0B;AAE1B,oBAA6B;AAE7B,MAAM,WAAW,CAAC,UAA8B;AAC9C,QAAM,EAAE,MAAM,UAAU,2BAA2B;AACnD,QAAM,gBAAgB,8BAAY,MAAM;AACtC,IAAC,SAAS,eAAe,IAAI,EAAkB,MAAM;AAAA,EACvD,GAAG,CAAC,IAAI,CAAC;AACT,SAAO,mDAAC;AAAA,IAAa,SAAS;AAAA,KAAgB,OAAQ;AACxD;AAEA,SAAS,YAAY;AACrB,SAAS,cAAc;AACvB,MAAM,qBAAqB,gCAAS,QAAQ;AAC5C,mBAAmB,YAAY;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -4,24 +4,17 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
-
var
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
9
|
+
for (let key of __getOwnPropNames(from))
|
10
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
11
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
13
12
|
}
|
14
|
-
return
|
13
|
+
return to;
|
15
14
|
};
|
16
|
-
var __toESM = (
|
17
|
-
|
18
|
-
};
|
19
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
20
|
-
return (module2, temp) => {
|
21
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
22
|
-
};
|
23
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
15
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
16
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
24
17
|
var index_d_exports = {};
|
25
|
-
var React = __toESM(require("react"));
|
26
18
|
module.exports = __toCommonJS(index_d_exports);
|
19
|
+
var React = __toESM(require("react"));
|
27
20
|
//# sourceMappingURL=index.d.js.map
|
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../src/skip-to/index.d.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
4
4
|
"sourcesContent": ["export interface DSSkipToPropsT {\n goTo: string;\n message?: string;\n}\n", "import * as React from 'react';\nexport { React };\n"],
|
5
|
-
"mappings": "
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -4,25 +4,19 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
-
var
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
9
|
+
for (let key of __getOwnPropNames(from))
|
10
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
11
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
13
12
|
}
|
14
|
-
return
|
13
|
+
return to;
|
15
14
|
};
|
16
|
-
var
|
17
|
-
|
18
|
-
};
|
19
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
20
|
-
return (module2, temp) => {
|
21
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
22
|
-
};
|
23
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
15
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
24
18
|
var skip_to_exports = {};
|
25
|
-
var React = __toESM(require("react"));
|
26
|
-
__reExport(skip_to_exports, require("./DSSkipTo"));
|
27
19
|
module.exports = __toCommonJS(skip_to_exports);
|
20
|
+
var React = __toESM(require("react"));
|
21
|
+
__reExport(skip_to_exports, require("./DSSkipTo"), module.exports);
|
28
22
|
//# sourceMappingURL=index.js.map
|
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../src/skip-to/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
4
4
|
"sourcesContent": ["export * from './DSSkipTo';\n", "import * as React from 'react';\nexport { React };\n"],
|
5
|
-
"mappings": "
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;ADAvB,4BAAc,uBAAd;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -4,36 +4,29 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
8
7
|
var __export = (target, all) => {
|
9
8
|
for (var name in all)
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
11
10
|
};
|
12
|
-
var
|
13
|
-
if (
|
14
|
-
for (let key of __getOwnPropNames(
|
15
|
-
if (!__hasOwnProp.call(
|
16
|
-
__defProp(
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
13
|
+
for (let key of __getOwnPropNames(from))
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
17
16
|
}
|
18
|
-
return
|
17
|
+
return to;
|
19
18
|
};
|
20
|
-
var __toESM = (
|
21
|
-
|
22
|
-
};
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
24
|
-
return (module2, temp) => {
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
26
|
-
};
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
28
21
|
var propTypes_exports = {};
|
29
22
|
__export(propTypes_exports, {
|
30
23
|
propTypes: () => propTypes
|
31
24
|
});
|
25
|
+
module.exports = __toCommonJS(propTypes_exports);
|
32
26
|
var React = __toESM(require("react"));
|
33
27
|
var import_react_desc = require("react-desc");
|
34
28
|
const propTypes = {
|
35
29
|
goTo: import_react_desc.PropTypes.string.isRequired.description("String containing content's id that you want to go."),
|
36
30
|
message: import_react_desc.PropTypes.string.description("Message for the Skip To component, default is 'Skip to main content'.")
|
37
31
|
};
|
38
|
-
module.exports = __toCommonJS(propTypes_exports);
|
39
32
|
//# sourceMappingURL=propTypes.js.map
|
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../src/skip-to/propTypes.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
4
4
|
"sourcesContent": ["import { PropTypes } from 'react-desc';\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": "
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAA0B;AAEnB,MAAM,YAAY;AAAA,EACvB,MAAM,4BAAU,OAAO,WAAW,YAAY,qDAAqD;AAAA,EACnG,SAAS,4BAAU,OAAO,YAAY,uEAAuE;AAC/G;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -4,31 +4,25 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
8
7
|
var __export = (target, all) => {
|
9
8
|
for (var name in all)
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
11
10
|
};
|
12
|
-
var
|
13
|
-
if (
|
14
|
-
for (let key of __getOwnPropNames(
|
15
|
-
if (!__hasOwnProp.call(
|
16
|
-
__defProp(
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
13
|
+
for (let key of __getOwnPropNames(from))
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
17
16
|
}
|
18
|
-
return
|
17
|
+
return to;
|
19
18
|
};
|
20
|
-
var __toESM = (
|
21
|
-
|
22
|
-
};
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
24
|
-
return (module2, temp) => {
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
26
|
-
};
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
28
21
|
var styles_exports = {};
|
29
22
|
__export(styles_exports, {
|
30
23
|
StyledButton: () => StyledButton
|
31
24
|
});
|
25
|
+
module.exports = __toCommonJS(styles_exports);
|
32
26
|
var React = __toESM(require("react"));
|
33
27
|
var import_styled_components = __toESM(require("styled-components"));
|
34
28
|
const StyledButton = import_styled_components.default.button`
|
@@ -58,5 +52,4 @@ const StyledButton = import_styled_components.default.button`
|
|
58
52
|
overflow: auto;
|
59
53
|
}
|
60
54
|
`;
|
61
|
-
module.exports = __toCommonJS(styles_exports);
|
62
55
|
//# sourceMappingURL=styles.js.map
|
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../src/skip-to/styles.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
4
4
|
"sourcesContent": ["import styled from 'styled-components';\n\nexport const StyledButton = styled.button`\n left: -999px;\n outline: none;\n position: absolute;\n top: auto;\n width: 1px;\n height: 1px;\n overflow: hidden;\n z-index: -999;\n &:focus,\n &:active {\n color: ${({ theme }) => theme.colors.brand[600]};\n background-color: ${({ theme }) => theme.colors.neutral['000']};\n text-decoration: underline;\n left: 0;\n top: 0;\n height: auto;\n cursor: pointer;\n width: fit-content;\n padding: ${({ theme }) => `${theme.space.xxxs} ${theme.space.xxs}`};\n border-radius: 2px;\n border: 2px solid ${({ theme }) => theme.colors.brand[700]};\n text-align: center;\n z-index: 999;\n overflow: auto;\n }\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
5
|
-
"mappings": "
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,+BAAmB;AAEZ,MAAM,eAAe,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAWtB,CAAC,EAAE,YAAY,MAAM,OAAO,MAAM;AAAA,wBACvB,CAAC,EAAE,YAAY,MAAM,OAAO,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAO7C,CAAC,EAAE,YAAY,GAAG,MAAM,MAAM,QAAQ,MAAM,MAAM;AAAA;AAAA,wBAEzC,CAAC,EAAE,YAAY,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;",
|
6
6
|
"names": []
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
package/dist/esm/index.js.map
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './skip-to';\n"],
|
5
|
-
"mappings": "AAAA;ACAA;",
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './skip-to';\nexport * from './live-region';\n"],
|
5
|
+
"mappings": "AAAA;ACAA;AACA;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import * as React from "react";
|
2
|
+
import ReactDOM from "react-dom";
|
3
|
+
import React2, { memo, useEffect, useState } from "react";
|
4
|
+
import { describe } from "@elliemae/ds-utilities";
|
5
|
+
import { StyledContainer } from "./styles";
|
6
|
+
import { propTypes } from "./propTypes";
|
7
|
+
const DSLiveRegion = memo((props) => {
|
8
|
+
const [text, setText] = useState("");
|
9
|
+
useEffect(() => {
|
10
|
+
if (props.methods && props.methods.current) {
|
11
|
+
props.methods.current.read = setText;
|
12
|
+
}
|
13
|
+
}, [props.methods]);
|
14
|
+
if (text === "")
|
15
|
+
return null;
|
16
|
+
return ReactDOM.createPortal(/* @__PURE__ */ React2.createElement(StyledContainer, {
|
17
|
+
"aria-atomic": true,
|
18
|
+
id: props["id"],
|
19
|
+
role: props["role"],
|
20
|
+
"aria-live": props["aria-live"] || "polite"
|
21
|
+
}, text), props.portal?.current || document.body);
|
22
|
+
});
|
23
|
+
DSLiveRegion.propTypes = propTypes;
|
24
|
+
DSLiveRegion.displayName = "DSLiveRegion";
|
25
|
+
const DSLiveRegionWithSchema = describe(DSLiveRegion);
|
26
|
+
DSLiveRegionWithSchema.propTypes = propTypes;
|
27
|
+
export {
|
28
|
+
DSLiveRegion,
|
29
|
+
DSLiveRegionWithSchema
|
30
|
+
};
|
31
|
+
//# sourceMappingURL=DSLiveRegion.js.map
|
@@ -0,0 +1,7 @@
|
|
1
|
+
{
|
2
|
+
"version": 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;ACAA;AACA;AACA;AACA;AACA;AAGA,MAAM,eAAe,KAAK,CAAC,UAAmD;AAC5E,QAAM,CAAC,MAAM,WAAW,SAAS,EAAE;AAEnC,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,aACd,qCAAC;AAAA,IAAgB,eAAW;AAAA,IAAC,IAAI,MAAM;AAAA,IAAO,MAAM,MAAM;AAAA,IAAS,aAAW,MAAM,gBAAgB;AAAA,KACjG,IACH,GACA,MAAM,QAAQ,WAAW,SAAS,IACpC;AACF,CAAC;AAED,aAAa,YAAY;AACzB,aAAa,cAAc;AAC3B,MAAM,yBAAyB,SAAS,YAAY;AACpD,uBAAuB,YAAY;",
|
6
|
+
"names": []
|
7
|
+
}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/live-region/index.ts"],
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './DSLiveRegion';\n"],
|
5
|
+
"mappings": "AAAA;ACAA;",
|
6
|
+
"names": []
|
7
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import * as React from "react";
|
2
|
+
import { PropTypes } from "@elliemae/ds-utilities";
|
3
|
+
const propTypes = {
|
4
|
+
methods: PropTypes.object.description("Ref Object."),
|
5
|
+
portal: PropTypes.node.description("Sets a custom portal").defaultValue("Body Element."),
|
6
|
+
["aria-live"]: PropTypes.oneOf(["assertive", "polite", "off"]).description("Selects your aria live mode."),
|
7
|
+
role: PropTypes.oneOf(["log", "status", "alert", "progressbar", "marquee", "timer"]).description("Selects your specific role."),
|
8
|
+
id: PropTypes.string.description("Unique id for the Live Region.")
|
9
|
+
};
|
10
|
+
export {
|
11
|
+
propTypes
|
12
|
+
};
|
13
|
+
//# sourceMappingURL=propTypes.js.map
|
@@ -0,0 +1,7 @@
|
|
1
|
+
{
|
2
|
+
"version": 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 { PropTypes } from '@elliemae/ds-utilities';\nimport type React from 'react';\n\nexport declare module DSLiveRegionT {\n interface Methods {\n read: React.Dispatch<React.SetStateAction<string>>;\n }\n export interface Props {\n methods?: React.MutableRefObject<Methods>;\n portal?: React.MutableRefObject<HTMLElement>;\n ['aria-live']?: 'off' | 'assertive' | 'polite';\n role?: 'log' | 'status' | 'alert' | 'progressbar' | 'marquee' | 'timer';\n id?: string;\n }\n}\n\nexport const propTypes = {\n methods: PropTypes.object.description('Ref Object.'),\n portal: PropTypes.node.description('Sets a custom portal').defaultValue('Body Element.'),\n ['aria-live']: PropTypes.oneOf(['assertive', 'polite', 'off']).description('Selects your aria live mode.'),\n role: PropTypes.oneOf(['log', 'status', 'alert', 'progressbar', 'marquee', 'timer']).description(\n 'Selects your specific role.',\n ),\n id: PropTypes.string.description('Unique id for the Live Region.'),\n};\n"],
|
5
|
+
"mappings": "AAAA;ACAA;AAgBO,MAAM,YAAY;AAAA,EACvB,SAAS,UAAU,OAAO,YAAY,aAAa;AAAA,EACnD,QAAQ,UAAU,KAAK,YAAY,sBAAsB,EAAE,aAAa,eAAe;AAAA,GACtF,cAAc,UAAU,MAAM,CAAC,aAAa,UAAU,KAAK,CAAC,EAAE,YAAY,8BAA8B;AAAA,EACzG,MAAM,UAAU,MAAM,CAAC,OAAO,UAAU,SAAS,eAAe,WAAW,OAAO,CAAC,EAAE,YACnF,6BACF;AAAA,EACA,IAAI,UAAU,OAAO,YAAY,gCAAgC;AACnE;",
|
6
|
+
"names": []
|
7
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import * as React from "react";
|
2
|
+
import { styled } from "@elliemae/ds-system";
|
3
|
+
const StyledContainer = styled.div`
|
4
|
+
position: absolute;
|
5
|
+
width: 1px;
|
6
|
+
height: 1px;
|
7
|
+
margin: -1px;
|
8
|
+
border: 0;
|
9
|
+
padding: 0;
|
10
|
+
overflow: hidden;
|
11
|
+
clip: rect(0 0 0 0);
|
12
|
+
clip-path: inset(100%);
|
13
|
+
white-space: nowrap;
|
14
|
+
`;
|
15
|
+
export {
|
16
|
+
StyledContainer
|
17
|
+
};
|
18
|
+
//# sourceMappingURL=styles.js.map
|
@@ -0,0 +1,7 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/live-region/styles.ts"],
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled } from '@elliemae/ds-system';\n\nexport const StyledContainer = styled.div`\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n border: 0;\n padding: 0;\n overflow: hidden;\n clip: rect(0 0 0 0);\n clip-path: inset(100%);\n white-space: nowrap;\n`;\n"],
|
5
|
+
"mappings": "AAAA;ACAA;AAEO,MAAM,kBAAkB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
|
6
|
+
"names": []
|
7
|
+
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/skip-to/DSSkipTo.tsx"],
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback } from 'react';\nimport { describe } from 'react-desc';\nimport { propTypes } from './propTypes';\nimport type { DSSkipToPropsT as Props } from './index.d';\nimport { StyledButton } from './styles';\n\nconst DSSkipTo = (props: Props): JSX.Element => {\n const { goTo, message = 'Skip to main content' } = props;\n const handleOnClick = useCallback(() => {\n (document.getElementById(goTo) as HTMLElement).focus();\n }, [goTo]);\n return <StyledButton onClick={handleOnClick}>{message}</StyledButton>;\n};\n\nDSSkipTo.propTypes = propTypes;\nconst DSSkipToWithSchema = describe(DSSkipTo);\nDSSkipToWithSchema.propTypes = propTypes;\n\nexport { DSSkipTo, DSSkipToWithSchema };\n"],
|
5
|
-
"mappings": "AAAA;ACAA;AACA;AACA;AAEA;AAEA,MAAM,WAAW,CAAC,UAA8B;AAC9C,QAAM,EAAE,MAAM,UAAU,2BAA2B;AACnD,QAAM,gBAAgB,YAAY,MAAM;AACtC,IAAC,SAAS,eAAe,
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback } from 'react';\nimport { describe } from 'react-desc';\nimport { propTypes } from './propTypes';\nimport type { DSSkipToPropsT as Props } from './index.d';\nimport { StyledButton } from './styles';\n\nconst DSSkipTo = (props: Props): JSX.Element => {\n const { goTo, message = 'Skip to main content' } = props;\n const handleOnClick = useCallback(() => {\n (document.getElementById(goTo) as HTMLElement).focus();\n }, [goTo]);\n return <StyledButton onClick={handleOnClick}>{message}</StyledButton>;\n};\n\nDSSkipTo.propTypes = propTypes;\nDSSkipTo.displayName = 'DSSkipTo';\nconst DSSkipToWithSchema = describe(DSSkipTo);\nDSSkipToWithSchema.propTypes = propTypes;\n\nexport { DSSkipTo, DSSkipToWithSchema };\n"],
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AAEA;AAEA,MAAM,WAAW,CAAC,UAA8B;AAC9C,QAAM,EAAE,MAAM,UAAU,2BAA2B;AACnD,QAAM,gBAAgB,YAAY,MAAM;AACtC,IAAC,SAAS,eAAe,IAAI,EAAkB,MAAM;AAAA,EACvD,GAAG,CAAC,IAAI,CAAC;AACT,SAAO,qCAAC;AAAA,IAAa,SAAS;AAAA,KAAgB,OAAQ;AACxD;AAEA,SAAS,YAAY;AACrB,SAAS,cAAc;AACvB,MAAM,qBAAqB,SAAS,QAAQ;AAC5C,mBAAmB,YAAY;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/skip-to/propTypes.tsx"],
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes } from 'react-desc';\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;ACAA;AAEO,MAAM,YAAY;AAAA,EACvB,MAAM,UAAU,OAAO,WAAW,YAAY;AAAA,
|
5
|
+
"mappings": "AAAA;ACAA;AAEO,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.0.0-next.
|
3
|
+
"version": "3.0.0-next.80",
|
4
4
|
"license": "MIT",
|
5
5
|
"description": "ICE MT - Dimsum - Accessibility",
|
6
6
|
"files": [
|
@@ -50,8 +50,15 @@
|
|
50
50
|
"reportFile": "tests.xml",
|
51
51
|
"indent": 4
|
52
52
|
},
|
53
|
+
"scripts": {
|
54
|
+
"dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
|
55
|
+
"test": "node ../../scripts/testing/test.mjs",
|
56
|
+
"lint": "node ../../scripts/lint.mjs",
|
57
|
+
"dts": "node ../../scripts/dts.mjs",
|
58
|
+
"build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs"
|
59
|
+
},
|
53
60
|
"dependencies": {
|
54
|
-
"
|
61
|
+
"@elliemae/ds-utilities": "workspace:*"
|
55
62
|
},
|
56
63
|
"devDependencies": {
|
57
64
|
"styled-components": "~5.3.3"
|
@@ -64,12 +71,5 @@
|
|
64
71
|
"publishConfig": {
|
65
72
|
"access": "public",
|
66
73
|
"typeSafety": false
|
67
|
-
},
|
68
|
-
"scripts": {
|
69
|
-
"dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
|
70
|
-
"test": "node ../../scripts/testing/test.mjs",
|
71
|
-
"lint": "node ../../scripts/lint.mjs",
|
72
|
-
"dts": "node ../../scripts/dts.mjs",
|
73
|
-
"build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs"
|
74
74
|
}
|
75
|
-
}
|
75
|
+
}
|