@kolkrabbi/kol-component 0.167.0 → 0.169.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kolkrabbi/kol-component",
3
- "version": "0.167.0",
3
+ "version": "0.169.0",
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",
@@ -329,10 +329,18 @@ export function MediaLibraryBrowse({
329
329
  const crumbs = prefix ? prefix.replace(/\/$/, '').split('/') : []
330
330
 
331
331
  /* the virtual root — one browser for the whole client: root row = the title,
332
- * its children the buckets, stepping into one IS the bucket switch */
332
+ * its children the buckets, stepping into one IS the bucket switch.
333
+ *
334
+ * ONE BUCKET GETS NO BUCKET LEVEL (one-bucket-consumer, kol-client-olina
335
+ * 2026-09-03): with a single bucket the second column was a row that named
336
+ * the only thing it could name, under a root that named the app — two levels
337
+ * to reach a folder. The virtual root collapses to the empty string, which
338
+ * makes every `slice(VROOT.length)` below a no-op and leaves column 0 as the
339
+ * bucket's own folders. Multi-bucket browse is untouched. */
340
+ const single = buckets.length <= 1
333
341
  const ROOT = title
334
342
  const label = bucketMeta.label || 'bucket'
335
- const VROOT = `${ROOT}/${label}/`
343
+ const VROOT = single ? '' : `${ROOT}/${label}/`
336
344
  const treeFolders = (level) => (folderTree?.[bucketMeta.id]?.folders ?? [])
337
345
  .filter((p) => p.startsWith(level) && p.length > level.length && !p.slice(level.length, -1).includes('/'))
338
346
  .map((p) => p.slice(level.length))
@@ -412,8 +420,10 @@ export function MediaLibraryBrowse({
412
420
  columnWidths={settings.columnWidths}
413
421
  onColumnResize={(i, px) => setSettings({ ...settings, columnWidths: { ...(settings.columnWidths ?? {}), [i]: px } })}
414
422
  objects={objects.filter((o) => !isSystemFile(o.key)).map((o) => ({ ...o, key: `${VROOT}${o.key}` }))}
415
- prefix={appRoot ? `${ROOT}/` : `${VROOT}${prefix}`}
423
+ prefix={single ? prefix : (appRoot ? `${ROOT}/` : `${VROOT}${prefix}`)}
416
424
  onPrefix={(v) => {
425
+ /* single: the browser's path IS the bucket path, no segment to strip */
426
+ if (single) { setAppRoot(false); setPrefix(v); return }
417
427
  const [, seg, ...rest] = v.split('/')
418
428
  const target = buckets.find((b) => b.label === seg)
419
429
  if (!target && buckets.length) { setAppRoot(true); setPickedFile(null); setPrefix(''); return }
@@ -435,8 +445,10 @@ export function MediaLibraryBrowse({
435
445
  return <KindPreview o={real} urlOf={(x) => mediaUrl(x.key)} poster={poster ? mediaUrl(poster) : undefined} kindOf={kindOf} kindLabel={KIND_LABEL} />
436
446
  }}
437
447
  partition={(objs, level) => {
438
- if (level === '') return { folders: [`${ROOT}/`], files: [] }
439
- if (level === `${ROOT}/`) return { folders: (buckets.length ? buckets : [bucketMeta]).map((b) => `${b.label || 'bucket'}/`), files: [] }
448
+ if (!single) {
449
+ if (level === '') return { folders: [`${ROOT}/`], files: [] }
450
+ if (level === `${ROOT}/`) return { folders: (buckets.length ? buckets : [bucketMeta]).map((b) => `${b.label || 'bucket'}/`), files: [] }
451
+ }
440
452
  const live = partition(objs, level)
441
453
  const baked = treeFolders(level.slice(VROOT.length))
442
454
  return { folders: [...new Set([...baked, ...live.folders])].sort(), files: live.files }
@@ -16,13 +16,6 @@ import FullscreenOverlay from '../utilities/FullscreenOverlay.jsx'
16
16
  * TWO PRESENTATIONS, ONE ANATOMY (the user's ask): `variant="drawer"` is a
17
17
  * right-anchored sheet over a scrim, `variant="overlay"` the same panel
18
18
  * centred. Only the shell differs; header · intro · sections · footer are the
19
- * NO SCRIM ON THE SETTINGS DRAWER (user 2026-08-30: "remove the background
20
- * overlay and blur when settings sidebar is opened"). `backdrop={false}` — the
21
- * panel alone, no 60% black wash and no `blur(1px)`. You change how a surface
22
- * looks WHILE looking at it, and a scrim hides the thing you are tuning. Escape
23
- * and the × still close it; only the dimming is gone. Scoped to this panel —
24
- * every other ShellDrawer consumer keeps its backdrop.
25
- *
26
19
  * same nodes in both. Neither shell is built here — the drawer IS ShellDrawer
27
20
  * (scrim, Escape, focus trap, scroll lock, focus return, the × control) and
28
21
  * the overlay IS FullscreenOverlay (scrim, Escape, backdrop dismiss, scroll
@@ -100,8 +93,13 @@ export default function SettingsPanel({
100
93
 
101
94
  return (
102
95
  /* THE APPROVED DRAWER (SettingsPanelApproved, kol-r2b2 2026-08-27 — user: "LOCK
103
- THIS"): no edge, no shadow, a Divider under the header, the sections. */
104
- <ShellDrawer open={open} onClose={onClose} side="right" width={width} header={header} className={className} edge={false} shadow={false} backdrop={false}>
96
+ THIS"): no edge, no shadow, a Divider under the header, the sections.
97
+ THE SCRIM IS BACK (settings-drawer-has-no-surface, kol-client-olina
98
+ 2026-09-03). `backdrop={false}` stood here from 2026-08-30; the drawer
99
+ paints `bg-surface-primary`, the same token as the page, so the scrim was
100
+ the only thing separating them — with it off the panel was invisible and
101
+ the controls floated in the right third of the screen. */
102
+ <ShellDrawer open={open} onClose={onClose} side="right" width={width} header={header} className={className} edge={false} shadow={false}>
105
103
  <div className="flex flex-col gap-4"><Divider />{body}</div>
106
104
  </ShellDrawer>
107
105
  )