Upgrade
Version 5: Rework of our foundations
Breaking Changes #
We rework our theme on the colors and spacings properties. Use the migration script to migrate easily to V5 on welcome-ui project.
yarn migrate "../yourProject/src/**/**.**(tsx|ts|js)"
Theme #
Colors #
We changed our colors dark and light to be full compatible with dark mode. Now dark are black rgba with transparency, and light are white rgba with transparency.
We need also for typescript compatibility rework our colors naming :
- Before :
colors.dark.900
- After :
colors['dark-900']
We rework some colors:
- v4 compare to v5
- [success/danger/warning/info].500 <-> [success/danger/warning/info]-300
- [success/danger/warning/info].700 <-> [success/danger/warning/info]-400
- new color [success/danger/warning/info]-500
- nude.400 <-> nude-500
- nude.500 <-> nude-400
- nude.700 <-> nude-600
- nude.800 <-> nude-700
- the light colors are all white with opacity, you need to replace the old light color for text with new black color
- light.800 <-> dark-100
- light.700 <-> dark-200
- light.500 <-> dark-400
- light.200 <-> dark-400
- light.100 <-> dark-500
- now the light colors variants are 100, 200, 400, 500, 700, 900(without opacity)
- the dark colors are all black with opacity, it's also used for text color
- dark.100 <-> dark-500
- dark.200 <-> dark-700
- dark.500 <-> dark.900
- dark.700 <-> dark.900
- dark.800 <-> dark.900
- now the dark colors variants are 100, 200, 400, 500, 700, 900(without opacity)
- new color white (get the light.900 for dark mode)
- new color black (get the dark.900 for dark mode)
- the color for html is now dark-500
Spacing #
We rework our spacing:
- v5 compare to v4
- xxs (2px) <-> new size (before it was 6px)
- xs (4px) <-> new size (before it was 8px)
- sm (8px) <-> xs
- md (12px) <-> same size
- lg (16px) <-> lg (15px)
- xl (24px) <-> xxl
- xxl (32px) <-> 3xl (30px)
- 3xl (48px) <-> 5xl (50px)
- 4xl (64px) <-> 6xl
- 5xl (96px) -> new size
- 6xl (128px) -> new size
- 7xl (192px) -> new size
Typography #
We change the name of variants to xs
s
m
lg
and remove useless variants.
- meta1 and meta2 has been removed and replaced by
sm
andxs
- body1 become
lg
- body2 become
md
- body3 become
sm
- body4 become
xs
- subtitle1 become
subtitle-md
- subtitle2 become
subtitle-sm
Components #
Accordion #
To prepare to the migration from reakit to ariakit, visible property is now deprecated and replaced by open.
Alert / Toast / Growl #
All
- We have adjusted colors and spacing.
- Position
top
has been replaced withtop-center
and positionbottom
has been replaced withbottom-center
. - We removed property
closeButtonDataTestId
, now we add-close-button
after yourdataTestId
perperty.
Alert
- The props
icon
is now given to the Alert component and not to Alert.Title. - You must use the
cta
prop instead of pass the Alert.Button as a Children - You must use the
isFullWidth
prop to have an alert with a 100% max width
- The props
Toast
- In order to use
Toast
component, you must add theNotifications
component in your project root. - The
useToast
hook is deprecated. Instead, you can directly usetoast
function. - The props
icon
is now given to Toast.Growl / Toast.Snackbar component and not to Toast.Title.
- In order to use
Badges #
- new
Badge
component show more
Buttons #
- We have adjusted colors and spacing.
- The
xl
size has been removed. - The
ternary-negative
has been removed. - The
quaternary
variant is now namedghost
. - The icon size now adjusts to the size of the button.
Drawer #
To prepare to the migration from reakit to ariakit, we need now to pass a state property who contain the state from useDrawerState:
const drawerState = useDrawerState()<Drawer {...drawerState}>...</Drawer>Before---Afterconst drawerState = useDrawerState()<Drawer state={drawerState}>...</Drawer>
DropdownMenu #
To prepare to the migration from reakit to ariakit, we need now to pass a state property who contain the state from useDropdownMenuState:
const dropdownMenuState = useDropdownMenuState()<DropdownMenu.Trigger {...dropdownMenuState}>...</DropdownMenu.Trigger><DropdownMenu {...dropdownMenuState}><DropdownMenu.Item {...dropdownMenuState}>...</DropdownMenu.Item>...</DropdownMenu>Before---Afterconst dropdownMenuState = useDropdownMenuState()<DropdownMenu.Trigger state={dropdownMenuState}>...</DropdownMenu.Trigger><DropdownMenu state={dropdownMenuState}><DropdownMenu.Item state={dropdownMenuState}>...</DropdownMenu.Item>...</DropdownMenu>
EmojiPicker #
To prepare to the migration from reakit to ariakit, we need now to pass a state property who contain the state from useEmojiPicker:
const emojiPickerState = useEmojiPicker()<EmojiPicker.Trigger {...emojiPickerState}>...</EmojiPicker.Trigger><EmojiPicker {...emojiPickerState} />Before---Afterconst emojiPickerState = useEmojiPicker()<EmojiPicker.Trigger state={emojiPickerState}>...</EmojiPicker.Trigger><EmojiPicker state={emojiPickerState} />
and visible property is now deprecated and replaced by open.
FileDrop #
accept
property changed on v14 of react-dropzone:
- Before:
accept: "image/*"
- After:
accept: { "image/*": [] }
See more about showOpenFilePicker and media type.
Icons #
We rework our icon size:
- v5 compare to v4
- This size has been removed <-> xxs (7px)
- xs (12px) <-> xs (10px)
- sm (16px) <-> sm (12px)
- md (24px) <-> md (15px)
- lg (32px) <-> lg (20px)
- xl (48px) <-> xl (27.574px)
- xxl (64px) <-> new size
We remove all @welcome-ui/icons.*
packages (except icons.font). There is now two packages available:
- @welcome-ui/icons using svg
- @welcome-ui/icons.font using webfont
We renamed some icons:
<GetIcon>
become<DownloadIcon>
<EyeIcon>
become<ShowIcon>
<ThumbupIcon>
become<ThumbUpIcon>
<ThumbdownIcon>
become<ThumbDownIcon>
<FlagFillIcon>
become<FlagIcon>
<FlagIcon>
become<FlagOutlineIcon>
<ChevronIcon>
become<CodeIcon>
<DuplicateIcon>
become<CopyIcon>
<TagsIcon>
become<TagIcon>
Link #
- the
isExternalLink
becomeisExternal
Modal #
- We have adjusted colors and spacing.
- Modal.Title is now named Modal.Header and has props
title
(mandatory) andsubtitle
(optional). - Modal.Content is replaced by Modal.Body.
- To ensure good spacing between modal's sub-components, they must be wrapped with Modal.Content.
- Modal.Cover has been removed.
- In order to fix an issue that made attributes duplicating, and to prepare to the migration from reakit to ariakit, you will now have to pass the modalState to it props
state
who contain the state from useModalState: onClose
has been changed from an optionnal prop of Modal to an optionnal option you can pass to useModalState
const modalState = useModalState()<Modal {...modalState}>...</Modal>Before---Afterconst modalState = useModalState()<Modal state={modalState}>...</Modal>
and visible property is now deprecated and replaced by open.
Popover #
To prepare to the migration from reakit to ariakit, we need now to pass a state property who contain the state from usePopoverState:
const popoverState = usePopoverState()<Popover.Trigger {...popoverState}>...</Popover.Trigger><Popover {...popoverState}><Popover.Content>...</Popover.Content></Popover>Before---Afterconst popoverState = usePopoverState()<Popover.Trigger state={popoverState}>...</Popover.Trigger><Popover state={popoverState}><Popover.Content>...</Popover.Content></Popover>
and visible property is now deprecated and replaced by open.
RadioGroup #
We removed the check icon on radio input and change the style of it.
Tabs #
To prepare to the migration from reakit to ariakit, we need now to pass a state property who contain the state from useTabState:
const tabState = useTabState()<Tab.List {...tabState}><Tab {...tabState}>...</Tab></Tab.List><Tab.Panel {...tabState}>...</Tab.Panel>Before---Afterconst tabState = useTabState()<Tab.List state={tabState}><Tab state={tabState}>...</Tab></Tab.List><Tab.Panel state={tabState}>...</Tab.Panel>
Tag #
- We have adjusted colors and spacing.
- The
lg
size has been removed. - The
shape
prop has been removed. - The icon size now adjusts to the size of the tag.
Tooltip #
We added a div around the Children of the tooltip when the children has a disabled prop otherwise the tooltip does not trigger.
Swiper #
We rework the swiper component:
<Swiper.Slide>
has been removed, you can embed and style your slides as you wantslidesToShow
option becomeslidesPerView
and now takes an object to define the number of slides per device{ mobile: 1, tablet: 1, desktop: 1 }
renderPaginationItem
,nextButton
,prevButton
andslidesToSwipe
options have been removed
Other versions #
Previous
ContributingNext
Basics