@celestia-island/hikari 0.31.1 → 0.31.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celestia-island/hikari",
3
- "version": "0.31.1",
3
+ "version": "0.31.2",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Hikari Vue 3 component library — production-grade UI components based on shittim-chest design system",
@@ -54,15 +54,20 @@ export default defineComponent({
54
54
  const listRef = ref<HTMLDivElement | null>(null);
55
55
 
56
56
  /** Measure the widest label text and publish it as the label-column
57
- * width custom property. `scrollWidth` reports the text width even
58
- * while the fixed column clips it, so this is correct both before
59
- * the variable is first set and after any label change. */
57
+ * width custom property. Each span is momentarily set to
58
+ * `max-content` while reading: a plain `scrollWidth` on the fixed
59
+ * column would report `max(textWidth, columnWidth)` and the column
60
+ * could never shrink below its fallback. All reads happen inside one
61
+ * synchronous task, so no intermediate paint is observable. */
60
62
  function measure() {
61
63
  const root = listRef.value;
62
64
  if (!root) return;
63
65
  let widest = 0;
64
66
  for (const label of root.querySelectorAll<HTMLElement>(".s-auth-methods-label")) {
67
+ const previous = label.style.width;
68
+ label.style.width = "max-content";
65
69
  widest = Math.max(widest, label.scrollWidth);
70
+ label.style.width = previous;
66
71
  }
67
72
  if (widest > 0) root.style.setProperty("--auth-methods-label-width", `${widest}px`);
68
73
  }