@fluentui/react-aria 9.72.9-experimental.component-base-hooks.20260122-49fc330360.0 → 9.74.3-experimental.esm.20260709-49ee7a20cf.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.
Files changed (94) hide show
  1. package/CHANGELOG.md +76 -10
  2. package/dist/index.d.cts +214 -0
  3. package/dist/index.d.ts +1 -2
  4. package/lib/AriaLiveAnnouncer/AriaLiveAnnouncer.js +3 -4
  5. package/lib/AriaLiveAnnouncer/AriaLiveAnnouncer.js.map +1 -1
  6. package/lib/AriaLiveAnnouncer/AriaLiveAnnouncer.types.js +1 -1
  7. package/lib/AriaLiveAnnouncer/AriaLiveAnnouncer.types.js.map +1 -1
  8. package/lib/AriaLiveAnnouncer/index.js +4 -4
  9. package/lib/AriaLiveAnnouncer/index.js.map +1 -1
  10. package/lib/AriaLiveAnnouncer/renderAriaLiveAnnouncer.js +2 -2
  11. package/lib/AriaLiveAnnouncer/useAriaLiveAnnouncer.js +4 -4
  12. package/lib/AriaLiveAnnouncer/useAriaLiveAnnouncer.js.map +1 -1
  13. package/lib/AriaLiveAnnouncer/useAriaLiveAnnouncerContextValues.js +1 -1
  14. package/lib/AriaLiveAnnouncer/useAriaNotifyAnnounce.js +2 -2
  15. package/lib/AriaLiveAnnouncer/useDomAnnounce.js +4 -4
  16. package/lib/activedescendant/ActiveDescendantContext.js +1 -1
  17. package/lib/activedescendant/ActiveDescendantContext.js.map +1 -1
  18. package/lib/activedescendant/index.js +3 -3
  19. package/lib/activedescendant/index.js.map +1 -1
  20. package/lib/activedescendant/types.js +1 -1
  21. package/lib/activedescendant/types.js.map +1 -1
  22. package/lib/activedescendant/useActiveDescendant.js +8 -6
  23. package/lib/activedescendant/useActiveDescendant.js.map +1 -1
  24. package/lib/activedescendant/useOptionWalker.js +3 -3
  25. package/lib/button/index.js +2 -2
  26. package/lib/button/index.js.map +1 -1
  27. package/lib/button/types.js +3 -1
  28. package/lib/button/types.js.map +1 -1
  29. package/lib/button/useARIAButtonProps.js +3 -5
  30. package/lib/button/useARIAButtonProps.js.map +1 -1
  31. package/lib/button/useARIAButtonShorthand.js +2 -2
  32. package/lib/button/useARIAButtonShorthand.js.map +1 -1
  33. package/lib/index.js +4 -4
  34. package/lib/index.js.map +1 -1
  35. package/lib/useTypingAnnounce/index.js +1 -1
  36. package/lib/useTypingAnnounce/index.js.map +1 -1
  37. package/lib/useTypingAnnounce/useTypingAnnounce.js +3 -3
  38. package/lib/useTypingAnnounce/useTypingAnnounce.js.map +1 -1
  39. package/lib-commonjs/AriaLiveAnnouncer/{AriaLiveAnnouncer.js → AriaLiveAnnouncer.cjs} +3 -5
  40. package/lib-commonjs/AriaLiveAnnouncer/AriaLiveAnnouncer.cjs.map +1 -0
  41. package/lib-commonjs/AriaLiveAnnouncer/AriaLiveAnnouncer.types.cjs +4 -0
  42. package/lib-commonjs/AriaLiveAnnouncer/AriaLiveAnnouncer.types.cjs.map +1 -0
  43. package/lib-commonjs/AriaLiveAnnouncer/{index.js → index.cjs} +4 -4
  44. package/lib-commonjs/AriaLiveAnnouncer/{useAriaLiveAnnouncer.js → useAriaLiveAnnouncer.cjs} +2 -2
  45. package/lib-commonjs/activedescendant/ActiveDescendantContext.cjs.map +1 -0
  46. package/lib-commonjs/activedescendant/{index.js → index.cjs} +3 -3
  47. package/lib-commonjs/activedescendant/types.cjs +4 -0
  48. package/lib-commonjs/activedescendant/types.cjs.map +1 -0
  49. package/lib-commonjs/activedescendant/{useActiveDescendant.js → useActiveDescendant.cjs} +5 -3
  50. package/lib-commonjs/activedescendant/useActiveDescendant.cjs.map +1 -0
  51. package/lib-commonjs/button/{index.js → index.cjs} +2 -2
  52. package/lib-commonjs/button/types.cjs +4 -0
  53. package/lib-commonjs/button/types.cjs.map +1 -0
  54. package/lib-commonjs/button/{useARIAButtonProps.js → useARIAButtonProps.cjs} +0 -2
  55. package/lib-commonjs/button/useARIAButtonProps.cjs.map +1 -0
  56. package/lib-commonjs/button/{useARIAButtonShorthand.js → useARIAButtonShorthand.cjs} +1 -1
  57. package/lib-commonjs/{index.js → index.cjs} +4 -4
  58. package/lib-commonjs/useTypingAnnounce/{index.js → index.cjs} +1 -1
  59. package/lib-commonjs/useTypingAnnounce/useTypingAnnounce.cjs.map +1 -0
  60. package/package.json +18 -12
  61. package/lib-commonjs/AriaLiveAnnouncer/AriaLiveAnnouncer.js.map +0 -1
  62. package/lib-commonjs/AriaLiveAnnouncer/AriaLiveAnnouncer.types.js +0 -6
  63. package/lib-commonjs/AriaLiveAnnouncer/AriaLiveAnnouncer.types.js.map +0 -1
  64. package/lib-commonjs/activedescendant/ActiveDescendantContext.js.map +0 -1
  65. package/lib-commonjs/activedescendant/types.js +0 -6
  66. package/lib-commonjs/activedescendant/types.js.map +0 -1
  67. package/lib-commonjs/activedescendant/useActiveDescendant.js.map +0 -1
  68. package/lib-commonjs/button/types.js +0 -6
  69. package/lib-commonjs/button/types.js.map +0 -1
  70. package/lib-commonjs/button/useARIAButtonProps.js.map +0 -1
  71. package/lib-commonjs/useTypingAnnounce/useTypingAnnounce.js.map +0 -1
  72. /package/lib-commonjs/AriaLiveAnnouncer/{index.js.map → index.cjs.map} +0 -0
  73. /package/lib-commonjs/AriaLiveAnnouncer/{renderAriaLiveAnnouncer.js → renderAriaLiveAnnouncer.cjs} +0 -0
  74. /package/lib-commonjs/AriaLiveAnnouncer/{renderAriaLiveAnnouncer.js.map → renderAriaLiveAnnouncer.cjs.map} +0 -0
  75. /package/lib-commonjs/AriaLiveAnnouncer/{useAriaLiveAnnouncer.js.map → useAriaLiveAnnouncer.cjs.map} +0 -0
  76. /package/lib-commonjs/AriaLiveAnnouncer/{useAriaLiveAnnouncerContextValues.js → useAriaLiveAnnouncerContextValues.cjs} +0 -0
  77. /package/lib-commonjs/AriaLiveAnnouncer/{useAriaLiveAnnouncerContextValues.js.map → useAriaLiveAnnouncerContextValues.cjs.map} +0 -0
  78. /package/lib-commonjs/AriaLiveAnnouncer/{useAriaNotifyAnnounce.js → useAriaNotifyAnnounce.cjs} +0 -0
  79. /package/lib-commonjs/AriaLiveAnnouncer/{useAriaNotifyAnnounce.js.map → useAriaNotifyAnnounce.cjs.map} +0 -0
  80. /package/lib-commonjs/AriaLiveAnnouncer/{useDomAnnounce.js → useDomAnnounce.cjs} +0 -0
  81. /package/lib-commonjs/AriaLiveAnnouncer/{useDomAnnounce.js.map → useDomAnnounce.cjs.map} +0 -0
  82. /package/lib-commonjs/activedescendant/{ActiveDescendantContext.js → ActiveDescendantContext.cjs} +0 -0
  83. /package/lib-commonjs/activedescendant/{constants.js → constants.cjs} +0 -0
  84. /package/lib-commonjs/activedescendant/{constants.js.map → constants.cjs.map} +0 -0
  85. /package/lib-commonjs/activedescendant/{index.js.map → index.cjs.map} +0 -0
  86. /package/lib-commonjs/activedescendant/{scrollIntoView.js → scrollIntoView.cjs} +0 -0
  87. /package/lib-commonjs/activedescendant/{scrollIntoView.js.map → scrollIntoView.cjs.map} +0 -0
  88. /package/lib-commonjs/activedescendant/{useOptionWalker.js → useOptionWalker.cjs} +0 -0
  89. /package/lib-commonjs/activedescendant/{useOptionWalker.js.map → useOptionWalker.cjs.map} +0 -0
  90. /package/lib-commonjs/button/{index.js.map → index.cjs.map} +0 -0
  91. /package/lib-commonjs/button/{useARIAButtonShorthand.js.map → useARIAButtonShorthand.cjs.map} +0 -0
  92. /package/lib-commonjs/{index.js.map → index.cjs.map} +0 -0
  93. /package/lib-commonjs/useTypingAnnounce/{index.js.map → index.cjs.map} +0 -0
  94. /package/lib-commonjs/useTypingAnnounce/{useTypingAnnounce.js → useTypingAnnounce.cjs} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,22 +1,88 @@
