Skip to content

Commit

Permalink
chore: move @fluentui/react-motions-preview to stable
Browse files Browse the repository at this point in the history
  • Loading branch information
layershifter committed Jun 6, 2024
1 parent 02f620c commit 69348a7
Show file tree
Hide file tree
Showing 96 changed files with 226 additions and 95 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ packages/react-components/react-swatch-picker/stories @microsoft/cxe-prg
packages/react-components/react-calendar-compat @microsoft/cxe-red @sopranopillow
packages/react-components/react-infolabel @microsoft/cxe-red @sopranopillow
packages/react-components/react-list-preview @microsoft/teams-prg
packages/react-components/react-motions-preview @microsoft/teams-prg
packages/react-components/react-motion @microsoft/teams-prg
packages/react-components/react-teaching-popover @microsoft/xc-uxe @Mitch-At-Work
packages/react-components/react-timepicker-compat @microsoft/teams-prg
packages/react-components/react-icons-compat @microsoft/cxe-red @tomi-msft
Expand Down
1 change: 0 additions & 1 deletion apps/public-docsite-v9/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
"@fluentui/react-storybook-addon": "*",
"@fluentui/react-storybook-addon-export-to-sandbox": "*",
"@fluentui/theme-designer": "*",
"@fluentui/react-motions-preview": "*",
"@fluentui/recipes": "*",
"@fluentui/react-timepicker-compat": "*",
"@griffel/react": "^1.5.22",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "feat: add @fluentui/react-motion to suite",
"packageName": "@fluentui/react-components",
"email": "olfedias@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: use @fluentui/react-motion",
"packageName": "@fluentui/react-dialog",
"email": "olfedias@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "feat: release stable",
"packageName": "@fluentui/react-motion",
"email": "olfedias@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: use @fluentui/react-motion",
"packageName": "@fluentui/react-toast",
"email": "olfedias@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ import { AriaLiveAnnouncerProps } from '@fluentui/react-aria';
import { AriaLiveAnnouncerState } from '@fluentui/react-aria';
import { arrowHeights } from '@fluentui/react-popover';
import { assertSlots } from '@fluentui/react-utilities';
import { AtomMotion } from '@fluentui/react-motion';
import { AtomMotionFn } from '@fluentui/react-motion';
import { Avatar } from '@fluentui/react-avatar';
import { avatarClassNames } from '@fluentui/react-avatar';
import { AvatarGroup } from '@fluentui/react-avatar';
Expand Down Expand Up @@ -194,6 +196,8 @@ import { createFocusOutlineStyle } from '@fluentui/react-tabster';
import { CreateFocusOutlineStyleOptions } from '@fluentui/react-tabster';
import { createHighContrastTheme } from '@fluentui/react-theme';
import { createLightTheme } from '@fluentui/react-theme';
import { createMotionComponent } from '@fluentui/react-motion';
import { createPresenceComponent } from '@fluentui/react-motion';
import { createTableColumn } from '@fluentui/react-table';
import { CreateTableColumnOptions } from '@fluentui/react-table';
import { createTeamsDarkTheme } from '@fluentui/react-theme';
Expand Down Expand Up @@ -559,6 +563,9 @@ import { MessageBarTitleProps } from '@fluentui/react-message-bar';
import { MessageBarTitleSlots } from '@fluentui/react-message-bar';
import { MessageBarTitleState } from '@fluentui/react-message-bar';
import { MessageBarTransitionContextValue } from '@fluentui/react-message-bar';
import { MotionComponentProps } from '@fluentui/react-motion';
import { MotionImperativeRef } from '@fluentui/react-motion';
import { motionTokens } from '@fluentui/react-motion';
import { OnOpenChangeData } from '@fluentui/react-popover';
import { OnSelectionChangeCallback } from '@fluentui/react-utilities';
import { OnSelectionChangeData } from '@fluentui/react-utilities';
Expand Down Expand Up @@ -632,8 +639,12 @@ import { PresenceBadgeState } from '@fluentui/react-badge';
import { PresenceBadgeStatus } from '@fluentui/react-badge';
import { presenceBlockedRegular } from '@fluentui/react-badge';
import { presenceBusyFilled } from '@fluentui/react-badge';
import { PresenceComponentProps } from '@fluentui/react-motion';
import { presenceDndFilled } from '@fluentui/react-badge';
import { presenceDndRegular } from '@fluentui/react-badge';
import { PresenceGroup } from '@fluentui/react-motion';
import { PresenceMotion } from '@fluentui/react-motion';
import { PresenceMotionFn } from '@fluentui/react-motion';
import { presenceOfflineRegular } from '@fluentui/react-badge';
import { presenceOofRegular } from '@fluentui/react-badge';
import { presenceUnknownRegular } from '@fluentui/react-badge';
Expand Down Expand Up @@ -1799,6 +1810,10 @@ export { arrowHeights }

export { assertSlots }

export { AtomMotion }

export { AtomMotionFn }

export { Avatar }

export { avatarClassNames }
Expand Down Expand Up @@ -2087,6 +2102,10 @@ export { createHighContrastTheme }

export { createLightTheme }

export { createMotionComponent }

export { createPresenceComponent }

export { createTableColumn }

export { CreateTableColumnOptions }
Expand Down Expand Up @@ -2817,6 +2836,12 @@ export { MessageBarTitleState }

export { MessageBarTransitionContextValue }

export { MotionComponentProps }

export { MotionImperativeRef }

export { motionTokens }

export { OnOpenChangeData }

export { OnSelectionChangeCallback }
Expand Down Expand Up @@ -2963,10 +2988,18 @@ export { presenceBlockedRegular }

export { presenceBusyFilled }

export { PresenceComponentProps }

export { presenceDndFilled }

export { presenceDndRegular }

export { PresenceGroup }

export { PresenceMotion }

export { PresenceMotionFn }

export { presenceOfflineRegular }

export { presenceOofRegular }
Expand Down
3 changes: 2 additions & 1 deletion packages/react-components/react-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@
"@fluentui/react-rating": "^9.0.10",
"@fluentui/react-search": "^9.0.6",
"@fluentui/react-teaching-popover": "^9.1.6",
"@fluentui/react-tag-picker": "^9.0.4"
"@fluentui/react-tag-picker": "^9.0.4",
"@fluentui/react-motion": "9.0.0-alpha.0"
},
"peerDependencies": {
"@types/react": ">=16.14.0 <19.0.0",
Expand Down
11 changes: 11 additions & 0 deletions packages/react-components/react-components/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1868,3 +1868,14 @@ export type {
EmptySwatchSlots,
EmptySwatchState,
} from '@fluentui/react-swatch-picker';

export { motionTokens, createMotionComponent, createPresenceComponent, PresenceGroup } from '@fluentui/react-motion';
export type {
AtomMotion,
AtomMotionFn,
MotionComponentProps,
MotionImperativeRef,
PresenceMotion,
PresenceMotionFn,
PresenceComponentProps,
} from '@fluentui/react-motion';
2 changes: 1 addition & 1 deletion packages/react-components/react-dialog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@fluentui/react-jsx-runtime": "^9.0.38",
"@fluentui/keyboard-keys": "^9.0.7",
"@fluentui/react-context-selector": "^9.1.60",
"@fluentui/react-motions-preview": "^0.3.2",
"@fluentui/react-motion": "9.0.0-alpha.0",
"@fluentui/react-shared-contexts": "^9.19.0",
"@fluentui/react-aria": "^9.11.4",
"@fluentui/react-icons": "^2.0.239",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createPresenceComponent, motionTokens } from '@fluentui/react-motions-preview';
import { createPresenceComponent, motionTokens } from '@fluentui/react-motion';

