@kolkrabbi/kol-component 0.367.0 → 0.369.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.367.0",
3
+ "version": "0.369.0",
4
4
  "description": "The core component library",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -32,9 +32,9 @@
32
32
  "embla-carousel-react": "^8.6.0",
33
33
  "pdfjs-dist": "^6.3.289",
34
34
  "react-syntax-highlighter": "^16.1.1",
35
- "@kolkrabbi/kol-growth": "^0.5.0",
35
+ "@kolkrabbi/kol-search": "^0.3.0",
36
36
  "@kolkrabbi/kol-markdown": "^0.2.0",
37
- "@kolkrabbi/kol-search": "^0.3.0"
37
+ "@kolkrabbi/kol-growth": "^0.5.0"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "@kolkrabbi/kol-icons": ">=0.69.0",
@@ -80,7 +80,11 @@ const Button = ({
80
80
  // it took the text-adjacent ladder until component 0.20.0, which put a 14px
81
81
  // glyph in a 28px square at `sm`. `iconSize` still overrides either.
82
82
  /* a float glyph follows the pointer (18, 20 on touch — `--kol-float-ic`), so its size is the token, not a number */
83
- const resolvedIconSize = iconSize ?? (variant === 'float' ? 'var(--kol-float-ic)' : glyphSize(size, Boolean(iconOnly)))
83
+ /* …except a chevron or caret: LAW 9 (the user, 2026-11-12: *"USE 12px chevron"*), the float chevron token per size
84
+ (12 · 12 · 16, touch 14 · 14 · 18), the same as the Dropdown and the fold. Only when every glyph is one. */
85
+ const glyphs = [iconOnly, iconLeft, iconRight].filter(Boolean)
86
+ const chevronOnly = glyphs.length > 0 && glyphs.every((g) => /^(chevron|caret)/.test(g))
87
+ const resolvedIconSize = iconSize ?? (variant === 'float' ? (chevronOnly ? `var(--kol-float-chev-${size === 'lg' ? 'lg' : size === 'md' ? 'md' : 'sm'})` : 'var(--kol-float-ic)') : glyphSize(size, Boolean(iconOnly)))
84
88
 
85
89
  // `control` is a legacy alias for `ghost` (kept so web call-sites passing
86
90
  // variant="control" keep working post-migration).
@@ -54,7 +54,7 @@ export default function ContextMenu({ menu, children, variant, className = '' })
54
54
  <Menu anchor={{ x: menu.x, y: menu.y }} open onOpenChange={(v) => { if (!v) menu.close() }} variant={variant} panelClassName={`min-w-44 ${className}`.trim()}>
55
55
  {/* Any click inside closes — a menu item that leaves the menu open after acting is the one interaction people
56
56
  * report as broken. Items keep their own onClick; this runs after it on the way up. */}
57
- <div onClick={menu.close} role="none" className="flex flex-col">
57
+ <div onClick={menu.close} role="none" className="flex flex-col gap-[var(--kol-spacing-0-5)]">
58
58
  {typeof children === 'function' ? children(menu.payload) : children}
59
59
  </div>
60
60
  </Menu>
@@ -334,7 +334,7 @@ const Dropdown = ({
334
334
  * not"*). One rule: an open dropdown has the line. */}
335
335
  <div className="kol-dd-div" />
336
336
 
337
- <div ref={listRef} className="kol-dd-list" role="listbox" aria-multiselectable={multiple || undefined} style={scale !== 1 ? { zoom: scale } : undefined}>
337
+ <div ref={listRef} className="kol-dd-list flex flex-col gap-[var(--kol-spacing-0-5)]" role="listbox" aria-multiselectable={multiple || undefined} style={scale !== 1 ? { zoom: scale } : undefined}>
338
338
  <MenuList items={items} dividerClassName="my-1" headingClassName={headingCls} />
339
339
  </div>
340
340
  </Menu>
@@ -58,7 +58,7 @@ export function MenuTrigger({ open = false, iconOnly, icon, iconComponent, varia
58
58
  }
59
59
 
60
60
  export const MenuPanel = ({ variant, sheet = false, className = '', children, ...rest }) => (
61
- <div className={`kol-menu-panel ${panelClass(variant, sheet)} ${className}`.replace(/\s+/g, ' ').trim()} {...rest}>{children}</div>
61
+ <div className={`kol-menu-panel flex flex-col gap-[var(--kol-spacing-0-5)] ${panelClass(variant, sheet)} ${className}`.replace(/\s+/g, ' ').trim()} {...rest}>{children}</div>
62
62
  )
63
63
 
64
64
  export { MenuLabel }
@@ -138,7 +138,7 @@ export function Menu({
138
138
  className={`kol-menu-panel${fused ? ' kol-menu-panel--fused' : ' w-max'} ${panelClass(variant, sheet)} ${panelClassName}`.replace(/\s+/g, ' ').trim()}
139
139
  style={{ ...ambient, ...(minWidth ? { minWidth } : null), ...panelStyle }}>
140
140
  {/* a row's click closes the menu (it bubbles from `[data-menu-item]`); a flyout row only toggles */}
141
- <div role="none" className="flex flex-col min-h-0" onClick={(e) => { if (closeOnSelect && e.target.closest('[data-menu-item]')) setOpen(false) }}>
141
+ <div role="none" className="flex flex-col gap-[var(--kol-spacing-0-5)] min-h-0" onClick={(e) => { if (closeOnSelect && e.target.closest('[data-menu-item]')) setOpen(false) }}>
142
142
  <MenuList items={items} search={search} variant={variant}>
143
143
  {typeof children === 'function' ? children({ close: () => setOpen(false) }) : children}
144
144
  </MenuList>
@@ -295,7 +295,7 @@ function MenuFlyoutNest({ prefix, iconLeft, label, disabled, scroll, rowClass, p
295
295
  <div
296
296
  ref={panel}
297
297
  role="menu"
298
- className={`absolute ${fit.flip ? 'right-full' : 'left-full'} flex flex-col w-max min-w-[180px] max-w-[320px] z-10 ${panelClassName ?? 'py-1 bg-surface-secondary rounded border border-oq-08 shadow-lg'} ${scroll ? 'max-h-[60vh] overflow-y-auto' : ''}`}
298
+ className={`absolute ${fit.flip ? 'right-full' : 'left-full'} flex flex-col gap-[var(--kol-spacing-0-5)] w-max min-w-[180px] max-w-[320px] z-10 ${panelClassName ?? 'py-1 bg-surface-secondary rounded border border-oq-08 shadow-lg'} ${scroll ? 'max-h-[60vh] overflow-y-auto' : ''}`}
299
299
  style={{ top: -5 + fit.dy, ...(fit.flip && panelStyle?.marginLeft != null ? { ...panelStyle, marginLeft: undefined, marginRight: panelStyle.marginLeft } : panelStyle) }}
300
300
  >
301
301
  {children}
@@ -18,12 +18,12 @@ function Side({ dir, item }) {
18
18
  return (
19
19
  <El {...(item.href ? { href: item.href } : { type: 'button' })} onClick={item.onClick}
20
20
  className={`flex h-14 min-w-0 items-center gap-3 rounded-full bg-surface-secondary text-left no-underline cursor-pointer hover:shadow-[inset_0_0_0_999px_var(--kol-fg-08)] focus-visible:outline-none focus-visible:shadow-[var(--kol-float-focus)] ${next ? 'pl-5 pr-4' : 'pl-4 pr-5'}`}>
21
- {!next && <IconLoader name="chevron-left" size="var(--kol-float-ic)" className="shrink-0 text-oq-64" />}
21
+ {!next && <IconLoader name="chevron-left" size="var(--kol-float-chev-md)" className="shrink-0 text-oq-64" />}
22
22
  <span className="flex min-w-0 flex-1 flex-col">
23
23
  <span className="kol-float-ruler truncate uppercase text-fg-64">{item.label ?? (next ? 'Next' : 'Previous')}</span>
24
24
  <span className="kol-float-hint truncate text-fg-emphasis">{item.title}</span>
25
25
  </span>
26
- {next && <IconLoader name="chevron-right" size="var(--kol-float-ic)" className="shrink-0 text-oq-64" />}
26
+ {next && <IconLoader name="chevron-right" size="var(--kol-float-chev-md)" className="shrink-0 text-oq-64" />}
27
27
  </El>
28
28
  )
29
29
  }
@@ -444,7 +444,7 @@ export default function CommandOverlay({
444
444
  <div className="border-t border-fg-08 max-h-[70vh] overflow-y-auto" style={RULE}>{children}</div>
445
445
  ) : results.length > 0 && (
446
446
  /* FIXED BODY HEIGHT — the panel holds still while the list narrows. */
447
- <ul ref={listRef} id={listId} role="listbox" className="h-80 overflow-y-auto">
447
+ <ul ref={listRef} id={listId} role="listbox" className="flex h-80 flex-col gap-[var(--kol-spacing-0-5)] overflow-y-auto">
448
448
  {results.map((item, i) => {
449
449
  const heading = (item.group ?? '') !== (results[i - 1]?.group ?? '') || i === 0
450
450
  return (