@kolkrabbi/kol-component 0.378.0 → 0.380.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 +5 -4
- package/src/atoms/Badge.jsx +1 -5
- package/src/atoms/BezierPathEditor.jsx +1 -1
- package/src/atoms/Button.jsx +88 -12
- package/src/atoms/Figure.jsx +19 -1
- package/src/atoms/FunctionPlot.jsx +1 -1
- package/src/atoms/Input.jsx +107 -7
- package/src/atoms/Kbd.jsx +42 -2
- package/src/atoms/Link.jsx +20 -0
- package/src/atoms/OriginPicker.jsx +9 -5
- package/src/atoms/Pill.jsx +1 -3
- package/src/atoms/ProgressBar.jsx +3 -6
- package/src/atoms/SectionFooter.jsx +22 -0
- package/src/atoms/SectionHeader.jsx +24 -0
- package/src/atoms/SectionLabel.jsx +0 -22
- package/src/atoms/SizeOrDownload.jsx +1 -1
- package/src/atoms/Tag.jsx +4 -7
- package/src/atoms/Textarea.jsx +12 -7
- package/src/atoms/ToggleCheckbox.jsx +25 -5
- package/src/atoms/ToggleSwitch.jsx +41 -7
- package/src/atoms/ViewToggle.jsx +2 -29
- package/src/atoms/XYPad.jsx +25 -0
- package/src/hooks/useDragResize.js +1 -1
- package/src/index.js +26 -4
- package/src/molecules/AccountMenu.jsx +16 -3
- package/src/molecules/AlignmentGrid.jsx +13 -1
- package/src/molecules/ButtonGroup.jsx +78 -15
- package/src/molecules/ButtonSplit.jsx +75 -28
- package/src/molecules/Chip.jsx +26 -0
- package/src/molecules/CodeBlock.jsx +39 -2
- package/src/molecules/ColorInputRow.jsx +125 -4
- package/src/molecules/ColorSwatch.jsx +43 -2
- package/src/molecules/ContentCard.jsx +104 -3
- package/src/molecules/ContentMedia.jsx +1 -1
- package/src/molecules/ContentRow.jsx +4 -32
- package/src/molecules/ContextMenu.jsx +0 -1
- package/src/molecules/DividerLabel.jsx +19 -0
- package/src/molecules/DocsToc.jsx +1 -16
- package/src/molecules/Dropdown.jsx +115 -18
- package/src/molecules/DropdownStepper.jsx +29 -0
- package/src/molecules/EmptyState.jsx +1 -15
- package/src/molecules/FieldPair.jsx +41 -2
- package/src/molecules/Header.jsx +4 -4
- package/src/molecules/IndexRow.jsx +1 -1
- package/src/molecules/InlineAddRow.jsx +2 -2
- package/src/molecules/LabeledControl.jsx +56 -11
- package/src/molecules/LayerRow.jsx +1 -1
- package/src/molecules/LinkAddRow.jsx +5 -7
- package/src/molecules/Menu.jsx +250 -33
- package/src/molecules/MenuFloat.jsx +6 -12
- package/src/molecules/MenuList.jsx +5 -11
- package/src/molecules/Modal.jsx +228 -55
- package/src/molecules/ModalHeader.jsx +12 -20
- package/src/molecules/ModalShell.jsx +20 -10
- package/src/molecules/NoticeBanner.jsx +1 -1
- package/src/molecules/OptionRow.jsx +1 -1
- package/src/molecules/PanelsMenu.jsx +2 -2
- package/src/molecules/ParamBindDot.jsx +29 -2
- package/src/molecules/PasswordInput.jsx +1 -1
- package/src/molecules/QuantityInput.jsx +45 -13
- package/src/molecules/QuickLookFrame.jsx +2 -31
- package/src/molecules/RailHeader.jsx +37 -16
- package/src/molecules/ReadingActions.jsx +2 -2
- package/src/molecules/ReadingNotes.jsx +3 -3
- package/src/molecules/ReadingSettings.jsx +8 -8
- package/src/molecules/SearchInput.jsx +4 -5
- package/src/molecules/SectionText.jsx +56 -10
- package/src/molecules/SettingsControls.jsx +23 -23
- package/src/molecules/Slider.jsx +103 -55
- package/src/molecules/SpecList.jsx +1 -21
- package/src/molecules/SplitToolButton.jsx +4 -6
- package/src/molecules/SwatchControls.jsx +28 -0
- package/src/molecules/SwatchGrid.jsx +39 -0
- package/src/molecules/TabsDocument.jsx +131 -0
- package/src/molecules/TabsRow.jsx +40 -50
- package/src/molecules/TaskRow.jsx +2 -2
- package/src/molecules/Toast.jsx +55 -0
- package/src/molecules/TocRow.jsx +1 -1
- package/src/molecules/TreeRow.jsx +87 -1
- package/src/molecules/WorkspaceSwitcher.jsx +3 -6
- package/src/organisms/AppItemMenuProvider.jsx +2 -2
- package/src/organisms/ColorPickerPopover.jsx +133 -4
- package/src/organisms/ColumnBrowser.jsx +1 -1
- package/src/organisms/CommandOverlay.jsx +362 -87
- package/src/organisms/ContentFilters.jsx +4 -12
- package/src/organisms/FindBar.jsx +70 -0
- package/src/organisms/FramedMediaBand.jsx +2 -2
- package/src/organisms/GalleryCarousel.jsx +1 -1
- package/src/organisms/LogoSystem.jsx +38 -0
- package/src/organisms/LogoTuner.jsx +32 -0
- package/src/organisms/MediaLibrary.jsx +1 -56
- package/src/organisms/MediaLibraryPages.jsx +1 -1
- package/src/organisms/NavRail.jsx +1 -4
- package/src/organisms/Rail.jsx +33 -1
- package/src/organisms/RailSwitcher.jsx +62 -0
- package/src/organisms/ReadingContents.jsx +65 -3
- package/src/organisms/ReadingOverview.jsx +5 -5
- package/src/organisms/ReadingPanel.jsx +1 -1
- package/src/organisms/SectionSplit.jsx +1 -1
- package/src/organisms/SettingsPanel.jsx +64 -41
- package/src/organisms/ShortcutsOverlay.jsx +46 -2
- package/src/organisms/SpectrumControls.jsx +112 -19
- package/src/organisms/StatusBar.jsx +30 -0
- package/src/organisms/Table.jsx +136 -45
- package/src/organisms/TimelineDock.jsx +281 -1
- package/src/organisms/logoBoard.jsx +61 -0
- package/src/utilities/AssetPlaceholder.jsx +1 -1
- package/src/utilities/EditorShell.jsx +42 -1
- package/src/utilities/OverlayGlassPanel.jsx +1 -1
- package/src/utilities/Popover.jsx +299 -5
- package/src/utilities/SelectionOverlay.jsx +60 -31
- package/src/utilities/kolboxGlyph.jsx +10 -0
- package/src/molecules/FloatModuleHeader.jsx +0 -11
- package/src/organisms/NavRailFloat.jsx +0 -139
|
@@ -17,7 +17,7 @@ import ModalHeader from './ModalHeader.jsx'
|
|
|
17
17
|
export default function PanelsMenu({ title = 'Workspace panels', panels = [], onAction, className = '' }) {
|
|
18
18
|
return (
|
|
19
19
|
<div className={`flex w-full max-w-md flex-col gap-3 rounded-[var(--kol-float-menu-r)] bg-surface-secondary p-4 ${className}`.trim()}>
|
|
20
|
-
<ModalHeader
|
|
20
|
+
<ModalHeader title={title} />
|
|
21
21
|
<ul className="flex flex-col gap-2">
|
|
22
22
|
{panels.map((p) => (
|
|
23
23
|
<li key={p.id ?? p.name} className="flex items-center gap-4 rounded-[var(--kol-float-list-r)] bg-[var(--kol-float-well)] py-2 pl-4 pr-2">
|
|
@@ -26,7 +26,7 @@ export default function PanelsMenu({ title = 'Workspace panels', panels = [], on
|
|
|
26
26
|
{p.meta && <span className="kol-float-label truncate text-fg-64">{p.meta}</span>}
|
|
27
27
|
</span>
|
|
28
28
|
{p.state && <span className="kol-float-label shrink-0 text-fg-64">{p.state}</span>}
|
|
29
|
-
<Button
|
|
29
|
+
<Button size="md" tone={p.primary ? 'inverted' : 'secondary'} className="shrink-0 min-w-20" onClick={() => { p.onAction?.(p); onAction?.(p) }}>{p.action}</Button>
|
|
30
30
|
</li>
|
|
31
31
|
))}
|
|
32
32
|
</ul>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useRef, useState } from 'react'
|
|
1
2
|
import { Menu } from './Menu.jsx'
|
|
2
3
|
import { Tooltip } from '../utilities/Popover.jsx'
|
|
3
4
|
|
|
@@ -39,7 +40,7 @@ const SIZE = {
|
|
|
39
40
|
* @param {number} [minWidth=180] - The menu's minimum width
|
|
40
41
|
* @param {string} [className] - Extra classes on the trigger
|
|
41
42
|
*/
|
|
42
|
-
|
|
43
|
+
function ParamBindDotDefault({
|
|
43
44
|
bound = false,
|
|
44
45
|
mode,
|
|
45
46
|
items = [],
|
|
@@ -60,7 +61,7 @@ export default function ParamBindDot({
|
|
|
60
61
|
aria-label={name}
|
|
61
62
|
{...props}
|
|
62
63
|
className={[
|
|
63
|
-
'kol-param-bind-dot group inline-flex shrink-0 items-center justify-center p-0 border-0 bg-transparent cursor-pointer rounded-[var(--kol-radius-
|
|
64
|
+
'kol-param-bind-dot group inline-flex shrink-0 items-center justify-center p-0 border-0 bg-transparent cursor-pointer rounded-[var(--kol-radius-2)] outline-none',
|
|
64
65
|
'focus-visible:outline focus-visible:outline-1 focus-visible:outline-[var(--kol-focus-ring-quiet)]',
|
|
65
66
|
SIZE[size] ?? SIZE.sm,
|
|
66
67
|
className,
|
|
@@ -77,3 +78,29 @@ export default function ParamBindDot({
|
|
|
77
78
|
)} />
|
|
78
79
|
)
|
|
79
80
|
}
|
|
81
|
+
|
|
82
|
+
/* kolbox (plan-2026-11-18-kolbox-system W31.2 batch 5, 2026-11-18): kolbox's BindDot (round 4, W5), its drawing carried
|
|
83
|
+
* from apps/kolbox/src/labs/Params.jsx (the binding itself stays the caller's): a 16 hit box, a 6 dot hollow on the muted
|
|
84
|
+
* ring, filled in the accent once `bound`; the kolbox Tooltip (`tooltip`, else "Modulate"); a press opens Menu kolbox
|
|
85
|
+
* beside it with `items` ({ label, checked, onClick }) as one group. */
|
|
86
|
+
function ParamBindDotKolbox({ bound = false, items = [], label, tooltip, minWidth = 180 }) {
|
|
87
|
+
const ref = useRef(null)
|
|
88
|
+
const [open, setOpen] = useState(false)
|
|
89
|
+
return (
|
|
90
|
+
<>
|
|
91
|
+
<Tooltip variant="kolbox" label={tooltip ?? 'Modulate'}>
|
|
92
|
+
<button ref={ref} type="button" aria-label={`Modulate${label ? ` ${label}` : ''}`} aria-haspopup="menu" aria-expanded={open} data-bind-dot
|
|
93
|
+
onClick={() => setOpen((o) => !o)}
|
|
94
|
+
className="kol-bind-dot--kolbox inline-flex size-4 shrink-0 items-center justify-center rounded-full outline-none focus-visible:outline-solid focus-visible:outline-1">
|
|
95
|
+
<span className={`kol-bind-dot-mark${bound ? ' is-bound' : ''} size-1.5 rounded-full`} />
|
|
96
|
+
</button>
|
|
97
|
+
</Tooltip>
|
|
98
|
+
<Menu variant="kolbox" aria-label="Modulate" anchor={ref} open={open} onClose={() => setOpen(false)} minWidth={minWidth}
|
|
99
|
+
groups={[items.map((it, i) => ({ label: it.label, value: i, check: !!it.checked }))]} onSelect={(r) => items[r.value]?.onClick?.()} />
|
|
100
|
+
</>
|
|
101
|
+
)
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export default function ParamBindDot(props) {
|
|
105
|
+
return props.variant === 'kolbox' ? <ParamBindDotKolbox {...props} /> : <ParamBindDotDefault {...props} />
|
|
106
|
+
}
|
|
@@ -6,7 +6,7 @@ import Input from '../atoms/Input.jsx'
|
|
|
6
6
|
* PasswordInput — A password field with its reveal. `•••••••••••• 👁` (float-everything W3 row 39, 2026-11-04 — the
|
|
7
7
|
* exploration's password field). An `Input type="password"` with the eye at its trailing edge (`eye-on` masked,
|
|
8
8
|
* `eye-off` revealed; 16, oq-64 to oq-96): a press flips the type, the field keeps focus. Every Input prop passes
|
|
9
|
-
* through — `
|
|
9
|
+
* through — `error` is the message under it.
|
|
10
10
|
*
|
|
11
11
|
* @param {boolean} [revealed] controlled reveal; omit for internal state
|
|
12
12
|
* @param {Function} [onRevealChange] `(revealed) => void`
|
|
@@ -19,14 +19,27 @@ import { useEffect, useState } from 'react'
|
|
|
19
19
|
* @param {number} max upper bound (default 99)
|
|
20
20
|
* @param {string} controls 'chevron' (default) | 'split'
|
|
21
21
|
* @param {string} size 'sm' | 'md' | 'lg' — pins the responsive size
|
|
22
|
-
* @param {
|
|
23
|
-
*
|
|
24
|
-
* @param {
|
|
25
|
-
*
|
|
22
|
+
* @param {string} unit a word after the value (`22 px`)
|
|
23
|
+
* @param {string} ariaLabel what the value is; the − + read `Decrease <it>` / `Increase <it>` (default quantity)
|
|
24
|
+
* @param {'folio'} variant also `folio` (Folio migration batch A, 2026-11-22): Folio's stepper, two 32 squares at radius
|
|
25
|
+
* 4 with the rule line round the value (JetBrains Mono 12 / 16), the step glyphs 12 / 500;
|
|
26
|
+
* 8 apart, the root as wide as its row; a bound dims its square to 40%
|
|
27
|
+
* @param {number} step FOLIO: how far one press moves the value (default 1; the reader's sizes step by 2)
|
|
28
|
+
* @param {ReactNode} down FOLIO: the − square's text (`A−`)
|
|
29
|
+
* @param {ReactNode} up FOLIO: the + square's text (`A+`)
|
|
30
|
+
* @param {string} downLabel FOLIO: the − square's name (`Smaller text`)
|
|
31
|
+
* @param {string} upLabel FOLIO: the + square's name (`Larger text`)
|
|
32
|
+
* @param {'kolbox'} variant also `kolbox` (Folio on kolbox, 2026-11-22): kolbox has no stepper of its own, so it is built
|
|
33
|
+
* from its parts: `Input variant="kolbox"` (its sm field, `--kol-kolbox-ctl` high: the value
|
|
34
|
+
* in mono with `unit` after it, typed and committed on Enter or leaving, ↑↓ step it) between
|
|
35
|
+
* two kolbox icon Buttons, − and + (your icons' `minus` and `plus`), 4 apart, the root as wide
|
|
36
|
+
* as its row. `step`, `min`, `max` as folio's: a typed value is held to the range and the step;
|
|
37
|
+
* a button at a bound is disabled. `downLabel`, `upLabel` name the buttons (else
|
|
38
|
+
* `Decrease <ariaLabel>`, `Increase <ariaLabel>`); `down`, `up` are not drawn (the set's glyphs are)
|
|
26
39
|
* @param {string} className extra classes on the root
|
|
27
40
|
*/
|
|
28
|
-
import
|
|
29
|
-
|
|
41
|
+
import Input from '../atoms/Input.jsx'
|
|
42
|
+
import Button from '../atoms/Button.jsx'
|
|
30
43
|
|
|
31
44
|
const SIZE_MAP = {
|
|
32
45
|
sm: { fontSize: 11, paddingY: 12, paddingX: 24, radius: 20, icon: 10 },
|
|
@@ -44,6 +57,11 @@ const QuantityInput = ({
|
|
|
44
57
|
variant,
|
|
45
58
|
unit,
|
|
46
59
|
ariaLabel = 'quantity',
|
|
60
|
+
step = 1,
|
|
61
|
+
down,
|
|
62
|
+
up,
|
|
63
|
+
downLabel,
|
|
64
|
+
upLabel,
|
|
47
65
|
className = '',
|
|
48
66
|
}) => {
|
|
49
67
|
const [resolvedSize, setResolvedSize] = useState('md')
|
|
@@ -78,14 +96,28 @@ const QuantityInput = ({
|
|
|
78
96
|
const increment = () => { if (value < max) onChange?.(value + 1) }
|
|
79
97
|
const decrement = () => { if (value > min) onChange?.(value - 1) }
|
|
80
98
|
|
|
81
|
-
/*
|
|
82
|
-
|
|
83
|
-
|
|
99
|
+
/* folio (Folio migration batch A, 2026-11-22): Folio's Stepper carried class for class (apps/folio Chrome.jsx), two 32
|
|
100
|
+
* squares round the value, stepping by `step`; the chrome in kol-theme `.kol-quantity-input--folio` */
|
|
101
|
+
if (variant === 'folio') {
|
|
102
|
+
const stepCls = 'kol-quantity-input-step flex size-[32px] items-center justify-center rounded-[4px] border disabled:opacity-40'
|
|
84
103
|
return (
|
|
85
|
-
<div className={`
|
|
86
|
-
<button type="button"
|
|
87
|
-
<
|
|
88
|
-
<button type="button"
|
|
104
|
+
<div className={`kol-quantity-input--folio flex items-center gap-[8px] ${className}`.trim()}>
|
|
105
|
+
<button type="button" aria-label={downLabel} disabled={value <= min} onClick={() => onChange?.(value - step)} className={stepCls}>{down}</button>
|
|
106
|
+
<p className="kol-quantity-input-value flex-1 text-center tabular-nums">{value}{unit ? ` ${unit}` : ''}</p>
|
|
107
|
+
<button type="button" aria-label={upLabel} disabled={value >= max} onClick={() => onChange?.(value + step)} className={stepCls}>{up}</button>
|
|
108
|
+
</div>
|
|
109
|
+
)
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* kolbox (Folio on kolbox, 2026-11-22): kolbox's field between its two icon buttons */
|
|
113
|
+
if (variant === 'kolbox') {
|
|
114
|
+
const to = (n) => Math.min(max, Math.max(min, min + Math.round((n - min) / step) * step))
|
|
115
|
+
const commit = (text) => { const n = parseFloat(text); if (Number.isFinite(n) && to(n) !== value) onChange?.(to(n)) }
|
|
116
|
+
return (
|
|
117
|
+
<div className={`flex min-w-0 items-center gap-1 ${className}`.trim()}>
|
|
118
|
+
<Button variant="kolbox" iconOnly="minus" aria-label={downLabel ?? `Decrease ${ariaLabel}`} disabled={value <= min} onClick={() => onChange?.(to(value - step))} />
|
|
119
|
+
<Input variant="kolbox" aria-label={ariaLabel} value={value} onCommit={commit} suffix={unit} className="flex-1" />
|
|
120
|
+
<Button variant="kolbox" iconOnly="plus" aria-label={upLabel ?? `Increase ${ariaLabel}`} disabled={value >= max} onClick={() => onChange?.(to(value + step))} />
|
|
89
121
|
</div>
|
|
90
122
|
)
|
|
91
123
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { useRef, useState } from 'react'
|
|
2
2
|
import { IconLoader } from '@kolkrabbi/kol-icons'
|
|
3
3
|
import ModalHeader from './ModalHeader.jsx'
|
|
4
|
-
import Header from './Header.jsx'
|
|
5
4
|
import ModalShell from './ModalShell.jsx'
|
|
6
5
|
|
|
7
|
-
/* taxonomy-ok: molecule —
|
|
6
|
+
/* taxonomy-ok: molecule — ModalHeader (molecule) on ModalShell (molecule) + kol-icons's IconLoader. */
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* QuickLookFrame — The preview window. the Finder Quick Look window (user 2026-09-23: *"put them in a container LIKE
|
|
@@ -32,18 +31,8 @@ import ModalShell from './ModalShell.jsx'
|
|
|
32
31
|
* @param {Function} onResize ({ w, h }) => void while the corner is dragged
|
|
33
32
|
* @param {ReactNode} footer the transport row
|
|
34
33
|
* @param {ReactNode} children the body
|
|
35
|
-
*
|
|
36
|
-
* THE UTILITY WINDOW (`variant="float"`, float-everything W6 rows 86 · 88, 2026-11-04 — kol-float--style 46:2840): a
|
|
37
|
-
* non-modal float window — no scrim, the scene stays live under it. `kol-float-solid` on `--kol-float-window-r`, 20 in,
|
|
38
|
-
* 18 between its parts; the header is `Header variant="modal"` (`icon` · title · `onMinimise` · `onClose`); the
|
|
39
|
-
* body is the caller's (chip tabs, float fields); `status` is the footer line (`Changes saved automatically`, the
|
|
40
|
-
* `kol-float-label` role on fg-64) with the resize corner as its glyph at the right — the same drag as the default grip.
|
|
41
|
-
* @param {'float'} [variant]
|
|
42
|
-
* @param {string} [icon] float: the window's glyph
|
|
43
|
-
* @param {Function} [onMinimise] float: the − control
|
|
44
|
-
* @param {ReactNode} [status] float: the footer line
|
|
45
34
|
*/
|
|
46
|
-
export default function QuickLookFrame({
|
|
35
|
+
export default function QuickLookFrame({ title, meta, actions, onClose, nav, size: sizeProp, onResize, footer, className = '', children }) {
|
|
47
36
|
const [own, setOwn] = useState(null)
|
|
48
37
|
const size = sizeProp !== undefined ? sizeProp : own
|
|
49
38
|
const setSize = onResize ?? setOwn
|
|
@@ -68,24 +57,6 @@ export default function QuickLookFrame({ variant, icon, onMinimise, status, titl
|
|
|
68
57
|
const onPointerUp = () => { drag.current = null }
|
|
69
58
|
|
|
70
59
|
const grip = { role: 'separator', 'aria-label': 'Resize', onPointerDown, onPointerMove, onPointerUp, onPointerCancel: onPointerUp }
|
|
71
|
-
if (variant === 'float') {
|
|
72
|
-
return (
|
|
73
|
-
<ModalShell ref={ref} variant="float" style={size ? { width: size.w, height: size.h } : undefined}
|
|
74
|
-
className={`w-full max-w-[562px] gap-[18px] p-5 ${className}`.trim()}
|
|
75
|
-
header={header && <Header variant="modal" icon={icon} title={title} end={actions} onMinimise={onMinimise} onClose={onClose} />}
|
|
76
|
-
footer={(
|
|
77
|
-
<>
|
|
78
|
-
{footer}
|
|
79
|
-
<div className="flex items-center gap-3">
|
|
80
|
-
<span className="kol-float-label min-w-0 flex-1 truncate text-fg-64">{status}</span>
|
|
81
|
-
<span {...grip} className="inline-flex size-4 cursor-nwse-resize touch-none items-center justify-center text-oq-64 hover:text-oq-96"><IconLoader name="expand" size={13} /></span>
|
|
82
|
-
</div>
|
|
83
|
-
</>
|
|
84
|
-
)}>
|
|
85
|
-
<div className="flex min-h-0 flex-1 flex-col gap-[18px]">{children}</div>
|
|
86
|
-
</ModalShell>
|
|
87
|
-
)
|
|
88
|
-
}
|
|
89
60
|
/* THE PANEL IS ModalShell's (W2.2, 2026-11-08): the lift surface and the one modal radius; the oq-12 hairline the
|
|
90
61
|
* window wore went with its own panel style — the scrim is the edge, as on every other KOL overlay */
|
|
91
62
|
const style = size ? { width: size.w, height: size.h, '--kol-ql-frame-h': `${size.h}px`, '--kol-ql-max-w': `${size.w}px` } : undefined
|
|
@@ -1,29 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/* taxonomy-ok: molecule — the rail kit's title line; `variant="float"` is Header variant="property" */
|
|
1
|
+
/* taxonomy-ok: molecule — the rail kit's title line */
|
|
4
2
|
|
|
5
3
|
/**
|
|
6
4
|
* RailHeader — the rail kit's title line (RailKit 2026-10-24): title (helper-14 uppercase), a subtitle, the header's
|
|
7
5
|
* actions before the × (which Rail draws). The node Rail's `header` slot takes it; SettingsPanel wears it.
|
|
8
6
|
*
|
|
9
|
-
* `variant="
|
|
10
|
-
* retirement ledger: `actions` → `end`, `collapsedV` / `onCollapseV` (the old `folded` / `onFold` still accepted).
|
|
11
|
-
* The default line stays here: it is not one of Header's four variants.
|
|
7
|
+
* `variant="kolbox"` (W31.2 batch 5): kolbox's rail header, with `leading` and `size` md · sm (below).
|
|
12
8
|
*
|
|
13
|
-
* @param {'default'|'
|
|
9
|
+
* @param {'default'|'kolbox'} [variant='default']
|
|
14
10
|
* @param {ReactNode} [title] · {ReactNode} [subtitle] · {ReactNode} [actions] · {string} [className]
|
|
15
11
|
*/
|
|
16
|
-
export default function RailHeader({ variant = 'default', title, subtitle, actions,
|
|
17
|
-
|
|
12
|
+
export default function RailHeader({ variant = 'default', title, subtitle, actions, leading, size = 'md', className = '' }) {
|
|
13
|
+
/* kolbox (plan-2026-11-18-kolbox-system W31.2 batch 5, 2026-11-18): kolbox's RailHeader, carried from
|
|
14
|
+
* apps/kolbox/src/ui/RailHeader.jsx: a `leading` slot, the title, the `subtitle` as a quiet meta line at the right,
|
|
15
|
+
* the actions; inset 16. `size` md the plain header (48 high), sm the document header (the file's RailHeader 61:11315:
|
|
16
|
+
* 65 high as Figma's, the title on the document voice 13 / 22; below). */
|
|
17
|
+
if (variant === 'kolbox') {
|
|
18
|
+
const sm = size === 'sm'
|
|
18
19
|
return (
|
|
19
|
-
<div className={`
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
<div className={`kol-rail-header--kolbox flex items-center ${sm ? 'items-start! gap-2 pt-[13px] pb-[9px] pr-2 pl-4' : 'h-12 gap-2 px-4'} ${className}`.trim()} data-rail-header>
|
|
21
|
+
{leading}
|
|
22
|
+
{sm ? (
|
|
23
|
+
/* sm, the document header: the subtitle is a quiet line UNDER the title, as his reference draws it (2026-11-19);
|
|
24
|
+
the header grows by that line only when there is one. As Figma's file header measures (plan-2026-11-23-editor-
|
|
25
|
+
measured-against-figma W3): 240 x 65, the title row 22 at 13 down, 5 to the line, the line 16, 9 under it; 16
|
|
26
|
+
left, 8 right, the actions 8 down */
|
|
27
|
+
<span className="flex! h-auto! min-w-0 flex-1 flex-col">
|
|
28
|
+
<span className="kol-rail-header-title--sm flex h-[22px] min-w-0 items-center">{title}</span>
|
|
29
|
+
{subtitle && <span className="kol-rail-header-sub truncate">{subtitle}</span>}
|
|
30
|
+
</span>
|
|
31
|
+
) : (
|
|
32
|
+
<>
|
|
33
|
+
<span className="kol-rail-header-title--md min-w-0 truncate">{title}</span>
|
|
34
|
+
<span className="kol-rail-header-meta min-w-0 flex-1 truncate text-right">{subtitle}</span>
|
|
35
|
+
</>
|
|
36
|
+
)}
|
|
37
|
+
{actions && <span className={`flex shrink-0 items-center ${sm ? '-mt-[5px]' : '-mr-1'}`}>{actions}</span>}
|
|
25
38
|
</div>
|
|
26
39
|
)
|
|
27
40
|
}
|
|
28
|
-
return
|
|
41
|
+
return (
|
|
42
|
+
<div className={`flex min-w-0 items-center gap-2 ${className}`.trim()}>
|
|
43
|
+
<div className="flex min-w-0 flex-1 flex-col">
|
|
44
|
+
{title && <span className="kol-helper-14 uppercase text-emphasis">{title}</span>}
|
|
45
|
+
{subtitle && <span className="kol-mono-12 text-meta">{subtitle}</span>}
|
|
46
|
+
</div>
|
|
47
|
+
{actions}
|
|
48
|
+
</div>
|
|
49
|
+
)
|
|
29
50
|
}
|
|
@@ -23,9 +23,9 @@ export default function ReadingActions({ actions = DEFAULT_ACTIONS, onAction, on
|
|
|
23
23
|
return (
|
|
24
24
|
<div role="toolbar" aria-label="Passage" className={`inline-flex h-10 items-center gap-1 rounded-full bg-surface-secondary px-1.5 ${className}`.trim()}>
|
|
25
25
|
{actions.map((a) => (
|
|
26
|
-
<Button key={a.id}
|
|
26
|
+
<Button key={a.id} tone="ghost" size="sm" iconLeft={a.icon} onClick={() => { a.onClick?.(); onAction?.(a.id) }}>{a.label}</Button>
|
|
27
27
|
))}
|
|
28
|
-
{onMore && <Button
|
|
28
|
+
{onMore && <Button tone="ghost" size="sm" iconOnly="more" aria-label="More" onClick={onMore} className="ml-auto" />}
|
|
29
29
|
</div>
|
|
30
30
|
)
|
|
31
31
|
}
|
|
@@ -29,10 +29,10 @@ export default function ReadingNotes({ quote, location, note = '', onNoteChange,
|
|
|
29
29
|
<blockquote className="mt-3 rounded-[14px] bg-[var(--kol-float-well)] p-3.5 text-[16px] leading-[1.5] text-fg-emphasis" style={{ fontFamily: font }}>{quote}</blockquote>
|
|
30
30
|
{location && <span className="kol-float-label mt-5 flex h-8 items-center rounded-full bg-[var(--kol-float-well)] px-4 text-fg-64">{location}</span>}
|
|
31
31
|
<span className="kol-float-ruler mt-8 uppercase text-fg-64">{noteLabel}</span>
|
|
32
|
-
<Textarea
|
|
32
|
+
<Textarea rows={5} value={note} onChange={(e) => onNoteChange?.(e.target.value)} aria-label={noteLabel} className="mt-3" />
|
|
33
33
|
{status && <span className="kol-float-label mt-5 text-fg-64">{status}</span>}
|
|
34
|
-
{onView && <Button
|
|
35
|
-
{onRemove && <Button
|
|
34
|
+
{onView && <Button size="lg" iconRight="external-link" onClick={onView} className="mt-6 w-full justify-center">{viewLabel}</Button>}
|
|
35
|
+
{onRemove && <Button tone="ghost" size="sm" onClick={onRemove} className="-ml-3 mt-4 self-start">{removeLabel}</Button>}
|
|
36
36
|
{footer && <span className="kol-float-ruler mt-5 uppercase text-fg-64">{footer}</span>}
|
|
37
37
|
</div>
|
|
38
38
|
)
|
|
@@ -10,7 +10,7 @@ const TRACK = 'w-full rounded-full bg-[var(--kol-float-well)] p-1 [&>button]:fle
|
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* ReadingSettings — How the text is set: the Reading side of `ReadingPanel` (float-everything W11 row 151, 2026-11-04 —
|
|
13
|
-
* kol-float--style W2.9 `Contextual reading panel · Reading`). Each setting is a `LabeledControl
|
|
13
|
+
* kol-float--style W2.9 `Contextual reading panel · Reading`). Each setting is a `LabeledControl` (the
|
|
14
14
|
* float label, as written, 8 over the control — plan-2026-11-12-float-rails-figma W12.1; it drew its own uppercase
|
|
15
15
|
* `kol-float-ruler` label until then), 24 between: the theme pick (`themes` — a row of kol-styleguide `ThemeTile`s; kol-component cannot import
|
|
16
16
|
* it), the face as a float Dropdown, the size as the float QuantityInput (`22 px`), leading and width as float
|
|
@@ -34,13 +34,13 @@ export default function ReadingSettings({ themes, font, fonts = [], onFont, size
|
|
|
34
34
|
const L = { ...LABELS, ...l }
|
|
35
35
|
return (
|
|
36
36
|
<div className={`flex flex-col gap-6 ${className}`.trim()}>
|
|
37
|
-
{themes && <LabeledControl
|
|
38
|
-
{fonts.length > 0 && <LabeledControl
|
|
39
|
-
<LabeledControl
|
|
40
|
-
{leadings.length > 0 && <LabeledControl
|
|
41
|
-
{widths.length > 0 && <LabeledControl
|
|
42
|
-
<LabeledControl
|
|
43
|
-
{onReset && <Button
|
|
37
|
+
{themes && <LabeledControl label={L.theme}><div className="flex gap-2">{themes}</div></LabeledControl>}
|
|
38
|
+
{fonts.length > 0 && <LabeledControl label={L.font}><Dropdown size="md" options={fonts} value={font} onChange={onFont} className="w-full" /></LabeledControl>}
|
|
39
|
+
<LabeledControl label={L.size}><QuantityInput unit="px" ariaLabel="text size" value={size} onChange={onSize} min={minSize} max={maxSize} className="w-full" /></LabeledControl>
|
|
40
|
+
{leadings.length > 0 && <LabeledControl label={L.leading}><Dropdown size="md" options={leadings} value={leading} onChange={onLeading} className="w-full" /></LabeledControl>}
|
|
41
|
+
{widths.length > 0 && <LabeledControl label={L.width}><Dropdown size="md" options={widths} value={width} onChange={onWidth} className="w-full" /></LabeledControl>}
|
|
42
|
+
<LabeledControl label={L.flow}><TabsRow size="xs" overflow="wrap" tabs={flows} value={flow} onChange={onFlow} ariaLabel={L.flow} className={TRACK} /></LabeledControl>
|
|
43
|
+
{onReset && <Button tone="secondary" size="lg" onClick={onReset} className="mt-4 w-full justify-center">{resetLabel}</Button>}
|
|
44
44
|
</div>
|
|
45
45
|
)
|
|
46
46
|
}
|
|
@@ -35,7 +35,7 @@ import Kbd from '../atoms/Kbd.jsx'
|
|
|
35
35
|
* @param {string} shortcutHint caller-authored kbd chip (e.g. "⌘K"); shown while the value is empty
|
|
36
36
|
* @param {Function} onFocus (event) => void — input focus
|
|
37
37
|
* @param {string} size 'xs' | 'sm' | 'md' — kol-control size + matched mono type class (xs = the panel rung, 2026-09-01)
|
|
38
|
-
* @param {string} variant 'filled' | 'ghost' | 'outline' — kol-control variant, same chrome as Input (ignored when bare/expanding)
|
|
38
|
+
* @param {string} variant 'filled' | 'ghost' | 'outline' — kol-control variant, same chrome as Input (ignored when bare/expanding)
|
|
39
39
|
* @param {string} tone 'default' | 'inverse' — the dark chip for a washed plane (ControlToneInverse, 2026-08-27); on the expanding pill it is the OPEN fill
|
|
40
40
|
* @param {boolean} bare borderless inline field for overlay panels (full width, no shell chrome; keeps icon/clear/chip slots)
|
|
41
41
|
* @param {boolean} expanding round icon-button pill that animates open into an inline field
|
|
@@ -215,8 +215,7 @@ export default function SearchInput({
|
|
|
215
215
|
? `kol-control--bare kol-control-${size} flex w-full border border-transparent gap-2`
|
|
216
216
|
: `kol-control${variant ? ` kol-control--${variant}` : ''} kol-control-${size} gap-2${toneClass(tone) ? ` ${toneClass(tone)}` : ''}`,
|
|
217
217
|
'items-center cursor-text',
|
|
218
|
-
|
|
219
|
-
variant !== 'float' && SIZE_TYPE[size],
|
|
218
|
+
SIZE_TYPE[size],
|
|
220
219
|
className,
|
|
221
220
|
].filter(Boolean).join(' ')
|
|
222
221
|
|
|
@@ -251,8 +250,8 @@ export default function SearchInput({
|
|
|
251
250
|
aria-hidden="true"
|
|
252
251
|
className={`flex items-center shrink-0 ${bare ? 'text-oq-48' : 'text-auto opacity-50'}`}
|
|
253
252
|
>
|
|
254
|
-
{/* ADJACENT — this glyph sits in the field's line box beside the query
|
|
255
|
-
<IconLoader name="search" size={iconSize ??
|
|
253
|
+
{/* ADJACENT — this glyph sits in the field's line box beside the query */}
|
|
254
|
+
<IconLoader name="search" size={iconSize ?? glyphSize(size)} />
|
|
256
255
|
</span>
|
|
257
256
|
)}
|
|
258
257
|
<input
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import KolboxGlyph from '../utilities/kolboxGlyph.jsx'
|
|
1
2
|
/**
|
|
2
3
|
* SectionText — The label, headline and body block. the ruled text block of the SECTION family (SectionSet,
|
|
3
4
|
* kol-website 2026-08-26): label · headline · body · actions, every slot
|
|
@@ -49,9 +50,7 @@
|
|
|
49
50
|
* to `--kol-page-header-mb` (40px; content 16px). Unset = the section family as before.
|
|
50
51
|
* @param {ReactNode} media a mark above the eyebrow (a logo, an SVG) — with a `level` only
|
|
51
52
|
* @param {ReactNode} meta a fact at the far end of the HEADLINE's row (float-everything W9 row 140, 2026-11-04 —
|
|
52
|
-
* `Website traffic · kolkrabbi.io · Umami`): the source or scope, in mono on fg-64 (`kol-
|
|
53
|
-
* under `variant="float"`, else `kol-mono-12 text-meta`), baseline-aligned with the title. Unset, nothing
|
|
54
|
-
* `variant="float"` — the float page header (see SECTION_TEXT_LEVELS.float).
|
|
53
|
+
* `Website traffic · kolkrabbi.io · Umami`): the source or scope, in mono on fg-64 (`kol-mono-12 text-meta`), baseline-aligned with the title. Unset, nothing
|
|
55
54
|
*/
|
|
56
55
|
export const HEADLINE_ROLE = {
|
|
57
56
|
pull: 'kol-section-text-pull',
|
|
@@ -78,14 +77,9 @@ export const SECTION_TEXT_LEVELS = {
|
|
|
78
77
|
/* document (DocumentIndexFigma, kol-atlas 2026-10-31) — the Research page header, the workspace sheet's: 36/1.2 bold
|
|
79
78
|
* display face at −0.005em, 12 under it; the lede 15/1.6 in the body face to a 724 edge */
|
|
80
79
|
document: { title: 'font-[family-name:var(--kol-font-family-sans)] text-[36px] font-bold leading-[1.2] tracking-[-0.005em]', lede: 'm-0 font-[family-name:var(--kol-font-family-sans-neutral)] text-[15px] leading-[1.6] text-fg-96', measure: '724px' },
|
|
81
|
-
/* float (float-everything W9 row 135, 2026-11-04 — kol-float--style 48:4542): the float page header — the eyebrow in
|
|
82
|
-
* mono (`kol-float-ruler`, fg-64, `STUDIO / WORKSPACE`), the title in `kol-float-sheet` (Inter 38/500), the subtitle
|
|
83
|
-
* in `kol-float-body` on fg-64; 8 between, 24 under. A section heading on the float is this with
|
|
84
|
-
* `headlineClass="kol-float-window"` and a `meta` (row 140). */
|
|
85
|
-
float: { title: 'kol-float-sheet', lede: 'kol-float-body text-fg-64', eyebrow: 'kol-float-ruler text-fg-64', gap: 'gap-2', mb: '24px' },
|
|
86
80
|
}
|
|
87
81
|
|
|
88
|
-
|
|
82
|
+
function SectionTextDefault({
|
|
89
83
|
eyebrow,
|
|
90
84
|
label,
|
|
91
85
|
headline,
|
|
@@ -166,7 +160,7 @@ export default function SectionText({
|
|
|
166
160
|
const titleNode = headline && <Headline className={cls(`kol-section-text-headline ${headlineClass ?? (HEADLINE_ROLE[headlineSize] ?? HEADLINE_ROLE['heading-02'])}${headlineCase === 'upper' ? ' kol-section-text-caps' : ''}`, 'headline')} style={slotStyle.headline}>{headline}</Headline>
|
|
167
161
|
/* `meta` rides the headline's row, at its far end */
|
|
168
162
|
const headlineNode = titleNode && meta
|
|
169
|
-
? <div className="flex self-stretch items-baseline justify-between gap-6">{titleNode}<span className={
|
|
163
|
+
? <div className="flex self-stretch items-baseline justify-between gap-6">{titleNode}<span className={`kol-mono-12 text-meta shrink-0`}>{meta}</span></div>
|
|
170
164
|
: titleNode
|
|
171
165
|
const bodyNode = body && (typeof body === 'string'
|
|
172
166
|
? <p className={cls(bodyClass, 'body')} style={slotStyle.body}>{body}</p>
|
|
@@ -219,3 +213,55 @@ export default function SectionText({
|
|
|
219
213
|
</div>
|
|
220
214
|
)
|
|
221
215
|
}
|
|
216
|
+
|
|
217
|
+
/* kolbox's title row (W31.2 batch 5), below */
|
|
218
|
+
function SectionTextKolbox({ headline, menu, actions, className = '' }) {
|
|
219
|
+
/* kolbox (plan-2026-11-18-kolbox-system W31.2 batch 5, 2026-11-18): kolbox's BrowserTitleRow (Figma `BrowserTitleRow`),
|
|
220
|
+
* carried from apps/kolbox/src/home/BrowserTitleRow.jsx: 64 high, 12 under the top bar, inset 32; the 40 folder glyph,
|
|
221
|
+
* the `headline` (22 / 28, read off the Figma build) and its `menu` (the chevron node) at the left; `actions` (the
|
|
222
|
+
* filters and the view switch) at the right. Under 768 it wraps. */
|
|
223
|
+
return (
|
|
224
|
+
<div className={`kol-section-text--kolbox mt-3 flex h-16 shrink-0 items-center gap-4 px-8 max-md:h-auto max-md:flex-wrap max-md:gap-y-2 max-md:px-4 ${className}`.trim()} data-browser-title-row>
|
|
225
|
+
<KolboxGlyph name="folder" size={40} className="kol-section-text-glyph" />
|
|
226
|
+
<div className="flex min-w-0 flex-1 items-center gap-1 max-md:flex-wrap">
|
|
227
|
+
<h1 className="kol-section-text-title truncate">{headline}</h1>
|
|
228
|
+
{menu}
|
|
229
|
+
</div>
|
|
230
|
+
<div className="flex shrink-0 items-center gap-2 max-md:w-full max-md:flex-wrap">{actions}</div>
|
|
231
|
+
</div>
|
|
232
|
+
)
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/* folio (Folio batch E, 2026-11-22): Folio's page titles and section heads, carried from apps/folio's FolioShelf (the
|
|
236
|
+
* shelf's title block and its numbered `Heading`) and FolioDocument (a chapter's and an article's head). The `eyebrow`
|
|
237
|
+
* in Folio's label over the `headline` over the `body`, muted; `children` (the document's date row) after the body.
|
|
238
|
+
* `headlineSize` is Folio's type step: `title` (the default, a page's), `chapter` or `section`; `headlineAs` h1 by
|
|
239
|
+
* default. `inline` (Folio's, no twin) sets the three on one baseline row, the numbered section head: the eyebrow its
|
|
240
|
+
* number, `meta` the quiet fact after the headline. `gap` is the rhythm and `slotClass.headline` the headline's extra
|
|
241
|
+
* classes (a title that carries the language flags lays them in a row), as in the default. */
|
|
242
|
+
const FOLIO_HEADLINE = { title: 'kol-folio-title', chapter: 'kol-folio-chapter', section: 'kol-folio-section' }
|
|
243
|
+
function SectionTextFolio({ eyebrow, label, headline, headlineSize = 'title', headlineAs: H = 'h1', body, meta, inline = false, gap = 'gap-[12px]', slotClass = {}, className = '', children }) {
|
|
244
|
+
const eb = eyebrow ?? label
|
|
245
|
+
if (inline) {
|
|
246
|
+
return (
|
|
247
|
+
<div className={`kol-section-text--folio flex items-baseline whitespace-nowrap ${gap} ${className}`.trim()}>
|
|
248
|
+
{eb != null && <p className="kol-folio-label kol-section-text-muted">{eb}</p>}
|
|
249
|
+
<H className={FOLIO_HEADLINE[headlineSize]}>{headline}</H>
|
|
250
|
+
{meta && <p className="kol-folio-meta kol-section-text-muted">{meta}</p>}
|
|
251
|
+
</div>
|
|
252
|
+
)
|
|
253
|
+
}
|
|
254
|
+
return (
|
|
255
|
+
<div className={`kol-section-text--folio flex flex-col ${gap} ${className}`.trim()}>
|
|
256
|
+
{eb != null && <p className="kol-folio-label kol-section-text-muted">{eb}</p>}
|
|
257
|
+
<H className={`${FOLIO_HEADLINE[headlineSize]} ${slotClass.headline ?? ''}`.trim()}>{headline}</H>
|
|
258
|
+
{body && <p className="kol-folio-body kol-section-text-muted">{body}</p>}
|
|
259
|
+
{children}
|
|
260
|
+
</div>
|
|
261
|
+
)
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export default function SectionText(props) {
|
|
265
|
+
if (props.variant === 'folio') return <SectionTextFolio {...props} />
|
|
266
|
+
return props.variant === 'kolbox' ? <SectionTextKolbox {...props} /> : <SectionTextDefault {...props} />
|
|
267
|
+
}
|