@mediaradar/design-components 0.35.0 → 0.37.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 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" })`).
@@ -0,0 +1,14 @@
1
+ {
2
+ "version": "0.37.0",
3
+ "components": [
4
+ "BarChartPlaceholder",
5
+ "Card",
6
+ "DateRangeFilter",
7
+ "LineChartPlaceholder",
8
+ "PieChartPlaceholder",
9
+ "SelectAllVisible",
10
+ "SelectedSection",
11
+ "SelectionPicker",
12
+ "WorkspaceSelectedCard"
13
+ ]
14
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mediaradar/design-components",
3
- "version": "0.35.0",
3
+ "version": "0.37.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -19,16 +19,18 @@
19
19
  "import": "./dist/index.js",
20
20
  "require": "./dist/index.cjs"
21
21
  },
22
+ "./approved-components.json": "./dist/approved-components.json",
22
23
  "./package.json": "./package.json"
23
24
  },
24
25
  "publishConfig": {
25
26
  "access": "public"
26
27
  },
27
28
  "scripts": {
28
- "build": "tsup",
29
+ "build": "tsup && node scripts/write-approved-components.mjs",
29
30
  "typecheck": "tsc --noEmit",
30
31
  "check:token-compat": "node scripts/check-token-compat.mjs",
31
32
  "check:arbitrary-values": "node scripts/check-arbitrary-values.mjs",
33
+ "check:colors": "node scripts/check-colors.mjs",
32
34
  "check:sentence-case": "node scripts/check-sentence-case.mjs",
33
35
  "test": "node --test test/cn.test.mjs test/jsdom.test.mjs"
34
36
  },