@kolkrabbi/kol-framework 0.15.1 → 0.15.2
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 +30 -0
- package/package.json +1 -1
- package/src/SideNav.jsx +23 -10
package/kol-framework.css
CHANGED
|
@@ -112,6 +112,36 @@ body {
|
|
|
112
112
|
* said 1800 — same element, two answers (lobby/WidthSystemContradictions). */
|
|
113
113
|
@media (min-width: 1920px) { :root { --kol-container-max: var(--kol-content-shell, 1800px); } }
|
|
114
114
|
|
|
115
|
+
/* SideNav's own box — IN RULES, not utilities (2026-08-09, defect found by
|
|
116
|
+
* the kol-website session during 0.15.1 verify): this whole file lives in
|
|
117
|
+
* @layer components, so a Tailwind utility the JSX stamps on the same element
|
|
118
|
+
* outranks every rule here — the collapsed overrides below silently lost to
|
|
119
|
+
* py-2 / pl-6 / Icon's own inline-flex. Same law as type: a component's box
|
|
120
|
+
* lives in its own rule, never a utility racing it. The JSX keeps only
|
|
121
|
+
* type/color utilities on these elements. */
|
|
122
|
+
.kol-sidenav-hop {
|
|
123
|
+
display: flex;
|
|
124
|
+
align-items: center;
|
|
125
|
+
gap: 0.75rem;
|
|
126
|
+
width: 100%;
|
|
127
|
+
position: relative;
|
|
128
|
+
padding: 0.5rem 2.5rem 0.5rem 1.5rem;
|
|
129
|
+
}
|
|
130
|
+
/* the caret rides a PLAIN span (Icon stamps inline-flex on its own element,
|
|
131
|
+
* which would outrank the collapsed display:none) */
|
|
132
|
+
.kol-sidenav-hop-caret {
|
|
133
|
+
position: absolute;
|
|
134
|
+
top: 0.75rem;
|
|
135
|
+
right: 0.75rem;
|
|
136
|
+
}
|
|
137
|
+
.kol-sidenav-list {
|
|
138
|
+
display: flex;
|
|
139
|
+
flex-direction: column;
|
|
140
|
+
gap: 0.125rem;
|
|
141
|
+
margin-bottom: 0.5rem;
|
|
142
|
+
}
|
|
143
|
+
.kol-sidenav-footer { padding-inline: 1.5rem 1rem; }
|
|
144
|
+
|
|
115
145
|
/* :root[data-sidenav="collapsed"] — the manual collapse, rebuilt DELIBERATELY
|
|
116
146
|
* 2026-08-09 (lobby: SideNavGrabResize) after the 2026-07-29 removal of the
|
|
117
147
|
* renderer-less stamp. SideNav's grab edge (useDragResize.js) owns the state
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolkrabbi/kol-framework",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.2",
|
|
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
|
@@ -62,6 +62,13 @@ export default function SideNav({
|
|
|
62
62
|
const isPageActive = (to) => (isActive ? isActive(to) : pathname === to)
|
|
63
63
|
const isActiveCat = (cat) => pagesOf(cat).some((p) => isPageActive(p.to))
|
|
64
64
|
|
|
65
|
+
/* Every navigation closes the mobile drawer — the prop sat accepted-but-
|
|
66
|
+
* unread until the kol-website session flagged it (2026-08-09). */
|
|
67
|
+
const handleNavigate = (e) => {
|
|
68
|
+
onNavigate?.(e)
|
|
69
|
+
onCloseDrawer?.()
|
|
70
|
+
}
|
|
71
|
+
|
|
65
72
|
/* Which categories are disclosed. INDEPENDENT per category (elder ruling
|
|
66
73
|
* 2026-08-01) — arriving somewhere must not silently close wherever you
|
|
67
74
|
* were. Loads closed, in-memory only (elder ruling 2026-08-06). */
|
|
@@ -105,7 +112,10 @@ export default function SideNav({
|
|
|
105
112
|
const pages = pagesOf(cat)
|
|
106
113
|
const isOpen = openCats.has(cat.id)
|
|
107
114
|
const isLink = !pages.length && cat.to
|
|
108
|
-
|
|
115
|
+
/* Box utilities deliberately absent — the hop's layout lives in
|
|
116
|
+
* .kol-sidenav-hop (kol-framework.css): a utility here would
|
|
117
|
+
* outrank the collapsed-state overrides (2026-08-09 defect). */
|
|
118
|
+
const rowCls = 'kol-sidenav-hop kol-helper-12 text-emphasis no-underline'
|
|
109
119
|
const glyph = (
|
|
110
120
|
<span className="kol-sidenav-hop-icon inline-flex items-center justify-center w-5 h-5 shrink-0" aria-hidden="true">
|
|
111
121
|
<Icon name={cat.icon} size={16} />
|
|
@@ -119,7 +129,7 @@ export default function SideNav({
|
|
|
119
129
|
to={cat.to}
|
|
120
130
|
end
|
|
121
131
|
className={({ isActive: navActive }) => `${rowCls}${(isActive ? isActive(cat.to) : navActive) ? ' is-active' : ''}`}
|
|
122
|
-
onClick={
|
|
132
|
+
onClick={handleNavigate}
|
|
123
133
|
>
|
|
124
134
|
{glyph}
|
|
125
135
|
<span className="kol-sidenav-hop-label flex-1 min-w-0">{cat.label}</span>
|
|
@@ -133,11 +143,14 @@ export default function SideNav({
|
|
|
133
143
|
>
|
|
134
144
|
{glyph}
|
|
135
145
|
<span className="kol-sidenav-hop-label flex-1 min-w-0">{cat.label}</span>
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
className={`kol-sidenav-hop-caret
|
|
140
|
-
|
|
146
|
+
{/* plain wrapper span — Icon stamps inline-flex on its own
|
|
147
|
+
* element, which would outrank the rail's display:none */}
|
|
148
|
+
<span
|
|
149
|
+
className={`kol-sidenav-hop-caret transition-transform duration-150${isOpen ? '' : ' -rotate-90'}`}
|
|
150
|
+
aria-hidden="true"
|
|
151
|
+
>
|
|
152
|
+
<Icon name="chevron-down" size={12} />
|
|
153
|
+
</span>
|
|
141
154
|
</button>
|
|
142
155
|
)
|
|
143
156
|
return (
|
|
@@ -151,7 +164,7 @@ export default function SideNav({
|
|
|
151
164
|
) : head}
|
|
152
165
|
|
|
153
166
|
{!isLink && isOpen && (
|
|
154
|
-
<ul className="kol-sidenav-list
|
|
167
|
+
<ul className="kol-sidenav-list">
|
|
155
168
|
{pages.map((page) => (
|
|
156
169
|
<li key={page.to}>
|
|
157
170
|
<NavLink
|
|
@@ -159,7 +172,7 @@ export default function SideNav({
|
|
|
159
172
|
end
|
|
160
173
|
style={pageStyle}
|
|
161
174
|
className={({ isActive: navActive }) => ((isActive ? isActive(page.to) : navActive) ? pageActiveCls : pageCls)}
|
|
162
|
-
onClick={
|
|
175
|
+
onClick={handleNavigate}
|
|
163
176
|
>
|
|
164
177
|
{page.label}
|
|
165
178
|
</NavLink>
|
|
@@ -180,7 +193,7 @@ export default function SideNav({
|
|
|
180
193
|
</div>
|
|
181
194
|
</div>
|
|
182
195
|
|
|
183
|
-
<div className="kol-sidenav-footer flex items-center
|
|
196
|
+
<div className="kol-sidenav-footer flex items-center h-14 border-t border-fg-08 min-w-0">
|
|
184
197
|
<a
|
|
185
198
|
href="https://kolkrabbi.io"
|
|
186
199
|
target="_blank"
|