@ibobbyts/svelte-ui-utils 0.4.7 → 0.5.0

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/style.css CHANGED
@@ -217,96 +217,6 @@
217
217
  }
218
218
  }
219
219
 
220
- .suu-dropdown-search {
221
- position: relative;
222
- width: 100%;
223
- font-family: var(--suu-font);
224
- }
225
-
226
- .suu-dropdown-search--multi {
227
- display: grid;
228
- gap: 8px;
229
- }
230
-
231
- .suu-dropdown-search__selected-items {
232
- display: flex;
233
- flex-wrap: wrap;
234
- gap: 6px;
235
- min-width: 0;
236
- }
237
-
238
- .suu-dropdown-search__selected-item {
239
- display: inline-flex;
240
- align-items: center;
241
- max-width: 100%;
242
- min-height: 30px;
243
- gap: 6px;
244
- padding: 4px 6px 4px 10px;
245
- border: 1px solid color-mix(in srgb, var(--suu-color-accent) 34%, var(--suu-color-border));
246
- border-radius: var(--suu-radius-pill);
247
- background: color-mix(in srgb, var(--suu-color-accent) 9%, var(--suu-color-bg));
248
- color: var(--suu-color-text);
249
- font-size: 0.875rem;
250
- }
251
-
252
- .suu-dropdown-search__selected-title {
253
- min-width: 0;
254
- overflow: hidden;
255
- text-overflow: ellipsis;
256
- white-space: nowrap;
257
- }
258
-
259
- .suu-dropdown-search__selected-remove {
260
- display: inline-grid;
261
- flex: 0 0 auto;
262
- place-items: center;
263
- width: 1.25rem;
264
- height: 1.25rem;
265
- padding: 0;
266
- border: 0;
267
- border-radius: var(--suu-radius-pill);
268
- background: transparent;
269
- color: var(--suu-color-muted);
270
- cursor: pointer;
271
- }
272
-
273
- .suu-dropdown-search__selected-remove:hover,
274
- .suu-dropdown-search__selected-remove:focus-visible {
275
- background: color-mix(in srgb, var(--suu-color-accent) 14%, transparent);
276
- color: var(--suu-color-text);
277
- outline: none;
278
- }
279
-
280
- .suu-dropdown-search__selected-remove svg {
281
- width: 0.875rem;
282
- height: 0.875rem;
283
- fill: none;
284
- stroke: currentColor;
285
- stroke-width: 2;
286
- stroke-linecap: round;
287
- }
288
-
289
- .suu-dropdown-search__field {
290
- position: relative;
291
- }
292
-
293
- .suu-dropdown-search__icon {
294
- position: absolute;
295
- top: 50%;
296
- left: 14px;
297
- z-index: 1;
298
- width: 1.25rem;
299
- height: 1.25rem;
300
- fill: none;
301
- stroke: var(--suu-color-muted);
302
- stroke-width: 2.2;
303
- stroke-linecap: round;
304
- stroke-linejoin: round;
305
- transform: translateY(-50%);
306
- pointer-events: none;
307
- }
308
-
309
- .suu-dropdown-search__input,
310
220
  .suu-pagination select {
311
221
  width: 100%;
312
222
  min-height: 42px;
@@ -317,196 +227,6 @@
317
227
  font: inherit;
318
228
  }
319
229
 
