@pretable/ui 0.17.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.
Files changed (2) hide show
  1. package/grid.css +151 -148
  2. package/package.json +1 -1
package/grid.css CHANGED
@@ -246,6 +246,53 @@
246
246
  color: var(--pretable-text-selected);
247
247
  }
248
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
+
249
296
  /* Multi-sort priority badge (rendered only when 2+ columns are sorted) */
250
297
  :where([data-pretable-sort-priority]) {
251
298
  margin-left: 2px;
@@ -862,63 +909,30 @@
862
909
  padding-top: var(--pretable-cell-padding-y);
863
910
  }
864
911
 
865
- /* The tool panel's visibility toggle is enrolled here rather than restyled
866
- in its own section: it IS this checkbox, and two hand-kept copies of the
867
- same control are how a theme edit makes them drift apart. */
868
- :where(
869
- button[data-pretable-row-select],
870
- button[data-pretable-row-select-all],
871
- button[data-pretable-bool-cell],
872
- button[data-pretable-tool-column-toggle]
873
- ) {
874
- width: 16px;
875
- height: 16px;
876
- border: 1px solid var(--pretable-checkbox-border);
877
- background: var(--pretable-checkbox-bg);
878
- border-radius: 3px;
879
- cursor: pointer;
880
- padding: 0;
881
- display: inline-flex;
882
- align-items: center;
883
- justify-content: center;
884
- font-size: 11px;
885
- line-height: 1;
886
- color: var(--pretable-checkbox-checked-fg);
887
- }
888
- :where(
889
- button[data-pretable-row-select][aria-checked="true"],
890
- button[data-pretable-row-select-all][aria-checked="true"],
891
- button[data-pretable-bool-cell][aria-checked="true"],
892
- button[data-pretable-tool-column-toggle][aria-checked="true"]
893
- ) {
894
- background: var(--pretable-checkbox-checked-bg);
895
- border-color: var(--pretable-checkbox-checked-bg);
896
- color: var(--pretable-checkbox-checked-fg);
897
- }
898
- :where(
899
- button[data-pretable-row-select][aria-checked="mixed"],
900
- button[data-pretable-row-select-all][aria-checked="mixed"]
901
- ) {
902
- background: var(--pretable-checkbox-checked-bg);
903
- border-color: var(--pretable-checkbox-checked-bg);
904
- color: var(--pretable-checkbox-checked-fg);
905
- }
906
-
907
- /* Boolean toggle cell (typed editors) */
908
- :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]) {
909
917
  margin: 0 auto;
910
918
  display: flex;
911
919
  align-items: center;
912
920
  justify-content: center;
913
921
  }
914
- :where(button[data-pretable-bool-cell]:disabled) {
915
- cursor: default;
916
- }
917
- :where(button[data-pretable-bool-cell][aria-busy="true"]) {
922
+ :where([data-pretable-bool-cell][aria-busy="true"]) {
918
923
  opacity: 0.5;
919
924
  cursor: wait;
920
925
  }
921
- :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"]) {
922
936
  outline: 1px solid var(--pretable-text-error);
923
937
  outline-offset: 1px;
924
938
  }
@@ -1119,43 +1133,31 @@
1119
1133
  line-height: 1.5;
1120
1134
  color: var(--pretable-text-cell);
1121
1135
  }
1122
- :where([data-pretable-filter-menu]) input[type="text"],
1123
- :where([data-pretable-filter-menu]) input[type="date"],
1124
- :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
+ ) {
1125
1148
  width: 100%;
1126
- box-sizing: border-box;
1127
- /* An explicit box, like the tool pane's identical controls: the operator
1128
- picker beside these is a kit select with its own fixed block-size, and
1129
- an input left to its own padding comes out several pixels taller — a
1130
- stacked pair that does not line up. Both centre their own text
1131
- vertically once the height is set, so the block padding goes. */
1132
1149
  block-size: 28px;
1133
1150
  padding-inline: 7px;
1134
- border: 1px solid var(--pretable-rule);
1135
- border-radius: var(--pretable-radius-control);
1136
- background: var(--pretable-bg-grid);
1137
- color: var(--pretable-text-cell);
1138
- font: inherit;
1139
1151
  }
1140
- /* The dialog's operator picker. A kit select: the rule above draws the box
1141
- for the INPUTS beside it, and the kit rule at the top of this file draws
1142
- this one's. What is the dialog's own is the size — full width, the 28px
1143
- the fields beside it stand at, and this dialog's 7px inset rather than
1144
- the kit's 6px. */
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. */
1145
1156
  :where([data-pretable-filter-operator]) {
1146
1157
  width: 100%;
1147
1158
  block-size: 28px;
1148
1159
  padding-inline: 7px;
1149
1160
  }
