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.
@@ -1,5 +1,5 @@
1
1
 
2
2
  
3
- > desen-core@1.0.0-draft.30 build /Users/selmanay/Desktop/desen/packages/core
3
+ > desen-core@1.0.0-draft.31 build /Users/selmanay/Desktop/desen/packages/core
4
4
  > tsc
5
5
 
@@ -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
- if (data[literal] !== undefined && data[token] === undefined) {
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "desen-core",
3
- "version": "1.0.0-draft.30",
3
+ "version": "1.0.0-draft.31",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "dependencies": {
@@ -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
- if (data[literal as keyof typeof data] !== undefined && data[token as keyof typeof data] === undefined) {
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.`,