@pretable/ui 0.16.0 → 0.18.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/grid.css CHANGED
@@ -162,6 +162,137 @@
162
162
  padding: 0;
163
163
  }
164
164
 
165
+ /* ---- Kit components: select ------------------------------------------
166
+ `PretableSelect`'s trigger. It is a FIELD, not a button: the rule
167
+ border, the grid surface, the cell ink, the label at the start and the
168
+ caret at the end. Each site keeps only its size and its flex
169
+ participation — the site rules further down win at equal specificity by
170
+ source order — and the list it opens is the kit list below.
171
+ `font: inherit` is safe here for the same reason it is on the buttons:
172
+ the trigger sits in a grid surface that declares its own font trio. */
173
+ :where([data-pretable-select]) {
174
+ box-sizing: border-box;
175
+ display: inline-flex;
176
+ align-items: center;
177
+ justify-content: space-between;
178
+ gap: 6px;
179
+ padding-inline: 6px;
180
+ border: 1px solid var(--pretable-rule);
181
+ border-radius: var(--pretable-radius-control);
182
+ background: var(--pretable-bg-grid);
183
+ color: var(--pretable-text-cell);
184
+ font: inherit;
185
+ text-align: start;
186
+ cursor: pointer;
187
+ }
188
+ /* The label takes the slack and ellipsizes; `min-inline-size: 0` is what
189
+ lets it, a flex item's automatic minimum being its content otherwise —
190
+ without it a long option widens the picker instead of truncating. */
191
+ :where([data-pretable-select-label]) {
192
+ flex: 1 1 auto;
193
+ min-inline-size: 0;
194
+ overflow: hidden;
195
+ text-overflow: ellipsis;
196
+ white-space: nowrap;
197
+ }
198
+ /* The caret never shrinks, and speaks in the dim ink like every other
199
+ affordance glyph in the grid. */
200
+ :where([data-pretable-select]) > :where([data-pretable-icon]) {
201
+ flex: none;
202
+ color: var(--pretable-text-dim);
203
+ }
204
+
205
+ /* ---- Kit components: the list ----------------------------------------
206
+ One popover list, two sites: the enum cell editor pops it open under its
207
+ field, and `PretableSelect` under its trigger. */
208
+ :where([data-pretable-listbox]) {
209
+ margin: 0;
210
+ padding: 4px 0;
211
+ list-style: none;
212
+ max-height: 220px;
213
+ overflow-y: auto;
214
+ background: var(--pretable-bg-grid);
215
+ border: 1px solid var(--pretable-rule-strong);
216
+ border-radius: var(--pretable-radius);
217
+ box-shadow: var(--pretable-shadow-overlay);
218
+ /* Portaled into <body> — see the filter menu below. Line-height joins the
219
+ trio (#580): the list is a kit surface now, and a kit control dropped
220
+ into it would otherwise read the HOST page's leading. */
221
+ font-family: var(--pretable-font-sans);
222
+ font-size: var(--pretable-font-size-cell);
223
+ color: var(--pretable-text-cell);
224
+ line-height: 1.5;
225
+ }
226
+
227
+ :where([data-pretable-option]) {
228
+ padding: var(--pretable-cell-padding-y) var(--pretable-cell-padding-x);
229
+ cursor: pointer;
230
+ }
231
+
232
+ :where([data-pretable-option]:hover) {
233
+ background: var(--pretable-bg-hover);
234
+ }
235
+
236
+ /* The roving highlight: keyboard navigation's `data-active`, painted like
237
+ a hover. DECLARED BEFORE the selected rule on purpose — an option that
238
+ is both active and committed should read as SELECTED, and at equal
239
+ (0,0,0) specificity source order is what decides that. */
240
+ :where([data-pretable-option][data-active]) {
241
+ background: var(--pretable-bg-hover);
242
+ }
243
+
244
+ :where([data-pretable-option][aria-selected="true"]) {
245
+ background: var(--pretable-bg-selected);
246
+ color: var(--pretable-text-selected);
247
+ }
248
+
249
+ /* ---- Kit components: text input --------------------------------------
250
+ The native input in the grid's box: the same rule border, grid surface
251
+ and cell ink the select trigger draws, so a field and the picker beside
252
+ it are one family. Sites keep their size, inset and flex participation
253
+ (the site rules below win by order); the element stays native, so the
254
+ date type keeps its picker. */
255
+ :where([data-pretable-text-input]) {
256
+ box-sizing: border-box;
257
+ padding-inline: 6px;
258
+ border: 1px solid var(--pretable-rule);
259
+ border-radius: var(--pretable-radius-control);
260
+ background: var(--pretable-bg-grid);
261
+ color: var(--pretable-text-cell);
262
+ font: inherit;
263
+ }
264
+
265
+ /* ---- Kit components: checkbox ----------------------------------------
266
+ The 16px square every checkbox in the grid is — the row-select cell, the
267
+ header select-all, the boolean cell, the column toggle, the checklists
268
+ and the hide-grouped switch — from one rule, so a theme edit reaches all
269
+ of them and two hand-kept copies cannot drift. aria-checked is the state
270
+ channel; the glyph is the kit icon, sized by the font-size here.
271
+ The tool panel's visibility toggle is enrolled here rather than restyled
272
+ in its own section: it IS this checkbox, and two hand-kept copies of the
273
+ same control are how a theme edit makes them drift apart. */
274
+ :where([data-pretable-checkbox]) {
275
+ width: 16px;
276
+ height: 16px;
277
+ border: 1px solid var(--pretable-checkbox-border);
278
+ background: var(--pretable-checkbox-bg);
279
+ border-radius: 3px;
280
+ cursor: pointer;
281
+ padding: 0;
282
+ display: inline-flex;
283
+ align-items: center;
284
+ justify-content: center;
285
+ font-size: 11px;
286
+ line-height: 1;
287
+ color: var(--pretable-checkbox-checked-fg);
288
+ }
289
+ :where([data-pretable-checkbox][aria-checked="true"]),
290
+ :where([data-pretable-checkbox][aria-checked="mixed"]) {
291
+ background: var(--pretable-checkbox-checked-bg);
292
+ border-color: var(--pretable-checkbox-checked-bg);
293
+ color: var(--pretable-checkbox-checked-fg);
294
+ }
295
+
165
296
  /* Multi-sort priority badge (rendered only when 2+ columns are sorted) */