1150
- /* The product's focus ring, not the host page's. Without this the dialog's
1151
- fields keep the UA ring — which takes the CONSUMER's accent-color, so
1152
- tabbing from the pane's copy of these same controls to this one changed
1153
- the ring's colour, width and offset. The declaration the builder rows
1154
- already share. */
1155
- :where([data-pretable-filter-menu] input:focus-visible) {
1156
- outline: 2px solid var(--pretable-focus-ring);
1157
- outline-offset: -2px;
1158
- }
1159
1161
  :where([data-pretable-filter-set]) label {
1160
1162
  display: flex;
1161
1163
  gap: 6px;
@@ -1750,19 +1752,14 @@
1750
1752
  overflow-y: auto;
1751
1753
  }
1752
1754
 
1753
- /* The filter menu's input treatment, restated rather than shared: the menus
1754
- portal into <body> and this input does not, and coupling their selectors
1755
- 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. */
1756
1759
  :where([data-pretable-tool-search]) {
1757
- box-sizing: border-box;
1758
1760
  inline-size: 100%;
1759
1761
  margin-block-end: 6px;
1760
1762
  padding: 5px 7px;
1761
- border: 1px solid var(--pretable-rule);
1762
- border-radius: var(--pretable-radius-control);
1763
- background: var(--pretable-bg-grid);
1764
- color: var(--pretable-text-cell);
1765
- font: inherit;
1766
1763
  }
1767
1764
 
1768
1765
  /* Group labels split the list by pin state. Size and tracking do the
@@ -1983,11 +1980,11 @@
1983
1980
  color: var(--pretable-text-dim);
1984
1981
  }
1985
1982
 
1986
- /* The single-value field. NOT a kit control — an <input>, which no kit rule
1987
- draws — so it keeps the whole box here: the frame, the surface, the ink
1988
- and the font, at the same 24px the pickers beside it stand at, because
1989
- the difference between "which column", "which operator" and "what value"
1990
- is the words inside the box, not the frame around it.
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.
1991
1988
  `flex: 1 1 auto` WITH an explicit `min-inline-size`, which is the pair
1992
1989
  that makes the wrapping row above work: a field's automatic minimum size
1993
1990
  is its content, so one long value would hold the row wider than the pane
@@ -1999,22 +1996,11 @@
1999
1996
  one states nothing.
2000
1997
  24px is the height this section bought for the join and the add actions,
2001
1998
  so the whole row clears 2.5.8 on every pointer rather than only where a
2002
- coarse-pointer block applies.
2003
- `font: inherit` as the SHORTHAND — the add action's choice, not the
2004
- join's longhands: UA stylesheets set their own font on form controls, and
2005
- this rule sets no size of its own, so there is nothing for the shorthand
2006
- to overwrite. */
2007
- :where(input[data-pretable-filter-row-value]) {
2008
- box-sizing: border-box;
1999
+ coarse-pointer block applies. */
2000
+ :where([data-pretable-filter-row-value]) {
2009
2001
  flex: 1 1 auto;
2010
2002
  min-inline-size: 24px;
2011
2003
  block-size: 24px;
2012
- padding-inline: 6px;
2013
- border: 1px solid var(--pretable-rule);
2014
- border-radius: var(--pretable-radius-control);
2015
- background: var(--pretable-bg-grid);
2016
- color: var(--pretable-text-cell);
2017
- font: inherit;
2018
2004
  }
2019
2005
  /* The builder's pickers: size and flex participation only — the kit select
2020
2006
  rule at the top of this file draws the box. `min-inline-size` matters for
@@ -2039,16 +2025,18 @@
2039
2025
  /* The set shape's checklist, which is not a field: it takes its own line
2040
2026
  (`flex-basis: 100%` in a wrapping row) because a column of checkboxes
2041
2027
  beside three 24px controls would set the row's height to the number of
2042
- choices. Declared AFTER the rule above and matching a different element,
2043
- so nothing here is overriding anything — every selector in this file is
2044
- :where()-flattened to (0,0,0) and source order is the only lever. */
2045
- :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]) {
2046
2034
  display: flex;
2047
2035
  flex-direction: column;
2048
2036
  gap: 2px;
2049
2037
  flex-basis: 100%;
2050
2038
  }
2051
- :where(div[data-pretable-filter-row-value]) label {
2039
+ :where([data-pretable-filter-row-set]) label {
2052
2040
  display: flex;
2053
2041
  align-items: center;
2054
2042
  gap: 6px;
@@ -2083,32 +2071,11 @@
2083
2071
  );
2084
2072
  color: var(--pretable-text-cell);
2085
2073
  }
