Update mantine monorepo to v7 (major) #97
Closed
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.0
->^7.0.0
^5.10.0
->^7.0.0
^5.10.0
->^7.0.0
^5.10.0
->^7.0.0
^5.10.0
->^7.0.0
Release Notes
mantinedev/mantine (@mantine/core)
v7.3.2
Compare Source
What's Changed
[@mantine/core]
Portal: Fix empty className string throwing error (#5400)[@mantine/core]
Select: Fix incorrect empty string as initial value handing[@mantine/core]
Fix error thrown in jest tests when autosize Textarea is used in Next.js application (#5393)[@mantine/core]
Loader: Fix default loaders not being available if custom loader was default with defaultProps on theme[@mantine/core]
Chip: Fixcolor
prop not working without specifying variant[@mantine/core]
MultiSelect: Fix dropdown not being opened when Space key is pressed and the component is not searchable[@mantine/core]
NavLink: Add missing Space key handling for collapse/expand nested links[@mantine/dates]
DateInput: Fix incorrect clear button size[@mantine/core]
Fix text inside MultiSelect, TagsInput and PillsInput search field not being possible to select with mouse[@mantine/core]
Set cursor tonot-allowed
on disabled Checkbox, Radio and Switch[@mantine/core]
NumberInput: Improve disabled increment/decrement controls styles[@mantine/core]
Button: Fix incorrect alignment if button is used in the same container as other buttons withcomponent
prop[@mantine/core]
SegmentedControl: Improve readOnly styles[@mantine/core]
NumberInput: Fix incorrect controls text color in error state[@mantine/core]
Change divs to more semantic elements in Modal and Drawer[@mantine/core]
Make header height of Modal and Drawer consistent to prevent layout shift whenwithCloseButton
prop is changed[@mantine/core]
FixonChange
not being called in Radio, Checkbox and Chip components if they are used insideX.Group
[@mantine/core]
NumberInput: Fix incorrect negative decimal values input handing[@mantine/core]
Button: Fix incorrect Loader vertical alignment[@mantine/vanilla-extract]
Expose all primary colors values[@mantine/core]
Menu: Fix incorrect aria roles (#5372)[@mantine/core]
Table: Fix sticky header being overlayed by elements in table rows in some cases (#5385)[@mantine/core]
Combobox: FixrightSection
andleftSection
nor being visible onCombobox.Search
(#5368)[@mantine/core]
Tabs: Fix clipped border of outline variant (#5370)[@mantine/core]
Fix incorrectrightSectionPointerEvents
in Select and MultiSelect components (#5371)[@mantine/core]
Alert: Fix incorrect margin if title is hidden[@mantine/core]
Overlay: Fix blur styles not working in old SafariNew Contributors
Full Changelog: mantinedev/mantine@7.3.1...7.3.2
v7.3.1
Compare Source
What's Changed
[@mantine/core]
Fix broken default colors override[@mantine/core]
Menu: Improveclick-hover
trigger accessibility (#5335)[@mantine/core]
Fix incorrectlineHeight
theme variables resolving (#5375)[@mantine/core]
Select: Fix error thrown if google translate changes labels (#5377)[@mantine/tiptap]
Add missingcontrol
Styles API selector toRichTextEditor.Link
(#5171)[@mantine/core]
Grid: Fix incorrect Grid.Col auto span handing if one Grid is used inside another Grid (#5278)[@mantine/core]
Grid: Fix incorrect Grid.Col styles when the column isauto
as base value andcontent
as breakpoint value (#5280)[@mantine/core]
Fix various RTL issues (#5250)[@mantine/dates]
FixhideOutsideDates
now working if@mantine/dates
is used as a headless library (#5003)[@mantine/core]
SegmentedControl: Remove animation during initialization (#5182)[@mantine/core]
Menu: Fix broken focus logic whenkeepMounted
is set (#4502)[@mantine/tiptap]
Remove@tabler/icons
dependency to improve bundling performance (#5279)[@mantine/core]
Fix inputs have incorrect left and right sections colors in error state (#5304)[@mantine/core]
Title: AddlineClamp
support (#5321)[@mantine/core]
Grid: Change default overflow to visible (#5276)[@mantine/core]
ScrollArea: Fix incorrect scrollbars styles (#4904)[@mantine/core]
Expose--mantine-primary-color-x
CSS variables (#5331)[@mantine/core]
Combobox: Fix incorrect Enter key handling when dropdown is opened and option is not selected (#5348)[@mantine/core]
NumberInput: FixstartValue
nor working ifmin
is set (#5308)[@mantine/core]
Collapse: Add missing Collapse.extend function (#5313)[@mantine/core]
Fix incorrect clamp() function handing in style props (#5330)[@mantine/core]
PinInput: Trim value on paste before validation (#5340)[@mantine/core]
PinInput: Fix incorrectly assigned ref (#5365)[@mantine/core]
Remove use client from createPolymorphicComponent factory (#5367)New Contributors
Full Changelog: mantinedev/mantine@7.3.0...7.3.1
v7.3.0
: 🌟Compare Source
View changelog with demos on mantine.dev website
smaller-than and larger-than mixins
smaller-than
andlarger-than
mixins can be used to create styles that will be applied only when the screen is smaller or larger than specified breakpoint.Note that to use these mixins, you need to update postcss-preset-mantine to version
1.11.0
or higher.Will be transformed to:
You can also use
smaller-than
andlarger-than
mixins with mantine breakpoints:Form schema resolvers packages
@mantine/form
schema validation resolver packages are now available as separate packages.Moving resolvers to separate packages allows making them type-safe and fully tested.
Old resolvers are still exported from
@mantine/form
package – you will be able to use them without any changesuntil 8.0.0 release.
The new packages are drop-in replacements for old resolvers, they have the same API and can be used in the same way.
Example of zod resolver:
rem/em functions improvements
rem and em function now support space-separated values. This feature is available
both in
rem
function exported from@mantine/core
package and postcss-preset-mantine.Note that you need to update postcss-preset-mantine to
1.11.0
to use this feature.All components props that are converted to
rem
units now support space-separated values as well.For example, space-separated values can be used in
radius
prop of Modal component:component and renderRoot props for non-polymorphic components
All Mantine components now support
component
andrenderRoot
props event if they are not polymorphic.The difference between polymorphic and non-polymorphic components is that polymorphic components
include the full set of props of the component passed to the
component
prop, while non-polymorphiccomponents only include props that are specific to the original component. It is done this way to
improve TypeScript performance.
Outline Checkbox and Radio variant
Checkbox and Radio components now support
outline
variant:HueSlider and AlphaSlider components
HueSlider and AlphaSlider components were added back:
Button loading state animation
Button component now has loading state animation:
Drawer offset
Drawer now supports
offset
prop. It changes drawer offset from the edge of the viewport:z-index CSS variables
You can now use Mantine z-index CSS variables:
--mantine-z-index-app
– value100
--mantine-z-index-modal
– value200
--mantine-z-index-popover
– value300
--mantine-z-index-overlay
– value400
--mantine-z-index-max
– value9999
Example of using
--mantine-z-index-modal
variable:Improved dark color scheme colors
theme.colors.dark
colors were slightly changed to improve contrast and make it easier to read text.You can preview new colors on this page. New colors values are:
If you prefer old colors, change theme settings on
MantineProvider
:Documentation updates
@mantine/form
now has a dedicated page. It includes more examples for basic, nested and list fields validation for each resolver.minRange
prop.Other changes
getInitialValueInEffect: false
option to get initial value during state initialization.useMantineColorScheme({ keepTransitions: true })
option allows keeping transitions when color scheme changes. Note that it isfalse
by default.<kbd />
element.hiddenValuesDivider
prop. It allows customizing divider character between values invalue
prop of the hidden input.overflow
prop, which allows controllingoverflow
CSS property on the root element. It ishidden
by default.removeScrollProps
prop. It allows configuring react-remove-scroll.offsetScrollbars
prop. It determines whether scrollbars should be offset, it istrue
by default. The logic of scrollbars offset is controlled by react-remove-scroll.trigger="click-hover"
prop, to open menu both on click and on hover.keepMounted
prop on Tabs.Panel components individually, not only onTabs
component.7.x
versions of@mantine/core
. To use it, updatemantine-flagpack
to4.0.0
.@mantine/ds
package has been deprecated. You can use@mantinex/mantine-logo
package to useMantineLogo
component in your project.v7.2.2
Compare Source
What's new
[@mantine/core]
HoverCard: Removeopened
andonChange
props from types[@mantine/core]
RingProgress: Fix error thrown when thickness is larger thansize / 4
[@mantine/dates]
DateInput: Fix unexpected values updates when the user tries to type in value with closed dropdown (#3818)[@mantine/core]
NumberInput: FixonChange
called when value is changed by external state (#5235)[@mantine/core]
NumberInput: FixonChange
function called inonBlur
when the value does not require updating[@mantine/core]
NumberInput: ImproveonChange
handler to be called with number unless the input is empty (#5037)[@mantine/core]
SegmentedControl: Fix incorrect indicator position if padding is set on the root element[@mantine/core]
Select: Fix empty string not being handled correctly as option value[@mantine/core]
Blockquote: Fix incorrectborder-radius
[@mantine/core]
Chip: Fix incorrect disabled styles in dark color scheme[@mantine/core]
Table: Setbackgound-color
onthead
only ifstrickyHeader
prop is set[@mantine/core]
Radio: Fix radio icon size being the same width and height at every size[@mantine/tiptap]
Fix incorrect rtl controls styles (#5223)[@mantine/tiptap]
Fix unexpected background-color set oncode
elementv7.2.1
Compare Source
What's Changed
[@mantine/core]
Numberinput: Reduce width of the right section to match controls width (#5033)[@mantine/core]
Popover: Addsize
floating-ui middleware to prevent large dropdown from exceeding screen size (#5213)[@mantine/code-highlight]
Prevent error thowing if language is not recognized by highlight.js (#5099)[@mantine/notifications]
Fixlimit
prop not working (#5105)[@mantine/dropzone]
Allow overriding props from react-dropzone-esm with component props (#5114)[@mantine/core]
Remove"use client";
directive fromrem
,createTheme
and other utility theme functions (#5119)[@mantine/hooks]
use-hash: Add option to retrieve value initially withoutuseEffect
(#5140)[@mantine/core]
PasswordInput: Fix incorrect styles when the component is wrapper with element withdata-disabled
attribute (#5149)[@mantine/core]
Add support for values separated by space torem
andem
functions (#5174)[@mantine/code-highlight]
Fix CodeHighlightTabs throwing error if language of the tab is nor specified (#5178)[@mantine/core]
Fieldset: Fix some elements overflowing the viewport width when rendered inside fieldset (#5179)[@mantine/core]
Modal: Fix ScrollArea not working as scroll container (#5189)[@mantine/core]
Text: Fixinline
prop not working (#5194)[@mantine/core]
Alert: Fix incorrect styles when the component is used without children (#5196)[@mantine/core]
Setaria-hidden
on Checkbox and Radio icons to prevent them being announced by screen readers (#5202)[@mantine/form]
Fixform.reset
not reseting values to updatedinitialValues
(#5123)New Contributors
Full Changelog: mantinedev/mantine@7.2.0...7.2.1
v7.2.0
: ⭐Community templates
You are welcome to share your GitHub templates with the community. Community templates are
featured on the getting started page. You can find a guide on how to
create and submit a template here.
Examples of templates that you can submit:
NumberFormatter component
New NumberFormatter component allows to format numbers
with thousands separators, decimal separators, and custom number of decimal places.
It supports the same formatting related props as NumberInput component.
Form actions
@mantine/form
package now exportscreateFormActions
function thatcan be used to change form state from anywhere in your application.
The mechanism of form actions is similar to notifications system,
modals manager and other similar packages.
To use form actions, set
name
property in use-form settings:Then call
createFormActions
function with the same form name as specified inuseForm
settings:After that, you can use
demoFormActions
to change form state from anywhere in your application.For example, after a fetch request or after a user interaction with a component that does not have access
to the form state:
Table data prop
Table component now supports
data
prop which can be used to generate table rowsfrom given data:
Table sticky header
Table component now supports
stickyHeader
prop, which can be used to make the table headerstick to the top of the table:
Usage with Sass
It is now possible to use Mantine with Sass. You can find documentation
on this page. Note that it is still required to set up postcss-preset-mantine
in order for all functions to work properly. Sass can be used as a replacement for CSS modules
– it supports all features that CSS modules support.
You can find examples of Mantine + Sass usage in separate branches of templates:
Inline loaders
Loader component now supports
children
prop. The prop allows overriding the defaultloader with any React node. It is useful in components that support
loaderProps
(Button, LoadingOverlay, Dropzone, etc.)– with
loaderProps.children
you can now display any React node instead of the loader.lightHidden and darkHidden props
All Mantine components now support
lightHidden
anddarkHidden
props that can be used to hidecomponents in a specific color scheme:
light-root and dark-root mixins
New
light-root
anddark-root
mixins were added to postcss-preset-mantine.These mixins can be used to add color scheme specific styles to the
:root
/html
element.Note that to use these mixins, you need to update
postcss-preset-mantine
to1.9.0
or higher.Documentation updates
:global
selectorOther changes
loaderProps
prop to pass props down to the Loader componenthoverColor
prop, which allows controllingcolor
property when the component is hovered. New property is supported in Button and ActionIcon components.renderRoot
andcomponent
propsdata-checked
attribute when the checkbox is checkediconColor
proponValuesChange
option which can be used to sync form values with external statev7.1.6
: 7.1.7Compare Source
What's Changed
[@mantine/core]
Change how primary color fallback is applied in defaulttheme.variantColorResolver
to allow setting custom fallback values andundefined
handling[@mantine/core]
Select: Fix error thrown on blur when givenvalue
is not in the data array[@mantine/core]
Fix option icon being smaller when option text has multiple lines[@mantine/core]
Spoiler: Fix unexpected empty space when hide label isnull
(#5126)[@mantine/core]
Button: Fix different border width of regular and disabled buttons[@mantine/core]
Table: Fix row background changing on hover in dark color scheme even whenhighlightOnHover
prop is not set[@mantine/carousel]
FixslideSize
prop not handling number values (#5050)[@mantine/core]
Add option to keep transitions when color scheme changes in useMantineColorScheme hook (#5092)[@mantine/core]
Improvepop-*
transitions animations (#5096)[@mantine/hooks]
use-local-storage: Fix error throwing if localStorage/sessionStorage is blocked by browser (#5091)[@mantine/dates]
Calendar: Fix incorrect focus logic when first item is disabled (#5078)New Contributors
Full Changelog: mantinedev/mantine@7.1.5...7.1.6
v7.1.5
Compare Source
What's Changed
[@mantine/core]
HoverCard: Fix dropdown not visible when Checkbox/Switch is used as target (#5072)[@mantine/code-highlight]
Fix code not updating when content changes (#5073)[@mantine/core]
Highlight: Fix incorrect highlighted parts when one of the array items includes substrings of other item (#5045)[@mantine/core]
Rating: Fix container overflow when the width of total item exceeds parent element width (#5057)[@mantine/core]
Radio: Fix checked icon clipping and not being centered with some sizes (#5064)[@mantine/core]
Fix incorrect callback arguments values types (#5067)[@mantine/core]
TagsInput: Fixrequired
prop not working correctly (#5032)New Contributors
Full Changelog: mantinedev/mantine@7.1.3...7.1.5
v7.1.3
Compare Source
What's Changed
[@mantine/core]
Paper: Fix incorrectwithBorder
prop cascading to nested Paper components (#4930)[@mantine/core]
MultiSelect: Fix incorrect input styles without placeholder (#4954)[@mantine/core]
NumberInput: Fix focus shifting from the input when one of the controls is pressed (#5013)[@mantine/notifications]
Fixstyle
prop breaking animations (#5007)[@mantine/core]
Rating: Fix incorrect touch events handling (#4976)[@mantine/carousel]
FixonClick
handler fromnextControlProps
being overwritten by internal props (#4985)[@mantine/core]
MultiSelect: FixselectFirstOptionOnChange
prop not working (#4997)[@mantine/core]
Select: Fix incorrect behavior when bothsearchValue
andvalue
are controlled (#4998)[@mantine/spotlight]
Fix DOM error thrown after HMR and several other cases (#4992)[@mantine/hooks]
use-timeout: Fix callback not running after state change (#4968)[@mantine/hooks]
use-focus-trap: Fix incorrectinput[type="radio"]
handling (#4856)New Contributors
Full Changelog: mantinedev/mantine@7.1.2...7.1.3
v7.1.2
Compare Source
[@mantine/dropzone]
Fix incorrect pointer events of inner element (#4934)[@mantine/dropzone]
Fix broken exports fromreact-dropzone-esm
packageFull Changelog: mantinedev/mantine@7.1.1...7.1.2
v7.1.1
Compare Source
What's Changed
[@mantine/core]
Radio: Fix description and error being misaligned when the component is rendered inside Radio.Group[@mantine/core]
HoverCard: Add missingHoverCard.extend
[@mantine/core]
Drawer: Fix incorrect transitions in rtl direction (#4917)[@mantine/core]
TagsInput: Fix incorrect IME keyboard input handling (#4947)[@mantine/core]
Container: Fix nested Container components inheriting some properties from parent Container component (#4859)[@mantine/core]
Menu: Fix incorrect Menu.Item rtl styles (#4936)[@mantine/core]
Spoiler: remove margin-bottom when "Show more" is hidden (#4928)[@mantine/dropzone]
Migrate toreact-dropzone-esm
package to support frameworks that work only with esm (#4920)[@mantine/core]
Button: Fix incorrect border-radius of loading overlay (#4939)[@mantine/core]
Portal: Fix error when value ofclassName
prop contained whitespace (#4935)[@mantine/core]
MultiSelect: Fix incorrect input sizes values (#4925)[@mantine/core]
Affix: Fixposition
prop set as attribute on the root element (#4932)[@mantine/core]
Updatereact-textarea-autosize
dependency to the latest version to fix issues with edge runtime (#4923)[@mantine/core]
Select: Fix search value not changing when component value is controlled (#4915)[@mantine/core]
Fix incorrect ActionIcon.Group, Button.Group and Rating components RTL styles (#4907)[@mantine/core]
TagsInput: FixonOptionSubmit
not being called when tag is submitted withEnter
key (#4892)[@mantine/core]
NumberInput: Fix value reset to zero when leading non-zero number is deleted (#4916)New Contributors
Full Changelog: mantinedev/mantine@7.1.0...7.1.1
v7.1.0
: ⭐Compare Source
CSS layers
Starting from 7.1.0 it is possible to import all
@mantine/*
packages styles with rulesdefined in
mantine
CSS layer.CSS rules within a layer are grouped together and applied before rules without a layer. This means that
even if you do not have control over styles import order, you can still override Mantine styles with
regular styles.
You can import styles within a layer by importing
@mantine/*/styles.layer.css
files.Note that these files are a full replacement for
@mantine/*/styles.css
files –you should not import both of them.
CSS layers are also useful if you want to combine Mantine components with other libraries which also
provide styles. You can use
@layer
directive to control the order of styles:In this example, Mantine styles will take precedence over other library
base
styles, but other librarycomponents
styles will take precedence over Mantine component styles.As of September 2023, CSS layers are supported in all modern browsers and have 90% browser support.
renderRoot prop
All polymorphic components now support
renderRoot
prop, whichis an alternative to
component
prop.renderRoot
prop allows changing the root elementto any other component or HTML tag with a callback function. It can be used in cases when
component
prop is not flexible enough:className
to be a string, but react-router-dom NavLink expects
className
to be a function.on its props. Examples: typed Next.js Link, TanStack router Link
renderRoot
example with react-router-dom NavLink:renderRoot
example with typed Next.js Link:Improved ESM support
All
@mantine/*
packages now have improved ESM support:esm
folder now have.mjs
extension@mantine/*
packages withtype: module
inpackage.json
without any additional configurationCSS variables in style prop
It is now possible to define CSS variables in
style
prop in all Mantine components –style prop is no longer restricted by
React.CSSProperties
type:form.setInitialValues
@mantine/form now supports
form.setInitialValues
methodwhich allows updating initial values after the form was initialized. This method is useful when you
want to update values that are used in
form.reset
and to compare values for dirty fields state:v7.0.2
Compare Source
What's Changed
[@mantine/dates]
Fix DatePickerInput and other similar inputs not having correct height when used without placeholder[@mantine/core]
MultConfiguration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR has been generated by Mend Renovate. View repository job log here.