@kolkrabbi/kol-component 0.323.0 → 0.325.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.323.0",
3
+ "version": "0.325.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-growth": "^0.4.0",
30
29
  "@kolkrabbi/kol-search": "^0.3.0",
30
+ "@kolkrabbi/kol-growth": "^0.4.0",
31
31
  "@kolkrabbi/kol-markdown": "^0.2.0"
32
32
  },
33
33
  "peerDependencies": {
@@ -39,7 +39,7 @@
39
39
  "react-dom": "^18.3.0 || ^19.0.0"
40
40
  },
41
41
  "devDependencies": {
42
- "@kolkrabbi/kol-icons": "^0.55.0"
42
+ "@kolkrabbi/kol-icons": "^0.56.0"
43
43
  },
44
44
  "files": [
45
45
  "src",
@@ -76,7 +76,7 @@ function Rows({ items }) {
76
76
  <Rows items={it.items} />
77
77
  </MenuFlyout>
78
78
  ) : (
79
- <MenuRow disabled={it.disabled} rowClass={cls} onClick={it.onClick} iconLeft={icon} shortcut={trailingOf(it)}>
79
+ <MenuRow href={it.href} disabled={it.disabled} rowClass={cls} onClick={it.onClick} iconLeft={icon} shortcut={trailingOf(it)}>
80
80
  {it.label}
81
81
  </MenuRow>
82
82
  )
@@ -134,15 +134,17 @@ const ROW_BY_SIZE = { xs: 'kol-mono-8 px-2 h-5', sm: 'kol-helper-12 px-2 h-8', m
134
134
  /* `flex`, not `inline-flex` (MenuDropdownItemBlockRow, kol-fxr 2026-10-13): as bare children of a
135
135
  * content-sized (`w-max`) panel, inline rows measured as ONE line — five starters ≈ 795px. A block
136
136
  * row still fills a fixed panel through `w-full` and lets a content-sized one hug its longest label. */
137
- export function MenuRow({ onClick, onPointerEnter, onPointerLeave, disabled, prefix, iconLeft, shortcut, hover = true, height, size = 'sm', rowClass, children }) {
137
+ export function MenuRow({ href, onClick, onPointerEnter, onPointerLeave, disabled, prefix, iconLeft, shortcut, hover = true, height, size = 'sm', rowClass, children }) {
138
+ /* `href` makes the row a real link — cmd/ctrl-click and middle-click open a new tab (DocumentHeader, 2026-10-31);
139
+ * a plain click still runs `onClick` (the app's router), which may preventDefault */
140
+ const Row = href && !disabled ? 'a' : 'button'
138
141
  return (
139
- <button
140
- type="button"
142
+ <Row
143
+ {...(Row === 'a' ? { href, onClick: (e) => { if (e.metaKey || e.ctrlKey || e.shiftKey || e.button === 1) return; onClick?.(e) } } : { type: 'button', onClick })}
141
144
  data-menu-item
142
- onClick={onClick}
143
145
  onPointerEnter={onPointerEnter}
144
146
  onPointerLeave={onPointerLeave}
145
- disabled={disabled}
147
+ disabled={Row === 'button' ? disabled : undefined}
146
148
  role="menuitem"
147
149
  style={height != null ? { height } : undefined}
148
150
  className={`kol-menu-btn w-full ${rowClass ?? ROW_BY_SIZE[size] ?? ROW_BY_SIZE.sm} shrink-0 flex items-center gap-2 text-body ${hover ? 'hover:text-emphasis' : ''} disabled:opacity-40 disabled:cursor-not-allowed text-left`}
@@ -155,7 +157,7 @@ export function MenuRow({ onClick, onPointerEnter, onPointerLeave, disabled, pre
155
157
  * zero layout shift (MenuItemDescenderClip, 2026-08-12). */}
156
158
  <span className="flex-1 truncate leading-normal">{children}</span>
157
159
  {shortcut && <span className="kol-helper-10 text-emphasis shrink-0 inline-flex items-center">{shortcut}</span>}
158
- </button>
160
+ </Row>
159
161
  )
160
162
  }
161
163
 
@@ -37,7 +37,8 @@
37
37
  * stamps `reveal` on each part; nothing animates in the DS)
38
38
  * @param {object} slotStyle inline style per slot — `{ headline: { '--reveal-delay': '0.1s' } }`
39
39
  * @param {string} className extra classes on the block
40
- * @param {'page'|'app'|'section'|'content'|'document'} [level] THE HEADER LEVELS (2026-10-22, user: *"rename PageHeader to
40
+ * @param {'page'|'app'|'section'|'content'|'document'} [variant] THE HEADER VARIANTS (was `level` until 2026-10-31 — user: `variant`
41
+ * is the only word for a variant; `level` stays a deprecated alias on the retirement ledger) (2026-10-22, user: *"rename PageHeader to
41
42
  * something that describes section text elements"* — PageHeader is now an alias of this). A
42
43
  * level fills the role defaults; any explicit prop still wins. page = h1 display-01 over
43
44
  * `.kol-header-lede` — the hero; app = h1 display-01 at 46/60 over `.kol-header-lede-app`;
@@ -119,11 +120,14 @@ export default function SectionText({
119
120
  (PageHeader's `--kol-page-header-mb`). `slotStyle` reaches the slots; this
120
121
  was the one box it could not reach. */
121
122
  style,
123
+ variant: variantProp,
124
+ /* deprecated alias of `variant` (2026-10-31) */
122
125
  level,
123
126
  media,
124
127
  }) {
125
128
  /* a LEVEL fills the header defaults; an explicit prop always wins */
126
- const L = level ? SECTION_TEXT_LEVELS[level] ?? SECTION_TEXT_LEVELS.page : null
129
+ const variant = variantProp ?? level
130
+ const L = variant ? SECTION_TEXT_LEVELS[variant] ?? SECTION_TEXT_LEVELS.page : null
127
131
  const Headline = headlineAs ?? L?.as ?? (L ? 'h1' : 'h2')
128
132
  if (L) {
129
133
  headlineClass = `text-fg-96 ${headlineClass ?? L.title}`