@kolkrabbi/kol-component 0.333.3 → 0.334.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kolkrabbi/kol-component",
3
- "version": "0.333.3",
3
+ "version": "0.334.0",
4
4
  "description": "The core component library",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -29,8 +29,8 @@
29
29
  "embla-carousel-react": "^8.6.0",
30
30
  "pdfjs-dist": "^6.3.289",
31
31
  "react-syntax-highlighter": "^16.1.1",
32
- "@kolkrabbi/kol-search": "^0.3.0",
33
32
  "@kolkrabbi/kol-growth": "^0.5.0",
33
+ "@kolkrabbi/kol-search": "^0.3.0",
34
34
  "@kolkrabbi/kol-markdown": "^0.2.0"
35
35
  },
36
36
  "peerDependencies": {
@@ -42,7 +42,7 @@
42
42
  "react-dom": "^18.3.0 || ^19.0.0"
43
43
  },
44
44
  "devDependencies": {
45
- "@kolkrabbi/kol-icons": "^0.60.0"
45
+ "@kolkrabbi/kol-icons": "^0.61.0"
46
46
  },
47
47
  "files": [
48
48
  "src",
@@ -3,6 +3,9 @@
3
3
  *
4
4
  * Converted from Badge.tsx (shadcn/CVA) → plain JSX with kol- CSS variables.
5
5
  * CSS classes live in components.css under 2-LABELS → Badges.
6
+ *
7
+ * `variant="float"` (float-everything W2 row 18, 2026-11-04): the count capsule — 26 tall, 10 in, Inter 500 on
8
+ * oq-16 — `3 effects`. The status tones keep today's look.
6
9
  */
7
10
 
8
11
  import { Icon } from '@kolkrabbi/kol-icons'
@@ -19,7 +22,8 @@ const VARIANT_MAP = {
19
22
  outline: 'kol-badge-outline',
20
23
  success: 'kol-badge-success',
21
24
  warning: 'kol-badge-warning',
22
- info: 'kol-badge-info'
25
+ info: 'kol-badge-info',
26
+ float: 'kol-badge-float'
23
27
  }
24
28
 
25
29
  const SIZE_MAP = {
@@ -2,6 +2,7 @@ import { isValidElement } from 'react'
2
2
  import { toneClass, VARIANT_TONE } from '../utilities/tone.js'
3
3
  import { Icon } from '@kolkrabbi/kol-icons'
4
4
  import { glyphSize } from '../hooks/glyphLadders.js'
5
+ import Kbd from './Kbd.jsx'
5
6
 
6
7
  /**
7
8
  * Button — canonical KOL button. Emits kol-btn* classes (CSS in @kol/theme).
@@ -35,6 +36,7 @@ import { glyphSize } from '../hooks/glyphLadders.js'
35
36
  * @param {boolean} props.selected - Selected/active state (toggle highlight)
36
37
  * @param {ElementType|ReactNode} props.iconComponent - Icon renderer seam — a component that receives `{ name, size, className, style }` in place of the DS Icon (custom icon registries plug in here), or a pre-rendered node dropped in verbatim where the glyph would go. Defaults to DS Icon.
37
38
  * @param {boolean} props.pressed - Toggle state — sets `aria-pressed` (true/false) and `kol-btn-pressed`; a `quiet` button drops its dimming while pressed. Leave undefined for non-toggle buttons.
39
+ * @param {string} props.kbd - a key cap after the label, inside the button (float-everything W2 row 12, 2026-11-04): `Kbd size="sm"`, a leading ⌘ drawn as the `command` icon. On `variant="float"` the cap takes the button's own ink (`.kol-btn-kbd`). The float roles are tones (W0.5): primary `tone="inverted"` · secondary `tone="secondary"` · quiet `tone="ghost"` · destructive `tone="danger"` — `danger` is accepted as a tone on a float button so the role and the shape are two props.
38
40
  */
39
41
  const warned = new Set()
40
42
 
@@ -63,6 +65,7 @@ const Button = ({
63
65
  iconComponent,
64
66
  pressed,
65
67
  tone = 'default',
68
+ kbd,
66
69
  ...props
67
70
  }) => {
68
71
  /* `variant="bare"` (MetricRebuild, 2026-10-31): a pressable SURFACE — a stat tile, a bar row, a column head — that
@@ -136,7 +139,9 @@ const Button = ({
136
139
  /* `tone="sunken"` (ControlToneSunken, 2026-08-28): the dark well + fg-96 ink of the control set, so an
137
140
  * icon-only button beside a sunken Dropdown is declared, not painted (kol-website hand-wrote the fill
138
141
  * AND guessed the ink — the secondary's dark ink vanished on the forced dark fill). Theme rules. */
139
- const toneCls = toneClass(tone)
142
+ /* `tone="danger"` is the float's destructive role (W0.5): the danger bundle is a variant's, worn here as a tone so
143
+ * `variant="float"` keeps the shape slot */
144
+ const toneCls = tone === 'danger' ? 'kol-btn-danger' : toneClass(tone)
140
145
  const combinedClass = `kol-btn ${variantClass} ${sizeClass} ${animateClass} ${quietClass} ${pressedClass} ${iconOnlyClass} ${radiusClass} ${toneCls} ${className}`.trim().replace(/\s+/g, ' ')
141
146
 
142
147
  // Render icon with optional hover state
@@ -172,6 +177,13 @@ const Button = ({
172
177
  )
173
178
  }
174
179
 
180
+ /* the key cap after the label (row 12): ⌘ is drawn, never typed — the Kbd's `command` glyph */
181
+ const cap = kbd != null && (
182
+ typeof kbd === 'string' && kbd.startsWith('⌘')
183
+ ? <Kbd size="sm" icon="command" className="kol-btn-kbd">{kbd.slice(1)}</Kbd>
184
+ : <Kbd size="sm" className="kol-btn-kbd">{kbd}</Kbd>
185
+ )
186
+
175
187
  // Render content with icons
176
188
  const renderContent = () => {
177
189
  // Icon-only button
@@ -189,12 +201,13 @@ const Button = ({
189
201
  {(iconLeft || iconLeftHover) && renderIcon(iconLeft, iconLeftHover)}
190
202
  {children}
191
203
  {(iconRight || iconRightHover) && renderIcon(iconRight, iconRightHover)}
204
+ {cap}
192
205
  </span>
193
206
  )
194
207
  }
195
208
 
196
209
  // Text-only button
197
- return children
210
+ return cap ? <>{children}{cap}</> : children
198
211
  }
199
212
 
200
213
  const mergedStyle = style
@@ -0,0 +1,27 @@
1
+ import { Icon } from '@kolkrabbi/kol-icons'
2
+
3
+ /**
4
+ * Delta — A change against a previous value. `↗ 19.8% from 10,740` (float-everything W2 row 29, 2026-11-04 — the
5
+ * exploration's period comparison under a metric). The change in the float timecode role (mono 12) at the emphasis
6
+ * ink, the arrow a drawn glyph (`arrow-upright` · `arrow-downright`, oq-96 — never a typed ↗), the previous value in
7
+ * the float hint role at fg-64.
8
+ *
9
+ * @param {string|number} value the change, as the caller words it (`19.8%`, `+320`)
10
+ * @param {'up'|'down'|'flat'} direction the arrow (default `up`; `flat` draws none)
11
+ * @param {string|number} [from] the previous value, after "from"
12
+ * @param {string} [fromLabel] the word before the previous value (default `from`)
13
+ * @param {string} [className]
14
+ */
15
+ const ARROW = { up: 'arrow-upright', down: 'arrow-downright' }
16
+
17
+ export default function Delta({ value, direction = 'up', from, fromLabel = 'from', className = '' }) {
18
+ return (
19
+ <span className={`inline-flex items-center gap-2 ${className}`.trim()}>
20
+ <span className="inline-flex items-center gap-1 kol-float-timecode text-fg-emphasis">
21
+ {ARROW[direction] && <Icon name={ARROW[direction]} size={12} className="text-oq-96" />}
22
+ {value}
23
+ </span>
24
+ {from != null && <span className="kol-float-hint text-fg-64">{fromLabel} {from}</span>}
25
+ </span>
26
+ )
27
+ }
@@ -64,6 +64,10 @@ import { glyphSize } from '../hooks/glyphLadders.js'
64
64
  * slotRight — its trailing mirror: an interactive node inside the shell, after the unit /
65
65
  * suffix — a combo field's chevron (the design editor's type size, 2026-09-27: the chevron
66
66
  * sat OUTSIDE the field as a second control). Not aria-hidden: it is a control.
67
+ * error — the field's error (float-everything W3 row 36, 2026-11-04): `true` marks it (`aria-invalid`, the
68
+ * alert-triangle in the error ink at the trailing edge); a string is also the message under the field, in
69
+ * the float hint role (Inter 12) with the info glyph. On the float it is the field's third state beside focus
70
+ * (the 2px ring) and disabled (40%); on the default look the mark and the message are the same.
67
71
  *
68
72
  * Chrome (bg/border/padding/transition/disabled) comes from .kol-control;
69
73
  * Input owns prefix/suffix/icon layout + the inner <input> styling.
@@ -91,6 +95,7 @@ export default function Input({
91
95
  iconSize = null,
92
96
  placeholder,
93
97
  disabled = false,
98
+ error,
94
99
  width,
95
100
  className = '',
96
101
  inputClassName = '',
@@ -161,6 +166,14 @@ export default function Input({
161
166
 
162
167
  const propertyLen = Math.max(String(value ?? placeholder ?? '').length, 1)
163
168
 
169
+ /* the error: a mark inside, a message under (row 36) */
170
+ const errorMark = error ? <span aria-hidden="true" className="kol-control-error flex items-center shrink-0 pl-2 text-[var(--ui-error)]"><Icon name="alert-triangle" size={14} /></span> : null
171
+ const errorText = typeof error === 'string' && error ? (
172
+ <span role="alert" className={`flex items-center gap-1.5 ${resolvedVariant === 'float' ? 'kol-float-label' : 'kol-mono-10'} text-fg-64`}>
173
+ <Icon name="info" size={12} />{error}
174
+ </span>
175
+ ) : null
176
+
164
177
  /* Pin inner input height to the typography token's line-height. Without
165
178
  * this the `<input>` renders ~0.5px taller than the equivalent <button>
166
179
  * or <label> at the same kol-mono-N — Chromium computes input height
@@ -186,11 +199,12 @@ export default function Input({
186
199
  inputClassName,
187
200
  ].filter(Boolean).join(' ')
188
201
 
189
- return (
202
+ const shell = (
190
203
  <label
191
204
  className={shellCls}
192
205
  style={width ? { width: typeof width === 'number' ? `${width}px` : width } : undefined}
193
206
  aria-disabled={disabled || undefined}
207
+ aria-invalid={error ? true : undefined}
194
208
  >
195
209
  {slotLeft && (
196
210
  <span className="flex items-center shrink-0 pr-2">{slotLeft}</span>
@@ -236,6 +250,9 @@ export default function Input({
236
250
  {slotRight && (
237
251
  <span className="flex items-center shrink-0 pl-1 ml-auto">{slotRight}</span>
238
252
  )}
253
+ {errorMark}
239
254
  </label>
240
255
  )
256
+ /* a message under the field wraps the shell; without one the shell is the whole atom, as before */
257
+ return errorText ? <span className="inline-flex flex-col gap-1.5" style={width ? { width: typeof width === 'number' ? `${width}px` : width } : undefined}>{shell}{errorText}</span> : shell
241
258
  }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * LiveDot — A live count with its pulse. `● 8 active visitors` (float-everything W2 row 30, 2026-11-04 — the
3
+ * exploration's live visitors line). An 8px dot in the success ink that breathes (still under reduced motion), the
4
+ * count in mono 32 medium at the emphasis ink, the words in the float body role at fg-72.
5
+ *
6
+ * @param {number|string} count
7
+ * @param {string} [label] the words after the count (`active visitors`)
8
+ * @param {boolean} [live] the dot and its pulse (default true; false draws the count alone)
9
+ * @param {string} [className]
10
+ */
11
+ export default function LiveDot({ count, label, live = true, className = '' }) {
12
+ return (
13
+ <span className={`inline-flex items-center gap-3 ${className}`.trim()}>
14
+ {live && <span aria-hidden="true" className="h-2 w-2 shrink-0 rounded-full bg-[var(--ui-success)] motion-safe:animate-pulse" />}
15
+ <span className="font-mono text-[32px] font-medium leading-none text-fg-emphasis tabular-nums">{count}</span>
16
+ {label && <span className="kol-float-body text-fg-72">{label}</span>}
17
+ </span>
18
+ )
19
+ }
@@ -18,7 +18,7 @@
18
18
  *
19
19
  * @param {Object} props
20
20
  * @param {string} props.children - Text content of the pill
21
- * @param {string} props.variant - Visual variant: 'primary' | 'secondary' | 'inverse' (deprecated aliases: 'subtle' → primary, 'outline' → secondary) (default: 'primary')
21
+ * @param {string} props.variant - Visual variant: 'primary' | 'secondary' | 'inverse' (deprecated aliases: 'subtle' → primary, 'outline' → secondary) (default: 'primary') · `float` (float-everything W2 row 20, 2026-11-04): the status capsule with a value — 28 tall, 16 in, Inter 500 on oq-16 (`Reading · 42%`); it carries its own type, so `size` does nothing to it
22
22
  * @param {string} props.size - Size variant: 'sm' | 'md' | 'lg' (default: 'sm')
23
23
  * @param {string} props.className - Additional classes for customization
24
24
  */
@@ -27,10 +27,12 @@ const Pill = ({ children, variant = 'primary', size = 'sm', className = '' }) =>
27
27
  primary: 'pill-subtle',
28
28
  secondary: 'pill-outline',
29
29
  inverse: 'pill-inverse',
30
+ float: 'pill-float',
30
31
  /* deprecated aliases (pre-2026-07-30 vocabulary) */
31
32
  subtle: 'pill-subtle',
32
33
  outline: 'pill-outline'
33
34
  }
35
+ if (variant === 'float') return <span className={`pill-float ${className}`.trim()}>{children}</span>
34
36
 
35
37
  const sizeClasses = {
36
38
  sm: 'pill-sm',
@@ -7,19 +7,22 @@
7
7
  * @param {number} max default 100
8
8
  * @param {boolean|ReactNode|Function} caption `true` → `value/max`; a node; or `(value, max) => node`; omit for none
9
9
  * @param {'success'|'warning'|'error'|'info'} tone the fill's colour (default the ink)
10
+ * @param {'float'} variant the float track (float-everything W2 row 31, 2026-11-04): 4px, a capsule, oq-16 under
11
+ * the emphasis ink; the caption in the float label role
10
12
  * @param {string} ariaLabel
11
13
  */
12
14
  const TONE = { success: 'var(--ui-success)', warning: 'var(--ui-warning)', error: 'var(--ui-error)', info: 'var(--ui-info)' }
13
15
 
14
- export default function ProgressBar({ value = 0, max = 100, caption, tone, ariaLabel, className = '' }) {
16
+ export default function ProgressBar({ value = 0, max = 100, caption, tone, variant, ariaLabel, className = '' }) {
15
17
  const pct = max > 0 ? Math.max(0, Math.min(100, (value / max) * 100)) : 0
16
18
  const text = caption === true ? `${value}/${max}` : typeof caption === 'function' ? caption(value, max) : caption
19
+ const float = variant === 'float'
17
20
  return (
18
21
  <div className={`flex flex-col gap-1 ${className}`.trim()}>
19
- <div role="progressbar" aria-valuenow={value} aria-valuemin={0} aria-valuemax={max} aria-label={ariaLabel} className="h-1 overflow-hidden rounded bg-fg-08">
20
- <div className="h-full transition-[width] duration-300" style={{ width: `${pct}%`, background: TONE[tone] ?? 'var(--kol-fg-64)' }} />
22
+ <div role="progressbar" aria-valuenow={value} aria-valuemin={0} aria-valuemax={max} aria-label={ariaLabel} className={`h-1 overflow-hidden ${float ? 'rounded-full bg-oq-16' : 'rounded bg-fg-08'}`}>
23
+ <div className={`h-full transition-[width] duration-300 ${float ? 'rounded-full' : ''}`} style={{ width: `${pct}%`, background: TONE[tone] ?? (float ? 'var(--kol-fg-emphasis)' : 'var(--kol-fg-64)') }} />
21
24
  </div>
22
- {text != null && text !== false && <span className="kol-mono-10 text-meta">{text}</span>}
25
+ {text != null && text !== false && <span className={float ? 'kol-float-label text-fg-64' : 'kol-mono-10 text-meta'}>{text}</span>}
23
26
  </div>
24
27
  )
25
28
  }
@@ -29,8 +29,10 @@
29
29
  * strip (canvas alignment, transform cluster); onChange is the
30
30
  * action dispatch.
31
31
  * onChange — handler (newValue) => void
32
- * options — [{ value, label, ariaLabel?, tooltip?, disabled? }] — a cell whose label is not a string
32
+ * options — [{ value, label, ariaLabel?, tooltip?, disabled?, count? }] — a cell whose label is not a string
33
33
  * (a glyph) shows its `ariaLabel` as a KOL Tooltip; `tooltip` overrides it.
34
+ * `count` (float-everything W2 row 26, 2026-11-04): a number after the label, mono one step down,
35
+ * 12 off the label — `Open 5`; drawn on `variant="float"` (`.kol-seg-count`), ignored elsewhere.
34
36
  * `disabled` (kol-fxr 2026-10-09): the cell draws the family's disabled ink
35
37
  * (`aria-disabled`, not the attribute — the tooltip still gives the reason),
36
38
  * refuses the press, and ←/→ step over it. It may still be the current `value`
@@ -120,6 +122,7 @@ export default function SegmentedToggle({ value, onChange, options = [], variant
120
122
  className={['kol-seg-cell', cellType, isActive && 'is-active'].filter(Boolean).join(' ')}
121
123
  >
122
124
  {opt.label}
125
+ {float && opt.count != null && <span className="kol-seg-count">{opt.count}</span>}
123
126
  </button>
124
127
  </Tooltip>
125
128
  )
@@ -0,0 +1,24 @@
1
+ /**
2
+ * SizeChip — A task's size as one letter. `S · M · B` (float-everything W2 row 32, 2026-11-04 — the exploration's
3
+ * task size). A 32 × 28 tile on the float well at the list radius, the letter in mono 11 at fg-64; `active` lifts it
4
+ * on fg-16 at the emphasis ink; with `onClick` it is a button, so a row of three is a pick.
5
+ *
6
+ * @param {string} children the letter (`S`)
7
+ * @param {boolean} [active]
8
+ * @param {Function} [onClick] makes it a <button>
9
+ * @param {string} [className]
10
+ */
11
+ export default function SizeChip({ children, active = false, onClick, className = '', ...rest }) {
12
+ const El = onClick ? 'button' : 'span'
13
+ return (
14
+ <El
15
+ type={onClick ? 'button' : undefined}
16
+ onClick={onClick}
17
+ aria-pressed={onClick ? active : undefined}
18
+ className={`inline-flex h-7 w-8 shrink-0 items-center justify-center rounded-[var(--kol-float-list-r)] font-mono text-[11px] leading-none transition-colors ${active ? 'bg-fg-16 text-fg-emphasis' : 'bg-[var(--kol-float-well)] text-fg-64'} ${onClick ? 'cursor-pointer hover:text-fg-emphasis outline-none focus-visible:[box-shadow:var(--kol-float-focus)]' : ''} ${className}`.replace(/\s+/g, ' ').trim()}
19
+ {...rest}
20
+ >
21
+ {children}
22
+ </El>
23
+ )
24
+ }
package/src/atoms/Tag.jsx CHANGED
@@ -35,12 +35,13 @@ const PALETTE = new Set(['blue', 'teal', 'green', 'yellow', 'red', 'orange', 'pu
35
35
  *
36
36
  * @param {ReactNode} children label content
37
37
  * @param {string} text content fallback when no children (brand SwatchControls)
38
- * @param {string} variant 'primary' | 'secondary' | 'inverse' · `tertiary` = secondary's fill, no outline, mono at fg-80 (2026-08-27)
38
+ * @param {string} variant 'primary' | 'secondary' | 'inverse' · `tertiary` = secondary's fill, no outline, mono at fg-80 (2026-08-27) · `float` (float-everything W2 row 17, 2026-11-04): a 26 capsule in Inter 500, no uppercase, no `#` — rest oq-04, hover oq-08, `active` fg-16; `md` is the filter bar's 30 chip (row 56)
39
39
  * @param {string} size 'xs' | 'sm' | 'md' | 'lg' — `sm` is the default and
40
40
  * should stay the answer; `lg` needs a reason
41
41
  * @param {boolean} active selected state (filter chips)
42
- * @param {boolean} hash prepend `#` (default true); false for plain labels
42
+ * @param {boolean} hash prepend `#` (default true; a float chip never does); false for plain labels
43
43
  * @param {string} icon leading icon name
44
+ * @param {number|string} count a count after the label (float, row 56): mono, one step down
44
45
  * @param {Function} onRemove renders the dismiss affordance
45
46
  * @param {Function} onClick makes it a <button>
46
47
  */
@@ -52,6 +53,7 @@ export default function Tag({
52
53
  active = false,
53
54
  hash = true,
54
55
  icon,
56
+ count,
55
57
  onRemove,
56
58
  onClick,
57
59
  color,
@@ -78,7 +80,10 @@ export default function Tag({
78
80
  inverse: 'kol-tag--inverse',
79
81
  /* secondary's fill, no outline, the mono voice at fg-80 (TagTertiary, 2026-08-27) */
80
82
  tertiary: 'kol-tag--tertiary',
83
+ /* the float capsule (W2 row 17, 2026-11-04) */
84
+ float: 'kol-tag--float',
81
85
  }
86
+ const float = variant === 'float'
82
87
 
83
88
  /* TYPE COMES FROM THE HELPER RAMP (user ruling 2026-08-01). The size classes
84
89
  * hardcoded font-size + font-weight and set no line-height, so a 10px chip
@@ -111,7 +116,8 @@ export default function Tag({
111
116
  onClick={onClick}
112
117
  >
113
118
  {icon && <Icon name={icon} size={iconSize} />}
114
- <span>{hash ? '#' : ''}{content}</span>
119
+ <span>{hash && !float ? '#' : ''}{content}</span>
120
+ {count != null && <span className="kol-tag-count">{count}</span>}
115
121
  {onRemove && (
116
122
  <span
117
123
  role="button"
@@ -8,6 +8,9 @@ import { Icon } from '@kolkrabbi/kol-icons'
8
8
  * variant="filled" (default) — persistent solid bg
9
9
  * variant="ghost" — legacy alias, resolves to outline
10
10
  * variant="outline" — bordered, transparent bg
11
+ * variant="float" — the note field (float-everything W3 row 42, 2026-11-04): the float well on the
12
+ * sheet radius (`--kol-float-menu-r`), Inter 500 at the md float type, 12 / 16 in;
13
+ * the grip stays, the focus ring is the float's
11
14
  *
12
15
  * size="sm" / "md" (default) / "lg" — padding + type class
13
16
  *
@@ -53,7 +56,8 @@ export default function Textarea({
53
56
  `kol-control--${resolvedVariant}`,
54
57
  'kol-control--textarea',
55
58
  `kol-control-${size}`,
56
- SIZE_TYPE[size],
59
+ /* the float note carries its own type (the theme's `.kol-control--float.kol-control--textarea`) */
60
+ resolvedVariant !== 'float' && SIZE_TYPE[size],
57
61
  'relative block w-full',
58
62
  className,
59
63
  ].filter(Boolean).join(' ')
@@ -3,7 +3,10 @@ import React from 'react'
3
3
  /* `variant="media"` (ContentFiltersCollection, kol-r2b2 2026-08-27): inside a
4
4
  * media frame the unchecked hairline vanished over a photo; this variant's
5
5
  * UNCHECKED box carries the media control's solid plate (`--kol-oq-12`) so it
6
- * reads over any image. Checked stays the white plate + black check. */
6
+ * reads over any image. Checked stays the white plate + black check.
7
+ * `variant="float"` (float-everything W2 row 22, 2026-11-04): an 18 plate on oq-08 with no hairline; checked is the
8
+ * bare check glyph on nothing; the label is the float panel role (Inter 13/500); focus ring on the plate, disabled 40%. */
9
+ const VARIANT_CLASS = { media: 'toggle-checkbox--media', float: 'toggle-checkbox--float' }
7
10
  const ToggleCheckbox = ({
8
11
  label,
9
12
  checked = false,
@@ -20,7 +23,7 @@ const ToggleCheckbox = ({
20
23
 
21
24
  return (
22
25
  <label
23
- className={`toggle-checkbox ${variant === 'media' ? 'toggle-checkbox--media' : ''} ${checked ? 'is-active' : ''} ${className}`.replace(/\s+/g, ' ').trim()}
26
+ className={`toggle-checkbox ${VARIANT_CLASS[variant] ?? ''} ${checked ? 'is-active' : ''} ${className}`.replace(/\s+/g, ' ').trim()}
24
27
  {...props}
25
28
  >
26
29
  <input
@@ -34,9 +37,9 @@ const ToggleCheckbox = ({
34
37
  <polyline points="1 5 4 8 11 1" fill="none" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" />
35
38
  </svg>
36
39
  </span>
37
- <span className="toggle-checkbox-label kol-helper-12 tracking-[0.08em]">
40
+ <span className={`toggle-checkbox-label ${variant === 'float' ? 'kol-float-panel' : 'kol-helper-12 tracking-[0.08em]'}`}>
38
41
  {label}
39
- {hint ? <span className="ml-2 opacity-60 tracking-normal kol-helper-10">{hint}</span> : null}
42
+ {hint ? <span className={`ml-2 opacity-60 tracking-normal ${variant === 'float' ? 'kol-float-label' : 'kol-helper-10'}`}>{hint}</span> : null}
40
43
  </span>
41
44
  </label>
42
45
  )
@@ -6,6 +6,9 @@ import React from 'react'
6
6
  * variant="bare" (default) — label + track, no box
7
7
  * variant="primary" — filled shell (surface-secondary), button geometry
8
8
  * variant="outline" — bordered shell (border-oq-16), button geometry
9
+ * variant="float" — the float switch (float-everything W2 row 21, 2026-11-04): a 32 × 20 track with a 14
10
+ * thumb 3 in, off oq-16 / oq-64, on fg-64 / the emphasis ink, the label in Inter 500;
11
+ * one size, the focus ring on the track, disabled 40%
9
12
  *
10
13
  * size="xs" / "sm" / "md" (default) / "lg" — shells match button heights
11
14
  * (22/26/32/40); the track scales with size in all variants. xs is the
@@ -36,12 +39,14 @@ const ToggleSwitch = ({
36
39
  }
37
40
 
38
41
  const resolvedVariant = LEGACY_VARIANTS[variant] || variant
42
+ const float = resolvedVariant === 'float'
39
43
 
40
44
  const cls = [
41
45
  'toggle-switch',
42
46
  `toggle-switch--${resolvedVariant}`,
43
- `toggle-switch--${size}`,
44
- SIZE_TYPE[size],
47
+ /* a float switch is one size and types in Inter (the theme's `.toggle-switch--float`) */
48
+ !float && `toggle-switch--${size}`,
49
+ !float && SIZE_TYPE[size],
45
50
  className,
46
51
  ].filter(Boolean).join(' ')
47
52
 
@@ -0,0 +1,24 @@
1
+ import { Icon } from '@kolkrabbi/kol-icons'
2
+
3
+ /**
4
+ * ValueField — A read-only value in a field's capsule. `○ Open` (float-everything W3 row 45, 2026-11-04 — the
5
+ * exploration's task status). The float field's shape — a 36 capsule on the float well, 16 in, Inter 500 — with no
6
+ * input in it: a value the row shows and the user does not type (a status, a kind, an owner). A glyph before it
7
+ * (`icon`, 14, oq-64) or any node (`prefix`). Sizes are the float heights.
8
+ *
9
+ * @param {ReactNode} children the value
10
+ * @param {string} [icon] a kol-icons name before the value
11
+ * @param {ReactNode} [prefix] a node before the value, in place of `icon`
12
+ * @param {'sm'|'md'|'lg'} [size] the float height (default md)
13
+ * @param {string} [className]
14
+ */
15
+ const H = { sm: 'h-[var(--kol-float-h-sm)] px-3 text-[length:var(--kol-float-t-sm)]', md: 'h-[var(--kol-float-h-md)] px-4 text-[length:var(--kol-float-t-md)]', lg: 'h-[var(--kol-float-h-lg)] px-5 text-[length:var(--kol-float-t-lg)]' }
16
+
17
+ export default function ValueField({ children, icon, prefix, size = 'md', className = '', ...rest }) {
18
+ return (
19
+ <span className={`inline-flex items-center gap-2 rounded-full bg-[var(--kol-float-well)] font-[family-name:var(--kol-font-family-float)] font-medium leading-none text-fg-emphasis ${H[size] ?? H.md} ${className}`.trim()} {...rest}>
20
+ {prefix ?? (icon && <Icon name={icon} size={14} className="text-oq-64" />)}
21
+ {children}
22
+ </span>
23
+ )
24
+ }
@@ -15,6 +15,10 @@ import { Tooltip } from '../utilities/Popover.jsx'
15
15
  * option's label; active = on (kol-control--filled),
16
16
  * inactive = off (bare text). Use for compact on/off
17
17
  * where a segmented two-button toggle is overkill.
18
+ * variant="float" — the float rounds (float-everything W2 row 35, 2026-11-04): each option a 32 circle, 4 apart,
19
+ * no well; a glyph (`icon`, 16) or a label (Inter 11/500 — a page number); the lit one fg-16
20
+ * on the emphasis ink, the rest fg-64 with an fg-08 hover; the float focus ring. Pagination and
21
+ * the view switch are one shape.
18
22
  *
19
23
  * Built on the .kol-control shell. Default options use grid / view-list
20
24
  * icons; consumers can pass `options` to override. `iconVariant` picks the
@@ -50,6 +54,29 @@ const ViewToggle = ({
50
54
  const isIconVariant = variant === 'icon'
51
55
  const isSingleVariant = variant === 'single'
52
56
 
57
+ if (variant === 'float') {
58
+ return (
59
+ <div className={`kol-view-toggle--float inline-flex items-center gap-1 ${className}`.trim()}>
60
+ {options.map((option) => {
61
+ const active = option.onClick ? !!option.pressed : viewMode === option.value
62
+ const button = (
63
+ <button
64
+ key={option.value}
65
+ type="button"
66
+ onClick={option.onClick ?? (() => onViewChange(option.value))}
67
+ aria-label={option.icon ? option.label : undefined}
68
+ aria-pressed={option.onClick && option.pressed == null ? undefined : active}
69
+ className={`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full transition-colors cursor-pointer kol-float-label font-medium ${active ? 'bg-fg-16 text-fg-emphasis' : 'text-fg-64 hover:bg-fg-08 hover:text-fg-emphasis'}`}
70
+ >
71
+ {option.icon ? <Icon name={option.icon} size={16} variant={iconVariant} /> : option.label}
72
+ </button>
73
+ )
74
+ return option.icon ? <Tooltip key={option.value} label={option.label}>{button}</Tooltip> : button
75
+ })}
76
+ </div>
77
+ )
78
+ }
79
+
53
80
  if (isSingleVariant) {
54
81
  const [offOpt, onOpt] = options
55
82
  const isOn = viewMode === onOpt.value
package/src/index.js CHANGED
@@ -72,6 +72,19 @@ export { default as SegmentedToggle } from './atoms/SegmentedToggle.jsx'
72
72
  export { default as VariantsControl } from './molecules/VariantsControl.jsx'
73
73
  export { default as Stepper } from './molecules/Stepper.jsx'
74
74
  export { default as Kbd } from './atoms/Kbd.jsx'
75
+ /* the float parts (float-everything W2 · W3 · W4, 2026-11-04) */
76
+ export { default as Delta } from './atoms/Delta.jsx'
77
+ export { default as LiveDot } from './atoms/LiveDot.jsx'
78
+ export { default as SizeChip } from './atoms/SizeChip.jsx'
79
+ export { default as ValueField } from './atoms/ValueField.jsx'
80
+ export { default as FieldPair } from './molecules/FieldPair.jsx'
81
+ export { default as PasswordInput } from './molecules/PasswordInput.jsx'
82
+ export { default as InlineAddRow } from './molecules/InlineAddRow.jsx'
83
+ export { default as LinkAddRow } from './molecules/LinkAddRow.jsx'
84
+ export { default as ColorField } from './molecules/ColorField.jsx'
85
+ export { default as PanelsMenu } from './molecules/PanelsMenu.jsx'
86
+ export { default as WorkspaceSwitcher } from './molecules/WorkspaceSwitcher.jsx'
87
+ export { default as AccountMenu } from './molecules/AccountMenu.jsx'
75
88
  export { default as OptionRow } from './molecules/OptionRow.jsx'
76
89
  export { default as Tag } from './atoms/Tag.jsx'
77
90
  export { default as Textarea } from './atoms/Textarea.jsx'
@@ -0,0 +1,27 @@
1
+ import Avatar from '../atoms/Avatar.jsx'
2
+ import { Menu, MenuTrigger } from './Menu.jsx'
3
+
4
+ /**
5
+ * AccountMenu — The account's circle and its menu. `(A) ⌄ Profile · Settings · Sign out` (float-everything W4 row 60,
6
+ * 2026-11-04 — the exploration's 36 avatar button; KOL had Avatar and Menu, never composed). The trigger is a float
7
+ * icon-only circle (36, the md float height): the `Avatar` when there is an `initial` or a `src`, the `user` glyph
8
+ * when there is neither; lit while the menu is open. The menu is `Menu`'s rows as data (`items`), right-aligned
9
+ * under the circle, in the float look — a `Sign out` row takes `tone: 'danger'`.
10
+ *
11
+ * @param {string} [initial] the avatar's letter
12
+ * @param {string} [src] the avatar's photo
13
+ * @param {string} [name] names the trigger for a screen reader (default `Account`)
14
+ * @param {Array} items `Menu`'s rows
15
+ * @param {'start'|'end'} [align] default `end`
16
+ * @param {'sm'|'md'|'lg'} [size] the circle (default md)
17
+ * @param {string} [className]
18
+ */
19
+ export default function AccountMenu({ initial, src, name = 'Account', items = [], align = 'end', size = 'md', className = '' }) {
20
+ const avatar = (initial || src) ? <Avatar initial={initial} src={src} alt="" size="xs" /> : null
21
+ return (
22
+ <Menu align={align} offset={8} minWidth={200} items={items} variant="float" className={className}
23
+ trigger={({ open, props }) => (
24
+ <MenuTrigger variant="float" size={size} open={open} iconOnly="user" iconComponent={avatar ?? undefined} aria-label={name} {...props} />
25
+ )} />
26
+ )
27
+ }
@@ -0,0 +1,30 @@
1
+ import ColorSwatch from './ColorSwatch.jsx'
2
+
3
+ /**
4
+ * ColorField — A color as a row: swatch, name, hex. `■ Background #0B0B0B` (float-everything W3 row 44, 2026-11-04 —
5
+ * the exploration's inline color field; KOL had only the picker popover). A 24 `ColorSwatch`, the name in Inter 13
6
+ * taking the room, the hex in mono 11 at fg-64 at the end. With `onClick` the row is a button — the caller opens its
7
+ * `ColorPickerPopover` from it; without one it reads. The hex is uppercased for the readout only; `value` is passed
8
+ * through untouched.
9
+ *
10
+ * @param {string} label the color's name (`Background`)
11
+ * @param {string} value the color, a hex string
12
+ * @param {Function} [onClick] makes the row a button (`(event) => void`)
13
+ * @param {boolean} [swatchFrame] the swatch's hairline (default true — a near-ground swatch needs its edge)
14
+ * @param {string} [className]
15
+ */
16
+ export default function ColorField({ label, value, onClick, swatchFrame = true, className = '', ...rest }) {
17
+ const El = onClick ? 'button' : 'div'
18
+ return (
19
+ <El
20
+ type={onClick ? 'button' : undefined}
21
+ onClick={onClick}
22
+ className={`flex w-full items-center gap-3 text-left ${onClick ? 'cursor-pointer rounded-full outline-none focus-visible:[box-shadow:var(--kol-float-focus)]' : ''} ${className}`.replace(/\s+/g, ' ').trim()}
23
+ {...rest}
24
+ >
25
+ <ColorSwatch hex={value} size={24} radius="sm" frame={swatchFrame} />
26
+ <span className="flex-1 min-w-0 truncate font-[family-name:var(--kol-font-family-float)] text-[13px] leading-none text-fg-emphasis">{label}</span>
27
+ <span className="shrink-0 font-mono text-[11px] leading-none uppercase text-fg-64">{value}</span>
28
+ </El>
29
+ )
30
+ }
@@ -40,7 +40,8 @@ export function useContextMenu() {
40
40
  return { open: !!state, x: state?.x, y: state?.y, payload: state?.payload ?? null, openAt, close }
41
41
  }
42
42
 
43
- export default function ContextMenu({ menu, children, className = '' }) {
43
+ /** `variant="float"` (float-everything W4 row 55, 2026-11-04): the float list — the list radius, 34 rows, the float flyouts */
44
+ export default function ContextMenu({ menu, children, variant, className = '' }) {
44
45
  /* ONE ESCAPE, ONE LEVEL (kol-fxr 2026-10-08: a menu opened inside a FullscreenOverlay took the
45
46
  * dialog with it). Open, the menu is the top layer, so the overlay under it ignores that Escape. */
46
47
  useEffect(() => {
@@ -50,7 +51,7 @@ export default function ContextMenu({ menu, children, className = '' }) {
50
51
  }, [menu.open])
51
52
  if (!menu.open) return null
52
53
  return (
53
- <Menu anchor={{ x: menu.x, y: menu.y }} open onOpenChange={(v) => { if (!v) menu.close() }} panelClassName={`min-w-44 ${className}`.trim()}>
54
+ <Menu anchor={{ x: menu.x, y: menu.y }} open onOpenChange={(v) => { if (!v) menu.close() }} variant={variant} panelClassName={`min-w-44 ${className}`.trim()}>
54
55
  {/* Any click inside closes — a menu item that leaves the menu open after acting is the one interaction people
55
56
  * report as broken. Items keep their own onClick; this runs after it on the way up. */}
56
57
  <div onClick={menu.close} role="none" className="flex flex-col">