Skip to content

Commit

Permalink
chore: updates dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
bsunderhus committed Sep 9, 2022
1 parent 482fd16 commit 59ddb12
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 7 deletions.
3 changes: 2 additions & 1 deletion apps/public-docsite-v9/src/shims/MenuShim.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
MenuItemCheckbox,
MenuItemCheckboxProps,
MenuProps,
MenuDividerProps,
} from '@fluentui/react-components';

export const shimMenuProps = (props: IContextualMenuProps): Partial<MenuProps> => {
Expand Down Expand Up @@ -54,7 +55,7 @@ const shimMenuHeaderProps = (props: IContextualMenuItem): MenuGroupHeaderProps =
export const MenuItemShim = (props: IContextualMenuItem) => {
if (props.itemType === ContextualMenuItemType.Divider) {
const shimProps = shimMenuItemProps(props);
return <MenuDivider {...shimProps} />;
return <MenuDivider {...(shimProps as MenuDividerProps)} />;
}

if (props.itemType === ContextualMenuItemType.Section) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ import { isConformant } from '../../common/isConformant';
import { MenuTriggerContextProvider } from '../../contexts/menuTriggerContext';
import { MenuListProvider } from '../../contexts/menuListContext';
import { mockUseMenuContext } from '../../common/mockUseMenuContext';
import { MenuItemProps } from './MenuItem.types';

jest.mock('../../contexts/menuContext');

describe('MenuItem', () => {
isConformant({
Component: MenuItem,
Component: MenuItem as React.FunctionComponent<MenuItemProps>,
displayName: 'MenuItem',
testOptions: {
'has-static-classnames': [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ import { MenuItemCheckbox } from './MenuItemCheckbox';
import { MenuListProvider } from '../../contexts/menuListContext';
import { mockUseMenuContext } from '../../common/mockUseMenuContext';
import type { MenuListContextValue } from '../../contexts/menuListContext';
import { MenuItemCheckboxProps } from './MenuItemCheckbox.types';

jest.mock('../../contexts/menuContext');

describe('MenuItemCheckbox conformance', () => {
isConformant({
Component: MenuItemCheckbox,
Component: MenuItemCheckbox as React.FunctionComponent<MenuItemCheckboxProps>,
requiredProps: {
name: 'checkbox',
value: '1',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ import { MenuItemRadio } from './MenuItemRadio';
import { isConformant } from '../../common/isConformant';
import { MenuListProvider } from '../../contexts/menuListContext';
import type { MenuListContextValue } from '../../contexts/menuListContext';
import { MenuItemRadioProps } from './MenuItemRadio.types';

describe('MenuItemRadio', () => {
isConformant({
Component: MenuItemRadio,
Component: MenuItemRadio as React.FunctionComponent<MenuItemRadioProps>,
requiredProps: {
name: 'radio',
value: '1',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ export const TestOverflowMenuItem: React.FC<TestOverflowMenuItemProps> = props =
return null;
}

return <MenuItem {...rest}>Item {id}</MenuItem>;
// As an union between button props and div props may be conflicting, casting is required
return <MenuItem {...(rest as MenuItemProps)}>Item {id}</MenuItem>;
};

export const TestOverflowMenuDivider: React.FC<{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
MoreHorizontalRegular,
} from '@fluentui/react-icons';
import { useIsOverflowItemVisible, useOverflowMenu, Overflow, OverflowItem } from '@fluentui/react-overflow';
import { ARIAButtonElement } from '@fluentui/react-aria/src/index';

//----- Example Tab Data -----//

Expand Down Expand Up @@ -88,7 +89,7 @@ const tabs: ExampleTab[] = [

type OverflowMenuItemProps = {
tab: ExampleTab;
onClick: React.MouseEventHandler<HTMLDivElement>;
onClick: React.MouseEventHandler<ARIAButtonElement<'div'>>;
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const ToolbarOverflowMenuItem: React.FC<ToolbarOverflowMenuItemProps> = p
return <MenuItem icon={<TextItalic16Regular />}> Italic</MenuItem>;
}

return <MenuItem {...rest}>Item {id}</MenuItem>;
return <MenuItem {...(rest as MenuItemProps)}>Item {id}</MenuItem>;
};

export const ToolbarMenuOverflowDivider: React.FC<{
Expand Down

0 comments on commit 59ddb12

Please sign in to comment.