@pretable/ui 0.16.0 → 0.17.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 +157 -82
- package/package.json +1 -1
- package/themes/excel.css +8 -5
- package/themes/material.css +8 -5
package/grid.css
CHANGED
|
@@ -162,6 +162,90 @@
|
|
|
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
|
+
|
|
165
249
|
/* Multi-sort priority badge (rendered only when 2+ columns are sorted) */
|
|
166
250
|
:where([data-pretable-sort-priority]) {
|
|
167
251
|
margin-left: 2px;
|
|
@@ -1035,17 +1119,16 @@
|
|
|
1035
1119
|
line-height: 1.5;
|
|
1036
1120
|
color: var(--pretable-text-cell);
|
|
1037
1121
|
}
|
|
1038
|
-
:where([data-pretable-filter-menu]) select,
|
|
1039
1122
|
:where([data-pretable-filter-menu]) input[type="text"],
|
|
1040
1123
|
:where([data-pretable-filter-menu]) input[type="date"],
|
|
1041
1124
|
:where([data-pretable-filter-menu]) input:not([type]) {
|
|
1042
1125
|
width: 100%;
|
|
1043
1126
|
box-sizing: border-box;
|
|
1044
|
-
/* An explicit box, like the tool pane's identical controls:
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
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. */
|
|
1049
1132
|
block-size: 28px;
|
|
1050
1133
|
padding-inline: 7px;
|
|
1051
1134
|
border: 1px solid var(--pretable-rule);
|
|
@@ -1054,15 +1137,22 @@
|
|
|
1054
1137
|
color: var(--pretable-text-cell);
|
|
1055
1138
|
font: inherit;
|
|
1056
1139
|
}
|
|
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. */
|
|
1145
|
+
:where([data-pretable-filter-operator]) {
|
|
1146
|
+
width: 100%;
|
|
1147
|
+
block-size: 28px;
|
|
1148
|
+
padding-inline: 7px;
|
|
1149
|
+
}
|
|
1057
1150
|
/* The product's focus ring, not the host page's. Without this the dialog's
|
|
1058
1151
|
fields keep the UA ring — which takes the CONSUMER's accent-color, so
|
|
1059
1152
|
tabbing from the pane's copy of these same controls to this one changed
|
|
1060
1153
|
the ring's colour, width and offset. The declaration the builder rows
|
|
1061
1154
|
already share. */
|
|
1062
|
-
:where(
|
|
1063
|
-
[data-pretable-filter-menu] select:focus-visible,
|
|
1064
|
-
[data-pretable-filter-menu] input:focus-visible
|
|
1065
|
-
) {
|
|
1155
|
+
:where([data-pretable-filter-menu] input:focus-visible) {
|
|
1066
1156
|
outline: 2px solid var(--pretable-focus-ring);
|
|
1067
1157
|
outline-offset: -2px;
|
|
1068
1158
|
}
|
|
@@ -1294,48 +1384,13 @@
|
|
|
1294
1384
|
border-top: 1px solid var(--pretable-rule);
|
|
1295
1385
|
}
|
|
1296
1386
|
|
|
1297
|
-
/* Enum combobox
|
|
1387
|
+
/* Enum combobox anchor (cell editor) */
|
|
1298
1388
|
:where([data-pretable-enum-editor]) {
|
|
1299
1389
|
display: block;
|
|
1300
1390
|
width: 100%;
|
|
1301
1391
|
height: 100%;
|
|
1302
1392
|
}
|
|
1303
1393
|
|
|
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
1394
|
/* Date calendar (cell editor) */
|
|
1340
1395
|
:where([data-pretable-date-editor]) {
|
|
1341
1396
|
display: block;
|
|
@@ -1733,7 +1788,7 @@
|
|
|
1733
1788
|
rules — the grouping block below adds nothing of its own.
|
|
1734
1789
|
[data-pretable-aggregate-row] (the aggregates block's rows) rides the
|
|
1735
1790
|
BASE rule only: same box, but nothing in it hovers, drags or takes row
|
|
1736
|
-
focus — its select carries its own states
|
|
1791
|
+
focus — its picker is a kit select and carries its own states. */
|
|
1737
1792
|
:where(
|
|
1738
1793
|
[data-pretable-tool-column-row],
|
|
1739
1794
|
[data-pretable-tool-group-row],
|
|
@@ -1928,18 +1983,20 @@
|
|
|
1928
1983
|
color: var(--pretable-text-dim);
|
|
1929
1984
|
}
|
|
1930
1985
|
|
|
1931
|
-
/* The
|
|
1932
|
-
|
|
1933
|
-
|
|
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.
|
|
1934
1991
|
`flex: 1 1 auto` WITH an explicit `min-inline-size`, which is the pair
|
|
1935
|
-
that makes the wrapping row above work: a
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1992
|
+
that makes the wrapping row above work: a field's automatic minimum size
|
|
1993
|
+
is its content, so one long value would hold the row wider than the pane
|
|
1994
|
+
and push the controls onto a line of their own no matter how the row
|
|
1995
|
+
wraps. ANY explicit value overrides that automatic minimum, so 24px
|
|
1996
|
+
shrinks and ellipsizes exactly as 0 would — and unlike 0 it does not hand
|
|
1997
|
+
back, on the inline axis, the WCAG 2.5.8 floor the block-size is
|
|
1998
|
+
claiming. A rule that states a 24px target and then permits a 4px-wide
|
|
1999
|
+
one states nothing.
|
|
1943
2000
|
24px is the height this section bought for the join and the add actions,
|
|
1944
2001
|
so the whole row clears 2.5.8 on every pointer rather than only where a
|
|
1945
2002
|
coarse-pointer block applies.
|
|
@@ -1947,17 +2004,7 @@
|
|
|
1947
2004
|
join's longhands: UA stylesheets set their own font on form controls, and
|
|
1948
2005
|
this rule sets no size of its own, so there is nothing for the shorthand
|
|
1949
2006
|
to overwrite. */
|
|
1950
|
-
|
|
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. */
|
|
1955
|
-
:where(
|
|
1956
|
-
[data-pretable-filter-row-column],
|
|
1957
|
-
[data-pretable-filter-row-operator],
|
|
1958
|
-
input[data-pretable-filter-row-value],
|
|
1959
|
-
[data-pretable-aggregate-row] select
|
|
1960
|
-
) {
|
|
2007
|
+
:where(input[data-pretable-filter-row-value]) {
|
|
1961
2008
|
box-sizing: border-box;
|
|
1962
2009
|
flex: 1 1 auto;
|
|
1963
2010
|
min-inline-size: 24px;
|
|
@@ -1969,6 +2016,25 @@
|
|
|
1969
2016
|
color: var(--pretable-text-cell);
|
|
1970
2017
|
font: inherit;
|
|
1971
2018
|
}
|
|
2019
|
+
/* The builder's pickers: size and flex participation only — the kit select
|
|
2020
|
+
rule at the top of this file draws the box. `min-inline-size` matters for
|
|
2021
|
+
the same reason it does on the field above: without it the longest option
|
|
2022
|
+
sets the trigger's automatic minimum and one long header name holds the
|
|
2023
|
+
row wider than the pane.
|
|
2024
|
+
[data-pretable-aggregate] (the grouping section's aggregate picker) rides
|
|
2025
|
+
this rule: it is the same 24px flex item as the builder's two, and the
|
|
2026
|
+
shared rule is what keeps the two panes' pickers from drifting apart.
|
|
2027
|
+
Appended AFTER the pinned head — the cascade guard anchors on
|
|
2028
|
+
[data-pretable-filter-row-column] leading. */
|
|
2029
|
+
:where(
|
|
2030
|
+
[data-pretable-filter-row-column],
|
|
2031
|
+
[data-pretable-filter-row-operator],
|
|
2032
|
+
[data-pretable-aggregate]
|
|
2033
|
+
) {
|
|
2034
|
+
flex: 1 1 auto;
|
|
2035
|
+
min-inline-size: 24px;
|
|
2036
|
+
block-size: 24px;
|
|
2037
|
+
}
|
|
1972
2038
|
|
|
1973
2039
|
/* The set shape's checklist, which is not a field: it takes its own line
|
|
1974
2040
|
(`flex-basis: 100%` in a wrapping row) because a column of checkboxes
|
|
@@ -2017,22 +2083,18 @@
|
|
|
2017
2083
|
);
|
|
2018
2084
|
color: var(--pretable-text-cell);
|
|
2019
2085
|
}
|
|
2020
|
-
/*
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
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.
|
|
2024
2091
|
`input[...-value]`, not the bare attribute: the set shape wears the same
|
|
2025
2092
|
attribute on a <div> wrapper, which takes no focus. A rule that matched it
|
|
2026
2093
|
would be inert today and would paint a ring around the whole checklist the
|
|
2027
2094
|
day anything made that wrapper focusable — a state nobody would have
|
|
2028
2095
|
designed. The FIELDS are what focus, so the field is what the selector
|
|
2029
2096
|
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
|
-
) {
|
|
2097
|
+
:where(input[data-pretable-filter-row-value]:focus-visible) {
|
|
2036
2098
|
outline: 2px solid var(--pretable-focus-ring);
|
|
2037
2099
|
outline-offset: -2px;
|
|
2038
2100
|
}
|
|
@@ -2183,7 +2245,8 @@
|
|
|
2183
2245
|
so they cannot be the site rule this ordering guards against. */
|
|
2184
2246
|
:where(
|
|
2185
2247
|
[data-pretable-button]:focus-visible,
|
|
2186
|
-
[data-pretable-icon-button]:focus-visible
|
|
2248
|
+
[data-pretable-icon-button]:focus-visible,
|
|
2249
|
+
[data-pretable-select]:focus-visible
|
|
2187
2250
|
) {
|
|
2188
2251
|
outline: 2px solid var(--pretable-focus-ring);
|
|
2189
2252
|
outline-offset: -2px;
|
|
@@ -2191,7 +2254,8 @@
|
|
|
2191
2254
|
/* The standard disabled treatment (#573): dim by token, drop the pointer. */
|
|
2192
2255
|
:where(
|
|
2193
2256
|
[data-pretable-button]:disabled,
|
|
2194
|
-
[data-pretable-icon-button]:disabled
|
|
2257
|
+
[data-pretable-icon-button]:disabled,
|
|
2258
|
+
[data-pretable-select]:disabled
|
|
2195
2259
|
) {
|
|
2196
2260
|
color: var(--pretable-text-dim);
|
|
2197
2261
|
cursor: default;
|
|
@@ -2401,10 +2465,21 @@
|
|
|
2401
2465
|
:where(
|
|
2402
2466
|
[data-pretable-menu-item]:disabled,
|
|
2403
2467
|
[data-pretable-button]:disabled,
|
|
2404
|
-
[data-pretable-icon-button]:disabled
|
|
2468
|
+
[data-pretable-icon-button]:disabled,
|
|
2469
|
+
[data-pretable-select]:disabled
|
|
2405
2470
|
) {
|
|
2406
2471
|
color: GrayText;
|
|
2407
2472
|
}
|
|
2473
|
+
/* The committed option's fill is an author background the UA would erase,
|
|
2474
|
+
leaving the chosen row indistinguishable from the rest of the list —
|
|
2475
|
+
the same failure the selected cell above has, answered the same way:
|
|
2476
|
+
the system's own guaranteed pair, and `forced-color-adjust: none` so
|
|
2477
|
+
the pair survives. */
|
|
2478
|
+
:where([data-pretable-option][aria-selected="true"]) {
|
|
2479
|
+
forced-color-adjust: none;
|
|
2480
|
+
background-color: Highlight;
|
|
2481
|
+
color: HighlightText;
|
|
2482
|
+
}
|
|
2408
2483
|
}
|
|
2409
2484
|
|
|
2410
2485
|
/* Reduced motion. Every animated declaration in this file is named here:
|
package/package.json
CHANGED
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
|
|
13
|
-
the filter dialog's
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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 */
|
package/themes/material.css
CHANGED
|
@@ -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
|
|
18
|
-
the filter dialog's
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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) */
|