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:
@@ -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' }),
|
||||
];
|
||||
}),
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user