@kolkrabbi/kol-component 0.334.0 → 0.336.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.
Files changed (40) hide show
  1. package/package.json +3 -3
  2. package/src/atoms/SectionLabel.jsx +29 -0
  3. package/src/index.js +25 -0
  4. package/src/molecules/ContentRow.jsx +30 -1
  5. package/src/molecules/DocsToc.jsx +16 -1
  6. package/src/molecules/EmptyState.jsx +15 -1
  7. package/src/molecules/FlyoutRow.jsx +10 -0
  8. package/src/molecules/IndexRow.jsx +37 -0
  9. package/src/molecules/LayerRow.jsx +53 -0
  10. package/src/molecules/Modal.jsx +58 -19
  11. package/src/molecules/NoticeBanner.jsx +28 -0
  12. package/src/molecules/QuantityInput.jsx +7 -3
  13. package/src/molecules/QuickLookFrame.jsx +31 -27
  14. package/src/molecules/QuickLookHeader.jsx +60 -0
  15. package/src/molecules/ReadingActions.jsx +31 -0
  16. package/src/molecules/ReadingChapterNav.jsx +38 -0
  17. package/src/molecules/ReadingHighlight.jsx +26 -0
  18. package/src/molecules/ReadingNotes.jsx +39 -0
  19. package/src/molecules/ReadingSettings.jsx +53 -0
  20. package/src/molecules/SectionText.jsx +15 -1
  21. package/src/molecules/SpecList.jsx +21 -1
  22. package/src/molecules/SummaryLine.jsx +18 -0
  23. package/src/molecules/TabsRow.jsx +54 -7
  24. package/src/molecules/TaskRow.jsx +43 -0
  25. package/src/molecules/TocRow.jsx +29 -0
  26. package/src/molecules/TreeRow.jsx +72 -0
  27. package/src/organisms/CalendarDay.jsx +60 -0
  28. package/src/organisms/CalendarMonth.jsx +75 -0
  29. package/src/organisms/CalendarTimeline.jsx +65 -0
  30. package/src/organisms/CalendarWeek.jsx +72 -0
  31. package/src/organisms/MediaLibrary.jsx +55 -0
  32. package/src/organisms/NavDrawer.jsx +67 -0
  33. package/src/organisms/NavRail.jsx +4 -1
  34. package/src/organisms/NavRailFloat.jsx +110 -0
  35. package/src/organisms/ReadingColumn.jsx +42 -0
  36. package/src/organisms/ReadingContents.jsx +54 -0
  37. package/src/organisms/ReadingOverview.jsx +60 -0
  38. package/src/organisms/ReadingPanel.jsx +36 -0
  39. package/src/organisms/Table.jsx +50 -1
  40. package/src/organisms/calendarDates.js +24 -0