320
- .suu-dropdown-search__input {
321
- padding: 9px 14px 9px 44px;
322
- box-shadow: 0 1px 2px rgb(15 23 42 / 0.04) inset;
323
- transition:
324
- border-color 120ms ease,
325
- box-shadow 120ms ease;
326
- }
327
-
328
- .suu-dropdown-search__input:focus {
329
- border-color: var(--suu-color-accent);
330
- outline: 2px solid color-mix(in srgb, var(--suu-color-accent) 22%, transparent);
331
- outline-offset: 1px;
332
- box-shadow: 0 0 0 1px color-mix(in srgb, var(--suu-color-accent) 16%, transparent);
333
- }
334
-
335
- .suu-dropdown-search--valid .suu-dropdown-search__input {
336
- border-color: var(--suu-color-success);
337
- }
338
-
339
- .suu-dropdown-search--invalid .suu-dropdown-search__input,
340
- .suu-dropdown-search--error .suu-dropdown-search__input {
341
- border-color: var(--suu-color-error);
342
- }
343
-
344
- .suu-dropdown-search--has-clear .suu-dropdown-search__input {
345
- padding-right: 42px;
346
- }
347
-
348
- .suu-dropdown-search__clear {
349
- position: absolute;
350
- top: 50%;
351
- right: 9px;
352
- z-index: 2;
353
- display: inline-grid;
354
- place-items: center;
355
- width: 1.5rem;
356
- height: 1.5rem;
357
- padding: 0;
358
- border: 0;
359
- border-radius: var(--suu-radius-pill);
360
- background: transparent;
361
- color: var(--suu-color-muted);
362
- cursor: pointer;
363
- transform: translateY(-50%);
364
- }
365
-
366
- .suu-dropdown-search__clear:hover {
367
- background: var(--suu-color-surface);
368
- color: var(--suu-color-text);
369
- }
370
-
371
- .suu-dropdown-search__clear:focus-visible {
372
- outline: 2px solid color-mix(in srgb, var(--suu-color-accent) 35%, transparent);
373
- outline-offset: 2px;
374
- }
375
-
376
- .suu-dropdown-search__clear svg {
377
- width: 1rem;
378
- height: 1rem;
379
- fill: none;
380
- stroke: currentColor;
381
- stroke-width: 2;
382
- stroke-linecap: round;
383
- }
384
-
385
- .suu-dropdown-search__menu {
386
- position: absolute;
387
- top: calc(100% + 6px);
388
- right: 0;
389
- left: 0;
390
- z-index: 100;
391
- overflow: hidden;
392
- border: 1px solid var(--suu-color-border);
393
- border-radius: var(--suu-radius);
394
- background: var(--suu-color-bg);
395
- box-shadow: 0 18px 42px rgb(15 23 42 / 0.16);
396
- }
397
-
398
- .suu-dropdown-search__menu-panel {
399
- max-height: 260px;
400
- overflow-y: auto;
401
- background: var(--suu-color-bg);
402
- overscroll-behavior: contain;
403
- }
404
-
405
- .suu-dropdown-search__option {
406
- display: grid;
407
- grid-template-columns: minmax(0, 1fr);
408
- gap: 2px;
409
- width: 100%;
410
- padding: 9px 10px;
411
- border: 0;
412
- border-bottom: 1px solid var(--suu-color-border);
413
- background: transparent;
414
- color: var(--suu-color-text);
415
- text-align: left;
416
- cursor: pointer;
417
- font: inherit;
418
- }
419
-
420
- .suu-dropdown-search--multi .suu-dropdown-search__option {
421
- grid-template-columns: auto minmax(0, 1fr);
422
- align-items: center;
423
- column-gap: 8px;
424
- }
425
-
426
- .suu-dropdown-search__option:last-child {
427
- border-bottom: 0;
428
- }
429
-
430
- .suu-dropdown-search__option:hover,
431
- .suu-dropdown-search__option:focus-visible {
432
- background: var(--suu-color-surface);
433
- outline: none;
434
- }
435
-
436
- .suu-dropdown-search__option--disabled {
437
- color: var(--suu-color-muted);
438
- cursor: not-allowed;
439
- opacity: 0.65;
440
- }
441
-
442
- .suu-dropdown-search__option--selected {
443
- background: color-mix(in srgb, var(--suu-color-accent) 8%, var(--suu-color-bg));
444
- }
445
-
446
- .suu-dropdown-search__footer {
447
- border-top: 1px solid var(--suu-color-border);
448
- padding: 9px 10px;
449
- background: var(--suu-color-bg);
450
- color: var(--suu-color-muted);
451
- font-size: 0.875em;
452
- }
453
-
454
- .suu-dropdown-search__check {
455
- display: inline-grid;
456
- grid-row: 1 / span 2;
457
- place-items: center;
458
- width: 1rem;
459
- height: 1rem;
460
- border: 1px solid var(--suu-color-border-strong);
461
- border-radius: var(--suu-radius-xs);
462
- color: transparent;
463
- }
464
-
465
- .suu-dropdown-search__check svg {
466
- width: 0.76rem;
467
- height: 0.76rem;
468
- fill: none;
469
- stroke: currentColor;
470
- stroke-width: 2.6;
471
- stroke-linecap: round;
472
- stroke-linejoin: round;
473
- }
474
-
475
- .suu-dropdown-search__option--selected .suu-dropdown-search__check {
476
- border-color: var(--suu-color-accent);
477
- background: var(--suu-color-accent);
478
- color: var(--suu-color-accent-text);
479
- }
480
-
481
- .suu-dropdown-search__title {
482
- font-weight: 650;
483
- }
484
-
485
- .suu-dropdown-search__meta,
486
- .suu-dropdown-search__empty {
487
- color: var(--suu-color-muted);
488
- font-size: 0.875rem;
489
- }
490
-
491
- .suu-dropdown-search__empty {
492
- padding: 10px;
493
- }
494
-
495
- .suu-dropdown-search__empty--loading {
496
- display: flex;
497
- align-items: center;
498
- gap: 8px;
499
- }
500
-
501
- .suu-dropdown-search__spinner {
502
- width: 0.875rem;
503
- height: 0.875rem;
504
- border: 2px solid color-mix(in srgb, var(--suu-color-muted) 28%, transparent);
505
- border-top-color: var(--suu-color-accent);
506
- border-radius: var(--suu-radius-pill);
507
- animation: suu-dropdown-spinner 700ms linear infinite;
508
- }
509
-
510
230
  .suu-data-table {
511
231
  display: grid;
512
232
  gap: 0;
@@ -1287,10 +1007,20 @@
1287
1007
 
1288
1008
  .suu-dropdown__menu--portal {
1289
1009
  position: fixed;
1010
+ /* Must stay ahead of the top/left/right longhands below: an `inset` shorthand
1011
+ declared after them would reset the menu placement variables. Also resets
1012
+ the native popover UA styles (`inset: 0; margin: auto`). */
1013
+ inset: auto;
1290
1014
  top: var(--suu-dropdown-menu-top);
1291
1015
  right: var(--suu-dropdown-menu-right, auto);
1292
1016
  left: var(--suu-dropdown-menu-left, auto);
1017
+ bottom: auto;
1293
1018
  width: var(--suu-dropdown-menu-width, max-content);
1019
+ /* Fixed positioning makes the base `min-width: 100%` resolve against the
1020
+ viewport, which would stretch the menu to full width. */
1021
+ min-width: 0;
1022
+ margin: 0;
1023
+ padding: 0;
1294
1024
  z-index: 1200;
1295
1025
  }
1296
1026
 
@@ -1309,11 +1039,11 @@
1309
1039
  bottom: calc(100% + 6px);
1310
1040
  }
