v10
Migration
v10 of @dnb/eufemia contains breaking changes. As a migration process, you can simply search and replace:
Features
- Browser support has been updated to support modern browsers only (es6).
Web Components
- The support for Web Components, Vue and Angular was removed.
Breakpoints
Some breakpoints sizes have changed:
- xx-large:
1280
is now1440
– and80em
is now90em
- x-large:
1152
is now1280
– and72em
is now80em
- large:
960
is now1152
– and60em
is now72em
- medium:
800
is now960
– and50em
is now60em
- Find
$layout-x-large
and replace with$layout-large
- Find
$layout-xx-large
and replace with$layout-x-large
- Find
--layout-x-large
and replace with--layout-large
- Find
--layout-xx-large
and replace with--layout-x-large
NB: Import and use the Eufemia breakpoints directly in your code:
// breakpoints.scss@import '@dnb/eufemia/style/core/utilities';$layout-small: map-get($breakpoints, 'small');$layout-medium: map-get($breakpoints, 'medium');$layout-large: map-get($breakpoints, 'large');
Breaking changes to CSS packages and imports
Example imports of the new style structure:
import '@dnb/eufemia/style/core'import '@dnb/eufemia/style/themes/ui'
Or as CSS imports:
import '@dnb/eufemia/style/dnb-ui-core.min.css'import '@dnb/eufemia/style/themes/theme-ui/dnb-theme-components.min.css'import '@dnb/eufemia/style/themes/theme-ui/dnb-theme-basis.min.css'
In detail:
- The package
dnb-theme-ui
was renamed todnb-theme-basis
. - The package
dnb-ui-components
was renamed and moved inside a theme/style/themes/theme-ui/dnb-theme-components.*
. dnb-ui-tags
was renamed and moved form/style/dnb-ui-tags.*
to/style/themes/theme-ui/dnb-theme-tags.*
.
Font
The DNB font is moved inside a subfolder in /assets/fonts/dnb/...
.
The CSS package dnb-ui-fonts
is moved inside a theme folder /themes/theme-ui
.
CSS Packages such as:
dnb-ui-basis
dnb-ui-core
do not contain the fonts anymore. Fonts are now only a part of a theme file, such as: /style/themes/theme-ui/dnb-theme-basis.*
.
As long as you don't import them manually, you don't need to make any changes in your codebase.
Properties
The DNB properties.scss
and properties.js
files were moved inside a theme folder /style/themes/theme-ui/properties.*
.
Packages such as:
dnb-ui-basis
dnb-ui-core
do not contain the properties anymore. Properties are only a part of a theme file, such as: /style/themes/theme-ui/dnb-theme-basis.*
.
As long as you don't import them in your application, you don't need to make any changes in your codebase.
SVG assets
All svg
icon files were moved inside a subfolder in /assets/icons/dnb/...
.
StepIndicator
- Find the
active_item
property and replace it withcurrent_step
. - Find
use_navigation
and remove it or replace it withmode="strict"
ormode="loose"
. - URL support has been removed – so props like
active_url
,url
,url_future
, andurl_passed
are not supported anymore. You have to handle it by yourself from inside your application. Here is an example.
Table
- Ensure all table sub elements have a CSS Class:
tr
=>.dnb-table__tr
th
=>.dnb-table__th
td
=>.dnb-table__td
- Find the
sticky_offset
property and replace it withstickyOffset
. - Find the
/elements/Table
property and replace it with/components/Table
. - Alignment classes are removed (
.dnb-table--left
,.dnb-table--right
and.dnb-table--center
). Use thealign
attribute instead. - Font-sizing classes are removed (
.dnb-table--small
and.dnb-table--x-small
). Use thesize
property instead. - Find and remove
Table.StickyHelper
.
Slider
- Find the
thump_title
property and replace it withthumbTitle
. - Find the snake_case
add_title
property and replace it withaddTitle
. - Find the snake_case
subtract_title
property and replace it withsubtractTitle
. - Remove
@dnb/eufemia/components/slider/style/dnb-range.min.css
and use the Eufemia Slider component instead. use_scrollwheel
andon_init
properties, as well as theraw_value
event value from Slider was removed in order to support multiple buttons.
Timeline
- Find the
name
property in your Timeline JSX syntax and replace it withtitle
. - Find the
date
property in your Timeline JSX syntax and replace it withsubtitle
.
Anchor
- Find the
target_blank_title
property and replace it withtargetBlankTitle
.
Button
- The padding of the
teriary
button is removed. Please, check your application and add back the padding of0.5rem
if needed.
Pagination and InfinityScroller
- Replace the deprecated event return parameter
page
withpageNumber
.
Tooltip
- Find the
target_element
property and replace it withtargetElement
. - Find the
target_selector
property and replace it withtargetSelector
. - Find the
animate_position
property and replace it withanimatePosition
. - Find the
fixed_position
property and replace it withfixedPosition
. - Find the
skip_portal
property and replace it withskipPortal
. - Find the
no_animation
property and replace it withnoAnimation
. - Find the
show_delay
property and replace it withshowDelay
. - Find the
hide_delay
property and replace it withhideDelay
.
Icon
- Find the
data-test-id
property and replace it withdata-testid
. The usage ofdata-test-id
will most likely be found in your tests.
Modal, Dialog and Drawer
Modal's mode
property is now deprecated and removed.
<Modal />
now behaves as <Modal mode="custom" />
did previously.
When you convert from <Modal mode="custom" />
simply change to <Modal />
.
When you convert from <Modal mode="drawer" />
to <Drawer />
– follow these steps:
- All
trigger_*
props are not supported for Drawer, usetriggerAttributes
instead to pass in props for the trigger button.- Change prop
trigger_hidden
toomitTriggerButton
to omit the default trigger button from Modal.
- Change prop
- Only camelCase props are supported for Drawer, so you will need to update the prop names.
Modal.Inner
orModal.Content
converts toDrawer.Body
.Modal.Bar
converts toDrawer.Navigaton
.Modal
was a class component andDrawer
is a functional component.
When you convert from <Modal />
or <Modal mode="dialog" />
to <Dialog />
– follow these steps:
- All
trigger_*
props are not supported for Dialog, usetriggerAttributes
instead to pass in props for the trigger button.- Change prop
trigger_hidden
toomitTriggerButton
to omit the default trigger button from Modal.
- Change prop
- Only camelCase props are supported for Dialog, so you will need to update the prop names.
Modal.Inner
orModal.Content
converts toDialog.Body
.Modal.Bar
converts toDialog.Navigaton
.Modal
was a class component andDialog
is a functional component.
Lists
- New Definition List layout direction:
direction="horizontal"
includingDl.Item
demo.
InputMasked
- In v10, InputMasked allows leading zeros. To prevent that behavior, the property
allowLeadingZeroes
has changed todisallowLeadingZeroes
.
FormRow
- The FormRow properties
indent
andindent_offset
were removed.
data-testid
in components
Removal of
Stopped supporting Internet Explorer (IE)
Stopped supporting Internet Explorer (IE), as Microsoft formally ended support for IE in June, 2022.
TypeScript
- Updated multiple types from
string | boolean
toboolean
, as there was a lot of properties who should only support boolean values and not strings. Examples of changes to do would be to find Eufemia components using"false"
or"true"
, and replace it with boolean values. i.e.,vertical="false"
tovertical={false}
orselectall="true"
toselectall={true}
.
SCSS
Find the SCSS @mixin fakeFocus
and replace it with focusRing
.
Find the SCSS @mixin removeFakeFocus
and replace it with removeFocusRing
.
Deprecations
- Helper class
.dnb-sr-only--inline
and SCSS mixinsrOnlyInline
was removed. - Helper class
.dnb-not-sr-only
and SCSS mixinnotSrOnly
was removed. import { SpacingHelper } from '@dnb/eufemia/shared'
was removed due to low usage. Use one of the other exported helpers.import { LocaleProps, DataAttributeTypes, DynamicElement } from '@dnb/eufemia/shared/interfaces'
was removed, and moved to@dnb/eufemia/shared/types
.isIE11
andIS_IE11
is deprecated as we have stopped supporting Internet Explorer (IE).- Stylis plugin,
import stylisPlugin from '@dnb/eufemia/style/stylis'
, has been removed.
Install
To upgrade to @dnb/eufemia v10 with NPM, use:
$ npm i @dnb/eufemia@10# or$ yarn add @dnb/eufemia@10
April, 20. 2023