@kolkrabbi/kol-shell 0.134.0 → 0.135.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/ToolRail.jsx +24 -27
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolkrabbi/kol-shell",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.135.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.389.0",
|
|
16
16
|
"@kolkrabbi/kol-framework": ">=0.55.0",
|
|
17
17
|
"@kolkrabbi/kol-icons": ">=0.69.0",
|
|
18
|
-
"@kolkrabbi/kol-theme": ">=0.
|
|
18
|
+
"@kolkrabbi/kol-theme": ">=0.237.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.
|
|
25
|
-
"@kolkrabbi/kol-
|
|
26
|
-
"@kolkrabbi/kol-icons": "^0.
|
|
27
|
-
"@kolkrabbi/kol-
|
|
24
|
+
"@kolkrabbi/kol-component": "^0.391.0",
|
|
25
|
+
"@kolkrabbi/kol-framework": "^0.74.1",
|
|
26
|
+
"@kolkrabbi/kol-icons": "^0.75.0",
|
|
27
|
+
"@kolkrabbi/kol-theme": "^0.237.0"
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
|
30
30
|
"src",
|
package/src/ToolRail.jsx
CHANGED
|
@@ -98,29 +98,31 @@ function ToolMore({ items, surface, chevron = false, label = 'More tools', onPic
|
|
|
98
98
|
)
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
/* ── kolbox
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
* `
|
|
101
|
+
/* ── dock (kolbox's ToolDock, plan-2026-11-18-kolbox-system W31.2 batch 5, 2026-11-18; a plain variant since
|
|
102
|
+
* plan-2026-11-29-one-set-fold W4 run 1) ─────────────────────────────────────────────────────────────────────────────
|
|
103
|
+
* The file's ToolDock 28:9326 (plan 10.8; W19.2), carried from apps/kolbox/src/ui/ToolDock.jsx: the panel fill, radius 13,
|
|
104
|
+
* padding 8, on the one floating surface (`kol-kolbox-surface`); chrome in kol-theme `.kol-tool-rail--dock`. The tools, 8
|
|
105
|
+
* apart; a rule 1 by 24 between groups (`--kol-rail-line`); `end` a second group after a rule (kolbox's well; the design
|
|
106
|
+
* draws none, the transport fills it). ToolRail's words: `tools` [{ id, icon, label, kbd, more: [{ id, icon, label, kbd,
|
|
107
|
+
* action }] }] (kolbox's `variants`), `value` a tool's id or one of its `more` ids (the tool shows its current member's
|
|
108
|
+
* glyph), `onChange(id)`. Two more kinds in `tools`, as the real ToolPalette's: `{ divider: true }` and a one-shot
|
|
109
|
+
* `{ id, icon, label, kbd, disabled, onClick }` that is never the armed tool. A tool with `more` is ButtonSplit in its
|
|
110
|
+
* icon-only form (`iconOnly` and `onMenu`): the tool a tile, its chevron a separate 16 by 32 button 1 beside it,
|
|
111
|
+
* `onVariants(tool, element)` its press (the host opens its own menu), `variantsOpen` the id of the tool whose menu is open
|
|
112
|
+
* (its chevron keeps the quiet fill). `children` replace the tools (the transport's own cells).
|
|
112
113
|
* Under 768 the dock and its end wrap onto a second row. Sizes are Figma's dock as measured 2026-11-20 (W16.3): 48 high,
|
|
113
114
|
* padding 8, a slot 32 square, 8 between a tool's chevron and the next tool. Glyphs are your icons by the set's names at
|
|
114
|
-
*
|
|
115
|
+
* 22 in the full ink (his "bigger icons", R3.4): drawn 14 to 15, Figma's 16 to 17 inside its 24 box.
|
|
116
|
+
* ToolRailSlot is the dock's slot, one look: chrome in kol-theme `.kol-tool-slot`. */
|
|
115
117
|
export function ToolRailSlot({ icon, label, kbd, active = false, lit = false, className = '', ...rest }) {
|
|
116
118
|
return (
|
|
117
|
-
<Tooltip
|
|
119
|
+
<Tooltip label={kbd ? <>{label}<KbdKeys size="sm" keys={kbd} className="ml-2" /></> : label}>
|
|
118
120
|
<button
|
|
119
121
|
type="button"
|
|
120
122
|
aria-label={label}
|
|
121
123
|
aria-pressed={active || lit}
|
|
122
124
|
data-dock-cell
|
|
123
|
-
className={`kol-tool-slot
|
|
125
|
+
className={`kol-tool-slot${active ? ' is-active' : lit ? ' is-lit' : ''} inline-flex size-8 shrink-0 items-center justify-center outline-none focus-visible:outline-solid focus-visible:outline-1 ${active || lit ? '' : 'disabled:opacity-40'} ${className}`.trim()}
|
|
124
126
|
{...rest}
|
|
125
127
|
>
|
|
126
128
|
<IconLoader name={icon} size={22} className="kol-kolbox-icon shrink-0" />
|
|
@@ -129,10 +131,10 @@ export function ToolRailSlot({ icon, label, kbd, active = false, lit = false, cl
|
|
|
129
131
|
)
|
|
130
132
|
}
|
|
131
133
|
|
|
132
|
-
function
|
|
134
|
+
function ToolRailDock({ tools = [], value, onChange, onVariants, variantsOpen, end, children, className = '' }) {
|
|
133
135
|
const rule = (key) => <span key={key} className="kol-tool-rail-rule h-6 w-px shrink-0" />
|
|
134
136
|
return (
|
|
135
|
-
<div data-kol-dock className={`kol-tool-rail--
|
|
137
|
+
<div data-kol-dock className={`kol-tool-rail--dock kol-kolbox-surface inline-flex items-center gap-2 p-2 max-md:max-w-full max-md:flex-wrap max-md:justify-center ${className}`.trim()}>
|
|
136
138
|
<div className="flex items-center gap-2">
|
|
137
139
|
{children ??
|
|
138
140
|
tools.map((t, i) => {
|
|
@@ -146,8 +148,8 @@ function ToolRailKolbox({ tools = [], value, onChange, onVariants, variantsOpen,
|
|
|
146
148
|
const arm = () => onChange?.(current?.id ?? t.id)
|
|
147
149
|
if (!t.more?.length) return <ToolRailSlot key={t.id} icon={icon} label={label} kbd={kbd} active={active} onClick={arm} />
|
|
148
150
|
return (
|
|
149
|
-
<ButtonSplit key={t.id}
|
|
150
|
-
tooltip={kbd ? <>{label}<KbdKeys
|
|
151
|
+
<ButtonSplit key={t.id} iconOnly={icon} aria-label={label} pressed={active} onClick={arm}
|
|
152
|
+
tooltip={kbd ? <>{label}<KbdKeys size="sm" keys={kbd} className="ml-2" /></> : label}
|
|
151
153
|
menuLabel={`${t.label} variants`} menuOpen={variantsOpen === t.id} onMenu={(e) => onVariants?.(t, e.currentTarget)} />
|
|
152
154
|
)
|
|
153
155
|
})}
|
|
@@ -162,15 +164,10 @@ function ToolRailKolbox({ tools = [], value, onChange, onVariants, variantsOpen,
|
|
|
162
164
|
)
|
|
163
165
|
}
|
|
164
166
|
|
|
165
|
-
/*
|
|
166
|
-
*
|
|
167
|
-
|
|
168
|
-
* tools are the format's own, as `children` (kolbox's word for cells in the dock's place). */
|
|
169
|
-
function ToolRailFolio({ children, className = '' }) {
|
|
170
|
-
return <div className={`kol-tool-rail--folio flex h-[56px] shrink-0 items-center gap-[8px] overflow-x-auto border-b px-[56px] [scrollbar-width:none] ${className}`.trim()}>{children}</div>
|
|
171
|
-
}
|
|
167
|
+
/* the old theme words: accepted, they draw `dock` (W4 run 1, on the retirement ledger). Folio's toolbar row went to
|
|
168
|
+
* `_tmp/2026-11-29-one-set-fold/ToolRail.pre-w4a.jsx`; apps/folio draws its row itself. */
|
|
169
|
+
const THEME_WORDS = ['kolbox', 'folio']
|
|
172
170
|
|
|
173
171
|
export default function ToolRail(props) {
|
|
174
|
-
|
|
175
|
-
return props.variant === 'kolbox' ? <ToolRailKolbox {...props} /> : <ToolRailDefault {...props} />
|
|
172
|
+
return props.variant === 'dock' || THEME_WORDS.includes(props.variant) ? <ToolRailDock {...props} /> : <ToolRailDefault {...props} />
|
|
176
173
|
}
|