@pretable/ui 0.9.0 → 0.11.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/README.md +1 -1
- package/dist/index.cjs +57 -24
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +5 -3
- package/dist/index.d.cts.map +1 -0
- package/dist/{index.d.ts → index.d.mts} +5 -3
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +56 -22
- package/dist/index.mjs.map +1 -0
- package/{dist/grid.css → grid.css} +894 -14
- package/package.json +26 -18
- /package/{dist/grid.css.d.ts → grid.css.d.ts} +0 -0
- /package/{dist/tailwind.css → tailwind.css} +0 -0
- /package/{dist/tailwind.css.d.ts → tailwind.css.d.ts} +0 -0
- /package/{dist/themes → themes}/excel.css +0 -0
- /package/{dist/themes → themes}/excel.css.d.ts +0 -0
- /package/{dist/themes → themes}/material.css +0 -0
- /package/{dist/themes → themes}/material.css.d.ts +0 -0
- /package/{dist/themes → themes}/pretable.css +0 -0
- /package/{dist/themes → themes}/pretable.css.d.ts +0 -0
- /package/{dist/tokens.css → tokens.css} +0 -0
- /package/{dist/tokens.css.d.ts → tokens.css.d.ts} +0 -0
|
@@ -646,10 +646,14 @@
|
|
|
646
646
|
padding-top: var(--pretable-cell-padding-y);
|
|
647
647
|
}
|
|
648
648
|
|
|
649
|
+
/* The tool panel's visibility toggle is enrolled here rather than restyled
|
|
650
|
+
in its own section: it IS this checkbox, and two hand-kept copies of the
|
|
651
|
+
same control are how a theme edit makes them drift apart. */
|
|
649
652
|
:where(
|
|
650
653
|
button[data-pretable-row-select],
|
|
651
654
|
button[data-pretable-row-select-all],
|
|
652
|
-
button[data-pretable-bool-cell]
|
|
655
|
+
button[data-pretable-bool-cell],
|
|
656
|
+
button[data-pretable-tool-column-toggle]
|
|
653
657
|
) {
|
|
654
658
|
width: 16px;
|
|
655
659
|
height: 16px;
|
|
@@ -668,7 +672,8 @@
|
|
|
668
672
|
:where(
|
|
669
673
|
button[data-pretable-row-select][aria-checked="true"],
|
|
670
674
|
button[data-pretable-row-select-all][aria-checked="true"],
|
|
671
|
-
button[data-pretable-bool-cell][aria-checked="true"]
|
|
675
|
+
button[data-pretable-bool-cell][aria-checked="true"],
|
|
676
|
+
button[data-pretable-tool-column-toggle][aria-checked="true"]
|
|
672
677
|
) {
|
|
673
678
|
background: var(--pretable-checkbox-checked-bg);
|
|
674
679
|
border-color: var(--pretable-checkbox-checked-bg);
|
|
@@ -702,12 +707,60 @@
|
|
|
702
707
|
outline-offset: 1px;
|
|
703
708
|
}
|
|
704
709
|
|
|
710
|
+
/* ---- Header overlay slot geometry ------------------------------------ */
|
|
711
|
+
|
|
712
|
+
/* Where each of the three header controls sits, counted back from a column's
|
|
713
|
+
trailing edge. @pretable/react reads these from the inline styles it writes
|
|
714
|
+
on the slots — `left: var(--pretable-header-funnel-slot)` — and that
|
|
715
|
+
indirection is the whole point: while the offsets were inline LITERALS
|
|
716
|
+
(`left: -4`, `left: -22`, `left: -40`) nothing in any stylesheet could move
|
|
717
|
+
them, since an inline style beats every rule, `!important` and `@layer`
|
|
718
|
+
included. The anchor arithmetic stays in JS; only the offsets are themeable.
|
|
719
|
+
|
|
720
|
+
A fine pointer, as half-open intervals back from the trailing edge at 0:
|
|
721
|
+
|
|
722
|
+
resize strip [ -4, 0) 4px, and that box is its whole target
|
|
723
|
+
funnel glyph [-22, -4) 18px drawn
|
|
724
|
+
funnel target [-28, -4) 24px reachable — the `::after` further down
|
|
725
|
+
menu glyph [-46, -28) 18px drawn, and that box is its whole target
|
|
726
|
+
|
|
727
|
+
The funnel's 18px glyph carries a 24px tap target (the transparent
|
|
728
|
+
`::after` below), so it reaches to -28 and the menu has to start there, not
|
|
729
|
+
at -22 + 18 = -40. At -40 the menu button — later in tree order, same
|
|
730
|
+
stacking context — painted over the six pixels of funnel target that ran
|
|
731
|
+
underneath it, and the funnel's REACHABLE width measured 17: narrower than
|
|
732
|
+
the glyph you can see, which is the part that reads as broken. (Measured by
|
|
733
|
+
hit-test sweep, all three densities, both engines: -40 -> 17.0px reachable,
|
|
734
|
+
-46 -> 24.0px.) The six pixels come out of the header cell's sort area,
|
|
735
|
+
which is hundreds of px wide, instead of out of the funnel, which is 18.
|
|
736
|
+
|
|
737
|
+
WCAG 2.5.8 exempts pointer inputs from its 24px minimum, so 24 is not the
|
|
738
|
+
bar here — "not clipped by a sibling" is. That is also why the menu keeps
|
|
739
|
+
its 18px glyph as its whole target on a desktop rather than growing an
|
|
740
|
+
`::after` of its own: it is unclipped at 18, and a fourth 6px would be
|
|
741
|
+
spent on a control that is not failing anything.
|
|
742
|
+
|
|
743
|
+
There is no fourth token: a column that has a menu but no funnel puts the
|
|
744
|
+
menu in the funnel's slot, so @pretable/react reads the funnel token for
|
|
745
|
+
that case rather than declaring a duplicate. That case is deliberately NOT
|
|
746
|
+
re-spaced — with no funnel beside it there is nothing to clip. */
|
|
747
|
+
:where([data-pretable-header-overlays]) {
|
|
748
|
+
--pretable-header-resize-slot: -4px;
|
|
749
|
+
--pretable-header-funnel-slot: -22px;
|
|
750
|
+
--pretable-header-menu-slot: -46px;
|
|
751
|
+
}
|
|
752
|
+
|
|
705
753
|
/* Column resize handle (sub-project C) */
|
|
706
754
|
:where([data-pretable-resize-handle]) {
|
|
707
755
|
position: absolute;
|
|
708
756
|
top: 0;
|
|
709
|
-
|
|
710
|
-
|
|
757
|
+
/* The strip spans from its slot to the column's trailing edge, so its width
|
|
758
|
+
is that offset and not an independent number: a theme that moved the slot
|
|
759
|
+
while the width stayed at a literal 4px would detach the strip from the
|
|
760
|
+
edge it exists to hug. Derived here rather than in @pretable/react
|
|
761
|
+
because a width written inline could not be re-derived by a theme either
|
|
762
|
+
— the same trap the offsets themselves were in. */
|
|
763
|
+
width: calc(-1 * var(--pretable-header-resize-slot));
|
|
711
764
|
height: 100%;
|
|
712
765
|
cursor: col-resize;
|
|
713
766
|
background: var(--pretable-resize-handle);
|
|
@@ -745,7 +798,13 @@
|
|
|
745
798
|
pointer-events: none;
|
|
746
799
|
}
|
|
747
800
|
|
|
748
|
-
/* Built-in column filter menu (sub-project 2/3)
|
|
801
|
+
/* Built-in column filter menu (sub-project 2/3).
|
|
802
|
+
This family shares the `data-pretable-filter-` prefix with the tool
|
|
803
|
+
panel's filter BUILDER further down, whose guards ban `opacity` outright.
|
|
804
|
+
The funnel's `opacity: 0/1` below reveals a control rather than dimming
|
|
805
|
+
one, so the family is exempt BY NAME in `LEGACY_FILTER_ATTRS`
|
|
806
|
+
(css-cascade.test.ts). A new funnel-family attribute belongs on that
|
|
807
|
+
list; a new builder attribute does not. */
|
|
749
808
|
:where([data-pretable-filter-funnel]) {
|
|
750
809
|
display: inline-flex;
|
|
751
810
|
align-items: center;
|
|
@@ -775,9 +834,9 @@
|
|
|
775
834
|
the header box cannot change size — @pretable/ui's `readDensity` and the
|
|
776
835
|
surface's virtualisation geometry both measure header/row height in JS,
|
|
777
836
|
and a change there would desynchronise painted from measured layout.
|
|
778
|
-
`right: 0`, NOT centred: the funnel's right edge is flush
|
|
779
|
-
|
|
780
|
-
column's trailing edge
|
|
837
|
+
`right: 0`, NOT centred: on a fine pointer the funnel's right edge is flush
|
|
838
|
+
against the 4px resize strip (--pretable-header-funnel-slot puts it 22px
|
|
839
|
+
back from the column's trailing edge, the strip at 4). The strip is not at
|
|
781
840
|
risk — it carries z-index: 2 inside the overlay anchor's stacking context,
|
|
782
841
|
so it hit-tests above the funnel either way, and a centred box measurably
|
|
783
842
|
steals none of it. What a centred box costs is the FUNNEL: 3 of its 24px
|
|
@@ -789,12 +848,14 @@
|
|
|
789
848
|
Height is a flat 24px, not 100%: the tightest shipped header is Excel's
|
|
790
849
|
compact tier at exactly 24px, so 24 fits every tier without spilling into
|
|
791
850
|
the first data row.
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
funnel
|
|
796
|
-
|
|
797
|
-
|
|
851
|
+
This box is 24px wide on EVERY pointer, and the slot geometry above is what
|
|
852
|
+
keeps it reachable rather than merely declared. With the drag-to-group
|
|
853
|
+
panel on there is an 18px column-menu button immediately left of the
|
|
854
|
+
funnel; while its slot sat at -40 it painted over the six pixels of this
|
|
855
|
+
box that ran underneath it and the funnel measured 24 tall but 17 wide. The
|
|
856
|
+
fix is spacing, not size — the menu slot moved to -46 — because shrinking
|
|
857
|
+
this box to 18 to stop the collision would have taken the same six pixels
|
|
858
|
+
off every panel-less grid, which was never clipped. */
|
|
798
859
|
:where([data-pretable-filter-funnel])::after {
|
|
799
860
|
content: "";
|
|
800
861
|
position: absolute;
|
|
@@ -1011,6 +1072,13 @@
|
|
|
1011
1072
|
cursor: pointer;
|
|
1012
1073
|
opacity: 0;
|
|
1013
1074
|
transition: opacity 0.1s ease;
|
|
1075
|
+
/* Containing block for the coarse-pointer hit area at the end of the file.
|
|
1076
|
+
Declared here rather than beside it so the two cannot drift apart, and
|
|
1077
|
+
unconditional because it changes nothing on its own: the button is
|
|
1078
|
+
already inside an absolutely positioned slot, so making it `relative`
|
|
1079
|
+
moves no pixel and reorders no paint — both slots were already in the
|
|
1080
|
+
positioned phase, ordered by tree order. */
|
|
1081
|
+
position: relative;
|
|
1014
1082
|
}
|
|
1015
1083
|
:where([data-pretable-header-row]:hover [data-pretable-column-menu-button]),
|
|
1016
1084
|
:where([data-pretable-column-menu-button]:focus-visible),
|
|
@@ -1293,4 +1361,816 @@
|
|
|
1293
1361
|
border-top-left-radius: 0;
|
|
1294
1362
|
border-top-right-radius: 0;
|
|
1295
1363
|
}
|
|
1364
|
+
|
|
1365
|
+
/* ---- Tool panel (SP1) ------------------------------------------------- */
|
|
1366
|
+
|
|
1367
|
+
/* The horizontal composite the surface renders while the panel is enabled:
|
|
1368
|
+
[grid stack][pane?][rail] in one flex row (the flex itself is inline
|
|
1369
|
+
layout math in @pretable/react). The card chrome — border, radius,
|
|
1370
|
+
shadow — moves UP onto this wrapper so it wraps the docked rail and
|
|
1371
|
+
pane; the boxes inside surrender their own copies and meet at hairlines.
|
|
1372
|
+
This is the same border redistribution the group-panel wrapper performs
|
|
1373
|
+
vertically, one axis over. */
|
|
1374
|
+
:where([data-pretable-tool-layout]) {
|
|
1375
|
+
border: 1px solid var(--pretable-rule-strong);
|
|
1376
|
+
border-radius: var(--pretable-radius);
|
|
1377
|
+
box-shadow: var(--pretable-shadow-card);
|
|
1378
|
+
/* The children keep square corners and the wrapper's radius clips them.
|
|
1379
|
+
Safe to clip: every floating grid child (menus, editors, the reorder
|
|
1380
|
+
ghost) portals to <body>, and the viewport scrolls inside itself. */
|
|
1381
|
+
overflow: hidden;
|
|
1382
|
+
}
|
|
1383
|
+
:where([data-pretable-tool-layout]) :where([data-pretable-scroll-viewport]) {
|
|
1384
|
+
border: 0;
|
|
1385
|
+
border-radius: 0;
|
|
1386
|
+
box-shadow: none;
|
|
1387
|
+
}
|
|
1388
|
+
/* The seam the viewport's own top border used to draw beneath the group
|
|
1389
|
+
panel and the error strip moves onto those boxes' bottom edge. */
|
|
1390
|
+
:where([data-pretable-tool-layout]) :where([data-pretable-group-panel]),
|
|
1391
|
+
:where([data-pretable-tool-layout])
|
|
1392
|
+
:where([data-pretable-body-state="error-strip"]) {
|
|
1393
|
+
border: 0;
|
|
1394
|
+
border-radius: 0;
|
|
1395
|
+
border-bottom: 1px solid var(--pretable-rule-strong);
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1398
|
+
/* A rail of section tabs at the grid's right edge plus a full-height pane.
|
|
1399
|
+
The rail borrows the header's surface and the pane the toolbar's, so the
|
|
1400
|
+
panel reads as chrome, not content — the same plane vocabulary as the
|
|
1401
|
+
rest of the grid. Docked planes meet at hairlines, not shadows: a shadow
|
|
1402
|
+
is elevation, and nothing here floats. */
|
|
1403
|
+
:where([data-pretable-tool-rail]) {
|
|
1404
|
+
display: flex;
|
|
1405
|
+
/* A flex item of the layout row. `flex: none`, or the row's shrink math
|
|
1406
|
+
splits negative space between the grid area and this strip — measured:
|
|
1407
|
+
a 640px card squeezed the pane 264 -> 224 before these were pinned. */
|
|
1408
|
+
flex: none;
|
|
1409
|
+
flex-direction: column;
|
|
1410
|
+
align-items: center;
|
|
1411
|
+
gap: 4px;
|
|
1412
|
+
inline-size: 36px;
|
|
1413
|
+
padding-block-start: 6px;
|
|
1414
|
+
background: var(--pretable-bg-header);
|
|
1415
|
+
border-inline-start: var(--pretable-rule-width) solid var(--pretable-rule);
|
|
1416
|
+
}
|
|
1417
|
+
:where([data-pretable-tool-tab]) {
|
|
1418
|
+
display: flex;
|
|
1419
|
+
align-items: center;
|
|
1420
|
+
justify-content: center;
|
|
1421
|
+
inline-size: 28px;
|
|
1422
|
+
block-size: 28px;
|
|
1423
|
+
padding: 0;
|
|
1424
|
+
border: 0;
|
|
1425
|
+
border-radius: var(--pretable-radius-control);
|
|
1426
|
+
background: transparent;
|
|
1427
|
+
color: var(--pretable-text-header);
|
|
1428
|
+
cursor: pointer;
|
|
1429
|
+
}
|
|
1430
|
+
/* A background-IMAGE, not the `background` shorthand most hovers in this
|
|
1431
|
+
file can safely use: the selected rule below paints this same tab with a
|
|
1432
|
+
background-COLOR, and the shorthand would reset the image-or-color the
|
|
1433
|
+
earlier rule left behind. The idiom belongs to the hovers that compose
|
|
1434
|
+
over an existing fill, which is why it is argued here and not everywhere. */
|
|
1435
|
+
:where([data-pretable-tool-tab]:hover) {
|
|
1436
|
+
background-image: linear-gradient(
|
|
1437
|
+
var(--pretable-bg-hover),
|
|
1438
|
+
var(--pretable-bg-hover)
|
|
1439
|
+
);
|
|
1440
|
+
}
|
|
1441
|
+
/* The open tab takes the PANE's surface, so tab and pane read as one
|
|
1442
|
+
continuous plane — the notebook-divider trick. Accent carries "current"
|
|
1443
|
+
because on the header surface a fill difference alone is one tone step.
|
|
1444
|
+
background-COLOR, never the shorthand: this rule follows the hover rule
|
|
1445
|
+
at equal (0,0,0) specificity, and the shorthand resets background-image
|
|
1446
|
+
to `none` — which would erase the hover tint on exactly the tab a
|
|
1447
|
+
pointer rests on most. Same hazard the selection-fill rules document at
|
|
1448
|
+
the top of the file. */
|
|
1449
|
+
:where([data-pretable-tool-tab][aria-selected="true"]) {
|
|
1450
|
+
background-color: var(--pretable-bg-toolbar);
|
|
1451
|
+
color: var(--pretable-accent);
|
|
1452
|
+
}
|
|
1453
|
+
:where([data-pretable-tool-tab]:focus-visible) {
|
|
1454
|
+
outline: 2px solid var(--pretable-focus-ring);
|
|
1455
|
+
outline-offset: -2px;
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1458
|
+
/* Pane width is a plain px, not a token: nothing themes it yet, and the
|
|
1459
|
+
flattened (0,0,0) specificity means a consumer can override it with any
|
|
1460
|
+
single attribute selector. It becomes a token when a theme needs it. */
|
|
1461
|
+
:where([data-pretable-tool-pane]) {
|
|
1462
|
+
display: flex;
|
|
1463
|
+
/* Same pin as the rail's: the pane's width is a fixed budget the grid
|
|
1464
|
+
area yields, never a negotiation. */
|
|
1465
|
+
flex: none;
|
|
1466
|
+
flex-direction: column;
|
|
1467
|
+
inline-size: 264px;
|
|
1468
|
+
min-block-size: 0;
|
|
1469
|
+
background: var(--pretable-bg-toolbar);
|
|
1470
|
+
border-inline-start: var(--pretable-rule-width) solid var(--pretable-rule);
|
|
1471
|
+
/* The pane docks BESIDE the scroll viewport, not inside it, so nothing
|
|
1472
|
+
is inherited from the viewport's font or color declarations. */
|
|
1473
|
+
font-family: var(--pretable-font-sans);
|
|
1474
|
+
font-size: var(--pretable-font-size-cell);
|
|
1475
|
+
color: var(--pretable-text-cell);
|
|
1476
|
+
}
|
|
1477
|
+
:where([data-pretable-tool-section]) {
|
|
1478
|
+
display: flex;
|
|
1479
|
+
flex-direction: column;
|
|
1480
|
+
flex: 1;
|
|
1481
|
+
min-block-size: 0;
|
|
1482
|
+
padding: 8px;
|
|
1483
|
+
overflow-y: auto;
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
/* The filter menu's input treatment, restated rather than shared: the menus
|
|
1487
|
+
portal into <body> and this input does not, and coupling their selectors
|
|
1488
|
+
would make the next popover edit silently restyle the panel. */
|
|
1489
|
+
:where([data-pretable-tool-search]) {
|
|
1490
|
+
box-sizing: border-box;
|
|
1491
|
+
inline-size: 100%;
|
|
1492
|
+
margin-block-end: 6px;
|
|
1493
|
+
padding: 5px 7px;
|
|
1494
|
+
border: 1px solid var(--pretable-rule);
|
|
1495
|
+
border-radius: var(--pretable-radius-control);
|
|
1496
|
+
background: var(--pretable-bg-grid);
|
|
1497
|
+
color: var(--pretable-text-cell);
|
|
1498
|
+
font: inherit;
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
/* Group labels split the list by pin state. Size and tracking do the
|
|
1502
|
+
subordinating alongside --pretable-text-dim — same recipe as the entity
|
|
1503
|
+
secondary, and for the same AA reason: never opacity. */
|
|
1504
|
+
:where([data-pretable-tool-group-label]) {
|
|
1505
|
+
padding: 8px 2px 4px;
|
|
1506
|
+
font-size: 0.72em;
|
|
1507
|
+
letter-spacing: 0.07em;
|
|
1508
|
+
text-transform: uppercase;
|
|
1509
|
+
color: var(--pretable-text-dim);
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
/* One row per column: grip, checkbox, label, kebab. `flex: none` because
|
|
1513
|
+
the section is a definite-height flex column that scrolls: the default
|
|
1514
|
+
`0 1 auto` lets a LONG list SHRINK its rows to fit rather than overflow,
|
|
1515
|
+
so 28px quietly becomes 22 and the scrollbar stays away until the rows
|
|
1516
|
+
bottom out at their content height. Nothing here ever stretches —
|
|
1517
|
+
flex-grow is 0 on both sides of that default; shrink is the entire
|
|
1518
|
+
difference. */
|
|
1519
|
+
/* [data-pretable-tool-group-row] (the grouping section's group-by rows)
|
|
1520
|
+
rides every selector list here: same anatomy, same states, one set of
|
|
1521
|
+
rules — the grouping block below adds nothing of its own.
|
|
1522
|
+
[data-pretable-aggregate-row] (the aggregates block's rows) rides the
|
|
1523
|
+
BASE rule only: same box, but nothing in it hovers, drags or takes row
|
|
1524
|
+
focus — its select carries its own states via the filter-field lists. */
|
|
1525
|
+
:where(
|
|
1526
|
+
[data-pretable-tool-column-row],
|
|
1527
|
+
[data-pretable-tool-group-row],
|
|
1528
|
+
[data-pretable-aggregate-row]
|
|
1529
|
+
) {
|
|
1530
|
+
display: flex;
|
|
1531
|
+
align-items: center;
|
|
1532
|
+
gap: 7px;
|
|
1533
|
+
flex: none;
|
|
1534
|
+
block-size: 28px;
|
|
1535
|
+
padding-inline: 7px;
|
|
1536
|
+
border-radius: var(--pretable-radius-control);
|
|
1537
|
+
}
|
|
1538
|
+
:where(
|
|
1539
|
+
[data-pretable-tool-column-row]:hover,
|
|
1540
|
+
[data-pretable-tool-group-row]:hover
|
|
1541
|
+
) {
|
|
1542
|
+
background-image: linear-gradient(
|
|
1543
|
+
var(--pretable-bg-hover),
|
|
1544
|
+
var(--pretable-bg-hover)
|
|
1545
|
+
);
|
|
1546
|
+
}
|
|
1547
|
+
/* Rows are keyboard-reorderable the way group chips are, so they carry the
|
|
1548
|
+
same ring. */
|
|
1549
|
+
:where(
|
|
1550
|
+
[data-pretable-tool-column-row]:focus-visible,
|
|
1551
|
+
[data-pretable-tool-group-row]:focus-visible
|
|
1552
|
+
) {
|
|
1553
|
+
outline: 2px solid var(--pretable-focus-ring);
|
|
1554
|
+
outline-offset: -2px;
|
|
1555
|
+
}
|
|
1556
|
+
/* Drag feedback rides the selection tint, not the chip strip's opacity
|
|
1557
|
+
fade: Excel sets --pretable-bg-hover to `transparent`, so hover cannot
|
|
1558
|
+
carry it — and a faded row is also a dimmed label, which is the exact
|
|
1559
|
+
presentation a hidden column owns further down. */
|
|
1560
|
+
:where(
|
|
1561
|
+
[data-pretable-tool-column-row][data-pretable-tool-row-dragging],
|
|
1562
|
+
[data-pretable-tool-group-row][data-pretable-tool-row-dragging]
|
|
1563
|
+
) {
|
|
1564
|
+
background-image: linear-gradient(
|
|
1565
|
+
var(--pretable-selection-bg),
|
|
1566
|
+
var(--pretable-selection-bg)
|
|
1567
|
+
);
|
|
1568
|
+
cursor: grabbing;
|
|
1569
|
+
}
|
|
1570
|
+
/* The grip is a GripIcon from the set — [data-pretable-icon] already sizes
|
|
1571
|
+
it, so only the tint and the affordance are left here. */
|
|
1572
|
+
:where([data-pretable-tool-row-grip]) {
|
|
1573
|
+
flex: none;
|
|
1574
|
+
display: inline-flex;
|
|
1575
|
+
color: var(--pretable-text-dim);
|
|
1576
|
+
cursor: grab;
|
|
1577
|
+
touch-action: none;
|
|
1578
|
+
/* Containing block for the coarse-pointer hit area at the end of the
|
|
1579
|
+
file — declared here so the two cannot drift apart, exactly as the
|
|
1580
|
+
header's ⋮ does. */
|
|
1581
|
+
position: relative;
|
|
1582
|
+
}
|
|
1583
|
+
:where([data-pretable-tool-column-label]) {
|
|
1584
|
+
flex: 1;
|
|
1585
|
+
min-inline-size: 0;
|
|
1586
|
+
overflow: hidden;
|
|
1587
|
+
text-overflow: ellipsis;
|
|
1588
|
+
white-space: nowrap;
|
|
1589
|
+
}
|
|
1590
|
+
/* Hidden columns dim by COLOR, never by opacity: --pretable-text-dim holds
|
|
1591
|
+
a contrast that was computed against the surface, and an opacity
|
|
1592
|
+
multiplies it away below AA — the failure every hand-rolled secondary in
|
|
1593
|
+
this repo has shipped at least once. */
|
|
1594
|
+
:where([data-pretable-tool-column-row][data-pretable-column-hidden="true"]) {
|
|
1595
|
+
color: var(--pretable-text-dim);
|
|
1596
|
+
}
|
|
1597
|
+
/* The kebab is the header's ⋮ minus the hover-reveal. The header hides its
|
|
1598
|
+
⋮ because it overlays a sort target hundreds of px wide; here the button
|
|
1599
|
+
owns its own slot in the row, and hover-reveal would just make it absent
|
|
1600
|
+
on every coarse pointer. Its menu is the SAME popover contract the
|
|
1601
|
+
header's opens — [data-pretable-column-menu] holding
|
|
1602
|
+
[data-pretable-menu-item]s — so the menu needs no rules of its own. */
|
|
1603
|
+
:where([data-pretable-tool-row-menu-button]) {
|
|
1604
|
+
flex: none;
|
|
1605
|
+
display: inline-flex;
|
|
1606
|
+
align-items: center;
|
|
1607
|
+
justify-content: center;
|
|
1608
|
+
inline-size: 18px;
|
|
1609
|
+
block-size: 18px;
|
|
1610
|
+
padding: 0;
|
|
1611
|
+
border: 0;
|
|
1612
|
+
border-radius: var(--pretable-radius-control);
|
|
1613
|
+
background: transparent;
|
|
1614
|
+
color: var(--pretable-text-dim);
|
|
1615
|
+
cursor: pointer;
|
|
1616
|
+
/* Containing block for the coarse-pointer hit area at the end of the
|
|
1617
|
+
file, like the grip's. */
|
|
1618
|
+
position: relative;
|
|
1619
|
+
}
|
|
1620
|
+
:where([data-pretable-tool-row-menu-button]:hover),
|
|
1621
|
+
:where([data-pretable-tool-row-menu-button][aria-expanded="true"]) {
|
|
1622
|
+
background: var(--pretable-selection-bg);
|
|
1623
|
+
color: var(--pretable-text-cell);
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1626
|
+
/* The gap a drop would land in: the chip strip's zero-content indicator
|
|
1627
|
+
turned horizontal, because this list stacks instead of flowing. */
|
|
1628
|
+
:where([data-pretable-tool-drop-indicator]) {
|
|
1629
|
+
flex: none;
|
|
1630
|
+
block-size: 2px;
|
|
1631
|
+
border-radius: 1px;
|
|
1632
|
+
background: var(--pretable-reorder-drop-indicator);
|
|
1633
|
+
}
|
|
1634
|
+
|
|
1635
|
+
/* The escape hatch under the list. Same voice as the filter menu's clear
|
|
1636
|
+
action — a quiet text button in the accent — because a bordered button
|
|
1637
|
+
at the foot of the pane would outweigh every row above it. */
|
|
1638
|
+
:where([data-pretable-tool-reset]) {
|
|
1639
|
+
align-self: flex-end;
|
|
1640
|
+
padding: 2px 4px;
|
|
1641
|
+
border: 0;
|
|
1642
|
+
background: transparent;
|
|
1643
|
+
color: var(--pretable-accent);
|
|
1644
|
+
cursor: pointer;
|
|
1645
|
+
font: inherit;
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1648
|
+
/* ---- Filter builder (SP2b) -------------------------------------------- */
|
|
1649
|
+
|
|
1650
|
+
/* Nesting is an indented run behind a vertical rule — NOT a bordered card.
|
|
1651
|
+
The pane is 264px and the rows inside it hold three controls plus a
|
|
1652
|
+
remove button, so every pixel a level costs comes out of the value
|
|
1653
|
+
input. A card costs ~14px a level (border + padding on both sides); this
|
|
1654
|
+
costs 8 — the 1px rule plus the 7px that keeps the rows off it. Depth
|
|
1655
|
+
three still leaves a usable row.
|
|
1656
|
+
The rule IS the nesting cue. It is the whole visual difference between a
|
|
1657
|
+
group and its parent, which is why it takes --pretable-rule (the
|
|
1658
|
+
hairline seam vocabulary the docked planes above already speak) rather
|
|
1659
|
+
than a shadow: nothing here floats.
|
|
1660
|
+
No `flex: none` here, unlike the rows: a nested rail's automatic minimum
|
|
1661
|
+
size resolves to min-content and its children are already unshrinkable,
|
|
1662
|
+
so the run cannot be squeezed out of shape by the column it sits in. */
|
|
1663
|
+
:where([data-pretable-filter-rail]) {
|
|
1664
|
+
display: flex;
|
|
1665
|
+
flex-direction: column;
|
|
1666
|
+
gap: 4px;
|
|
1667
|
+
padding-inline-start: 7px;
|
|
1668
|
+
border-inline-start: var(--pretable-rule-width) solid var(--pretable-rule);
|
|
1669
|
+
}
|
|
1670
|
+
|
|
1671
|
+
/* One leaf: join · column · operator · value · remove, all in this one flex
|
|
1672
|
+
box — the connective is placed INSIDE the row it introduces rather than
|
|
1673
|
+
beside it, which is what lets the two line up as the pane wraps.
|
|
1674
|
+
It WRAPS, unlike the columns section's fixed-height row: five controls
|
|
1675
|
+
do not fit across 264px minus the rails, and `nowrap` would push the
|
|
1676
|
+
trailing control past the pane's edge, where the pane's own
|
|
1677
|
+
`overflow-y: auto` gives no way to reach it. `flex: none` for the reason
|
|
1678
|
+
the column rows carry it — a scrolling, definite-height section shrinks
|
|
1679
|
+
its rows to fit unless told not to.
|
|
1680
|
+
THE TWO HAZARDS THIS COMMENT USED TO WARN THE CONTROLS TASK ABOUT, and
|
|
1681
|
+
what the rules below did about them. Neither drop-in was taken. The
|
|
1682
|
+
nearest reusable remove control, [data-pretable-chip-remove] further up,
|
|
1683
|
+
is 14x14 — below WCAG 2.5.8, in a section that bought 24px for every
|
|
1684
|
+
control it owns — so the remove button takes this section's box instead
|
|
1685
|
+
and states the size in its own guarded rule. And .pretable-cell-editor is
|
|
1686
|
+
CELL geometry: its `width/height: 100%` would force the value onto a line
|
|
1687
|
+
of its own in this wrapping row, and its `[aria-busy="true"] { opacity:
|
|
1688
|
+
0.7 }` would defeat this section's no-opacity rule through a selector the
|
|
1689
|
+
guard cannot see — so the value control is a primitive with a box of its
|
|
1690
|
+
own here, and @pretable/react's FilterRow carries the rest of that
|
|
1691
|
+
argument (the cell editors' commit-on-blur lifecycle, and an enum
|
|
1692
|
+
combobox that cannot express `isAnyOf`). */
|
|
1693
|
+
:where([data-pretable-filter-row]) {
|
|
1694
|
+
display: flex;
|
|
1695
|
+
flex-wrap: wrap;
|
|
1696
|
+
align-items: center;
|
|
1697
|
+
gap: 4px;
|
|
1698
|
+
flex: none;
|
|
1699
|
+
padding: 4px;
|
|
1700
|
+
border-radius: var(--pretable-radius-control);
|
|
1701
|
+
}
|
|
1702
|
+
/* A background-IMAGE, the way the tool tabs' hover does it and for the
|
|
1703
|
+
reason argued there. Nothing paints this row before the hover today —
|
|
1704
|
+
the hidden-column rule below sets `color` only — so this is house
|
|
1705
|
+
consistency and future-proofing rather than a fix: the day this row
|
|
1706
|
+
grows a fill of its own, a `background` shorthand here would erase it,
|
|
1707
|
+
silently and only on hover. */
|
|
1708
|
+
:where([data-pretable-filter-row]:hover) {
|
|
1709
|
+
background-image: linear-gradient(
|
|
1710
|
+
var(--pretable-bg-hover),
|
|
1711
|
+
var(--pretable-bg-hover)
|
|
1712
|
+
);
|
|
1713
|
+
}
|
|
1714
|
+
/* A filter on a hidden column still applies, and the row says so by COLOR,
|
|
1715
|
+
never by opacity: --pretable-text-dim holds a contrast computed against
|
|
1716
|
+
the surface and an opacity multiplies it away below AA — the failure the
|
|
1717
|
+
columns section's hidden row documents one section up. */
|
|
1718
|
+
:where(
|
|
1719
|
+
[data-pretable-filter-row][data-pretable-filter-column-hidden="true"]
|
|
1720
|
+
) {
|
|
1721
|
+
color: var(--pretable-text-dim);
|
|
1722
|
+
}
|
|
1723
|
+
/* The grouped-away marking (SP3b spec decision 11): a filter on a column
|
|
1724
|
+
that grouping removed from the header — grouped AND hide-grouped on —
|
|
1725
|
+
dims the same way and for the same reason. Its own rule rather than a
|
|
1726
|
+
selector list in the hidden one, so the two markings can diverge without
|
|
1727
|
+
an edit that re-reads both; the distinction a screen reader needs is in
|
|
1728
|
+
the picker's name, which says "grouped" there and "hidden" here. */
|
|
1729
|
+
:where(
|
|
1730
|
+
[data-pretable-filter-row][data-pretable-filter-column-grouped="true"]
|
|
1731
|
+
) {
|
|
1732
|
+
color: var(--pretable-text-dim);
|
|
1733
|
+
}
|
|
1734
|
+
|
|
1735
|
+
/* The two pickers and the single-value field, in ONE rule: they are the same
|
|
1736
|
+
box, and the difference between "which column", "which operator" and
|
|
1737
|
+
"what value" is the words inside it, not the frame around them.
|
|
1738
|
+
`flex: 1 1 auto` WITH an explicit `min-inline-size`, which is the pair
|
|
1739
|
+
that makes the wrapping row above work: a <select>'s automatic minimum
|
|
1740
|
+
size is its longest option, so one long header name would hold the row
|
|
1741
|
+
wider than the pane and push the value onto a line of its own no matter
|
|
1742
|
+
how the row wraps. ANY explicit value overrides that automatic minimum,
|
|
1743
|
+
so 24px shrinks and ellipsizes exactly as 0 would — and unlike 0 it does
|
|
1744
|
+
not hand back, on the inline axis, the WCAG 2.5.8 floor the block-size
|
|
1745
|
+
below is claiming. A rule that states a 24px target and then permits a
|
|
1746
|
+
4px-wide one states nothing.
|
|
1747
|
+
24px is the height this section bought for the join and the add actions,
|
|
1748
|
+
so the whole row clears 2.5.8 on every pointer rather than only where a
|
|
1749
|
+
coarse-pointer block applies.
|
|
1750
|
+
`font: inherit` as the SHORTHAND — the add action's choice, not the
|
|
1751
|
+
join's longhands: UA stylesheets set their own font on form controls, and
|
|
1752
|
+
this rule sets no size of its own, so there is nothing for the shorthand
|
|
1753
|
+
to overwrite. */
|
|
1754
|
+
/* [data-pretable-aggregate-row] select (the grouping section's aggregate
|
|
1755
|
+
picker) rides this list and the focus ring below: it is the same box as
|
|
1756
|
+
the builder's pickers, and the shared rule is what keeps the two panes'
|
|
1757
|
+
selects from drifting apart. Appended AFTER the pinned head — the
|
|
1758
|
+
cascade guard anchors on [data-pretable-filter-row-column] leading. */
|
|
1759
|
+
:where(
|
|
1760
|
+
[data-pretable-filter-row-column],
|
|
1761
|
+
[data-pretable-filter-row-operator],
|
|
1762
|
+
input[data-pretable-filter-row-value],
|
|
1763
|
+
[data-pretable-aggregate-row] select
|
|
1764
|
+
) {
|
|
1765
|
+
box-sizing: border-box;
|
|
1766
|
+
flex: 1 1 auto;
|
|
1767
|
+
min-inline-size: 24px;
|
|
1768
|
+
block-size: 24px;
|
|
1769
|
+
padding-inline: 6px;
|
|
1770
|
+
border: 1px solid var(--pretable-rule);
|
|
1771
|
+
border-radius: var(--pretable-radius-control);
|
|
1772
|
+
background: var(--pretable-bg-grid);
|
|
1773
|
+
color: var(--pretable-text-cell);
|
|
1774
|
+
font: inherit;
|
|
1775
|
+
}
|
|
1776
|
+
|
|
1777
|
+
/* The set shape's checklist, which is not a field: it takes its own line
|
|
1778
|
+
(`flex-basis: 100%` in a wrapping row) because a column of checkboxes
|
|
1779
|
+
beside three 24px controls would set the row's height to the number of
|
|
1780
|
+
choices. Declared AFTER the rule above and matching a different element,
|
|
1781
|
+
so nothing here is overriding anything — every selector in this file is
|
|
1782
|
+
:where()-flattened to (0,0,0) and source order is the only lever. */
|
|
1783
|
+
:where(div[data-pretable-filter-row-value]) {
|
|
1784
|
+
display: flex;
|
|
1785
|
+
flex-direction: column;
|
|
1786
|
+
gap: 2px;
|
|
1787
|
+
flex-basis: 100%;
|
|
1788
|
+
}
|
|
1789
|
+
:where(div[data-pretable-filter-row-value]) label {
|
|
1790
|
+
display: flex;
|
|
1791
|
+
align-items: center;
|
|
1792
|
+
gap: 6px;
|
|
1793
|
+
}
|
|
1794
|
+
|
|
1795
|
+
/* Remove. NOT [data-pretable-chip-remove], which is 14x14 — under WCAG
|
|
1796
|
+
2.5.8's 24px minimum, in a section where every other control is 24. The
|
|
1797
|
+
chip strip can argue its own case (a chip is a label with a glyph on the
|
|
1798
|
+
end); this row cannot, because it sits beside two 24px controls that
|
|
1799
|
+
already made the opposite choice. What IS taken from the chip is the
|
|
1800
|
+
quiet-until-hover idea — dim by --pretable-text-dim, full text colour on
|
|
1801
|
+
hover — and not its paint: the hover fill is this section's own
|
|
1802
|
+
background-IMAGE gradient, the same one the row and the join use, rather
|
|
1803
|
+
than the chip's --pretable-selection-bg.
|
|
1804
|
+
`flex: none` and a square inline-size: it holds a glyph, so it must not
|
|
1805
|
+
stretch the way the fields either side of it do. The glyph itself is a
|
|
1806
|
+
CloseIcon from the set, sized by --pretable-icon-size through
|
|
1807
|
+
[data-pretable-icon] — no font-size here, unlike the chip's Unicode. */
|
|
1808
|
+
/* [data-pretable-tool-group-remove] (the group-by row's ✕) shares every
|
|
1809
|
+
rule: same glyph, same quiet treatment, one set of declarations. */
|
|
1810
|
+
:where([data-pretable-filter-row-remove], [data-pretable-tool-group-remove]) {
|
|
1811
|
+
box-sizing: border-box;
|
|
1812
|
+
flex: none;
|
|
1813
|
+
display: inline-flex;
|
|
1814
|
+
align-items: center;
|
|
1815
|
+
justify-content: center;
|
|
1816
|
+
inline-size: 24px;
|
|
1817
|
+
block-size: 24px;
|
|
1818
|
+
padding: 0;
|
|
1819
|
+
border: 0;
|
|
1820
|
+
border-radius: var(--pretable-radius-control);
|
|
1821
|
+
background: transparent;
|
|
1822
|
+
color: var(--pretable-text-dim);
|
|
1823
|
+
cursor: pointer;
|
|
1824
|
+
}
|
|
1825
|
+
:where(
|
|
1826
|
+
[data-pretable-filter-row-remove]:hover,
|
|
1827
|
+
[data-pretable-tool-group-remove]:hover
|
|
1828
|
+
) {
|
|
1829
|
+
background-image: linear-gradient(
|
|
1830
|
+
var(--pretable-bg-hover),
|
|
1831
|
+
var(--pretable-bg-hover)
|
|
1832
|
+
);
|
|
1833
|
+
color: var(--pretable-text-cell);
|
|
1834
|
+
}
|
|
1835
|
+
/* One ring for every control in the row, an OUTLINE like every other ring
|
|
1836
|
+
in this file: a box-shadow would spend the one shadow slot these controls
|
|
1837
|
+
might later want for elevation, and whichever declaration lost would lose
|
|
1838
|
+
silently.
|
|
1839
|
+
`input[...-value]`, not the bare attribute: the set shape wears the same
|
|
1840
|
+
attribute on a <div> wrapper, which takes no focus. A rule that matched it
|
|
1841
|
+
would be inert today and would paint a ring around the whole checklist the
|
|
1842
|
+
day anything made that wrapper focusable — a state nobody would have
|
|
1843
|
+
designed. The FIELDS are what focus, so the field is what the selector
|
|
1844
|
+
names. */
|
|
1845
|
+
:where(
|
|
1846
|
+
[data-pretable-filter-row-column]:focus-visible,
|
|
1847
|
+
[data-pretable-filter-row-operator]:focus-visible,
|
|
1848
|
+
input[data-pretable-filter-row-value]:focus-visible,
|
|
1849
|
+
[data-pretable-filter-row-remove]:focus-visible,
|
|
1850
|
+
[data-pretable-tool-group-remove]:focus-visible,
|
|
1851
|
+
[data-pretable-aggregate-row] select:focus-visible
|
|
1852
|
+
) {
|
|
1853
|
+
outline: 2px solid var(--pretable-focus-ring);
|
|
1854
|
+
outline-offset: -2px;
|
|
1855
|
+
}
|
|
1856
|
+
/* The checklist's checkboxes, which the rule above deliberately does not
|
|
1857
|
+
reach — they are inside the wrapper, not the wrapper. Without this they
|
|
1858
|
+
keep the UA's own focus ring, so tabbing through a set filter would change
|
|
1859
|
+
ring colour and shape halfway down a row that is otherwise entirely this
|
|
1860
|
+
section's. A POSITIVE offset, unlike every other ring here: a checkbox is
|
|
1861
|
+
~13px and paints to its own edge, so an inset ring would sit on top of the
|
|
1862
|
+
box instead of around it. */
|
|
1863
|
+
:where(div[data-pretable-filter-row-value]) input:focus-visible {
|
|
1864
|
+
outline: 2px solid var(--pretable-focus-ring);
|
|
1865
|
+
outline-offset: 1px;
|
|
1866
|
+
}
|
|
1867
|
+
|
|
1868
|
+
/* The connective, which is the thing users misread — so it sits between
|
|
1869
|
+
rows carrying the run's join rather than hiding in a group header. Two
|
|
1870
|
+
shapes share the attribute: a plain `Where` on the run's first row, and
|
|
1871
|
+
a <button> on every later one. Both take this box so the rows below the
|
|
1872
|
+
first line up with the one above; min-inline-size is what holds that
|
|
1873
|
+
column, and it doubles as half of the button's hit target.
|
|
1874
|
+
font-family/font-size as LONGHANDS, never the `font` shorthand a bordered
|
|
1875
|
+
control in this file usually reaches for: a <button> does not inherit the
|
|
1876
|
+
pane's font, so the family has to be restored here — and `font: inherit`
|
|
1877
|
+
would restore the SIZE too, overwriting the 0.9em that subordinates the
|
|
1878
|
+
connective to the row it sits beside. Two longhands say exactly the two
|
|
1879
|
+
things meant; the shorthand says a third. */
|
|
1880
|
+
:where([data-pretable-filter-join]) {
|
|
1881
|
+
display: inline-flex;
|
|
1882
|
+
align-items: center;
|
|
1883
|
+
flex: none;
|
|
1884
|
+
min-inline-size: 44px;
|
|
1885
|
+
block-size: 24px;
|
|
1886
|
+
color: var(--pretable-text-dim);
|
|
1887
|
+
font-family: inherit;
|
|
1888
|
+
font-size: 0.9em;
|
|
1889
|
+
}
|
|
1890
|
+
/* The interactive half. 24px tall and at least 44px wide in its own rule,
|
|
1891
|
+
not in the coarse-pointer block at the end of the file: this control's
|
|
1892
|
+
LABEL is its target, so it can simply be big enough on every pointer,
|
|
1893
|
+
and there is no glyph-sized box for a transparent ::after to grow. */
|
|
1894
|
+
:where(button[data-pretable-filter-join]) {
|
|
1895
|
+
/* grid.css has no universal reset — every bordered control declares its
|
|
1896
|
+
own box, the search input above included. Without it this button's
|
|
1897
|
+
1px border lands OUTSIDE the shared 24px in a content-box host, so it
|
|
1898
|
+
stands 26px beside a 24px `Where` and the promise the rule above makes
|
|
1899
|
+
about rows lining up holds only on some pages. */
|
|
1900
|
+
box-sizing: border-box;
|
|
1901
|
+
justify-content: space-between;
|
|
1902
|
+
gap: 4px;
|
|
1903
|
+
padding-inline: 6px;
|
|
1904
|
+
border: 1px solid var(--pretable-rule);
|
|
1905
|
+
border-radius: var(--pretable-radius-control);
|
|
1906
|
+
background: var(--pretable-bg-grid);
|
|
1907
|
+
color: var(--pretable-text-cell);
|
|
1908
|
+
cursor: pointer;
|
|
1909
|
+
}
|
|
1910
|
+
:where(button[data-pretable-filter-join]:hover) {
|
|
1911
|
+
background-image: linear-gradient(
|
|
1912
|
+
var(--pretable-bg-hover),
|
|
1913
|
+
var(--pretable-bg-hover)
|
|
1914
|
+
);
|
|
1915
|
+
}
|
|
1916
|
+
/* Focus is an OUTLINE, like every ring in this file. A box-shadow ring
|
|
1917
|
+
would occupy the one shadow slot the control might later want for
|
|
1918
|
+
elevation, and whichever declaration lost would lose silently. */
|
|
1919
|
+
:where([data-pretable-filter-join]:focus-visible) {
|
|
1920
|
+
outline: 2px solid var(--pretable-focus-ring);
|
|
1921
|
+
outline-offset: -2px;
|
|
1922
|
+
}
|
|
1923
|
+
|
|
1924
|
+
/* `+ filter` / `+ group`: the reset action's quiet-text-button voice,
|
|
1925
|
+
because a bordered pair under the tree would outweigh the rows they add
|
|
1926
|
+
to. 24px tall so the pair clears WCAG 2.5.8 on the same terms as the
|
|
1927
|
+
join. */
|
|
1928
|
+
/* [data-pretable-add-group] (the grouping section's `+ Add group`) rides
|
|
1929
|
+
these four rules: same quiet-text-button voice, same disabled dimming
|
|
1930
|
+
(there: tree depth; here: every column already grouped) — and so do the
|
|
1931
|
+
expansion pair, [data-pretable-expand-all] / [data-pretable-collapse-all]
|
|
1932
|
+
(disabled there: no groups to act on). One list per rule, extended in
|
|
1933
|
+
place, so the sections cannot drift apart part by part. */
|
|
1934
|
+
:where(
|
|
1935
|
+
[data-pretable-filter-add],
|
|
1936
|
+
[data-pretable-add-group],
|
|
1937
|
+
[data-pretable-expand-all],
|
|
1938
|
+
[data-pretable-collapse-all]
|
|
1939
|
+
) {
|
|
1940
|
+
display: inline-flex;
|
|
1941
|
+
align-items: center;
|
|
1942
|
+
gap: 4px;
|
|
1943
|
+
block-size: 24px;
|
|
1944
|
+
padding-inline: 6px;
|
|
1945
|
+
border: 0;
|
|
1946
|
+
border-radius: var(--pretable-radius-control);
|
|
1947
|
+
background: transparent;
|
|
1948
|
+
color: var(--pretable-accent);
|
|
1949
|
+
cursor: pointer;
|
|
1950
|
+
/* The shorthand, unlike the join's longhands: this rule sets no size of
|
|
1951
|
+
its own, so there is nothing for `font: inherit` to overwrite. */
|
|
1952
|
+
font: inherit;
|
|
1953
|
+
}
|
|
1954
|
+
:where(
|
|
1955
|
+
[data-pretable-filter-add]:hover:not(:disabled),
|
|
1956
|
+
[data-pretable-add-group]:hover:not(:disabled),
|
|
1957
|
+
[data-pretable-expand-all]:hover:not(:disabled),
|
|
1958
|
+
[data-pretable-collapse-all]:hover:not(:disabled)
|
|
1959
|
+
) {
|
|
1960
|
+
background-image: linear-gradient(
|
|
1961
|
+
var(--pretable-bg-hover),
|
|
1962
|
+
var(--pretable-bg-hover)
|
|
1963
|
+
);
|
|
1964
|
+
}
|
|
1965
|
+
:where(
|
|
1966
|
+
[data-pretable-filter-add]:focus-visible,
|
|
1967
|
+
[data-pretable-add-group]:focus-visible,
|
|
1968
|
+
[data-pretable-expand-all]:focus-visible,
|
|
1969
|
+
[data-pretable-collapse-all]:focus-visible
|
|
1970
|
+
) {
|
|
1971
|
+
outline: 2px solid var(--pretable-focus-ring);
|
|
1972
|
+
outline-offset: -2px;
|
|
1973
|
+
}
|
|
1974
|
+
|
|
1975
|
+
/* `+ group` refuses at the engine's 64-level bound — a deeper tree throws
|
|
1976
|
+
`invalid-query` out of setQuery, which no consumer catches. Disabled
|
|
1977
|
+
dims by token like the hidden row does, and drops the pointer
|
|
1978
|
+
affordance; the REASON is the button's business (a title/aria-disabled
|
|
1979
|
+
description), not the stylesheet's. */
|
|
1980
|
+
:where(
|
|
1981
|
+
[data-pretable-filter-add]:disabled,
|
|
1982
|
+
[data-pretable-add-group]:disabled,
|
|
1983
|
+
[data-pretable-expand-all]:disabled,
|
|
1984
|
+
[data-pretable-collapse-all]:disabled
|
|
1985
|
+
) {
|
|
1986
|
+
color: var(--pretable-text-dim);
|
|
1987
|
+
cursor: default;
|
|
1988
|
+
}
|
|
1989
|
+
|
|
1990
|
+
/* What renders INSTEAD of the tree, so it sits with the actions that end
|
|
1991
|
+
it rather than opening the section. The group-label's voice: a dim line,
|
|
1992
|
+
not an empty box. A bordered placeholder would draw more attention than the
|
|
1993
|
+
rows it stands in for. */
|
|
1994
|
+
/* [data-pretable-tool-empty] is the same statement in the other sections'
|
|
1995
|
+
voice — the columns section's no-match line and the grouping section's
|
|
1996
|
+
"No groups" — so the three share the one rule. */
|
|
1997
|
+
:where([data-pretable-filter-empty], [data-pretable-tool-empty]) {
|
|
1998
|
+
padding: 8px 2px;
|
|
1999
|
+
color: var(--pretable-text-dim);
|
|
2000
|
+
}
|
|
2001
|
+
|
|
2002
|
+
/* ---- Grouping section (SP3b) ------------------------------------------ */
|
|
2003
|
+
|
|
2004
|
+
/* The section's four blocks — group-by, expansion, hide-grouped,
|
|
2005
|
+
aggregates — stacked with the filter rail's 4px rhythm inside the
|
|
2006
|
+
section's own 8px frame ([data-pretable-tool-section] carries the
|
|
2007
|
+
padding and the scroll; this container only spaces its blocks). The
|
|
2008
|
+
blocks' own rules land with the blocks — the group-by block's rows,
|
|
2009
|
+
grip, drop indicator, remove button, add button and empty line all ride
|
|
2010
|
+
the columns/filters sections' selector lists above (each extended in
|
|
2011
|
+
place), so the three sections cannot drift apart part by part. What is
|
|
2012
|
+
left to say here is only stacking: the blocks stack with the 4px
|
|
2013
|
+
rhythm, a block's own children stack TIGHT (the columns section's
|
|
2014
|
+
no-gap row run), and the add button shrink-wraps like `+ filter` does
|
|
2015
|
+
in its block-flow home instead of stretching to the column's width. */
|
|
2016
|
+
:where([data-pretable-tool-grouping]) {
|
|
2017
|
+
display: flex;
|
|
2018
|
+
flex-direction: column;
|
|
2019
|
+
gap: 4px;
|
|
2020
|
+
}
|
|
2021
|
+
:where([data-pretable-tool-grouping] > div) {
|
|
2022
|
+
display: flex;
|
|
2023
|
+
flex-direction: column;
|
|
2024
|
+
}
|
|
2025
|
+
:where([data-pretable-tool-grouping] [data-pretable-add-group]) {
|
|
2026
|
+
align-self: flex-start;
|
|
2027
|
+
}
|
|
2028
|
+
/* The expansion block: its two buttons sit side by side — a pair, acting
|
|
2029
|
+
on the same thing — against the container rule above that stacks every
|
|
2030
|
+
block's children. :has() keys the exception on the block's content
|
|
2031
|
+
rather than minting a wrapper attribute for a purely stylistic
|
|
2032
|
+
distinction (the wrap rows already use :has() this way). */
|
|
2033
|
+
:where([data-pretable-tool-grouping] > div:has([data-pretable-expand-all])) {
|
|
2034
|
+
flex-direction: row;
|
|
2035
|
+
gap: 4px;
|
|
2036
|
+
}
|
|
2037
|
+
/* The hide-grouped switch: a native checkbox and its clickable label on
|
|
2038
|
+
one line, sized to the add button's 24px row so the stack keeps the
|
|
2039
|
+
rail's rhythm. */
|
|
2040
|
+
:where([data-pretable-tool-grouping] label) {
|
|
2041
|
+
display: inline-flex;
|
|
2042
|
+
align-items: center;
|
|
2043
|
+
align-self: flex-start;
|
|
2044
|
+
gap: 6px;
|
|
2045
|
+
block-size: 24px;
|
|
2046
|
+
cursor: pointer;
|
|
2047
|
+
}
|
|
2048
|
+
/* The checklist checkboxes' ring (its comment argues the POSITIVE offset:
|
|
2049
|
+
a ~13px box painting to its own edge would be covered by an inset
|
|
2050
|
+
ring), restated here because that rule is scoped to the filter rows. */
|
|
2051
|
+
:where(input[data-pretable-hide-grouped]:focus-visible) {
|
|
2052
|
+
outline: 2px solid var(--pretable-focus-ring);
|
|
2053
|
+
outline-offset: 1px;
|
|
2054
|
+
}
|
|
2055
|
+
|
|
2056
|
+
/* ---- Coarse pointers -------------------------------------------------- */
|
|
2057
|
+
|
|
2058
|
+
/* A finger, not a mouse. The header's overlay controls were built on three
|
|
2059
|
+
mouse assumptions that all fail together here: they are 18px, they are
|
|
2060
|
+
revealed by hover, and they are packed overlapping into the 40px the slots
|
|
2061
|
+
above allot. Vertical space is not the constraint: the tightest header
|
|
2062
|
+
any shipped theme draws is Excel's compact tier at exactly 24px, which is
|
|
2063
|
+
why 24 is also the height of every hit area below — it is the largest
|
|
2064
|
+
target that fits every tier without spilling into the first data row.
|
|
2065
|
+
HORIZONTAL is the constraint.
|
|
2066
|
+
DECLARED LAST ON PURPOSE. Every selector in this file is :where()-flattened
|
|
2067
|
+
to (0,0,0), so source order is the only cascade lever there is: put this
|
|
2068
|
+
block above the rules it overrides and a phone silently keeps the desktop
|
|
2069
|
+
treatment, with nothing else in the suite any the wiser. */
|
|
2070
|
+
@media (pointer: coarse) {
|
|
2071
|
+
/* No resize strip. 4px is not a target a finger can acquire at any size,
|
|
2072
|
+
and dragging a column edge inside a ~324px viewport is a poor interaction
|
|
2073
|
+
even with a large one — so this clears a WCAG 2.5.8 failure by REMOVING
|
|
2074
|
+
the control rather than by inflating it, and hands back the trailing edge
|
|
2075
|
+
that was squeezing the funnel. Resizing stays a pointer affordance; if
|
|
2076
|
+
touch resizing is ever wanted it belongs in a menu, not in an invisible
|
|
2077
|
+
strip.
|
|
2078
|
+
`display: none` rather than a `matchMedia` guard in @pretable/react, for
|
|
2079
|
+
two reasons. It generates no boxes at all, so the strip is neither
|
|
2080
|
+
painted nor hit-testable — the property that matters to a finger, which
|
|
2081
|
+
`pointer-events: none` or `visibility: hidden` would only half give. And
|
|
2082
|
+
a media query is evaluated by the engine on both sides of a stream, so
|
|
2083
|
+
there is no client/server disagreement for hydration to reconcile; a JS
|
|
2084
|
+
media query has no correct SSR default here, only a less bad one. */
|
|
2085
|
+
:where([data-pretable-resize-handle]) {
|
|
2086
|
+
display: none;
|
|
2087
|
+
}
|
|
2088
|
+
|
|
2089
|
+
/* The 48px the strip freed, spent as two 24px targets that ABUT rather than
|
|
2090
|
+
overlap: the menu's hit area runs [-54, -30] off the trailing edge and
|
|
2091
|
+
the funnel's [-30, -6], so neither can steal from the other. 48px is 34%
|
|
2092
|
+
of a 140px column — against the 72px that three compliant targets would
|
|
2093
|
+
have needed, which is 51% and would have covered the label they sit
|
|
2094
|
+
beside. */
|
|
2095
|
+
:where([data-pretable-header-overlays]) {
|
|
2096
|
+
--pretable-header-funnel-slot: -24px;
|
|
2097
|
+
--pretable-header-menu-slot: -48px;
|
|
2098
|
+
}
|
|
2099
|
+
|
|
2100
|
+
/* There is no hover on a phone, so a hover-revealed control is not subtle,
|
|
2101
|
+
it is absent: measured on an iPhone 13, the funnel computes `opacity: 0`
|
|
2102
|
+
on every filterable column of every grid, which makes the 24px target it
|
|
2103
|
+
already carries a target nobody can see.
|
|
2104
|
+
This changes how every grid LOOKS on a phone. That is the intended
|
|
2105
|
+
change, not a side effect. The fine-pointer hover-reveal further up is
|
|
2106
|
+
deliberately untouched. */
|
|
2107
|
+
:where([data-pretable-filter-funnel]) {
|
|
2108
|
+
opacity: 1;
|
|
2109
|
+
}
|
|
2110
|
+
|
|
2111
|
+
/* WCAG 2.5.8 for the ⋮, bought exactly the way the funnel buys its own 250
|
|
2112
|
+
lines up: the GLYPH stays 18x18 and the missing 6px comes from a
|
|
2113
|
+
transparent, out-of-flow ::after. Not padding — padding grows the
|
|
2114
|
+
button's border box, and the button is what the hover fill and the focus
|
|
2115
|
+
ring paint on, so an 18px ⋮ would suddenly wear a 24px chip. Out of flow
|
|
2116
|
+
is also what keeps the promise the whole header rests on: `readDensity`
|
|
2117
|
+
and @pretable/react's virtualisation both measure header and row height
|
|
2118
|
+
in JavaScript, and a rule that grew the painted header would
|
|
2119
|
+
desynchronise painted layout from measured layout.
|
|
2120
|
+
`right: 0` mirrors the funnel, and here that is load-bearing rather than
|
|
2121
|
+
symmetric: anchored to the button's trailing edge the box grows leftward
|
|
2122
|
+
into the header cell — a sort target hundreds of px wide — instead of
|
|
2123
|
+
back over the funnel. Centred, the two 24px boxes would overlap by 6px,
|
|
2124
|
+
and the menu (later in tree order, same stacking context) would take
|
|
2125
|
+
those pixels off the funnel. That is precisely the ~17px-wide funnel this
|
|
2126
|
+
block exists to fix; a centred box would have re-created it one slot
|
|
2127
|
+
over.
|
|
2128
|
+
Scoped to coarse pointers, unlike the funnel's, and that is a decision
|
|
2129
|
+
rather than an omission. WCAG 2.5.8 exempts pointer inputs, so a desktop
|
|
2130
|
+
menu is not failing anything at 18px: its glyph is its whole target and
|
|
2131
|
+
nothing clips it once the slots above are spaced for the funnel's 24. A
|
|
2132
|
+
fine-pointer `::after` here would buy no reachable pixel the mouse did
|
|
2133
|
+
not already have, and would spend 6px more of the header cell's sort
|
|
2134
|
+
area to do it. */
|
|
2135
|
+
:where([data-pretable-column-menu-button])::after {
|
|
2136
|
+
content: "";
|
|
2137
|
+
position: absolute;
|
|
2138
|
+
top: 50%;
|
|
2139
|
+
right: 0;
|
|
2140
|
+
width: 24px;
|
|
2141
|
+
height: 24px;
|
|
2142
|
+
transform: translateY(-50%);
|
|
2143
|
+
}
|
|
2144
|
+
|
|
2145
|
+
/* Visible, for the same reason the funnel above is: the rest state is
|
|
2146
|
+
`opacity: 0` revealed on `:hover`, and a coarse pointer never hovers. The
|
|
2147
|
+
hit area directly above would otherwise be a 24px target with nothing
|
|
2148
|
+
drawn in it — a mystery region that opens a menu.
|
|
2149
|
+
|
|
2150
|
+
The design spec's A2 names only the funnel, because the measurement that
|
|
2151
|
+
prompted it was taken on a grid without the group panel, where no menu
|
|
2152
|
+
renders. It is the same defect one control over. */
|
|
2153
|
+
:where([data-pretable-column-menu-button]) {
|
|
2154
|
+
opacity: 1;
|
|
2155
|
+
}
|
|
2156
|
+
|
|
2157
|
+
/* WCAG 2.5.8 for the tool panel's row controls, bought the way the ⋮
|
|
2158
|
+
above buys it: the glyphs stay put and the missing pixels come from a
|
|
2159
|
+
transparent, out-of-flow ::after, so the 28px row cannot change size.
|
|
2160
|
+
CENTRED, unlike the header's right-anchored boxes, because here there
|
|
2161
|
+
is no neighbouring target to steal from — the label beside the kebab
|
|
2162
|
+
and the row padding beside the grip are not tap targets, and the
|
|
2163
|
+
grip's box runs out inside the 7px gap before it can reach the
|
|
2164
|
+
checkbox. */
|
|
2165
|
+
:where([data-pretable-tool-row-grip])::after,
|
|
2166
|
+
:where([data-pretable-tool-row-menu-button])::after {
|
|
2167
|
+
content: "";
|
|
2168
|
+
position: absolute;
|
|
2169
|
+
top: 50%;
|
|
2170
|
+
left: 50%;
|
|
2171
|
+
width: 24px;
|
|
2172
|
+
height: 24px;
|
|
2173
|
+
transform: translate(-50%, -50%);
|
|
2174
|
+
}
|
|
2175
|
+
}
|
|
1296
2176
|
}
|