@kolkrabbi/kol-styleguide 0.8.0 → 0.10.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.10.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,10 +1,10 @@
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'
6
- import { BrandAvatar } from './SocialMocks.jsx'
7
- import { BusinessCardBack, BusinessCardFront, EmailSignature, Envelope, Letterhead } from './StationeryMocks.jsx'
6
+ import { BrandAvatar, PostEditorial, PostPhoto, StoryPhoto } from './SocialMocks.jsx'
7
+ import { BusinessCardBack, BusinessCardFront, EmailSignature, Envelope, Letterhead, LetterheadB } from './StationeryMocks.jsx'
8
8
  import BrandMark from './BrandMark.jsx'
9
9
  import { Prose, SectionIndex } from './BrandBook.jsx'
10
10
  import {
@@ -20,6 +20,34 @@ 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
+ /* the drawn social mocks a template may name instead of a photo (kol-website's Social page, 2026-10-14) */
34
+ const SOCIAL_MOCKS = { PostPhoto, PostEditorial, StoryPhoto }
35
+
36
+ /* square preview tile with its category / name — kol-website's GraphicCard */
37
+ function GraphicCard({ category, name, polarity = 'dark' }) {
38
+ const bg = polarity === 'dark' ? 'bg-surface-inverse' : 'bg-surface-primary'
39
+ return (
40
+ <figure>
41
+ <div className={`aspect-square flex items-center justify-center rounded-[4px] overflow-hidden ${bg}`}>
42
+ <Graphic category={category} name={name} />
43
+ </div>
44
+ <figcaption className="kol-helper-12 uppercase tracking-wider text-meta mt-2">
45
+ {category} / {name}
46
+ </figcaption>
47
+ </figure>
48
+ )
49
+ }
50
+
23
51
  const brandedAssetCols = [
24
52
  { accessor: 'item', header: 'Item', render: (r) => <TokenName>{r.item}</TokenName> },
25
53
  { accessor: 'aspect', header: 'Aspect' },
@@ -30,7 +58,8 @@ const brandedAssetCols = [
30
58
 
31
59
  /**
32
60
  * 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,
61
+ * mark table, with the ink toggle, zoom and recoloured download), Graphics and Patterns (the manifest's `graphics`, names
62
+ * from kol-component's set by category, on the same table), the branded-asset register,
34
63
  * stationery, social post sizes and profile avatars.
35
64
  *
36
65
  * kol-olina's apps/brand `pages/assets/*`, carried class-for-class; the client's marks, contact
@@ -95,6 +124,19 @@ export default function BrandAssets({ brand, Logo, logoSources }) {
95
124
  </FullscreenOverlay>
96
125
  </PageSection>
97
126
  )
127
+ case 'graphics':
128
+ case 'patterns': return (
129
+ <PageSection key={s.key} {...head}>
130
+ <AssetTable caption={s.title} rows={graphicRows(s.category, brand.graphics[s.category])} inkTokens={INK_TOKENS} />
131
+ </PageSection>
132
+ )
133
+ case 'graphicsPatterns': return (
134
+ <PageSection key={s.key} {...head}>
135
+ <div className="kol-grid mt-8">
136
+ {brand.graphics[s.category].map((name) => <GraphicCard key={name} category={s.category} name={name} />)}
137
+ </div>
138
+ </PageSection>
139
+ )
98
140
  case 'branded': return (
99
141
  <PageSection key={s.key} {...head}>
100
142
  <Table caption="Branded assets" columns={brandedAssetCols} rows={BRANDED_ASSET_ROWS} className="mt-8" />
@@ -111,12 +153,31 @@ export default function BrandAssets({ brand, Logo, logoSources }) {
111
153
  </div>
112
154
  <div className="col-span-2"><AssetCard><Letterhead mark={mark(marks.letter, { style: { height: '100%', width: 'auto' } })} info={info} /></AssetCard></div>
113
155
  </div>
156
+ {/* the second letterhead, its own row (kol-website's Stationery page): `stationery.letterheadB: true` */}
157
+ {brand?.stationery?.letterheadB && (
158
+ <div className="kol-grid mt-12">
159
+ <div className="col-span-2">
160
+ <AssetCard caption="Letterhead, A4 [B]"><LetterheadB mark={mark(marks.letter, { style: { display: 'inline-block', height: 48, width: 'auto' } })} info={info} /></AssetCard>
161
+ </div>
162
+ </div>
163
+ )}
114
164
  </PageSection>
115
165
  )
116
166
  case 'social': return (
117
167
  <PageSection key={s.key} {...head}>
118
168
  <ContentCollection cols={3} className="mt-8 items-start">
119
- {brand.social.templates.map(({ caption, ratio, src }) => (
169
+ {brand.social.templates.map(({ caption, ratio, src, mock }) => mock ? (
170
+ /* A DRAWN MOCK (BrandAssetsSocialMocksAndLetterheadB, kol-website 2026-10-27): `mock` names one of
171
+ kol-styleguide's social mocks, or is a node; it carries the brand's logomark itself, so no
172
+ overlay. `ratio` boxes a mock that does not size itself (PostEditorial), as kol-website does. */
173
+ <AssetCard key={caption ?? String(mock)} caption={caption}>
174
+ {(() => {
175
+ const Mock = typeof mock === 'string' ? SOCIAL_MOCKS[mock] : null
176
+ const node = Mock ? <Mock mark={mark(marks.avatar)} /> : mock
177
+ return ratio ? <div className="overflow-hidden rounded-sm" style={{ aspectRatio: ratio }}>{node}</div> : node
178
+ })()}
179
+ </AssetCard>
180
+ ) : (
120
181
  <AssetCard key={caption ?? src} caption={caption}>
121
182
  <div className="relative overflow-hidden" style={{ aspectRatio: ratio }}>
122
183
  <img src={src} alt="" loading="lazy" className="absolute inset-0 w-full h-full object-cover" />
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)