1
1
  # Change Log - @fluentui/react-aria
2
2
 
3
- This log was last generated on Thu, 22 Jan 2026 16:12:55 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 09 Jul 2026 17:34:00 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [9.72.9-experimental.component-base-hooks.20260122-49fc330360.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-aria_v9.72.9-experimental.component-base-hooks.20260122-49fc330360.0)
7
+ ## [9.74.3-experimental.esm.20260709-49ee7a20cf.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-aria_v9.74.3-experimental.esm.20260709-49ee7a20cf.0)
8
8
 
9
- Thu, 22 Jan 2026 16:12:55 GMT
10
- [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-aria_v9.17.7..@fluentui/react-aria_v9.72.9-experimental.component-base-hooks.20260122-49fc330360.0)
9
+ Thu, 09 Jul 2026 17:34:00 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-aria_v9.17.13..@fluentui/react-aria_v9.74.3-experimental.esm.20260709-49ee7a20cf.0)
11
11
 
12
12
  ### Changes
13
13
 
14
- - Release 9.72.9-experimental.component-base-hooks.20260122-49fc330360 ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
15
- - Bump @fluentui/keyboard-keys to v9.72.9-experimental.component-base-hooks.20260122-49fc330360.0 ([commit](https://github.com/microsoft/fluentui/commit/373001c3e19d022ef1fcf745ea96375cf4f3aff1) by beachball)
16
- - Bump @fluentui/react-shared-contexts to v9.72.9-experimental.component-base-hooks.20260122-49fc330360.0 ([commit](https://github.com/microsoft/fluentui/commit/373001c3e19d022ef1fcf745ea96375cf4f3aff1) by beachball)
17
- - Bump @fluentui/react-jsx-runtime to v9.72.9-experimental.component-base-hooks.20260122-49fc330360.0 ([commit](https://github.com/microsoft/fluentui/commit/373001c3e19d022ef1fcf745ea96375cf4f3aff1) by beachball)
18
- - Bump @fluentui/react-tabster to v9.72.9-experimental.component-base-hooks.20260122-49fc330360.0 ([commit](https://github.com/microsoft/fluentui/commit/373001c3e19d022ef1fcf745ea96375cf4f3aff1) by beachball)
19
- - Bump @fluentui/react-utilities to v9.72.9-experimental.component-base-hooks.20260122-49fc330360.0 ([commit](https://github.com/microsoft/fluentui/commit/373001c3e19d022ef1fcf745ea96375cf4f3aff1) by beachball)
14
+ - Release 9.74.3-experimental.esm.20260709-49ee7a20cf ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
15
+ - Bump @fluentui/keyboard-keys to v9.74.3-experimental.esm.20260709-49ee7a20cf.0 ([commit](https://github.com/microsoft/fluentui/commit/175a26e0c520dd90a54578d1185a3b0b6c446e15) by beachball)
16
+ - Bump @fluentui/react-shared-contexts to v9.74.3-experimental.esm.20260709-49ee7a20cf.0 ([commit](https://github.com/microsoft/fluentui/commit/175a26e0c520dd90a54578d1185a3b0b6c446e15) by beachball)
17
+ - Bump @fluentui/react-jsx-runtime to v9.74.3-experimental.esm.20260709-49ee7a20cf.0 ([commit](https://github.com/microsoft/fluentui/commit/175a26e0c520dd90a54578d1185a3b0b6c446e15) by beachball)
18
+ - Bump @fluentui/react-tabster to v9.74.3-experimental.esm.20260709-49ee7a20cf.0 ([commit](https://github.com/microsoft/fluentui/commit/175a26e0c520dd90a54578d1185a3b0b6c446e15) by beachball)
19
+ - Bump @fluentui/react-utilities to v9.74.3-experimental.esm.20260709-49ee7a20cf.0 ([commit](https://github.com/microsoft/fluentui/commit/175a26e0c520dd90a54578d1185a3b0b6c446e15) by beachball)
20
+
21
+ ## [9.17.13](https://github.com/microsoft/fluentui/tree/@fluentui/react-aria_v9.17.13)
22
+
23
+ Wed, 24 Jun 2026 11:10:10 GMT
24
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-aria_v9.17.12..@fluentui/react-aria_v9.17.13)
25
+
26
+ ### Patches
27
+
28
+ - Bump @fluentui/react-jsx-runtime to v9.4.4 ([commit](https://github.com/microsoft/fluentui/commit/a4b871ca80c1f16f35ab4229def4fe02be7f30ea) by beachball)
29
+ - Bump @fluentui/react-tabster to v9.26.16 ([commit](https://github.com/microsoft/fluentui/commit/a4b871ca80c1f16f35ab4229def4fe02be7f30ea) by beachball)
30
+ - Bump @fluentui/react-utilities to v9.26.5 ([commit](https://github.com/microsoft/fluentui/commit/a4b871ca80c1f16f35ab4229def4fe02be7f30ea) by beachball)
31
+
32
+ ## [9.17.12](https://github.com/microsoft/fluentui/tree/@fluentui/react-aria_v9.17.12)
33
+
34
+ Tue, 26 May 2026 09:39:43 GMT
35
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-aria_v9.17.11..@fluentui/react-aria_v9.17.12)
36
+
37
+ ### Patches
38
+
39
+ - Bump @fluentui/react-jsx-runtime to v9.4.3 ([PR #36246](https://github.com/microsoft/fluentui/pull/36246) by beachball)
40
+ - Bump @fluentui/react-tabster to v9.26.15 ([PR #36246](https://github.com/microsoft/fluentui/pull/36246) by beachball)
41
+ - Bump @fluentui/react-utilities to v9.26.4 ([PR #36246](https://github.com/microsoft/fluentui/pull/36246) by beachball)
42
+
43
+ ## [9.17.11](https://github.com/microsoft/fluentui/tree/@fluentui/react-aria_v9.17.11)
44
+
45
+ Thu, 23 Apr 2026 14:21:17 GMT
46
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-aria_v9.17.10..@fluentui/react-aria_v9.17.11)
47
+
48
+ ### Patches
49
+
50
+ - Bump @fluentui/react-jsx-runtime to v9.4.2 ([PR #36035](https://github.com/microsoft/fluentui/pull/36035) by beachball)
51
+ - Bump @fluentui/react-tabster to v9.26.14 ([PR #36035](https://github.com/microsoft/fluentui/pull/36035) by beachball)
52
+ - Bump @fluentui/react-utilities to v9.26.3 ([PR #36035](https://github.com/microsoft/fluentui/pull/36035) by beachball)
53
+
54
+ ## [9.17.10](https://github.com/microsoft/fluentui/tree/@fluentui/react-aria_v9.17.10)
55
+
56
+ Wed, 25 Feb 2026 13:32:28 GMT
57
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-aria_v9.17.9..@fluentui/react-aria_v9.17.10)
58
+
59
+ ### Patches
60
+
61
+ - Bump @fluentui/react-shared-contexts to v9.26.2 ([PR #35782](https://github.com/microsoft/fluentui/pull/35782) by beachball)
62
+ - Bump @fluentui/react-jsx-runtime to v9.4.1 ([PR #35782](https://github.com/microsoft/fluentui/pull/35782) by beachball)
63
+ - Bump @fluentui/react-tabster to v9.26.13 ([PR #35782](https://github.com/microsoft/fluentui/pull/35782) by beachball)
64
+ - Bump @fluentui/react-utilities to v9.26.2 ([PR #35782](https://github.com/microsoft/fluentui/pull/35782) by beachball)
65
+
66
+ ## [9.17.9](https://github.com/microsoft/fluentui/tree/@fluentui/react-aria_v9.17.9)
67
+
68
+ Thu, 12 Feb 2026 10:46:15 GMT
69
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-aria_v9.17.8..@fluentui/react-aria_v9.17.9)
70
+
71
+ ### Patches
72
+
73
+ - Bump @fluentui/react-jsx-runtime to v9.4.0 ([PR #35743](https://github.com/microsoft/fluentui/pull/35743) by beachball)
74
+
75
+ ## [9.17.8](https://github.com/microsoft/fluentui/tree/@fluentui/react-aria_v9.17.8)
76
+
77
+ Thu, 22 Jan 2026 17:07:01 GMT
78
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-aria_v9.17.7..@fluentui/react-aria_v9.17.8)
79
+
80
+ ### Patches
81
+
82
+ - Bump @fluentui/react-shared-contexts to v9.26.1 ([PR #35574](https://github.com/microsoft/fluentui/pull/35574) by beachball)
83
+ - Bump @fluentui/react-jsx-runtime to v9.3.5 ([PR #35574](https://github.com/microsoft/fluentui/pull/35574) by beachball)
84
+ - Bump @fluentui/react-tabster to v9.26.12 ([PR #35574](https://github.com/microsoft/fluentui/pull/35574) by beachball)
85
+ - Bump @fluentui/react-utilities to v9.26.1 ([PR #35574](https://github.com/microsoft/fluentui/pull/35574) by beachball)
20
86
 
21
87
  ## [9.17.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-aria_v9.17.7)
22
88
 
@@ -0,0 +1,214 @@
1
+ import type { AnnounceContextValue } from '@fluentui/react-shared-contexts';
2
+ import type { DistributiveOmit } from '@fluentui/react-utilities';
3
+ import type { ExtractSlotProps } from '@fluentui/react-utilities';
4
+ import type { JSXElement } from '@fluentui/react-utilities';
5
+ import type { JSXIntrinsicElement } from '@fluentui/react-utilities';
6
+ import * as React_2 from 'react';
7
+ import type { ResolveShorthandFunction } from '@fluentui/react-utilities';
8
+ import type { Slot } from '@fluentui/react-utilities';
9
+ import type { UnionToIntersection } from '@fluentui/react-utilities';
10
+
11
+ /**
12
+ * Applied to the active descendant when the user is navigating with keyboard
13
+ */
14
+ export declare const ACTIVEDESCENDANT_FOCUSVISIBLE_ATTRIBUTE = "data-activedescendant-focusvisible";
15
+
16
+ export declare type ActiveDescendantChangeEvent = CustomEvent<ActiveDescendantChangeEventDetail>;
17
+
18
+ declare interface ActiveDescendantChangeEventDetail {
19
+ id: string;
20
+ previousId: string | null;
21
+ }
22
+
23
+ export declare const ActiveDescendantContextProvider: React_2.Provider<ActiveDescendantContextValue | undefined>;
24
+
25
+ export declare type ActiveDescendantContextValue = {
26
+ controller: ActiveDescendantImperativeRef;
27
+ };
28
+
29
+ export declare interface ActiveDescendantImperativeRef {
30
+ first: (options?: IteratorOptions) => string | undefined;
31
+ last: (options?: IteratorOptions) => string | undefined;
32
+ next: (options?: IteratorOptions) => string | undefined;
33
+ prev: (options?: IteratorOptions) => string | undefined;
34
+ find: (predicate: (id: string) => boolean, options?: IteratorOptions & FindOptions) => string | undefined;
35
+ blur: () => void;
36
+ active: () => string | undefined;
37
+ focus: (id: string) => void;
38
+ /**
39
+ * @deprecated This function is not used internally anymore and will be removed in the future
40
+ */
41
+ focusLastActive: () => void;
42
+ /**
43
+ * Scrolls the active option into view, if it still exists
44
+ */
45
+ scrollActiveIntoView: () => void;
46
+ hideAttributes: () => void;
47
+ showAttributes: () => void;
48
+ hideFocusVisibleAttributes: () => void;
49
+ showFocusVisibleAttributes: () => void;
50
+ }
51
+
52
+ export declare interface ActiveDescendantOptions {
53
+ /**
54
+ * @param el - HTML element to test
55
+ * @returns whether the element can be an active descendant
56
+ */
57
+ matchOption: (el: HTMLElement) => boolean;
58
+ /**
59
+ * Forward imperative refs when exposing functionality from a React component
60
+ */
61
+ imperativeRef?: React_2.RefObject<ActiveDescendantImperativeRef | null>;
62
+ }
63
+
64
+ /**
65
+ * Props that will be modified internally by `useARIAButtonProps` by each case.
66
+ * This typing is to ensure a well specified return value for `useARIAbButtonProps`
67
+ */
68
+ export declare type ARIAButtonAlteredProps<Type extends ARIAButtonType> = (Type extends 'button' ? Pick<JSXIntrinsicElement<'button'>, 'onClick' | 'onKeyDown' | 'onKeyUp' | 'disabled' | 'aria-disabled' | 'tabIndex'> : never) | (Type extends 'a' ? Pick<JSXIntrinsicElement<'a'>, 'onClick' | 'onKeyDown' | 'onKeyUp' | 'aria-disabled' | 'tabIndex' | 'role' | 'href'> : never) | (Type extends 'div' ? Pick<JSXIntrinsicElement<'div'>, 'onClick' | 'onKeyDown' | 'onKeyUp' | 'aria-disabled' | 'tabIndex' | 'role'> : never);
69
+
70
+ export declare type ARIAButtonElement<AlternateAs extends 'a' | 'div' = 'a' | 'div'> = HTMLButtonElement | (AlternateAs extends 'a' ? HTMLAnchorElement : never) | (AlternateAs extends 'div' ? HTMLDivElement : never);
71
+
72
+ /**
73
+ * @internal
74
+ */
75
+ export declare type ARIAButtonElementIntersection<AlternateAs extends 'a' | 'div' = 'a' | 'div'> = UnionToIntersection<ARIAButtonElement<AlternateAs>>;
76
+
77
+ /**
78
+ * Props expected by `useARIAButtonProps` hooks
79
+ */
80
+ export declare type ARIAButtonProps<Type extends ARIAButtonType = ARIAButtonType> = DistributiveOmit<React_2.PropsWithRef<JSXIntrinsicElement<Type>>, 'children'> & {
81
+ disabled?: boolean;
82
+ /**
83
+ * When set, allows the button to be focusable even when it has been disabled.
84
+ * This is used in scenarios where it is important to keep a consistent tab order
85
+ * for screen reader and keyboard users. The primary example of this
86
+ * pattern is when the disabled button is in a menu or a commandbar and is seldom used for standalone buttons.
87
+ *
88
+ * @default false
89
+ */
90
+ disabledFocusable?: boolean;
91
+ };
92
+
93
+ /**
94
+ * Merge of props provided by the user and props provided internally.
95
+ */
96
+ export declare type ARIAButtonResultProps<Type extends ARIAButtonType, Props> = Props & UnionToIntersection<ARIAButtonAlteredProps<Type>>;
97
+
98
+ export declare type ARIAButtonSlotProps<AlternateAs extends 'a' | 'div' = 'a' | 'div'> = ExtractSlotProps<Slot<'button', AlternateAs>> & Pick<ARIAButtonProps<ARIAButtonType>, 'disabled' | 'disabledFocusable'>;
99
+
100
+ export declare type ARIAButtonType = 'button' | 'a' | 'div';
101
+
102
+ declare type AriaLiveAnnounceFn = AnnounceContextValue['announce'];
103
+
104
+ /**
105
+ * A sample implementation of a component that manages aria live announcements.
106
+ */
107
+ export declare const AriaLiveAnnouncer: React_2.FC<AriaLiveAnnouncerProps>;
108
+
109
+ declare type AriaLiveAnnouncerContextValues = {
110
+ announce: {
111
+ announce: AriaLiveAnnounceFn;
112
+ };
113
+ };
114
+
115
+ export declare type AriaLiveAnnouncerProps = {
116
+ children?: React_2.ReactNode;
117
+ };
118
+
119
+ export declare type AriaLiveAnnouncerState = {
120
+ announce: AriaLiveAnnounceFn;
121
+ children?: React_2.ReactNode;
122
+ };
123
+
124
+ declare interface FindOptions {
125
+ /**
126
+ * Starts the search from a specific id
127
+ */
128
+ startFrom?: string;
129
+ }
130
+
131
+ declare interface IteratorOptions {
132
+ /**
133
+ * When passive, the active descendant is changed
134
+ * @default false
135
+ */
136
+ passive?: boolean;
137
+ }
138
+
139
+ export declare const renderAriaLiveAnnouncer_unstable: (state: AriaLiveAnnouncerState, contextValues: AriaLiveAnnouncerContextValues) => JSXElement;
140
+
141
+ declare interface TypingAnnounceReturn<TInputElement extends HTMLElement = HTMLElement> {
142
+ typingAnnounce: AriaLiveAnnounceFn;
143
+ inputRef: React_2.MutableRefObject<TInputElement | null>;
144
+ }
145
+
146
+ export declare function useActiveDescendant<TActiveParentElement extends HTMLElement, TListboxElement extends HTMLElement>(options: ActiveDescendantOptions): UseActiveDescendantReturn<TActiveParentElement, TListboxElement>;
147
+
148
+ export declare const useActiveDescendantContext: () => ActiveDescendantContextValue;
149
+
150
+ declare interface UseActiveDescendantReturn<TActiveParentElement extends HTMLElement = HTMLElement, TListboxElement extends HTMLElement = HTMLElement> {
151
+ /**
152
+ * Attach this to the element that contains all active descendants
153
+ */
154
+ listboxRef: React_2.Ref<TListboxElement>;
155
+ /**
156
+ * Attach this to the element that has an active descendant
157
+ */
158
+ activeParentRef: React_2.Ref<TActiveParentElement>;
159
+ /**
160
+ * Imperative functions to manage active descendants within the listboxRef
161
+ */
162
+ controller: ActiveDescendantImperativeRef;
163
+ }
164
+
165
+ /**
166
+ * Button keyboard handling, role, disabled and tabIndex implementation that ensures ARIA spec
167
+ * for multiple scenarios of non native button elements. Ensuring 1st rule of ARIA for cases
168
+ * where no attribute addition is required.
169
+ *
170
+ * @internal
171
+ * @param type - the proper scenario to be interpreted by the hook.
172
+ * 1. `button` - Minimal interference from the hook, as semantic button already supports most of the states
173
+ * 2. `a` or `div` - Proper keyboard/mouse handling plus other support to ensure ARIA behavior
174
+ * @param props - the props to be passed down the line to the desired element.
175
+ * This hook will encapsulate proper properties, such as `onClick`, `onKeyDown`, `onKeyUp`, etc,.
176
+ *
177
+ * @example
178
+ * ```tsx
179
+ * const buttonProps = useARIAButtonProps('a', {
180
+ * href: './some-route'
181
+ * onClick: () => console.log('this should run both on click and Space and Enter')
182
+ * })
183
+ *
184
+ * // ...
185
+ *
186
+ * return (
187
+ * <a {...buttonProps}>This anchor will behave as a proper button</a>
188
+ * )
189
+ * ```
190
+ */
191
+ export declare function useARIAButtonProps<Type extends ARIAButtonType, Props extends ARIAButtonProps<Type>>(type?: Type, props?: Props): ARIAButtonResultProps<Type, Props>;
192
+
193
+ /**
194
+ * @internal
195
+ *
196
+ * @deprecated use useARIAButtonProps instead
197
+ *
198
+ * This function expects to receive a slot, if `as` property is not desired use `useARIAButtonProps` instead
199
+ *
200
+ * Button keyboard handling, role, disabled and tabIndex implementation that ensures ARIA spec
201
+ * for multiple scenarios of shorthand properties. Ensuring 1st rule of ARIA for cases
202
+ * where no attribute addition is required.
203
+ */
204
+ export declare const useARIAButtonShorthand: ResolveShorthandFunction<ARIAButtonSlotProps>;
205
+
206
+ export declare const useAriaLiveAnnouncer_unstable: (props: AriaLiveAnnouncerProps) => AriaLiveAnnouncerState;
207
+
208
+ export declare function useAriaLiveAnnouncerContextValues_unstable(state: AriaLiveAnnouncerState): AriaLiveAnnouncerContextValues;
209
+
210
+ export declare const useHasParentActiveDescendantContext: () => boolean;
211
+
212
+ export declare function useTypingAnnounce<TInputElement extends HTMLElement = HTMLElement>(): TypingAnnounceReturn<TInputElement>;
213
+
214
+ export { }
package/dist/index.d.ts CHANGED
@@ -163,12 +163,11 @@ declare interface UseActiveDescendantReturn<TActiveParentElement extends HTMLEle
163
163
  }
164
164
 
165
165
  /**
166
- * @internal
167
- *
168
166
  * Button keyboard handling, role, disabled and tabIndex implementation that ensures ARIA spec
169
167
  * for multiple scenarios of non native button elements. Ensuring 1st rule of ARIA for cases
170
168
  * where no attribute addition is required.
171
169
  *
170
+ * @internal
172
171
  * @param type - the proper scenario to be interpreted by the hook.
173
172
  * 1. `button` - Minimal interference from the hook, as semantic button already supports most of the states
174
173
  * 2. `a` or `div` - Proper keyboard/mouse handling plus other support to ensure ARIA behavior
@@ -1,8 +1,7 @@
1
1
  'use client';
2
- import * as React from 'react';
3
- import { renderAriaLiveAnnouncer_unstable } from './renderAriaLiveAnnouncer';
4
- import { useAriaLiveAnnouncer_unstable } from './useAriaLiveAnnouncer';
5
- import { useAriaLiveAnnouncerContextValues_unstable } from './useAriaLiveAnnouncerContextValues';
2
+ import { renderAriaLiveAnnouncer_unstable } from "./renderAriaLiveAnnouncer.js";
3
+ import { useAriaLiveAnnouncer_unstable } from "./useAriaLiveAnnouncer.js";
4
+ import { useAriaLiveAnnouncerContextValues_unstable } from "./useAriaLiveAnnouncerContextValues.js";
6
5
  /**
7
6
  * A sample implementation of a component that manages aria live announcements.
8
7
  */ export const AriaLiveAnnouncer = (props)=>{
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/AriaLiveAnnouncer/AriaLiveAnnouncer.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport type { AriaLiveAnnouncerProps } from './AriaLiveAnnouncer.types';\nimport { renderAriaLiveAnnouncer_unstable } from './renderAriaLiveAnnouncer';\nimport { useAriaLiveAnnouncer_unstable } from './useAriaLiveAnnouncer';\nimport { useAriaLiveAnnouncerContextValues_unstable } from './useAriaLiveAnnouncerContextValues';\n\n/**\n * A sample implementation of a component that manages aria live announcements.\n */\nexport const AriaLiveAnnouncer: React.FC<AriaLiveAnnouncerProps> = props => {\n const state = useAriaLiveAnnouncer_unstable(props);\n const contextValues = useAriaLiveAnnouncerContextValues_unstable(state);\n\n return renderAriaLiveAnnouncer_unstable(state, contextValues);\n};\n\nAriaLiveAnnouncer.displayName = 'AriaLiveAnnouncer';\n"],"names":["React","renderAriaLiveAnnouncer_unstable","useAriaLiveAnnouncer_unstable","useAriaLiveAnnouncerContextValues_unstable","AriaLiveAnnouncer","props","state","contextValues","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAG/B,SAASC,gCAAgC,QAAQ,4BAA4B;AAC7E,SAASC,6BAA6B,QAAQ,yBAAyB;AACvE,SAASC,0CAA0C,QAAQ,sCAAsC;AAEjG;;CAEC,GACD,OAAO,MAAMC,oBAAsDC,CAAAA;IACjE,MAAMC,QAAQJ,8BAA8BG;IAC5C,MAAME,gBAAgBJ,2CAA2CG;IAEjE,OAAOL,iCAAiCK,OAAOC;AACjD,EAAE;AAEFH,kBAAkBI,WAAW,GAAG"}
1
+ {"version":3,"sources":["../src/AriaLiveAnnouncer/AriaLiveAnnouncer.tsx"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\n\nimport type { AriaLiveAnnouncerProps } from './AriaLiveAnnouncer.types';\nimport { renderAriaLiveAnnouncer_unstable } from './renderAriaLiveAnnouncer';\nimport { useAriaLiveAnnouncer_unstable } from './useAriaLiveAnnouncer';\nimport { useAriaLiveAnnouncerContextValues_unstable } from './useAriaLiveAnnouncerContextValues';\n\n/**\n * A sample implementation of a component that manages aria live announcements.\n */\nexport const AriaLiveAnnouncer: React.FC<AriaLiveAnnouncerProps> = props => {\n const state = useAriaLiveAnnouncer_unstable(props);\n const contextValues = useAriaLiveAnnouncerContextValues_unstable(state);\n\n return renderAriaLiveAnnouncer_unstable(state, contextValues);\n};\n\nAriaLiveAnnouncer.displayName = 'AriaLiveAnnouncer';\n"],"names":["renderAriaLiveAnnouncer_unstable","useAriaLiveAnnouncer_unstable","useAriaLiveAnnouncerContextValues_unstable","AriaLiveAnnouncer","props","state","contextValues","displayName"],"mappings":"AAAA;AAKA,SAASA,gCAAgC,QAAQ,+BAA4B;AAC7E,SAASC,6BAA6B,QAAQ,4BAAyB;AACvE,SAASC,0CAA0C,QAAQ,yCAAsC;AAEjG;;CAEC,GACD,OAAO,MAAMC,oBAAsDC,CAAAA;IACjE,MAAMC,QAAQJ,8BAA8BG;IAC5C,MAAME,gBAAgBJ,2CAA2CG;IAEjE,OAAOL,iCAAiCK,OAAOC;AACjD,EAAE;AAEFH,kBAAkBI,WAAW,GAAG"}
@@ -1 +1 @@
1
- import * as React from 'react';
1
+ export { };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/AriaLiveAnnouncer/AriaLiveAnnouncer.types.ts"],"sourcesContent":["import type { AnnounceContextValue } from '@fluentui/react-shared-contexts';\nimport * as React from 'react';\n\nexport type AriaLiveAnnounceFn = AnnounceContextValue['announce'];\n\nexport type AriaLiveMessage = {\n message: string;\n\n createdAt: number;\n\n priority: number;\n batchId?: string;\n};\n\nexport type AriaLiveAnnouncerProps = {\n children?: React.ReactNode;\n};\n\nexport type AriaLiveAnnouncerState = {\n announce: AriaLiveAnnounceFn;\n children?: React.ReactNode;\n};\n\nexport type AriaLiveAnnouncerContextValues = {\n announce: { announce: AriaLiveAnnounceFn };\n};\n"],"names":["React"],"mappings":"AACA,YAAYA,WAAW,QAAQ"}
1
+ {"version":3,"sources":["../src/AriaLiveAnnouncer/AriaLiveAnnouncer.types.ts"],"sourcesContent":["import type { AnnounceContextValue } from '@fluentui/react-shared-contexts';\nimport type * as React from 'react';\n\nexport type AriaLiveAnnounceFn = AnnounceContextValue['announce'];\n\nexport type AriaLiveMessage = {\n message: string;\n\n createdAt: number;\n\n priority: number;\n batchId?: string;\n};\n\nexport type AriaLiveAnnouncerProps = {\n children?: React.ReactNode;\n};\n\nexport type AriaLiveAnnouncerState = {\n announce: AriaLiveAnnounceFn;\n children?: React.ReactNode;\n};\n\nexport type AriaLiveAnnouncerContextValues = {\n announce: { announce: AriaLiveAnnounceFn };\n};\n"],"names":[],"mappings":"AAuBA,WAEE"}
@@ -1,4 +1,4 @@
1
- export { AriaLiveAnnouncer } from './AriaLiveAnnouncer';
2
- export { renderAriaLiveAnnouncer_unstable } from './renderAriaLiveAnnouncer';
3
- export { useAriaLiveAnnouncer_unstable } from './useAriaLiveAnnouncer';
4
- export { useAriaLiveAnnouncerContextValues_unstable } from './useAriaLiveAnnouncerContextValues';
1
+ export { AriaLiveAnnouncer } from "./AriaLiveAnnouncer.js";
2
+ export { renderAriaLiveAnnouncer_unstable } from "./renderAriaLiveAnnouncer.js";
3
+ export { useAriaLiveAnnouncer_unstable } from "./useAriaLiveAnnouncer.js";
4
+ export { useAriaLiveAnnouncerContextValues_unstable } from "./useAriaLiveAnnouncerContextValues.js";
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/AriaLiveAnnouncer/index.ts"],"sourcesContent":["export { AriaLiveAnnouncer } from './AriaLiveAnnouncer';\nexport type { AriaLiveAnnouncerProps, AriaLiveAnnouncerState } from './AriaLiveAnnouncer.types';\nexport { renderAriaLiveAnnouncer_unstable } from './renderAriaLiveAnnouncer';\nexport { useAriaLiveAnnouncer_unstable } from './useAriaLiveAnnouncer';\nexport { useAriaLiveAnnouncerContextValues_unstable } from './useAriaLiveAnnouncerContextValues';\n"],"names":["AriaLiveAnnouncer","renderAriaLiveAnnouncer_unstable","useAriaLiveAnnouncer_unstable","useAriaLiveAnnouncerContextValues_unstable"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,sBAAsB;AAExD,SAASC,gCAAgC,QAAQ,4BAA4B;AAC7E,SAASC,6BAA6B,QAAQ,yBAAyB;AACvE,SAASC,0CAA0C,QAAQ,sCAAsC"}
1
+ {"version":3,"sources":["../src/AriaLiveAnnouncer/index.ts"],"sourcesContent":["export { AriaLiveAnnouncer } from './AriaLiveAnnouncer';\nexport type { AriaLiveAnnouncerProps, AriaLiveAnnouncerState } from './AriaLiveAnnouncer.types';\nexport { renderAriaLiveAnnouncer_unstable } from './renderAriaLiveAnnouncer';\nexport { useAriaLiveAnnouncer_unstable } from './useAriaLiveAnnouncer';\nexport { useAriaLiveAnnouncerContextValues_unstable } from './useAriaLiveAnnouncerContextValues';\n"],"names":["AriaLiveAnnouncer","renderAriaLiveAnnouncer_unstable","useAriaLiveAnnouncer_unstable","useAriaLiveAnnouncerContextValues_unstable"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,yBAAsB;AAExD,SAASC,gCAAgC,QAAQ,+BAA4B;AAC7E,SAASC,6BAA6B,QAAQ,4BAAyB;AACvE,SAASC,0CAA0C,QAAQ,yCAAsC"}
@@ -1,5 +1,5 @@
1
- import * as React from 'react';
2
- import { AnnounceProvider } from '@fluentui/react-shared-contexts';
1
+ import * as React from "react";
2
+ import { AnnounceProvider } from "@fluentui/react-shared-contexts";
3
3
  export const renderAriaLiveAnnouncer_unstable = (state, contextValues)=>{
4
4
  return /*#__PURE__*/ React.createElement(AnnounceProvider, {
5
5
  value: contextValues.announce
@@ -1,8 +1,8 @@
1
1
  'use client';
2
- import * as React from 'react';
3
- import { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';
4
- import { useDomAnnounce_unstable } from './useDomAnnounce';
5
- import { useAriaNotifyAnnounce_unstable } from './useAriaNotifyAnnounce';
2
+ import * as React from "react";
3
+ import { useFluent_unstable as useFluent } from "@fluentui/react-shared-contexts";
4
+ import { useDomAnnounce_unstable } from "./useDomAnnounce.js";
5
+ import { useAriaNotifyAnnounce_unstable } from "./useAriaNotifyAnnounce.js";
6
6
  export const useAriaLiveAnnouncer_unstable = (props)=>{
7
7
  const { targetDocument } = useFluent();
8
8
  const domAnnounce = useDomAnnounce_unstable();
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/AriaLiveAnnouncer/useAriaLiveAnnouncer.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useDomAnnounce_unstable } from './useDomAnnounce';\nimport { useAriaNotifyAnnounce_unstable } from './useAriaNotifyAnnounce';\n\nimport type { AriaLiveAnnouncerState, AriaLiveAnnouncerProps } from './AriaLiveAnnouncer.types';\n\nexport const useAriaLiveAnnouncer_unstable = (props: AriaLiveAnnouncerProps): AriaLiveAnnouncerState => {\n const { targetDocument } = useFluent();\n const domAnnounce = useDomAnnounce_unstable();\n const ariaNotifyAnnounce = useAriaNotifyAnnounce_unstable();\n\n const announce = React.useMemo(() => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const supportsAriaNotify = typeof (targetDocument as any)?.ariaNotify === 'function';\n return supportsAriaNotify ? ariaNotifyAnnounce : domAnnounce;\n }, [targetDocument, ariaNotifyAnnounce, domAnnounce]);\n\n return {\n announce,\n children: props.children,\n };\n};\n"],"names":["React","useFluent_unstable","useFluent","useDomAnnounce_unstable","useAriaNotifyAnnounce_unstable","useAriaLiveAnnouncer_unstable","props","targetDocument","domAnnounce","ariaNotifyAnnounce","announce","useMemo","supportsAriaNotify","ariaNotify","children"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAClF,SAASC,uBAAuB,QAAQ,mBAAmB;AAC3D,SAASC,8BAA8B,QAAQ,0BAA0B;AAIzE,OAAO,MAAMC,gCAAgC,CAACC;IAC5C,MAAM,EAAEC,cAAc,EAAE,GAAGL;IAC3B,MAAMM,cAAcL;IACpB,MAAMM,qBAAqBL;IAE3B,MAAMM,WAAWV,MAAMW,OAAO,CAAC;QAC7B,8DAA8D;QAC9D,MAAMC,qBAAqB,QAAQL,2BAAAA,qCAAD,AAACA,eAAwBM,UAAU,MAAK;QAC1E,OAAOD,qBAAqBH,qBAAqBD;IACnD,GAAG;QAACD;QAAgBE;QAAoBD;KAAY;IAEpD,OAAO;QACLE;QACAI,UAAUR,MAAMQ,QAAQ;IAC1B;AACF,EAAE"}
1
+ {"version":3,"sources":["../src/AriaLiveAnnouncer/useAriaLiveAnnouncer.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useDomAnnounce_unstable } from './useDomAnnounce';\nimport { useAriaNotifyAnnounce_unstable } from './useAriaNotifyAnnounce';\n\nimport type { AriaLiveAnnouncerState, AriaLiveAnnouncerProps } from './AriaLiveAnnouncer.types';\n\nexport const useAriaLiveAnnouncer_unstable = (props: AriaLiveAnnouncerProps): AriaLiveAnnouncerState => {\n const { targetDocument } = useFluent();\n const domAnnounce = useDomAnnounce_unstable();\n const ariaNotifyAnnounce = useAriaNotifyAnnounce_unstable();\n\n const announce = React.useMemo(() => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const supportsAriaNotify = typeof (targetDocument as any)?.ariaNotify === 'function';\n return supportsAriaNotify ? ariaNotifyAnnounce : domAnnounce;\n }, [targetDocument, ariaNotifyAnnounce, domAnnounce]);\n\n return {\n announce,\n children: props.children,\n };\n};\n"],"names":["React","useFluent_unstable","useFluent","useDomAnnounce_unstable","useAriaNotifyAnnounce_unstable","useAriaLiveAnnouncer_unstable","props","targetDocument","domAnnounce","ariaNotifyAnnounce","announce","useMemo","supportsAriaNotify","ariaNotify","children"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAClF,SAASC,uBAAuB,QAAQ,sBAAmB;AAC3D,SAASC,8BAA8B,QAAQ,6BAA0B;AAIzE,OAAO,MAAMC,gCAAgC,CAACC;IAC5C,MAAM,EAAEC,cAAc,EAAE,GAAGL;IAC3B,MAAMM,cAAcL;IACpB,MAAMM,qBAAqBL;IAE3B,MAAMM,WAAWV,MAAMW,OAAO,CAAC;QAC7B,8DAA8D;QAC9D,MAAMC,qBAAqB,QAAQL,2BAAAA,qCAAD,AAACA,eAAwBM,UAAU,MAAK;QAC1E,OAAOD,qBAAqBH,qBAAqBD;IACnD,GAAG;QAACD;QAAgBE;QAAoBD;KAAY;IAEpD,OAAO;QACLE;QACAI,UAAUR,MAAMQ,QAAQ;IAC1B;AACF,EAAE"}
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import * as React from 'react';
2
+ import * as React from "react";
3
3
  export function useAriaLiveAnnouncerContextValues_unstable(state) {
4
4
  const { announce } = state;
5
5
  return React.useMemo(()=>({
@@ -1,6 +1,6 @@
1
1
  'use client';
2
- import { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';
3
- import * as React from 'react';
2
+ import { useFluent_unstable as useFluent } from "@fluentui/react-shared-contexts";
3
+ import * as React from "react";
4
4
  /* INTERNAL: implementation of the announcer using the ariaNotify API */ export const useAriaNotifyAnnounce_unstable = ()=>{
5
5
  const { targetDocument } = useFluent();
6
6
  const announce = React.useCallback((message, options = {})=>{
@@ -1,8 +1,8 @@
1
1
  'use client';
2
- import { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';
3
- import { createPriorityQueue, useTimeout } from '@fluentui/react-utilities';
4
- import { useDangerousNeverHidden_unstable as useDangerousNeverHidden } from '@fluentui/react-tabster';
5
- import * as React from 'react';
2
+ import { useFluent_unstable as useFluent } from "@fluentui/react-shared-contexts";
3
+ import { createPriorityQueue, useTimeout } from "@fluentui/react-utilities";
4
+ import { useDangerousNeverHidden_unstable as useDangerousNeverHidden } from "@fluentui/react-tabster";
5
+ import * as React from "react";
6
6
  /** The duration the message needs to be in present in DOM for screen readers to register a change and announce */ const MESSAGE_DURATION = 500;
7
7
  const VISUALLY_HIDDEN_STYLES = {
8
8
  clip: 'rect(0px, 0px, 0px, 0px)',
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import * as React from 'react';
2
+ import * as React from "react";
3
3
  const noop = ()=>undefined;
4
4
  const activeDescendantContextDefaultValue = {
5
5
  controller: {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/activedescendant/ActiveDescendantContext.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { ActiveDescendantImperativeRef } from './types';\n\nexport type ActiveDescendantContextValue = {\n controller: ActiveDescendantImperativeRef;\n};\n\nconst noop = () => undefined;\n\nconst activeDescendantContextDefaultValue: ActiveDescendantContextValue = {\n controller: {\n active: noop,\n blur: noop,\n find: noop,\n first: noop,\n focus: noop,\n focusLastActive: noop,\n scrollActiveIntoView: noop,\n last: noop,\n next: noop,\n prev: noop,\n showAttributes: noop,\n hideAttributes: noop,\n showFocusVisibleAttributes: noop,\n hideFocusVisibleAttributes: noop,\n },\n};\n\nconst ActiveDescendantContext = React.createContext<ActiveDescendantContextValue | undefined>(undefined);\n\nexport const ActiveDescendantContextProvider = ActiveDescendantContext.Provider;\nexport const useActiveDescendantContext = (): ActiveDescendantContextValue =>\n React.useContext(ActiveDescendantContext) ?? activeDescendantContextDefaultValue;\nexport const useHasParentActiveDescendantContext = (): boolean => !!React.useContext(ActiveDescendantContext);\n"],"names":["React","noop","undefined","activeDescendantContextDefaultValue","controller","active","blur","find","first","focus","focusLastActive","scrollActiveIntoView","last","next","prev","showAttributes","hideAttributes","showFocusVisibleAttributes","hideFocusVisibleAttributes","ActiveDescendantContext","createContext","ActiveDescendantContextProvider","Provider","useActiveDescendantContext","useContext","useHasParentActiveDescendantContext"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAO/B,MAAMC,OAAO,IAAMC;AAEnB,MAAMC,sCAAoE;IACxEC,YAAY;QACVC,QAAQJ;QACRK,MAAML;QACNM,MAAMN;QACNO,OAAOP;QACPQ,OAAOR;QACPS,iBAAiBT;QACjBU,sBAAsBV;QACtBW,MAAMX;QACNY,MAAMZ;QACNa,MAAMb;QACNc,gBAAgBd;QAChBe,gBAAgBf;QAChBgB,4BAA4BhB;QAC5BiB,4BAA4BjB;IAC9B;AACF;AAEA,MAAMkB,0BAA0BnB,MAAMoB,aAAa,CAA2ClB;AAE9F,OAAO,MAAMmB,kCAAkCF,wBAAwBG,QAAQ,CAAC;AAChF,OAAO,MAAMC,6BAA6B;QACxCvB;WAAAA,CAAAA,oBAAAA,MAAMwB,UAAU,CAACL,sCAAjBnB,+BAAAA,oBAA6CG;EAAoC;AACnF,OAAO,MAAMsB,sCAAsC,IAAe,CAAC,CAACzB,MAAMwB,UAAU,CAACL,yBAAyB"}
1
+ {"version":3,"sources":["../src/activedescendant/ActiveDescendantContext.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ActiveDescendantImperativeRef } from './types';\n\nexport type ActiveDescendantContextValue = {\n controller: ActiveDescendantImperativeRef;\n};\n\nconst noop = () => undefined;\n\nconst activeDescendantContextDefaultValue: ActiveDescendantContextValue = {\n controller: {\n active: noop,\n blur: noop,\n find: noop,\n first: noop,\n focus: noop,\n focusLastActive: noop,\n scrollActiveIntoView: noop,\n last: noop,\n next: noop,\n prev: noop,\n showAttributes: noop,\n hideAttributes: noop,\n showFocusVisibleAttributes: noop,\n hideFocusVisibleAttributes: noop,\n },\n};\n\nconst ActiveDescendantContext = React.createContext<ActiveDescendantContextValue | undefined>(undefined);\n\nexport const ActiveDescendantContextProvider = ActiveDescendantContext.Provider;\nexport const useActiveDescendantContext = (): ActiveDescendantContextValue =>\n React.useContext(ActiveDescendantContext) ?? activeDescendantContextDefaultValue;\nexport const useHasParentActiveDescendantContext = (): boolean => !!React.useContext(ActiveDescendantContext);\n"],"names":["React","noop","undefined","activeDescendantContextDefaultValue","controller","active","blur","find","first","focus","focusLastActive","scrollActiveIntoView","last","next","prev","showAttributes","hideAttributes","showFocusVisibleAttributes","hideFocusVisibleAttributes","ActiveDescendantContext","createContext","ActiveDescendantContextProvider","Provider","useActiveDescendantContext","useContext","useHasParentActiveDescendantContext"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAO/B,MAAMC,OAAO,IAAMC;AAEnB,MAAMC,sCAAoE;IACxEC,YAAY;QACVC,QAAQJ;QACRK,MAAML;QACNM,MAAMN;QACNO,OAAOP;QACPQ,OAAOR;QACPS,iBAAiBT;QACjBU,sBAAsBV;QACtBW,MAAMX;QACNY,MAAMZ;QACNa,MAAMb;QACNc,gBAAgBd;QAChBe,gBAAgBf;QAChBgB,4BAA4BhB;QAC5BiB,4BAA4BjB;IAC9B;AACF;AAEA,MAAMkB,0BAA0BnB,MAAMoB,aAAa,CAA2ClB;AAE9F,OAAO,MAAMmB,kCAAkCF,wBAAwBG,QAAQ,CAAC;AAChF,OAAO,MAAMC,6BAA6B;QACxCvB;WAAAA,CAAAA,oBAAAA,MAAMwB,UAAU,CAACL,sCAAjBnB,+BAAAA,oBAA6CG;EAAoC;AACnF,OAAO,MAAMsB,sCAAsC,IAAe,CAAC,CAACzB,MAAMwB,UAAU,CAACL,yBAAyB"}
@@ -1,3 +1,3 @@
1
- export { ActiveDescendantContextProvider, useActiveDescendantContext, useHasParentActiveDescendantContext } from './ActiveDescendantContext';
2
- export { createActiveDescendantChangeEvent, useActiveDescendant } from './useActiveDescendant';
3
- export { ACTIVEDESCENDANT_ATTRIBUTE, ACTIVEDESCENDANT_FOCUSVISIBLE_ATTRIBUTE } from './constants';
1
+ export { ActiveDescendantContextProvider, useActiveDescendantContext, useHasParentActiveDescendantContext } from "./ActiveDescendantContext.js";
2
+ export { createActiveDescendantChangeEvent, useActiveDescendant } from "./useActiveDescendant.js";
3
+ export { ACTIVEDESCENDANT_ATTRIBUTE, ACTIVEDESCENDANT_FOCUSVISIBLE_ATTRIBUTE } from "./constants.js";
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/activedescendant/index.ts"],"sourcesContent":["export type { ActiveDescendantContextValue } from './ActiveDescendantContext';\nexport {\n ActiveDescendantContextProvider,\n useActiveDescendantContext,\n useHasParentActiveDescendantContext,\n} from './ActiveDescendantContext';\nexport type { ActiveDescendantChangeEvent } from './useActiveDescendant';\nexport { createActiveDescendantChangeEvent, useActiveDescendant } from './useActiveDescendant';\nexport { ACTIVEDESCENDANT_ATTRIBUTE, ACTIVEDESCENDANT_FOCUSVISIBLE_ATTRIBUTE } from './constants';\nexport type {\n ActiveDescendantImperativeRef,\n ActiveDescendantOptions,\n FindOptions,\n IteratorOptions,\n UseActiveDescendantReturn,\n} from './types';\n"],"names":["ActiveDescendantContextProvider","useActiveDescendantContext","useHasParentActiveDescendantContext","createActiveDescendantChangeEvent","useActiveDescendant","ACTIVEDESCENDANT_ATTRIBUTE","ACTIVEDESCENDANT_FOCUSVISIBLE_ATTRIBUTE"],"mappings":"AACA,SACEA,+BAA+B,EAC/BC,0BAA0B,EAC1BC,mCAAmC,QAC9B,4BAA4B;AAEnC,SAASC,iCAAiC,EAAEC,mBAAmB,QAAQ,wBAAwB;AAC/F,SAASC,0BAA0B,EAAEC,uCAAuC,QAAQ,cAAc"}
1
+ {"version":3,"sources":["../src/activedescendant/index.ts"],"sourcesContent":["export type { ActiveDescendantContextValue } from './ActiveDescendantContext';\nexport {\n ActiveDescendantContextProvider,\n useActiveDescendantContext,\n useHasParentActiveDescendantContext,\n} from './ActiveDescendantContext';\nexport type { ActiveDescendantChangeEvent } from './useActiveDescendant';\nexport { createActiveDescendantChangeEvent, useActiveDescendant } from './useActiveDescendant';\nexport { ACTIVEDESCENDANT_ATTRIBUTE, ACTIVEDESCENDANT_FOCUSVISIBLE_ATTRIBUTE } from './constants';\nexport type {\n ActiveDescendantImperativeRef,\n ActiveDescendantOptions,\n FindOptions,\n IteratorOptions,\n UseActiveDescendantReturn,\n} from './types';\n"],"names":["ActiveDescendantContextProvider","useActiveDescendantContext","useHasParentActiveDescendantContext","createActiveDescendantChangeEvent","useActiveDescendant","ACTIVEDESCENDANT_ATTRIBUTE","ACTIVEDESCENDANT_FOCUSVISIBLE_ATTRIBUTE"],"mappings":"AACA,SACEA,+BAA+B,EAC/BC,0BAA0B,EAC1BC,mCAAmC,QAC9B,+BAA4B;AAEnC,SAASC,iCAAiC,EAAEC,mBAAmB,QAAQ,2BAAwB;AAC/F,SAASC,0BAA0B,EAAEC,uCAAuC,QAAQ,iBAAc"}
@@ -1 +1 @@
1
- import * as React from 'react';
1
+ export { };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/activedescendant/types.ts"],"sourcesContent":["import * as React from 'react';\n\nexport interface ActiveDescendantImperativeRef {\n first: (options?: IteratorOptions) => string | undefined;\n last: (options?: IteratorOptions) => string | undefined;\n next: (options?: IteratorOptions) => string | undefined;\n prev: (options?: IteratorOptions) => string | undefined;\n find: (predicate: (id: string) => boolean, options?: IteratorOptions & FindOptions) => string | undefined;\n blur: () => void;\n active: () => string | undefined;\n focus: (id: string) => void;\n /**\n * @deprecated This function is not used internally anymore and will be removed in the future\n */\n focusLastActive: () => void;\n /**\n * Scrolls the active option into view, if it still exists\n */\n scrollActiveIntoView: () => void;\n hideAttributes: () => void;\n showAttributes: () => void;\n hideFocusVisibleAttributes: () => void;\n showFocusVisibleAttributes: () => void;\n}\n\nexport interface ActiveDescendantOptions {\n /**\n * @param el - HTML element to test\n * @returns whether the element can be an active descendant\n */\n matchOption: (el: HTMLElement) => boolean;\n /**\n * Forward imperative refs when exposing functionality from a React component\n */\n imperativeRef?: React.RefObject<ActiveDescendantImperativeRef | null>;\n}\n\nexport interface FindOptions {\n /**\n * Starts the search from a specific id\n */\n startFrom?: string;\n}\n\nexport interface UseActiveDescendantReturn<\n TActiveParentElement extends HTMLElement = HTMLElement,\n TListboxElement extends HTMLElement = HTMLElement,\n> {\n /**\n * Attach this to the element that contains all active descendants\n */\n listboxRef: React.Ref<TListboxElement>;\n /**\n * Attach this to the element that has an active descendant\n */\n activeParentRef: React.Ref<TActiveParentElement>;\n /**\n * Imperative functions to manage active descendants within the listboxRef\n */\n controller: ActiveDescendantImperativeRef;\n}\n\nexport interface IteratorOptions {\n /**\n * When passive, the active descendant is changed\n * @default false\n */\n passive?: boolean;\n}\n"],"names":["React"],"mappings":"AAAA,YAAYA,WAAW,QAAQ"}
1
+ {"version":3,"sources":["../src/activedescendant/types.ts"],"sourcesContent":["import type * as React from 'react';\n\nexport interface ActiveDescendantImperativeRef {\n first: (options?: IteratorOptions) => string | undefined;\n last: (options?: IteratorOptions) => string | undefined;\n next: (options?: IteratorOptions) => string | undefined;\n prev: (options?: IteratorOptions) => string | undefined;\n find: (predicate: (id: string) => boolean, options?: IteratorOptions & FindOptions) => string | undefined;\n blur: () => void;\n active: () => string | undefined;\n focus: (id: string) => void;\n /**\n * @deprecated This function is not used internally anymore and will be removed in the future\n */\n focusLastActive: () => void;\n /**\n * Scrolls the active option into view, if it still exists\n */\n scrollActiveIntoView: () => void;\n hideAttributes: () => void;\n showAttributes: () => void;\n hideFocusVisibleAttributes: () => void;\n showFocusVisibleAttributes: () => void;\n}\n\nexport interface ActiveDescendantOptions {\n /**\n * @param el - HTML element to test\n * @returns whether the element can be an active descendant\n */\n matchOption: (el: HTMLElement) => boolean;\n /**\n * Forward imperative refs when exposing functionality from a React component\n */\n imperativeRef?: React.RefObject<ActiveDescendantImperativeRef | null>;\n}\n\nexport interface FindOptions {\n /**\n * Starts the search from a specific id\n */\n startFrom?: string;\n}\n\nexport interface UseActiveDescendantReturn<\n TActiveParentElement extends HTMLElement = HTMLElement,\n TListboxElement extends HTMLElement = HTMLElement,\n> {\n /**\n * Attach this to the element that contains all active descendants\n */\n listboxRef: React.Ref<TListboxElement>;\n /**\n * Attach this to the element that has an active descendant\n */\n activeParentRef: React.Ref<TActiveParentElement>;\n /**\n * Imperative functions to manage active descendants within the listboxRef\n */\n controller: ActiveDescendantImperativeRef;\n}\n\nexport interface IteratorOptions {\n /**\n * When passive, the active descendant is changed\n * @default false\n */\n passive?: boolean;\n}\n"],"names":[],"mappings":"AA8DA,WAMC"}
@@ -1,10 +1,10 @@
1
1
  'use client';
2
- import * as React from 'react';
3
- import { useEventCallback, useMergedRefs } from '@fluentui/react-utilities';
4
- import { useOnKeyboardNavigationChange } from '@fluentui/react-tabster';
5
- import { useOptionWalker } from './useOptionWalker';
6
- import { ACTIVEDESCENDANT_ATTRIBUTE, ACTIVEDESCENDANT_FOCUSVISIBLE_ATTRIBUTE } from './constants';
7
- import { scrollIntoView } from './scrollIntoView';
2
+ import * as React from "react";
3
+ import { useEventCallback, useMergedRefs } from "@fluentui/react-utilities";
4
+ import { useOnKeyboardNavigationChange } from "@fluentui/react-tabster";
5
+ import { useOptionWalker } from "./useOptionWalker.js";
6
+ import { ACTIVEDESCENDANT_ATTRIBUTE, ACTIVEDESCENDANT_FOCUSVISIBLE_ATTRIBUTE } from "./constants.js";
7
+ import { scrollIntoView } from "./scrollIntoView.js";
8
8
  export const createActiveDescendantChangeEvent = (detail)=>new CustomEvent('activedescendantchange', {
9
9
  bubbles: true,
10
10
  cancelable: false,
@@ -34,6 +34,7 @@ export function useActiveDescendant(options) {
34
34
  }, []);
35
35
  useOnKeyboardNavigationChange((isNavigatingWithKeyboard)=>{
36
36
  focusVisibleRef.current = isNavigatingWithKeyboard;
37
+ // eslint-disable-next-line react-hooks/immutability, react-hooks/preserve-manual-memoization
37
38
  const active = getActiveDescendant();
38
39
  if (!active) {
39
40
  return;
@@ -49,6 +50,7 @@ export function useActiveDescendant(options) {
49
50
  const { optionWalker, listboxCallbackRef } = useOptionWalker({
50
51
  matchOption
51
52
  });
53
+ // eslint-disable-next-line react-hooks/preserve-manual-memoization
52
54
  const getActiveDescendant = React.useCallback(()=>{
53
55
  var _listboxRef_current;
54
56
  return (_listboxRef_current = listboxRef.current) === null || _listboxRef_current === void 0 ? void 0 : _listboxRef_current.querySelector(`#${activeIdRef.current}`);