@kolkrabbi/kol-component 0.276.0 → 0.278.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 +3 -3
- package/src/index.js +1 -1
- package/src/molecules/PageHeader.jsx +19 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolkrabbi/kol-component",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.278.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",
|
package/src/index.js
CHANGED
|
@@ -171,7 +171,7 @@ export { default as EmblaNav } from './molecules/EmblaNav.jsx'
|
|
|
171
171
|
/** @deprecated 2026-10-17 — alias of `TabsRow look="stacked" placement="phone"` */
|
|
172
172
|
export { default as MobileTabBar } from './molecules/MobileTabBar.jsx'
|
|
173
173
|
export { default as ContentFilters } from './organisms/ContentFilters.jsx'
|
|
174
|
-
export { default as PageHeader } from './molecules/PageHeader.jsx'
|
|
174
|
+
export { default as PageHeader, PAGE_HEADER_ROLES } from './molecules/PageHeader.jsx'
|
|
175
175
|
export { MastheadContext, MASTHEADS, useMasthead, mastheadTitleClass } from './utilities/masthead.js'
|
|
176
176
|
export { default as ErrorBoundary } from './utilities/ErrorBoundary.jsx'
|
|
177
177
|
export { default as FeatureSplit } from './organisms/FeatureSplit.jsx'
|
|
@@ -28,9 +28,11 @@ import SectionText from './SectionText.jsx'
|
|
|
28
28
|
* @param {ReactNode} eyebrow small label above the title
|
|
29
29
|
* @param {ReactNode} title
|
|
30
30
|
* @param {ReactNode} subtitle the lede under the title (`description` is its other name)
|
|
31
|
-
* @param {'page'|'section'} level ONE HEADER
|
|
32
|
-
* display-01 over `.kol-header-lede` (22/28 Light);
|
|
33
|
-
* `.kol-header-lede-
|
|
31
|
+
* @param {'page'|'app'|'section'} level ONE HEADER (Round 11, approved 2026-10-18): page = h1
|
|
32
|
+
* display-01 over `.kol-header-lede` (22/28 Light) — the hero; app = h1 display-02
|
|
33
|
+
* over `.kol-header-lede-app` (19/26 Light) — the app tier's pages; section = h2
|
|
34
|
+
* display-03 over `.kol-header-lede-section` (16/24 Light +0.5px). Default `page`.
|
|
35
|
+
* Classes per level: `PAGE_HEADER_ROLES`.
|
|
34
36
|
* @param {ReactNode} media a mark above the eyebrow (a logo, an SVG) — shown only when passed
|
|
35
37
|
* @param {ReactNode} description the subtitle's other name — the header's description
|
|
36
38
|
* @param {string} titleClass replaces the title role whole (the ContentText seam)
|
|
@@ -52,12 +54,21 @@ import SectionText from './SectionText.jsx'
|
|
|
52
54
|
* only choice — page = display-01 over the 22/28 lede, section = display-03 over the 16/24 lede — and
|
|
53
55
|
* `size` · `voice` · `register` · `masthead` are accepted and ignored, so every caller (and every
|
|
54
56
|
* Shell's masthead) renders the one header with no edit. `titleClass` stays the seam. */
|
|
55
|
-
|
|
56
|
-
|
|
57
|
+
/* THREE LEVELS since 0.277.0 (PageHeaderAppLevel, kol-monitor — user: *"that display is fine for Section
|
|
58
|
+
* Hero like in brand but not for EVERYTHING ELSE that uses the mono"*). `app` sits BETWEEN page and section,
|
|
59
|
+
* in their family (0.278.0 — user: *"did I ask for mono?!?! … MAKE THE TEXT SMALLER … SO THAT IT IS BETWEEN
|
|
60
|
+
* SECTION AND PAGE"*; 0.277.0 had made it mono): display-02 over a 19/26 light lede. The app tier's Home ·
|
|
61
|
+
* Library · Settings · Dev pages, which kol-shell defaults to it. Exported so a page drawing its own title
|
|
62
|
+
* (monitor's Create inputs) matches the level. */
|
|
63
|
+
export const PAGE_HEADER_ROLES = {
|
|
64
|
+
page: { title: 'kol-sans-display-01', lede: 'kol-header-lede' },
|
|
65
|
+
app: { title: 'kol-sans-display-02', lede: 'kol-header-lede-app' },
|
|
66
|
+
section: { title: 'kol-sans-display-03', lede: 'kol-header-lede-section' },
|
|
67
|
+
}
|
|
57
68
|
|
|
58
69
|
export default function PageHeader({ eyebrow, title, subtitle, description, actions, subtitleMaxWidth, level = 'page', media, titleClass, className = '' }) {
|
|
59
70
|
const section = level === 'section'
|
|
60
|
-
const
|
|
71
|
+
const roles = PAGE_HEADER_ROLES[level] ?? PAGE_HEADER_ROLES.page
|
|
61
72
|
const header = (
|
|
62
73
|
/* the block owns its own rhythm — margins inline, never in a shared type
|
|
63
74
|
class, which leaks estate-wide (ShellHeaderFilterRefinements, 2026-08-15) */
|
|
@@ -65,9 +76,9 @@ export default function PageHeader({ eyebrow, title, subtitle, description, acti
|
|
|
65
76
|
eyebrow={eyebrow}
|
|
66
77
|
headline={title}
|
|
67
78
|
headlineAs={section ? 'h2' : 'h1'}
|
|
68
|
-
headlineClass={`text-fg-96 ${titleClass ??
|
|
79
|
+
headlineClass={`text-fg-96 ${titleClass ?? roles.title}`}
|
|
69
80
|
body={subtitle ?? description}
|
|
70
|
-
bodyClass={`${
|
|
81
|
+
bodyClass={`${roles.lede} min-w-0`}
|
|
71
82
|
actions={actions}
|
|
72
83
|
actionsPlacement="inline"
|
|
73
84
|
actionsClass="flex items-center gap-4"
|