@pretable/ui 0.15.3 → 0.16.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 +126 -151
  2. package/package.json +1 -1
package/grid.css CHANGED
@@ -102,6 +102,66 @@
102
102
  background: var(--pretable-bg-header);
103
103
  }
104
104
 
105
+ /* ---- Kit components: push-buttons ------------------------------------
106
+ The shared look every plain push-button in the grid used to carry per
107
+ site — twelve rule lists for one box — now lives on the component's own
108
+ attributes, and each site keeps only what is genuinely its own: a size,
109
+ a reveal, an alignment. These rules come FIRST in the file so a site
110
+ rule can still win at equal specificity by source order. The site
111
+ attribute (`data-pretable-filter-clear`) still arrives on the element,
112
+ so every selector keyed on it keeps working.
113
+ `font: inherit` resolves correctly here because every surface a labelled
114
+ button sits in declares its own font trio — see the filter menu's comment
115
+ about portaled surfaces below; a `PretableButton` rendered straight into
116
+ a bare portal would inherit the HOST PAGE instead. */
117
+ :where([data-pretable-button], [data-pretable-icon-button]) {
118
+ box-sizing: border-box;
119
+ display: inline-flex;
120
+ align-items: center;
121
+ justify-content: center;
122
+ border: 0;
123
+ border-radius: var(--pretable-radius-control);
124
+ background: transparent;
125
+ color: var(--pretable-text-dim);
126
+ font: inherit;
127
+ cursor: pointer;
128
+ }
129
+ /* A labelled button speaks in the accent; an icon button in the dim ink
130
+ its site may lift on hover or reveal. */
131
+ :where([data-pretable-button]) {
132
+ color: var(--pretable-accent);
133
+ }
134
+ /* `ghost`: the 24px action row box — `+ filter`, `Expand all` — with a
135
+ hover tint painted as a background-IMAGE layer so a site's own surface
136
+ colour underneath survives. */
137
+ :where([data-pretable-button][data-pretable-variant="ghost"]) {
138
+ gap: 4px;
139
+ block-size: 24px;
140
+ padding-inline: 6px;
141
+ }
142
+ :where(
143
+ [data-pretable-button][data-pretable-variant="ghost"]:hover:not(:disabled)
144
+ ) {
145
+ background-image: linear-gradient(
146
+ var(--pretable-bg-hover),
147
+ var(--pretable-bg-hover)
148
+ );
149
+ }
150
+ /* `link`: plain accent text — `Clear`, `Reset columns`. No hover tint;
151
+ the two sites that use it never had one. */
152
+ :where([data-pretable-button][data-pretable-variant="link"]) {
153
+ padding: 2px 4px;
154
+ }
155
+ /* An icon button is a fixed box its site sizes (14, 18 and 24px boxes all
156
+ exist). NO `position: relative` here: it moves an in-flow flex item into
157
+ the positioned paint phase, which for the two remove buttons that sit in
158
+ flow among later siblings would reorder painting. The three sites that
159
+ need a containing block for a ::after hit area declare it themselves. */
160
+ :where([data-pretable-icon-button]) {
161
+ flex: none;
162
+ padding: 0;
163
+ }
164
+
105
165
  /* Multi-sort priority badge (rendered only when 2+ columns are sorted) */
