@iroco/ui 0.15.2 → 0.17.0

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.
@@ -0,0 +1,45 @@
1
+ <script lang="ts">
2
+ export let width = '10rem';
3
+ export let height = '10rem';
4
+ </script>
5
+
6
+ <a class='iroco-logo' href="/">
7
+ <svg viewBox="0 0 832.33 249.52" width={width} height={height}>
8
+ <title>Iroco</title>
9
+ <path
10
+ fill="white"
11
+ d="M412,81.41c-7.34,0-12.07-5.19-12.07-12.37S404.77,56.66,412,56.66,424.17,61.85,424.17,69,419.13,81.41,412,81.41Zm10.7,118.4H401V103.54h21.7Z"
12
+ transform="translate(-0.44 -0.49)"
13
+ />
14
+ <path
15
+ fill="white"
16
+ d="M505.77,123.71h-6.72c-18,0-27.2,8.26-27.2,28.43v47.67h-21.7V103.54h21.7v14.21h.3c5.5-9.32,15.44-15.28,28.43-15.28h5.19Z"
17
+ transform="translate(-0.44 -0.49)"
18
+ />
19
+ <path
20
+ fill="white"
21
+ d="M566.44,201.34c-33,0-49.21-21.54-49.21-49.66S533.43,102,566.44,102s49.35,21.39,49.35,49.66C615.79,179.64,599.29,201.34,566.44,201.34Zm0-80.22c-19.26,0-27.51,12.68-27.51,30.56,0,17.72,8.4,30.56,27.66,30.56s27.5-12.68,27.5-30.56S585.69,121.12,566.44,121.12Z"
22
+ transform="translate(-0.44 -0.49)"
23
+ />
24
+ <path
25
+ fill="white"
26
+ d="M721.23,186.52c-11.77,10.7-24.45,14.82-39.12,14.82-33.62,0-49.51-21.54-49.51-48.9,0-28.11,17.88-50.42,49.81-50.42,15.9,0,28,4.27,38.51,14.21L706.1,131.05c-6.88-6.72-14.21-9.93-23.53-9.93-18.8.15-28.27,13.9-28.27,31.32,0,16.66,8.1,29.8,28,29.8,9.17,0,16.35-2.9,24.3-10.54Z"
27
+ transform="translate(-0.44 -0.49)"
28
+ />
29
+ <path
30
+ fill="white"
31
+ d="M783.42,201.34c-33,0-49.21-21.54-49.21-49.66S750.41,102,783.42,102s49.35,21.39,49.35,49.66C832.77,179.64,816.27,201.34,783.42,201.34Zm0-80.22c-19.26,0-27.51,12.68-27.51,30.56,0,17.72,8.41,30.56,27.66,30.56s27.5-12.68,27.5-30.56S802.67,121.12,783.42,121.12Z"
32
+ transform="translate(-0.44 -0.49)"
33
+ />
34
+ <path
35
+ fill="white"
36
+ d="M122.8,144.26a30.6,30.6,0,0,0-8.07,1.23,5.53,5.53,0,0,0-3.46,3.53,28,28,0,0,0-.92,8.46v76.24a28,28,0,0,0,.92,8.46,5.53,5.53,0,0,0,3.46,3.53,30.18,30.18,0,0,0,8.07,1.23V250q-7.06-.45-19.52-.46-13.22,0-19.67.46v-3.07a30.33,30.33,0,0,0,8.07-1.23,5.49,5.49,0,0,0,3.45-3.53,27.59,27.59,0,0,0,.93-8.46V157.48a27.59,27.59,0,0,0-.93-8.46,5.49,5.49,0,0,0-3.45-3.53,30.75,30.75,0,0,0-8.07-1.23v-3.08q6.45.47,19.67.47,12.3,0,19.52-.47Z"
37
+ transform="translate(-0.44 -0.49)"
38
+ />
39
+ <path
40
+ fill="#00D692"
41
+ d="M64.64,198.52a102.78,102.78,0,1,1,77.13,0l-7.41-18.29a83,83,0,1,0-62.31,0Z"
42
+ transform="translate(-0.44 -0.49)"
43
+ />
44
+ </svg>
45
+ </a>
package/src/NavBar.svelte CHANGED
@@ -13,7 +13,7 @@
13
13
  active = menuItem.name;