@@ -0,0 +1,110 @@
1
+ import { useState } from 'react'
2
+ import { Icon } from '@kolkrabbi/kol-icons'
3
+ import Kbd from '../atoms/Kbd.jsx'
4
+ import TreeRow from '../molecules/TreeRow.jsx'
5
+ import { Tooltip } from '../utilities/Popover.jsx'
6
+
7
+ /* taxonomy-ok: organism — nests TreeRow (molecule) + Kbd (atom) + Tooltip (utility) + kol-icons's Icon. */
8
+
9
+ /**
10
+ * NavRailFloat — the float sidebar, `NavRail variant="float"` (float-everything W9 rows 122 · 127 · 128 · 131,
11
+ * 2026-11-04 — kol-float--style 48:4015 expanded, 48:4277 rail). Its own path: none of the app rail's grab, drag or
12
+ * width token. Two states, the rail's words — EXPANDED (280) and COLLAPSED (72):
13
+ *
14
+ * expanded the switcher row (glyph · title · ⌄, or your `switcher`) · the search capsule (`Search pages ⌘K`) · the
15
+ * tree: a `{ heading }` entry is a section label (`kol-float-ruler`, fg-64, as authored), an item a
16
+ * `TreeRow size="lg"` (40 · 18 glyph · Inter 13 · count · chevron), its `sub` rows `TreeRow size="sm"`
17
+ * indented under it · `footer` at the foot (kol-shell's RailDisplayControls, a theme row)
18
+ * collapsed 44 round slots on a 72 rail, 20 glyphs; the lit slot fg-16 with a 3 × 14 bar at the rail's edge — a
19
+ * section with the current page inside lights too; a heading becomes a 16 gap. Expand on top and search ·
20
+ * hide at the foot, on the well. Each slot names itself in the float Tooltip
21
+ *
22
+ * On `surface-secondary` at the sheet radius, 12 in, full height of its container. Nothing auto-expands: a section
23
+ * opens by its chevron, or by `defaultExpanded`.
24
+ *
25
+ * @param {Array} items `{ heading }` | `{ icon, label, path, count?, sub?: [{ icon, label, path, count? }] }`
26
+ * @param {string} currentPath the active path (exact match)
27
+ * @param {Function} onNavigate `(path) => void`
28
+ * @param {boolean} [collapsed] the 72 rail · {Function} [onCollapsedChange]
29
+ * @param {string} [title] · {string} [icon='grid'] · {Function} [onSwitch] the switcher row; `switcher` replaces it
30
+ * @param {Function} [onSearch] shows the search capsule (and the rail's search slot)
31
+ * @param {Function} [onHide] the rail's hide slot (expanded: put kol-shell's RailDisplayControls in `footer`)
32
+ * @param {Array} [defaultExpanded] paths of sections open at mount
33
+ * @param {ReactNode} [footer]
34
+ */
35
+ const isOn = (path, current) => !!path && path === current
36
+
37
+ export default function NavRailFloat({ items = [], currentPath = '', onNavigate, collapsed = false, onCollapsedChange, title, icon = 'grid', onSwitch, switcher, onSearch, onHide, defaultExpanded = [], footer, className = '' }) {
38
+ const [open, setOpen] = useState(() => new Set(defaultExpanded))
39
+ const toggle = (path) => setOpen((s) => { const n = new Set(s); n.has(path) ? n.delete(path) : n.add(path); return n })
40
+ const go = (path) => () => onNavigate?.(path)
41
+
42
+ if (collapsed) {
43
+ const slot = (key, label, glyph, { on = false, well = false, onClick } = {}) => (
44
+ <Tooltip key={key} label={label} placement="right" variant="float" asChild>
45
+ <button type="button" aria-label={label} aria-current={on ? 'page' : undefined} onClick={onClick}
46
+ className={`relative inline-flex size-11 shrink-0 items-center justify-center rounded-full cursor-pointer focus-visible:outline-none focus-visible:shadow-[var(--kol-float-focus)] ${on ? 'bg-fg-16 text-oq-96' : well ? 'bg-[var(--kol-float-well)] text-oq-64 hover:text-oq-96' : 'text-oq-64 hover:bg-fg-08 hover:text-oq-96'}`}>
47
+ <Icon name={glyph} size={well ? 18 : 20} />
48
+ </button>
49
+ </Tooltip>
50
+ )
51
+ return (
52
+ <nav aria-label="Navigation" className={`flex h-full w-[72px] flex-col items-center gap-1 rounded-[var(--kol-float-menu-r)] bg-surface-secondary py-3.5 ${className}`.trim()}>
53
+ {onCollapsedChange && slot('expand', 'Expand', 'panel-left', { well: true, onClick: () => onCollapsedChange(false) })}
54
+ <div className="flex min-h-0 w-full flex-1 flex-col items-center gap-1 overflow-y-auto py-3 [scrollbar-width:none]">
55
+ {items.map((it, i) => {
56
+ if (it.heading) return i === 0 ? null : <span key={`h${i}`} className="h-4 shrink-0" aria-hidden />
57
+ const on = isOn(it.path, currentPath) || !!it.sub?.some((c) => isOn(c.path, currentPath))
58
+ return (
59
+ <span key={it.path ?? it.label} className="relative flex w-full justify-center">
60
+ {on && <span className="absolute left-[5px] top-1/2 h-3.5 w-[3px] -translate-y-1/2 rounded-full bg-[var(--kol-surface-on-primary)]" aria-hidden />}
61
+ {slot(it.path ?? it.label, it.label, it.icon, { on, onClick: go(it.path) })}
62
+ </span>
63
+ )
64
+ })}
65
+ </div>
66
+ {onSearch && slot('search', 'Search pages', 'search', { well: true, onClick: onSearch })}
67
+ {onHide && slot('hide', 'Hide', 'hamburger', { well: true, onClick: onHide })}
68
+ </nav>
69
+ )
70
+ }
71
+
72
+ return (
73
+ <nav aria-label="Navigation" className={`flex h-full w-[280px] flex-col gap-3 rounded-[var(--kol-float-menu-r)] bg-surface-secondary p-3 ${className}`.trim()}>
74
+ {switcher ?? (title && (
75
+ <button type="button" onClick={onSwitch} className="flex h-10 w-full items-center gap-2.5 rounded-[var(--kol-float-list-r)] px-2.5 text-left cursor-pointer hover:bg-fg-08 focus-visible:outline-none focus-visible:shadow-[var(--kol-float-focus)]">
76
+ <Icon name={icon} size={18} className="shrink-0 text-oq-96" />
77
+ <span className="kol-float-body-lg min-w-0 flex-1 truncate text-fg-emphasis">{title}</span>
78
+ {onSwitch && <Icon name="chevron-down" size={14} className="shrink-0 text-oq-64" />}
79
+ </button>
80
+ ))}
81
+ {onSearch && (
82
+ <button type="button" onClick={onSearch} className="flex h-[var(--kol-float-h-md)] w-full items-center gap-2.5 rounded-full bg-[var(--kol-float-well)] pl-3 pr-2 text-left cursor-pointer hover:bg-fg-08 focus-visible:outline-none focus-visible:shadow-[var(--kol-float-focus)]">
83
+ <Icon name="search" size={16} className="shrink-0 text-oq-64" />
84
+ <span className="kol-float-hint min-w-0 flex-1 truncate text-fg-64">Search pages</span>
85
+ <Kbd size="sm" icon="command">K</Kbd>
86
+ </button>
87
+ )}
88
+ <div className="flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto [scrollbar-width:none]">
89
+ {items.map((it, i) => {
90
+ if (it.heading) return <span key={`h${i}`} className={`kol-float-ruler px-2.5 pb-1 text-fg-64 ${i === 0 ? 'pt-1' : 'pt-4'}`}>{it.heading}</span>
91
+ const kids = it.sub ?? []
92
+ const isOpen = open.has(it.path)
93
+ const childOn = kids.some((c) => isOn(c.path, currentPath))
94
+ return (
95
+ <div key={it.path ?? it.label} className="flex flex-col gap-0.5">
96
+ <TreeRow size="lg" icon={it.icon} label={it.label} count={it.count}
97
+ active={isOn(it.path, currentPath)} open={childOn && isOpen}
98
+ expanded={kids.length ? isOpen : undefined} onToggle={kids.length ? () => toggle(it.path) : undefined}
99
+ onClick={kids.length && !it.to ? () => toggle(it.path) : go(it.to ?? it.path)} />
100
+ {isOpen && kids.map((c) => (
101
+ <TreeRow key={c.path} size="sm" depth={1} icon={c.icon} label={c.label} count={c.count} active={isOn(c.path, currentPath)} onClick={go(c.path)} />
102
+ ))}
103
+ </div>
104
+ )
105
+ })}
106
+ </div>
107
+ {footer && <div className="flex shrink-0 flex-col gap-2">{footer}</div>}
108
+ </nav>
109
+ )
110
+ }
@@ -0,0 +1,42 @@
1
+ import ReadingChapterNav from '../molecules/ReadingChapterNav.jsx'
2
+
3
+ /* taxonomy-ok: organism — the reader's whole text region: position line, head, prose, chapter nav */
4
+
5
+ /**
6
+ * ReadingColumn — The text itself, set for reading (float-everything W11 row 145, 2026-11-04 — kol-float--style W2.9
7
+ * `Reading column`). A column `width` wide (default 760): the position line in `kol-float-ruler` (where in the book ·
8
+ * `125 / 297`), the eyebrow, the title in the reading face at 48 / 1.25, the standfirst in Inter 12 / 1.6 (fg-64),
9
+ * then `children` — the prose, 24 between blocks: paragraphs in the reading face at `size` / `leading` on fg-88, `h2`
10
+ * at 28 / 1.45 on the emphasis ink, a `blockquote` on the fg-04 lift at radius 12, 20 in (the quote at 26 / 1.45, its
11
+ * `cite` in `kol-float-label`), `ol`/`small` as notes in Inter 12 (fg-64); `ReadingHighlight` sits among them. Last the
12
+ * `ReadingChapterNav` from `prev` / `next`. The reading face is the reader's (`font`, default Literata — the consumer
13
+ * loads it; Georgia stands in); the chrome around it stays Inter and JetBrains Mono.
14
+ *
15
+ * @param {ReactNode} [position] the position line's start (`The Waves / Interlude 03`)
16
+ * @param {ReactNode} [page] its end (`125 / 297`)
17
+ * @param {ReactNode} [eyebrow] · {ReactNode} [title] · {ReactNode} [standfirst]
18
+ * @param {ReactNode} children the prose
19
+ * @param {Object} [prev] · {Object} [next] — `ReadingChapterNav`'s sides
20
+ * @param {string} [font] default `'Literata', Georgia, serif`
21
+ * @param {number} [size] px (default 22) · {number} [leading] (default 1.6) · {number} [width] px (default 760)
22
+ * @param {string} [className]
23
+ */
24
+ export default function ReadingColumn({ position, page, eyebrow, title, standfirst, children, prev, next, font = "'Literata', Georgia, serif", size = 22, leading = 1.6, width = 760, className = '' }) {
25
+ return (
26
+ <article className={`mx-auto flex w-full flex-col gap-6 ${className}`.trim()} style={{ maxWidth: width, '--reading-font': font, '--reading-size': `${size}px`, '--reading-leading': leading }}>
27
+ {(position || page) && (
28
+ <div className="flex items-baseline justify-between gap-4">
29
+ <span className="kol-float-ruler truncate uppercase text-fg-64">{position}</span>
30
+ {page && <span className="kol-float-ruler shrink-0 text-[11px] tabular-nums text-fg-64">{page}</span>}
31
+ </div>
32
+ )}
33
+ {eyebrow && <span className="kol-float-ruler mt-4 uppercase text-fg-64">{eyebrow}</span>}
34
+ {title && <h1 className="m-0 -mt-2 text-[48px] font-normal leading-[1.25] text-fg-emphasis [font-family:var(--reading-font)]">{title}</h1>}
35
+ {standfirst && <p className="m-0 font-[family-name:var(--kol-font-family-float)] text-[12px] leading-[1.6] text-fg-64">{standfirst}</p>}
36
+ <div className="flex flex-col gap-6 [&_p]:m-0 [&_p]:text-[length:var(--reading-size)] [&_p]:leading-[var(--reading-leading)] [&_p]:[color:var(--kol-fg-88)] [&_p]:[font-family:var(--reading-font)] [&_h2]:m-0 [&_h2]:mt-2 [&_h2]:text-[28px] [&_h2]:font-normal [&_h2]:leading-[1.45] [&_h2]:[color:var(--kol-fg-emphasis)] [&_h2]:[font-family:var(--reading-font)] [&_blockquote]:m-0 [&_blockquote]:flex [&_blockquote]:flex-col [&_blockquote]:gap-4 [&_blockquote]:rounded-xl [&_blockquote]:[background:var(--kol-fg-04)] [&_blockquote]:p-5 [&_blockquote_p]:text-[26px] [&_blockquote_p]:leading-[1.45] [&_blockquote_p]:[color:var(--kol-fg-emphasis)] [&_cite]:font-[family-name:var(--kol-font-family-float)] [&_cite]:text-[11px] [&_cite]:leading-4 [&_cite]:not-italic [&_cite]:[color:var(--kol-fg-64)] [&_small]:font-[family-name:var(--kol-font-family-float)] [&_small]:text-[12px] [&_small]:leading-[1.6] [&_small]:[color:var(--kol-fg-64)]">
37
+ {children}
38
+ </div>
39
+ {(prev || next) && <ReadingChapterNav prev={prev} next={next} className="mt-2" />}
40
+ </article>
41
+ )
42
+ }
@@ -0,0 +1,54 @@
1
+ import Button from '../atoms/Button.jsx'
2
+ import ProgressBar from '../atoms/ProgressBar.jsx'
3
+ import TocRow from '../molecules/TocRow.jsx'
4
+
5
+ /* taxonomy-ok: organism — the reader's contents sheet: book head, TocRow list, progress */
6
+
7
+ /**
8
+ * ReadingContents — The book's contents, where the reader is in them, and how far through. `Contents · The Waves ·
9
+ * 01 First interlude … · Through the book 42%` (float-everything W11 row 149, 2026-11-04 — kol-float--style W2.9
10
+ * `Contents panel`). A 304 sheet on `surface-secondary` at the sheet radius, 20 in: `Contents` in `kol-float-body-lg`
11
+ * with the fold ⌃, the book in `kol-float-section` over its author (`kol-float-hint`, fg-64), the count in
12
+ * `kol-float-ruler`, then one `TocRow` per chapter (numbered, `current` lifted fg-16), then the progress line —
13
+ * `Through the book` and the share in mono over the float ProgressBar (4px) — and the save state.
14
+ *
15
+ * @param {string} [title] default `Contents`
16
+ * @param {ReactNode} [book] · {ReactNode} [author] · {ReactNode} [count] `9 interludes`
17
+ * @param {Array} chapters `[{ id, label, href? }]`
18
+ * @param {string} [current] the id the reader is in
19
+ * @param {Function} [onSelect] `(id) => void`
20
+ * @param {number} [progress] 0–100; unset, no progress line
21
+ * @param {string} [progressLabel] default `Through the book`
22
+ * @param {ReactNode} [status] `Reading position saved`
23
+ * @param {Function} [onFold]
24
+ * @param {number} [width] default 304
25
+ * @param {string} [className]
26
+ */
27
+ export default function ReadingContents({ title = 'Contents', book, author, count, chapters = [], current, onSelect, progress, progressLabel = 'Through the book', status, onFold, width = 304, className = '' }) {
28
+ return (
29
+ <aside className={`flex flex-col rounded-[var(--kol-float-menu-r)] bg-surface-secondary p-5 ${className}`.trim()} style={{ width }} aria-label={title}>
30
+ <div className="flex h-7 items-center justify-between">
31
+ <span className="kol-float-body-lg text-fg-emphasis">{title}</span>
32
+ {onFold && <Button variant="float" tone="ghost" size="sm" iconOnly="chevron-up" aria-label="Fold" onClick={onFold} className="-mr-1.5" />}
33
+ </div>
34
+ {book && <span className="kol-float-section mt-8 text-fg-emphasis">{book}</span>}
35
+ {author && <span className="kol-float-hint mt-1 text-fg-64">{author}</span>}
36
+ {count && <span className="kol-float-ruler mt-6 uppercase text-fg-64">{count}</span>}
37
+ <nav className="-mx-2 mt-3 flex flex-col gap-1" aria-label={title}>
38
+ {chapters.map((c, i) => (
39
+ <TocRow key={c.id} number={i + 1} label={c.label} href={c.href} current={c.id === current} onClick={onSelect ? () => onSelect(c.id) : undefined} className="h-9" />
40
+ ))}
41
+ </nav>
42
+ {progress != null && (
43
+ <div className="mt-6 flex flex-col gap-3">
44
+ <div className="flex items-center justify-between">
45
+ <span className="kol-float-hint text-fg-64">{progressLabel}</span>
46
+ <span className="kol-float-timecode tabular-nums text-fg-emphasis">{Math.round(progress)}%</span>
47
+ </div>
48
+ <ProgressBar variant="float" value={progress} ariaLabel={progressLabel} />
49
+ </div>
50
+ )}
51
+ {status && <span className="kol-float-label mt-5 text-fg-64">{status}</span>}
52
+ </aside>
53
+ )
54
+ }
@@ -0,0 +1,60 @@
1
+ import Button from '../atoms/Button.jsx'
2
+ import Tag from '../atoms/Tag.jsx'
3
+ import ProgressBar from '../atoms/ProgressBar.jsx'
4
+ import { floatSurfaceClass } from '../utilities/tone.js'
5
+
6
+ /* taxonomy-ok: organism — the book's page: cover, metadata, the saved place, the two ways in */
7
+
8
+ /**
9
+ * ReadingOverview — A book before you open it: cover, what it is, and where you left it (float-everything W11 row 152,
10
+ * 2026-11-04 — kol-float--style W2.9 `Book overview`). The way back as a quiet float capsule over two columns: the
11
+ * `cover` (300 × 420, the consumer's image) and, 52 off it, the title in the reading face at 52 / 1.45, the author in
12
+ * `kol-float-window` (fg-64), the metadata as float Tags (md, 12 apart), the description in `kol-float-body-lg` (fg-64),
13
+ * the saved place as a card on `surface-secondary` at the sheet radius (24 in: `kol-float-ruler` label, the chapter in
14
+ * `kol-float-window`, the page line and share over the float ProgressBar), then `Resume reading →` as the inverted lg
15
+ * capsule beside the secondary one on the float's solid ground (it sits on the page, not a sheet). Stacks under the cover on a phone.
16
+ *
17
+ * @param {Function} [onBack] · {string} [backLabel] default `Back to my library`
18
+ * @param {ReactNode} [cover]
19
+ * @param {ReactNode} title · {ReactNode} [author]
20
+ * @param {string[]} [meta] `['Fiction', 'EPUB', 'Reading']`
21
+ * @param {ReactNode} [description]
22
+ * @param {Object} [place] `{ label?, title, line, progress }` — label default `Your place`, `line` `Page 125 of 297`, progress 0–100
23
+ * @param {Function} [onResume] · {string} [resumeLabel] default `Resume reading`
24
+ * @param {Function} [onCollect] · {string} [collectLabel] default `Add to collection`
25
+ * @param {string} [font] the title's face (default `'Literata', Georgia, serif`)
26
+ * @param {string} [className]
27
+ */
28
+ export default function ReadingOverview({ onBack, backLabel = 'Back to my library', cover, title, author, meta = [], description, place, onResume, resumeLabel = 'Resume reading', onCollect, collectLabel = 'Add to collection', font = "'Literata', Georgia, serif", className = '' }) {
29
+ return (
30
+ <section className={`flex flex-col gap-8 ${className}`.trim()}>
31
+ {onBack && <Button variant="float" tone="ghost" size="sm" iconLeft="arrow-left" onClick={onBack} className="-ml-3 self-start">{backLabel}</Button>}
32
+ <div className="flex flex-col gap-8 md:flex-row md:gap-[52px]">
33
+ {cover && <div className="aspect-[300/420] w-full max-w-[300px] shrink-0 self-start overflow-hidden rounded-sm">{cover}</div>}
34
+ <div className="flex min-w-0 flex-1 flex-col">
35
+ <h1 className="m-0 text-[52px] font-normal leading-[1.45] text-fg-emphasis" style={{ fontFamily: font }}>{title}</h1>
36
+ {author && <span className="kol-float-window mt-3 font-normal text-fg-64">{author}</span>}
37
+ {meta.length > 0 && <div className="mt-5 flex flex-wrap gap-3">{meta.map((m) => <Tag key={m} variant="float" size="md" hash={false}>{m}</Tag>)}</div>}
38
+ {description && <p className="kol-float-body-lg m-0 mt-6 text-fg-64">{description}</p>}
39
+ {place && (
40
+ <div className="mt-10 flex flex-col rounded-[var(--kol-float-menu-r)] bg-surface-secondary px-6 py-4">
41
+ <span className="kol-float-ruler uppercase text-fg-64">{place.label ?? 'Your place'}</span>
42
+ <span className="kol-float-window mt-2 font-normal text-fg-emphasis">{place.title}</span>
43
+ <div className="mt-2 flex items-center justify-between">
44
+ <span className="kol-float-hint text-fg-64">{place.line}</span>
45
+ {place.progress != null && <span className="kol-float-timecode tabular-nums text-fg-emphasis">{Math.round(place.progress)}%</span>}
46
+ </div>
47
+ {place.progress != null && <ProgressBar variant="float" value={place.progress} ariaLabel={place.label ?? 'Your place'} className="mt-2" />}
48
+ </div>
49
+ )}
50
+ {(onResume || onCollect) && (
51
+ <div className="mt-5 flex flex-wrap gap-4">
52
+ {onResume && <Button variant="float" tone="inverted" size="lg" iconRight="arrow-right" onClick={onResume}>{resumeLabel}</Button>}
53
+ {onCollect && <Button variant="float" tone="secondary" size="lg" onClick={onCollect} className={floatSurfaceClass('solid')}>{collectLabel}</Button>}
54
+ </div>
55
+ )}
56
+ </div>
57
+ </div>
58
+ </section>
59
+ )
60
+ }
@@ -0,0 +1,36 @@
1
+ import Button from '../atoms/Button.jsx'
2
+ import TabsRow from '../molecules/TabsRow.jsx'
3
+
4
+ /* taxonomy-ok: organism — the reader's side sheet: header, fold, chip track, body */
5
+
6
+ const TRACK = 'w-full rounded-full bg-[var(--kol-float-well)] p-1 [&>button]:flex-1 [&>button]:justify-center'
7
+
8
+ /**
9
+ * ReadingPanel — The reader's side sheet: Notes and Reading behind one track (float-everything W11 rows 150 · 151,
10
+ * 2026-11-04 — kol-float--style W2.9 `Contextual reading panel`). A 320 sheet on `surface-secondary` at the sheet
11
+ * radius (`--kol-float-menu-r`), 20 in: the title in `kol-float-body-lg` with the fold ⌃ (a quiet float round) at the
12
+ * end, the float chip track under it (fg-16 on the well, the halves equal), then the body — `ReadingNotes` or
13
+ * `ReadingSettings` as `children`. No hairline edge.
14
+ *
15
+ * @param {string} [title] default `Reading panel`
16
+ * @param {Array} [tabs] `[{ value, label }]` (default Notes · Reading)
17
+ * @param {string} [tab] · {Function} [onTab] `(value) => void`
18
+ * @param {Function} [onFold] the ⌃ press; unset, none
19
+ * @param {ReactNode} children the open side's body
20
+ * @param {number} [width] default 320
21
+ * @param {string} [className]
22
+ */
23
+ const TABS = [{ value: 'notes', label: 'Notes' }, { value: 'reading', label: 'Reading' }]
24
+
25
+ export default function ReadingPanel({ title = 'Reading panel', tabs = TABS, tab = 'notes', onTab, onFold, children, width = 320, className = '' }) {
26
+ return (
27
+ <aside className={`flex flex-col rounded-[var(--kol-float-menu-r)] bg-surface-secondary p-5 ${className}`.trim()} style={{ width }} aria-label={title}>
28
+ <div className="flex h-7 items-center justify-between">
29
+ <span className="kol-float-body-lg text-fg-emphasis">{title}</span>
30
+ {onFold && <Button variant="float" tone="ghost" size="sm" iconOnly="chevron-up" aria-label="Fold" onClick={onFold} className="-mr-1.5" />}
31
+ </div>
32
+ <TabsRow variant="float" size="xs" overflow="wrap" tabs={tabs} value={tab} onChange={onTab} ariaLabel={title} className={`mt-4 ${TRACK}`} />
33
+ <div className="mt-6">{children}</div>
34
+ </aside>
35
+ )
36
+ }
@@ -17,6 +17,15 @@ import { INDICATOR } from '../hooks/glyphLadders.js'
17
17
  * sorts itself needs no state from the page. Pass `sortValue(row)` when the
