@fluentui/react-aria 9.3.43 → 9.4.0

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/CHANGELOG.md CHANGED
@@ -1,12 +1,32 @@
1
1
  # Change Log - @fluentui/react-aria
2
2
 
3
- This log was last generated on Wed, 18 Oct 2023 17:47:37 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 30 Nov 2023 13:37:52 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.4.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-aria_v9.4.0)
8
+
9
+ Thu, 30 Nov 2023 13:37:52 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-aria_v9.3.44..@fluentui/react-aria_v9.4.0)
11
+
12
+ ### Minor changes
13
+
14
+ - feat: Implement aria-activedescendant utility ([PR #29904](https://github.com/microsoft/fluentui/pull/29904) by lingfan.gao@microsoft.com)
15
+
16
+ ## [9.3.44](https://github.com/microsoft/fluentui/tree/@fluentui/react-aria_v9.3.44)
17
+
18
+ Thu, 09 Nov 2023 17:29:50 GMT
19
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-aria_v9.3.43..@fluentui/react-aria_v9.3.44)
20
+
21
+ ### Patches
22
+
23
+ - chore: use package.json#files setup instead of npmignore for all v9 libraries ([PR #29734](https://github.com/microsoft/fluentui/pull/29734) by martinhochel@microsoft.com)
24
+ - Bump @fluentui/keyboard-keys to v9.0.7 ([PR #29800](https://github.com/microsoft/fluentui/pull/29800) by beachball)
25
+ - Bump @fluentui/react-utilities to v9.15.2 ([PR #29800](https://github.com/microsoft/fluentui/pull/29800) by beachball)
26
+
7
27
  ## [9.3.43](https://github.com/microsoft/fluentui/tree/@fluentui/react-aria_v9.3.43)
8
28
 
9
- Wed, 18 Oct 2023 17:47:37 GMT
29
+ Wed, 18 Oct 2023 17:54:08 GMT
10
30
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-aria_v9.3.42..@fluentui/react-aria_v9.3.43)
11
31
 
12
32
  ### Patches
package/dist/index.d.ts CHANGED
@@ -3,6 +3,20 @@ import * as React_2 from 'react';
3
3
  import type { ResolveShorthandFunction } from '@fluentui/react-utilities';
4
4
  import type { Slot } from '@fluentui/react-utilities';
5
5
 
6
+ export declare interface ActiveDescendantImperativeRef {
7
+ first: () => void;
8
+ next: () => void;
9
+ prev: () => void;
10
+ blur: () => void;
11
+ active: () => string | undefined;
12
+ focus: (id: string) => void;
13
+ }
14
+
15
+ export declare interface ActiveDescendantOptions {
16
+ matchOption: (el: HTMLElement) => boolean;
17
+ imperativeRef?: React_2.RefObject<ActiveDescendantImperativeRef>;
18
+ }
19
+
6
20
  /**
7
21
  * Props that will be modified internally by `useARIAButtonProps` by each case.
8
22
  * This typing is to ensure a well specified return value for `useARIAbButtonProps`
@@ -43,6 +57,11 @@ export declare type ARIAButtonType = 'button' | 'a' | 'div';
43
57
 
44
58
  declare type UnionToIntersection<U> = (U extends unknown ? (x: U) => U : never) extends (x: infer I) => U ? I : never;
45
59
 
60
+ export declare function useActiveDescendant<TActiveParentElement extends HTMLElement, TListboxElement extends HTMLElement>(options: ActiveDescendantOptions): {
61
+ listboxRef: React_2.MutableRefObject<TListboxElement | null>;
62
+ activeParentRef: React_2.RefObject<TActiveParentElement>;
63
+ };
64
+
46
65
  /**
47
66
  * @internal
48
67
  *
@@ -0,0 +1 @@
1
+ export const ACTIVEDESCENDANT_ATTRIBUTE = 'data-activedescendant';
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["constants.ts"],"sourcesContent":["export const ACTIVEDESCENDANT_ATTRIBUTE = 'data-activedescendant';\n"],"names":["ACTIVEDESCENDANT_ATTRIBUTE"],"mappings":"AAAA,OAAO,MAAMA,6BAA6B,wBAAwB"}
@@ -0,0 +1,2 @@
1
+ export * from './useActiveDescendant';
2
+ export * from './types';
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './useActiveDescendant';\nexport * from './types';\n"],"names":[],"mappings":"AAAA,cAAc,wBAAwB;AACtC,cAAc,UAAU"}
@@ -0,0 +1 @@
1
+ import * as React from 'react';
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["types.ts"],"sourcesContent":["import * as React from 'react';\n\nexport interface ActiveDescendantImperativeRef {\n first: () => void;\n next: () => void;\n prev: () => void;\n blur: () => void;\n active: () => string | undefined;\n focus: (id: string) => void;\n}\n\nexport interface ActiveDescendantOptions {\n matchOption: (el: HTMLElement) => boolean;\n imperativeRef?: React.RefObject<ActiveDescendantImperativeRef>;\n}\n"],"names":["React"],"mappings":"AAAA,YAAYA,WAAW,QAAQ"}
@@ -0,0 +1,96 @@
1
+ import * as React from 'react';
2
+ import { useOptionWalker } from './useOptionWalker';
3
+ import { ACTIVEDESCENDANT_ATTRIBUTE } from './constants';
4
+ export function useActiveDescendant(options) {
5
+ const { imperativeRef, matchOption } = options;
6
+ const activeParentRef = React.useRef(null);
7
+ const { listboxRef, optionWalker } = useOptionWalker({
8
+ matchOption
9
+ });
10
+ const getActiveDescendant = ()=>{
11
+ var _listboxRef_current;
12
+ return (_listboxRef_current = listboxRef.current) === null || _listboxRef_current === void 0 ? void 0 : _listboxRef_current.querySelector(`[${ACTIVEDESCENDANT_ATTRIBUTE}]`);
13
+ };
14
+ const setActiveDescendant = (nextActive)=>{
15
+ const active = getActiveDescendant();
16
+ if (active) {
17
+ active.removeAttribute(ACTIVEDESCENDANT_ATTRIBUTE);
18
+ }
19
+ if (nextActive) {
20
+ var _activeParentRef_current;
21
+ nextActive.setAttribute(ACTIVEDESCENDANT_ATTRIBUTE, '');
22
+ (_activeParentRef_current = activeParentRef.current) === null || _activeParentRef_current === void 0 ? void 0 : _activeParentRef_current.setAttribute('aria-activedescendant', nextActive.id);
23
+ } else {
24
+ var _activeParentRef_current1;
25
+ (_activeParentRef_current1 = activeParentRef.current) === null || _activeParentRef_current1 === void 0 ? void 0 : _activeParentRef_current1.removeAttribute('aria-activedescendant');
26
+ }
27
+ };
28
+ React.useImperativeHandle(imperativeRef, ()=>({
29
+ first: ()=>{
30
+ if (!listboxRef.current || !activeParentRef.current) {
31
+ return;
32
+ }
33
+ const first = optionWalker.first();
34
+ if (first) {
35
+ setActiveDescendant(first);
36
+ }
37
+ },
38
+ next: ()=>{
39
+ if (!listboxRef.current || !activeParentRef.current) {
40
+ return;
41
+ }
42
+ const active = getActiveDescendant();
43
+ if (!active) {
44
+ return;
45
+ }
46
+ optionWalker.setCurrent(active);
47
+ const next = optionWalker.next();
48
+ if (next) {
49
+ setActiveDescendant(next);
50
+ }
51
+ },
52
+ prev: ()=>{
53
+ if (!listboxRef.current || !activeParentRef.current) {
54
+ return;
55
+ }
56
+ const active = getActiveDescendant();
57
+ if (!active) {
58
+ return;
59
+ }
60
+ optionWalker.setCurrent(active);
61
+ const next = optionWalker.prev();
62
+ if (next && next !== listboxRef.current) {
63
+ setActiveDescendant(next);
64
+ }
65
+ },
66
+ blur: ()=>{
67
+ if (!listboxRef.current || !activeParentRef.current) {
68
+ return;
69
+ }
70
+ setActiveDescendant(undefined);
71
+ },
72
+ active: ()=>{
73
+ if (listboxRef.current) {
74
+ var _getActiveDescendant;
75
+ return (_getActiveDescendant = getActiveDescendant()) === null || _getActiveDescendant === void 0 ? void 0 : _getActiveDescendant.id;
76
+ }
77
+ },
78
+ focus: (id)=>{
79
+ if (!listboxRef.current) {
80
+ return;
81
+ }
82
+ optionWalker.setCurrent(listboxRef.current);
83
+ let cur = optionWalker.next();
84
+ while(cur && cur.id !== id){
85
+ cur = optionWalker.next();
86
+ }
87
+ if (cur) {
88
+ setActiveDescendant(cur);
89
+ }
90
+ }
91
+ }));
92
+ return {
93
+ listboxRef,
94
+ activeParentRef
95
+ };
96
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["useActiveDescendant.ts"],"sourcesContent":["import * as React from 'react';\nimport { useOptionWalker } from './useOptionWalker';\nimport type { ActiveDescendantOptions } from './types';\nimport { ACTIVEDESCENDANT_ATTRIBUTE } from './constants';\n\nexport function useActiveDescendant<TActiveParentElement extends HTMLElement, TListboxElement extends HTMLElement>(\n options: ActiveDescendantOptions,\n) {\n const { imperativeRef, matchOption } = options;\n const activeParentRef = React.useRef<TActiveParentElement>(null);\n const { listboxRef, optionWalker } = useOptionWalker<TListboxElement>({ matchOption });\n const getActiveDescendant = () => {\n return listboxRef.current?.querySelector<HTMLElement>(`[${ACTIVEDESCENDANT_ATTRIBUTE}]`);\n };\n\n const setActiveDescendant = (nextActive: HTMLElement | undefined) => {\n const active = getActiveDescendant();\n if (active) {\n active.removeAttribute(ACTIVEDESCENDANT_ATTRIBUTE);\n }\n\n if (nextActive) {\n nextActive.setAttribute(ACTIVEDESCENDANT_ATTRIBUTE, '');\n activeParentRef.current?.setAttribute('aria-activedescendant', nextActive.id);\n } else {\n activeParentRef.current?.removeAttribute('aria-activedescendant');\n }\n };\n\n React.useImperativeHandle(imperativeRef, () => ({\n first: () => {\n if (!listboxRef.current || !activeParentRef.current) {\n return;\n }\n\n const first = optionWalker.first();\n if (first) {\n setActiveDescendant(first);\n }\n },\n next: () => {\n if (!listboxRef.current || !activeParentRef.current) {\n return;\n }\n\n const active = getActiveDescendant();\n if (!active) {\n return;\n }\n\n optionWalker.setCurrent(active);\n const next = optionWalker.next();\n if (next) {\n setActiveDescendant(next);\n }\n },\n prev: () => {\n if (!listboxRef.current || !activeParentRef.current) {\n return;\n }\n\n const active = getActiveDescendant();\n if (!active) {\n return;\n }\n\n optionWalker.setCurrent(active);\n const next = optionWalker.prev();\n\n if (next && next !== listboxRef.current) {\n setActiveDescendant(next);\n }\n },\n blur: () => {\n if (!listboxRef.current || !activeParentRef.current) {\n return;\n }\n\n setActiveDescendant(undefined);\n },\n active: () => {\n if (listboxRef.current) {\n return getActiveDescendant()?.id;\n }\n },\n\n focus: (id: string) => {\n if (!listboxRef.current) {\n return;\n }\n\n optionWalker.setCurrent(listboxRef.current);\n let cur = optionWalker.next();\n\n while (cur && cur.id !== id) {\n cur = optionWalker.next();\n }\n\n if (cur) {\n setActiveDescendant(cur);\n }\n },\n }));\n\n return { listboxRef, activeParentRef };\n}\n"],"names":["React","useOptionWalker","ACTIVEDESCENDANT_ATTRIBUTE","useActiveDescendant","options","imperativeRef","matchOption","activeParentRef","useRef","listboxRef","optionWalker","getActiveDescendant","current","querySelector","setActiveDescendant","nextActive","active","removeAttribute","setAttribute","id","useImperativeHandle","first","next","setCurrent","prev","blur","undefined","focus","cur"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,eAAe,QAAQ,oBAAoB;AAEpD,SAASC,0BAA0B,QAAQ,cAAc;AAEzD,OAAO,SAASC,oBACdC,OAAgC;IAEhC,MAAM,EAAEC,aAAa,EAAEC,WAAW,EAAE,GAAGF;IACvC,MAAMG,kBAAkBP,MAAMQ,MAAM,CAAuB;IAC3D,MAAM,EAAEC,UAAU,EAAEC,YAAY,EAAE,GAAGT,gBAAiC;QAAEK;IAAY;IACpF,MAAMK,sBAAsB;YACnBF;QAAP,QAAOA,sBAAAA,WAAWG,OAAO,cAAlBH,0CAAAA,oBAAoBI,aAAa,CAAc,CAAC,CAAC,EAAEX,2BAA2B,CAAC,CAAC;IACzF;IAEA,MAAMY,sBAAsB,CAACC;QAC3B,MAAMC,SAASL;QACf,IAAIK,QAAQ;YACVA,OAAOC,eAAe,CAACf;QACzB;QAEA,IAAIa,YAAY;gBAEdR;YADAQ,WAAWG,YAAY,CAAChB,4BAA4B;aACpDK,2BAAAA,gBAAgBK,OAAO,cAAvBL,+CAAAA,yBAAyBW,YAAY,CAAC,yBAAyBH,WAAWI,EAAE;QAC9E,OAAO;gBACLZ;aAAAA,4BAAAA,gBAAgBK,OAAO,cAAvBL,gDAAAA,0BAAyBU,eAAe,CAAC;QAC3C;IACF;IAEAjB,MAAMoB,mBAAmB,CAACf,eAAe,IAAO,CAAA;YAC9CgB,OAAO;gBACL,IAAI,CAACZ,WAAWG,OAAO,IAAI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AAEnB;QAAYF;IAAgB;AACvC"}
@@ -0,0 +1,56 @@
1
+ import * as React from 'react';
2
+ import { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';
3
+ import { isHTMLElement, useIsomorphicLayoutEffect } from '@fluentui/react-utilities';
4
+ export function useOptionWalker(options) {
5
+ const { matchOption } = options;
6
+ const { targetDocument } = useFluent();
7
+ const treeWalkerRef = React.useRef(null);
8
+ const listboxRef = React.useRef(null);
9
+ const optionFilter = React.useCallback((node)=>{
10
+ if (isHTMLElement(node) && matchOption(node)) {
11
+ return NodeFilter.FILTER_ACCEPT;
12
+ }
13
+ return NodeFilter.FILTER_SKIP;
14
+ }, [
15
+ matchOption
16
+ ]);
17
+ useIsomorphicLayoutEffect(()=>{
18
+ if (!targetDocument || !listboxRef.current) {
19
+ return;
20
+ }
21
+ treeWalkerRef.current = targetDocument.createTreeWalker(listboxRef.current, NodeFilter.SHOW_ELEMENT, optionFilter);
22
+ }, [
23
+ targetDocument,
24
+ optionFilter
25
+ ]);
26
+ const optionWalker = React.useMemo(()=>({
27
+ first: ()=>{
28
+ if (!treeWalkerRef.current) {
29
+ return null;
30
+ }
31
+ return treeWalkerRef.current.firstChild();
32
+ },
33
+ next: ()=>{
34
+ if (!treeWalkerRef.current) {
35
+ return null;
36
+ }
37
+ return treeWalkerRef.current.nextNode();
38
+ },
39
+ prev: ()=>{
40
+ if (!treeWalkerRef.current) {
41
+ return null;
42
+ }
43
+ return treeWalkerRef.current.previousNode();
44
+ },
45
+ setCurrent: (el)=>{
46
+ if (!treeWalkerRef.current) {
47
+ return;
48
+ }
49
+ treeWalkerRef.current.currentNode = el;
50
+ }
51
+ }), []);
52
+ return {
53
+ optionWalker,
54
+ listboxRef
55
+ };
56
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["useOptionWalker.ts"],"sourcesContent":["import * as React from 'react';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { isHTMLElement, useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\n\ninterface UseOptionWalkerOptions {\n matchOption: (el: HTMLElement) => boolean;\n}\n\nexport function useOptionWalker<TListboxElement extends HTMLElement>(options: UseOptionWalkerOptions) {\n const { matchOption } = options;\n const { targetDocument } = useFluent();\n const treeWalkerRef = React.useRef<TreeWalker | null>(null);\n const listboxRef = React.useRef<TListboxElement | null>(null);\n\n const optionFilter = React.useCallback(\n (node: Node) => {\n if (isHTMLElement(node) && matchOption(node)) {\n return NodeFilter.FILTER_ACCEPT;\n }\n\n return NodeFilter.FILTER_SKIP;\n },\n [matchOption],\n );\n\n useIsomorphicLayoutEffect(() => {\n if (!targetDocument || !listboxRef.current) {\n return;\n }\n\n treeWalkerRef.current = targetDocument.createTreeWalker(listboxRef.current, NodeFilter.SHOW_ELEMENT, optionFilter);\n }, [targetDocument, optionFilter]);\n\n const optionWalker = React.useMemo(\n () => ({\n first: () => {\n if (!treeWalkerRef.current) {\n return null;\n }\n\n return treeWalkerRef.current.firstChild() as HTMLElement | null;\n },\n next: () => {\n if (!treeWalkerRef.current) {\n return null;\n }\n\n return treeWalkerRef.current.nextNode() as HTMLElement | null;\n },\n prev: () => {\n if (!treeWalkerRef.current) {\n return null;\n }\n\n return treeWalkerRef.current.previousNode() as HTMLElement | null;\n },\n setCurrent: (el: HTMLElement) => {\n if (!treeWalkerRef.current) {\n return;\n }\n\n treeWalkerRef.current.currentNode = el;\n },\n }),\n [],\n );\n\n return {\n optionWalker,\n listboxRef,\n };\n}\n"],"names":["React","useFluent_unstable","useFluent","isHTMLElement","useIsomorphicLayoutEffect","useOptionWalker","options","matchOption","targetDocument","treeWalkerRef","useRef","listboxRef","optionFilter","useCallback","node","NodeFilter","FILTER_ACCEPT","FILTER_SKIP","current","createTreeWalker","SHOW_ELEMENT","optionWalker","useMemo","first","firstChild","next","nextNode","prev","previousNode","setCurrent","el","currentNode"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;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2 @@
1
1
  export { useARIAButtonShorthand, useARIAButtonProps } from './button/index';
2
+ export { useActiveDescendant } from './activedescendant';
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["export { useARIAButtonShorthand, useARIAButtonProps } from './button/index';\nexport type {\n ARIAButtonSlotProps,\n ARIAButtonProps,\n ARIAButtonResultProps,\n ARIAButtonType,\n ARIAButtonElement,\n ARIAButtonElementIntersection,\n ARIAButtonAlteredProps,\n} from './button/index';\n"],"names":["useARIAButtonShorthand","useARIAButtonProps"],"mappings":"AAAA,SAASA,sBAAsB,EAAEC,kBAAkB,QAAQ,iBAAiB"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export { useARIAButtonShorthand, useARIAButtonProps } from './button/index';\nexport { useActiveDescendant } from './activedescendant';\nexport type { ActiveDescendantImperativeRef, ActiveDescendantOptions } from './activedescendant';\nexport type {\n ARIAButtonSlotProps,\n ARIAButtonProps,\n ARIAButtonResultProps,\n ARIAButtonType,\n ARIAButtonElement,\n ARIAButtonElementIntersection,\n ARIAButtonAlteredProps,\n} from './button/index';\n"],"names":["useARIAButtonShorthand","useARIAButtonProps","useActiveDescendant"],"mappings":"AAAA,SAASA,sBAAsB,EAAEC,kBAAkB,QAAQ,iBAAiB;AAC5E,SAASC,mBAAmB,QAAQ,qBAAqB"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "ACTIVEDESCENDANT_ATTRIBUTE", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return ACTIVEDESCENDANT_ATTRIBUTE;
9
+ }
10
+ });
11
+ const ACTIVEDESCENDANT_ATTRIBUTE = 'data-activedescendant';
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["constants.js"],"sourcesContent":["export const ACTIVEDESCENDANT_ATTRIBUTE = 'data-activedescendant';\n"],"names":["ACTIVEDESCENDANT_ATTRIBUTE"],"mappings":";;;;+BAAaA;;;eAAAA;;;AAAN,MAAMA,6BAA6B"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ const _export_star = require("@swc/helpers/_/_export_star");
6
+ _export_star._(require("./useActiveDescendant"), exports);
7
+ _export_star._(require("./types"), exports);
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index.js"],"sourcesContent":["export * from './useActiveDescendant';\nexport * from './types';\n"],"names":[],"mappings":";;;;;uBAAc;uBACA"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
6
+ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["types.js"],"sourcesContent":["import * as React from 'react';\n"],"names":[],"mappings":";;;;;iEAAuB"}
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "useActiveDescendant", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return useActiveDescendant;
9
+ }
10
+ });
11
+ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
+ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
+ const _useOptionWalker = require("./useOptionWalker");
14
+ const _constants = require("./constants");
15
+ function useActiveDescendant(options) {
16
+ const { imperativeRef, matchOption } = options;
17
+ const activeParentRef = _react.useRef(null);
18
+ const { listboxRef, optionWalker } = (0, _useOptionWalker.useOptionWalker)({
19
+ matchOption
20
+ });
21
+ const getActiveDescendant = ()=>{
22
+ var _listboxRef_current;
23
+ return (_listboxRef_current = listboxRef.current) === null || _listboxRef_current === void 0 ? void 0 : _listboxRef_current.querySelector(`[${_constants.ACTIVEDESCENDANT_ATTRIBUTE}]`);
24
+ };
25
+ const setActiveDescendant = (nextActive)=>{
26
+ const active = getActiveDescendant();
27
+ if (active) {
28
+ active.removeAttribute(_constants.ACTIVEDESCENDANT_ATTRIBUTE);
29
+ }
30
+ if (nextActive) {
31
+ var _activeParentRef_current;
32
+ nextActive.setAttribute(_constants.ACTIVEDESCENDANT_ATTRIBUTE, '');
33
+ (_activeParentRef_current = activeParentRef.current) === null || _activeParentRef_current === void 0 ? void 0 : _activeParentRef_current.setAttribute('aria-activedescendant', nextActive.id);
34
+ } else {
35
+ var _activeParentRef_current1;
36
+ (_activeParentRef_current1 = activeParentRef.current) === null || _activeParentRef_current1 === void 0 ? void 0 : _activeParentRef_current1.removeAttribute('aria-activedescendant');
37
+ }
38
+ };
39
+ _react.useImperativeHandle(imperativeRef, ()=>({
40
+ first: ()=>{
41
+ if (!listboxRef.current || !activeParentRef.current) {
42
+ return;
43
+ }
44
+ const first = optionWalker.first();
45
+ if (first) {
46
+ setActiveDescendant(first);
47
+ }
48
+ },
49
+ next: ()=>{
50
+ if (!listboxRef.current || !activeParentRef.current) {
51
+ return;
52
+ }
53
+ const active = getActiveDescendant();
54
+ if (!active) {
55
+ return;
56
+ }
57
+ optionWalker.setCurrent(active);
58
+ const next = optionWalker.next();
59
+ if (next) {
60
+ setActiveDescendant(next);
61
+ }
62
+ },
63
+ prev: ()=>{
64
+ if (!listboxRef.current || !activeParentRef.current) {
65
+ return;
66
+ }
67
+ const active = getActiveDescendant();
68
+ if (!active) {
69
+ return;
70
+ }
71
+ optionWalker.setCurrent(active);
72
+ const next = optionWalker.prev();
73
+ if (next && next !== listboxRef.current) {
74
+ setActiveDescendant(next);
75
+ }
76
+ },
77
+ blur: ()=>{
78
+ if (!listboxRef.current || !activeParentRef.current) {
79
+ return;
80
+ }
81
+ setActiveDescendant(undefined);
82
+ },
83
+ active: ()=>{
84
+ if (listboxRef.current) {
85
+ var _getActiveDescendant;
86
+ return (_getActiveDescendant = getActiveDescendant()) === null || _getActiveDescendant === void 0 ? void 0 : _getActiveDescendant.id;
87
+ }
88
+ },
89
+ focus: (id)=>{
90
+ if (!listboxRef.current) {
91
+ return;
92
+ }
93
+ optionWalker.setCurrent(listboxRef.current);
94
+ let cur = optionWalker.next();
95
+ while(cur && cur.id !== id){
96
+ cur = optionWalker.next();
97
+ }
98
+ if (cur) {
99
+ setActiveDescendant(cur);
100
+ }
101
+ }
102
+ }));
103
+ return {
104
+ listboxRef,
105
+ activeParentRef
106
+ };
107
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["useActiveDescendant.js"],"sourcesContent":["import * as React from 'react';\nimport { useOptionWalker } from './useOptionWalker';\nimport { ACTIVEDESCENDANT_ATTRIBUTE } from './constants';\nexport function useActiveDescendant(options) {\n const { imperativeRef, matchOption } = options;\n const activeParentRef = React.useRef(null);\n const { listboxRef, optionWalker } = useOptionWalker({\n matchOption\n });\n const getActiveDescendant = ()=>{\n var _listboxRef_current;\n return (_listboxRef_current = listboxRef.current) === null || _listboxRef_current === void 0 ? void 0 : _listboxRef_current.querySelector(`[${ACTIVEDESCENDANT_ATTRIBUTE}]`);\n };\n const setActiveDescendant = (nextActive)=>{\n const active = getActiveDescendant();\n if (active) {\n active.removeAttribute(ACTIVEDESCENDANT_ATTRIBUTE);\n }\n if (nextActive) {\n var _activeParentRef_current;\n nextActive.setAttribute(ACTIVEDESCENDANT_ATTRIBUTE, '');\n (_activeParentRef_current = activeParentRef.current) === null || _activeParentRef_current === void 0 ? void 0 : _activeParentRef_current.setAttribute('aria-activedescendant', nextActive.id);\n } else {\n var _activeParentRef_current1;\n (_activeParentRef_current1 = activeParentRef.current) === null || _activeParentRef_current1 === void 0 ? void 0 : _activeParentRef_current1.removeAttribute('aria-activedescendant');\n }\n };\n React.useImperativeHandle(imperativeRef, ()=>({\n first: ()=>{\n if (!listboxRef.current || !activeParentRef.current) {\n return;\n }\n const first = optionWalker.first();\n if (first) {\n setActiveDescendant(first);\n }\n },\n next: ()=>{\n if (!listboxRef.current || !activeParentRef.current) {\n return;\n }\n const active = getActiveDescendant();\n if (!active) {\n return;\n }\n optionWalker.setCurrent(active);\n const next = optionWalker.next();\n if (next) {\n setActiveDescendant(next);\n }\n },\n prev: ()=>{\n if (!listboxRef.current || !activeParentRef.current) {\n return;\n }\n const active = getActiveDescendant();\n if (!active) {\n return;\n }\n optionWalker.setCurrent(active);\n const next = optionWalker.prev();\n if (next && next !== listboxRef.current) {\n setActiveDescendant(next);\n }\n },\n blur: ()=>{\n if (!listboxRef.current || !activeParentRef.current) {\n return;\n }\n setActiveDescendant(undefined);\n },\n active: ()=>{\n if (listboxRef.current) {\n var _getActiveDescendant;\n return (_getActiveDescendant = getActiveDescendant()) === null || _getActiveDescendant === void 0 ? void 0 : _getActiveDescendant.id;\n }\n },\n focus: (id)=>{\n if (!listboxRef.current) {\n return;\n }\n optionWalker.setCurrent(listboxRef.current);\n let cur = optionWalker.next();\n while(cur && cur.id !== id){\n cur = optionWalker.next();\n }\n if (cur) {\n setActiveDescendant(cur);\n }\n }\n }));\n return {\n listboxRef,\n activeParentRef\n };\n}\n"],"names":["useActiveDescendant","options","imperativeRef","matchOption","activeParentRef","React","useRef","listboxRef","optionWalker","useOptionWalker","getActiveDescendant","_listboxRef_current","current","querySelector","ACTIVEDESCENDANT_ATTRIBUTE","setActiveDescendant","nextActive","active","removeAttribute","_activeParentRef_current","setAttribute","id","_activeParentRef_current1","useImperativeHandle","first","next","setCurrent","prev","blur","undefined","_getActiveDescendant","focus","cur"],"mappings":";;;;+BAGgBA;;;eAAAA;;;;iEAHO;iCACS;2BACW;AACpC,SAASA,oBAAoBC,OAAO;IACvC,MAAM,EAAEC,aAAa,EAAEC,WAAW,EAAE,GAAGF;IACvC,MAAMG,kBAAkBC,OAAMC,MAAM,CAAC;IACrC,MAAM,EAAEC,UAAU,EAAEC,YAAY,EAAE,GAAGC,IAAAA,gCAAe,EAAC;QACjDN;IACJ;IACA,MAAMO,sBAAsB;QACxB,IAAIC;QACJ,OAAO,AAACA,CAAAA,sBAAsBJ,WAA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AACO,QAAQ;oBACT;gBACJ;gBACAT,aAAakB,UAAU,CAACT;gBACxB,MAAMQ,OAAOjB,aAAamB,IAAI;gBAC9B,IAAIF,QAAQA,SAASlB,WAAWK,OAAO,EAAE;oBACrCG,oBAAoBU;gBACxB;YACJ;YACAG,MAAM;gBACF,IAAI,CAACrB,WAAWK,OAAO,IAAI,CAACR,gBAAgBQ,OAAO,EAAE;oBACjD;gBACJ;gBACAG,oBAAoBc;YACxB;YACAZ,QAAQ;gBACJ,IAAIV,WAAWK,OAAO,EAAE;oBACpB,IAAIkB;oBACJ,OAAO,AAACA,CAAAA,uBAAuBpB,qBAAoB,MAAO,QAAQoB,yBAAyB,KAAK,IAAI,KAAK,IAAIA,qBAAqBT,EAAE;gBACxI;YACJ;YACAU,OAAO,CAACV;gBACJ,IAAI,CAACd,WAAWK,OAAO,EAAE;oBACrB;gBACJ;gBACAJ,aAAakB,UAAU,CAACnB,WAAWK,OAAO;gBAC1C,IAAIoB,MAAMxB,aAAaiB,IAAI;gBAC3B,MAAMO,OAAOA,IAAIX,EAAE,KAAKA,GAAG;oBACvBW,MAAMxB,aAAaiB,IAAI;gBAC3B;gBACA,IAAIO,KAAK;oBACLjB,oBAAoBiB;gBACxB;YACJ;QACJ,CAAA;IACJ,OAAO;QACHzB;QACAH;IACJ;AACJ"}
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "useOptionWalker", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return useOptionWalker;
9
+ }
10
+ });
11
+ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
+ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
+ const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
14
+ const _reactutilities = require("@fluentui/react-utilities");
15
+ function useOptionWalker(options) {
16
+ const { matchOption } = options;
17
+ const { targetDocument } = (0, _reactsharedcontexts.useFluent_unstable)();
18
+ const treeWalkerRef = _react.useRef(null);
19
+ const listboxRef = _react.useRef(null);
20
+ const optionFilter = _react.useCallback((node)=>{
21
+ if ((0, _reactutilities.isHTMLElement)(node) && matchOption(node)) {
22
+ return NodeFilter.FILTER_ACCEPT;
23
+ }
24
+ return NodeFilter.FILTER_SKIP;
25
+ }, [
26
+ matchOption
27
+ ]);
28
+ (0, _reactutilities.useIsomorphicLayoutEffect)(()=>{
29
+ if (!targetDocument || !listboxRef.current) {
30
+ return;
31
+ }
32
+ treeWalkerRef.current = targetDocument.createTreeWalker(listboxRef.current, NodeFilter.SHOW_ELEMENT, optionFilter);
33
+ }, [
34
+ targetDocument,
35
+ optionFilter
36
+ ]);
37
+ const optionWalker = _react.useMemo(()=>({
38
+ first: ()=>{
39
+ if (!treeWalkerRef.current) {
40
+ return null;
41
+ }
42
+ return treeWalkerRef.current.firstChild();
43
+ },
44
+ next: ()=>{
45
+ if (!treeWalkerRef.current) {
46
+ return null;
47
+ }
48
+ return treeWalkerRef.current.nextNode();
49
+ },
50
+ prev: ()=>{
51
+ if (!treeWalkerRef.current) {
52
+ return null;
53
+ }
54
+ return treeWalkerRef.current.previousNode();
55
+ },
56
+ setCurrent: (el)=>{
57
+ if (!treeWalkerRef.current) {
58
+ return;
59
+ }
60
+ treeWalkerRef.current.currentNode = el;
61
+ }
62
+ }), []);
63
+ return {
64
+ optionWalker,
65
+ listboxRef
66
+ };
67
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["useOptionWalker.js"],"sourcesContent":["import * as React from 'react';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { isHTMLElement, useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\nexport function useOptionWalker(options) {\n const { matchOption } = options;\n const { targetDocument } = useFluent();\n const treeWalkerRef = React.useRef(null);\n const listboxRef = React.useRef(null);\n const optionFilter = React.useCallback((node)=>{\n if (isHTMLElement(node) && matchOption(node)) {\n return NodeFilter.FILTER_ACCEPT;\n }\n return NodeFilter.FILTER_SKIP;\n }, [\n matchOption\n ]);\n useIsomorphicLayoutEffect(()=>{\n if (!targetDocument || !listboxRef.current) {\n return;\n }\n treeWalkerRef.current = targetDocument.createTreeWalker(listboxRef.current, NodeFilter.SHOW_ELEMENT, optionFilter);\n }, [\n targetDocument,\n optionFilter\n ]);\n const optionWalker = React.useMemo(()=>({\n first: ()=>{\n if (!treeWalkerRef.current) {\n return null;\n }\n return treeWalkerRef.current.firstChild();\n },\n next: ()=>{\n if (!treeWalkerRef.current) {\n return null;\n }\n return treeWalkerRef.current.nextNode();\n },\n prev: ()=>{\n if (!treeWalkerRef.current) {\n return null;\n }\n return treeWalkerRef.current.previousNode();\n },\n setCurrent: (el)=>{\n if (!treeWalkerRef.current) {\n return;\n }\n treeWalkerRef.current.currentNode = el;\n }\n }), []);\n return {\n optionWalker,\n listboxRef\n };\n}\n"],"names":["useOptionWalker","options","matchOption","targetDocument","useFluent","treeWalkerRef","React","useRef","listboxRef","optionFilter","useCallback","node","isHTMLElement","NodeFilter","FILTER_ACCEPT","FILTER_SKIP","useIsomorphicLayoutEffect","current","createTreeWalker","SHOW_ELEMENT","optionWalker","useMemo","first","firstChild","next","nextNode","prev","previousNode","setCurrent","el","currentNode"],"mappings":";;;;+BAGgBA;;;eAAAA;;;;iEAHO;qCACyB;gCACS;AAClD,SAASA,gBAAgBC,OAAO;IACnC,MAAM,EAAEC,WAAW,EAAE,GAAGD;IACxB,MAAM,EAAEE,cAAc,EAAE,GAAGC,IAAAA,uCAAS;IACpC,MAAMC,gBAAgBC,OAAMC,MAAM,CAAC;IACnC,MAAMC,aAAaF,OAAMC,MAAM,CAAC;IAChC,MAAME,eAAeH,OAAMI,WAAW,CAAC,CAACC;QACpC,IAAIC,IAAAA,6BAAa,EAACD,SAAST,YAAYS,OAAO;YAC1C,OAAOE,WAAWC,aAAa;QACnC;QACA,OAAOD,WAAWE,WAAW;IACjC,GAAG;QACCb;KACH;IACDc,IAAAA,yCAAyB,EAAC;QACtB,IAAI,CAACb,kBAAkB,CAACK,WAAWS,OAAO,EAAE;YACxC;QACJ;QACAZ,cAAcY,OAAO,GAAGd,eAAee,gBAAgB,CAACV,WAAWS,OAAO,EAAEJ,WAAWM,YAAY,EAAEV;IACzG,GAAG;QACCN;QACAM;KACH;IACD,MAAMW,eAAed,OAAMe,OAAO,CAAC,IAAK,CAAA;YAChCC,OAAO;gBACH,IAAI,CAACjB,cAAcY,OAAO,EAAE;oBACxB,OAAO;gBACX;gBACA,OAAOZ,cAAcY,OAAO,CAACM,UAAU;YAC3C;YACAC,MAAM;gBACF,IAAI,CAACnB,cAAcY,OAAO,EAAE;oBACxB,OAAO;gBACX;gBACA,OAAOZ,cAAcY,OAAO,CAACQ,QAAQ;YACzC;YACAC,MAAM;gBACF,IAAI,CAACrB,cAAcY,OAAO,EAAE;oBACxB,OAAO;gBACX;gBACA,OAAOZ,cAAcY,OAAO,CAACU,YAAY;YAC7C;YACAC,YAAY,CAACC;gBACT,IAAI,CAACxB,cAAcY,OAAO,EAAE;oBACxB;gBACJ;gBACAZ,cAAcY,OAAO,CAACa,WAAW,GAAGD;YACxC;QACJ,CAAA,GAAI,EAAE;IACV,OAAO;QACHT;QACAZ;IACJ;AACJ"}
@@ -14,6 +14,10 @@ _export(exports, {
14
14
  },
15
15
  useARIAButtonProps: function() {
16
16
  return _index.useARIAButtonProps;
17
+ },
18
+ useActiveDescendant: function() {
19
+ return _activedescendant.useActiveDescendant;
17
20
  }
18
21
  });
19
22
  const _index = require("./button/index");
23
+ const _activedescendant = require("./activedescendant");
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"sourcesContent":["export { useARIAButtonShorthand, useARIAButtonProps } from './button/index';\n"],"names":["useARIAButtonShorthand","useARIAButtonProps"],"mappings":";;;;;;;;;;;IAASA,sBAAsB;eAAtBA,6BAAsB;;IAAEC,kBAAkB;eAAlBA,yBAAkB;;;uBAAQ"}
1
+ {"version":3,"sources":["index.js"],"sourcesContent":["export { useARIAButtonShorthand, useARIAButtonProps } from './button/index';\nexport { useActiveDescendant } from './activedescendant';\n"],"names":["useARIAButtonShorthand","useARIAButtonProps","useActiveDescendant"],"mappings":";;;;;;;;;;;IAASA,sBAAsB;eAAtBA,6BAAsB;;IAAEC,kBAAkB;eAAlBA,yBAAkB;;IAC1CC,mBAAmB;eAAnBA,qCAAmB;;;uBAD+B;kCACvB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-aria",
3
- "version": "9.3.43",
3
+ "version": "9.4.0",
4
4
  "description": "React helper to ensure ARIA",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -31,8 +31,9 @@
31
31
  "@fluentui/scripts-tasks": "*"
32
32
  },
33
33
  "dependencies": {
34
- "@fluentui/keyboard-keys": "^9.0.6",
35
- "@fluentui/react-utilities": "^9.15.1",
34
+ "@fluentui/keyboard-keys": "^9.0.7",
35
+ "@fluentui/react-shared-contexts": "^9.13.0",
36
+ "@fluentui/react-utilities": "^9.15.2",
36
37
  "@swc/helpers": "^0.5.1"
37
38
  },
38
39
  "peerDependencies": {
@@ -55,5 +56,11 @@
55
56
  "require": "./lib-commonjs/index.js"
56
57
  },
57
58
  "./package.json": "./package.json"
58
- }
59
+ },
60
+ "files": [
61
+ "*.md",
62
+ "dist/*.d.ts",
63
+ "lib",
64
+ "lib-commonjs"
65
+ ]
59
66
  }