diff --git a/src/app/component-library/components/button/button.component.html b/src/app/component-library/components/button/button.component.html index f076e6388..71b719dbc 100644 --- a/src/app/component-library/components/button/button.component.html +++ b/src/app/component-library/components/button/button.component.html @@ -1,12 +1,13 @@ diff --git a/src/app/component-library/components/button/button.component.scss b/src/app/component-library/components/button/button.component.scss index b8c7ea124..43c8095d1 100644 --- a/src/app/component-library/components/button/button.component.scss +++ b/src/app/component-library/components/button/button.component.scss @@ -1,24 +1,32 @@ /* @format */ @import 'variables'; -@mixin darkButton { - background-color: rgba(19, 27, 74, 1); - border: 1px solid rgba(19, 27, 74, 1); +@mixin darkButton($isLink: false) { + background-color: rgba(255, 255, 255, 0); + border: 1px solid rgba(255, 255, 255, 0.32); & > .button-text { color: white; margin: 0; @include bodyMedium; + + @if $isLink { + font-size: 14px; + } } } -@mixin lightButton { +@mixin lightButton($isLink: false) { background-color: $white; border: 1px solid rgba(184, 187, 201, 1); & > .button-text { color: rgba(19, 27, 74, 1); margin: 0; @include bodyMedium; + + @if $isLink { + font-size: 14px; + } } & > .icon { @@ -27,6 +35,11 @@ } .button { + &:disabled { + cursor: not-allowed; + opacity: 0.5; + } + &:focus { outline: none; } @@ -53,8 +66,10 @@ &-primary { &.button-light { - //the button on a white background will be blue @include darkButton(); + &:focus { + border: 2px solid white; + } } &.button-dark { @include lightButton(); @@ -64,6 +79,9 @@ &-secondary { &.button-light { @include lightButton(); + &:focus { + border: 2px solid black; + } } &.button-dark { @include darkButton(); @@ -88,8 +106,12 @@ &-fill { width: 100%; - padding: 0px 24px; + padding: 12px 24px; height: 56px; + justify-content: space-between; + &-no-icon { + justify-content: center; + } } &-fill.button-large { @@ -101,4 +123,26 @@ margin: 0; @include bodyMedium; } + + &-link { + margin-left: 4px; + padding: 0px; + &.button-dark { + @include darkButton(true); + font-size: 14px; + border: 1px solid transparent; + } + &.button-light { + @include lightButton(true); + font-size: 14px; + border: 1px solid transparent; + } + + &:focus { + outline: none; + background-color: #e0e0e0; + box-shadow: 0 0 0 3px rgba(21, 156, 228, 0.4); + border-color: #159ce4; + } + } } diff --git a/src/app/component-library/components/button/button.component.spec.ts b/src/app/component-library/components/button/button.component.spec.ts index 5a6566fc4..f8808207d 100644 --- a/src/app/component-library/components/button/button.component.spec.ts +++ b/src/app/component-library/components/button/button.component.spec.ts @@ -105,12 +105,12 @@ describe('ButtonComponent', () => { expect(button.nativeElement.type).toEqual('button'); - instance.attr = 'submit'; + instance.buttonType = 'submit'; fixture.detectChanges(); expect(button.nativeElement.type).toEqual('submit'); - instance.attr = 'reset'; + instance.buttonType = 'reset'; fixture.detectChanges(); expect(button.nativeElement.type).toEqual('reset'); diff --git a/src/app/component-library/components/button/button.component.ts b/src/app/component-library/components/button/button.component.ts index 4cbf7ce9c..9314a64bd 100644 --- a/src/app/component-library/components/button/button.component.ts +++ b/src/app/component-library/components/button/button.component.ts @@ -1,12 +1,12 @@ /* @format */ import { Component, EventEmitter, Input, Output } from '@angular/core'; -type VARIANT = 'primary' | 'secondary' | 'tertiary'; +type VARIANT = 'primary' | 'secondary' | 'tertiary' | 'link'; type MODE = 'light' | 'dark'; type SIZE = 'hug' | 'fill'; type ORIENTATION = 'left' | 'right'; type HEIGHT = 'medium' | 'large'; -type ATTR = 'submit' | 'reset' | 'button'; +type TYPE = 'submit' | 'reset' | 'button'; @Component({ selector: 'pr-button', @@ -15,7 +15,6 @@ type ATTR = 'submit' | 'reset' | 'button'; }) export class ButtonComponent { //Inputs - @Input() text: string = ''; @Input() variant: VARIANT = 'primary'; @Input() height: HEIGHT = 'medium'; @Input() mode: MODE = 'light'; @@ -24,7 +23,7 @@ export class ButtonComponent { @Input() icon: string = ''; @Input() orientation: ORIENTATION = 'left'; @Input() faIcon: string = ''; - @Input() attr: ATTR = 'button'; + @Input() buttonType: TYPE = 'button'; //Outputs @Output() buttonClick = new EventEmitter(); diff --git a/src/app/component-library/components/form-input/form-input.component.html b/src/app/component-library/components/form-input/form-input.component.html index 26c5789a8..37ba60d9d 100644 --- a/src/app/component-library/components/form-input/form-input.component.html +++ b/src/app/component-library/components/form-input/form-input.component.html @@ -1,7 +1,7 @@
@@ -14,15 +14,18 @@ >
{{ errors }} diff --git a/src/app/component-library/components/form-input/form-input.component.scss b/src/app/component-library/components/form-input/form-input.component.scss index 4c47eea5e..ec4d4ab8b 100644 --- a/src/app/component-library/components/form-input/form-input.component.scss +++ b/src/app/component-library/components/form-input/form-input.component.scss @@ -13,9 +13,13 @@ line-height: 24px; font-weight: 600; border: 1px solid $form-border; - padding: 12px; + padding: 14px 24px 14px 24px; height: 48px; + &-with-text { + padding: 28px 24px 14px 24px; + } + &-light.form-input-errors { background-color: $form-background-error; border: 1px solid $form-border-error; @@ -41,7 +45,7 @@ } &-dark { - background-color: $form-background-dark; + background: rgba(255, 255, 255, 0.08); opacity: 0.8; color: white; border: 1px solid transparent; @@ -62,8 +66,8 @@ font-size: 10px; font-weight: 400; text-transform: uppercase; - left: 12px; - top: 4px; + left: 24px; + top: 7px; &-dark { color: $form-label-dark; } diff --git a/src/app/component-library/components/form-input/form-input.component.ts b/src/app/component-library/components/form-input/form-input.component.ts index 99ee179f2..fda7726da 100644 --- a/src/app/component-library/components/form-input/form-input.component.ts +++ b/src/app/component-library/components/form-input/form-input.component.ts @@ -32,7 +32,7 @@ export interface FormInputConfig { } @Component({ - selector: 'pr-form-input-comp', + selector: 'pr-form-input-glam', templateUrl: './form-input.component.html', styleUrls: ['./form-input.component.scss'], }) @@ -48,6 +48,8 @@ export class FormInputComponent implements OnInit, AfterViewInit { message: string; value?: number | string; }[] = []; + @Input() styling = {}; + @Input() hideLabel: boolean = false; @HostBinding('class.right-align') rightAlign = false; @HostBinding('class.input-vertical') inputVertical = true; @@ -157,7 +159,7 @@ export class FormInputComponent implements OnInit, AfterViewInit { inputField.setAttribute('spellcheck', this.config.spellcheck); } - if ((this.config.autoselect && this.control.value) || this.value) { + if (this.config.autoselect && (this.control.value || this.value)) { inputField.addEventListener('focus', (event) => { inputField.setSelectionRange(0, inputField.value.length); }); diff --git a/src/app/onboarding/components/archive-creation-start-screen/archive-creation-start-screen.component.html b/src/app/onboarding/components/archive-creation-start-screen/archive-creation-start-screen.component.html new file mode 100644 index 000000000..41ffec6d9 --- /dev/null +++ b/src/app/onboarding/components/archive-creation-start-screen/archive-creation-start-screen.component.html @@ -0,0 +1,38 @@ + +
+

+ Hello, {{ name }}. +

+

Welcome to Permanent!

+
+
+
+

We’re so glad you’re here!

+

+ At Permanent, it is our mission to provide a safe and secure place to + store, preserve, and share the digital legacy of all people, whether + that's for you or for your friends, family, interests or organizations. +

+

+ We know that starting this journey can sometimes be overwhelming, but + don’t worry. We’re here to help you every step of the way. +

+
+
+ Create archive for me + Get started +
+
diff --git a/src/app/onboarding/components/archive-creation-start-screen/archive-creation-start-screen.component.scss b/src/app/onboarding/components/archive-creation-start-screen/archive-creation-start-screen.component.scss new file mode 100644 index 000000000..ef80dd772 --- /dev/null +++ b/src/app/onboarding/components/archive-creation-start-screen/archive-creation-start-screen.component.scss @@ -0,0 +1,60 @@ +/* @format */ +@import 'fonts'; + +:host { + display: flex; + flex-direction: row; + justify-content: space-evenly; + gap: 64px; + margin-top: 64px; + + @media screen and (max-width: 600px) { + flex-direction: column; + } + + @media screen and (min-width: 602px) and (max-width: 900px) { + height: 100vh; + } + + @media screen and (max-width: 364px) { + height: 106vh; + } +} + +p { + color: white; +} + +.greetings-container { + width: 50%; + + @media screen and (max-width: 600px) { + width: 100%; + } + & > p { + font-size: 50px; + font-family: 'UsualRegular', sans-serif; + } +} + +.text-buttons-container { + flex-direction: column; + justify-content: space-between; + width: 50%; + display: flex; + height: 75vh; + + @media screen and (max-width: 600px) { + height: 60vh; + } + + & > .text > p { + font-size: 16px; + font-family: 'UsualLight', sans-serif; + } + + & > .buttons { + display: flex; + gap: 32px; + } +} diff --git a/src/app/onboarding/components/archive-creation-start-screen/archive-creation-start-screen.component.spec.ts b/src/app/onboarding/components/archive-creation-start-screen/archive-creation-start-screen.component.spec.ts new file mode 100644 index 000000000..01045624b --- /dev/null +++ b/src/app/onboarding/components/archive-creation-start-screen/archive-creation-start-screen.component.spec.ts @@ -0,0 +1,67 @@ +/* @format */ +import { Shallow } from 'shallow-render'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { AccountService } from '@shared/services/account/account.service'; +import { By } from '@angular/platform-browser'; +import { OnboardingModule } from '../../onboarding.module'; +import { ArchiveCreationStartScreenComponent } from './archive-creation-start-screen.component'; + +const mockAccountService = { + getAccount: () => ({ fullName: 'John Doe' }), +}; + +describe('ArchiveCreationStartScreenComponent', () => { + let shallow: Shallow; + + beforeEach(() => { + shallow = new Shallow(ArchiveCreationStartScreenComponent, OnboardingModule) + .mock(AccountService, mockAccountService) + .import(HttpClientTestingModule); + }); + + it('should create', async () => { + const { instance } = await shallow.render(); + + expect(instance).toBeTruthy(); + }); + + it('should initialize with the account name', async () => { + const { instance } = await shallow.render(); + + expect(instance.name).toBe('John Doe'); + }); + + it('should render the account name in the greeting', async () => { + const { fixture } = await shallow.render(); + const greetingElement = fixture.debugElement.query( + By.css('.greetings-container b'), + ).nativeElement; + + expect(greetingElement.textContent).toContain('John Doe'); + }); + + it('should emit getStartedOutput event when Get Started button is clicked', async () => { + const { fixture, instance, outputs } = await shallow.render(); + spyOn(instance, 'getStarted').and.callThrough(); + + const getStartedButton = fixture.debugElement.query(By.css('.get-started')); + + getStartedButton.triggerEventHandler('buttonClick', null); + + expect(instance.getStarted).toHaveBeenCalled(); + expect(outputs.getStartedOutput.emit).toHaveBeenCalled(); + }); + + it('should emit createArchiveForMeOutput event when Create Archive for Me button is clicked', async () => { + const { fixture, instance, outputs } = await shallow.render(); + spyOn(instance, 'createArchiveForMe').and.callThrough(); + + const createArchiveButton = fixture.debugElement.query( + By.css('.create-archive-for-me'), + ); + createArchiveButton.triggerEventHandler('buttonClick', null); + + expect(instance.createArchiveForMe).toHaveBeenCalled(); + expect(outputs.createArchiveForMeOutput.emit).toHaveBeenCalled(); + }); +}); diff --git a/src/app/onboarding/components/archive-creation-start-screen/archive-creation-start-screen.component.ts b/src/app/onboarding/components/archive-creation-start-screen/archive-creation-start-screen.component.ts new file mode 100644 index 000000000..a242311b3 --- /dev/null +++ b/src/app/onboarding/components/archive-creation-start-screen/archive-creation-start-screen.component.ts @@ -0,0 +1,25 @@ +import { Component, Output, EventEmitter } from '@angular/core'; +import { AccountService } from '@shared/services/account/account.service'; + +@Component({ + selector: 'pr-archive-creation-start-screen', + templateUrl: './archive-creation-start-screen.component.html', + styleUrl: './archive-creation-start-screen.component.scss', +}) +export class ArchiveCreationStartScreenComponent { + @Output() public getStartedOutput = new EventEmitter(); + @Output() public createArchiveForMeOutput = new EventEmitter(); + public name: string = ''; + + constructor(private account: AccountService) { + this.name = this.account.getAccount().fullName; + } + + public getStarted() { + this.getStartedOutput.emit(); + } + + public createArchiveForMe(): void { + this.createArchiveForMeOutput.emit(); + } +} diff --git a/src/app/onboarding/components/create-new-archive/create-new-archive.component.html b/src/app/onboarding/components/create-new-archive/create-new-archive.component.html index ecd0d5720..ecdb628e4 100644 --- a/src/app/onboarding/components/create-new-archive/create-new-archive.component.html +++ b/src/app/onboarding/components/create-new-archive/create-new-archive.component.html @@ -1,8 +1,13 @@