18
18
  * rendered cell is not what should be compared (a chip, a link, a date
19
19
  * string).
20
+ *
21
+ * FLOAT (`variant="float"`, float-everything W8 rows 115 · 116, 2026-11-04 — kol-float--style 48:2780 analytics,
22
+ * 48:3257 catalog): its own render, none of `.kol-table`'s rules. The head in mono (`kol-float-ruler`, 10, uppercase
23
+ * by the table's role) on the emphasis ink; body cells in `kol-float-timecode` (mono 12) on fg-64, or the float sans
24
+ * (`kol-float-hint`) for a column with `sans: true`; 12 · 16 in a cell, no rules between rows (the no-borders law —
25
+ * rows lift fg-08 under the pointer instead). `align: 'right'` right-aligns a column (the numbers, the share). A cell's
26
+ * `render` draws covers and status pills (`Pill variant="float"`) — the catalog's cover · title · status row.
27
+ * `framed` sets it on a sheet (surface-secondary on `--kol-float-menu-r`, 8 in) — the catalog; unframed it sits on
28
+ * whatever float holds it — the analytics card.
20
29
  */
21
30
  const collator = new Intl.Collator(undefined, { numeric: true, sensitivity: 'base' })
22
31
 
@@ -33,7 +42,7 @@ const WIDTHS = {
33
42
  column: '',
34
43
  }
