@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
- ], u = {
126
- // color: semantic theme colors (primary, secondary, error, etc.)
127
- Typography: ["color"],
128
- Link: ["color"],
129
- Button: ["color"],
130
- ButtonGroup: ["color"],
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(t) {
161
- const o = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Set();
142
+ create(l) {
143
+ const r = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Set();
162
144
  return {
163
- ImportDeclaration(l) {
164
- const r = l;
165
- r.source.value === "@clearstory/drywall-react" && r.specifiers.forEach((e) => {
166
- e.type === "ImportSpecifier" && e.imported ? o.set(e.local.name, e.imported.name) : e.type === "ImportNamespaceSpecifier" && p.add(e.local.name);
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(l) {
170
- const r = l;
171
- let e, s;
172
- if ("name" in r.name) {
173
- if (e = r.name.name, !o.has(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
- s = o.get(e);
176
- } else if (r.name.type === "JSXMemberExpression") {
177
- const n = r.name.object.name;
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 m = [];
183
- r.attributes.forEach((n) => {
184
- const i = n;
185
- if (i.type !== "JSXAttribute" || !i.name)
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 = i.name.name;
168
+ const a = n.name.name;
188
169
  if (a === "sx" || !g.includes(a))
189
170
  return;
190
- const d = u[s];
191
- if (d && d.includes(a))
192
- if (a === "color") {
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
- }), m.forEach((n) => {
204
- t.report({
205
- node: n,
175
+ }), p.forEach((t) => {
176
+ l.report({
177
+ node: t,
206
178
  messageId: "systemProp",
207
179
  data: {
208
- prop: n.name.name,
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
- h as default
190
+ f as default
251
191
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clearstory/drywall-react",
3
- "version": "7.2.0",
3
+ "version": "7.2.1",
4
4
  "license": "UNLICENSED",
5
5
  "description": "a Clearstory software design system",
6
6
  "type": "module",