diff --git a/bestax-mcp/data/catalog.json b/bestax-mcp/data/catalog.json index d0f79f20c..3b0a4b85d 100644 --- a/bestax-mcp/data/catalog.json +++ b/bestax-mcp/data/catalog.json @@ -557,7 +557,7 @@ "slug": "layout/level", "import": "import { Level } from '@allxsmith/bestax-bulma';", "compound": true, - "propCount": 26, + "propCount": 23, "exampleCount": 5 }, { diff --git a/bestax-mcp/data/components/Level.json b/bestax-mcp/data/components/Level.json index f4c27b4ac..131954829 100644 --- a/bestax-mcp/data/components/Level.json +++ b/bestax-mcp/data/components/Level.json @@ -287,37 +287,10 @@ "required": false, "inherited": false, "deprecated": false - }, - { - "name": "href", - "type": "string", - "default": null, - "description": "Href for \"a\" tag.", - "required": false, - "inherited": false, - "deprecated": false - }, - { - "name": "target", - "type": "string", - "default": null, - "description": "Target for \"a\" tag", - "required": false, - "inherited": false, - "deprecated": false - }, - { - "name": "rel", - "type": "string", - "default": null, - "description": "Rel for \"a\" tag", - "required": false, - "inherited": false, - "deprecated": false } ], "extraProps": [], - "catchAll": "All standard
attributes and Bulma helper props", "types": [] } ], diff --git a/bestax-mcp/data/components/SubTitle.json b/bestax-mcp/data/components/SubTitle.json index fc87a4d82..f54e82e26 100644 --- a/bestax-mcp/data/components/SubTitle.json +++ b/bestax-mcp/data/components/SubTitle.json @@ -128,7 +128,7 @@ "deprecated": false } ], - "catchAll": "All standard
attributes and Bulma helper props", "types": [] } ], diff --git a/bestax-mcp/data/components/Title.json b/bestax-mcp/data/components/Title.json index 286b6cc30..bcfa719f0 100644 --- a/bestax-mcp/data/components/Title.json +++ b/bestax-mcp/data/components/Title.json @@ -135,7 +135,7 @@ "deprecated": false } ], - "catchAll": "All standard
attributes and Bulma helper props",
"types": []
}
],
diff --git a/bestax-mcp/data/skills.json b/bestax-mcp/data/skills.json
index 206fb6708..721a6c2d7 100644
--- a/bestax-mcp/data/skills.json
+++ b/bestax-mcp/data/skills.json
@@ -98,7 +98,7 @@
{
"id": "bloomer-unmappables",
"file": "references/bloomer/unmappables.md",
- "bytes": 16259
+ "bytes": 16354
},
{
"id": "css-migration",
@@ -118,7 +118,7 @@
{
"id": "rbx-unmappables",
"file": "references/rbx/unmappables.md",
- "bytes": 13444
+ "bytes": 13539
},
{
"id": "react-bulma-components-component-map",
@@ -133,7 +133,7 @@
{
"id": "react-bulma-components-unmappables",
"file": "references/react-bulma-components/unmappables.md",
- "bytes": 9448
+ "bytes": 9543
}
],
"examples": []
diff --git a/bestax-migrate/e2e/as-unions.test.ts b/bestax-migrate/e2e/as-unions.test.ts
index 94a296484..7132b9443 100644
--- a/bestax-migrate/e2e/as-unions.test.ts
+++ b/bestax-migrate/e2e/as-unions.test.ts
@@ -381,30 +381,6 @@ describe('the per-target link-attribute exception matches the library', () => {
diagnostics: '',
});
});
-
- it('holds `Level.Item` to exactly the link attributes it declares', () => {
- // Most href-capable targets either follow `as` or extend
- // `AnchorHTMLAttributes`; this one enumerates, and the rule has a row for
- // it. Asserted by use, both ways.
- const rows: string[] = [
- "import { Level } from '@allxsmith/bestax-bulma';",
- '',
- `export const ok = ` without it. That asymmetry is deliberate for now: deriving
+ * them from `as` instead is what makes the dead pair a type error, and it also
+ * stops `const p: LevelItemProps = { href }` compiling for consumers who write
+ * it today. #672 carries that half, labelled `next-major`.
+ *
+ * What this list must NOT become is a shorter one. Enumerating only `href`,
+ * `target` and `rel` made every other anchor attribute a type error even at
+ * `as="a"`, which is what #641 reported.
*/
export interface LevelItemProps
extends
+ AnchorOnlyAttributes,
React.HTMLAttributes<
HTMLDivElement | HTMLParagraphElement | HTMLAnchorElement
>,
@@ -185,12 +220,6 @@ export interface LevelItemProps
className?: string;
/** Content. */
children?: React.ReactNode;
- /** Href for "a" tag. */
- href?: string;
- /** Target for "a" tag */
- target?: string;
- /** Rel for "a" tag */
- rel?: string;
}
/**
@@ -205,9 +234,6 @@ export const LevelItem: React.FC ` attributes and Bulma helper props | — | See [Helper Props](../helpers/usebulmaclasses.md) |
diff --git a/docs/docs/api/elements/title.md b/docs/docs/api/elements/title.md
index 06bab1f08..cedea1c49 100644
--- a/docs/docs/api/elements/title.md
+++ b/docs/docs/api/elements/title.md
@@ -174,7 +174,7 @@ When using `as="p"`, the element is visually styled as a heading but semanticall
| `textColor` | [Bulma color](../helpers/valid-values.md) \| `'inherit'` \| `'current'` | — | Text color helper. |
| `bgColor` | [Bulma color](../helpers/valid-values.md) \| `'inherit'` \| `'current'` | — | Background color helper. |
| `skeleton` | `boolean` | — | Applies the `is-skeleton` class to the entire component. |
-| `...` | All standard ` ` attributes and Bulma helper props | — | See [Helper Props](../helpers/usebulmaclasses.md) |
diff --git a/docs/docs/api/layout/level.md b/docs/docs/api/layout/level.md
index 19e683ffb..33e24e0d2 100644
--- a/docs/docs/api/layout/level.md
+++ b/docs/docs/api/layout/level.md
@@ -292,10 +292,7 @@ You can use all [Bulma helper props](../helpers/usebulmaclasses.md) with ` ` attributes and Bulma helper props | — | See [Helper Props](../helpers/usebulmaclasses.md) |
diff --git a/scripts/lib/props-extract.mjs b/scripts/lib/props-extract.mjs
index bcd6b94e5..6e9e21b86 100644
--- a/scripts/lib/props-extract.mjs
+++ b/scripts/lib/props-extract.mjs
@@ -1188,8 +1188,14 @@ function catchAllRow(external, markdown = true) {
);
continue;
}
- const m = e.text.match(/HTML\w*Element/);
- if (m) elements.add(DOM_ELEMENT_LABELS[m[0]] ?? 'HTML');
+ // Every match, not the first. A component whose base is a UNION of elements
+ // — `Level.Item` is `HTMLDivElement | HTMLParagraphElement | HTMLAnchorElement`
+ // — was described by whichever one came first, so its page and the MCP index
+ // both said " ` nor the `` it
+ // also renders.
+ for (const m of e.text.matchAll(/HTML\w*Element/g)) {
+ elements.add(DOM_ELEMENT_LABELS[m[0]] ?? 'HTML');
+ }
}
// Surfaced so a test can hold every polymorphic component to a RECOGNIZED
// constraint. 'unknown' silently takes the open wording, which over-promises
diff --git a/scripts/props-extract.test.mjs b/scripts/props-extract.test.mjs
index fd1d3bff3..a507db691 100644
--- a/scripts/props-extract.test.mjs
+++ b/scripts/props-extract.test.mjs
@@ -241,6 +241,28 @@ test('every polymorphic component has a recognized `as` constraint', () => {
assert.deepEqual(table('Button', 'Button').catchAll.asKinds, ['open']);
});
+test('a union element base names every element, not the first', () => {
+ // `catchAllRow` read the base with `String.match` and no `/g`, so a component
+ // whose props extend `HTMLAttributes` was described by whichever
+ // element came first. The regenerated pages are not the guard: a one-match
+ // implementation regenerates them just as incomplete, and `gen:*:check` calls
+ // that fresh.
+ assert.match(
+ table('Level', 'Level.Item').catchAll.text,
+ /`` \/ ` ` attributes/
+ );
+ for (const [component, path] of [
+ ['Title', 'Title'],
+ ['SubTitle', 'SubTitle'],
+ ]) {
+ assert.match(
+ table(component, path).catchAll.text,
+ /` `/,
+ `${path} drops the it also renders`
+ );
+ }
+});
+
test('every polymorphic component names a concrete default element', () => {
// A type parameter defaulting to the CONSTRAINT rather than to a tag —
// ` ` or a ` ` or a ` ` or a ``–`
` attributes and Bulma helper props | — | See [Helper Props](../helpers/usebulmaclasses.md) |
+| `...` | All standard `
`–`
` / `
`–`
` attributes and Bulma helper props | — | See [Helper Props](../helpers/usebulmaclasses.md) |
+| `...` | All standard `
`–`
` / `