@iroco/ui 0.50.1 → 0.51.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/Button.svelte +7 -0
- package/NavBar.svelte +24 -9
- package/README.md +38 -21
- package/definition.d.ts +7 -2
- package/definition.js +9 -3
- package/package.json +1 -1
- package/scss/button.scss +8 -0
package/Button.svelte
CHANGED
|
@@ -266,6 +266,13 @@ export let node;
|
|
|
266
266
|
.iroco-ui-button:active {
|
|
267
267
|
box-shadow: none;
|
|
268
268
|
}
|
|
269
|
+
.iroco-ui-button .iroco-ui-link {
|
|
270
|
+
background: none;
|
|
271
|
+
border: none;
|
|
272
|
+
font-family: "Arial";
|
|
273
|
+
color: #f2ebe3;
|
|
274
|
+
cursor: pointer;
|
|
275
|
+
}
|
|
269
276
|
.iroco-ui-button.disabled {
|
|
270
277
|
background-color: #f5f5f5;
|
|
271
278
|
cursor: default;
|
package/NavBar.svelte
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script>import IconClose from "./IconClose.svelte";
|
|
2
2
|
import { createEventDispatcher } from "svelte";
|
|
3
3
|
import { navigating } from "$app/stores";
|
|
4
|
+
import { NavigationItemType } from "./definition.js";
|
|
4
5
|
export let navigationItems;
|
|
5
6
|
export let type;
|
|
6
7
|
let active;
|
|
@@ -31,15 +32,21 @@ $:
|
|
|
31
32
|
<ul class="nav__{type}__item-container">
|
|
32
33
|
{#each navigationItems as item}
|
|
33
34
|
<li class="nav__{type}__item" class:active={isActive(active, item)}>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
35
|
+
{#if item.type === NavigationItemType.FORM}
|
|
36
|
+
<form method="POST" action={item.hrefOrCallback}>
|
|
37
|
+
<button class="iroco-ui-link" type="submit">{item.name}</button>
|
|
38
|
+
</form>
|
|
39
|
+
{:else}
|
|
40
|
+
<a
|
|
41
|
+
on:click={() => handleClickLink(item)}
|
|
42
|
+
href={typeof item.hrefOrCallback === 'string' ? item.hrefOrCallback : '#'}
|
|
43
|
+
class:iroco-ui-button={item.type === NavigationItemType.BUTTON}
|
|
44
|
+
class:iroco-ui-button--small={item.type === NavigationItemType.BUTTON}
|
|
45
|
+
class:iroco-ui-button--success={item.type === NavigationItemType.BUTTON}
|
|
46
|
+
>
|
|
47
|
+
{item.name}
|
|
48
|
+
</a>
|
|
49
|
+
{/if}
|
|
43
50
|
</li>
|
|
44
51
|
{/each}
|
|
45
52
|
</ul>
|
|
@@ -552,6 +559,14 @@ $:
|
|
|
552
559
|
box-shadow: none;
|
|
553
560
|
}
|
|
554
561
|
|
|
562
|
+
.iroco-ui-button .iroco-ui-link {
|
|
563
|
+
background: none;
|
|
564
|
+
border: none;
|
|
565
|
+
font-family: "Arial";
|
|
566
|
+
color: #f2ebe3;
|
|
567
|
+
cursor: pointer;
|
|
568
|
+
}
|
|
569
|
+
|
|
555
570
|
.iroco-ui-button.disabled {
|
|
556
571
|
background-color: #f5f5f5;
|
|
557
572
|
cursor: default;
|
package/README.md
CHANGED
|
@@ -1,38 +1,55 @@
|
|
|
1
|
-
#
|
|
1
|
+
# iroco-ui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://app.circleci.com/pipelines/github/iroco-co/iroco-ui)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Design system for Iroco [based on SvelteKit](https://kit.svelte.dev/docs/packaging).
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
See the [Documentation](https://iroco-co.github.io/iroco-ui/) (not in sync anymore : to be restored with storybook)
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
# create a new project in the current directory
|
|
11
|
-
npm create svelte@latest
|
|
9
|
+
# develop
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
To install dependencies :
|
|
12
|
+
|
|
13
|
+
```shell
|
|
14
|
+
~/src/iroco-ui$ npm ci
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Building :
|
|
18
|
+
|
|
19
|
+
```shell
|
|
20
|
+
~/src/iroco-ui$ npm run build
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Releasing :
|
|
24
|
+
|
|
25
|
+
```shell
|
|
26
|
+
~/iroco-ui$ cd package ; npm publish
|
|
27
|
+
```
|
|
18
28
|
|
|
19
|
-
|
|
29
|
+
# documentation (to be done with storybook)
|
|
20
30
|
|
|
21
|
-
|
|
22
|
-
npm run dev
|
|
31
|
+
The docs directory contains the documentation app deployed on github pages. To install dependencies :
|
|
23
32
|
|
|
24
|
-
|
|
25
|
-
npm
|
|
33
|
+
```shell
|
|
34
|
+
~/src/iroco-ui/docs$ npm ci
|
|
26
35
|
```
|
|
27
36
|
|
|
28
|
-
|
|
37
|
+
You can add/update components documentation into `docs/src/pages/components` and update the left menu in `docs/src/includes/sidebar.md`.
|
|
29
38
|
|
|
30
|
-
To
|
|
39
|
+
When you have to work on the CSS for components, you can have hot reloading. To do so you have to make the iroco-ui build watched with :
|
|
31
40
|
|
|
32
|
-
```
|
|
33
|
-
npm
|
|
41
|
+
```shell
|
|
42
|
+
~/src/iroco-ui$ npx npm-watch build
|
|
34
43
|
```
|
|
35
44
|
|
|
36
|
-
|
|
45
|
+
And in the same time launch the dev server for docs :
|
|
46
|
+
|
|
47
|
+
```shell
|
|
48
|
+
~/src/iroco-ui/docs$ npm run dev
|
|
49
|
+
```
|
|
37
50
|
|
|
38
|
-
|
|
51
|
+
To build the documentation (in docs) :
|
|
52
|
+
|
|
53
|
+
```shell
|
|
54
|
+
~/src/iroco-ui/docs$ npm run build
|
|
55
|
+
```
|
package/definition.d.ts
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
export declare class NavigationItem {
|
|
2
2
|
hrefOrCallback: string | (() => void);
|
|
3
3
|
name: string;
|
|
4
|
-
|
|
5
|
-
constructor(name: string, hrefOrCallback: string | (() => void),
|
|
4
|
+
type: NavigationItemType;
|
|
5
|
+
constructor(name: string, hrefOrCallback: string | (() => void), type?: NavigationItemType);
|
|
6
|
+
}
|
|
7
|
+
export declare enum NavigationItemType {
|
|
8
|
+
BUTTON = 0,
|
|
9
|
+
ANCHOR = 1,
|
|
10
|
+
FORM = 2
|
|
6
11
|
}
|
|
7
12
|
export declare enum TextInputType {
|
|
8
13
|
text = "text",
|
package/definition.js
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
export class NavigationItem {
|
|
2
2
|
hrefOrCallback;
|
|
3
3
|
name;
|
|
4
|
-
|
|
5
|
-
constructor(name, hrefOrCallback,
|
|
4
|
+
type;
|
|
5
|
+
constructor(name, hrefOrCallback, type = NavigationItemType.ANCHOR) {
|
|
6
6
|
this.hrefOrCallback = hrefOrCallback;
|
|
7
7
|
this.name = name;
|
|
8
|
-
this.
|
|
8
|
+
this.type = type;
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
+
export var NavigationItemType;
|
|
12
|
+
(function (NavigationItemType) {
|
|
13
|
+
NavigationItemType[NavigationItemType["BUTTON"] = 0] = "BUTTON";
|
|
14
|
+
NavigationItemType[NavigationItemType["ANCHOR"] = 1] = "ANCHOR";
|
|
15
|
+
NavigationItemType[NavigationItemType["FORM"] = 2] = "FORM";
|
|
16
|
+
})(NavigationItemType || (NavigationItemType = {}));
|
|
11
17
|
export var TextInputType;
|
|
12
18
|
(function (TextInputType) {
|
|
13
19
|
TextInputType["text"] = "text";
|
package/package.json
CHANGED
package/scss/button.scss
CHANGED