@mediaradar/design-components 0.35.0 → 0.38.0
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/README.md +27 -0
- package/dist/approved-components.json +14 -0
- package/dist/index.cjs +437 -444
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +389 -396
- package/dist/index.js.map +1 -1
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -119,3 +119,30 @@ It fails if any class the installed version of this package uses is
|
|
|
119
119
|
missing from the app's compiled CSS — whether because Tailwind isn't
|
|
120
120
|
scanning the package, or because the app's `@mediaradar/design-tokens` is
|
|
121
121
|
older than this package's peer range.
|
|
122
|
+
|
|
123
|
+
## Approved components (COMP-11)
|
|
124
|
+
|
|
125
|
+
`@mediaradar/design-components/approved-components.json` lists every
|
|
126
|
+
component tagged `@status stable`, for the installed version:
|
|
127
|
+
|
|
128
|
+
```json
|
|
129
|
+
{ "version": "0.37.0", "components": ["BarChartPlaceholder", "Card", "..."] }
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
COMP-11 (`docs/ux-frontend-standards.md`) says an app never defines its own
|
|
133
|
+
component with one of these names. Build the lint rule from this file rather
|
|
134
|
+
than a hand-typed list, so a new sign-off reaches the app with its normal
|
|
135
|
+
package bump. ESLint flat config (ESM):
|
|
136
|
+
|
|
137
|
+
```js
|
|
138
|
+
import approved from '@mediaradar/design-components/approved-components.json' with { type: 'json' }
|
|
139
|
+
|
|
140
|
+
const NO_LOCAL_COPY = {
|
|
141
|
+
selector: `:matches(FunctionDeclaration, ClassDeclaration, VariableDeclarator)[id.name=/^(${approved.components.join('|')})$/]`,
|
|
142
|
+
message: 'COMP-11: this is an approved component; import it from @mediaradar/design-components instead of defining one with the same name.',
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
In an `.eslintrc.cjs`, `require('@mediaradar/design-components/approved-components.json')`.
|
|
147
|
+
The file is written by the build from the `@pattern` blocks, so it always
|
|
148
|
+
matches the catalog (`search_components({ status: "stable" })`).
|