Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit 8027a40

Browse files
authored
Merge branch 'master' into mituron/carousel-app-mode-fix
2 parents 3639ce7 + 2689e7a commit 8027a40

File tree

85 files changed

+1282
-595
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+1282
-595
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,6 @@ lerna add @fluentui/react-proptypes packages/react
229229
[11]: https://github.com/microsoft/fluent-ui-react/blob/master/src/themes/teams/components/Button/buttonStyles.ts
230230
[12]: https://github.com/microsoft/fluent-ui-react/blob/master/packages/react/src/utils/accessibility/Behaviors/Menu/MenuItemBehavior.ts
231231
[13]: https://github.com/microsoft/fluent-ui-react/blob/master/src/components/Menu/MenuItem.tsx
232-
[14]: https://lernajs.io/
232+
[14]: https://lerna.js.org
233233
[15]: https://yarnpkg.com/en/docs/workspaces
234234
[16]: https://github.com/lerna/lerna/tree/master/commands/add

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,19 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
2323
- `mode` property from `focusZone` configuration in accessibility behaviors is no longer supported - the focus zone will always be in embed mode @layershifter ([#2265](https://github.com/microsoft/fluent-ui-react/pull/2265))
2424
- `FocusZoneMode` and `FOCUSZONE_WRAP_ATTRIBUTE` are no longer exported @layershifter ([#2265](https://github.com/microsoft/fluent-ui-react/pull/2265))
2525
- Returned function from `useAccessibility` no longer keeps the same reference @layershifter ([#2268](https://github.com/microsoft/fluent-ui-react/pull/2268))
26-
- Changed `avatarBorderWidth` and `statusBorderWidth` avatar variables types from number to string and updated styles in Teams theme @mnajdova ([#2238](https://github.com/microsoft/fluent-ui-react/pull/2238))
26+
- Add logic for mounting/removing elements when they are shown/hidden using the `Animation` component; `Animation` component is not rendering element anymore, just applying classes to it's children @mnajdova ([#2115](https://github.com/microsoft/fluent-ui-react/pull/2115))
27+
- Restricted prop set in the `Button`, `Avatar`, `Box` and `Image` styles; changed `avatarBorderWidth` and `statusBorderWidth` avatar variables types from number to string and updated styles in Teams theme @mnajdova ([#2238](https://github.com/microsoft/fluent-ui-react/pull/2238))
28+
- Restricted prop set in the `List` & `ListItem` @layershifter ([#2238](https://github.com/microsoft/fluent-ui-react/pull/2238))
29+
- Remove `mountDocument` prop in `Popup` & `MenuButton` components @layershifter ([#2286](https://github.com/microsoft/fluent-ui-react/pull/2286))
2730

2831
### Fixes
2932
- Fix event listener leak in `FocusZone` @miroslavstastny ([#2227](https://github.com/microsoft/fluent-ui-react/pull/2227))
3033
- Fix styleParam to always be required in the styles functions @layershifter, @mnajdova ([#2235](https://github.com/microsoft/fluent-ui-react/pull/2235))
3134
- Check input and button refs exist before focus in `Dropdown` @silviuavram ([#2248](https://github.com/microsoft/fluent-ui-react/pull/2248))
35+
- Update iconOnly button hover, focus styles and add new `background5` and `backgroundHover2` design tokens in Teams theme @codepretty ([#2211](https://github.com/microsoft/fluent-ui-react/pull/2211))
3236
- Fix `forceUpdate` to get synced updates in React's Concurrent mode @layershifter ([#2268](https://github.com/microsoft/fluent-ui-react/pull/2268))
3337
- Fix element reference memory leaks @jurokapsiar ([#2270](https://github.com/microsoft/fluent-ui-react/pull/2270))
38+
- Adding actionable items into `Carousel` @kolaps33 ([#2271](https://github.com/microsoft/fluent-ui-react/pull/2271))
3439

3540
### Features
3641
- Allow `useRef` hook used for storing debugging data to be defined in any order with other hooks in functional components @layershifter, @mnajdova ([#2236](https://github.com/microsoft/fluent-ui-react/pull/2236))

build/config.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as path from 'path'
22
import * as _ from 'lodash'
3+
import * as webpack from 'webpack'
34

45
// ------------------------------------
56
// Environment vars
@@ -21,12 +22,14 @@ const envConfig = {
2122
// ----------------------------------
2223
path_base: path.resolve(__dirname, '..'),
2324
dir_build: 'build',
25+
dir_docs: 'docs',
2426
dir_docs_dist: 'docs/dist',
2527
dir_docs_src: 'docs/src',
2628
dir_e2e: 'e2e',
2729
dir_e2e_src: 'e2e/server',
2830
dir_e2e_dist: 'e2e/dist',
2931
dir_packages: 'packages',
32+
dir_perf: 'perf',
3033
dir_perf_dist: 'perf/dist',
3134
dir_perf_src: 'perf/src',
3235
dir_umd_dist: 'dist/umd',
@@ -41,6 +44,7 @@ const fromBase = (...paths: string[]) => (...subPaths: string[]) => base(...path
4144

4245
const tempPaths = {
4346
build: fromBase(envConfig.dir_build),
47+
docs: fromBase(envConfig.dir_docs),
4448
docsDist: fromBase(envConfig.dir_docs_dist),
4549
docsSrc: fromBase(envConfig.dir_docs_src),
4650
e2e: fromBase(envConfig.dir_e2e),
@@ -51,6 +55,7 @@ const tempPaths = {
5155
packageSrc: (packageName: string, ...paths: string[]) =>
5256
base(envConfig.dir_packages, packageName, 'src', ...paths),
5357
packages: fromBase(envConfig.dir_packages),
58+
perf: fromBase(envConfig.dir_perf),
5459
perfDist: fromBase(envConfig.dir_perf_dist),
5560
perfSrc: fromBase(envConfig.dir_perf_src),
5661
umdDist: fromBase(envConfig.dir_umd_dist),
@@ -91,8 +96,8 @@ const config = {
9196
// ----------------------------------
9297
// Compiler Configuration
9398
// ----------------------------------
94-
compiler_devtool: __DEV__ && 'eval-source-map',
95-
compiler_mode: __DEV__ ? 'development' : 'production',
99+
compiler_devtool: __DEV__ && ('eval-source-map' as webpack.Options.Devtool),
100+
compiler_mode: (__DEV__ ? 'development' : 'production') as webpack.Configuration['mode'],
96101
compiler_globals: {
97102
__DEV__,
98103
__PERF__,

build/dangerjs/detectNonApprovedDependencies/approvedPackages.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
export default [
22
'@babel/runtime@7.1.2',
33
'@babel/runtime@7.4.5',
4+
'@babel/runtime@7.7.6',
45
'classnames@2.2.6',
56
'compute-scroll-into-view@1.0.11',
67
'css-in-js-utils@2.0.1',
78
'css-in-js-utils@3.0.0',
9+
'dom-helpers@5.1.3',
810
'downshift@3.2.6',
911
'downshift@3.2.10',
1012
'downshift@3.2.14',
@@ -78,6 +80,7 @@ export default [
7880
'react-is@16.8.2',
7981
'react-is@16.9.0',
8082
'react-resize-detector@4.2.0',
83+
'react-transition-group@4.3.0',
8184
'react@16.8.3',
8285
'resize-observer-polyfill@1.5.1',
8386
'rtl-css-js@1.11.0',

build/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"@types/node": "^10.3.2",
2929
"@types/puppeteer": "^1.11.1",
3030
"@types/webpack-dev-middleware": "^2.0.1",
31+
"@types/webpack-env": "^1.14.1",
3132
"@types/webpack-hot-middleware": "^2.16.3",
3233
"@typescript-eslint/eslint-plugin": "^2.5.0",
3334
"@typescript-eslint/parser": "^2.5.0",

build/screener/screener.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
// @ts-check
2+
13
require('@fluentui/internal-tooling/babel/register')
24

35
const config = require('../config').default
4-
const { compilerOptions } = require('../tsconfig.docs.json')
6+
7+
const { compilerOptions } = require(config.paths.docs('tsconfig.json'))
58

69
require('tsconfig-paths').register({
710
baseUrl: config.path_base,

build/screener/screener.steps.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import fs from 'fs'
33
import Steps from 'screener-runner/src/steps'
44
import keys from 'screener-runner/src/keys'
55

6-
const DEFAULT_THEMES: ScreenerThemes = ['teams']
6+
const DEFAULT_THEMES: ScreenerThemeName[] = ['teams']
77

88
Steps.prototype.resetExternalLayout = function resetExternalLayout() {
99
return this.executeScript(`window.resetExternalLayout()`)

build/tsconfig.common.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
"@fluentui/*": ["packages/*/src"]
1313
},
1414
"types": ["node", "jest"],
15-
"typeRoots": ["../types", "../node_modules/@types"],
1615
"jsx": "react",
1716
"importHelpers": true,
1817
"isolatedModules": true,

build/tsconfig.docs.json

Lines changed: 0 additions & 13 deletions
This file was deleted.

build/tsconfig.e2e.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

build/tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"extends": "./tsconfig.common.json",
33
"compilerOptions": {
4-
"allowSyntheticDefaultImports": true
4+
"allowSyntheticDefaultImports": true,
5+
"typeRoots": ["../types", "../node_modules/@types"],
6+
"types": ["node", "webpack-env", "screener-runner"]
57
}
68
}

build/tsconfig.perf.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

build/tsconfig.test.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

build/webpack.config.e2e.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import CopyWebpackPlugin from 'copy-webpack-plugin'
22
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin'
33
import { webpack as lernaAliases } from 'lerna-alias'
4+
import webpack from 'webpack'
45

56
import config from './config'
67

78
const { paths } = config
89

9-
const webpackConfig: any = {
10+
const webpackConfig: webpack.Configuration = {
1011
name: 'client',
1112
target: 'web',
1213
mode: 'development',
@@ -18,7 +19,7 @@ const webpackConfig: any = {
1819
path: paths.e2eDist(),
1920
pathinfo: true,
2021
},
21-
devtool: config.compiler_devtool,
22+
devtool: config.compiler_devtool as webpack.Options.Devtool,
2223
node: {
2324
fs: 'empty',
2425
module: 'empty',
@@ -40,7 +41,7 @@ const webpackConfig: any = {
4041
],
4142
},
4243
plugins: [
43-
new ForkTsCheckerWebpackPlugin({ tsconfig: paths.build('tsconfig.e2e.json') }),
44+
new ForkTsCheckerWebpackPlugin({ tsconfig: paths.e2e('tsconfig.json') }),
4445
new CopyWebpackPlugin([
4546
{
4647
from: paths.e2eSrc('index.html'),

build/webpack.config.perf.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ import CopyWebpackPlugin from 'copy-webpack-plugin'
22
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin'
33
import { webpack as lernaAliases } from 'lerna-alias'
44
import { argv } from 'yargs'
5+
import webpack from 'webpack'
56

67
import config from './config'
78

89
const { paths } = config
910

10-
const webpackConfig: any = {
11+
const webpackConfig: webpack.Configuration = {
1112
name: 'client',
1213
target: 'web',
1314
mode: 'development',
@@ -20,7 +21,7 @@ const webpackConfig: any = {
2021
pathinfo: true,
2122
publicPath: config.compiler_public_path,
2223
},
23-
devtool: config.compiler_devtool,
24+
devtool: config.compiler_devtool as webpack.Options.Devtool,
2425
node: {
2526
fs: 'empty',
2627
module: 'empty',
@@ -42,7 +43,7 @@ const webpackConfig: any = {
4243
],
4344
},
4445
plugins: [
45-
new ForkTsCheckerWebpackPlugin({ tsconfig: paths.build('tsconfig.perf.json') }),
46+
new ForkTsCheckerWebpackPlugin({ tsconfig: paths.perf('tsconfig.json') }),
4647
new CopyWebpackPlugin([
4748
{
4849
from: paths.perfSrc('index.html'),

build/webpack.config.stats.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class IgnoreNotFoundExportPlugin {
2727
}
2828
}
2929

30-
const makeConfig = (srcPath, name) => ({
30+
const makeConfig = (srcPath: string, name: string): webpack.Configuration => ({
3131
mode: 'production',
3232
name: 'client',
3333
target: 'web',

build/webpack.config.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import config from './config'
1212
const { paths } = config
1313
const { __DEV__, __PROD__ } = config.compiler_globals
1414

15-
const webpackConfig: any = {
15+
const webpackConfig: webpack.Configuration = {
1616
name: 'client',
1717
target: 'web',
1818
mode: config.compiler_mode,
@@ -26,7 +26,7 @@ const webpackConfig: any = {
2626
pathinfo: true,
2727
publicPath: config.compiler_public_path,
2828
},
29-
devtool: config.compiler_devtool,
29+
devtool: config.compiler_devtool as webpack.Options.Devtool,
3030
externals: {
3131
'@babel/standalone': 'Babel',
3232
'anchor-js': 'AnchorJS',
@@ -68,7 +68,7 @@ const webpackConfig: any = {
6868
},
6969
plugins: [
7070
new ForkTsCheckerWebpackPlugin({
71-
tsconfig: paths.base('build/tsconfig.docs.json'),
71+
tsconfig: paths.docs('tsconfig.json'),
7272
watch: [paths.docsSrc(), paths.packages()],
7373
}),
7474
new webpack.DefinePlugin(config.compiler_globals),
@@ -112,7 +112,7 @@ const webpackConfig: any = {
112112
entries: true,
113113
modules: true,
114114
modulesCount: 500,
115-
}),
115+
} as any),
116116
].filter(Boolean),
117117
resolve: {
118118
extensions: ['.ts', '.tsx', '.js', '.json'],
@@ -141,7 +141,7 @@ const webpackConfig: any = {
141141
// Environment Configuration
142142
// ------------------------------------
143143
if (__DEV__) {
144-
const webpackHotPath = `${config.compiler_public_path}__webpack_hmr`
144+
const webpackHotPath = `${config.compiler_public_path}__compiler_hmr`
145145
const webpackHotMiddlewareEntry = `webpack-hot-middleware/client?${_.map(
146146
{
147147
path: webpackHotPath, // The path which the middleware is serving the event stream on
@@ -153,8 +153,9 @@ if (__DEV__) {
153153
},
154154
(val, key) => `&${key}=${val}`,
155155
).join('')}`
156+
const entry = webpackConfig.entry as webpack.Entry
157+
entry.app = [webpackHotMiddlewareEntry].concat((entry as webpack.Entry).app)
156158

157-
webpackConfig.entry.app = [webpackHotMiddlewareEntry].concat(webpackConfig.entry.app)
158159
webpackConfig.plugins.push(
159160
new webpack.HotModuleReplacementPlugin(),
160161
new webpack.NoEmitOnErrorsPlugin(),

build/webpack.config.umd.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
import webpack from 'webpack'
12
import config from './config'
23
import webpackConfig from './webpack.config'
34

45
const { paths } = config
56

6-
const webpackUMDConfig = (packageName: string) => {
7+
const webpackUMDConfig = (packageName: string): webpack.Configuration => {
78
const pkg = require(`../packages/${packageName}/package.json`)
89

910
return {

docs/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"@types/node": "^10.3.2",
2929
"@types/react-custom-scrollbars": "^4.0.5",
3030
"@types/react-router-dom": "^4.3.4",
31+
"@types/webpack-env": "^1.14.1",
3132
"gulp": "^4.0.2"
3233
},
3334
"publishConfig": {

docs/src/components/DocsLayout.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Provider, themes, pxToRem, createTheme } from '@fluentui/react'
2+
// @ts-ignore
23
import AnchorJS from 'anchor-js'
34
import * as PropTypes from 'prop-types'
45
import * as React from 'react'

docs/src/examples/components/Animation/Performance/AnimationMinimal.perf.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import { Animation } from '@fluentui/react'
22
import * as React from 'react'
33

4-
const AnimationMinimalPerf = () => <Animation />
4+
const AnimationMinimalPerf = () => (
5+
<Animation>
6+
<div />
7+
</Animation>
8+
)
59

610
AnimationMinimalPerf.iterations = 5000
711
AnimationMinimalPerf.filename = 'AnimationMinimal.perf.tsx'

docs/src/examples/components/Animation/Types/AnimationExampleDirection.tsx

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,26 @@ const AnimationExampleDirection = () => (
2121
<Text content="Reverse" />
2222
<Text content="Alternate" />
2323
<Text content="Alternate reverse" />
24-
<Animation name="spinner">
25-
<Icon name="mention" circular bordered />
26-
</Animation>
27-
<Animation name="spinner" direction="reverse">
28-
<Icon name="mention" circular bordered />
29-
</Animation>
30-
<Animation name="spinner" direction="alternate">
31-
<Icon name="mention" circular bordered />
32-
</Animation>
33-
<Animation name="spinner" direction="alternate-reverse">
34-
<Icon name="mention" circular bordered />
35-
</Animation>
24+
<div>
25+
<Animation name="spinner">
26+
<Icon name="mention" circular bordered />
27+
</Animation>
28+
</div>
29+
<div>
30+
<Animation name="spinner" direction="reverse">
31+
<Icon name="mention" circular bordered />
32+
</Animation>
33+
</div>
34+
<div>
35+
<Animation name="spinner" direction="alternate">
36+
<Icon name="mention" circular bordered />
37+
</Animation>
38+
</div>
39+
<div>
40+
<Animation name="spinner" direction="alternate-reverse">
41+
<Icon name="mention" circular bordered />
42+
</Animation>
43+
</div>
3644
</Grid>
3745
</Provider>
3846
)

0 commit comments

Comments
 (0)