@iroco/ui 0.11.1 → 0.13.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/lib/containers.scss +2 -2
- package/lib/index.js +324 -119
- package/lib/index.min.js +3 -3
- package/lib/index.mjs +324 -120
- package/lib/index.mjs.css +83 -80
- package/package.json +1 -1
- package/src/IconMastodon.svelte +13 -0
- package/src/NavBar.svelte +154 -0
- package/src/Navigation.svelte +17 -13
- package/src/index.ts +2 -1
- package/src/SideBar.svelte +0 -103
package/src/SideBar.svelte
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import IconClose from './IconClose.svelte';
|
|
3
|
-
import type { NavigationItem } from 'definition';
|
|
4
|
-
import { createEventDispatcher } from 'svelte';
|
|
5
|
-
|
|
6
|
-
export let navigationItems: Array<NavigationItem>;
|
|
7
|
-
|
|
8
|
-
let active: string;
|
|
9
|
-
const dispatch = createEventDispatcher();
|
|
10
|
-
|
|
11
|
-
const handleClickLink = (menuItem: NavigationItem) => {
|
|
12
|
-
active = menuItem.name;
|
|
13
|
-
if (typeof menuItem.hrefOrCallback === "function") {
|
|
14
|
-
menuItem.hrefOrCallback()
|
|
15
|
-
return false // to avoid calling href
|
|
16
|
-
}
|
|
17
|
-
dispatch('click_link');
|
|
18
|
-
};
|
|
19
|
-
</script>
|
|
20
|
-
|
|
21
|
-
<nav data-testid="sidebar" class="account__sidebar">
|
|
22
|
-
<button on:click class="account__sidebar__close">
|
|
23
|
-
<IconClose width="3em" height="3em" />
|
|
24
|
-
</button>
|
|
25
|
-
|
|
26
|
-
<ul class="account__sidebar__item_container">
|
|
27
|
-
{#each navigationItems as item}
|
|
28
|
-
<li class="account__sidebar__item" class:active={active === item.name}>
|
|
29
|
-
<a on:click={() => handleClickLink(item)} href={typeof item.hrefOrCallback === 'string' ? item.hrefOrCallback: '#'}> {item.name}</a>
|
|
30
|
-
</li>
|
|
31
|
-
{/each}
|
|
32
|
-
</ul>
|
|
33
|
-
</nav>
|
|
34
|
-
|
|
35
|
-
<style lang="scss">
|
|
36
|
-
@use '../scss/colors';
|
|
37
|
-
@import '../scss/containers';
|
|
38
|
-
|
|
39
|
-
.account__sidebar {
|
|
40
|
-
height: 100%;
|
|
41
|
-
width: 300px;
|
|
42
|
-
position: absolute;
|
|
43
|
-
overflow-x: hidden;
|
|
44
|
-
border-right: 1px solid colors.$mediumGrey;
|
|
45
|
-
&__item_container {
|
|
46
|
-
margin: 0;
|
|
47
|
-
padding: 0;
|
|
48
|
-
width: 100%;
|
|
49
|
-
height: 100%;
|
|
50
|
-
}
|
|
51
|
-
&__item {
|
|
52
|
-
padding: 2em 2em;
|
|
53
|
-
text-decoration: none;
|
|
54
|
-
font-size: 0.75em;
|
|
55
|
-
display: block;
|
|
56
|
-
border-top: 1px solid colors.$mediumGrey;
|
|
57
|
-
border-bottom: 1px solid colors.$mediumGrey a {
|
|
58
|
-
padding-left: 1em;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
&__item a {
|
|
63
|
-
color: colors.$beige;
|
|
64
|
-
font-size: 2em;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
&__close {
|
|
68
|
-
display: none;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.active {
|
|
72
|
-
border-top: 1px solid colors.$green;
|
|
73
|
-
border-bottom: 1px solid colors.$green;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
@include screen-tablet {
|
|
78
|
-
.account__sidebar {
|
|
79
|
-
position: fixed;
|
|
80
|
-
background-color: colors.$darkBlue;
|
|
81
|
-
top: 0;
|
|
82
|
-
right: 0;
|
|
83
|
-
width: 100%;
|
|
84
|
-
padding: 0;
|
|
85
|
-
padding-top: 2em;
|
|
86
|
-
margin: 0;
|
|
87
|
-
border-right: none;
|
|
88
|
-
&__item_container {
|
|
89
|
-
padding: 0em;
|
|
90
|
-
margin-top: 2rem;
|
|
91
|
-
}
|
|
92
|
-
&__close {
|
|
93
|
-
display: block;
|
|
94
|
-
position: absolute;
|
|
95
|
-
right: 0;
|
|
96
|
-
top: 0;
|
|
97
|
-
background-color: transparent;
|
|
98
|
-
border: none;
|
|
99
|
-
color: colors.$darkBeige;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
</style>
|