@kolkrabbi/kol-component 0.150.1 → 0.151.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kolkrabbi/kol-component",
3
- "version": "0.150.1",
3
+ "version": "0.151.0",
4
4
  "description": "KOL design-system components — atoms through organisms, emitting canonical kol-* classes. Pairs with @kolkrabbi/kol-theme for styling.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -18,6 +18,11 @@
18
18
  * weight). Useful for current-value displays, units, etc.
19
19
  * inline — bool. When true, renders horizontally with label on the left.
20
20
  * labelWidth — px width for the label column when `inline`. Default 48.
21
+ * `'auto'` flips which cell yields: the label flexes and TRUNCATES,
22
+ * the control hugs its content (SettingsShortcutsComboOverflow,
23
+ * kol-monitor 2026-09-01 — in a narrow multi-column grid a fixed
24
+ * 160 label left the control 4px, and a nowrap combo painted into
25
+ * the neighbour column; the 48px column gap had been hiding it).
21
26
  * children — the control body.
22
27
  * className — additional classes on the wrapper.
23
28
  */
@@ -40,17 +45,22 @@ export default function LabeledControl({
40
45
  )
41
46
 
42
47
  if (inline) {
48
+ /* `'auto'`: the label is the yielding cell — flex-1, truncating — and the
49
+ * control hugs. The control still carries min-w-0 + overflow-hidden so a
50
+ * combo wider than the whole column CLIPS at the column edge rather than
51
+ * painting over the neighbour (the invariant: no cell outside its column). */
52
+ const labelAuto = labelWidth === 'auto'
43
53
  return (
44
54
  <div className={`flex items-center gap-3 ${className}`}>
45
55
  {showLabel && (
46
56
  <span
47
- className="kol-helper-10 tracking-widest text-meta shrink-0"
48
- style={{ width: labelWidth }}
57
+ className={`kol-helper-10 tracking-widest text-meta ${labelAuto ? 'flex-1 min-w-0 truncate' : 'shrink-0'}`}
58
+ style={labelAuto ? undefined : { width: labelWidth }}
49
59
  >
50
60
  {labelInner}
51
61
  </span>
52
62
  )}
53
- <div className="flex-1 min-w-0">{children}</div>
63
+ <div className={labelAuto ? 'min-w-0 overflow-hidden' : 'flex-1 min-w-0'}>{children}</div>
54
64
  </div>
55
65
  )
56
66
  }
@@ -112,7 +112,10 @@ export default function SettingsPanel({
112
112
  * uppercase label (`kol-helper-10` tracked, meta ink) in a 160px column, the
113
113
  * control fills the rest. A switch sits at the far right (`align="end"`, the
114
114
  * default); a dropdown fills the row (`align="fill"`). No hint sentences on the
115
- * page — `hint` rides the control's `title`.
115
+ * page — `hint` rides the control's `title`. `labelWidth="auto"` passes through
116
+ * to LabeledControl: the label flexes and truncates, the control hugs — for a
117
+ * row living in a column narrower than the 160px label default
118
+ * (SettingsShortcutsComboOverflow, kol-monitor 2026-09-01).
116
119
  */
117
120
  export function SettingsRow({ label, hint, align = 'end', labelWidth = 160, children }) {
118
121
  return (