@clearstory/drywall-react 7.2.0 → 7.2.1
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.
|
@@ -14,7 +14,6 @@ const g = [
|
|
|
14
14
|
"outlineColor",
|
|
15
15
|
"borderRadius",
|
|
16
16
|
// colors
|
|
17
|
-
"color",
|
|
18
17
|
"bgcolor",
|
|
19
18
|
"backgroundColor",
|
|
20
19
|
// spacing
|
|
@@ -122,29 +121,12 @@ const g = [
|
|
|
122
121
|
"typography",
|
|
123
122
|
// other common system props
|
|
124
123
|
"spacing"
|
|
125
|
-
],
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
IconButton: ["color"],
|
|
132
|
-
Chip: ["color"],
|
|
133
|
-
Badge: ["color"],
|
|
134
|
-
Alert: ["color"],
|
|
135
|
-
CircularProgress: ["color"],
|
|
136
|
-
LinearProgress: ["color"],
|
|
137
|
-
Radio: ["color"],
|
|
138
|
-
Checkbox: ["color"],
|
|
139
|
-
Switch: ["color"],
|
|
140
|
-
SvgIcon: ["color"],
|
|
141
|
-
FormLabel: ["color"],
|
|
142
|
-
FormControl: ["color"],
|
|
143
|
-
ToggleButton: ["color"],
|
|
144
|
-
ToggleButtonGroup: ["color"],
|
|
145
|
-
// Container: maxWidth accepts breakpoint values (xs, sm, md, lg, xl), not CSS values
|
|
146
|
-
Container: ["maxWidth"]
|
|
147
|
-
}, h = {
|
|
124
|
+
], c = {
|
|
125
|
+
Container: ["maxWidth"],
|
|
126
|
+
Dialog: ["maxWidth"],
|
|
127
|
+
InputAdornment: ["position"],
|
|
128
|
+
TableCell: ["padding"]
|
|
129
|
+
}, f = {
|
|
148
130
|
meta: {
|
|
149
131
|
type: "problem",
|
|
150
132
|
docs: {
|
|
@@ -157,55 +139,45 @@ const g = [
|
|
|
157
139
|
},
|
|
158
140
|
schema: []
|
|
159
141
|
},
|
|
160
|
-
create(
|
|
161
|
-
const
|
|
142
|
+
create(l) {
|
|
143
|
+
const r = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Set();
|
|
162
144
|
return {
|
|
163
|
-
ImportDeclaration(
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
e.type === "ImportSpecifier" && e.imported ?
|
|
145
|
+
ImportDeclaration(i) {
|
|
146
|
+
const o = i;
|
|
147
|
+
o.source.value === "@clearstory/drywall-react" && o.specifiers.forEach((e) => {
|
|
148
|
+
e.type === "ImportSpecifier" && e.imported ? r.set(e.local.name, e.imported.name) : e.type === "ImportNamespaceSpecifier" && m.add(e.local.name);
|
|
167
149
|
});
|
|
168
150
|
},
|
|
169
|
-
JSXOpeningElement(
|
|
170
|
-
const
|
|
171
|
-
let e
|
|
172
|
-
if ("name" in
|
|
173
|
-
if (e =
|
|
151
|
+
JSXOpeningElement(i) {
|
|
152
|
+
const o = i;
|
|
153
|
+
let e;
|
|
154
|
+
if ("name" in o.name) {
|
|
155
|
+
if (e = o.name.name, !r.has(e))
|
|
174
156
|
return;
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
if (e = r.name.property.name, s = e, !p.has(n))
|
|
157
|
+
} else if (o.name.type === "JSXMemberExpression") {
|
|
158
|
+
const t = o.name.object.name;
|
|
159
|
+
if (e = o.name.property.name, !m.has(t))
|
|
179
160
|
return;
|
|
180
161
|
} else
|
|
181
162
|
return;
|
|
182
|
-
const
|
|
183
|
-
|
|
184
|
-
const
|
|
185
|
-
if (
|
|
163
|
+
const p = [];
|
|
164
|
+
o.attributes.forEach((t) => {
|
|
165
|
+
const n = t;
|
|
166
|
+
if (n.type !== "JSXAttribute" || !n.name)
|
|
186
167
|
return;
|
|
187
|
-
const a =
|
|
168
|
+
const a = n.name.name;
|
|
188
169
|
if (a === "sx" || !g.includes(a))
|
|
189
170
|
return;
|
|
190
|
-
const d =
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
if (i.value) {
|
|
194
|
-
const c = f(i.value);
|
|
195
|
-
if (y(c))
|
|
196
|
-
return;
|
|
197
|
-
}
|
|
198
|
-
} else
|
|
199
|
-
return;
|
|
200
|
-
m.push(
|
|
201
|
-
i
|
|
171
|
+
const s = r.get(e) ?? e, d = c[s];
|
|
172
|
+
d && d.includes(a) || p.push(
|
|
173
|
+
n
|
|
202
174
|
);
|
|
203
|
-
}),
|
|
204
|
-
|
|
205
|
-
node:
|
|
175
|
+
}), p.forEach((t) => {
|
|
176
|
+
l.report({
|
|
177
|
+
node: t,
|
|
206
178
|
messageId: "systemProp",
|
|
207
179
|
data: {
|
|
208
|
-
prop:
|
|
180
|
+
prop: t.name.name,
|
|
209
181
|
component: e
|
|
210
182
|
}
|
|
211
183
|
});
|
|
@@ -214,38 +186,6 @@ const g = [
|
|
|
214
186
|
};
|
|
215
187
|
}
|
|
216
188
|
};
|
|
217
|
-
function f(t) {
|
|
218
|
-
if (!t) return null;
|
|
219
|
-
const o = t;
|
|
220
|
-
if (o.type === "Literal")
|
|
221
|
-
return String(o.value);
|
|
222
|
-
if (o.type === "JSXExpressionContainer" && o.expression) {
|
|
223
|
-
if (o.expression.type === "Literal")
|
|
224
|
-
return String(o.expression.value);
|
|
225
|
-
if (o.expression.type === "Identifier")
|
|
226
|
-
return o.expression.name || null;
|
|
227
|
-
}
|
|
228
|
-
return null;
|
|
229
|
-
}
|
|
230
|
-
function y(t) {
|
|
231
|
-
return [
|
|
232
|
-
"inherit",
|
|
233
|
-
"primary",
|
|
234
|
-
"secondary",
|
|
235
|
-
"error",
|
|
236
|
-
"warning",
|
|
237
|
-
"info",
|
|
238
|
-
"success",
|
|
239
|
-
"default",
|
|
240
|
-
// Badge, Radio, Checkbox, Switch
|
|
241
|
-
"action",
|
|
242
|
-
// SvgIcon
|
|
243
|
-
"disabled",
|
|
244
|
-
// SvgIcon
|
|
245
|
-
"standard"
|
|
246
|
-
// ToggleButton, ToggleButtonGroup
|
|
247
|
-
].includes(t || "");
|
|
248
|
-
}
|
|
249
189
|
export {
|
|
250
|
-
|
|
190
|
+
f as default
|
|
251
191
|
};
|