14
14
  if (typeof menuItem.hrefOrCallback === 'function') {
15
15
  menuItem.hrefOrCallback();
16
- return false; // to avoid calling href
16
+ return false; // to avoid calling href
17
17
  }
18
18
  dispatch('click_link');
19
19
  };
@@ -26,10 +26,11 @@
26
26
 
27
27
  <ul class="nav__{type}__item-container">
28
28
  {#each navigationItems as item}
29
- <li class="nav__{type}__item" class:active={active === item.name}>
29
+ <li class="nav__{type}__item" class:active={active === item.name} >
30
30
  <a
31
31
  on:click={() => handleClickLink(item)}
32
32
  href={typeof item.hrefOrCallback === 'string' ? item.hrefOrCallback : '#'}
33
+ class:iroco-ui-button= { item.isButton() }
33
34
  >
34
35
  {item.name}</a
35
36
  >
@@ -40,7 +41,9 @@
40
41
 
41
42
  <style lang="scss">
42
43
  @use '../scss/colors';
44
+ @use '../scss/constants';
43
45
  @import '../scss/containers';
46
+ @import '../scss/button';
44
47
 
45
48
  .nav {
46
49
  &__sidebar,
@@ -53,6 +56,7 @@
53
56
  &__item a {
54
57
  color: colors.$beige;
55
58
  font-size: 2em;
59
+
56
60
  }
57
61
  &__close {
58
62
  display: none;
@@ -2,19 +2,25 @@
2
2
  import type { NavigationItem } from './definition';
3
3
  import IconBurger from './IconBurger.svelte';
4
4
  import IconIrocoLogo from './IconIrocoLogo.svelte';
5
+ import IrocoLogo from './IrocoLogo.svelte';
5
6
  import NavBar from './NavBar.svelte';
6
7
 
7
8
  export let navigationItems: Array<NavigationItem>;
8
9
  export let type: 'sidebar' | 'topbar' = "topbar";
9
- export let title: string;
10
+ export let title: string | null = null;
10
11
 
11
12
  let showMenu = false;
13
+
12
14
  </script>
13
15
 
14
16
  <div class="navigation--mobile">
15
17
  <div class="navigation--mobile__title-container">
16
- <IconIrocoLogo width="3em" height="3em" />
17
- <h1>{title}</h1>
18
+ {#if title == null}
19
+ <IrocoLogo width="10em" height="10em"/>
20
+ {:else}
21
+ <IconIrocoLogo width="3em" height="3em" />
22
+ <h1>{title}</h1>
23
+ {/if}
18
24
  </div>
19
25
 
20
26
  <button on:click={() => (showMenu = true)} class="navigation--mobile__button">
@@ -33,8 +39,12 @@
33
39
 
34
40
  <div class="navigation">
35
41
  <div class="navigation__title-container">
36
- <IconIrocoLogo width="3em" height="3em" />
37
- <h1>{title}</h1>
42
+ {#if title == null}
43
+ <IrocoLogo width="10em" height="10em"/>
44
+ {:else}
45
+ <IconIrocoLogo width="3em" height="3em" />
46
+ <h1>{title}</h1>
47
+ {/if}
38
48
  </div>
39
49
  <NavBar {navigationItems} { type } />
40
50
  </div>
package/src/definition.ts CHANGED
@@ -1,8 +1,16 @@
1
- export type NavigationItem = {
1
+ export class NavigationItem {
2
2
  hrefOrCallback: string|(() => void);
3
3
  name: string;
4
- };
4
+
5
+ constructor (name: string, hrefOrCallback: string|(() => void)) {
6
+ this.hrefOrCallback = hrefOrCallback;
7
+ this.name = name;
8
+ }
5
9
 
10
+ isButton(): boolean {
11
+ return typeof this.hrefOrCallback === 'function'
12
+ }
13
+ };
6
14
 
7
15
  export enum ButtonKind {
8
16
  REGULAR = "regular",
package/src/index.ts CHANGED
@@ -15,3 +15,7 @@ export { default as IconFloppyDisk } from './IconFloppyDisk.svelte'
15
15
  export { default as IconTrashCan } from './IconTrashCan.svelte'
16
16
  export { default as Alert } from './Alert.svelte'
17
17
  export { default as IconIrocoLogo } from './IconIrocoLogo.svelte'
18
+ export { default as IrocoLogo } from './IrocoLogo.svelte'
19
+ export * from './definition'
20
+
21
+