@kolkrabbi/kol-component 0.267.0 → 0.269.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.267.0",
3
+ "version": "0.269.0",
4
4
  "description": "The core component library",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -26,8 +26,8 @@
26
26
  "embla-carousel-react": "^8.6.0",
27
27
  "pdfjs-dist": "^6.3.289",
28
28
  "react-syntax-highlighter": "^16.1.1",
29
- "@kolkrabbi/kol-markdown": "^0.1.3",
30
- "@kolkrabbi/kol-search": "^0.3.0"
29
+ "@kolkrabbi/kol-search": "^0.3.0",
30
+ "@kolkrabbi/kol-markdown": "^0.1.3"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@kolkrabbi/kol-icons": ">=0.22.0",
@@ -23,6 +23,11 @@
23
23
  * kol-monitor 2026-09-01 — in a narrow multi-column grid a fixed
24
24
  * 160 label left the control 4px, and a nowrap combo painted into
25
25
  * the neighbour column; the 48px column gap had been hiding it).
26
+ * text — bool, `inline` only. A row whose value is TEXT (a shortcut's combo, a reading): the label sets
27
+ * in `kol-mono-12` at the value's ink, label and value share a baseline, and the value cell is a
28
+ * flex box so no inherited line-height strut makes the row taller than its text
29
+ * (SettingsRowMonoBaseline, kol-monitor 2026-10-18 — user: *"why here are we not aligning baseline
30
+ * or size or nothing? and why such low opacity all over?"*).
26
31
  * variant — `'panel'` is the hardware panel label (was kol-hardware `PanelLabel`, merged
27
32
  * 2026-10-01): `kol-helper-8`, uppercase, hugging the control; it takes
28
33
  * `labelPosition` (`top · bottom · left · right`, default bottom), `labelClass` and `gap`.
@@ -36,6 +41,7 @@ export default function LabeledControl({
36
41
  labelWidth = 48,
37
42
  children,
38
43
  className = '',
44
+ text = false,
39
45
  variant,
40
46
  labelPosition = 'bottom',
41
47
  labelClass = 'kol-helper-8',
@@ -76,16 +82,16 @@ export default function LabeledControl({
76
82
  * showed as "C" or not at all. Label on its line, the value under it. */
77
83
  const labelAuto = labelWidth === 'auto'
78
84
  return (
79
- <div className={`flex ${labelAuto ? 'flex-col items-start gap-1 sm:flex-row sm:items-center sm:gap-3' : 'items-center gap-3'} ${className}`}>
85
+ <div className={`flex ${labelAuto ? `flex-col items-start gap-1 sm:flex-row ${text ? 'sm:items-baseline' : 'sm:items-center'} sm:gap-3` : `${text ? 'items-baseline' : 'items-center'} gap-3`} ${className}`}>
80
86
  {showLabel && (
81
87
  <span
82
- className={`kol-helper-10 tracking-widest text-meta ${labelAuto ? 'max-w-full min-w-0 truncate sm:flex-1' : 'shrink-0'}`}
88
+ className={`${text ? 'kol-mono-12 text-fg-80' : 'kol-helper-10 tracking-widest text-meta'} ${labelAuto ? 'max-w-full min-w-0 truncate sm:flex-1' : 'shrink-0'}`}
83
89
  style={labelAuto ? undefined : { width: labelWidth }}
84
90
  >
85
91
  {labelInner}
86
92
  </span>
87
93
  )}
88
- <div className={labelAuto ? 'min-w-0 max-w-full sm:overflow-hidden' : 'flex-1 min-w-0'}>{children}</div>
94
+ <div className={`${text ? 'flex ' : ''}${labelAuto ? 'min-w-0 max-w-full sm:overflow-hidden' : 'flex-1 min-w-0'}`}>{children}</div>
89
95
  </div>
90
96
  )
91
97
  }
@@ -67,23 +67,20 @@ export function HighlightMatch({ label, query, ranges }) {
67
67
  const MODE_LABEL = { search: 'Go to page', go: 'Go to page', add: 'Add', shortcuts: 'Run' }
68
68
  const MODE_PLACEHOLDER = { search: 'Search…', go: 'Go to…', add: 'Add…', shortcuts: 'Search shortcuts…' }
69
69
 
70
- /* the keymap as rows: every section visible at once, this page's first, the rest muted and never run */
70
+ /* the keymap as rows: this page's sections only (ShortcutsOverlayList, kol-monitor 2026-10-18 — no Elsewhere) */
71
71
  function shortcutRows(shortcuts, path, query) {
72
72
  const q = query.trim().toLowerCase()
73
- const rows = (sec, here) => (sec.items ?? []).map((it) => ({
74
- id: `${sec.section}:${it.id ?? it.label}`, label: it.label, hint: it.combo ?? it.keys,
75
- group: here ? sec.section : `Elsewhere · ${sec.section}`, disabled: !here, run: it.run,
76
- }))
77
- const all = [...shortcuts.filter((s) => shortcutInScope(s, path)).flatMap((s) => rows(s, true)),
78
- ...shortcuts.filter((s) => !shortcutInScope(s, path)).flatMap((s) => rows(s, false))]
73
+ const all = shortcuts.filter((s) => shortcutInScope(s, path)).flatMap((sec) => (sec.items ?? []).map((it) => ({
74
+ id: `${sec.section}:${it.id ?? it.label}`, label: it.label, hint: it.combo ?? it.keys, group: sec.section, run: it.run,
75
+ })))
79
76
  return q ? all.filter((r) => r.label.toLowerCase().includes(q) || String(r.hint ?? '').toLowerCase().includes(q)) : all
80
77
  }
81
78
 
82
79
  /**
83
80
  * CommandOverlay — The ⌘K overlay: search, add, go, shortcuts. Was `ShellSearchOverlay` (still exported, an
84
81
  * alias). `mode` names what the overlay is for — `search` (default) · `go` · `add` · `shortcuts`. In
85
- * `shortcuts` it draws `shortcuts` (the AppHub keymap) as rows: every section at once, the current page's
86
- * first, the rest muted under "Elsewhere"; typing filters; Enter runs a row's `run`.
82
+ * `shortcuts` it draws `shortcuts` as rows: the current page's sections only; typing filters; Enter runs a
83
+ * row's `run`. AppHub's `S` sheet is `ShortcutsOverlay`, not this mode (2026-10-18).
87
84
  *
88
85
  * ARROWS (2026-10-17 — user: *"arrows up down can focus category and arrows left right can enter and back,
89
86
  * along with enter key"*): ↑↓ move through rows; → or Enter opens a category (a `keepOpen` row); ← goes back
@@ -115,11 +115,12 @@ export default function SettingsPanel({
115
115
  * 2026-09-22, kol-client-olina). `labelWidth="auto"` passes through
116
116
  * to LabeledControl: the label flexes and truncates, the control hugs — for a
117
117
  * row living in a column narrower than the 160px label default
118
- * (SettingsShortcutsComboOverflow, kol-monitor 2026-09-01).
118
+ * (SettingsShortcutsComboOverflow, kol-monitor 2026-09-01). `text` is a row whose value is text — mono label at
119
+ * the value's ink, on the baseline, as tall as its text (LabeledControl's `text`; SettingsRowMonoBaseline, kol-monitor 2026-10-18).
119
120
  */
120
- export function SettingsRow({ label, hint, align = 'end', labelWidth = 160, children }) {
121
+ export function SettingsRow({ label, hint, align = 'end', labelWidth = 160, text = false, children }) {
121
122
  return (
122
- <LabeledControl inline label={typeof label === 'string' ? label.toUpperCase() : label} labelWidth={labelWidth}>
123
+ <LabeledControl inline text={text} label={typeof label === 'string' ? label.toUpperCase() : label} labelWidth={labelWidth}>
123
124
  {hint
124
125
  ? <Tooltip label={hint} triggerClassName={`inline-flex w-full ${align === 'fill' ? '' : 'justify-end'}`.trim()}>{children}</Tooltip>
125
126
  : <span className={`inline-flex w-full ${align === 'fill' ? '' : 'justify-end'}`.trim()}>{children}</span>}
@@ -35,7 +35,7 @@ import { LabeledControlSection, SettingsRow } from './SettingsPanel.jsx'
35
35
  * first included: the rule is `.kol-section--divided + .kol-section--divided`,
36
36
  * so the first draws nothing and skipping it just costs the next its line.
37
37
  *
38
- * @param {Array<{label?: string, rows: Array<{label: ReactNode, render?: Function, value?: ReactNode, hint?: string, align?: string, labelWidth?: number|'auto', id?: string}>, rowGap?: number}>} sections - The settings body, in order (`hint` → SettingsRow's hint)
38
+ * @param {Array<{label?: string, rows: Array<{label: ReactNode, render?: Function, value?: ReactNode, hint?: string, align?: string, labelWidth?: number|'auto', text?: boolean, id?: string}>, rowGap?: number}>} sections - The settings body, in order (`hint` → SettingsRow's hint)
39
39
  * @param {boolean} [divided=false] - Hairline above each section
40
40
  * @param {number|'auto'} [labelWidth] - Default label column for every row — `'auto'` makes the label yield and the control hug, which is what a narrow column or a nowrap value needs
41
41
  * @param {string} [align] - Default row alignment passed to `SettingsRow`
@@ -53,6 +53,7 @@ export default function SettingsSections({ sections = [], divided = false, label
53
53
  hint={row.hint}
54
54
  align={row.align ?? align}
55
55
  labelWidth={row.labelWidth ?? labelWidth}
56
+ text={row.text}
56
57
  >
57
58
  {row.render ? row.render() : row.value}
58
59
  </SettingsRow>
@@ -42,8 +42,8 @@ import SettingsSections from './SettingsSections.jsx'
42
42
  * @param {Array} props.shortcuts - `[{ label, combo }]` or `[{ section, items: [{ id, label, combo }] }]` — the same array `SettingsShortcuts` takes (ShellHomeSystemMonitorGaps, kol-monitor 2026-08-27: the overlay read `keys` while the settings block read `combo`; `combo` is the name, `keys` is tolerated for a release)
43
43
  * @param {Function} props.onClose
44
44
  * @param {string} [props.currentPath] sections may carry `routes: ['/rack']` (CommandOverlayModes, kol-monitor
45
- * 2026-10-17 — user: *"im in dev, how can I cable lock here?"*): with a path, the sections that work here come
46
- * first and the rest sit muted under ELSEWHERE, never as if they worked here. A section without `routes`
45
+ * 2026-10-17 — user: *"im in dev, how can I cable lock here?"*): with a path, only the sections that work here
46
+ * are drawn (ShortcutsOverlayList, kol-monitor 2026-10-18 — the muted ELSEWHERE block is gone). A section without `routes`
47
47
  * works everywhere. Bind keys from the same scope with `shortcutInScope`.
48
48
  */
49
49
 
@@ -74,7 +74,6 @@ export default function ShortcutsOverlay({ shortcuts = [], onClose, currentPath
74
74
 
75
75
  const sectioned = isSectioned(shortcuts)
76
76
  const here = sectioned ? shortcuts.filter((s) => shortcutInScope(s, currentPath)) : []
77
- const elsewhere = sectioned ? shortcuts.filter((s) => !shortcutInScope(s, currentPath)) : []
78
77
 
79
78
  return (
80
79
  <div
@@ -108,12 +107,6 @@ export default function ShortcutsOverlay({ shortcuts = [], onClose, currentPath
108
107
  ? here.map(({ section, items = [] }) => ({ label: section, rowGap: 1, rows: items.map(toRow) }))
109
108
  : [{ rowGap: 1, rows: shortcuts.map(toRow) }]}
110
109
  />
111
- {elsewhere.length > 0 && (
112
- <div className="flex flex-col gap-4 opacity-[var(--kol-opacity-disabled)]">
113
- <span className="kol-helper-10 text-fg-48">ELSEWHERE</span>
114
- <SettingsSections sections={elsewhere.map(({ section, items = [] }) => ({ label: section, rowGap: 1, rows: items.map(toRow) }))} />
115
- </div>
116
- )}
117
110
  </div>
118
111
  </div>
119
112
  )