@pretable/ui 0.0.8 → 0.0.10
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/grid.css +187 -0
- package/dist/themes/excel.css +3 -0
- package/dist/themes/material.css +3 -0
- package/package.json +1 -1
package/dist/grid.css
CHANGED
|
@@ -433,6 +433,193 @@
|
|
|
433
433
|
padding: 2px 4px;
|
|
434
434
|
}
|
|
435
435
|
|
|
436
|
+
/* ---- Drag-to-group panel (sub-project 3) ----------------------------- */
|
|
437
|
+
|
|
438
|
+
/* The strip above the header. @pretable/react sets its `height` inline —
|
|
439
|
+
the panel's height is layout math the surface has to know in JS, because
|
|
440
|
+
it is SUBTRACTED from viewportHeight — and reads it from this same token.
|
|
441
|
+
Mirrored here as a min-height so the token stays the single source for
|
|
442
|
+
both, and so a server-rendered panel has its height before hydration.
|
|
443
|
+
No calc(): a theme that misses the token would collapse the strip to
|
|
444
|
+
nothing rather than degrade. */
|
|
445
|
+
:where([data-pretable-group-panel]) {
|
|
446
|
+
box-sizing: border-box;
|
|
447
|
+
min-height: var(--pretable-group-panel-height);
|
|
448
|
+
gap: var(--pretable-cell-padding-x);
|
|
449
|
+
padding: 0 var(--pretable-cell-padding-x);
|
|
450
|
+
background: var(--pretable-bg-toolbar);
|
|
451
|
+
border: 1px solid var(--pretable-rule-strong);
|
|
452
|
+
border-bottom: 0;
|
|
453
|
+
border-radius: var(--pretable-radius) var(--pretable-radius) 0 0;
|
|
454
|
+
color: var(--pretable-text-header);
|
|
455
|
+
font-family: var(--pretable-font-sans);
|
|
456
|
+
font-size: var(--pretable-font-size-header);
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
/* The panel and the viewport are stacked in one box, so the two rounded
|
|
460
|
+
corners that now meet in the middle have to go — otherwise the strip
|
|
461
|
+
floats above a separately rounded card. */
|
|
462
|
+
:where(
|
|
463
|
+
[data-pretable-group-panel-wrapper] > [data-pretable-scroll-viewport]
|
|
464
|
+
) {
|
|
465
|
+
border-top-left-radius: 0;
|
|
466
|
+
border-top-right-radius: 0;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
/* A drop is pending over the panel. Present-or-absent rather than a value,
|
|
470
|
+
so it is selected on with an attribute-existence check.
|
|
471
|
+
`--pretable-selection-bg` rather than `--pretable-bg-hover`: Excel sets
|
|
472
|
+
hover to `transparent` on purpose, and a drop target that gives no
|
|
473
|
+
feedback in one of the two shipped themes is not feedback. */
|
|
474
|
+
:where([data-pretable-group-panel][data-pretable-group-panel-active]) {
|
|
475
|
+
background: var(--pretable-selection-bg);
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
:where([data-pretable-group-panel-empty]) {
|
|
479
|
+
color: var(--pretable-text-dim);
|
|
480
|
+
font-style: italic;
|
|
481
|
+
overflow: hidden;
|
|
482
|
+
text-overflow: ellipsis;
|
|
483
|
+
white-space: nowrap;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
:where([data-pretable-group-chip]) {
|
|
487
|
+
display: inline-flex;
|
|
488
|
+
align-items: center;
|
|
489
|
+
gap: 4px;
|
|
490
|
+
box-sizing: border-box;
|
|
491
|
+
max-width: 14em;
|
|
492
|
+
padding: 2px 4px;
|
|
493
|
+
border: 1px solid var(--pretable-rule);
|
|
494
|
+
border-radius: var(--pretable-radius);
|
|
495
|
+
background: var(--pretable-bg-grid);
|
|
496
|
+
color: var(--pretable-text-cell);
|
|
497
|
+
cursor: grab;
|
|
498
|
+
user-select: none;
|
|
499
|
+
/* The chip is a pointer drag handle; without this a touch drag scrolls
|
|
500
|
+
the page instead of reordering the level. */
|
|
501
|
+
touch-action: none;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
:where([data-pretable-group-chip]:focus-visible) {
|
|
505
|
+
outline: 2px solid var(--pretable-focus-ring);
|
|
506
|
+
outline-offset: 1px;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
:where([data-pretable-group-chip][data-pretable-chip-dragging]) {
|
|
510
|
+
opacity: 0.5;
|
|
511
|
+
cursor: grabbing;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
/* Grip dots, drawn rather than added to the DOM — the handle is an empty,
|
|
515
|
+
aria-hidden span so it costs no accessible content. */
|
|
516
|
+
:where([data-pretable-chip-handle]) {
|
|
517
|
+
flex: none;
|
|
518
|
+
width: 5px;
|
|
519
|
+
height: 12px;
|
|
520
|
+
background-image: radial-gradient(currentColor 40%, transparent 45%);
|
|
521
|
+
background-size: 3px 4px;
|
|
522
|
+
color: var(--pretable-text-dim);
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
:where([data-pretable-chip-label]) {
|
|
526
|
+
min-width: 0;
|
|
527
|
+
overflow: hidden;
|
|
528
|
+
text-overflow: ellipsis;
|
|
529
|
+
white-space: nowrap;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
:where([data-pretable-chip-remove]) {
|
|
533
|
+
flex: none;
|
|
534
|
+
display: inline-flex;
|
|
535
|
+
align-items: center;
|
|
536
|
+
justify-content: center;
|
|
537
|
+
width: 14px;
|
|
538
|
+
height: 14px;
|
|
539
|
+
padding: 0;
|
|
540
|
+
border: 0;
|
|
541
|
+
border-radius: var(--pretable-radius);
|
|
542
|
+
background: transparent;
|
|
543
|
+
color: var(--pretable-text-dim);
|
|
544
|
+
font-size: 10px;
|
|
545
|
+
line-height: 1;
|
|
546
|
+
cursor: pointer;
|
|
547
|
+
}
|
|
548
|
+
:where([data-pretable-chip-remove]:hover) {
|
|
549
|
+
background: var(--pretable-selection-bg);
|
|
550
|
+
color: var(--pretable-text-cell);
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
/* The gap between two chips that a drop would land in. A zero-content span,
|
|
554
|
+
so every pixel of it is this rule. */
|
|
555
|
+
:where([data-pretable-chip-drop-indicator]) {
|
|
556
|
+
flex: none;
|
|
557
|
+
align-self: stretch;
|
|
558
|
+
width: 2px;
|
|
559
|
+
margin: 4px 0;
|
|
560
|
+
background: var(--pretable-reorder-drop-indicator);
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
/* ---- Column menu (sub-project 3) ------------------------------------- */
|
|
564
|
+
|
|
565
|
+
/* Same reveal model as the funnel it sits beside: invisible until the header
|
|
566
|
+
row is hovered, the button is keyboard-focused, or its menu is open. The
|
|
567
|
+
open case matters — without it the button vanishes the moment the pointer
|
|
568
|
+
leaves the header, while its own menu is still up. */
|
|
569
|
+
:where([data-pretable-column-menu-button]) {
|
|
570
|
+
display: inline-flex;
|
|
571
|
+
align-items: center;
|
|
572
|
+
justify-content: center;
|
|
573
|
+
width: 18px;
|
|
574
|
+
height: 18px;
|
|
575
|
+
padding: 0;
|
|
576
|
+
border: 0;
|
|
577
|
+
border-radius: var(--pretable-radius);
|
|
578
|
+
background: transparent;
|
|
579
|
+
color: var(--pretable-text-dim);
|
|
580
|
+
cursor: pointer;
|
|
581
|
+
opacity: 0;
|
|
582
|
+
transition: opacity 0.1s ease;
|
|
583
|
+
}
|
|
584
|
+
:where([data-pretable-header-row]:hover [data-pretable-column-menu-button]),
|
|
585
|
+
:where([data-pretable-column-menu-button]:focus-visible),
|
|
586
|
+
:where([data-pretable-column-menu-button][aria-expanded="true"]) {
|
|
587
|
+
opacity: 1;
|
|
588
|
+
}
|
|
589
|
+
:where([data-pretable-column-menu-button]:hover) {
|
|
590
|
+
background: var(--pretable-selection-bg);
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
/* The popover itself takes its surface from [data-pretable-popover]. */
|
|
594
|
+
:where([data-pretable-column-menu]) {
|
|
595
|
+
display: flex;
|
|
596
|
+
flex-direction: column;
|
|
597
|
+
padding: 4px;
|
|
598
|
+
box-shadow: var(--pretable-reorder-ghost-shadow);
|
|
599
|
+
/* Portaled into <body>, so nothing is inherited from the viewport. */
|
|
600
|
+
font-family: var(--pretable-font-sans);
|
|
601
|
+
font-size: var(--pretable-font-size-cell);
|
|
602
|
+
}
|
|
603
|
+
:where([data-pretable-menu-item]) {
|
|
604
|
+
display: block;
|
|
605
|
+
width: 100%;
|
|
606
|
+
padding: 6px 8px;
|
|
607
|
+
border: 0;
|
|
608
|
+
border-radius: var(--pretable-radius);
|
|
609
|
+
background: transparent;
|
|
610
|
+
color: var(--pretable-text-cell);
|
|
611
|
+
font: inherit;
|
|
612
|
+
text-align: left;
|
|
613
|
+
cursor: pointer;
|
|
614
|
+
}
|
|
615
|
+
:where([data-pretable-menu-item]:hover) {
|
|
616
|
+
background: var(--pretable-selection-bg);
|
|
617
|
+
}
|
|
618
|
+
:where([data-pretable-menu-item]:focus-visible) {
|
|
619
|
+
outline: 2px solid var(--pretable-focus-ring);
|
|
620
|
+
outline-offset: -2px;
|
|
621
|
+
}
|
|
622
|
+
|
|
436
623
|
/* Enum combobox listbox (cell editor) */
|
|
437
624
|
:where([data-pretable-enum-editor]) {
|
|
438
625
|
display: block;
|
package/dist/themes/excel.css
CHANGED
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
/* Density — natural default = compact (Excel "Compact" tier) */
|
|
56
56
|
--pretable-row-height: 20px; /* 15pt at 96 DPI */
|
|
57
57
|
--pretable-header-height: 24px;
|
|
58
|
+
--pretable-group-panel-height: 28px; /* drag-to-group strip above the header */
|
|
58
59
|
--pretable-cell-padding-x: 6px;
|
|
59
60
|
--pretable-group-indent: 12px;
|
|
60
61
|
--pretable-cell-padding-y: 2px;
|
|
@@ -74,6 +75,7 @@
|
|
|
74
75
|
[data-density="standard"] {
|
|
75
76
|
--pretable-row-height: 24px;
|
|
76
77
|
--pretable-header-height: 32px;
|
|
78
|
+
--pretable-group-panel-height: 34px;
|
|
77
79
|
--pretable-cell-padding-x: 8px;
|
|
78
80
|
--pretable-group-indent: 16px;
|
|
79
81
|
--pretable-cell-padding-y: 4px;
|
|
@@ -84,6 +86,7 @@
|
|
|
84
86
|
[data-density="spacious"] {
|
|
85
87
|
--pretable-row-height: 32px;
|
|
86
88
|
--pretable-header-height: 40px;
|
|
89
|
+
--pretable-group-panel-height: 42px;
|
|
87
90
|
--pretable-cell-padding-x: 12px;
|
|
88
91
|
--pretable-group-indent: 20px;
|
|
89
92
|
--pretable-cell-padding-y: 8px;
|
package/dist/themes/material.css
CHANGED
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
/* Density — natural default = standard */
|
|
59
59
|
--pretable-row-height: 48px;
|
|
60
60
|
--pretable-header-height: 52px;
|
|
61
|
+
--pretable-group-panel-height: 44px; /* drag-to-group strip above the header */
|
|
61
62
|
--pretable-cell-padding-x: 16px;
|
|
62
63
|
--pretable-group-indent: 24px;
|
|
63
64
|
--pretable-cell-padding-y: 12px;
|
|
@@ -76,6 +77,7 @@
|
|
|
76
77
|
[data-density="compact"] {
|
|
77
78
|
--pretable-row-height: 40px;
|
|
78
79
|
--pretable-header-height: 44px;
|
|
80
|
+
--pretable-group-panel-height: 36px;
|
|
79
81
|
--pretable-cell-padding-x: 12px;
|
|
80
82
|
--pretable-group-indent: 20px;
|
|
81
83
|
--pretable-cell-padding-y: 6px;
|
|
@@ -86,6 +88,7 @@
|
|
|
86
88
|
[data-density="spacious"] {
|
|
87
89
|
--pretable-row-height: 56px;
|
|
88
90
|
--pretable-header-height: 64px;
|
|
91
|
+
--pretable-group-panel-height: 52px;
|
|
89
92
|
--pretable-cell-padding-x: 24px;
|
|
90
93
|
--pretable-group-indent: 32px;
|
|
91
94
|
--pretable-cell-padding-y: 16px;
|