@kolkrabbi/kol-shell 0.65.0 → 0.67.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/AppHub.jsx +14 -8
- package/src/HubDev.jsx +9 -11
- package/src/PhoneNav.jsx +4 -2
- package/src/TabStrip.jsx +6 -31
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolkrabbi/kol-shell",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.67.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.
|
|
15
|
+
"@kolkrabbi/kol-component": ">=0.266.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.
|
|
23
|
+
"@kolkrabbi/kol-component": "^0.267.0",
|
|
24
24
|
"@kolkrabbi/kol-icons": "^0.39.0",
|
|
25
|
-
"@kolkrabbi/kol-
|
|
26
|
-
"@kolkrabbi/kol-
|
|
25
|
+
"@kolkrabbi/kol-theme": "^0.175.0",
|
|
26
|
+
"@kolkrabbi/kol-framework": "^0.51.0"
|
|
27
27
|
},
|
|
28
28
|
"files": [
|
|
29
29
|
"src",
|
package/src/AppHub.jsx
CHANGED
|
@@ -3,9 +3,9 @@ import AppShell from './AppShell.jsx'
|
|
|
3
3
|
import HubHome from './HubHome.jsx'
|
|
4
4
|
import HubSettings from './HubSettings.jsx'
|
|
5
5
|
import HubDev from './HubDev.jsx'
|
|
6
|
-
import {
|
|
6
|
+
import { CommandOverlay } from '@kolkrabbi/kol-component'
|
|
7
7
|
|
|
8
|
-
/* taxonomy-ok: organism — nests AppShell / HubHome / HubSettings /
|
|
8
|
+
/* taxonomy-ok: organism — nests AppShell / HubHome / HubSettings / HubDev (relative) + kol-component's CommandOverlay */
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* AppHub — An app's shell and hub in one. Shell + Hub in one call; the app passes its Tool as children (the app anatomy,
|
|
@@ -39,8 +39,8 @@ import { ShortcutsOverlay } from '@kolkrabbi/kol-component'
|
|
|
39
39
|
* to neccessarily have settings manditory part of the rail"*) — no `settings`, no rail
|
|
40
40
|
* row, no route, no `,` key. It was pinned whether the app had settings or not.
|
|
41
41
|
* @param {Object} dev HubDev's props (`tabs`, `title`, `subtitle`) + `path` (default `/dev`). OPT-IN, and only on
|
|
42
|
-
* a dev server (`import.meta.env.DEV`; `always: true` overrides) — a `code` row
|
|
43
|
-
*
|
|
42
|
+
* a dev server (`import.meta.env.DEV`; `always: true` overrides) — a `code` row after
|
|
43
|
+
* the app's own rows (CompareGridDevTab · HubDevChrome, kol-monitor)
|
|
44
44
|
* @param {Array} shortcuts `[{ section, items: [{ id, label, combo }] }]` — the sheet AND Settings
|
|
45
45
|
* @param {ReactNode} themeToggle Settings' masthead toggle (a node — kol-framework is not a peer)
|
|
46
46
|
* @param {string} shortcutsKey default `s`; `null` turns the sheet key off (a tool that owns S)
|
|
@@ -70,6 +70,7 @@ export default function AppHub({
|
|
|
70
70
|
children,
|
|
71
71
|
}) {
|
|
72
72
|
const [sheet, setSheet] = useState(false)
|
|
73
|
+
const [sheetQuery, setSheetQuery] = useState('')
|
|
73
74
|
|
|
74
75
|
useEffect(() => {
|
|
75
76
|
if (!shortcutsKey) return undefined
|
|
@@ -95,13 +96,16 @@ export default function AppHub({
|
|
|
95
96
|
: devOn && (currentPath === devPath || currentPath?.startsWith(`${devPath}/`))
|
|
96
97
|
? <HubDev storageKey={`kol-dev-tab:${app.name ?? 'app'}`} {...devProps} />
|
|
97
98
|
: children
|
|
98
|
-
|
|
99
|
+
/* the Dev row closes the app's own rows — under Stage in monitor (HubDevChrome, kol-monitor 2026-10-18 — user:
|
|
100
|
+
* *"why did the dev tab move? it was fine where it was. below stage"*); Settings keeps the bottom alone */
|
|
101
|
+
const rows = devOn ? [...items, { icon: 'code', path: devPath, label: 'Dev' }] : items
|
|
102
|
+
const bottom = settings ? SETTINGS_ROW(settingsPath) : []
|
|
99
103
|
/* the phone bar lists Home as a tab — the rail draws it as the mark, the bar has no mark */
|
|
100
|
-
const barItems = [...(home ? [{ icon: 'home-01', path: homePath, label: 'Home' }] : []), ...
|
|
104
|
+
const barItems = [...(home ? [{ icon: 'home-01', path: homePath, label: 'Home' }] : []), ...rows, ...bottom]
|
|
101
105
|
|
|
102
106
|
return (
|
|
103
107
|
<AppShell
|
|
104
|
-
items={
|
|
108
|
+
items={rows}
|
|
105
109
|
bottomItems={bottom}
|
|
106
110
|
barItems={barItems}
|
|
107
111
|
logomark={app.logomark ? { svgUrl: app.logomark, title: app.name } : undefined}
|
|
@@ -122,7 +126,9 @@ export default function AppHub({
|
|
|
122
126
|
{...shell}
|
|
123
127
|
>
|
|
124
128
|
{page}
|
|
125
|
-
{
|
|
129
|
+
{/* THE SHEET IS THE OVERLAY'S SHORTCUTS MODE (5.3, 2026-10-17): the whole keymap at a glance, this page's
|
|
130
|
+
* first, the rest under Elsewhere; typing filters, Enter runs a row */}
|
|
131
|
+
<CommandOverlay open={sheet} mode="shortcuts" shortcuts={shortcuts} currentPath={currentPath} query={sheetQuery} onQueryChange={setSheetQuery} onClose={() => { setSheet(false); setSheetQuery('') }} />
|
|
126
132
|
</AppShell>
|
|
127
133
|
)
|
|
128
134
|
}
|
package/src/HubDev.jsx
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { useState } from 'react'
|
|
2
|
-
import { PageHeader } from '@kolkrabbi/kol-component'
|
|
2
|
+
import { PageHeader, TabsRow } from '@kolkrabbi/kol-component'
|
|
3
3
|
import PageShell from './PageShell.jsx'
|
|
4
|
-
import TabStrip from './TabStrip.jsx'
|
|
5
4
|
|
|
6
|
-
/* taxonomy-ok: organism — nests PageShell
|
|
5
|
+
/* taxonomy-ok: organism — nests PageShell (relative) + kol-component's PageHeader / TabsRow */
|
|
7
6
|
|
|
8
7
|
const read = (key, fallback) => { try { return localStorage.getItem(key) ?? fallback } catch { return fallback } }
|
|
9
8
|
const write = (key, value) => { try { localStorage.setItem(key, value) } catch { /* private mode: the tab just resets */ } }
|
|
@@ -14,14 +13,14 @@ const write = (key, value) => { try { localStorage.setItem(key, value) } catch {
|
|
|
14
13
|
* instructions for making the dev tab to the hub … localhost only using the </> icon"*). Each app had built
|
|
15
14
|
* this page by hand and each read differently; this is the page made once, for reading.
|
|
16
15
|
*
|
|
17
|
-
* The shape: a small mono masthead with one line saying what the page is, the tabs on their own row under
|
|
18
|
-
* it,
|
|
16
|
+
* The shape: a small mono masthead with one line saying what the page is, the chip tabs on their own row under
|
|
17
|
+
* it, then the tab's content at full width. Detail belongs in the
|
|
19
18
|
* content's own toggles, not in more text here. The open tab is remembered per app.
|
|
20
19
|
*
|
|
21
20
|
* Rendered by `AppHub` / `AppStudio` from their `dev` prop, only on a dev server (`import.meta.env.DEV`),
|
|
22
|
-
* at `/dev`, behind
|
|
21
|
+
* at `/dev`, behind a `code` rail row after the app's own rows.
|
|
23
22
|
*
|
|
24
|
-
* @param {Array} tabs `[{ value, label,
|
|
23
|
+
* @param {Array} tabs `[{ value, label, content }]`
|
|
25
24
|
* @param {string} [title='Dev']
|
|
26
25
|
* @param {string} [subtitle] one line: what the page is
|
|
27
26
|
* @param {string} [storageKey] where the open tab is remembered
|
|
@@ -35,10 +34,9 @@ export default function HubDev({ tabs = [], title = 'Dev', subtitle = 'Experimen
|
|
|
35
34
|
<PageShell className="gap-6">
|
|
36
35
|
<PageHeader size="sm" voice="mono" title={title} subtitle={subtitle} />
|
|
37
36
|
{tabs.length > 1 && (
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
</div>
|
|
37
|
+
/* chip tabs — the ones ui.kolkrabbi.io's component pages use — and nothing between them and the
|
|
38
|
+
* content (HubDevChrome, kol-monitor 2026-10-18 — user: *"why are we puttin sub description below the tabs?"*) */
|
|
39
|
+
<TabsRow look="chip" tabs={tabs.map(({ value, label }) => ({ value, label }))} value={active?.value} onChange={pick} ariaLabel={title} />
|
|
42
40
|
)}
|
|
43
41
|
{active && <div className="min-w-0">{active.content}</div>}
|
|
44
42
|
</PageShell>
|
package/src/PhoneNav.jsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react'
|
|
2
|
-
import { Button,
|
|
2
|
+
import { Button, TabsRow } from '@kolkrabbi/kol-component'
|
|
3
3
|
|
|
4
4
|
/* taxonomy-ok: molecule — MobileTabBar + a More sheet of Buttons */
|
|
5
5
|
|
|
@@ -68,7 +68,9 @@ export default function PhoneNav({ items = [], currentPath = '/', onNavigate })
|
|
|
68
68
|
))}
|
|
69
69
|
</div>
|
|
70
70
|
)}
|
|
71
|
-
<
|
|
71
|
+
<TabsRow
|
|
72
|
+
look="stacked"
|
|
73
|
+
placement="phone"
|
|
72
74
|
tabs={tabs}
|
|
73
75
|
value={value}
|
|
74
76
|
onChange={(v) => (v === MORE ? setOpen((o) => !o) : onNavigate?.(v))}
|
package/src/TabStrip.jsx
CHANGED
|
@@ -1,34 +1,9 @@
|
|
|
1
|
+
import { TabsRow } from '@kolkrabbi/kol-component'
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* `text-fg-96`, rest `text-fg-32 hover:text-fg-48`.
|
|
5
|
-
*
|
|
6
|
-
* No auto-casing — labels render exactly as authored (the source repos'
|
|
7
|
-
* `text-transform: uppercase` dropped per the DS law; author "GRID" if you
|
|
8
|
-
* want GRID). `tracked` adds the 1px letter-spacing the view-mode strips
|
|
9
|
-
* carried.
|
|
10
|
-
*
|
|
11
|
-
* SINGLE-SELECT ONLY. A `Set` form for multi-select was added 2026-08-15 so the
|
|
12
|
-
* retired ContentFilters fork could render filter values through this — and
|
|
13
|
-
* removed the same day with it. A multi-select, handler-carrying, active/rest
|
|
14
|
-
* chip is a `Tag`; building a second one here under another name in another
|
|
15
|
-
* package is exactly the duplication kol-shell exists to end.
|
|
16
|
-
*
|
|
17
|
-
* @param {Array} props.options `[{ value, label }]`
|
|
4
|
+
* @deprecated 2026-10-17 — alias of kol-component's `TabsRow look="text"` (TabsStackedLayout: one tab component). Drops when nobody imports it (04-retirements.md).
|
|
5
|
+
* TabStrip — Old name for TabsRow's text look. Same props: `options` (`{ value, label }`) · `value` · `onChange` · `size` · `tracked` · `className` · `style`.
|
|
18
6
|
*/
|
|
19
|
-
export default function TabStrip({ options = [],
|
|
20
|
-
return
|
|
21
|
-
<div className={`flex items-center ${className}`.trim()} style={style}>
|
|
22
|
-
{options.map((opt) => (
|
|
23
|
-
<span
|
|
24
|
-
key={opt.value}
|
|
25
|
-
onClick={() => onChange?.(opt.value)}
|
|
26
|
-
className={`kol-helper-${size} cursor-pointer select-none ${value === opt.value ? 'text-fg-96' : 'text-fg-32 hover:text-fg-48'}`}
|
|
27
|
-
style={tracked ? { letterSpacing: 1 } : undefined}
|
|
28
|
-
>
|
|
29
|
-
{opt.label}
|
|
30
|
-
</span>
|
|
31
|
-
))}
|
|
32
|
-
</div>
|
|
33
|
-
)
|
|
7
|
+
export default function TabStrip({ options = [], className = 'gap-6', ...rest }) {
|
|
8
|
+
return <TabsRow look="text" tabs={options} className={className} {...rest} />
|
|
34
9
|
}
|