@kolkrabbi/kol-shell 0.52.0 → 0.55.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-shell",
3
- "version": "0.52.0",
3
+ "version": "0.55.0",
4
4
  "private": false,
5
5
  "description": "KOL application shell — fixed 48px NavRail + AppShell layout root, PageShell/PageHeader scaffolds, ContentFilters catalog organism, GridCard, SettingsScaffold, WalkthroughPanel, ShortcutsOverlay. App chrome (kol-framework owns site chrome). Nav items, content, shortcuts and settings are consumer-injected. Sits above @kolkrabbi/kol-{theme,component,framework}.",
6
6
  "license": "MIT",
@@ -20,9 +20,9 @@
20
20
  "react-dom": "^18.3.0 || ^19.0.0"
21
21
  },
22
22
  "devDependencies": {
23
- "@kolkrabbi/kol-component": "^0.200.0",
24
- "@kolkrabbi/kol-icons": "^0.26.0",
23
+ "@kolkrabbi/kol-component": "^0.201.0",
25
24
  "@kolkrabbi/kol-framework": "^0.44.0",
25
+ "@kolkrabbi/kol-icons": "^0.26.0",
26
26
  "@kolkrabbi/kol-theme": "^0.142.0"
27
27
  },
28
28
  "files": [
@@ -1,5 +1,5 @@
1
1
  import { useEffect } from 'react'
2
- import { LabeledControlSection, SettingsRow } from '@kolkrabbi/kol-component'
2
+ import { SettingsSections } from '@kolkrabbi/kol-component'
3
3
 
4
4
  /**
5
5
  * ShortcutsOverlay — the keyboard-shortcut sheet: blurred scrim, centred
@@ -22,16 +22,18 @@ import { LabeledControlSection, SettingsRow } from '@kolkrabbi/kol-component'
22
22
  * have lost the grouping. That consumer kept a 99-line local overlay instead,
23
23
  * which is the duplication this component exists to end.
24
24
  *
25
- * ONE IDIOM WITH THE SETTINGS PAGE (user, 2026-09-03: *"align it more to the
26
- * settings sidebar who uses LabelledControls and LabelledControlsSection"*).
27
- * This sheet and `SettingsShortcuts` render the SAME keymap array, and they
28
- * had drifted into two anatomies: a bespoke two-column grid with a plain
29
- * `text-fg-32` heading and hand-rolled `<span>` pairs here, against
30
- * `kol-eyebrow` sections over `SettingsRow`s there down to the combo being
31
- * `fg-96` in one and `fg-32` in the other. Both are `LabeledControlSection` +
32
- * `SettingsRow` now, so a shortcut reads identically wherever it is shown and
33
- * a change to the row lands in both. The column shape stays each one's own:
34
- * a tall single column here, a six-column grid on the settings page.
25
+ * ONE COMPONENT WITH THE SETTINGS PAGE AND THE DRAWER (user, 2026-09-03:
26
+ * *"align it more to the settings sidebar"* *"lets normalise a component
27
+ * they can grab"*). This sheet and `SettingsShortcuts` render the SAME keymap
28
+ * array and had drifted into two anatomies a bespoke two-column grid with a
29
+ * plain `text-fg-32` heading and hand-rolled `<span>` pairs here, against
30
+ * eyebrow sections over `SettingsRow`s there, down to the combo being `fg-96`
31
+ * in one and `fg-32` in the other. Both go through `SettingsSections` now, the
32
+ * same call the settings page and the settings drawer use, so a shortcut reads
33
+ * identically wherever it is shown and a change to the row lands in all of
34
+ * them. The FRAME stays each one's own: a scrim and a centred sheet here, a
35
+ * six-column grid on the page, a right-anchored drawer over the thing you are
36
+ * looking at.
35
37
  *
36
38
  * `keys` is a DISPLAY STRING and is never bound — this component shows a
37
39
  * keymap, it does not own one. Formatting a combo (⌘⇧Z) is the consumer's,
@@ -43,16 +45,15 @@ import { LabeledControlSection, SettingsRow } from '@kolkrabbi/kol-component'
43
45
 
44
46
  const isSectioned = (list) => Array.isArray(list?.[0]?.items)
45
47
 
46
- /* One row `SettingsRow`, the same one the settings page's `SettingsShortcuts`
47
- * uses, with the same `labelWidth="auto"` so the label yields and the combo
48
- * hugs (a combo is one token by nature and must not wrap). */
49
- function Row({ label, combo, keys }) {
50
- return (
51
- <SettingsRow label={label} align="fill" labelWidth="auto">
52
- <span className="text-fg-32 kol-helper-12 whitespace-nowrap">{combo ?? keys}</span>
53
- </SettingsRow>
54
- )
55
- }
48
+ /* A shortcut as a settings ROW: the label on the left, the combo as the row's
49
+ * value. `labelWidth="auto"` makes the label yield and the combo hug — a combo
50
+ * is one token by nature and must not wrap. */
51
+ const toRow = ({ label, combo, keys }) => ({
52
+ label,
53
+ align: 'fill',
54
+ labelWidth: 'auto',
55
+ value: <span className="text-fg-32 kol-helper-12 whitespace-nowrap">{combo ?? keys}</span>,
56
+ })
56
57
 
57
58
  export default function ShortcutsOverlay({ shortcuts = [], onClose }) {
58
59
  useEffect(() => {
@@ -85,21 +86,11 @@ export default function ShortcutsOverlay({ shortcuts = [], onClose }) {
85
86
  style={{ padding: 24, borderRadius: 4 }}
86
87
  onClick={(e) => e.stopPropagation()}
87
88
  >
88
- {sectioned
89
- ? shortcuts.map(({ section, items = [] }) => (
90
- <LabeledControlSection key={section} label={section} rowGap={1}>
91
- {items.map(({ label, combo, keys }) => (
92
- <Row key={`${section}:${label}`} label={label} combo={combo} keys={keys} />
93
- ))}
94
- </LabeledControlSection>
95
- ))
96
- : (
97
- <LabeledControlSection rowGap={1}>
98
- {shortcuts.map(({ label, combo, keys }) => (
99
- <Row key={label} label={label} combo={combo} keys={keys} />
100
- ))}
101
- </LabeledControlSection>
102
- )}
89
+ <SettingsSections
90
+ sections={sectioned
91
+ ? shortcuts.map(({ section, items = [] }) => ({ label: section, rowGap: 1, rows: items.map(toRow) }))
92
+ : [{ rowGap: 1, rows: shortcuts.map(toRow) }]}
93
+ />
103
94
  </div>
104
95
  </div>
105
96
  )