@iroco/ui 0.15.1 → 0.16.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.
package/lib/index.mjs.css CHANGED
@@ -16,21 +16,6 @@ svg.svelte-1cuxg7m {
16
16
  to {
17
17
  transform: rotate(359deg); } }
18
18
 
19
- .data-table.svelte-1ju5y8t {
20
- border: 1px solid #464452;
21
- width: 100%; }
22
-
23
- .data-table__header.svelte-1ju5y8t {
24
- font-size: 1.5em;
25
- height: 4rem; }
26
-
27
- .data-table__header__cell.svelte-1ju5y8t {
28
- border-bottom: 1px solid #464452; }
29
-
30
- .data-table__body__cell.svelte-1ju5y8t {
31
- text-align: center;
32
- vertical-align: middle; }
33
-
34
19
  .iroco-ui-radio.svelte-156c82q.svelte-156c82q.svelte-156c82q {
35
20
  color: #f2ebe3;
36
21
  position: relative;
@@ -148,6 +133,45 @@ input.svelte-1y0402x.svelte-1y0402x:focus {
148
133
  .navigation--mobile__title-container.svelte-lqwgm1 h1.svelte-lqwgm1 {
149
134
  padding-left: 0.5em; } }
150
135
 
136
+ @use "colors";
137
+ @use "containers";
138
+ @use "fonts";
139
+ @use "forms";
140
+ @use "layouts";
141
+ .data-table.svelte-1ju5y8t {
142
+ border: 1px solid #464452;
143
+ width: 100%; }
144
+
145
+ .data-table__header.svelte-1ju5y8t {
146
+ font-size: 1.5em;
147
+ height: 4rem; }
148
+
149
+ .data-table__header__cell.svelte-1ju5y8t {
150
+ border-bottom: 1px solid #464452; }
151
+
152
+ .data-table__body__cell.svelte-1ju5y8t {
153
+ text-align: center;
154
+ vertical-align: middle; }
155
+
156
+ .alert.svelte-itln7g {
157
+ min-height: 2em;
158
+ display: inline-flex;
159
+ align-items: center;
160
+ border-radius: 0.3em;
161
+ padding: 0 1em 0 1em;
162
+ font-size: 1.2em;
163
+ justify-content: center;
164
+ margin-bottom: 1em;
165
+ cursor: pointer; }
166
+
167
+ .alert--danger.svelte-itln7g {
168
+ background-color: rgba(255, 80, 77, 0.5);
169
+ border: 1px solid #ff504d; }
170
+
171
+ .alert--success.svelte-itln7g {
172
+ background-color: rgba(0, 214, 146, 0.5);
173
+ border: 1px solid #00D692; }
174
+
151
175
  .container-wide.svelte-5qkkwb {
152
176
  width: calc(100% - 20px);
153
177
  max-width: 2360px;
@@ -539,27 +563,3 @@ input.svelte-1y0402x.svelte-1y0402x:focus {
539
563
  .nav__topbar__item.svelte-1c8sozl.svelte-1c8sozl {
540
564
  padding: 2em;
541
565
  border-top: 1px solid #464452; } }
542
-
543
- @use "colors";
544
- @use "containers";
545
- @use "fonts";
546
- @use "forms";
547
- @use "layouts";
548
- .alert.svelte-itln7g {
549
- min-height: 2em;
550
- display: inline-flex;
551
- align-items: center;
552
- border-radius: 0.3em;
553
- padding: 0 1em 0 1em;
554
- font-size: 1.2em;
555
- justify-content: center;
556
- margin-bottom: 1em;
557
- cursor: pointer; }
558
-
559
- .alert--danger.svelte-itln7g {
560
- background-color: rgba(255, 80, 77, 0.5);
561
- border: 1px solid #ff504d; }
562
-
563
- .alert--success.svelte-itln7g {
564
- background-color: rgba(0, 214, 146, 0.5);
565
- border: 1px solid #00D692; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iroco/ui",
3
- "version": "0.15.1",
3
+ "version": "0.16.0",
4
4
  "description": "Iroco design system based on Svelte",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.mjs",
@@ -62,6 +62,7 @@
62
62
  "husky": "^7.0.2",
63
63
  "jest": "^26.6.3",
64
64
  "lint-staged": "^11.1.2",
65
+ "node-sass": "^7.0.1",
65
66
  "npm-watch": "^0.10.0",
66
67
  "prettier": "^2.3.1",
67
68
  "prettier-plugin-svelte": "^2.3.0",
@@ -75,7 +76,6 @@
75
76
  "svelte-jester": "^1.7.0",
76
77
  "svelte-preprocess": "^4.7.3",
77
78
  "ts-jest": "^26.5.5",
78
- "node-sass": "^7.0.1",
79
79
  "typescript": "^4.3.3"
80
80
  },
81
81
  "peerDependencies": {
@@ -95,7 +95,8 @@
95
95
  "preprocess": true
96
96
  }
97
97
  ],
98
- "^.+\\.js$": "babel-jest"
98
+ "^.+\\.js$": "babel-jest",
99
+ "^.+\\.ts$": "ts-jest"
99
100
  },
100
101
  "testEnvironment": "jsdom",
101
102
  "moduleFileExtensions": [
@@ -0,0 +1,60 @@
1
+ @use '../scss/colors';
2
+ @use '../scss/fonts';
3
+ @use '../scss/containers';
4
+ @use '../scss/constants';
5
+
6
+ .iroco-ui-button {
7
+ cursor: pointer;
8
+ -webkit-touch-callout: none;
9
+ -webkit-user-select: none;
10
+ -khtml-user-select: none;
11
+ -moz-user-select: none;
12
+ -ms-user-select: none;
13
+ user-select: none;
14
+ border: none;
15
+ flex-shrink: 0;
16
+ margin: 1em 0em;
17
+ position: relative;
18
+ text-transform: uppercase;
19
+ border-radius: constants.$border-radius;
20
+
21
+ &--basic {
22
+ background: colors.$beige;
23
+ border: 1px solid colors.$nightBlue;
24
+ }
25
+ &--dark {
26
+ background: colors.$nightBlue;
27
+ color: colors.$beige;
28
+ }
29
+ &--success {
30
+ background: colors.$green;
31
+ }
32
+ &--danger {
33
+ background: colors.$red;
34
+ }
35
+ &--regular {
36
+ padding: 1em 2em;
37
+ }
38
+ &--small {
39
+ padding: 0.5em 1em;
40
+ }
41
+
42
+ &--basic:hover, &--success:hover, &--danger:hover {
43
+ box-shadow: inset 0 0 0 10em rgba(0, 0, 0, 0.2);
44
+ }
45
+ &--dark:hover {
46
+ box-shadow: inset 0 0 0 10em rgba(255, 255, 255, 0.2);
47
+ }
48
+
49
+ &:active {
50
+ box-shadow: none;
51
+ }
52
+
53
+ &.disabled {
54
+ background-color: colors.$lightGrey;
55
+ cursor: default;
56
+ &:hover {
57
+ box-shadow: none;
58
+ }
59
+ }
60
+ }
package/src/Button.svelte CHANGED
@@ -20,65 +20,5 @@
20
20
  </button>
21
21
 
22
22
  <style lang="scss">
23
- @use '../scss/colors';
24
- @use '../scss/fonts';
25
- @use '../scss/containers';
26
- @use '../scss/constants';
27
-
28
- .iroco-ui-button {
29
- cursor: pointer;
30
- -webkit-touch-callout: none;
31
- -webkit-user-select: none;
32
- -khtml-user-select: none;
33
- -moz-user-select: none;
34
- -ms-user-select: none;
35
- user-select: none;
36
- border: none;
37
- flex-shrink: 0;
38
- margin: 1em 0em;
39
- position: relative;
40
- text-transform: uppercase;
41
- border-radius: constants.$border-radius;
42
-
43
- &--basic {
44
- background: colors.$beige;
45
- border: 1px solid colors.$nightBlue;
46
- }
47
- &--dark {
48
- background: colors.$nightBlue;
49
- color: colors.$beige;
50
- }
51
- &--success {
52
- background: colors.$green;
53
- }
54
- &--danger {
55
- background: colors.$red;
56
- }
57
- &--regular {
58
- padding: 1em 2em;
59
- }
60
- &--small {
61
- padding: 0.5em 1em;
62
- }
63
-
64
- &--basic:hover, &--success:hover, &--danger:hover {
65
- box-shadow: inset 0 0 0 10em rgba(0, 0, 0, 0.2);
66
- }
67
- &--dark:hover {
68
- box-shadow: inset 0 0 0 10em rgba(255, 255, 255, 0.2);
69
- }
70
-
71
- &:active {
72
- box-shadow: none;
73
- }
74
-
75
- &.disabled {
76
- background-color: colors.$lightGrey;
77
- cursor: default;
78
- &:hover {
79
- box-shadow: none;
80
- }
81
- }
82
- }
83
-
23
+ @use '../scss/button';
84
24
  </style>
@@ -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
  };
@@ -40,6 +40,7 @@
40
40
 
41
41
  <style lang="scss">
42
42
  @use '../scss/colors';
43
+ @use '../scss/constants';
43
44
  @import '../scss/containers';
44
45
 
45
46
  .nav {
@@ -53,6 +54,7 @@
53
54
  &__item a {
54
55
  color: colors.$beige;
55
56
  font-size: 2em;
57
+
56
58
  }
57
59
  &__close {
58
60
  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,6 +1,15 @@
1
- export type NavigationItem = {
1
+ export class NavigationItem {
2
2
  hrefOrCallback: string|(() => void);
3
3
  name: string;
4
+
5
+ constructor (name: string, hrefOrCallback: string|(() => void)) {
6
+ this.hrefOrCallback = hrefOrCallback;
7
+ this.name = name;
8
+ }
9
+
10
+ isButton(): boolean {
11
+ return typeof this.hrefOrCallback === 'function'
12
+ }
4
13
  };
5
14
 
6
15
 
package/src/index.ts CHANGED
@@ -14,3 +14,7 @@ export { default as IconMore } from './IconMoreSign.svelte'
14
14
  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
+ export { default as IconIrocoLogo } from './IconIrocoLogo.svelte'
18
+ export { default as IrocoLogo } from './IrocoLogo.svelte'
19
+
20
+