@ashley-shrok/viewmodel-shell 5.1.0 → 5.1.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/index.d.ts CHANGED
@@ -530,7 +530,8 @@ export interface TableRow {
530
530
  * cell (right). A previous version typed this as `ButtonNode[]` and called
531
531
  * the button renderer blindly, silently dropping non-button entries. */
532
532
  actions?: (ButtonNode | CheckboxNode)[];
533
- /** Row lifecycle STATE (NOT severity — that's `tone`). A freeform, app-extensible token; the framework ships styling for `done`, `disabled`, `running`. Emits .vms-table__row--{state}. Orthogonal to `tone`. */
533
+ /** Row lifecycle STATE (NOT severity — that's `tone`). A freeform, app-extensible token; the framework ships styling for `done`, `disabled`, `running`. Emits .vms-table__row--{state}. Orthogonal to `tone`.
534
+ * APPEARANCE ONLY — `state` dims/tints the row and NEVER affects clickability or the cursor. Clickability is governed solely by `action`: a `state:"disabled"` row that ALSO sets `action` is dimmed AND still clickable (pointer cursor + hover + role=button), e.g. an already-paid invoice line shown muted but still openable for details. To make a row literally non-clickable, omit `action` (optionally still dim it with `state`). */
534
535
  state?: string;
535
536
  /** Semantic intent/severity — the universal status tone axis (closed). Emits .vms-table__row--{tone} (subtle tinted row background, reusing the shared tokens). Omitted = neutral. */
536
537
  tone?: "danger" | "warning" | "success" | "info";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ashley-shrok/viewmodel-shell",
3
- "version": "5.1.0",
4
- "description": "A server-driven UI framework where the wire format is structured enough that agents can build full-stack apps without ever opening a browser and all UI tests are pure unit tests with no browser runtime. Server returns a JSON tree of typed nodes; a thin TypeScript adapter renders it to DOM. Backend-agnostic a .NET reference backend ships with the repo, but any language can produce the JSON contract.",
3
+ "version": "5.1.2",
4
+ "description": "A server-driven UI framework where the wire format is structured enough that agents can build full-stack apps without ever opening a browser and all UI tests are pure unit tests with no browser runtime. Server returns a JSON tree of typed nodes; a thin TypeScript adapter renders it to DOM. Backend-agnostic \u2014 a .NET reference backend ships with the repo, but any language can produce the JSON contract.",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "author": "ashley-shrok",
@@ -938,11 +938,16 @@ select.vms-field__input { cursor: pointer; padding-right: var(--vms-space-xl);
938
938
  outline-offset: -2px;
939
939
  }
940
940
  /* Row STATE (lifecycle) — done/disabled/running framework-styled; apps can add
941
- more .vms-table__row--{state} rules. */
941
+ more .vms-table__row--{state} rules. `state` is an APPEARANCE axis ONLY — it
942
+ dims/tints the row and NEVER affects clickability or cursor. Clickability is
943
+ governed solely by `row.action` (→ .vms-table__row--clickable → pointer +
944
+ hover + role=button). So a `state:"disabled"` row that ALSO has `row.action`
945
+ is dimmed AND still clickable, and correctly shows the pointer cursor — the
946
+ dim is a visual cue (e.g. an already-paid invoice line you can still open to
947
+ view details), not a behavioral disable. To make a row literally NOT
948
+ clickable, omit `row.action` (optionally still dim it with `state`). */
942
949
  .vms-table__row--done { opacity: 0.6; }
943
950
  .vms-table__row--disabled { opacity: 0.55; color: var(--vms-text-muted); }
944
- .vms-table__row--disabled.vms-table__row--clickable { cursor: default; }
945
- .vms-table__row--disabled.vms-table__row--clickable:hover { background: transparent; }
946
951
  .vms-table__row--running { background: color-mix(in srgb, var(--vms-accent) 8%, transparent); }
947
952
  /* Row TONE (severity) — the universal status axis (was the old critical/danger;
948
953
  critical → danger). Tints derive from theme vars (color-mix), so a custom
@@ -954,6 +959,13 @@ select.vms-field__input { cursor: pointer; padding-right: var(--vms-space-xl);
954
959
  .vms-table__link { color: var(--vms-accent); text-decoration: none; }
955
960
  .vms-table__link:hover { text-decoration: underline; }
956
961
 
962
+ /* Trailing per-row actions cell (row.actions[] ButtonNodes). Keep the buttons on
963
+ one line and give adjacent buttons breathing room — without this rule they
964
+ render flush against each other. Margin-adjacency (not `display:flex` on the
965
+ <td>) so the cell stays a proper table-cell and column widths are unaffected. */
966
+ .vms-table__td--actions { white-space: nowrap; }
967
+ .vms-table__td--actions .vms-button + .vms-button { margin-left: var(--vms-space-sm); }
968
+
957
969
  /* Selection — leading checkbox column + selected-row tint. The tint derives
958
970
  from --vms-accent via color-mix, so a custom :root theme recolors it
959
971
  automatically (same pattern as the status variants above). Selected wins
@@ -1130,6 +1142,15 @@ select.vms-field__input { cursor: pointer; padding-right: var(--vms-space-xl);
1130
1142
  --_badge-tone: var(--vms-text-muted);
1131
1143
  display: inline-flex;
1132
1144
  align-items: center;
1145
+ /* Hug content in ANY parent layout. A badge is semantically inline, but as a flex
1146
+ item it is BLOCKIFIED (inline-flex → flex) and a stack section's align-items:stretch
1147
+ would then stretch it to full width. Giving it a definite cross-size (fit-content)
1148
+ opts out of that stretch — align-items:stretch only stretches items whose cross size
1149
+ is `auto`. We deliberately DON'T use align-self:start: that would top-anchor a badge
1150
+ in a `row` section (align-items:center) since a child's align-self beats the parent's
1151
+ align-items. width:fit-content only touches the main-axis size, so a badge hugs in a
1152
+ stack AND stays vertically centered in a row. Inert for an inline-in-flow badge. */
1153
+ width: fit-content;
1133
1154
  /* Center the pill on the surrounding text instead of baselining it (an
1134
1155
  inline-flex pill otherwise hangs below the baseline of adjacent text). */
1135
1156
  vertical-align: middle;