Skip to content

Commit

Permalink
Press2 1570 visual fixes preview editor (#431)
Browse files Browse the repository at this point in the history
* Visual fixes

* Removed DEFAULT colors

* changed customize icon

* added white stroked outline on selected preview

* editor sidebar view all tab fixes

* postioned the loader in the center of viewport

* merged enhance/ai-onboarding

* update package.lock file

* update package.lock file

* removed border on sidebar

* fixed js linting

* removed unsed secondary palatte

* refactored logic for click and mouseover event in sidebar tab

* icon via background image

* fixed lint

---------

Co-authored-by: arunshenoy99 <[email protected]>
  • Loading branch information
ajayadav09 and arunshenoy99 authored Jan 29, 2024
1 parent 8ef143f commit 8cb0d9a
Show file tree
Hide file tree
Showing 23 changed files with 2,457 additions and 2,005 deletions.
4,165 changes: 2,276 additions & 1,889 deletions package-lock.json

Large diffs are not rendered by default.

36 changes: 20 additions & 16 deletions src/OnboardingSPA/components/CardWithOptions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,28 @@ const CardWithOptions = ( { title, options, skip, callback } ) => {
}
} }
>
<div className={ 'nfd-sg-card__data__option__left' }>
<div
className={ 'nfd-sg-card__data__option__left_top' }
>
{ data.title }
</div>
<div
className={
'nfd-sg-card__data__option__left_bottom'
}
>
{ data.desc }
<div className={ 'nfd-sg-card__data__option__wrapper' }>
<div className={ 'nfd-sg-card__data__option__left' }>
<div
className={
'nfd-sg-card__data__option__left_top'
}
>
{ data.title }
</div>
<div
className={
'nfd-sg-card__data__option__left_bottom'
}
>
{ data.desc }
</div>
</div>
<Icon
className={ 'nfd-sg-card__data__option__right' }
icon={ chevronRight }
/>
</div>
<Icon
className={ 'nfd-sg-card__data__option__right' }
icon={ chevronRight }
/>
</div>
);
} );
Expand Down
41 changes: 24 additions & 17 deletions src/OnboardingSPA/components/CardWithOptions/stylesheet.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,43 +18,49 @@ $background-color: var(--nfd-onboarding-card-background);
&__title {
color: var(--nfd-onboarding-primary);
margin: 16px;
line-height: 2;
line-height: 1.5;
font-size: 18px;
text-align: center;
margin-bottom: 30px;
letter-spacing: 1.5px;
font-weight: 400;
letter-spacing: 1.5;
}

