@kolkrabbi/kol-workshop 0.2.1 → 0.3.1
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 +4 -4
- package/src/shell/ShellLayout.jsx +19 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolkrabbi/kol-workshop",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
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",
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
"d3": "^7.9.0",
|
|
16
16
|
"@kolkrabbi/kol-brand": "^0.1.2",
|
|
17
17
|
"@kolkrabbi/kol-icons": "0.8.10",
|
|
18
|
-
"@kolkrabbi/kol-
|
|
19
|
-
"@kolkrabbi/kol-
|
|
20
|
-
"@kolkrabbi/kol-
|
|
18
|
+
"@kolkrabbi/kol-component": "0.13.1",
|
|
19
|
+
"@kolkrabbi/kol-framework": "0.6.4",
|
|
20
|
+
"@kolkrabbi/kol-theme": "0.12.2"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"react": "^18.3.0 || ^19.0.0",
|
|
@@ -46,7 +46,7 @@ const TocColumn = ({ children }) => (
|
|
|
46
46
|
</aside>
|
|
47
47
|
)
|
|
48
48
|
|
|
49
|
-
const ShellLayout = ({ routes = [], basePath = '/', brandLogoSrc, brandLogoAlt = '', renderSidebar, searchItems, defaultTocContent, isActive: isActiveProp }) => {
|
|
49
|
+
const ShellLayout = ({ routes = [], basePath = '/', brand: brandProp, brandLogoSrc, brandLogoAlt = '', renderSidebar, searchItems, defaultTocContent, isActive: isActiveProp, actions }) => {
|
|
50
50
|
const [isNavDrawerOpen, setIsNavDrawerOpen] = useState(false)
|
|
51
51
|
const [navCollapsed, setNavCollapsed] = useState(false)
|
|
52
52
|
const [tocCollapsed, setTocCollapsed] = useState(false)
|
|
@@ -104,7 +104,10 @@ const ShellLayout = ({ routes = [], basePath = '/', brandLogoSrc, brandLogoAlt =
|
|
|
104
104
|
navigate(item.href)
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
|
|
107
|
+
/* `brand` takes any node — a consumer that isn't the workshop needs its own
|
|
108
|
+
* wordmark, and brandLogoSrc only ever accepted an <img>. Falls back to the
|
|
109
|
+
* logo-src form, then to the KOLKRABBI + WORKSHOP pair. */
|
|
110
|
+
const brand = brandProp ?? (brandLogoSrc ? (
|
|
108
111
|
<Link to={basePath} className="shell-header-logo flex items-center text-emphasis">
|
|
109
112
|
<img src={brandLogoSrc} alt={brandLogoAlt} className="h-6 w-auto" />
|
|
110
113
|
</Link>
|
|
@@ -120,11 +123,16 @@ const ShellLayout = ({ routes = [], basePath = '/', brandLogoSrc, brandLogoAlt =
|
|
|
120
123
|
<Asset name="wordmark-workshop" title="Workshop" className="inline-flex [&>svg]:h-6 [&>svg]:w-auto" />
|
|
121
124
|
</Link>
|
|
122
125
|
</>
|
|
123
|
-
)
|
|
126
|
+
))
|
|
127
|
+
/* Consumer `actions` sit BEFORE the search trigger in row 1 — a showcase
|
|
128
|
+
* needs its own controls (repo link, etc.) beside the shell's. */
|
|
124
129
|
const searchTrigger = (
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
130
|
+
<>
|
|
131
|
+
{actions}
|
|
132
|
+
<Tooltip label="Search">
|
|
133
|
+
<Button variant="ghost" quiet iconOnly="search" iconSize={18} onClick={() => setIsSearchOpen(true)} aria-label="Search" />
|
|
134
|
+
</Tooltip>
|
|
135
|
+
</>
|
|
128
136
|
)
|
|
129
137
|
|
|
130
138
|
/* searchItems ({ id, label, href, sectionLabel?, tags?, headings?, keywords? })
|
|
@@ -172,7 +180,11 @@ const ShellLayout = ({ routes = [], basePath = '/', brandLogoSrc, brandLogoAlt =
|
|
|
172
180
|
* overscroll-none stops chaining between regions and the edge bounce. */}
|
|
173
181
|
<div className="flex-1 overflow-hidden">
|
|
174
182
|
<div className="h-full w-full px-4 md:px-5 lg:px-6">
|
|
175
|
-
|
|
183
|
+
{/* gap lives in .shell-content-grid (theme) — a gap-8 utility here
|
|
184
|
+
* outranks the layered theme rule at every width and killed the
|
|
185
|
+
* 48px wide step (ARCHITECTURE §5: component geometry in its own
|
|
186
|
+
* rule, never a utility racing it). */}
|
|
187
|
+
<div className={`shell-content-grid grid ${gridCols} h-full min-h-0`} data-layout={layoutType}>
|
|
176
188
|
{showNav && (
|
|
177
189
|
<NavColumn>
|
|
178
190
|
{renderSidebar ? renderSidebar({}) : <ShellSidebar routes={routes} basePath={basePath} />}
|