@iroco/ui 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/NavBar.svelte
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { IconClose } from './index';
|
|
3
3
|
import { createEventDispatcher } from 'svelte';
|
|
4
|
-
import {
|
|
4
|
+
import { NavigationItem, NavigationItemType } from './definition.js';
|
|
5
5
|
import type { MouseEventHandler } from 'svelte/elements';
|
|
6
6
|
|
|
7
7
|
interface Props {
|
|
8
8
|
navigationItems: Array<NavigationItem>;
|
|
9
9
|
type: 'sidebar' | 'topbar';
|
|
10
10
|
version?: string | null;
|
|
11
|
-
navigating?: {
|
|
11
|
+
navigating?: {
|
|
12
|
+
to: {
|
|
13
|
+
params: Record<string, string> | null
|
|
14
|
+
route: { id: string | null }
|
|
15
|
+
url: URL
|
|
16
|
+
} | null
|
|
17
|
+
} | null;
|
|
12
18
|
onclick?: MouseEventHandler<HTMLButtonElement>;
|
|
13
19
|
}
|
|
14
20
|
|
|
@@ -31,7 +37,7 @@
|
|
|
31
37
|
return false;
|
|
32
38
|
}
|
|
33
39
|
|
|
34
|
-
let active = $derived(navigating?.to
|
|
40
|
+
let active = $derived(navigating?.to?.url.pathname ?? '');
|
|
35
41
|
</script>
|
|
36
42
|
|
|
37
43
|
<nav data-testid={type} class="nav__{type}">
|
|
@@ -41,7 +47,7 @@
|
|
|
41
47
|
|
|
42
48
|
<ul class="nav__{type}__item-container">
|
|
43
49
|
{#each navigationItems as item}
|
|
44
|
-
<li class="nav__{type}__item" class:active={isActive(active, item)}>
|
|
50
|
+
<li class="nav__{type}__item" class:active={isActive(active, item)} aria-current={isActive(active, item)}>
|
|
45
51
|
{#if item.type === NavigationItemType.FORM}
|
|
46
52
|
<form method="POST" action={item.hrefOrCallback}>
|
|
47
53
|
<button class="iroco-ui-link" type="submit">{item.name}</button>
|
package/dist/NavBar.svelte.d.ts
CHANGED
|
@@ -6,10 +6,12 @@ interface Props {
|
|
|
6
6
|
version?: string | null;
|
|
7
7
|
navigating?: {
|
|
8
8
|
to: {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
params: Record<string, string> | null;
|
|
10
|
+
route: {
|
|
11
|
+
id: string | null;
|
|
11
12
|
};
|
|
12
|
-
|
|
13
|
+
url: URL;
|
|
14
|
+
} | null;
|
|
13
15
|
} | null;
|
|
14
16
|
onclick?: MouseEventHandler<HTMLButtonElement>;
|
|
15
17
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iroco/ui",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Iroco design system based on Svelte",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"format": "prettier --plugin-search-dir . --write .",
|
|
17
17
|
"clean": "rm -rf dist && npm cache clean --force",
|
|
18
18
|
"release": "npm run format && npm run build && release-it --only-version",
|
|
19
|
-
"build-storybook": "storybook build"
|
|
19
|
+
"build-storybook": "storybook build --output-dir docs"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@ljcl/storybook-addon-cssprops": "^4.0.0",
|