const keyframes = [{ opacity: 0 }, { opacity: 1 }];

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createPresenceComponent, motionTokens } from '@fluentui/react-motions-preview';
import { createPresenceComponent, motionTokens } from '@fluentui/react-motion';
import { tokens } from '@fluentui/react-theme';

const keyframes = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This log was last generated on Mon, 20 May 2024 12:44:59 GMT and should not be m

## [0.3.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-motions-preview_v0.3.2)

Mon, 20 May 2024 12:44:59 GMT
Mon, 20 May 2024 12:44:59 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-motions-preview_v0.3.1..@fluentui/react-motions-preview_v0.3.2)

### Patches
Expand All @@ -17,7 +17,7 @@ Mon, 20 May 2024 12:44:59 GMT

## [0.3.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-motions-preview_v0.3.1)

Thu, 16 May 2024 09:25:16 GMT
Thu, 16 May 2024 09:25:16 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-motions-preview_v0.3.0..@fluentui/react-motions-preview_v0.3.1)

### Patches
Expand All @@ -26,7 +26,7 @@ Thu, 16 May 2024 09:25:16 GMT

## [0.3.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-motions-preview_v0.3.0)

Thu, 09 May 2024 19:35:11 GMT
Thu, 09 May 2024 19:35:11 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-motions-preview_v0.2.8..@fluentui/react-motions-preview_v0.3.0)

### Minor changes
Expand All @@ -35,7 +35,7 @@ Thu, 09 May 2024 19:35:11 GMT

## [0.2.8](https://github.com/microsoft/fluentui/tree/@fluentui/react-motions-preview_v0.2.8)

Mon, 06 May 2024 12:55:02 GMT
Mon, 06 May 2024 12:55:02 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-motions-preview_v0.2.7..@fluentui/react-motions-preview_v0.2.8)

### Patches
Expand All @@ -45,7 +45,7 @@ Mon, 06 May 2024 12:55:02 GMT

## [0.2.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-motions-preview_v0.2.7)

Thu, 02 May 2024 11:36:35 GMT
Thu, 02 May 2024 11:36:35 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-motions-preview_v0.2.6..@fluentui/react-motions-preview_v0.2.7)

### Patches
Expand All @@ -55,7 +55,7 @@ Thu, 02 May 2024 11:36:35 GMT

## [0.2.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-motions-preview_v0.2.6)

Tue, 23 Apr 2024 08:17:49 GMT
Tue, 23 Apr 2024 08:17:49 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-motions-preview_v0.2.5..@fluentui/react-motions-preview_v0.2.6)

### Patches
Expand All @@ -65,7 +65,7 @@ Tue, 23 Apr 2024 08:17:49 GMT

## [0.2.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-motions-preview_v0.2.5)

Tue, 02 Apr 2024 09:48:01 GMT
Tue, 02 Apr 2024 09:48:01 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-motions-preview_v0.2.4..@fluentui/react-motions-preview_v0.2.5)

### Patches
Expand All @@ -75,7 +75,7 @@ Tue, 02 Apr 2024 09:48:01 GMT

## [0.2.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-motions-preview_v0.2.4)

Mon, 18 Mar 2024 19:50:46 GMT
Mon, 18 Mar 2024 19:50:46 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-motions-preview_v0.2.3..@fluentui/react-motions-preview_v0.2.4)

### Patches
Expand All @@ -85,7 +85,7 @@ Mon, 18 Mar 2024 19:50:46 GMT

## [0.2.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-motions-preview_v0.2.3)

Fri, 15 Mar 2024 21:43:49 GMT
Fri, 15 Mar 2024 21:43:49 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-motions-preview_v0.2.2..@fluentui/react-motions-preview_v0.2.3)

### Patches
Expand All @@ -95,7 +95,7 @@ Fri, 15 Mar 2024 21:43:49 GMT

## [0.2.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-motions-preview_v0.2.2)

Thu, 07 Mar 2024 19:33:27 GMT
Thu, 07 Mar 2024 19:33:27 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-motions-preview_v0.2.1..@fluentui/react-motions-preview_v0.2.2)

