@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.
Files changed (114) hide show
  1. package/package.json +5 -4
  2. package/src/atoms/Badge.jsx +1 -5
  3. package/src/atoms/BezierPathEditor.jsx +1 -1
  4. package/src/atoms/Button.jsx +88 -12
  5. package/src/atoms/Figure.jsx +19 -1
  6. package/src/atoms/FunctionPlot.jsx +1 -1
  7. package/src/atoms/Input.jsx +107 -7
  8. package/src/atoms/Kbd.jsx +42 -2
  9. package/src/atoms/Link.jsx +20 -0
  10. package/src/atoms/OriginPicker.jsx +9 -5
  11. package/src/atoms/Pill.jsx +1 -3
  12. package/src/atoms/ProgressBar.jsx +3 -6
  13. package/src/atoms/SectionFooter.jsx +22 -0
  14. package/src/atoms/SectionHeader.jsx +24 -0
  15. package/src/atoms/SectionLabel.jsx +0 -22
  16. package/src/atoms/SizeOrDownload.jsx +1 -1
  17. package/src/atoms/Tag.jsx +4 -7
  18. package/src/atoms/Textarea.jsx +12 -7
  19. package/src/atoms/ToggleCheckbox.jsx +25 -5
  20. package/src/atoms/ToggleSwitch.jsx +41 -7
  21. package/src/atoms/ViewToggle.jsx +2 -29
  22. package/src/atoms/XYPad.jsx +25 -0
  23. package/src/hooks/useDragResize.js +1 -1
  24. package/src/index.js +26 -4
  25. package/src/molecules/AccountMenu.jsx +16 -3
  26. package/src/molecules/AlignmentGrid.jsx +13 -1
  27. package/src/molecules/ButtonGroup.jsx +78 -15
  28. package/src/molecules/ButtonSplit.jsx +75 -28
  29. package/src/molecules/Chip.jsx +26 -0
  30. package/src/molecules/CodeBlock.jsx +39 -2
  31. package/src/molecules/ColorInputRow.jsx +125 -4
  32. package/src/molecules/ColorSwatch.jsx +43 -2
  33. package/src/molecules/ContentCard.jsx +104 -3
  34. package/src/molecules/ContentMedia.jsx +1 -1
  35. package/src/molecules/ContentRow.jsx +4 -32
  36. package/src/molecules/ContextMenu.jsx +0 -1
  37. package/src/molecules/DividerLabel.jsx +19 -0
  38. package/src/molecules/DocsToc.jsx +1 -16
  39. package/src/molecules/Dropdown.jsx +115 -18
  40. package/src/molecules/DropdownStepper.jsx +29 -0
  41. package/src/molecules/EmptyState.jsx +1 -15
  42. package/src/molecules/FieldPair.jsx +41 -2
  43. package/src/molecules/Header.jsx +4 -4
  44. package/src/molecules/IndexRow.jsx +1 -1
  45. package/src/molecules/InlineAddRow.jsx +2 -2
  46. package/src/molecules/LabeledControl.jsx +56 -11
  47. package/src/molecules/LayerRow.jsx +1 -1
  48. package/src/molecules/LinkAddRow.jsx +5 -7
  49. package/src/molecules/Menu.jsx +250 -33
  50. package/src/molecules/MenuFloat.jsx +6 -12
  51. package/src/molecules/MenuList.jsx +5 -11
  52. package/src/molecules/Modal.jsx +228 -55
  53. package/src/molecules/ModalHeader.jsx +12 -20
  54. package/src/molecules/ModalShell.jsx +20 -10
  55. package/src/molecules/NoticeBanner.jsx +1 -1
  56. package/src/molecules/OptionRow.jsx +1 -1
  57. package/src/molecules/PanelsMenu.jsx +2 -2
  58. package/src/molecules/ParamBindDot.jsx +29 -2
  59. package/src/molecules/PasswordInput.jsx +1 -1
  60. package/src/molecules/QuantityInput.jsx +45 -13
  61. package/src/molecules/QuickLookFrame.jsx +2 -31
  62. package/src/molecules/RailHeader.jsx +37 -16
  63. package/src/molecules/ReadingActions.jsx +2 -2
  64. package/src/molecules/ReadingNotes.jsx +3 -3
  65. package/src/molecules/ReadingSettings.jsx +8 -8
  66. package/src/molecules/SearchInput.jsx +4 -5
  67. package/src/molecules/SectionText.jsx +56 -10
  68. package/src/molecules/SettingsControls.jsx +23 -23
  69. package/src/molecules/Slider.jsx +103 -55
  70. package/src/molecules/SpecList.jsx +1 -21
  71. package/src/molecules/SplitToolButton.jsx +4 -6
  72. package/src/molecules/SwatchControls.jsx +28 -0
  73. package/src/molecules/SwatchGrid.jsx +39 -0
  74. package/src/molecules/TabsDocument.jsx +131 -0
  75. package/src/molecules/TabsRow.jsx +40 -50
  76. package/src/molecules/TaskRow.jsx +2 -2
  77. package/src/molecules/Toast.jsx +55 -0
  78. package/src/molecules/TocRow.jsx +1 -1
  79. package/src/molecules/TreeRow.jsx +87 -1
  80. package/src/molecules/WorkspaceSwitcher.jsx +3 -6
  81. package/src/organisms/AppItemMenuProvider.jsx +2 -2
  82. package/src/organisms/ColorPickerPopover.jsx +133 -4
  83. package/src/organisms/ColumnBrowser.jsx +1 -1
  84. package/src/organisms/CommandOverlay.jsx +362 -87
  85. package/src/organisms/ContentFilters.jsx +4 -12
  86. package/src/organisms/FindBar.jsx +70 -0
  87. package/src/organisms/FramedMediaBand.jsx +2 -2
  88. package/src/organisms/GalleryCarousel.jsx +1 -1
  89. package/src/organisms/LogoSystem.jsx +38 -0
  90. package/src/organisms/LogoTuner.jsx +32 -0
  91. package/src/organisms/MediaLibrary.jsx +1 -56
  92. package/src/organisms/MediaLibraryPages.jsx +1 -1
  93. package/src/organisms/NavRail.jsx +1 -4
  94. package/src/organisms/Rail.jsx +33 -1
  95. package/src/organisms/RailSwitcher.jsx +62 -0
  96. package/src/organisms/ReadingContents.jsx +65 -3
  97. package/src/organisms/ReadingOverview.jsx +5 -5
  98. package/src/organisms/ReadingPanel.jsx +1 -1
  99. package/src/organisms/SectionSplit.jsx +1 -1
  100. package/src/organisms/SettingsPanel.jsx +64 -41
  101. package/src/organisms/ShortcutsOverlay.jsx +46 -2
  102. package/src/organisms/SpectrumControls.jsx +112 -19
  103. package/src/organisms/StatusBar.jsx +30 -0
  104. package/src/organisms/Table.jsx +136 -45
  105. package/src/organisms/TimelineDock.jsx +281 -1
  106. package/src/organisms/logoBoard.jsx +61 -0
  107. package/src/utilities/AssetPlaceholder.jsx +1 -1
  108. package/src/utilities/EditorShell.jsx +42 -1
  109. package/src/utilities/OverlayGlassPanel.jsx +1 -1
  110. package/src/utilities/Popover.jsx +299 -5
  111. package/src/utilities/SelectionOverlay.jsx +60 -31
  112. package/src/utilities/kolboxGlyph.jsx +10 -0
  113. package/src/molecules/FloatModuleHeader.jsx +0 -11
  114. package/src/organisms/NavRailFloat.jsx +0 -139
