Skip to content

Commit

Permalink
some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Magnusrm committed Sep 27, 2023
1 parent 071dcda commit b14b3c6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 26 deletions.
5 changes: 0 additions & 5 deletions packages/react/src/components/ToggleGroup/ToggleGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ import { RovingTabindexRoot } from '../../utility-components/RovingTabIndex';

import classes from './ToggleGroup.module.css';

export type RovingTabindexItem = {
value: string;
element: HTMLElement;
};

export type ToggleGroupContextProps = {
value?: string;
defaultValue?: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,36 +1,16 @@
import { useContext, useId } from 'react';

import type { RovingTabindexItem } from '../ToggleGroup';
import { ToggleGroupContext } from '../ToggleGroup';
import type { ButtonProps } from '../../Button';

import type { ToggleGroupItemProps } from './ToggleGroupItem';

export type RovingTabindexContextProps = {
elements: React.MutableRefObject<Map<string, HTMLElement>>;
getOrderedItems: () => RovingTabindexItem[];
setFocusableValue: (value: string) => void;
focusableValue: string | null;
onShiftTab: () => void;
};

type UseToggleGroupItem = (props: ToggleGroupItemProps) => {
active: boolean;
size?: 'small' | 'medium' | 'large';
elements?: React.MutableRefObject<Map<string, HTMLElement>>;
keyDown?: (e: KeyboardEvent) => void;
buttonProps?: Pick<
ButtonProps,
| 'onClick'
| 'variant'
| 'tabIndex'
| 'iconPlacement'
| 'role'
| 'aria-checked'
| 'aria-current'
| 'name'
| 'onKeyDown'
| 'onFocus'
'id' | 'onClick' | 'role' | 'aria-checked' | 'aria-current' | 'name'
>;
};

Expand Down

0 comments on commit b14b3c6

Please sign in to comment.