35
44
 
36
- const Table = ({ caption, columns, rows, variant = 'default', className = '', width = 'panel', rowClassName, compact = false, lastRule = false }) => {
45
+ const Table = ({ caption, columns, rows, variant = 'default', className = '', width = 'panel', rowClassName, compact = false, lastRule = false, framed = false }) => {
37
46
  const [sort, setSort] = useState({ key: null, dir: null })
38
47
 
39
48
  const cycle = (key) =>
@@ -55,6 +64,8 @@ const Table = ({ caption, columns, rows, variant = 'default', className = '', wi
55
64
  })
56
65
  }, [rows, columns, sort])
57
66
 
67
+ if (variant === 'float') return <FloatTable caption={caption} columns={columns} rows={sorted} sort={sort} cycle={cycle} framed={framed} rowClassName={rowClassName} className={`${WIDTHS[width] ?? WIDTHS.panel} ${className}`.trim()} />
68
+
58
69
  const variantClass = variant === 'simple' ? 'kol-table--simple' : ''
59
70
  /* compact — record-surface density (RecordManager, 2026-08-09): the default
60
71
  * 12/16 cell box read as bloated rows against the reference table. */
@@ -113,4 +124,42 @@ const Table = ({ caption, columns, rows, variant = 'default', className = '', wi
113
124
  )
114
125
  }