1311
1041
 
1312
- .suu-dropdown__menu--fit-content {
1042
+ .suu-dropdown__menu--fit-content:not(.suu-dropdown__menu--portal) {
1313
1043
  width: max-content;
1314
1044
  }
1315
1045
 
1316
- .suu-dropdown__menu--fit-content .suu-dropdown__panel {
1046
+ .suu-dropdown__menu--fit-content:not(.suu-dropdown__menu--portal) .suu-dropdown__panel {
1317
1047
  min-width: max-content;
1318
1048
  }
1319
1049
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ibobbyts/svelte-ui-utils",
3
- "version": "0.4.7",
4
- "description": "Reusable Svelte 5 UI utilities for dialogs, toast notifications, dropdown search, and data tables.",
3
+ "version": "0.5.0",
4
+ "description": "Reusable Svelte 5 UI utilities for dialogs, toast notifications, dropdowns, and data tables.",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -33,15 +33,6 @@
33
33
  "svelte": "./dist/dropdown/index.js",
34
34
  "default": "./dist/dropdown/index.js"
35
35
  },
36
- "./dropdown-search": {
37
- "types": "./dist/dropdown-search/index.d.ts",
38
- "svelte": "./dist/dropdown-search/index.js",
39
- "default": "./dist/dropdown-search/index.js"
40
- },
41
- "./dropdown-search/state": {
42
- "types": "./dist/dropdown-search/state.d.ts",
43
- "default": "./dist/dropdown-search/state.js"
44
- },
45
36
  "./dialog": {
46
37
  "types": "./dist/dialog/index.d.ts",
47
38
  "svelte": "./dist/dialog/index.js",