@sveltia/ui 0.7.0 → 0.7.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/package/components/button/button.svelte +3 -0
- package/package/components/dialog/dialog.svelte +1 -1
- package/package/components/drawer/drawer.svelte +1 -1
- package/package/components/select/combobox.svelte +1 -1
- package/package/components/toast/toast.svelte +37 -36
- package/package/components/util/popup.svelte +1 -1
- package/package/services/group.js +2 -2
- package/package.json +6 -6
|
@@ -226,6 +226,9 @@ button:global(.ghost)[aria-pressed=true] {
|
|
|
226
226
|
}
|
|
227
227
|
button:global(.link) {
|
|
228
228
|
outline: 0;
|
|
229
|
+
border-radius: 0 !important;
|
|
230
|
+
padding: 0 !important;
|
|
231
|
+
height: auto !important;
|
|
229
232
|
color: var(--sui-primary-accent-color-text);
|
|
230
233
|
}
|
|
231
234
|
button:global(.link):hover, button:global(.link):focus, button:global(.link):active {
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
*
|
|
67
67
|
*/
|
|
68
68
|
const openDialog = async () => {
|
|
69
|
-
(document.querySelector('.sui.app-shell')
|
|
69
|
+
(document.querySelector('.sui.app-shell') ?? document.body).appendChild(dialog);
|
|
70
70
|
showContent = true;
|
|
71
71
|
dialog.showModal();
|
|
72
72
|
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
export let show = false;
|
|
15
15
|
/**
|
|
16
|
+
* Duration to automatically hide the toast. Use `0` to hide it manually from the consumer.
|
|
16
17
|
* @type {number}
|
|
17
18
|
*/
|
|
18
19
|
export let duration = 5000;
|
|
@@ -43,7 +44,7 @@
|
|
|
43
44
|
} else {
|
|
44
45
|
popover = popoverBase;
|
|
45
46
|
popover.classList.add('enabled');
|
|
46
|
-
document.body.appendChild(popover);
|
|
47
|
+
(document.querySelector('.sui.app-shell') ?? document.body).appendChild(popover);
|
|
47
48
|
|
|
48
49
|
// Move the element to top layer
|
|
49
50
|
if (popover.showPopover) {
|
|
@@ -64,7 +65,7 @@
|
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
$: {
|
|
67
|
-
if (show) {
|
|
68
|
+
if (show && duration) {
|
|
68
69
|
window.setTimeout(() => {
|
|
69
70
|
show = false;
|
|
70
71
|
}, duration);
|
|
@@ -82,38 +83,38 @@
|
|
|
82
83
|
</Alert>
|
|
83
84
|
</div>
|
|
84
85
|
|
|
85
|
-
<style
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
position: absolute;
|
|
108
|
-
inset: auto 16px 16px auto;
|
|
109
|
-
box-shadow: 0 8px 16px var(--sui-popup-shadow-color);
|
|
110
|
-
opacity: 1;
|
|
111
|
-
transition-duration: 250ms;
|
|
112
|
-
will-change: opacity;
|
|
86
|
+
<style>.toast-base {
|
|
87
|
+
position: fixed;
|
|
88
|
+
inset: 0;
|
|
89
|
+
z-index: 99999;
|
|
90
|
+
display: flex;
|
|
91
|
+
flex-direction: column;
|
|
92
|
+
justify-content: flex-end;
|
|
93
|
+
align-items: flex-end;
|
|
94
|
+
gap: 8px;
|
|
95
|
+
margin: 0;
|
|
96
|
+
border: 0;
|
|
97
|
+
padding: 16px;
|
|
98
|
+
width: 100vw;
|
|
99
|
+
height: 100vh;
|
|
100
|
+
background-color: transparent;
|
|
101
|
+
font-family: var(--sui-font-family-default);
|
|
102
|
+
font-size: var(--sui-font-size-default);
|
|
103
|
+
font-weight: var(--sui-font-weight-normal);
|
|
104
|
+
pointer-events: none;
|
|
105
|
+
-webkit-user-select: none;
|
|
106
|
+
user-select: none;
|
|
107
|
+
}
|
|
113
108
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
109
|
+
.toast {
|
|
110
|
+
position: absolute;
|
|
111
|
+
inset: auto 16px 16px auto;
|
|
112
|
+
box-shadow: 0 8px 16px var(--sui-popup-shadow-color);
|
|
113
|
+
opacity: 1;
|
|
114
|
+
transition-duration: 250ms;
|
|
115
|
+
will-change: opacity;
|
|
116
|
+
}
|
|
117
|
+
.toast[hidden] {
|
|
118
|
+
display: block;
|
|
119
|
+
opacity: 0;
|
|
120
|
+
}</style>
|
|
@@ -68,7 +68,7 @@ class Group {
|
|
|
68
68
|
|
|
69
69
|
this.orientation = this.grid
|
|
70
70
|
? 'horizontal'
|
|
71
|
-
: this.parent.getAttribute('aria-orientation')
|
|
71
|
+
: this.parent.getAttribute('aria-orientation') ?? orientation;
|
|
72
72
|
this.childRoles = childRoles;
|
|
73
73
|
this.childSelectedAttr = childSelectedAttr;
|
|
74
74
|
this.focusChild = focusChild;
|
|
@@ -208,7 +208,7 @@ class Group {
|
|
|
208
208
|
|
|
209
209
|
const currentTarget = (() => {
|
|
210
210
|
if (!this.focusChild) {
|
|
211
|
-
return activeMembers.find((member) => member.matches('.focused'))
|
|
211
|
+
return activeMembers.find((member) => member.matches('.focused')) ?? activeMembers[0];
|
|
212
212
|
}
|
|
213
213
|
|
|
214
214
|
if (target.matches(this.selector)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sveltia/ui",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -27,16 +27,16 @@
|
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@playwright/test": "^1.39.0",
|
|
30
|
-
"@sveltejs/adapter-auto": "2.1.
|
|
31
|
-
"@sveltejs/kit": "^1.27.
|
|
30
|
+
"@sveltejs/adapter-auto": "2.1.1",
|
|
31
|
+
"@sveltejs/kit": "^1.27.3",
|
|
32
32
|
"@sveltejs/package": "^2.2.2",
|
|
33
33
|
"cspell": "^7.3.8",
|
|
34
|
-
"eslint": "^8.
|
|
34
|
+
"eslint": "^8.53.0",
|
|
35
35
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
36
36
|
"eslint-config-prettier": "^9.0.0",
|
|
37
37
|
"eslint-plugin-import": "^2.29.0",
|
|
38
38
|
"eslint-plugin-jsdoc": "^46.8.2",
|
|
39
|
-
"eslint-plugin-svelte": "^2.34.
|
|
39
|
+
"eslint-plugin-svelte": "^2.34.1",
|
|
40
40
|
"npm-run-all": "^4.1.5",
|
|
41
41
|
"postcss": "^8.4.31",
|
|
42
42
|
"postcss-html": "^1.5.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"prettier-plugin-svelte": "^3.0.3",
|
|
45
45
|
"sass": "^1.69.5",
|
|
46
46
|
"stylelint": "^15.11.0",
|
|
47
|
-
"stylelint-config-recommended-scss": "^13.
|
|
47
|
+
"stylelint-config-recommended-scss": "^13.1.0",
|
|
48
48
|
"stylelint-scss": "^5.3.0",
|
|
49
49
|
"svelte-check": "^3.5.2",
|
|
50
50
|
"svelte-i18n": "^4.0.0",
|