@pretable/ui 0.0.13 → 0.1.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/dist/grid.css CHANGED
@@ -300,6 +300,35 @@
300
300
  justify-content: center;
301
301
  padding: 0;
302
302
  }
303
+
304
+ /* Rows containing a wrapped cell top-align every cell, so each column's first
305
+ line shares a baseline instead of every cell centring independently against
306
+ a variable row height.
307
+ `data-pretable-wrap` comes from `column.wrap` — a COLUMN property — so it
308
+ marks "this column can wrap", not "this cell did wrap". The match is
309
+ therefore static, and alignment never flips as streaming content changes a
310
+ row's height. A true per-row signal would flip on every height change; do
311
+ not add one.
312
+ Placed AFTER the row-selection rule deliberately: every selector in this
313
+ file is :where()-flattened to (0,0,0), so source order is the only thing
314
+ that lets this reach the checkbox cell. Left centred, the checkbox floats
315
+ far below the row it selects once a cell wraps to three lines. */
316
+ :where(
317
+ [data-pretable-row]:has([data-pretable-wrap="true"]) [data-pretable-cell]
318
+ ) {
319
+ align-items: flex-start;
320
+ }
321
+
322
+ /* The checkbox cell zeroes its padding to centre a 16px control in the row.
323
+ Top-aligned it needs that vertical padding back, or it sits above the first
324
+ line of text instead of on it. */
325
+ :where(
326
+ [data-pretable-row]:has([data-pretable-wrap="true"])
327
+ [data-pretable-cell][data-pretable-row-select-cell="true"]
328
+ ) {
329
+ padding-top: var(--pretable-cell-padding-y);
330
+ }
331
+
303
332
  :where(
304
333
  button[data-pretable-row-select],
305
334
  button[data-pretable-row-select-all],
@@ -861,4 +890,50 @@
861
890
  font-family: var(--pretable-font-sans);
862
891
  font-size: var(--pretable-font-size-cell);
863
892
  }
893
+
894
+ /* Data-lifecycle body states. Austere by design: no spinner opinion and no
895
+ animation — a consumer who wants one supplies `renderBodyState`.
896
+ The boxes themselves are positioned from inline layout math (the overlay's
897
+ top inset is the resolved header + panel height, which CSS cannot derive). */
898
+ :where([data-pretable-body-state]) {
899
+ box-sizing: border-box;
900
+ padding: calc(var(--pretable-cell-padding-y) * 4)
901
+ var(--pretable-cell-padding-x);
902
+ background: var(--pretable-bg-grid);
903
+ color: var(--pretable-text-dim);
904
+ font-family: var(--pretable-font-sans);
905
+ font-size: var(--pretable-font-size-cell);
906
+ text-align: center;
907
+ }
908
+
909
+ /* Failures read left-aligned like prose, and in the theme's error color. */
910
+ :where([data-pretable-body-state="error"]),
911
+ :where([data-pretable-body-state="error-strip"]) {
912
+ color: var(--pretable-text-error);
913
+ text-align: start;
914
+ }
915
+
916
+ /* The strip is a card stacked on top of the box below it, so it carries that
917
+ box's border and rounds only its own top. `border-bottom: 0` is what stops
918
+ the seam being drawn twice. */
919
+ :where([data-pretable-body-state="error-strip"]) {
920
+ border: 1px solid var(--pretable-rule-strong);
921
+ border-bottom: 0;
922
+ border-radius: var(--pretable-radius) var(--pretable-radius) 0 0;
923
+ }
924
+
925
+ /* …and the box below squares the two corners that now meet in the middle,
926
+ the same rule the group panel needs one level up. With the panel enabled
927
+ the strip stacks on the panel, which is then the box that squares. */
928
+ :where(
929
+ [data-pretable-body-state="error-strip"] + [data-pretable-scroll-viewport]
930
+ ),
931
+ :where(
932
+ [data-pretable-body-state="error-strip"]
933
+ + [data-pretable-group-panel-wrapper]
934
+ [data-pretable-group-panel]
935
+ ) {
936
+ border-top-left-radius: 0;
937
+ border-top-right-radius: 0;
938
+ }
864
939
  }
package/dist/index.d.cts CHANGED
@@ -17,8 +17,11 @@ interface DensityHeights {
17
17
  *
18
18
  * SSR-safe: returns the fallback values when `document` is undefined.
19
19
  *
20
- * For non-React consumers, tests, custom virtualizers, and power users.
21
- * The reactive React hook (`useResolvedHeights`) lives in `@pretable/react`.
20
+ * For non-React consumers, tests, custom virtualizers, and power users. This
21
+ * is the only public way to read density into JavaScript: `@pretable/react`'s
22
+ * reactive equivalent is internal, so a React caller that needs the values to
23
+ * follow a theme or density swap wraps this in its own `useSyncExternalStore`
24
+ * — the docs at `/docs/grid/density-helpers` carry the recipe.
22
25
  *
23
26
  * @public
24
27
  */
package/dist/index.d.ts CHANGED
@@ -17,8 +17,11 @@ interface DensityHeights {
17
17
  *
18
18
  * SSR-safe: returns the fallback values when `document` is undefined.
19
19
  *
20
- * For non-React consumers, tests, custom virtualizers, and power users.
21
- * The reactive React hook (`useResolvedHeights`) lives in `@pretable/react`.
20
+ * For non-React consumers, tests, custom virtualizers, and power users. This
21
+ * is the only public way to read density into JavaScript: `@pretable/react`'s
22
+ * reactive equivalent is internal, so a React caller that needs the values to
23
+ * follow a theme or density swap wraps this in its own `useSyncExternalStore`
24
+ * — the docs at `/docs/grid/density-helpers` carry the recipe.
22
25
  *
23
26
  * @public
24
27
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pretable/ui",
3
- "version": "0.0.13",
3
+ "version": "0.1.0",
4
4
  "description": "CSS themes, tokens, and grid styles for Pretable.",
5
5
  "license": "MIT",
6
6
  "repository": {