&__data {
margin: 12px;

&__option {
display: flex;
cursor: pointer;
margin: 16px 4px;
align-items: center;
border-radius: 4px 4px 0 0;
padding: 16px 12px 16px 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);
&__wrapper {
display: flex;
cursor: pointer;
margin: 16px 4px;
align-items: center;
border-radius: 8px;
padding: 16px 12px 16px 12px;
justify-content: space-between;
transition: background-color 400ms ease-in-out;

&:hover {
background-color: var(--nfd-onboarding-hover);
}
}

&:hover {
background-color: var(--nfd-onboarding-hover);
&:not(:last-child) {
border-bottom: 0.5px solid rgba(var(--nfd-onboarding-primary-rgb), 0.3);
}

&__left_top {
color: var(--nfd-onboarding-primary);
font-size: 16px;
font-size: 15px;
font-weight: 500;
padding-bottom: 12px;
margin-bottom: 7px;
line-height: 24px;
}

&__left_bottom {
color: var(--nfd-onboarding-primary);
color: rgba(var(--nfd-onboarding-primary-rgb), 0.7);

font-size: 14px;
font-weight: 300;
}
Expand All @@ -76,6 +82,7 @@ $background-color: var(--nfd-onboarding-card-background);
margin: 0 20px 6px 20px;
transition: color 200ms ease-in-out;
color: rgba(var(--nfd-onboarding-primary-rgb), 0.8);
font-weight: 500;

&:hover {
color: var(--nfd-onboarding-primary);
Expand Down
4 changes: 1 addition & 3 deletions src/OnboardingSPA/components/ColorPickerButton/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ const ColorPickerButton = ( {
style={ {
backgroundColor: `${ color }`,
} }
>
{ isColorSelected ? <>&#10003;</> : null }
</div>
></div>
<div className="custom-palette__below__row__text">{ name }</div>
</div>
);
Expand Down
4 changes: 0 additions & 4 deletions src/OnboardingSPA/components/Drawer/stylesheet.scss
Original file line number Diff line number Diff line change
Expand Up @@ -479,10 +479,6 @@
align-items: center;
justify-content: center;
border: 1px solid rgba(0, 0, 0, 0.3);

&--selected-border {
box-shadow: 0 0 5px 3px rgba(var(--nfd-onboarding-highlighted--rgb), 0.5);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
padding: 6px 56px 6px 56px;
border-radius: 8px;
gap: 6px;
border: none;
}

&:hover {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ $background-color: var(--nfd-onboarding-card-background);

.nfd-sg-loader {

margin: 8px;
margin-bottom: 8px;
max-width: 90vw;
padding: 16px 12px;
padding: 18px 12px 10px 12px;
border-radius: 12px;
background-color: $background-color;
width: clamp(18.75rem, 22.6136rem + 5.6818vw, 31.25rem);
Expand All @@ -16,16 +16,17 @@ $background-color: var(--nfd-onboarding-card-background);
}

&__title {
line-height: 2;
font-size: 18px;
line-height: 19px;
font-size: 16px;
text-align: center;
letter-spacing: 1.5px;
font-weight: 500;
color: var(--nfd-onboarding-primary);
letter-spacing: 1.5;
}

&__progress {
display: flex;
margin: 20px 60px;
margin: 17px 60px 04px 60px;
align-items: center;
justify-content: center;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,14 @@ import { ColorPalette, Popover } from '@wordpress/components';
import './stylesheet.scss';
import { __ } from '@wordpress/i18n';

const CustomColorPalette = ( {
onChange,
paletteSecondaryColors,
palettePrimaryColors,
} ) => {
const CustomColorPalette = ( { onChange, palettePrimaryColors } ) => {
const [ color, setColor ] = useState( palettePrimaryColors[ 0 ].color );
const baseClassName =
'nfd-onboarding-sidebar--customize__custom-color-palette';
const colors = [
{
colors: palettePrimaryColors,
name: __( 'Primary colors', 'wp-module-onboarding' ),
},
{
colors: paletteSecondaryColors,
name: __( 'Secondary colors', 'wp-module-onboarding' ),
name: __( 'THEME', 'wp-module-onboarding' ),
},
];
const handleColorChange = ( newColor ) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,6 @@ const DesignColorsPanel = ( {
const [ showColorPicker, setShowColorPicker ] = useState( false );
const customPaletteId = colors.length - 1;

const paletteSecondaryColors = Object.entries( colorPalettes[ 1 ] )
.map( ( [ name, color ] ) => {
if ( name !== 'name' ) {
return {
name: __( 'Custom', 'wp-module-onboarding' ),
color,
};
}
return null;
} )
.filter( Boolean );

const handleApplyCustomColors = () => {
setSelectedCustomColors( true );
setIsEditingCustomColors( false );
Expand Down Expand Up @@ -219,7 +207,6 @@ const DesignColorsPanel = ( {
<CustomColorPalette
onChange={ handleColorPicker }
palettePrimaryColors={ palettePrimaryColors }
paletteSecondaryColors={ paletteSecondaryColors }
/>
) }
</div>
Expand Down Expand Up @@ -263,9 +250,9 @@ const DesignColorsPanel = ( {
label={
idx === 0
? __(
'Default',
'wp-module-onboarding'
)
'Default',
'wp-module-onboarding'
)
: ''
}
selectedPalette={ selectedPalette }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,11 @@ const FontGroup = ( {
role="presentation"
onClick={ () => handleGroupSelect( group.id ) }
>
<Dashicon
className={ `${ baseClassName }__font-group__container__button__icon` }
icon={ 'yes-alt' }
size={ 30 }
style={ {
color:
selectedGroup === group.id
? 'var(--nfd-onboarding-sitegen-customize-icon-selected)'
: 'var(--nfd-onboarding-sitegen-customize-grey-1)',
} }
/>
<span
className={ `${ baseClassName }__font-group__container__button__icon${
selectedGroup === group.id ? ` selected` : ``
}` }
></span>
<div
className={ `${ baseClassName }__font-group__container__button__font-name__container` }
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,14 @@
}

&__icon {
width: 24px;
height: 24px;
margin-right: 10px;
background-image: var(--sitegen-sidebar-radio-unchecked);

&.selected {
background-image: var(--sitegen-sidebar-radio-checked);
}
}

&__font-name__container {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,11 +286,6 @@ const SitegenEditorPatternsSidebar = () => {
'wp-module-onboarding'
) }
</p>
<Button
className="nfd-onboarding-sidebar--sitegen-editor-patterns__header__icon"
onClick={ closeSideBar }
icon={ closeSmall }
></Button>
</div>
),
content:
Expand Down Expand Up @@ -358,8 +353,15 @@ const SitegenEditorPatternsSidebar = () => {
},
] }
callback={ setActiveTab }
triggerEvent="click"
></TabPanelHover>
</div>

<Button
className="nfd-onboarding-sidebar--sitegen-editor-patterns__header__icon"
onClick={ closeSideBar }
icon={ closeSmall }
></Button>
</PanelHeader>
{ activeTab &&
homepages &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,18 @@

&__tab-panel {
font-size: 13px;
width: 300px;

.components-tab-panel__tabs-item {

&.is-active {
color: #1e1e1e;
box-shadow: inset 0 0 - ($border-width-tab - 0.5) 0 0 #1e1e1e;
}

&.is-not-active {
box-shadow: none !important;
}
}

&__favorites-tab {
display: flex;
Expand Down Expand Up @@ -68,7 +79,8 @@
height: 140px;
border-radius: 8px;
cursor: pointer;
border: 3px solid #0060f0;
border: 3px solid #fff;
box-shadow: 0 0 0 3px #0060f0;
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/OnboardingSPA/components/Sidebar/stylesheet.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

.nfd-onboarding-sidebar__panel.is-open {
width: $nav-sidebar-width;
border-left: 1px solid var(--nfd-onboarding-sidebar-border-left);

.nfd-onboarding-sidebar__panel-inner,
.interface-interface-skeleton__sidebar {
Expand Down
Loading

0 comments on commit 8cb0d9a

Please sign in to comment.