@kolkrabbi/kol-styleguide 0.8.0 → 0.9.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-styleguide",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "private": false,
5
5
  "description": "Brand guide components and the brand tool",
6
6
  "license": "MIT",
@@ -21,8 +21,8 @@
21
21
  },
22
22
  "devDependencies": {
23
23
  "@kolkrabbi/kol-framework": "^0.57.0",
24
- "@kolkrabbi/kol-component": "^0.305.0",
25
24
  "@kolkrabbi/kol-icons": "^0.47.0",
25
+ "@kolkrabbi/kol-component": "^0.305.0",
26
26
  "@kolkrabbi/kol-theme": "^0.191.0"
27
27
  },
28
28
  "files": [
@@ -1,5 +1,5 @@
1
1
  import { useState } from 'react'
2
- import { ContentCollection, FullscreenOverlay, Table } from '@kolkrabbi/kol-component'
2
+ import { ContentCollection, FullscreenOverlay, Graphic, GRAPHIC_RAW, Table } from '@kolkrabbi/kol-component'
3
3
  import PageSection from '@kolkrabbi/kol-framework/src/PageSection.jsx'
4
4
  import AssetTable from './AssetTable.jsx'
5
5
  import AssetCard from './AssetCard.jsx'
@@ -20,6 +20,31 @@ const TokenName = ({ children }) => (
20
20
  <code className="kol-helper-12 text-emphasis">{children}</code>
21
21
  )
22
22
 
23
+ /* a graphic from kol-component's set as an asset row — kol-website's graphicRows, its 80px preview */
24
+ const graphicRows = (category, names = []) => names.map((name) => {
25
+ const raw = GRAPHIC_RAW[category]?.[name]
26
+ return {
27
+ id: `${category}/${name}`, name, preview: <Graphic category={category} name={name} />, previewWidth: 80,
28
+ path: `packages/component/src/graphics/svg/${category}/${name}.svg`, format: 'SVG', dimensions: svgDims(raw), raw,
29
+ onDownload: raw ? (row, ink) => downloadRecolored(row.raw, ink, `${name}.svg`) : undefined,
30
+ }
31
+ })
32
+
33
+ /* square preview tile with its category / name — kol-website's GraphicCard */
34
+ function GraphicCard({ category, name, polarity = 'dark' }) {
35
+ const bg = polarity === 'dark' ? 'bg-surface-inverse' : 'bg-surface-primary'
36
+ return (
37
+ <figure>
38
+ <div className={`aspect-square flex items-center justify-center rounded-[4px] overflow-hidden ${bg}`}>
39
+ <Graphic category={category} name={name} />
40
+ </div>
41
+ <figcaption className="kol-helper-12 uppercase tracking-wider text-meta mt-2">
42
+ {category} / {name}
43
+ </figcaption>
44
+ </figure>
45
+ )
46
+ }
47
+
23
48
  const brandedAssetCols = [
24
49
  { accessor: 'item', header: 'Item', render: (r) => <TokenName>{r.item}</TokenName> },
25
50
  { accessor: 'aspect', header: 'Aspect' },
@@ -30,7 +55,8 @@ const brandedAssetCols = [
30
55
 
31
56
  /**
32
57
  * BrandAssets — The brand book's assets page. the ASSETS page of the brand tool: what you download or reproduce. Logos (the
33
- * mark table, with the ink toggle, zoom and recoloured download), the branded-asset register,
58
+ * mark table, with the ink toggle, zoom and recoloured download), Graphics and Patterns (the manifest's `graphics`, names
59
+ * from kol-component's set by category, on the same table), the branded-asset register,
34
60
  * stationery, social post sizes and profile avatars.
35
61
  *
36
62
  * kol-olina's apps/brand `pages/assets/*`, carried class-for-class; the client's marks, contact
@@ -95,6 +121,19 @@ export default function BrandAssets({ brand, Logo, logoSources }) {
95
121
  </FullscreenOverlay>
96
122
  </PageSection>
97
123
  )
124
+ case 'graphics':
125
+ case 'patterns': return (
126
+ <PageSection key={s.key} {...head}>
127
+ <AssetTable caption={s.title} rows={graphicRows(s.category, brand.graphics[s.category])} inkTokens={INK_TOKENS} />
128
+ </PageSection>
129
+ )
130
+ case 'graphicsPatterns': return (
131
+ <PageSection key={s.key} {...head}>
132
+ <div className="kol-grid mt-8">
133
+ {brand.graphics[s.category].map((name) => <GraphicCard key={name} category={s.category} name={name} />)}
134
+ </div>
135
+ </PageSection>
136
+ )
98
137
  case 'branded': return (
99
138
  <PageSection key={s.key} {...head}>
100
139
  <Table caption="Branded assets" columns={brandedAssetCols} rows={BRANDED_ASSET_ROWS} className="mt-8" />
package/src/brandBook.js CHANGED
@@ -28,6 +28,13 @@ export const BOOK_SECTIONS = [
28
28
  export const ASSET_SECTIONS = [
29
29
  { key: 'assetsOverview', id: 'assets-overview', label: 'Assets', title: 'Downloads and reproduction', lede: 'Everything you download or reproduce. Brand documents the identity; this holds the files and the specs for making them.' },
30
30
  { key: 'logos', id: 'logos', nav: 'Logos', label: '01 — logos', title: 'Logos' },
31
+ /* kol-website's Assets page (BrandAssetsGraphicsAndPatterns, 2026-10-27): the manifest's `graphics` — names from
32
+ kol-component's set by category, `{ abstract: [...], patterns: [...] }`. The Patterns page there carried a second
33
+ block, the cards (`graphics-patterns`); it rides under Patterns, off the rail, as it did. Ledes named repo paths,
34
+ so they are the manifest's to set, as Logos' is. */
35
+ { key: 'graphics', id: 'graphics', nav: 'Graphics', label: '02 — graphics', title: 'Graphics', category: 'abstract' },
36
+ { key: 'patterns', id: 'patterns', nav: 'Patterns', label: '03 — patterns', title: 'Patterns', category: 'patterns' },
37
+ { key: 'graphicsPatterns', id: 'graphics-patterns', label: '16 — graphics · patterns', title: 'Patterns', category: 'patterns' },
31
38
  { key: 'branded', id: 'branded-assets', nav: 'Branded', label: '04 — branded', title: 'Branded assets' },
32
39
  { key: 'stationery', id: 'assets-stationery', nav: 'Stationery', label: '08 — assets · stationery', title: 'Stationery', lede: 'Standard correspondence — business card, envelope, letterhead, email signature. Quiet typography, generous space, monochrome restraint.' },
33
40
  { key: 'labels', id: 'labels', nav: 'Labels', label: '09 — labels', title: 'Labels', copy: true },
@@ -53,6 +60,7 @@ function shows(s, brand) {
53
60
  if (s.copy) return hasCopy(s)
54
61
  if (s.key === 'color') return Boolean(brand?.ramps?.length) || hasCopy(s)
55
62
  if (s.key === 'logos') return Boolean(brand?.logos?.length)
63
+ if (s.category) return Boolean(brand?.graphics?.[s.category]?.length)
56
64
  /* the marks sections draw the manifest's logos — their default lede is not enough to show empty frames */
57
65
  if (s.key === 'logo' || s.key === 'lockups') return Boolean(brand?.logos?.length || s.blocks?.length || s.after?.length)
58
66
  if (s.key === 'social') return Boolean(brand?.social?.templates?.length)