166
297
  :where([data-pretable-sort-priority]) {
167
298
  margin-left: 2px;
@@ -778,63 +909,30 @@
778
909
  padding-top: var(--pretable-cell-padding-y);
779
910
  }
780
911
 
781
- /* The tool panel's visibility toggle is enrolled here rather than restyled
782
- in its own section: it IS this checkbox, and two hand-kept copies of the
783
- same control are how a theme edit makes them drift apart. */
784
- :where(
785
- button[data-pretable-row-select],
786
- button[data-pretable-row-select-all],
787
- button[data-pretable-bool-cell],
788
- button[data-pretable-tool-column-toggle]
789
- ) {
790
- width: 16px;
791
- height: 16px;
792
- border: 1px solid var(--pretable-checkbox-border);
793
- background: var(--pretable-checkbox-bg);
794
- border-radius: 3px;
795
- cursor: pointer;
796
- padding: 0;
797
- display: inline-flex;
798
- align-items: center;
799
- justify-content: center;
800
- font-size: 11px;
801
- line-height: 1;
802
- color: var(--pretable-checkbox-checked-fg);
803
- }
804
- :where(
805
- button[data-pretable-row-select][aria-checked="true"],
806
- button[data-pretable-row-select-all][aria-checked="true"],
807
- button[data-pretable-bool-cell][aria-checked="true"],
808
- button[data-pretable-tool-column-toggle][aria-checked="true"]
809
- ) {
810
- background: var(--pretable-checkbox-checked-bg);
811
- border-color: var(--pretable-checkbox-checked-bg);
812
- color: var(--pretable-checkbox-checked-fg);
813
- }
814
- :where(
815
- button[data-pretable-row-select][aria-checked="mixed"],
816
- button[data-pretable-row-select-all][aria-checked="mixed"]
817
- ) {
818
- background: var(--pretable-checkbox-checked-bg);
819
- border-color: var(--pretable-checkbox-checked-bg);
820
- color: var(--pretable-checkbox-checked-fg);
821
- }
822
-
823
- /* Boolean toggle cell (typed editors) */
824
- :where(button[data-pretable-bool-cell]) {
912
+ /* Boolean toggle cell (typed editors). The box, the glyph colour and the
913
+ checked fill all come from the kit checkbox rule; what is left here is
914
+ the cell's own placement — centred in a data cell — and the two states
915
+ no other checkbox has, busy and invalid. */
916
+ :where([data-pretable-bool-cell]) {
825
917
  margin: 0 auto;
826
918
  display: flex;
827
919
  align-items: center;
828
920
  justify-content: center;
829
921
  }
830
- :where(button[data-pretable-bool-cell]:disabled) {
831
- cursor: default;
832
- }
833
- :where(button[data-pretable-bool-cell][aria-busy="true"]) {
922
+ :where([data-pretable-bool-cell][aria-busy="true"]) {
834
923
  opacity: 0.5;
835
924
  cursor: wait;
836
925
  }
837
- :where(button[data-pretable-bool-cell][aria-invalid="true"]) {
926
+ /* This outline shares the kit's focus-ring property. The kit rule at the end
927
+ of the layer now matches `[data-pretable-checkbox]:focus-visible`, which
928
+ this cell is one of, and both selectors flatten to (0,0,0) — so if the two
929
+ ever matched at once the later kit rule would take the outline. Latent
930
+ today: the control is `tabIndex={-1}`, so a click never gives it
931
+ `:focus-visible`. And that precedence is the RIGHT one if it ever fires —
932
+ while a control is focused the focus ring must be the visible state, and
933
+ the invalid state is still carried to assistive tech by `aria-invalid` and
934
+ `aria-errormessage`, which no outline can say. Left alone deliberately. */
935
+ :where([data-pretable-bool-cell][aria-invalid="true"]) {
838
936
  outline: 1px solid var(--pretable-text-error);
839
937
  outline-offset: 1px;
840
938
  }
@@ -1035,36 +1133,30 @@
1035
1133
  line-height: 1.5;
1036
1134
  color: var(--pretable-text-cell);
1037
1135
  }
1038
- :where([data-pretable-filter-menu]) select,
1039
- :where([data-pretable-filter-menu]) input[type="text"],
1040
- :where([data-pretable-filter-menu]) input[type="date"],
1041
- :where([data-pretable-filter-menu]) input:not([type]) {
1136
+ /* The dialog's three value fields. Kit text inputs: the kit rule at the top
1137
+ of this file draws the box, the rule border and the ink. What is the
1138
+ dialog's own is the size and the inset — full width, the 28px the
1139
+ operator picker beside them stands at (an input left to its own padding
1140
+ comes out several pixels taller, and a stacked pair that does not line
1141
+ up is what this height buys), and this dialog's 7px rather than the
1142
+ kit's 6px. */
1143
+ :where(
1144
+ [data-pretable-filter-value],
1145
+ [data-pretable-filter-min],
1146
+ [data-pretable-filter-max]
1147
+ ) {
1042
1148
  width: 100%;
1043
- box-sizing: border-box;
1044
- /* An explicit box, like the tool pane's identical controls: Chrome forces
1045
- `line-height: normal` on a <select> and ignores what it is given, so a
1046
- select and an input with the same padding come out different heights —
1047
- 28 and 33 here, a stacked pair a few pixels apart. Both centre their
1048
- own text vertically once the height is set, so the block padding goes. */
1049
1149
  block-size: 28px;
1050
1150
  padding-inline: 7px;
1051
- border: 1px solid var(--pretable-rule);
1052
- border-radius: var(--pretable-radius-control);
1053
- background: var(--pretable-bg-grid);
1054
- color: var(--pretable-text-cell);
1055
- font: inherit;
1056
1151
  }
1057
- /* The product's focus ring, not the host page's. Without this the dialog's
1058
- fields keep the UA ring — which takes the CONSUMER's accent-color, so
1059
- tabbing from the pane's copy of these same controls to this one changed
1060
- the ring's colour, width and offset. The declaration the builder rows
1061
- already share. */
1062
- :where(
1063
- [data-pretable-filter-menu] select:focus-visible,
1064
- [data-pretable-filter-menu] input:focus-visible
1065
- ) {
1066
- outline: 2px solid var(--pretable-focus-ring);
1067
- outline-offset: -2px;
1152
+ /* The dialog's operator picker. A kit select: the kit rules at the top of
1153
+ this file draw both this box and the fields' beside it. What is the
1154
+ dialog's own is the size — full width, the 28px the fields beside it
1155
+ stand at, and this dialog's 7px inset rather than the kit's 6px. */
1156
+ :where([data-pretable-filter-operator]) {
1157
+ width: 100%;
1158
+ block-size: 28px;
1159
+ padding-inline: 7px;
1068
1160
  }
1069
1161
  :where([data-pretable-filter-set]) label {
1070
1162
  display: flex;
@@ -1294,48 +1386,13 @@
1294
1386
  border-top: 1px solid var(--pretable-rule);
1295
1387
  }
1296
1388
 
1297
- /* Enum combobox listbox (cell editor) */
1389
+ /* Enum combobox anchor (cell editor) */
1298
1390
  :where([data-pretable-enum-editor]) {
1299
1391
  display: block;
1300
1392
  width: 100%;
1301
1393
  height: 100%;
1302
1394
  }
1303
1395
 
1304
- :where([data-pretable-enum-listbox]) {
1305
- margin: 0;
1306
- padding: 4px 0;
1307
- list-style: none;
1308
- max-height: 220px;
1309
- overflow-y: auto;
1310
- background: var(--pretable-bg-grid);
1311
- border: 1px solid var(--pretable-rule-strong);
1312
- border-radius: var(--pretable-radius);
1313
- box-shadow: var(--pretable-shadow-overlay);
1314
- /* Portaled into <body> — see the filter menu above. */
1315
- font-family: var(--pretable-font-sans);
1316
- font-size: var(--pretable-font-size-cell);
1317
- color: var(--pretable-text-cell);
1318
- }
1319
-
1320
- /* Typed text matching nothing leaves an empty list; don't paint a bare box. */
1321
- :where([data-pretable-enum-listbox]:empty) {
1322
- display: none;
1323
- }
1324
-
1325
- :where([data-pretable-enum-option]) {
1326
- padding: var(--pretable-cell-padding-y) var(--pretable-cell-padding-x);
1327
- cursor: pointer;
1328
- }
1329
-
1330
- :where([data-pretable-enum-option]:hover) {
1331
- background: var(--pretable-bg-hover);
1332
- }
1333
-
1334
- :where([data-pretable-enum-option][aria-selected="true"]) {
1335
- background: var(--pretable-bg-selected);
1336
- color: var(--pretable-text-selected);
1337
- }
1338
-
1339
1396
  /* Date calendar (cell editor) */
1340
1397
  :where([data-pretable-date-editor]) {
1341
1398
  display: block;
@@ -1695,19 +1752,14 @@
1695
1752
  overflow-y: auto;
1696
1753
  }
1697
1754
 
1698
- /* The filter menu's input treatment, restated rather than shared: the menus
1699
- portal into <body> and this input does not, and coupling their selectors
1700
- would make the next popover edit silently restyle the panel. */
1755
+ /* A kit text input: the kit rule at the top of this file draws the box, the
1756
+ rule border and the ink. What is the pane's own is the size and the
1757
+ spacing — full width, the 6px gap to the list below, and this pane's
1758
+ 5px/7px inset rather than the kit's 6px inline. */
1701
1759
  :where([data-pretable-tool-search]) {
1702
- box-sizing: border-box;
1703
1760
  inline-size: 100%;
1704
1761
  margin-block-end: 6px;
1705
1762
  padding: 5px 7px;
1706
- border: 1px solid var(--pretable-rule);
1707
- border-radius: var(--pretable-radius-control);
1708
- background: var(--pretable-bg-grid);
1709
- color: var(--pretable-text-cell);
1710
- font: inherit;
1711
1763
  }
1712
1764
 
1713
1765
  /* Group labels split the list by pin state. Size and tracking do the
@@ -1733,7 +1785,7 @@
1733
1785
  rules — the grouping block below adds nothing of its own.
1734
1786
  [data-pretable-aggregate-row] (the aggregates block's rows) rides the
1735
1787
  BASE rule only: same box, but nothing in it hovers, drags or takes row
1736
- focus — its select carries its own states via the filter-field lists. */
1788
+ focus — its picker is a kit select and carries its own states. */
1737
1789
  :where(
1738
1790
  [data-pretable-tool-column-row],
1739
1791
  [data-pretable-tool-group-row],
@@ -1928,61 +1980,63 @@
1928
1980
  color: var(--pretable-text-dim);
1929
1981
  }
1930
1982
 
1931
- /* The two pickers and the single-value field, in ONE rule: they are the same
1932
- box, and the difference between "which column", "which operator" and
1933
- "what value" is the words inside it, not the frame around them.
1983
+ /* The single-value field. A kit text input: the kit rule at the top of this
1984
+ file draws the frame, the surface, the ink and the font, so what is left
1985
+ here is size and flex participation — the same 24px the pickers beside it
1986
+ stand at, because the difference between "which column", "which operator"
1987
+ and "what value" is the words inside the box, not the frame around it.
1934
1988
  `flex: 1 1 auto` WITH an explicit `min-inline-size`, which is the pair
1935
- that makes the wrapping row above work: a <select>'s automatic minimum
1936
- size is its longest option, so one long header name would hold the row
1937
- wider than the pane and push the value onto a line of its own no matter
1938
- how the row wraps. ANY explicit value overrides that automatic minimum,
1939
- so 24px shrinks and ellipsizes exactly as 0 would — and unlike 0 it does
1940
- not hand back, on the inline axis, the WCAG 2.5.8 floor the block-size
1941
- below is claiming. A rule that states a 24px target and then permits a
1942
- 4px-wide one states nothing.
1989
+ that makes the wrapping row above work: a field's automatic minimum size
1990
+ is its content, so one long value would hold the row wider than the pane
1991
+ and push the controls onto a line of their own no matter how the row
1992
+ wraps. ANY explicit value overrides that automatic minimum, so 24px
1993
+ shrinks and ellipsizes exactly as 0 would — and unlike 0 it does not hand
1994
+ back, on the inline axis, the WCAG 2.5.8 floor the block-size is
1995
+ claiming. A rule that states a 24px target and then permits a 4px-wide
1996
+ one states nothing.
1943
1997
  24px is the height this section bought for the join and the add actions,
1944
1998
  so the whole row clears 2.5.8 on every pointer rather than only where a
1945
- coarse-pointer block applies.
1946
- `font: inherit` as the SHORTHAND — the add action's choice, not the
1947
- join's longhands: UA stylesheets set their own font on form controls, and
1948
- this rule sets no size of its own, so there is nothing for the shorthand
1949
- to overwrite. */
1950
- /* [data-pretable-aggregate-row] select (the grouping section's aggregate
1951
- picker) rides this list and the focus ring below: it is the same box as
1952
- the builder's pickers, and the shared rule is what keeps the two panes'
1953
- selects from drifting apart. Appended AFTER the pinned head — the
1954
- cascade guard anchors on [data-pretable-filter-row-column] leading. */
1999
+ coarse-pointer block applies. */
2000
+ :where([data-pretable-filter-row-value]) {
2001
+ flex: 1 1 auto;
2002
+ min-inline-size: 24px;
2003
+ block-size: 24px;
2004
+ }
2005
+ /* The builder's pickers: size and flex participation only — the kit select
2006
+ rule at the top of this file draws the box. `min-inline-size` matters for
2007
+ the same reason it does on the field above: without it the longest option
2008
+ sets the trigger's automatic minimum and one long header name holds the
2009
+ row wider than the pane.
2010
+ [data-pretable-aggregate] (the grouping section's aggregate picker) rides
2011
+ this rule: it is the same 24px flex item as the builder's two, and the
2012
+ shared rule is what keeps the two panes' pickers from drifting apart.
2013
+ Appended AFTER the pinned head — the cascade guard anchors on
2014
+ [data-pretable-filter-row-column] leading. */
1955
2015
  :where(
1956
2016
  [data-pretable-filter-row-column],
1957
2017
  [data-pretable-filter-row-operator],
1958
- input[data-pretable-filter-row-value],
1959
- [data-pretable-aggregate-row] select
2018
+ [data-pretable-aggregate]
1960
2019
  ) {
1961
- box-sizing: border-box;
1962
2020
  flex: 1 1 auto;
1963
2021
  min-inline-size: 24px;
1964
2022
  block-size: 24px;
1965
- padding-inline: 6px;
1966
- border: 1px solid var(--pretable-rule);
1967
- border-radius: var(--pretable-radius-control);
1968
- background: var(--pretable-bg-grid);
1969
- color: var(--pretable-text-cell);
1970
- font: inherit;
1971
2023
  }
1972
2024
 
1973
2025
  /* The set shape's checklist, which is not a field: it takes its own line
1974
2026
  (`flex-basis: 100%` in a wrapping row) because a column of checkboxes
1975
2027
  beside three 24px controls would set the row's height to the number of
1976
- choices. Declared AFTER the rule above and matching a different element,
1977
- so nothing here is overriding anything — every selector in this file is
1978
- :where()-flattened to (0,0,0) and source order is the only lever. */
1979
- :where(div[data-pretable-filter-row-value]) {
2028
+ choices. Its OWN attribute, not the field's: the wrapper wore
2029
+ `data-pretable-filter-row-value` while the field was a bare <input> and
2030
+ an element-type selector could tell the two apart. Both are kit controls
2031
+ now — the field is the kit's <input> — so one attribute on both would
2032
+ hand the wrapper the field's size rule. */
2033
+ :where([data-pretable-filter-row-set]) {
1980
2034
  display: flex;
1981
2035
  flex-direction: column;
1982
2036
  gap: 2px;
1983
2037
  flex-basis: 100%;
1984
2038
  }
1985
- :where(div[data-pretable-filter-row-value]) label {
2039
+ :where([data-pretable-filter-row-set]) label {
1986
2040
  display: flex;
1987
2041
  align-items: center;
1988
2042
  gap: 6px;
@@ -2017,36 +2071,11 @@
2017
2071
  );
2018
2072
  color: var(--pretable-text-cell);
2019
2073
  }
2020
- /* One ring for every control in the row, an OUTLINE like every other ring
2021
- in this file: a box-shadow would spend the one shadow slot these controls
2022
- might later want for elevation, and whichever declaration lost would lose
2023
- silently.
2024
- `input[...-value]`, not the bare attribute: the set shape wears the same
2025
- attribute on a <div> wrapper, which takes no focus. A rule that matched it
2026
- would be inert today and would paint a ring around the whole checklist the
2027
- day anything made that wrapper focusable — a state nobody would have
2028
- designed. The FIELDS are what focus, so the field is what the selector
2029
- names. */
2030
- :where(
2031
- [data-pretable-filter-row-column]:focus-visible,
2032
- [data-pretable-filter-row-operator]:focus-visible,
2033
- input[data-pretable-filter-row-value]:focus-visible,
2034
- [data-pretable-aggregate-row] select:focus-visible
2035
- ) {
2036
- outline: 2px solid var(--pretable-focus-ring);
2037
- outline-offset: -2px;
2038
- }
2039
- /* The checklist's checkboxes, which the rule above deliberately does not
2040
- reach — they are inside the wrapper, not the wrapper. Without this they
2041
- keep the UA's own focus ring, so tabbing through a set filter would change
2042
- ring colour and shape halfway down a row that is otherwise entirely this
2043
- section's. A POSITIVE offset, unlike every other ring here: a checkbox is
2044
- ~13px and paints to its own edge, so an inset ring would sit on top of the
2045
- box instead of around it. */
2046
- :where(div[data-pretable-filter-row-value]) input:focus-visible {
2047
- outline: 2px solid var(--pretable-focus-ring);
2048
- outline-offset: 1px;
2049
- }
2074
+ /* The field's ring and the checklist's are both the KIT's now — the shared
2075
+ ring rule in the state section, plus the kit-level positive offset every
2076
+ checkbox takes. This section declared two of its own while these controls
2077
+ were bare elements; keeping them would be two more copies of one
2078
+ declaration to drift. */
2050
2079
 
2051
2080
  /* The connective, which is the thing users misread — so it sits between
2052
2081
  rows carrying the run's join rather than hiding in a group header. Two
@@ -2151,9 +2180,9 @@
2151
2180
  flex-direction: row;
2152
2181
  gap: 4px;
2153
2182
  }
2154
- /* The hide-grouped switch: a native checkbox and its clickable label on
2183
+ /* The hide-grouped switch: a kit checkbox and its clickable label on
2155
2184
  one line, sized to the add button's 24px row so the stack keeps the
2156
- rail's rhythm. */
2185
+ rail's rhythm. The ring is the kit's, here and in the checklists. */
2157
2186
  :where([data-pretable-tool-grouping] label) {
2158
2187
  display: inline-flex;
2159
2188
  align-items: center;
@@ -2162,13 +2191,6 @@
2162
2191
  block-size: 24px;
2163
2192
  cursor: pointer;
2164
2193
  }
2165
- /* The checklist checkboxes' ring (its comment argues the POSITIVE offset:
2166
- a ~13px box painting to its own edge would be covered by an inset
2167
- ring), restated here because that rule is scoped to the filter rows. */
2168
- :where(input[data-pretable-hide-grouped]:focus-visible) {
2169
- outline: 2px solid var(--pretable-focus-ring);
2170
- outline-offset: 1px;
2171
- }
2172
2194
 
2173
2195
  /* ---- Kit components: state -------------------------------------------
2174
2196
  The ring and the disabled ink come LAST in the layer, after every site
@@ -2183,19 +2205,50 @@
2183
2205
  so they cannot be the site rule this ordering guards against. */
2184
2206
  :where(
2185
2207
  [data-pretable-button]:focus-visible,
2186
- [data-pretable-icon-button]:focus-visible
2208
+ [data-pretable-icon-button]:focus-visible,
2209
+ [data-pretable-select]:focus-visible,
2210
+ [data-pretable-text-input]:focus-visible,
2211
+ [data-pretable-checkbox]:focus-visible
2187
2212
  ) {
2188
2213
  outline: 2px solid var(--pretable-focus-ring);
2189
2214
  outline-offset: -2px;
2190
2215
  }
2191
- /* The standard disabled treatment (#573): dim by token, drop the pointer. */
2216
+ /* A checkbox rings OUTSIDE its box, alone among the kit controls. The
2217
+ square is 16px and paints to its own edge — border, fill and glyph all
2218
+ the way out — so the inset ring above would land ON the box rather than
2219
+ around it, and the state would read as a recoloured border. The
2220
+ checklists' own rules said exactly this while they had one each; every
2221
+ checkbox gets it now, the four button sites included, which had the UA's
2222
+ ring before this component existed.
2223
+ AFTER the shared rule, not merged into it: both selectors are
2224
+ :where()-flattened to (0,0,0), so this only wins by source order. */
2225
+ :where([data-pretable-checkbox]:focus-visible) {
2226
+ outline-offset: 1px;
2227
+ }
2228
+ /* The standard disabled treatment (#573): dim by token, drop the pointer.
2229
+ These four controls all draw TEXT — a label, a committed value, typed
2230
+ input — so dimming the ink is what "disabled" looks like on them. */
2192
2231
  :where(
2193
2232
  [data-pretable-button]:disabled,
2194
- [data-pretable-icon-button]:disabled
2233
+ [data-pretable-icon-button]:disabled,
2234
+ [data-pretable-select]:disabled,
2235
+ [data-pretable-text-input]:disabled
2195
2236
  ) {
2196
2237
  color: var(--pretable-text-dim);
2197
2238
  cursor: default;
2198
2239
  }
2240
+ /* The checkbox is deliberately NOT in that list. Its `color` is not ink for
2241
+ a label, it is the CHECK GLYPH, painted on the checked fill — so dimming
2242
+ it puts --pretable-text-dim on --pretable-checkbox-checked-bg at about
2243
+ 1.9:1 and the tick all but vanishes. A read-only boolean column renders
2244
+ its cell control disabled on EVERY row, so that would be every tick in
2245
+ the column. A checkbox's disabled look is its own tokens (border, fill,
2246
+ and the shared opacity/forced-colors treatment), never text ink; all this
2247
+ rule owes is the pointer. Declaring no `color` here also leaves the
2248
+ checked rule above as the last word on the glyph. */
2249
+ :where([data-pretable-checkbox]:disabled) {
2250
+ cursor: default;
2251
+ }
2199
2252
 
2200
2253
  /* ---- Coarse pointers -------------------------------------------------- */
2201
2254
 
@@ -2401,10 +2454,35 @@
2401
2454
  :where(
2402
2455
  [data-pretable-menu-item]:disabled,
2403
2456
  [data-pretable-button]:disabled,
2404
- [data-pretable-icon-button]:disabled
2457
+ [data-pretable-icon-button]:disabled,
2458
+ [data-pretable-select]:disabled,
2459
+ [data-pretable-text-input]:disabled,
2460
+ [data-pretable-checkbox]:disabled
2405
2461
  ) {
2406
2462
  color: GrayText;
2407
2463
  }
2464
+ /* The committed option's fill is an author background the UA would erase,
2465
+ leaving the chosen row indistinguishable from the rest of the list —
2466
+ the same failure the selected cell above has, answered the same way:
2467
+ the system's own guaranteed pair, and `forced-color-adjust: none` so
2468
+ the pair survives. */
2469
+ :where([data-pretable-option][aria-selected="true"]) {
2470
+ forced-color-adjust: none;
2471
+ background-color: Highlight;
2472
+ color: HighlightText;
2473
+ }
2474
+ /* A checked box is an author fill and an author glyph colour, both of
2475
+ which the UA erases — leaving a checked checkbox identical to an
2476
+ unchecked one, which is the whole of what the control says. Answered
2477
+ exactly as the committed option above: the system's guaranteed pair,
2478
+ and `forced-color-adjust: none` so the pair survives. The glyph is
2479
+ drawn in currentColor, so HighlightText carries it too. */
2480
+ :where([data-pretable-checkbox][aria-checked="true"]),
2481
+ :where([data-pretable-checkbox][aria-checked="mixed"]) {
2482
+ forced-color-adjust: none;
2483
+ background-color: Highlight;
2484
+ color: HighlightText;
2485
+ }
2408
2486
  }
2409
2487
 
2410
2488
  /* Reduced motion. Every animated declaration in this file is named here:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pretable/ui",
3
- "version": "0.16.0",
3
+ "version": "0.18.0",
4
4
  "description": "CSS themes, tokens, and grid styles for Pretable.",
5
5
  "license": "MIT",
6
6
  "repository": {
package/themes/excel.css CHANGED
@@ -9,11 +9,14 @@
9
9
 
10
10
  :root {
11
11
  /* Declared for the same reason pretable.css does: the browser paints the
12
- scroll viewport's scrollbars and every native control inside the grid —
13
- the filter dialog's operator select, its popup list — from this, not from
14
- the tokens. Without it a dark-mode host keeps this grid's scrollbars light and a light
15
- select popup, which is the one part of the surface a theme cannot reach
16
- with a custom property. */
12
+ scroll viewport's scrollbars and the native chrome still left inside the
13
+ grid — the filter dialog's text and date inputs (and the date input's own
14
+ calendar popup), and the enum checklist's checkboxes — from this, not from
15
+ the tokens. Without it a dark-mode host keeps this grid's scrollbars
16
+ light and its inputs and checkboxes on a light field, which is the part
17
+ of the surface a theme cannot reach with a custom property. The operator picker is no longer
18
+ among them: it is the kit's own combobox, styled through
19
+ `data-pretable-select` and `data-pretable-listbox`. */
17
20
  color-scheme: light;
18
21
 
19
22
  /* Surfaces */
@@ -14,11 +14,14 @@
14
14
 
15
15
  :root {
16
16
  /* Declared for the same reason pretable.css does: the browser paints the
17
- scroll viewport's scrollbars and every native control inside the grid —
18
- the filter dialog's operator select, its popup list — from this, not from
19
- the tokens. Without it a dark-mode grid keeps light scrollbars and a light
20
- select popup, which is the one part of the surface a theme cannot reach
21
- with a custom property. */
17
+ scroll viewport's scrollbars and the native chrome still left inside the
18
+ grid — the filter dialog's text and date inputs (and the date input's own
19
+ calendar popup), and the enum checklist's checkboxes — from this, not from
20
+ the tokens. Without it a dark-mode grid keeps light scrollbars and its
21
+ inputs and checkboxes on a light field, which is the part of the surface
22
+ a theme cannot reach with a custom property. The operator picker is no longer
23
+ among them: it is the kit's own combobox, styled through
24
+ `data-pretable-select` and `data-pretable-listbox`. */
22
25
  color-scheme: light;
23
26
 
24
27
  /* Surfaces — M3 neutral grayscale (untinted by primary seed) */