Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

[spike] remove callout component #372

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 0 additions & 7 deletions src/components/Callout/Callout.css

This file was deleted.

40 changes: 0 additions & 40 deletions src/components/Callout/Callout.md

This file was deleted.

7 changes: 0 additions & 7 deletions src/components/Callout/Callout.tsx

This file was deleted.

3 changes: 0 additions & 3 deletions src/components/Callout/index.ts

This file was deleted.

10 changes: 10 additions & 0 deletions src/components/Dropdown/Dropdown.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*! Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. */
@import 'src/css/variables/colors.css';
@import 'src/css/variables/fonts.css';
@import 'src/css/variables/borders.css';

/* Label element above the Dropdown */
.y-dropdown .ms-Dropdown-label {
Expand Down Expand Up @@ -87,3 +88,12 @@
.y-dropdown .ms-Callout-container {
z-index: 1000;
}

/* Prevent top shadow of callout from overlapping dropdown. */
.y-dropdown .ms-Dropdown {
z-index: 1001;
}

.y-dropdown .ms-Dropdown-callout {
@mixin borderStylePopOver;
}
7 changes: 7 additions & 0 deletions src/components/Hovercard/Hovercard.styles.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
/*! Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. */
import { palette } from '../../util/colors';
import { borderStylePopOver } from '../../util/styles/borders';
import { fontSizes, lineHeights } from '../../util/styles/fonts';
import { mergeStyleSets } from '@uifabric/styling';
import { memoizeFunction } from '@uifabric/utilities';
import { ICalloutContentStyles } from 'office-ui-fabric-react/lib/Callout';

export const getClassNames = memoizeFunction(() =>
mergeStyleSets({
modalContainer: {
width: '340px',
fontSize: fontSizes.medium,
lineHeight: lineHeights.medium,
...borderStylePopOver,
},
header: {
borderBottom: `2px solid ${palette.neutralLighter}`,
},
}),
);

export const getCalloutStyles = memoizeFunction((): Partial<ICalloutContentStyles> => {
return { root: borderStylePopOver };
});
2 changes: 1 addition & 1 deletion src/components/Hovercard/Hovercard.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*! Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. */
import * as React from 'react';
import { mount, ReactWrapper, shallow, ShallowWrapper } from 'enzyme';
import Callout from '../Callout';
import { Callout } from 'office-ui-fabric-react/lib/Callout';
import { KeyCodes } from '../../util/keyCodes';
import { Hovercard, HovercardProps, HovercardState, TriggerType } from '.';

Expand Down
5 changes: 3 additions & 2 deletions src/components/Hovercard/Hovercard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
import '../../yamui';
import * as React from 'react';
import { join } from '../../util/classNames';
import Callout, { DirectionalHint } from '../Callout';
import { Callout, DirectionalHint } from 'office-ui-fabric-react/lib/Callout';
import { NestableBaseComponentProps } from '../../util/BaseComponent/props';
import { KeyCodes } from '../../util/keyCodes';
import ScreenreaderText from '../ScreenreaderText';
import { getClassNames } from './Hovercard.styles';
import { getClassNames, getCalloutStyles } from './Hovercard.styles';

const hideDelay = 500;
const showDelay = 750;
Expand Down Expand Up @@ -117,6 +117,7 @@ export default class Hovercard extends React.Component<HovercardProps, Hovercard
target={this.triggerElement}
onDismiss={this.hide}
preventDismissOnScroll={false}
styles={getCalloutStyles}
>
<div
className={`y-hovercard--modal-container ${classNames.modalContainer}`}
Expand Down
2 changes: 2 additions & 0 deletions src/components/MenuButton/MenuButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { IconSize, BaseIcon } from '../Icon';
import MoreIcon from '../Icon/icons/More';
import MenuButtonItem from './MenuButtonItem';
import { MenuItemType } from './types';
import { getCalloutStyles } from './MenuButton.styles';
import './MenuButton.css';

export { MenuItemType };
Expand Down Expand Up @@ -139,6 +140,7 @@ export default class MenuButton extends React.Component<MenuButtonProps> {
contextualMenuItemAs: this.getMenuItemContent,
calloutProps: {
className: 'y-menu-button--callout',
styles: getCalloutStyles,
},
};
}
Expand Down