115
126
 
127
+ function FloatTable({ caption, columns, rows, sort, cycle, framed, rowClassName, className }) {
128
+ const align = (c) => (c.align === 'right' ? 'text-right' : 'text-left')
129
+ return (
130
+ <div className={`w-full overflow-x-auto ${framed ? 'rounded-[var(--kol-float-menu-r)] bg-surface-secondary p-2' : ''} ${className}`.trim()}>
131
+ <table className="w-full border-collapse">
132
+ {caption ? <caption className="sr-only">{caption}</caption> : null}
133
+ <thead>
134
+ <tr>
135
+ {columns.map((c) => (
136
+ <th key={c.accessor} scope="col" style={c.style} className={`kol-float-ruler whitespace-nowrap px-4 py-3 font-normal uppercase text-fg-emphasis first:pl-3 ${align(c)}`}
137
+ aria-sort={sort.key === c.accessor ? (sort.dir === 'asc' ? 'ascending' : 'descending') : undefined}>
138
+ {c.sortable ? (
139
+ <button type="button" onClick={() => cycle(c.accessor)} className="inline-flex items-center gap-1 uppercase cursor-pointer">
140
+ {c.header}
141
+ <Icon name={sort.key === c.accessor && sort.dir === 'desc' ? 'arrow-down' : 'arrow-up'} size={10} className={sort.key === c.accessor ? 'text-oq-96' : 'opacity-0'} />
142
+ </button>
143
+ ) : c.header}
144
+ </th>
145
+ ))}
146
+ </tr>
147
+ </thead>
148
+ <tbody>
149
+ {rows.map((row, i) => (
150
+ <tr key={row.id ?? row.token ?? i} className={`group${rowClassName ? ` ${rowClassName(row, i)}` : ''}`}>
151
+ {columns.map((c) => (
152
+ <td key={c.accessor} style={c.style}
153
+ className={`${c.sans ? 'kol-float-hint' : 'kol-float-timecode'} whitespace-nowrap px-4 py-3 text-fg-64 group-hover:bg-fg-08 group-hover:text-fg-emphasis first:rounded-l-[var(--kol-float-list-r)] first:pl-3 last:rounded-r-[var(--kol-float-list-r)] ${align(c)}`}>
154
+ {c.render ? c.render(row) : row[c.accessor] ?? '—'}
155
+ </td>
156
+ ))}
157
+ </tr>
158
+ ))}
159
+ </tbody>
160
+ </table>
161
+ </div>
162
+ )
163
+ }
164
+
116
165
  export default Table
