@kolkrabbi/kol-shell 0.62.0 → 0.63.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.62.0",
3
+ "version": "0.63.0",
4
4
  "private": false,
5
5
  "description": "The application shell",
6
6
  "license": "MIT",
@@ -12,7 +12,7 @@
12
12
  "./src/*": "./src/*"
13
13
  },
14
14
  "peerDependencies": {
15
- "@kolkrabbi/kol-component": ">=0.229.0",
15
+ "@kolkrabbi/kol-component": ">=0.246.0",
16
16
  "@kolkrabbi/kol-icons": ">=0.16.0",
17
17
  "@kolkrabbi/kol-theme": ">=0.165.0",
18
18
  "gsap": "^3.13.0",
@@ -20,10 +20,10 @@
20
20
  "react-dom": "^18.3.0 || ^19.0.0"
21
21
  },
22
22
  "devDependencies": {
23
- "@kolkrabbi/kol-component": "^0.240.0",
23
+ "@kolkrabbi/kol-component": "^0.246.0",
24
24
  "@kolkrabbi/kol-icons": "^0.33.1",
25
- "@kolkrabbi/kol-theme": "^0.166.0",
26
- "@kolkrabbi/kol-framework": "^0.49.0"
25
+ "@kolkrabbi/kol-framework": "^0.49.0",
26
+ "@kolkrabbi/kol-theme": "^0.170.0"
27
27
  },
28
28
  "files": [
29
29
  "src",
@@ -1,5 +1,5 @@
1
- import { useState } from 'react'
2
- import { Button } from '@kolkrabbi/kol-component'
1
+ import { useEffect, useRef, useState } from 'react'
2
+ import { Button, pushLayer, popLayer, isTopLayer } from '@kolkrabbi/kol-component'
3
3
 
4
4
  /**
5
5
  * WalkthroughPanel — A stepped intro card. the absolutely-centred stepped intro card (both repos'
@@ -13,10 +13,29 @@ import { Button } from '@kolkrabbi/kol-component'
13
13
  * `onClose` draws an X INSIDE the card, top-right (user, 2026-09-26, on media-hub:
14
14
  * the panel had no close of its own, so every app put one outside the card or on a
15
15
  * page button). Unset = no X, exactly as before.
16
+ *
17
+ * KEYS (kol-fxr 2026-10-09, HubWalkthroughEscape): Escape calls `onClose`, ← → page. The panel
18
+ * joins the DS overlay layer stack, so a sheet opened above it takes the Escape first, and keys
19
+ * typed into a field are left alone.
16
20
  */
17
21
  export default function WalkthroughPanel({ steps = [], iconComponent, onClose }) {
18
22
  const [step, setStep] = useState(0)
19
23
  const current = steps[step]
24
+ const live = useRef()
25
+ live.current = { onClose, last: steps.length - 1 }
26
+ useEffect(() => {
27
+ const layer = pushLayer()
28
+ const onKey = (e) => {
29
+ if (!isTopLayer(layer) || e.metaKey || e.ctrlKey || e.altKey) return
30
+ const el = e.target
31
+ if (el?.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(el?.tagName ?? '')) return
32
+ if (e.key === 'Escape' && live.current.onClose) { e.preventDefault(); live.current.onClose() }
33
+ else if (e.key === 'ArrowLeft') { e.preventDefault(); setStep((s) => Math.max(0, s - 1)) }
34
+ else if (e.key === 'ArrowRight') { e.preventDefault(); setStep((s) => Math.min(live.current.last, s + 1)) }
35
+ }
36
+ document.addEventListener('keydown', onKey)
37
+ return () => { document.removeEventListener('keydown', onKey); popLayer(layer) }
38
+ }, [])
20
39
  if (!current) return null
21
40
 
22
41
  return (