@kolkrabbi/kol-shell 0.10.0 → 0.12.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.10.0",
3
+ "version": "0.12.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.108.0",
24
- "@kolkrabbi/kol-framework": "^0.28.0",
25
- "@kolkrabbi/kol-theme": "^0.72.0",
26
- "@kolkrabbi/kol-icons": "^0.22.0"
23
+ "@kolkrabbi/kol-component": "^0.118.2",
24
+ "@kolkrabbi/kol-framework": "^0.30.0",
25
+ "@kolkrabbi/kol-icons": "^0.24.0",
26
+ "@kolkrabbi/kol-theme": "^0.78.1"
27
27
  },
28
28
  "files": [
29
29
  "src",
package/src/AppShell.jsx CHANGED
@@ -26,6 +26,21 @@ import TouchDeviceOverlay, { useTouchPrimary } from './TouchDeviceOverlay.jsx'
26
26
  * localStorage `kol-desktop` is '1' (fxr's gate); `overlay` keeps the shell and
27
27
  * mounts TouchDeviceOverlay once (monitor's)
28
28
  * @param {string} props.appName TouchDeviceOverlay's subject
29
+ * @param {boolean} props.navKeys Option+1…9 navigates to `items[n-1].path` through `onNavigate` — the
30
+ * rail-order counterpart of `railToggleKey` (AppShellNavKeys, kol-monitor
31
+ * 2026-08-28 — user: "make command or alt 1234 go from home 1 2 3 4 in the
32
+ * sidenav without clicking"). Option, not Command: ⌘1–9 is the browser's
33
+ * tab switch. Matched on `e.code` (`Digit1`…) because Opt+digit yields
34
+ * `¡ ™ £ ¢` as `e.key` on macOS; ignored while typing in a field; only
35
+ * digits with an item; `preventDefault` on a match. Default off.
36
+ * @param {string} props.pageWash a CSS colour painted by `PageShell` OVER the shell's primary back
37
+ * (ShellPageWash, kol-monitor 2026-08-27 — user: "the back of the back
38
+ * should be primary — then you can just add transparent on top to step
39
+ * up the lightness"): `'var(--kol-fg-12)'` steps the page a rung lighter
40
+ * without swapping the surface. Set as `--kol-shell-page-wash` on the
41
+ * content wrapper, so a page root that is not `PageShell` reads it too.
42
+ * Default none — unset renders exactly as before. A prop, not a token
43
+ * an app binds, because fxr's stylesheet is imports-only by rule.
29
44
  */
30
45
  export default function AppShell({
31
46
  items,
@@ -38,6 +53,8 @@ export default function AppShell({
38
53
  railToggleKey,
39
54
  touch = 'shell',
40
55
  appName,
56
+ pageWash,
57
+ navKeys = false,
41
58
  children,
42
59
  }) {
43
60
  const [navHidden, setNavHidden] = useState(false)
@@ -59,9 +76,28 @@ export default function AppShell({
59
76
  return () => window.removeEventListener('keydown', onKey)
60
77
  }, [railToggleKey])
61
78
 
79
+ /* Option+digit → the rail item in that position (never while typing) */
80
+ useEffect(() => {
81
+ if (!navKeys) return undefined
82
+ const onKey = (e) => {
83
+ const m = /^Digit([1-9])$/.exec(e.code)
84
+ if (!m || !e.altKey || e.metaKey || e.ctrlKey) return
85
+ const t = e.target
86
+ if (t?.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(t?.tagName)) return
87
+ const item = items?.[Number(m[1]) - 1]
88
+ if (!item?.path) return
89
+ e.preventDefault()
90
+ onNavigate?.(item.path)
91
+ }
92
+ window.addEventListener('keydown', onKey)
93
+ return () => window.removeEventListener('keydown', onKey)
94
+ }, [navKeys, items, onNavigate])
95
+
62
96
  let wantsDesktop = false
63
97
  try { wantsDesktop = typeof localStorage !== 'undefined' && localStorage.getItem('kol-desktop') === '1' } catch { /* storage blocked */ }
64
- if (touch === 'bare' && coarse && !wantsDesktop) return <div className="kol-app-shell contents">{children}</div>
98
+ /* the wash variable rides the bare wrapper too (custom properties inherit
99
+ * through `display: contents`); there is no box here to paint the back on */
100
+ if (touch === 'bare' && coarse && !wantsDesktop) return <div className="kol-app-shell contents" style={{ '--kol-shell-page-wash': pageWash }}>{children}</div>
65
101
 
66
102
  return (
67
103
  <NavHiddenContext.Provider value={{ navHidden, setNavHidden }}>
@@ -79,7 +115,9 @@ export default function AppShell({
79
115
  themeToggle={themeToggle}
80
116
  />
81
117
  )}
82
- <div style={{ marginLeft: navHidden ? 0 : 'var(--kol-shell-rail-width)' }}>
118
+ {/* THE BACK OF THE BACK — surface-primary, always, in every app; the
119
+ * page paints its wash over it (ShellPageWash). */}
120
+ <div className="bg-surface-primary" style={{ marginLeft: navHidden ? 0 : 'var(--kol-shell-rail-width)', '--kol-shell-page-wash': pageWash }}>
83
121
  {children}
84
122
  </div>
85
123
  </div>
package/src/PageShell.jsx CHANGED
@@ -8,6 +8,12 @@
8
8
  *
9
9
  * Gutter is `--kol-shell-page-pad` (kol-theme). `PageBleed` breaks it for
10
10
  * full-width embeds (monitor's rack bleed).
11
+ *
12
+ * The background is `var(--kol-shell-page-wash, var(--kol-surface-primary))`
13
+ * (ShellPageWash, 2026-08-27): unset, today's primary pixel; set by
14
+ * `AppShell pageWash`, a transparent wash over the shell's primary back —
15
+ * the lightness steps up and the structure stays visible, which an opaque
16
+ * surface swap would hide. The ink stays `text-auto` (surface-on-primary).
11
17
  */
12
18
  export default function PageShell({ mode = 'scroll', className = '', style, children }) {
13
19
  const modeStyle =
@@ -16,8 +22,9 @@ export default function PageShell({ mode = 'scroll', className = '', style, chil
16
22
  : { minHeight: '100vh' }
17
23
  return (
18
24
  <div
19
- className={`bg-surface-primary ${className}`.trim()}
25
+ className={`text-auto ${className}`.trim()}
20
26
  style={{
27
+ background: 'var(--kol-shell-page-wash, var(--kol-surface-primary))',
21
28
  padding: 'var(--kol-shell-page-pad)',
22
29
  display: 'flex',
23
30
  flexDirection: 'column',