From a5b0d64cbcd304c73640cb4259cf4ef4f0919088 Mon Sep 17 00:00:00 2001 From: Egor Smirnov Date: Thu, 22 Sep 2022 20:13:31 +0300 Subject: [PATCH] remove unused import --- src/components/FocusTrap/FocusTrap.tsx | 5 +++-- src/components/Tabs/Tabs.tsx | 6 ++++-- src/components/TabsItem/TabsItem.tsx | 1 - src/lib/accessibility.ts | 1 - 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/components/FocusTrap/FocusTrap.tsx b/src/components/FocusTrap/FocusTrap.tsx index 737b0f96e37..ee00359d3a1 100644 --- a/src/components/FocusTrap/FocusTrap.tsx +++ b/src/components/FocusTrap/FocusTrap.tsx @@ -3,7 +3,7 @@ import { useExternRef } from "../../hooks/useExternRef"; import { useGlobalEventListener } from "../../hooks/useGlobalEventListener"; import { useTimeout } from "../../hooks/useTimeout"; import { - FOCUSABLE_ELEMENTS_QUERY, + FOCUSABLE_ELEMENTS_LIST, Keys, pressedKey, } from "../../lib/accessibility"; @@ -12,6 +12,7 @@ import { useIsomorphicLayoutEffect } from "../../lib/useIsomorphicLayoutEffect"; import { HasComponent, HasRootRef } from "../../types"; import { AppRootContext } from "../AppRoot/AppRootContext"; +const FOCUSABLE_ELEMENTS: string = FOCUSABLE_ELEMENTS_LIST.join(); export interface FocusTrapProps extends React.AllHTMLAttributes, HasRootRef, @@ -69,7 +70,7 @@ export const FocusTrap = ({ const nodes: HTMLElement[] = []; Array.prototype.forEach.call( // eslint-disable-next-line no-restricted-properties - ref.current.querySelectorAll(FOCUSABLE_ELEMENTS_QUERY), + ref.current.querySelectorAll(FOCUSABLE_ELEMENTS), (focusableEl: Element) => { const { display, visibility } = window!.getComputedStyle(focusableEl); diff --git a/src/components/Tabs/Tabs.tsx b/src/components/Tabs/Tabs.tsx index 6fc60bc5423..dac4adde2c3 100644 --- a/src/components/Tabs/Tabs.tsx +++ b/src/components/Tabs/Tabs.tsx @@ -7,7 +7,7 @@ import { withAdaptivity, AdaptivityProps } from "../../hoc/withAdaptivity"; import { warnOnce } from "../../lib/warnOnce"; import { useGlobalEventListener } from "../../hooks/useGlobalEventListener"; import { useDOM } from "../../lib/dom"; -import { FOCUSABLE_ELEMENTS_QUERY, pressedKey } from "../../lib/accessibility"; +import { pressedKey } from "../../lib/accessibility"; import "./Tabs.css"; export interface TabsProps @@ -78,7 +78,9 @@ const TabsComponent = ({ return Array.from( // eslint-disable-next-line - tabsRef.current.querySelectorAll("[role=tab]:not([disabled])") + tabsRef.current.querySelectorAll( + "[role=tab]:not([disabled])" + ) ); } diff --git a/src/components/TabsItem/TabsItem.tsx b/src/components/TabsItem/TabsItem.tsx index 296705b612e..bf6d26e53ca 100644 --- a/src/components/TabsItem/TabsItem.tsx +++ b/src/components/TabsItem/TabsItem.tsx @@ -7,7 +7,6 @@ import { useAdaptivity } from "../../hooks/useAdaptivity"; import { TabsModeContext, TabsContextProps } from "../Tabs/Tabs"; import { Headline } from "../Typography/Headline/Headline"; import { Subhead } from "../Typography/Subhead/Subhead"; -import { Text } from "../Typography/Text/Text"; import { warnOnce } from "../../lib/warnOnce"; import "./TabsItem.css"; diff --git a/src/lib/accessibility.ts b/src/lib/accessibility.ts index 2c1bd2d3646..f9a590d37b4 100644 --- a/src/lib/accessibility.ts +++ b/src/lib/accessibility.ts @@ -13,7 +13,6 @@ export const FOCUSABLE_ELEMENTS_LIST = [ "[contenteditable]", '[tabindex]:not([tabindex="-1"])', ]; -export const FOCUSABLE_ELEMENTS_QUERY: string = FOCUSABLE_ELEMENTS_LIST.join(); export enum Keys { ENTER = "Enter",