Clarify icon sizing rules for NFS icons

Document the IconElement sizing contract, ensure deprecated icon component registrations inherit size correctly, and add changesets for the affected icon migration packages.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
This commit is contained in:
Patrik Oldsberg
2026-03-07 18:38:02 +01:00
parent ed8d9ce67c
commit 3f36ce1257
6 changed files with 32 additions and 18 deletions
@@ -61,8 +61,6 @@ describe('DefaultIconsApi', () => {
expect(result.type).toBe(MyIcon);
// @ts-expect-error accessing internal React element structure
expect(result.props.fontSize).toBe('inherit');
// @ts-expect-error accessing internal React element structure
expect(result.props.size).toBe('1em');
});
it('should wrap IconElement values in a component for getIcon()', () => {
@@ -46,7 +46,10 @@ export class DefaultIconsApi implements IconsApi {
return [key, value];
}
deprecatedKeys.push(key);
return [key, createElement(value as IconComponent)];
return [
key,
createElement(value as IconComponent, { fontSize: 'inherit' }),
];
}),
);