@iroco/ui 0.13.0 → 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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/NavBar.svelte +36 -14
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iroco/ui",
3
- "version": "0.13.0",
3
+ "version": "0.13.1",
4
4
  "description": "Iroco design system based on Svelte",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.mjs",
package/src/NavBar.svelte CHANGED
@@ -11,15 +11,15 @@
11
11
 
12
12
  const handleClickLink = (menuItem: NavigationItem) => {
13
13
  active = menuItem.name;
14
- if (typeof menuItem.hrefOrCallback === "function") {
15
- menuItem.hrefOrCallback()
16
- return false // to avoid calling href
14
+ if (typeof menuItem.hrefOrCallback === 'function') {
15
+ menuItem.hrefOrCallback();
16
+ return false; // to avoid calling href
17
17
  }
18
18
  dispatch('click_link');
19
19
  };
20
20
  </script>
21
21
 
22
- <nav data-testid={type} class='nav__{type}'>
22
+ <nav data-testid={type} class="nav__{type}">
23
23
  <button on:click class="nav__{type}__close">
24
24
  <IconClose width="3em" height="3em" />
25
25
  </button>
@@ -27,7 +27,12 @@
27
27
  <ul class="nav__{type}__item-container">
28
28
  {#each navigationItems as item}
29
29
  <li class="nav__{type}__item" class:active={active === item.name}>
30
- <a on:click={() => handleClickLink(item)} href={typeof item.hrefOrCallback === 'string' ? item.hrefOrCallback: '#'}> {item.name}</a>
30
+ <a
31
+ on:click={() => handleClickLink(item)}
32
+ href={typeof item.hrefOrCallback === 'string' ? item.hrefOrCallback : '#'}
33
+ >
34
+ {item.name}</a
35
+ >
31
36
  </li>
32
37
  {/each}
33
38
  </ul>
@@ -38,7 +43,8 @@
38
43
  @import '../scss/containers';
39
44
 
40
45
  .nav {
41
- &__sidebar, &__topbar {
46
+ &__sidebar,
47
+ &__topbar {
42
48
  &__item {
43
49
  text-decoration: none;
44
50
  font-size: 0.75em;
@@ -57,9 +63,11 @@
57
63
  height: 100%;
58
64
  width: 300px;
59
65
  position: absolute;
66
+ top: 4.45em;
67
+ left: 0;
60
68
  overflow-x: hidden;
61
69
  border-right: 1px solid colors.$mediumGrey;
62
- &__item_container {
70
+ &__item-container {
63
71
  margin: 0;
64
72
  padding: 0;
65
73
  width: 100%;
@@ -69,6 +77,9 @@
69
77
  padding: 2em;
70
78
  border-top: 1px solid colors.$mediumGrey;
71
79
  }
80
+ &__item:first-child {
81
+ border-top: none;
82
+ }
72
83
  .active {
73
84
  border-top: 1px solid colors.$green;
74
85
  border-bottom: 1px solid colors.$green;
@@ -79,7 +90,8 @@
79
90
  flex-grow: 1;
80
91
  display: flex;
81
92
  justify-content: flex-end;
82
- ul, li {
93
+ ul,
94
+ li {
83
95
  display: inline;
84
96
  }
85
97
  ul {
@@ -92,7 +104,8 @@
92
104
 
93
105
  @include screen-tablet {
94
106
  .nav {
95
- &__sidebar, &__topbar {
107
+ &__sidebar,
108
+ &__topbar {
96
109
  position: fixed;
97
110
  background-color: colors.$darkBlue;
98
111
  top: 0;
@@ -106,7 +119,8 @@
106
119
  padding: 0em;
107
120
  margin-top: 2rem;
108
121
  }
109
- ul, li {
122
+ ul,
123
+ li {
110
124
  display: block;
111
125
  }
112
126
  &__close {
@@ -119,13 +133,21 @@
119
133
  color: colors.$darkBeige;
120
134
  }
121
135
  }
122
-
136
+
137
+ &__sidebar {
138
+ top: 0;
139
+ left: 0;
140
+ &__item:first-child {
141
+ border-top: 1px solid colors.$mediumGrey;
142
+ }
143
+ }
144
+
123
145
  &__topbar {
124
146
  height: 100%;
125
147
  &__item {
126
- padding: 2em;
127
- border-top: 1px solid colors.$mediumGrey;
128
- }
148
+ padding: 2em;
149
+ border-top: 1px solid colors.$mediumGrey;
150
+ }
129
151
  }
130
152
  }
131
153
  }