From b05f84658a1b91bd260f0acd7d0984c2ed714e06 Mon Sep 17 00:00:00 2001 From: AAGaming Date: Sun, 18 Sep 2022 14:51:50 -0400 Subject: [PATCH] feat(components): add FocusRing --- src/deck-components/FocusRing.ts | 18 ++++++++++++++++++ src/deck-components/index.ts | 1 + 2 files changed, 19 insertions(+) create mode 100644 src/deck-components/FocusRing.ts diff --git a/src/deck-components/FocusRing.ts b/src/deck-components/FocusRing.ts new file mode 100644 index 0000000..d949eb2 --- /dev/null +++ b/src/deck-components/FocusRing.ts @@ -0,0 +1,18 @@ +import { ElementType, FC, ReactNode } from "react"; +import { findModuleChild } from "../webpack"; + +export interface FocusRingProps { + className?: string, + rootClassName?: string, + render?: ElementType, + children?: ReactNode, + NavigationManager?: any +} + +export const FocusRing = findModuleChild((m: any) => { + if (typeof m !== 'object') return false; + for (let prop in m) { + if (m[prop]?.toString()?.includes('.GetShowDebugFocusRing())')) return m[prop]; + } + return false; +}) as FC; \ No newline at end of file diff --git a/src/deck-components/index.ts b/src/deck-components/index.ts index 60d18ec..2eb94af 100755 --- a/src/deck-components/index.ts +++ b/src/deck-components/index.ts @@ -4,6 +4,7 @@ export * from './Carousel'; export * from './Dropdown'; export * from './Field'; export * from './Focusable'; +export * from './FocusRing'; export * from './FooterLegend'; export * from './Menu'; export * from './Modal';