@kolkrabbi/kol-shell 0.9.2 → 0.11.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.9.2",
3
+ "version": "0.11.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",
@@ -12,7 +12,7 @@
12
12
  "./src/*": "./src/*"
13
13
  },
14
14
  "peerDependencies": {
15
- "@kolkrabbi/kol-component": ">=0.99.0",
15
+ "@kolkrabbi/kol-component": ">=0.108.0",
16
16
  "@kolkrabbi/kol-framework": ">=0.20.0",
17
17
  "@kolkrabbi/kol-icons": ">=0.16.0",
18
18
  "@kolkrabbi/kol-theme": ">=0.68.0",
@@ -20,9 +20,9 @@
20
20
  "react-dom": "^18.3.0 || ^19.0.0"
21
21
  },
22
22
  "devDependencies": {
23
- "@kolkrabbi/kol-component": "^0.107.0",
24
- "@kolkrabbi/kol-theme": "^0.72.0",
25
23
  "@kolkrabbi/kol-icons": "^0.22.0",
24
+ "@kolkrabbi/kol-component": "^0.110.0",
25
+ "@kolkrabbi/kol-theme": "^0.72.0",
26
26
  "@kolkrabbi/kol-framework": "^0.28.0"
27
27
  },
28
28
  "files": [
package/src/AppShell.jsx CHANGED
@@ -26,6 +26,14 @@ 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 {string} props.pageWash a CSS colour painted by `PageShell` OVER the shell's primary back
30
+ * (ShellPageWash, kol-monitor 2026-08-27 — user: "the back of the back
31
+ * should be primary — then you can just add transparent on top to step
32
+ * up the lightness"): `'var(--kol-fg-12)'` steps the page a rung lighter
33
+ * without swapping the surface. Set as `--kol-shell-page-wash` on the
34
+ * content wrapper, so a page root that is not `PageShell` reads it too.
35
+ * Default none — unset renders exactly as before. A prop, not a token
36
+ * an app binds, because fxr's stylesheet is imports-only by rule.
29
37
  */
30
38
  export default function AppShell({
31
39
  items,
@@ -38,6 +46,7 @@ export default function AppShell({
38
46
  railToggleKey,
39
47
  touch = 'shell',
40
48
  appName,
49
+ pageWash,
41
50
  children,
42
51
  }) {
43
52
  const [navHidden, setNavHidden] = useState(false)
@@ -61,7 +70,9 @@ export default function AppShell({
61
70
 
62
71
  let wantsDesktop = false
63
72
  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>
73
+ /* the wash variable rides the bare wrapper too (custom properties inherit
74
+ * through `display: contents`); there is no box here to paint the back on */
75
+ if (touch === 'bare' && coarse && !wantsDesktop) return <div className="kol-app-shell contents" style={{ '--kol-shell-page-wash': pageWash }}>{children}</div>
65
76
 
66
77
  return (
67
78
  <NavHiddenContext.Provider value={{ navHidden, setNavHidden }}>
@@ -79,7 +90,9 @@ export default function AppShell({
79
90
  themeToggle={themeToggle}
80
91
  />
81
92
  )}
82
- <div style={{ marginLeft: navHidden ? 0 : 'var(--kol-shell-rail-width)' }}>
93
+ {/* THE BACK OF THE BACK — surface-primary, always, in every app; the
94
+ * page paints its wash over it (ShellPageWash). */}
95
+ <div className="bg-surface-primary" style={{ marginLeft: navHidden ? 0 : 'var(--kol-shell-rail-width)', '--kol-shell-page-wash': pageWash }}>
83
96
  {children}
84
97
  </div>
85
98
  </div>
@@ -20,8 +20,11 @@ import WalkthroughPanel from './WalkthroughPanel.jsx'
20
20
  * what a click does. `toCard(item, { view, layout })` → `{ key, title, detail,
21
21
  * media, actions, onClick, href, onNavigate, expanded, expandedContent, fit }` is
22
22
  * the whole contract — `expanded` / `expandedContent` reach `ContentCard catalog`'s
23
- * 2×2 cell (ShellHomeSystemMonitorGaps, kol-monitor 2026-08-27; neighbour-hiding
24
- * stays the consumer's); `fit` (`cover` default | `natural` | `compact`) is the
23
+ * 2×2 cell (ShellHomeSystemMonitorGaps, kol-monitor 2026-08-27) — and the page
24
+ * HIDES the cell's three neighbours itself (CatalogPageMonitorParity: the
25
+ * consumer never sees the filtered row order, so it cannot; monitor's
26
+ * `computeHiddenSet` for the 6-column grid, verbatim — the grid stays still
27
+ * instead of reflowing around the expanded card); `fit` (`cover` default | `natural` | `compact`) is the
25
28
  * card's media fit, PER CARD because one catalog mixes photographs (cover) and
26
29
  * diagrams (natural) — CatalogPageCardFit, kol-monitor: a rack preview wider
27
30
  * than the card lost its left rail to `cover`. Anything `ContentFilters` takes that the page has no
@@ -48,6 +51,20 @@ const LAYOUTS = [
48
51
  { value: 'grid', label: 'GRID' },
49
52
  ]
50
53
 
54
+ /* The 2×2 expanded card's three neighbours — the cell to the right, the two
55
+ * beneath — skipped so the grid stays still (monitor's computeHiddenSet, verbatim). */
56
+ function computeHiddenSet(items, expandedIdx) {
57
+ if (expandedIdx < 0) return new Set()
58
+ const hiddenSet = new Set()
59
+ const blockCol = Math.floor((expandedIdx % 6) / 2)
60
+ const blockRow = Math.floor(Math.floor(expandedIdx / 6) / 2)
61
+ const base = blockRow * 12 + blockCol * 2
62
+ ;[base, base + 1, base + 6, base + 7].forEach(i => {
63
+ if (i !== expandedIdx && i < items.length) hiddenSet.add(i)
64
+ })
65
+ return hiddenSet
66
+ }
67
+
51
68
  export default function CatalogPage({
52
69
  header,
53
70
  items = [],
@@ -90,17 +107,23 @@ export default function CatalogPage({
90
107
  defaultViewMode={defaultView}
91
108
  layoutOptions={open ? undefined : layouts}
92
109
  defaultLayout={defaultLayout}
93
- renderItem={(rows, viewMode, layout) => open ? null : (
110
+ renderItem={(rows, viewMode, layout) => {
111
+ if (open) return null
112
+ const cards = rows.map((item) => toCard ? toCard(item, { view: viewMode, layout }) : { title: item.title ?? item.name, detail: item.detail })
113
+ const hidden = layout === 'list' ? new Set() : computeHiddenSet(rows, cards.findIndex((c) => c.expanded))
114
+ return (
94
115
  <div style={{ display: 'grid', gridTemplateColumns: layout === 'list' ? 'repeat(4, 1fr)' : 'repeat(6, 1fr)', gap: layout === 'list' ? 8 : 24 }}>
95
116
  {rows.map((item, i) => {
96
- const c = toCard ? toCard(item, { view: viewMode, layout }) : { title: item.title ?? item.name, detail: item.detail }
117
+ if (hidden.has(i)) return null
118
+ const c = cards[i]
97
119
  const key = c.key ?? item.key ?? item.id ?? item.name ?? i
98
120
  return layout === 'list'
99
121
  ? <ContentRow key={key} variant="catalog" title={c.title} detail={c.detail} actions={c.actions} onClick={c.onClick} href={c.href} onNavigate={c.onNavigate} />
100
122
  : <ContentCard key={key} variant="catalog" fit={c.fit ?? 'cover'} title={c.title} detail={c.detail} media={c.media} actions={c.actions} onClick={c.onClick} href={c.href} onNavigate={c.onNavigate} expanded={c.expanded} expandedContent={c.expandedContent} />
101
123
  })}
102
124
  </div>
103
- )}
125
+ )
126
+ }}
104
127
  {...filtersProps}
105
128
  />
106
129
  </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',