### Patches
Expand All @@ -105,7 +105,7 @@ Thu, 07 Mar 2024 19:33:27 GMT

## [0.2.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-motions-preview_v0.2.1)

Wed, 28 Feb 2024 02:34:19 GMT
Wed, 28 Feb 2024 02:34:19 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-motions-preview_v0.2.0..@fluentui/react-motions-preview_v0.2.1)

### Patches
Expand All @@ -115,7 +115,7 @@ Wed, 28 Feb 2024 02:34:19 GMT

## [0.2.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-motions-preview_v0.2.0)

Tue, 20 Feb 2024 14:22:22 GMT
Tue, 20 Feb 2024 14:22:22 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-motions-preview_v0.1.1..@fluentui/react-motions-preview_v0.2.0)

### Minor changes
Expand All @@ -131,7 +131,7 @@ Tue, 20 Feb 2024 14:22:22 GMT

## [0.1.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-motions-preview_v0.1.1)

Tue, 30 Jan 2024 23:16:54 GMT
Tue, 30 Jan 2024 23:16:54 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-motions-preview_v0.1.0..@fluentui/react-motions-preview_v0.1.1)

### Patches
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @fluentui/react-motions-preview
# @fluentui/react-motion

**React Motions components for [Fluent UI React](https://react.fluentui.dev/)**

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## API Report File for "@fluentui/react-motions-preview"
## API Report File for "@fluentui/react-motion"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @type {import('@jest/types').Config.InitialOptions}
*/
module.exports = {
displayName: 'react-motions-preview',
displayName: 'react-motion',
preset: '../../../jest.preset.js',
transform: {
'^.+\\.tsx?$': [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fluentui/react-motions-preview",
"version": "0.3.2",
"name": "@fluentui/react-motion",
"version": "9.0.0-alpha.0",
"description": "A package with utilities & motion definitions using Web Animations API",
"main": "lib-commonjs/index.js",
"module": "lib/index.js",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@fluentui/react-motions-preview",
"name": "@fluentui/react-motion",
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"sourceRoot": "packages/react-components/react-motions-preview/src",
"sourceRoot": "packages/react-components/react-motion/src",
"tags": ["platform:web", "vNext"],
"implicitDependencies": []
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ type PresenceGroupState = {

/* eslint-disable @typescript-eslint/explicit-member-accessibility */
/* eslint-disable @typescript-eslint/naming-convention */
/* eslint-disable @typescript-eslint/member-ordering */

export class PresenceGroup extends React.Component<PresenceGroupProps, PresenceGroupState> {
#mounted: boolean = false;
private mounted: boolean = false;

static getDerivedStateFromProps(
nextProps: PresenceGroupProps,
Expand All @@ -41,14 +42,14 @@ export class PresenceGroup extends React.Component<PresenceGroupProps, PresenceG
};
}

#handleExit = (childKey: string) => {
private handleExit = (childKey: string) => {
const currentChildMapping = getChildMapping(this.props.children);

if (childKey in currentChildMapping) {
return;
}

if (this.#mounted) {
if (this.mounted) {
this.setState(state => {
const childMapping = { ...state.childMapping };
delete childMapping[childKey];
Expand All @@ -59,18 +60,18 @@ export class PresenceGroup extends React.Component<PresenceGroupProps, PresenceG
};

componentDidMount() {
this.#mounted = true;
this.mounted = true;
}

componentWillUnmount() {
this.#mounted = false;
this.mounted = false;
}

render() {
return (
<>
{Object.entries(this.state.childMapping).map(([childKey, childProps]) => (
<PresenceGroupItemProvider {...childProps} childKey={childKey} key={childKey} onExit={this.#handleExit}>
<PresenceGroupItemProvider {...childProps} childKey={childKey} key={childKey} onExit={this.handleExit}>
{childProps.element}
</PresenceGroupItemProvider>
))}
Expand Down
Loading

0 comments on commit 69348a7

Please sign in to comment.