@snap-rail/ui 0.2.0 → 0.4.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/lib/charts.js +7 -1
- package/lib/components/index.js +2182 -0
- package/lib/contract.js +20 -12
- package/lib/fallback.js +47 -8
- package/lib/index.js +766 -558
- package/lib/runtime.js +113 -138
- package/lib/settings-pages/index.js +1359 -0
- package/lib/settings.js +97 -58
- package/lib/types/components/alert.js +7 -7
- package/lib/types/components/button.js +2 -2
- package/lib/types/components/combobox.d.ts +45 -0
- package/lib/types/components/combobox.js +108 -0
- package/lib/types/components/controls.js +16 -16
- package/lib/types/components/dialog.js +1 -1
- package/lib/types/components/index.d.ts +1 -0
- package/lib/types/components/index.js +1 -0
- package/lib/types/components/input.js +3 -3
- package/lib/types/components/overlay.d.ts +26 -20
- package/lib/types/components/overlay.js +99 -67
- package/lib/types/components/slider.js +1 -1
- package/lib/types/components/surface.js +12 -12
- package/lib/types/contract.d.ts +6 -5
- package/lib/types/contract.js +6 -5
- package/lib/types/utils.d.ts +7 -1
- package/lib/types/utils.js +7 -1
- package/package.json +9 -9
- package/src/styles/base.css +107 -17
- package/src/styles/default.css +59 -19
package/src/styles/base.css
CHANGED
|
@@ -178,6 +178,12 @@
|
|
|
178
178
|
text-align: left;
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
+
/* Headers never wrap: narrow panes get a wider scrollable table instead of
|
|
182
|
+
* vertically stacked glyphs. */
|
|
183
|
+
[data-snap-part='table.head'] {
|
|
184
|
+
white-space: nowrap;
|
|
185
|
+
}
|
|
186
|
+
|
|
181
187
|
[data-snap-part='card.root'],
|
|
182
188
|
[data-snap-part='panel.root'] {
|
|
183
189
|
display: flex;
|
|
@@ -352,9 +358,31 @@
|
|
|
352
358
|
min-height: 0;
|
|
353
359
|
}
|
|
354
360
|
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
361
|
+
/* TouchSelect fills its container like every other form control (the
|
|
362
|
+
* Input family defaults to width:100%); parts anchor the layout because
|
|
363
|
+
* the trigger/sheet wrappers also carry the component tag. */
|
|
364
|
+
[data-snap-part='touch-select.root'] {
|
|
365
|
+
display: flex;
|
|
366
|
+
width: 100%;
|
|
367
|
+
min-width: 0;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
[data-snap-part='touch-select.trigger'] {
|
|
371
|
+
display: flex;
|
|
372
|
+
flex: 1;
|
|
373
|
+
min-width: 0;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
[data-snap-part='touch-select.trigger'] > [data-snap-component='button'] {
|
|
377
|
+
width: 100%;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
[data-snap-part='touch-select.sheet'] {
|
|
381
|
+
display: flex;
|
|
382
|
+
flex: 1;
|
|
383
|
+
flex-direction: column;
|
|
384
|
+
gap: var(--snap-space-sm);
|
|
385
|
+
min-height: 0;
|
|
358
386
|
}
|
|
359
387
|
|
|
360
388
|
[data-snap-part='radio-group.block'] {
|
|
@@ -401,6 +429,49 @@
|
|
|
401
429
|
z-index: var(--snap-z-overlay);
|
|
402
430
|
}
|
|
403
431
|
|
|
432
|
+
/* A popover tracks its anchor: at least as wide, wider when content asks
|
|
433
|
+
* (the popper exposes the anchor width as a CSS variable). */
|
|
434
|
+
[data-snap-part='popover.content'] {
|
|
435
|
+
min-width: var(--radix-popper-anchor-width);
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
[data-snap-part='combobox.root'] {
|
|
439
|
+
display: flex;
|
|
440
|
+
width: 100%;
|
|
441
|
+
min-width: 0;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
[data-snap-part='combobox.anchor'] {
|
|
445
|
+
display: block;
|
|
446
|
+
flex: 1;
|
|
447
|
+
min-width: 0;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
[data-snap-part='combobox.list'] {
|
|
451
|
+
display: flex;
|
|
452
|
+
flex-direction: column;
|
|
453
|
+
max-height: 320px;
|
|
454
|
+
overflow: auto;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
[data-snap-part='combobox.option'] {
|
|
458
|
+
display: flex;
|
|
459
|
+
align-items: center;
|
|
460
|
+
min-height: var(--snap-control-height-md);
|
|
461
|
+
padding-inline: var(--snap-space-md);
|
|
462
|
+
cursor: pointer;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
[data-snap-part='combobox.option'][data-disabled] {
|
|
466
|
+
color: var(--snap-color-muted);
|
|
467
|
+
cursor: default;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
[data-snap-part='combobox.empty'] {
|
|
471
|
+
padding: var(--snap-space-sm) var(--snap-space-md);
|
|
472
|
+
color: var(--snap-color-muted);
|
|
473
|
+
}
|
|
474
|
+
|
|
404
475
|
[data-snap-part='menu.item'],
|
|
405
476
|
[data-snap-part='menu.checkbox-item'] {
|
|
406
477
|
display: flex;
|
|
@@ -414,23 +485,41 @@
|
|
|
414
485
|
background: var(--snap-color-border);
|
|
415
486
|
}
|
|
416
487
|
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
z-index: var(--snap-z-modal);
|
|
422
|
-
display: flex;
|
|
423
|
-
flex-direction: column;
|
|
424
|
-
gap: var(--snap-space-sm);
|
|
425
|
-
margin: 0;
|
|
488
|
+
/* Toast (Sonner hosts the queue; these fit it to the semantic scale).
|
|
489
|
+
* The stylesheet ships with the app boot, so the structural rules here are
|
|
490
|
+
* written to out-last its defaults by loading order and specificity. */
|
|
491
|
+
[data-sonner-toast] {
|
|
426
492
|
padding: var(--snap-space-md);
|
|
427
|
-
|
|
493
|
+
gap: var(--snap-space-sm);
|
|
494
|
+
font-size: var(--snap-text-sm);
|
|
428
495
|
}
|
|
429
496
|
|
|
430
|
-
[data-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
497
|
+
[data-sonner-toast] [data-icon] {
|
|
498
|
+
width: 1.15em;
|
|
499
|
+
height: 1.15em;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
[data-sonner-toast] [data-icon] svg {
|
|
503
|
+
display: block;
|
|
504
|
+
width: 100%;
|
|
505
|
+
height: 100%;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
[data-sonner-toast] [data-content] {
|
|
509
|
+
/* keep clear of the absolutely-positioned close button */
|
|
510
|
+
padding-right: var(--snap-space-lg);
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
[data-sonner-toast] [data-close-button] {
|
|
514
|
+
/* always reachable on touch: pinned top-right, visible without hover */
|
|
515
|
+
top: 0;
|
|
516
|
+
right: 0;
|
|
517
|
+
left: auto;
|
|
518
|
+
opacity: 1;
|
|
519
|
+
width: 28px;
|
|
520
|
+
height: 28px;
|
|
521
|
+
border: 0;
|
|
522
|
+
background: transparent;
|
|
434
523
|
}
|
|
435
524
|
|
|
436
525
|
[data-snap-part='alert.root'] {
|
|
@@ -478,6 +567,7 @@
|
|
|
478
567
|
display: flex;
|
|
479
568
|
align-items: center;
|
|
480
569
|
gap: var(--snap-space-sm);
|
|
570
|
+
padding-inline: var(--snap-space-md);
|
|
481
571
|
min-height: var(--snap-control-height-md);
|
|
482
572
|
min-width: 0;
|
|
483
573
|
}
|
package/src/styles/default.css
CHANGED
|
@@ -538,45 +538,75 @@
|
|
|
538
538
|
font-size: var(--snap-text-xs);
|
|
539
539
|
}
|
|
540
540
|
|
|
541
|
-
:is([data-snap-skin='default-light'], [data-snap-skin='default-dark']) [data-
|
|
541
|
+
:is([data-snap-skin='default-light'], [data-snap-skin='default-dark']) [data-sonner-toaster] {
|
|
542
|
+
z-index: var(--snap-z-toast);
|
|
543
|
+
--border-radius: var(--snap-radius-md);
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
:is([data-snap-skin='default-light'], [data-snap-skin='default-dark']) [data-sonner-toast] {
|
|
542
547
|
min-width: 280px;
|
|
543
|
-
max-width:
|
|
548
|
+
max-width: 380px;
|
|
544
549
|
border: var(--snap-border-width) solid var(--snap-color-border);
|
|
545
550
|
border-radius: var(--snap-radius-md);
|
|
546
551
|
background: var(--snap-color-surface-raised);
|
|
547
|
-
|
|
552
|
+
color: var(--snap-color-text);
|
|
548
553
|
box-shadow: var(--snap-shadow-lg);
|
|
549
554
|
}
|
|
550
555
|
|
|
551
|
-
|
|
552
|
-
|
|
556
|
+
/* intent reads through a translucent tint and the icon colour; the frame
|
|
557
|
+
* stays neutral */
|
|
558
|
+
:is([data-snap-skin='default-light'], [data-snap-skin='default-dark']) [data-sonner-toast][data-type='success'] {
|
|
559
|
+
background: color-mix(in srgb, var(--snap-color-success) 10%, var(--snap-color-surface-raised));
|
|
553
560
|
}
|
|
554
561
|
|
|
555
|
-
:is([data-snap-skin='default-light'], [data-snap-skin='default-dark']) [data-
|
|
556
|
-
|
|
562
|
+
:is([data-snap-skin='default-light'], [data-snap-skin='default-dark']) [data-sonner-toast][data-type='warning'] {
|
|
563
|
+
background: color-mix(in srgb, var(--snap-color-warning) 10%, var(--snap-color-surface-raised));
|
|
557
564
|
}
|
|
558
565
|
|
|
559
|
-
:is([data-snap-skin='default-light'], [data-snap-skin='default-dark']) [data-
|
|
560
|
-
|
|
566
|
+
:is([data-snap-skin='default-light'], [data-snap-skin='default-dark']) [data-sonner-toast][data-type='error'] {
|
|
567
|
+
background: color-mix(in srgb, var(--snap-color-danger) 10%, var(--snap-color-surface-raised));
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
:is([data-snap-skin='default-light'], [data-snap-skin='default-dark']) [data-sonner-toast].snap-intent-primary {
|
|
571
|
+
background: color-mix(in srgb, var(--snap-color-primary) 8%, var(--snap-color-surface-raised));
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
:is([data-snap-skin='default-light'], [data-snap-skin='default-dark']) [data-sonner-toast] [data-icon] {
|
|
575
|
+
color: var(--snap-color-muted);
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
:is([data-snap-skin='default-light'], [data-snap-skin='default-dark']) [data-sonner-toast][data-type='success'] [data-icon] {
|
|
579
|
+
color: var(--snap-color-success);
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
:is([data-snap-skin='default-light'], [data-snap-skin='default-dark']) [data-sonner-toast][data-type='warning'] [data-icon] {
|
|
583
|
+
color: var(--snap-color-warning);
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
:is([data-snap-skin='default-light'], [data-snap-skin='default-dark']) [data-sonner-toast][data-type='error'] [data-icon] {
|
|
587
|
+
color: var(--snap-color-danger);
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
:is([data-snap-skin='default-light'], [data-snap-skin='default-dark']) [data-sonner-toast].snap-intent-primary [data-icon] {
|
|
591
|
+
color: var(--snap-color-primary);
|
|
561
592
|
}
|
|
562
593
|
|
|
563
|
-
:is([data-snap-skin='default-light'], [data-snap-skin='default-dark']) [data-
|
|
594
|
+
:is([data-snap-skin='default-light'], [data-snap-skin='default-dark']) [data-sonner-toast] [data-title] {
|
|
564
595
|
font-weight: var(--snap-weight-medium);
|
|
565
596
|
}
|
|
566
597
|
|
|
567
|
-
:is([data-snap-skin='default-light'], [data-snap-skin='default-dark']) [data-
|
|
598
|
+
:is([data-snap-skin='default-light'], [data-snap-skin='default-dark']) [data-sonner-toast] [data-description] {
|
|
568
599
|
color: var(--snap-color-muted);
|
|
569
|
-
|
|
600
|
+
opacity: 1;
|
|
570
601
|
}
|
|
571
602
|
|
|
572
|
-
:is([data-snap-skin='default-light'], [data-snap-skin='default-dark']) [data-
|
|
573
|
-
position: absolute;
|
|
574
|
-
top: var(--snap-space-sm);
|
|
575
|
-
right: var(--snap-space-sm);
|
|
576
|
-
border: 0;
|
|
577
|
-
background: transparent;
|
|
603
|
+
:is([data-snap-skin='default-light'], [data-snap-skin='default-dark']) [data-sonner-toast] [data-close-button] {
|
|
578
604
|
color: var(--snap-color-muted);
|
|
579
|
-
|
|
605
|
+
border-radius: var(--snap-radius-full);
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
:is([data-snap-skin='default-light'], [data-snap-skin='default-dark']) [data-sonner-toast] [data-close-button]:hover {
|
|
609
|
+
background: color-mix(in srgb, var(--snap-color-muted) 18%, transparent);
|
|
580
610
|
}
|
|
581
611
|
|
|
582
612
|
/* Alerts / separator / skeleton / list / slider ---------------------- */
|
|
@@ -654,6 +684,16 @@
|
|
|
654
684
|
background: var(--snap-color-surface-raised);
|
|
655
685
|
}
|
|
656
686
|
|
|
687
|
+
:is([data-snap-skin='default-light'], [data-snap-skin='default-dark']) [data-snap-part='combobox.option']:hover,
|
|
688
|
+
:is([data-snap-skin='default-light'], [data-snap-skin='default-dark']) [data-snap-part='combobox.option'][data-active] {
|
|
689
|
+
background: var(--snap-color-surface);
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
:is([data-snap-skin='default-light'], [data-snap-skin='default-dark']) [data-snap-part='combobox.option'][aria-selected='true'] {
|
|
693
|
+
background: var(--snap-color-surface-raised);
|
|
694
|
+
font-weight: 600;
|
|
695
|
+
}
|
|
696
|
+
|
|
657
697
|
:is([data-snap-skin='default-light'], [data-snap-skin='default-dark']) [data-snap-part='list.leading'],
|
|
658
698
|
:is([data-snap-skin='default-light'], [data-snap-skin='default-dark']) [data-snap-part='list.trailing'] {
|
|
659
699
|
color: var(--snap-color-muted);
|