@kolkrabbi/kol-framework 0.31.1 → 0.33.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/kol-framework.css CHANGED
@@ -43,7 +43,16 @@ body {
43
43
  /* 16rem — the rail width, one number (2026-07-31). It read 260 while every
44
44
  grid track that had to line up with it read 256, so the shell header's
45
45
  brand block sat 4 off the sidebar column it exists to align to. */
46
- --kol-sidenav-w: 16rem;
46
+ --kol-sidenav-w: 264px;
47
+ /* A LADDER, not one number (SideNavWidthLadder, kol-website 2026-08-28 —
48
+ user ruling on the brand book: 320 desktop · 264 laptop · collapsed
49
+ tablet · hamburger mobile; the footer wordmark truncated at 16rem on a
50
+ desktop). 264 here, 320 from 1536 (Tailwind's `2xl`, the site's desktop
51
+ rung — the framework carries no named desktop breakpoint) in the media
52
+ rule below the grid; ≤1024 and <768 were already the collapse and the
53
+ drawer. useDragResize snaps to whichever rung the window is on; a stored
54
+ drag still wins on load. Anything that must line up with the rail reads
55
+ this token — a literal 256 is now wrong at every width. */
47
56
  /* Grab-edge gesture (lobby: SideNavGrabResize, 2026-08-09). Minted HERE —
48
57
  no --kol-* token carried these before (checked: only -w, -w-collapsed,
49
58
  -dot-left shipped). kol-mirror carried them as bare literals, the
@@ -137,6 +146,21 @@ body {
137
146
  position: relative;
138
147
  padding: 0.5rem 2.5rem 0.5rem 1.5rem;
139
148
  }
149
+ /* THE HEADER SLOT (RailLogomarkAtTop, kol-fxr 2026-08-28 — user, on the
150
+ * raven in the footer: "why did you move the logo from top to bottom?"): the
151
+ * `header` node sits ABOVE the tree, outside the scroll region, in the hop's
152
+ * own horizontal geometry — its `.kol-sidenav-hop-icon` centres on the icon
153
+ * column collapsed and left-aligns to it expanded, its `.kol-sidenav-hop-label`
154
+ * hides with the labels. 1rem above it; the scroll region's own top pad is the
155
+ * gap to the first row, so the first tree glyph's y is one number in every
156
+ * consumer that passes the same header. */
157
+ .kol-sidenav-header {
158
+ display: flex;
159
+ align-items: center;
160
+ gap: 0.75rem;
161
+ width: 100%;
162
+ padding: 1rem 2.5rem 0 1.5rem;
163
+ }
140
164
  /* the caret rides a PLAIN span (Icon stamps inline-flex on its own element,
141
165
  * which would outrank the collapsed display:none) */
142
166
  .kol-sidenav-hop-caret {
@@ -199,6 +223,7 @@ body {
199
223
  :root[data-sidenav="collapsed"] .kol-brand-layout { grid-template-columns: var(--kol-sidenav-w-collapsed) minmax(0, 1fr); }
200
224
  :root[data-sidenav="collapsed"] .kol-sidenav-hops { padding: 0 0 var(--kol-spacing-4); margin-bottom: var(--kol-spacing-4); }
201
225
  :root[data-sidenav="collapsed"] .kol-sidenav-hop { padding: var(--kol-spacing-2) 0; justify-content: center; gap: 0; }
226
+ :root[data-sidenav="collapsed"] .kol-sidenav-header { padding: 1rem 0 0; justify-content: center; gap: 0; }
202
227
  :root[data-sidenav="collapsed"] .kol-sidenav-hop-label { display: none; }
203
228
  :root[data-sidenav="collapsed"] .kol-sidenav-body { display: none; }
204
229
  :root[data-sidenav="collapsed"] .kol-sidenav-hop-count,
@@ -253,6 +278,9 @@ body {
253
278
  * (useDragResize stamps the attribute for the drag's duration). */
254
279
  :root[data-sidenav-dragging] .kol-brand-layout { transition: none; }
255
280
 
281
+ /* the desktop rung of the ladder (SideNavWidthLadder) */
282
+ @media (min-width: 1536px) { :root { --kol-sidenav-w: 320px; } }
283
+
256
284
  /* ───── Brand doc layout (sidebar + content) ─────
257
285
  The grid lives in CSS for its dynamic --kol-sidenav-w + transition. */
258
286
 
@@ -269,6 +297,7 @@ body {
269
297
  .kol-brand-layout { grid-template-columns: var(--kol-sidenav-w-collapsed) minmax(0, 1fr); }
270
298
  .kol-sidenav-hops { padding: 0 0 var(--kol-spacing-4); margin-bottom: var(--kol-spacing-4); }
271
299
  .kol-sidenav-hop { padding: var(--kol-spacing-2) 0; justify-content: center; gap: 0; }
300
+ .kol-sidenav-header { padding: 1rem 0 0; justify-content: center; gap: 0; }
272
301
  .kol-sidenav-hop-label { display: none; }
273
302
  .kol-sidenav-section { display: none; }
274
303
  .kol-sidenav-body { display: none; }
@@ -291,6 +320,7 @@ body {
291
320
  .kol-sidenav.is-drawer-open { transform: translateX(0); }
292
321
  /* Restore expanded labels + body inside the open drawer (override the rail rules above). */
293
322
  .kol-sidenav.is-drawer-open .kol-sidenav-hop { padding: 8px 0; justify-content: flex-start; gap: 12px; }
323
+ .kol-sidenav.is-drawer-open .kol-sidenav-header { padding: 1rem 2.5rem 0 1.5rem; justify-content: flex-start; gap: 12px; }
294
324
  .kol-sidenav.is-drawer-open .kol-sidenav-hop-label { display: inline; }
295
325
  .kol-sidenav.is-drawer-open .kol-sidenav-section { display: block; }
296
326
  .kol-sidenav.is-drawer-open .kol-sidenav-body { display: block; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kolkrabbi/kol-framework",
3
- "version": "0.31.1",
3
+ "version": "0.33.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",
package/src/SideNav.jsx CHANGED
@@ -71,6 +71,14 @@ import useDragResize from './useDragResize'
71
71
  * pixel (fxr measured 48 vs 56 wide, 20 vs 16px glyphs, 40 vs 38 pitch, first
72
72
  * glyph at y 76 vs 26 between the old NavRail and this rail collapsed). The
73
73
  * seams the shell needed, all opt-in, a tree with none of them renders as before:
74
+ * `header` a node ABOVE the tree, outside the scroll region, in the
75
+ * hop's geometry (`.kol-sidenav-header`, kol-framework.css)
76
+ * — the app's logomark (RailLogomarkAtTop, 2026-08-28 —
77
+ * user: "why did you move the logo from top to bottom?").
78
+ * Give it a `.kol-sidenav-hop-icon` span (20px mark on the
79
+ * icon column) and, optionally, a `.kol-sidenav-hop-label`;
80
+ * both follow the collapse. Same node in every consumer =
81
+ * the first tree glyph at one y — the parity contract
74
82
  * `bottomItems` top-level nodes pinned BELOW the theme slot, above the
75
83
  * footer (the shell pins theme → Settings; a Settings row in
76
84
  * the tree landed above the theme instead — "same rail, two
@@ -143,6 +151,7 @@ function SideNavInner({
143
151
  * name; a rail floating over media and a rail without a line are different
144
152
  * choices. */
145
153
  hairline = false,
154
+ header,
146
155
  bottomItems = [],
147
156
  footer,
148
157
  themeToggle = true,
@@ -344,6 +353,8 @@ function SideNavInner({
344
353
  * THE single collapse/resize control — click toggles, drag resizes,
345
354
  * snap-to-default on release, Home/Enter/Space on the keyboard. */}
346
355
 
356
+ {header && <div className="kol-sidenav-header">{header}</div>}
357
+
347
358
  {/* ONLY the tree scrolls (fxr's re-measure, 2026-08-28): the theme slot
348
359
  * and the pinned rows used to sit inside this region, so on a 26-row
349
360
  * collapsed tree they scrolled off below the footer — "pinned" only