Skip to content

Commit 07afca8

Browse files
committed
feat: AppNav fragment
1 parent 8fcd64e commit 07afca8

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
};
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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>

0 commit comments

Comments
 (0)