@pretable/ui 0.3.0 → 0.3.2

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/dist/grid.css CHANGED
@@ -28,6 +28,22 @@
28
28
  border: 0;
29
29
  }
30
30
 
31
+ /* Every glyph in the set draws on a 16px grid in currentColor and takes its
32
+ size from here, so one token moves all of them. `flex: none` because most
33
+ sit inside flex containers that would otherwise squash them.
34
+
35
+ The literal fallback is load-bearing, for the same reason as
36
+ --pretable-group-indent below: an SVG with a viewBox and no width has no
37
+ useful intrinsic size, so against a third-party theme that predates the
38
+ token these collapse to `width: auto` and the chip grip alone inflates
39
+ from 16px to 54px, taking the drag-to-group strip's height with it. 16px
40
+ because that is the grid the set is authored on. */
41
+ :where([data-pretable-icon]) {
42
+ flex: none;
43
+ width: var(--pretable-icon-size, 16px);
44
+ height: var(--pretable-icon-size, 16px);
45
+ }
46
+
31
47
  /* Outer viewport (scrollable container) */
32
48
  :where([data-pretable-scroll-viewport]) {
33
49
  background: var(--pretable-bg-grid);
@@ -147,10 +163,17 @@
147
163
  );
148
164
  }
149
165
 
166
+ /* Sized from the icon token rather than 1em: the twisty is an SVG now, so a
167
+ font-relative box no longer tracks the glyph inside it. `rotate` below
168
+ turns about the BUTTON's centre, so the box has to hug the glyph or the
169
+ collapsed chevron swings off its own axis. */
150
170
  :where([data-pretable-group-twisty]) {
151
171
  flex: none;
152
- width: 1em;
153
- height: 1em;
172
+ display: inline-flex;
173
+ align-items: center;
174
+ justify-content: center;
175
+ width: var(--pretable-icon-size, 16px);
176
+ height: var(--pretable-icon-size, 16px);
154
177
  padding: 0;
155
178
  border: 0;
156
179
  background: none;
@@ -196,18 +219,45 @@
196
219
  }
197
220
 
198
221
  /* Pinned cells (sticky left) — an opaque fill so scrolled columns pass
199
- underneath, on their own token rather than the header's. */
222
+ underneath, on their own token rather than the header's.
223
+ The seam shadow marks the frozen edge for themes that do not mark it any
224
+ other way. A theme that drops the vertical rule AND gives --pretable-bg-pinned
225
+ no tone step has no boundary at all otherwise: unpinned cells scroll under
226
+ these at z-index 1, so text would appear clipped mid-glyph at an invisible
227
+ line. The spread is <= -blur/2 on purpose — any less negative and the blur
228
+ bleeds above and below each cell and paints a dark band at every row
229
+ boundary inside the pinned region.
230
+ Known interaction: the focus ring below is also a `box-shadow`, and
231
+ box-shadow is not additive, so a FOCUSED pinned cell shows the ring and
232
+ loses its seam for as long as it holds focus. Accepted rather than worked
233
+ around — the ring is the stronger signal in that moment, it is one cell,
234
+ and both shipped themes opt out of the seam entirely. Revisit if the house
235
+ theme makes it visible. */
200
236
  :where([data-pretable-cell][data-pretable-pinned="left"]) {
201
237
  background: var(--pretable-bg-pinned);
238
+ box-shadow: 8px 0 8px -8px var(--pretable-seam-color);
202
239
  z-index: 1;
203
240
  }
204
241
 
205
- /* Pinned cells (sticky right) — mirror of the left rule */
242
+ /* Pinned cells (sticky right) — mirror of the left rule, including the seam,
243
+ whose offset has to flip. That mirroring is why --pretable-seam-color holds
244
+ a COLOUR and not a whole shadow: one shadow value cannot be reversed. */
206
245
  :where([data-pretable-cell][data-pretable-pinned="right"]) {
207
246
  background: var(--pretable-bg-pinned);
247
+ box-shadow: -8px 0 8px -8px var(--pretable-seam-color);
208
248
  z-index: 1;
209
249
  }
210
250
 
251
+ /* A pinned cell inside a group row is still part of the band. Both pinned
252
+ rules above follow the group-row rule at equal (0,0,0) specificity, so
253
+ without this a frozen column punches a visible notch straight through every
254
+ group band the moment a theme stops aliasing the two surface tokens
255
+ together — which is exactly what the house theme does. Excel and Material
256
+ are immune only by accident. */
257
+ :where([data-pretable-group-row] [data-pretable-cell][data-pretable-pinned]) {
258
+ background: var(--pretable-bg-group-row);
259
+ }
260
+
211
261
  /* The left-pinned group is bounded by the base cell's border-right; the
212
262
  right-pinned group's boundary is its LEADING edge, so draw the rule on the
213
263
  first right-pinned cell only (avoids doubling up with the previous cell's
@@ -612,14 +662,11 @@
612
662
  cursor: grabbing;
613
663
  }
614
664
 
615
- /* Grip dots, drawn rather than added to the DOM — the handle is an empty,
616
- aria-hidden span so it costs no accessible content. */
665
+ /* The grip is a GripIcon from the set, so its size comes from
666
+ --pretable-icon-size via [data-pretable-icon] and only the tint is left
667
+ here. It used to be a tiled radial-gradient on an empty span, which could
668
+ not share a weight or an optical size with any other glyph. */
617
669
  :where([data-pretable-chip-handle]) {
618
- flex: none;
619
- width: 5px;
620
- height: 12px;
621
- background-image: radial-gradient(currentColor 40%, transparent 45%);
622
- background-size: 3px 4px;
623
670
  color: var(--pretable-text-dim);
624
671
  }
