@kolkrabbi/kol-shell 0.114.0 → 0.116.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 +6 -6
- package/src/DocumentCapsule.jsx +12 -14
- package/src/MoreSheet.jsx +4 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolkrabbi/kol-shell",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.116.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The application shell",
|
|
6
6
|
"license": "MIT",
|
|
@@ -12,19 +12,19 @@
|
|
|
12
12
|
"./src/*": "./src/*"
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@kolkrabbi/kol-component": ">=0.
|
|
15
|
+
"@kolkrabbi/kol-component": ">=0.349.0",
|
|
16
16
|
"@kolkrabbi/kol-framework": ">=0.55.0",
|
|
17
17
|
"@kolkrabbi/kol-icons": ">=0.16.0",
|
|
18
|
-
"@kolkrabbi/kol-theme": ">=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.349.0",
|
|
25
|
+
"@kolkrabbi/kol-framework": "^0.70.0",
|
|
24
26
|
"@kolkrabbi/kol-icons": "^0.66.0",
|
|
25
|
-
"@kolkrabbi/kol-
|
|
26
|
-
"@kolkrabbi/kol-theme": "^0.214.0",
|
|
27
|
-
"@kolkrabbi/kol-framework": "^0.70.0"
|
|
27
|
+
"@kolkrabbi/kol-theme": "^0.216.1"
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
|
30
30
|
"src",
|
package/src/DocumentCapsule.jsx
CHANGED
|
@@ -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
|
|
@@ -30,18 +30,16 @@ export default function DocumentCapsule({ name, status, statusIcon, onBack, menu
|
|
|
30
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()}>
|
|
31
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)]" />}
|
|
32
32
|
{hasMenu || onMenu ? (
|
|
33
|
-
<button
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
/* the
|
|
37
|
-
{
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
<Icon name="chevron-down" size={16} className="text-oq-64" />
|
|
44
|
-
</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>
|
|
45
43
|
) : (
|
|
46
44
|
<span className="kol-float-panel text-emphasis">{name}</span>
|
|
47
45
|
)}
|
package/src/MoreSheet.jsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createContext, useContext, useEffect, useRef, useState } from 'react'
|
|
2
|
-
import {
|
|
2
|
+
import { Button, ModalHeader, usePopover, PopoverPanel } from '@kolkrabbi/kol-component'
|
|
3
3
|
import { Icon } from '@kolkrabbi/kol-icons'
|
|
4
4
|
|
|
5
5
|
/* the open level a row sits in (FloatMenu); null outside one, where a row's `sub` is ignored as before */
|
|
@@ -38,13 +38,14 @@ export default function MoreRows({ actions = [], items = [], active, onPick, ite
|
|
|
38
38
|
{actions.map((a) => {
|
|
39
39
|
/* a row with `sub` inside a FloatMenu opens its level instead of picking — the chevron at the row's end */
|
|
40
40
|
const nests = level && a.sub?.length > 0
|
|
41
|
+
/* the account row is the ModalHeader (menu-system W4.1) — avatar · title, pressable */
|
|
42
|
+
if (a.avatar && !nests) return <ModalHeader key={a.label} variant={float ? 'float' : 'default'} avatar={a.avatar} title={a.label} onClick={() => { onPick?.(a); a.onPress?.() }} />
|
|
41
43
|
return (
|
|
42
44
|
/* a nesting row draws its own glyph so the label can take the room between it and the chevron; 8 apart, as Button's */
|
|
43
|
-
<Button key={a.label} variant="nav" size="lg" iconLeft={a.checked === undefined && !
|
|
45
|
+
<Button key={a.label} variant="nav" size="lg" iconLeft={a.checked === undefined && !nests ? a.icon : undefined} iconSize={glyph}
|
|
44
46
|
className={rowCls} style={nests ? { gap: 8 } : undefined}
|
|
45
47
|
aria-haspopup={nests ? 'menu' : undefined} aria-expanded={nests ? level.isOpen(a) : undefined}
|
|
46
48
|
onClick={(e) => { if (nests) { level.open(a, e.currentTarget); return } onPick?.(a); a.onPress?.() }}>
|
|
47
|
-
{a.avatar && <Avatar src={a.avatar} alt="" size="xs" />}
|
|
48
49
|
{a.checked !== undefined && (
|
|
49
50
|
<span className="inline-flex items-center justify-center shrink-0" style={{ width: float ? 'var(--kol-float-ic)' : 22, height: float ? 'var(--kol-float-ic)' : 22 }}>{a.checked && <Icon name="check" size={22} />}</span>
|
|
50
51
|
)}
|