@kolkrabbi/kol-styleguide 0.4.0 → 0.4.1

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/Swatch.jsx +34 -21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kolkrabbi/kol-styleguide",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "private": false,
5
5
  "description": "KOL style-guide / brand-guide component set — the visual specimens a brand manual is built from: color anatomy + combination lab, logo construction / clearspace / scaling, mood tiles, type blocks, and asset spec tables. Raided from the apps/brand styleguide. Sits above @kolkrabbi/kol-{theme,icons,component}.",
6
6
  "license": "MIT",
package/src/Swatch.jsx CHANGED
@@ -1,25 +1,30 @@
1
1
  import { ColorSwatch } from '@kolkrabbi/kol-component'
2
2
 
3
3
  /**
4
- * Swatch — the DOCUMENTED swatch: chip + meta row (name, hex), with an
5
- * optional canonical-anchor dot.
4
+ * Swatch — the DOCUMENTED swatch: a specimen bar over its meta row (name, hex),
5
+ * with an optional canonical-anchor dot.
6
6
  *
7
- * `ColorSwatch` (kol-component) is the chip alone — a fixed-size pressable
8
- * atom for paint bars and inspectors. A colour PAGE needs the chip plus its
9
- * label and value, which is the form both brand apps had built locally
7
+ * `ColorSwatch` (kol-component) is the chip alone — a fixed-size pressable atom
8
+ * for paint bars and inspectors. A colour PAGE needs the specimen plus its label
9
+ * and value, which is the form both brand apps had built locally
10
10
  * (`brand-book-mocks-two-consumers`, 2026-09-03: 23 lines, byte-identical in
11
11
  * kol-client-olina and kol-website). This composes the atom rather than
12
12
  * redrawing it, per the ticket.
13
13
  *
14
- * ⚠ The forks were rendering `.kol-swatch` / `.kol-swatch-chip` /
15
- * `.kol-swatch-meta` — classes that exist in NO stylesheet in the estate
16
- * (checked kol-theme, both apps, the showcase; only `.kol-swatch-none-marker`
17
- * is real). The chip was a bare div with a background and no dimensions, so it
18
- * collapsed to zero height and the swatch has been showing its meta row over
19
- * nothing. The ticket reported the CSS as already shipping in
20
- * `kol-components-molecules.css`; it does not. So there is no verbatim
21
- * rendering to carry through here — the chip gets a real box from
22
- * `ColorSwatch`, and the dead hooks are dropped.
14
+ * GEOMETRY IS CARRIED THROUGH. The forks wore `.kol-swatch` /
15
+ * `.kol-swatch-chip` / `.kol-swatch-meta`, and those rules are real — they ship
16
+ * in **`@kolkrabbi/kol-framework`** (`kol-framework.css`, the "Swatch / Ramp
17
+ * (color specimens)" block), not in kol-theme: a 6px-gap column, a **96px-tall**
18
+ * chip at radius 4, and a row-wrapped meta line on the baseline. They are
19
+ * stragglers — `.kol-mood-tile-*` left that same block for
20
+ * `kol-theme/kol-components-styleguide.css` on 2026-07-10 and these did not.
21
+ *
22
+ * So this component draws that geometry ITSELF rather than wearing the classes.
23
+ * kol-framework is not a peer of kol-styleguide and must not become one — a
24
+ * component whose look depends on another package's stylesheet being imported
25
+ * is the defect `styleguide-barrel-is-unimportable` was filed about. A
26
+ * consumer swapping its fork onto this gets the same render with no new
27
+ * install, and `height` is the seam if a page wants a different specimen depth.
23
28
  *
24
29
  * <Swatch hex="#131316" name="Ink" anchor />
25
30
  *
@@ -27,16 +32,20 @@ import { ColorSwatch } from '@kolkrabbi/kol-component'
27
32
  * copy; `name` renders exactly as authored.
28
33
  *
29
34
  * @param {string} hex - The colour, e.g. '#131316' (required — it is both the paint and the printed value)
30
- * @param {ReactNode} name - Label above the value; omitted, only the hex renders
35
+ * @param {ReactNode} name - Label beside the value; omitted, only the hex renders
31
36
  * @param {boolean} anchor - Mark this stop as the palette's canonical anchor — a difference-blended dot centred on the chip (default: false)
32
- * @param {number|'fill'|'stretch'} size - Forwarded to ColorSwatch; 'fill' (default) squares the chip to the column
37
+ * @param {number|string} height - Specimen depth, the forks' `.kol-swatch-chip` height (default: 96)
33
38
  * @param {string} className - Extra classes on the wrapper
34
39
  */
35
- export default function Swatch({ hex, name, anchor = false, size = 'fill', className = '' }) {
40
+ export default function Swatch({ hex, name, anchor = false, height = 96, className = '' }) {
36
41
  return (
37
- <div className={`flex flex-col gap-2 ${className}`.trim()}>
38
- <div className="relative">
39
- <ColorSwatch hex={hex} size={size} />
42
+ /* gap 6 — .kol-swatch */
43
+ <div className={`flex flex-col ${className}`.trim()} style={{ gap: 6 }}>
44
+ {/* .kol-swatch-chip: full column width, 96 tall, radius 4. ColorSwatch's
45
+ 'stretch' size fills this box, so the atom owns the paint and the
46
+ frame while the specimen depth stays the page's decision. */}
47
+ <div className="relative w-full" style={{ height }}>
48
+ <ColorSwatch hex={hex} size="stretch" radius="sm" />
40
49
  {anchor && (
41
50
  <span
42
51
  aria-label="Canonical anchor"
@@ -51,7 +60,11 @@ export default function Swatch({ hex, name, anchor = false, size = 'fill', class
51
60
  </span>
52
61
  )}
53
62
  </div>
54
- <div className="kol-helper-10 flex flex-col">
63
+ {/* .kol-swatch-meta: row, space-between, baseline, wrapping */}
64
+ <div
65
+ className="kol-helper-10 flex flex-row flex-wrap items-baseline justify-between"
66
+ style={{ gap: '4px 12px' }}
67
+ >
55
68
  {name && <span className="text-meta">{name}</span>}
56
69
  <span className="text-strong font-semibold">{hex.toUpperCase()}</span>
57
70
  </div>