106
166
  :where([data-pretable-sort-priority]) {
107
167
  margin-left: 2px;
@@ -884,21 +944,12 @@
884
944
  (css-cascade.test.ts). A new funnel-family attribute belongs on that
885
945
  list; a new builder attribute does not. */
886
946
  :where([data-pretable-filter-funnel]) {
887
- display: inline-flex;
888
- align-items: center;
889
- justify-content: center;
890
947
  width: 18px;
891
948
  height: 18px;
892
- padding: 0;
893
- border: 0;
894
- border-radius: var(--pretable-radius-control);
895
- background: transparent;
896
- color: var(--pretable-text-dim);
897
- cursor: pointer;
898
- opacity: 0;
899
- transition: opacity 0.1s ease;
900
949
  /* Containing block for the ::after hit area below. */
901
950
  position: relative;
951
+ opacity: 0;
952
+ transition: opacity 0.1s ease;
902
953
  }
903
954
  /* WCAG 2.5.8 (Target Size, Minimum) asks for 24x24 CSS px. The funnel drew
904
955
  an 18x18 tap target on every filterable column, so a phone got an 18px
@@ -957,7 +1008,7 @@
957
1008
  :where([data-pretable-filter-funnel][data-pretable-filter-active="true"]) {
958
1009
  color: var(--pretable-accent);
959
1010
  }
960
- :where([data-pretable-filter-funnel]:hover) {
1011
+ :where([data-pretable-filter-funnel]:hover:not(:disabled)) {
961
1012
  background: var(--pretable-bg-hover);
962
1013
  }
963
1014
 
@@ -976,6 +1027,12 @@
976
1027
  popover sat at the cell size. */
977
1028
  font-family: var(--pretable-font-sans);
978
1029
  font-size: var(--pretable-font-size-cell);
1030
+ /* The fourth member of the trio. Every kit control inside says
1031
+ `font: inherit`, and a `link` button has no fixed block-size, so
1032
+ without this a consumer with no CSS reset gets the UA's `normal`
1033
+ here — 1.5 is what the grid's own body computes and what the pixel
1034
+ baseline measured. */
1035
+ line-height: 1.5;
979
1036
  color: var(--pretable-text-cell);
980
1037
  }
981
1038
  :where([data-pretable-filter-menu]) select,
@@ -1004,8 +1061,7 @@
1004
1061
  already share. */
1005
1062
  :where(
1006
1063
  [data-pretable-filter-menu] select:focus-visible,
1007
- [data-pretable-filter-menu] input:focus-visible,
1008
- [data-pretable-filter-clear]:focus-visible
1064
+ [data-pretable-filter-menu] input:focus-visible
1009
1065
  ) {
1010
1066
  outline: 2px solid var(--pretable-focus-ring);
1011
1067
  outline-offset: -2px;
@@ -1017,11 +1073,6 @@
1017
1073
  }
1018
1074
  :where([data-pretable-filter-clear]) {
1019
1075
  align-self: flex-end;
1020
- background: transparent;
1021
- border: 0;
1022
- color: var(--pretable-accent);
1023
- cursor: pointer;
1024
- padding: 2px 4px;
1025
1076
  }
1026
1077
 
1027
1078
  /* ---- Drag-to-group panel (sub-project 3) ----------------------------- */
@@ -1125,22 +1176,13 @@
1125
1176
  }
1126
1177
 
1127
1178
  :where([data-pretable-chip-remove]) {
1128
- flex: none;
1129
- display: inline-flex;
1130
- align-items: center;
1131
- justify-content: center;
1179
+ /* 14px, one step under the 18px header buttons — the chip is a small
1180
+ object and its ✕ is a CloseIcon sized by --pretable-icon-size, so
1181
+ nothing here is type. */
1132
1182
  width: 14px;
1133
1183
  height: 14px;
1134
- padding: 0;
1135
- border: 0;
1136
- border-radius: var(--pretable-radius-control);
1137
- background: transparent;
1138
- color: var(--pretable-text-dim);
1139
- font-size: 10px;
1140
- line-height: 1;
1141
- cursor: pointer;
1142
1184
  }
