File tree Expand file tree Collapse file tree 16 files changed +574
-180
lines changed
Expand file tree Collapse file tree 16 files changed +574
-180
lines changed Original file line number Diff line number Diff line change 1111@layer base {
1212 /* Typography */
1313 h1 {
14- @apply text-[90px ] text-black font-semibold;
14+ @apply text-[90px ]/ [ 1.5 ] text-black font-semibold;
1515 }
1616
1717 h2 {
18- @apply text-6xl text-black font-semibold;
18+ @apply text-6xl/ [ 1.5 ] text-black font-semibold;
1919 }
2020
2121 h3 {
22- @apply text-3xl text-black font-semibold;
22+ @apply text-3xl/ [ 1.5 ] text-black font-semibold;
2323 }
2424
2525 h4 {
26- @apply text-xl text-black font-semibold;
26+ @apply text-xl/ [ 1.5 ] text-black font-semibold;
2727 }
2828
2929 p {
30- @apply text-base text-black font-normal;
30+ @apply text-base/ [ 1.5 ] text-black font-normal;
3131 }
3232
3333 .small {
34- @apply text-xs text-black font-normal;
34+ @apply text-xs/ [ 1.5 ] text-black font-normal;
3535 }
3636}
3737
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ import type { ComponentProps } from "svelte" ;
2+ import Hero from "./Hero.svelte" ;
3+
4+ export default {
5+ title : "Fragments/Hero" ,
6+ component : Hero ,
7+ tags : [ "autodocs" ] ,
8+ render : ( args : {
9+ Component : Hero ;
10+ props : ComponentProps < typeof Hero > ;
11+ } ) => ( {
12+ Component : Hero ,
13+ props : args ,
14+ } ) ,
15+ } ;
16+
17+ export const Basic = {
18+ args : {
19+ title : "Create PIN" ,
20+ subtitle : "Create a PIN to protect your wallet" ,
21+ } ,
22+ } ;
23+
24+ export const WithSettings = {
25+ args : {
26+ title : "Good morning!" ,
27+ subtitle : "Don't forget to drink water." ,
28+ titleClasses : "-mb-2" ,
29+ showSettings : true ,
30+ } ,
31+ } ;
Original file line number Diff line number Diff line change 1+ <script lang =" ts" >
2+ import * as Button from " $lib/ui/Button" ;
3+ import { cn } from " $lib/utils" ;
4+ import { Settings02Icon } from " @hugeicons/core-free-icons" ;
5+ import type { HTMLAttributes } from " svelte/elements" ;
6+
7+ interface IHeroProps extends HTMLAttributes <HTMLElement > {
8+ title? : string ;
9+ subtitle? : string ;
10+ showSettings? : boolean ;
11+ titleClasses? : string ;
12+ }
13+ const {
14+ title,
15+ subtitle,
16+ showSettings = false ,
17+ titleClasses,
18+ children,
19+ ... restProps
20+ }: IHeroProps = $props ();
21+ const baseClasses = " w-full flex justify-between items-center" ;
22+ </script >
23+
24+ <header {...restProps } class ={cn (baseClasses , restProps .class )}>
25+ <div class =" flex flex-col items-start" >
26+ <h3 class ={cn (titleClasses )}>
27+ {@render children ?.()}
28+ {title }
29+ </h3 >
30+ {#if subtitle }
31+ <p class ="text-black-700 mt-2" >{subtitle }</p >
32+ {/if }
33+ </div >
34+ {#if showSettings }
35+ <Button .Nav href =" /settings" >
36+ <Button .Icon
37+ icon ={Settings02Icon }
38+ iconSize =" lg"
39+ />
40+ </Button .Nav >
41+ {:else }
42+ <span aria-hidden =" true" ></span >
43+ {/if }
44+ </header >
45+
46+ <!--
47+ @component
48+ @name Hero
49+ @description A component that displays a header with a title, subtitle, and optional settings icon.
50+ @props
51+ - title: string - The main title to display.
52+ - subtitle: string - An optional subtitle to display below the title.
53+ - showSettings: boolean - A flag to determine if the settings icon should be displayed.
54+ - titleClasses: string - Additional classes to apply to the title element.
55+ - children: Snippet - Optional child elements to render within the title.
56+ @slots
57+ - default - Slot for additional content to be rendered within the title.
58+ @usage
59+ ```svelte
60+ <Hero
61+ title="Good morning!"
62+ subtitle="Don't forget to drink water."
63+ class="mb-8"
64+ titleClasses="-mb-2"
65+ showSettings
66+ >
67+ </Hero>
68+ ```
69+ -->
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ $effect(() => {
4141});
4242 </script >
4343
44- <div {...restProps } class ="relative {variant === ' eName' ? " bg-black-900" : variant === ' ePassport' ? " bg-primary" : " bg-gray" } rounded-xl w-full min-h-[150px] text-white overflow-hidden" >
44+ <div {...restProps } class ="relative {variant === ' eName' ? " bg-black-900" : variant === ' ePassport' ? " bg-primary" : " bg-gray" } rounded-3xl w-full min-h-[150px] text-white overflow-hidden" >
4545 <div class =" w-full h-full pointer-events-none flex gap-13 justify-end absolute right-15 bottom-20" >
4646 <div class ="w-10 {variant === ' eVault' ? " bg-white/40" : " bg-white/10" } h-[300%] rotate-40" ></div >
4747 <div class ="w-10 {variant === ' eVault' ? " bg-white/40" : " bg-white/10" } h-[300%] rotate-40" ></div >
Original file line number Diff line number Diff line change 1- export { default as Header } from "./Header/Header .svelte" ;
1+ export { default as Hero } from "./Hero/Hero .svelte" ;
22export { default as IdentityCard } from "./IdentityCard/IdentityCard.svelte" ;
33export { default as SettingsNavigationBtn } from "./SettingsNavigationBtn/SettingsNavigationBtn.svelte" ;
Original file line number Diff line number Diff line change 11<script lang =" ts" >
2+ import { Hero } from " $lib/fragments" ;
23import IdentityCard from " $lib/fragments/IdentityCard/IdentityCard.svelte" ;
34import { ButtonAction } from " $lib/ui" ;
45
@@ -20,8 +21,11 @@ const handleFinish = async () => {};
2021 }}/>
2122 </section >
2223 <section class =" mt-[4vh] mb-[9vh]" >
23- <h4 class =" mb-[0.5vh]" >Your eVault</h4 >
24- <p class =" text-black-700 mb-[3vh]" >We’ve also created your eVault—secure cloud storage for your personal data. W3DS platforms access it directly, keeping you in control.</p >
24+ <Hero
25+ title =" Your ePassport and eVault are ready"
26+ subtitle =" Log into any W3DS platform without passwords. It’s tied to this phone; if lost, you’ll need to revoke and reissue it on a new device."
27+ class =" mb-2"
28+ />
2529 <IdentityCard variant = " eVault"
2630 usedStorage = {15}
2731 totalStorage = {80}/>
Original file line number Diff line number Diff line change 11<script lang =" ts" >
22import { goto } from " $app/navigation" ;
3+ import { Hero } from " $lib/fragments" ;
34import { ButtonAction , Drawer } from " $lib/ui" ;
45
56let isPaneOpen = $state (false );
@@ -20,10 +21,15 @@ const handleNext = async () => {
2021 <img class =" aspect-square w-full object-cover" src =" /images/Onboarding.svg" alt =" Infographic card" >
2122 </article >
2223 <section class =" mb-[9.3vh]" >
23- <h2 class =" text-[42px]/[1] font-medium mb-[1vh]" >Your <br >
24+ <Hero
25+ subtitle =" Store your IDs, verify instantly with QR codes, and manage your digital identity with ease."
26+ class =" mb-4"
27+ titleClasses =" text-[42px]/[1.1] font-medium"
28+ >
29+ Your <br >
2430 Digital Identity,
25- Secured</ h2 >
26- <p class = " text-black-700 " >Store your IDs, verify instantly with QR codes, and manage your digital identity with ease.</ p >
31+ Secured
32+ </ Hero >
2733 </section >
2834 <section >
2935 <p class =" max-w-[300px] mx-[auto] text-center small text-black-500" >By continuing you agree to our <a href =" /" class =" text-primary underline underline-offset-5" >Terms & Conditions </a > and <a href =" /" class =" text-primary underline underline-offset-5" >privacy policy.</a ></p >
Original file line number Diff line number Diff line change 11<script lang =" ts" >
22import { goto } from " $app/navigation" ;
3+ import { Hero } from " $lib/fragments" ;
34import { ButtonAction , Drawer , InputPin } from " $lib/ui" ;
45import { CircleLock01Icon , FaceIdIcon } from " @hugeicons/core-free-icons" ;
56import { HugeiconsIcon } from " @hugeicons/svelte" ;
@@ -55,17 +56,23 @@ $effect(() => {
5556{#if firstStep }
5657 <main class =" h-screen pt-[5.2vh] px-[5vw] pb-[4.5vh] flex flex-col justify-between" >
5758 <section >
58- <h3 class =" mb-[1vh]" >Create a pin</h3 >
59- <p class =" text-black-700 mb-[14vh]" >Enter a 4-digit PIN code</p >
59+ <Hero
60+ title =" Create a pin"
61+ subtitle =" Enter a 4-digit PIN code"
62+ class =" mb-[14vh]"
63+ />
6064 <InputPin bind:pin />
6165 </section >
6266 <ButtonAction class ="w-full" variant ="soft" callback ={handleFirstStep }>Confirm</ButtonAction >
6367 </main >
6468{:else }
6569 <main class =" h-screen pt-[5.2vh] px-[5vw] pb-[4.5vh] flex flex-col justify-between" >
6670 <section >
67- <h3 class =" mb-[1vh]" >Re-enter your pin</h3 >
68- <p class =" text-black-700 mb-[14vh]" >Confirm by entering pin again</p >
71+ <Hero
72+ title =" Re-enter your pin"
73+ subtitle =" Confirm by entering pin again"
74+ class =" mb-[14vh]"
75+ />
6976 <InputPin bind:pin ={repeatPin } {isError }/>
7077 <p class ={` text-danger mt-[3.4vh] ${isError ? " block" : " hidden" } ` }>Your PIN does not match, try again.</p >
7178 </section >
You can’t perform that action at this time.
0 commit comments