From c25fe58f082d70a34443ac3c8b32b4528a4b01fb Mon Sep 17 00:00:00 2001 From: AAGaming Date: Fri, 26 Aug 2022 01:12:21 -0400 Subject: [PATCH] feat(Focusable): add FooterLegend props to Focusable and Field --- src/deck-components/Field.tsx | 3 ++- src/deck-components/Focusable.tsx | 3 ++- src/deck-components/FooterLegend.ts | 18 ++++++++++++++++++ src/deck-components/index.ts | 1 + 4 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 src/deck-components/FooterLegend.ts diff --git a/src/deck-components/Field.tsx b/src/deck-components/Field.tsx index bbddb44..591486a 100644 --- a/src/deck-components/Field.tsx +++ b/src/deck-components/Field.tsx @@ -1,7 +1,8 @@ import { FC, HTMLAttributes, ReactNode, RefAttributes } from 'react'; import { findModuleChild } from '../webpack'; +import { FooterLegendProps } from './FooterLegend'; -export interface FieldProps extends HTMLAttributes { +export interface FieldProps extends HTMLAttributes, FooterLegendProps { label?: string | ReactNode; bottomSeparator?: boolean; description?: string | ReactNode; diff --git a/src/deck-components/Focusable.tsx b/src/deck-components/Focusable.tsx index 8e2f2aa..497e6d8 100644 --- a/src/deck-components/Focusable.tsx +++ b/src/deck-components/Focusable.tsx @@ -1,7 +1,8 @@ import { HTMLAttributes, ReactNode, RefAttributes, VFC } from "react"; import { findModuleChild } from "../webpack"; +import { FooterLegendProps } from "./FooterLegend"; -export interface FocusableProps extends HTMLAttributes { +export interface FocusableProps extends HTMLAttributes, FooterLegendProps { children: ReactNode; "flow-children"?: string; focusClassName?: string; diff --git a/src/deck-components/FooterLegend.ts b/src/deck-components/FooterLegend.ts new file mode 100644 index 0000000..40ebc9f --- /dev/null +++ b/src/deck-components/FooterLegend.ts @@ -0,0 +1,18 @@ +export interface FooterLegendProps { + actionDescriptionMap?: unknown; + onOKActionDescription?: string; + onCancelActionDescription?: string; + onSecondaryActionDescription?: string; + onOptionsActionDescription?: string; + onMenuActionDescription?: string; + onButtonDown?: () => void; + onButtonUp?: () => void; + onOKButton?: () => void; + onCancelButton?: () => void; + onSecondaryButton?: () => void; + onOptionsButton?: () => void; + onGamepadDirection?: () => void; + onGamepadFocus?: () => void; + onGamepadBlur?: () => void; + onMenuButton?: () => void; +} \ No newline at end of file diff --git a/src/deck-components/index.ts b/src/deck-components/index.ts index df06f99..60d18ec 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 './FooterLegend'; export * from './Menu'; export * from './Modal'; export * from './Panel';