1143
- :where([data-pretable-chip-remove]:hover) {
1185
+ :where([data-pretable-chip-remove]:hover:not(:disabled)) {
1144
1186
  background: var(--pretable-selection-bg);
1145
1187
  color: var(--pretable-text-cell);
1146
1188
  }
@@ -1162,19 +1204,8 @@
1162
1204
  open case matters — without it the button vanishes the moment the pointer
1163
1205
  leaves the header, while its own menu is still up. */
1164
1206
  :where([data-pretable-column-menu-button]) {
1165
- display: inline-flex;
1166
- align-items: center;
1167
- justify-content: center;
1168
1207
  width: 18px;
1169
1208
  height: 18px;
1170
- padding: 0;
1171
- border: 0;
1172
- border-radius: var(--pretable-radius-control);
1173
- background: transparent;
1174
- color: var(--pretable-text-dim);
1175
- cursor: pointer;
1176
- opacity: 0;
1177
- transition: opacity 0.1s ease;
1178
1209
  /* Containing block for the coarse-pointer hit area at the end of the file.
1179
1210
  Declared here rather than beside it so the two cannot drift apart, and
1180
1211
  unconditional because it changes nothing on its own: the button is
@@ -1182,13 +1213,15 @@
1182
1213
  moves no pixel and reorders no paint — both slots were already in the
1183
1214
  positioned phase, ordered by tree order. */
1184
1215
  position: relative;
1216
+ opacity: 0;
1217
+ transition: opacity 0.1s ease;
1185
1218
  }
1186
1219
  :where([data-pretable-header-row]:hover [data-pretable-column-menu-button]),
1187
1220
  :where([data-pretable-column-menu-button]:focus-visible),
1188
1221
  :where([data-pretable-column-menu-button][aria-expanded="true"]) {
1189
1222
  opacity: 1;
1190
1223
  }
1191
- :where([data-pretable-column-menu-button]:hover) {
1224
+ :where([data-pretable-column-menu-button]:hover:not(:disabled)) {
1192
1225
  background: var(--pretable-selection-bg);
1193
1226
  }
1194
1227
 
@@ -1201,6 +1234,12 @@
1201
1234
  /* Portaled into <body>, so nothing is inherited from the viewport. */
1202
1235
  font-family: var(--pretable-font-sans);
1203
1236
  font-size: var(--pretable-font-size-cell);
1237
+ /* The fourth member of the trio. Every kit control inside says
1238
+ `font: inherit`, and a `link` button has no fixed block-size, so
1239
+ without this a consumer with no CSS reset gets the UA's `normal`
1240
+ here — 1.5 is what the grid's own body computes and what the pixel
1241
+ baseline measured. */
1242
+ line-height: 1.5;
1204
1243
  color: var(--pretable-text-cell);
1205
1244
  }
1206
1245
  :where([data-pretable-menu-item]) {
@@ -1774,23 +1813,13 @@
1774
1813
  header's opens — [data-pretable-column-menu] holding
1775
1814
  [data-pretable-menu-item]s — so the menu needs no rules of its own. */
1776
1815
  :where([data-pretable-tool-row-menu-button]) {
1777
- flex: none;
1778
- display: inline-flex;
1779
- align-items: center;
1780
- justify-content: center;
1781
1816
  inline-size: 18px;
1782
1817
  block-size: 18px;
1783
- padding: 0;
1784
- border: 0;
1785
- border-radius: var(--pretable-radius-control);
1786
- background: transparent;
1787
- color: var(--pretable-text-dim);
1788
- cursor: pointer;
1789
1818
  /* Containing block for the coarse-pointer hit area at the end of the
1790
1819
  file, like the grip's. */
1791
1820
  position: relative;
1792
1821
  }
1793
- :where([data-pretable-tool-row-menu-button]:hover),
1822
+ :where([data-pretable-tool-row-menu-button]:hover:not(:disabled)),
1794
1823
  :where([data-pretable-tool-row-menu-button][aria-expanded="true"]) {
1795
1824
  background: var(--pretable-selection-bg);
1796
1825
  color: var(--pretable-text-cell);
@@ -1810,12 +1839,6 @@
1810
1839
  at the foot of the pane would outweigh every row above it. */
1811
1840
  :where([data-pretable-tool-reset]) {
1812
1841
  align-self: flex-end;
1813
- padding: 2px 4px;
1814
- border: 0;
1815
- background: transparent;
1816
- color: var(--pretable-accent);
1817
- cursor: pointer;
1818
- font: inherit;
1819
1842
  }
1820
1843
 
1821
1844
  /* ---- Filter builder (SP2b) -------------------------------------------- */
@@ -1970,34 +1993,23 @@
1970
1993
  chip strip can argue its own case (a chip is a label with a glyph on the
1971
1994
  end); this row cannot, because it sits beside two 24px controls that
1972
1995
  already made the opposite choice. What IS taken from the chip is the
1973
- quiet-until-hover idea — dim by --pretable-text-dim, full text colour on
1974
- hover — and not its paint: the hover fill is this section's own
1975
- background-IMAGE gradient, the same one the row and the join use, rather
1976
- than the chip's --pretable-selection-bg.
1977
- `flex: none` and a square inline-size: it holds a glyph, so it must not
1978
- stretch the way the fields either side of it do. The glyph itself is a
1979
- CloseIcon from the set, sized by --pretable-icon-size through
1980
- [data-pretable-icon] — no font-size here, unlike the chip's Unicode. */
1996
+ quiet-until-hover idea — full text colour on hover — and not its paint:
1997
+ the hover fill is this section's own background-IMAGE gradient, the same
1998
+ one the row and the join use, rather than the chip's
1999
+ --pretable-selection-bg.
2000
+ A square 24px box. NO `position: relative`: unlike the two ⋮ buttons this
2001
+ one sits IN FLOW among later siblings, so making it a positioned box
2002
+ would paint it above them. It buys no hit area with a ::after and needs
2003
+ no containing block. */
1981
2004
  /* [data-pretable-tool-group-remove] (the group-by row's ✕) shares every
1982
2005
  rule: same glyph, same quiet treatment, one set of declarations. */
1983
2006
  :where([data-pretable-filter-row-remove], [data-pretable-tool-group-remove]) {
1984
- box-sizing: border-box;
1985
- flex: none;
1986
- display: inline-flex;
1987
- align-items: center;
1988
- justify-content: center;
1989
2007
  inline-size: 24px;
1990
2008
  block-size: 24px;
1991
- padding: 0;
1992
- border: 0;
1993
- border-radius: var(--pretable-radius-control);
1994
- background: transparent;
1995
- color: var(--pretable-text-dim);
1996
- cursor: pointer;
1997
2009
  }
1998
2010
  :where(
1999
- [data-pretable-filter-row-remove]:hover,
2000
- [data-pretable-tool-group-remove]:hover
2011
+ [data-pretable-filter-row-remove]:hover:not(:disabled),
2012
+ [data-pretable-tool-group-remove]:hover:not(:disabled)
2001
2013
  ) {
2002
2014
  background-image: linear-gradient(
2003
2015
  var(--pretable-bg-hover),
@@ -2019,8 +2031,6 @@
2019
2031
  [data-pretable-filter-row-column]:focus-visible,
2020
2032
  [data-pretable-filter-row-operator]:focus-visible,
2021
2033
  input[data-pretable-filter-row-value]:focus-visible,
2022
- [data-pretable-filter-row-remove]:focus-visible,
2023
- [data-pretable-tool-group-remove]:focus-visible,
2024
2034
  [data-pretable-aggregate-row] select:focus-visible
2025
2035
  ) {
2026
2036
  outline: 2px solid var(--pretable-focus-ring);
@@ -2094,72 +2104,6 @@
2094
2104
  outline-offset: -2px;
2095
2105
  }
2096
2106
 
2097
- /* `+ filter` / `+ group`: the reset action's quiet-text-button voice,
2098
- because a bordered pair under the tree would outweigh the rows they add
2099
- to. 24px tall so the pair clears WCAG 2.5.8 on the same terms as the
2100
- join. */
2101
- /* [data-pretable-add-group] (the grouping section's `+ Add group`) rides
2102
- these four rules: same quiet-text-button voice, same disabled dimming
2103
- (there: tree depth; here: every column already grouped) — and so do the
2104
- expansion pair, [data-pretable-expand-all] / [data-pretable-collapse-all]
2105
- (disabled there: no groups to act on). One list per rule, extended in
2106
- place, so the sections cannot drift apart part by part. */
2107
- :where(
2108
- [data-pretable-filter-add],
2109
- [data-pretable-add-group],
2110
- [data-pretable-expand-all],
2111
- [data-pretable-collapse-all]
2112
- ) {
2113
- display: inline-flex;
2114
- align-items: center;
2115
- gap: 4px;
2116
- block-size: 24px;
2117
- padding-inline: 6px;
2118
- border: 0;
2119
- border-radius: var(--pretable-radius-control);
2120
- background: transparent;
2121
- color: var(--pretable-accent);
2122
- cursor: pointer;
2123
- /* The shorthand, unlike the join's longhands: this rule sets no size of
2124
- its own, so there is nothing for `font: inherit` to overwrite. */
2125
- font: inherit;
2126
- }
2127
- :where(
2128
- [data-pretable-filter-add]:hover:not(:disabled),
2129
- [data-pretable-add-group]:hover:not(:disabled),
2130
- [data-pretable-expand-all]:hover:not(:disabled),
2131
- [data-pretable-collapse-all]:hover:not(:disabled)
2132
- ) {
2133
- background-image: linear-gradient(
2134
- var(--pretable-bg-hover),
2135
- var(--pretable-bg-hover)
2136
- );
2137
- }
2138
- :where(
2139
- [data-pretable-filter-add]:focus-visible,
2140
- [data-pretable-add-group]:focus-visible,
2141
- [data-pretable-expand-all]:focus-visible,
2142
- [data-pretable-collapse-all]:focus-visible
2143
- ) {
2144
- outline: 2px solid var(--pretable-focus-ring);
2145
- outline-offset: -2px;
2146
- }
2147
-
2148
- /* `+ group` refuses at the engine's 64-level bound — a deeper tree throws
2149
- `invalid-query` out of setQuery, which no consumer catches. Disabled
2150
- dims by token like the hidden row does, and drops the pointer
2151
- affordance; the REASON is the button's business (a title/aria-disabled
2152
- description), not the stylesheet's. */
2153
- :where(
2154
- [data-pretable-filter-add]:disabled,
2155
- [data-pretable-add-group]:disabled,
2156
- [data-pretable-expand-all]:disabled,
2157
- [data-pretable-collapse-all]:disabled
2158
- ) {
2159
- color: var(--pretable-text-dim);
2160
- cursor: default;
2161
- }
2162
-
2163
2107
  /* What renders INSTEAD of the tree, so it sits with the actions that end
2164
2108
  it rather than opening the section. The group-label's voice: a dim line,
2165
2109
  not an empty box. A bordered placeholder would draw more attention than the
@@ -2226,6 +2170,33 @@
2226
2170
  outline-offset: 1px;
2227
2171
  }
2228
2172
 
2173
+ /* ---- Kit components: state -------------------------------------------
2174
+ The ring and the disabled ink come LAST in the layer, after every site
2175
+ rule, because every selector here is :where()-flattened to (0,0,0) and
2176
+ source order is the only cascade lever there is. A site's own state
2177
+ colour — `[data-pretable-filter-funnel][data-pretable-filter-active="true"]
2178
+ { color }`, a `:hover { color }` — would otherwise outrank the disabled
2179
+ ink at equal specificity. The ghost group's old local `:disabled` rule
2180
+ was protected only by being local and last; this is what replaces it.
2181
+ The two @media blocks that follow this section are the file's last word
2182
+ by construction, but they set only opacity and hit areas, never colour,
2183
+ so they cannot be the site rule this ordering guards against. */
2184
+ :where(
2185
+ [data-pretable-button]:focus-visible,
2186
+ [data-pretable-icon-button]:focus-visible
2187
+ ) {
2188
+ outline: 2px solid var(--pretable-focus-ring);
2189
+ outline-offset: -2px;
2190
+ }
2191
+ /* The standard disabled treatment (#573): dim by token, drop the pointer. */
2192
+ :where(
2193
+ [data-pretable-button]:disabled,
2194
+ [data-pretable-icon-button]:disabled
2195
+ ) {
2196
+ color: var(--pretable-text-dim);
2197
+ cursor: default;
2198
+ }
2199
+
2229
2200
  /* ---- Coarse pointers -------------------------------------------------- */
2230
2201
 
2231
2202
  /* A finger, not a mouse. The header's overlay controls were built on three
@@ -2427,7 +2398,11 @@
2427
2398
  /* GrayText is the system's own disabled ink. Without it a disabled item
2428
2399
  is forced to CanvasText — the enabled colour — and the menu goes back
2429
2400
  to offering the one thing that cannot be chosen. */
2430
- :where([data-pretable-menu-item]:disabled) {
2401
+ :where(
2402
+ [data-pretable-menu-item]:disabled,
2403
+ [data-pretable-button]:disabled,
2404
+ [data-pretable-icon-button]:disabled
2405
+ ) {
2431
2406
  color: GrayText;
2432
2407
  }
2433
2408
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pretable/ui",
3
- "version": "0.15.3",
3
+ "version": "0.16.0",
4
4
  "description": "CSS themes, tokens, and grid styles for Pretable.",
5
5
  "license": "MIT",
6
6
  "repository": {