@webority/tokens 0.0.0-stage → 0.89.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/LICENSE +5 -0
- package/dist/_virtual/_rolldown/runtime.js +1 -0
- package/dist/brand.d.ts +33 -0
- package/dist/brand.js +2 -0
- package/dist/build.js +5 -0
- package/dist/canvas/renames.json +159 -0
- package/dist/canvas/webority-phone.json +763 -0
- package/dist/canvas/webority-web-390.json +423 -0
- package/dist/canvas/webority-web.json +423 -0
- package/dist/canvas-renames.js +1 -0
- package/dist/check.js +2 -0
- package/dist/cli.d.ts +91 -0
- package/dist/cli.js +2 -0
- package/dist/deviations.js +1 -0
- package/dist/emit/canvas.js +1 -0
- package/dist/emit/email.js +2 -0
- package/dist/emit/meanings.js +1 -0
- package/dist/emit/phone.js +3 -0
- package/dist/emit/web.js +23 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +1 -0
- package/dist/meanings.json +879 -0
- package/dist/model/colour.js +1 -0
- package/dist/model/derive.js +1 -0
- package/dist/model/index.js +1 -0
- package/dist/model/length.js +1 -0
- package/dist/model/load.js +1 -0
- package/dist/model/references.js +1 -0
- package/dist/model/resolve.js +2 -0
- package/dist/names.d.ts +13 -0
- package/dist/names.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/2020.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/code.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/index.js +2 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/scope.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/errors.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/index.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/names.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/ref_error.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/resolve.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/rules.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/util.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/applicability.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/boolSchema.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/dataType.js +4 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/defaults.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/index.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/keyword.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/subschema.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/core.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/data.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/index.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/schema.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/equal.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/ucs2length.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/uri.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/validation_error.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/allOf.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/contains.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +4 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/if.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/index.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items2020.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/not.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/properties.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/code.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/id.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/index.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/ref.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/index.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/types.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/draft2020.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/index.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/format.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/index.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/metadata.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/next.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/index.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/const.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/enum.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/index.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitContains.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitItems.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitLength.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/pattern.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/required.js +1 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +1 -0
- package/dist/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js +1 -0
- package/dist/node_modules/.pnpm/fast-uri@3.1.9/node_modules/fast-uri/index.js +1 -0
- package/dist/node_modules/.pnpm/fast-uri@3.1.9/node_modules/fast-uri/lib/schemes.js +1 -0
- package/dist/node_modules/.pnpm/fast-uri@3.1.9/node_modules/fast-uri/lib/utils.js +1 -0
- package/dist/node_modules/.pnpm/json-schema-traverse@1.0.0/node_modules/json-schema-traverse/index.js +1 -0
- package/dist/outputs.d.ts +139 -0
- package/dist/source/component.tokens.json +1672 -0
- package/dist/source/meaning.tokens.json +1025 -0
- package/dist/source/mode.dark.tokens.json +594 -0
- package/dist/source/palette.tokens.json +1406 -0
- package/dist/source/platform.phone.tokens.json +395 -0
- package/dist/source/scale.tokens.json +869 -0
- package/dist/source/width.390.tokens.json +96 -0
- package/dist/upgrade/css.js +2 -0
- package/dist/upgrade/index.js +5 -0
- package/dist/upgrade/razorAttributes.js +3 -0
- package/dist/upgrade/themeReads.js +2 -0
- package/dist/webority.js +2 -0
- package/dist/webority.resolver.json +18 -0
- package/package.json +46 -3
- package/renames/0.87.1.json +14 -0
- package/renames/0.89.0.json +1423 -0
- package/renames/renames.d.ts +42 -0
- package/schema/design-map.schema.json +143 -0
- package/schema/webority-tokens.schema.json +211 -0
- package/README.md +0 -3
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/** Theme reads the phone theme renamed or removed in a release. `from` and `to` are plain dotted paths; the upgrade writes a segment that is not an identifier as ["segment"]. */
|
|
2
|
+
export type RetiredThemeRead =
|
|
3
|
+
| { kind: "path"; from: string; to: string }
|
|
4
|
+
| { kind: "prefix"; from: string; to: string }
|
|
5
|
+
| { kind: "kebab"; under: string; names: Readonly<Record<string, string>> }
|
|
6
|
+
| { kind: "gone"; from: string; hint: string };
|
|
7
|
+
|
|
8
|
+
/** A JSX prop that took a boolean and now takes named values: the bare prop or `{true}` becomes `true`, `{false}` becomes `false`. */
|
|
9
|
+
export interface PropValueRule {
|
|
10
|
+
package: string;
|
|
11
|
+
components: string[];
|
|
12
|
+
prop: string;
|
|
13
|
+
true: string;
|
|
14
|
+
false: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** A JSX prop that took `true` or a settings object and became an on/off value plus a separate settings prop named `into`. */
|
|
18
|
+
export interface PropSplitRule {
|
|
19
|
+
package: string;
|
|
20
|
+
components: string[];
|
|
21
|
+
prop: string;
|
|
22
|
+
on: string;
|
|
23
|
+
off: string;
|
|
24
|
+
into: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** A Razor tag-helper attribute whose `"true"` and `"false"` values became named values; `values` maps the lower-cased old value to the new one. */
|
|
28
|
+
export interface RazorAttributeRule {
|
|
29
|
+
tags: string[];
|
|
30
|
+
attribute: string;
|
|
31
|
+
values: Readonly<Record<"true" | "false", string>>;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface RenameTable {
|
|
35
|
+
version: string;
|
|
36
|
+
css: { rename: [string, string][]; reads: [string, string][]; choose: Record<string, string>; checkRole: string[] };
|
|
37
|
+
themeReads: RetiredThemeRead[];
|
|
38
|
+
props: { package: string; props: string[]; from: string; to: string }[];
|
|
39
|
+
propValues: PropValueRule[];
|
|
40
|
+
propSplits: PropSplitRule[];
|
|
41
|
+
razorAttributes: RazorAttributeRule[];
|
|
42
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://webority.dev/schema/design-map.schema.json",
|
|
4
|
+
"title": "Webority design map",
|
|
5
|
+
"description": "The machine contract of a repo's .webority/design.json. design-map.md stays its prose; webority check validates against this file, then checks that every head names a listed brand, that brand names are unique, and that every brand but the library one has a head.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["schemaVersion", "tokens", "color"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"$schema": { "type": "string" },
|
|
10
|
+
"$comment": { "type": "string" },
|
|
11
|
+
"schemaVersion": { "const": 1 },
|
|
12
|
+
"brandAuthority": { "type": "object" },
|
|
13
|
+
"type": { "type": "object" },
|
|
14
|
+
"color": {
|
|
15
|
+
"type": "object",
|
|
16
|
+
"properties": {
|
|
17
|
+
"roles": {
|
|
18
|
+
"description": "Role to meaning name (a key of the tokens' color group), never a CSS variable or a hex.",
|
|
19
|
+
"type": "object",
|
|
20
|
+
"additionalProperties": { "$ref": "#/$defs/meaningName" }
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"required": ["roles"],
|
|
24
|
+
"additionalProperties": false
|
|
25
|
+
},
|
|
26
|
+
"tokens": {
|
|
27
|
+
"type": "object",
|
|
28
|
+
"required": ["brands"],
|
|
29
|
+
"properties": {
|
|
30
|
+
"brands": {
|
|
31
|
+
"description": "Every brand the repo builds. A repo with one brand writes a list of one.",
|
|
32
|
+
"type": "array",
|
|
33
|
+
"minItems": 1,
|
|
34
|
+
"items": { "$ref": "#/$defs/brand" }
|
|
35
|
+
},
|
|
36
|
+
"heads": {
|
|
37
|
+
"description": "Head project folders that receive copies of their brand's generated files.",
|
|
38
|
+
"type": "array",
|
|
39
|
+
"minItems": 1,
|
|
40
|
+
"items": { "$ref": "#/$defs/head" }
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"additionalProperties": false
|
|
44
|
+
},
|
|
45
|
+
"scale": {
|
|
46
|
+
"type": "object",
|
|
47
|
+
"propertyNames": { "enum": ["space", "radius", "elevation", "motion"] },
|
|
48
|
+
"additionalProperties": {
|
|
49
|
+
"type": "object",
|
|
50
|
+
"properties": {
|
|
51
|
+
"rhythm": { "type": "string" },
|
|
52
|
+
"character": { "type": "string" },
|
|
53
|
+
"reducedMotion": { "type": "string" },
|
|
54
|
+
"durations": {
|
|
55
|
+
"description": "Motion role to duration token.",
|
|
56
|
+
"type": "object",
|
|
57
|
+
"additionalProperties": { "$ref": "#/$defs/groupName" }
|
|
58
|
+
},
|
|
59
|
+
"roles": {
|
|
60
|
+
"type": "object",
|
|
61
|
+
"additionalProperties": { "$ref": "#/$defs/groupName" }
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"additionalProperties": false
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"logo": { "type": "object" },
|
|
68
|
+
"iconography": {
|
|
69
|
+
"type": "object",
|
|
70
|
+
"properties": {
|
|
71
|
+
"sizes": {
|
|
72
|
+
"type": "object",
|
|
73
|
+
"additionalProperties": { "$ref": "#/$defs/groupName" }
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"imagery": { "type": "object" },
|
|
78
|
+
"moodboards": { "type": "array" },
|
|
79
|
+
"voice": { "type": "object" },
|
|
80
|
+
"principles": { "type": "array" },
|
|
81
|
+
"deliverables": { "type": "object" },
|
|
82
|
+
"designSources": { "type": "string" },
|
|
83
|
+
"lastVerified": { "type": "string" }
|
|
84
|
+
},
|
|
85
|
+
"additionalProperties": false,
|
|
86
|
+
"$defs": {
|
|
87
|
+
"meaningName": {
|
|
88
|
+
"description": "A meaning name such as primary or text-body.",
|
|
89
|
+
"type": "string",
|
|
90
|
+
"pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
|
|
91
|
+
"not": { "pattern": "^[0-9]+$" }
|
|
92
|
+
},
|
|
93
|
+
"groupName": {
|
|
94
|
+
"description": "<group>.<name>, resolved against the generated token files.",
|
|
95
|
+
"type": "string",
|
|
96
|
+
"pattern": "^[a-z0-9]+(-[a-z0-9]+)*\\.[a-z0-9]+(-[a-z0-9]+)*$"
|
|
97
|
+
},
|
|
98
|
+
"relativePath": {
|
|
99
|
+
"description": "A folder relative to the repo root: no leading slash, no drive, no .. segment.",
|
|
100
|
+
"type": "string",
|
|
101
|
+
"minLength": 1,
|
|
102
|
+
"pattern": "^(?![/\\\\])(?![A-Za-z]:)(?!.*(^|[/\\\\])\\.\\.([/\\\\]|$)).+$"
|
|
103
|
+
},
|
|
104
|
+
"brand": {
|
|
105
|
+
"type": "object",
|
|
106
|
+
"required": ["name", "source", "export"],
|
|
107
|
+
"properties": {
|
|
108
|
+
"name": {
|
|
109
|
+
"description": "The brand's name; Canvas shows it as the brand theme of the same name.",
|
|
110
|
+
"type": "string",
|
|
111
|
+
"pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
|
|
112
|
+
},
|
|
113
|
+
"source": {
|
|
114
|
+
"description": "Path of the brand file, or \"library\" in webority-ui only, where the library's own tokens are the source.",
|
|
115
|
+
"type": "string",
|
|
116
|
+
"minLength": 1
|
|
117
|
+
},
|
|
118
|
+
"export": {
|
|
119
|
+
"description": "Folder the brand's generated token files are written to.",
|
|
120
|
+
"$ref": "#/$defs/relativePath"
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
"additionalProperties": false
|
|
124
|
+
},
|
|
125
|
+
"head": {
|
|
126
|
+
"type": "object",
|
|
127
|
+
"required": ["path", "brand", "kind"],
|
|
128
|
+
"properties": {
|
|
129
|
+
"path": { "$ref": "#/$defs/relativePath" },
|
|
130
|
+
"brand": {
|
|
131
|
+
"description": "The name of the brand whose files this head receives.",
|
|
132
|
+
"type": "string",
|
|
133
|
+
"pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
|
|
134
|
+
},
|
|
135
|
+
"kind": {
|
|
136
|
+
"description": "Which generated file the head receives: razor gets brand.css in wwwroot/generated, spa (a Vite web portal) gets brand.css in src/generated for its style entry to import after the theme tokens, phone gets brand.phone.js and email gets email.json in generated.",
|
|
137
|
+
"enum": ["razor", "spa", "phone", "email"]
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"additionalProperties": false
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://webority.dev/schema/webority-tokens.schema.json",
|
|
4
|
+
"title": "Webority design tokens",
|
|
5
|
+
"description": "One source file of the four tiers (palette, scale, meaning, component), a mode, platform or width override file, or a product brand file.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"propertyNames": { "$ref": "#/$defs/groupName" },
|
|
8
|
+
"properties": {
|
|
9
|
+
"palette": { "$ref": "#/$defs/paletteGroup" },
|
|
10
|
+
"color": { "$ref": "#/$defs/meaningGroup" },
|
|
11
|
+
"effect": { "$ref": "#/$defs/group" },
|
|
12
|
+
"component": { "$ref": "#/$defs/componentGroup" }
|
|
13
|
+
},
|
|
14
|
+
"additionalProperties": { "$ref": "#/$defs/group" },
|
|
15
|
+
"$defs": {
|
|
16
|
+
"name": {
|
|
17
|
+
"description": "Kebab case, not purely numeric (a step name such as 2xl is fine, 200 is not).",
|
|
18
|
+
"type": "string",
|
|
19
|
+
"pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
|
|
20
|
+
"not": { "pattern": "^[0-9]+$" }
|
|
21
|
+
},
|
|
22
|
+
"groupName": {
|
|
23
|
+
"anyOf": [{ "$ref": "#/$defs/name" }, { "enum": ["$type", "$description", "$extensions"] }]
|
|
24
|
+
},
|
|
25
|
+
"componentKey": {
|
|
26
|
+
"anyOf": [{ "$ref": "#/$defs/name" }, { "const": "$extensions" }]
|
|
27
|
+
},
|
|
28
|
+
"reference": { "type": "string", "pattern": "^\\{[a-z0-9-]+(\\.[a-z0-9-]+)+\\}$" },
|
|
29
|
+
"extensions": {
|
|
30
|
+
"type": "object",
|
|
31
|
+
"properties": {
|
|
32
|
+
"com.webority": {
|
|
33
|
+
"type": "object",
|
|
34
|
+
"properties": {
|
|
35
|
+
"internal": { "const": true },
|
|
36
|
+
"elevation": { "description": "Android elevation of a phone shadow.", "type": "integer", "minimum": 0 },
|
|
37
|
+
"platforms": {
|
|
38
|
+
"type": "array",
|
|
39
|
+
"items": { "enum": ["web", "phone"] },
|
|
40
|
+
"minItems": 1,
|
|
41
|
+
"uniqueItems": true
|
|
42
|
+
},
|
|
43
|
+
"fluidUntil": {
|
|
44
|
+
"description": "Viewport width in px at which a fluid text step stops growing.",
|
|
45
|
+
"type": "number",
|
|
46
|
+
"exclusiveMinimum": 390,
|
|
47
|
+
"maximum": 1440
|
|
48
|
+
},
|
|
49
|
+
"breakpoints": {
|
|
50
|
+
"description": "Per breakpoint, the token a responsive step takes from that width up.",
|
|
51
|
+
"type": "object",
|
|
52
|
+
"propertyNames": { "enum": ["md", "lg", "xl"] },
|
|
53
|
+
"additionalProperties": { "$ref": "#/$defs/reference" }
|
|
54
|
+
},
|
|
55
|
+
"derive": {
|
|
56
|
+
"description": "A colour computed from another instead of written out.",
|
|
57
|
+
"enum": ["on-fill", "aa-ink", "dark-aa-ink", "dark-hover"]
|
|
58
|
+
},
|
|
59
|
+
"faces": {
|
|
60
|
+
"description": "Phone font file names, by weight name.",
|
|
61
|
+
"type": "object",
|
|
62
|
+
"propertyNames": { "$ref": "#/$defs/name" },
|
|
63
|
+
"additionalProperties": { "type": "string" }
|
|
64
|
+
},
|
|
65
|
+
"brand": {
|
|
66
|
+
"description": "A product brand file: the product name, kebab case.",
|
|
67
|
+
"type": "string",
|
|
68
|
+
"pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$"
|
|
69
|
+
},
|
|
70
|
+
"dark": { "description": "A brand colour override: its dark mode value, a colour or a reference." },
|
|
71
|
+
"deviation": {
|
|
72
|
+
"description": "A brand file that sets every group: the key of its recorded deviation in deviations.json.",
|
|
73
|
+
"type": "string",
|
|
74
|
+
"pattern": "^[A-Za-z0-9][A-Za-z0-9-]*/[A-Za-z0-9][A-Za-z0-9-]*(#[a-z0-9-]+)?$"
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"additionalProperties": false
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"token": {
|
|
82
|
+
"type": "object",
|
|
83
|
+
"required": ["$value"],
|
|
84
|
+
"properties": {
|
|
85
|
+
"$value": {},
|
|
86
|
+
"$type": { "type": "string" },
|
|
87
|
+
"$description": { "type": "string", "minLength": 1 },
|
|
88
|
+
"$extensions": { "$ref": "#/$defs/extensions" }
|
|
89
|
+
},
|
|
90
|
+
"additionalProperties": false
|
|
91
|
+
},
|
|
92
|
+
"group": {
|
|
93
|
+
"type": "object",
|
|
94
|
+
"propertyNames": { "$ref": "#/$defs/groupName" },
|
|
95
|
+
"properties": {
|
|
96
|
+
"$type": { "type": "string" },
|
|
97
|
+
"$description": { "type": "string" },
|
|
98
|
+
"$extensions": { "$ref": "#/$defs/extensions" }
|
|
99
|
+
},
|
|
100
|
+
"additionalProperties": {
|
|
101
|
+
"if": { "type": "object", "required": ["$value"] },
|
|
102
|
+
"then": { "$ref": "#/$defs/token" },
|
|
103
|
+
"else": { "$ref": "#/$defs/group" }
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"paletteGroup": {
|
|
107
|
+
"description": "Raw colours, library-internal. Names are today's --wui-* names; product code never reads them.",
|
|
108
|
+
"$ref": "#/$defs/group"
|
|
109
|
+
},
|
|
110
|
+
"meaningGroup": {
|
|
111
|
+
"description": "Colour meanings. In a source file every meaning carries a description; an override file carries values only.",
|
|
112
|
+
"type": "object",
|
|
113
|
+
"propertyNames": { "$ref": "#/$defs/groupName" },
|
|
114
|
+
"properties": { "$type": { "const": "color" } },
|
|
115
|
+
"additionalProperties": { "$ref": "#/$defs/token" }
|
|
116
|
+
},
|
|
117
|
+
"componentToken": {
|
|
118
|
+
"description": "A component property with no size level or none of the families below: a dimension may be a literal px value (shape sizes). A typography value is a reference.",
|
|
119
|
+
"allOf": [
|
|
120
|
+
{ "$ref": "#/$defs/token" },
|
|
121
|
+
{
|
|
122
|
+
"if": { "properties": { "$type": { "const": "typography" } }, "required": ["$type"] },
|
|
123
|
+
"then": { "properties": { "$value": { "$ref": "#/$defs/reference" } } }
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
},
|
|
127
|
+
"componentScaleToken": {
|
|
128
|
+
"description": "A property of the text, radius or space family: a dimension or typography value is a reference to a scale token, never a literal.",
|
|
129
|
+
"allOf": [
|
|
130
|
+
{ "$ref": "#/$defs/token" },
|
|
131
|
+
{
|
|
132
|
+
"if": { "properties": { "$type": { "enum": ["dimension", "typography"] } }, "required": ["$type"] },
|
|
133
|
+
"then": { "properties": { "$value": { "$ref": "#/$defs/reference" } } }
|
|
134
|
+
}
|
|
135
|
+
]
|
|
136
|
+
},
|
|
137
|
+
"componentSize": {
|
|
138
|
+
"description": "One size of a component: its properties.",
|
|
139
|
+
"type": "object",
|
|
140
|
+
"propertyNames": { "$ref": "#/$defs/componentKey" },
|
|
141
|
+
"properties": { "$extensions": { "$ref": "#/$defs/extensions" } },
|
|
142
|
+
"patternProperties": {
|
|
143
|
+
"^(text|.+-text)$": { "$ref": "#/$defs/componentScaleToken" },
|
|
144
|
+
"^(radius|.+-radius)$": { "$ref": "#/$defs/componentScaleToken" },
|
|
145
|
+
"^(padding(-.+)?|.+-padding(-.+)?|gap|.+-gap|.+-inset|margin.*)$": { "$ref": "#/$defs/componentScaleToken" }
|
|
146
|
+
},
|
|
147
|
+
"additionalProperties": { "$ref": "#/$defs/componentToken" }
|
|
148
|
+
},
|
|
149
|
+
"componentEntry": {
|
|
150
|
+
"description": "One component: properties with no size level directly, and one group per size.",
|
|
151
|
+
"type": "object",
|
|
152
|
+
"propertyNames": { "$ref": "#/$defs/componentKey" },
|
|
153
|
+
"properties": { "$extensions": { "$ref": "#/$defs/extensions" } },
|
|
154
|
+
"patternProperties": {
|
|
155
|
+
"^(text|.+-text)$": { "$ref": "#/$defs/componentEntryNode" },
|
|
156
|
+
"^(radius|.+-radius)$": { "$ref": "#/$defs/componentEntryNode" },
|
|
157
|
+
"^(padding(-.+)?|.+-padding(-.+)?|gap|.+-gap|.+-inset|margin.*)$": { "$ref": "#/$defs/componentEntryNode" }
|
|
158
|
+
},
|
|
159
|
+
"additionalProperties": {
|
|
160
|
+
"if": { "type": "object", "required": ["$value"] },
|
|
161
|
+
"then": { "$ref": "#/$defs/componentToken" },
|
|
162
|
+
"else": { "$ref": "#/$defs/componentSize" }
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
"componentEntryNode": {
|
|
166
|
+
"if": { "type": "object", "required": ["$value"] },
|
|
167
|
+
"then": { "$ref": "#/$defs/componentScaleToken" },
|
|
168
|
+
"else": { "$ref": "#/$defs/componentSize" }
|
|
169
|
+
},
|
|
170
|
+
"componentGroup": {
|
|
171
|
+
"description": "Per component, optionally per size, then property. Spacing, text and corner values are references to a scale token; a shape size may be a literal.",
|
|
172
|
+
"type": "object",
|
|
173
|
+
"propertyNames": { "$ref": "#/$defs/name" },
|
|
174
|
+
"additionalProperties": { "$ref": "#/$defs/componentEntry" }
|
|
175
|
+
},
|
|
176
|
+
"sourceMeaning": {
|
|
177
|
+
"description": "Applied to meaning.tokens.json: every meaning needs a description.",
|
|
178
|
+
"type": "object",
|
|
179
|
+
"properties": {
|
|
180
|
+
"color": {
|
|
181
|
+
"type": "object",
|
|
182
|
+
"additionalProperties": { "required": ["$value", "$description"] }
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
"brand": {
|
|
187
|
+
"description": "Applied to a product brand file: a product overrides palette steps, colour meanings, fonts and radius and may add colour and effect names of its own, never the space scale. A name the library does not declare needs a $description, which loadBrand checks against the library. A file naming a recorded deviation may set every group.",
|
|
188
|
+
"type": "object",
|
|
189
|
+
"required": ["$extensions"],
|
|
190
|
+
"properties": {
|
|
191
|
+
"$extensions": {
|
|
192
|
+
"type": "object",
|
|
193
|
+
"required": ["com.webority"],
|
|
194
|
+
"properties": { "com.webority": { "type": "object", "required": ["brand"] } }
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
"if": {
|
|
198
|
+
"required": ["$extensions"],
|
|
199
|
+
"properties": {
|
|
200
|
+
"$extensions": {
|
|
201
|
+
"required": ["com.webority"],
|
|
202
|
+
"properties": { "com.webority": { "required": ["deviation"] } }
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
"else": {
|
|
207
|
+
"propertyNames": { "enum": ["$extensions", "$description", "palette", "color", "effect", "font", "radius"] }
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
package/README.md
DELETED