@iksnerd/blazon 0.1.1 → 0.2.2
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/README.md +4 -4
- package/dist/chunks/{site-builder-CPfjBOmR.js → site-builder-CsBH_ocA.js} +2335 -2633
- package/dist/cli/commands/tokens.d.ts +4 -0
- package/dist/cli/commands/tokens.d.ts.map +1 -1
- package/dist/cli/handlers/brand.d.ts +1 -1
- package/dist/cli/handlers/index.d.ts +2 -2
- package/dist/cli/index.js +915 -941
- package/dist/core/brand/export.d.ts +2 -9
- package/dist/core/brand/export.d.ts.map +1 -1
- package/dist/core/brand/schema.d.ts +0 -58
- package/dist/core/brand/schema.d.ts.map +1 -1
- package/dist/core/brand-theme.d.ts +0 -2
- package/dist/core/brand-theme.d.ts.map +1 -1
- package/dist/core/checker/catalogue.d.ts +2 -2
- package/dist/core/checker/contrast.d.ts +1 -1
- package/dist/core/checker/variables.d.ts +2 -2
- package/dist/core/checker/variables.d.ts.map +1 -1
- package/dist/core/config/removed-keys.d.ts +6 -0
- package/dist/core/config/removed-keys.d.ts.map +1 -0
- package/dist/core/config/validate.d.ts +1 -1
- package/dist/core/config/validate.d.ts.map +1 -1
- package/dist/core/emit.d.ts +1 -3
- package/dist/core/emit.d.ts.map +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/operations/list.d.ts.map +1 -1
- package/dist/core/plugin-name.d.ts +1 -1
- package/dist/core/read/token.d.ts +1 -6
- package/dist/core/read/token.d.ts.map +1 -1
- package/dist/core/starter.d.ts.map +1 -1
- package/dist/index.js +33 -33
- package/dist/plugins/roles/integrate.d.ts +5 -2
- package/dist/plugins/roles/integrate.d.ts.map +1 -1
- package/dist/plugins/roles/roles.d.ts +5 -2
- package/dist/plugins/roles/roles.d.ts.map +1 -1
- package/dist/plugins/wire/profile.d.ts +5 -0
- package/dist/plugins/wire/profile.d.ts.map +1 -1
- package/dist/types/config.d.ts +1 -3
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/theme.d.ts +0 -3
- package/dist/types/theme.d.ts.map +1 -1
- package/dist/ui/assets/{index-D0WCUmtA.css → index-DluSqfla.css} +1 -1
- package/dist/ui/index.html +2 -2
- package/package.json +2 -1
- package/plugins/blazon.brand-deck/bin/blazon-blazon.brand-deck./360/237/224/214 +24 -2
- package/plugins/blazon.copy/bin/blazon-blazon.copy./360/237/224/214 +25 -3
- package/plugins/blazon.favicons/bin/blazon-blazon.favicons./360/237/224/214 +26 -3
- package/plugins/blazon.logo-geometry/bin/blazon-blazon.logo-geometry./360/237/224/214 +37 -8
- package/plugins/blazon.logo-kit/bin/blazon-blazon.logo-kit./360/237/224/214 +37 -8
- package/plugins/blazon.office-template/bin/blazon-blazon.office-template./360/237/224/214 +37 -8
- package/plugins/blazon.platform-tokens/bin/blazon-blazon.platform-tokens./360/237/224/214 +37 -9
- package/plugins/blazon.press-kit/bin/blazon-blazon.press-kit./360/237/224/214 +37 -8
- package/plugins/blazon.print-book/bin/blazon-blazon.print-book./360/237/224/214 +36 -7
- package/plugins/blazon.shadcn/README.md +27 -0
- package/plugins/blazon.shadcn/bin/blazon-blazon.shadcn./360/237/224/214 +8273 -0
- package/plugins/blazon.shadcn/package.json +3 -0
- package/plugins/blazon.social-cards/bin/blazon-blazon.social-cards./360/237/224/214 +37 -8
- package/plugins/blazon.tailwind/README.md +23 -0
- package/plugins/blazon.tailwind/bin/blazon-blazon.tailwind./360/237/224/214 +420 -0
- package/plugins/blazon.tailwind/package.json +3 -0
- package/plugins/shipped.lock +24 -10
- package/template/AGENTS.md +2 -2
- package/template/blazon.json +18 -10
- package/template/docs/12-web.md +2 -2
- package/dist/core/tokens/formatters/tailwind.d.ts +0 -37
- package/dist/core/tokens/formatters/tailwind.d.ts.map +0 -1
- package/dist/core/tokens/shadcn.d.ts +0 -43
- package/dist/core/tokens/shadcn.d.ts.map +0 -1
- /package/dist/ui/assets/{index-DhSc0Zxv.js → index-CLKH0m9J.js} +0 -0
package/template/blazon.json
CHANGED
|
@@ -44,16 +44,6 @@
|
|
|
44
44
|
"fontBody": "font.family.body",
|
|
45
45
|
"radius": "radius.hairline"
|
|
46
46
|
},
|
|
47
|
-
"shadcn": {
|
|
48
|
-
"ring": "text.primary",
|
|
49
|
-
"sidebar-ring": "text.primary",
|
|
50
|
-
"destructive": "text.primary",
|
|
51
|
-
"chart-1": "text.primary",
|
|
52
|
-
"chart-2": "text.muted",
|
|
53
|
-
"chart-3": "surface.canvas",
|
|
54
|
-
"chart-4": "rule.default",
|
|
55
|
-
"chart-5": "rule.quiet"
|
|
56
|
-
},
|
|
57
47
|
"fonts": [
|
|
58
48
|
"https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@800&family=IBM+Plex+Sans:wght@400;600&display=swap",
|
|
59
49
|
{
|
|
@@ -99,6 +89,24 @@
|
|
|
99
89
|
"11-voice.md"
|
|
100
90
|
]
|
|
101
91
|
}
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"name": "blazon.tailwind"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"name": "blazon.shadcn",
|
|
98
|
+
"options": {
|
|
99
|
+
"variables": {
|
|
100
|
+
"ring": "text.primary",
|
|
101
|
+
"sidebar-ring": "text.primary",
|
|
102
|
+
"destructive": "text.primary",
|
|
103
|
+
"chart-1": "text.primary",
|
|
104
|
+
"chart-2": "text.muted",
|
|
105
|
+
"chart-3": "surface.canvas",
|
|
106
|
+
"chart-4": "rule.default",
|
|
107
|
+
"chart-5": "rule.quiet"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
102
110
|
}
|
|
103
111
|
]
|
|
104
112
|
}
|
package/template/docs/12-web.md
CHANGED
|
@@ -147,9 +147,9 @@ Three details give a page the brand's industrial look. Each uses only tokens, an
|
|
|
147
147
|
|
|
148
148
|
## Using shadcn/ui
|
|
149
149
|
|
|
150
|
-
A shadcn/ui project takes its colors from the brand
|
|
150
|
+
A shadcn/ui project takes its colors from the brand through the `blazon.shadcn` plugin. Run `blazon tokens` to write `dist/tokens/blazon.shadcn/shadcn.css` and `shadcn.json`. The "Using shadcn/ui" section of `docs/manual/19-building-a-website.md` in the blazon source repository describes both. Its components also hard-code `text-sm`, `h-8`, `rounded-xl`, `ring/10`, opacity blends such as `hover:bg-primary/80`, and 0.35s transitions. The brand takes none of them. A site overrides each in its own button and card components, using the rules on this page.
|
|
151
151
|
|
|
152
|
-
The brand has no role for two groups of shadcn variables, so `blazon.json` maps them:
|
|
152
|
+
The brand has no role for two groups of shadcn variables, so the `variables` option of `blazon.shadcn` in `blazon.json` maps them:
|
|
153
153
|
|
|
154
154
|
- `destructive` is `text.primary`. The brand has no red. An error is `text.primary` with `border.rule`, and the message is in words. It is never a red fill.
|
|
155
155
|
- `chart-1` to `chart-5` are `text.primary`, `text.muted`, `surface.canvas`, `rule.default` and `rule.quiet`, in that order. Separate series with `rule.default` hatching. Add no hue.
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { ParsedTokens, TokenItem } from '../../../types/index.js';
|
|
2
|
-
interface Namespace {
|
|
3
|
-
/** The prefix of the variables written: `color` for `--color-brand` */
|
|
4
|
-
prefix: string;
|
|
5
|
-
/** What the reset in tailwind-reset.css writes for it, and what chapter 8 names; undefined where nothing is reset */
|
|
6
|
-
reset?: string;
|
|
7
|
-
/** The token types and groups it takes, for chapter 8 */
|
|
8
|
-
takes: string;
|
|
9
|
-
/** Whether a token belongs to it; `path` is the token's path in kebab-case */
|
|
10
|
-
match: (token: TokenItem, path: string[]) => boolean;
|
|
11
|
-
/** Leading path words that repeat the namespace and are left out of the variable name */
|
|
12
|
-
drop: string[];
|
|
13
|
-
/** Words anywhere in the path that are left out too (a `family` in `font.family.sans`) */
|
|
14
|
-
dropAnywhere?: boolean;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Every Tailwind v4 theme namespace a token can fill. The order is the order of the tables in chapter 8 and of the reset file.
|
|
18
|
-
* A token type with no Tailwind namespace (border, transition and typography composites, gradients, other dimensions and numbers) is not here.
|
|
19
|
-
*/
|
|
20
|
-
export declare const TAILWIND_NAMESPACES: readonly Namespace[];
|
|
21
|
-
/** The namespaces that at least one token of the brand fills, in the order of TAILWIND_NAMESPACES. */
|
|
22
|
-
export declare function filledNamespaces(parsed: ParsedTokens): Namespace[];
|
|
23
|
-
/** The variable a token writes in tailwind.css, or undefined where the token maps to no Tailwind namespace. */
|
|
24
|
-
export declare function tailwindVariable(token: TokenItem): string | undefined;
|
|
25
|
-
/**
|
|
26
|
-
* Formats the tokens that fill a namespace of TAILWIND_NAMESPACES as a Tailwind v4 `@theme` block, with the default
|
|
27
|
-
* context's values. A variable named like one in theme.css (`--color-indigo`) holds the same value.
|
|
28
|
-
* Returns undefined when no token maps to a Tailwind namespace.
|
|
29
|
-
*/
|
|
30
|
-
export declare function formatTailwindTheme(parsed: ParsedTokens): string | undefined;
|
|
31
|
-
/**
|
|
32
|
-
* A `@theme` block that sets `initial` on each Tailwind namespace the brand fills, so only the brand's values remain once tailwind.css is
|
|
33
|
-
* imported after it. Returns undefined when no token maps to a namespace.
|
|
34
|
-
*/
|
|
35
|
-
export declare function formatTailwindReset(parsed: ParsedTokens): string | undefined;
|
|
36
|
-
export {};
|
|
37
|
-
//# sourceMappingURL=tailwind.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tailwind.d.ts","sourceRoot":"","sources":["../../../../src/core/tokens/formatters/tailwind.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAWvE,UAAU,SAAS;IACjB,uEAAuE;IACvE,MAAM,EAAE,MAAM,CAAC;IACf,qHAAqH;IACrH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAC;IACd,8EAA8E;IAC9E,KAAK,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC;IACrD,yFAAyF;IACzF,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,0FAA0F;IAC1F,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAMD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,SAAS,EAoDnD,CAAC;AAQF,sGAAsG;AACtG,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,YAAY,GAAG,SAAS,EAAE,CAElE;AAED,+GAA+G;AAC/G,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAUrE;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,GAAG,SAAS,CAY5E;AAmBD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,GAAG,SAAS,CAI5E"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { BrandTheme, ShadcnVariable, ThemeRole, TokenItem } from '../../types/index.js';
|
|
2
|
-
/**
|
|
3
|
-
* The shadcn/ui variables the theme roles supply, and the role each one reads. The brand book's own
|
|
4
|
-
* stylesheet (`src/viewer/index.css`) derives the same light-mode values with CSS, and a test holds the two
|
|
5
|
-
* together. A variable not here (`destructive`, `chart-1` to `chart-5`) has no role: only `shadcn` in the config fills it.
|
|
6
|
-
*/
|
|
7
|
-
export declare const SHADCN_FROM_ROLES: Partial<Record<ShadcnVariable, ThemeRole>>;
|
|
8
|
-
/** The pairs shadcn draws as text on a surface: the first is the surface, the second the text on it. */
|
|
9
|
-
export declare const SHADCN_PAIRS: readonly (readonly [ShadcnVariable, ShadcnVariable])[];
|
|
10
|
-
export interface ShadcnEntry {
|
|
11
|
-
/** The token the value comes from */
|
|
12
|
-
token: string;
|
|
13
|
-
/** Its value in the default context, as CSS */
|
|
14
|
-
value: string;
|
|
15
|
-
/** `theme`: derived from a theme role (named in `role`). `config`: set by `shadcn` in blazon.json */
|
|
16
|
-
from: 'theme' | 'config';
|
|
17
|
-
role?: ThemeRole;
|
|
18
|
-
}
|
|
19
|
-
export interface ShadcnPairNote {
|
|
20
|
-
/** The surface variable and the variable drawn on it */
|
|
21
|
-
background: ShadcnVariable;
|
|
22
|
-
foreground: ShadcnVariable;
|
|
23
|
-
backgroundToken: string;
|
|
24
|
-
foregroundToken: string;
|
|
25
|
-
/** Whether a `pairs` rule of the brand covers these two tokens, so `blazon check` measures their contrast */
|
|
26
|
-
declared: boolean;
|
|
27
|
-
}
|
|
28
|
-
export interface ShadcnMapping {
|
|
29
|
-
variables: Partial<Record<ShadcnVariable, ShadcnEntry>>;
|
|
30
|
-
/** The variables nothing supplies, in shadcn's order: the ones an agent has to ask about or choose */
|
|
31
|
-
unsupplied: ShadcnVariable[];
|
|
32
|
-
/** Each shadcn pair whose two tokens are known. Absent when the brand declares no `pairs` at all */
|
|
33
|
-
pairs?: ShadcnPairNote[];
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* The one place shadcn variables are derived. A mapping entry wins over the role; a mapping that names a
|
|
37
|
-
* token that does not exist is left out (the compile reports it, `theme-unresolved`).
|
|
38
|
-
*/
|
|
39
|
-
export declare function deriveShadcn(roles: BrandTheme, roleTokens: Partial<Record<ThemeRole, string>>, mapping: Partial<Record<ShadcnVariable, string>> | undefined, items: TokenItem[], declaredPairs?: {
|
|
40
|
-
fg: string;
|
|
41
|
-
bg: string;
|
|
42
|
-
}[]): ShadcnMapping;
|
|
43
|
-
//# sourceMappingURL=shadcn.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shadcn.d.ts","sourceRoot":"","sources":["../../../src/core/tokens/shadcn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAG9H;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,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