{
isOpen={ isOpen }
>
-
+
diff --git a/client/landing/stepper/declarative-flow/internals/steps-repository/components/migration-survey/style.scss b/client/landing/stepper/declarative-flow/internals/steps-repository/components/migration-survey/style.scss
index a2021645d34e3..0de51e74c5518 100644
--- a/client/landing/stepper/declarative-flow/internals/steps-repository/components/migration-survey/style.scss
+++ b/client/landing/stepper/declarative-flow/internals/steps-repository/components/migration-survey/style.scss
@@ -1,6 +1,15 @@
.migration-survey {
.migration-survey__popup-head {
- background: #3858e9;
+ background: var( --color-accent );
+ }
+
+ .migration-survey__popup-img {
+ background: var( --color-accent );
+
+ img {
+ width: 100%;
+ display: block;
+ }
}
.migration-survey__popup-content {
@@ -22,14 +31,5 @@
display: flex;
justify-content: flex-end;
}
- .migration-survey__popup-img {
- background: #0675c4;
- padding-bottom: 57.9%;
-
- img {
- width: 100%;
- display: block;
- }
- }
}
}
diff --git a/client/landing/stepper/declarative-flow/internals/steps-repository/components/survey/index.tsx b/client/landing/stepper/declarative-flow/internals/steps-repository/components/survey/index.tsx
index c4ce0991806a4..3628cea97509e 100644
--- a/client/landing/stepper/declarative-flow/internals/steps-repository/components/survey/index.tsx
+++ b/client/landing/stepper/declarative-flow/internals/steps-repository/components/survey/index.tsx
@@ -3,6 +3,7 @@ import { Button } from '@wordpress/components';
import clsx from 'clsx';
import cookie from 'cookie';
import React, { cloneElement, useCallback, useContext, useMemo, useState } from 'react';
+import { flushSync } from 'react-dom';
import { recordTracksEvent } from 'calypso/lib/analytics/tracks';
import {
type SurveyContextType,
@@ -116,7 +117,17 @@ export const Survey = ( {
onSkip?.();
}
- setShouldShowSurvey( false );
+ if ( document.startViewTransition ) {
+ document.startViewTransition( async () => {
+ //use flushSync to ensure the DOM is updated before the view transition starts
+ //it is essential to use view transition api
+ flushSync( () => {
+ setShouldShowSurvey( false );
+ } );
+ } );
+ } else {
+ setShouldShowSurvey( false );
+ }
},
[ name, onAccept, onSkip ]
);
@@ -161,7 +172,8 @@ export const Survey = ( {
- { children }
+
+ { children }
diff --git a/client/landing/stepper/declarative-flow/internals/steps-repository/components/survey/style.scss b/client/landing/stepper/declarative-flow/internals/steps-repository/components/survey/style.scss
index 38e8db01a156c..8aa9890b7593e 100644
--- a/client/landing/stepper/declarative-flow/internals/steps-repository/components/survey/style.scss
+++ b/client/landing/stepper/declarative-flow/internals/steps-repository/components/survey/style.scss
@@ -1,4 +1,61 @@
+@keyframes fade-in {
+ from {
+ opacity: 0;
+ }
+ to {
+ opacity: 0.5;
+ }
+}
+@keyframes fade-out {
+ from {
+ opacity: 0.5;
+ }
+ to {
+ opacity: 0;
+ }
+}
+
+@keyframes slide-in {
+ 0% {
+ transform: translateY( 100% );
+ opacity: 0;
+ }
+
+ 50% {
+ transform: translateY( -24px );
+ opacity: 50;
+ }
+
+ 100% {
+ transform: translateY( 0 );
+ opacity: 1;
+ }
+}
+
+@keyframes slide-out {
+ 0% {
+ transform: translateY( 0 );
+ opacity: 1;
+ }
+
+ 100% {
+ transform: translateY( 30% );
+ opacity: 0;
+ }
+}
+
+@keyframes reduced-motion-slide-in {
+ 0% {
+ opacity: 0;
+ }
+
+ 100% {
+ opacity: 1;
+ }
+}
+
.survey-notice {
+ view-transition-name: survey-notice;
position: fixed;
left: 0;
top: 0;
@@ -7,6 +64,7 @@
z-index: 1000;
.survey-notice__backdrop {
+ view-transition-name: survey-notice-backdrop;
background: var(--studio-black);
opacity: 0.2;
position: absolute;
@@ -15,9 +73,18 @@
width: 100%;
height: 100%;
cursor: default;
+ animation: fade-in 0.3s ease-out both;
+ @media (prefers-reduced-motion) {
+ animation: none;
+ }
}
.survey-notice__popup {
+ view-transition-name: survey-notice-popup;
+ animation: slide-in 0.3s ease-out both 0.1s;
+ @media (prefers-reduced-motion) {
+ animation: reduced-motion-slide-in 0.5s ease-in-out both 0.7s;
+ }
position: absolute;
right: 25px;
bottom: 25px;
@@ -54,3 +121,13 @@
}
}
}
+
+
+
+::view-transition-new(survey-notice-backdrop) {
+ opacity: 0;
+}
+
+::view-transition-old(survey-notice-popup) {
+ animation: slide-out 0.2s ease-in both;
+}
diff --git a/client/landing/stepper/declarative-flow/internals/steps-repository/components/survey/test/index.tsx b/client/landing/stepper/declarative-flow/internals/steps-repository/components/survey/test/index.tsx
index 8d288c6d533f9..1e2fabcffd736 100644
--- a/client/landing/stepper/declarative-flow/internals/steps-repository/components/survey/test/index.tsx
+++ b/client/landing/stepper/declarative-flow/internals/steps-repository/components/survey/test/index.tsx
@@ -36,7 +36,7 @@ describe( 'Survey', () => {
Survey
-
+ Take the survey
);
@@ -67,7 +67,7 @@ describe( 'Survey', () => {
Survey
-
+ Take the survey
);
@@ -83,7 +83,7 @@ describe( 'Survey', () => {
Survey
-
+
@@ -101,7 +101,7 @@ describe( 'Survey', () => {
Survey
-
+
diff --git a/client/landing/stepper/declarative-flow/internals/steps-repository/components/survey/types.ts b/client/landing/stepper/declarative-flow/internals/steps-repository/components/survey/types.ts
index 52814af7ef895..ebed8cc14cacd 100644
--- a/client/landing/stepper/declarative-flow/internals/steps-repository/components/survey/types.ts
+++ b/client/landing/stepper/declarative-flow/internals/steps-repository/components/survey/types.ts
@@ -20,6 +20,6 @@ export interface SurveyProps extends PropsWithChildren {
export interface TriggerProps {
asChild?: boolean;
onClick: () => void;
- children: React.ReactElement;
as?: React.ElementType;
+ children: React.ReactElement;
}
diff --git a/client/landing/stepper/index.tsx b/client/landing/stepper/index.tsx
index 5d0dbeddd34a3..bdc6861735e7b 100644
--- a/client/landing/stepper/index.tsx
+++ b/client/landing/stepper/index.tsx
@@ -38,7 +38,6 @@ import { FlowRenderer } from './declarative-flow/internals';
import { AsyncHelpCenter } from './declarative-flow/internals/components';
import 'calypso/components/environment-badge/style.scss';
import 'calypso/assets/stylesheets/style.scss';
-import SurveyManager from './declarative-flow/internals/components/survery-manager';
import availableFlows from './declarative-flow/registered-flows';
import { USER_STORE } from './stores';
import { setupWpDataDebug } from './utils/devtools';
@@ -173,7 +172,6 @@ window.AppBoot = async () => {
placeholder={ null }
id="notices"
/>
-