@kolkrabbi/kol-shell 0.14.0 → 0.15.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 +4 -4
- package/src/PageHeader.jsx +36 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolkrabbi/kol-shell",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "KOL application shell — fixed 48px NavRail + AppShell layout root, PageShell/PageHeader scaffolds, ContentFilters catalog organism, GridCard, SettingsScaffold, WalkthroughPanel, ShortcutsOverlay. App chrome (kol-framework owns site chrome). Nav items, content, shortcuts and settings are consumer-injected. Sits above @kolkrabbi/kol-{theme,component,framework}.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"react-dom": "^18.3.0 || ^19.0.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@kolkrabbi/kol-component": "^0.
|
|
24
|
-
"@kolkrabbi/kol-framework": "^0.34.0",
|
|
23
|
+
"@kolkrabbi/kol-component": "^0.121.1",
|
|
25
24
|
"@kolkrabbi/kol-icons": "^0.24.0",
|
|
26
|
-
"@kolkrabbi/kol-
|
|
25
|
+
"@kolkrabbi/kol-framework": "^0.35.0",
|
|
26
|
+
"@kolkrabbi/kol-theme": "^0.83.0"
|
|
27
27
|
},
|
|
28
28
|
"files": [
|
|
29
29
|
"src",
|
package/src/PageHeader.jsx
CHANGED
|
@@ -29,18 +29,34 @@
|
|
|
29
29
|
* kol-mono-heading-03 · kol-mono-display-03 · kol-mono-display-02
|
|
30
30
|
* (kol-theme ≥0.67.0). The subtitle stays kol-mono-14.
|
|
31
31
|
* @param {string} titleClass replaces the title role whole (the ContentText seam)
|
|
32
|
+
* @param {ReactNode} actions a control cluster on the SUBTITLE's first baseline — on the title's
|
|
33
|
+
* when there is no subtitle (PageHeaderTrailingSlot, kol-website 2026-08-28;
|
|
34
|
+
* kol-r2b2's header is the reference: wordmark left, controls right, on the
|
|
35
|
+
* line). Without it the consumer wrapped the header in a flex row and got the
|
|
36
|
+
* h1's baseline, or re-rendered the subtitle as a bare <p> off copied classes
|
|
37
|
+
* with an `!important` on the margin — a DS text role re-implemented outside.
|
|
38
|
+
* @param {string} subtitleMaxWidth the lede's measure (e.g. '800px' or '60ch'), a prop
|
|
39
|
+
* instead of a consumer selector reaching inside
|
|
40
|
+
* The bottom rhythm is `--kol-page-header-mb` (default 40px): inline, as before, but through a
|
|
41
|
+
* variable a consumer can re-point where an inline literal could only be `!important`-ed.
|
|
32
42
|
*/
|
|
33
43
|
const TITLE = {
|
|
34
44
|
sans: { sm: 'kol-sans-heading-03', md: 'kol-sans-display-03', lg: 'kol-sans-display-02' },
|
|
35
45
|
mono: { sm: 'kol-mono-heading-03', md: 'kol-mono-display-03', lg: 'kol-mono-display-02' },
|
|
36
46
|
}
|
|
37
47
|
|
|
38
|
-
export default function PageHeader({ eyebrow, title, subtitle, size = 'md', voice = 'sans', titleClass, className = '' }) {
|
|
48
|
+
export default function PageHeader({ eyebrow, title, subtitle, actions, subtitleMaxWidth, size = 'md', voice = 'sans', titleClass, className = '' }) {
|
|
39
49
|
const roles = TITLE[voice] ?? TITLE.sans
|
|
50
|
+
const h1 = <h1 className={`text-fg-96 ${titleClass ?? roles[size] ?? roles.md}`}>{title}</h1>
|
|
51
|
+
const lede = subtitle && <p className="text-oq-64 kol-mono-14 min-w-0" style={{ marginTop: actions ? undefined : 12, maxWidth: subtitleMaxWidth }}>{subtitle}</p>
|
|
52
|
+
/* the cluster shares a baseline row with the lede (or the title): flexbox
|
|
53
|
+
exposes a flex item's FIRST baseline, so putting them in one row is the
|
|
54
|
+
one way to land on the subtitle's line rather than the h1's */
|
|
55
|
+
const cluster = actions && <div className="flex items-center gap-4 shrink-0">{actions}</div>
|
|
40
56
|
return (
|
|
41
57
|
/* the block owns its own rhythm — margins inline, never in a shared type
|
|
42
58
|
class, which leaks estate-wide (ShellHeaderFilterRefinements, 2026-08-15) */
|
|
43
|
-
<header className={`flex flex-col ${className}`.trim()} style={{ marginBottom:
|
|
59
|
+
<header className={`flex flex-col ${className}`.trim()} style={{ marginBottom: 'var(--kol-page-header-mb, 40px)' }}>
|
|
44
60
|
{eyebrow && (
|
|
45
61
|
/* HELPER, not mono (user ruling 2026-08-15). An eyebrow is single-line
|
|
46
62
|
chrome — that is the whole definition of the `kol-helper-*` ramp, and
|
|
@@ -54,9 +70,24 @@ export default function PageHeader({ eyebrow, title, subtitle, size = 'md', voic
|
|
|
54
70
|
{eyebrow}
|
|
55
71
|
</p>
|
|
56
72
|
)}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
73
|
+
{actions && subtitle ? (
|
|
74
|
+
<>
|
|
75
|
+
{h1}
|
|
76
|
+
<div className="flex items-baseline justify-between gap-6" style={{ marginTop: 12 }}>
|
|
77
|
+
{lede}
|
|
78
|
+
{cluster}
|
|
79
|
+
</div>
|
|
80
|
+
</>
|
|
81
|
+
) : actions ? (
|
|
82
|
+
<div className="flex items-baseline justify-between gap-6">
|
|
83
|
+
{h1}
|
|
84
|
+
{cluster}
|
|
85
|
+
</div>
|
|
86
|
+
) : (
|
|
87
|
+
<>
|
|
88
|
+
{h1}
|
|
89
|
+
{lede}
|
|
90
|
+
</>
|
|
60
91
|
)}
|
|
61
92
|
</header>
|
|
62
93
|
)
|