@fluentui/react-aria 9.17.13 → 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.
- package/CHANGELOG.md +16 -2
- package/dist/index.d.cts +214 -0
- package/lib/AriaLiveAnnouncer/AriaLiveAnnouncer.js +3 -3
- package/lib/AriaLiveAnnouncer/AriaLiveAnnouncer.js.map +1 -1
- package/lib/AriaLiveAnnouncer/index.js +4 -4
- package/lib/AriaLiveAnnouncer/index.js.map +1 -1
- package/lib/AriaLiveAnnouncer/renderAriaLiveAnnouncer.js +2 -2
- package/lib/AriaLiveAnnouncer/useAriaLiveAnnouncer.js +4 -4
- package/lib/AriaLiveAnnouncer/useAriaLiveAnnouncer.js.map +1 -1
- package/lib/AriaLiveAnnouncer/useAriaLiveAnnouncerContextValues.js +1 -1
- package/lib/AriaLiveAnnouncer/useAriaNotifyAnnounce.js +2 -2
- package/lib/AriaLiveAnnouncer/useDomAnnounce.js +4 -4
- package/lib/activedescendant/ActiveDescendantContext.js +1 -1
- package/lib/activedescendant/index.js +3 -3
- package/lib/activedescendant/index.js.map +1 -1
- package/lib/activedescendant/useActiveDescendant.js +6 -6
- package/lib/activedescendant/useActiveDescendant.js.map +1 -1
- package/lib/activedescendant/useOptionWalker.js +3 -3
- package/lib/button/index.js +2 -2
- package/lib/button/index.js.map +1 -1
- package/lib/button/useARIAButtonProps.js +2 -2
- package/lib/button/useARIAButtonShorthand.js +2 -2
- package/lib/button/useARIAButtonShorthand.js.map +1 -1
- package/lib/index.js +4 -4
- package/lib/index.js.map +1 -1
- package/lib/useTypingAnnounce/index.js +1 -1
- package/lib/useTypingAnnounce/index.js.map +1 -1
- package/lib/useTypingAnnounce/useTypingAnnounce.js +3 -3
- package/lib-commonjs/AriaLiveAnnouncer/{AriaLiveAnnouncer.js → AriaLiveAnnouncer.cjs} +3 -3
- package/lib-commonjs/AriaLiveAnnouncer/{index.js → index.cjs} +4 -4
- package/lib-commonjs/AriaLiveAnnouncer/{useAriaLiveAnnouncer.js → useAriaLiveAnnouncer.cjs} +2 -2
- package/lib-commonjs/activedescendant/{index.js → index.cjs} +3 -3
- package/lib-commonjs/activedescendant/{useActiveDescendant.js → useActiveDescendant.cjs} +3 -3
- package/lib-commonjs/button/{index.js → index.cjs} +2 -2
- package/lib-commonjs/button/{useARIAButtonShorthand.js → useARIAButtonShorthand.cjs} +1 -1
- package/lib-commonjs/{index.js → index.cjs} +4 -4
- package/lib-commonjs/useTypingAnnounce/{index.js → index.cjs} +1 -1
- package/package.json +19 -18
- /package/lib-commonjs/AriaLiveAnnouncer/{AriaLiveAnnouncer.js.map → AriaLiveAnnouncer.cjs.map} +0 -0
- /package/lib-commonjs/AriaLiveAnnouncer/{AriaLiveAnnouncer.types.js → AriaLiveAnnouncer.types.cjs} +0 -0
- /package/lib-commonjs/AriaLiveAnnouncer/{AriaLiveAnnouncer.types.js.map → AriaLiveAnnouncer.types.cjs.map} +0 -0
- /package/lib-commonjs/AriaLiveAnnouncer/{index.js.map → index.cjs.map} +0 -0
- /package/lib-commonjs/AriaLiveAnnouncer/{renderAriaLiveAnnouncer.js → renderAriaLiveAnnouncer.cjs} +0 -0
- /package/lib-commonjs/AriaLiveAnnouncer/{renderAriaLiveAnnouncer.js.map → renderAriaLiveAnnouncer.cjs.map} +0 -0
- /package/lib-commonjs/AriaLiveAnnouncer/{useAriaLiveAnnouncer.js.map → useAriaLiveAnnouncer.cjs.map} +0 -0
- /package/lib-commonjs/AriaLiveAnnouncer/{useAriaLiveAnnouncerContextValues.js → useAriaLiveAnnouncerContextValues.cjs} +0 -0
- /package/lib-commonjs/AriaLiveAnnouncer/{useAriaLiveAnnouncerContextValues.js.map → useAriaLiveAnnouncerContextValues.cjs.map} +0 -0
- /package/lib-commonjs/AriaLiveAnnouncer/{useAriaNotifyAnnounce.js → useAriaNotifyAnnounce.cjs} +0 -0
- /package/lib-commonjs/AriaLiveAnnouncer/{useAriaNotifyAnnounce.js.map → useAriaNotifyAnnounce.cjs.map} +0 -0
- /package/lib-commonjs/AriaLiveAnnouncer/{useDomAnnounce.js → useDomAnnounce.cjs} +0 -0
- /package/lib-commonjs/AriaLiveAnnouncer/{useDomAnnounce.js.map → useDomAnnounce.cjs.map} +0 -0
- /package/lib-commonjs/activedescendant/{ActiveDescendantContext.js → ActiveDescendantContext.cjs} +0 -0
- /package/lib-commonjs/activedescendant/{ActiveDescendantContext.js.map → ActiveDescendantContext.cjs.map} +0 -0
- /package/lib-commonjs/activedescendant/{constants.js → constants.cjs} +0 -0
- /package/lib-commonjs/activedescendant/{constants.js.map → constants.cjs.map} +0 -0
- /package/lib-commonjs/activedescendant/{index.js.map → index.cjs.map} +0 -0
- /package/lib-commonjs/activedescendant/{scrollIntoView.js → scrollIntoView.cjs} +0 -0
- /package/lib-commonjs/activedescendant/{scrollIntoView.js.map → scrollIntoView.cjs.map} +0 -0
- /package/lib-commonjs/activedescendant/{types.js → types.cjs} +0 -0
- /package/lib-commonjs/activedescendant/{types.js.map → types.cjs.map} +0 -0
- /package/lib-commonjs/activedescendant/{useActiveDescendant.js.map → useActiveDescendant.cjs.map} +0 -0
- /package/lib-commonjs/activedescendant/{useOptionWalker.js → useOptionWalker.cjs} +0 -0
- /package/lib-commonjs/activedescendant/{useOptionWalker.js.map → useOptionWalker.cjs.map} +0 -0
- /package/lib-commonjs/button/{index.js.map → index.cjs.map} +0 -0
- /package/lib-commonjs/button/{types.js → types.cjs} +0 -0
- /package/lib-commonjs/button/{types.js.map → types.cjs.map} +0 -0
- /package/lib-commonjs/button/{useARIAButtonProps.js → useARIAButtonProps.cjs} +0 -0
- /package/lib-commonjs/button/{useARIAButtonProps.js.map → useARIAButtonProps.cjs.map} +0 -0
- /package/lib-commonjs/button/{useARIAButtonShorthand.js.map → useARIAButtonShorthand.cjs.map} +0 -0
- /package/lib-commonjs/{index.js.map → index.cjs.map} +0 -0
- /package/lib-commonjs/useTypingAnnounce/{index.js.map → index.cjs.map} +0 -0
- /package/lib-commonjs/useTypingAnnounce/{useTypingAnnounce.js → useTypingAnnounce.cjs} +0 -0
- /package/lib-commonjs/useTypingAnnounce/{useTypingAnnounce.js.map → useTypingAnnounce.cjs.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,26 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-aria
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
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.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
|
+
|
|
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
|
+
|
|
12
|
+
### Changes
|
|
13
|
+
|
|
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
|
+
|
|
7
21
|
## [9.17.13](https://github.com/microsoft/fluentui/tree/@fluentui/react-aria_v9.17.13)
|
|
8
22
|
|
|
9
|
-
Wed, 24 Jun 2026 11:
|
|
23
|
+
Wed, 24 Jun 2026 11:10:10 GMT
|
|
10
24
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-aria_v9.17.12..@fluentui/react-aria_v9.17.13)
|
|
11
25
|
|
|
12
26
|
### Patches
|
package/dist/index.d.cts
ADDED
|
@@ -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 { }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { renderAriaLiveAnnouncer_unstable } from
|
|
3
|
-
import { useAriaLiveAnnouncer_unstable } from
|
|
4
|
-
import { useAriaLiveAnnouncerContextValues_unstable } from
|
|
2
|
+
import { renderAriaLiveAnnouncer_unstable } from "./renderAriaLiveAnnouncer.js";
|
|
3
|
+
import { useAriaLiveAnnouncer_unstable } from "./useAriaLiveAnnouncer.js";
|
|
4
|
+
import { useAriaLiveAnnouncerContextValues_unstable } from "./useAriaLiveAnnouncerContextValues.js";
|
|
5
5
|
/**
|
|
6
6
|
* A sample implementation of a component that manages aria live announcements.
|
|
7
7
|
*/ export const AriaLiveAnnouncer = (props)=>{
|
|
@@ -1 +1 @@
|
|
|
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
|
|
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,4 +1,4 @@
|
|
|
1
|
-
export { AriaLiveAnnouncer } from
|
|
2
|
-
export { renderAriaLiveAnnouncer_unstable } from
|
|
3
|
-
export { useAriaLiveAnnouncer_unstable } from
|
|
4
|
-
export { useAriaLiveAnnouncerContextValues_unstable } from
|
|
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,
|
|
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
|
|
2
|
-
import { AnnounceProvider } from
|
|
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
|
|
3
|
-
import { useFluent_unstable as useFluent } from
|
|
4
|
-
import { useDomAnnounce_unstable } from
|
|
5
|
-
import { useAriaNotifyAnnounce_unstable } from
|
|
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,
|
|
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,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { useFluent_unstable as useFluent } from
|
|
3
|
-
import * as React from
|
|
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
|
|
3
|
-
import { createPriorityQueue, useTimeout } from
|
|
4
|
-
import { useDangerousNeverHidden_unstable as useDangerousNeverHidden } from
|
|
5
|
-
import * as React from
|
|
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,3 +1,3 @@
|
|
|
1
|
-
export { ActiveDescendantContextProvider, useActiveDescendantContext, useHasParentActiveDescendantContext } from
|
|
2
|
-
export { createActiveDescendantChangeEvent, useActiveDescendant } from
|
|
3
|
-
export { ACTIVEDESCENDANT_ATTRIBUTE, ACTIVEDESCENDANT_FOCUSVISIBLE_ATTRIBUTE } from
|
|
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
|
|
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,10 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import * as React from
|
|
3
|
-
import { useEventCallback, useMergedRefs } from
|
|
4
|
-
import { useOnKeyboardNavigationChange } from
|
|
5
|
-
import { useOptionWalker } from
|
|
6
|
-
import { ACTIVEDESCENDANT_ATTRIBUTE, ACTIVEDESCENDANT_FOCUSVISIBLE_ATTRIBUTE } from
|
|
7
|
-
import { scrollIntoView } from
|
|
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,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/activedescendant/useActiveDescendant.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useEventCallback, useMergedRefs } from '@fluentui/react-utilities';\nimport { useOnKeyboardNavigationChange } from '@fluentui/react-tabster';\nimport { useOptionWalker } from './useOptionWalker';\nimport type { ActiveDescendantImperativeRef, ActiveDescendantOptions, UseActiveDescendantReturn } from './types';\nimport { ACTIVEDESCENDANT_ATTRIBUTE, ACTIVEDESCENDANT_FOCUSVISIBLE_ATTRIBUTE } from './constants';\nimport { scrollIntoView } from './scrollIntoView';\n\ninterface ActiveDescendantChangeEventDetail {\n id: string;\n previousId: string | null;\n}\n\nexport type ActiveDescendantChangeEvent = CustomEvent<ActiveDescendantChangeEventDetail>;\n\nexport const createActiveDescendantChangeEvent = (\n detail: ActiveDescendantChangeEventDetail,\n): ActiveDescendantChangeEvent =>\n new CustomEvent<ActiveDescendantChangeEventDetail>('activedescendantchange', {\n bubbles: true,\n cancelable: false,\n composed: true,\n detail,\n });\n\nexport function useActiveDescendant<TActiveParentElement extends HTMLElement, TListboxElement extends HTMLElement>(\n options: ActiveDescendantOptions,\n): UseActiveDescendantReturn<TActiveParentElement, TListboxElement> {\n const { imperativeRef, matchOption: matchOptionUnstable } = options;\n const focusVisibleRef = React.useRef(false);\n const shouldShowFocusVisibleAttrRef = React.useRef(true);\n const activeIdRef = React.useRef<string | null>(null);\n const lastActiveIdRef = React.useRef<string | null>(null);\n const activeParentRef = React.useRef<TActiveParentElement>(null);\n const attributeVisibilityRef = React.useRef(true);\n\n const removeAttribute = React.useCallback(() => {\n activeParentRef.current?.removeAttribute('aria-activedescendant');\n }, []);\n\n const setAttribute = React.useCallback((id?: string) => {\n if (id) {\n activeIdRef.current = id;\n }\n if (attributeVisibilityRef.current && activeIdRef.current) {\n activeParentRef.current?.setAttribute('aria-activedescendant', activeIdRef.current);\n }\n }, []);\n\n useOnKeyboardNavigationChange(isNavigatingWithKeyboard => {\n focusVisibleRef.current = isNavigatingWithKeyboard;\n\n // eslint-disable-next-line react-hooks/immutability, react-hooks/preserve-manual-memoization\n const active = getActiveDescendant();\n if (!active) {\n return;\n }\n\n if (isNavigatingWithKeyboard && shouldShowFocusVisibleAttrRef.current) {\n active.setAttribute(ACTIVEDESCENDANT_FOCUSVISIBLE_ATTRIBUTE, '');\n } else {\n active.removeAttribute(ACTIVEDESCENDANT_FOCUSVISIBLE_ATTRIBUTE);\n }\n });\n\n const matchOption = useEventCallback(matchOptionUnstable);\n const listboxRef = React.useRef<TListboxElement>(null);\n const { optionWalker, listboxCallbackRef } = useOptionWalker<TListboxElement>({ matchOption });\n\n // eslint-disable-next-line react-hooks/preserve-manual-memoization\n const getActiveDescendant = React.useCallback(() => {\n return listboxRef.current?.querySelector<HTMLElement>(`#${activeIdRef.current}`);\n }, [listboxRef]);\n\n const setShouldShowFocusVisibleAttribute = React.useCallback(\n (shouldShow: boolean) => {\n shouldShowFocusVisibleAttrRef.current = shouldShow;\n\n const active = getActiveDescendant();\n if (!active) {\n return;\n }\n\n if (shouldShow && focusVisibleRef.current) {\n active.setAttribute(ACTIVEDESCENDANT_FOCUSVISIBLE_ATTRIBUTE, '');\n } else {\n active.removeAttribute(ACTIVEDESCENDANT_FOCUSVISIBLE_ATTRIBUTE);\n }\n },\n [getActiveDescendant],\n );\n\n const blurActiveDescendant = React.useCallback(() => {\n const active = getActiveDescendant();\n if (active) {\n active.removeAttribute(ACTIVEDESCENDANT_ATTRIBUTE);\n active.removeAttribute(ACTIVEDESCENDANT_FOCUSVISIBLE_ATTRIBUTE);\n }\n\n removeAttribute();\n lastActiveIdRef.current = activeIdRef.current;\n activeIdRef.current = null;\n return active?.id ?? null;\n }, [getActiveDescendant, removeAttribute]);\n\n const focusActiveDescendant = React.useCallback(\n (nextActive: HTMLElement | null) => {\n if (!nextActive) {\n return;\n }\n\n const previousActiveId = blurActiveDescendant();\n\n scrollIntoView(nextActive);\n setAttribute(nextActive.id);\n nextActive.setAttribute(ACTIVEDESCENDANT_ATTRIBUTE, '');\n\n if (focusVisibleRef.current && shouldShowFocusVisibleAttrRef.current) {\n nextActive.setAttribute(ACTIVEDESCENDANT_FOCUSVISIBLE_ATTRIBUTE, '');\n }\n\n const event = createActiveDescendantChangeEvent({ id: nextActive.id, previousId: previousActiveId });\n nextActive.dispatchEvent(event);\n },\n [blurActiveDescendant, setAttribute],\n );\n\n const controller: ActiveDescendantImperativeRef = React.useMemo(\n () => ({\n first: ({ passive } = {}) => {\n const first = optionWalker.first();\n if (!passive) {\n focusActiveDescendant(first);\n }\n\n return first?.id;\n },\n last: ({ passive } = {}) => {\n const last = optionWalker.last();\n if (!passive) {\n focusActiveDescendant(last);\n }\n\n return last?.id;\n },\n next: ({ passive } = {}) => {\n const active = getActiveDescendant();\n if (!active) {\n return;\n }\n\n optionWalker.setCurrent(active);\n const next = optionWalker.next();\n if (!passive) {\n focusActiveDescendant(next);\n }\n\n return next?.id;\n },\n prev: ({ passive } = {}) => {\n const active = getActiveDescendant();\n if (!active) {\n return;\n }\n\n optionWalker.setCurrent(active);\n const next = optionWalker.prev();\n\n if (!passive) {\n focusActiveDescendant(next);\n }\n\n return next?.id;\n },\n blur: () => {\n blurActiveDescendant();\n },\n active: () => {\n return getActiveDescendant()?.id;\n },\n focus: (id: string) => {\n if (!listboxRef.current) {\n return;\n }\n\n const target = listboxRef.current.querySelector<HTMLElement>(`#${id}`);\n if (target) {\n focusActiveDescendant(target);\n }\n },\n focusLastActive: () => {\n if (!listboxRef.current || !lastActiveIdRef.current) {\n return;\n }\n\n const target = listboxRef.current.querySelector<HTMLElement>(`#${lastActiveIdRef.current}`);\n if (target) {\n focusActiveDescendant(target);\n return true;\n }\n },\n find(predicate, { passive, startFrom } = {}) {\n const target = optionWalker.find(predicate, startFrom);\n if (!passive) {\n focusActiveDescendant(target);\n }\n\n return target?.id;\n },\n scrollActiveIntoView: () => {\n if (!listboxRef.current) {\n return;\n }\n\n const active = getActiveDescendant();\n if (!active) {\n return;\n }\n\n scrollIntoView(active);\n },\n showAttributes() {\n attributeVisibilityRef.current = true;\n setAttribute();\n },\n hideAttributes() {\n attributeVisibilityRef.current = false;\n removeAttribute();\n },\n showFocusVisibleAttributes() {\n setShouldShowFocusVisibleAttribute(true);\n },\n hideFocusVisibleAttributes() {\n setShouldShowFocusVisibleAttribute(false);\n },\n }),\n [\n optionWalker,\n listboxRef,\n setAttribute,\n removeAttribute,\n focusActiveDescendant,\n blurActiveDescendant,\n getActiveDescendant,\n setShouldShowFocusVisibleAttribute,\n ],\n );\n\n React.useImperativeHandle(imperativeRef, () => controller);\n\n return { listboxRef: useMergedRefs(listboxRef, listboxCallbackRef), activeParentRef, controller };\n}\n"],"names":["React","useEventCallback","useMergedRefs","useOnKeyboardNavigationChange","useOptionWalker","ACTIVEDESCENDANT_ATTRIBUTE","ACTIVEDESCENDANT_FOCUSVISIBLE_ATTRIBUTE","scrollIntoView","createActiveDescendantChangeEvent","detail","CustomEvent","bubbles","cancelable","composed","useActiveDescendant","options","imperativeRef","matchOption","matchOptionUnstable","focusVisibleRef","useRef","shouldShowFocusVisibleAttrRef","activeIdRef","lastActiveIdRef","activeParentRef","attributeVisibilityRef","removeAttribute","useCallback","current","setAttribute","id","isNavigatingWithKeyboard","active","getActiveDescendant","listboxRef","optionWalker","listboxCallbackRef","querySelector","setShouldShowFocusVisibleAttribute","shouldShow","blurActiveDescendant","focusActiveDescendant","nextActive","previousActiveId","event","previousId","dispatchEvent","controller","useMemo","first","passive","last","next","setCurrent","prev","blur","focus","target","focusLastActive","find","predicate","startFrom","scrollActiveIntoView","showAttributes","hideAttributes","showFocusVisibleAttributes","hideFocusVisibleAttributes","useImperativeHandle"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,gBAAgB,EAAEC,aAAa,QAAQ,4BAA4B;AAC5E,SAASC,6BAA6B,QAAQ,0BAA0B;AACxE,SAASC,eAAe,QAAQ,oBAAoB;AAEpD,SAASC,0BAA0B,EAAEC,uCAAuC,QAAQ,cAAc;AAClG,SAASC,cAAc,QAAQ,mBAAmB;AASlD,OAAO,MAAMC,oCAAoC,CAC/CC,SAEA,IAAIC,YAA+C,0BAA0B;QAC3EC,SAAS;QACTC,YAAY;QACZC,UAAU;QACVJ;IACF,GAAG;AAEL,OAAO,SAASK,oBACdC,OAAgC;IAEhC,MAAM,EAAEC,aAAa,EAAEC,aAAaC,mBAAmB,EAAE,GAAGH;IAC5D,MAAMI,kBAAkBnB,MAAMoB,MAAM,CAAC;IACrC,MAAMC,gCAAgCrB,MAAMoB,MAAM,CAAC;IACnD,MAAME,cAActB,MAAMoB,MAAM,CAAgB;IAChD,MAAMG,kBAAkBvB,MAAMoB,MAAM,CAAgB;IACpD,MAAMI,kBAAkBxB,MAAMoB,MAAM,CAAuB;IAC3D,MAAMK,yBAAyBzB,MAAMoB,MAAM,CAAC;IAE5C,MAAMM,kBAAkB1B,MAAM2B,WAAW,CAAC;YACxCH;SAAAA,2BAAAA,gBAAgBI,OAAO,cAAvBJ,+CAAAA,yBAAyBE,eAAe,CAAC;IAC3C,GAAG,EAAE;IAEL,MAAMG,eAAe7B,MAAM2B,WAAW,CAAC,CAACG;QACtC,IAAIA,IAAI;YACNR,YAAYM,OAAO,GAAGE;QACxB;QACA,IAAI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AAWN,OAAO,EAAE;oBACvB;gBACF;gBAEA,MAAMI,SAASC;gBACf,IAAI,CAACD,QAAQ;oBACX;gBACF;gBAEAzB,eAAeyB;YACjB;YACA+B;gBACEtC,uBAAuBG,OAAO,GAAG;gBACjCC;YACF;YACAmC;gBACEvC,uBAAuBG,OAAO,GAAG;gBACjCF;YACF;YACAuC;gBACE3B,mCAAmC;YACrC;YACA4B;gBACE5B,mCAAmC;YACrC;QACF,CAAA,GACA;QACEH;QACAD;QACAL;QACAH;QACAe;QACAD;QACAP;QACAK;KACD;IAGHtC,MAAMmE,mBAAmB,CAACnD,eAAe,IAAM+B;IAE/C,OAAO;QAAEb,YAAYhC,cAAcgC,YAAYE;QAAqBZ;QAAiBuB;IAAW;AAClG"}
|
|
1
|
+
{"version":3,"sources":["../src/activedescendant/useActiveDescendant.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useEventCallback, useMergedRefs } from '@fluentui/react-utilities';\nimport { useOnKeyboardNavigationChange } from '@fluentui/react-tabster';\nimport { useOptionWalker } from './useOptionWalker';\nimport type { ActiveDescendantImperativeRef, ActiveDescendantOptions, UseActiveDescendantReturn } from './types';\nimport { ACTIVEDESCENDANT_ATTRIBUTE, ACTIVEDESCENDANT_FOCUSVISIBLE_ATTRIBUTE } from './constants';\nimport { scrollIntoView } from './scrollIntoView';\n\ninterface ActiveDescendantChangeEventDetail {\n id: string;\n previousId: string | null;\n}\n\nexport type ActiveDescendantChangeEvent = CustomEvent<ActiveDescendantChangeEventDetail>;\n\nexport const createActiveDescendantChangeEvent = (\n detail: ActiveDescendantChangeEventDetail,\n): ActiveDescendantChangeEvent =>\n new CustomEvent<ActiveDescendantChangeEventDetail>('activedescendantchange', {\n bubbles: true,\n cancelable: false,\n composed: true,\n detail,\n });\n\nexport function useActiveDescendant<TActiveParentElement extends HTMLElement, TListboxElement extends HTMLElement>(\n options: ActiveDescendantOptions,\n): UseActiveDescendantReturn<TActiveParentElement, TListboxElement> {\n const { imperativeRef, matchOption: matchOptionUnstable } = options;\n const focusVisibleRef = React.useRef(false);\n const shouldShowFocusVisibleAttrRef = React.useRef(true);\n const activeIdRef = React.useRef<string | null>(null);\n const lastActiveIdRef = React.useRef<string | null>(null);\n const activeParentRef = React.useRef<TActiveParentElement>(null);\n const attributeVisibilityRef = React.useRef(true);\n\n const removeAttribute = React.useCallback(() => {\n activeParentRef.current?.removeAttribute('aria-activedescendant');\n }, []);\n\n const setAttribute = React.useCallback((id?: string) => {\n if (id) {\n activeIdRef.current = id;\n }\n if (attributeVisibilityRef.current && activeIdRef.current) {\n activeParentRef.current?.setAttribute('aria-activedescendant', activeIdRef.current);\n }\n }, []);\n\n useOnKeyboardNavigationChange(isNavigatingWithKeyboard => {\n focusVisibleRef.current = isNavigatingWithKeyboard;\n\n // eslint-disable-next-line react-hooks/immutability, react-hooks/preserve-manual-memoization\n const active = getActiveDescendant();\n if (!active) {\n return;\n }\n\n if (isNavigatingWithKeyboard && shouldShowFocusVisibleAttrRef.current) {\n active.setAttribute(ACTIVEDESCENDANT_FOCUSVISIBLE_ATTRIBUTE, '');\n } else {\n active.removeAttribute(ACTIVEDESCENDANT_FOCUSVISIBLE_ATTRIBUTE);\n }\n });\n\n const matchOption = useEventCallback(matchOptionUnstable);\n const listboxRef = React.useRef<TListboxElement>(null);\n const { optionWalker, listboxCallbackRef } = useOptionWalker<TListboxElement>({ matchOption });\n\n // eslint-disable-next-line react-hooks/preserve-manual-memoization\n const getActiveDescendant = React.useCallback(() => {\n return listboxRef.current?.querySelector<HTMLElement>(`#${activeIdRef.current}`);\n }, [listboxRef]);\n\n const setShouldShowFocusVisibleAttribute = React.useCallback(\n (shouldShow: boolean) => {\n shouldShowFocusVisibleAttrRef.current = shouldShow;\n\n const active = getActiveDescendant();\n if (!active) {\n return;\n }\n\n if (shouldShow && focusVisibleRef.current) {\n active.setAttribute(ACTIVEDESCENDANT_FOCUSVISIBLE_ATTRIBUTE, '');\n } else {\n active.removeAttribute(ACTIVEDESCENDANT_FOCUSVISIBLE_ATTRIBUTE);\n }\n },\n [getActiveDescendant],\n );\n\n const blurActiveDescendant = React.useCallback(() => {\n const active = getActiveDescendant();\n if (active) {\n active.removeAttribute(ACTIVEDESCENDANT_ATTRIBUTE);\n active.removeAttribute(ACTIVEDESCENDANT_FOCUSVISIBLE_ATTRIBUTE);\n }\n\n removeAttribute();\n lastActiveIdRef.current = activeIdRef.current;\n activeIdRef.current = null;\n return active?.id ?? null;\n }, [getActiveDescendant, removeAttribute]);\n\n const focusActiveDescendant = React.useCallback(\n (nextActive: HTMLElement | null) => {\n if (!nextActive) {\n return;\n }\n\n const previousActiveId = blurActiveDescendant();\n\n scrollIntoView(nextActive);\n setAttribute(nextActive.id);\n nextActive.setAttribute(ACTIVEDESCENDANT_ATTRIBUTE, '');\n\n if (focusVisibleRef.current && shouldShowFocusVisibleAttrRef.current) {\n nextActive.setAttribute(ACTIVEDESCENDANT_FOCUSVISIBLE_ATTRIBUTE, '');\n }\n\n const event = createActiveDescendantChangeEvent({ id: nextActive.id, previousId: previousActiveId });\n nextActive.dispatchEvent(event);\n },\n [blurActiveDescendant, setAttribute],\n );\n\n const controller: ActiveDescendantImperativeRef = React.useMemo(\n () => ({\n first: ({ passive } = {}) => {\n const first = optionWalker.first();\n if (!passive) {\n focusActiveDescendant(first);\n }\n\n return first?.id;\n },\n last: ({ passive } = {}) => {\n const last = optionWalker.last();\n if (!passive) {\n focusActiveDescendant(last);\n }\n\n return last?.id;\n },\n next: ({ passive } = {}) => {\n const active = getActiveDescendant();\n if (!active) {\n return;\n }\n\n optionWalker.setCurrent(active);\n const next = optionWalker.next();\n if (!passive) {\n focusActiveDescendant(next);\n }\n\n return next?.id;\n },\n prev: ({ passive } = {}) => {\n const active = getActiveDescendant();\n if (!active) {\n return;\n }\n\n optionWalker.setCurrent(active);\n const next = optionWalker.prev();\n\n if (!passive) {\n focusActiveDescendant(next);\n }\n\n return next?.id;\n },\n blur: () => {\n blurActiveDescendant();\n },\n active: () => {\n return getActiveDescendant()?.id;\n },\n focus: (id: string) => {\n if (!listboxRef.current) {\n return;\n }\n\n const target = listboxRef.current.querySelector<HTMLElement>(`#${id}`);\n if (target) {\n focusActiveDescendant(target);\n }\n },\n focusLastActive: () => {\n if (!listboxRef.current || !lastActiveIdRef.current) {\n return;\n }\n\n const target = listboxRef.current.querySelector<HTMLElement>(`#${lastActiveIdRef.current}`);\n if (target) {\n focusActiveDescendant(target);\n return true;\n }\n },\n find(predicate, { passive, startFrom } = {}) {\n const target = optionWalker.find(predicate, startFrom);\n if (!passive) {\n focusActiveDescendant(target);\n }\n\n return target?.id;\n },\n scrollActiveIntoView: () => {\n if (!listboxRef.current) {\n return;\n }\n\n const active = getActiveDescendant();\n if (!active) {\n return;\n }\n\n scrollIntoView(active);\n },\n showAttributes() {\n attributeVisibilityRef.current = true;\n setAttribute();\n },\n hideAttributes() {\n attributeVisibilityRef.current = false;\n removeAttribute();\n },\n showFocusVisibleAttributes() {\n setShouldShowFocusVisibleAttribute(true);\n },\n hideFocusVisibleAttributes() {\n setShouldShowFocusVisibleAttribute(false);\n },\n }),\n [\n optionWalker,\n listboxRef,\n setAttribute,\n removeAttribute,\n focusActiveDescendant,\n blurActiveDescendant,\n getActiveDescendant,\n setShouldShowFocusVisibleAttribute,\n ],\n );\n\n React.useImperativeHandle(imperativeRef, () => controller);\n\n return { listboxRef: useMergedRefs(listboxRef, listboxCallbackRef), activeParentRef, controller };\n}\n"],"names":["React","useEventCallback","useMergedRefs","useOnKeyboardNavigationChange","useOptionWalker","ACTIVEDESCENDANT_ATTRIBUTE","ACTIVEDESCENDANT_FOCUSVISIBLE_ATTRIBUTE","scrollIntoView","createActiveDescendantChangeEvent","detail","CustomEvent","bubbles","cancelable","composed","useActiveDescendant","options","imperativeRef","matchOption","matchOptionUnstable","focusVisibleRef","useRef","shouldShowFocusVisibleAttrRef","activeIdRef","lastActiveIdRef","activeParentRef","attributeVisibilityRef","removeAttribute","useCallback","current","setAttribute","id","isNavigatingWithKeyboard","active","getActiveDescendant","listboxRef","optionWalker","listboxCallbackRef","querySelector","setShouldShowFocusVisibleAttribute","shouldShow","blurActiveDescendant","focusActiveDescendant","nextActive","previousActiveId","event","previousId","dispatchEvent","controller","useMemo","first","passive","last","next","setCurrent","prev","blur","focus","target","focusLastActive","find","predicate","startFrom","scrollActiveIntoView","showAttributes","hideAttributes","showFocusVisibleAttributes","hideFocusVisibleAttributes","useImperativeHandle"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,gBAAgB,EAAEC,aAAa,QAAQ,4BAA4B;AAC5E,SAASC,6BAA6B,QAAQ,0BAA0B;AACxE,SAASC,eAAe,QAAQ,uBAAoB;AAEpD,SAASC,0BAA0B,EAAEC,uCAAuC,QAAQ,iBAAc;AAClG,SAASC,cAAc,QAAQ,sBAAmB;AASlD,OAAO,MAAMC,oCAAoC,CAC/CC,SAEA,IAAIC,YAA+C,0BAA0B;QAC3EC,SAAS;QACTC,YAAY;QACZC,UAAU;QACVJ;IACF,GAAG;AAEL,OAAO,SAASK,oBACdC,OAAgC;IAEhC,MAAM,EAAEC,aAAa,EAAEC,aAAaC,mBAAmB,EAAE,GAAGH;IAC5D,MAAMI,kBAAkBnB,MAAMoB,MAAM,CAAC;IACrC,MAAMC,gCAAgCrB,MAAMoB,MAAM,CAAC;IACnD,MAAME,cAActB,MAAMoB,MAAM,CAAgB;IAChD,MAAMG,kBAAkBvB,MAAMoB,MAAM,CAAgB;IACpD,MAAMI,kBAAkBxB,MAAMoB,MAAM,CAAuB;IAC3D,MAAMK,yBAAyBzB,MAAMoB,MAAM,CAAC;IAE5C,MAAMM,kBAAkB1B,MAAM2B,WAAW,CAAC;YACxCH;SAAAA,2BAAAA,gBAAgBI,OAAO,cAAvBJ,+CAAAA,yBAAyBE,eAAe,CAAC;IAC3C,GAAG,EAAE;IAEL,MAAMG,eAAe7B,MAAM2B,WAAW,CAAC,CAACG;QACtC,IAAIA,IAAI;YACNR,YAAYM,OAAO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;gBACpB,IAAI,CAAC5B,WAAWN,OAAO,EAAE;oBACvB;gBACF;gBAEA,MAAMI,SAASC;gBACf,IAAI,CAACD,QAAQ;oBACX;gBACF;gBAEAzB,eAAeyB;YACjB;YACA+B;gBACEtC,uBAAuBG,OAAO,GAAG;gBACjCC;YACF;YACAmC;gBACEvC,uBAAuBG,OAAO,GAAG;gBACjCF;YACF;YACAuC;gBACE3B,mCAAmC;YACrC;YACA4B;gBACE5B,mCAAmC;YACrC;QACF,CAAA,GACA;QACEH;QACAD;QACAL;QACAH;QACAe;QACAD;QACAP;QACAK;KACD;IAGHtC,MAAMmE,mBAAmB,CAACnD,eAAe,IAAM+B;IAE/C,OAAO;QAAEb,YAAYhC,cAAcgC,YAAYE;QAAqBZ;QAAiBuB;IAAW;AAClG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import * as React from
|
|
3
|
-
import { useFluent_unstable as useFluent } from
|
|
4
|
-
import { isHTMLElement } from
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { useFluent_unstable as useFluent } from "@fluentui/react-shared-contexts";
|
|
4
|
+
import { isHTMLElement } from "@fluentui/react-utilities";
|
|
5
5
|
export function useOptionWalker(options) {
|
|
6
6
|
const { matchOption } = options;
|
|
7
7
|
const { targetDocument } = useFluent();
|
package/lib/button/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { useARIAButtonProps } from
|
|
1
|
+
export { useARIAButtonProps } from "./useARIAButtonProps.js";
|
|
2
2
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
3
|
-
export { useARIAButtonShorthand } from
|
|
3
|
+
export { useARIAButtonShorthand } from "./useARIAButtonShorthand.js";
|
package/lib/button/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/button/index.ts"],"sourcesContent":["export { useARIAButtonProps } from './useARIAButtonProps';\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport { useARIAButtonShorthand } from './useARIAButtonShorthand';\nexport type {\n ARIAButtonAlteredProps,\n ARIAButtonElement,\n ARIAButtonElementIntersection,\n ARIAButtonProps,\n ARIAButtonResultProps,\n ARIAButtonSlotProps,\n ARIAButtonType,\n} from './types';\n"],"names":["useARIAButtonProps","useARIAButtonShorthand"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,
|
|
1
|
+
{"version":3,"sources":["../src/button/index.ts"],"sourcesContent":["export { useARIAButtonProps } from './useARIAButtonProps';\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport { useARIAButtonShorthand } from './useARIAButtonShorthand';\nexport type {\n ARIAButtonAlteredProps,\n ARIAButtonElement,\n ARIAButtonElementIntersection,\n ARIAButtonProps,\n ARIAButtonResultProps,\n ARIAButtonSlotProps,\n ARIAButtonType,\n} from './types';\n"],"names":["useARIAButtonProps","useARIAButtonShorthand"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,0BAAuB;AAC1D,4DAA4D;AAC5D,SAASC,sBAAsB,QAAQ,8BAA2B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { Enter, Space } from
|
|
3
|
-
import { useEventCallback } from
|
|
2
|
+
import { Enter, Space } from "@fluentui/keyboard-keys";
|
|
3
|
+
import { useEventCallback } from "@fluentui/react-utilities";
|
|
4
4
|
/**
|
|
5
5
|
* Button keyboard handling, role, disabled and tabIndex implementation that ensures ARIA spec
|
|
6
6
|
* for multiple scenarios of non native button elements. Ensuring 1st rule of ARIA for cases
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { resolveShorthand } from
|
|
3
|
-
import { useARIAButtonProps } from
|
|
2
|
+
import { resolveShorthand } from "@fluentui/react-utilities";
|
|
3
|
+
import { useARIAButtonProps } from "./useARIAButtonProps.js";
|
|
4
4
|
/**
|
|
5
5
|
* @internal
|
|
6
6
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/button/useARIAButtonShorthand.ts"],"sourcesContent":["'use client';\n\nimport { resolveShorthand } from '@fluentui/react-utilities';\nimport { useARIAButtonProps } from './useARIAButtonProps';\nimport type { ResolveShorthandFunction } from '@fluentui/react-utilities';\nimport type { ARIAButtonProps, ARIAButtonSlotProps, ARIAButtonType } from './types';\n\n/**\n * @internal\n *\n * @deprecated use useARIAButtonProps instead\n *\n * This function expects to receive a slot, if `as` property is not desired use `useARIAButtonProps` instead\n *\n * Button keyboard handling, role, disabled and tabIndex implementation that ensures ARIA spec\n * for multiple scenarios of shorthand properties. Ensuring 1st rule of ARIA for cases\n * where no attribute addition is required.\n */\nexport const useARIAButtonShorthand = ((value, options) => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const shorthand = resolveShorthand(value, options);\n const shorthandARIAButton = useARIAButtonProps<ARIAButtonType, ARIAButtonProps>(shorthand?.as ?? 'button', shorthand);\n return shorthand && shorthandARIAButton;\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n}) as ResolveShorthandFunction<ARIAButtonSlotProps>;\n"],"names":["resolveShorthand","useARIAButtonProps","useARIAButtonShorthand","value","options","shorthand","shorthandARIAButton","as"],"mappings":"AAAA;AAEA,SAASA,gBAAgB,QAAQ,4BAA4B;AAC7D,SAASC,kBAAkB,QAAQ,
|
|
1
|
+
{"version":3,"sources":["../src/button/useARIAButtonShorthand.ts"],"sourcesContent":["'use client';\n\nimport { resolveShorthand } from '@fluentui/react-utilities';\nimport { useARIAButtonProps } from './useARIAButtonProps';\nimport type { ResolveShorthandFunction } from '@fluentui/react-utilities';\nimport type { ARIAButtonProps, ARIAButtonSlotProps, ARIAButtonType } from './types';\n\n/**\n * @internal\n *\n * @deprecated use useARIAButtonProps instead\n *\n * This function expects to receive a slot, if `as` property is not desired use `useARIAButtonProps` instead\n *\n * Button keyboard handling, role, disabled and tabIndex implementation that ensures ARIA spec\n * for multiple scenarios of shorthand properties. Ensuring 1st rule of ARIA for cases\n * where no attribute addition is required.\n */\nexport const useARIAButtonShorthand = ((value, options) => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const shorthand = resolveShorthand(value, options);\n const shorthandARIAButton = useARIAButtonProps<ARIAButtonType, ARIAButtonProps>(shorthand?.as ?? 'button', shorthand);\n return shorthand && shorthandARIAButton;\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n}) as ResolveShorthandFunction<ARIAButtonSlotProps>;\n"],"names":["resolveShorthand","useARIAButtonProps","useARIAButtonShorthand","value","options","shorthand","shorthandARIAButton","as"],"mappings":"AAAA;AAEA,SAASA,gBAAgB,QAAQ,4BAA4B;AAC7D,SAASC,kBAAkB,QAAQ,0BAAuB;AAI1D;;;;;;;;;;CAUC,GACD,OAAO,MAAMC,yBAA0B,CAACC,OAAOC;IAC7C,4DAA4D;IAC5D,MAAMC,YAAYL,iBAAiBG,OAAOC;QACsCC;IAAhF,MAAMC,sBAAsBL,mBAAoDI,CAAAA,gBAAAA,sBAAAA,gCAAAA,UAAWE,EAAE,cAAbF,2BAAAA,gBAAiB,UAAUA;IAC3G,OAAOA,aAAaC;AACpB,4DAA4D;AAC9D,EAAoD"}
|
package/lib/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { // eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
2
|
-
useARIAButtonShorthand, useARIAButtonProps } from
|
|
3
|
-
export { useActiveDescendant, ACTIVEDESCENDANT_FOCUSVISIBLE_ATTRIBUTE, ActiveDescendantContextProvider, useActiveDescendantContext, useHasParentActiveDescendantContext } from
|
|
4
|
-
export { AriaLiveAnnouncer, renderAriaLiveAnnouncer_unstable, useAriaLiveAnnouncer_unstable, useAriaLiveAnnouncerContextValues_unstable } from
|
|
5
|
-
export { useTypingAnnounce } from
|
|
2
|
+
useARIAButtonShorthand, useARIAButtonProps } from "./button/index.js";
|
|
3
|
+
export { useActiveDescendant, ACTIVEDESCENDANT_FOCUSVISIBLE_ATTRIBUTE, ActiveDescendantContextProvider, useActiveDescendantContext, useHasParentActiveDescendantContext } from "./activedescendant/index.js";
|
|
4
|
+
export { AriaLiveAnnouncer, renderAriaLiveAnnouncer_unstable, useAriaLiveAnnouncer_unstable, useAriaLiveAnnouncerContextValues_unstable } from "./AriaLiveAnnouncer/index.js";
|
|
5
|
+
export { useTypingAnnounce } from "./useTypingAnnounce/index.js";
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n useARIAButtonShorthand,\n useARIAButtonProps,\n} from './button/index';\nexport {\n useActiveDescendant,\n ACTIVEDESCENDANT_FOCUSVISIBLE_ATTRIBUTE,\n ActiveDescendantContextProvider,\n useActiveDescendantContext,\n useHasParentActiveDescendantContext,\n} from './activedescendant';\nexport type {\n ActiveDescendantImperativeRef,\n ActiveDescendantOptions,\n ActiveDescendantContextValue,\n ActiveDescendantChangeEvent,\n} from './activedescendant';\nexport type {\n ARIAButtonSlotProps,\n ARIAButtonProps,\n ARIAButtonResultProps,\n ARIAButtonType,\n ARIAButtonElement,\n ARIAButtonElementIntersection,\n ARIAButtonAlteredProps,\n} from './button/index';\n\nexport {\n AriaLiveAnnouncer,\n renderAriaLiveAnnouncer_unstable,\n useAriaLiveAnnouncer_unstable,\n useAriaLiveAnnouncerContextValues_unstable,\n} from './AriaLiveAnnouncer/index';\nexport type { AriaLiveAnnouncerProps, AriaLiveAnnouncerState } from './AriaLiveAnnouncer/index';\n\nexport { useTypingAnnounce } from './useTypingAnnounce/index';\n"],"names":["useARIAButtonShorthand","useARIAButtonProps","useActiveDescendant","ACTIVEDESCENDANT_FOCUSVISIBLE_ATTRIBUTE","ActiveDescendantContextProvider","useActiveDescendantContext","useHasParentActiveDescendantContext","AriaLiveAnnouncer","renderAriaLiveAnnouncer_unstable","useAriaLiveAnnouncer_unstable","useAriaLiveAnnouncerContextValues_unstable","useTypingAnnounce"],"mappings":"AAAA,SACE,4DAA4D;AAC5DA,sBAAsB,EACtBC,kBAAkB,QACb,
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n useARIAButtonShorthand,\n useARIAButtonProps,\n} from './button/index';\nexport {\n useActiveDescendant,\n ACTIVEDESCENDANT_FOCUSVISIBLE_ATTRIBUTE,\n ActiveDescendantContextProvider,\n useActiveDescendantContext,\n useHasParentActiveDescendantContext,\n} from './activedescendant';\nexport type {\n ActiveDescendantImperativeRef,\n ActiveDescendantOptions,\n ActiveDescendantContextValue,\n ActiveDescendantChangeEvent,\n} from './activedescendant';\nexport type {\n ARIAButtonSlotProps,\n ARIAButtonProps,\n ARIAButtonResultProps,\n ARIAButtonType,\n ARIAButtonElement,\n ARIAButtonElementIntersection,\n ARIAButtonAlteredProps,\n} from './button/index';\n\nexport {\n AriaLiveAnnouncer,\n renderAriaLiveAnnouncer_unstable,\n useAriaLiveAnnouncer_unstable,\n useAriaLiveAnnouncerContextValues_unstable,\n} from './AriaLiveAnnouncer/index';\nexport type { AriaLiveAnnouncerProps, AriaLiveAnnouncerState } from './AriaLiveAnnouncer/index';\n\nexport { useTypingAnnounce } from './useTypingAnnounce/index';\n"],"names":["useARIAButtonShorthand","useARIAButtonProps","useActiveDescendant","ACTIVEDESCENDANT_FOCUSVISIBLE_ATTRIBUTE","ActiveDescendantContextProvider","useActiveDescendantContext","useHasParentActiveDescendantContext","AriaLiveAnnouncer","renderAriaLiveAnnouncer_unstable","useAriaLiveAnnouncer_unstable","useAriaLiveAnnouncerContextValues_unstable","useTypingAnnounce"],"mappings":"AAAA,SACE,4DAA4D;AAC5DA,sBAAsB,EACtBC,kBAAkB,QACb,oBAAiB;AACxB,SACEC,mBAAmB,EACnBC,uCAAuC,EACvCC,+BAA+B,EAC/BC,0BAA0B,EAC1BC,mCAAmC,QAC9B,8BAAqB;AAiB5B,SACEC,iBAAiB,EACjBC,gCAAgC,EAChCC,6BAA6B,EAC7BC,0CAA0C,QACrC,+BAA4B;AAGnC,SAASC,iBAAiB,QAAQ,+BAA4B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { useTypingAnnounce } from
|
|
1
|
+
export { useTypingAnnounce } from "./useTypingAnnounce.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/useTypingAnnounce/index.ts"],"sourcesContent":["export { useTypingAnnounce } from './useTypingAnnounce';\n"],"names":["useTypingAnnounce"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,
|
|
1
|
+
{"version":3,"sources":["../src/useTypingAnnounce/index.ts"],"sourcesContent":["export { useTypingAnnounce } from './useTypingAnnounce';\n"],"names":["useTypingAnnounce"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,yBAAsB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import * as React from
|
|
3
|
-
import { useTimeout } from
|
|
4
|
-
import { useAnnounce, useFluent_unstable as useFluent } from
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { useTimeout } from "@fluentui/react-utilities";
|
|
4
|
+
import { useAnnounce, useFluent_unstable as useFluent } from "@fluentui/react-shared-contexts";
|
|
5
5
|
const valueMutationOptions = {
|
|
6
6
|
attributes: true,
|
|
7
7
|
subtree: true,
|
|
@@ -9,9 +9,9 @@ Object.defineProperty(exports, "AriaLiveAnnouncer", {
|
|
|
9
9
|
return AriaLiveAnnouncer;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
const _renderAriaLiveAnnouncer = require("./renderAriaLiveAnnouncer");
|
|
13
|
-
const _useAriaLiveAnnouncer = require("./useAriaLiveAnnouncer");
|
|
14
|
-
const _useAriaLiveAnnouncerContextValues = require("./useAriaLiveAnnouncerContextValues");
|
|
12
|
+
const _renderAriaLiveAnnouncer = require("./renderAriaLiveAnnouncer.cjs");
|
|
13
|
+
const _useAriaLiveAnnouncer = require("./useAriaLiveAnnouncer.cjs");
|
|
14
|
+
const _useAriaLiveAnnouncerContextValues = require("./useAriaLiveAnnouncerContextValues.cjs");
|
|
15
15
|
const AriaLiveAnnouncer = (props)=>{
|
|
16
16
|
const state = (0, _useAriaLiveAnnouncer.useAriaLiveAnnouncer_unstable)(props);
|
|
17
17
|
const contextValues = (0, _useAriaLiveAnnouncerContextValues.useAriaLiveAnnouncerContextValues_unstable)(state);
|
|
@@ -22,7 +22,7 @@ _export(exports, {
|
|
|
22
22
|
return _useAriaLiveAnnouncer.useAriaLiveAnnouncer_unstable;
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
|
-
const _AriaLiveAnnouncer = require("./AriaLiveAnnouncer");
|
|
26
|
-
const _renderAriaLiveAnnouncer = require("./renderAriaLiveAnnouncer");
|
|
27
|
-
const _useAriaLiveAnnouncer = require("./useAriaLiveAnnouncer");
|
|
28
|
-
const _useAriaLiveAnnouncerContextValues = require("./useAriaLiveAnnouncerContextValues");
|
|
25
|
+
const _AriaLiveAnnouncer = require("./AriaLiveAnnouncer.cjs");
|
|
26
|
+
const _renderAriaLiveAnnouncer = require("./renderAriaLiveAnnouncer.cjs");
|
|
27
|
+
const _useAriaLiveAnnouncer = require("./useAriaLiveAnnouncer.cjs");
|
|
28
|
+
const _useAriaLiveAnnouncerContextValues = require("./useAriaLiveAnnouncerContextValues.cjs");
|
|
@@ -12,8 +12,8 @@ Object.defineProperty(exports, "useAriaLiveAnnouncer_unstable", {
|
|
|
12
12
|
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
13
13
|
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
14
14
|
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
|
|
15
|
-
const _useDomAnnounce = require("./useDomAnnounce");
|
|
16
|
-
const _useAriaNotifyAnnounce = require("./useAriaNotifyAnnounce");
|
|
15
|
+
const _useDomAnnounce = require("./useDomAnnounce.cjs");
|
|
16
|
+
const _useAriaNotifyAnnounce = require("./useAriaNotifyAnnounce.cjs");
|
|
17
17
|
const useAriaLiveAnnouncer_unstable = (props)=>{
|
|
18
18
|
const { targetDocument } = (0, _reactsharedcontexts.useFluent_unstable)();
|
|
19
19
|
const domAnnounce = (0, _useDomAnnounce.useDomAnnounce_unstable)();
|
|
@@ -31,6 +31,6 @@ _export(exports, {
|
|
|
31
31
|
return _ActiveDescendantContext.useHasParentActiveDescendantContext;
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
|
-
const _ActiveDescendantContext = require("./ActiveDescendantContext");
|
|
35
|
-
const _useActiveDescendant = require("./useActiveDescendant");
|
|
36
|
-
const _constants = require("./constants");
|
|
34
|
+
const _ActiveDescendantContext = require("./ActiveDescendantContext.cjs");
|
|
35
|
+
const _useActiveDescendant = require("./useActiveDescendant.cjs");
|
|
36
|
+
const _constants = require("./constants.cjs");
|
|
@@ -21,9 +21,9 @@ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildc
|
|
|
21
21
|
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
22
22
|
const _reactutilities = require("@fluentui/react-utilities");
|
|
23
23
|
const _reacttabster = require("@fluentui/react-tabster");
|
|
24
|
-
const _useOptionWalker = require("./useOptionWalker");
|
|
25
|
-
const _constants = require("./constants");
|
|
26
|
-
const _scrollIntoView = require("./scrollIntoView");
|
|
24
|
+
const _useOptionWalker = require("./useOptionWalker.cjs");
|
|
25
|
+
const _constants = require("./constants.cjs");
|
|
26
|
+
const _scrollIntoView = require("./scrollIntoView.cjs");
|
|
27
27
|
const createActiveDescendantChangeEvent = (detail)=>new CustomEvent('activedescendantchange', {
|
|
28
28
|
bubbles: true,
|
|
29
29
|
cancelable: false,
|
|
@@ -16,5 +16,5 @@ _export(exports, {
|
|
|
16
16
|
return _useARIAButtonShorthand.useARIAButtonShorthand;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
|
-
const _useARIAButtonProps = require("./useARIAButtonProps");
|
|
20
|
-
const _useARIAButtonShorthand = require("./useARIAButtonShorthand");
|
|
19
|
+
const _useARIAButtonProps = require("./useARIAButtonProps.cjs");
|
|
20
|
+
const _useARIAButtonShorthand = require("./useARIAButtonShorthand.cjs");
|
|
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "useARIAButtonShorthand", {
|
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
const _reactutilities = require("@fluentui/react-utilities");
|
|
13
|
-
const _useARIAButtonProps = require("./useARIAButtonProps");
|
|
13
|
+
const _useARIAButtonProps = require("./useARIAButtonProps.cjs");
|
|
14
14
|
const useARIAButtonShorthand = (value, options)=>{
|
|
15
15
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
16
16
|
const shorthand = (0, _reactutilities.resolveShorthand)(value, options);
|
|
@@ -47,7 +47,7 @@ _export(exports, {
|
|
|
47
47
|
return _index2.useTypingAnnounce;
|
|
48
48
|
}
|
|
49
49
|
});
|
|
50
|
-
const _index = require("./button/index");
|
|
51
|
-
const _activedescendant = require("./activedescendant");
|
|
52
|
-
const _index1 = require("./AriaLiveAnnouncer/index");
|
|
53
|
-
const _index2 = require("./useTypingAnnounce/index");
|
|
50
|
+
const _index = require("./button/index.cjs");
|
|
51
|
+
const _activedescendant = require("./activedescendant/index.cjs");
|
|
52
|
+
const _index1 = require("./AriaLiveAnnouncer/index.cjs");
|
|
53
|
+
const _index2 = require("./useTypingAnnounce/index.cjs");
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-aria",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.74.3-experimental.esm.20260709-49ee7a20cf.0",
|
|
4
4
|
"description": "React helper to ensure ARIA",
|
|
5
|
-
"main": "lib-commonjs/index.
|
|
5
|
+
"main": "lib-commonjs/index.cjs",
|
|
6
6
|
"module": "lib/index.js",
|
|
7
7
|
"typings": "./dist/index.d.ts",
|
|
8
8
|
"sideEffects": false,
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
},
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@fluentui/keyboard-keys": "
|
|
16
|
-
"@fluentui/react-shared-contexts": "
|
|
17
|
-
"@fluentui/react-jsx-runtime": "
|
|
18
|
-
"@fluentui/react-tabster": "
|
|
19
|
-
"@fluentui/react-utilities": "
|
|
15
|
+
"@fluentui/keyboard-keys": "9.74.3-experimental.esm.20260709-49ee7a20cf.0",
|
|
16
|
+
"@fluentui/react-shared-contexts": "9.74.3-experimental.esm.20260709-49ee7a20cf.0",
|
|
17
|
+
"@fluentui/react-jsx-runtime": "9.74.3-experimental.esm.20260709-49ee7a20cf.0",
|
|
18
|
+
"@fluentui/react-tabster": "9.74.3-experimental.esm.20260709-49ee7a20cf.0",
|
|
19
|
+
"@fluentui/react-utilities": "9.74.3-experimental.esm.20260709-49ee7a20cf.0",
|
|
20
20
|
"@swc/helpers": "^0.5.1"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
@@ -25,25 +25,26 @@
|
|
|
25
25
|
"react": ">=16.14.0 <20.0.0",
|
|
26
26
|
"react-dom": ">=16.14.0 <20.0.0"
|
|
27
27
|
},
|
|
28
|
-
"beachball": {
|
|
29
|
-
"disallowedChangeTypes": [
|
|
30
|
-
"major",
|
|
31
|
-
"prerelease"
|
|
32
|
-
]
|
|
33
|
-
},
|
|
28
|
+
"beachball": {},
|
|
34
29
|
"exports": {
|
|
35
30
|
".": {
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
31
|
+
"import": {
|
|
32
|
+
"types": "./dist/index.d.ts",
|
|
33
|
+
"default": "./lib/index.js"
|
|
34
|
+
},
|
|
35
|
+
"require": {
|
|
36
|
+
"types": "./dist/index.d.cts",
|
|
37
|
+
"default": "./lib-commonjs/index.cjs"
|
|
38
|
+
}
|
|
40
39
|
},
|
|
41
40
|
"./package.json": "./package.json"
|
|
42
41
|
},
|
|
43
42
|
"files": [
|
|
44
43
|
"*.md",
|
|
45
44
|
"dist/*.d.ts",
|
|
45
|
+
"dist/*.d.cts",
|
|
46
46
|
"lib",
|
|
47
47
|
"lib-commonjs"
|
|
48
|
-
]
|
|
48
|
+
],
|
|
49
|
+
"type": "module"
|
|
49
50
|
}
|
/package/lib-commonjs/AriaLiveAnnouncer/{AriaLiveAnnouncer.js.map → AriaLiveAnnouncer.cjs.map}
RENAMED
|
File without changes
|
/package/lib-commonjs/AriaLiveAnnouncer/{AriaLiveAnnouncer.types.js → AriaLiveAnnouncer.types.cjs}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/lib-commonjs/AriaLiveAnnouncer/{renderAriaLiveAnnouncer.js → renderAriaLiveAnnouncer.cjs}
RENAMED
|
File without changes
|
|
File without changes
|
/package/lib-commonjs/AriaLiveAnnouncer/{useAriaLiveAnnouncer.js.map → useAriaLiveAnnouncer.cjs.map}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/lib-commonjs/AriaLiveAnnouncer/{useAriaNotifyAnnounce.js → useAriaNotifyAnnounce.cjs}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/lib-commonjs/activedescendant/{ActiveDescendantContext.js → ActiveDescendantContext.cjs}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/lib-commonjs/activedescendant/{useActiveDescendant.js.map → useActiveDescendant.cjs.map}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/lib-commonjs/button/{useARIAButtonShorthand.js.map → useARIAButtonShorthand.cjs.map}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/lib-commonjs/useTypingAnnounce/{useTypingAnnounce.js.map → useTypingAnnounce.cjs.map}
RENAMED
|
File without changes
|