@codecademy/gamut
72.2.472.2.5-alpha.619ec9.0
dist/Form/SelectDropdown/hooks/useNoOptionsAnnouncement.d.ts+
dist/Form/SelectDropdown/hooks/useNoOptionsAnnouncement.d.tsNew file+18
Index: package/dist/Form/SelectDropdown/hooks/useNoOptionsAnnouncement.d.ts
===================================================================
--- package/dist/Form/SelectDropdown/hooks/useNoOptionsAnnouncement.d.ts
+++ package/dist/Form/SelectDropdown/hooks/useNoOptionsAnnouncement.d.ts
@@ -0,0 +1,18 @@
+import { ComponentType, ReactNode } from 'react';
+interface UseNoOptionsAnnouncementReturn {
+ /** `NoOptionsMessage` override for react-select's `components` prop */
+ noOptionsMessageComponent: ComponentType<any>;
+ /** Current text for the standalone accessibility live region */
+ announcement: ReactNode;
+ /** Changes whenever `announcement` has a new value to announce */
+ announcementKey: number;
+}
+/**
+ * Announces react-select's "no options" menu text (its default "No options",
+ * or a custom `validationMessage`) to screen readers via a standalone live
+ * region. react-select's own live region only fires when its `options` prop
+ * is non-empty, so it never speaks the "no options" state - this fills that
+ * gap, including while a consumer is mid-fetch with an empty `options` array.
+ */
+export declare const useNoOptionsAnnouncement: () => UseNoOptionsAnnouncementReturn;
+export {};