@kolkrabbi/kol-workshop 0.1.7 → 0.1.9
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 +70 -0
- package/src/docs/index.js +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolkrabbi/kol-workshop",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
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",
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"d3": "^7.9.0",
|
|
16
16
|
"@kolkrabbi/kol-brand": "^0.1.2",
|
|
17
|
-
"@kolkrabbi/kol-
|
|
18
|
-
"@kolkrabbi/kol-
|
|
19
|
-
"@kolkrabbi/kol-
|
|
20
|
-
"@kolkrabbi/kol-
|
|
17
|
+
"@kolkrabbi/kol-component": "0.12.3",
|
|
18
|
+
"@kolkrabbi/kol-framework": "0.5.6",
|
|
19
|
+
"@kolkrabbi/kol-theme": "0.11.11",
|
|
20
|
+
"@kolkrabbi/kol-icons": "0.8.3"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"react": "^18.3.0 || ^19.0.0",
|
|
@@ -0,0 +1,70 @@
|
|
|
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
|
+
import { Table } from '@kolkrabbi/kol-component'
|
|
14
|
+
|
|
15
|
+
export function DocHeader({ eyebrow, title, lede, children }) {
|
|
16
|
+
return (
|
|
17
|
+
<header className="flex flex-col gap-3">
|
|
18
|
+
{eyebrow && <p className="kol-doc-eyebrow">{eyebrow}</p>}
|
|
19
|
+
<h1 className="kol-doc-heading">{title}</h1>
|
|
20
|
+
{lede && <p className="kol-doc-lede">{lede}</p>}
|
|
21
|
+
{children}
|
|
22
|
+
</header>
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function DocSection({ id, title, lede, children }) {
|
|
27
|
+
return (
|
|
28
|
+
<section id={id} className="flex flex-col gap-4 border-t border-fg-08 pt-8 scroll-mt-20">
|
|
29
|
+
{title && <h2 className="kol-doc-section-title">{title}</h2>}
|
|
30
|
+
{lede && <p className="kol-doc-body max-w-[65ch]">{lede}</p>}
|
|
31
|
+
{children}
|
|
32
|
+
</section>
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* DocTable — a PRESET over the kol-component Table (the one table; 2026-07-28
|
|
37
|
+
* user ruling: no parallel table markup). Fixed props-table columns, doc cell
|
|
38
|
+
* classes through Table's per-column seams, doc chrome via the .kol-doc-table
|
|
39
|
+
* class on Table's wrapper (the descendant rules out-specify Table's cell
|
|
40
|
+
* defaults). The .kol-doc-figure frame supplies the border. */
|
|
41
|
+
const PROPS_COLUMNS = [
|
|
42
|
+
{ accessor: 'prop', header: 'Prop', className: 'kol-doc-table-value text-emphasis' },
|
|
43
|
+
{ accessor: 'type', header: 'Type', className: 'kol-doc-table-value kol-doc-table-value--wrap text-meta' },
|
|
44
|
+
{ accessor: 'def', header: 'Default', className: 'kol-doc-table-value text-meta' },
|
|
45
|
+
{ accessor: 'desc', header: 'Description' },
|
|
46
|
+
]
|
|
47
|
+
|
|
48
|
+
export function DocTable({ rows }) {
|
|
49
|
+
if (!rows?.length) return null
|
|
50
|
+
return (
|
|
51
|
+
<div className="kol-doc-figure overflow-x-auto">
|
|
52
|
+
<Table
|
|
53
|
+
variant="simple"
|
|
54
|
+
caption="Props"
|
|
55
|
+
columns={PROPS_COLUMNS}
|
|
56
|
+
rows={rows.map((r) => ({ id: r.prop, ...r }))}
|
|
57
|
+
className="kol-doc-table"
|
|
58
|
+
/>
|
|
59
|
+
</div>
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function DocFigure({ caption, className = '', children }) {
|
|
64
|
+
return (
|
|
65
|
+
<figure className={`kol-doc-figure ${className}`}>
|
|
66
|
+
{children}
|
|
67
|
+
{caption && <figcaption className="kol-doc-caption border-t border-fg-08 px-4 py-2.5">{caption}</figcaption>}
|
|
68
|
+
</figure>
|
|
69
|
+
)
|
|
70
|
+
}
|
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'
|