@@ -1,139 +0,0 @@
1
- import { useState } from 'react'
2
- import { IconLoader } from '@kolkrabbi/kol-icons'
3
- import Kbd from '../atoms/Kbd.jsx'
4
- import TreeRow from '../molecules/TreeRow.jsx'
5
- import RailFloat from '../molecules/RailFloat.jsx'
6
- import { LabeledControlSection } from './SettingsPanel.jsx'
7
- import { Tooltip } from '../utilities/Popover.jsx'
8
- import { floatMotion } from '../utilities/motion.js'
9
-
10
- /* taxonomy-ok: organism — nests RailFloat + TreeRow (molecules) + LabeledControlSection (organism) + Kbd (atom) + Tooltip (utility) + kol-icons's Icon. */
11
-
12
- /**
13
- * NavRailFloat — the float sidebar, `NavRail variant="float"` (float-everything W9 rows 122 · 127 · 128 · 131,
14
- * 2026-11-04 — kol-float--style 48:4015 expanded, 48:4277 rail). Its own path: none of the app rail's grab, drag or
15
- * width token. Two states, the rail's words — EXPANDED (264) and COLLAPSED (72):
16
- *
17
- * expanded the switcher row — Header variant="nav" (glyph · title · ⌄ 12, or your `switcher`) · the search capsule (`Search pages ⌘K`) · the
18
- * tree: a `{ heading }` entry opens a group, a float `LabeledControlSection` whose label is the heading
19
- * (`kol-float-ruler`, fg-64, as authored) over the items under it; an item a
20
- * `TreeRow size="lg"` (40 · 18 glyph · Inter 13 · count · chevron), its `sub` rows `TreeRow size="sm"`
21
- * indented under it · `footer` at the foot (kol-shell's RailDisplayControls, a theme row)
22
- * 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
23
- * section with the current page inside lights too; each group is a LabeledControlSection without its
24
- * label, 24 apart. Expand on top and search ·
25
- * hide at the foot, on the well. Each slot names itself in the float Tooltip
26
- *
27
- * On `surface-secondary` lifted by the float shadow (`--kol-shadow-float`, the pill's and the card's — FloatRailOverlayShadowRestore,
28
- * 2026-11-04) at the sheet radius, 12 in, full height of its container. Nothing auto-expands: a section
29
- * opens by its chevron, or by `defaultExpanded`.
30
- *
31
- * @param {Array} items `{ heading }` | `{ icon, label, path, count?, sub?: [{ icon, label, path, count? }] }`
32
- * @param {string} currentPath the active path (exact match)
33
- * @param {Function} onNavigate `(path) => void`
34
- * @param {boolean} [collapsed] the 72 rail · {Function} [onCollapsedChange]
35
- * @param {string} [title] · {string} [icon='grid'] · {Function} [onSwitch] the switcher row; `switcher` replaces it
36
- * @param {Function} [onSearch] shows the search capsule (and the rail's search slot)
37
- * @param {Function} [onHide] the rail's hide slot (expanded: put kol-shell's RailDisplayControls in `footer`)
38
- * @param {Array} [defaultExpanded] paths of sections open at mount
39
- * @param {ReactNode} [footer]
40
- * @param {Function} [onItemHover] collapsed only: `(item, element)` when the pointer enters a slot, `(null, null)` when it
41
- * leaves — the seam a hover flyout hangs off (kol-shell's RailFlyout, FloatLayout 2026-11-04)
42
- * @param {boolean} [collapsibleV] the collapse-v chevron beside the switcher row (plan-2026-11-12-one-header W2.1): the rail
43
- * collapses up to RailFloat's pill — `title` and ⌄ at the expanded width — apart from its
44
- * 72 collapse and its hide. `collapsedV` controlled, `defaultCollapsedV` uncontrolled,
45
- * `onCollapseV(collapsedV)`. Deprecated aliases: `foldable` · `folded` · `defaultFolded` · `onFold`
46
- * @param {boolean|Object} [motion=true] expand ↔ collapse eases the width and fades the new rows in, and the slots and rows ease
47
- * their hover (`.kol-float-rail`, FloatActionStatesAndMotion 2026-11-04): `true` the
48
- * `--kol-float-*` tokens · `false` none · `{ duration, ease }` per app. Hide and show are
49
- * FloatLayout's (it holds the rail while it leaves)
50
- */
51
- const isOn = (path, current) => !!path && path === current
52
- /* the flat item list in groups: the items before the first `{ heading }`, then each heading with the items under it —
53
- * each group one float LabeledControlSection (plan-2026-11-12-float-rails-figma W10.1), never a loose heading */
54
- const groupsOf = (items) => {
55
- const out = [{ items: [] }]
56
- for (const it of items) it.heading ? out.push({ heading: it.heading, items: [] }) : out[out.length - 1].items.push(it)
57
- return out[0].items.length ? out : out.slice(1)
58
- }
59
-
60
- export default function NavRailFloat({ items = [], currentPath = '', onNavigate, collapsed = false, onCollapsedChange, title, icon = 'grid', onSwitch, switcher, onSearch, onHide, defaultExpanded = [], footer, onItemHover, motion = true, collapsibleV, collapsedV, defaultCollapsedV, onCollapseV, foldable, folded, defaultFolded, onFold, className = '' }) {
61
- const motionStyle = floatMotion(motion).style
62
- const [open, setOpen] = useState(() => new Set(defaultExpanded))
63
- const toggle = (path) => setOpen((s) => { const n = new Set(s); n.has(path) ? n.delete(path) : n.add(path); return n })
64
- const go = (path) => () => onNavigate?.(path)
65
-
66
- if (collapsed) {
67
- const slot = (key, label, glyph, { on = false, well = false, onClick } = {}) => (
68
- <Tooltip key={key} label={label} placement="right" variant="float" asChild>
69
- <button type="button" aria-label={label} aria-current={on ? 'page' : undefined} onClick={onClick}
70
- 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'}`}>
71
- <IconLoader name={glyph} size={well ? 18 : 20} />
72
- </button>
73
- </Tooltip>
74
- )
75
- return (
76
- <RailFloat as="nav" aria-label="Navigation" inset="none" width="var(--kol-shell-float-rail-width, 72px)" style={motionStyle} bodyClassName="items-center !gap-1"
77
- className={`kol-float-rail h-full !gap-1 items-center py-3.5 ${className}`.trim()}>
78
- {onCollapsedChange && slot('expand', 'Expand', 'panel-left', { well: true, onClick: () => onCollapsedChange(false) })}
79
- <div className="flex min-h-0 w-full flex-1 flex-col gap-6 overflow-y-auto py-3 [scrollbar-width:none]">
80
- {groupsOf(items).map((g, gi) => (
81
- <LabeledControlSection key={gi} variant="float" rowGap={1} className="w-full">
82
- {g.items.map((it) => {
83
- const on = isOn(it.path, currentPath) || !!it.sub?.some((c) => isOn(c.path, currentPath))
84
- return (
85
- <span key={it.path ?? it.label} className="relative flex w-full justify-center"
86
- onMouseEnter={onItemHover && ((e) => onItemHover(it, e.currentTarget))} onMouseLeave={onItemHover && (() => onItemHover(null, null))}>
87
- {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 />}
88
- {slot(it.path ?? it.label, it.label, it.icon, { on, onClick: go(it.path) })}
89
- </span>
90
- )
91
- })}
92
- </LabeledControlSection>
93
- ))}
94
- </div>
95
- {onSearch && slot('search', 'Search pages', 'search', { well: true, onClick: onSearch })}
96
- {onHide && slot('hide', 'Hide', 'hamburger', { well: true, onClick: onHide })}
97
- </RailFloat>
98
- )
99
- }
100
-
101
- return (
102
- <RailFloat as="nav" aria-label="Navigation" inset="sm" width="var(--kol-shell-float-rail-open, 264px)" style={motionStyle}
103
- headerVariant="nav" icon={icon} onSwitch={onSwitch} title={title} head={switcher}
104
- collapsibleV={collapsibleV ?? foldable} collapsedV={collapsedV ?? folded} defaultCollapsedV={defaultCollapsedV ?? defaultFolded} onCollapseV={onCollapseV ?? onFold}
105
- bodyClassName="!gap-3" className={`kol-float-rail h-full !gap-3 ${className}`.trim()}
106
- footer={footer && <div className="flex shrink-0 flex-col gap-2">{footer}</div>}>
107
- {onSearch && (
108
- <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)] px-3 text-left cursor-pointer hover:bg-fg-08 focus-visible:outline-none focus-visible:shadow-[var(--kol-float-focus)]">
109
- <IconLoader name="search" size={16} className="shrink-0 text-oq-64" />
110
- <span className="kol-float-hint min-w-0 flex-1 truncate text-fg-64">Search pages</span>
111
- <Kbd size="sm" icon="command">K</Kbd>
112
- </button>
113
- )}
114
- <div className="flex min-h-0 flex-1 flex-col gap-[18px] overflow-y-auto [scrollbar-width:none]">
115
- {groupsOf(items).map((g, gi) => (
116
- <LabeledControlSection key={gi} variant="float" gap={1.5} rowGap={0.5} className={gi === 0 && g.heading ? 'pt-1' : ''}
117
- label={g.heading && <span className="kol-float-ruler px-2.5 text-fg-64">{g.heading}</span>}>
118
- {g.items.map((it) => {
119
- const kids = it.sub ?? []
120
- const isOpen = open.has(it.path)
121
- const childOn = kids.some((c) => isOn(c.path, currentPath))
122
- return (
123
- <div key={it.path ?? it.label} className="flex flex-col gap-0.5">
124
- <TreeRow size="lg" icon={it.icon} label={it.label} count={it.count}
125
- active={isOn(it.path, currentPath)} open={childOn && isOpen}
126
- expanded={kids.length ? isOpen : undefined} onToggle={kids.length ? () => toggle(it.path) : undefined}
127
- onClick={kids.length && !it.to ? () => toggle(it.path) : go(it.to ?? it.path)} />
128
- {isOpen && kids.map((c) => (
129
- <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)} />
130
- ))}
131
- </div>
132
- )
133
- })}
134
- </LabeledControlSection>
135
- ))}
136
- </div>
137
- </RailFloat>
138
- )
139
- }