@kolkrabbi/kol-component 0.387.0 → 0.389.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 +1 -1
- package/src/index.js +1 -1
- package/src/molecules/AccountMenu.jsx +11 -6
- package/src/molecules/AlignmentGrid.jsx +5 -5
- package/src/molecules/ButtonGroup.jsx +30 -48
- package/src/molecules/ButtonSplit.jsx +66 -66
- package/src/molecules/ContextMenu.jsx +1 -1
- package/src/molecules/Dropdown.jsx +24 -56
- package/src/molecules/Menu.jsx +190 -255
- package/src/molecules/MenuItem.jsx +45 -12
- package/src/molecules/MenuList.jsx +48 -17
- package/src/molecules/ParamBindDot.jsx +8 -24
- package/src/molecules/TabsDocument.jsx +42 -66
- package/src/molecules/TabsRow.jsx +19 -12
- package/src/organisms/FindBar.jsx +18 -32
- package/src/utilities/Popover.jsx +8 -4
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { useLayoutEffect, useRef, useState } from 'react'
|
|
2
2
|
import { IconLoader } from '@kolkrabbi/kol-icons'
|
|
3
3
|
import { Menu } from './Menu.jsx'
|
|
4
|
-
import Kbd from '../atoms/Kbd.jsx'
|
|
5
4
|
import Divider from '../atoms/Divider.jsx'
|
|
6
5
|
import { indicatorSize } from '../hooks/glyphLadders.js'
|
|
7
6
|
|
|
@@ -125,47 +124,81 @@ const ROW_BY_SIZE = { xs: 'kol-mono-8 px-2 h-5', sm: 'kol-helper-12 px-2 h-8', m
|
|
|
125
124
|
* row still fills a fixed panel through `w-full` and lets a content-sized one hug its longest label. */
|
|
126
125
|
const INDICATOR = { dot: 'ascii-dot', check: 'check', chevron: 'chevron-right' }
|
|
127
126
|
|
|
128
|
-
|
|
127
|
+
/* ONE ROW, ITS LOOK THE THEME'S (plan-2026-11-29-one-set-fold W3): kolbox's row keys are MenuRow's too.
|
|
128
|
+
* check true | false: a check mark, `menuitemcheckbox`. Where it sits is the theme's (`.kol-menu-check`): after the
|
|
129
|
+
* label in the default theme, the leading column in the kolbox theme. `lead` (the list's: a row in it has a
|
|
130
|
+
* check) keeps the column on every row, empty where the row is not checked.
|
|
131
|
+
* tag a small mono chip after the shortcut (`.kol-menu-tag`)
|
|
132
|
+
* flyout the row opens a child menu: no pick, `aria-haspopup`, `expanded` while it is open, the chevron last
|
|
133
|
+
* chosen the chosen row (`data-chosen`): where the keys start, what a list laid over its field puts on the field
|
|
134
|
+
* rowRef · onPointerMove for the list that holds it (MenuList's flyouts)
|
|
135
|
+
* The lit row (the pointer's or the keys') is `data-active`, set by the Menu that holds it, never by React. */
|
|
136
|
+
export function MenuRow({ href, onClick, onPointerEnter, onPointerLeave, onPointerMove, disabled, prefix, iconLeft, indicator, kbd, shortcut, hover = true, height, size = 'sm', rowClass, tone, accent, check, lead = false, tag, flyout = false, expanded, chosen, rowRef, children }) {
|
|
129
137
|
/* `href` makes the row a real link — cmd/ctrl-click and middle-click open a new tab (DocumentHeader, 2026-10-31);
|
|
130
138
|
* a plain click still runs `onClick` (the app's router), which may preventDefault */
|
|
131
139
|
const Row = href && !disabled ? 'a' : 'button'
|
|
140
|
+
const caps = kbd != null || typeof shortcut === 'string'
|
|
132
141
|
return (
|
|
133
142
|
<Row
|
|
143
|
+
ref={rowRef}
|
|
134
144
|
{...(Row === 'a' ? { href, onClick: (e) => { if (e.metaKey || e.ctrlKey || e.shiftKey || e.button === 1) return; onClick?.(e) } } : { type: 'button', onClick })}
|
|
135
|
-
data-menu-item
|
|
145
|
+
/* a flyout row only opens its child: the menu closes on a click from `[data-menu-item]`, never on this one */
|
|
146
|
+
data-menu-item={flyout ? undefined : ''}
|
|
147
|
+
data-menu-row=""
|
|
148
|
+
data-chosen={chosen || undefined}
|
|
136
149
|
data-accent={accent === 'secondary' ? accent : undefined}
|
|
137
150
|
onPointerEnter={onPointerEnter}
|
|
138
151
|
onPointerLeave={onPointerLeave}
|
|
152
|
+
onPointerMove={onPointerMove}
|
|
139
153
|
disabled={Row === 'button' ? disabled : undefined}
|
|
140
|
-
role=
|
|
154
|
+
role={check === undefined ? 'menuitem' : 'menuitemcheckbox'}
|
|
155
|
+
aria-checked={check === undefined ? undefined : !!check}
|
|
156
|
+
aria-haspopup={flyout ? 'menu' : undefined}
|
|
157
|
+
aria-expanded={flyout ? !!expanded : undefined}
|
|
141
158
|
style={height != null ? { height } : undefined}
|
|
142
|
-
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' : ''} ${tone === 'danger' ? 'kol-menu-row--danger' : ''} disabled:opacity-
|
|
159
|
+
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' : ''} ${tone === 'danger' ? 'kol-menu-row--danger' : ''} disabled:opacity-[var(--kol-menu-row-disabled-opacity,0.4)] disabled:cursor-not-allowed text-left`.replace(/\s+/g, ' ')}
|
|
143
160
|
>
|
|
144
161
|
{prefix && <span className="shrink-0 inline-flex items-center">{prefix}</span>}
|
|
145
|
-
{iconLeft && <span className="shrink-0 w-4 inline-flex items-center justify-center">{iconLeft}</span>}
|
|
162
|
+
{iconLeft && <span className="kol-menu-lead-icon shrink-0 w-4 inline-flex items-center justify-center">{iconLeft}</span>}
|
|
146
163
|
{/* leading-normal: kol-helper-12 is line-height 1, and truncate's
|
|
147
164
|
* overflow clip cuts mono descenders on a 1-em line box ("Show grid"
|
|
148
165
|
* loses its g). The h-8 centered row absorbs the taller line box —
|
|
149
166
|
* zero layout shift (MenuItemDescenderClip, 2026-08-12). */}
|
|
150
167
|
<span className="flex-1 truncate leading-normal">{children}</span>
|
|
151
|
-
{
|
|
168
|
+
{lead && <span className="kol-menu-check">{check ? <IconLoader name="check" size={size === 'xs' ? indicatorSize('xs') : 14} /> : null}</span>}
|
|
169
|
+
{(indicator || caps || (shortcut && typeof shortcut !== 'string')) && (
|
|
152
170
|
<span className="shrink-0 inline-flex items-center gap-2 text-oq-88">
|
|
153
171
|
{/* the dot is kol-icons `ascii-dot` drawn at twice the slot and pulled back into it: at the slot's own size its
|
|
154
172
|
* 2.25/24 circle is a 2.6px speck; at 24 it is the rail's • (≈4.5px) and still takes the check's 14px column */}
|
|
155
173
|
{indicator === 'dot'
|
|
156
174
|
? <IconLoader name="ascii-dot" size={size === 'xs' ? 16 : 24} style={{ margin: size === 'xs' ? -4 : -5 }} />
|
|
157
175
|
: indicator && <IconLoader name={INDICATOR[indicator] ?? indicator} size={size === 'xs' ? indicatorSize('xs') : 14} />}
|
|
158
|
-
{
|
|
159
|
-
{
|
|
160
|
-
? <Kbd size="md" icon="command" className="kol-menu-kbd">{kbd.slice(1)}</Kbd>
|
|
161
|
-
: <Kbd size="md" className="kol-menu-kbd">{kbd}</Kbd>)}
|
|
162
|
-
{typeof shortcut === 'string' ? <Kbd size="md" className="kol-menu-kbd">{shortcut}</Kbd> : shortcut}
|
|
176
|
+
{kbd != null && <MenuKbd keys={kbd} />}
|
|
177
|
+
{typeof shortcut === 'string' ? <MenuKbd keys={shortcut} plain /> : shortcut}
|
|
163
178
|
</span>
|
|
164
179
|
)}
|
|
180
|
+
{tag && <span className="kol-menu-tag shrink-0 px-1">{tag}</span>}
|
|
181
|
+
{flyout && <IconLoader name="chevron-right" size={10} className="kol-menu-chevron text-emphasis shrink-0" />}
|
|
165
182
|
</Row>
|
|
166
183
|
)
|
|
167
184
|
}
|
|
168
185
|
|
|
186
|
+
/* a row's key cap: the Kbd's plate and type (`.kol-kbd .kol-kbd-md`), its box in `.kol-menu-kbd` so the theme can draw
|
|
187
|
+
* it as plain text (kolbox: the muted ink, no plate, as Figma's menus). ⌘ is drawn, never typed — the Kbd's `command`
|
|
188
|
+
* glyph (W2 row 27, 2026-11-04) — and kolbox writes it as text: both are here, the theme shows one. `plain`: no ⌘ glyph
|
|
189
|
+
* (the old free `shortcut` string was a cap as written). */
|
|
190
|
+
function MenuKbd({ keys, plain = false }) {
|
|
191
|
+
const s = keys
|
|
192
|
+
const cmd = !plain && typeof s === 'string' && s.startsWith('⌘')
|
|
193
|
+
return (
|
|
194
|
+
<kbd aria-hidden="true" className="kol-kbd kol-kbd-md kol-menu-kbd">
|
|
195
|
+
{cmd && <span className="kol-menu-kbd-glyph"><IconLoader name="command" size={12} className="kol-kbd-icon shrink-0" /></span>}
|
|
196
|
+
{cmd && <span className="kol-menu-kbd-char">⌘</span>}
|
|
197
|
+
{cmd ? s.slice(1) : s}
|
|
198
|
+
</kbd>
|
|
199
|
+
)
|
|
200
|
+
}
|
|
201
|
+
|
|
169
202
|
/* `className` — the rule's spacing, whole (MetricDashboardUpstream, kol-website 2026-10-31); `kol-menu-rule` is the
|
|
170
203
|
* panel's edge-to-edge rule, its ink set by the panel (oq-16, float oq-08). */
|
|
171
204
|
/* MenuDivider — a rule between a menu's groups: the Divider atom on the oq ramp, oq-08 (plan-2026-11-07-menu-system
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useState } from 'react'
|
|
2
2
|
import { IconLoader } from '@kolkrabbi/kol-icons'
|
|
3
3
|
import SearchInput from './SearchInput.jsx'
|
|
4
|
-
import { MenuRow, MenuDivider
|
|
4
|
+
import { MenuRow, MenuDivider } from './MenuItem.jsx'
|
|
5
|
+
import { Menu } from './Menu.jsx'
|
|
5
6
|
import { Tooltip } from '../utilities/Popover.jsx'
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -16,30 +17,43 @@ import { Tooltip } from '../utilities/Popover.jsx'
|
|
|
16
17
|
* ]} />
|
|
17
18
|
*
|
|
18
19
|
* items rows as data — the row keys `Menu` documents: `label` · `icon` · `trailing` (+ `trailingSize`) · `current`
|
|
19
|
-
* · `indicator` 'dot' | 'check' | 'chevron' · `checked`
|
|
20
|
-
* · `
|
|
21
|
-
* · `
|
|
20
|
+
* · `indicator` 'dot' | 'check' | 'chevron' · `checked` (or `check`) · `kbd` · `tag` · `inset`
|
|
21
|
+
* · `highlighted` · `disabled` + `tooltip` · `tone: 'danger'` · `href` · `onClick` · `items` (a flyout) · `key`.
|
|
22
|
+
* A row may also carry MenuRow's own `rowClass` · `hover` · `size` · `height` · `prefix` · `onPointerEnter` /
|
|
23
|
+
* `onPointerLeave` (Dropdown's rows do).
|
|
22
24
|
* search `{ placeholder, empty }` — a search field above the rows that filters them by label
|
|
25
|
+
* onSelect `(row)` on a pick, before the row's own `onClick` (Menu passes its own; a flyout's pick is its parent's)
|
|
23
26
|
* children sit above the rows (under the search)
|
|
24
27
|
* dividerClassName the rule's class, whole (default `kol-menu-rule` — the panel's edge-to-edge rule)
|
|
25
28
|
* headingClassName the heading's class, whole (default the MenuLabel's)
|
|
29
|
+
*
|
|
30
|
+
* ONE LIST (plan-2026-11-29-one-set-fold W3): kolbox's rows are these rows. A flyout is a child `Menu` beside the panel,
|
|
31
|
+
* opened by the pointer moving on its row, a click, ArrowRight or Enter, closed by the pointer moving on another row,
|
|
32
|
+
* ArrowLeft or Escape in it; where it stands is the theme's (`--kol-menu-flyout-*`).
|
|
26
33
|
*/
|
|
27
34
|
|
|
28
35
|
export const MenuLabel = ({ className = 'kol-menu-label kol-helper-12', children }) => <div className={className}>{children}</div>
|
|
29
36
|
|
|
30
37
|
const glyph = (icon, size) => (typeof icon === 'string' ? <IconLoader name={icon} size={size} /> : icon)
|
|
31
|
-
/* a row's trailing marks — real icons and Kbd only (W2): `indicator` 'dot' | 'check' | 'chevron', `
|
|
32
|
-
* `
|
|
33
|
-
const
|
|
38
|
+
/* a row's trailing marks — real icons and Kbd only (W2): `indicator` 'dot' | 'check' | 'chevron', `kbd` a key cap,
|
|
39
|
+
* `trailing` an icon name for an action (download). `checked` is the check (MenuRow's `check`). */
|
|
40
|
+
const checkOf = (it) => it.check ?? it.checked
|
|
41
|
+
const focusPanel = (el) => el?.closest('[data-menu-panel]')?.focus({ preventScroll: true })
|
|
34
42
|
|
|
35
|
-
export function MenuList({ items = [], search, dividerClassName = 'kol-menu-rule', headingClassName, children }) {
|
|
43
|
+
export function MenuList({ items = [], search, onSelect, dividerClassName = 'kol-menu-rule', headingClassName, children }) {
|
|
36
44
|
const [q, setQ] = useState('')
|
|
45
|
+
const [flyout, setFlyout] = useState(null)
|
|
46
|
+
const [rowEl, setRowEl] = useState(null)
|
|
37
47
|
let rows = items
|
|
38
48
|
if (search) {
|
|
39
49
|
const s = q.toLowerCase()
|
|
40
50
|
rows = rows.filter((it) => it.label == null || String(it.label).toLowerCase().includes(s))
|
|
41
51
|
if (!rows.some((it) => it.label != null)) rows = [...rows, { key: 'empty', label: search.empty || 'Nothing matches', disabled: true }]
|
|
42
52
|
}
|
|
53
|
+
/* the check column is the list's: kept on every row once one row can be checked */
|
|
54
|
+
const lead = items.some((it) => !it.divider && !it.heading && checkOf(it) !== undefined)
|
|
55
|
+
/* a pointer on another row closes the open child and gives the keys back to this panel */
|
|
56
|
+
const shut = (el) => { if (flyout !== null) { setFlyout(null); focusPanel(el) } }
|
|
43
57
|
return (
|
|
44
58
|
<>
|
|
45
59
|
{search && <div className="pb-1"><SearchInput variant="outline" size="sm" value={q} onChange={(e) => setQ(e.target?.value ?? e)} onClear={() => setQ('')} placeholder={search.placeholder || 'Search'} /></div>}
|
|
@@ -47,21 +61,38 @@ export function MenuList({ items = [], search, dividerClassName = 'kol-menu-rule
|
|
|
47
61
|
{rows.map((it, i) => {
|
|
48
62
|
if (it.divider) return <MenuDivider key={it.key ?? `d${i}`} className={dividerClassName} />
|
|
49
63
|
if (it.heading) return <MenuLabel key={it.key ?? `h${i}`} className={headingClassName}>{it.heading}</MenuLabel>
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
64
|
+
const key = it.key ?? `r${i}`
|
|
65
|
+
const icon = it.icon ? <span className="kol-menu-icon inline-flex">{glyph(it.icon, 16)}</span> : it.inset ? <span className="size-4" /> : null
|
|
66
|
+
/* `kol-menu-row--kolbox` rides along as a hook for kol-fxr's own rules (on the retirement ledger) */
|
|
67
|
+
const cls = it.rowClass ?? `kol-menu-row kol-menu-row--kolbox kol-helper-12${it.current ? ' kol-menu-row--current' : ''}${it.tone === 'danger' ? ' kol-menu-row--danger' : ''}`
|
|
68
|
+
const common = {
|
|
69
|
+
rowClass: cls, iconLeft: icon, prefix: it.prefix, disabled: it.disabled, check: checkOf(it), lead, tag: it.tag,
|
|
70
|
+
chosen: it.highlighted, hover: it.hover, size: it.size, height: it.height, kbd: it.kbd,
|
|
71
|
+
}
|
|
72
|
+
const opens = it.items?.length && !it.disabled
|
|
73
|
+
const open = opens && flyout === key
|
|
74
|
+
const row = opens ? (
|
|
75
|
+
<>
|
|
76
|
+
<MenuRow {...common} flyout expanded={open} rowRef={open ? setRowEl : undefined}
|
|
77
|
+
onPointerMove={(e) => { if (flyout !== key) { if (flyout !== null) focusPanel(e.currentTarget); setRowEl(e.currentTarget); setFlyout(key) } }}
|
|
78
|
+
onClick={(e) => { setRowEl(e.currentTarget); setFlyout(open ? null : key) }}>
|
|
79
|
+
{it.label}
|
|
80
|
+
</MenuRow>
|
|
81
|
+
{open && rowEl && (
|
|
82
|
+
<Menu nested anchor={rowEl} open placement="flyout" aria-label={typeof it.label === 'string' ? it.label : undefined}
|
|
83
|
+
items={it.items} onSelect={onSelect} panelClassName="kol-menu-flyout"
|
|
84
|
+
onClose={() => { setFlyout(null); focusPanel(rowEl) }} />
|
|
85
|
+
)}
|
|
86
|
+
</>
|
|
56
87
|
) : (
|
|
57
|
-
<MenuRow
|
|
58
|
-
|
|
88
|
+
<MenuRow {...common} href={it.href} indicator={it.indicator}
|
|
89
|
+
onClick={onSelect ? (e) => { onSelect(it.row ?? it); it.onClick?.(e) } : it.onClick}
|
|
59
90
|
onPointerEnter={it.onPointerEnter} onPointerLeave={it.onPointerLeave}
|
|
91
|
+
onPointerMove={flyout !== null ? (e) => shut(e.currentTarget) : undefined}
|
|
60
92
|
shortcut={it.shortcut ?? (it.trailing ? <span className="text-oq-88 inline-flex">{glyph(it.trailing, it.trailingSize ?? 14)}</span> : undefined)}>
|
|
61
93
|
{it.label}
|
|
62
94
|
</MenuRow>
|
|
63
95
|
)
|
|
64
|
-
const key = it.key ?? `r${i}`
|
|
65
96
|
return it.tooltip
|
|
66
97
|
? <Tooltip key={key} label={it.tooltip} placement="left" triggerClassName="block w-full">{row}</Tooltip>
|
|
67
98
|
: <div key={key}>{row}</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { forwardRef
|
|
1
|
+
import { forwardRef } from 'react'
|
|
2
2
|
import { Menu } from './Menu.jsx'
|
|
3
3
|
import { Tooltip } from '../utilities/Popover.jsx'
|
|
4
4
|
|
|
@@ -37,13 +37,14 @@ import { Tooltip } from '../utilities/Popover.jsx'
|
|
|
37
37
|
* `--kol-bind-*` (kol-theme `.kol-param-bind-dot`), the default theme leaving them unset (the rung's box and dot, a 1.5
|
|
38
38
|
* ring in oq-48, oq-80 on hover and open, the quiet focus line) and `data-theme-variant="kolbox"` setting kolbox's (a 6
|
|
39
39
|
* dot in a round 16 box at every rung, a 1px ring in oq-64, the accent focus line). The menu is the one `Menu` with
|
|
40
|
-
* `items` (kolbox's `{ label, checked, onClick }` rows are Menu rows
|
|
41
|
-
* Menu
|
|
40
|
+
* `items` (kolbox's `{ label, checked, onClick }` rows are Menu rows; the kolbox theme draws them as kolbox's menu). The
|
|
41
|
+
* kolbox Menu bridge left with the Menu fold (W3): `variant="kolbox"` and `"folio"` are accepted, open the one Menu and
|
|
42
|
+
* keep kolbox's place for it, under the dot from its left edge (`align` unset reads `start`). The bridge is in
|
|
43
|
+
* `_tmp/2026-11-29-one-set-fold/ParamBindDot.pre-menu.jsx`.
|
|
42
44
|
*/
|
|
43
45
|
const THEME_WORDS = ['kolbox', 'folio']
|
|
44
|
-
export default function ParamBindDot({ variant, ...props }) {
|
|
45
|
-
|
|
46
|
-
return THEME_WORDS.includes(variant) ? <ParamBindDotMenuBridge {...props} /> : <ParamBindDotMenu {...props} />
|
|
46
|
+
export default function ParamBindDot({ variant, align, ...props }) {
|
|
47
|
+
return <ParamBindDotMenu {...props} align={align ?? (THEME_WORDS.includes(variant) ? 'start' : 'end')} />
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
/* the dot itself, the same button for both menus */
|
|
@@ -62,23 +63,6 @@ const Dot = forwardRef(function Dot({ bound, className = '', size = 'sm', accent
|
|
|
62
63
|
)
|
|
63
64
|
})
|
|
64
65
|
|
|
65
|
-
/* the kolbox Menu bridge, as the pre-fields3 kolbox build wired it: "Modulate" (or `tooltip`), Menu kolbox beside the dot,
|
|
66
|
-
`items` ({ label, checked, onClick }) as one group */
|
|
67
|
-
function ParamBindDotMenuBridge({ bound = false, items = [], label, tooltip, size, minWidth = 180, className, accent }) {
|
|
68
|
-
const ref = useRef(null)
|
|
69
|
-
const [open, setOpen] = useState(false)
|
|
70
|
-
return (
|
|
71
|
-
<>
|
|
72
|
-
<Tooltip label={tooltip ?? 'Modulate'}>
|
|
73
|
-
<Dot ref={ref} bound={bound} size={size} className={className} accent={accent} open={open} data-bind-dot
|
|
74
|
-
aria-label={`Modulate${label ? ` ${label}` : ''}`} aria-haspopup="menu" aria-expanded={open} onClick={() => setOpen((o) => !o)} />
|
|
75
|
-
</Tooltip>
|
|
76
|
-
<Menu variant="kolbox" accent={accent} aria-label="Modulate" anchor={ref} open={open} onClose={() => setOpen(false)} minWidth={minWidth}
|
|
77
|
-
groups={[items.map((it, i) => ({ label: it.label, value: i, check: !!it.checked }))]} onSelect={(r) => items[r.value]?.onClick?.()} />
|
|
78
|
-
</>
|
|
79
|
-
)
|
|
80
|
-
}
|
|
81
|
-
|
|
82
66
|
function ParamBindDotMenu({
|
|
83
67
|
bound = false,
|
|
84
68
|
mode,
|
|
@@ -96,7 +80,7 @@ function ParamBindDotMenu({
|
|
|
96
80
|
return (
|
|
97
81
|
<Menu align={align} minWidth={minWidth} items={items} trigger={({ open, props }) => (
|
|
98
82
|
<Tooltip label={open ? null : tip}>
|
|
99
|
-
<Dot aria-label={name} bound={bound} size={size} className={className} accent={accent} open={open} {...props} />
|
|
83
|
+
<Dot data-bind-dot aria-label={name} bound={bound} size={size} className={className} accent={accent} open={open} {...props} />
|
|
100
84
|
</Tooltip>
|
|
101
85
|
)} />
|
|
102
86
|
)
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { IconLoader } from '@kolkrabbi/kol-icons'
|
|
2
1
|
import Button from '../atoms/Button.jsx'
|
|
3
2
|
import KolboxGlyph from '../utilities/kolboxGlyph.jsx'
|
|
4
3
|
|
|
@@ -12,23 +11,24 @@ import KolboxGlyph from '../utilities/kolboxGlyph.jsx'
|
|
|
12
11
|
* A tablist of tabs: arrow keys, Home and End move between the tabs (Enter or Space opens one); each tab's close button
|
|
13
12
|
* is in the Tab order, named "Close <name>".
|
|
14
13
|
*
|
|
15
|
-
* <TabsDocument
|
|
14
|
+
* <TabsDocument tabs={[{ value: '/a', label: 'notes.md', icon: 'file-md', dirty: true }]}
|
|
16
15
|
* value="/a" onChange={open} onClose={close} onNew={create} />
|
|
17
16
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
17
|
+
* ONE STRIP (plan-2026-11-29-one-set-fold W3 run 2): a 40 strip on the strip's ground with its line under it, tabs in the UI
|
|
18
|
+
* text, the current one on the active wash, the others flat in oq-64; the glyph 16, the close an icon Button; an unsaved
|
|
19
|
+
* tab shows a dot in the close's place until hovered. Its look is `--kol-doctabs-*` (kol-theme `.kol-tabs-document`): the
|
|
20
|
+
* default theme draws the secondary surface, kolbox the panel ground, the field line and wash (light: the top rail's track
|
|
21
|
+
* pair, canvas strip and ground tab).
|
|
22
|
+
* @param {'kolbox'|'folio'} [variant] - accepted and nothing (on the retirement ledger). Folio's own strip (44 high, 56 in,
|
|
23
|
+
* a text "New", the green chain line) went to `_tmp/2026-11-29-one-set-fold/TabsDocument.pre-w3b.jsx`
|
|
23
24
|
* @param {Array<{ value: string, label: string, icon?: string, dirty?: boolean }>} tabs - The open documents, in order.
|
|
24
|
-
* `icon` is the document kind's glyph by your icons' name (
|
|
25
|
+
* `icon` is the document kind's glyph by your icons' name (`file` when unset); `dirty` shows the unsaved dot
|
|
25
26
|
* @param {string} [value] - The current tab's value
|
|
26
27
|
* @param {(value: string) => void} [onChange] - A tab pressed (the current one included, as Folio's tab button is)
|
|
27
28
|
* @param {(value: string) => void} [onClose] - A tab's close pressed; no close button without it
|
|
28
29
|
* @param {() => void} [onNew] - The plus after the last tab; none without it
|
|
29
|
-
* @param {string} [newLabel='New'] - The plus's name
|
|
30
|
-
* @param {string} [paired] - The tab open beside the current one (a split): drawn on the current ground
|
|
31
|
-
* with its green line
|
|
30
|
+
* @param {string} [newLabel='New'] - The plus's name
|
|
31
|
+
* @param {string} [paired] - The tab open beside the current one (a split): drawn on the current ground
|
|
32
32
|
* @param {(value: string) => void} [onOpenBeside] - A tab's "Open beside" button (shown on hover, not on the current or the
|
|
33
33
|
* paired tab); none without it
|
|
34
34
|
* @param {() => void} [onCloseSplit] - With `paired`, a "Close split" button after the tabs
|
|
@@ -39,10 +39,10 @@ import KolboxGlyph from '../utilities/kolboxGlyph.jsx'
|
|
|
39
39
|
* @param {string} [className] - Extra classes on the strip
|
|
40
40
|
*/
|
|
41
41
|
export default function TabsDocument({
|
|
42
|
-
variant
|
|
42
|
+
variant, // eslint-disable-line no-unused-vars
|
|
43
|
+
tabs = [], value, onChange, onClose, onNew, newLabel = 'New', paired,
|
|
43
44
|
onOpenBeside, onCloseSplit, onTabContextMenu, onTabDragStart, ariaLabel = 'Open documents', className = '', accent,
|
|
44
45
|
}) {
|
|
45
|
-
const kolbox = variant === 'kolbox'
|
|
46
46
|
const focusable = tabs.some((t) => t.value === value) ? value : tabs[0]?.value
|
|
47
47
|
/* arrows, Home and End move the focus between the tabs; the host opens one on Enter or Space (the tab is a button) */
|
|
48
48
|
const onKeyDown = (e) => {
|
|
@@ -64,68 +64,44 @@ export default function TabsDocument({
|
|
|
64
64
|
onClick: () => onChange?.(t.value),
|
|
65
65
|
})
|
|
66
66
|
|
|
67
|
-
if (kolbox) {
|
|
68
|
-
return (
|
|
69
|
-
<div data-accent={accent === 'secondary' ? accent : undefined} role="tablist" aria-label={ariaLabel} onKeyDown={onKeyDown}
|
|
70
|
-
className={`kol-tabs-document--kolbox relative flex h-10 shrink-0 items-stretch overflow-x-auto [scrollbar-width:none] after:pointer-events-none after:absolute after:inset-x-0 after:bottom-0 after:h-px after:content-[''] ${className}`.trim()}>
|
|
71
|
-
{tabs.map((t) => {
|
|
72
|
-
const on = t.value === value
|
|
73
|
-
const lit = on || t.value === paired
|
|
74
|
-
const closeShown = on && !t.dirty
|
|
75
|
-
return (
|
|
76
|
-
<div key={t.value} role="presentation" {...cell(t)}
|
|
77
|
-
className={`kol-tabs-document-tab${lit ? ' is-active' : ''} group relative flex shrink-0 items-center gap-1 pr-2 pl-3`}>
|
|
78
|
-
<button {...tabProps(t)} className="kol-tabs-document-label flex min-w-0 items-center gap-2 self-stretch outline-none focus-visible:outline-solid focus-visible:outline-1">
|
|
79
|
-
<KolboxGlyph name={t.icon || 'file'} className="kol-tabs-document-glyph" />
|
|
80
|
-
<span className="max-w-[220px] truncate">{t.label}</span>
|
|
81
|
-
</button>
|
|
82
|
-
{onOpenBeside && !lit && (
|
|
83
|
-
<Button variant="kolbox" iconOnly="panel-right" aria-label={`Open ${t.label} beside`} onClick={() => onOpenBeside(t.value)}
|
|
84
|
-
className="opacity-0 group-hover:opacity-100 focus-visible:opacity-100" />
|
|
85
|
-
)}
|
|
86
|
-
{onClose && (
|
|
87
|
-
<span className="relative flex size-(--kol-kolbox-ctl) items-center justify-center">
|
|
88
|
-
{t.dirty && <span aria-label="Unsaved changes" role="img" className="kol-tabs-document-dot pointer-events-none absolute size-1.5 rounded-full group-hover:opacity-0 group-focus-within:opacity-0" />}
|
|
89
|
-
<Button variant="kolbox" iconOnly="x" aria-label={`Close ${t.label}`} onClick={() => onClose(t.value)}
|
|
90
|
-
className={closeShown ? '' : 'opacity-0 group-hover:opacity-100 group-focus-within:opacity-100'} />
|
|
91
|
-
</span>
|
|
92
|
-
)}
|
|
93
|
-
</div>
|
|
94
|
-
)
|
|
95
|
-
})}
|
|
96
|
-
{paired && onCloseSplit && (
|
|
97
|
-
<span className="flex shrink-0 items-center px-2">
|
|
98
|
-
<Button variant="kolbox" tone="ghost" iconLeft="panel-right" onClick={onCloseSplit}>Close split</Button>
|
|
99
|
-
</span>
|
|
100
|
-
)}
|
|
101
|
-
{onNew && (
|
|
102
|
-
<span className="flex shrink-0 items-center px-2">
|
|
103
|
-
<Button variant="kolbox" iconOnly="plus" aria-label={newLabel} onClick={onNew} />
|
|
104
|
-
</span>
|
|
105
|
-
)}
|
|
106
|
-
</div>
|
|
107
|
-
)
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/* folio: FolioWrite's strip (13.3, W18) class for class; its colors are rules on the folio tokens (kol-components-molecules.css) */
|
|
111
67
|
return (
|
|
112
68
|
<div data-accent={accent === 'secondary' ? accent : undefined} role="tablist" aria-label={ariaLabel} onKeyDown={onKeyDown}
|
|
113
|
-
className={`kol-tabs-document
|
|
69
|
+
className={`kol-tabs-document relative flex h-10 shrink-0 items-stretch overflow-x-auto [scrollbar-width:none] after:pointer-events-none after:absolute after:inset-x-0 after:bottom-0 after:h-px after:content-[''] ${className}`.trim()}>
|
|
114
70
|
{tabs.map((t) => {
|
|
115
71
|
const on = t.value === value
|
|
116
|
-
const
|
|
72
|
+
const lit = on || t.value === paired
|
|
73
|
+
const closeShown = on && !t.dirty
|
|
117
74
|
return (
|
|
118
75
|
<div key={t.value} role="presentation" {...cell(t)}
|
|
119
|
-
className={`kol-tabs-document-tab${
|
|
120
|
-
<button {...tabProps(t)} className=
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
76
|
+
className={`kol-tabs-document-tab${lit ? ' is-active' : ''} group relative flex shrink-0 items-center gap-1 pr-2 pl-3`}>
|
|
77
|
+
<button {...tabProps(t)} className="kol-tabs-document-label flex min-w-0 items-center gap-2 self-stretch outline-none focus-visible:outline-solid focus-visible:outline-1">
|
|
78
|
+
<KolboxGlyph name={t.icon || 'file'} className="kol-tabs-document-glyph" />
|
|
79
|
+
<span className="max-w-[220px] truncate">{t.label}</span>
|
|
80
|
+
</button>
|
|
81
|
+
{onOpenBeside && !lit && (
|
|
82
|
+
<Button iconOnly="panel-right" aria-label={`Open ${t.label} beside`} onClick={() => onOpenBeside(t.value)}
|
|
83
|
+
className="opacity-0 group-hover:opacity-100 focus-visible:opacity-100" />
|
|
84
|
+
)}
|
|
85
|
+
{onClose && (
|
|
86
|
+
<span className="kol-tabs-document-slot relative flex items-center justify-center">
|
|
87
|
+
{t.dirty && <span aria-label="Unsaved changes" role="img" className="kol-tabs-document-dot pointer-events-none absolute size-1.5 rounded-full group-hover:opacity-0 group-focus-within:opacity-0" />}
|
|
88
|
+
<Button iconOnly="x" aria-label={`Close ${t.label}`} onClick={() => onClose(t.value)}
|
|
89
|
+
className={closeShown ? '' : 'opacity-0 group-hover:opacity-100 group-focus-within:opacity-100'} />
|
|
90
|
+
</span>
|
|
91
|
+
)}
|
|
124
92
|
</div>
|
|
125
93
|
)
|
|
126
94
|
})}
|
|
127
|
-
{paired && onCloseSplit &&
|
|
128
|
-
|
|
95
|
+
{paired && onCloseSplit && (
|
|
96
|
+
<span className="flex shrink-0 items-center px-2">
|
|
97
|
+
<Button tone="ghost" iconLeft="panel-right" onClick={onCloseSplit}>Close split</Button>
|
|
98
|
+
</span>
|
|
99
|
+
)}
|
|
100
|
+
{onNew && (
|
|
101
|
+
<span className="flex shrink-0 items-center px-2">
|
|
102
|
+
<Button iconOnly="plus" aria-label={newLabel} onClick={onNew} />
|
|
103
|
+
</span>
|
|
104
|
+
)}
|
|
129
105
|
</div>
|
|
130
106
|
)
|
|
131
107
|
}
|
|
@@ -34,7 +34,9 @@ import { floatSurfaceClass } from '../utilities/tone.js'
|
|
|
34
34
|
* keeps one line that scrolls sideways with no scrollbar, `.kol-scroll-fade--x` fading the clipped edge(s), and the
|
|
35
35
|
* active tab scrolled into view when it changes — arrow keys included; `wrap` breaks the tabs onto a second line.
|
|
36
36
|
* Every variant but `stacked`, which has its phone bar
|
|
37
|
-
* @param {'underline'|'chip'|'text'|'stacked'|'
|
|
37
|
+
* @param {'underline'|'chip'|'text'|'stacked'|'track'} [variant='underline'] `track` (kolbox's tabs, W31.2 batch 3; a plain variant
|
|
38
|
+
* since plan-2026-11-29-one-set-fold W3 run 2): the tab track, see `TabsTrack` below; takes `tabs`, `value`, `onChange`, `size`
|
|
39
|
+
* (sm, md) and `className` only. `kolbox` and `folio` are accepted and draw `track` (on the retirement ledger).
|
|
38
40
|
* @param {string} [look] @deprecated 2026-10-30 — the old spelling of `variant`; `variant` wins when both are passed
|
|
39
41
|
* @param {'mono'|'sans'|'mono-light'} [type='mono'] `underline` only: the tab's type — `mono-light` is `sans`'s row on JetBrains Mono at 300 (his word, 2026-10-30)
|
|
40
42
|
* @param {boolean} [filled=false] - `chip` only: every chip shows at rest (Button `tab-filled`), so the row reads as choices
|
|
@@ -84,17 +86,19 @@ import { floatSurfaceClass } from '../utilities/tone.js'
|
|
|
84
86
|
* Tabs are `{ id, label }` or `{ value, label }` (either key), plus `icon` for stacked; a stacked tab's `selected`
|
|
85
87
|
* lights it whatever `value` is — action slots (the transport) light more than one.
|
|
86
88
|
*/
|
|
87
|
-
/* `variant="
|
|
88
|
-
* chrome in kol-theme `.kol-tabs
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
* rest oq-64, the ink on hover. Tabs are strings or `{ value, label, disabled, tooltip }`: a disabled
|
|
92
|
-
* no hover or focus and shows its `tooltip
|
|
93
|
-
* equally and the padding gives way.
|
|
94
|
-
|
|
89
|
+
/* `variant="track"` (kolbox's Tabs, plan-2026-11-18-kolbox-system W31.2 batch 3, 2026-11-18; a plain variant since
|
|
90
|
+
* plan-2026-11-29-one-set-fold W3 run 2), chrome in kol-theme `.kol-tabs-track`, its look `--kol-tabs-track-*`. `size` sm
|
|
91
|
+
* (its default) the tab track: the control height on the track's fill, 2 in, the tabs 1 apart at radius 4, 12 in, the
|
|
92
|
+
* current one on the stronger fill in the ink; md the top rail's mode track: 32 on the ground, 4 in, the tabs touching, 8
|
|
93
|
+
* in. The UI text, the rest oq-64, the ink on hover. Tabs are strings or `{ value, label, disabled, tooltip }`: a disabled
|
|
94
|
+
* tab is 40%, takes no hover or focus and shows its `tooltip`. In a track narrower than the labels and their padding the
|
|
95
|
+
* tabs share it equally and the padding gives way. kolbox sets the fills, the type and the height
|
|
96
|
+
* (kol-components-molecules.css). `kol-tabs--kolbox-sm` stays on the sm box as a hook for kol-fxr's touch height
|
|
97
|
+
* (retirement ledger). */
|
|
98
|
+
function TabsTrack({ tabs = [], value, onChange, size = 'sm', className = '', accent }) {
|
|
95
99
|
const md = size === 'md'
|
|
96
100
|
return (
|
|
97
|
-
<div data-accent={accent === 'secondary' ? accent : undefined} role="tablist" className={`kol-tabs
|
|
101
|
+
<div data-accent={accent === 'secondary' ? accent : undefined} role="tablist" className={`kol-tabs-track kol-tabs-track--${md ? 'md' : 'sm kol-tabs--kolbox-sm'} inline-flex items-center ${md ? 'h-8 p-1' : 'gap-px p-0.5'} ${className}`}>
|
|
98
102
|
{tabs.map((t) => {
|
|
99
103
|
const { value: v, label, disabled, tooltip } = typeof t === 'string' ? { value: t, label: t } : t
|
|
100
104
|
const on = v === value
|
|
@@ -111,12 +115,15 @@ function TabsKolbox({ tabs = [], value, onChange, size = 'sm', className = '', a
|
|
|
111
115
|
{label}
|
|
112
116
|
</button>
|
|
113
117
|
)
|
|
114
|
-
return tooltip ? <span key={v} className="flex h-full flex-1 [&>span]:h-full [&>span]:flex-1 [&_button]:w-full">{<Tooltip
|
|
118
|
+
return tooltip ? <span key={v} className="flex h-full flex-1 [&>span]:h-full [&>span]:flex-1 [&_button]:w-full">{<Tooltip label={tooltip}>{tab}</Tooltip>}</span> : tab
|
|
115
119
|
})}
|
|
116
120
|
</div>
|
|
117
121
|
)
|
|
118
122
|
}
|
|
119
123
|
|
|
124
|
+
/* the old theme words: accepted, they draw `track` (W3 run 2, on the retirement ledger) */
|
|
125
|
+
const THEME_WORDS = ['kolbox', 'folio']
|
|
126
|
+
|
|
120
127
|
export const TABBAR_H = 56
|
|
121
128
|
/* the pill's height (W16, round 3 — fxr's live nav: was TABBAR_H) — a page under it owes TABBAR_PILL_H + TABBAR_PILL_INSET */
|
|
122
129
|
export const TABBAR_PILL_H = 66
|
|
@@ -142,7 +149,7 @@ export const tabbarPillSlot = (at, { count, labels = false, split = false } = {}
|
|
|
142
149
|
const COLLAPSE_MS = 300
|
|
143
150
|
|
|
144
151
|
export default function TabsRow({ tabs: raw = [], value, onChange, onClose, onMinimise, variant, look: lookLegacy, type, trailing, filled = false, placement = 'inline', shape = 'bar', collapsed = false, onExpand, edge, border, shadow, dock, active, foldable, folded, onFoldChange, foldSide, foldTone, surface, split, labels, size, tracked = false, overflow = 'scroll', ariaLabel, className, style, accent }) {
|
|
145
|
-
if (variant === '
|
|
152
|
+
if (variant === 'track' || THEME_WORDS.includes(variant)) return <TabsTrack tabs={raw} value={value} onChange={onChange} size={size} className={className} accent={accent} />
|
|
146
153
|
const tabs = raw.map((t) => ({ ...t, id: t.id ?? t.value }))
|
|
147
154
|
const look = variant ?? lookLegacy ?? 'underline'
|
|
148
155
|
const wrap = overflow === 'wrap'
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { IconLoader } from '@kolkrabbi/kol-icons'
|
|
2
1
|
import Input from '../atoms/Input.jsx'
|
|
3
2
|
import Button from '../atoms/Button.jsx'
|
|
4
|
-
import ButtonGroup from '../molecules/ButtonGroup.jsx'
|
|
5
3
|
|
|
6
4
|
/**
|
|
7
5
|
* FindBar — find and replace over a document, one bar across its top (Folio's FindBar, 2026-11-22). It holds no
|
|
8
6
|
* document state: the host keeps the query, the replacement, the count and match case, and does the finding.
|
|
9
7
|
*
|
|
10
8
|
* The find field takes focus when the bar mounts. In either field Enter is the next match, Shift+Enter the previous;
|
|
11
|
-
* Escape anywhere in the bar closes it. Chrome in kol-theme `.kol-find-bar
|
|
9
|
+
* Escape anywhere in the bar closes it. Chrome in kol-theme `.kol-find-bar`, its line `--kol-find-bar-line` (kolbox the one edge).
|
|
12
10
|
*
|
|
13
11
|
* <FindBar query={q} onQueryChange={setQ} replacement={r} onReplacementChange={setR} count="3 found"
|
|
14
12
|
* onPrev={prev} onNext={next} onReplace={one} onReplaceAll={all} matchCase={mc} onMatchCase={setMc} onClose={close} />
|
|
15
13
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
14
|
+
* ONE BAR (plan-2026-11-29-one-set-fold W3 run 2): 48 high on the rail ground, the line under it, Input md (the rail's search)
|
|
15
|
+
* and Buttons, the theme's look on each.
|
|
16
|
+
* @param {'kolbox'|'folio'} [variant] - accepted and nothing (on the retirement ledger). Folio's own bar (56 in, arrow
|
|
17
|
+
* glyphs, Folio's Input and Buttons) went to `_tmp/2026-11-29-one-set-fold/FindBar.pre-w3b.jsx`
|
|
18
18
|
* @param {string} query - The find field's text
|
|
19
19
|
* @param {(value: string) => void} onQueryChange
|
|
20
20
|
* @param {string} replacement - The replace field's text
|
|
@@ -29,42 +29,28 @@ import ButtonGroup from '../molecules/ButtonGroup.jsx'
|
|
|
29
29
|
* @param {() => void} onClose
|
|
30
30
|
* @param {string} [className] - Extra classes on the bar
|
|
31
31
|
*/
|
|
32
|
-
export default function FindBar({ variant
|
|
32
|
+
export default function FindBar({ variant, query, // eslint-disable-line no-unused-vars
|
|
33
|
+
onQueryChange, replacement, onReplacementChange, count, onPrev, onNext, onReplace, onReplaceAll, matchCase, onMatchCase, onClose, className = '' }) {
|
|
33
34
|
/* Enter steps only from a field, so a focused button still presses on Enter */
|
|
34
35
|
const onKeyDown = (e) => {
|
|
35
36
|
if (e.key === 'Escape') { e.preventDefault(); onClose?.() }
|
|
36
37
|
if (e.key === 'Enter' && e.target.tagName === 'INPUT') { e.preventDefault(); e.shiftKey ? onPrev?.() : onNext?.() }
|
|
37
38
|
}
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
<IconLoader name="search" size={16} />
|
|
42
|
-
<Input variant="folio" autoFocus aria-label="Find" placeholder="Find" value={query} onChange={(e) => onQueryChange(e.target.value)} className="w-[220px]" />
|
|
43
|
-
<span className="kol-find-bar-count w-[64px] tabular-nums">{count}</span>
|
|
44
|
-
<ButtonGroup layout="joined" variant="folio" ariaLabel="Matches" options={[{ icon: 'arrow-left', ariaLabel: 'Previous match', onPress: onPrev }, { icon: 'arrow-right', ariaLabel: 'Next match', onPress: onNext }]} />
|
|
45
|
-
<button type="button" aria-pressed={matchCase} onClick={() => onMatchCase(!matchCase)} className={`kol-find-bar-case${matchCase ? ' is-on' : ''} h-[28px] rounded-[3px] px-[8px]`}>Aa</button>
|
|
46
|
-
<span className="kol-find-bar-rule mx-[8px] h-[20px] w-px" />
|
|
47
|
-
<Input variant="folio" aria-label="Replace with" placeholder="Replace with" value={replacement} onChange={(e) => onReplacementChange(e.target.value)} className="w-[220px]" />
|
|
48
|
-
<Button variant="folio" keepFocus onClick={onReplace}>Replace</Button>
|
|
49
|
-
<Button variant="folio" keepFocus onClick={onReplaceAll}>Replace all</Button>
|
|
50
|
-
<Button variant="folio" keepFocus iconOnly="x" aria-label="Close find" onClick={onClose} className="kol-find-bar-close ml-auto" />
|
|
51
|
-
</div>
|
|
52
|
-
)
|
|
53
|
-
|
|
54
|
-
/* kolbox: the rail header's 48 and its insets (12 in, 8 at the end), the rail's search field (Input md) and kolbox's
|
|
55
|
-
own find's buttons; Folio's order and words */
|
|
40
|
+
/* the rail header's 48 and its insets (12 in, 8 at the end), the rail's search field (Input md) and kolbox's own find's
|
|
41
|
+
buttons; Folio's order and words */
|
|
56
42
|
return (
|
|
57
|
-
<div className={`kol-find-bar
|
|
58
|
-
<Input
|
|
43
|
+
<div className={`kol-find-bar flex h-12 shrink-0 items-center gap-2 border-b pr-2 pl-3 ${className}`.trim()} onKeyDown={onKeyDown}>
|
|
44
|
+
<Input size="md" iconLeft="search" autoFocus aria-label="Find" placeholder="Find" value={query} onChange={(e) => onQueryChange(e.target.value)} className="w-60" />
|
|
59
45
|
<span className="kol-find-bar-count kol-kolbox-row w-16 shrink-0 tabular-nums">{count}</span>
|
|
60
|
-
<Button
|
|
61
|
-
<Button
|
|
62
|
-
<Button
|
|
46
|
+
<Button iconOnly="chevron-up" aria-label="Previous match" onClick={onPrev} />
|
|
47
|
+
<Button iconOnly="chevron-down" aria-label="Next match" onClick={onNext} />
|
|
48
|
+
<Button tone="ghost" pressed={Boolean(matchCase)} aria-label="Match case" onClick={() => onMatchCase(!matchCase)}>Aa</Button>
|
|
63
49
|
<span className="kol-find-bar-rule mx-2 h-5 w-px shrink-0" />
|
|
64
|
-
<Input
|
|
65
|
-
<Button
|
|
66
|
-
<Button
|
|
67
|
-
<Button
|
|
50
|
+
<Input size="md" iconLeft="arrow-right" aria-label="Replace with" placeholder="Replace with" value={replacement} onChange={(e) => onReplacementChange(e.target.value)} className="w-60" />
|
|
51
|
+
<Button onClick={onReplace}>Replace</Button>
|
|
52
|
+
<Button onClick={onReplaceAll}>Replace all</Button>
|
|
53
|
+
<Button iconOnly="x" aria-label="Close find" onClick={onClose} className="ml-auto" />
|
|
68
54
|
</div>
|
|
69
55
|
)
|
|
70
56
|
}
|