forked from microsoft/fluentui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(Dialog): migrate to new motion APIs (microsoft#31380)
Co-authored-by: Bernardo Sunderhus <bernardo.sunderhus@gmail.com>
- Loading branch information
1 parent
9455bcc
commit 963c618
Showing
16 changed files
with
155 additions
and
138 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/@fluentui-react-dialog-6263971a-523d-4e53-9472-04268e11b2fc.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "patch", | ||
"comment": "chore(Dialog): migrate to new motion APIs", | ||
"packageName": "@fluentui/react-dialog", | ||
"email": "olfedias@microsoft.com", | ||
"dependentChangeType": "patch" | ||
} |
7 changes: 7 additions & 0 deletions
7
change/@fluentui-react-drawer-1eb5687d-dae0-495b-8f47-ca863a12599a.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "patch", | ||
"comment": "fix(OverlayDrawer): unlock scroll when reduced motion is enabled", | ||
"packageName": "@fluentui/react-drawer", | ||
"email": "olfedias@microsoft.com", | ||
"dependentChangeType": "patch" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 10 additions & 17 deletions
27
packages/react-components/react-dialog/src/components/Dialog/renderDialog.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
packages/react-components/react-dialog/src/components/DialogBackdropMotion.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { createPresenceComponent, motionTokens } from '@fluentui/react-motions-preview'; | ||
|
||
const keyframes = [{ opacity: 0 }, { opacity: 1 }]; | ||
|
||
export const DialogBackdropMotion = createPresenceComponent({ | ||
enter: { | ||
keyframes, | ||
easing: motionTokens.curveLinear, | ||
duration: motionTokens.durationGentle, | ||
}, | ||
exit: { | ||
keyframes: [...keyframes].reverse(), | ||
easing: motionTokens.curveLinear, | ||
duration: motionTokens.durationGentle, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
packages/react-components/react-dialog/src/components/DialogSurfaceMotion.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { createPresenceComponent, motionTokens } from '@fluentui/react-motions-preview'; | ||
import { tokens } from '@fluentui/react-theme'; | ||
|
||
const keyframes = [ | ||
{ opacity: 0, boxShadow: '0px 0px 0px 0px rgba(0, 0, 0, 0.1)', transform: 'scale(0.85) translateZ(0)' }, | ||
{ | ||
boxShadow: tokens.shadow64, | ||
transform: 'scale(1) translateZ(0)', | ||
opacity: 1, | ||
}, | ||
]; | ||
|
||
export const DialogSurfaceMotion = createPresenceComponent({ | ||
enter: { | ||
keyframes, | ||
easing: motionTokens.curveDecelerateMid, | ||
duration: motionTokens.durationGentle, | ||
}, | ||
exit: { | ||
keyframes: [...keyframes].reverse(), | ||
easing: motionTokens.curveAccelerateMin, | ||
duration: motionTokens.durationGentle, | ||
}, | ||
}); |
Oops, something went wrong.