@sveltia/ui 0.10.3 → 0.10.5

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.
@@ -110,6 +110,7 @@
110
110
  on:closing
111
111
  on:close
112
112
  >
113
+ <slot name="extra-content" slot="extra-content" />
113
114
  <div role="none" class="content {className} {size}">
114
115
  {#if title || showClose || $$slots.header || $$slots['header-extra']}
115
116
  <div role="none" class="header">
@@ -183,6 +184,7 @@
183
184
  position: relative;
184
185
  display: flex;
185
186
  flex-direction: column;
187
+ overflow: hidden;
186
188
  border-radius: var(--sui-dialog-content-border-radius, 4px);
187
189
  max-width: calc(100dvw - var(--sui-dialog-content-margin, 16px) * 2);
188
190
  background-color: var(--sui-dialog-content-background-color, var(--sui-secondary-background-color-translucent));
@@ -200,8 +202,8 @@
200
202
  transform: scale(90%);
201
203
  }
202
204
  .content.small {
203
- width: var(--sui-dialog-small-content-width, 400px);
204
- max-height: var(--sui-dialog-small-content-max-height, 400px);
205
+ width: var(--sui-dialog-small-content-width, var(--sui-dialog-content-width, 400px));
206
+ max-height: var(--sui-dialog-small-content-max-height, var(--sui-dialog-content-max-height, 400px));
205
207
  }
206
208
  @media (max-height: 400px) {
207
209
  .content.small {
@@ -209,8 +211,8 @@
209
211
  }
210
212
  }
211
213
  .content.medium {
212
- width: var(--sui-dialog-medium-content-width, 600px);
213
- max-height: var(--sui-dialog-medium-content-max-height, 600px);
214
+ width: var(--sui-dialog-medium-content-width, var(--sui-dialog-content-width, 600px));
215
+ max-height: var(--sui-dialog-medium-content-max-height, var(--sui-dialog-content-max-height, 600px));
214
216
  }
215
217
  @media (max-height: 600px) {
216
218
  .content.medium {
@@ -218,8 +220,8 @@
218
220
  }
219
221
  }
220
222
  .content.large {
221
- width: var(--sui-dialog-large-content-width, 800px);
222
- max-height: var(--sui-dialog-large-content-max-height, 800px);
223
+ width: var(--sui-dialog-large-content-width, var(--sui-dialog-content-width, 800px));
224
+ max-height: var(--sui-dialog-large-content-max-height, var(--sui-dialog-content-max-height, 800px));
223
225
  }
224
226
  @media (max-height: 800px) {
225
227
  .content.large {
@@ -227,8 +229,8 @@
227
229
  }
228
230
  }
229
231
  .content.x-large {
230
- width: var(--sui-dialog-x-large-content-width, 1000px);
231
- max-height: var(--sui-dialog-x-large-content-max-height, 1000px);
232
+ width: var(--sui-dialog-x-large-content-width, var(--sui-dialog-content-width, 1000px));
233
+ max-height: var(--sui-dialog-x-large-content-max-height, var(--sui-dialog-content-max-height, 1000px));
232
234
  }
