Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Snyk] Upgrade @mantine/hooks from 7.10.1 to 7.11.0 #151

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

molnard1
Copy link
Contributor

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/hooks from 7.10.1 to 7.11.0.

ℹ️ 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 22 days ago.

Release notes
Package name: @mantine/hooks
  • 7.11.0 - 2024-06-26

    View changelog with demos on mantine.dev website

    withProps function

    All Mantine components now have withProps static function that can be used to
    add default props to the component:

    https://mantine.dev&quot;&gt;Mantine website</LinkButton>

      {/* Component props override default props defined in `withProps` */}
      &lt;PhoneInput placeholder=&quot;Personal phone&quot; /&gt;
    &lt;/&gt;
    

    );
    }">

    import { IMaskInput } from 'react-imask';
    import { Button, InputBase } from '@ mantine/core';

    const LinkButton = Button.withProps({
    component: 'a',
    target: '_blank',
    rel: 'noreferrer',
    variant: 'subtle',
    });

    const PhoneInput = InputBase.withProps({
    mask: '+7 (000) 000-0000',
    component: IMaskInput,
    label: 'Your phone number',
    placeholder: 'Your phone number',
    });

    function Demo() {
    return (
    <>
    {/* You can pass additional props to components created with withProps */}
    <LinkButton href="https://mantine.dev">Mantine website</LinkButton>

      <span class="pl-kos">{</span><span class="pl-c">/* Component props override default props defined in `withProps` */</span><span class="pl-kos">}</span>
      <span class="pl-c1">&lt;</span><span class="pl-smi">PhoneInput</span> <span class="pl-c1">placeholder</span><span class="pl-c1">=</span><span class="pl-s">"Personal phone"</span> <span class="pl-c1">/</span><span class="pl-c1">&gt;</span>
    <span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-c1">&gt;</span>
    

    );
    }

    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 prop
    to the name of the person, for example, name="John Doe". If the name
    is set, you can use color="initials" to generate color based on the name:

    import { Avatar, Group } from '@ mantine/core';

    const names = [
    'John Doe',
    'Jane Mol',
    'Alex Lump',
    'Sarah Condor',
    'Mike Johnson',
    'Kate Kok',
    'Tom Smith',
    ];

    function Demo() {
    const avatars = names.map((name) => <Avatar key={name} name={name} color="initials" />);
    return <Group>{avatars}</Group>;
    }

    BubbleChart component

    New BubbleChart component:

    import { BubbleChart } from '@ mantine/charts';
    import { data } from './data';

    function Demo() {
    return (
    <BubbleChart
    h={60}
    data={data}
    range={[16, 225]}
    label="Sales/hour"
    color="lime.6"
    dataKey={{ x: 'hour', y: 'index', z: 'value' }}
    />
    );
    }

    BarChart waterfall type

    BarChart component now supports waterfall type
    which is useful for visualizing changes in values over time:

    import { BarChart } from '@ mantine/charts';
    import { data } from './data';

    function Demo() {
    return (
    <BarChart
    h={300}
    data={data}
    dataKey="item"
    type="waterfall"
    series={[{ name: 'Effective tax rate in %', color: 'blue' }]}
    withLegend
    />
    );
    }

    LineChart gradient type

    LineChart component now supports gradient type
    which renders line chart with gradient fill:

    import { LineChart } from '@ mantine/charts';
    import { data } from './data';

    function Demo() {
    return (
    <LineChart
    h={300}
    data={data}
    series={[{ name: 'temperature', label: 'Avg. Temperature' }]}
    dataKey="date"
    type="gradient"
    gradientStops={[
    { offset: 0, color: 'red.6' },
    { offset: 20, color: 'orange.6' },
    { offset: 40, color: 'yellow.5' },
    { offset: 70, color: 'lime.5' },
    { offset: 80, color: 'cyan.5' },
    { offset: 100, color: 'blue.5' },
    ]}
    strokeWidth={5}
    curveType="natural"
    yAxisProps={{ domain: [-25, 40] }}
    valueFormatter={(value) => <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">value</span><span class="pl-kos">}</span></span>°C}
    />
    );
    }

    Right Y axis

    LineChart, BarChart and AreaChart components
    now support rightYAxis prop which renders additional Y axis on the right side of the chart:

    import { LineChart } from '@ mantine/charts';
    import { data } from './data';

    function Demo() {
    return (
    <LineChart
    h={300}
    data={data}
    dataKey="name"
    withRightYAxis
    yAxisLabel="uv"
    rightYAxisLabel="pv"
    series={[
    { name: 'uv', color: 'pink.6' },
    { name: 'pv', color: 'cyan.6', yAxisId: 'right' },
    ]}
    />
    );
    }

    RadarChart legend

    RadarChart component now supports legend:

    import { RadarChart } from '@ mantine/charts';
    import { data } from './data';

    function Demo() {
    return (
    <RadarChart
    h={300}
    data={data}
    dataKey="product"
    withPolarRadiusAxis
    withLegend
    series={[
    { name: 'Sales January', color: 'blue.6', opacity: 0.2 },
    { name: 'Sales February', color: 'orange.6', opacity: 0.2 },
    ]}
    />
    );
    }

    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 to false. In this case, the value is added
    only when the user presses Enter or clicks on a suggestion.

    import { TagsInput } from '@ mantine/core';

    function Demo() {
    return (
    <>
    <TagsInput
    label="Value IS accepted on blur"
    placeholder="Enter text, then blur the field"
    data={['React', 'Angular', 'Svelte']}
    acceptValueOnBlur
    />
    <TagsInput
    label="Value IS NOT accepted on blur"
    placeholder="Enter text, then blur the field"
    data={['React', 'Angular', 'Svelte']}
    acceptValueOnBlur={false}
    mt="md"
    />
    </>
    );
    }

    Transition delay

    Transition component now supports enterDelay and exitDelay props to delay transition start:

    import { useState } from 'react';
    import { Button, Flex, Paper, Transition } from '@ mantine/core';

    export function Demo() {
    const [opened, setOpened] = useState(false);

    return (
    <Flex maw={200} pos="relative" justify="center" m="auto">
    <Button onClick={() => setOpened(true)}>Open dropdown</Button>

      <span class="pl-c1">&lt;</span><span class="pl-smi">Transition</span> <span class="pl-c1">mounted</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-s1">opened</span><span class="pl-kos">}</span> <span class="pl-c1">transition</span><span class="pl-c1">=</span><span class="pl-s">"pop"</span> <span class="pl-c1">enterDelay</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-c1">500</span><span class="pl-kos">}</span> <span class="pl-c1">exitDelay</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-c1">300</span><span class="pl-kos">}</span><span class="pl-c1">&gt;</span>
        <span class="pl-kos">{</span><span class="pl-kos">(</span><span class="pl-s1">transitionStyle</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">(</span>
          <span class="pl-c1">&lt;</span><span class="pl-smi">Paper</span>
            <span class="pl-c1">shadow</span><span class="pl-c1">=</span><span class="pl-s">"md"</span>
            <span class="pl-c1">p</span><span class="pl-c1">=</span><span class="pl-s">"xl"</span>
            <span class="pl-c1">h</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-c1">120</span><span class="pl-kos">}</span>
            <span class="pl-c1">pos</span><span class="pl-c1">=</span><span class="pl-s">"absolute"</span>
            <span class="pl-c1">inset</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-c1">0</span><span class="pl-kos">}</span>
            <span class="pl-c1">bottom</span><span class="pl-c1">=</span><span class="pl-s">"auto"</span>
            <span class="pl-c1">onClick</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-en">setOpened</span><span class="pl-kos">(</span><span class="pl-c1">false</span><span class="pl-kos">)</span><span class="pl-kos">}</span>
            <span class="pl-c1">style</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-kos">{</span> ...<span class="pl-s1">transitionStyle</span><span class="pl-kos">,</span> <span class="pl-c1">zIndex</span>: <span class="pl-c1">1</span> <span class="pl-kos">}</span><span class="pl-kos">}</span>
          <span class="pl-c1">&gt;</span>
            Click to close
          <span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-smi">Paper</span><span class="pl-c1">&gt;</span>
        <span class="pl-kos">)</span><span class="pl-kos">}</span>
      <span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-smi">Transition</span><span class="pl-c1">&gt;</span>
    <span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-smi">Flex</span><span class="pl-c1">&gt;</span>
    

    );
    }

    Documentation updates

    Other changes

    • Pagination component now supports hideWithOnePage prop which hides pagination when there is only one page
    • Spoiler component now supports controlled expanded state with expanded and onExpandedChange props
    • Burger component now supports lineSize prop to change lines height
    • Calendar, DatePicker and other similar components now support highlightToday prop to highlight today's date
  • 7.10.2 - 2024-06-13

    What's Changed

    • [@ mantine/core] Select: Fix incorrect state changes handling when both value and searchValue are controlled (#6272)
    • [@ mantine/core] Stepper: Fix autoContrast 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: Fix withErrorStyles prop being passed to the DOM element (#6348)

    New Contributors

    Full Changelog: 7.10.1...7.10.2

  • 7.10.1 - 2024-05-30

    What's Changed

    • [@ mantine/charts] BarChart: Add waterfall type (#6231)
    • [@ mantine/form] Fix form.setFieldError called inside form.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] Fix bd 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: Add inputSize prop to set size html attribute on the input element

    New Contributors

    Full Changelog: 7.10.0...7.10.1

from @mantine/hooks GitHub release notes

Important

  • Check the changes in this PR to ensure they won't cause issues with your project.
  • This PR was automatically created by Snyk using the credentials of a real user.
  • Snyk has automatically assigned this pull request, set who gets assigned.

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:

Snyk has created this PR to upgrade @mantine/hooks from 7.10.1 to 7.11.0.

See this package in npm:
@mantine/hooks

See this project in Snyk:
https://app.snyk.io/org/molnard1/project/b17e9594-832c-4d8d-884a-d22061356753?utm_source=github&utm_medium=referral&page=upgrade-pr
@molnard1 molnard1 self-assigned this Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants