` (1 occurrence); use Astryx `Button`; do not hand-write controls from raw elements or custom control CSS (API Use-the-System)',
+ ],
+]);
function main() {
if (!existsSync(pathsFile) || !existsSync(mdFile)) {
@@ -44,6 +56,7 @@ function main() {
}
const rendered = renderAstryxSurfaceInventory(root);
+ assertNoAstryxBlockers(rendered, legacyBlockerBaseline);
const committedMd = readFileSync(mdFile, 'utf8');
const committedPaths = readFileSync(pathsFile, 'utf8');
const mdDrift = committedMd !== rendered.markdown;
diff --git a/scripts/generate-astryx-surface-inventory.mjs b/scripts/generate-astryx-surface-inventory.mjs
index 076e7753bd..9b4c130595 100644
--- a/scripts/generate-astryx-surface-inventory.mjs
+++ b/scripts/generate-astryx-surface-inventory.mjs
@@ -385,6 +385,8 @@ const RAW_BUTTON_RE = /<\s*button\b/;
const RAW_INPUT_RE = /<\s*input\b/;
const RAW_SELECT_RE = /<\s*select\b/;
const RAW_TEXTAREA_RE = /<\s*textarea\b/;
+const RAW_ACTION_ELEMENT_RE =
+ /<\s*(span|div)\b(?=[^>]*(?:onClick\s*=|role\s*=\s*['"]button['"]))[^>]*>/g;
const HEX_RE = /#[0-9a-fA-F]{3,8}\b/;
const OFF_HEIGHT_RE = /(?:min-)?height:\s*(\d+)px/g;
const ALLOWED_H = new Set([28, 32, 36]);
@@ -528,11 +530,22 @@ export function analyzeTsx(rel, text, ctx) {
const rawInput = RAW_INPUT_RE.test(code);
const rawSelect = RAW_SELECT_RE.test(code);
const rawTextarea = RAW_TEXTAREA_RE.test(code);
+ const rawActionElements = [...code.matchAll(RAW_ACTION_ELEMENT_RE)].map((match) => match[1]);
+ const rawActionElementCounts = new Map();
+ for (const element of rawActionElements) {
+ rawActionElementCounts.set(element, (rawActionElementCounts.get(element) || 0) + 1);
+ }
const gaps = [];
+ const admissionGaps = [];
if (rawButton) gaps.push('raw `