Add changesets for useDefinition migration and cleanup

Signed-off-by: Johan Persson <johanopersson@gmail.com>
This commit is contained in:
Johan Persson
2026-02-27 15:28:21 +01:00
parent fb5400e39b
commit 95702abc2b
5 changed files with 32 additions and 11 deletions
+7
View File
@@ -0,0 +1,7 @@
---
'@backstage/ui': patch
---
Migrated all components from `useStyles` to `useDefinition` hook. Exported `OwnProps` types for each component, enabling better type composition for consumers.
**Affected components:** Avatar, Checkbox, Container, Dialog, FieldError, FieldLabel, Flex, FullPage, Grid, HeaderPage, Link, Menu, PasswordField, PluginHeader, Popover, RadioGroup, SearchField, Select, Skeleton, Switch, Table, TablePagination, Tabs, TagGroup, Text, TextField, ToggleButton, ToggleButtonGroup, Tooltip, VisuallyHidden
+7
View File
@@ -0,0 +1,7 @@
---
'@backstage/ui': patch
---
Fixed Link variant default from `'body'` to `'body-medium'` to match actual CSS selectors. The previous default did not correspond to a valid variant value.
**Affected components:** Link
+15
View File
@@ -0,0 +1,15 @@
---
'@backstage/ui': minor
---
**BREAKING**: Removed deprecated types `ComponentDefinition`, `ClassNamesMap`, `DataAttributeValues`, and `DataAttributesMap` from the public API. These were internal styling infrastructure types that have been replaced by the `defineComponent` system.
**Migration:**
Remove any direct usage of these types. Component definitions now use `defineComponent()` and their shapes are not part of the public API contract.
```diff
- import type { ComponentDefinition, ClassNamesMap } from '@backstage/ui';
```
If you were reading `definition.dataAttributes`, use `definition.propDefs` instead — props with `dataAttribute: true` in `propDefs` are the equivalent.
-7
View File
@@ -1,7 +0,0 @@
---
'@backstage/ui': patch
---
Migrated Avatar, Checkbox, Container, FieldError, FieldLabel, Link, and Skeleton components from `useStyles` to `useDefinition` hook. Exported `OwnProps` types for each migrated component. Fixed Link variant default from `'body'` to `'body-medium'` to match actual CSS selectors.
**Affected components:** Avatar, Checkbox, Container, FieldError, FieldLabel, Link, Skeleton
@@ -22,8 +22,8 @@ import styles from './VisuallyHidden.module.css';
* Component definition for VisuallyHidden
* @public
*/
export const VisuallyHiddenDefinition = defineComponent<VisuallyHiddenOwnProps>()(
{
export const VisuallyHiddenDefinition =
defineComponent<VisuallyHiddenOwnProps>()({
styles,
classNames: {
root: 'bui-VisuallyHidden',
@@ -31,5 +31,4 @@ export const VisuallyHiddenDefinition = defineComponent<VisuallyHiddenOwnProps>(
propDefs: {
className: {},
},
},
);
});