Open lucasaarcoverde opened 6 months ago
@lucasaarcoverde is this documentation updated? This content should be moved to the documentation website. There is already a page about Design Migration
so it would make sense for this content to live in the documentation too.
Proposal: Migration
is expandable and includes pages Design
and Code
.
Can we add this to the documentation site? @lucasaarcoverde
Migration
In this documentation you can find information about what changed from
@vtex/admin-ui@0.137.x
to@vtex/shoreline-components
package.I've added some tags to help to understand the size of the change on each component, you can check below what each tag means:
codemod
: we can implement a codemod for the changedocumentation
: the changes on the component API it's complex and it's better to reimplement the component from scratch by following the instructions on the documentationimport-only
: the component has the same API and we only need to change its import fromadmin-ui
toshoreline
.Alert
tags:
codemod
;action
property doesn’t exist anymore. Now you must add the action by hand using theButton
component'info' | 'positive' | 'warning' | 'critical'
to'informational' | 'success' | 'critical' | 'warning'
Before
After
Bleed
tags:
codemod
;left
andright
are nowstart
andend
.After
After
Button
tags:
codemod
variant
property values has changed fromprimary | secondary | tertiary | critical |criticalSecondary |criticalTertiary | neutralTertiary
to'primary' | 'secondary' | 'tertiary' | 'critical' | 'criticalTertiary'
icon
andiconPosition
doesn’t exist, now you must useIconButton
component.Before
After
Center
tags:
codemod
;import-only
;There are no changes.
Checkbox
tags:
documentation
;helpText
,errorText
, anderror
are now implemented using theField
component. You can check theField
documentation for detailed info.label
property was replaced by thechildren
.state
property no longer exists, you must use thechecked
andonChange
combination in order to control the checkbox state. Theindeterminate
property was also added to represent this state.Before
After
Collections
tags:
documentation
;This component replaces the old
DataView
component.There are several changes in the component API, we’d recommend you to check the documentation before doing the migration.
ContextualHelp
tags:
new
EmptyState
tags:
new
It renders a styled empty state area. This component can be used combined with the
Collections
orFilter
componentField
tags:
new
This component helps to implement form fields and it’s used combined with form components such as:
Checkbox
,Input
,Textarea
,Radio
, etc.Before
After
Filter
tags:
documentation
;There are several changes in the component API, we’d recommend you to check the documentation before doing the migration.
Before
After
Flex
tags:
codemod
;import-only
;There are no changes.
Grid
tags:
codemod
;import-only
;There are no changes.
Heading
tags:
codemod
;import-only
;variant
property which changes text style.Input
tags:
codemod
TextInput
toInput
helpText
, anderrorText
are now implemented using theField
component. You can check theField
documentation for detailed info.Label
tags:
codemod
;import-only
;optional
property that indicates whether the form field is optional or not.Link
tags:
codemod
;Anchor
toLink
Menu
There are several changes in the component API, we’d recommend you to check the documentation before doing the migration.
Before
After
Modal
tags:
documentation
;We split the Modal component into two components:
ConfirmationModal
: allow merchants to confirm an action through an overlay window that opens on top of the current page.Modal
: allow users to view content that demands attention through an overlay window that opens on top of the current page.There are several changes in the component API, we’d recommend you to check the documentation before doing the migration.
Page
tags:
documentation
;There are several changes in the component API, we’d recommend you to check the documentation before doing the migration.
Pagination
tags:
codemod
;usePaginationState
hook anymore and now the state values should be passed as propsBefore
After
Radio
tags:
codemod
;helpText
,errorText
, anderror
are now implemented using theField
component. You can check theField
documentation for detailed info.label
property was replaced by thechildren
. Now to add a label to the Radio you must pass it as a children.direction
has changed to ahorizontal
which is a boolean prop and by default the direction isvertical
.Before
After
Search
tags:
documentation
;useSearchState
no longer exists and the state should be handled by the user.Select
tags:
codemod
;label
,helpText
,errorText
, anderror
are now implemented using theField
component. You can check theField
documentation for detailed info.Before
After
Skeleton
tags:
codemod
;import-only
;There are no changes.
Slot
tags:
new
;A layout component to help in the structural composition.
Spinner
tags:
codemod
;import-only
;There are no changes.
Stack
tags:
codemod
;direction
has changed to ahorizontal
which is a boolean prop and by default the direction isvertical
.Before
After
Tab
tags:
documentation
;There are several changes in the component API, we’d recommend you to check the documentation before doing the migration.
Before
After
Table
tags:
documentation
;There are several changes in the component API, we’d recommend you to check the documentation before doing the migration.
Tag
tags:
codemod
;label
property no longer exist and now you must pass the label as theTag
children.Before
After
Text
tone
property no longer exists, you must set the text color by applying css to it.'pageTitle' | 'title1' | 'title2' | 'action1' | 'action2' | 'display' | 'body' | 'detail'
to'context' | 'body' | 'action' | 'emphasis' | 'caption1' | 'caption2' | 'display1' | 'display2' | 'display3' | 'display4'
TextArea
tags:
codemod
helpText
, anderrorText
are now implemented using theField
component. You can check theField
documentation for detailed info.Tooltip
tags:
documentation
;text
property was renamed tolabel
.Before
After
Toast
tags:
documentation
;There are several changes in the component API, we’d recommend you to check the documentation before doing the migration.
VisuallyHidden
tags:
codemod
;import-only
;There are no changes.
New components
Primitives
Components renamed
Anchor
->Link
DataView
->Collections
Components without replacements