233
235
  @media (max-height: 1000px) {
234
236
  .content.x-large {
@@ -31,6 +31,9 @@ export default class Dialog extends SvelteComponent<{
31
31
  } & {
32
32
  [evt: string]: CustomEvent<any>;
33
33
  }, {
34
+ 'extra-content': {
35
+ slot: string;
36
+ };
34
37
  header: {};
35
38
  'header-extra': {};
36
39
  'close-icon': {
@@ -73,6 +76,9 @@ declare const __propDef: {
73
76
  [evt: string]: CustomEvent<any>;
74
77
  };
75
78
  slots: {
79
+ 'extra-content': {
80
+ slot: string;
81
+ };
76
82
  header: {};
77
83
  'header-extra': {};
78
84
  'close-icon': {
@@ -84,6 +84,7 @@
84
84
  on:closing
85
85
  on:close
86
86
  >
87
+ <slot name="extra-content" slot="extra-content" />
87
88
  <div role="none" class="content {className} {size} {position} {orientation}">
88
89
  <div role="none" class="extra-control">
89
90
  {#if showClose === 'outside'}
@@ -149,6 +150,7 @@
149
150
  position: absolute;
150
151
  display: flex;
151
152
  flex-direction: column;
153
+ overflow: hidden;
152
154
  max-width: 100dvw;
153
155
  max-height: 100dvh;
154
156
  background-color: var(--sui-secondary-background-color-translucent);
@@ -171,11 +173,11 @@
171
173
  transition-duration: 300ms;
172
174
  }
173
175
  .content.right {
174
- inset: 0 0 0 auto;
176
+ inset: var(--sui-drawer-right-content-inset, 0 0 0 auto);
175
177
  border-radius: var(--sui-drawer-right-content-border-radius, var(--sui-drawer-content-border-radius, 4px 0 0 4px));
176
178
  }
177
179
  .content.right.full {
178
- border-radius: var(--sui-drawer-right-full-content-border-radius, 0);
180
+ border-radius: var(--sui-drawer-right-full-content-border-radius, var(--sui-drawer-right-content-border-radius, 0));
179
181
  }
180
182
  .content.right .extra-control {
181
183
  inset: 0 100% auto auto;
@@ -184,11 +186,11 @@
184
186
  transform: translateX(105%);
185
187
  }
186
188
  .content.left {
187
- inset: 0 auto 0 0;
189
+ inset: var(--sui-drawer-left-content-inset, 0 auto 0 0);
188
190
  border-radius: var(--sui-drawer-left-content-border-radius, var(--sui-drawer-content-border-radius, 0 4px 4px 0));
189
191
  }
190
192
  .content.left.full {
191
- border-radius: var(--sui-drawer-left-full-content-border-radius, 0);
193
+ border-radius: var(--sui-drawer-left-full-content-border-radius, var(--sui-drawer-left-content-border-radius, 0));
192
194
  }
193
195
  .content.left .extra-control {
194
196
  inset: 0 auto auto 100%;
@@ -196,24 +198,28 @@
196
198
  :global(dialog:not(.open)) .content.left {
197
199
  transform: translateX(-105%);
198
200
  }
199
- .content.vertical {
200
- max-width: var(--sui-drawer-vertical-max-width, calc(100dvw - 56px));
201
- height: var(--sui-drawer-vertical-height, 100dvh);
202
- }
203
201
  :global(dialog.open) .content.vertical {
204
202
  transform: translateX(0%);
205
203
  }
206
204
  .content.vertical.small {
207
- width: var(--sui-drawer-vertical-small-width, 400px);
205
+ width: var(--sui-drawer-vertical-small-width, var(--sui-drawer-vertical-width, 400px));
206
+ max-width: var(--sui-drawer-vertical-small-max-width, var(--sui-drawer-vertical-max-width, calc(100dvw - 56px)));
207
+ height: var(--sui-drawer-vertical-small-height, var(--sui-drawer-vertical-height, 100dvh));
208
208
  }
209
209
  .content.vertical.medium {
210
- width: var(--sui-drawer-vertical-medium-width, 600px);
210
+ width: var(--sui-drawer-vertical-medium-width, var(--sui-drawer-vertical-width, 600px));
211
+ max-width: var(--sui-drawer-vertical-medium-max-width, var(--sui-drawer-vertical-max-width, calc(100dvw - 56px)));
212
+ height: var(--sui-drawer-vertical-medium-height, var(--sui-drawer-vertical-height, 100dvh));
211
213
  }
212
214
  .content.vertical.large {
213
- width: var(--sui-drawer-vertical-large-width, 800px);
215
+ width: var(--sui-drawer-vertical-large-width, var(--sui-drawer-vertical-width, 800px));
216
+ max-width: var(--sui-drawer-vertical-large-max-width, var(--sui-drawer-vertical-max-width, calc(100dvw - 56px)));
217
+ height: var(--sui-drawer-vertical-large-height, var(--sui-drawer-vertical-height, 100dvh));
214
218
  }
215
219
  .content.vertical.x-large {
216
- width: var(--sui-drawer-vertical-x-large-width, 1000px);
220
+ width: var(--sui-drawer-vertical-x-large-width, var(--sui-drawer-vertical-width, 1000px));
221
+ max-width: var(--sui-drawer-vertical-x-large-max-width, var(--sui-drawer-vertical-max-width, calc(100dvw - 56px)));
222
+ height: var(--sui-drawer-vertical-x-large-height, var(--sui-drawer-vertical-height, 100dvh));
217
223
  }
218
224
  .content.vertical.full {
219
225
  width: 100dvw;
@@ -221,11 +227,11 @@
221
227
  height: 100dvh;
222
228
  }
223
229
  .content.top {
224
- inset: 0 0 auto 0;
230
+ inset: var(--sui-drawer-top-content-inset, 0 0 auto 0);
225
231
  border-radius: var(--sui-drawer-top-content-border-radius, var(--sui-drawer-content-border-radius, 0 0 4px 4px));
226
232
  }
227
233
  .content.top.full {
228
- border-radius: var(--sui-drawer-top-full-content-border-radius, 0);
234
+ border-radius: var(--sui-drawer-top-full-content-border-radius, var(--sui-drawer-top-content-border-radius, 0));
229
235
  }
230
236
  .content.top .extra-control {
231
237
  inset: 100% 0 auto auto;
@@ -234,11 +240,11 @@
234
240
  transform: translateY(-105%);
235
241
  }
236
242
  .content.bottom {
237
- inset: auto 0 0 0;
243
+ inset: var(--sui-drawer-bottom-content-inset, auto 0 0 0);
238
244
  border-radius: var(--sui-drawer-bottom-content-border-radius, var(--sui-drawer-content-border-radius, 4px 4px 0 0));
239
245
  }
240
246
  .content.bottom.full {
241
- border-radius: var(--sui-drawer-bottom-full-content-border-radius, 0);
247
+ border-radius: var(--sui-drawer-bottom-full-content-border-radius, var(--sui-drawer-bottom-content-border-radius, 0));
242
248
  }
243
249
  .content.bottom .extra-control {
244
250
  inset: auto 0 100% auto;
@@ -246,24 +252,28 @@
246
252
  :global(dialog:not(.open)) .content.bottom {
247
253
  transform: translateY(105%);
248
254
  }
249
- .content.horizontal {
250
- width: var(--sui-drawer-horizontal-width, 100dvw);
251
- max-height: var(--sui-drawer-horizontal-max-height, calc(100dvh - 56px));
252
- }
253
255
  :global(dialog.open) .content.horizontal {
254
256
  transform: translateY(0%);
255
257
  }
256
258
  .content.horizontal.small {
257
- height: var(--sui-drawer-horizontal-small-height, 400px);
259
+ width: var(--sui-drawer-horizontal-small-width, var(--sui-drawer-horizontal-width, 100dvw));
260
+ height: var(--sui-drawer-horizontal-small-height, var(--sui-drawer-horizontal-height, 400px));
261
+ max-height: var(--sui-drawer-horizontal-small-max-height, var(--sui-drawer-horizontal-max-height, calc(100dvh - 56px)));
258
262
  }
259
263
  .content.horizontal.medium {
260
- height: var(--sui-drawer-horizontal-medium-height, 600px);
264
+ width: var(--sui-drawer-horizontal-medium-width, var(--sui-drawer-horizontal-width, 100dvw));
265
+ height: var(--sui-drawer-horizontal-medium-height, var(--sui-drawer-horizontal-height, 600px));
266
+ max-height: var(--sui-drawer-horizontal-medium-max-height, var(--sui-drawer-horizontal-max-height, calc(100dvh - 56px)));
261
267
  }
262
268
  .content.horizontal.large {
263
- height: var(--sui-drawer-horizontal-large-height, 800px);
269
+ width: var(--sui-drawer-horizontal-large-width, var(--sui-drawer-horizontal-width, 100dvw));
270
+ height: var(--sui-drawer-horizontal-large-height, var(--sui-drawer-horizontal-height, 800px));
271
+ max-height: var(--sui-drawer-horizontal-large-max-height, var(--sui-drawer-horizontal-max-height, calc(100dvh - 56px)));
264
272
  }
265
273
  .content.horizontal.x-large {
266
- height: var(--sui-drawer-horizontal-x-large-height, 1000px);
274
+ width: var(--sui-drawer-horizontal-x-large-width, var(--sui-drawer-horizontal-width, 100dvw));
275
+ height: var(--sui-drawer-horizontal-x-large-height, var(--sui-drawer-horizontal-height, 1000px));
276
+ max-height: var(--sui-drawer-horizontal-x-large-max-height, var(--sui-drawer-horizontal-max-height, calc(100dvh - 56px)));
267
277
  }
268
278
  .content.horizontal.full {
269
279
  width: 100dvw;
@@ -26,6 +26,9 @@ export default class Drawer extends SvelteComponent<{
26
26
  } & {
27
27
  [evt: string]: CustomEvent<any>;
28
28
  }, {
29
+ 'extra-content': {
30
+ slot: string;
31
+ };
29
32
  'close-button': {
30
33
  slot: string;
31
34
  };
@@ -62,6 +65,9 @@ declare const __propDef: {
62
65
  [evt: string]: CustomEvent<any>;
63
66
  };
64
67
  slots: {
68
+ 'extra-content': {
69
+ slot: string;
70
+ };
65
71
  'close-button': {
66
72
  slot: string;
67
73
  };
@@ -6,6 +6,7 @@
6
6
 
7
7
  <script>
8
8
  import { createEventDispatcher, onMount } from 'svelte';
9
+ import { sleep } from '../../services/util';
9
10
 
10
11
  /**
11
12
  * The `class` attribute on the `<dialog>` element.
@@ -98,13 +99,11 @@
98
99
  (document.querySelector('.sui.app-shell') ?? document.body).appendChild(dialog);
99
100
  showContent = true;
100
101
  dialog.showModal();
101
-
102
- window.requestAnimationFrame(async () => {
103
- dispatch('open');
104
- setOpenClass = true;
105
- await waitForTransition();
106
- setActiveClass = true;
107
- });
102
+ dispatch('open');
103
+ await sleep(100);
104
+ setOpenClass = true;
105
+ await waitForTransition();
106
+ setActiveClass = true;
108
107
  };
109
108
 
110
109
  /**
@@ -186,7 +185,7 @@
186
185
  }
187
186
  }}
188
187
  >
189
- <slot name="always-show" />
188
+ <slot name="extra-content" />
190
189
  {#if showContent || keepContent}
191
190
  <slot />
192
191
  {/if}
@@ -21,7 +21,7 @@ export default class Modal extends SvelteComponent<{
21
21
  } & {
22
22
  [evt: string]: CustomEvent<any>;
23
23
  }, {
24
- 'always-show': {};
24
+ 'extra-content': {};
25
25
  default: {};
26
26
  }> {
27
27
  get close(): (returnValue: string) => void;
@@ -76,7 +76,7 @@ declare const __propDef: {
76
76
  [evt: string]: CustomEvent<any>;
77
77
  };
78
78
  slots: {
79
- 'always-show': {};
79
+ 'extra-content': {};
80
80
  default: {};
81
81
  };
82
82
  };
@@ -130,6 +130,7 @@
130
130
  }
131
131
  }}
132
132
  >
133
+ <slot name="extra-content" slot="extra-content" />
133
134
  <div
134
135
  role="none"
135
136
  class="content {className} {contentType}"
@@ -22,6 +22,9 @@ export default class Popup extends SvelteComponent<{
22
22
  } & {
23
23
  [evt: string]: CustomEvent<any>;
24
24
  }, {
25
+ 'extra-content': {
26
+ slot: string;
27
+ };
25
28
  default: {};
26
29
  }> {
27
30
  /**accessor*/
@@ -76,6 +79,9 @@ declare const __propDef: {
76
79
  [evt: string]: CustomEvent<any>;
77
80
  };
78
81
  slots: {
82
+ 'extra-content': {
83
+ slot: string;
84
+ };
79
85
  default: {};
80
86
  };
81
87
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltia/ui",
3
- "version": "0.10.3",
3
+ "version": "0.10.5",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -23,13 +23,13 @@
23
23
  "test:unit": "vitest"
24
24
  },
25
25
  "dependencies": {
26
- "svelte": "^4.2.8"
26
+ "svelte": "^4.2.9"
27
27
  },
28
28
  "devDependencies": {
29
- "@playwright/test": "^1.40.1",
30
- "@sveltejs/adapter-auto": "^3.1.0",
31
- "@sveltejs/kit": "^2.3.2",
32
- "@sveltejs/package": "^2.2.5",
29
+ "@playwright/test": "^1.41.1",
30
+ "@sveltejs/adapter-auto": "^3.1.1",
31
+ "@sveltejs/kit": "^2.4.1",
32
+ "@sveltejs/package": "^2.2.6",
33
33
  "@sveltejs/vite-plugin-svelte": "^3.0.1",
34
34
  "cspell": "^8.3.2",
35
35
  "eslint": "^8.56.0",
@@ -41,18 +41,18 @@
41
41
  "npm-run-all": "^4.1.5",
42
42
  "postcss": "^8.4.33",
43
43
  "postcss-html": "^1.6.0",
44
- "prettier": "^3.2.2",
44
+ "prettier": "^3.2.4",
45
45
  "prettier-plugin-svelte": "^3.1.2",
46
- "sass": "^1.69.7",
47
- "stylelint": "^16.1.0",
46
+ "sass": "^1.70.0",
47
+ "stylelint": "^16.2.0",
48
48
  "stylelint-config-recommended-scss": "^14.0.0",
49
49
  "stylelint-scss": "^6.0.0",
50
50
  "svelte-check": "^3.6.3",
51
51
  "svelte-i18n": "^4.0.0",
52
52
  "svelte-preprocess": "^5.1.3",
53
53
  "tslib": "^2.6.2",
54
- "vite": "^5.0.11",
55
- "vitest": "^1.2.0"
54
+ "vite": "^5.0.12",
55
+ "vitest": "^1.2.1"
56
56
  },
57
57
  "exports": {
58
58
  "./package.json": "./package.json",