@compa11y/core 0.1.2 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/announcer/index.cjs +1 -49
- package/dist/announcer/index.js +1 -4
- package/dist/aria/index.cjs +1 -24
- package/dist/aria/index.js +1 -3
- package/dist/chunk-7BL2ABLF.cjs +1 -0
- package/dist/chunk-AQ6HEUSD.cjs +1 -0
- package/dist/chunk-C3VZQUKG.js +1 -0
- package/dist/chunk-EM45V5TK.cjs +1 -0
- package/dist/chunk-KQUAJKTG.cjs +1 -0
- package/dist/chunk-QGEFH2VG.js +1 -0
- package/dist/chunk-RE4QIUWR.js +1 -0
- package/dist/chunk-TGXWODB3.js +1 -0
- package/dist/chunk-Y2RTDE4A.cjs +1 -0
- package/dist/chunk-ZAQMM5TA.js +1 -0
- package/dist/focus/index.cjs +1 -53
- package/dist/focus/index.d.cts +63 -1
- package/dist/focus/index.d.ts +63 -1
- package/dist/focus/index.js +1 -4
- package/dist/index.cjs +2 -567
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -337
- package/dist/keyboard/index.cjs +1 -28
- package/dist/keyboard/index.js +1 -3
- package/package.json +1 -1
- package/dist/announcer/index.cjs.map +0 -1
- package/dist/announcer/index.js.map +0 -1
- package/dist/aria/index.cjs.map +0 -1
- package/dist/aria/index.js.map +0 -1
- package/dist/chunk-24U5HHMC.js +0 -309
- package/dist/chunk-24U5HHMC.js.map +0 -1
- package/dist/chunk-2CQOLVQH.js +0 -147
- package/dist/chunk-2CQOLVQH.js.map +0 -1
- package/dist/chunk-2PUYKF2E.js +0 -631
- package/dist/chunk-2PUYKF2E.js.map +0 -1
- package/dist/chunk-2WF5Y6D7.js +0 -175
- package/dist/chunk-2WF5Y6D7.js.map +0 -1
- package/dist/chunk-CQXMBRLD.cjs +0 -657
- package/dist/chunk-CQXMBRLD.cjs.map +0 -1
- package/dist/chunk-HQOFVJFO.cjs +0 -181
- package/dist/chunk-HQOFVJFO.cjs.map +0 -1
- package/dist/chunk-NBGFFCIJ.cjs +0 -314
- package/dist/chunk-NBGFFCIJ.cjs.map +0 -1
- package/dist/chunk-V6TZIZZ4.cjs +0 -158
- package/dist/chunk-V6TZIZZ4.cjs.map +0 -1
- package/dist/chunk-XEGB27QF.cjs +0 -78
- package/dist/chunk-XEGB27QF.cjs.map +0 -1
- package/dist/chunk-Z7K2G6FX.js +0 -66
- package/dist/chunk-Z7K2G6FX.js.map +0 -1
- package/dist/focus/index.cjs.map +0 -1
- package/dist/focus/index.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/keyboard/index.cjs.map +0 -1
- package/dist/keyboard/index.js.map +0 -1
package/dist/announcer/index.cjs
CHANGED
|
@@ -1,49 +1 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkV6TZIZZ4_cjs = require('../chunk-V6TZIZZ4.cjs');
|
|
4
|
-
require('../chunk-XEGB27QF.cjs');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Object.defineProperty(exports, "announce", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function () { return chunkV6TZIZZ4_cjs.announce; }
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "announceAssertive", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () { return chunkV6TZIZZ4_cjs.announceAssertive; }
|
|
15
|
-
});
|
|
16
|
-
Object.defineProperty(exports, "announceError", {
|
|
17
|
-
enumerable: true,
|
|
18
|
-
get: function () { return chunkV6TZIZZ4_cjs.announceError; }
|
|
19
|
-
});
|
|
20
|
-
Object.defineProperty(exports, "announcePolite", {
|
|
21
|
-
enumerable: true,
|
|
22
|
-
get: function () { return chunkV6TZIZZ4_cjs.announcePolite; }
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "announceProgress", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () { return chunkV6TZIZZ4_cjs.announceProgress; }
|
|
27
|
-
});
|
|
28
|
-
Object.defineProperty(exports, "announceStatus", {
|
|
29
|
-
enumerable: true,
|
|
30
|
-
get: function () { return chunkV6TZIZZ4_cjs.announceStatus; }
|
|
31
|
-
});
|
|
32
|
-
Object.defineProperty(exports, "clearAnnouncements", {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
get: function () { return chunkV6TZIZZ4_cjs.clearAnnouncements; }
|
|
35
|
-
});
|
|
36
|
-
Object.defineProperty(exports, "createAnnouncer", {
|
|
37
|
-
enumerable: true,
|
|
38
|
-
get: function () { return chunkV6TZIZZ4_cjs.createAnnouncer; }
|
|
39
|
-
});
|
|
40
|
-
Object.defineProperty(exports, "initAnnouncer", {
|
|
41
|
-
enumerable: true,
|
|
42
|
-
get: function () { return chunkV6TZIZZ4_cjs.initAnnouncer; }
|
|
43
|
-
});
|
|
44
|
-
Object.defineProperty(exports, "queueAnnouncement", {
|
|
45
|
-
enumerable: true,
|
|
46
|
-
get: function () { return chunkV6TZIZZ4_cjs.queueAnnouncement; }
|
|
47
|
-
});
|
|
48
|
-
//# sourceMappingURL=index.cjs.map
|
|
49
|
-
//# sourceMappingURL=index.cjs.map
|
|
1
|
+
'use strict';var chunkAQ6HEUSD_cjs=require('../chunk-AQ6HEUSD.cjs');require('../chunk-7BL2ABLF.cjs');Object.defineProperty(exports,"announce",{enumerable:true,get:function(){return chunkAQ6HEUSD_cjs.b}});Object.defineProperty(exports,"announceAssertive",{enumerable:true,get:function(){return chunkAQ6HEUSD_cjs.d}});Object.defineProperty(exports,"announceError",{enumerable:true,get:function(){return chunkAQ6HEUSD_cjs.i}});Object.defineProperty(exports,"announcePolite",{enumerable:true,get:function(){return chunkAQ6HEUSD_cjs.c}});Object.defineProperty(exports,"announceProgress",{enumerable:true,get:function(){return chunkAQ6HEUSD_cjs.j}});Object.defineProperty(exports,"announceStatus",{enumerable:true,get:function(){return chunkAQ6HEUSD_cjs.h}});Object.defineProperty(exports,"clearAnnouncements",{enumerable:true,get:function(){return chunkAQ6HEUSD_cjs.e}});Object.defineProperty(exports,"createAnnouncer",{enumerable:true,get:function(){return chunkAQ6HEUSD_cjs.g}});Object.defineProperty(exports,"initAnnouncer",{enumerable:true,get:function(){return chunkAQ6HEUSD_cjs.a}});Object.defineProperty(exports,"queueAnnouncement",{enumerable:true,get:function(){return chunkAQ6HEUSD_cjs.f}});
|
package/dist/announcer/index.js
CHANGED
|
@@ -1,4 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
import '../chunk-Z7K2G6FX.js';
|
|
3
|
-
//# sourceMappingURL=index.js.map
|
|
4
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export{b as announce,d as announceAssertive,i as announceError,c as announcePolite,j as announceProgress,h as announceStatus,e as clearAnnouncements,g as createAnnouncer,a as initAnnouncer,f as queueAnnouncement}from'../chunk-ZAQMM5TA.js';import'../chunk-C3VZQUKG.js';
|
package/dist/aria/index.cjs
CHANGED
|
@@ -1,24 +1 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkNBGFFCIJ_cjs = require('../chunk-NBGFFCIJ.cjs');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "aria", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function () { return chunkNBGFFCIJ_cjs.aria; }
|
|
10
|
-
});
|
|
11
|
-
Object.defineProperty(exports, "buildAriaProps", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
get: function () { return chunkNBGFFCIJ_cjs.buildAriaProps; }
|
|
14
|
-
});
|
|
15
|
-
Object.defineProperty(exports, "hasAccessibleName", {
|
|
16
|
-
enumerable: true,
|
|
17
|
-
get: function () { return chunkNBGFFCIJ_cjs.hasAccessibleName; }
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports, "mergeAriaIds", {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
get: function () { return chunkNBGFFCIJ_cjs.mergeAriaIds; }
|
|
22
|
-
});
|
|
23
|
-
//# sourceMappingURL=index.cjs.map
|
|
24
|
-
//# sourceMappingURL=index.cjs.map
|
|
1
|
+
'use strict';var chunkKQUAJKTG_cjs=require('../chunk-KQUAJKTG.cjs');Object.defineProperty(exports,"aria",{enumerable:true,get:function(){return chunkKQUAJKTG_cjs.a}});Object.defineProperty(exports,"buildAriaProps",{enumerable:true,get:function(){return chunkKQUAJKTG_cjs.b}});Object.defineProperty(exports,"hasAccessibleName",{enumerable:true,get:function(){return chunkKQUAJKTG_cjs.d}});Object.defineProperty(exports,"mergeAriaIds",{enumerable:true,get:function(){return chunkKQUAJKTG_cjs.c}});
|
package/dist/aria/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';function e(){return typeof window<"u"&&typeof document<"u"}function s(){return e()?/Mac|iPod|iPhone|iPad/.test(navigator.platform):false}function c(){return e()?/iPod|iPhone|iPad/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1:false}function d(){return e()?/Android/.test(navigator.userAgent):false}function f(){return e()?/Win/.test(navigator.platform):false}function u(){return e()?"ontouchstart"in window||navigator.maxTouchPoints>0:false}function l(){return e()?window.matchMedia("(prefers-reduced-motion: reduce)").matches:false}function m(){return e()?window.matchMedia("(prefers-contrast: more)").matches||window.matchMedia("(-ms-high-contrast: active)").matches:false}function h(){return e()?window.matchMedia("(prefers-color-scheme: dark)").matches:false}function p(){if(!e())return {possibleScreenReader:false,forcedColors:false};let n=window.matchMedia("(forced-colors: active)").matches;return {possibleScreenReader:n,forcedColors:n}}function v(n,o){if(!e())return ()=>{};let r=window.matchMedia(n);if(o(r.matches),r.addEventListener){let a=i=>o(i.matches);return r.addEventListener("change",a),()=>r.removeEventListener("change",a)}let t=()=>o(r.matches);return r.addListener(t),()=>r.removeListener(t)}exports.a=e;exports.b=s;exports.c=c;exports.d=d;exports.e=f;exports.f=u;exports.g=l;exports.h=m;exports.i=h;exports.j=p;exports.k=v;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunk7BL2ABLF_cjs=require('./chunk-7BL2ABLF.cjs');var o=null,i=null,m=false,l=[],r=null;function L(){return {position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"}}function x(n){let e=document.createElement("div");e.setAttribute("role","status"),e.setAttribute("aria-live",n),e.setAttribute("aria-atomic","true"),e.setAttribute("aria-relevant","additions text"),e.id=`compa11y-announcer-${n}`;let t=L();return Object.assign(e.style,t),document.body.appendChild(e),{element:e,politeness:n}}function b(){return !chunk7BL2ABLF_cjs.a()||m?()=>{}:(m=true,o=x("polite"),i=x("assertive"),()=>{o&&(o.element.remove(),o=null),i&&(i.element.remove(),i=null),r&&(clearTimeout(r),r=null),l=[],m=false;})}function R(){!m&&chunk7BL2ABLF_cjs.a()&&b();}function g(n){n.element.textContent="";}function a(n,e={}){if(!chunk7BL2ABLF_cjs.a())return;let{politeness:t="polite",delay:s=0,clearPrevious:c=false,timeout:A=7e3}=e;R();let u=t==="assertive"?i:o;if(!u)return;let d=()=>{c&&g(u),u.element.textContent="",requestAnimationFrame(()=>{u.element.textContent=n,A>0&&setTimeout(()=>{u.element.textContent===n&&(u.element.textContent="");},A);});};s>0?setTimeout(d,s):d();}function f(n,e){a(n,{...e,politeness:"polite"});}function v(n,e){a(n,{...e,politeness:"assertive"});}function O(){o&&g(o),i&&g(i);}function y(n,e={}){let{debounce:t=150,...s}=e;l.push({message:n,options:s}),r&&clearTimeout(r),r=setTimeout(()=>{let c=l[l.length-1];c&&a(c.message,c.options),l=[],r=null;},t);}function P(n={}){return {announce:(e,t)=>a(e,{...n,...t}),polite:(e,t)=>f(e,{...n,...t}),assertive:(e,t)=>v(e,{...n,...t}),queue:(e,t)=>y(e,{...n,...t}),clear:O}}function S(n){f(n);}function T(n){v(n);}function h(n,e,t="{current} of {total}"){let s=t.replace("{current}",String(n)).replace("{total}",String(e));f(s);}exports.a=b;exports.b=a;exports.c=f;exports.d=v;exports.e=O;exports.f=y;exports.g=P;exports.h=S;exports.i=T;exports.j=h;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(){return typeof window<"u"&&typeof document<"u"}function s(){return e()?/Mac|iPod|iPhone|iPad/.test(navigator.platform):false}function c(){return e()?/iPod|iPhone|iPad/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1:false}function d(){return e()?/Android/.test(navigator.userAgent):false}function f(){return e()?/Win/.test(navigator.platform):false}function u(){return e()?"ontouchstart"in window||navigator.maxTouchPoints>0:false}function l(){return e()?window.matchMedia("(prefers-reduced-motion: reduce)").matches:false}function m(){return e()?window.matchMedia("(prefers-contrast: more)").matches||window.matchMedia("(-ms-high-contrast: active)").matches:false}function h(){return e()?window.matchMedia("(prefers-color-scheme: dark)").matches:false}function p(){if(!e())return {possibleScreenReader:false,forcedColors:false};let n=window.matchMedia("(forced-colors: active)").matches;return {possibleScreenReader:n,forcedColors:n}}function v(n,o){if(!e())return ()=>{};let r=window.matchMedia(n);if(o(r.matches),r.addEventListener){let a=i=>o(i.matches);return r.addEventListener("change",a),()=>r.removeEventListener("change",a)}let t=()=>o(r.matches);return r.addListener(t),()=>r.removeListener(t)}export{e as a,s as b,c,d,f as e,u as f,l as g,m as h,h as i,p as j,v as k};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';function f(e){let t=e.key;switch(t){case " ":return "Space";case "Esc":return "Escape";case "Left":return "ArrowLeft";case "Right":return "ArrowRight";case "Up":return "ArrowUp";case "Down":return "ArrowDown";default:return t}}function p(e){let t=[];e.ctrlKey&&t.push("Ctrl"),e.altKey&&t.push("Alt"),e.shiftKey&&t.push("Shift"),e.metaKey&&t.push("Meta");let d=f(e);return ["Control","Alt","Shift","Meta"].includes(d)||t.push(d),t.join("+")}function v(e={},t={}){let{preventDefault:d=true,stopPropagation:i=true,targetSelector:o}=t,n=new Map(Object.entries(e)),a=null;function l(r){if(o&&!r.target.matches(o))return;let y=p(r),c=n.get(y);if(!c){let u=f(r);c=n.get(u);}c&&c(r)!==false&&(d&&r.preventDefault(),i&&r.stopPropagation());}function g(r){a&&s(),a=r,r.addEventListener("keydown",l);}function s(){a&&(a.removeEventListener("keydown",l),a=null);}function h(r,y){n.set(r,y);}function m(r){n.delete(r);}function b(){s(),n.clear();}return {attach:g,detach:s,on:h,off:m,destroy:b}}var K={menu:e=>({ArrowUp:()=>e.onUp?.(),ArrowDown:()=>e.onDown?.(),Enter:()=>e.onEnter?.(),Space:()=>e.onEnter?.(),Escape:()=>e.onEscape?.(),Home:()=>e.onHome?.(),End:()=>e.onEnd?.()}),tabs:e=>({ArrowLeft:()=>e.onLeft?.(),ArrowRight:()=>e.onRight?.(),Home:()=>e.onHome?.(),End:()=>e.onEnd?.()}),dialog:e=>({Escape:()=>e.onEscape?.()}),grid:e=>({ArrowUp:()=>e.onUp?.(),ArrowDown:()=>e.onDown?.(),ArrowLeft:()=>e.onLeft?.(),ArrowRight:()=>e.onRight?.(),Home:()=>e.onHome?.(),End:()=>e.onEnd?.(),"Ctrl+Home":()=>e.onCtrlHome?.(),"Ctrl+End":()=>e.onCtrlEnd?.()})};function E(e,t={}){let{timeout:d=500}=t,i="",o=null;function n(){i="",o&&(clearTimeout(o),o=null);}function a(l){return l.length!==1||l===" "?null:(o&&clearTimeout(o),i+=l.toLowerCase(),o=setTimeout(n,d),e.find(s=>s.toLowerCase().startsWith(i))??null)}return {type:a,reset:n,getSearch:()=>i}}exports.a=f;exports.b=p;exports.c=v;exports.d=K;exports.e=E;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var r={hide(e){e.setAttribute("aria-hidden","true");},show(e){e.removeAttribute("aria-hidden");},setExpanded(e,t){e.setAttribute("aria-expanded",String(t));},setSelected(e,t){e.setAttribute("aria-selected",String(t));},setChecked(e,t){e.setAttribute("aria-checked",String(t));},setPressed(e,t){e.setAttribute("aria-pressed",String(t));},setDisabled(e,t){e.setAttribute("aria-disabled",String(t));},setBusy(e,t){e.setAttribute("aria-busy",String(t));},setCurrent(e,t){t==="false"?e.removeAttribute("aria-current"):e.setAttribute("aria-current",t);},setInvalid(e,t){t===false?e.removeAttribute("aria-invalid"):e.setAttribute("aria-invalid",String(t));},setLabel(e,t){t?e.setAttribute("aria-label",t):e.removeAttribute("aria-label");},setLabelledBy(e,...t){let i=t.filter(Boolean).join(" ");i?e.setAttribute("aria-labelledby",i):e.removeAttribute("aria-labelledby");},setDescribedBy(e,...t){let i=t.filter(Boolean).join(" ");i?e.setAttribute("aria-describedby",i):e.removeAttribute("aria-describedby");},setControls(e,...t){let i=t.filter(Boolean).join(" ");i?e.setAttribute("aria-controls",i):e.removeAttribute("aria-controls");},setOwns(e,...t){let i=t.filter(Boolean).join(" ");i?e.setAttribute("aria-owns",i):e.removeAttribute("aria-owns");},setActiveDescendant(e,t){t?e.setAttribute("aria-activedescendant",t):e.removeAttribute("aria-activedescendant");},setHasPopup(e,t){t===false?e.removeAttribute("aria-haspopup"):e.setAttribute("aria-haspopup",String(t));},setLevel(e,t){e.setAttribute("aria-level",String(t));},setPosition(e,t,i){e.setAttribute("aria-posinset",String(t)),e.setAttribute("aria-setsize",String(i));},setValue(e,t){t.min!==void 0&&e.setAttribute("aria-valuemin",String(t.min)),t.max!==void 0&&e.setAttribute("aria-valuemax",String(t.max)),t.now!==void 0&&e.setAttribute("aria-valuenow",String(t.now)),t.text!==void 0&&e.setAttribute("aria-valuetext",t.text);},setRole(e,t){t?e.setAttribute("role",t):e.removeAttribute("role");},setModal(e,t){t?e.setAttribute("aria-modal","true"):e.removeAttribute("aria-modal");},setOrientation(e,t){e.setAttribute("aria-orientation",t);},setRequired(e,t){e.setAttribute("aria-required",String(t));},setReadOnly(e,t){e.setAttribute("aria-readonly",String(t));},setAutocomplete(e,t){e.setAttribute("aria-autocomplete",t);},setMultiSelectable(e,t){e.setAttribute("aria-multiselectable",String(t));},setSort(e,t){e.setAttribute("aria-sort",t);}};function l(e){let t={};return e.label&&(t["aria-label"]=e.label),e.labelledBy&&(t["aria-labelledby"]=Array.isArray(e.labelledBy)?e.labelledBy.join(" "):e.labelledBy),e.describedBy&&(t["aria-describedby"]=Array.isArray(e.describedBy)?e.describedBy.join(" "):e.describedBy),e.controls&&(t["aria-controls"]=Array.isArray(e.controls)?e.controls.join(" "):e.controls),e.owns&&(t["aria-owns"]=Array.isArray(e.owns)?e.owns.join(" "):e.owns),e.expanded!==void 0&&(t["aria-expanded"]=String(e.expanded)),e.selected!==void 0&&(t["aria-selected"]=String(e.selected)),e.checked!==void 0&&(t["aria-checked"]=String(e.checked)),e.pressed!==void 0&&(t["aria-pressed"]=String(e.pressed)),e.disabled!==void 0&&(t["aria-disabled"]=String(e.disabled)),e.hidden!==void 0&&(t["aria-hidden"]=String(e.hidden)),e.modal!==void 0&&(t["aria-modal"]=String(e.modal)),e.busy!==void 0&&(t["aria-busy"]=String(e.busy)),e.current&&(t["aria-current"]=e.current),e.invalid!==void 0&&(t["aria-invalid"]=String(e.invalid)),e.hasPopup!==void 0&&(t["aria-haspopup"]=String(e.hasPopup)),e.activeDescendant&&(t["aria-activedescendant"]=e.activeDescendant),e.level!==void 0&&(t["aria-level"]=String(e.level)),e.posInSet!==void 0&&(t["aria-posinset"]=String(e.posInSet)),e.setSize!==void 0&&(t["aria-setsize"]=String(e.setSize)),e.valueMin!==void 0&&(t["aria-valuemin"]=String(e.valueMin)),e.valueMax!==void 0&&(t["aria-valuemax"]=String(e.valueMax)),e.valueNow!==void 0&&(t["aria-valuenow"]=String(e.valueNow)),e.valueText&&(t["aria-valuetext"]=e.valueText),e.orientation&&(t["aria-orientation"]=e.orientation),e.required!==void 0&&(t["aria-required"]=String(e.required)),e.readOnly!==void 0&&(t["aria-readonly"]=String(e.readOnly)),e.autocomplete&&(t["aria-autocomplete"]=e.autocomplete),e.multiSelectable!==void 0&&(t["aria-multiselectable"]=String(e.multiSelectable)),e.sort&&(t["aria-sort"]=e.sort),e.role&&(t.role=e.role),t}function d(...e){let t=e.filter(Boolean);return t.length>0?t.join(" "):void 0}function u(e){if(e.getAttribute("aria-label"))return true;let t=e.getAttribute("aria-labelledby");return !!(t&&t.split(" ").some(n=>{let a=document.getElementById(n);return a&&a.textContent?.trim()})||e.textContent?.trim()||e.getAttribute("title")||"labels"in e&&e.labels?.length||e.tagName==="IMG"&&e.getAttribute("alt"))}exports.a=r;exports.b=l;exports.c=d;exports.d=u;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-C3VZQUKG.js';var D=["a[href]","area[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])','[contenteditable="true"]',"audio[controls]","video[controls]","details > summary:first-of-type","iframe"].join(","),K=['a[href]:not([tabindex="-1"])','area[href]:not([tabindex="-1"])','button:not([disabled]):not([tabindex="-1"])','input:not([disabled]):not([type="hidden"]):not([tabindex="-1"])','select:not([disabled]):not([tabindex="-1"])','textarea:not([disabled]):not([tabindex="-1"])','[tabindex]:not([tabindex="-1"])','[contenteditable="true"]:not([tabindex="-1"])','audio[controls]:not([tabindex="-1"])','video[controls]:not([tabindex="-1"])','details > summary:first-of-type:not([tabindex="-1"])','iframe:not([tabindex="-1"])'].join(",");function U(e){if(!(e instanceof HTMLElement)||e.hidden||e.style.display==="none"||e.style.visibility==="hidden")return false;let t=window.getComputedStyle(e);return !(t.display==="none"||t.visibility==="hidden"||!e.isConnected)}function V(e){return !(!(e instanceof HTMLElement)||!U(e)||!e.matches(D)||e.closest("[inert]"))}function I(e){return !V(e)||e.tabIndex<0?false:e.matches(K)}function oe(e){return Array.from(e.querySelectorAll(D)).filter(V)}function T(e){return Array.from(e.querySelectorAll(K)).filter(I).sort((u,r)=>{let n=Math.max(0,u.tabIndex),i=Math.max(0,r.tabIndex);return n===0&&i===0?0:n===0?1:i===0?-1:n-i})}function k(e){return T(e)[0]??null}function re(e){let t=T(e);return t[t.length-1]??null}function P(e){let t=document.activeElement;return t!==null&&e.contains(t)}function N(e,t,a=true){let u=T(e),r=u.indexOf(t);if(r===-1)return u[0]??null;let n=r+1;return n<u.length?u[n]:a?u[0]??null:null}function C(e,t,a=true){let u=T(e),r=u.indexOf(t);if(r===-1)return u[u.length-1]??null;let n=r-1;return n>=0?u[n]:a?u[u.length-1]??null:null}function ie(e,t){return t.contains(e)}function q(e,t=document.body){return e?typeof e=="string"?t.querySelector(e):typeof e=="function"?e():e:null}var F=[];function _(e,t={}){let{initialFocus:a,returnFocus:u=true,clickOutsideDeactivates:r=false,escapeDeactivates:n=true,onDeactivate:i,onEscapeFocus:c}=t,o=false,b=false,f=null;function h(l){b||!o||(l.key==="Tab"?y(l):l.key==="Escape"&&n&&(l.preventDefault(),l.stopPropagation(),v()));}function y(l){let E=T(e);if(E.length===0){l.preventDefault();return}let w=E[0],g=E[E.length-1],S=document.activeElement;l.shiftKey?(S===w||!e.contains(S))&&(l.preventDefault(),g.focus()):(S===g||!e.contains(S))&&(l.preventDefault(),w.focus());}function p(l){if(b||!o)return;let E=l.target;e.contains(E)||(c?.(E),k(e)?.focus());}function d(l){if(b||!o)return;let E=l.target;r&&!e.contains(E)&&v();}function m(){if(!o){f=document.activeElement,F.push(A);for(let l=0;l<F.length-1;l++)F[l].pause();document.addEventListener("keydown",h,true),document.addEventListener("focusin",p,true),document.addEventListener("click",d,true),o=true,requestAnimationFrame(()=>{if(!o)return;let l=q(a,e);if(l)l.focus();else {let E=k(e);E?E.focus():(e.setAttribute("tabindex","-1"),e.focus());}});}}function s(l){if(!o)return;document.removeEventListener("keydown",h,true),document.removeEventListener("focusin",p,true),document.removeEventListener("click",d,true),o=false,b=false;let E=F.indexOf(A);if(E>-1&&F.splice(E,1),F[F.length-1]?.unpause(),u&&f){let g=typeof u=="boolean"?f:u;requestAnimationFrame(()=>{g&&"focus"in g&&g.focus();});}l&&i?.();}function v(){s(true);}function L(){s(false);}function M(){!o||b||(b=true);}function H(){!o||!b||(b=false,P(e)||k(e)?.focus());}let A={activate:m,deactivate:v,destroy:L,pause:M,unpause:H,isActive:()=>o,isPaused:()=>b};return A}function z(){return F[F.length-1]??null}function W(){return F.length>0}var x={hadKeyboardEvent:true,isPointerInput:false,lastFocusSource:"unknown"},O=false,j=new Set(["Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Enter"," ","Home","End","PageUp","PageDown","Escape"]);function G(){if(!a()||O)return ()=>{};O=true;function e(n){j.has(n.key)&&(x.hadKeyboardEvent=true,x.isPointerInput=false,x.lastFocusSource="keyboard");}function t(n){x.isPointerInput=true,x.hadKeyboardEvent=false,x.lastFocusSource="pointerType"in n&&n.pointerType==="touch"?"touch":"mouse";}function a$1(n){let i=n.target;i instanceof HTMLElement&&(x.hadKeyboardEvent||Y(i))&&(i.dataset.a11ykitFocusVisible="true");}function u(n){let i=n.target;i instanceof HTMLElement&&delete i.dataset.a11ykitFocusVisible;}function r(){document.visibilityState==="hidden"&&(x.hadKeyboardEvent=true);}return document.addEventListener("keydown",e,true),document.addEventListener("mousedown",t,true),document.addEventListener("pointerdown",t,true),document.addEventListener("focus",a$1,true),document.addEventListener("blur",u,true),document.addEventListener("visibilitychange",r,true),()=>{document.removeEventListener("keydown",e,true),document.removeEventListener("mousedown",t,true),document.removeEventListener("pointerdown",t,true),document.removeEventListener("focus",a$1,true),document.removeEventListener("blur",u,true),document.removeEventListener("visibilitychange",r,true),O=false;}}function Y(e){let t=e.tagName.toLowerCase(),a=e.getAttribute("type")?.toLowerCase();return !!(t==="input"&&(!a||a==="text"||a==="email"||a==="password"||a==="search"||a==="tel"||a==="url"||a==="number")||t==="textarea"||e.isContentEditable)}function J(){return x.hadKeyboardEvent}function Q(e){return e.dataset.a11ykitFocusVisible==="true"}function X(){return x.lastFocusSource}function Z(e,t){t?e.dataset.a11ykitFocusVisible="true":delete e.dataset.a11ykitFocusVisible;}function $(e,t){x.hadKeyboardEvent=true,x.lastFocusSource="keyboard",e.focus(t);}function ee(e,t={}){let{contain:a=false,restoreFocus:u=false,autoFocus:r=false}=t,n=null,i=false;u&&(n=document.activeElement);function c(){return i?[]:T(e)}function o(){let s=document.activeElement;return s&&e.contains(s)?s:null}function b(){if(i)return;c()[0]?.focus();}function f(){if(i)return;let s=c();s[s.length-1]?.focus();}function h({wrap:s=true}={}){if(i)return;let v=o();if(!v){b();return}N(e,v,s)?.focus();}function y({wrap:s=true}={}){if(i)return;let v=o();if(!v){f();return}C(e,v,s)?.focus();}function p(s){if(i)return;c()[s]?.focus();}function d(s){if(!(i||!a)&&s.key==="Tab"){let v=c();if(v.length===0){s.preventDefault();return}let L=v[0],M=v[v.length-1],H=o();s.shiftKey&&H===L?(s.preventDefault(),M.focus()):!s.shiftKey&&H===M&&(s.preventDefault(),L.focus());}}function m(){i||(i=true,document.removeEventListener("keydown",d,true),u&&n&&n.focus());}return a&&document.addEventListener("keydown",d,true),r&&requestAnimationFrame(()=>{i||b();}),{focusFirst:b,focusLast:f,focusNext:h,focusPrevious:y,focusAt:p,getFocused:o,getElements:c,destroy:m}}function te(e,t,a={}){let{initialIndex:u=0,orientation:r="both",wrap:n=true,onSelectionChange:i}=a,c=[],o=u;function b(){c=Array.from(e.querySelectorAll(t)),c.forEach((p,d)=>{p.setAttribute("tabindex",d===o?"0":"-1");});}function f(p){if(c.length===0)return;let d=p;d<0?d=n?c.length-1:0:d>=c.length&&(d=n?0:c.length-1);let m=c[o],s=c[d];m&&m.setAttribute("tabindex","-1"),s&&(s.setAttribute("tabindex","0"),s.focus(),i?.(d,s)),o=d;}function h(p){let d=p.target;if(!c.includes(d))return;let m=false;switch(p.key){case "ArrowRight":(r==="horizontal"||r==="both")&&(f(o+1),m=true);break;case "ArrowLeft":(r==="horizontal"||r==="both")&&(f(o-1),m=true);break;case "ArrowDown":(r==="vertical"||r==="both")&&(f(o+1),m=true);break;case "ArrowUp":(r==="vertical"||r==="both")&&(f(o-1),m=true);break;case "Home":f(0),m=true;break;case "End":f(c.length-1),m=true;break}m&&(p.preventDefault(),p.stopPropagation());}function y(p){let d=p.target,m=c.indexOf(d);if(m!==-1&&m!==o){let s=c[o];s&&s.setAttribute("tabindex","-1"),d.setAttribute("tabindex","0"),o=m;}}return b(),e.addEventListener("keydown",h),e.addEventListener("focusin",y),{next:()=>f(o+1),previous:()=>f(o-1),first:()=>f(0),last:()=>f(c.length-1),goto:f,getIndex:()=>o,update:b,destroy:()=>{e.removeEventListener("keydown",h),e.removeEventListener("focusin",y);}}}function B(e,t={}){let{scope:a=e.parentElement??document.body,prefer:u="previous"}=t,r=T(a),n=r.indexOf(e);n===-1&&(n=r.findIndex(f=>e.compareDocumentPosition(f)&Node.DOCUMENT_POSITION_FOLLOWING),n===-1&&(n=r.length));let i=n-1,c=n+1,o=i>=0&&r[i]!==e?r[i]:null,b=c<r.length&&r[c]!==e?r[c]:null;return u==="previous"?o??b:b??o}function ne(e){let t=e??null;function a(n){t=n??document.activeElement??null;}function u(n={}){let{fallback:i,prefer:c="previous"}=n;if(!t){i?.focus();return}if(t.isConnected&&I(t)){t.focus(),t=null;return}if(t.isConnected){let o=B(t,{prefer:c});if(o){o.focus(),t=null;return}}i&&i.focus(),t=null;}function r(){t=null;}return {get element(){return t},save:a,return:u,clear:r}}export{ne as A,D as a,K as b,U as c,V as d,I as e,oe as f,T as g,k as h,re as i,P as j,N as k,C as l,ie as m,q as n,_ as o,z as p,W as q,G as r,J as s,Q as t,X as u,Z as v,$ as w,ee as x,te as y,B as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function f(e){let t=e.key;switch(t){case " ":return "Space";case "Esc":return "Escape";case "Left":return "ArrowLeft";case "Right":return "ArrowRight";case "Up":return "ArrowUp";case "Down":return "ArrowDown";default:return t}}function p(e){let t=[];e.ctrlKey&&t.push("Ctrl"),e.altKey&&t.push("Alt"),e.shiftKey&&t.push("Shift"),e.metaKey&&t.push("Meta");let d=f(e);return ["Control","Alt","Shift","Meta"].includes(d)||t.push(d),t.join("+")}function v(e={},t={}){let{preventDefault:d=true,stopPropagation:i=true,targetSelector:o}=t,n=new Map(Object.entries(e)),a=null;function l(r){if(o&&!r.target.matches(o))return;let y=p(r),c=n.get(y);if(!c){let u=f(r);c=n.get(u);}c&&c(r)!==false&&(d&&r.preventDefault(),i&&r.stopPropagation());}function g(r){a&&s(),a=r,r.addEventListener("keydown",l);}function s(){a&&(a.removeEventListener("keydown",l),a=null);}function h(r,y){n.set(r,y);}function m(r){n.delete(r);}function b(){s(),n.clear();}return {attach:g,detach:s,on:h,off:m,destroy:b}}var K={menu:e=>({ArrowUp:()=>e.onUp?.(),ArrowDown:()=>e.onDown?.(),Enter:()=>e.onEnter?.(),Space:()=>e.onEnter?.(),Escape:()=>e.onEscape?.(),Home:()=>e.onHome?.(),End:()=>e.onEnd?.()}),tabs:e=>({ArrowLeft:()=>e.onLeft?.(),ArrowRight:()=>e.onRight?.(),Home:()=>e.onHome?.(),End:()=>e.onEnd?.()}),dialog:e=>({Escape:()=>e.onEscape?.()}),grid:e=>({ArrowUp:()=>e.onUp?.(),ArrowDown:()=>e.onDown?.(),ArrowLeft:()=>e.onLeft?.(),ArrowRight:()=>e.onRight?.(),Home:()=>e.onHome?.(),End:()=>e.onEnd?.(),"Ctrl+Home":()=>e.onCtrlHome?.(),"Ctrl+End":()=>e.onCtrlEnd?.()})};function E(e,t={}){let{timeout:d=500}=t,i="",o=null;function n(){i="",o&&(clearTimeout(o),o=null);}function a(l){return l.length!==1||l===" "?null:(o&&clearTimeout(o),i+=l.toLowerCase(),o=setTimeout(n,d),e.find(s=>s.toLowerCase().startsWith(i))??null)}return {type:a,reset:n,getSearch:()=>i}}export{f as a,p as b,v as c,K as d,E as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r={hide(e){e.setAttribute("aria-hidden","true");},show(e){e.removeAttribute("aria-hidden");},setExpanded(e,t){e.setAttribute("aria-expanded",String(t));},setSelected(e,t){e.setAttribute("aria-selected",String(t));},setChecked(e,t){e.setAttribute("aria-checked",String(t));},setPressed(e,t){e.setAttribute("aria-pressed",String(t));},setDisabled(e,t){e.setAttribute("aria-disabled",String(t));},setBusy(e,t){e.setAttribute("aria-busy",String(t));},setCurrent(e,t){t==="false"?e.removeAttribute("aria-current"):e.setAttribute("aria-current",t);},setInvalid(e,t){t===false?e.removeAttribute("aria-invalid"):e.setAttribute("aria-invalid",String(t));},setLabel(e,t){t?e.setAttribute("aria-label",t):e.removeAttribute("aria-label");},setLabelledBy(e,...t){let i=t.filter(Boolean).join(" ");i?e.setAttribute("aria-labelledby",i):e.removeAttribute("aria-labelledby");},setDescribedBy(e,...t){let i=t.filter(Boolean).join(" ");i?e.setAttribute("aria-describedby",i):e.removeAttribute("aria-describedby");},setControls(e,...t){let i=t.filter(Boolean).join(" ");i?e.setAttribute("aria-controls",i):e.removeAttribute("aria-controls");},setOwns(e,...t){let i=t.filter(Boolean).join(" ");i?e.setAttribute("aria-owns",i):e.removeAttribute("aria-owns");},setActiveDescendant(e,t){t?e.setAttribute("aria-activedescendant",t):e.removeAttribute("aria-activedescendant");},setHasPopup(e,t){t===false?e.removeAttribute("aria-haspopup"):e.setAttribute("aria-haspopup",String(t));},setLevel(e,t){e.setAttribute("aria-level",String(t));},setPosition(e,t,i){e.setAttribute("aria-posinset",String(t)),e.setAttribute("aria-setsize",String(i));},setValue(e,t){t.min!==void 0&&e.setAttribute("aria-valuemin",String(t.min)),t.max!==void 0&&e.setAttribute("aria-valuemax",String(t.max)),t.now!==void 0&&e.setAttribute("aria-valuenow",String(t.now)),t.text!==void 0&&e.setAttribute("aria-valuetext",t.text);},setRole(e,t){t?e.setAttribute("role",t):e.removeAttribute("role");},setModal(e,t){t?e.setAttribute("aria-modal","true"):e.removeAttribute("aria-modal");},setOrientation(e,t){e.setAttribute("aria-orientation",t);},setRequired(e,t){e.setAttribute("aria-required",String(t));},setReadOnly(e,t){e.setAttribute("aria-readonly",String(t));},setAutocomplete(e,t){e.setAttribute("aria-autocomplete",t);},setMultiSelectable(e,t){e.setAttribute("aria-multiselectable",String(t));},setSort(e,t){e.setAttribute("aria-sort",t);}};function l(e){let t={};return e.label&&(t["aria-label"]=e.label),e.labelledBy&&(t["aria-labelledby"]=Array.isArray(e.labelledBy)?e.labelledBy.join(" "):e.labelledBy),e.describedBy&&(t["aria-describedby"]=Array.isArray(e.describedBy)?e.describedBy.join(" "):e.describedBy),e.controls&&(t["aria-controls"]=Array.isArray(e.controls)?e.controls.join(" "):e.controls),e.owns&&(t["aria-owns"]=Array.isArray(e.owns)?e.owns.join(" "):e.owns),e.expanded!==void 0&&(t["aria-expanded"]=String(e.expanded)),e.selected!==void 0&&(t["aria-selected"]=String(e.selected)),e.checked!==void 0&&(t["aria-checked"]=String(e.checked)),e.pressed!==void 0&&(t["aria-pressed"]=String(e.pressed)),e.disabled!==void 0&&(t["aria-disabled"]=String(e.disabled)),e.hidden!==void 0&&(t["aria-hidden"]=String(e.hidden)),e.modal!==void 0&&(t["aria-modal"]=String(e.modal)),e.busy!==void 0&&(t["aria-busy"]=String(e.busy)),e.current&&(t["aria-current"]=e.current),e.invalid!==void 0&&(t["aria-invalid"]=String(e.invalid)),e.hasPopup!==void 0&&(t["aria-haspopup"]=String(e.hasPopup)),e.activeDescendant&&(t["aria-activedescendant"]=e.activeDescendant),e.level!==void 0&&(t["aria-level"]=String(e.level)),e.posInSet!==void 0&&(t["aria-posinset"]=String(e.posInSet)),e.setSize!==void 0&&(t["aria-setsize"]=String(e.setSize)),e.valueMin!==void 0&&(t["aria-valuemin"]=String(e.valueMin)),e.valueMax!==void 0&&(t["aria-valuemax"]=String(e.valueMax)),e.valueNow!==void 0&&(t["aria-valuenow"]=String(e.valueNow)),e.valueText&&(t["aria-valuetext"]=e.valueText),e.orientation&&(t["aria-orientation"]=e.orientation),e.required!==void 0&&(t["aria-required"]=String(e.required)),e.readOnly!==void 0&&(t["aria-readonly"]=String(e.readOnly)),e.autocomplete&&(t["aria-autocomplete"]=e.autocomplete),e.multiSelectable!==void 0&&(t["aria-multiselectable"]=String(e.multiSelectable)),e.sort&&(t["aria-sort"]=e.sort),e.role&&(t.role=e.role),t}function d(...e){let t=e.filter(Boolean);return t.length>0?t.join(" "):void 0}function u(e){if(e.getAttribute("aria-label"))return true;let t=e.getAttribute("aria-labelledby");return !!(t&&t.split(" ").some(n=>{let a=document.getElementById(n);return a&&a.textContent?.trim()})||e.textContent?.trim()||e.getAttribute("title")||"labels"in e&&e.labels?.length||e.tagName==="IMG"&&e.getAttribute("alt"))}export{r as a,l as b,d as c,u as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunk7BL2ABLF_cjs=require('./chunk-7BL2ABLF.cjs');var D=["a[href]","area[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])','[contenteditable="true"]',"audio[controls]","video[controls]","details > summary:first-of-type","iframe"].join(","),K=['a[href]:not([tabindex="-1"])','area[href]:not([tabindex="-1"])','button:not([disabled]):not([tabindex="-1"])','input:not([disabled]):not([type="hidden"]):not([tabindex="-1"])','select:not([disabled]):not([tabindex="-1"])','textarea:not([disabled]):not([tabindex="-1"])','[tabindex]:not([tabindex="-1"])','[contenteditable="true"]:not([tabindex="-1"])','audio[controls]:not([tabindex="-1"])','video[controls]:not([tabindex="-1"])','details > summary:first-of-type:not([tabindex="-1"])','iframe:not([tabindex="-1"])'].join(",");function U(e){if(!(e instanceof HTMLElement)||e.hidden||e.style.display==="none"||e.style.visibility==="hidden")return false;let t=window.getComputedStyle(e);return !(t.display==="none"||t.visibility==="hidden"||!e.isConnected)}function V(e){return !(!(e instanceof HTMLElement)||!U(e)||!e.matches(D)||e.closest("[inert]"))}function I(e){return !V(e)||e.tabIndex<0?false:e.matches(K)}function oe(e){return Array.from(e.querySelectorAll(D)).filter(V)}function T(e){return Array.from(e.querySelectorAll(K)).filter(I).sort((u,r)=>{let n=Math.max(0,u.tabIndex),i=Math.max(0,r.tabIndex);return n===0&&i===0?0:n===0?1:i===0?-1:n-i})}function k(e){return T(e)[0]??null}function re(e){let t=T(e);return t[t.length-1]??null}function P(e){let t=document.activeElement;return t!==null&&e.contains(t)}function N(e,t,a=true){let u=T(e),r=u.indexOf(t);if(r===-1)return u[0]??null;let n=r+1;return n<u.length?u[n]:a?u[0]??null:null}function C(e,t,a=true){let u=T(e),r=u.indexOf(t);if(r===-1)return u[u.length-1]??null;let n=r-1;return n>=0?u[n]:a?u[u.length-1]??null:null}function ie(e,t){return t.contains(e)}function q(e,t=document.body){return e?typeof e=="string"?t.querySelector(e):typeof e=="function"?e():e:null}var F=[];function _(e,t={}){let{initialFocus:a,returnFocus:u=true,clickOutsideDeactivates:r=false,escapeDeactivates:n=true,onDeactivate:i,onEscapeFocus:c}=t,o=false,b=false,f=null;function h(l){b||!o||(l.key==="Tab"?y(l):l.key==="Escape"&&n&&(l.preventDefault(),l.stopPropagation(),v()));}function y(l){let E=T(e);if(E.length===0){l.preventDefault();return}let w=E[0],g=E[E.length-1],S=document.activeElement;l.shiftKey?(S===w||!e.contains(S))&&(l.preventDefault(),g.focus()):(S===g||!e.contains(S))&&(l.preventDefault(),w.focus());}function p(l){if(b||!o)return;let E=l.target;e.contains(E)||(c?.(E),k(e)?.focus());}function d(l){if(b||!o)return;let E=l.target;r&&!e.contains(E)&&v();}function m(){if(!o){f=document.activeElement,F.push(A);for(let l=0;l<F.length-1;l++)F[l].pause();document.addEventListener("keydown",h,true),document.addEventListener("focusin",p,true),document.addEventListener("click",d,true),o=true,requestAnimationFrame(()=>{if(!o)return;let l=q(a,e);if(l)l.focus();else {let E=k(e);E?E.focus():(e.setAttribute("tabindex","-1"),e.focus());}});}}function s(l){if(!o)return;document.removeEventListener("keydown",h,true),document.removeEventListener("focusin",p,true),document.removeEventListener("click",d,true),o=false,b=false;let E=F.indexOf(A);if(E>-1&&F.splice(E,1),F[F.length-1]?.unpause(),u&&f){let g=typeof u=="boolean"?f:u;requestAnimationFrame(()=>{g&&"focus"in g&&g.focus();});}l&&i?.();}function v(){s(true);}function L(){s(false);}function M(){!o||b||(b=true);}function H(){!o||!b||(b=false,P(e)||k(e)?.focus());}let A={activate:m,deactivate:v,destroy:L,pause:M,unpause:H,isActive:()=>o,isPaused:()=>b};return A}function z(){return F[F.length-1]??null}function W(){return F.length>0}var x={hadKeyboardEvent:true,isPointerInput:false,lastFocusSource:"unknown"},O=false,j=new Set(["Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Enter"," ","Home","End","PageUp","PageDown","Escape"]);function G(){if(!chunk7BL2ABLF_cjs.a()||O)return ()=>{};O=true;function e(n){j.has(n.key)&&(x.hadKeyboardEvent=true,x.isPointerInput=false,x.lastFocusSource="keyboard");}function t(n){x.isPointerInput=true,x.hadKeyboardEvent=false,x.lastFocusSource="pointerType"in n&&n.pointerType==="touch"?"touch":"mouse";}function a(n){let i=n.target;i instanceof HTMLElement&&(x.hadKeyboardEvent||Y(i))&&(i.dataset.a11ykitFocusVisible="true");}function u(n){let i=n.target;i instanceof HTMLElement&&delete i.dataset.a11ykitFocusVisible;}function r(){document.visibilityState==="hidden"&&(x.hadKeyboardEvent=true);}return document.addEventListener("keydown",e,true),document.addEventListener("mousedown",t,true),document.addEventListener("pointerdown",t,true),document.addEventListener("focus",a,true),document.addEventListener("blur",u,true),document.addEventListener("visibilitychange",r,true),()=>{document.removeEventListener("keydown",e,true),document.removeEventListener("mousedown",t,true),document.removeEventListener("pointerdown",t,true),document.removeEventListener("focus",a,true),document.removeEventListener("blur",u,true),document.removeEventListener("visibilitychange",r,true),O=false;}}function Y(e){let t=e.tagName.toLowerCase(),a=e.getAttribute("type")?.toLowerCase();return !!(t==="input"&&(!a||a==="text"||a==="email"||a==="password"||a==="search"||a==="tel"||a==="url"||a==="number")||t==="textarea"||e.isContentEditable)}function J(){return x.hadKeyboardEvent}function Q(e){return e.dataset.a11ykitFocusVisible==="true"}function X(){return x.lastFocusSource}function Z(e,t){t?e.dataset.a11ykitFocusVisible="true":delete e.dataset.a11ykitFocusVisible;}function $(e,t){x.hadKeyboardEvent=true,x.lastFocusSource="keyboard",e.focus(t);}function ee(e,t={}){let{contain:a=false,restoreFocus:u=false,autoFocus:r=false}=t,n=null,i=false;u&&(n=document.activeElement);function c(){return i?[]:T(e)}function o(){let s=document.activeElement;return s&&e.contains(s)?s:null}function b(){if(i)return;c()[0]?.focus();}function f(){if(i)return;let s=c();s[s.length-1]?.focus();}function h({wrap:s=true}={}){if(i)return;let v=o();if(!v){b();return}N(e,v,s)?.focus();}function y({wrap:s=true}={}){if(i)return;let v=o();if(!v){f();return}C(e,v,s)?.focus();}function p(s){if(i)return;c()[s]?.focus();}function d(s){if(!(i||!a)&&s.key==="Tab"){let v=c();if(v.length===0){s.preventDefault();return}let L=v[0],M=v[v.length-1],H=o();s.shiftKey&&H===L?(s.preventDefault(),M.focus()):!s.shiftKey&&H===M&&(s.preventDefault(),L.focus());}}function m(){i||(i=true,document.removeEventListener("keydown",d,true),u&&n&&n.focus());}return a&&document.addEventListener("keydown",d,true),r&&requestAnimationFrame(()=>{i||b();}),{focusFirst:b,focusLast:f,focusNext:h,focusPrevious:y,focusAt:p,getFocused:o,getElements:c,destroy:m}}function te(e,t,a={}){let{initialIndex:u=0,orientation:r="both",wrap:n=true,onSelectionChange:i}=a,c=[],o=u;function b(){c=Array.from(e.querySelectorAll(t)),c.forEach((p,d)=>{p.setAttribute("tabindex",d===o?"0":"-1");});}function f(p){if(c.length===0)return;let d=p;d<0?d=n?c.length-1:0:d>=c.length&&(d=n?0:c.length-1);let m=c[o],s=c[d];m&&m.setAttribute("tabindex","-1"),s&&(s.setAttribute("tabindex","0"),s.focus(),i?.(d,s)),o=d;}function h(p){let d=p.target;if(!c.includes(d))return;let m=false;switch(p.key){case "ArrowRight":(r==="horizontal"||r==="both")&&(f(o+1),m=true);break;case "ArrowLeft":(r==="horizontal"||r==="both")&&(f(o-1),m=true);break;case "ArrowDown":(r==="vertical"||r==="both")&&(f(o+1),m=true);break;case "ArrowUp":(r==="vertical"||r==="both")&&(f(o-1),m=true);break;case "Home":f(0),m=true;break;case "End":f(c.length-1),m=true;break}m&&(p.preventDefault(),p.stopPropagation());}function y(p){let d=p.target,m=c.indexOf(d);if(m!==-1&&m!==o){let s=c[o];s&&s.setAttribute("tabindex","-1"),d.setAttribute("tabindex","0"),o=m;}}return b(),e.addEventListener("keydown",h),e.addEventListener("focusin",y),{next:()=>f(o+1),previous:()=>f(o-1),first:()=>f(0),last:()=>f(c.length-1),goto:f,getIndex:()=>o,update:b,destroy:()=>{e.removeEventListener("keydown",h),e.removeEventListener("focusin",y);}}}function B(e,t={}){let{scope:a=e.parentElement??document.body,prefer:u="previous"}=t,r=T(a),n=r.indexOf(e);n===-1&&(n=r.findIndex(f=>e.compareDocumentPosition(f)&Node.DOCUMENT_POSITION_FOLLOWING),n===-1&&(n=r.length));let i=n-1,c=n+1,o=i>=0&&r[i]!==e?r[i]:null,b=c<r.length&&r[c]!==e?r[c]:null;return u==="previous"?o??b:b??o}function ne(e){let t=e??null;function a(n){t=n??document.activeElement??null;}function u(n={}){let{fallback:i,prefer:c="previous"}=n;if(!t){i?.focus();return}if(t.isConnected&&I(t)){t.focus(),t=null;return}if(t.isConnected){let o=B(t,{prefer:c});if(o){o.focus(),t=null;return}}i&&i.focus(),t=null;}function r(){t=null;}return {get element(){return t},save:a,return:u,clear:r}}exports.A=ne;exports.a=D;exports.b=K;exports.c=U;exports.d=V;exports.e=I;exports.f=oe;exports.g=T;exports.h=k;exports.i=re;exports.j=P;exports.k=N;exports.l=C;exports.m=ie;exports.n=q;exports.o=_;exports.p=z;exports.q=W;exports.r=G;exports.s=J;exports.t=Q;exports.u=X;exports.v=Z;exports.w=$;exports.x=ee;exports.y=te;exports.z=B;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a as a$1}from'./chunk-C3VZQUKG.js';var o=null,i=null,m=false,l=[],r=null;function L(){return {position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"}}function x(n){let e=document.createElement("div");e.setAttribute("role","status"),e.setAttribute("aria-live",n),e.setAttribute("aria-atomic","true"),e.setAttribute("aria-relevant","additions text"),e.id=`compa11y-announcer-${n}`;let t=L();return Object.assign(e.style,t),document.body.appendChild(e),{element:e,politeness:n}}function b(){return !a$1()||m?()=>{}:(m=true,o=x("polite"),i=x("assertive"),()=>{o&&(o.element.remove(),o=null),i&&(i.element.remove(),i=null),r&&(clearTimeout(r),r=null),l=[],m=false;})}function R(){!m&&a$1()&&b();}function g(n){n.element.textContent="";}function a(n,e={}){if(!a$1())return;let{politeness:t="polite",delay:s=0,clearPrevious:c=false,timeout:A=7e3}=e;R();let u=t==="assertive"?i:o;if(!u)return;let d=()=>{c&&g(u),u.element.textContent="",requestAnimationFrame(()=>{u.element.textContent=n,A>0&&setTimeout(()=>{u.element.textContent===n&&(u.element.textContent="");},A);});};s>0?setTimeout(d,s):d();}function f(n,e){a(n,{...e,politeness:"polite"});}function v(n,e){a(n,{...e,politeness:"assertive"});}function O(){o&&g(o),i&&g(i);}function y(n,e={}){let{debounce:t=150,...s}=e;l.push({message:n,options:s}),r&&clearTimeout(r),r=setTimeout(()=>{let c=l[l.length-1];c&&a(c.message,c.options),l=[],r=null;},t);}function P(n={}){return {announce:(e,t)=>a(e,{...n,...t}),polite:(e,t)=>f(e,{...n,...t}),assertive:(e,t)=>v(e,{...n,...t}),queue:(e,t)=>y(e,{...n,...t}),clear:O}}function S(n){f(n);}function T(n){v(n);}function h(n,e,t="{current} of {total}"){let s=t.replace("{current}",String(n)).replace("{total}",String(e));f(s);}export{b as a,a as b,f as c,v as d,O as e,y as f,P as g,S as h,T as i,h as j};
|
package/dist/focus/index.cjs
CHANGED
|
@@ -1,53 +1 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkCQXMBRLD_cjs = require('../chunk-CQXMBRLD.cjs');
|
|
4
|
-
require('../chunk-XEGB27QF.cjs');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Object.defineProperty(exports, "createFocusScope", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function () { return chunkCQXMBRLD_cjs.createFocusScope; }
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "createFocusTrap", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () { return chunkCQXMBRLD_cjs.createFocusTrap; }
|
|
15
|
-
});
|
|
16
|
-
Object.defineProperty(exports, "createRovingTabindex", {
|
|
17
|
-
enumerable: true,
|
|
18
|
-
get: function () { return chunkCQXMBRLD_cjs.createRovingTabindex; }
|
|
19
|
-
});
|
|
20
|
-
Object.defineProperty(exports, "focusWithVisibleRing", {
|
|
21
|
-
enumerable: true,
|
|
22
|
-
get: function () { return chunkCQXMBRLD_cjs.focusWithVisibleRing; }
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "getActiveFocusTrap", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () { return chunkCQXMBRLD_cjs.getActiveFocusTrap; }
|
|
27
|
-
});
|
|
28
|
-
Object.defineProperty(exports, "getLastFocusSource", {
|
|
29
|
-
enumerable: true,
|
|
30
|
-
get: function () { return chunkCQXMBRLD_cjs.getLastFocusSource; }
|
|
31
|
-
});
|
|
32
|
-
Object.defineProperty(exports, "hasFocusTrap", {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
get: function () { return chunkCQXMBRLD_cjs.hasFocusTrap; }
|
|
35
|
-
});
|
|
36
|
-
Object.defineProperty(exports, "hasVisibleFocus", {
|
|
37
|
-
enumerable: true,
|
|
38
|
-
get: function () { return chunkCQXMBRLD_cjs.hasVisibleFocus; }
|
|
39
|
-
});
|
|
40
|
-
Object.defineProperty(exports, "initFocusVisible", {
|
|
41
|
-
enumerable: true,
|
|
42
|
-
get: function () { return chunkCQXMBRLD_cjs.initFocusVisible; }
|
|
43
|
-
});
|
|
44
|
-
Object.defineProperty(exports, "isFocusVisible", {
|
|
45
|
-
enumerable: true,
|
|
46
|
-
get: function () { return chunkCQXMBRLD_cjs.isFocusVisible; }
|
|
47
|
-
});
|
|
48
|
-
Object.defineProperty(exports, "setFocusVisible", {
|
|
49
|
-
enumerable: true,
|
|
50
|
-
get: function () { return chunkCQXMBRLD_cjs.setFocusVisible; }
|
|
51
|
-
});
|
|
52
|
-
//# sourceMappingURL=index.cjs.map
|
|
53
|
-
//# sourceMappingURL=index.cjs.map
|
|
1
|
+
'use strict';var chunkY2RTDE4A_cjs=require('../chunk-Y2RTDE4A.cjs');require('../chunk-7BL2ABLF.cjs');Object.defineProperty(exports,"createFocusReturn",{enumerable:true,get:function(){return chunkY2RTDE4A_cjs.A}});Object.defineProperty(exports,"createFocusScope",{enumerable:true,get:function(){return chunkY2RTDE4A_cjs.x}});Object.defineProperty(exports,"createFocusTrap",{enumerable:true,get:function(){return chunkY2RTDE4A_cjs.o}});Object.defineProperty(exports,"createRovingTabindex",{enumerable:true,get:function(){return chunkY2RTDE4A_cjs.y}});Object.defineProperty(exports,"findFocusNeighbor",{enumerable:true,get:function(){return chunkY2RTDE4A_cjs.z}});Object.defineProperty(exports,"focusWithVisibleRing",{enumerable:true,get:function(){return chunkY2RTDE4A_cjs.w}});Object.defineProperty(exports,"getActiveFocusTrap",{enumerable:true,get:function(){return chunkY2RTDE4A_cjs.p}});Object.defineProperty(exports,"getLastFocusSource",{enumerable:true,get:function(){return chunkY2RTDE4A_cjs.u}});Object.defineProperty(exports,"hasFocusTrap",{enumerable:true,get:function(){return chunkY2RTDE4A_cjs.q}});Object.defineProperty(exports,"hasVisibleFocus",{enumerable:true,get:function(){return chunkY2RTDE4A_cjs.t}});Object.defineProperty(exports,"initFocusVisible",{enumerable:true,get:function(){return chunkY2RTDE4A_cjs.r}});Object.defineProperty(exports,"isFocusVisible",{enumerable:true,get:function(){return chunkY2RTDE4A_cjs.s}});Object.defineProperty(exports,"setFocusVisible",{enumerable:true,get:function(){return chunkY2RTDE4A_cjs.v}});
|
package/dist/focus/index.d.cts
CHANGED
|
@@ -136,4 +136,66 @@ interface RovingTabindex {
|
|
|
136
136
|
}
|
|
137
137
|
declare function createRovingTabindex(container: HTMLElement, selector: string, options?: RovingTabindexOptions): RovingTabindex;
|
|
138
138
|
|
|
139
|
-
|
|
139
|
+
/**
|
|
140
|
+
* Focus Neighbor & Focus Return
|
|
141
|
+
*
|
|
142
|
+
* Utilities for graceful focus recovery when the focused element
|
|
143
|
+
* becomes disabled, removed, or otherwise unfocusable.
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* ```ts
|
|
147
|
+
* // Find where focus should go if this button is about to be removed
|
|
148
|
+
* const neighbor = findFocusNeighbor(button);
|
|
149
|
+
* neighbor?.focus();
|
|
150
|
+
*
|
|
151
|
+
* // Remember focus target, restore later (with fallback to neighbor)
|
|
152
|
+
* const focusReturn = createFocusReturn();
|
|
153
|
+
* focusReturn.save(triggerButton);
|
|
154
|
+
* // ... later, after modal closes:
|
|
155
|
+
* focusReturn.return(); // focuses trigger, or its neighbor if trigger is disabled
|
|
156
|
+
* ```
|
|
157
|
+
*/
|
|
158
|
+
interface FocusNeighborOptions {
|
|
159
|
+
/** Container to search within (default: element.parentElement ?? document.body) */
|
|
160
|
+
scope?: HTMLElement;
|
|
161
|
+
/** Which direction to try first: 'previous' (default) or 'next' */
|
|
162
|
+
prefer?: 'previous' | 'next';
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Find the nearest focusable neighbor of an element within a scope.
|
|
166
|
+
*
|
|
167
|
+
* Useful when an element is about to be removed or disabled and you
|
|
168
|
+
* need to know where to move focus.
|
|
169
|
+
*
|
|
170
|
+
* @param element - The reference element to find a neighbor for
|
|
171
|
+
* @param options - Search scope and direction preference
|
|
172
|
+
* @returns The nearest tabbable neighbor, or null if none found
|
|
173
|
+
*/
|
|
174
|
+
declare function findFocusNeighbor(element: HTMLElement, options?: FocusNeighborOptions): HTMLElement | null;
|
|
175
|
+
interface FocusReturnOptions {
|
|
176
|
+
/** Fallback element if saved element and its neighbors are all unfocusable */
|
|
177
|
+
fallback?: HTMLElement;
|
|
178
|
+
/** Direction preference for neighbor search */
|
|
179
|
+
prefer?: 'previous' | 'next';
|
|
180
|
+
}
|
|
181
|
+
interface FocusReturn {
|
|
182
|
+
/** The currently saved element (may be null) */
|
|
183
|
+
readonly element: HTMLElement | null;
|
|
184
|
+
/** Save an element (or current activeElement) as the return target */
|
|
185
|
+
save(element?: HTMLElement): void;
|
|
186
|
+
/** Return focus to the saved element, or its nearest neighbor if unavailable */
|
|
187
|
+
return(options?: FocusReturnOptions): void;
|
|
188
|
+
/** Clear the saved reference without moving focus */
|
|
189
|
+
clear(): void;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Create a focus return manager that remembers an element and can
|
|
193
|
+
* restore focus to it later — with smart fallback to the nearest
|
|
194
|
+
* focusable neighbor if the saved element is no longer available.
|
|
195
|
+
*
|
|
196
|
+
* @param initialElement - Optional element to save immediately
|
|
197
|
+
* @returns FocusReturn controller
|
|
198
|
+
*/
|
|
199
|
+
declare function createFocusReturn(initialElement?: HTMLElement): FocusReturn;
|
|
200
|
+
|
|
201
|
+
export { type FocusNeighborOptions, type FocusReturn, type FocusReturnOptions, type FocusScope, type FocusScopeOptions, type RovingTabindex, type RovingTabindexOptions, createFocusReturn, createFocusScope, createFocusTrap, createRovingTabindex, findFocusNeighbor, focusWithVisibleRing, getActiveFocusTrap, getLastFocusSource, hasFocusTrap, hasVisibleFocus, initFocusVisible, isFocusVisible, setFocusVisible };
|
package/dist/focus/index.d.ts
CHANGED
|
@@ -136,4 +136,66 @@ interface RovingTabindex {
|
|
|
136
136
|
}
|
|
137
137
|
declare function createRovingTabindex(container: HTMLElement, selector: string, options?: RovingTabindexOptions): RovingTabindex;
|
|
138
138
|
|
|
139
|
-
|
|
139
|
+
/**
|
|
140
|
+
* Focus Neighbor & Focus Return
|
|
141
|
+
*
|
|
142
|
+
* Utilities for graceful focus recovery when the focused element
|
|
143
|
+
* becomes disabled, removed, or otherwise unfocusable.
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* ```ts
|
|
147
|
+
* // Find where focus should go if this button is about to be removed
|
|
148
|
+
* const neighbor = findFocusNeighbor(button);
|
|
149
|
+
* neighbor?.focus();
|
|
150
|
+
*
|
|
151
|
+
* // Remember focus target, restore later (with fallback to neighbor)
|
|
152
|
+
* const focusReturn = createFocusReturn();
|
|
153
|
+
* focusReturn.save(triggerButton);
|
|
154
|
+
* // ... later, after modal closes:
|
|
155
|
+
* focusReturn.return(); // focuses trigger, or its neighbor if trigger is disabled
|
|
156
|
+
* ```
|
|
157
|
+
*/
|
|
158
|
+
interface FocusNeighborOptions {
|
|
159
|
+
/** Container to search within (default: element.parentElement ?? document.body) */
|
|
160
|
+
scope?: HTMLElement;
|
|
161
|
+
/** Which direction to try first: 'previous' (default) or 'next' */
|
|
162
|
+
prefer?: 'previous' | 'next';
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Find the nearest focusable neighbor of an element within a scope.
|
|
166
|
+
*
|
|
167
|
+
* Useful when an element is about to be removed or disabled and you
|
|
168
|
+
* need to know where to move focus.
|
|
169
|
+
*
|
|
170
|
+
* @param element - The reference element to find a neighbor for
|
|
171
|
+
* @param options - Search scope and direction preference
|
|
172
|
+
* @returns The nearest tabbable neighbor, or null if none found
|
|
173
|
+
*/
|
|
174
|
+
declare function findFocusNeighbor(element: HTMLElement, options?: FocusNeighborOptions): HTMLElement | null;
|
|
175
|
+
interface FocusReturnOptions {
|
|
176
|
+
/** Fallback element if saved element and its neighbors are all unfocusable */
|
|
177
|
+
fallback?: HTMLElement;
|
|
178
|
+
/** Direction preference for neighbor search */
|
|
179
|
+
prefer?: 'previous' | 'next';
|
|
180
|
+
}
|
|
181
|
+
interface FocusReturn {
|
|
182
|
+
/** The currently saved element (may be null) */
|
|
183
|
+
readonly element: HTMLElement | null;
|
|
184
|
+
/** Save an element (or current activeElement) as the return target */
|
|
185
|
+
save(element?: HTMLElement): void;
|
|
186
|
+
/** Return focus to the saved element, or its nearest neighbor if unavailable */
|
|
187
|
+
return(options?: FocusReturnOptions): void;
|
|
188
|
+
/** Clear the saved reference without moving focus */
|
|
189
|
+
clear(): void;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Create a focus return manager that remembers an element and can
|
|
193
|
+
* restore focus to it later — with smart fallback to the nearest
|
|
194
|
+
* focusable neighbor if the saved element is no longer available.
|
|
195
|
+
*
|
|
196
|
+
* @param initialElement - Optional element to save immediately
|
|
197
|
+
* @returns FocusReturn controller
|
|
198
|
+
*/
|
|
199
|
+
declare function createFocusReturn(initialElement?: HTMLElement): FocusReturn;
|
|
200
|
+
|
|
201
|
+
export { type FocusNeighborOptions, type FocusReturn, type FocusReturnOptions, type FocusScope, type FocusScopeOptions, type RovingTabindex, type RovingTabindexOptions, createFocusReturn, createFocusScope, createFocusTrap, createRovingTabindex, findFocusNeighbor, focusWithVisibleRing, getActiveFocusTrap, getLastFocusSource, hasFocusTrap, hasVisibleFocus, initFocusVisible, isFocusVisible, setFocusVisible };
|
package/dist/focus/index.js
CHANGED
|
@@ -1,4 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
import '../chunk-Z7K2G6FX.js';
|
|
3
|
-
//# sourceMappingURL=index.js.map
|
|
4
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export{A as createFocusReturn,x as createFocusScope,o as createFocusTrap,y as createRovingTabindex,z as findFocusNeighbor,w as focusWithVisibleRing,p as getActiveFocusTrap,u as getLastFocusSource,q as hasFocusTrap,t as hasVisibleFocus,r as initFocusVisible,s as isFocusVisible,v as setFocusVisible}from'../chunk-QGEFH2VG.js';import'../chunk-C3VZQUKG.js';
|