desen-core 1.0.0-draft.30 → 1.0.0-draft.31
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/.turbo/turbo-build.log +1 -1
- package/dist/schemas/style.js +12 -2
- package/package.json +1 -1
- package/src/schemas/style.ts +13 -2
package/.turbo/turbo-build.log
CHANGED
package/dist/schemas/style.js
CHANGED
|
@@ -96,10 +96,20 @@ exports.styleSpec = zod_1.z.object({
|
|
|
96
96
|
{ literal: 'padding', token: 'padding_token' },
|
|
97
97
|
{ literal: 'margin', token: 'margin_token' },
|
|
98
98
|
{ literal: 'border_radius', token: 'border_radius_token' },
|
|
99
|
-
{ literal: 'border_width', token: 'border_width_token' }
|
|
99
|
+
{ literal: 'border_width', token: 'border_width_token' },
|
|
100
|
+
{ literal: 'border_top_width', token: 'border_width_token' },
|
|
101
|
+
{ literal: 'border_right_width', token: 'border_width_token' },
|
|
102
|
+
{ literal: 'border_bottom_width', token: 'border_width_token' },
|
|
103
|
+
{ literal: 'border_left_width', token: 'border_width_token' }
|
|
100
104
|
];
|
|
101
105
|
rules.forEach(({ literal, token }) => {
|
|
102
|
-
|
|
106
|
+
const val = data[literal];
|
|
107
|
+
if (val !== undefined && data[token] === undefined) {
|
|
108
|
+
// EXEMPTION: Border widths of 0 or 1 do not require token binding
|
|
109
|
+
if (literal.includes('border_width') || literal.includes('border_top_width') || literal.includes('border_right_width') || literal.includes('border_bottom_width') || literal.includes('border_left_width')) {
|
|
110
|
+
if (val === 0 || val === 1)
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
103
113
|
ctx.addIssue({
|
|
104
114
|
code: zod_1.z.ZodIssueCode.custom,
|
|
105
115
|
message: `Fail-Closed Governance: Unbound Literal Value. Element declares [${literal}] but is missing [${token}]. Hardcoded visual styles are rejected by the design system.`,
|
package/package.json
CHANGED
package/src/schemas/style.ts
CHANGED
|
@@ -102,11 +102,22 @@ export const styleSpec = z.object({
|
|
|
102
102
|
{ literal: 'padding', token: 'padding_token' },
|
|
103
103
|
{ literal: 'margin', token: 'margin_token' },
|
|
104
104
|
{ literal: 'border_radius', token: 'border_radius_token' },
|
|
105
|
-
{ literal: 'border_width', token: 'border_width_token' }
|
|
105
|
+
{ literal: 'border_width', token: 'border_width_token' },
|
|
106
|
+
{ literal: 'border_top_width', token: 'border_width_token' },
|
|
107
|
+
{ literal: 'border_right_width', token: 'border_width_token' },
|
|
108
|
+
{ literal: 'border_bottom_width', token: 'border_width_token' },
|
|
109
|
+
{ literal: 'border_left_width', token: 'border_width_token' }
|
|
106
110
|
];
|
|
107
111
|
|
|
108
112
|
rules.forEach(({ literal, token }) => {
|
|
109
|
-
|
|
113
|
+
const val = data[literal as keyof typeof data];
|
|
114
|
+
if (val !== undefined && data[token as keyof typeof data] === undefined) {
|
|
115
|
+
|
|
116
|
+
// EXEMPTION: Border widths of 0 or 1 do not require token binding
|
|
117
|
+
if (literal.includes('border_width') || literal.includes('border_top_width') || literal.includes('border_right_width') || literal.includes('border_bottom_width') || literal.includes('border_left_width')) {
|
|
118
|
+
if (val === 0 || val === 1) return;
|
|
119
|
+
}
|
|
120
|
+
|
|
110
121
|
ctx.addIssue({
|
|
111
122
|
code: z.ZodIssueCode.custom,
|
|
112
123
|
message: `Fail-Closed Governance: Unbound Literal Value. Element declares [${literal}] but is missing [${token}]. Hardcoded visual styles are rejected by the design system.`,
|