File tree Expand file tree Collapse file tree 2 files changed +58
-0
lines changed
infrastructure/eid-wallet/src/lib/fragments/AppNav Expand file tree Collapse file tree 2 files changed +58
-0
lines changed Original file line number Diff line number Diff line change 1+ import type { ComponentProps } from "svelte" ;
2+ import AppNav from "./AppNav.svelte" ;
3+
4+ export default {
5+ title : "Fragments/AppNav" ,
6+ component : AppNav ,
7+ tags : [ "autodocs" ] ,
8+ render : ( args : {
9+ Component : AppNav ;
10+ props : ComponentProps < typeof AppNav > ;
11+ } ) => ( {
12+ Component : AppNav ,
13+ props : args ,
14+ } ) ,
15+ } ;
16+
17+ export const Basic = {
18+ args : {
19+ title : "Settings" ,
20+ } ,
21+ } ;
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 { ArrowLeft01Icon , Settings02Icon } from " @hugeicons/core-free-icons" ;
5+ import type { HTMLAttributes } from " svelte/elements" ;
6+ interface IHeroProps extends HTMLAttributes <HTMLElement > {
7+ title? : string ;
8+ titleClasses? : string ;
9+ }
10+ const { title, titleClasses, ... restProps }: IHeroProps = $props ();
11+ const baseClasses = " w-full relative flex justify-center h-14 items-center" ;
12+ </script >
13+
14+ <nav {...restProps } class ={cn (baseClasses , restProps .class )}>
15+ <Button .Icon
16+ icon ={ArrowLeft01Icon }
17+ iconSize =" md"
18+ iconColor ={" black" }
19+ class =" absolute left-2"
20+ onclick ={() => window .history .back ()}
21+ />
22+ <h4 class ={cn (titleClasses )}>
23+ {title }
24+ </h4 >
25+ </nav >
26+
27+ <!--
28+ @component
29+ @name AppNav
30+ @description A component that displays the title of the current page and a back button.
31+ @props
32+ - title: string - The main title to display.
33+ - titleClasses: string - Additional classes to apply to the title element.
34+ @usage
35+ ```svelte
36+ <AppNav title="My Title" />
37+ -->
You can’t perform that action at this time.
0 commit comments