@kolkrabbi/kol-shell 0.51.0 → 0.52.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 +5 -5
- package/src/ShortcutsOverlay.jsx +39 -22
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolkrabbi/kol-shell",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.52.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,10 +20,10 @@
|
|
|
20
20
|
"react-dom": "^18.3.0 || ^19.0.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@kolkrabbi/kol-component": "^0.
|
|
24
|
-
"@kolkrabbi/kol-icons": "^0.
|
|
25
|
-
"@kolkrabbi/kol-framework": "^0.
|
|
26
|
-
"@kolkrabbi/kol-theme": "^0.
|
|
23
|
+
"@kolkrabbi/kol-component": "^0.200.0",
|
|
24
|
+
"@kolkrabbi/kol-icons": "^0.26.0",
|
|
25
|
+
"@kolkrabbi/kol-framework": "^0.44.0",
|
|
26
|
+
"@kolkrabbi/kol-theme": "^0.142.0"
|
|
27
27
|
},
|
|
28
28
|
"files": [
|
|
29
29
|
"src",
|
package/src/ShortcutsOverlay.jsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useEffect } from 'react'
|
|
2
|
+
import { LabeledControlSection, SettingsRow } from '@kolkrabbi/kol-component'
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* ShortcutsOverlay — the keyboard-shortcut sheet: blurred scrim, centred
|
|
@@ -21,10 +22,16 @@ import { useEffect } from 'react'
|
|
|
21
22
|
* have lost the grouping. That consumer kept a 99-line local overlay instead,
|
|
22
23
|
* which is the duplication this component exists to end.
|
|
23
24
|
*
|
|
24
|
-
* ONE
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
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.
|
|
28
35
|
*
|
|
29
36
|
* `keys` is a DISPLAY STRING and is never bound — this component shows a
|
|
30
37
|
* keymap, it does not own one. Formatting a combo (⌘⇧Z) is the consumer's,
|
|
@@ -36,13 +43,14 @@ import { useEffect } from 'react'
|
|
|
36
43
|
|
|
37
44
|
const isSectioned = (list) => Array.isArray(list?.[0]?.items)
|
|
38
45
|
|
|
39
|
-
/* One row
|
|
40
|
-
*
|
|
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). */
|
|
41
49
|
function Row({ label, combo, keys }) {
|
|
42
50
|
return (
|
|
43
|
-
<
|
|
44
|
-
<span
|
|
45
|
-
</
|
|
51
|
+
<SettingsRow label={label} align="fill" labelWidth="auto">
|
|
52
|
+
<span className="text-fg-32 kol-helper-12 whitespace-nowrap">{combo ?? keys}</span>
|
|
53
|
+
</SettingsRow>
|
|
46
54
|
)
|
|
47
55
|
}
|
|
48
56
|
|
|
@@ -65,24 +73,33 @@ export default function ShortcutsOverlay({ shortcuts = [], onClose }) {
|
|
|
65
73
|
className="fixed inset-0 select-none kol-overlay-scrim"
|
|
66
74
|
style={{ display: 'grid', placeItems: 'center', zIndex: 'var(--kol-z-modal)' }}
|
|
67
75
|
>
|
|
68
|
-
|
|
76
|
+
{/* `bg-oq-04`, not `bg-surface-primary` (user, 2026-09-03: *"this is too
|
|
77
|
+
bright"*). Over a near-black editor canvas the raised page surface
|
|
78
|
+
reads as a lit slab, and an `fg-16` stroke on top of it was the
|
|
79
|
+
brightest edge on screen. The OPAQUE ramp is right here: the sheet
|
|
80
|
+
must not let the canvas through, and `oq-04` is a 4 % lift off the
|
|
81
|
+
ground rather than a surface from the page's own ladder — so the
|
|
82
|
+
panel separates from the scrimmed canvas without a stroke. */}
|
|
83
|
+
<div
|
|
84
|
+
className="kol-shortcuts-panel text-fg-64 kol-helper-12 bg-oq-04 flex flex-col gap-6"
|
|
85
|
+
style={{ padding: 24, borderRadius: 4 }}
|
|
86
|
+
onClick={(e) => e.stopPropagation()}
|
|
87
|
+
>
|
|
69
88
|
{sectioned
|
|
70
|
-
? shortcuts.map(({ section, items = [] }
|
|
71
|
-
<
|
|
72
|
-
<span
|
|
73
|
-
className="text-fg-32"
|
|
74
|
-
style={{ gridColumn: '1 / -1', marginTop: i === 0 ? 0 : 14 }}
|
|
75
|
-
>
|
|
76
|
-
{section}
|
|
77
|
-
</span>
|
|
89
|
+
? shortcuts.map(({ section, items = [] }) => (
|
|
90
|
+
<LabeledControlSection key={section} label={section} rowGap={1}>
|
|
78
91
|
{items.map(({ label, combo, keys }) => (
|
|
79
92
|
<Row key={`${section}:${label}`} label={label} combo={combo} keys={keys} />
|
|
80
93
|
))}
|
|
81
|
-
</
|
|
94
|
+
</LabeledControlSection>
|
|
82
95
|
))
|
|
83
|
-
:
|
|
84
|
-
<
|
|
85
|
-
|
|
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
|
+
)}
|
|
86
103
|
</div>
|
|
87
104
|
</div>
|
|
88
105
|
)
|