[Snyk] Upgrade @mantine/core from 7.8.1 to 7.9.1 #209
Merged
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 was automatically created by Snyk using the credentials of a real user.
![snyk-top-banner](https://github.com/andygongea/OWASP-Benchmark/assets/818805/c518c423-16fe-447e-b67f-ad5a49b5d123)
Snyk has created this PR to upgrade @mantine/core from 7.8.1 to 7.9.1.
ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.
The recommended version is 2 versions ahead of your current version.
The recommended version was released on a month ago.
Release notes
Package name: @mantine/core
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: 7.9.0...7.9.1
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.
import { createStyles } from '@ mantine/emotion';
const useStyles = createStyles((theme, _, u) => ({
wrapper: {
maxWidth: rem(400),
width: '100%',
height: rem(180),
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
marginLeft: 'auto',
marginRight: 'auto',
borderRadius: theme.radius.sm,
},
child: {
// Assign selector to a ref to reference it in other styles
ref: u.ref('child'),
padding: theme.spacing.md,
borderRadius: theme.radius.sm,
boxShadow: theme.shadows.md,
},
}));
function Demo() {
const { classes } = useStyles();
return (
<div className={classes.wrapper}>
<div className={classes.child}>createStyles demo</div>
</div>
);
}
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.
import { isEmail, useField } from '@ mantine/form';
function Demo() {
const field = useField({
initialValue: '',
validateOnChange: true,
validate: isEmail('Invalid email'),
});
return <TextInput {...field.getInputProps()} label="Email" placeholder="Enter your email" />;
}
use-field
hook also supports async validation:import { useField } from '@ mantine/form';
function validateAsync(value: string): Promise<string | null> {
return new Promise((resolve) => {
window.setTimeout(() => {
resolve(value === 'mantine' ? null : 'Value must be "mantine"');
}, 800);
});
}
function Demo() {
const field = useField({
initialValue: '',
validate: validateAsync,
});
return (
<>
<TextInput
{...field.getInputProps()}
label="Enter 'mantine'"
placeholder="Enter 'mantine'"
rightSection={field.isValidating ? <Loader size={18} /> : null}
mb="md"
/>
<Button onClick={field.validate}>Validate async</Button>
</>
);
}
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
function Demo() {
const color = useMatches({
base: 'blue.9',
sm: 'orange.9',
lg: 'red.9',
});
return (
<Box bg={color} c="white" p="xl">
Box with color that changes based on screen size
</Box>
);
}
BarChart value label
BarChart now supports
withBarValueLabel
prop that allowsdisplaying value label on top of each bar:
import { data } from './data';
function Demo() {
return (
<BarChart
h={300}
data={data}
dataKey="month"
valueFormatter={(value) => new Intl.NumberFormat('en-US').format(value)}
withBarValueLabel
series={[
{ name: 'Smartphones', color: 'violet.6' },
{ name: 'Laptops', color: 'blue.6' },
{ name: 'Tablets', color: 'teal.6' },
]}
/>
);
}
Documentation updates
form.key()
functionOther changes
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: 7.8.0...7.8.1
Important
Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.
For more information: