Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
robphoenix committed Aug 5, 2024
1 parent ad28f66 commit 34957e9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 19 deletions.
31 changes: 14 additions & 17 deletions packages/web-ui/docs/web-ui/guides/migration/v1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ documenting for others, thankyou!

- [Typography component](#typography-component)
- [Buttons size renaming](#buttons-size-renaming)
- [Link component](#link-component)
- [Codemods](#codemods)
- [Migration](#migration)
- [Rename lab button size](#rename-lab-button-size)
- [Rename lab Button size](#rename-lab-button-size)
- [Rename IconButton size](#rename-iconbutton-size)

## Typography component

Expand Down Expand Up @@ -134,13 +136,14 @@ confused with that component.

### Variant and Size

There are 2 main changes to be aware of; the removal of the `variant` prop, and
the addition of the `size` prop. These changes mean that the `Link` component's
font size no longer simply reflects that of the `Text` and `Heading`
components, but is controlled by the 2 size values; `small` & `large`.
There are 2 main API changes to be aware of; the removal of the `variant` prop, and
the addition of the `size` prop.

There is no equivalent replacement if any of the `Heading` variants were used
with the legacy `Link` component. This is by design.
Visually, these changes mean that the `Link` component's font size no longer
simply reflects that of the `Text` and `Heading` components, but is controlled
by the 2 size values; `small` & `large`. These sizes do not reflect any of the
previous variants, and change both the font size, and the line height. The font
weight has also changed from 'regular' to 'semibold'.

As this change is not a 1-2-1 replacement, when migrating, you will need to
visually check each usage of the component, and appropriately choose the best
Expand All @@ -149,13 +152,6 @@ completely replace the previous usage of the `Link` component with the new
`TextLink` component, if the previous usage was inline within a section of
text.

```diff
- <Link variant="body">Link</Link>
- <Link variant="subtitle">Link</Link>
+ <Link size="small">Link</Link>
+ <Link size="large">Link</Link>
```

### Colour

The new `Link` component is not designed to be used on darker background
Expand All @@ -167,9 +163,10 @@ design team.
### Codemod

Due to the nature of the changes, and the fact this is not a 1-2-1 replacement,
we are unable to offer a reliable codemod. We also felt it would be better not
to provide a codemod which removed legacy props, so that the errors this caused
would highlight where manual updates and checks needed to happen.
we are unable to offer a reliable codemod. We also feel it would be better not
to provide a codemod removing legacy props, so that the errors caused by having
incorrect props will highlight where manual updates and checks needed to
happen.

## Codemods

Expand Down
4 changes: 2 additions & 2 deletions packages/web-ui/src/Link/Link.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const KitchenSink: Story = {
<Flex gap={2} align="center">
{sizes.map(size => (
<Link key={size} size={size} href="#">
Link
Hamburgefons
{size === 'large' ? <ChevronRightMediumIcon /> : <ChevronRightSmallIcon />}
</Link>
))}
Expand All @@ -46,7 +46,7 @@ export const KitchenSink: Story = {
{sizes.map(size => (
<Link key={size} size={size} href="#">
{size === 'large' ? <ChevronLeftMediumIcon /> : <ChevronLeftSmallIcon />}
Link
Hamburgefons
</Link>
))}
</Flex>
Expand Down

0 comments on commit 34957e9

Please sign in to comment.