@kolkrabbi/kol-component 0.97.0 → 0.97.1
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-component",
|
|
3
|
-
"version": "0.97.
|
|
3
|
+
"version": "0.97.1",
|
|
4
4
|
"description": "KOL design-system components — atoms through organisms, emitting canonical kol-* classes. Pairs with @kolkrabbi/kol-theme for styling.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -151,6 +151,10 @@ export default function ColumnBrowser({
|
|
|
151
151
|
const [picked, setPicked] = useState(null)
|
|
152
152
|
// Keyboard cursor: which column, which row. Clicks keep it in sync.
|
|
153
153
|
const [cursor, setCursor] = useState({ col: 0, idx: 0 })
|
|
154
|
+
/* the cursor is NOT drawn until the keyboard is used (ColumnBrowserCursorStart,
|
|
155
|
+
* kol-r2b2 2026-08-27): at rest it sat on row 0 beside the open folder and
|
|
156
|
+
* read as a second selection. Arrows arm it; a click seeds it. */
|
|
157
|
+
const [cursorActive, setCursorActive] = useState(false)
|
|
154
158
|
const rootRef = useRef(null)
|
|
155
159
|
|
|
156
160
|
const levelsOf = (pfx) => {
|
|
@@ -181,6 +185,7 @@ export default function ColumnBrowser({
|
|
|
181
185
|
}
|
|
182
186
|
if (!['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].includes(e.key)) return
|
|
183
187
|
e.preventDefault()
|
|
188
|
+
setCursorActive(true)
|
|
184
189
|
const lv = levelsOf(prefix)
|
|
185
190
|
const col = Math.min(cursor.col, lv.length - 1)
|
|
186
191
|
const items = itemsAt(lv[col])
|
|
@@ -260,9 +265,9 @@ export default function ColumnBrowser({
|
|
|
260
265
|
icon="folder"
|
|
261
266
|
label={f.replace(/\/$/, '')}
|
|
262
267
|
active={f === activeFolder}
|
|
263
|
-
cursor={cursor.col === k && cursor.idx === i}
|
|
268
|
+
cursor={cursorActive && cursor.col === k && cursor.idx === i}
|
|
264
269
|
trailing={<Icon name="chevron-right" size={12} className="text-fg-32" />}
|
|
265
|
-
onClick={() => { setCursor({ col: k, idx: i }); rootRef.current?.focus(); setPicked(null); onPrefix(level + f) }}
|
|
270
|
+
onClick={() => { setCursor({ col: k, idx: i }); setCursorActive(true); rootRef.current?.focus(); setPicked(null); onPrefix(level + f) }}
|
|
266
271
|
/>
|
|
267
272
|
))}
|
|
268
273
|
{files.map((o, i) => (
|
|
@@ -272,8 +277,8 @@ export default function ColumnBrowser({
|
|
|
272
277
|
label={o.displayKey ?? o.key}
|
|
273
278
|
muted={shown?.key !== o.key}
|
|
274
279
|
active={shown?.key === o.key}
|
|
275
|
-
cursor={cursor.col === k && cursor.idx === folders.length + i}
|
|
276
|
-
onClick={() => { setCursor({ col: k, idx: folders.length + i }); rootRef.current?.focus(); setPicked(o) }}
|
|
280
|
+
cursor={cursorActive && cursor.col === k && cursor.idx === folders.length + i}
|
|
281
|
+
onClick={() => { setCursor({ col: k, idx: folders.length + i }); setCursorActive(true); rootRef.current?.focus(); setPicked(o) }}
|
|
277
282
|
/>
|
|
278
283
|
))}
|
|
279
284
|
{folders.length === 0 && files.length === 0 && (
|