+ );
+ }
+ };
+
+ /** Renders a button to go back in the browser history only if there is a page to go back to. */
+ private _renderBackButton = (): JSX.Element => {
+ if (window.history.length > 1) {
+ return (
+
+ Fabric React components are built as production-ready, generalized, documented, and reusable components to be used in Microsoft
+ products. This enables us and our partners to more easily build great applications without spending a ton of time implementing the
+ same things over and over.
+
+
+
+ Each component is designed to be RTL-friendly, keyboard accessible, screen reader-friendly, themeable, and generalized. TypeScript
+ definition files are also included, so if you use TypeScript (which isn't a requirement), you will get compiler validation and
+ using an editor like VS Code, you'll get intellisense. Each component is exported as a named module that can be easily imported in
+ your code, allowing your external bundler to create small bundles that include just what you need.
+
+
+
Getting started
+
+
+ Integrating components into your project depends heavily on your setup. The recommended setup is to use a bundler such as
+
+ Webpack
+
+ which can resolve NPM package imports in your code and can bundle the specific things you import.
+
+
+
Within an npm project, you should install the package and save it as a dependency:
+
+
+ npm install --save office-ui-fabric-react
+
+
+
+ This will add the fabric-react project as a dependency in your package.json file, and will drop the project under
+ node_modules/office-ui-fabric-react.
+
+
+
+ The library includes commonjs entry points under the lib folder. To use a control, you should be able to import it and use it in
+ your render method. Note that wrapping your application in the Fabric component is required to support RTL, keyboard focus and
+ other features.
+
+
+
+ {`
+import * as React from 'react';
+import * as ReactDOM from 'react-dom';
+import { Fabric } from 'office-ui-fabric-react/lib/Fabric';
+import { DefaultButton } from 'office-ui-fabric-react/lib/Button';
+
+const MyPage = () => (I am a button.);
+
+ReactDOM.render(, document.body.firstChild);`}
+
+
+
Notes on module vs path-based imports
+
+ While it is possible to import all components as named imports from the main module entry point, it is not recommended to do so
+ without using a bundler that supports es6 tree shaking. In other words, if you import the Button component like this: }
+
+
+
+ {`import { Button } from 'office-ui-fabric-react';`}
+
+
+
+ ...this would work, but then unless you are using a tree-shaking bundler such as Rollup.js or Webpack 2, Webpack will assume you
+ want every module exported from the main entry file to be included in your final bundle, which produces unnecessary large bundles
+ and slows your page load down. Instead you can import the specific paths to trim down your bundle size:
+
+
+
+ {`
+import { Button } from 'office-ui-fabric-react/lib/Button';
+import { Dropdown } from 'office-ui-fabric-react/lib/Dropdown';
+import { List } from 'office-ui-fabric-react/lib/List';`}
+
+
+
Using an AMD bundler like r.js
+
+
+ If your project relies on AMD modules, they are dropped in the lib-amd folder. You will need to set up your bundler to handle the
+ imports correctly. This may require you to symlink or copy the folder into your pre-bundle location.
+
+
+ );
+ }
+}
diff --git a/packages/lists/src/demo/index.scss b/packages/lists/src/demo/index.scss
new file mode 100644
index 00000000000000..77cebee061ee60
--- /dev/null
+++ b/packages/lists/src/demo/index.scss
@@ -0,0 +1,8 @@
+@import '~office-ui-fabric-react/dist/sass/References';
+
+:global {
+ html,
+ body {
+ -webkit-tap-highlight-color: transparent;
+ }
+}
diff --git a/packages/lists/src/demo/index.tsx b/packages/lists/src/demo/index.tsx
new file mode 100644
index 00000000000000..12659a38067b26
--- /dev/null
+++ b/packages/lists/src/demo/index.tsx
@@ -0,0 +1,89 @@
+/* tslint:disable:no-unused-variable */
+import * as React from 'react';
+/* tslint:enable:no-unused-variable */
+import * as ReactDOM from 'react-dom';
+import { App, AppDefinition } from './AppDefinition';
+import { IAppLink, IAppLinkGroup } from '@uifabric/example-app-base';
+import { Router, Route } from 'office-ui-fabric-react/lib/utilities/router/index';
+import { initializeIcons } from 'office-ui-fabric-react/lib/Icons';
+import { setBaseUrl, Fabric } from 'office-ui-fabric-react';
+import { GettingStartedPage } from './GettingStartedPage';
+
+import './index.scss';
+import './ColorStyles.scss';
+
+setBaseUrl('./dist/');
+
+// Initialize all icons.
+initializeIcons();
+
+let rootElement: HTMLElement | null;
+
+// Return the anchor link from the URL without the hash
+function _extractAnchorLink(path: string): string {
+ const index = path.lastIndexOf('#');
+ if (index >= 0) {
+ path = path.substr(index + 1, path.length - index);
+ }
+ return path;
+}
+
+function _scrollAnchorLink(): void {
+ if ((window.location.hash.match(/#/g) || []).length > 1) {
+ const anchor = _extractAnchorLink(window.location.hash);
+ document.getElementById(anchor)!.scrollIntoView();
+ }
+}
+
+function _onLoad(): void {
+ rootElement = rootElement || document.getElementById('content');
+
+ ReactDOM.render(
+
+ {_getRoutes()}
+ ,
+ rootElement
+ );
+}
+
+function _getRoutes(): JSX.Element[] {
+ const routes = AppDefinition.testPages.map((page: IAppLink) => );
+ const appRoutes: JSX.Element[] = [];
+
+ AppDefinition.examplePages.forEach((group: IAppLinkGroup) => {
+ group.links
+ .filter((link: IAppLink) => link.hasOwnProperty('component') || link.hasOwnProperty('getComponent'))
+ .forEach((link: IAppLink, linkIndex: number) => {
+ const { component, getComponent } = link;
+
+ appRoutes.push();
+ });
+ });
+
+ // Default route.
+ appRoutes.push();
+
+ routes.push(
+
+ {appRoutes}
+
+ );
+
+ return routes;
+}
+
+function _onUnload(): void {
+ if (rootElement) {
+ ReactDOM.unmountComponentAtNode(rootElement);
+ }
+}
+
+const isReady = document.readyState === 'interactive' || document.readyState === 'complete';
+
+if (isReady) {
+ _onLoad();
+} else {
+ window.onload = _onLoad;
+}
+
+window.onunload = _onUnload;
diff --git a/packages/lists/src/index.ts b/packages/lists/src/index.ts
new file mode 100644
index 00000000000000..107367257abe5c
--- /dev/null
+++ b/packages/lists/src/index.ts
@@ -0,0 +1 @@
+import './version';
diff --git a/packages/lists/src/version.ts b/packages/lists/src/version.ts
new file mode 100644
index 00000000000000..f5705775a27ed9
--- /dev/null
+++ b/packages/lists/src/version.ts
@@ -0,0 +1,4 @@
+// @uifabric/lists@0.1.0
+// Do not modify this file, the file is generated as part of publish. The checked in version is a placeholder only.
+import { setVersion } from '@uifabric/set-version';
+setVersion('@uifabric/lists', '0.1.0');
\ No newline at end of file
diff --git a/packages/lists/tsconfig.json b/packages/lists/tsconfig.json
new file mode 100644
index 00000000000000..19aeb40f1c2dbd
--- /dev/null
+++ b/packages/lists/tsconfig.json
@@ -0,0 +1,26 @@
+{
+ "compilerOptions": {
+ "baseUrl": ".",
+ "outDir": "dist",
+ "target": "es5",
+ "module": "commonjs",
+ "jsx": "react",
+ "declaration": true,
+ "sourceMap": true,
+ "experimentalDecorators": true,
+ "importHelpers": true,
+ "noUnusedLocals": true,
+ "forceConsistentCasingInFileNames": true,
+ "strictNullChecks": true,
+ "noImplicitAny": true,
+ "moduleResolution": "node",
+ "preserveConstEnums": true,
+ "lib": ["es5", "dom"],
+ "types": ["jest", "webpack-env"],
+ "paths": {
+ "@uifabric/lists/lib/*": ["./src/*"],
+ "@uifabric/lists": ["./src"]
+ }
+ },
+ "include": ["src"]
+}
diff --git a/packages/lists/tslint.json b/packages/lists/tslint.json
new file mode 100644
index 00000000000000..06e306229f8738
--- /dev/null
+++ b/packages/lists/tslint.json
@@ -0,0 +1,4 @@
+{
+ "extends": ["@uifabric/tslint-rules"],
+ "rules": {}
+}
diff --git a/packages/lists/webpack.config.js b/packages/lists/webpack.config.js
new file mode 100644
index 00000000000000..8205c64803042b
--- /dev/null
+++ b/packages/lists/webpack.config.js
@@ -0,0 +1,26 @@
+const path = require('path');
+const resources = require('../../scripts/webpack/webpack-resources');
+
+const BUNDLE_NAME = 'lists';
+const IS_PRODUCTION = process.argv.indexOf('--production') > -1;
+
+module.exports = resources.createConfig(BUNDLE_NAME, IS_PRODUCTION, {
+ entry: {
+ [BUNDLE_NAME]: './lib/index.js'
+ },
+
+ output: {
+ libraryTarget: 'var',
+ library: 'FabricLists'
+ },
+
+ externals: [{ react: 'React' }, { 'react-dom': 'ReactDOM' }],
+
+ resolve: {
+ alias: {
+ '@uifabric/lists/src': path.join(__dirname, 'src'),
+ '@uifabric/lists/lib': path.join(__dirname, 'lib'),
+ '@uifabric/lists': path.join(__dirname, 'lib')
+ }
+ }
+});
diff --git a/packages/lists/webpack.serve.config.js b/packages/lists/webpack.serve.config.js
new file mode 100644
index 00000000000000..68c1f2d279d996
--- /dev/null
+++ b/packages/lists/webpack.serve.config.js
@@ -0,0 +1,28 @@
+const path = require('path');
+const resources = require('../../scripts/webpack/webpack-resources');
+const webpack = resources.webpack;
+
+const PACKAGE_NAME = require('./package.json').name;
+
+module.exports = resources.createServeConfig({
+ entry: './src/demo/index.tsx',
+
+ output: {
+ filename: 'demo-app.js'
+ },
+
+ externals: {
+ react: 'React',
+ 'react-dom': 'ReactDOM'
+ },
+
+ resolve: {
+ alias: {
+ '@uifabric/lists/src': path.join(__dirname, 'src'),
+ '@uifabric/lists/lib': path.join(__dirname, 'lib'),
+ '@uifabric/lists': path.join(__dirname, 'lib'),
+ 'Props.ts.js': 'Props',
+ 'Example.tsx.js': 'Example'
+ }
+ }
+});
diff --git a/packages/office-ui-fabric-react/CHANGELOG.json b/packages/office-ui-fabric-react/CHANGELOG.json
index 750dadb3f7179e..b3aba70ef222ef 100644
--- a/packages/office-ui-fabric-react/CHANGELOG.json
+++ b/packages/office-ui-fabric-react/CHANGELOG.json
@@ -1,6 +1,61 @@
{
"name": "office-ui-fabric-react",
"entries": [
+ {
+ "version": "6.182.1",
+ "tag": "office-ui-fabric-react_v6.182.1",
+ "date": "Thu, 16 May 2019 05:28:50 GMT",
+ "comments": {
+ "patch": [
+ {
+ "comment": "[Checkbox] Fix outline on focus.",
+ "author": "JD Huntington ",
+ "commit": "d0d926c5c415c4df00e3e537297e36cdb5efccdd"
+ }
+ ]
+ }
+ },
+ {
+ "version": "6.182.0",
+ "tag": "office-ui-fabric-react_v6.182.0",
+ "date": "Wed, 15 May 2019 12:31:44 GMT",
+ "comments": {
+ "patch": [
+ {
+ "comment": "added the title attribute for the cancel icon in the panel which is same as aira-label",
+ "author": "shivasai09 <33802398+shivasai09@users.noreply.github.com>",
+ "commit": "4b6c5f67888661c38ec4a1f75a9737a2ecf56dfd"
+ },
+ {
+ "comment": "Add TextField multiple-line errorMessage support",
+ "author": "iamchangming ",
+ "commit": "61a272d0a6795db704cbd2e154889b12edf1a45f"
+ },
+ {
+ "comment": "This latest PR is to ensure Nav link without icon should not be rendered with place-holder",
+ "author": "inateeg ",
+ "commit": "a2dd64cfd3a5540ced0dae0799d282fe574b90e6"
+ }
+ ],
+ "minor": [
+ {
+ "comment": "Nav respects changes to collapsedByDefault",
+ "author": "JD Huntington ",
+ "commit": "96b7dc34667f348bcaeb2a5884017438191df998"
+ },
+ {
+ "comment": "Allow custom aria label generation in suggestionStore",
+ "author": "Max ",
+ "commit": "950f160fea68db673098b9834d5116b6c9d9ce21"
+ },
+ {
+ "comment": "ShimmeredDetailsList: export to the surface missing API items.",
+ "author": "Vitalie Braga ",
+ "commit": "8c3f3b4755122ed5c78a819baf27c57b3805f075"
+ }
+ ]
+ }
+ },
{
"version": "6.181.1",
"tag": "office-ui-fabric-react_v6.181.1",
diff --git a/packages/office-ui-fabric-react/CHANGELOG.md b/packages/office-ui-fabric-react/CHANGELOG.md
index 5b75d52480a67a..184a69650c23c7 100644
--- a/packages/office-ui-fabric-react/CHANGELOG.md
+++ b/packages/office-ui-fabric-react/CHANGELOG.md
@@ -1,6 +1,28 @@
# Change Log - office-ui-fabric-react
-This log was last generated on Tue, 14 May 2019 07:50:31 GMT and should not be manually modified.
+This log was last generated on Thu, 16 May 2019 05:28:50 GMT and should not be manually modified.
+
+## 6.182.1
+Thu, 16 May 2019 05:28:50 GMT
+
+### Patches
+
+- [Checkbox] Fix outline on focus.
+
+## 6.182.0
+Wed, 15 May 2019 12:31:44 GMT
+
+### Minor changes
+
+- Nav respects changes to collapsedByDefault
+- Allow custom aria label generation in suggestionStore
+- ShimmeredDetailsList: export to the surface missing API items.
+
+### Patches
+
+- added the title attribute for the cancel icon in the panel which is same as aira-label
+- Add TextField multiple-line errorMessage support
+- This latest PR is to ensure Nav link without icon should not be rendered with place-holder
## 6.181.1
Tue, 14 May 2019 07:50:31 GMT
diff --git a/packages/office-ui-fabric-react/etc/office-ui-fabric-react.api.md b/packages/office-ui-fabric-react/etc/office-ui-fabric-react.api.md
index 8c522ac4bf2f97..903445c76c8f3c 100644
--- a/packages/office-ui-fabric-react/etc/office-ui-fabric-react.api.md
+++ b/packages/office-ui-fabric-react/etc/office-ui-fabric-react.api.md
@@ -5521,7 +5521,7 @@ export interface INavProps {
// @public (undocumented)
export interface INavState {
// (undocumented)
- isGroupCollapsed?: {
+ isGroupCollapsed: {
[key: string]: boolean;
};
// (undocumented)
@@ -6681,13 +6681,21 @@ export interface IShimmeredDetailsListProps extends IDetailsListProps {
onRenderCustomPlaceholder?: (rowProps: IDetailsRowProps) => React_2.ReactNode;
removeFadingOverlay?: boolean;
shimmerLines?: number;
- // Warning: (ae-forgotten-export) The symbol "IShimmeredDetailsListStyleProps" needs to be exported by the entry point index.d.ts
- // Warning: (ae-forgotten-export) The symbol "IShimmeredDetailsListStyles" needs to be exported by the entry point index.d.ts
- //
// @deprecated
styles?: IStyleFunctionOrObject;
}
+// @public
+export type IShimmeredDetailsListStyleProps = Required> & {
+ className?: string;
+ enableShimmer?: boolean;
+};
+
+// @public
+export interface IShimmeredDetailsListStyles {
+ root: IStyle;
+}
+
// @public
export interface IShimmerElement {
height?: number;
@@ -7496,7 +7504,7 @@ export interface ITextFieldProps extends React_2.AllHTMLAttributes, newValue?: string) => void;
// @deprecated (undocumented)
onChanged?: (newValue: any) => void;
- onGetErrorMessage?: (value: string) => string | PromiseLike | undefined;
- onNotifyValidationResult?: (errorMessage: string, value: string | undefined) => void;
+ onGetErrorMessage?: (value: string) => string | JSX.Element | PromiseLike | undefined;
+ onNotifyValidationResult?: (errorMessage: string | JSX.Element, value: string | undefined) => void;
// @deprecated (undocumented)
onRenderAddon?: IRenderFunction;
onRenderDescription?: IRenderFunction;
@@ -7535,7 +7543,7 @@ export interface ITextFieldProps extends React_2.AllHTMLAttributes;
export class NavBase extends React.Component implements INav {
constructor(props: INavProps);
// (undocumented)
- componentWillReceiveProps(newProps: INavProps): void;
- // (undocumented)
static defaultProps: INavProps;
// (undocumented)
render(): JSX.Element | null;
// (undocumented)
readonly selectedKey: string | undefined;
-}
+ }
// @public (undocumented)
export const NormalPeoplePicker: React.StatelessComponent;
@@ -9159,7 +9165,7 @@ export class SuggestionsItem extends BaseComponent, {
// @public (undocumented)
export class SuggestionsStore {
- constructor();
+ constructor(options?: SuggestionsStoreOptions);
// (undocumented)
convertSuggestionsToSuggestionItems(suggestions: Array | T>): ISuggestionModel[];
// (undocumented)
@@ -9174,6 +9180,11 @@ export class SuggestionsStore {
updateSuggestions(newSuggestions: T[]): void;
}
+// @public (undocumented)
+export type SuggestionsStoreOptions = {
+ getAriaLabel?: (item: T) => string;
+};
+
// @public (undocumented)
export const SwatchColorPicker: React_2.StatelessComponent;
diff --git a/packages/office-ui-fabric-react/package.json b/packages/office-ui-fabric-react/package.json
index e1752754835546..1e3ab8166d9684 100644
--- a/packages/office-ui-fabric-react/package.json
+++ b/packages/office-ui-fabric-react/package.json
@@ -1,6 +1,6 @@
{
"name": "office-ui-fabric-react",
- "version": "6.181.1",
+ "version": "6.182.1",
"description": "Reusable React components for building experiences for Office 365.",
"main": "lib-commonjs/index.js",
"module": "lib/index.js",
diff --git a/packages/office-ui-fabric-react/src/ShimmeredDetailsList.ts b/packages/office-ui-fabric-react/src/ShimmeredDetailsList.ts
index 6c39e97dad5c2a..97cc1f76d4d8a0 100644
--- a/packages/office-ui-fabric-react/src/ShimmeredDetailsList.ts
+++ b/packages/office-ui-fabric-react/src/ShimmeredDetailsList.ts
@@ -1,3 +1,3 @@
export * from './components/DetailsList/ShimmeredDetailsList';
export * from './components/DetailsList/ShimmeredDetailsList.base';
-export { IShimmeredDetailsListProps } from './components/DetailsList/ShimmeredDetailsList.types';
+export * from './components/DetailsList/ShimmeredDetailsList.types';
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 21d7c4edfa3434..ccf2b5e03b1adc 100644
--- a/packages/office-ui-fabric-react/src/components/Button/BaseButton.tsx
+++ b/packages/office-ui-fabric-react/src/components/Button/BaseButton.tsx
@@ -313,7 +313,7 @@ export class BaseButton extends BaseComponent): JSX.Element | null => {
const { iconProps } = this.props;
- if (iconProps) {
+ if (iconProps && (iconProps.iconName || iconProps.imageProps)) {
const { className, ...rest } = iconProps;
return ;
diff --git a/packages/office-ui-fabric-react/src/components/Checkbox/Checkbox.styles.ts b/packages/office-ui-fabric-react/src/components/Checkbox/Checkbox.styles.ts
index 5bd72f79f0e97a..2624537175df97 100644
--- a/packages/office-ui-fabric-react/src/components/Checkbox/Checkbox.styles.ts
+++ b/packages/office-ui-fabric-react/src/components/Checkbox/Checkbox.styles.ts
@@ -44,7 +44,7 @@ export const getStyles = (props: ICheckboxStyleProps): ICheckboxStyles => {
opacity: 0,
selectors: {
- [`.${IsFocusVisibleClassName} &:focus + label::before`]: {
+ [`.${IsFocusVisibleClassName} &:focus + label`]: {
outline: '1px solid ' + theme.palette.neutralSecondary,
outlineOffset: '2px',
selectors: {
diff --git a/packages/office-ui-fabric-react/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap b/packages/office-ui-fabric-react/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap
index fdc918a8544f34..216711fc9defa5 100644
--- a/packages/office-ui-fabric-react/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap
+++ b/packages/office-ui-fabric-react/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap
@@ -18,11 +18,11 @@ exports[`Checkbox renders Checkbox correctly 1`] = `
opacity: 0;
position: absolute;
}
- .ms-Fabric--isFocusVisible &:focus + label::before {
+ .ms-Fabric--isFocusVisible &:focus + label {
outline-offset: 2px;
outline: 1px solid #666666;
}
- @media screen and (-ms-high-contrast: active){.ms-Fabric--isFocusVisible &:focus + label::before {
+ @media screen and (-ms-high-contrast: active){.ms-Fabric--isFocusVisible &:focus + label {
outline: 1px solid ActiveBorder;
}
id="checkbox-0"
diff --git a/packages/office-ui-fabric-react/src/components/DetailsList/ShimmeredDetailsList.types.ts b/packages/office-ui-fabric-react/src/components/DetailsList/ShimmeredDetailsList.types.ts
index 351aecff7b599e..100c21953dd496 100644
--- a/packages/office-ui-fabric-react/src/components/DetailsList/ShimmeredDetailsList.types.ts
+++ b/packages/office-ui-fabric-react/src/components/DetailsList/ShimmeredDetailsList.types.ts
@@ -5,7 +5,7 @@ import { IStyleFunctionOrObject } from '../../Utilities';
/**
* ShimmeredDetailsList props interface
- * {@docCategory ShimmeredDetailsList}
+ * {@docCategory DetailsList}
*/
export interface IShimmeredDetailsListProps extends IDetailsListProps {
/**
@@ -50,7 +50,7 @@ export interface IShimmeredDetailsListProps extends IDetailsListProps {
/**
* Defines props needed to construct styles. This represents the simplified set of immutable things which control the class names.
- * @internal
+ * {@docCategory DetailsList}
*/
export type IShimmeredDetailsListStyleProps = Required> & {
/**
@@ -68,7 +68,7 @@ export type IShimmeredDetailsListStyleProps = Required d.customName + ' label';
+
+describe('SuggestionsStore', () => {
+ describe('when getting the aria-label', () => {
+ it('uses getAriaLabel for item text when it is set', () => {
+ const store = new SuggestionsStore({
+ getAriaLabel: getCustomName
+ });
+ store.updateSuggestions([
+ {
+ customName: 'me'
+ }
+ ]);
+
+ expect(store.getSuggestionAtIndex(0)).toEqual({
+ item: {
+ customName: 'me'
+ },
+ selected: false,
+ ariaLabel: 'me label'
+ });
+ });
+
+ it('prioritizes getAriaLabel over name', () => {
+ const store = new SuggestionsStore({
+ getAriaLabel: getCustomName
+ });
+ store.updateSuggestions([
+ {
+ customName: 'u',
+ name: 'name'
+ }
+ ]);
+
+ expect(store.getSuggestionAtIndex(0)).toEqual({
+ item: {
+ customName: 'u',
+ name: 'name'
+ },
+ selected: false,
+ ariaLabel: 'u label'
+ });
+ });
+
+ it('prioritizes getAriaLabel over primaryText', () => {
+ const store = new SuggestionsStore({
+ getAriaLabel: getCustomName
+ });
+ store.updateSuggestions([
+ {
+ customName: 'us',
+ primaryText: 'primaryText'
+ }
+ ]);
+
+ expect(store.getSuggestionAtIndex(0)).toEqual({
+ item: {
+ customName: 'us',
+ primaryText: 'primaryText'
+ },
+ selected: false,
+ ariaLabel: 'us label'
+ });
+ });
+
+ it('prioritizes name over primaryText if getAriaLabel is unset', () => {
+ const store = new SuggestionsStore();
+ store.updateSuggestions([
+ {
+ customName: 'us',
+ primaryText: 'primaryText',
+ name: 'name'
+ }
+ ]);
+
+ expect(store.getSuggestionAtIndex(0)).toEqual({
+ item: {
+ customName: 'us',
+ primaryText: 'primaryText',
+ name: 'name'
+ },
+ selected: false,
+ ariaLabel: 'name'
+ });
+ });
+ });
+});
diff --git a/packages/office-ui-fabric-react/src/components/FloatingPicker/Suggestions/SuggestionsStore.ts b/packages/office-ui-fabric-react/src/components/FloatingPicker/Suggestions/SuggestionsStore.ts
index b1f6e5b7089d89..a145f5dcdb117c 100644
--- a/packages/office-ui-fabric-react/src/components/FloatingPicker/Suggestions/SuggestionsStore.ts
+++ b/packages/office-ui-fabric-react/src/components/FloatingPicker/Suggestions/SuggestionsStore.ts
@@ -1,11 +1,17 @@
-import { autobind } from '../../../Utilities';
-import { ISuggestionModel } from '../../../Pickers';
+import { ISuggestionModel, ITag } from '../../../Pickers';
+import { IPersonaProps } from '../../../Persona';
+
+export type SuggestionsStoreOptions = {
+ getAriaLabel?: (item: T) => string;
+};
export class SuggestionsStore {
public suggestions: ISuggestionModel[];
+ private getAriaLabel?: (item: T) => string;
- constructor() {
+ constructor(options?: SuggestionsStoreOptions) {
this.suggestions = [];
+ this.getAriaLabel = options && options.getAriaLabel;
}
public updateSuggestions(newSuggestions: T[]): void {
@@ -32,22 +38,23 @@ export class SuggestionsStore {
return Array.isArray(suggestions) ? suggestions.map(this._ensureSuggestionModel) : [];
}
- @autobind
- private _isSuggestionModel(value: ISuggestionModel | T): value is ISuggestionModel {
+ private _isSuggestionModel = (value: ISuggestionModel | T): value is ISuggestionModel => {
return (>value).item !== undefined;
- }
+ };
- @autobind
- private _ensureSuggestionModel(suggestion: ISuggestionModel | T): ISuggestionModel {
+ private _ensureSuggestionModel = (suggestion: ISuggestionModel | T): ISuggestionModel => {
if (this._isSuggestionModel(suggestion)) {
- return suggestion as ISuggestionModel;
+ return suggestion;
} else {
return {
item: suggestion,
selected: false,
- // tslint:disable-next-line:no-any
- ariaLabel: (suggestion).name || (suggestion).primaryText
- } as ISuggestionModel;
+ ariaLabel:
+ this.getAriaLabel !== undefined
+ ? this.getAriaLabel(suggestion)
+ : // tslint:disable-next-line:no-any
+ ((suggestion as any) as ITag).name || (suggestion).primaryText
+ };
}
- }
+ };
}
diff --git a/packages/office-ui-fabric-react/src/components/Nav/Nav.base.tsx b/packages/office-ui-fabric-react/src/components/Nav/Nav.base.tsx
index ed52d96a19643c..4f7ebe8e910952 100644
--- a/packages/office-ui-fabric-react/src/components/Nav/Nav.base.tsx
+++ b/packages/office-ui-fabric-react/src/components/Nav/Nav.base.tsx
@@ -23,7 +23,7 @@ export function isRelativeUrl(url: string): boolean {
const getClassNames = classNamesFunction();
export interface INavState {
- isGroupCollapsed?: { [key: string]: boolean };
+ isGroupCollapsed: { [key: string]: boolean };
isLinkExpandStateChanged?: boolean;
selectedKey?: string;
}
@@ -41,36 +41,6 @@ export class NavBase extends React.Component implements IN
isLinkExpandStateChanged: false,
selectedKey: props.initialSelectedKey || props.selectedKey
};
-
- if (props.groups) {
- for (const group of props.groups) {
- if (group.collapseByDefault && group.name) {
- this.state.isGroupCollapsed![group.name] = true;
- }
- }
- }
- }
-
- public componentWillReceiveProps(newProps: INavProps): void {
- const newGroups = newProps.groups || [];
- const isGroupCollapsed = this.state.isGroupCollapsed!;
-
- // If the component's props were updated, new groups may have been added, which may have
- // collapseByDefault set. Ensure that setting is respected for any new groups.
- // (If isGroupCollapsed is already set for a group, don't overwrite that.)
- let hasUpdated = false;
- for (const newGroup of newGroups) {
- if (newGroup.name && newGroup.collapseByDefault && !isGroupCollapsed.hasOwnProperty(newGroup.name)) {
- isGroupCollapsed[newGroup.name] = true;
- hasUpdated = true;
- }
- }
-
- if (hasUpdated) {
- this.setState({
- isGroupCollapsed: isGroupCollapsed
- });
- }
}
public render(): JSX.Element | null {
@@ -105,13 +75,13 @@ export class NavBase extends React.Component implements IN
private _renderNavLink(link: INavLink, linkIndex: number, nestingLevel: number): JSX.Element {
const { styles, groups, theme, onRenderLink = this._onRenderLink, linkAs: LinkAs = ActionButton } = this.props;
-
+ const isLinkWithIcon = link.icon || link.iconProps;
const classNames = getClassNames(styles!, {
theme: theme!,
isSelected: this._isLinkSelected(link),
isDisabled: link.disabled,
isButtonEntry: link.onClick && !link.forceAnchor,
- leftPadding: _indentationSize * nestingLevel + _baseIndent,
+ leftPadding: _indentationSize * nestingLevel + _baseIndent + (isLinkWithIcon ? 0 : 24),
groups
});
@@ -123,7 +93,7 @@ export class NavBase extends React.Component implements IN
className={classNames.link}
styles={buttonStyles}
href={link.url || (link.forceAnchor ? 'javascript:' : undefined)}
- iconProps={link.iconProps || { iconName: link.icon || '' }}
+ iconProps={link.iconProps || { iconName: link.icon }}
onClick={link.onClick ? this._onNavButtonLinkClicked.bind(this, link) : this._onNavAnchorLinkClicked.bind(this, link)}
title={link.title || link.name}
target={link.target}
@@ -201,7 +171,7 @@ export class NavBase extends React.Component implements IN
const classNames = getClassNames(styles!, {
theme: theme!,
isGroup: true,
- isExpanded: !this.state.isGroupCollapsed![group.name!],
+ isExpanded: this._isGroupExpanded(group),
groups
});
@@ -218,7 +188,7 @@ export class NavBase extends React.Component implements IN
const classNames = getClassNames(styles!, {
theme: theme!,
isGroup: true,
- isExpanded: !this.state.isGroupCollapsed![group.name!],
+ isExpanded: this._isGroupExpanded(group),
groups
});
@@ -227,7 +197,7 @@ export class NavBase extends React.Component implements IN
className={classNames.chevronButton}
onClick={this._onGroupHeaderClicked.bind(this, group)}
aria-label={expandButtonAriaLabel}
- aria-expanded={!this.state.isGroupCollapsed![group.name!]}
+ aria-expanded={this._isGroupExpanded(group)}
>
{group.name}
@@ -236,16 +206,11 @@ export class NavBase extends React.Component implements IN
};
private _onGroupHeaderClicked(group: INavLinkGroup, ev: React.MouseEvent): void {
- const { isGroupCollapsed } = this.state;
- const groupKey = group.name!;
- const isCollapsed = !isGroupCollapsed![groupKey];
-
if (group.onHeaderClick) {
- group.onHeaderClick(ev, isCollapsed);
+ group.onHeaderClick(ev, this._isGroupExpanded(group));
}
- isGroupCollapsed![groupKey] = isCollapsed;
- this.setState({ isGroupCollapsed: isGroupCollapsed });
+ this._toggleCollapsed(group);
ev.preventDefault();
ev.stopPropagation();
@@ -331,4 +296,24 @@ export class NavBase extends React.Component implements IN
return false;
}
+
+ private _isGroupExpanded(group: INavLinkGroup): boolean {
+ if (group.name && this.state.isGroupCollapsed.hasOwnProperty(group.name)) {
+ return !this.state.isGroupCollapsed[group.name];
+ }
+ if (group.collapseByDefault !== undefined) {
+ return !group.collapseByDefault;
+ }
+ return true;
+ }
+
+ private _toggleCollapsed(group: INavLinkGroup): void {
+ if (group.name) {
+ const newGroupCollapsed = {
+ ...this.state.isGroupCollapsed, // Make a copy in order to not modify state
+ [group.name]: this._isGroupExpanded(group) // sic - presently open will be collapsed after setState
+ };
+ this.setState({ isGroupCollapsed: newGroupCollapsed });
+ }
+ }
}
diff --git a/packages/office-ui-fabric-react/src/components/Nav/__snapshots__/Nav.test.tsx.snap b/packages/office-ui-fabric-react/src/components/Nav/__snapshots__/Nav.test.tsx.snap
index 186a2ffddc1489..e2c1c619bc32fc 100644
--- a/packages/office-ui-fabric-react/src/components/Nav/__snapshots__/Nav.test.tsx.snap
+++ b/packages/office-ui-fabric-react/src/components/Nav/__snapshots__/Nav.test.tsx.snap
@@ -104,7 +104,7 @@ exports[`Nav renders Nav correctly 1`] = `
outline: transparent;
overflow: hidden;
padding-bottom: 0;
- padding-left: 3px;
+ padding-left: 27px;
padding-right: 20px;
padding-top: 0;
position: relative;
@@ -184,28 +184,6 @@ exports[`Nav renders Nav correctly 1`] = `
justify-content: flex-start;
}
>
-
implement
className={this._classNames.closeButton}
onClick={this._onPanelClick}
ariaLabel={closeButtonAriaLabel}
+ title={closeButtonAriaLabel}
data-is-visible={true}
iconProps={{ iconName: 'Cancel' }}
/>
diff --git a/packages/office-ui-fabric-react/src/components/TextField/TextField.base.tsx b/packages/office-ui-fabric-react/src/components/TextField/TextField.base.tsx
index f2ce4e62a57293..9a1bcc2bff3c3f 100644
--- a/packages/office-ui-fabric-react/src/components/TextField/TextField.base.tsx
+++ b/packages/office-ui-fabric-react/src/components/TextField/TextField.base.tsx
@@ -32,7 +32,7 @@ export interface ITextFieldState {
* - If there is no validation error or we have not validated the input value, errorMessage is an empty string.
* - If we have done the validation and there is validation error, errorMessage is the validation error message.
*/
- errorMessage: string;
+ errorMessage: string | JSX.Element;
}
const DEFAULT_STATE_VALUE = '';
@@ -418,7 +418,7 @@ export class TextFieldBase extends React.Component{suffix};
}
- private get _errorMessage(): string | undefined {
+ private get _errorMessage(): string | JSX.Element | undefined {
let { errorMessage } = this.state;
if (!errorMessage && this.props.errorMessage) {
errorMessage = this.props.errorMessage;
@@ -524,13 +524,13 @@ export class TextFieldBase extends React.Component {
+ result.then((errorMessage: string | JSX.Element) => {
if (this._isMounted && currentValidation === this._lastValidation) {
this.setState({ errorMessage } as ITextFieldState);
}
@@ -542,7 +542,7 @@ export class TextFieldBase extends React.Component {
describe('error message', () => {
const errorMessage = 'The string is too long, should not exceed 3 characters.';
+ const errorMessageJSX = (
+
+ The string is too long,
+
+ should not exceed 3 characters.
+
+ );
- function assertErrorMessage(renderedDOM: Element, expectedErrorMessage: string | boolean): void {
+ function assertErrorMessage(renderedDOM: Element, expectedErrorMessage: string | JSX.Element | boolean): void {
const errorMessageDOM = renderedDOM.querySelector('[data-automation-id=error-message]');
if (expectedErrorMessage === false) {
expect(errorMessageDOM).toBeNull(); // element not exists
- } else {
+ } else if (typeof expectedErrorMessage === 'string') {
expect(errorMessageDOM!.textContent).toEqual(expectedErrorMessage);
+ } else if (typeof expectedErrorMessage !== 'boolean') {
+ const xhtml = errorMessageDOM!.innerHTML.replace(/ /g, ' ');
+ expect(xhtml).toEqual(renderToStaticMarkup(expectedErrorMessage));
}
}
@@ -233,6 +244,22 @@ describe('TextField', () => {
return delay(20).then(() => assertErrorMessage(textField.getDOMNode(), errorMessage));
});
+ it('should render error message when onGetErrorMessage returns a JSX.Element', () => {
+ function validator(value: string): string | JSX.Element {
+ return value.length > 3 ? errorMessageJSX : '';
+ }
+
+ const textField = mount(
+
+ );
+
+ const inputDOM = textField.getDOMNode().querySelector('input');
+ ReactTestUtils.Simulate.change(inputDOM as Element, mockEvent('the input value'));
+
+ // The value is delayed to validate, so it must to query error message after a while.
+ return delay(20).then(() => assertErrorMessage(textField.getDOMNode(), errorMessageJSX));
+ });
+
it('should render error message when onGetErrorMessage returns a Promise', () => {
function validator(value: string): Promise {
return Promise.resolve(value.length > 3 ? errorMessage : '');
@@ -249,6 +276,22 @@ describe('TextField', () => {
return delay(20).then(() => assertErrorMessage(textField.getDOMNode(), errorMessage));
});
+ it('should render error message when onGetErrorMessage returns a Promise', () => {
+ function validator(value: string): Promise {
+ return Promise.resolve(value.length > 3 ? errorMessageJSX : '');
+ }
+
+ const textField = mount(
+
+ );
+
+ const inputDOM = textField.getDOMNode().querySelector('input');
+ ReactTestUtils.Simulate.change(inputDOM as Element, mockEvent('the input value'));
+
+ // The value is delayed to validate, so it must to query error message after a while.
+ return delay(20).then(() => assertErrorMessage(textField.getDOMNode(), errorMessageJSX));
+ });
+
it('should render error message on first render when onGetErrorMessage returns a string', () => {
const textField = mount(
void;
+ onNotifyValidationResult?: (errorMessage: string | JSX.Element, value: string | undefined) => void;
/**
* Function used to determine whether the input value is valid and get an error message if not.
* Mutually exclusive with the static string `errorMessage` (it will take precedence over this).
*
- * When it returns string:
+ * When it returns string | JSX.Element:
* - If valid, it returns empty string.
- * - If invalid, it returns the error message string and the text field will
+ * - If invalid, it returns the error message and the text field will
* show a red border and show an error message below the text field.
*
- * When it returns Promise:
+ * When it returns Promise\:
* - The resolved value is displayed as the error message.
* - If rejected, the value is thrown away.
*/
- onGetErrorMessage?: (value: string) => string | PromiseLike | undefined;
+ onGetErrorMessage?: (value: string) => string | JSX.Element | PromiseLike | undefined;
/**
* Text field will start to validate after users stop typing for `deferredValidationTime` milliseconds.
diff --git a/packages/office-ui-fabric-react/src/components/__snapshots__/Callout.Directional.Example.tsx.shot b/packages/office-ui-fabric-react/src/components/__snapshots__/Callout.Directional.Example.tsx.shot
index 7b71b9f2d2df38..605c1f179d5596 100644
--- a/packages/office-ui-fabric-react/src/components/__snapshots__/Callout.Directional.Example.tsx.shot
+++ b/packages/office-ui-fabric-react/src/components/__snapshots__/Callout.Directional.Example.tsx.shot
@@ -26,11 +26,11 @@ exports[`Component Examples renders Callout.Directional.Example.tsx correctly 1`
opacity: 0;
position: absolute;
}
- .ms-Fabric--isFocusVisible &:focus + label::before {
+ .ms-Fabric--isFocusVisible &:focus + label {
outline-offset: 2px;
outline: 1px solid #666666;
}
- @media screen and (-ms-high-contrast: active){.ms-Fabric--isFocusVisible &:focus + label::before {
+ @media screen and (-ms-high-contrast: active){.ms-Fabric--isFocusVisible &:focus + label {
outline: 1px solid ActiveBorder;
}
id="checkbox-0"
diff --git a/packages/office-ui-fabric-react/src/components/__snapshots__/Checkbox.Basic.Example.tsx.shot b/packages/office-ui-fabric-react/src/components/__snapshots__/Checkbox.Basic.Example.tsx.shot
index 8444b3766d7e68..47d88056d64de8 100644
--- a/packages/office-ui-fabric-react/src/components/__snapshots__/Checkbox.Basic.Example.tsx.shot
+++ b/packages/office-ui-fabric-react/src/components/__snapshots__/Checkbox.Basic.Example.tsx.shot
@@ -19,11 +19,11 @@ exports[`Component Examples renders Checkbox.Basic.Example.tsx correctly 1`] = `
opacity: 0;
position: absolute;
}
- .ms-Fabric--isFocusVisible &:focus + label::before {
+ .ms-Fabric--isFocusVisible &:focus + label {
outline-offset: 2px;
outline: 1px solid #666666;
}
- @media screen and (-ms-high-contrast: active){.ms-Fabric--isFocusVisible &:focus + label::before {
+ @media screen and (-ms-high-contrast: active){.ms-Fabric--isFocusVisible &:focus + label {
outline: 1px solid ActiveBorder;
}
id="checkbox-0"
diff --git a/packages/office-ui-fabric-react/src/components/__snapshots__/Checkbox.Other.Example.tsx.shot b/packages/office-ui-fabric-react/src/components/__snapshots__/Checkbox.Other.Example.tsx.shot
index 569f7c40c25a78..40e1002232dcdb 100644
--- a/packages/office-ui-fabric-react/src/components/__snapshots__/Checkbox.Other.Example.tsx.shot
+++ b/packages/office-ui-fabric-react/src/components/__snapshots__/Checkbox.Other.Example.tsx.shot
@@ -20,11 +20,11 @@ exports[`Component Examples renders Checkbox.Other.Example.tsx correctly 1`] = `
opacity: 0;
position: absolute;
}
- .ms-Fabric--isFocusVisible &:focus + label::before {
+ .ms-Fabric--isFocusVisible &:focus + label {
outline-offset: 2px;
outline: 1px solid #666666;
}
- @media screen and (-ms-high-contrast: active){.ms-Fabric--isFocusVisible &:focus + label::before {
+ @media screen and (-ms-high-contrast: active){.ms-Fabric--isFocusVisible &:focus + label {
outline: 1px solid ActiveBorder;
}
id="checkbox-0"
@@ -151,11 +151,11 @@ exports[`Component Examples renders Checkbox.Other.Example.tsx correctly 1`] = `
opacity: 0;
position: absolute;
}
- .ms-Fabric--isFocusVisible &:focus + label::before {
+ .ms-Fabric--isFocusVisible &:focus + label {
outline-offset: 2px;
outline: 1px solid #666666;
}
- @media screen and (-ms-high-contrast: active){.ms-Fabric--isFocusVisible &:focus + label::before {
+ @media screen and (-ms-high-contrast: active){.ms-Fabric--isFocusVisible &:focus + label {
outline: 1px solid ActiveBorder;
}
defaultChecked={true}
@@ -296,11 +296,11 @@ exports[`Component Examples renders Checkbox.Other.Example.tsx correctly 1`] = `
opacity: 0;
position: absolute;
}
- .ms-Fabric--isFocusVisible &:focus + label::before {
+ .ms-Fabric--isFocusVisible &:focus + label {
outline-offset: 2px;
outline: 1px solid #666666;
}
- @media screen and (-ms-high-contrast: active){.ms-Fabric--isFocusVisible &:focus + label::before {
+ @media screen and (-ms-high-contrast: active){.ms-Fabric--isFocusVisible &:focus + label {
outline: 1px solid ActiveBorder;
}
disabled={true}
@@ -413,11 +413,11 @@ exports[`Component Examples renders Checkbox.Other.Example.tsx correctly 1`] = `
opacity: 0;
position: absolute;
}
- .ms-Fabric--isFocusVisible &:focus + label::before {
+ .ms-Fabric--isFocusVisible &:focus + label {
outline-offset: 2px;
outline: 1px solid #666666;
}
- @media screen and (-ms-high-contrast: active){.ms-Fabric--isFocusVisible &:focus + label::before {
+ @media screen and (-ms-high-contrast: active){.ms-Fabric--isFocusVisible &:focus + label {
outline: 1px solid ActiveBorder;
}
defaultChecked={true}
@@ -531,11 +531,11 @@ exports[`Component Examples renders Checkbox.Other.Example.tsx correctly 1`] = `
opacity: 0;
position: absolute;
}
- .ms-Fabric--isFocusVisible &:focus + label::before {
+ .ms-Fabric--isFocusVisible &:focus + label {
outline-offset: 2px;
outline: 1px solid #666666;
}
- @media screen and (-ms-high-contrast: active){.ms-Fabric--isFocusVisible &:focus + label::before {
+ @media screen and (-ms-high-contrast: active){.ms-Fabric--isFocusVisible &:focus + label {
outline: 1px solid ActiveBorder;
}
id="checkbox-4"
@@ -662,11 +662,11 @@ exports[`Component Examples renders Checkbox.Other.Example.tsx correctly 1`] = `
opacity: 0;
position: absolute;
}
- .ms-Fabric--isFocusVisible &:focus + label::before {
+ .ms-Fabric--isFocusVisible &:focus + label {
outline-offset: 2px;
outline: 1px solid #666666;
}
- @media screen and (-ms-high-contrast: active){.ms-Fabric--isFocusVisible &:focus + label::before {
+ @media screen and (-ms-high-contrast: active){.ms-Fabric--isFocusVisible &:focus + label {
outline: 1px solid ActiveBorder;
}
id="checkbox-5"
@@ -794,11 +794,11 @@ exports[`Component Examples renders Checkbox.Other.Example.tsx correctly 1`] = `
opacity: 0;
position: absolute;
}
- .ms-Fabric--isFocusVisible &:focus + label::before {
+ .ms-Fabric--isFocusVisible &:focus + label {
outline-offset: 2px;
outline: 1px solid #666666;
}
- @media screen and (-ms-high-contrast: active){.ms-Fabric--isFocusVisible &:focus + label::before {
+ @media screen and (-ms-high-contrast: active){.ms-Fabric--isFocusVisible &:focus + label {
outline: 1px solid ActiveBorder;
}
id="checkbox-6"
diff --git a/packages/office-ui-fabric-react/src/components/__snapshots__/ContextualMenu.Directional.Example.tsx.shot b/packages/office-ui-fabric-react/src/components/__snapshots__/ContextualMenu.Directional.Example.tsx.shot
index 741e6c12d2617c..917197d0163e19 100644
--- a/packages/office-ui-fabric-react/src/components/__snapshots__/ContextualMenu.Directional.Example.tsx.shot
+++ b/packages/office-ui-fabric-react/src/components/__snapshots__/ContextualMenu.Directional.Example.tsx.shot
@@ -25,11 +25,11 @@ exports[`Component Examples renders ContextualMenu.Directional.Example.tsx corre
opacity: 0;
position: absolute;
}
- .ms-Fabric--isFocusVisible &:focus + label::before {
+ .ms-Fabric--isFocusVisible &:focus + label {
outline-offset: 2px;
outline: 1px solid #666666;
}
- @media screen and (-ms-high-contrast: active){.ms-Fabric--isFocusVisible &:focus + label::before {
+ @media screen and (-ms-high-contrast: active){.ms-Fabric--isFocusVisible &:focus + label {
outline: 1px solid ActiveBorder;
}
id="checkbox-0"
diff --git a/packages/office-ui-fabric-react/src/components/__snapshots__/Dialog.Basic.Example.tsx.shot b/packages/office-ui-fabric-react/src/components/__snapshots__/Dialog.Basic.Example.tsx.shot
index 44a9236d573e0c..062a64fc1b5ca8 100644
--- a/packages/office-ui-fabric-react/src/components/__snapshots__/Dialog.Basic.Example.tsx.shot
+++ b/packages/office-ui-fabric-react/src/components/__snapshots__/Dialog.Basic.Example.tsx.shot
@@ -20,11 +20,11 @@ exports[`Component Examples renders Dialog.Basic.Example.tsx correctly 1`] = `
opacity: 0;
position: absolute;
}
- .ms-Fabric--isFocusVisible &:focus + label::before {
+ .ms-Fabric--isFocusVisible &:focus + label {
outline-offset: 2px;
outline: 1px solid #666666;
}
- @media screen and (-ms-high-contrast: active){.ms-Fabric--isFocusVisible &:focus + label::before {
+ @media screen and (-ms-high-contrast: active){.ms-Fabric--isFocusVisible &:focus + label {
outline: 1px solid ActiveBorder;
}
id="checkbox-2"
diff --git a/packages/office-ui-fabric-react/src/components/__snapshots__/Dialog.Modeless.Example.tsx.shot b/packages/office-ui-fabric-react/src/components/__snapshots__/Dialog.Modeless.Example.tsx.shot
index 235aa10ed393d0..b9f9fd6e366c17 100644
--- a/packages/office-ui-fabric-react/src/components/__snapshots__/Dialog.Modeless.Example.tsx.shot
+++ b/packages/office-ui-fabric-react/src/components/__snapshots__/Dialog.Modeless.Example.tsx.shot
@@ -26,11 +26,11 @@ exports[`Component Examples renders Dialog.Modeless.Example.tsx correctly 1`] =
opacity: 0;
position: absolute;
}
- .ms-Fabric--isFocusVisible &:focus + label::before {
+ .ms-Fabric--isFocusVisible &:focus + label {
outline-offset: 2px;
outline: 1px solid #666666;
}
- @media screen and (-ms-high-contrast: active){.ms-Fabric--isFocusVisible &:focus + label::before {
+ @media screen and (-ms-high-contrast: active){.ms-Fabric--isFocusVisible &:focus + label {
outline: 1px solid ActiveBorder;
}
disabled={false}
diff --git a/packages/office-ui-fabric-react/src/components/__snapshots__/Facepile.Basic.Example.tsx.shot b/packages/office-ui-fabric-react/src/components/__snapshots__/Facepile.Basic.Example.tsx.shot
index 652f900dd306a3..c4e955a9d998be 100644
--- a/packages/office-ui-fabric-react/src/components/__snapshots__/Facepile.Basic.Example.tsx.shot
+++ b/packages/office-ui-fabric-react/src/components/__snapshots__/Facepile.Basic.Example.tsx.shot
@@ -943,11 +943,11 @@ exports[`Component Examples renders Facepile.Basic.Example.tsx correctly 1`] = `
opacity: 0;
position: absolute;
}
- .ms-Fabric--isFocusVisible &:focus + label::before {
+ .ms-Fabric--isFocusVisible &:focus + label {
outline-offset: 2px;
outline: 1px solid #666666;
}
- @media screen and (-ms-high-contrast: active){.ms-Fabric--isFocusVisible &:focus + label::before {
+ @media screen and (-ms-high-contrast: active){.ms-Fabric--isFocusVisible &:focus + label {
outline: 1px solid ActiveBorder;
}
id="checkbox-6"
diff --git a/packages/office-ui-fabric-react/src/components/__snapshots__/MarqueeSelection.Basic.Example.tsx.shot b/packages/office-ui-fabric-react/src/components/__snapshots__/MarqueeSelection.Basic.Example.tsx.shot
index f5c5e4f5e70d29..2e9cabc8dd53d8 100644
--- a/packages/office-ui-fabric-react/src/components/__snapshots__/MarqueeSelection.Basic.Example.tsx.shot
+++ b/packages/office-ui-fabric-react/src/components/__snapshots__/MarqueeSelection.Basic.Example.tsx.shot
@@ -27,11 +27,11 @@ exports[`Component Examples renders MarqueeSelection.Basic.Example.tsx correctly
opacity: 0;
position: absolute;
}
- .ms-Fabric--isFocusVisible &:focus + label::before {
+ .ms-Fabric--isFocusVisible &:focus + label {
outline-offset: 2px;
outline: 1px solid #666666;
}
- @media screen and (-ms-high-contrast: active){.ms-Fabric--isFocusVisible &:focus + label::before {
+ @media screen and (-ms-high-contrast: active){.ms-Fabric--isFocusVisible &:focus + label {
outline: 1px solid ActiveBorder;
}
defaultChecked={true}
diff --git a/packages/office-ui-fabric-react/src/components/__snapshots__/Modal.Basic.Example.tsx.shot b/packages/office-ui-fabric-react/src/components/__snapshots__/Modal.Basic.Example.tsx.shot
index 642a88d1eb6137..ef52e704a402dc 100644
--- a/packages/office-ui-fabric-react/src/components/__snapshots__/Modal.Basic.Example.tsx.shot
+++ b/packages/office-ui-fabric-react/src/components/__snapshots__/Modal.Basic.Example.tsx.shot
@@ -20,11 +20,11 @@ exports[`Component Examples renders Modal.Basic.Example.tsx correctly 1`] = `
opacity: 0;
position: absolute;
}
- .ms-Fabric--isFocusVisible &:focus + label::before {
+ .ms-Fabric--isFocusVisible &:focus + label {
outline-offset: 2px;
outline: 1px solid #666666;
}
- @media screen and (-ms-high-contrast: active){.ms-Fabric--isFocusVisible &:focus + label::before {
+ @media screen and (-ms-high-contrast: active){.ms-Fabric--isFocusVisible &:focus + label {
outline: 1px solid ActiveBorder;
}
id="checkbox-2"
diff --git a/packages/office-ui-fabric-react/src/components/__snapshots__/Modal.Modeless.Example.tsx.shot b/packages/office-ui-fabric-react/src/components/__snapshots__/Modal.Modeless.Example.tsx.shot
index 335fb4107dbab2..7ca881016b619f 100644
--- a/packages/office-ui-fabric-react/src/components/__snapshots__/Modal.Modeless.Example.tsx.shot
+++ b/packages/office-ui-fabric-react/src/components/__snapshots__/Modal.Modeless.Example.tsx.shot
@@ -21,11 +21,11 @@ exports[`Component Examples renders Modal.Modeless.Example.tsx correctly 1`] = `
opacity: 0;
position: absolute;
}
- .ms-Fabric--isFocusVisible &:focus + label::before {
+ .ms-Fabric--isFocusVisible &:focus + label {
outline-offset: 2px;
outline: 1px solid #666666;
}
- @media screen and (-ms-high-contrast: active){.ms-Fabric--isFocusVisible &:focus + label::before {
+ @media screen and (-ms-high-contrast: active){.ms-Fabric--isFocusVisible &:focus + label {
outline: 1px solid ActiveBorder;
}
disabled={false}
diff --git a/packages/office-ui-fabric-react/src/components/__snapshots__/Nav.Basic.Example.tsx.shot b/packages/office-ui-fabric-react/src/components/__snapshots__/Nav.Basic.Example.tsx.shot
index f13b68bdbcdbb9..a5dc7c89f6c0ef 100644
--- a/packages/office-ui-fabric-react/src/components/__snapshots__/Nav.Basic.Example.tsx.shot
+++ b/packages/office-ui-fabric-react/src/components/__snapshots__/Nav.Basic.Example.tsx.shot
@@ -196,7 +196,7 @@ exports[`Component Examples renders Nav.Basic.Example.tsx correctly 1`] = `
outline: transparent;
overflow: hidden;
padding-bottom: 0;
- padding-left: 3px;
+ padding-left: 27px;
padding-right: 20px;
padding-top: 0;
position: relative;
@@ -276,28 +276,6 @@ exports[`Component Examples renders Nav.Basic.Example.tsx correctly 1`] = `
justify-content: flex-start;
}
>
-