Skip to content

Commit

Permalink
fixup! feat(react-keytips): draft implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
mainframev committed Sep 2, 2024
1 parent 2d2a960 commit 129cb22
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
22 changes: 12 additions & 10 deletions packages/react-keytips/src/components/Keytip/Keytip.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,19 @@ export type KeytipSlots = {
content: NonNullable<Slot<'div'>>;
};

export type ExecuteKeytipEventHandler<E = HTMLElement> = EventHandler<
EventData<'keydown', KeyboardEvent> & {
targetElement: E;
}
>;
export type ExecuteKeytipEventHandler<E = PositioningProps['target']> =
EventHandler<
EventData<'keydown', KeyboardEvent> & {
targetElement: E;
}
>;

export type ReturnKeytipEventHandler<E = HTMLElement> = EventHandler<
EventData<'keydown', KeyboardEvent> & {
targetElement: E;
}
>;
export type ReturnKeytipEventHandler<E = PositioningProps['target']> =
EventHandler<
EventData<'keydown', KeyboardEvent> & {
targetElement: E;
}
>;

export type OnVisibleChangeData = {
visible: boolean;
Expand Down
3 changes: 2 additions & 1 deletion packages/react-keytips/src/hooks/useTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ import * as React from 'react';
import { sequencesToID, createNode } from '../utilities';
import { KTP_ROOT_ID } from '../constants';
import { useFluent } from '@fluentui/react-components';
import { PositioningProps } from '@fluentui/react-components';

export type KeytipTreeNode = Pick<
KeytipProps,
'keySequences' | 'onExecute' | 'onReturn' | 'dynamic'
> & {
id: string;
uniqueId: string;
target: HTMLElement | null;
target: PositioningProps['target'];
parent: string;
children: Set<string>;
};
Expand Down

0 comments on commit 129cb22

Please sign in to comment.