@kolkrabbi/kol-shell 0.113.0 → 0.115.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-shell",
3
- "version": "0.113.0",
3
+ "version": "0.115.0",
4
4
  "private": false,
5
5
  "description": "The application shell",
6
6
  "license": "MIT",
@@ -15,16 +15,16 @@
15
15
  "@kolkrabbi/kol-component": ">=0.341.0",
16
16
  "@kolkrabbi/kol-framework": ">=0.55.0",
17
17
  "@kolkrabbi/kol-icons": ">=0.16.0",
18
- "@kolkrabbi/kol-theme": ">=0.212.0",
18
+ "@kolkrabbi/kol-theme": ">=0.215.0",
19
19
  "gsap": "^3.13.0",
20
20
  "react": "^18.3.0 || ^19.0.0",
21
21
  "react-dom": "^18.3.0 || ^19.0.0"
22
22
  },
23
23
  "devDependencies": {
24
- "@kolkrabbi/kol-component": "^0.344.0",
24
+ "@kolkrabbi/kol-theme": "^0.215.0",
25
25
  "@kolkrabbi/kol-icons": "^0.66.0",
26
- "@kolkrabbi/kol-theme": "^0.214.0",
27
- "@kolkrabbi/kol-framework": "^0.70.0"
26
+ "@kolkrabbi/kol-framework": "^0.70.0",
27
+ "@kolkrabbi/kol-component": "^0.344.0"
28
28
  },
29
29
  "files": [
30
30
  "src",
@@ -1,9 +1,9 @@
1
1
  import { useState } from 'react'
2
- import { Button, usePopover, PopoverPanel, floatSurfaceClass } from '@kolkrabbi/kol-component'
2
+ import { Button, MenuTrigger, usePopover, PopoverPanel, floatSurfaceClass } from '@kolkrabbi/kol-component'
3
3
  import { Icon } from '@kolkrabbi/kol-icons'
4
4
  import MoreRows, { FloatMenu } from './MoreSheet.jsx'
5
5
 
6
- /* taxonomy-ok: molecule — a float Button, the name, the More sheet's rows */
6
+ /* taxonomy-ok: molecule — a float Button, a float MenuTrigger (the name), the More sheet's rows */
7
7
 
8
8
  /**
9
9
  * DocumentCapsule — The open document's capsule (float-everything W5 row 71, 2026-11-04): 48 tall, the way back (at full
@@ -12,14 +12,16 @@ import MoreRows, { FloatMenu } from './MoreSheet.jsx'
12
12
  * oq-64). The exploration's `Document pill` (kol-float--style 9:9358).
13
13
  *
14
14
  * @param {string} name the document
15
- * @param {string} status the save state, verbatim ("✓ Saved")
15
+ * @param {string} status the save state, verbatim ("Saved")
16
+ * @param {string} statusIcon an icon before the status (`check` for a saved document) — a glyph is an Icon, never a text
17
+ * character (plan-2026-11-06-buttons-page 1.4: the "✓" was a string)
16
18
  * @param {Function} onBack the ← press; unset, no ←
17
19
  * @param {Array} menuItems `[{ label, icon?, onPress, sub? }]` — the ▾ menu's rows (MoreRows float); unset with `onMenu`, the ▾ runs it
18
20
  * @param {Function} onMenu `() => void` — the ▾ press when the consumer owns the menu
19
21
  * @param {'solid'|'glass-dark'|'glass-light'} surface what the capsule (and its menu) is made of (default `solid`)
20
22
  * @param {string} className
21
23
  */
22
- export default function DocumentCapsule({ name, status, onBack, menuItems, onMenu, surface = 'solid', className = '' }) {
24
+ export default function DocumentCapsule({ name, status, statusIcon, onBack, menuItems, onMenu, surface = 'solid', className = '' }) {
23
25
  const [open, setOpen] = useState(false)
24
26
  const popover = usePopover({ open, onOpenChange: setOpen, placement: 'bottom-start', offset: 8 })
25
27
  const hasMenu = menuItems?.length > 0
@@ -28,22 +30,25 @@ export default function DocumentCapsule({ name, status, onBack, menuItems, onMen
28
30
  <div className={`kol-document-capsule kol-float-chrome inline-flex items-center gap-3 h-12 pl-2 pr-4 rounded-full ${floatSurfaceClass(surface)} ${className}`.trim()}>
29
31
  {onBack && <Button variant="float" tone="ghost" size="sm" iconOnly="arrow-left" aria-label="Back" onClick={onBack} className="[--kol-tone-fg:var(--kol-oq-96)]" />}
30
32
  {hasMenu || onMenu ? (
31
- <button
32
- type="button"
33
- ref={hasMenu ? popover.refs.setReference : undefined}
34
- /* the popover's own press when there are rows — an `onClick={undefined}` after the spread wiped it */
35
- {...(hasMenu ? popover.getReferenceProps() : { onClick: onMenu })}
36
- aria-haspopup="menu"
37
- aria-expanded={hasMenu ? open : undefined}
38
- className="kol-float-panel text-emphasis inline-flex items-center gap-3 h-9 rounded-full bg-transparent border-0 p-0 cursor-pointer"
39
- >
40
- {name}
41
- <Icon name="chevron-down" size={16} className="text-oq-64" />
42
- </button>
33
+ /* the name ▾ is a MenuTrigger float (plan-2026-11-06-buttons-page 2.3 — it was a hand-rolled <button>): clear at
34
+ * rest on the capsule, lit while its menu is open; the popover holds the span, the pattern TopControlsBar uses */
35
+ <span ref={hasMenu ? popover.refs.setReference : undefined} {...(hasMenu ? popover.getReferenceProps() : {})} className="inline-flex">
36
+ {/* inline: the theme's menu-trigger rule sets the well at 3-class weight, a utility class cannot reach it */}
37
+ <MenuTrigger variant="float" open={hasMenu && open} iconRight="chevron-down" aria-haspopup="menu" aria-expanded={hasMenu ? open : undefined}
38
+ onClick={hasMenu ? undefined : onMenu}
39
+ style={{ '--kol-tone-bg': 'transparent', '--kol-float-px-md': 'var(--kol-spacing-2)' }}>
40
+ {name}
41
+ </MenuTrigger>
42
+ </span>
43
43
  ) : (
44
44
  <span className="kol-float-panel text-emphasis">{name}</span>
45
45
  )}
46
- {status && <span className="kol-float-label text-oq-64">{status}</span>}
46
+ {status && (
47
+ <span className="kol-float-label text-oq-64 inline-flex items-center gap-1">
48
+ {statusIcon && <Icon name={statusIcon} size={16} />}
49
+ {status}
50
+ </span>
51
+ )}
47
52
  {hasMenu && (
48
53
  <PopoverPanel popover={popover} panel={false} focus={false} className={card} style={{ minWidth: 220, maxWidth: 'calc(100vw - 24px)' }}>
49
54
  <FloatMenu beside cardClass={card} onLeaf={() => setOpen(false)}>