@@ -0,0 +1,24 @@
1
+ /* calendarDates — the four Calendar views' date arithmetic (float-everything W11, 2026-11-04). Dates are local
2
+ * `YYYY-MM-DD` strings or Date objects; weeks start on Monday. Not exported from the package. */
3
+
4
+ export const toDate = (d) => {
5
+ if (d instanceof Date) return new Date(d.getFullYear(), d.getMonth(), d.getDate())
6
+ const [y, m, day] = String(d).split('-').map(Number)
7
+ return new Date(y, (m || 1) - 1, day || 1)
8
+ }
9
+
10
+ export const addDays = (d, n) => new Date(d.getFullYear(), d.getMonth(), d.getDate() + n)
11
+
12
+ export const sameDay = (a, b) => a && b && a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate()
13
+
14
+ /** Monday of the week holding `d` */
15
+ export const weekStart = (d) => addDays(d, -((d.getDay() + 6) % 7))
16
+
17
+ /** whole days from a to b */
18
+ export const daysBetween = (a, b) => Math.round((b - a) / 86400000)
19
+
20
+ export const WEEKDAYS = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
21
+ export const MONTHS = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
22
+
23
+ /** `HH:MM` → hours as a number */
24
+ export const toHours = (t) => { const [h, m = 0] = String(t).split(':').map(Number); return h + m / 60 }