@hyvor/design 0.0.57 → 0.0.59
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/dist/components/Dropdown/Dropdown.svelte +1 -1
- package/dist/components/Internationalization/T.svelte +1 -0
- package/dist/components/Modal/Modal.svelte +7 -1
- package/dist/components/NavLink/NavLink.svelte +11 -1
- package/dist/components/NavLink/NavLink.svelte.d.ts +1 -0
- package/dist/components/Radio/Radio.svelte +75 -67
- package/dist/components/Radio/Radio.svelte.d.ts +1 -0
- package/dist/components/TextInput/TextInput.svelte +3 -17
- package/package.json +1 -2
|
@@ -5,6 +5,7 @@ import IconButton from "./../IconButton/IconButton.svelte";
|
|
|
5
5
|
import { fade, scale } from "svelte/transition";
|
|
6
6
|
import { onMount, tick } from "svelte";
|
|
7
7
|
import Loader from "../Loader/Loader.svelte";
|
|
8
|
+
import { createEventDispatcher } from "svelte";
|
|
8
9
|
export let show = false;
|
|
9
10
|
export let title = "";
|
|
10
11
|
export let size = "medium";
|
|
@@ -13,11 +14,16 @@ export let role = "alertdialog";
|
|
|
13
14
|
export let closeOnOutsideClick = true;
|
|
14
15
|
export let closeOnEscape = true;
|
|
15
16
|
export let loading = false;
|
|
17
|
+
const dispatch = createEventDispatcher();
|
|
16
18
|
const titleId = id + "-title";
|
|
17
19
|
const descId = id + "-desc";
|
|
18
20
|
export let footer = null;
|
|
19
21
|
let wrapEl;
|
|
20
22
|
let innerEl;
|
|
23
|
+
function handleCancel() {
|
|
24
|
+
show = false;
|
|
25
|
+
dispatch("cancel");
|
|
26
|
+
}
|
|
21
27
|
async function setFlex() {
|
|
22
28
|
await tick();
|
|
23
29
|
if (!wrapEl || !innerEl)
|
|
@@ -80,7 +86,7 @@ $:
|
|
|
80
86
|
<div class="close-wrap">
|
|
81
87
|
<IconButton
|
|
82
88
|
variant="invisible"
|
|
83
|
-
on:click={
|
|
89
|
+
on:click={handleCancel}
|
|
84
90
|
>
|
|
85
91
|
<IconX size={25} />
|
|
86
92
|
</IconButton>
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<script>export let href;
|
|
2
2
|
export let active = false;
|
|
3
|
+
export let disabled = false;
|
|
3
4
|
</script>
|
|
4
5
|
|
|
5
6
|
<a
|
|
6
7
|
{href}
|
|
7
8
|
class:active={active}
|
|
8
|
-
|
|
9
|
+
class:disabled={disabled}
|
|
9
10
|
on:keyup
|
|
10
11
|
on:keydown
|
|
11
12
|
on:keypress
|
|
@@ -60,6 +61,15 @@ export let active = false;
|
|
|
60
61
|
border-left: 3px solid var(--accent);
|
|
61
62
|
}
|
|
62
63
|
|
|
64
|
+
a.disabled {
|
|
65
|
+
cursor: not-allowed;
|
|
66
|
+
opacity: .5;
|
|
67
|
+
|
|
68
|
+
/* hover */
|
|
69
|
+
background-color: transparent;
|
|
70
|
+
|
|
71
|
+
}
|
|
72
|
+
|
|
63
73
|
.start, .middle, .end {
|
|
64
74
|
display: inline-flex;
|
|
65
75
|
align-items: center;
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
<script>export let value = "";
|
|
2
2
|
export let group = "";
|
|
3
|
+
export let disabled = false;
|
|
3
4
|
export let input = {};
|
|
4
5
|
</script>
|
|
5
6
|
|
|
6
|
-
<label
|
|
7
|
+
<label
|
|
8
|
+
class:disabled={disabled}
|
|
9
|
+
>
|
|
7
10
|
|
|
8
11
|
<input
|
|
9
12
|
type="radio"
|
|
10
|
-
|
|
13
|
+
disabled={disabled}
|
|
11
14
|
bind:group
|
|
12
15
|
bind:this={input}
|
|
13
16
|
{value}
|
|
14
17
|
|
|
18
|
+
|
|
15
19
|
on:keyup
|
|
16
20
|
on:keydown
|
|
17
21
|
on:keypress
|
|
@@ -33,68 +37,72 @@ export let input = {};
|
|
|
33
37
|
</label>
|
|
34
38
|
|
|
35
39
|
|
|
36
|
-
<style>
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
40
|
+
<style>label {
|
|
41
|
+
position: relative;
|
|
42
|
+
padding-left: 30px;
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
user-select: none;
|
|
45
|
+
height: 20px;
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
label.disabled {
|
|
51
|
+
cursor: not-allowed;
|
|
52
|
+
opacity: 0.5;
|
|
53
|
+
}
|
|
54
|
+
label.disabled .checkmark {
|
|
55
|
+
box-shadow: none !important;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
input {
|
|
59
|
+
position: absolute;
|
|
60
|
+
opacity: 0;
|
|
61
|
+
cursor: pointer;
|
|
62
|
+
height: 0;
|
|
63
|
+
width: 0;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.checkmark {
|
|
67
|
+
position: absolute;
|
|
68
|
+
top: 0;
|
|
69
|
+
left: 0;
|
|
70
|
+
height: 20px;
|
|
71
|
+
width: 20px;
|
|
72
|
+
background-color: var(--input);
|
|
73
|
+
border-radius: 50%;
|
|
74
|
+
transition: 0.4s;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.checkmark:after {
|
|
78
|
+
content: "";
|
|
79
|
+
position: absolute;
|
|
80
|
+
display: none;
|
|
81
|
+
top: 50%;
|
|
82
|
+
left: 50%;
|
|
83
|
+
transform: translate(-50%, -50%);
|
|
84
|
+
width: 8px;
|
|
85
|
+
height: 8px;
|
|
86
|
+
border-radius: 50%;
|
|
87
|
+
background: var(--accent-text);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
label:hover input ~ .checkmark {
|
|
91
|
+
box-shadow: 0 0 0 3px var(--accent-light);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
label:active input ~ .checkmark {
|
|
95
|
+
box-shadow: 0 0 0 4px var(--accent-light);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
label input:focus-visible ~ .checkmark {
|
|
99
|
+
box-shadow: 0 0 0 3px var(--accent-light);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
label input:checked ~ .checkmark {
|
|
103
|
+
background-color: var(--accent);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
input:checked ~ .checkmark:after {
|
|
107
|
+
display: block;
|
|
108
|
+
}</style>
|
|
@@ -5,20 +5,7 @@ export let value = void 0;
|
|
|
5
5
|
export let input = {};
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
<span
|
|
10
|
-
class="input-wrap state-{state} size-{size}"
|
|
11
|
-
class:block
|
|
12
|
-
on:click={() => input.focus()}
|
|
13
|
-
on:keydown={(e) => {
|
|
14
|
-
if (e.key === 'Enter') {
|
|
15
|
-
input.focus();
|
|
16
|
-
}
|
|
17
|
-
}}
|
|
18
|
-
role="textbox"
|
|
19
|
-
tabindex="0"
|
|
20
|
-
>
|
|
21
|
-
|
|
8
|
+
<label class="input-wrap state-{state} size-{size}" class:block>
|
|
22
9
|
{#if $$slots.start}
|
|
23
10
|
<span class="slot start">
|
|
24
11
|
<slot name="start" />
|
|
@@ -27,9 +14,8 @@ export let input = {};
|
|
|
27
14
|
|
|
28
15
|
<input
|
|
29
16
|
{...$$restProps}
|
|
30
|
-
bind:value
|
|
17
|
+
bind:value
|
|
31
18
|
bind:this={input}
|
|
32
|
-
|
|
33
19
|
on:keyup
|
|
34
20
|
on:keydown
|
|
35
21
|
on:keypress
|
|
@@ -48,7 +34,7 @@ export let input = {};
|
|
|
48
34
|
<slot name="end" />
|
|
49
35
|
</span>
|
|
50
36
|
{/if}
|
|
51
|
-
</
|
|
37
|
+
</label>
|
|
52
38
|
|
|
53
39
|
<style>.slot {
|
|
54
40
|
display: inline-flex;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyvor/design",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.59",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"private": false,
|
|
6
6
|
"scripts": {
|
|
@@ -48,7 +48,6 @@
|
|
|
48
48
|
"@hyvor/icons": "^0.0.3",
|
|
49
49
|
"deepmerge-ts": "^5.1.0",
|
|
50
50
|
"highlight.js": "^11.9.0",
|
|
51
|
-
"i": "^0.3.7",
|
|
52
51
|
"intl-messageformat": "^10.5.11",
|
|
53
52
|
"npm": "^10.4.0",
|
|
54
53
|
"svelte-awesome-color-picker": "^3.0.4",
|