Version Packages (next)
This commit is contained in:
@@ -1,5 +1,68 @@
|
||||
# @backstage/ui
|
||||
|
||||
## 0.11.0-next.1
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 243e5e7: **BREAKING**: Redesigned Table component with new `useTable` hook API.
|
||||
|
||||
- The `Table` component (React Aria wrapper) is renamed to `TableRoot`
|
||||
- New high-level `Table` component that handles data display, pagination, sorting, and selection
|
||||
- The `useTable` hook is completely redesigned with a new API supporting three pagination modes (complete, offset, cursor)
|
||||
- New types: `ColumnConfig`, `TableProps`, `TableItem`, `UseTableOptions`, `UseTableResult`
|
||||
|
||||
New features include unified pagination modes, debounced query changes, stale data preservation during reloads, and row selection with toggle/replace behaviors.
|
||||
|
||||
**Migration guide:**
|
||||
|
||||
1. Update imports and use the new `useTable` hook:
|
||||
|
||||
```diff
|
||||
-import { Table, useTable } from '@backstage/ui';
|
||||
-const { data, paginationProps } = useTable({ data: items, pagination: {...} });
|
||||
+import { Table, useTable, type ColumnConfig } from '@backstage/ui';
|
||||
+const { tableProps } = useTable({
|
||||
+ mode: 'complete',
|
||||
+ getData: () => items,
|
||||
+});
|
||||
```
|
||||
|
||||
2. Define columns and render with the new Table API:
|
||||
|
||||
```diff
|
||||
-<Table aria-label="My table">
|
||||
- <TableHeader>...</TableHeader>
|
||||
- <TableBody items={data}>...</TableBody>
|
||||
-</Table>
|
||||
-<TablePagination {...paginationProps} />
|
||||
+const columns: ColumnConfig<Item>[] = [
|
||||
+ { id: 'name', label: 'Name', isRowHeader: true, cell: item => <CellText title={item.name} /> },
|
||||
+ { id: 'type', label: 'Type', cell: item => <CellText title={item.type} /> },
|
||||
+];
|
||||
+
|
||||
+<Table columnConfig={columns} {...tableProps} />
|
||||
```
|
||||
|
||||
Affected components: Table, TableRoot, TablePagination
|
||||
|
||||
- 95246eb: **Breaking** Updating color tokens to match the new neutral style on different surfaces.
|
||||
|
||||
## Migration notes
|
||||
|
||||
There's no direct replacement for the old tint tokens but you can use the new neutral set of color tokens on surface 0 or 1 as a replacement.
|
||||
|
||||
- `--bui-bg-tint` can be replaced by `--bui-bg-neutral-on-surface-0`
|
||||
- `--bui-bg-tint-hover` can be replaced by `--bui-bg-neutral-on-surface-0-hover`
|
||||
- `--bui-bg-tint-pressed` can be replaced by `--bui-bg-neutral-on-surface-0-pressed`
|
||||
- `--bui-bg-tint-disabled` can be replaced by `--bui-bg-neutral-on-surface-0-disabled`
|
||||
|
||||
- ea0c6d8: Introduce new `ToggleButton` & `ToggleButtonGroup` components in Backstage UI
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 21c87cc: Fixes disabled state in primary and secondary buttons in Backstage UI.
|
||||
- b3253b6: Fixed `Link` component causing hard page refreshes for internal routes. The component now properly uses React Router's navigation instead of full page reloads.
|
||||
|
||||
## 0.11.0-next.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
Reference in New Issue
Block a user