@kolkrabbi/kol-workshop 0.1.6 → 0.1.8
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 +5 -5
- package/src/docs/DocKit.jsx +68 -0
- package/src/docs/index.js +1 -0
- package/src/shell/ShellLayout.jsx +14 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolkrabbi/kol-workshop",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "KOL workshop/docs system — a handrolled markdown engine, search, tag system (incl. a d3 tag graph), docs viewer, and docs shell. Sits above @kolkrabbi/kol-{theme,icons,component,framework}; content is consumer-injected (the package never globs docs).",
|
|
6
6
|
"license": "MIT",
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"d3": "^7.9.0",
|
|
16
|
+
"@kolkrabbi/kol-component": "0.12.3",
|
|
17
|
+
"@kolkrabbi/kol-theme": "0.11.9",
|
|
18
|
+
"@kolkrabbi/kol-framework": "0.5.5",
|
|
16
19
|
"@kolkrabbi/kol-brand": "^0.1.2",
|
|
17
|
-
"@kolkrabbi/kol-
|
|
18
|
-
"@kolkrabbi/kol-icons": "0.7.0",
|
|
19
|
-
"@kolkrabbi/kol-framework": "0.5.0",
|
|
20
|
-
"@kolkrabbi/kol-theme": "0.8.0"
|
|
20
|
+
"@kolkrabbi/kol-icons": "0.8.3"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"react": "^18.3.0 || ^19.0.0",
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DocKit — the Doc* composer family over the kol-theme `.kol-doc-*` role set
|
|
3
|
+
* (theme ≥ 0.11.9). The packaged successors of the showcase-local doc kit
|
|
4
|
+
* (2026-07-28 doc+card sets epic): thin composers, zero styling of their own —
|
|
5
|
+
* every text rule lives in kol-type-roles.css.
|
|
6
|
+
*
|
|
7
|
+
* DocHeader — eyebrow → h1 → lede page header
|
|
8
|
+
* DocSection — anchored section: rule + h2 + optional lede + content
|
|
9
|
+
* DocTable — the props table (Prop / Type / Default / Description)
|
|
10
|
+
* DocFigure — framed content container + optional caption
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export function DocHeader({ eyebrow, title, lede, children }) {
|
|
14
|
+
return (
|
|
15
|
+
<header className="flex flex-col gap-3">
|
|
16
|
+
{eyebrow && <p className="kol-doc-eyebrow">{eyebrow}</p>}
|
|
17
|
+
<h1 className="kol-doc-heading">{title}</h1>
|
|
18
|
+
{lede && <p className="kol-doc-lede">{lede}</p>}
|
|
19
|
+
{children}
|
|
20
|
+
</header>
|
|
21
|
+
)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function DocSection({ id, title, lede, children }) {
|
|
25
|
+
return (
|
|
26
|
+
<section id={id} className="flex flex-col gap-4 border-t border-fg-08 pt-8 scroll-mt-20">
|
|
27
|
+
{title && <h2 className="kol-doc-section-title">{title}</h2>}
|
|
28
|
+
{lede && <p className="kol-doc-body max-w-[65ch]">{lede}</p>}
|
|
29
|
+
{children}
|
|
30
|
+
</section>
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function DocTable({ rows }) {
|
|
35
|
+
if (!rows?.length) return null
|
|
36
|
+
return (
|
|
37
|
+
<div className="kol-doc-figure overflow-x-auto">
|
|
38
|
+
<table className="kol-doc-table">
|
|
39
|
+
<thead>
|
|
40
|
+
<tr>
|
|
41
|
+
{['Prop', 'Type', 'Default', 'Description'].map((h) => (
|
|
42
|
+
<th key={h}>{h}</th>
|
|
43
|
+
))}
|
|
44
|
+
</tr>
|
|
45
|
+
</thead>
|
|
46
|
+
<tbody>
|
|
47
|
+
{rows.map((r) => (
|
|
48
|
+
<tr key={r.prop}>
|
|
49
|
+
<td className="kol-doc-table-value text-emphasis">{r.prop}</td>
|
|
50
|
+
<td className="kol-doc-table-value !whitespace-normal text-meta">{r.type}</td>
|
|
51
|
+
<td className="kol-doc-table-value text-meta">{r.def}</td>
|
|
52
|
+
<td>{r.desc}</td>
|
|
53
|
+
</tr>
|
|
54
|
+
))}
|
|
55
|
+
</tbody>
|
|
56
|
+
</table>
|
|
57
|
+
</div>
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function DocFigure({ caption, className = '', children }) {
|
|
62
|
+
return (
|
|
63
|
+
<figure className={`kol-doc-figure ${className}`}>
|
|
64
|
+
{children}
|
|
65
|
+
{caption && <figcaption className="kol-doc-caption border-t border-fg-08 px-4 py-2.5">{caption}</figcaption>}
|
|
66
|
+
</figure>
|
|
67
|
+
)
|
|
68
|
+
}
|
package/src/docs/index.js
CHANGED
|
@@ -12,3 +12,4 @@ export { default as DocsArticle } from './DocsArticle.jsx'
|
|
|
12
12
|
export { default as DocsHeader } from './DocsHeader.jsx'
|
|
13
13
|
export { default as DocsFrontmatter } from './DocsFrontmatter.jsx'
|
|
14
14
|
export { renderInlineTokens } from './render-tokens.jsx'
|
|
15
|
+
export { DocHeader, DocSection, DocTable, DocFigure } from './DocKit.jsx'
|
|
@@ -22,27 +22,26 @@ export const ShellFullHeightContext = createContext(null)
|
|
|
22
22
|
export const ShellTocCollapsedContext = createContext(null)
|
|
23
23
|
|
|
24
24
|
const NavColumn = ({ children }) => (
|
|
25
|
-
<aside className="hidden lg:block shrink-0 pt-6 md:pt-6 lg:pt-8">
|
|
26
|
-
|
|
27
|
-
{children}
|
|
28
|
-
</div>
|
|
25
|
+
<aside className="shell-sidebar-sticky hidden lg:block shrink-0 h-full min-h-0 overflow-y-auto overscroll-none pt-6 md:pt-6 lg:pt-8 pb-8">
|
|
26
|
+
{children}
|
|
29
27
|
</aside>
|
|
30
28
|
)
|
|
31
29
|
|
|
32
30
|
const MainColumn = ({ children, fullHeight }) => (
|
|
33
|
-
<main
|
|
31
|
+
<main
|
|
32
|
+
className={`w-full min-w-0 h-full min-h-0 ${fullHeight ? 'overflow-hidden flex flex-col' : 'overflow-y-auto overscroll-none'}`}
|
|
33
|
+
style={fullHeight ? undefined : { scrollbarGutter: 'stable' }}
|
|
34
|
+
>
|
|
34
35
|
{fullHeight
|
|
35
36
|
? children
|
|
36
|
-
: <div className="pt-6 md:pt-6 lg:pt-8 pb-
|
|
37
|
+
: <div className="pt-6 md:pt-6 lg:pt-8 pb-16">{children}</div>
|
|
37
38
|
}
|
|
38
39
|
</main>
|
|
39
40
|
)
|
|
40
41
|
|
|
41
42
|
const TocColumn = ({ children }) => (
|
|
42
|
-
<aside className="hidden lg:block shrink-0 pt-6 md:pt-6 lg:pt-8">
|
|
43
|
-
|
|
44
|
-
{children}
|
|
45
|
-
</div>
|
|
43
|
+
<aside className="shell-sidebar-sticky hidden lg:block shrink-0 h-full min-h-0 overflow-y-auto overscroll-none pt-6 md:pt-6 lg:pt-8 pb-8">
|
|
44
|
+
{children}
|
|
46
45
|
</aside>
|
|
47
46
|
)
|
|
48
47
|
|
|
@@ -150,10 +149,12 @@ const ShellLayout = ({ routes = [], basePath = '/', brandLogoSrc, brandLogoAlt =
|
|
|
150
149
|
tocCollapsed={tocCollapsed}
|
|
151
150
|
/>
|
|
152
151
|
|
|
152
|
+
{/* Three independent scroll regions: each rail scrolls its own overflow,
|
|
153
|
+
* main scrolls unless a page locks it (ShellFullHeightContext — embeds).
|
|
154
|
+
* overscroll-none stops chaining between regions and the edge bounce. */}
|
|
153
155
|
<div className="flex-1 overflow-hidden">
|
|
154
|
-
<div className=
|
|
155
|
-
<div className={`
|
|
156
|
-
<div className={`shell-content-grid grid gap-8 ${gridCols}${isFullHeight ? ' h-full' : ''}`} data-layout={layoutType}>
|
|
156
|
+
<div className="h-full w-full px-4 md:px-5 lg:px-6">
|
|
157
|
+
<div className={`shell-content-grid grid gap-8 ${gridCols} h-full min-h-0`} data-layout={layoutType}>
|
|
157
158
|
{showNav && (
|
|
158
159
|
<NavColumn>
|
|
159
160
|
{renderSidebar ? renderSidebar({}) : <ShellSidebar routes={routes} basePath={basePath} />}
|
|
@@ -176,7 +177,6 @@ const ShellLayout = ({ routes = [], basePath = '/', brandLogoSrc, brandLogoAlt =
|
|
|
176
177
|
</div>
|
|
177
178
|
</div>
|
|
178
179
|
</div>
|
|
179
|
-
</div>
|
|
180
180
|
|
|
181
181
|
<ShellDrawer
|
|
182
182
|
isOpen={isNavDrawerOpen}
|