2086
- /* The value field's ring, an OUTLINE like every other ring in this file: a
2087
- box-shadow would spend the one shadow slot this control might later want
2088
- for elevation, and whichever declaration lost would lose silently. The
2089
- two pickers beside it take the KIT select's ring — same declaration, one
2090
- source — so only the input is named here.
2091
- `input[...-value]`, not the bare attribute: the set shape wears the same
2092
- attribute on a <div> wrapper, which takes no focus. A rule that matched it
2093
- would be inert today and would paint a ring around the whole checklist the
2094
- day anything made that wrapper focusable — a state nobody would have
2095
- designed. The FIELDS are what focus, so the field is what the selector
2096
- names. */
2097
- :where(input[data-pretable-filter-row-value]:focus-visible) {
2098
- outline: 2px solid var(--pretable-focus-ring);
2099
- outline-offset: -2px;
2100
- }
2101
- /* The checklist's checkboxes, which the rule above deliberately does not
2102
- reach — they are inside the wrapper, not the wrapper. Without this they
2103
- keep the UA's own focus ring, so tabbing through a set filter would change
2104
- ring colour and shape halfway down a row that is otherwise entirely this
2105
- section's. A POSITIVE offset, unlike every other ring here: a checkbox is
2106
- ~13px and paints to its own edge, so an inset ring would sit on top of the
2107
- box instead of around it. */
2108
- :where(div[data-pretable-filter-row-value]) input:focus-visible {
2109
- outline: 2px solid var(--pretable-focus-ring);
2110
- outline-offset: 1px;
2111
- }
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. */
2112
2079
 
2113
2080
  /* The connective, which is the thing users misread — so it sits between
2114
2081
  rows carrying the run's join rather than hiding in a group header. Two
@@ -2213,9 +2180,9 @@
2213
2180
  flex-direction: row;
2214
2181
  gap: 4px;
2215
2182
  }
2216
- /* 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
2217
2184
  one line, sized to the add button's 24px row so the stack keeps the
2218
- rail's rhythm. */
2185
+ rail's rhythm. The ring is the kit's, here and in the checklists. */
2219
2186
  :where([data-pretable-tool-grouping] label) {
2220
2187
  display: inline-flex;
2221
2188
  align-items: center;
@@ -2224,13 +2191,6 @@
2224
2191
  block-size: 24px;
2225
2192
  cursor: pointer;
2226
2193
  }
2227
- /* The checklist checkboxes' ring (its comment argues the POSITIVE offset:
2228
- a ~13px box painting to its own edge would be covered by an inset
2229
- ring), restated here because that rule is scoped to the filter rows. */
2230
- :where(input[data-pretable-hide-grouped]:focus-visible) {
2231
- outline: 2px solid var(--pretable-focus-ring);
2232
- outline-offset: 1px;
2233
- }
2234
2194
 
2235
2195
  /* ---- Kit components: state -------------------------------------------
2236
2196
  The ring and the disabled ink come LAST in the layer, after every site
@@ -2246,20 +2206,49 @@
2246
2206
  :where(
2247
2207
  [data-pretable-button]:focus-visible,
2248
2208
  [data-pretable-icon-button]:focus-visible,
2249
- [data-pretable-select]:focus-visible
2209
+ [data-pretable-select]:focus-visible,
2210
+ [data-pretable-text-input]:focus-visible,
2211
+ [data-pretable-checkbox]:focus-visible
2250
2212
  ) {
2251
2213
  outline: 2px solid var(--pretable-focus-ring);
2252
2214
  outline-offset: -2px;
2253
2215
  }
2254
- /* 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. */
2255
2231
  :where(
2256
2232
  [data-pretable-button]:disabled,
2257
2233
  [data-pretable-icon-button]:disabled,
2258
- [data-pretable-select]:disabled
2234
+ [data-pretable-select]:disabled,
2235
+ [data-pretable-text-input]:disabled
2259
2236
  ) {
2260
2237
  color: var(--pretable-text-dim);
2261
2238
  cursor: default;
2262
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
+ }
2263
2252
 
2264
2253
  /* ---- Coarse pointers -------------------------------------------------- */
2265
2254
 
@@ -2466,7 +2455,9 @@
2466
2455
  [data-pretable-menu-item]:disabled,
2467
2456
  [data-pretable-button]:disabled,
2468
2457
  [data-pretable-icon-button]:disabled,
2469
- [data-pretable-select]:disabled
2458
+ [data-pretable-select]:disabled,
2459
+ [data-pretable-text-input]:disabled,
2460
+ [data-pretable-checkbox]:disabled
2470
2461
  ) {
2471
2462
  color: GrayText;
2472
2463
  }
@@ -2480,6 +2471,18 @@
2480
2471
  background-color: Highlight;
2481
2472
  color: HighlightText;
2482
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
+ }
2483
2486
  }
2484
2487
 
2485
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.17.0",
3
+ "version": "0.18.0",
4
4
  "description": "CSS themes, tokens, and grid styles for Pretable.",
5
5
  "license": "MIT",
6
6
  "repository": {