diff --git a/infrastructure/eid-wallet/src/lib/fragments/SettingsNavigationBtn/SettingsNavigationBtn.stories.snippet.svelte b/infrastructure/eid-wallet/src/lib/fragments/SettingsNavigationBtn/SettingsNavigationBtn.stories.snippet.svelte deleted file mode 100644 index 95907a7c..00000000 --- a/infrastructure/eid-wallet/src/lib/fragments/SettingsNavigationBtn/SettingsNavigationBtn.stories.snippet.svelte +++ /dev/null @@ -1,10 +0,0 @@ - - -{#snippet icon()} - -{/snippet} diff --git a/infrastructure/eid-wallet/src/lib/fragments/SettingsNavigationBtn/SettingsNavigationBtn.stories.ts b/infrastructure/eid-wallet/src/lib/fragments/SettingsNavigationBtn/SettingsNavigationBtn.stories.ts index 6e4c6b88..b5f5edb7 100644 --- a/infrastructure/eid-wallet/src/lib/fragments/SettingsNavigationBtn/SettingsNavigationBtn.stories.ts +++ b/infrastructure/eid-wallet/src/lib/fragments/SettingsNavigationBtn/SettingsNavigationBtn.stories.ts @@ -1,12 +1,15 @@ -import type { Snippet } from "svelte"; -import { icon } from "./SettingsNavigationBtn.stories.snippet.svelte"; +import { LanguageSquareIcon } from "@hugeicons/core-free-icons"; +import type { ComponentProps } from "svelte"; import SettingsNavigationBtn from "./SettingsNavigationBtn.svelte"; export default { title: "Fragments/SettingsNavigationBtn", component: SettingsNavigationBtn, tags: ["autodocs"], - render: (args: { icon: Snippet; label: string; onClick: () => void }) => ({ + render: (args: { + Component: SettingsNavigationBtn; + props: ComponentProps; + }) => ({ Component: SettingsNavigationBtn, props: args, }), @@ -14,8 +17,8 @@ export default { export const Primary = { args: { - icon: icon, + icon: LanguageSquareIcon, label: "Language", - onClick: () => alert("asdf"), + href: "#", }, }; diff --git a/infrastructure/eid-wallet/src/lib/fragments/SettingsNavigationBtn/SettingsNavigationBtn.svelte b/infrastructure/eid-wallet/src/lib/fragments/SettingsNavigationBtn/SettingsNavigationBtn.svelte index 9b6977d8..0eb4f6d8 100644 --- a/infrastructure/eid-wallet/src/lib/fragments/SettingsNavigationBtn/SettingsNavigationBtn.svelte +++ b/infrastructure/eid-wallet/src/lib/fragments/SettingsNavigationBtn/SettingsNavigationBtn.svelte @@ -1,25 +1,25 @@ -
+
-
- {@render icon?.()} +
+

{label}

-
\ No newline at end of file +
\ No newline at end of file diff --git a/infrastructure/eid-wallet/src/lib/ui/Button/Button.stories.snippet.svelte b/infrastructure/eid-wallet/src/lib/ui/Button/Button.stories.snippet.svelte index e22e3596..b626e0f4 100644 --- a/infrastructure/eid-wallet/src/lib/ui/Button/Button.stories.snippet.svelte +++ b/infrastructure/eid-wallet/src/lib/ui/Button/Button.stories.snippet.svelte @@ -1,7 +1,24 @@ {#snippet ButtonText()} Button {/snippet} + +{#snippet ButtonNavText()} + Nav Button +{/snippet} + +{#snippet ButtonNavSettings()} +
+
+ +
+

Settings

+
+ +{/snippet} \ No newline at end of file diff --git a/infrastructure/eid-wallet/src/lib/ui/Button/ButtonIcon.svelte b/infrastructure/eid-wallet/src/lib/ui/Button/ButtonIcon.svelte index d99183a7..0fd927da 100644 --- a/infrastructure/eid-wallet/src/lib/ui/Button/ButtonIcon.svelte +++ b/infrastructure/eid-wallet/src/lib/ui/Button/ButtonIcon.svelte @@ -27,7 +27,6 @@ const { icon, iconSize = undefined, isActive = false, - children = undefined, ...restProps }: IButtonProps = $props(); diff --git a/infrastructure/eid-wallet/src/lib/ui/Button/ButtonNav.stories.ts b/infrastructure/eid-wallet/src/lib/ui/Button/ButtonNav.stories.ts new file mode 100644 index 00000000..7c844501 --- /dev/null +++ b/infrastructure/eid-wallet/src/lib/ui/Button/ButtonNav.stories.ts @@ -0,0 +1,31 @@ +import type { ComponentProps } from "svelte"; +import { + ButtonNavSettings, + ButtonNavText, +} from "./Button.stories.snippet.svelte"; +import ButtonNav from "./ButtonNav.svelte"; + +export default { + title: "UI/ButtonNav", + component: ButtonNav, + tags: ["autodocs"], + render: (args: { + Component: ButtonNav; + props: ComponentProps; + }) => ({ + Component: ButtonNav, + props: args, + }), +}; + +export const Default = { + args: { href: "#", children: ButtonNavText }, +}; + +export const ForSettings = { + args: { + href: "#", + children: ButtonNavSettings, + class: "flex items-center justify-between px-3 py-2", + }, +}; diff --git a/infrastructure/eid-wallet/src/lib/ui/Button/ButtonNav.svelte b/infrastructure/eid-wallet/src/lib/ui/Button/ButtonNav.svelte new file mode 100644 index 00000000..6d09ae92 --- /dev/null +++ b/infrastructure/eid-wallet/src/lib/ui/Button/ButtonNav.svelte @@ -0,0 +1,40 @@ + + + + {@render children()} + + + \ No newline at end of file diff --git a/infrastructure/eid-wallet/src/lib/ui/Button/index.ts b/infrastructure/eid-wallet/src/lib/ui/Button/index.ts index be977c6c..f6adf300 100644 --- a/infrastructure/eid-wallet/src/lib/ui/Button/index.ts +++ b/infrastructure/eid-wallet/src/lib/ui/Button/index.ts @@ -1,4 +1,5 @@ import Action from "./ButtonAction.svelte"; import Icon from "./ButtonIcon.svelte"; +import Nav from "./ButtonNav.svelte"; -export { Action, Icon }; +export { Action, Icon, Nav };