@dnd-kit/accessibility 3.0.0 → 3.0.1-next-20224300590
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +6 -0
- package/dist/accessibility.cjs.development.js +11 -9
- package/dist/accessibility.cjs.development.js.map +1 -1
- package/dist/accessibility.cjs.production.min.js +1 -1
- package/dist/accessibility.cjs.production.min.js.map +1 -1
- package/dist/accessibility.esm.js +11 -9
- package/dist/accessibility.esm.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# @dnd-kit/accessibility
|
2
2
|
|
3
|
+
## 3.0.1-next-20224300590
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- [#776](https://github.com/clauderic/dnd-kit/pull/776) [`3978c43`](https://github.com/clauderic/dnd-kit/commit/3978c43c6b045f10b75f47ad8bbea38a84437bd6) Thanks [@clauderic](https://github.com/clauderic)! - The ARIA live region element used for screen reader announcements is now positioned using `position: fixed` instead of `position: absolute`. As of `@dnd-kit/core^6.0.0`, the live region element is no longer portaled by default into the `document.body`. This change was introduced in order to fix issues with portaled live regions. However, this change can introduce visual regressions when using absolutely positioned elements, since the live region element is constrained to the stacking and position context of its closest positioned ancestor. Using fixed position ensures the element does not introduce visual regressions.
|
8
|
+
|
3
9
|
## 3.0.0
|
4
10
|
|
5
11
|
### Major Changes
|
@@ -10,10 +10,11 @@ var React__default = _interopDefault(React);
|
|
10
10
|
const hiddenStyles = {
|
11
11
|
display: 'none'
|
12
12
|
};
|
13
|
-
function HiddenText({
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
function HiddenText(_ref) {
|
14
|
+
let {
|
15
|
+
id,
|
16
|
+
value
|
17
|
+
} = _ref;
|
17
18
|
return React__default.createElement("div", {
|
18
19
|
id: id,
|
19
20
|
style: hiddenStyles
|
@@ -21,7 +22,7 @@ function HiddenText({
|
|
21
22
|
}
|
22
23
|
|
23
24
|
const visuallyHidden = {
|
24
|
-
position: '
|
25
|
+
position: 'fixed',
|
25
26
|
width: 1,
|
26
27
|
height: 1,
|
27
28
|
margin: -1,
|
@@ -32,10 +33,11 @@ const visuallyHidden = {
|
|
32
33
|
clipPath: 'inset(100%)',
|
33
34
|
whiteSpace: 'nowrap'
|
34
35
|
};
|
35
|
-
function LiveRegion({
|
36
|
-
|
37
|
-
|
38
|
-
|
36
|
+
function LiveRegion(_ref) {
|
37
|
+
let {
|
38
|
+
id,
|
39
|
+
announcement
|
40
|
+
} = _ref;
|
39
41
|
return React__default.createElement("div", {
|
40
42
|
id: id,
|
41
43
|
style: visuallyHidden,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"accessibility.cjs.development.js","sources":["../src/components/HiddenText/HiddenText.tsx","../src/components/LiveRegion/LiveRegion.tsx","../src/hooks/useAnnouncement.ts"],"sourcesContent":["import React from 'react';\n\ninterface Props {\n id: string;\n value: string;\n}\n\nconst hiddenStyles: React.CSSProperties = {\n display: 'none',\n};\n\nexport function HiddenText({id, value}: Props) {\n return (\n <div id={id} style={hiddenStyles}>\n {value}\n </div>\n );\n}\n","import React from 'react';\n\nexport interface Props {\n id: string;\n announcement: string;\n}\n\n// Hide element visually but keep it readable by screen readers\nconst visuallyHidden: React.CSSProperties = {\n position: '
|
1
|
+
{"version":3,"file":"accessibility.cjs.development.js","sources":["../src/components/HiddenText/HiddenText.tsx","../src/components/LiveRegion/LiveRegion.tsx","../src/hooks/useAnnouncement.ts"],"sourcesContent":["import React from 'react';\n\ninterface Props {\n id: string;\n value: string;\n}\n\nconst hiddenStyles: React.CSSProperties = {\n display: 'none',\n};\n\nexport function HiddenText({id, value}: Props) {\n return (\n <div id={id} style={hiddenStyles}>\n {value}\n </div>\n );\n}\n","import React from 'react';\n\nexport interface Props {\n id: string;\n announcement: string;\n}\n\n// Hide element visually but keep it readable by screen readers\nconst visuallyHidden: React.CSSProperties = {\n position: 'fixed',\n width: 1,\n height: 1,\n margin: -1,\n border: 0,\n padding: 0,\n overflow: 'hidden',\n clip: 'rect(0 0 0 0)',\n clipPath: 'inset(100%)',\n whiteSpace: 'nowrap',\n};\n\nexport function LiveRegion({id, announcement}: Props) {\n return (\n <div\n id={id}\n style={visuallyHidden}\n role=\"status\"\n aria-live=\"assertive\"\n aria-atomic\n >\n {announcement}\n </div>\n );\n}\n","import {useCallback, useState} from 'react';\n\nexport function useAnnouncement() {\n const [announcement, setAnnouncement] = useState('');\n const announce = useCallback((value: string | undefined) => {\n if (value != null) {\n setAnnouncement(value);\n }\n }, []);\n\n return {announce, announcement} as const;\n}\n"],"names":["hiddenStyles","display","HiddenText","id","value","React","style","visuallyHidden","position","width","height","margin","border","padding","overflow","clip","clipPath","whiteSpace","LiveRegion","announcement","role","useAnnouncement","setAnnouncement","useState","announce","useCallback"],"mappings":";;;;;;;;;AAOA,MAAMA,YAAY,GAAwB;EACxCC,OAAO,EAAE;AAD+B,CAA1C;SAIgBC;MAAW;IAACC,EAAD;IAAKC;;EAC9B,OACEC,4BAAA,MAAA;IAAKF,EAAE,EAAEA;IAAIG,KAAK,EAAEN;GAApB,EACGI,KADH,CADF;AAKD;;ACTD,MAAMG,cAAc,GAAwB;EAC1CC,QAAQ,EAAE,OADgC;EAE1CC,KAAK,EAAE,CAFmC;EAG1CC,MAAM,EAAE,CAHkC;EAI1CC,MAAM,EAAE,CAAC,CAJiC;EAK1CC,MAAM,EAAE,CALkC;EAM1CC,OAAO,EAAE,CANiC;EAO1CC,QAAQ,EAAE,QAPgC;EAQ1CC,IAAI,EAAE,eARoC;EAS1CC,QAAQ,EAAE,aATgC;EAU1CC,UAAU,EAAE;AAV8B,CAA5C;AAaA,SAAgBC;MAAW;IAACf,EAAD;IAAKgB;;EAC9B,OACEd,4BAAA,MAAA;IACEF,EAAE,EAAEA;IACJG,KAAK,EAAEC;IACPa,IAAI,EAAC;iBACK;;GAJZ,EAOGD,YAPH,CADF;AAWD;;SC/BeE;EACd,MAAM,CAACF,YAAD,EAAeG,eAAf,IAAkCC,cAAQ,CAAC,EAAD,CAAhD;EACA,MAAMC,QAAQ,GAAGC,iBAAW,CAAErB,KAAD;IAC3B,IAAIA,KAAK,IAAI,IAAb,EAAmB;MACjBkB,eAAe,CAAClB,KAAD,CAAf;;GAFwB,EAIzB,EAJyB,CAA5B;EAMA,OAAO;IAACoB,QAAD;IAAWL;GAAlB;AACD;;;;;;"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react"),n=(e=t)&&"object"==typeof e&&"default"in e?e.default:e;const i={display:"none"},r={position:"
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react"),n=(e=t)&&"object"==typeof e&&"default"in e?e.default:e;const i={display:"none"},r={position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};exports.HiddenText=function(e){let{id:t,value:r}=e;return n.createElement("div",{id:t,style:i},r)},exports.LiveRegion=function(e){let{id:t,announcement:i}=e;return n.createElement("div",{id:t,style:r,role:"status","aria-live":"assertive","aria-atomic":!0},i)},exports.useAnnouncement=function(){const[e,n]=t.useState("");return{announce:t.useCallback(e=>{null!=e&&n(e)},[]),announcement:e}};
|
2
2
|
//# sourceMappingURL=accessibility.cjs.production.min.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"accessibility.cjs.production.min.js","sources":["../src/components/HiddenText/HiddenText.tsx","../src/components/LiveRegion/LiveRegion.tsx","../src/hooks/useAnnouncement.ts"],"sourcesContent":["import React from 'react';\n\ninterface Props {\n id: string;\n value: string;\n}\n\nconst hiddenStyles: React.CSSProperties = {\n display: 'none',\n};\n\nexport function HiddenText({id, value}: Props) {\n return (\n <div id={id} style={hiddenStyles}>\n {value}\n </div>\n );\n}\n","import React from 'react';\n\nexport interface Props {\n id: string;\n announcement: string;\n}\n\n// Hide element visually but keep it readable by screen readers\nconst visuallyHidden: React.CSSProperties = {\n position: '
|
1
|
+
{"version":3,"file":"accessibility.cjs.production.min.js","sources":["../src/components/HiddenText/HiddenText.tsx","../src/components/LiveRegion/LiveRegion.tsx","../src/hooks/useAnnouncement.ts"],"sourcesContent":["import React from 'react';\n\ninterface Props {\n id: string;\n value: string;\n}\n\nconst hiddenStyles: React.CSSProperties = {\n display: 'none',\n};\n\nexport function HiddenText({id, value}: Props) {\n return (\n <div id={id} style={hiddenStyles}>\n {value}\n </div>\n );\n}\n","import React from 'react';\n\nexport interface Props {\n id: string;\n announcement: string;\n}\n\n// Hide element visually but keep it readable by screen readers\nconst visuallyHidden: React.CSSProperties = {\n position: 'fixed',\n width: 1,\n height: 1,\n margin: -1,\n border: 0,\n padding: 0,\n overflow: 'hidden',\n clip: 'rect(0 0 0 0)',\n clipPath: 'inset(100%)',\n whiteSpace: 'nowrap',\n};\n\nexport function LiveRegion({id, announcement}: Props) {\n return (\n <div\n id={id}\n style={visuallyHidden}\n role=\"status\"\n aria-live=\"assertive\"\n aria-atomic\n >\n {announcement}\n </div>\n );\n}\n","import {useCallback, useState} from 'react';\n\nexport function useAnnouncement() {\n const [announcement, setAnnouncement] = useState('');\n const announce = useCallback((value: string | undefined) => {\n if (value != null) {\n setAnnouncement(value);\n }\n }, []);\n\n return {announce, announcement} as const;\n}\n"],"names":["hiddenStyles","display","visuallyHidden","position","width","height","margin","border","padding","overflow","clip","clipPath","whiteSpace","id","value","React","style","announcement","role","setAnnouncement","useState","announce","useCallback"],"mappings":"oJAOA,MAAMA,EAAoC,CACxCC,QAAS,QCALC,EAAsC,CAC1CC,SAAU,QACVC,MAAO,EACPC,OAAQ,EACRC,QAAS,EACTC,OAAQ,EACRC,QAAS,EACTC,SAAU,SACVC,KAAM,gBACNC,SAAU,cACVC,WAAY,6CDPaC,GAACA,EAADC,MAAKA,KAC9B,OACEC,uBAAKF,GAAIA,EAAIG,MAAOhB,GACjBc,uCCOoBD,GAACA,EAADI,aAAKA,KAC9B,OACEF,uBACEF,GAAIA,EACJG,MAAOd,EACPgB,KAAK,qBACK,8BAGTD,uCC3BL,MAAOA,EAAcE,GAAmBC,WAAS,IAOjD,MAAO,CAACC,SANSC,cAAaR,IACf,MAATA,GACFK,EAAgBL,IAEjB,IAEeG,aAAAA"}
|
@@ -3,10 +3,11 @@ import React, { useState, useCallback } from 'react';
|
|
3
3
|
const hiddenStyles = {
|
4
4
|
display: 'none'
|
5
5
|
};
|
6
|
-
function HiddenText({
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
function HiddenText(_ref) {
|
7
|
+
let {
|
8
|
+
id,
|
9
|
+
value
|
10
|
+
} = _ref;
|
10
11
|
return React.createElement("div", {
|
11
12
|
id: id,
|
12
13
|
style: hiddenStyles
|
@@ -14,7 +15,7 @@ function HiddenText({
|
|
14
15
|
}
|
15
16
|
|
16
17
|
const visuallyHidden = {
|
17
|
-
position: '
|
18
|
+
position: 'fixed',
|
18
19
|
width: 1,
|
19
20
|
height: 1,
|
20
21
|
margin: -1,
|
@@ -25,10 +26,11 @@ const visuallyHidden = {
|
|
25
26
|
clipPath: 'inset(100%)',
|
26
27
|
whiteSpace: 'nowrap'
|
27
28
|
};
|
28
|
-
function LiveRegion({
|
29
|
-
|
30
|
-
|
31
|
-
|
29
|
+
function LiveRegion(_ref) {
|
30
|
+
let {
|
31
|
+
id,
|
32
|
+
announcement
|
33
|
+
} = _ref;
|
32
34
|
return React.createElement("div", {
|
33
35
|
id: id,
|
34
36
|
style: visuallyHidden,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"accessibility.esm.js","sources":["../src/components/HiddenText/HiddenText.tsx","../src/components/LiveRegion/LiveRegion.tsx","../src/hooks/useAnnouncement.ts"],"sourcesContent":["import React from 'react';\n\ninterface Props {\n id: string;\n value: string;\n}\n\nconst hiddenStyles: React.CSSProperties = {\n display: 'none',\n};\n\nexport function HiddenText({id, value}: Props) {\n return (\n <div id={id} style={hiddenStyles}>\n {value}\n </div>\n );\n}\n","import React from 'react';\n\nexport interface Props {\n id: string;\n announcement: string;\n}\n\n// Hide element visually but keep it readable by screen readers\nconst visuallyHidden: React.CSSProperties = {\n position: '
|
1
|
+
{"version":3,"file":"accessibility.esm.js","sources":["../src/components/HiddenText/HiddenText.tsx","../src/components/LiveRegion/LiveRegion.tsx","../src/hooks/useAnnouncement.ts"],"sourcesContent":["import React from 'react';\n\ninterface Props {\n id: string;\n value: string;\n}\n\nconst hiddenStyles: React.CSSProperties = {\n display: 'none',\n};\n\nexport function HiddenText({id, value}: Props) {\n return (\n <div id={id} style={hiddenStyles}>\n {value}\n </div>\n );\n}\n","import React from 'react';\n\nexport interface Props {\n id: string;\n announcement: string;\n}\n\n// Hide element visually but keep it readable by screen readers\nconst visuallyHidden: React.CSSProperties = {\n position: 'fixed',\n width: 1,\n height: 1,\n margin: -1,\n border: 0,\n padding: 0,\n overflow: 'hidden',\n clip: 'rect(0 0 0 0)',\n clipPath: 'inset(100%)',\n whiteSpace: 'nowrap',\n};\n\nexport function LiveRegion({id, announcement}: Props) {\n return (\n <div\n id={id}\n style={visuallyHidden}\n role=\"status\"\n aria-live=\"assertive\"\n aria-atomic\n >\n {announcement}\n </div>\n );\n}\n","import {useCallback, useState} from 'react';\n\nexport function useAnnouncement() {\n const [announcement, setAnnouncement] = useState('');\n const announce = useCallback((value: string | undefined) => {\n if (value != null) {\n setAnnouncement(value);\n }\n }, []);\n\n return {announce, announcement} as const;\n}\n"],"names":["hiddenStyles","display","HiddenText","id","value","React","style","visuallyHidden","position","width","height","margin","border","padding","overflow","clip","clipPath","whiteSpace","LiveRegion","announcement","role","useAnnouncement","setAnnouncement","useState","announce","useCallback"],"mappings":";;AAOA,MAAMA,YAAY,GAAwB;EACxCC,OAAO,EAAE;AAD+B,CAA1C;SAIgBC;MAAW;IAACC,EAAD;IAAKC;;EAC9B,OACEC,mBAAA,MAAA;IAAKF,EAAE,EAAEA;IAAIG,KAAK,EAAEN;GAApB,EACGI,KADH,CADF;AAKD;;ACTD,MAAMG,cAAc,GAAwB;EAC1CC,QAAQ,EAAE,OADgC;EAE1CC,KAAK,EAAE,CAFmC;EAG1CC,MAAM,EAAE,CAHkC;EAI1CC,MAAM,EAAE,CAAC,CAJiC;EAK1CC,MAAM,EAAE,CALkC;EAM1CC,OAAO,EAAE,CANiC;EAO1CC,QAAQ,EAAE,QAPgC;EAQ1CC,IAAI,EAAE,eARoC;EAS1CC,QAAQ,EAAE,aATgC;EAU1CC,UAAU,EAAE;AAV8B,CAA5C;AAaA,SAAgBC;MAAW;IAACf,EAAD;IAAKgB;;EAC9B,OACEd,mBAAA,MAAA;IACEF,EAAE,EAAEA;IACJG,KAAK,EAAEC;IACPa,IAAI,EAAC;iBACK;;GAJZ,EAOGD,YAPH,CADF;AAWD;;SC/BeE;EACd,MAAM,CAACF,YAAD,EAAeG,eAAf,IAAkCC,QAAQ,CAAC,EAAD,CAAhD;EACA,MAAMC,QAAQ,GAAGC,WAAW,CAAErB,KAAD;IAC3B,IAAIA,KAAK,IAAI,IAAb,EAAmB;MACjBkB,eAAe,CAAClB,KAAD,CAAf;;GAFwB,EAIzB,EAJyB,CAA5B;EAMA,OAAO;IAACoB,QAAD;IAAWL;GAAlB;AACD;;;;"}
|