@kolkrabbi/kol-framework 0.25.0 → 0.27.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 +3 -3
- package/src/AppShell.jsx +11 -3
- package/src/SideNav.jsx +12 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolkrabbi/kol-framework",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.0",
|
|
4
4
|
"description": "KOL app shell — sidenav, layout, theme toggle, footer, heroes + brand color layer. SideNav takes nav data as props so the tree stays app-local.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"react-router-dom": "^6.0.0 || ^7.0.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@kolkrabbi/kol-
|
|
24
|
-
"@kolkrabbi/kol-
|
|
23
|
+
"@kolkrabbi/kol-icons": "^0.18.0",
|
|
24
|
+
"@kolkrabbi/kol-component": "^0.80.0"
|
|
25
25
|
},
|
|
26
26
|
"files": [
|
|
27
27
|
"src",
|
package/src/AppShell.jsx
CHANGED
|
@@ -18,7 +18,10 @@ export const ShellTocCollapsedContext = createContext(null)
|
|
|
18
18
|
/* `getActivePage` — ACCEPTED-but-inert since the 2026-08-09 SideNav port (the
|
|
19
19
|
* two-level elder model derives the active category from the route); kept so
|
|
20
20
|
* no call site breaks. */
|
|
21
|
-
|
|
21
|
+
/* `sideNav` — every SideNav prop AppShell does not own, spread onto the rail
|
|
22
|
+
* (sidenav-rail-hairline, 2026-08-26): `background`, `hairline`, `isActive`,
|
|
23
|
+
* `onNavigate` … the next rail option needs no AppShell release. */
|
|
24
|
+
export default function AppShell({ navTree = [], getActivePage: _getActivePage, header, footer, defaultTocContent, sideNav }) {
|
|
22
25
|
const [drawerOpen, setDrawerOpen] = useState(false)
|
|
23
26
|
const [tocContent, setTocContent] = useState(null)
|
|
24
27
|
const [tocCollapsed, setTocCollapsed] = useState(false)
|
|
@@ -41,7 +44,12 @@ export default function AppShell({ navTree = [], getActivePage: _getActivePage,
|
|
|
41
44
|
<ShellTocContext.Provider value={setTocContent}>
|
|
42
45
|
<ShellTocCollapsedContext.Provider value={setTocCollapsed}>
|
|
43
46
|
<div
|
|
44
|
-
|
|
47
|
+
/* the PAGE is surface-tertiary, the rail surface-primary — the brand
|
|
48
|
+
* split (appshell-content-surface, kol-studio 2026-08-26, user:
|
|
49
|
+
* "sidenav primary, site tertiary, like brand"). BrandLayout's own
|
|
50
|
+
* line, verbatim; the fork dropped it on 2026-08-09 and every
|
|
51
|
+
* AppShell app rendered one flat colour. */
|
|
52
|
+
className="kol-brand-layout bg-surface-tertiary min-h-dvh"
|
|
45
53
|
data-drawer-open={drawerOpen ? 'true' : undefined}
|
|
46
54
|
data-toc={showToc ? 'true' : undefined}
|
|
47
55
|
>
|
|
@@ -61,7 +69,7 @@ export default function AppShell({ navTree = [], getActivePage: _getActivePage,
|
|
|
61
69
|
aria-hidden="true"
|
|
62
70
|
/>
|
|
63
71
|
|
|
64
|
-
<SideNav navTree={navTree} drawerOpen={drawerOpen} onCloseDrawer={() => setDrawerOpen(false)} />
|
|
72
|
+
<SideNav navTree={navTree} drawerOpen={drawerOpen} onCloseDrawer={() => setDrawerOpen(false)} {...sideNav} />
|
|
65
73
|
<div className="min-w-0">
|
|
66
74
|
{header}
|
|
67
75
|
<Outlet />
|
package/src/SideNav.jsx
CHANGED
|
@@ -42,9 +42,11 @@ import useDragResize from './useDragResize'
|
|
|
42
42
|
* the `kol-sidenav` storage schema, owned by useDragResize. Collapsed rows
|
|
43
43
|
* get a DS Tooltip — the glyph is otherwise the only thing naming them.
|
|
44
44
|
*
|
|
45
|
-
* `background` (2026-08-09, prop): `true` (default) paints the rail surface
|
|
46
|
-
*
|
|
47
|
-
*
|
|
45
|
+
* `background` (2026-08-09, prop): `true` (default) paints the rail surface;
|
|
46
|
+
* `false` renders chromeless so the rail can float over a consumer's media
|
|
47
|
+
* (the brand-hero model — the consumer owns the plane). `hairline` (2026-08-26,
|
|
48
|
+
* default `false`) paints the right-edge `border-r border-fg-08` — split out
|
|
49
|
+
* of `background` so the line is a choice of its own.
|
|
48
50
|
*/
|
|
49
51
|
|
|
50
52
|
const pageBase =
|
|
@@ -78,6 +80,12 @@ export default function SideNav({
|
|
|
78
80
|
onNavigate,
|
|
79
81
|
isActive,
|
|
80
82
|
background = true,
|
|
83
|
+
/* the right-edge hairline is OPT-IN (sidenav-rail-hairline, kol-studio
|
|
84
|
+
* 2026-08-26 — user: the footer's border-t is right, the border-r is wrong
|
|
85
|
+
* as a default). It used to ride `background` — two decisions under one
|
|
86
|
+
* name; a rail floating over media and a rail without a line are different
|
|
87
|
+
* choices. */
|
|
88
|
+
hairline = false,
|
|
81
89
|
}) {
|
|
82
90
|
const { pathname } = useLocation()
|
|
83
91
|
const isPageActive = (to) => (isActive ? isActive(to) : pathname === to)
|
|
@@ -152,7 +160,7 @@ export default function SideNav({
|
|
|
152
160
|
* (kol-framework.css). `sticky … h-dvh z-20` here outranked the 767px
|
|
153
161
|
* drawer rule's `position: fixed`, so every consumer page opened one
|
|
154
162
|
* viewport down on phones. Only colour utilities ride the element. */
|
|
155
|
-
className={`kol-sidenav${background ? ' bg-surface-primary border-r border-fg-08' : ''}${collapsed ? ' is-collapsed' : ''}${drawerOpen ? ' is-drawer-open' : ''}`}
|
|
163
|
+
className={`kol-sidenav${background ? ' bg-surface-primary' : ''}${hairline ? ' border-r border-fg-08' : ''}${collapsed ? ' is-collapsed' : ''}${drawerOpen ? ' is-drawer-open' : ''}`}
|
|
156
164
|
>
|
|
157
165
|
{/* NO chip Button in either state (user build order 2026-08-09 — "MAKE
|
|
158
166
|
* IT"; supersedes the elder A/B): the pill-marked grab edge below is
|