Files
redash/client/app/lib/hooks/useUniqueId.ts
Rafael Wendel fb90b501cb Improve icon a11y (#5424)
* Added screen reader CSS

* Added description to external links

* Added spinner icon accessibility

* Added accessibility to exclamation and big message

* Added question and exclamation accessibility

* Hide decorative icons

* Standardized link design

* Added a11y to refresh icons

* Added aria-label to anchors and buttons

* Added a11y to conditional icons

* Added applicable labels to Ant Icons

* Changed escape to interpolation

* Replaced external links with opens in new tab

* Improved Tooltip hosts

* Added aria live to temporary elements

* Removed mistakenly added redundant helper

* Undoes unnecessarily added interpolation

* Replaced empty label with hidden

* Improved full icon label

* Improved display of live regions

* Added note

* remove unused class

* Created unique id

* Remove TODOs

* Proper action label

* Improved feedback for autocomplete toggle

* feature: add id hook

* refactor: use id hook

* standardize white space
2021-03-22 19:49:36 -03:00

8 lines
202 B
TypeScript

import { uniqueId } from "lodash";
import { useLazyRef } from "./useLazyRef";
export function useUniqueId(prefix: string) {
const { current: id } = useLazyRef(() => uniqueId(prefix));
return id;
}