@kolkrabbi/kol-component 0.361.1 → 0.362.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.362.0",
|
|
4
4
|
"description": "The core component library",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"embla-carousel-react": "^8.6.0",
|
|
33
33
|
"pdfjs-dist": "^6.3.289",
|
|
34
34
|
"react-syntax-highlighter": "^16.1.1",
|
|
35
|
-
"@kolkrabbi/kol-markdown": "^0.2.0",
|
|
36
35
|
"@kolkrabbi/kol-search": "^0.3.0",
|
|
37
|
-
"@kolkrabbi/kol-growth": "^0.5.0"
|
|
36
|
+
"@kolkrabbi/kol-growth": "^0.5.0",
|
|
37
|
+
"@kolkrabbi/kol-markdown": "^0.2.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"@kolkrabbi/kol-icons": ">=0.69.0",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"react-dom": "^18.3.0 || ^19.0.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@kolkrabbi/kol-icons": "^0.
|
|
48
|
+
"@kolkrabbi/kol-icons": "^0.70.1"
|
|
49
49
|
},
|
|
50
50
|
"files": [
|
|
51
51
|
"src",
|
|
@@ -22,15 +22,26 @@ import TocRow from '../molecules/TocRow.jsx'
|
|
|
22
22
|
* @param {ReactNode} [status] `Reading position saved`
|
|
23
23
|
* @param {Function} [onFold]
|
|
24
24
|
* @param {number} [width] default 304
|
|
25
|
+
* @param {boolean} [bare] the body only — book, chapters, progress, status — with no sheet and no header, for
|
|
26
|
+
* kol-shell's PropertyRail, the float module that carries the title and the fold (2026-11-12)
|
|
25
27
|
* @param {string} [className]
|
|
26
28
|
*/
|
|
27
|
-
export default function ReadingContents({ title = 'Contents', book, author, count, chapters = [], current, onSelect, progress, progressLabel = 'Through the book', status, onFold, width = 304, className = '' }) {
|
|
29
|
+
export default function ReadingContents({ title = 'Contents', book, author, count, chapters = [], current, onSelect, progress, progressLabel = 'Through the book', status, onFold, width = 304, bare = false, className = '' }) {
|
|
30
|
+
if (bare) return <div className={`flex flex-col ${className}`.trim()}><Body {...{ title, book, author, count, chapters, current, onSelect, progress, progressLabel, status }} /></div>
|
|
28
31
|
return (
|
|
29
32
|
<aside className={`flex flex-col rounded-[var(--kol-float-menu-r)] bg-surface-secondary p-5 ${className}`.trim()} style={{ width }} aria-label={title}>
|
|
30
33
|
<div className="flex h-7 items-center justify-between">
|
|
31
34
|
<span className="kol-float-body-lg text-fg-emphasis">{title}</span>
|
|
32
35
|
{onFold && <Button variant="float" tone="ghost" size="sm" iconOnly="chevron-up" aria-label="Fold" onClick={onFold} className="-mr-1.5" />}
|
|
33
36
|
</div>
|
|
37
|
+
<Body {...{ title, book, author, count, chapters, current, onSelect, progress, progressLabel, status }} />
|
|
38
|
+
</aside>
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function Body({ title, book, author, count, chapters, current, onSelect, progress, progressLabel, status }) {
|
|
43
|
+
return (
|
|
44
|
+
<>
|
|
34
45
|
{book && <span className="kol-float-section mt-8 text-fg-emphasis">{book}</span>}
|
|
35
46
|
{author && <span className="kol-float-hint mt-1 text-fg-64">{author}</span>}
|
|
36
47
|
{count && <span className="kol-float-ruler mt-6 uppercase text-fg-64">{count}</span>}
|
|
@@ -49,6 +60,6 @@ export default function ReadingContents({ title = 'Contents', book, author, coun
|
|
|
49
60
|
</div>
|
|
50
61
|
)}
|
|
51
62
|
{status && <span className="kol-float-label mt-5 text-fg-64">{status}</span>}
|
|
52
|
-
|
|
63
|
+
</>
|
|
53
64
|
)
|
|
54
65
|
}
|