625
672
 
@@ -70,9 +70,13 @@
70
70
  --pretable-shadow-overlay: 0 4px 12px rgb(0 0 0 / 0.12);
71
71
  /* No card shadow: this theme draws a frame instead. pretable.css uses it. */
72
72
  --pretable-shadow-card: none;
73
- /* The frozen-column edge. Spread must be <= -blur/2 or the blur bleeds above
74
- and below each pinned cell and paints a dark band at every row boundary. */
75
- --pretable-shadow-seam: 6px 0 10px -8px rgb(0 0 0 / 0.18);
73
+ /* The frozen-column edge, as a COLOUR rather than a whole shadow: the right
74
+ edge needs the mirror of the left one's offset, and a single shadow value
75
+ cannot be flipped. grid.css owns the geometry — which is structural — and
76
+ the theme owns the strength. `transparent` opts out.
77
+ Excel opts out: it already marks the frozen edge twice over, with a tone
78
+ step on --pretable-bg-pinned and a vertical rule. */
79
+ --pretable-seam-color: transparent;
76
80
 
77
81
  /* Density — natural default = compact (Excel "Compact" tier) */
78
82
  --pretable-row-height: 20px; /* 15pt at 96 DPI */
@@ -84,6 +88,13 @@
84
88
  --pretable-font-size-cell: 15px; /* Aptos Narrow 11pt */
85
89
  --pretable-font-size-header: 13px;
86
90
 
91
+ /* Every glyph in the icon set draws at this size. 12px because Excel is a
92
+ dense skin — its header runs 13px and its row 20px, so a 16px glyph would
93
+ out-weigh the label it sits beside. Deliberately not density-scoped: the
94
+ chrome glyphs are affordances, not text, and they stay legible at 12px in
95
+ every tier. */
96
+ --pretable-icon-size: 12px;
97
+
87
98
  /* Typography */
88
99
  --pretable-font-sans:
89
100
  "Aptos Narrow", "Aptos", "Segoe UI", -apple-system, BlinkMacSystemFont,
@@ -77,9 +77,14 @@
77
77
  --pretable-shadow-overlay: 0 4px 12px rgb(0 0 0 / 0.12);
78
78
  /* No card shadow: this theme draws a frame instead. pretable.css uses it. */
79
79
  --pretable-shadow-card: none;
80
- /* The frozen-column edge. Spread must be <= -blur/2 or the blur bleeds above
81
- and below each pinned cell and paints a dark band at every row boundary. */
82
- --pretable-shadow-seam: 6px 0 10px -8px rgb(0 0 0 / 0.18);
80
+ /* The frozen-column edge, as a COLOUR rather than a whole shadow: the right
81
+ edge needs the mirror of the left one's offset, and a single shadow value
82
+ cannot be flipped. grid.css owns the geometry — which is structural — and
83
+ the theme owns the strength. `transparent` opts out.
84
+ Material opts out: like Excel it marks the frozen edge with a tone step on
85
+ --pretable-bg-pinned plus a vertical rule, so a shadow would be a third
86
+ signal and a change to a compatibility skin's look. */
87
+ --pretable-seam-color: transparent;
83
88
 
84
89
  /* Density — natural default = standard */
85
90
  --pretable-row-height: 48px;
@@ -91,6 +96,12 @@
91
96
  --pretable-font-size-cell: 14px; /* body-medium */
92
97
  --pretable-font-size-header: 14px; /* label-large (px equal; weight differs in grid.css) */
93
98
 
99
+ /* Every glyph in the icon set draws at this size. 16px is M3's own icon size
100
+ for dense components, and it matches the 14px header and 48px row far
101
+ better than Excel's 12px would. Deliberately not density-scoped: the
102
+ chrome glyphs are affordances, not text. */
103
+ --pretable-icon-size: 16px;
104
+
94
105
  /* Typography */
95
106
  --pretable-font-sans:
96
107
  "Roboto Flex", "Roboto", system-ui, -apple-system, BlinkMacSystemFont,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pretable/ui",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "CSS themes, tokens, and grid styles for Pretable.",
5
5
  "license": "MIT",
6
6
  "repository": {