@kolkrabbi/kol-component 0.217.0 → 0.218.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.
|
|
3
|
+
"version": "0.218.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",
|
|
@@ -844,6 +844,9 @@ export function MediaLibraryBrowse({
|
|
|
844
844
|
* the consumer's — a repo whose surfaces are routes wires its router here.
|
|
845
845
|
* No tabs, no pill, and the page is exactly what it was. */
|
|
846
846
|
tabs, activeTab, onTabChange,
|
|
847
|
+
/* `bucketLevel` — keep title → bucket → folders with ONE bucket (kol-client-olina 2026-09-23).
|
|
848
|
+
* Absent, a one-bucket consumer collapses the level as ruled 2026-09-03. */
|
|
849
|
+
bucketLevel = false,
|
|
847
850
|
}) {
|
|
848
851
|
const [ownPrefix, setOwnPrefix] = useState('')
|
|
849
852
|
const prefix = prefixProp ?? ownPrefix
|
|
@@ -1395,7 +1398,7 @@ export function MediaLibraryBrowse({
|
|
|
1395
1398
|
* to reach a folder. The virtual root collapses to the empty string, which
|
|
1396
1399
|
* makes every `slice(VROOT.length)` below a no-op and leaves column 0 as the
|
|
1397
1400
|
* bucket's own folders. Multi-bucket browse is untouched. */
|
|
1398
|
-
const single = buckets.length <= 1
|
|
1401
|
+
const single = !bucketLevel && buckets.length <= 1
|
|
1399
1402
|
const ROOT = title
|
|
1400
1403
|
const label = bucketMeta.label || 'bucket'
|
|
1401
1404
|
const VROOT = single ? '' : `${ROOT}/${label}/`
|
|
@@ -1921,7 +1924,11 @@ export function MediaLibraryBrowse({
|
|
|
1921
1924
|
<p className="kol-mono-12 text-fg-48">
|
|
1922
1925
|
{folders.length > 0 && `${folders.length} folder${folders.length > 1 ? 's' : ''} · `}
|
|
1923
1926
|
{rawFiles.length} {rawFiles.length === 1 ? 'file' : 'files'} · {formatSize(totalBytes)}
|
|
1927
|
+
{/* THE GREY TAIL TOTALS WHERE YOU STAND (kol-client-olina 2026-09-23): the bucket at the
|
|
1928
|
+
* root, the current folder recursively below it. Hidden when it would repeat the
|
|
1929
|
+
* bright part — a leaf has nothing beneath it to add. */}
|
|
1924
1930
|
{!prefix && rawFiles.length !== bucketFiles && <span className="text-fg-32">{' · bucket: '}{bucketFiles} files · {formatSize(bucketBytes)}</span>}
|
|
1931
|
+
{prefix && scoped.length !== levelFiles.length && <span className="text-fg-32">{` · in ${crumbs.at(-1)}: `}{scoped.length} files · {formatSize(scoped.reduce((n, o) => n + (o.size || 0), 0))}</span>}
|
|
1925
1932
|
{systemCount > 0 && <span className="text-fg-32">{' · '}{systemCount} system files hidden</span>}
|
|
1926
1933
|
</p>
|
|
1927
1934
|
)}
|