@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.
@@ -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 {
@@ -59,7 +59,7 @@
59
59
  *
60
60
  */
61
61
  const openDialog = async () => {
62
- (document.querySelector('.sui.app-shell') || document.body).appendChild(dialog);
62
+ (document.querySelector('.sui.app-shell') ?? document.body).appendChild(dialog);
63
63
  showContent = true;
64
64
 
65
65
  if (modal) {
@@ -66,7 +66,7 @@
66
66
  *
67
67
  */
68
68
  const openDialog = async () => {
69
- (document.querySelector('.sui.app-shell') || document.body).appendChild(dialog);
69
+ (document.querySelector('.sui.app-shell') ?? document.body).appendChild(dialog);
70
70
  showContent = true;
71
71
  dialog.showModal();
72
72
 
@@ -138,7 +138,7 @@
138
138
  <Popup
139
139
  id="{id}-popup"
140
140
  class="combobox"
141
- anchor={comboboxElement || inputComponent?.element}
141
+ anchor={comboboxElement ?? inputComponent?.element}
142
142
  {position}
143
143
  touchOptimized={true}
144
144
  bind:open={isPopupOpen}
@@ -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
- .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
- pointer-events: none;
102
- -webkit-user-select: none;
103
- user-select: none;
104
- }
105
-
106
- .toast {
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
- &[hidden] {
115
- display: block;
116
- opacity: 0;
117
- }
118
- }
119
- </style>
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>
@@ -71,7 +71,7 @@
71
71
  *
72
72
  */
73
73
  const openDialog = () => {
74
- (document.querySelector('.sui.app-shell') || document.body).appendChild(dialog);
74
+ (document.querySelector('.sui.app-shell') ?? document.body).appendChild(dialog);
75
75
  showContent = true;
76
76
  dialog.showModal();
77
77
 
@@ -68,7 +68,7 @@ class Group {
68
68
 
69
69
  this.orientation = this.grid
70
70
  ? 'horizontal'
71
- : this.parent.getAttribute('aria-orientation') || 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')) || activeMembers[0];
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.0",
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.0",
31
- "@sveltejs/kit": "^1.27.2",
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.52.0",
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.0",
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.0.0",
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",