Update mantine monorepo to v7 (major) #440
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
5.10.5
->7.11.1
5.10.5
->7.11.1
5.10.5
->7.11.1
Release Notes
mantinedev/mantine (@mantine/core)
v7.11.1
Compare Source
What's Changed
[@mantine/core]
Add option to displaynothingFoundMessage
when data is empty in Select and MultiSelect components (#6477)[@mantine/core]
Tooltip: AdddefaultOpened
prop support (#6466)[@mantine/core]
PinInput: Fix incorrect rtl logic (#6382)[@mantine/core]
Popover: FixfloatingStrategy="fixed"
not havingposition:fixed
styles (#6419)[@mantine/spotlight]
Fix spotlight not working correctly with shadow DOM (#6400)[@mantine/form]
FixonValuesChange
using stale values (#6392)[@mantine/carousel]
FixonSlideChange
using stale props values (#6393)[@mantine/charts]
Fix unexpected padding on the right side of the chart in BarChart, AreaChart and LineChart components (#6467)[@mantine/core]
Select: FixonChange
being called with the already selected if it has been picked from the dropdown (#6468)[@mantine/dates]
DatePickerInput: FixhighlightToday
not working (#6471)[@mantine/core]
NumberInput: Fix incorrect handling of numbers larger than max safe integer on blur (#6407)[@mantine/core]
Tooltip: Fix tooltip arrow being incompatible with headless mode (#6458)[@mantine/core]
ActionIcon: Fix loading styles inconsistency with Button component (#6460)[@mantine/charts]
PieChart: Fix key error for duplicatedname
data (#6067)[@mantine/core]
Modal: FixremoveScrollProps.ref
not being compatible with React 19 (#6446)[@mantine/core]
TagsInput: FixselectFirstOptionOnChange
prop not working (#6337)[@mantine/hooks]
use-eye-dropper: Fix Opera being incorrectly detected as a supported browser (#6307)[@mantine/core]
Fix:host
selector now working correctly incssVariablesSelector
of MantineProvider (#6404)[@mantine/core]
TagsInput: FixonChange
being called twice when Enter key is pressed in some cases (#6416)[@mantine/modals]
Fix Modal overrides type augmentation not working with TypeScript 5.5 (#6443)[@mantine/core]
Tree: FixlevelOffset
prop being added to the root DOM element (#6461)New Contributors
Full Changelog: mantinedev/mantine@7.11.0...7.11.1
v7.11.0
: 👁️Compare Source
View changelog with demos on mantine.dev website
withProps function
All Mantine components now have
withProps
static function that can be used toadd default props to the component:
Avatar initials
Avatar component now supports displaying initials with auto generated color based on the given
name
value.To display initials instead of the default placeholder, set
name
propto the name of the person, for example,
name="John Doe"
. If the nameis set, you can use
color="initials"
to generate color based on the name:BubbleChart component
New BubbleChart component:
BarChart waterfall type
BarChart component now supports
waterfall
typewhich is useful for visualizing changes in values over time:
LineChart gradient type
LineChart component now supports
gradient
typewhich renders line chart with gradient fill:
Right Y axis
LineChart, BarChart and AreaChart components
now support
rightYAxis
prop which renders additional Y axis on the right side of the chart:RadarChart legend
RadarChart component now supports legend:
TagsInput acceptValueOnBlur
TagsInput component behavior has been changed. Now By default,
if the user types in a value and blurs the input, the value is added to the list.
You can change this behavior by setting
acceptValueOnBlur
tofalse
. In this case, the value is addedonly when the user presses
Enter
or clicks on a suggestion.Transition delay
Transition component now supports
enterDelay
andexitDelay
props to delay transition start:Documentation updates
Progress
component documentationexcludeDate
propOther changes
hideWithOnePage
prop which hides pagination when there is only one pageexpanded
andonExpandedChange
propslineSize
prop to change lines heighthighlightToday
prop to highlight today's datev7.10.2
Compare Source
What's Changed
[@mantine/core]
Select: Fix incorrect state changes handling when bothvalue
andsearchValue
are controlled (#6272)[@mantine/core]
Stepper: FixautoContrast
prop being added to the DOM element[@mantine/charts]
PieChart: Fix inner label not using formatted value (#6328)[@mantine/core]
Fix incorrect color resolving logic in border style prop resolver (#6326)[@mantine/modals]
Fix incorrect styles of the confirmation modal when it is used without any description (#6325)[@mantine/core]
ScrollArea: Fix click events being triggered when scrollbar drag is released over an interactive element in Firefox (#6354)[@mantine/core]
Combobox: Fix clicks on footer and header triggering dropdown close (#6344)[@mantine/core]
PasswordInput: FixwithErrorStyles
prop being passed to the DOM element (#6348)New Contributors
Full Changelog: mantinedev/mantine@7.10.1...7.10.2
v7.10.1
Compare Source
What's Changed
[@mantine/charts]
BarChart: Add waterfall type (#6231)[@mantine/form]
Fixform.setFieldError
called insideform.onSubmit
not working correctly in some cases (#6101)[@mantine/core]
SegmentedControl: Fix false error reported by React 18.3+ for incorrect key prop usage[@mantine/hooks]
use-fetch: Fix incorrect error handling (#6278)[@mantine/core]
Fixbd
style prop not being applied in some components (#6282)[@mantine/core]
NumberInput: Fix incorrect leading zeros handling (#6232)[@mantine/core]
NumberInput: Fix incorrect logic while editing decimal values (#6232)[@mantine/core]
ScrollArea: Fix scrollbar flickering on reveal with hover and scroll types (#6218)[@mantine/hooks]
Update use-throttled-* hooks to emit updates on trailing edges (#6257)[@mantine/core]
Input: AddinputSize
prop to setsize
html attribute on the input elementNew Contributors
Full Changelog: mantinedev/mantine@7.10.0...7.10.1
v7.10.0
: 😎Compare Source
View changelog with demos on mantine.dev website
Tree component
New Tree component:
form.getInputNode
New
form.getInputNode(path)
handler returns input DOM node for the given field path.Form example, it can be used to focus input on form submit if there is an error:
Container queries in SimpleGrid
You can now use container queries
in SimpleGrid component. With container queries, grid columns and spacing
will be adjusted based on the container width, not the viewport width.
Example of using container queries. To see how the grid changes, resize the root element
of the demo with the resize handle located at the bottom right corner of the demo:
Checkbox and Radio indicators
New Checkbox.Indicator and Radio.Indicator
components look exactly the same as
Checkbox
andRadio
components, but they do nothave any semantic meaning, they are just visual representations of checkbox and radio states.
Checkbox.Indicator
component:Radio.Indicator
component:Checkbox and Radio cards
New Checkbox.Card and Radio.Card
components can be used as replacements for
Checkbox
andRadio
to build custom cards/buttons/etc.that work as checkboxes and radios. Components are accessible by default and support the same
keyboard interactions as
input[type="checkbox"]
andinput[type="radio"]
.Checkbox.Card
component:Checkbox.Card
component withCheckbox.Group
:Radio.Card
component:Radio.Card
component withRadio.Group
:bd style prop
New bd style prop can be used to set
border
CSS property.It is available in all components that support style props.
Border width value is automatically converted to rem. For border color you can reference
theme colors similar to other style props:
v7.9.2
Compare Source
What's Changed
[@mantine/dates]
DateTimePicker: Fix some oftimeInputProps
not being respected (#6204)[@mantine/core]
NavLink: Add react-router support to display active route (#6180)[@mantine/core]
Fixnonce
attribute not being set on<style />
tag generated in color scheme switching script[@mantine/core]
Input: Fix incorrect margins when input wrapper order is explicitly set[@mantine/core]
Pagination: Fix types definition being incompatible with @tabler/icons-react 3.x[@mantine/charts]
Fix incorrect tooltip position in LineChart, AreaChart and BarChart with vertical orientation[@mantine/core]
Rating: FixreadOnly
prop now working on touch devices (#6202)[@mantine/core]
TagsInput: Fix existing search value being ignored inonPaste
even handler (#6073)[@mantine/core]
TagsInput: Improveclearable
prop logic related to dropdown (#6115)New Contributors
Full Changelog: mantinedev/mantine@7.9.1...7.9.2
v7.9.1
Compare Source
What's Changed
[@mantine/core]
Fixtheme.scale
being ignored in Input, Paper and Table border styles[@mantine/core]
FixvirtualColor
function requringuse client
in Next.js[@mantine/core]
FloatingIndicator: Fix incorrect resize observer logic (#6129)[@mantine/core]
NumberInput: Fix incorrectallowNegative
handling with up/down arrows (#6170)[@mantine/core]
Fixerror={true}
prop set on Checkbox, Radio and Switch rendering unxpected error element with margin[@mantine/core]
SegmentedControl: Fixtheme.primaryColor
not being respected in the focus ring styles[@mantine/core]
CloseButton: Fix incorrect specificity of some selectors[@mantine/core]
Fix incorrectaria-label
handling in Select, Autocomplete, MultiSelect and TagsInputs components (#6123)[@mantine/core]
Modal: PreventonClose
from being called when modal is not opened (#6156)[@mantine/core]
PasswordInput: Fix duplicated password visibility icon in Edge browser (#6126)[@mantine/hooks]
use-hash: Fix hash value not being updated correctly (#6145)[@mantine/emotion]
Fix incorrect transform logic that was causing extra hooks to render (#6159)New Contributors
Full Changelog: mantinedev/mantine@7.9.0...7.9.1
v7.9.0
: ✨Compare Source
View changelog with demos on mantine.dev website
@mantine/emotion package
New @mantine/emotion package is now available to simplify migration
from 6.x to 7.x. It includes
createStyles
function and additionalfunctionality for
sx
andstyles
props for all components similar to what was availablein
@mantine/core
package in v6.If you still haven't migrated to 7.x because of the change in styling approach, you can now
have a smoother transition by using
@mantine/emotion
package. To learn more about the package,visit the documentation page and updated 6.x to 7.x migration guide.
React 18.3 support
All
@mantine/*
components and hooks have been updated to support React 18.3. It isrecommended to update your application as well to prepare for the upcoming React 19 release.
use-field hook
New use-field hook is now available in
@mantine/form
package.It can be used as a simpler alternative to use-form hook to manage state of a single input without the need to create a form.
The hook supports most of
use-form
hook features: validation with function, touched anddirty state, error message, validation on change/blur and more.
use-field
hook also supports async validation:Custom PostCSS mixins
You can now define custom mixins that are not included in mantine-postcss-preset by specifying them
in the
mixins
option. To learn about mixins syntax, follow postcss-mixins documentation.Note that this feature is available in
postcss-preset-mantine
starting from version 1.15.0.Example of adding
clearfix
andcircle
mixins:Then you can use these mixins in your styles:
use-matches hook
New
use-matches
hook exported from@mantine/core
is an alternative to use-media-queryif you need to match multiple media queries and values. It accepts an object with media queries as keys and
values at given breakpoint as values.
Note that
use-matches
hook uses the same logic as use-media-query under the hood,it is not recommended to be used as a primary source of responsive styles, especially if you have ssr in your application.
In the following example:
theme.breakpoints.lg
, color will bered.9
theme.breakpoints.sm
andtheme.breakpoints.lg
, color will beorange.9
theme.breakpoints.sm
, color will beblue.9
BarChart value label
BarChart now supports
withBarValueLabel
prop that allowsdisplaying value label on top of each bar:
Documentation updates
form.key()
functionOther changes
v7.8.1
Compare Source
Notes
Note that if you've already started using uncontrolled form mode introduced in 7.8.0, you need to include
form.key()
as described in the documentation.What's Changed
[@mantine/form]
AdddefaultValue
toform.getInputProps
return type[@mantine/form]
Replacekey
spread withform.getInputProps
withform.key()
function[@mantine/dropzone]
Fix keyboard activation not working (#6095)[@mantine/dates]
DatePicker: Fix date range being stuck in incorrect state when controlled state changes to an empty value (#6092)[@mantine/core]
Radio: Allownull
to be passed to Radio.Group value to clear the value (#6102)[@mantine/core]
NumberInput: Fix incorrect cursor position when backspace is pressed (#6072)[@mantine/core]
Fix incorrect empty string handling in style props (#6078)New Contributors
Full Changelog: mantinedev/mantine@7.8.0...7.8.1
v7.8.0
Compare Source
View changelog with demos on mantine.dev website
Auto convert px to rem in .css files
Start from version
1.14.4
postcss-preset-mantinesupports
autoRem
option that can be used to automatically convert allpx
valuesto
rem
units in.css
files.This option works similar to
rem
function. The following code:Will be transformed to:
Note that
autoRem
converts only CSS properties, values in@media
queries arenot converted automatically – you still need to use
em
function to convert them.autoRem
option does not convert values in the following cases:calc()
,var()
,clamp()
andurl()
functionscontent
propertyrgb()
,rgba()
,hsl()
,hsla()
colorsIf you want to convert above values to rem units, use
rem
function manually.Uncontrolled form mode
useForm hook now supports uncontrolled mode.
Uncontrolled mode provides a significant performance improvement by reducing
the number of re-renders and the amount of state updates almost to 0. Uncontrolled
mode is now the recommended way to use the
useForm
hook for almost all use cases.Example of uncontrolled form (
form.values
are not updated):form.getValues
With uncontrolled mode, you can not access
form.values
as a state variable,instead, you can use
form.getValues()
method to get current form values at any time:form.getValues()
always returns the latest form values, it is safe to use itafter state updates:
form.watch
form.watch
is an effect function that allows subscribing to changes of aspecific form field. It accepts field path and a callback function that is
called with new value, previous value, touched and dirty field states:
Customize Popover middlewares
You can now customize
middlewares
options in Popover component andin other components (Menu, Select, Combobox, etc.)
based on Popover.
To customize Floating UI middlewares options, pass them as
an object to the
middlewares
prop. For example, to change shiftmiddleware padding to
20px
use the following configuration:use-fetch hook
New use-fetch hook:
use-map hook
New use-map hook:
use-set hook
New use-set hook:
use-debounced-callback hook
New use-debounced-callback hook:
use-throttled-state hook
New use-throttled-state hook:
use-throttled-value hook
New use-throttled-value hook: