Files
decky-frontend-lib/src/components/Focusable.tsx

17 lines
699 B
TypeScript
Raw Normal View History

2022-10-24 20:33:40 -04:00
import { HTMLAttributes, ReactNode, RefAttributes, VFC } from 'react';
import { Export, findModuleExport } from '../webpack';
2022-10-24 20:33:40 -04:00
import { FooterLegendProps } from './FooterLegend';
2022-06-08 21:40:19 -04:00
export interface FocusableProps extends HTMLAttributes<HTMLDivElement>, FooterLegendProps {
children: ReactNode;
2022-10-24 20:33:40 -04:00
'flow-children'?: string;
focusClassName?: string;
focusWithinClassName?: string;
noFocusRing?: boolean;
onActivate?: (e: CustomEvent) => void;
onCancel?: (e: CustomEvent) => void;
2022-06-08 21:40:19 -04:00
}
export const Focusable = findModuleExport((e: Export) => e?.render?.toString()?.includes('["flow-children","onActivate","onCancel","focusClassName",')) as VFC<FocusableProps & RefAttributes<HTMLDivElement>>;