diff --git a/src/OnboardingSPA/components/Animate/stylesheet.scss b/src/OnboardingSPA/components/Animate/stylesheet.scss
index 00ce8b300..3ab261adc 100644
--- a/src/OnboardingSPA/components/Animate/stylesheet.scss
+++ b/src/OnboardingSPA/components/Animate/stylesheet.scss
@@ -109,6 +109,25 @@
}
}
+@keyframes fadeInFast {
+
+ 0% {
+ opacity: 0.1;
+ }
+
+ 25% {
+ opacity: 1;
+ }
+
+ 75% {
+ opacity: 1;
+ }
+
+ 100% {
+ opacity: 0.1;
+ }
+}
+
@-webkit-keyframes spin {
0% {
diff --git a/src/OnboardingSPA/components/Button/NextButtonSiteGen/index.js b/src/OnboardingSPA/components/Button/NextButtonSiteGen/index.js
index 742cb078d..145f392ea 100644
--- a/src/OnboardingSPA/components/Button/NextButtonSiteGen/index.js
+++ b/src/OnboardingSPA/components/Button/NextButtonSiteGen/index.js
@@ -1,11 +1,11 @@
+import classNames from 'classnames';
import { useNavigate } from 'react-router-dom';
-
import { useSelect } from '@wordpress/data';
import { Button } from '@wordpress/components';
+import { Icon, chevronRight } from '@wordpress/icons';
import { store as nfdOnboardingStore } from '../../../store';
-import classNames from 'classnames';
-const NextButtonSiteGen = ( { text, className } ) => {
+const NextButtonSiteGen = ( { text, className, callback = null } ) => {
const navigate = useNavigate();
const { nextStep } = useSelect( ( select ) => {
return {
@@ -19,12 +19,19 @@ const NextButtonSiteGen = ( { text, className } ) => {
className
) }
onClick={ () => {
+ if ( callback && typeof callback === 'function' ) {
+ callback();
+ }
if ( nextStep ) {
navigate( nextStep.path );
}
} }
>
{ text }
+
);
};
diff --git a/src/OnboardingSPA/components/Button/NextButtonSiteGen/stylesheet.scss b/src/OnboardingSPA/components/Button/NextButtonSiteGen/stylesheet.scss
index 4fd7d8707..7003deaeb 100644
--- a/src/OnboardingSPA/components/Button/NextButtonSiteGen/stylesheet.scss
+++ b/src/OnboardingSPA/components/Button/NextButtonSiteGen/stylesheet.scss
@@ -1,15 +1,18 @@
.nfd-onboarding-button {
&--site-gen-next {
- display: block;
- background-color: var(--nfd-onboarding-primary);
- color: var(--nfd-onboarding-secondary);
- text-align: center;
width: 164px;
height: 50px;
- font-size: clamp(0.5rem, 0.3864rem + 0.5682vw, 1.75rem);
+ display: flex;
+ cursor: pointer;
margin-top: 24px;
- border-radius: 6px;
+ text-align: center;
+ border-radius: 8px;
+ align-items: center;
+ justify-content: center;
+ color: var(--nfd-onboarding-secondary);
+ background-color: var(--nfd-onboarding-primary);
+ font-size: clamp(0.5rem, 0.3864rem + 0.5682vw, 1.75rem);
@media (min-width: 2600px ) {
width: 250px;
@@ -22,4 +25,8 @@
margin-top: 10px;
}
}
+
+ &--icon {
+ fill: var(--nfd-onboarding-secondary);
+ }
}
diff --git a/src/OnboardingSPA/components/CardWithOptions/index.js b/src/OnboardingSPA/components/CardWithOptions/index.js
new file mode 100644
index 000000000..6ac5c8fff
--- /dev/null
+++ b/src/OnboardingSPA/components/CardWithOptions/index.js
@@ -0,0 +1,71 @@
+import { Icon, chevronRight } from '@wordpress/icons';
+
+const CardWithOptions = ( { title, options, skip, callback } ) => {
+ const buildOptions = () => {
+ return options.map( ( data, idx ) => {
+ return (
+
{
+ if ( callback && typeof callback === 'function' ) {
+ callback( idx + 1 );
+ }
+ } }
+ onKeyDown={ () => {
+ if ( callback && typeof callback === 'function' ) {
+ callback( idx + 1 );
+ }
+ } }
+ >
+
+
+ { data.title }
+
+
+ { data.desc }
+
+
+
+
+ );
+ } );
+ };
+
+ return (
+
+
{ title }
+
{ buildOptions() }
+
{
+ if ( callback && typeof callback === 'function' ) {
+ callback( -1 );
+ }
+ } }
+ onKeyDown={ () => {
+ if ( callback && typeof callback === 'function' ) {
+ callback( -1 );
+ }
+ } }
+ >
+ { skip }
+
+
+ );
+};
+
+export default CardWithOptions;
diff --git a/src/OnboardingSPA/components/CardWithOptions/stylesheet.scss b/src/OnboardingSPA/components/CardWithOptions/stylesheet.scss
new file mode 100644
index 000000000..3a1e8b2f9
--- /dev/null
+++ b/src/OnboardingSPA/components/CardWithOptions/stylesheet.scss
@@ -0,0 +1,79 @@
+$background-color: var(--nfd-onboarding-card-background);
+
+.nfd-sg-card {
+
+ margin: 8px;
+ max-width: 90vw;
+ padding: 24px 12px;
+ border-radius: 12px;
+ background-color: $background-color;
+ width: clamp(18.75rem, 22.6136rem + 5.6818vw, 31.25rem);
+ box-shadow: 3px 3px 5px rgba(var(--nfd-onboarding-primary-rgb), $alpha: 0.05);
+
+ &__title {
+ color: var(--nfd-onboarding-primary);
+ margin: 16px;
+ line-height: 2;
+ font-size: 18px;
+ text-align: center;
+ margin-bottom: 30px;
+ letter-spacing: 1.5px;
+ }
+
+ &__data {
+ margin: 12px;
+
+ &__option {
+ display: flex;
+ cursor: pointer;
+ margin: 16px 4px;
+ align-items: center;
+ border-radius: 4px 4px 0 0;
+ padding: 16px 12px 20px 12px;
+ justify-content: space-between;
+ transition: background-color 400ms ease-in-out;
+
+ &:not(:last-child) {
+ border-bottom: 0.5px solid rgba(var(--nfd-onboarding-primary-rgb), 0.3);
+ }
+
+ &:hover {
+ background-color: var(--nfd-onboarding-hover);
+ }
+
+ &__left_top {
+ color: var(--nfd-onboarding-primary);
+ font-size: 16px;
+ font-weight: 500;
+ padding-bottom: 12px;
+ }
+
+ &__left_bottom {
+ color: var(--nfd-onboarding-primary);
+ font-size: 14px;
+ font-weight: 300;
+ }
+
+ &__right {
+ fill: var(--nfd-onboarding-primary);
+ transition: all 200ms ease-in-out;
+
+ &:hover {
+ transform: scale(1.1);
+ }
+ }
+ }
+ }
+
+ &__skip {
+ cursor: pointer;
+ text-align: end;
+ margin: 0 20px 6px 20px;
+ transition: color 200ms ease-in-out;
+ color: rgba(var(--nfd-onboarding-primary-rgb), 0.8);
+
+ &:hover {
+ color: var(--nfd-onboarding-primary);
+ }
+ }
+}
diff --git a/src/OnboardingSPA/components/ErrorState/Step/index.js b/src/OnboardingSPA/components/ErrorState/Step/index.js
index d97570176..909eda268 100644
--- a/src/OnboardingSPA/components/ErrorState/Step/index.js
+++ b/src/OnboardingSPA/components/ErrorState/Step/index.js
@@ -1,5 +1,5 @@
import CommonLayout from '../../Layouts/Common';
-import HeadingWithSubHeading from '../../HeadingWithSubHeading';
+import HeadingWithSubHeading from '../../Heading/HeadingWithSubHeading';
import NeedHelpTag from '../../NeedHelpTag';
const StepErrorState = ( { title, subtitle, error } ) => {
diff --git a/src/OnboardingSPA/components/Heading/AIHeading/index.js b/src/OnboardingSPA/components/Heading/AIHeading/index.js
new file mode 100644
index 000000000..93fd2b8d3
--- /dev/null
+++ b/src/OnboardingSPA/components/Heading/AIHeading/index.js
@@ -0,0 +1,10 @@
+const AIHeading = ( { title } ) => {
+ return (
+
+ );
+};
+
+export default AIHeading;
diff --git a/src/OnboardingSPA/components/Heading/AIHeading/stylesheet.scss b/src/OnboardingSPA/components/Heading/AIHeading/stylesheet.scss
new file mode 100644
index 000000000..51c3e5f17
--- /dev/null
+++ b/src/OnboardingSPA/components/Heading/AIHeading/stylesheet.scss
@@ -0,0 +1,24 @@
+.ai-heading {
+
+ display: flex;
+ margin-bottom: 20px;
+ align-items: center;
+
+ &--icon {
+ width: 50px;
+ margin: 4px;
+ height: 50px;
+ background-size: 200%;
+ background-position: center;
+ background-repeat: no-repeat;
+ background-image: var(--sitegen-ai-animation);
+ }
+
+ &--title {
+ margin: 10px;
+ line-height: 1.5;
+ font-weight: 500;
+ font-size: 1.2rem;
+ color: var(--nfd-onboarding-primary);
+ }
+}
diff --git a/src/OnboardingSPA/components/HeadingWithSubHeading/index.js b/src/OnboardingSPA/components/Heading/HeadingWithSubHeading/index.js
similarity index 100%
rename from src/OnboardingSPA/components/HeadingWithSubHeading/index.js
rename to src/OnboardingSPA/components/Heading/HeadingWithSubHeading/index.js
diff --git a/src/OnboardingSPA/components/HeadingWithSubHeading/stylesheet.scss b/src/OnboardingSPA/components/Heading/HeadingWithSubHeading/stylesheet.scss
similarity index 100%
rename from src/OnboardingSPA/components/HeadingWithSubHeading/stylesheet.scss
rename to src/OnboardingSPA/components/Heading/HeadingWithSubHeading/stylesheet.scss
diff --git a/src/OnboardingSPA/components/Loaders/SiteGenLoader/contents.js b/src/OnboardingSPA/components/Loaders/SiteGenLoader/contents.js
new file mode 100644
index 000000000..3ebb1b078
--- /dev/null
+++ b/src/OnboardingSPA/components/Loaders/SiteGenLoader/contents.js
@@ -0,0 +1,32 @@
+import { __ } from '@wordpress/i18n';
+
+const getContents = () => {
+ return {
+ title: __( 'Building Website', 'wp-module-onboarding' ),
+ status: [
+ {
+ title: __( 'Generating Website', 'wp-module-onboarding' ),
+ },
+ {
+ title: __( 'Finding Font Pairings', 'wp-module-onboarding' ),
+ },
+ {
+ title: __(
+ 'Building Custom Color Palettes',
+ 'wp-module-onboarding'
+ ),
+ },
+ {
+ title: __( 'Populating Images', 'wp-module-onboarding' ),
+ },
+ {
+ title: __( 'Finalizing Previews', 'wp-module-onboarding' ),
+ },
+ {
+ title: __( 'Packaging Website', 'wp-module-onboarding' ),
+ },
+ ],
+ };
+};
+
+export default getContents;
diff --git a/src/OnboardingSPA/components/Loaders/SiteGenLoader/index.js b/src/OnboardingSPA/components/Loaders/SiteGenLoader/index.js
new file mode 100644
index 000000000..72a0c9a8b
--- /dev/null
+++ b/src/OnboardingSPA/components/Loaders/SiteGenLoader/index.js
@@ -0,0 +1,64 @@
+import getContents from './contents';
+import { useSelect } from '@wordpress/data';
+import { useNavigate } from 'react-router-dom';
+import { useEffect, useState } from '@wordpress/element';
+import { store as nfdOnboardingStore } from '../../../store';
+
+const SiteGenLoader = ( { autoNavigate = false } ) => {
+ let statusIdx = 0;
+ const content = getContents();
+ const navigate = useNavigate();
+ const [ percentage, setPercentage ] = useState( 0 );
+ const [ status, setStatus ] = useState( content.status[ statusIdx ].title );
+
+ const { nextStep } = useSelect( ( select ) => {
+ return {
+ nextStep: select( nfdOnboardingStore ).getNextStep(),
+ };
+ } );
+
+ const checkStatus = async () => {
+ // Make fake API Call to get the status.
+ if ( percentage !== 100 ) setPercentage( ( t ) => t + 10 );
+ };
+
+ useEffect( () => {
+ const statusTimer = setInterval( () => {
+ checkStatus();
+ statusIdx += 1;
+ if ( statusIdx === content.status.length ) statusIdx = 0;
+ setStatus( content.status[ statusIdx ].title );
+ }, 3000 );
+ return () => {
+ clearInterval( statusTimer );
+ };
+ }, [] );
+
+ useEffect( () => {
+ if ( percentage === 100 ) {
+ if ( nextStep && autoNavigate ) {
+ navigate( nextStep.path );
+ }
+ }
+ }, [ percentage ] );
+
+ return (
+
+
{ content.title }
+
+
{ `${ status }...` }
+
+ );
+};
+
+export default SiteGenLoader;
diff --git a/src/OnboardingSPA/components/Loaders/SiteGenLoader/stylesheet.scss b/src/OnboardingSPA/components/Loaders/SiteGenLoader/stylesheet.scss
new file mode 100644
index 000000000..a32bacc27
--- /dev/null
+++ b/src/OnboardingSPA/components/Loaders/SiteGenLoader/stylesheet.scss
@@ -0,0 +1,70 @@
+$background-color: var(--nfd-onboarding-card-background);
+
+.nfd-sg-loader {
+
+ margin: 8px;
+ max-width: 90vw;
+ padding: 16px 12px;
+ border-radius: 12px;
+ background-color: $background-color;
+ width: clamp(18.75rem, 22.6136rem + 5.6818vw, 31.25rem);
+ box-shadow: 3px 3px 5px rgba(var(--nfd-onboarding-black-rgb), $alpha: 0.05);
+
+ @media (max-width: #{ ($break-small) }) {
+ margin: 20px;
+ max-width: 80vw;
+ }
+
+ &__title {
+ line-height: 2;
+ font-size: 18px;
+ text-align: center;
+ letter-spacing: 1.5px;
+ color: var(--nfd-onboarding-primary);
+ }
+
+ &__progress {
+ display: flex;
+ margin: 20px 60px;
+ align-items: center;
+ justify-content: center;
+
+ @media (max-width: #{ ($break-small) }) {
+ margin: 20px 30px;
+ }
+
+ &_bars {
+ width: 100%;
+ display: flex;
+ position: relative;
+ align-items: center;
+ justify-content: flex-start;
+
+ &_bg {
+ height: 6px;
+ width: 100%;
+ border-radius: 6px;
+ background-color: var(--nfd-onboarding-progress-bar-background);
+ }
+
+ &_bar {
+ top: 0;
+ height: 6px;
+ max-width: 100%;
+ border-radius: 6px;
+ position: absolute;
+ transition: width 2s ease-in-out;
+ background-color: var(--nfd-onboarding-progress-bar-fill);
+ }
+ }
+ }
+
+ &__status {
+ line-height: 2;
+ font-size: 14px;
+ text-align: center;
+ letter-spacing: 1.3px;
+ color: var(--nfd-onboarding-primary);
+ animation: fadeInFast 3s ease-out infinite;
+ }
+}
diff --git a/src/OnboardingSPA/components/Loaders/Step/index.js b/src/OnboardingSPA/components/Loaders/Step/index.js
index ea84b1950..09f655d1f 100644
--- a/src/OnboardingSPA/components/Loaders/Step/index.js
+++ b/src/OnboardingSPA/components/Loaders/Step/index.js
@@ -1,5 +1,5 @@
import CommonLayout from '../../Layouts/Common';
-import HeadingWithSubHeading from '../../HeadingWithSubHeading';
+import HeadingWithSubHeading from '../../Heading/HeadingWithSubHeading';
import NeedHelpTag from '../../NeedHelpTag';
const StepLoader = ( { title, subtitle } ) => {
diff --git a/src/OnboardingSPA/components/TextInput/contents.js b/src/OnboardingSPA/components/TextInput/TextInputSiteBuild/contents.js
similarity index 100%
rename from src/OnboardingSPA/components/TextInput/contents.js
rename to src/OnboardingSPA/components/TextInput/TextInputSiteBuild/contents.js
diff --git a/src/OnboardingSPA/components/TextInput/index.js b/src/OnboardingSPA/components/TextInput/TextInputSiteBuild/index.js
similarity index 91%
rename from src/OnboardingSPA/components/TextInput/index.js
rename to src/OnboardingSPA/components/TextInput/TextInputSiteBuild/index.js
index 6859ff853..ad2ae1dea 100644
--- a/src/OnboardingSPA/components/TextInput/index.js
+++ b/src/OnboardingSPA/components/TextInput/TextInputSiteBuild/index.js
@@ -1,7 +1,7 @@
import { useRef, useEffect, useState, memo } from '@wordpress/element';
import getContents from './contents';
-const TextInput = ( {
+const TextInputSiteBuild = ( {
title,
hint,
placeholder,
@@ -58,5 +58,5 @@ const TextInput = ( {
);
};
-const TextInputMemo = memo( TextInput );
-export default TextInputMemo;
+const TextInputSiteBuildMemo = memo( TextInputSiteBuild );
+export default TextInputSiteBuildMemo;
diff --git a/src/OnboardingSPA/components/TextInput/stylesheet.scss b/src/OnboardingSPA/components/TextInput/TextInputSiteBuild/stylesheet.scss
similarity index 100%
rename from src/OnboardingSPA/components/TextInput/stylesheet.scss
rename to src/OnboardingSPA/components/TextInput/TextInputSiteBuild/stylesheet.scss
diff --git a/src/OnboardingSPA/components/TextInput/TextInputSiteGen/index.js b/src/OnboardingSPA/components/TextInput/TextInputSiteGen/index.js
new file mode 100644
index 000000000..c213f45ec
--- /dev/null
+++ b/src/OnboardingSPA/components/TextInput/TextInputSiteGen/index.js
@@ -0,0 +1,86 @@
+import classNames from 'classnames';
+import { useRef, useEffect, useState, memo } from '@wordpress/element';
+
+const TextInputSiteGen = ( {
+ hint,
+ height,
+ placeholder,
+ customerInput,
+ setCustomerInput,
+} ) => {
+ const textareaRef = useRef( null );
+ const [ inputText, setInputText ] = useState( 'nfd-sg-input-box__field' );
+
+ useEffect( () => {
+ textareaRef.current.style.height = height;
+ const scrollHeight = textareaRef.current.scrollHeight;
+ textareaRef.current.style.height = scrollHeight + 'px';
+ }, [ customerInput ] );
+
+ const calculateDetail = ( num ) => {
+ const selectedButton = 'nfd-sg-input-box__info-icon--selected';
+ switch ( num ) {
+ case 1:
+ if ( customerInput?.length > 30 ) return selectedButton;
+ break;
+ case 2:
+ if ( customerInput?.length > 60 ) return selectedButton;
+ break;
+ case 3:
+ if ( customerInput?.length > 100 ) return selectedButton;
+ }
+ };
+
+ const onTextChange = ( e ) => {
+ e.preventDefault();
+ setCustomerInput( e.target.value );
+ setInputText( 'nfd-sg-input-box__field' );
+ };
+
+ return (
+
+
+
+ );
+};
+
+export default memo( TextInputSiteGen );
diff --git a/src/OnboardingSPA/components/TextInput/TextInputSiteGen/stylesheet.scss b/src/OnboardingSPA/components/TextInput/TextInputSiteGen/stylesheet.scss
new file mode 100644
index 000000000..c13ecdb00
--- /dev/null
+++ b/src/OnboardingSPA/components/TextInput/TextInputSiteGen/stylesheet.scss
@@ -0,0 +1,74 @@
+$letter-spacing: 0.5px;
+$selected-detail: #1de082;
+
+.nfd-sg-input {
+ margin-top: 25px;
+ margin-bottom: 25px;
+ width: 100% !important;
+
+ &-box {
+ margin-bottom: 10px;
+ border-bottom: 2px solid rgba(var(--nfd-onboarding-primary-rgb), 0.5);
+
+ &__field {
+ padding-top: 10px;
+ font-size: 1.5rem;
+ background: transparent;
+ letter-spacing: $letter-spacing;
+
+ width: 100%;
+ resize: none;
+ border: none;
+ max-height: 150px;
+ color: var(--nfd-onboarding-primary);
+
+ &:focus {
+ box-shadow: none;
+ }
+
+ &::placeholder {
+ font-weight: 100;
+ color: rgba(var(--nfd-onboarding-primary-rgb), 0.8);
+ }
+ }
+
+ &__hint {
+ margin-top: 30px;
+ font-weight: 300;
+ font-size: 0.87rem;
+ padding: 0 1.5px;
+ animation: fadeIn 100ms ease-out;
+ letter-spacing: $letter-spacing;
+ color: var(--nfd-onboarding-primary);
+ }
+
+ &__info {
+ display: flex;
+ margin-top: 30px;
+ align-items: center;
+
+ &-text {
+ margin: 3px;
+ margin-right: 8px;
+ font-size: 0.87rem;
+ animation: fadeIn 100ms ease-in;
+ color: var(--nfd-onboarding-primary);
+ }
+
+ &-icon {
+ width: 10px;
+ height: 6px;
+ margin: 3px;
+ border-radius: 6px;
+ animation: fadeIn 100ms ease-in;
+ background-color: var(--nfd-onboarding-primary);
+
+ &--selected {
+ animation: fadeIn 400ms ease-in-out;
+ background-color: $selected-detail;
+ }
+ }
+ }
+ }
+
+}
diff --git a/src/OnboardingSPA/pages/ErrorPage/index.js b/src/OnboardingSPA/pages/ErrorPage/index.js
index eb14fc4e0..760da6d6a 100644
--- a/src/OnboardingSPA/pages/ErrorPage/index.js
+++ b/src/OnboardingSPA/pages/ErrorPage/index.js
@@ -2,7 +2,7 @@ import { useDispatch } from '@wordpress/data';
import { useEffect } from '@wordpress/element';
import CommonLayout from '../../components/Layouts/Common';
-import HeadingWithSubHeading from '../../components/HeadingWithSubHeading';
+import HeadingWithSubHeading from '../../components/Heading/HeadingWithSubHeading';
import { SIDEBAR_LEARN_MORE, VIEW_NAV_PAGE } from '../../../constants';
import { store as nfdOnboardingStore } from '../../store';
import { useViewportMatch } from '@wordpress/compose';
diff --git a/src/OnboardingSPA/steps/BasicInfo/basicInfoForm.js b/src/OnboardingSPA/steps/BasicInfo/basicInfoForm.js
index 512e162e3..30f5334a8 100644
--- a/src/OnboardingSPA/steps/BasicInfo/basicInfoForm.js
+++ b/src/OnboardingSPA/steps/BasicInfo/basicInfoForm.js
@@ -2,7 +2,7 @@ import { useDispatch, useSelect } from '@wordpress/data';
import { store as coreStore } from '@wordpress/core-data';
import { useState, useEffect, useRef } from '@wordpress/element';
import getContents from './contents';
-import TextInput from '../../components/TextInput';
+import TextInputSiteBuild from '../../components/TextInput/TextInputSiteBuild';
import SkipButton from '../../components/SkipButton';
import MiniPreview from '../../components/MiniPreview';
import Animate from '../../components/Animate';
@@ -142,7 +142,7 @@ const BasicInfoForm = () => {
-
{
textValueSetter={ setSiteTitle }
/>
- {
const {
@@ -27,7 +27,17 @@ const SiteGenBuilding = () => {
isCentered
className="nfd-onboarding-step--site-gen__building"
>
-
+
+
+
+
);
};
diff --git a/src/OnboardingSPA/steps/SiteGen/Building/stylesheet.scss b/src/OnboardingSPA/steps/SiteGen/Building/stylesheet.scss
new file mode 100644
index 000000000..325405a1c
--- /dev/null
+++ b/src/OnboardingSPA/steps/SiteGen/Building/stylesheet.scss
@@ -0,0 +1,67 @@
+@property --angle {
+ inherits: true;
+ syntax: "";
+ initial-value: 90deg;
+}
+
+@keyframes borderRotate {
+
+ 100% {
+ --angle: 360deg;
+ }
+}
+
+.nfd-onboarding-step--site-gen__building {
+ margin: 20px;
+ padding: 20px;
+ position: relative;
+}
+
+.site-gen__building {
+
+ &_skimmer {
+
+ &--main {
+ margin-bottom: 30px;
+ background: rgba(var(--nfd-onboarding-primary-rgb), 0.05);
+ box-shadow: 0 4px 30px rgba(var(--nfd-onboarding-secondary-rgb), 0.1);
+ animation: borderRotate 3500ms infinite forwards;
+ border: 0.25px solid rgba(var(--nfd-onboarding-secondary-rgb), 0.26);
+ border-image: conic-gradient(from var(--angle), rgba(var(--nfd-onboarding-secondary-rgb), 0.26) calc(var(--angle) + 0.5deg), rgba(var(--nfd-onboarding-shimmer-color), 0.5) calc(var(--angle) + 1deg)) 30;
+ }
+
+ &--header {
+ height: 80px;
+ width: 90vw;
+ }
+
+ &--body {
+ width: 90vw;
+ height: 500px;
+ }
+
+ &--footer {
+ display: flex;
+ align-items: center;
+ flex-direction: row;
+ justify-content: space-between;
+
+ &_left {
+ width: 55vw;
+ height: 300px;
+ }
+
+ &_right {
+ width: 33vw;
+ height: 300px;
+ }
+ }
+ }
+
+ &_loader__overlay {
+ position: absolute;
+ top: 40%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ }
+}
diff --git a/src/OnboardingSPA/steps/SiteGen/Experience/contents.js b/src/OnboardingSPA/steps/SiteGen/Experience/contents.js
new file mode 100644
index 000000000..246dbb06e
--- /dev/null
+++ b/src/OnboardingSPA/steps/SiteGen/Experience/contents.js
@@ -0,0 +1,36 @@
+import { __ } from '@wordpress/i18n';
+
+const getContents = () => {
+ return {
+ heading: __(
+ 'How familiar are you with using WordPress?',
+ 'wp-module-onboarding'
+ ),
+ options: [
+ {
+ title: __( 'Beginner', 'wp-module-onboarding' ),
+ desc: __(
+ 'First time here, where am I?',
+ 'wp-module-onboarding'
+ ),
+ },
+ {
+ title: __( 'Used it some', 'wp-module-onboarding' ),
+ desc: __(
+ "I'll ask for help when I need it",
+ 'wp-module-onboarding'
+ ),
+ },
+ {
+ title: __( 'Expert', 'wp-module-onboarding' ),
+ desc: __(
+ "Stay out of my way, I know what I'm doing",
+ 'wp-module-onboarding'
+ ),
+ },
+ ],
+ skip: __( 'Skip', 'wp-module-onboarding' ),
+ };
+};
+
+export default getContents;
diff --git a/src/OnboardingSPA/steps/SiteGen/Experience/index.js b/src/OnboardingSPA/steps/SiteGen/Experience/index.js
index 1e2d51463..d04bb4628 100644
--- a/src/OnboardingSPA/steps/SiteGen/Experience/index.js
+++ b/src/OnboardingSPA/steps/SiteGen/Experience/index.js
@@ -1,19 +1,35 @@
-import CommonLayout from '../../../components/Layouts/Common';
-
-import { useEffect } from '@wordpress/element';
+import { useNavigate } from 'react-router-dom';
+import { useSelect, useDispatch } from '@wordpress/data';
+import { useEffect, useState } from '@wordpress/element';
-import { useDispatch } from '@wordpress/data';
-import { store as nfdOnboardingStore } from '../../../store';
+import getContents from './contents';
import { HEADER_SITEGEN } from '../../../../constants';
-
-import SiteGenPlaceholder from '../../../components/SiteGenPlaceholder';
+import { store as nfdOnboardingStore } from '../../../store';
+import CommonLayout from '../../../components/Layouts/Common';
+import CardWithOptions from '../../../components/CardWithOptions';
+import SiteGenLoader from '../../../components/Loaders/SiteGenLoader';
const SiteGenExperience = () => {
+ const navigate = useNavigate();
+ const content = getContents();
+ // Index of the selection user makes
+ /* eslint-disable no-unused-vars */
+ const [ selection, setSelection ] = useState();
+
+ const { currentData, nextStep } = useSelect( ( select ) => {
+ return {
+ currentData:
+ select( nfdOnboardingStore ).getCurrentOnboardingData(),
+ nextStep: select( nfdOnboardingStore ).getNextStep(),
+ };
+ } );
+
const {
setIsHeaderEnabled,
setSidebarActiveView,
setHeaderActiveView,
setDrawerActiveView,
+ setCurrentOnboardingData,
} = useDispatch( nfdOnboardingStore );
useEffect( () => {
@@ -21,13 +37,37 @@ const SiteGenExperience = () => {
setSidebarActiveView( false );
setHeaderActiveView( HEADER_SITEGEN );
setDrawerActiveView( false );
+
+ if ( currentData.sitegen.experience?.level ) {
+ setSelection( currentData.sitegen.experience.level );
+ }
} );
+
+ const checkAndNavigate = ( idx ) => {
+ // 0 - Not Selected
+ // 1-2 Options
+ // -1 Skip
+ setSelection( idx );
+ currentData.sitegen.experience.level = idx;
+ setCurrentOnboardingData( currentData );
+ // console.log( selection );
+ // console.log( 'Navigate to the next screen!' );
+ if ( nextStep ) {
+ navigate( nextStep.path );
+ }
+ };
+
return (
-
-
+
+
+
+
+
);
};
diff --git a/src/OnboardingSPA/steps/SiteGen/Experience/stylesheet.scss b/src/OnboardingSPA/steps/SiteGen/Experience/stylesheet.scss
new file mode 100644
index 000000000..ee5e0c38f
--- /dev/null
+++ b/src/OnboardingSPA/steps/SiteGen/Experience/stylesheet.scss
@@ -0,0 +1,6 @@
+.nfd-sg-experience-level {
+ display: flex;
+ align-items: center;
+ flex-direction: column;
+ justify-content: center;
+}
diff --git a/src/OnboardingSPA/steps/SiteGen/SiteDetails/contents.js b/src/OnboardingSPA/steps/SiteGen/SiteDetails/contents.js
new file mode 100644
index 000000000..9fc5fee8b
--- /dev/null
+++ b/src/OnboardingSPA/steps/SiteGen/SiteDetails/contents.js
@@ -0,0 +1,18 @@
+import { __ } from '@wordpress/i18n';
+
+const getContents = () => {
+ return {
+ heading: __(
+ 'Tell me some details about the site you want created?',
+ 'wp-module-onboarding'
+ ),
+ inputPlaceholder: __(
+ 'I want a site for my company that sells…',
+ 'wp-module-onboarding'
+ ),
+ inputHint: __( 'The more detail the better', 'wp-module-onboarding' ),
+ buttonText: __( 'Next', 'wp-module-onboarding' ),
+ };
+};
+
+export default getContents;
diff --git a/src/OnboardingSPA/steps/SiteGen/SiteDetails/index.js b/src/OnboardingSPA/steps/SiteGen/SiteDetails/index.js
index 06fea7cac..efc9db610 100644
--- a/src/OnboardingSPA/steps/SiteGen/SiteDetails/index.js
+++ b/src/OnboardingSPA/steps/SiteGen/SiteDetails/index.js
@@ -1,19 +1,32 @@
-import CommonLayout from '../../../components/Layouts/Common';
-
-import { useEffect } from '@wordpress/element';
+import { useSelect, useDispatch } from '@wordpress/data';
+import { useEffect, useState } from '@wordpress/element';
-import { useDispatch } from '@wordpress/data';
-import { store as nfdOnboardingStore } from '../../../store';
+import getContents from './contents';
+import Animate from '../../../components/Animate';
import { HEADER_SITEGEN } from '../../../../constants';
-
-import SiteGenPlaceholder from '../../../components/SiteGenPlaceholder';
+import { store as nfdOnboardingStore } from '../../../store';
+import AIHeading from '../../../components/Heading/AIHeading';
+import CommonLayout from '../../../components/Layouts/Common';
+import TextInputSiteGen from '../../../components/TextInput/TextInputSiteGen';
+import NextButtonSiteGen from '../../../components/Button/NextButtonSiteGen';
const SiteGenSiteDetails = () => {
+ const content = getContents();
+ const [ customerInput, setCustomerInput ] = useState();
+
+ const { currentData } = useSelect( ( select ) => {
+ return {
+ currentData:
+ select( nfdOnboardingStore ).getCurrentOnboardingData(),
+ };
+ } );
+
const {
setIsHeaderEnabled,
setSidebarActiveView,
setHeaderActiveView,
setDrawerActiveView,
+ setCurrentOnboardingData,
} = useDispatch( nfdOnboardingStore );
useEffect( () => {
@@ -21,13 +34,39 @@ const SiteGenSiteDetails = () => {
setSidebarActiveView( false );
setHeaderActiveView( HEADER_SITEGEN );
setDrawerActiveView( false );
- } );
+
+ if ( currentData.sitegen.siteDetails?.prompt !== '' ) {
+ setCustomerInput( currentData.sitegen.siteDetails.prompt );
+ }
+ }, [] );
+
+ const checkAndNavigate = () => {
+ currentData.sitegen.siteDetails.prompt = customerInput;
+ setCurrentOnboardingData( currentData );
+ // console.log( 'Navigate to the next screen!' );
+ };
+
return (
-
-
+
+
+
+
);
};
diff --git a/src/OnboardingSPA/steps/SiteGen/SiteDetails/stylesheet.scss b/src/OnboardingSPA/steps/SiteGen/SiteDetails/stylesheet.scss
new file mode 100644
index 000000000..dd264c6c3
--- /dev/null
+++ b/src/OnboardingSPA/steps/SiteGen/SiteDetails/stylesheet.scss
@@ -0,0 +1,29 @@
+.nfd-sg-site-details {
+
+ @media (max-width: #{ ($break-small) }) {
+ margin: 20px;
+ }
+
+ &-endrow {
+ width: 100%;
+ display: flex;
+ justify-content: flex-end;
+
+ @media (max-width: #{ ($break-small) }) {
+ justify-content: center;
+ }
+ }
+
+ &--next-btn {
+ width: 100px;
+ color: var(--nfd-onboarding-secondary);
+ font-size: 1rem;
+ padding-left: 24px;
+ background-color: var(--nfd-onboarding-primary);
+ transition: all 300ms ease-in-out;
+
+ &:hover {
+ box-shadow: 5px 5px rgba($color: var(--nfd-onboarding-secondary), $alpha: 0.1);
+ }
+ }
+}
diff --git a/src/OnboardingSPA/steps/SitePages/index.js b/src/OnboardingSPA/steps/SitePages/index.js
index bea7a884e..6cd9986fa 100644
--- a/src/OnboardingSPA/steps/SitePages/index.js
+++ b/src/OnboardingSPA/steps/SitePages/index.js
@@ -4,7 +4,7 @@ import { useLocation } from 'react-router-dom';
import { store as nfdOnboardingStore } from '../../store';
import CommonLayout from '../../components/Layouts/Common';
-import HeadingWithSubHeading from '../../components/HeadingWithSubHeading';
+import HeadingWithSubHeading from '../../components/Heading/HeadingWithSubHeading';
import { getPatterns } from '../../utils/api/patterns';
import {
THEME_STATUS_ACTIVE,
diff --git a/src/OnboardingSPA/steps/TopPriority/index.js b/src/OnboardingSPA/steps/TopPriority/index.js
index 37a66e526..d42ab1621 100644
--- a/src/OnboardingSPA/steps/TopPriority/index.js
+++ b/src/OnboardingSPA/steps/TopPriority/index.js
@@ -6,7 +6,7 @@ import { useDispatch, useSelect } from '@wordpress/data';
import SkipButton from '../../components/SkipButton';
import { store as nfdOnboardingStore } from '../../store';
import CommonLayout from '../../components/Layouts/Common';
-import HeadingWithSubHeading from '../../components/HeadingWithSubHeading';
+import HeadingWithSubHeading from '../../components/Heading/HeadingWithSubHeading';
import SelectableCardList from '../../components/SelectableCardList/selectable-card-list';
import getContents from './contents';
import {
diff --git a/src/OnboardingSPA/styles/_branding.scss b/src/OnboardingSPA/styles/_branding.scss
index 2fc574b70..700b00494 100644
--- a/src/OnboardingSPA/styles/_branding.scss
+++ b/src/OnboardingSPA/styles/_branding.scss
@@ -295,27 +295,35 @@ body {
}
}
- .nfd-onboarding-sitegen-dark {
- --nfd-onboarding-admin-bar-background: #1d2327;
+ .nfd-onboarding-sitegen-light {
+ --nfd-onboarding-primary: #000;
+ --nfd-onboarding-primary-rgb: 0, 0, 0;
+ --nfd-onboarding-hover: #c3c4c7;
+ --nfd-onboarding-secondary: #fff;
+ --nfd-onboarding-secondary-rgb: 255, 255, 255;
--nfd-onboarding-admin-bar-color: #c3c4c7;
+ --nfd-onboarding-shimmer-color: 0, 0, 0;
+ --nfd-onboarding-card-background: #fff;
+ --nfd-onboarding-admin-bar-background: #1d2327;
+ --nfd-onboarding-progress-bar-fill: #0060f0;
+ --nfd-onboarding-progress-bar-background: #d5d5d5;
+ --nfd-onboarding-site-logo-on-drag: rgba(53, 59, 64, 0.3);
--nfd-onboarding-navigation-back-background: rgba(54, 62, 68, 0.35);
+ }
+
+ .nfd-onboarding-sitegen-dark {
--nfd-onboarding-primary: #fff;
--nfd-onboarding-primary-rgb: 255, 255, 255;
+ --nfd-onboarding-hover: #262c30;
--nfd-onboarding-secondary: #000;
- --nfd-onboarding-progress-bar-background: #353a40;
+ --nfd-onboarding-secondary-rgb: 0, 0, 0;
+ --nfd-onboarding-admin-bar-color: #c3c4c7;
+ --nfd-onboarding-card-background: #1d2327;
+ --nfd-onboarding-shimmer-color: 168, 239, 255;
+ --nfd-onboarding-admin-bar-background: #1d2327;
--nfd-onboarding-progress-bar-fill: #0060f0;
- --nfd-onboarding-site-logo-border: rgba(156, 162, 167, 1);
+ --nfd-onboarding-progress-bar-background: #353a40;
--nfd-onboarding-site-logo-on-drag: rgba(156, 162, 167, 0.3);
- }
-
- .nfd-onboarding-sitegen-light {
- --nfd-onboarding-admin-bar-background: #1d2327;
- --nfd-onboarding-admin-bar-color: #c3c4c7;
--nfd-onboarding-navigation-back-background: rgba(54, 62, 68, 0.35);
- --nfd-onboarding-primary: #000;
- --nfd-onboarding-primary-rgb: 0, 0, 0;
- --nfd-onboarding-secondary: #fff;
- --nfd-onboarding-progress-bar-background: #353a40;
- --nfd-onboarding-progress-bar-fill: #0060f0;
}
}
diff --git a/src/OnboardingSPA/styles/_interface.scss b/src/OnboardingSPA/styles/_interface.scss
index 75d7d1265..98b81f65e 100644
--- a/src/OnboardingSPA/styles/_interface.scss
+++ b/src/OnboardingSPA/styles/_interface.scss
@@ -25,6 +25,7 @@ body {
--nfd-onboarding-white: #fff;
--nfd-onboarding-white-rgb: 255, 255, 255;
--nfd-onboarding-black: #000;
+ --nfd-onboarding-black-rgb: 0, 0, 0;
--nfd-onboarding-header-base: var(--nfd-onboarding-light);
--nfd-onboarding-header-contrast: var(--nfd-onboarding-dark);
--nfd-onboarding-content-base: var(--nfd-onboarding-light);
diff --git a/src/OnboardingSPA/styles/app.scss b/src/OnboardingSPA/styles/app.scss
index f6b650597..0dc7d3388 100644
--- a/src/OnboardingSPA/styles/app.scss
+++ b/src/OnboardingSPA/styles/app.scss
@@ -15,13 +15,13 @@
@import "../components/Tooltip/stylesheet";
@import "../components/ImageUploader/components/ImageUploaderWithIcon/stylesheet";
@import "../components/SocialMediaForm/stylesheet";
-@import "../components/TextInput/stylesheet";
+@import "../components/TextInput/TextInputSiteBuild/stylesheet";
@import "../components/ExitToWordPress/stylesheet";
@import "../components/Accordion/stylesheet";
@import "../components/NewfoldLargeCard/stylesheet";
@import "../components/SelectableCard/stylesheet";
@import "../components/SelectableCardList/stylesheet";
-@import "../components/HeadingWithSubHeading/stylesheet";
+@import "../components/Heading/HeadingWithSubHeading/stylesheet";
@import "../components/Button/stylesheet";
@import "../components/CardHeader/stylesheet";
@import "../components/NeedHelpTag/stylesheet";
@@ -52,8 +52,12 @@
@import "../components/Button/ButtonNext/stylesheet";
@import "../components/Loaders/Spinner/stylesheet";
@import "../components/SiteGenPlaceholder/stylesheet";
+@import "../components/Heading/AIHeading/stylesheet";
+@import "../components/TextInput/TextInputSiteGen/stylesheet";
@import "../components/ToggleDarkMode/stylesheet";
@import "../components/Button/NextButtonSiteGen/stylesheet";
+@import "../components/CardWithOptions/stylesheet";
+@import "../components/Loaders/SiteGenLoader/stylesheet";
// CSS for Pages
@import "../steps/BasicInfo/stylesheet";
@@ -69,8 +73,11 @@
@import "../steps/DesignHeaderMenu/stylesheet";
@import "../steps/SiteFeatures/stylesheet";
@import "../steps/TheFork/stylesheet";
+@import "../steps/SiteGen/SiteDetails/stylesheet";
+@import "../steps/SiteGen/Experience/stylesheet";
@import "../steps/SiteGen/SiteLogo/stylesheet";
@import "../steps/SiteGen/Welcome/stylesheet";
+@import "../steps/SiteGen/Building/stylesheet";
.nfd-onboarding-container {
display: flex;