@kolkrabbi/kol-component 0.20.0 → 0.21.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.20.0",
3
+ "version": "0.21.0",
4
4
  "description": "KOL design-system components — atoms through organisms, emitting canonical kol-* classes. Pairs with @kolkrabbi/kol-theme for styling.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,4 +1,5 @@
1
1
  import { Icon } from '@kolkrabbi/kol-icons'
2
+ import { glyphSize } from '../hooks/glyphLadders.js'
2
3
 
3
4
  /**
4
5
  * Input — single-input atom built on the .kol-control shell.
@@ -31,7 +32,6 @@ import { Icon } from '@kolkrabbi/kol-icons'
31
32
  */
32
33
 
33
34
  const SIZE_TYPE = { sm: 'kol-mono-12', md: 'kol-mono-14', lg: 'kol-mono-16' }
34
- const ICON_SIZE = { sm: 14, md: 14, lg: 18 }
35
35
 
36
36
  export default function Input({
37
37
  type = 'text',
@@ -53,7 +53,12 @@ export default function Input({
53
53
  }) {
54
54
  const isNumber = type === 'number'
55
55
  const fixedChars = typeof chars === 'number'
56
- const resolvedIconSize = iconSize ?? ICON_SIZE[size] ?? 14
56
+ // The text-adjacent ladder an Input's icon sits in the rung's line box
57
+ // beside the value, exactly like a labelled Button's. `.kol-control-*` and
58
+ // `.kol-btn-*` carry identical padding + type per rung, so the glyph is the
59
+ // same too. This was a local ICON_SIZE with `md: 14` until 0.20.1, the last
60
+ // of the four transcriptions (sm and lg had always agreed).
61
+ const resolvedIconSize = iconSize ?? glyphSize(size)
57
62
 
58
63
  // ghost folds into outline (2026-07-08 chrome law): one secondary treatment.
59
64
  const resolvedVariant = variant === 'ghost' ? 'outline' : variant
@@ -216,10 +216,36 @@ function useCopy() {
216
216
  return [copied, copy]
217
217
  }
218
218
 
219
+ /* A video paints nothing until a frame decodes, so its resting state is a blank
220
+ * box — no name, no type marker. This gives it the <img alt> equivalent: a play
221
+ * glyph and the filename behind the video, revealed only while it has nothing
222
+ * to show. `onLoadedData` is the earliest event that guarantees a frame.
223
+ *
224
+ * The loading strategy is deliberately unchanged (lobby/MediaLibraryVideoFallback:
225
+ * both candidate strategies failed the same way headless, so that measurement
226
+ * discriminates nothing). This layer needs no decoder to be correct. */
219
227
  function Thumb({ row, mediaUrl }) {
220
- return isVideo(row.contentType)
221
- ? <video src={posterSrc(mediaUrl(row.key))} muted preload="metadata" className="w-full h-full object-cover" />
222
- : <img src={mediaUrl(row.key)} alt="" loading="lazy" className="w-full h-full object-cover" />
228
+ const [painted, setPainted] = useState(false)
229
+
230
+ if (!isVideo(row.contentType)) {
231
+ return <img src={mediaUrl(row.key)} alt="" loading="lazy" className="w-full h-full object-cover" />
232
+ }
233
+
234
+ return (
235
+ <div className="kol-media-thumb">
236
+ <span className="kol-media-thumb-fallback" data-painted={painted}>
237
+ <Icon name="play" size={20} />
238
+ <span className="kol-mono-12">{fileName(row.key)}</span>
239
+ </span>
240
+ <video
241
+ src={posterSrc(mediaUrl(row.key))}
242
+ muted
243
+ preload="metadata"
244
+ onLoadedData={() => setPainted(true)}
245
+ className="relative w-full h-full object-cover"
246
+ />
247
+ </div>
248
+ )
223
249
  }
224
250
 
225
251
  /* Folders, then the tiles or rows. Shared by both views — the modal shell and