@kolkrabbi/kol-component 0.324.0 → 0.326.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.324.0",
3
+ "version": "0.326.0",
4
4
  "description": "The core component library",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -26,9 +26,9 @@
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-search": "^0.3.0",
30
29
  "@kolkrabbi/kol-growth": "^0.4.0",
31
- "@kolkrabbi/kol-markdown": "^0.2.0"
30
+ "@kolkrabbi/kol-markdown": "^0.2.0",
31
+ "@kolkrabbi/kol-search": "^0.3.0"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "@kolkrabbi/kol-icons": ">=0.22.0",
@@ -39,7 +39,7 @@
39
39
  "react-dom": "^18.3.0 || ^19.0.0"
40
40
  },
41
41
  "devDependencies": {
42
- "@kolkrabbi/kol-icons": "^0.56.0"
42
+ "@kolkrabbi/kol-icons": "^0.56.1"
43
43
  },
44
44
  "files": [
45
45
  "src",
@@ -22,6 +22,8 @@ import { glyphSize, indicatorSize } from '../hooks/glyphLadders.js'
22
22
  * tone="inverse" — the dark chip (`fg-ab-24`) for a washed
23
23
  * plane, the panel continuing it (ControlToneInverse,
24
24
  * kol-website 2026-08-27); same prop on ViewToggle · Input
25
+ * variant="raised" — the menus' faint raised look (metric R3.4, 2026-10-31): trigger, open trigger and
26
+ * panel all on oq-08 with the float shadow — one tone, nothing changes on open
25
27
  * variant="outline" — bordered trigger; open panel carries the
26
28
  * same border, trigger's bottom edge acts as the divider
27
29
  *
@@ -222,7 +224,7 @@ const Dropdown = ({
222
224
  'kol-btn',
223
225
  /* grey is dropdown-only chrome (2026-07-15) — no kol-btn-* class so it
224
226
  * never leaks into Button's variant set */
225
- resolvedVariant === 'grey' ? 'kol-dd-trigger--grey' : resolvedVariant && `kol-btn-${resolvedVariant}`,
227
+ resolvedVariant === 'grey' ? 'kol-dd-trigger--grey' : resolvedVariant === 'raised' ? 'kol-dd-trigger--raised' : resolvedVariant && `kol-btn-${resolvedVariant}`,
226
228
  `kol-btn-${resolvedSize}`,
227
229
  SIZE_TYPE[resolvedSize],
228
230
  'kol-dd-trigger',
@@ -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