diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 853c516dad6896..7b8cb59f31cd8b 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -86,7 +86,7 @@ OverflowSet/ @micahgodbolt # Overlay/ # Panel/ # Persona/ -Persona/PersonaCoin.tsx @mtennoe @jakob101 +Persona/PersonaCoin/ @mtennoe @jakob101 Persona/PersonaConsts.tsx @mtennoe @jakob101 pickers/ @joschect # Pivot/ @@ -105,4 +105,59 @@ TeachingBubble/ @micahgodbolt Toggle/ @phkuo Tooltip/ @micahgodbolt +## Docs +# ActivityItem/docs/ +# Breadcrumb/docs/ +# Button/docs/ +Calendar/docs/ @lorejoh12 @sathi23 +Callout/docs/ @joschect +# Check/docs/ +# Checkbox/docs/ +ChoiceGroup/docs/ @srideshpande +# ColorPicker/docs/ +# ComboBox/docs/ +CommandBar/docs/ @micahgodbolt +ContextualMenu/docs/ @joschect +DatePicker/docs/ @lorejoh12 @sathi23 +# DetailsList/docs/ +# Dialog/docs/ +DocumentCard/docs/ @yiminwu @mikewheaton +# Dropdown/docs/ +# Fabric/docs/ +# FacePile/docs/ +# FocusTrapZone/docs/ +# FocusZone/docs/ +GroupedList/docs/ @aditima +HoverCard/docs/ @atneik @Jahnp +# Icon/docs/ +# Image/docs/ +# Label/docs/ +Layer/docs/ @ThomasMichon +# Link/docs/ +List/docs/ @cschleiden +# MarqueeSelection/docs/ +# MessageBar/docs/ +# Modal/docs/ +# Nav/docs/ +OverflowSet/docs/ @micahgodbolt +# Overlay/docs/ +# Panel/docs/ +# Persona/docs/ +pickers/docs/ @joschect +# Pivot/docs/ +# Popup/docs/ +# ProgressIndicator/docs/ +Rating/docs/ @cschleiden +ResizeGroup/docs/ @micahgodbolt +# SearchBox/docs/ +# Slider/docs/ +# SpinButton/docs/ +# Spinner/docs/ +# SwatchColorPicker/docs/ +TeachingBubble/docs/ @micahgodbolt +# TextField/docs/ +# Theme/docs/ +Toggle/docs/ @phkuo +Tooltip/docs/ @micahgodbolt + diff --git a/.npm-version b/.npm-version index ad98597185fb24..4cc0e35cb30cfc 100644 --- a/.npm-version +++ b/.npm-version @@ -1 +1 @@ -2.x \ No newline at end of file +5.6.0 \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 03a88d5329b50f..37768f45f95425 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,4 +7,4 @@ script: fi - npm run buildfast - npm run bundlesize - - npm run vrtest + - npm run vrtest \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json index cb4569a49b2bd3..88e721384038c1 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,13 +1,22 @@ { - "version": "0.1.0", - "command": "gulp", - "isShellCommand": true, + "version": "2.0.0", "tasks": [ { - "taskName": "bundle", - "isBuildCommand": true, - "showOutput": "always", - "isWatching": true + "label": "Typescript (oufr) watch", + "type": "process", + "command": "node", + "args": [ + "./scripts/node_modules/typescript/bin/tsc", + "-p", + "packages/office-ui-fabric-react/tsconfig.json", + "-w", + "--noEmit" + ], + "problemMatcher": "$tsc", + "group": { + "kind": "build", + "isDefault": true + } } ] } \ No newline at end of file diff --git a/apps/fabric-website/CHANGELOG.json b/apps/fabric-website/CHANGELOG.json index ec6015e7ba8ae1..549326a38cd410 100644 --- a/apps/fabric-website/CHANGELOG.json +++ b/apps/fabric-website/CHANGELOG.json @@ -1,6 +1,44 @@ { "name": "@uifabric/fabric-website", "entries": [ + { + "version": "5.7.0", + "tag": "@uifabric/fabric-website_v5.7.0", + "date": "Tue, 17 Apr 2018 18:47:11 GMT", + "comments": { + "minor": [ + { + "author": "lynamemi ", + "commit": "8829b1fde1bbe2e6920b5e619727835184a15b45", + "comment": "GetStarted page: Give titles links to their corresponding pages." + } + ], + "dependency": [ + { + "comment": "Updating dependency \"office-ui-fabric-react\" from `>=5.82.1 <6.0.0` to `>=5.82.2 <6.0.0`" + } + ] + } + }, + { + "version": "5.6.1", + "tag": "@uifabric/fabric-website_v5.6.1", + "date": "Mon, 16 Apr 2018 10:23:26 GMT", + "comments": { + "patch": [ + { + "author": "David Zearing ", + "commit": "6f8a180ae2ecca66d09be97e48e8e03cc17d4d9e", + "comment": "Updating build to React 16.3.1." + } + ], + "dependency": [ + { + "comment": "Updating dependency \"office-ui-fabric-react\" from `>=5.81.1 <6.0.0` to `>=5.82.0 <6.0.0`" + } + ] + } + }, { "version": "5.6.0", "tag": "@uifabric/fabric-website_v5.6.0", diff --git a/apps/fabric-website/CHANGELOG.md b/apps/fabric-website/CHANGELOG.md index d9d87e339be9db..2cb7da3dab9aa3 100644 --- a/apps/fabric-website/CHANGELOG.md +++ b/apps/fabric-website/CHANGELOG.md @@ -1,6 +1,20 @@ # Change Log - @uifabric/fabric-website -This log was last generated on Thu, 05 Apr 2018 10:15:39 GMT and should not be manually modified. +This log was last generated on Tue, 17 Apr 2018 18:47:11 GMT and should not be manually modified. + +## 5.7.0 +Tue, 17 Apr 2018 18:47:11 GMT + +### Minor changes + +- GetStarted page: Give titles links to their corresponding pages. + +## 5.6.1 +Mon, 16 Apr 2018 10:23:26 GMT + +### Patches + +- Updating build to React 16.3.1. ## 5.6.0 Thu, 05 Apr 2018 10:15:39 GMT diff --git a/apps/fabric-website/package.json b/apps/fabric-website/package.json index 98198f63c3a67d..5e4d27bc359376 100644 --- a/apps/fabric-website/package.json +++ b/apps/fabric-website/package.json @@ -1,6 +1,6 @@ { "name": "@uifabric/fabric-website", - "version": "5.6.0", + "version": "5.7.0", "description": "Reusable React components for building experiences for Office 365.", "main": "lib/index.js", "typings": "lib/index.d.ts", @@ -39,7 +39,7 @@ "@microsoft/load-themed-styles": "^1.7.13", "color-functions": "1.1.0", "json-loader": "^0.5.7", - "office-ui-fabric-react": ">=5.81.1 <6.0.0", + "office-ui-fabric-react": ">=5.89.0 <6.0.0", "tslib": "^1.7.1" } } \ No newline at end of file diff --git a/apps/fabric-website/src/components/App/App.tsx b/apps/fabric-website/src/components/App/App.tsx index 38b5c98c5e03ad..103875380d1d90 100644 --- a/apps/fabric-website/src/components/App/App.tsx +++ b/apps/fabric-website/src/components/App/App.tsx @@ -27,7 +27,7 @@ export class App extends React.Component { }; } - public componentDidMount() { + public componentDidMount(): void { window.addEventListener('scroll', this._handleNavPositioning); window.addEventListener('resize', this._handleNavPositioning); @@ -35,12 +35,12 @@ export class App extends React.Component { this._handleNavPositioning(); } - public componentWillUnmount() { + public componentWillUnmount(): void { window.removeEventListener('scroll', this._handleNavPositioning); window.removeEventListener('resize', this._handleNavPositioning); } - public render() { + public render(): JSX.Element { let { navHeight } = this.state; let navPosition: 'fixed' | 'absolute' = this.state.isAttached ? 'fixed' : 'absolute'; let navStyle = { diff --git a/apps/fabric-website/src/components/CodeBlock/CodeBlock.tsx b/apps/fabric-website/src/components/CodeBlock/CodeBlock.tsx index e5d8ce6a6f775d..4856de58c41120 100644 --- a/apps/fabric-website/src/components/CodeBlock/CodeBlock.tsx +++ b/apps/fabric-website/src/components/CodeBlock/CodeBlock.tsx @@ -49,7 +49,7 @@ export class CodeBlock extends React.Component this._onToggleClicked = this._onToggleClicked.bind(this); } - public render() { + public render(): JSX.Element { let { language, isCollapsible, isLightTheme, children } = this.props; let { isOpen } = this.state; diff --git a/apps/fabric-website/src/components/ColorTable/ColorTable.tsx b/apps/fabric-website/src/components/ColorTable/ColorTable.tsx index ed7c3d59482b01..c8668c67451a79 100644 --- a/apps/fabric-website/src/components/ColorTable/ColorTable.tsx +++ b/apps/fabric-website/src/components/ColorTable/ColorTable.tsx @@ -14,7 +14,7 @@ export interface IColorTableState { } export class ColorTable extends React.Component { - public render() { + public render(): JSX.Element { let { content } = this.props; return ( diff --git a/apps/fabric-website/src/components/DOIcon/DOIcon.tsx b/apps/fabric-website/src/components/DOIcon/DOIcon.tsx index e212f0f6c8a389..631ad9ced549aa 100644 --- a/apps/fabric-website/src/components/DOIcon/DOIcon.tsx +++ b/apps/fabric-website/src/components/DOIcon/DOIcon.tsx @@ -12,7 +12,7 @@ export class DOIcon extends React.Component { ariaHidden: true }; - public render() { + public render(): JSX.Element { return (
@@ -174,7 +174,7 @@ export class DONavigation extends React.Component { - public static defaultProps = { - role: 'menuitem' - }; + public static defaultProps = { + role: 'menuitem' + }; - public render() { - return ( - - { this._getIcon() } - { this.props.label } - - ); - } + public render(): JSX.Element { + return ( + + { this._getIcon() } + { this.props.label } + + ); + } - private _getIcon() { - if (this.props.icon) { - return ; - } + private _getIcon() { + if (this.props.icon) { + return ; } + } } \ No newline at end of file diff --git a/apps/fabric-website/src/components/DOSearchBox/DOSearchBox.tsx b/apps/fabric-website/src/components/DOSearchBox/DOSearchBox.tsx index 8ffd0bba489422..0400353f9881d3 100644 --- a/apps/fabric-website/src/components/DOSearchBox/DOSearchBox.tsx +++ b/apps/fabric-website/src/components/DOSearchBox/DOSearchBox.tsx @@ -2,17 +2,17 @@ import * as React from 'react'; import './DOSearchBox.scss'; export class DOSearchBox extends React.Component<{}, {}> { - public render() { + public render(): JSX.Element { return (
-
-
- - - -
-
-
+
+
+ + + +
+
+
); } } \ No newline at end of file diff --git a/apps/fabric-website/src/components/IconGrid/IconGrid.tsx b/apps/fabric-website/src/components/IconGrid/IconGrid.tsx index 08879b64d9e0d2..3a317fd721b66c 100644 --- a/apps/fabric-website/src/components/IconGrid/IconGrid.tsx +++ b/apps/fabric-website/src/components/IconGrid/IconGrid.tsx @@ -26,7 +26,7 @@ export class IconGrid extends React.Component { }; } - public render() { + public render(): JSX.Element { let { icons } = this.props; let { searchQuery } = this.state; @@ -57,7 +57,7 @@ export class IconGrid extends React.Component { ); } - private _onSearchQueryChanged(newValue) { + private _onSearchQueryChanged(newValue): void { this.setState({ 'searchQuery': newValue }); diff --git a/apps/fabric-website/src/components/Nav/Nav.tsx b/apps/fabric-website/src/components/Nav/Nav.tsx index df836511d6eabd..04b96ff55fa1e3 100644 --- a/apps/fabric-website/src/components/Nav/Nav.tsx +++ b/apps/fabric-website/src/components/Nav/Nav.tsx @@ -14,7 +14,7 @@ export interface INavState { export class Nav extends React.Component { - public render() { + public render(): JSX.Element { let { pages } = this.props; if (!pages) { diff --git a/apps/fabric-website/src/components/PageHeader/PageHeader.tsx b/apps/fabric-website/src/components/PageHeader/PageHeader.tsx index bafc2d4ce182d4..d63bd6bfd626c8 100644 --- a/apps/fabric-website/src/components/PageHeader/PageHeader.tsx +++ b/apps/fabric-website/src/components/PageHeader/PageHeader.tsx @@ -71,7 +71,7 @@ export class PageHeader extends BaseComponent { link?: HTMLAnchorElement } = {}; - public componentDidMount() { + public componentDidMount(): void { this._eventListener = this._eventListener.bind(this); this._getBreakpoint = this._getBreakpoint.bind(this); this._els.link.addEventListener('click', this._eventListener); @@ -23,7 +23,7 @@ export class PageHeaderLink extends React.Component { this._getBreakpoint(); } - public render() { + public render(): JSX.Element { return ( { this._els.link = a; } } href={ this.props.href } data-title={ this.props.text }>{ this.props.text } ); @@ -41,7 +41,7 @@ export class PageHeaderLink extends React.Component { } } - private _eventListener(event) { + private _eventListener(event): void { event.preventDefault(); history.pushState({}, '', this._els.link.getAttribute('href')); let navigatorUserAgent = navigator.userAgent.toLowerCase(); diff --git a/apps/fabric-website/src/components/Table/AnimationCell/AnimationCell.tsx b/apps/fabric-website/src/components/Table/AnimationCell/AnimationCell.tsx index f2f143e825b2b6..4870ddee18ca03 100644 --- a/apps/fabric-website/src/components/Table/AnimationCell/AnimationCell.tsx +++ b/apps/fabric-website/src/components/Table/AnimationCell/AnimationCell.tsx @@ -10,7 +10,7 @@ export class AnimationCell extends React.Component { super(props); } - public render() { + public render(): JSX.Element { const name = this.props.data[0].value; const animClass = this.props.data[1].value; diff --git a/apps/fabric-website/src/components/Table/Table.tsx b/apps/fabric-website/src/components/Table/Table.tsx index a9bcf0d2b8edb6..0dd67f4f21d285 100644 --- a/apps/fabric-website/src/components/Table/Table.tsx +++ b/apps/fabric-website/src/components/Table/Table.tsx @@ -31,7 +31,7 @@ export class Table extends React.Component { this._windowEventHandler(); } - public render() { + public render(): JSX.Element { let { content } = this.props; return (this.state.currentBreakpoint === 'mobile' && this.props.responsive) ? this._renderMobile(content) : this._renderDesktop(content); } diff --git a/apps/fabric-website/src/pages/BlogPage/BlogItem.tsx b/apps/fabric-website/src/pages/BlogPage/BlogItem.tsx index 5012d58ed50d89..263ed46fa1d847 100644 --- a/apps/fabric-website/src/pages/BlogPage/BlogItem.tsx +++ b/apps/fabric-website/src/pages/BlogPage/BlogItem.tsx @@ -12,7 +12,7 @@ export interface IBlogItem { } export class BlogItem extends React.Component { - public render() { + public render(): JSX.Element { return (
@@ -33,7 +33,7 @@ export class BlogItem extends React.Component { { this.props.title }

- Posted by {this.props.author} + Posted by { this.props.author }

{ this.props.previewDescription } diff --git a/apps/fabric-website/src/pages/BlogPage/BlogPage.tsx b/apps/fabric-website/src/pages/BlogPage/BlogPage.tsx index 686d320b7d8cab..0e70557dfb12d9 100644 --- a/apps/fabric-website/src/pages/BlogPage/BlogPage.tsx +++ b/apps/fabric-website/src/pages/BlogPage/BlogPage.tsx @@ -7,7 +7,7 @@ const styles: any = stylesImport; const blogData = require('../../data/blog-posts.json'); export class BlogPage extends React.Component { - public render() { + public render(): JSX.Element { return (

diff --git a/apps/fabric-website/src/pages/BlogPage/BlogPost.tsx b/apps/fabric-website/src/pages/BlogPage/BlogPost.tsx index 9e93ead4f9383e..f2eb361ac72ad9 100644 --- a/apps/fabric-website/src/pages/BlogPage/BlogPost.tsx +++ b/apps/fabric-website/src/pages/BlogPage/BlogPost.tsx @@ -11,7 +11,7 @@ export class BlogPost extends React.Component<{}, {}> { this._postId = this._getParameterByName('id'); } - public render() { + public render(): JSX.Element { return (
@@ -31,7 +31,7 @@ export class BlogPost extends React.Component<{}, {}> { ); } - private _getParameterByName(name: string, url?: string) { + private _getParameterByName(name: string, url?: string): string { if (!url) { url = window.location.href; } diff --git a/apps/fabric-website/src/pages/Components/ActivityItemComponentPage.tsx b/apps/fabric-website/src/pages/Components/ActivityItemComponentPage.tsx index 9f998585a05c85..d5a8b62c7b95e4 100644 --- a/apps/fabric-website/src/pages/Components/ActivityItemComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/ActivityItemComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class ActivityItemComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/BreadcrumbComponentPage.tsx b/apps/fabric-website/src/pages/Components/BreadcrumbComponentPage.tsx index f4f9be714e055c..1f5c650f113be1 100644 --- a/apps/fabric-website/src/pages/Components/BreadcrumbComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/BreadcrumbComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class BreadcrumbComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/ButtonComponentPage.tsx b/apps/fabric-website/src/pages/Components/ButtonComponentPage.tsx index 6a3232b9b1f1b4..ddbd8862a50a40 100644 --- a/apps/fabric-website/src/pages/Components/ButtonComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/ButtonComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class ButtonComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/CalendarComponentPage.tsx b/apps/fabric-website/src/pages/Components/CalendarComponentPage.tsx index 50bf399d2ee0fe..e69e2759099261 100644 --- a/apps/fabric-website/src/pages/Components/CalendarComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/CalendarComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class CalendarComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/CalloutComponentPage.tsx b/apps/fabric-website/src/pages/Components/CalloutComponentPage.tsx index dfe53b86345489..0f61628ccf9e25 100644 --- a/apps/fabric-website/src/pages/Components/CalloutComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/CalloutComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class CalloutComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/CheckboxComponentPage.tsx b/apps/fabric-website/src/pages/Components/CheckboxComponentPage.tsx index 0175c42a03ed8e..187ecf596d44cb 100644 --- a/apps/fabric-website/src/pages/Components/CheckboxComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/CheckboxComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class CheckboxComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/ChoiceGroupComponentPage.tsx b/apps/fabric-website/src/pages/Components/ChoiceGroupComponentPage.tsx index 4182b09dfb1a4e..53a58a52cad6ec 100644 --- a/apps/fabric-website/src/pages/Components/ChoiceGroupComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/ChoiceGroupComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class ChoiceGroupComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/CoachmarkComponentPage.tsx b/apps/fabric-website/src/pages/Components/CoachmarkComponentPage.tsx index 6096e069887363..ee8ad6e087fac4 100644 --- a/apps/fabric-website/src/pages/Components/CoachmarkComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/CoachmarkComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class CoachmarkComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/ColorPickerComponentPage.tsx b/apps/fabric-website/src/pages/Components/ColorPickerComponentPage.tsx index 4c9bd0ba381062..864849d170daad 100644 --- a/apps/fabric-website/src/pages/Components/ColorPickerComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/ColorPickerComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class ColorPickerComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/ComboBoxComponentPage.tsx b/apps/fabric-website/src/pages/Components/ComboBoxComponentPage.tsx index d28667aeabcd03..b4c2fdebd414ab 100644 --- a/apps/fabric-website/src/pages/Components/ComboBoxComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/ComboBoxComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class ComboBoxComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/CommandBarComponentPage.tsx b/apps/fabric-website/src/pages/Components/CommandBarComponentPage.tsx index 25be30d714a4fc..28b68e2bdf3930 100644 --- a/apps/fabric-website/src/pages/Components/CommandBarComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/CommandBarComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class CommandBarComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/ComponentUtilitiesPage.tsx b/apps/fabric-website/src/pages/Components/ComponentUtilitiesPage.tsx index bf17459fd3717b..a92bb1ac7e117c 100644 --- a/apps/fabric-website/src/pages/Components/ComponentUtilitiesPage.tsx +++ b/apps/fabric-website/src/pages/Components/ComponentUtilitiesPage.tsx @@ -4,7 +4,7 @@ import { ComponentPage, IComponentPageProps } from '../../components/ComponentPa const pageStyles: any = require('../PageStyles.module.scss'); export class ComponentUtilitiesPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/ContextualMenuComponentPage.tsx b/apps/fabric-website/src/pages/Components/ContextualMenuComponentPage.tsx index 1532af2aed26a6..dcc0d0f29ba739 100644 --- a/apps/fabric-website/src/pages/Components/ContextualMenuComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/ContextualMenuComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class ContextualMenuComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/DatePickerComponentPage.tsx b/apps/fabric-website/src/pages/Components/DatePickerComponentPage.tsx index 204c5dec1575f3..7528ff1215d4a2 100644 --- a/apps/fabric-website/src/pages/Components/DatePickerComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/DatePickerComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class DatePickerComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/DetailsListComponentPage.tsx b/apps/fabric-website/src/pages/Components/DetailsListComponentPage.tsx index 2ac9254e714f83..76d78ee67c44c9 100644 --- a/apps/fabric-website/src/pages/Components/DetailsListComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/DetailsListComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class DetailsListComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/DialogComponentPage.tsx b/apps/fabric-website/src/pages/Components/DialogComponentPage.tsx index b3bf165e8e8d7a..37429d48ddf427 100644 --- a/apps/fabric-website/src/pages/Components/DialogComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/DialogComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class DialogComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/DocumentCardComponentPage.tsx b/apps/fabric-website/src/pages/Components/DocumentCardComponentPage.tsx index b1bae3dc7b2a97..5e5b0eef3d4cd5 100644 --- a/apps/fabric-website/src/pages/Components/DocumentCardComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/DocumentCardComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class DocumentCardComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/DropdownComponentPage.tsx b/apps/fabric-website/src/pages/Components/DropdownComponentPage.tsx index dac02d95e18f8c..ca5e93aab22086 100644 --- a/apps/fabric-website/src/pages/Components/DropdownComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/DropdownComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class DropdownComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/FacepileComponentPage.tsx b/apps/fabric-website/src/pages/Components/FacepileComponentPage.tsx index 3ed0df6639a622..3917a6b67f35b4 100644 --- a/apps/fabric-website/src/pages/Components/FacepileComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/FacepileComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class FacepileComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/FocusTrapZoneUtilityPage.tsx b/apps/fabric-website/src/pages/Components/FocusTrapZoneUtilityPage.tsx index c7e9b107a45f67..56124bb35f9067 100644 --- a/apps/fabric-website/src/pages/Components/FocusTrapZoneUtilityPage.tsx +++ b/apps/fabric-website/src/pages/Components/FocusTrapZoneUtilityPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class FocusTrapZoneUtilityPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/FocusZoneUtilityPage.tsx b/apps/fabric-website/src/pages/Components/FocusZoneUtilityPage.tsx index 961cdec0c6c040..4f19fe75087cd0 100644 --- a/apps/fabric-website/src/pages/Components/FocusZoneUtilityPage.tsx +++ b/apps/fabric-website/src/pages/Components/FocusZoneUtilityPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class FocusZoneUtilityPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/GroupedListComponentPage.tsx b/apps/fabric-website/src/pages/Components/GroupedListComponentPage.tsx index 9208478fa3ef96..65e087c4b323e1 100644 --- a/apps/fabric-website/src/pages/Components/GroupedListComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/GroupedListComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class GroupedListComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/HoverCardComponentPage.tsx b/apps/fabric-website/src/pages/Components/HoverCardComponentPage.tsx index 78139437bee796..cb46a0a86369d1 100644 --- a/apps/fabric-website/src/pages/Components/HoverCardComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/HoverCardComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class HoverCardComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/IconComponentPage.tsx b/apps/fabric-website/src/pages/Components/IconComponentPage.tsx index 0357bd7b5cdc86..ed4bb74cfa756e 100644 --- a/apps/fabric-website/src/pages/Components/IconComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/IconComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class IconComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/ImageComponentPage.tsx b/apps/fabric-website/src/pages/Components/ImageComponentPage.tsx index f8af3614d787e1..799e9db3e3cdc1 100644 --- a/apps/fabric-website/src/pages/Components/ImageComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/ImageComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class ImageComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/LabelComponentPage.tsx b/apps/fabric-website/src/pages/Components/LabelComponentPage.tsx index f5760704309112..d3918096fc4e33 100644 --- a/apps/fabric-website/src/pages/Components/LabelComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/LabelComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class LabelComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/LayerComponentPage.tsx b/apps/fabric-website/src/pages/Components/LayerComponentPage.tsx index 21a3374c8f20b9..05813321385c93 100644 --- a/apps/fabric-website/src/pages/Components/LayerComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/LayerComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class LayerComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/LinkComponentPage.tsx b/apps/fabric-website/src/pages/Components/LinkComponentPage.tsx index 2e09a43deffda0..2973b8d378c304 100644 --- a/apps/fabric-website/src/pages/Components/LinkComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/LinkComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class LinkComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/ListComponentPage.tsx b/apps/fabric-website/src/pages/Components/ListComponentPage.tsx index 991a8a3c799e23..2d61c08e874965 100644 --- a/apps/fabric-website/src/pages/Components/ListComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/ListComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class ListComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/MarqueeSelectionUtilityPage.tsx b/apps/fabric-website/src/pages/Components/MarqueeSelectionUtilityPage.tsx index 9dde9e1fb0ee5d..364d4fc5052bd0 100644 --- a/apps/fabric-website/src/pages/Components/MarqueeSelectionUtilityPage.tsx +++ b/apps/fabric-website/src/pages/Components/MarqueeSelectionUtilityPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class MarqueeSelectionUtilityPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/MessageBarComponentPage.tsx b/apps/fabric-website/src/pages/Components/MessageBarComponentPage.tsx index d215e845f2ecf0..7099ae35adf875 100644 --- a/apps/fabric-website/src/pages/Components/MessageBarComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/MessageBarComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class MessageBarComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/ModalComponentPage.tsx b/apps/fabric-website/src/pages/Components/ModalComponentPage.tsx index a407a065e0a9ab..be0793d2b2eb17 100644 --- a/apps/fabric-website/src/pages/Components/ModalComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/ModalComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class ModalComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/NavComponentPage.tsx b/apps/fabric-website/src/pages/Components/NavComponentPage.tsx index dd0e8f5f59b2a0..dee5dec8a0d435 100644 --- a/apps/fabric-website/src/pages/Components/NavComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/NavComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class NavComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/OverflowSetComponentPage.tsx b/apps/fabric-website/src/pages/Components/OverflowSetComponentPage.tsx index 7c21183bd950a6..7cae17323a2274 100644 --- a/apps/fabric-website/src/pages/Components/OverflowSetComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/OverflowSetComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class OverflowSetComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/OverlayComponentPage.tsx b/apps/fabric-website/src/pages/Components/OverlayComponentPage.tsx index 36e654cc461c86..050161847c3fa9 100644 --- a/apps/fabric-website/src/pages/Components/OverlayComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/OverlayComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class OverlayComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/PanelComponentPage.tsx b/apps/fabric-website/src/pages/Components/PanelComponentPage.tsx index 9e158348e4bfba..991071864bd814 100644 --- a/apps/fabric-website/src/pages/Components/PanelComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/PanelComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class PanelComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/PeoplePickerComponentPage.tsx b/apps/fabric-website/src/pages/Components/PeoplePickerComponentPage.tsx index a6570e9a22f00e..5c4a48a32ce800 100644 --- a/apps/fabric-website/src/pages/Components/PeoplePickerComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/PeoplePickerComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class PeoplePickerComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/PersonaComponentPage.tsx b/apps/fabric-website/src/pages/Components/PersonaComponentPage.tsx index 6207c0bcaf1098..1bf3aab5a22bbc 100644 --- a/apps/fabric-website/src/pages/Components/PersonaComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/PersonaComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class PersonaComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/PickersComponentPage.tsx b/apps/fabric-website/src/pages/Components/PickersComponentPage.tsx index f94833f6f8e1dd..a3143da8bdd981 100644 --- a/apps/fabric-website/src/pages/Components/PickersComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/PickersComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class PickersComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/PivotComponentPage.tsx b/apps/fabric-website/src/pages/Components/PivotComponentPage.tsx index a991a20e89881a..1ed9a5c4ec33ad 100644 --- a/apps/fabric-website/src/pages/Components/PivotComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/PivotComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class PivotComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/ProgressIndicatorComponentPage.tsx b/apps/fabric-website/src/pages/Components/ProgressIndicatorComponentPage.tsx index 3d756d2edbc24c..4e5a7c942ee85e 100644 --- a/apps/fabric-website/src/pages/Components/ProgressIndicatorComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/ProgressIndicatorComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class ProgressIndicatorComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/RatingComponentPage.tsx b/apps/fabric-website/src/pages/Components/RatingComponentPage.tsx index 268f915e2603b6..ea2119d9a12656 100644 --- a/apps/fabric-website/src/pages/Components/RatingComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/RatingComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class RatingComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/ResizeGroupComponentPage.tsx b/apps/fabric-website/src/pages/Components/ResizeGroupComponentPage.tsx index 5a11a629e2ce4b..da320c2385ce0d 100644 --- a/apps/fabric-website/src/pages/Components/ResizeGroupComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/ResizeGroupComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class ResizeGroupComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/ScrollablePaneComponentPage.tsx b/apps/fabric-website/src/pages/Components/ScrollablePaneComponentPage.tsx index 9c3f68da7568d6..9a6e4ac8f1e6d0 100644 --- a/apps/fabric-website/src/pages/Components/ScrollablePaneComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/ScrollablePaneComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class ScrollablePaneComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/SearchBoxComponentPage.tsx b/apps/fabric-website/src/pages/Components/SearchBoxComponentPage.tsx index 3ee30b89ea0a59..c1ac5e2ca8d6d8 100644 --- a/apps/fabric-website/src/pages/Components/SearchBoxComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/SearchBoxComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class SearchBoxComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/SelectionUtilityPage.tsx b/apps/fabric-website/src/pages/Components/SelectionUtilityPage.tsx index 17e72e6f9ecff1..02fd6b09c5ec74 100644 --- a/apps/fabric-website/src/pages/Components/SelectionUtilityPage.tsx +++ b/apps/fabric-website/src/pages/Components/SelectionUtilityPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class SelectionUtilityPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/SliderComponentPage.tsx b/apps/fabric-website/src/pages/Components/SliderComponentPage.tsx index 962688361f6bd4..ced2bb935516fd 100644 --- a/apps/fabric-website/src/pages/Components/SliderComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/SliderComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class SliderComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/SpinButtonComponentPage.tsx b/apps/fabric-website/src/pages/Components/SpinButtonComponentPage.tsx index a43701393039af..86398034c23b75 100644 --- a/apps/fabric-website/src/pages/Components/SpinButtonComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/SpinButtonComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class SpinButtonComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/SpinnerComponentPage.tsx b/apps/fabric-website/src/pages/Components/SpinnerComponentPage.tsx index a68576a591830d..18570a9f0f6726 100644 --- a/apps/fabric-website/src/pages/Components/SpinnerComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/SpinnerComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class SpinnerComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/SwatchColorPickerComponentPage.tsx b/apps/fabric-website/src/pages/Components/SwatchColorPickerComponentPage.tsx index e0377f11c6009d..c3028cb9720491 100644 --- a/apps/fabric-website/src/pages/Components/SwatchColorPickerComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/SwatchColorPickerComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class SwatchColorPickerComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/TeachingBubbleComponentPage.tsx b/apps/fabric-website/src/pages/Components/TeachingBubbleComponentPage.tsx index 750ccff7c794f1..a524b400189b55 100644 --- a/apps/fabric-website/src/pages/Components/TeachingBubbleComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/TeachingBubbleComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class TeachingBubbleComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/TextFieldComponentPage.tsx b/apps/fabric-website/src/pages/Components/TextFieldComponentPage.tsx index 481664c191be8a..a46d5f2871c29f 100644 --- a/apps/fabric-website/src/pages/Components/TextFieldComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/TextFieldComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class TextFieldComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/ThemesUtilityPage.tsx b/apps/fabric-website/src/pages/Components/ThemesUtilityPage.tsx index 81b0c766b8ee93..e5962ebab25e7f 100644 --- a/apps/fabric-website/src/pages/Components/ThemesUtilityPage.tsx +++ b/apps/fabric-website/src/pages/Components/ThemesUtilityPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class ThemesUtilityPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/ToggleComponentPage.tsx b/apps/fabric-website/src/pages/Components/ToggleComponentPage.tsx index a9dd35ef267053..bc7d60d8b27c27 100644 --- a/apps/fabric-website/src/pages/Components/ToggleComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/ToggleComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class ToggleComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Components/TooltipComponentPage.tsx b/apps/fabric-website/src/pages/Components/TooltipComponentPage.tsx index 13fdb3ac613b9a..e0174926854afe 100644 --- a/apps/fabric-website/src/pages/Components/TooltipComponentPage.tsx +++ b/apps/fabric-website/src/pages/Components/TooltipComponentPage.tsx @@ -5,7 +5,7 @@ import { ComponentPage } from '../../components/ComponentPage/ComponentPage'; const pageStyles: any = require('../PageStyles.module.scss'); export class TooltipComponentPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/GetStarted/GetStartedPage.module.scss b/apps/fabric-website/src/pages/GetStarted/GetStartedPage.module.scss index ec7fb9aa58d2b8..4885114e6360f6 100644 --- a/apps/fabric-website/src/pages/GetStarted/GetStartedPage.module.scss +++ b/apps/fabric-website/src/pages/GetStarted/GetStartedPage.module.scss @@ -47,11 +47,15 @@ background-color:$color-getStarted-darker; color: $ms-color-neutralLighter; - a, a:visited, + a:not(.title), a:visited, a:hover.title, .getStartedLink { border-bottom: 1px solid $ms-color-neutralLight; } + a.title { + border-bottom: 1px solid transparent; + } + a, a:hover, a:active, .getStartedLink { color: $ms-color-neutralLight; @@ -59,11 +63,15 @@ } .feature { - align-items: center; - display: flex; - flex-direction: column; margin-bottom: 32px; + .featureImage { + align-items: center; + display: flex; + flex-direction: column; + width: 100%; + } + img { height: 100%; margin-bottom: 8px; @@ -91,7 +99,7 @@ font-size: $font-size-big; font-weight: $ms-font-weight-semilight; margin-bottom: $contentMargin-vertical; - width: 100%; + display: table; } @media screen and (max-width: $uhf-screen-max-mobile) { diff --git a/apps/fabric-website/src/pages/GetStarted/GetStartedPage.tsx b/apps/fabric-website/src/pages/GetStarted/GetStartedPage.tsx index 7841a5f4ecd702..3fed74a80af96b 100644 --- a/apps/fabric-website/src/pages/GetStarted/GetStartedPage.tsx +++ b/apps/fabric-website/src/pages/GetStarted/GetStartedPage.tsx @@ -12,7 +12,7 @@ const corePackageData = require('../../../node_modules/office-ui-fabric-core/pac const corePackageVersion: string = corePackageData && corePackageData.version || '9.2.0'; export class GetStartedPage extends React.Component { - public render() { + public render(): JSX.Element { return (
{
- Illustration of Typography and color swatches. -
Styles
+
+ Illustration of Typography and color swatches. +
+ Styles
Fabric gives you access to Segoe, Microsoft’s official typeface, along with the color palette, type ramp, icons, and responsive grid for Office 365.
- Illustration of Icons -
Icons
+
+ Illustration of Icons +
+ Icons
Fabric includes Office’s official product icons. Fabric also provides a suite of product and document symbols, so you can use the same metaphors we use.
- Illustration of Components -
Components
+
+ Illustration of Components +
+ Components
Components are the building blocks of your UI. Fabric has a variety of components, including navigation, commands, containers, and content.
- Design Toolkit + Design Toolkit The Fabric design toolkit is built with Adobe XD and provides controls and layout templates that enable you to create seamless, beautiful Office experiences. - Learn more
diff --git a/apps/fabric-website/src/pages/HomePage/HomePage.tsx b/apps/fabric-website/src/pages/HomePage/HomePage.tsx index 83cf6348f90749..b16d12b01cd386 100644 --- a/apps/fabric-website/src/pages/HomePage/HomePage.tsx +++ b/apps/fabric-website/src/pages/HomePage/HomePage.tsx @@ -7,7 +7,7 @@ const corePackageData = require('../../../node_modules/office-ui-fabric-core/pac const reactPackageData = require('../../../node_modules/office-ui-fabric-react/package.json'); export class HomePage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Interstitials/AngularJSPage.tsx b/apps/fabric-website/src/pages/Interstitials/AngularJSPage.tsx index 0f2371b9ef90e1..ff14f47e1a4d1d 100644 --- a/apps/fabric-website/src/pages/Interstitials/AngularJSPage.tsx +++ b/apps/fabric-website/src/pages/Interstitials/AngularJSPage.tsx @@ -5,7 +5,7 @@ const styles: any = stylesImport; const pageStyles: any = require('../PageStyles.module.scss'); export class AngularJSPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Interstitials/FabricIOSPage.tsx b/apps/fabric-website/src/pages/Interstitials/FabricIOSPage.tsx index a54ec3b47229eb..000f457820c06b 100644 --- a/apps/fabric-website/src/pages/Interstitials/FabricIOSPage.tsx +++ b/apps/fabric-website/src/pages/Interstitials/FabricIOSPage.tsx @@ -4,7 +4,7 @@ const styles: any = stylesImport; const pageStyles: any = require('../PageStyles.module.scss'); export class FabricIOSPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Interstitials/FabricJSPage.tsx b/apps/fabric-website/src/pages/Interstitials/FabricJSPage.tsx index c46e45ddacf0f5..1ad71bac883143 100644 --- a/apps/fabric-website/src/pages/Interstitials/FabricJSPage.tsx +++ b/apps/fabric-website/src/pages/Interstitials/FabricJSPage.tsx @@ -4,7 +4,7 @@ import * as stylesImport from './Interstitials.module.scss'; const styles: any = stylesImport; export class FabricJSPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Overviews/ComponentsPage.tsx b/apps/fabric-website/src/pages/Overviews/ComponentsPage.tsx index 1c1662094b730a..2936b7836c7856 100644 --- a/apps/fabric-website/src/pages/Overviews/ComponentsPage.tsx +++ b/apps/fabric-website/src/pages/Overviews/ComponentsPage.tsx @@ -5,7 +5,7 @@ import * as stylesImport from './Overviews.module.scss'; const styles: any = stylesImport; export class ComponentsPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/Overviews/StylesPage.tsx b/apps/fabric-website/src/pages/Overviews/StylesPage.tsx index e1351d495aba69..ac995196cf9c7e 100644 --- a/apps/fabric-website/src/pages/Overviews/StylesPage.tsx +++ b/apps/fabric-website/src/pages/Overviews/StylesPage.tsx @@ -5,7 +5,7 @@ import * as stylesImport from './Overviews.module.scss'; const styles: any = stylesImport; export class StylesPage extends React.Component { - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/pages/ResourcesPage/ResourcesPage.tsx b/apps/fabric-website/src/pages/ResourcesPage/ResourcesPage.tsx index cfc7cbd4d10461..352163683d80f4 100644 --- a/apps/fabric-website/src/pages/ResourcesPage/ResourcesPage.tsx +++ b/apps/fabric-website/src/pages/ResourcesPage/ResourcesPage.tsx @@ -6,7 +6,7 @@ const styles: any = stylesImport; const pageStyles: any = require('../PageStyles.module.scss'); export class ResourcesPage extends React.Component { - public render() { + public render(): JSX.Element { return (
{ - public render() { + public render(): JSX.Element { return (
{ - public render() { + public render(): JSX.Element { let productIcons = productIconsData; let documentIcons = documentIconsData; diff --git a/apps/fabric-website/src/pages/Styles/ColorsPage/ColorsPage.tsx b/apps/fabric-website/src/pages/Styles/ColorsPage/ColorsPage.tsx index 62125bd95e0928..37c8d071211833 100644 --- a/apps/fabric-website/src/pages/Styles/ColorsPage/ColorsPage.tsx +++ b/apps/fabric-website/src/pages/Styles/ColorsPage/ColorsPage.tsx @@ -13,7 +13,7 @@ const neutralColorsData = require('../../../data/colors-neutral.json'); const themeColorsData = require('../../../data/colors-theme.json'); export class ColorsPage extends React.Component { - public render() { + public render(): JSX.Element { return (
{ - public render() { + public render(): JSX.Element { return (
{ - public render() { + public render(): JSX.Element { return (
{ - public render() { + public render(): JSX.Element { return (
{ - public render() { + public render(): JSX.Element { return (
{ - public render() { + public render(): JSX.Element { return (
{ - public render() { + public render(): JSX.Element { return (
diff --git a/apps/fabric-website/src/root.tsx b/apps/fabric-website/src/root.tsx index ed574ac555f439..50406003b832db 100644 --- a/apps/fabric-website/src/root.tsx +++ b/apps/fabric-website/src/root.tsx @@ -59,7 +59,7 @@ function _hasAnchorLink(path: string): boolean { return (path.match(/#/g) || []).length > 1; } -function _extractAnchorLink(path) { +function _extractAnchorLink(path): string { let split = path.split('#'); let cleanedSplit = split.filter((value) => { if (value === '') { @@ -136,7 +136,7 @@ if (isReady) { window.onunload = _onUnload; -function addCSSToHeader(fileName: string) { +function addCSSToHeader(fileName: string): void { let headEl = document.head; let linkEl = document.createElement('link'); diff --git a/apps/fabric-website/src/utilities/data.ts b/apps/fabric-website/src/utilities/data.ts index 0966eb30aff807..0cdf67f593ad05 100644 --- a/apps/fabric-website/src/utilities/data.ts +++ b/apps/fabric-website/src/utilities/data.ts @@ -5,9 +5,9 @@ const LOREM_IPSUM = ('Lorem ipsum dolor sit amet, consectetur adipiscing elit, s 'mollit anim id est laborum').split(' '); const DATA = { - 'color' : [ 'red', 'blue', 'green', 'yellow' ], - 'shape' : [ 'circle', 'square', 'triangle' ], - 'location' : [ 'Seattle', 'New York', 'Chicago', 'Los Angeles', 'Portland' ] + 'color': ['red', 'blue', 'green', 'yellow'], + 'shape': ['circle', 'square', 'triangle'], + 'location': ['Seattle', 'New York', 'Chicago', 'Los Angeles', 'Portland'] }; export function createListItems(count: number, startIndex = 0): any { @@ -17,7 +17,7 @@ export function createListItems(count: number, startIndex = 0): any { let aspectRatio = width / height; return { - thumbnail: `//placekitten.com/${ Math.round(75 * aspectRatio) }/${ 75 }`, + thumbnail: `//placekitten.com/${Math.round(75 * aspectRatio)}/${75}`, key: 'item-' + (index + startIndex) + ' ' + lorem(4), name: lorem(5), description: lorem(10 + Math.round(Math.random() * 50)), @@ -42,7 +42,7 @@ export function isGroupable(key: string): boolean { key === 'location'; } -function _randWord(array: string[]) { +function _randWord(array: string[]): string { let index = Math.floor(Math.random() * array.length); return array[index]; } diff --git a/apps/ssr-tests/package.json b/apps/ssr-tests/package.json index 14da544821c6d1..cd8ce65a79c342 100644 --- a/apps/ssr-tests/package.json +++ b/apps/ssr-tests/package.json @@ -21,7 +21,7 @@ "@types/mocha": "2.2.39", "@types/webpack-env": "1.13.0", "mocha": "^3.3.0", - "office-ui-fabric-react": ">=5.81.1 <6.0.0", + "office-ui-fabric-react": ">=5.89.0 <6.0.0", "raw-loader": "^0.5.1", "react": "^16.3.1", "react-dom": "^16.3.1", diff --git a/apps/test-bundle-button/package.json b/apps/test-bundle-button/package.json index 3366d6813c4ddd..422498e0efcff3 100644 --- a/apps/test-bundle-button/package.json +++ b/apps/test-bundle-button/package.json @@ -25,7 +25,7 @@ "dependencies": { "react": "^0.14 || ^15.0.1-0 || ^16.0.0-0", "react-dom": "^0.14 || ^15.0.1-0 || ^16.0.0-0", - "office-ui-fabric-react": ">=5.81.1 <6.0.0", + "office-ui-fabric-react": ">=5.89.0 <6.0.0", "tslib": "^1.7.1" } } \ No newline at end of file diff --git a/apps/todo-app/package.json b/apps/todo-app/package.json index c6de7b07c05263..c9ad72cefe8556 100644 --- a/apps/todo-app/package.json +++ b/apps/todo-app/package.json @@ -19,7 +19,7 @@ "@microsoft/load-themed-styles": "^1.7.13", "es6-promise": "^4.1.0", "immutability-helper": "^2.6.4", - "office-ui-fabric-react": ">=5.81.1 <6.0.0", + "office-ui-fabric-react": ">=5.89.0 <6.0.0", "react": "^16.3.1", "react-dom": "^16.3.1", "typescript": "2.8.1", diff --git a/apps/todo-app/src/components/TodoForm.tsx b/apps/todo-app/src/components/TodoForm.tsx index c381a5fd8980a8..57a5d51148bab7 100644 --- a/apps/todo-app/src/components/TodoForm.tsx +++ b/apps/todo-app/src/components/TodoForm.tsx @@ -81,7 +81,7 @@ export default class TodoForm extends BaseComponent): void => { event.preventDefault(); - const { value: textField } = this._textField; + const { current: textField } = this._textField; if (!textField) { return; } diff --git a/apps/vr-tests/package.json b/apps/vr-tests/package.json index aa79a27ddfbe8e..7eee74674948b7 100644 --- a/apps/vr-tests/package.json +++ b/apps/vr-tests/package.json @@ -23,12 +23,12 @@ "style-loader": "^0.19.0", "awesome-typescript-loader": "^3.2.3", "office-ui-fabric-react-tslint": ">=5.0.0 <6.0.0", - "screener-storybook": "^0.11.1", + "screener-storybook": "^0.12.5", "screener-runner": "^0.6.19", "storybook-readme": "=3.0.6" }, "dependencies": { - "office-ui-fabric-react": ">=5.81.1 <6.0.0", + "office-ui-fabric-react": ">=5.89.0 <6.0.0", "react": "^16.3.1", "react-dom": "^16.3.1", "typescript": "2.8.1", diff --git a/apps/vr-tests/src/stories/Rating.stories.tsx b/apps/vr-tests/src/stories/Rating.stories.tsx index 280bfdbddbb5a3..60f15cfdf2756d 100644 --- a/apps/vr-tests/src/stories/Rating.stories.tsx +++ b/apps/vr-tests/src/stories/Rating.stories.tsx @@ -29,6 +29,12 @@ storiesOf('Rating', module) max={ 5 } rating={ 2 } /> + )).add('Allow Zero', () => ( + )).add('Large', () => ( { // Create the reference object that will be used for setting and accessing the reference private _root = createRef(); - public render() { + public render(): JSX.Element { // Set the reference by passing the reference object as the ref prop return + + +
  • + +
    + TestText4 +
    +
    +
  • + +
    +
    +
    +
    +`; + +exports[`Breadcrumb renders empty breadcrumb 1`] = ` +
    +
    +
    +
    +
      +
    +
    +
    +
    +`; diff --git a/packages/office-ui-fabric-react/src/components/Breadcrumb/docs/BreadcrumbDonts.md b/packages/office-ui-fabric-react/src/components/Breadcrumb/docs/BreadcrumbDonts.md new file mode 100644 index 00000000000000..41d6b2c92cb4ad --- /dev/null +++ b/packages/office-ui-fabric-react/src/components/Breadcrumb/docs/BreadcrumbDonts.md @@ -0,0 +1 @@ +- Don't use Breadcrumbs as a primary way to navigate an app or site. \ No newline at end of file diff --git a/packages/office-ui-fabric-react/src/components/Breadcrumb/docs/BreadcrumbDos.md b/packages/office-ui-fabric-react/src/components/Breadcrumb/docs/BreadcrumbDos.md new file mode 100644 index 00000000000000..475b0636fbcd7b --- /dev/null +++ b/packages/office-ui-fabric-react/src/components/Breadcrumb/docs/BreadcrumbDos.md @@ -0,0 +1 @@ +- Place Breadcrumbs at the top of a page, above a list of items, or above the main content of a page. \ No newline at end of file diff --git a/packages/office-ui-fabric-react/src/components/Breadcrumb/docs/BreadcrumbOverview.md b/packages/office-ui-fabric-react/src/components/Breadcrumb/docs/BreadcrumbOverview.md new file mode 100644 index 00000000000000..78bbf512689e34 --- /dev/null +++ b/packages/office-ui-fabric-react/src/components/Breadcrumb/docs/BreadcrumbOverview.md @@ -0,0 +1,3 @@ +Breadcrumbs should be used as a navigational aid in your app or site. They indicate the current page’s location within a hierarchy and help the user understand where they are in relation to the rest of that hierarchy. They also afford one-click access to higher levels of that hierarchy. + +Breadcrumbs are typically placed, in horizontal form, under the masthead or navigation of an experience, above the primary content area. \ No newline at end of file diff --git a/packages/office-ui-fabric-react/src/components/Breadcrumb/examples/Breadcrumb.Basic.Example.tsx b/packages/office-ui-fabric-react/src/components/Breadcrumb/examples/Breadcrumb.Basic.Example.tsx index 25cb0874589e02..5ee7499cbed3b4 100644 --- a/packages/office-ui-fabric-react/src/components/Breadcrumb/examples/Breadcrumb.Basic.Example.tsx +++ b/packages/office-ui-fabric-react/src/components/Breadcrumb/examples/Breadcrumb.Basic.Example.tsx @@ -1,6 +1,4 @@ -/* tslint:disable:no-unused-variable */ import * as React from 'react'; -/* tslint:enable:no-unused-variable */ import { Breadcrumb, IBreadcrumbItem } from 'office-ui-fabric-react/lib/Breadcrumb'; @@ -13,7 +11,7 @@ export class BreadcrumbBasicExample extends React.Component { super(props); } - public render() { + public render(): JSX.Element { const customDivider = () => *; return ( @@ -58,11 +56,23 @@ export class BreadcrumbBasicExample extends React.Component { maxDisplayedItems={ 3 } ariaLabel={ 'Website breadcrumb' } /> + + +
    ); } - private _onBreadcrumbItemClicked = (ev: React.MouseEvent, item: IBreadcrumbItem) => { + private _onBreadcrumbItemClicked = (ev: React.MouseEvent, item: IBreadcrumbItem): void => { console.log(`Breadcrumb item with key "${item.key}" has been clicked.`); } diff --git a/packages/office-ui-fabric-react/src/components/Breadcrumb/examples/Breadcrumb.Static.Example.tsx b/packages/office-ui-fabric-react/src/components/Breadcrumb/examples/Breadcrumb.Static.Example.tsx index fc283ec4f333fb..fe371bfcee2c40 100644 --- a/packages/office-ui-fabric-react/src/components/Breadcrumb/examples/Breadcrumb.Static.Example.tsx +++ b/packages/office-ui-fabric-react/src/components/Breadcrumb/examples/Breadcrumb.Static.Example.tsx @@ -1,13 +1,11 @@ -/* tslint:disable:no-unused-variable */ import * as React from 'react'; -/* tslint:enable:no-unused-variable */ import { Breadcrumb, IBreadcrumbItem } from 'office-ui-fabric-react/lib/Breadcrumb'; export class BreadcrumbStaticExample extends React.Component { - public render() { + public render(): JSX.Element { return (
    , item: IBreadcrumbItem) => { + private _onBreadcrumbItemClicked = (ev: React.MouseEvent, item: IBreadcrumbItem): void => { console.log(`Breadcrumb item with key "${item.key}" has been clicked.`); } diff --git a/packages/office-ui-fabric-react/src/components/Button/ActionButton/ActionButton.tsx b/packages/office-ui-fabric-react/src/components/Button/ActionButton/ActionButton.tsx index c99913121c9777..da778847a2dd14 100644 --- a/packages/office-ui-fabric-react/src/components/Button/ActionButton/ActionButton.tsx +++ b/packages/office-ui-fabric-react/src/components/Button/ActionButton/ActionButton.tsx @@ -12,7 +12,7 @@ export class ActionButton extends BaseComponent { */ protected _shouldUpdateComponentRef = false; - public render() { + public render(): JSX.Element { const { styles, theme } = this.props; return ( diff --git a/packages/office-ui-fabric-react/src/components/Button/BaseButton.tsx b/packages/office-ui-fabric-react/src/components/Button/BaseButton.tsx index 06c66aee2304b6..5c350017e24df3 100644 --- a/packages/office-ui-fabric-react/src/components/Button/BaseButton.tsx +++ b/packages/office-ui-fabric-react/src/components/Button/BaseButton.tsx @@ -39,9 +39,8 @@ export class BaseButton extends BaseComponent = { baseClassName: 'ms-Button', - classNames: {}, styles: {}, split: false, }; @@ -208,10 +207,10 @@ export class BaseButton extends BaseComponent @@ -428,10 +427,10 @@ export class BaseButton extends BaseComponent { - if (this._splitButtonContainer.value) { - this._splitButtonContainer.value.focus(); + if (this._splitButtonContainer.current) { + this._splitButtonContainer.current.focus(); } - const { menuProps } = this.props; + const currentMenuProps = this.state.menuProps; if (this.props.persistMenu) { currentMenuProps && currentMenuProps.hidden ? this._openMenu() : this._dismissMenu(); @@ -446,7 +445,6 @@ export class BaseButton extends BaseComponent) => { if (ev.which === KeyCodes.enter) { - if (this._buttonElement.value) { - this._buttonElement.value.click(); + if (this._buttonElement.current) { + this._buttonElement.current.click(); ev.preventDefault(); ev.stopPropagation(); } @@ -570,14 +568,13 @@ export class BaseButton extends BaseComponent { ); } - public render() { + public render(): JSX.Element { const props = this.props; switch (props.buttonType) { diff --git a/packages/office-ui-fabric-react/src/components/Button/ButtonPage.tsx b/packages/office-ui-fabric-react/src/components/Button/ButtonPage.tsx index 37e2643a4a00ca..894e13ef4646c8 100644 --- a/packages/office-ui-fabric-react/src/components/Button/ButtonPage.tsx +++ b/packages/office-ui-fabric-react/src/components/Button/ButtonPage.tsx @@ -3,7 +3,8 @@ import { ExampleCard, IComponentDemoPageProps, ComponentPage, - PropertiesTableSet + PropertiesTableSet, + PageMarkdown, } from '@uifabric/example-app-base'; import { ButtonStatus } from './Button.checklist'; import { ButtonDefaultExample } from './examples/Button.Default.Example'; @@ -18,7 +19,6 @@ import { ButtonSwapExample } from './examples/Button.Swap.Example'; import { ButtonSplitExample, ButtonSplitCustomExample } from './examples/Button.Split.Example'; import { ComponentStatus } from '../../demo/ComponentStatus/ComponentStatus'; import { Checkbox } from 'office-ui-fabric-react/lib/Checkbox'; -import { Link } from '../../Link'; import * as exampleStylesImport from '../../common/_exampleStyles.scss'; const exampleStyles: any = exampleStylesImport; @@ -67,11 +67,12 @@ export class ButtonPage extends React.Component } overview={ -
    -

    Buttons are best used to enable a user to commit a change or complete steps in a task. They are typically found inside forms, dialogs, panels or pages. An example of their usage is confirming the deletion of a file in a confirmation dialog.

    -

    When considering their place in a layout, contemplate the order in which a user will flow through the UI. As an example, in a form, the individual will need to read and interact with the form fields before submiting the form. Therefore, as a general rule, the button should be placed at the bottom of the UI container (a dialog, panel, or page) which holds the related UI elements.

    -

    While buttons can technically be used to navigate a user to another part of the experience, this is not recommended unless that navigation is part of an action or their flow.

    -

    Note that both iconProps and menuIconProps take IIconProps to specify name and type.

    -
    + + { require('!raw-loader!office-ui-fabric-react/src/components/Button/docs/ButtonOverview.md') } + } bestPractices={
    } dos={ -
    -
      -
    • Make sure the label conveys a clear purpose of the button to the user.
    • -
    • Button labels must describe the action the button will perform and should include a verb. Use concise, specific, self-explanatory labels, usually a single word.
    • -
    • Buttons should always include a noun if there is any room for interpretation about what the verb operates on.
    • -
    • Consider the affect localization will have on the button and what will happen to components around it.
    • -
    • If the button’s label content is dynamic, consider how the button will resize and what will happen to components around it.
    • -
    • Use only a single line of text in the label of the button.
    • -
    • Expose only one or two buttons to the user at a time, for example, "Accept" and "Cancel". If you need to expose more actions to the user, consider using checkboxes or radio buttons from which the user can select actions, with a single command button to trigger those actions.
    • -
    • Show only one primary button that inherits theme color at rest state. In the event there are more than two buttons with equal priority, all buttons should have neutral backgrounds.
    • -
    • "Submit", "OK", and "Apply" buttons should always be styled as primary buttons. When "Reset" or "Cancel" buttons appear alongside one of the above, they should be styled as secondary buttons.
    • -
    • Default buttons should always perform safe operations. For example, a default button should never delete.
    • -
    • Use task buttons to cause actions that complete a task or cause a transitional task. Do not use buttons to toggle other UX in the same context. For example, a button may be used to open an interface area but should not be used to open an additional set of components in the same interface.
    • -
    -
    + + { require('!raw-loader!office-ui-fabric-react/src/components/Button/docs/ButtonDos.md') } + } donts={ -
    -
      -
    • Don't use generic labels like "Ok," especially in the case of an error; errors are never "Ok."
    • -
    • Don’t place the default focus on a button that destroys data. Instead, place the default focus on the button that performs the "safe act" and retains the content (i.e. "Save") or cancels the action (i.e. "Cancel").
    • -
    • Don’t use a button to navigate to another place, use a link instead. The exception is in a wizard where "Back" and "Next" buttons may be used.
    • -
    • Don’t put too much text in a button - try to keep the length of your text to a minimum.
    • -
    • Don't put anything other than text in a button.
    • -
    -
    + + { require('!raw-loader!office-ui-fabric-react/src/components/Button/docs/ButtonDonts.md') } + } isHeaderVisible={ this.props.isHeaderVisible } componentStatus={ @@ -183,13 +163,13 @@ export class ButtonPage extends React.Component, disabled: boolean) { + private _onDisabledChanged(ev: React.MouseEvent, disabled: boolean): void { this.setState({ areButtonsDisabled: disabled }); } - private _onToggledChanged(ev: React.MouseEvent, toggled: boolean) { + private _onToggledChanged(ev: React.MouseEvent, toggled: boolean): void { this.setState({ areButtonsChecked: toggled }); diff --git a/packages/office-ui-fabric-react/src/components/Button/CommandBarButton/CommandBarButton.tsx b/packages/office-ui-fabric-react/src/components/Button/CommandBarButton/CommandBarButton.tsx index c5b55c2678e0d3..d2a94188f742ca 100644 --- a/packages/office-ui-fabric-react/src/components/Button/CommandBarButton/CommandBarButton.tsx +++ b/packages/office-ui-fabric-react/src/components/Button/CommandBarButton/CommandBarButton.tsx @@ -11,7 +11,7 @@ export class CommandBarButton extends BaseComponent { */ protected _shouldUpdateComponentRef = false; - public render() { + public render(): JSX.Element { const { styles, theme } = this.props; return ( diff --git a/packages/office-ui-fabric-react/src/components/Button/CompoundButton/CompoundButton.tsx b/packages/office-ui-fabric-react/src/components/Button/CompoundButton/CompoundButton.tsx index 96cd9e73660a7e..96aaf94ed664da 100644 --- a/packages/office-ui-fabric-react/src/components/Button/CompoundButton/CompoundButton.tsx +++ b/packages/office-ui-fabric-react/src/components/Button/CompoundButton/CompoundButton.tsx @@ -11,7 +11,7 @@ export class CompoundButton extends BaseComponent { */ protected _shouldUpdateComponentRef = false; - public render() { + public render(): JSX.Element { const { primary = false, styles, theme } = this.props; return ( { */ protected _shouldUpdateComponentRef = false; - public render() { + public render(): JSX.Element { const { primary = false, styles, theme } = this.props; return ( diff --git a/packages/office-ui-fabric-react/src/components/Button/IconButton/IconButton.tsx b/packages/office-ui-fabric-react/src/components/Button/IconButton/IconButton.tsx index 775ecceba5cc6d..6612ed87bfa050 100644 --- a/packages/office-ui-fabric-react/src/components/Button/IconButton/IconButton.tsx +++ b/packages/office-ui-fabric-react/src/components/Button/IconButton/IconButton.tsx @@ -11,7 +11,7 @@ export class IconButton extends BaseComponent { */ protected _shouldUpdateComponentRef = false; - public render() { + public render(): JSX.Element { const { styles, theme } = this.props; return ( diff --git a/packages/office-ui-fabric-react/src/components/Button/MessageBarButton/MessageBarButton.tsx b/packages/office-ui-fabric-react/src/components/Button/MessageBarButton/MessageBarButton.tsx index c59d000ab98a12..3c5e0345f04230 100644 --- a/packages/office-ui-fabric-react/src/components/Button/MessageBarButton/MessageBarButton.tsx +++ b/packages/office-ui-fabric-react/src/components/Button/MessageBarButton/MessageBarButton.tsx @@ -7,7 +7,7 @@ import { getStyles } from './MessageBarButton.styles'; @customizable('MessageBarButton', ['theme']) export class MessageBarButton extends BaseComponent { - public render() { + public render(): JSX.Element { const { styles, theme } = this.props; return ( diff --git a/packages/office-ui-fabric-react/src/components/Button/PrimaryButton/PrimaryButton.tsx b/packages/office-ui-fabric-react/src/components/Button/PrimaryButton/PrimaryButton.tsx index c633f9c4a70317..58ec54fcdb1a7d 100644 --- a/packages/office-ui-fabric-react/src/components/Button/PrimaryButton/PrimaryButton.tsx +++ b/packages/office-ui-fabric-react/src/components/Button/PrimaryButton/PrimaryButton.tsx @@ -10,7 +10,7 @@ export class PrimaryButton extends BaseComponent { */ protected _shouldUpdateComponentRef = false; - public render() { + public render(): JSX.Element { return ( IIconProps to specify name and type. \ No newline at end of file diff --git a/packages/office-ui-fabric-react/src/components/Button/examples/Button.Action.Example.tsx b/packages/office-ui-fabric-react/src/components/Button/examples/Button.Action.Example.tsx index dd8603446821ac..cb59b413995332 100644 --- a/packages/office-ui-fabric-react/src/components/Button/examples/Button.Action.Example.tsx +++ b/packages/office-ui-fabric-react/src/components/Button/examples/Button.Action.Example.tsx @@ -15,7 +15,7 @@ export class ButtonActionExample extends React.Component { super(props); } - public render() { + public render(): JSX.Element { const { disabled, checked } = this.props; const getClassNames = classNamesFunction(); diff --git a/packages/office-ui-fabric-react/src/components/Button/examples/Button.Anchor.Example.tsx b/packages/office-ui-fabric-react/src/components/Button/examples/Button.Anchor.Example.tsx index 09a462ec6a6881..5bdbe2a5a8917f 100644 --- a/packages/office-ui-fabric-react/src/components/Button/examples/Button.Anchor.Example.tsx +++ b/packages/office-ui-fabric-react/src/components/Button/examples/Button.Anchor.Example.tsx @@ -11,7 +11,7 @@ import { } from 'office-ui-fabric-react/lib/Button'; export class ButtonAnchorExample extends React.Component { - public render() { + public render(): JSX.Element { const { disabled, checked } = this.props; const getClassNames = classNamesFunction(); diff --git a/packages/office-ui-fabric-react/src/components/Button/examples/Button.Command.Example.tsx b/packages/office-ui-fabric-react/src/components/Button/examples/Button.Command.Example.tsx index 4617d5420cb864..acbdf45e089d83 100644 --- a/packages/office-ui-fabric-react/src/components/Button/examples/Button.Command.Example.tsx +++ b/packages/office-ui-fabric-react/src/components/Button/examples/Button.Command.Example.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import { CommandButton, IButtonProps } from 'office-ui-fabric-react/lib/Button'; export class ButtonCommandExample extends React.Component { - public render() { + public render(): JSX.Element { const { disabled, checked } = this.props; return ( diff --git a/packages/office-ui-fabric-react/src/components/Button/examples/Button.CommandBar.Example.tsx b/packages/office-ui-fabric-react/src/components/Button/examples/Button.CommandBar.Example.tsx index c1ba4cf8657597..295b9974150eb4 100644 --- a/packages/office-ui-fabric-react/src/components/Button/examples/Button.CommandBar.Example.tsx +++ b/packages/office-ui-fabric-react/src/components/Button/examples/Button.CommandBar.Example.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import { CommandBarButton, IButtonProps } from 'office-ui-fabric-react/lib/Button'; export class ButtonCommandBarExample extends React.Component { - public render() { + public render(): JSX.Element { const { disabled, checked } = this.props; return ( diff --git a/packages/office-ui-fabric-react/src/components/Button/examples/Button.Compound.Example.tsx b/packages/office-ui-fabric-react/src/components/Button/examples/Button.Compound.Example.tsx index 19a42f41c4c630..bd284ccc3d3f57 100644 --- a/packages/office-ui-fabric-react/src/components/Button/examples/Button.Compound.Example.tsx +++ b/packages/office-ui-fabric-react/src/components/Button/examples/Button.Compound.Example.tsx @@ -16,7 +16,7 @@ export class ButtonCompoundExample extends React.Component { super(props); } - public render() { + public render(): JSX.Element { const { disabled, checked } = this.props; const getClassNames = classNamesFunction(); diff --git a/packages/office-ui-fabric-react/src/components/Button/examples/Button.ContextualMenu.Example.tsx b/packages/office-ui-fabric-react/src/components/Button/examples/Button.ContextualMenu.Example.tsx index a90f12afb5b428..5675c885040d41 100644 --- a/packages/office-ui-fabric-react/src/components/Button/examples/Button.ContextualMenu.Example.tsx +++ b/packages/office-ui-fabric-react/src/components/Button/examples/Button.ContextualMenu.Example.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import { DefaultButton, IButtonProps } from 'office-ui-fabric-react/lib/Button'; export class ButtonContextualMenuExample extends React.Component { - public render() { + public render(): JSX.Element { const { disabled, checked } = this.props; return ( diff --git a/packages/office-ui-fabric-react/src/components/Button/examples/Button.Default.Example.tsx b/packages/office-ui-fabric-react/src/components/Button/examples/Button.Default.Example.tsx index 7e145591eefde6..83de1f76fa67fc 100644 --- a/packages/office-ui-fabric-react/src/components/Button/examples/Button.Default.Example.tsx +++ b/packages/office-ui-fabric-react/src/components/Button/examples/Button.Default.Example.tsx @@ -9,7 +9,7 @@ import { DefaultButton, IButtonProps } from 'office-ui-fabric-react/lib/Button'; import { Label } from 'office-ui-fabric-react/lib/Label'; export class ButtonDefaultExample extends React.Component { - public render() { + public render(): JSX.Element { const { disabled, checked } = this.props; const getClassNames = classNamesFunction(); diff --git a/packages/office-ui-fabric-react/src/components/Button/examples/Button.Icon.Example.tsx b/packages/office-ui-fabric-react/src/components/Button/examples/Button.Icon.Example.tsx index bcd33745f2ad7e..135731af037726 100644 --- a/packages/office-ui-fabric-react/src/components/Button/examples/Button.Icon.Example.tsx +++ b/packages/office-ui-fabric-react/src/components/Button/examples/Button.Icon.Example.tsx @@ -8,7 +8,7 @@ import { import { IconButton, IButtonProps } from 'office-ui-fabric-react/lib/Button'; export class ButtonIconExample extends React.Component { - public render() { + public render(): JSX.Element { const { disabled, checked } = this.props; const getClassNames = classNamesFunction(); @@ -23,6 +23,7 @@ export class ButtonIconExample extends React.Component { title='Emoji' ariaLabel='Emoji' /> +

    For a list of Icons, visit our Icon documentation.

    ); } diff --git a/packages/office-ui-fabric-react/src/components/Button/examples/Button.Primary.Example.tsx b/packages/office-ui-fabric-react/src/components/Button/examples/Button.Primary.Example.tsx index fcc150fa3fd136..253e75f431bc89 100644 --- a/packages/office-ui-fabric-react/src/components/Button/examples/Button.Primary.Example.tsx +++ b/packages/office-ui-fabric-react/src/components/Button/examples/Button.Primary.Example.tsx @@ -8,7 +8,7 @@ import { import { PrimaryButton, IButtonProps } from 'office-ui-fabric-react/lib/Button'; export class ButtonPrimaryExample extends React.Component { - public render() { + public render(): JSX.Element { const { disabled, checked } = this.props; const getClassNames = classNamesFunction(); diff --git a/packages/office-ui-fabric-react/src/components/Button/examples/Button.ScreenReader.Example.tsx b/packages/office-ui-fabric-react/src/components/Button/examples/Button.ScreenReader.Example.tsx index ceccbf0b51c1df..5cd9502c361f75 100644 --- a/packages/office-ui-fabric-react/src/components/Button/examples/Button.ScreenReader.Example.tsx +++ b/packages/office-ui-fabric-react/src/components/Button/examples/Button.ScreenReader.Example.tsx @@ -8,7 +8,7 @@ import { import { PrimaryButton, IButtonProps } from 'office-ui-fabric-react/lib/Button'; export class ButtonScreenReaderExample extends React.Component { - public render() { + public render(): JSX.Element { const { disabled, checked } = this.props; const getClassNames = classNamesFunction(); diff --git a/packages/office-ui-fabric-react/src/components/Button/examples/Button.Split.Example.tsx b/packages/office-ui-fabric-react/src/components/Button/examples/Button.Split.Example.tsx index 3ab322885eda6c..63ae1632d8ccf7 100644 --- a/packages/office-ui-fabric-react/src/components/Button/examples/Button.Split.Example.tsx +++ b/packages/office-ui-fabric-react/src/components/Button/examples/Button.Split.Example.tsx @@ -15,7 +15,7 @@ const alertClicked = (): void => { export class ButtonSplitExample extends React.Component { - public render() { + public render(): JSX.Element { const { disabled, checked } = this.props; const getClassNames = classNamesFunction(); @@ -139,7 +139,7 @@ export class ButtonSplitExample extends React.Component { export class ButtonSplitCustomExample extends React.Component { - public render() { + public render(): JSX.Element { const { disabled, checked } = this.props; const customSplitButtonStyles = getCustomSplitButtonStyles(); diff --git a/packages/office-ui-fabric-react/src/components/Button/examples/Button.Swap.Example.tsx b/packages/office-ui-fabric-react/src/components/Button/examples/Button.Swap.Example.tsx index e91de6bf13f39a..80061d9aa3dee9 100644 --- a/packages/office-ui-fabric-react/src/components/Button/examples/Button.Swap.Example.tsx +++ b/packages/office-ui-fabric-react/src/components/Button/examples/Button.Swap.Example.tsx @@ -39,7 +39,7 @@ export class ButtonSwapExample extends React.Component { dateRangeType={ DateRangeType.Week } autoNavigateOnSelection={ true } onSelectDate={ onSelectDate() } + className='CalendarTestClass' />) as Calendar; }); @@ -246,6 +245,17 @@ describe('Calendar', () => { expect(lastSelectedDateRange!.length).toEqual(7); lastSelectedDateRange!.forEach((val, i) => expect(compareDates(val, addDays(firstDate, i))).toEqual(true)); }); + + it('Verify class name', () => { + const calendarRoot = ReactTestUtils.scryRenderedDOMComponentsWithClass(renderedComponent, 'CalendarTestClass'); + expect(calendarRoot).toBeDefined(); + expect(calendarRoot.length).toEqual(1); + const root = calendarRoot[0]; + expect(root.classList).toBeDefined(); + expect(root.classList.length).toEqual(2); + expect(root.classList[0]).toEqual('ms-DatePicker'); + expect(root.classList[1]).toEqual('CalendarTestClass'); + }); }); describe('render with date boundaries', () => { diff --git a/packages/office-ui-fabric-react/src/components/Calendar/Calendar.tsx b/packages/office-ui-fabric-react/src/components/Calendar/Calendar.tsx index 6d999bf54e92f6..a79e89f50895ce 100644 --- a/packages/office-ui-fabric-react/src/components/Calendar/Calendar.tsx +++ b/packages/office-ui-fabric-react/src/components/Calendar/Calendar.tsx @@ -63,6 +63,7 @@ export class Calendar extends BaseComponent impl showGoToToday: true, strings: null, highlightCurrentMonth: false, + highlightSelectedMonth: false, navigationIcons: iconStrings, showWeekNumbers: false, firstWeekOfYear: FirstWeekOfYear.FirstDay, @@ -92,7 +93,7 @@ export class Calendar extends BaseComponent impl this._focusOnUpdate = false; } - public componentWillReceiveProps(nextProps: ICalendarProps) { + public componentWillReceiveProps(nextProps: ICalendarProps): void { const { autoNavigateOnSelection, value, today = new Date() } = nextProps; // Make sure auto-navigation is supported for programmatic changes to selected date, i.e., @@ -109,28 +110,28 @@ export class Calendar extends BaseComponent impl }); } - public componentDidUpdate() { + public componentDidUpdate(): void { if (this._focusOnUpdate) { // if the day picker is shown, focus on it - if (this._dayPicker.value) { - this._dayPicker.value.focus(); - } else if (this._monthPicker.value) { - this._monthPicker.value.focus(); + if (this._dayPicker.current) { + this._dayPicker.current.focus(); + } else if (this._monthPicker.current) { + this._monthPicker.current.focus(); } this._focusOnUpdate = false; } } - public render() { + public render(): JSX.Element { const rootClass = 'ms-DatePicker'; - const { firstDayOfWeek, dateRangeType, strings, showMonthPickerAsOverlay, autoNavigateOnSelection, showGoToToday, highlightCurrentMonth, navigationIcons, minDate, maxDate } = this.props; + const { firstDayOfWeek, dateRangeType, strings, showMonthPickerAsOverlay, autoNavigateOnSelection, showGoToToday, highlightCurrentMonth, highlightSelectedMonth, navigationIcons, minDate, maxDate, className } = this.props; const { selectedDate, navigatedDate, isMonthPickerVisible, isDayPickerVisible } = this.state; const onHeaderSelect = showMonthPickerAsOverlay ? this._onHeaderSelect : undefined; const monthPickerOnly = !showMonthPickerAsOverlay && !isDayPickerVisible; const overlayedWithButton = showMonthPickerAsOverlay && showGoToToday; return ( -
    +
    impl { isMonthPickerVisible && impl } public focus() { - if (this._dayPicker.value) { - this._dayPicker.value.focus(); + if (this._dayPicker.current) { + this._dayPicker.current.focus(); } } @@ -257,7 +260,7 @@ export class Calendar extends BaseComponent impl } private _onGotoTodayKeyDown = (ev: React.KeyboardEvent): void => { - if (ev.which === KeyCodes.enter || ev.which === KeyCodes.space) { + if (ev.which === KeyCodes.enter) { ev.preventDefault(); this._onGotoToday(); } else if (ev.which === KeyCodes.tab && !ev.shiftKey) { diff --git a/packages/office-ui-fabric-react/src/components/Calendar/Calendar.types.ts b/packages/office-ui-fabric-react/src/components/Calendar/Calendar.types.ts index e3f731dcea3fb7..d6401d66e5f613 100644 --- a/packages/office-ui-fabric-react/src/components/Calendar/Calendar.types.ts +++ b/packages/office-ui-fabric-react/src/components/Calendar/Calendar.types.ts @@ -16,6 +16,11 @@ export interface ICalendarProps extends React.Props { */ componentRef?: (component: ICalendar | null) => void; + /** + * Optional class name to add to the root element. + */ + className?: string; + /** * Callback issued when a date is selected * @param date - The date the user selected @@ -100,6 +105,12 @@ export interface ICalendarProps extends React.Props { */ highlightCurrentMonth?: boolean; + /** + * Whether the month picker should highlight the selected month + * @defaultvalue false + */ + highlightSelectedMonth?: boolean; + /** * Customize navigation icons using ICalendarIconStrings */ @@ -196,6 +207,11 @@ export interface ICalendarStrings { */ nextYearAriaLabel?: string; + /** + * Aria-label format string for the week number header. Should have 1 string param e.g. "week number {0}" + */ + weekNumberFormatString?: string; + } export interface ICalendarIconStrings { diff --git a/packages/office-ui-fabric-react/src/components/Calendar/CalendarDay.tsx b/packages/office-ui-fabric-react/src/components/Calendar/CalendarDay.tsx index 7907ad60de58e5..e0493c4cd2f01d 100644 --- a/packages/office-ui-fabric-react/src/components/Calendar/CalendarDay.tsx +++ b/packages/office-ui-fabric-react/src/components/Calendar/CalendarDay.tsx @@ -5,7 +5,8 @@ import { css, getId, getRTL, - getRTLSafeKeyCode + getRTLSafeKeyCode, + format } from '../../Utilities'; import { ICalendarStrings, ICalendarIconStrings, ICalendarFormatDateCallbacks } from './Calendar.types'; import { DayOfWeek, FirstWeekOfYear, DateRangeType } from '../../utilities/dateValues/DateValues'; @@ -78,10 +79,8 @@ interface IWeekCorners { } export class CalendarDay extends BaseComponent { - public refs: { - [key: string]: React.ReactInstance; - navigatedDay: HTMLElement; - }; + private navigatedDay: HTMLElement | null; + private days: { [key: string]: HTMLElement | null } = {}; public constructor(props: ICalendarDayProps) { super(props); @@ -95,13 +94,13 @@ export class CalendarDay extends BaseComponent -
    -
    - - -
    -
    -
    +
    { this.props.onHeaderSelect ?
    }
    +
    +
    + + +
    +
    - { - showWeekNumbers ? - - - { weekNumbers!.map((weekNumber, index) => - - - - ) } - -
    -
    - { weekNumber } -
    -
    - : null - } + { showWeekNumbers && - + { weeks!.map((week, weekIndex) => - + + { showWeekNumbers && weekNumbers && + + } { week.map((day, dayIndex) => { const isNavigatedDate = compareDates(navigatedDate, day.originalDate); return - +
    } { strings.shortDays.map((val, index) => ) }
    +
    + { weekNumbers[weekIndex] } +
    +
    this._setDayRef(element, day, isNavigatedDate) } + onMouseOver={ dateRangeType === DateRangeType.Month ? this._onDayMouseOver(day.originalDate, weekIndex, dayIndex) : undefined } + onMouseLeave={ dateRangeType === DateRangeType.Month ? this._onDayMouseLeave(day.originalDate, weekIndex, dayIndex) : undefined } + onMouseDown={ dateRangeType === DateRangeType.Month ? this._onDayMouseDown(day.originalDate, weekIndex, dayIndex) : undefined } + onMouseUp={ dateRangeType === DateRangeType.Month ? this._onDayMouseUp(day.originalDate, weekIndex, dayIndex) : undefined } >
    @@ -282,14 +287,21 @@ export class CalendarDay extends BaseComponent 0) { @@ -347,7 +359,7 @@ export class CalendarDay extends BaseComponent, date: Date, weekIndex: number, dayIndex: number) { + private _navigateMonthEdge(ev: React.KeyboardEvent, date: Date, weekIndex: number, dayIndex: number): void { const { minDate, maxDate } = this.props; let targetDate: Date | undefined = undefined; @@ -415,6 +427,90 @@ export class CalendarDay extends BaseComponent) => void => { + return (ev: React.MouseEvent): void => { + // set the press styling + this._applyFunctionToDayRefs((ref, day) => { + if (ref && day.originalDate.getMonth() === originalDate.getMonth()) { + ref.classList.add(styles.monthPress); + } + }); + }; + } + + private _onDayMouseUp = (originalDate: Date, weekIndex: number, dayIndex: number) + : (ev: React.MouseEvent) => void => { + return (ev: React.MouseEvent): void => { + // remove press styling + this._applyFunctionToDayRefs((ref, day) => { + if (ref && day.originalDate.getMonth() === originalDate.getMonth()) { + ref.classList.remove(styles.monthPress); + } + }); + }; + } + + private _onDayMouseOver = (originalDate: Date, weekIndex: number, dayIndex: number) + : (ev: React.MouseEvent) => void => { + return (ev: React.MouseEvent): void => { + // set the hover styling on every day in the same month + this._applyFunctionToDayRefs((ref, day) => { + if (ref && day.originalDate.getMonth() === originalDate.getMonth()) { + ref.classList.add(styles.monthHover); + } + }); + }; + } + + private _onDayMouseLeave = (originalDate: Date, weekIndex: number, dayIndex: number) + : (ev: React.MouseEvent) => void => { + return (ev: React.MouseEvent): void => { + // remove the hover and pressed styling + this._applyFunctionToDayRefs((ref, day) => { + if (ref && day.originalDate.getMonth() === originalDate.getMonth()) { + ref.classList.remove(styles.monthHover); + } + }); + }; + } + + private _onTableMouseLeave = (ev: React.MouseEvent): void => { + if ((ev.target as HTMLElement).contains && (ev.target as HTMLElement).contains(ev.relatedTarget as HTMLElement)) { + return; + } + + this._applyFunctionToDayRefs((ref, day) => { + if (ref) { + ref.classList.remove(styles.monthHover); + ref.classList.remove(styles.monthPress); + } + }); + } + + private _onTableMouseUp = (ev: React.MouseEvent): void => { + if ((ev.target as HTMLElement).contains && (ev.target as HTMLElement).contains(ev.relatedTarget as HTMLElement)) { + return; + } + + this._applyFunctionToDayRefs((ref, day) => { + if (ref) { + ref.classList.remove(styles.monthPress); + } + }); + } + + private _applyFunctionToDayRefs(func: (ref: HTMLElement | null, day: IDayInfo) => void) { + if (this.state.weeks && this.props.dateRangeType === DateRangeType.Month) { + this.state.weeks.map(week => { + week.map(day => { + const ref = this.days[day.key]; + func(ref, day); + }); + }); + } + } + private _onSelectDate = (selectedDate: Date): void => { const { onSelectDate, @@ -470,11 +566,15 @@ export class CalendarDay extends BaseComponent): void => { - this._onKeyDown(this._onSelectPrevMonth, ev); + if (ev.which === KeyCodes.enter) { + this._onKeyDown(this._onSelectPrevMonth, ev); + } } private _onNextMonthKeyDown = (ev: React.KeyboardEvent): void => { - this._onKeyDown(this._onSelectNextMonth, ev); + if (ev.which === KeyCodes.enter) { + this._onKeyDown(this._onSelectNextMonth, ev); + } } private _getWeeks(propsToUse: ICalendarDayProps): IDayInfo[][] { @@ -501,7 +601,9 @@ export class CalendarDay extends BaseComponent { componentRef?: (c: ICalendarMonth) => void; navigatedDate: Date; + selectedDate: Date; strings: ICalendarStrings; onNavigateDate: (date: Date, focusOnNavigatedDay: boolean) => void; today?: Date; highlightCurrentMonth: boolean; + highlightSelectedMonth: boolean; onHeaderSelect?: (focus: boolean) => void; navigationIcons: ICalendarIconStrings; dateTimeFormatter: ICalendarFormatDateCallbacks; @@ -52,9 +54,9 @@ export class CalendarMonth extends BaseComponent { this._onSelectMonth = this._onSelectMonth.bind(this); } - public render() { + public render(): JSX.Element { - const { navigatedDate, strings, today, highlightCurrentMonth, navigationIcons, dateTimeFormatter, minDate, maxDate } = this.props; + const { navigatedDate, selectedDate, strings, today, highlightCurrentMonth, highlightSelectedMonth, navigationIcons, dateTimeFormatter, minDate, maxDate } = this.props; const leftNavigationIcon = navigationIcons.leftNavigation; const rightNavigationIcon = navigationIcons.rightNavigation; @@ -64,34 +66,6 @@ export class CalendarMonth extends BaseComponent { return (
    -
    -
    - - -
    -
    { this.props.onHeaderSelect ?
    { { dateTimeFormatter.formatYear(navigatedDate) }
    } +
    +
    + + +
    +
    { const indexedMonth = setMonth(navigatedDate, index); const isCurrentMonth = this._isCurrentMonth(index, navigatedDate.getFullYear(), today!); const isNavigatedMonth = navigatedDate.getMonth() === index; + const isSelectedMonth = selectedDate.getMonth() === index; + const isSelectedYear = selectedDate.getFullYear() === navigatedDate.getFullYear(); const isInBounds = (minDate ? compareDatePart(minDate, getMonthEnd(indexedMonth)) < 1 : true) && (maxDate ? compareDatePart(getMonthStart(indexedMonth), maxDate) < 1 : true); @@ -129,7 +133,8 @@ export class CalendarMonth extends BaseComponent { css('ms-DatePicker-monthOption', styles.monthOption, { ['ms-DatePicker-day--today ' + styles.monthIsCurrentMonth]: highlightCurrentMonth && isCurrentMonth!, - ['ms-DatePicker-day--highlighted ' + styles.monthIsHighlighted]: highlightCurrentMonth && isNavigatedMonth, + ['ms-DatePicker-day--highlighted ' + styles.monthIsHighlighted]: (highlightCurrentMonth && isNavigatedMonth) || + (highlightSelectedMonth && isSelectedMonth && isSelectedYear), ['ms-DatePicker-monthOption--disabled ' + styles.monthOptionIsDisabled]: !isInBounds }) } @@ -157,7 +162,7 @@ export class CalendarMonth extends BaseComponent { } } - private _isCurrentMonth(month: number, year: number, today: Date) { + private _isCurrentMonth(month: number, year: number, today: Date): boolean { return today.getFullYear() === year && today.getMonth() === month; } @@ -173,7 +178,9 @@ export class CalendarMonth extends BaseComponent { } private _onSelectNextYearKeyDown = (ev: React.KeyboardEvent): void => { - this._onKeyDown(this._onSelectNextYear, ev); + if (ev.which === KeyCodes.enter) { + this._onKeyDown(this._onSelectNextYear, ev); + } } private _onSelectPrevYear = (): void => { @@ -182,7 +189,9 @@ export class CalendarMonth extends BaseComponent { } private _onSelectPrevYearKeyDown = (ev: React.KeyboardEvent): void => { - this._onKeyDown(this._onSelectPrevYear, ev); + if (ev.which === KeyCodes.enter) { + this._onKeyDown(this._onSelectPrevYear, ev); + } } private _onSelectMonth = (newMonth: number): void => { diff --git a/packages/office-ui-fabric-react/src/components/Calendar/CalendarPage.tsx b/packages/office-ui-fabric-react/src/components/Calendar/CalendarPage.tsx index b3609024692755..485a312fa0e01b 100644 --- a/packages/office-ui-fabric-react/src/components/Calendar/CalendarPage.tsx +++ b/packages/office-ui-fabric-react/src/components/Calendar/CalendarPage.tsx @@ -3,7 +3,8 @@ import { ComponentPage, ExampleCard, IComponentDemoPageProps, - PropertiesTableSet + PropertiesTableSet, + PageMarkdown, } from '@uifabric/example-app-base'; import { DateRangeType, DayOfWeek } from 'office-ui-fabric-react/lib/Calendar'; import { CalendarButtonExample } from './examples/Calendar.Button.Example'; @@ -16,12 +17,13 @@ const CalendarButtonExampleCode = require('!raw-loader!office-ui-fabric-react/sr const CalendarInlineExampleCode = require('!raw-loader!office-ui-fabric-react/src/components/Calendar/examples/Calendar.Inline.Example.tsx') as string; export class CalendarPage extends React.Component { - public render() { + public render(): JSX.Element { const today = new Date(Date.now()); return ( @@ -38,7 +40,8 @@ export class CalendarPage extends React.Component > @@ -62,6 +66,8 @@ export class CalendarPage extends React.Component @@ -73,6 +79,8 @@ export class CalendarPage extends React.Component @@ -100,7 +108,8 @@ export class CalendarPage extends React.Component dateRangeType={ DateRangeType.Month } autoNavigateOnSelection={ false } showGoToToday={ true } - highlightCurrentMonth={ true } + highlightCurrentMonth={ false } + highlightSelectedMonth={ true } isDayPickerVisible={ false } /> @@ -111,7 +120,8 @@ export class CalendarPage extends React.Component dateRangeType={ DateRangeType.WorkWeek } firstDayOfWeek={ DayOfWeek.Monday } autoNavigateOnSelection={ true } - highlightCurrentMonth={ true } + highlightCurrentMonth={ false } + highlightSelectedMonth={ true } showGoToToday={ true } workWeekDays={ [DayOfWeek.Tuesday, DayOfWeek.Saturday, DayOfWeek.Wednesday, DayOfWeek.Friday] } /> @@ -143,7 +154,8 @@ export class CalendarPage extends React.Component > @@ -153,7 +165,8 @@ export class CalendarPage extends React.Component > @@ -167,40 +180,27 @@ export class CalendarPage extends React.Component /> } overview={ -
    -

    - The calendar component allows a user to browse through a calendar and pick a date value. -

    -
    + + { require('!raw-loader!office-ui-fabric-react/src/components/Calendar/docs/CalendarOverview.md') } + } bestPractices={
    } dos={ -
    -
      -
    • Use the control as a single entity.
    • -
    • Set the default date to the current date unless a specific date is required for context (e.g. the date of the conference).
    • -
    • The control is designed to resize relative to available screen width. Allow it to render in either wide or narrow as appropriate.
    • -
    • When the control is engaged, the Calendar renders as a flyout and has defined widths (300px -narrow and 440px – wide). Plan your UI implementation accordingly.
    • -
    • The control renders date in a specific format. If allowing for manual entry of date, provide helper text in the appropriate format.
    • -
    -
    + + { require('!raw-loader!office-ui-fabric-react/src/components/Calendar/docs/CalendarDos.md') } + } donts={ -
    -
      -
    • Don't attempt to break apart year from month/day selectors. If granularity is required, use the Dropdown control or something similar.
    • -
    • Don't attempt to force resize the control in any way.
    • -
    • Don't force the control to render one mode vs. the other (year or month/day)
    • -
    • The flyout selector is a light dismiss control. Don't modify this behavior in any way.
    • -
    -
    + + { require('!raw-loader!office-ui-fabric-react/src/components/Calendar/docs/CalendarDonts.md') } + } isHeaderVisible={ this.props.isHeaderVisible } componentStatus={ } /> diff --git a/packages/office-ui-fabric-react/src/components/Calendar/__snapshots__/Calendar.test.tsx.snap b/packages/office-ui-fabric-react/src/components/Calendar/__snapshots__/Calendar.test.tsx.snap index 507065a96d6f5d..7d08d9ef31f465 100644 --- a/packages/office-ui-fabric-react/src/components/Calendar/__snapshots__/Calendar.test.tsx.snap +++ b/packages/office-ui-fabric-react/src/components/Calendar/__snapshots__/Calendar.test.tsx.snap @@ -22,54 +22,6 @@ exports[`Calendar Test rendering simplest calendar Renders simple calendar corre className="ms-DatePicker-dayPicker" id="DatePickerDay-dayPicker10" > -
    -
    - - -
    -
    @@ -77,6 +29,7 @@ exports[`Calendar Test rendering simplest calendar Renders simple calendar corre aria-atomic="true" aria-live="polite" aria-relevant="text" + className={undefined} id="DatePickerDay-monthAndYear11" >
    +
    +
    + + +
    +
    -
    -
    - - -
    -
    @@ -952,6 +1055,52 @@ exports[`Calendar Test rendering simplest calendar Renders simple calendar corre > 2000
    +
    +
    + + +
    +
    this._calendarButtonElement = calendarBtn! }> @@ -125,6 +126,7 @@ export class CalendarButtonExample extends React.Component @@ -134,21 +136,21 @@ export class CalendarButtonExample extends React.Component { prevState.showCalendar = !prevState.showCalendar; return prevState; }); } - private _onDismiss() { + private _onDismiss(): void { this.setState((prevState: ICalendarButtonExampleState) => { prevState.showCalendar = false; return prevState; }); } - private _onSelectDate(date: Date) { + private _onSelectDate(date: Date): void { this.setState((prevState: ICalendarButtonExampleState) => { prevState.showCalendar = false; prevState.selectedDate = date; diff --git a/packages/office-ui-fabric-react/src/components/Calendar/examples/Calendar.Inline.Example.tsx b/packages/office-ui-fabric-react/src/components/Calendar/examples/Calendar.Inline.Example.tsx index d6819cbc42f4c7..59b966a8142add 100644 --- a/packages/office-ui-fabric-react/src/components/Calendar/examples/Calendar.Inline.Example.tsx +++ b/packages/office-ui-fabric-react/src/components/Calendar/examples/Calendar.Inline.Example.tsx @@ -58,7 +58,8 @@ const DayPickerStrings = { 'S' ], - goToToday: 'Go to today' + goToToday: 'Go to today', + weekNumberFormatString: 'Week number {0}', }; export interface ICalendarInlineExampleState { @@ -73,6 +74,7 @@ export interface ICalendarInlineExampleProps { showGoToToday: boolean; showNavigateButtons?: boolean; highlightCurrentMonth?: boolean; + highlightSelectedMonth?: boolean; isDayPickerVisible?: boolean; showMonthPickerAsOverlay?: boolean; showWeekNumbers?: boolean; @@ -98,7 +100,7 @@ export class CalendarInlineExample extends React.Component { return prevState; }); } - private _goPrevious() { + private _goPrevious(): void { this.setState((prevState: ICalendarInlineExampleState) => { const selectedDate = prevState.selectedDate || new Date(); const dateRangeArray = getDateRangeArray(selectedDate, this.props.dateRangeType, DayOfWeek.Sunday); @@ -185,7 +188,7 @@ export class CalendarInlineExample extends React.Component { const selectedDate = prevState.selectedDate || new Date(); const dateRangeArray = getDateRangeArray(selectedDate, this.props.dateRangeType, DayOfWeek.Sunday); @@ -197,7 +200,7 @@ export class CalendarInlineExample extends React.Component { return { selectedDate: date, diff --git a/packages/office-ui-fabric-react/src/components/Callout/Callout.tsx b/packages/office-ui-fabric-react/src/components/Callout/Callout.tsx index 07bf90be3eb67b..737428170c92b7 100644 --- a/packages/office-ui-fabric-react/src/components/Callout/Callout.tsx +++ b/packages/office-ui-fabric-react/src/components/Callout/Callout.tsx @@ -1,6 +1,4 @@ -/* tslint:disable:no-unused-variable */ import * as React from 'react'; -/* tslint:enable:no-unused-variable */ import { BaseComponent } from '../../Utilities'; import { ICalloutProps } from './Callout.types'; @@ -19,7 +17,7 @@ export class Callout extends BaseComponent { }); } - public render() { + public render(): JSX.Element { const content = ( ); diff --git a/packages/office-ui-fabric-react/src/components/Callout/CalloutContent.base.tsx b/packages/office-ui-fabric-react/src/components/Callout/CalloutContent.base.tsx index aad6f3163b7162..807243c1ca152d 100644 --- a/packages/office-ui-fabric-react/src/components/Callout/CalloutContent.base.tsx +++ b/packages/office-ui-fabric-react/src/components/Callout/CalloutContent.base.tsx @@ -1,6 +1,4 @@ -/* tslint:disable:no-unused-variable */ import * as React from 'react'; -/* tslint:enable:no-unused-variable */ import { ICalloutProps, ICalloutContentStyleProps, @@ -114,7 +112,7 @@ export class CalloutContentBase extends BaseComponent { - if (this.props.setInitialFocus && !this._didSetInitialFocus && this.state.positions && this._calloutElement.value) { + if (this.props.setInitialFocus && !this._didSetInitialFocus && this.state.positions && this._calloutElement.current) { this._didSetInitialFocus = true; - this._async.requestAnimationFrame(() => focusFirstChild(this._calloutElement.value!)); + this._async.requestAnimationFrame(() => focusFirstChild(this._calloutElement.current!)); } } @@ -307,7 +305,7 @@ export class CalloutContentBase extends BaseComponent this._updatePosition()); } @@ -325,10 +323,10 @@ export class CalloutContentBase extends BaseComponent { - const calloutMainElem = this._calloutElement.value && this._calloutElement.value.lastChild as HTMLElement; + const calloutMainElem = this._calloutElement.current && this._calloutElement.current.lastChild as HTMLElement; if (!calloutMainElem) { return; diff --git a/packages/office-ui-fabric-react/src/components/Callout/CalloutContent.tsx b/packages/office-ui-fabric-react/src/components/Callout/CalloutContent.tsx index bab78ae1af389e..ace32b65844106 100644 --- a/packages/office-ui-fabric-react/src/components/Callout/CalloutContent.tsx +++ b/packages/office-ui-fabric-react/src/components/Callout/CalloutContent.tsx @@ -1,5 +1,3 @@ -/* tslint:disable:no-unused-variable */ -import * as React from 'react'; import { styled } from '../../Utilities'; @@ -7,7 +5,7 @@ import { ICalloutProps } from './Callout.types'; import { CalloutContentBase } from './CalloutContent.base'; import { getStyles } from './CalloutContent.styles'; -export const CalloutContent = styled( +export const CalloutContent: (props: ICalloutProps) => JSX.Element = styled( CalloutContentBase, getStyles ); \ No newline at end of file diff --git a/packages/office-ui-fabric-react/src/components/Callout/CalloutPage.tsx b/packages/office-ui-fabric-react/src/components/Callout/CalloutPage.tsx index 1ad35f6e42f521..3da6221681baf6 100644 --- a/packages/office-ui-fabric-react/src/components/Callout/CalloutPage.tsx +++ b/packages/office-ui-fabric-react/src/components/Callout/CalloutPage.tsx @@ -3,7 +3,8 @@ import { ComponentPage, ExampleCard, IComponentDemoPageProps, - PropertiesTableSet + PropertiesTableSet, + PageMarkdown, } from '@uifabric/example-app-base'; import { items } from '../CommandBar/examples/data'; @@ -20,13 +21,14 @@ const CalloutDirectionalExampleCode = require('!raw-loader!office-ui-fabric-reac const CalloutCoverExampleCode = require('!raw-loader!office-ui-fabric-react/src/components/Callout/examples/Callout.Cover.Example.tsx') as string; export class CalloutPage extends React.Component { - public render() { + public render(): JSX.Element { const cmdBarParamsTextAndIcons: any = { items: items, farItems: null }; return ( @@ -54,47 +56,27 @@ export class CalloutPage extends React.Component {
    } overview={ -
    -

    Callouts are a powerful way to simplify a user interface. They host tips and other information users need when they need it, with minimal effort on their part. Callouts can help you use screen space more effectively and reduce screen clutter. However, poorly designed Callouts can be annoying, distracting, unhelpful, overwhelming, or in the way.

    - -

    Use a Callout for displaying additional contextual information about an item on the screen. Callouts also have a tail that identifies their source. A common use for Callout is the introduction of a new feature or capability of an app or site. Alternate usages include pairing the Callout with a button or clickable element for on-demand presentation of additional or supporting content.

    - -

    Real-world examples of this implementation can be seen in administrative interfaces where a particularly difficult-to-understand concept is paired with the iconClassNames.info "i" icon. In this example, Callout - with its tip text - is opened when the user clicks on or hovers over the icon.

    -
    + + { require('!raw-loader!office-ui-fabric-react/src/components/Callout/docs/CalloutOverview.md') } + } bestPractices={
    } dos={ -
    -
      -
    • Use Callouts to introduce new concepts in an experience where highlighting specific pieces of the UI is necessary.
    • -
    • Do be concise with the information you provide inside of a Callout. Short sentences or sentence fragments are best.
    • -
    • Do be helpful with the tip text inside of your Callout.
    • -
    • Do limit the information inside of a Callout to supplemental information that users don't have to read.
    • -
    • Callouts should be placed near the object being described, usually at the pointer's tail or head if possible.
    • -
    • When additional context - or more advanced description - is necessary, consider placing a link to "Learn more" at the bottom of the Callout and opening the additional content in a new window or Panel when clicked.
    • -
    -
    + + { require('!raw-loader!office-ui-fabric-react/src/components/Callout/docs/CalloutDos.md') } + } donts={ -
    -
      -
    • Don’t overuse Callout without putting the user in control. Too many Callouts which open automatically can be perceived as interrupting workflow and are a bad user experience.
    • -
    • Don't use large, unformatted blocks of text in your Callout, they are difficult to read and overwhelming.
    • -
    • Don't put obvious tip text, or text that simply repeats what is already on the screen in your Callout.
    • -
    • Because the content inside of a Callout isn't always visible, don't put important or required information in a Callout.
    • -
    • Don’t block important UI with the placement of your Callout, it is a poor user experience that will lead to frustration.
    • -
    • Don’t open Callout from within another Callout.
    • -
    • Don’t use Callout to ask the user to confirm an action, use a Dialog instead.
    • -
    • Don’t show Callouts on hidden elements.
    • -
    -
    + + { require('!raw-loader!office-ui-fabric-react/src/components/Callout/docs/CalloutDonts.md') } + } isHeaderVisible={ this.props.isHeaderVisible } componentStatus={ } /> diff --git a/packages/office-ui-fabric-react/src/components/Callout/docs/CalloutDonts.md b/packages/office-ui-fabric-react/src/components/Callout/docs/CalloutDonts.md new file mode 100644 index 00000000000000..6520cbea8d16c0 --- /dev/null +++ b/packages/office-ui-fabric-react/src/components/Callout/docs/CalloutDonts.md @@ -0,0 +1,8 @@ +- Don’t overuse Callout without putting the user in control. Too many Callouts which open automatically can be perceived as interrupting workflow and are a bad user experience. +- Don't use large, unformatted blocks of text in your Callout, they are difficult to read and overwhelming. +- Don't put obvious tip text, or text that simply repeats what is already on the screen in your Callout. +- Because the content inside of a Callout isn't always visible, don't put important or required information in a Callout. +- Don’t block important UI with the placement of your Callout, it is a poor user experience that will lead to frustration. +- Don’t open Callout from within another Callout. +- Don’t use Callout to ask the user to confirm an action, use a Dialog instead. +- Don’t show Callouts on hidden elements. \ No newline at end of file diff --git a/packages/office-ui-fabric-react/src/components/Callout/docs/CalloutDos.md b/packages/office-ui-fabric-react/src/components/Callout/docs/CalloutDos.md new file mode 100644 index 00000000000000..865bc50ab5309b --- /dev/null +++ b/packages/office-ui-fabric-react/src/components/Callout/docs/CalloutDos.md @@ -0,0 +1,6 @@ +- Use Callouts to introduce new concepts in an experience where highlighting specific pieces of the UI is necessary. +- Do be concise with the information you provide inside of a Callout. Short sentences or sentence fragments are best. +- Do be helpful with the tip text inside of your Callout. +- Do limit the information inside of a Callout to supplemental information that users don't have to read. +- Callouts should be placed near the object being described, usually at the pointer's tail or head if possible. +- When additional context - or more advanced description - is necessary, consider placing a link to "Learn more" at the bottom of the Callout and opening the additional content in a new window or Panel when clicked. \ No newline at end of file diff --git a/packages/office-ui-fabric-react/src/components/Callout/docs/CalloutOverview.md b/packages/office-ui-fabric-react/src/components/Callout/docs/CalloutOverview.md new file mode 100644 index 00000000000000..87e096317a2b53 --- /dev/null +++ b/packages/office-ui-fabric-react/src/components/Callout/docs/CalloutOverview.md @@ -0,0 +1,5 @@ +Callouts are a powerful way to simplify a user interface. They host tips and other information users need when they need it, with minimal effort on their part. Callouts can help you use screen space more effectively and reduce screen clutter. However, poorly designed Callouts can be annoying, distracting, unhelpful, overwhelming, or in the way. + +Use a Callout for displaying additional contextual information about an item on the screen. Callouts also have a tail that identifies their source. A common use for Callout is the introduction of a new feature or capability of an app or site. Alternate usages include pairing the Callout with a button or clickable element for on-demand presentation of additional or supporting content. + +Real-world examples of this implementation can be seen in administrative interfaces where a particularly difficult-to-understand concept is paired with the iconClassNames.info "i" icon. In this example, Callout - with its tip text - is opened when the user clicks on or hovers over the icon. \ No newline at end of file diff --git a/packages/office-ui-fabric-react/src/components/Callout/examples/Callout.Basic.Example.tsx b/packages/office-ui-fabric-react/src/components/Callout/examples/Callout.Basic.Example.tsx index 2e1e81f02ac389..45043738e3ba49 100644 --- a/packages/office-ui-fabric-react/src/components/Callout/examples/Callout.Basic.Example.tsx +++ b/packages/office-ui-fabric-react/src/components/Callout/examples/Callout.Basic.Example.tsx @@ -2,6 +2,9 @@ import * as React from 'react'; import { DefaultButton } from 'office-ui-fabric-react/lib/Button'; import { Callout } from 'office-ui-fabric-react/lib/Callout'; import { Link } from 'office-ui-fabric-react/lib/Link'; +import { + createRef +} from 'office-ui-fabric-react/lib/Utilities'; import { getTheme, FontWeights, mergeStyleSets } from 'office-ui-fabric-react/lib/Styling'; export interface ICalloutBasicExampleState { @@ -50,7 +53,7 @@ const styles = mergeStyleSets({ // Example code export class CalloutBasicExample extends React.Component<{}, ICalloutBasicExampleState> { - private _menuButtonElement: HTMLElement | null; + private _menuButtonElement = createRef(); public constructor(props: {}) { super(props); @@ -60,12 +63,15 @@ export class CalloutBasicExample extends React.Component<{}, ICalloutBasicExampl }; } - public render() { + public render(): JSX.Element { const { isCalloutVisible } = this.state; return (
    -
    +