@kolkrabbi/kol-component 0.353.0 → 0.354.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.353.0",
3
+ "version": "0.354.0",
4
4
  "description": "The core component library",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -32,8 +32,8 @@
32
32
  "embla-carousel-react": "^8.6.0",
33
33
  "pdfjs-dist": "^6.3.289",
34
34
  "react-syntax-highlighter": "^16.1.1",
35
- "@kolkrabbi/kol-markdown": "^0.2.0",
36
35
  "@kolkrabbi/kol-search": "^0.3.0",
36
+ "@kolkrabbi/kol-markdown": "^0.2.0",
37
37
  "@kolkrabbi/kol-growth": "^0.5.0"
38
38
  },
39
39
  "peerDependencies": {
@@ -1,11 +1,16 @@
1
+ import { Icon } from '@kolkrabbi/kol-icons'
2
+
1
3
  /**
2
4
  * Label — minimal form label. Inherits typography from parent (consumer
3
5
  * supplies `kol-helper-N` or similar via className when needed). Defaults
4
6
  * to `text-fg-48` for the muted-control look.
7
+ *
8
+ * @param {string} icon a kol-icons name, drawn before the text at the label's own size (1em) — never a text glyph
5
9
  */
6
- export default function Label({ children, htmlFor, className = '' }) {
10
+ export default function Label({ children, htmlFor, icon, className = '' }) {
7
11
  return (
8
- <label htmlFor={htmlFor} className={`text-fg-48 ${className}`}>
12
+ <label htmlFor={htmlFor} className={`text-fg-48 ${icon ? 'inline-flex items-center gap-1 ' : ''}${className}`}>
13
+ {icon && <Icon name={icon} size="1em" />}
9
14
  {children}
10
15
  </label>
11
16
  )
@@ -4,6 +4,7 @@ import KindPreview, { KIND_GLYPH } from '../molecules/KindPreview.jsx'
4
4
  import FileIcon from '../atoms/FileIcon.jsx'
5
5
  import RowMenuButton from '../molecules/RowMenuButton.jsx'
6
6
  import OptionRow from '../molecules/OptionRow.jsx'
7
+ import ContentText from '../molecules/ContentText.jsx'
7
8
  import { formatLength } from '../molecules/PlayTile.jsx'
8
9
  import { kindOf as dsKindOf, KIND_LABEL as DS_KIND_LABEL } from '../utilities/mediaKinds.js'
9
10
  import useGrabEdge from '../hooks/useGrabEdge.js'
@@ -368,15 +369,18 @@ function Row({
368
369
  </span>
369
370
  )}
370
371
 
371
- {/* ZONE 3 — name over meta */}
372
- {meta ? (
373
- <span className="flex-1 min-w-0 flex flex-col gap-0.5">
374
- <span className="kol-mono-12 truncate">{label}</span>
375
- <span className="kol-helper-10 text-fg-48 truncate">{meta}</span>
376
- </span>
377
- ) : (
378
- <span className="kol-mono-12 flex-1 truncate">{label}</span>
379
- )}
372
+ {/* ZONE 3 — name over meta, drawn by ContentText's row (no middot join: date and size are two
373
+ slots, date first as the Figma master). A folder's meta is the consumer's one string. */}
374
+ <ContentText
375
+ form="row"
376
+ title={label}
377
+ {...(typeof meta === 'object' && meta ? meta : { date: meta || null })}
378
+ gap={2}
379
+ titleClass="kol-mono-12 truncate"
380
+ dateClass="kol-helper-10 text-fg-48 truncate"
381
+ sizeClass="kol-helper-10 text-fg-48 truncate"
382
+ className="flex-1"
383
+ />
380
384
 
381
385
  {/* ZONE 4 */}
382
386
  {zones ? <span className="shrink-0 inline-flex justify-end" style={{ width: 20 }}>{trailing}</span> : trailing}
@@ -870,7 +874,7 @@ export default function ColumnBrowser({
870
874
  * it. */
871
875
  const rows = stackRows(objects, base, stackView === 'grid' ? () => false : (path) => expanded.has(path), partition)
872
876
 
873
- const metaOf = (o) => [o.size != null && formatSize(o.size), formatDate(o.uploaded)].filter(Boolean).join(' · ')
877
+ const metaOf = (o) => ({ date: formatDate(o.uploaded) || null, size: o.size != null ? formatSize(o.size) : null })
874
878
 
875
879
  return (
876
880
  <div