@kolkrabbi/kol-component 0.266.0 → 0.267.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.267.0",
|
|
4
4
|
"description": "The core component library",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"embla-carousel-react": "^8.6.0",
|
|
27
27
|
"pdfjs-dist": "^6.3.289",
|
|
28
28
|
"react-syntax-highlighter": "^16.1.1",
|
|
29
|
-
"@kolkrabbi/kol-
|
|
30
|
-
"@kolkrabbi/kol-
|
|
29
|
+
"@kolkrabbi/kol-markdown": "^0.1.3",
|
|
30
|
+
"@kolkrabbi/kol-search": "^0.3.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"@kolkrabbi/kol-icons": ">=0.22.0",
|
|
@@ -48,7 +48,12 @@ import { TITLE_ROLES, useMasthead } from '../utilities/masthead.js'
|
|
|
48
48
|
* default, so no shell page moves.
|
|
49
49
|
* site sans lede (`kol-sans-body-01`) — what kolkrabbi.io's `/prints`
|
|
50
50
|
* and `/work` build by hand today.
|
|
51
|
-
* @param {string} size sm | md | lg (default md)
|
|
51
|
+
* @param {string} size sm | md | lg | xl (default md; xl = display-01, the approved page header)
|
|
52
|
+
* @param {'page'|'section'} level ONE HEADER, TWO LEVELS (Round 11, approved 2026-10-18): `section` is the same
|
|
53
|
+
* header one step down — an h2, and in the site register the section description
|
|
54
|
+
* (16/24 Light +0.5px) under the page's (22/28 Light +0.01em). Default `page`.
|
|
55
|
+
* @param {ReactNode} media a mark above the eyebrow (a logo, an SVG) — shown only when passed
|
|
56
|
+
* @param {ReactNode} description the subtitle's other name — the header's description
|
|
52
57
|
* @param {'sans'|'mono'} voice the title's family (default sans). `mono` = the
|
|
53
58
|
* app tier's masthead (PageHeaderMonoTitle, kol-fxr 2026-08-27 —
|
|
54
59
|
* user ruling: kol-monitor's JetBrains Mono 32 / 500 is the look):
|
|
@@ -75,24 +80,26 @@ import { TITLE_ROLES, useMasthead } from '../utilities/masthead.js'
|
|
|
75
80
|
* utilities/masthead.js since 2026-09-29 so a tool's own title reads the same table. */
|
|
76
81
|
const TITLE = TITLE_ROLES
|
|
77
82
|
/* the ONE thing the registers disagree about */
|
|
78
|
-
const LEDE = { app: 'kol-mono-14', site: 'kol-
|
|
83
|
+
const LEDE = { app: 'text-oq-64 kol-mono-14', site: 'kol-header-lede', 'site-section': 'kol-header-lede-section' }
|
|
79
84
|
|
|
80
|
-
export default function PageHeader({ eyebrow, title, subtitle:
|
|
85
|
+
export default function PageHeader({ eyebrow, title, subtitle: ownSubtitle0, description, actions, subtitleMaxWidth, size: ownSize = 'md', voice: ownVoice = 'sans', register = 'app', level = 'page', media, titleClass, masthead, className = '' }) {
|
|
86
|
+
const ownSubtitle = ownSubtitle0 ?? description
|
|
87
|
+
const section = level === 'section'
|
|
81
88
|
const m = useMasthead(masthead)
|
|
82
89
|
const voice = m ? m.voice : ownVoice
|
|
83
90
|
const size = m ? m.size : ownSize
|
|
84
91
|
const subtitle = m && !m.subtitle ? undefined : ownSubtitle
|
|
85
92
|
const roles = TITLE[voice] ?? TITLE.sans
|
|
86
|
-
|
|
93
|
+
const header = (
|
|
87
94
|
/* the block owns its own rhythm — margins inline, never in a shared type
|
|
88
95
|
class, which leaks estate-wide (ShellHeaderFilterRefinements, 2026-08-15) */
|
|
89
96
|
<SectionText
|
|
90
97
|
eyebrow={eyebrow}
|
|
91
98
|
headline={title}
|
|
92
|
-
headlineAs=
|
|
99
|
+
headlineAs={section ? 'h2' : 'h1'}
|
|
93
100
|
headlineClass={`text-fg-96 ${titleClass ?? roles[size] ?? roles.md}${m?.upper ? ' uppercase' : ''}`}
|
|
94
101
|
body={subtitle}
|
|
95
|
-
bodyClass={
|
|
102
|
+
bodyClass={`${(register === 'site' && section ? LEDE['site-section'] : LEDE[register]) ?? LEDE.app} min-w-0`}
|
|
96
103
|
actions={actions}
|
|
97
104
|
actionsPlacement="inline"
|
|
98
105
|
actionsClass="flex items-center gap-4"
|
|
@@ -105,7 +112,14 @@ export default function PageHeader({ eyebrow, title, subtitle: ownSubtitle, acti
|
|
|
105
112
|
gap="gap-3"
|
|
106
113
|
slotStyle={{ body: { maxWidth: subtitleMaxWidth } }}
|
|
107
114
|
className={className}
|
|
108
|
-
style={{ marginBottom: 'var(--kol-page-header-mb, 40px)' }}
|
|
115
|
+
style={media ? undefined : { marginBottom: 'var(--kol-page-header-mb, 40px)' }}
|
|
109
116
|
/>
|
|
110
117
|
)
|
|
118
|
+
if (!media) return header
|
|
119
|
+
return (
|
|
120
|
+
<div className="flex flex-col gap-4" style={{ marginBottom: 'var(--kol-page-header-mb, 40px)' }}>
|
|
121
|
+
<span className="inline-flex text-emphasis">{media}</span>
|
|
122
|
+
{header}
|
|
123
|
+
</div>
|
|
124
|
+
)
|
|
111
125
|
}
|
|
@@ -22,8 +22,8 @@ export const MASTHEADS = {
|
|
|
22
22
|
|
|
23
23
|
/* the title role per voice and size — PageHeader's ladder, here so a tool's own title reads it too */
|
|
24
24
|
export const TITLE_ROLES = {
|
|
25
|
-
sans: { sm: 'kol-sans-heading-03', md: 'kol-sans-display-03', lg: 'kol-sans-display-02' },
|
|
26
|
-
mono: { sm: 'kol-mono-heading-03', md: 'kol-mono-display-03', lg: 'kol-mono-display-02' },
|
|
25
|
+
sans: { sm: 'kol-sans-heading-03', md: 'kol-sans-display-03', lg: 'kol-sans-display-02', xl: 'kol-sans-display-01' },
|
|
26
|
+
mono: { sm: 'kol-mono-heading-03', md: 'kol-mono-display-03', lg: 'kol-mono-display-02', xl: 'kol-mono-display-02' },
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export const MastheadContext = createContext(null)
|