@neatico/visual-core 0.14.71 → 0.14.72
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/dist/cjs/styleManifest.js +11 -1
- package/dist/designSystem.d.ts +2 -0
- package/dist/styleManifest.d.ts +2 -0
- package/dist/styleManifest.js +11 -1
- package/package.json +1 -1
|
@@ -55,6 +55,10 @@ function validateStyleManifest(value) {
|
|
|
55
55
|
if (!typography ||
|
|
56
56
|
["heading", "body", "code"].some((key) => typeof typography[key] !==
|
|
57
57
|
"string") ||
|
|
58
|
+
["quantity", "label"].some(key => {
|
|
59
|
+
const font = typography[key];
|
|
60
|
+
return font !== undefined && (typeof font !== "string" || !font.trim() || font.length > 100);
|
|
61
|
+
}) ||
|
|
58
62
|
!Number.isInteger(typography.headingWeight) ||
|
|
59
63
|
typography.headingWeight < 100 ||
|
|
60
64
|
typography.headingWeight > 900)
|
|
@@ -69,7 +73,11 @@ function validateStyleManifest(value) {
|
|
|
69
73
|
!["none", "hairline", "accent"].includes(geometry.rule))
|
|
70
74
|
return fail();
|
|
71
75
|
if (!manifest.fonts ||
|
|
72
|
-
Object.keys(manifest.fonts).
|
|
76
|
+
Object.keys(manifest.fonts).some(key => !["heading", "body", "code", "quantity", "label"].includes(key)) ||
|
|
77
|
+
["quantity", "label"].some(key => {
|
|
78
|
+
const font = manifest.fonts[key];
|
|
79
|
+
return font !== undefined && (typeof font !== "string" || !font.trim() || font.length > 100);
|
|
80
|
+
}) ||
|
|
73
81
|
["heading", "body", "code"].some((key) => {
|
|
74
82
|
const font = manifest.fonts[key];
|
|
75
83
|
return typeof font !== "string" || !font.trim() || font.length > 100;
|
|
@@ -97,6 +105,8 @@ function validateStyleManifest(value) {
|
|
|
97
105
|
heading: manifest.fonts.heading,
|
|
98
106
|
body: manifest.fonts.body,
|
|
99
107
|
code: manifest.fonts.code,
|
|
108
|
+
...(manifest.fonts.quantity ? { quantity: manifest.fonts.quantity } : {}),
|
|
109
|
+
...(manifest.fonts.label ? { label: manifest.fonts.label } : {}),
|
|
100
110
|
},
|
|
101
111
|
imagery: {
|
|
102
112
|
medium: manifest.imagery.medium,
|
package/dist/designSystem.d.ts
CHANGED
package/dist/styleManifest.d.ts
CHANGED
package/dist/styleManifest.js
CHANGED
|
@@ -51,6 +51,10 @@ export function validateStyleManifest(value) {
|
|
|
51
51
|
if (!typography ||
|
|
52
52
|
["heading", "body", "code"].some((key) => typeof typography[key] !==
|
|
53
53
|
"string") ||
|
|
54
|
+
["quantity", "label"].some(key => {
|
|
55
|
+
const font = typography[key];
|
|
56
|
+
return font !== undefined && (typeof font !== "string" || !font.trim() || font.length > 100);
|
|
57
|
+
}) ||
|
|
54
58
|
!Number.isInteger(typography.headingWeight) ||
|
|
55
59
|
typography.headingWeight < 100 ||
|
|
56
60
|
typography.headingWeight > 900)
|
|
@@ -65,7 +69,11 @@ export function validateStyleManifest(value) {
|
|
|
65
69
|
!["none", "hairline", "accent"].includes(geometry.rule))
|
|
66
70
|
return fail();
|
|
67
71
|
if (!manifest.fonts ||
|
|
68
|
-
Object.keys(manifest.fonts).
|
|
72
|
+
Object.keys(manifest.fonts).some(key => !["heading", "body", "code", "quantity", "label"].includes(key)) ||
|
|
73
|
+
["quantity", "label"].some(key => {
|
|
74
|
+
const font = manifest.fonts[key];
|
|
75
|
+
return font !== undefined && (typeof font !== "string" || !font.trim() || font.length > 100);
|
|
76
|
+
}) ||
|
|
69
77
|
["heading", "body", "code"].some((key) => {
|
|
70
78
|
const font = manifest.fonts[key];
|
|
71
79
|
return typeof font !== "string" || !font.trim() || font.length > 100;
|
|
@@ -93,6 +101,8 @@ export function validateStyleManifest(value) {
|
|
|
93
101
|
heading: manifest.fonts.heading,
|
|
94
102
|
body: manifest.fonts.body,
|
|
95
103
|
code: manifest.fonts.code,
|
|
104
|
+
...(manifest.fonts.quantity ? { quantity: manifest.fonts.quantity } : {}),
|
|
105
|
+
...(manifest.fonts.label ? { label: manifest.fonts.label } : {}),
|
|
96
106
|
},
|
|
97
107
|
imagery: {
|
|
98
108
|
medium: manifest.imagery.medium,
|
package/package.json
CHANGED