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/core from 7.9.1 to 7.10.1 #221

Closed

Conversation

thearyadev
Copy link
Owner

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.9.1 to 7.10.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 3 versions ahead of your current version.

  • The recommended version was released on 23 days ago.

Release notes
Package name: @mantine/core
  • 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

  • 7.10.0 - 2024-05-23

    View changelog with demos on mantine.dev website

    Tree component

    New Tree component:

    import { IconFolder, IconFolderOpen } from '@ tabler/icons-react';
    import { Group, RenderTreeNodePayload, Tree } from '@ mantine/core';
    import { CssIcon, NpmIcon, TypeScriptCircleIcon } from '@ mantinex/dev-icons';
    import { data, dataCode } from './data';
    import classes from './Demo.module.css';

    interface FileIconProps {
    name: string;
    isFolder: boolean;
    expanded: boolean;
    }

    function FileIcon({ name, isFolder, expanded }: FileIconProps) {
    if (name.endsWith('package.json')) {
    return <NpmIcon size={14} />;
    }

    if (name.endsWith('.ts') || name.endsWith('.tsx') || name.endsWith('tsconfig.json')) {
    return <TypeScriptCircleIcon size={14} />;
    }

    if (name.endsWith('.css')) {
    return <CssIcon size={14} />;
    }

    if (isFolder) {
    return expanded ? (
    <IconFolderOpen color="var(--mantine-color-yellow-9)" size={14} stroke={2.5} />
    ) : (
    <IconFolder color="var(--mantine-color-yellow-9)" size={14} stroke={2.5} />
    );
    }

    return null;
    }

    function Leaf({ node, expanded, hasChildren, elementProps }: RenderTreeNodePayload) {
    return (
    <Group gap={5} {...elementProps}>
    <FileIcon name={node.value} isFolder={hasChildren} expanded={expanded} />
    <span>{node.label}</span>
    </Group>
    );
    }

    function Demo() {
    return (
    <Tree
    classNames={classes}
    selectOnClick
    clearSelectionOnOutsideClick
    data={data}
    renderNode={(payload) => <Leaf {...payload} />}
    />
    );
    }

    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:

    import { Button, Group, TextInput } from '@ mantine/core';
    import { isEmail, isNotEmpty, useForm } from '@ mantine/form';

    function Demo() {
    const form = useForm({
    mode: 'uncontrolled',
    initialValues: {
    name: '',
    email: '',
    },

    <span class="pl-c1">validate</span>: <span class="pl-kos">{</span>
      <span class="pl-c1">name</span>: <span class="pl-en">isNotEmpty</span><span class="pl-kos">(</span><span class="pl-s">'Name is required'</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
      <span class="pl-c1">email</span>: <span class="pl-en">isEmail</span><span class="pl-kos">(</span><span class="pl-s">'Invalid email'</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>
    

    });

    return (
    <form
    onSubmit={form.onSubmit(
    (values) => console.log(values),
    (errors) => {
    const firstErrorPath = Object.keys(errors)[0];
    form.getInputNode(firstErrorPath)?.focus();
    }
    )}
    >
    <TextInput
    withAsterisk
    label="Your name"
    placeholder="Your name"
    key={form.key('name')}
    {...form.getInputProps('name')}
    />

      <span class="pl-c1">&lt;</span><span class="pl-smi">TextInput</span>
        <span class="pl-c1">withAsterisk</span>
        <span class="pl-c1">label</span><span class="pl-c1">=</span><span class="pl-s">"Your email"</span>
        <span class="pl-c1">placeholder</span><span class="pl-c1">=</span><span class="pl-s">"[email protected]"</span>
        <span class="pl-c1">key</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-s1">form</span><span class="pl-kos">.</span><span class="pl-en">key</span><span class="pl-kos">(</span><span class="pl-s">'email'</span><span class="pl-kos">)</span><span class="pl-kos">}</span>
        <span class="pl-kos">{</span>...<span class="pl-s1">form</span><span class="pl-kos">.</span><span class="pl-en">getInputProps</span><span class="pl-kos">(</span><span class="pl-s">'email'</span><span class="pl-kos">)</span><span class="pl-kos">}</span>
      <span class="pl-c1">/</span><span class="pl-c1">&gt;</span>
    
      <span class="pl-c1">&lt;</span><span class="pl-smi">Group</span> <span class="pl-c1">justify</span><span class="pl-c1">=</span><span class="pl-s">"flex-end"</span> <span class="pl-c1">mt</span><span class="pl-c1">=</span><span class="pl-s">"md"</span><span class="pl-c1">&gt;</span>
        <span class="pl-c1">&lt;</span><span class="pl-smi">Button</span> <span class="pl-c1">type</span><span class="pl-c1">=</span><span class="pl-s">"submit"</span><span class="pl-c1">&gt;</span>Submit<span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-smi">Button</span><span class="pl-c1">&gt;</span>
      <span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-smi">Group</span><span class="pl-c1">&gt;</span>
    <span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-ent">form</span><span class="pl-c1">&gt;</span>
    

    );
    }

    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:

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

    function Demo() {
    return (
    // Wrapper div is added for demonstration purposes only,
    // it is not required in real projects
    <div style={{ resize: 'horizontal', overflow: 'hidden', maxWidth: '100%' }}>
    <SimpleGrid
    type="container"
    cols={{ base: 1, '300px': 2, '500px': 5 }}
    spacing={{ base: 10, '300px': 'xl' }}
    >
    <div>1</div>
    <div>2</div>
    <div>3</div>
    <div>4</div>
    <div>5</div>
    </SimpleGrid>
    </div>
    );
    }

    Checkbox and Radio indicators

    New Checkbox.Indicator and Radio.Indicator
    components look exactly the same as Checkbox and Radio components, but they do not
    have any semantic meaning, they are just visual representations of checkbox and radio states.

    Checkbox.Indicator component:

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

    function Demo() {
    return (
    <Group>
    <Checkbox.Indicator />
    <Checkbox.Indicator checked />
    <Checkbox.Indicator indeterminate />
    <Checkbox.Indicator disabled />
    <Checkbox.Indicator disabled checked />
    <Checkbox.Indicator disabled indeterminate />
    </Group>
    );
    }

    Radio.Indicator component:

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

    function Demo() {
    return (
    <Group>
    <Radio.Indicator />
    <Radio.Indicator checked />
    <Radio.Indicator disabled />
    <Radio.Indicator disabled checked />
    </Group>
    );
    }

    Checkbox and Radio cards

    New Checkbox.Card and Radio.Card
    components can be used as replacements for Checkbox and Radio 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"] and input[type="radio"].

    Checkbox.Card component:

    import { useState } from 'react';
    import { Checkbox, Group, Text } from '@ mantine/core';
    import classes from './Demo.module.css';

    function Demo() {
    const [checked, setChecked] = useState(false);

    return (
    <Checkbox.Card
    className={classes.root}
    radius="md"
    checked={checked}
    onClick={() => setChecked((c) => !c)}
    >
    <Group wrap="nowrap" align="flex-start">
    <Checkbox.Indicator />
    <div>
    <Text className={classes.label}>@ mantine/core</Text>
    <Text className={classes.description}>
    Core components library: inputs, buttons, overlays, etc.
    </Text>
    </div>
    </Group>
    </Checkbox.Card>
    );
    }

    Checkbox.Card component with Checkbox.Group:

    import { useState } from 'react';
    import { Checkbox, Group, Stack, Text } from '@ mantine/core';
    import classes from './Demo.module.css';

    const data = [
    {
    name: '@ mantine/core',
    description: 'Core components library: inputs, buttons, overlays, etc.',
    },
    { name: '@ mantine/hooks', description: 'Collection of reusable hooks for React applications.' },
    { name: '@ mantine/notifications', description: 'Notifications system' },
    ];

    function Demo() {
    const [value, setValue] = useState<string[]>([]);

    const cards = data.map((item) => (
    <Checkbox.Card className={classes.root} radius="md" value={item.name} key={item.name}>
    <Group wrap="nowrap" align="flex-start">
    <Checkbox.Indicator />
    <div>
    <Text className={classes.label}>{item.name}</Text>
    <Text className={classes.description}>{item.description}</Text>
    </div>
    </Group>
    </Checkbox.Card>
    ));

    return (
    <>
    <Checkbox.Group
    value={value}
    onChange={setValue}
    label="Pick packages to install"
    description="Choose all packages that you will need in your application"
    >
    <Stack pt="md" gap="xs">
    {cards}
    </Stack>
    </Checkbox.Group>

      <span class="pl-c1">&lt;</span><span class="pl-smi">Text</span> <span class="pl-c1">fz</span><span class="pl-c1">=</span><span class="pl-s">"xs"</span> <span class="pl-c1">mt</span><span class="pl-c1">=</span><span class="pl-s">"md"</span><span class="pl-c1">&gt;</span>
        CurrentValue: <span class="pl-kos">{</span><span class="pl-s1">value</span><span class="pl-kos">.</span><span class="pl-en">join</span><span class="pl-kos">(</span><span class="pl-s">', '</span><span class="pl-kos">)</span> <span class="pl-c1">||</span> <span class="pl-s">'–'</span><span class="pl-kos">}</span>
      <span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-smi">Text</span><span class="pl-c1">&gt;</span>
    <span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-c1">&gt;</span>
    

    );
    }

    Radio.Card component:

    import { useState } from 'react';
    import { Group, Radio, Text } from '@ mantine/core';
    import classes from './Demo.module.css';

    function Demo() {
    const [checked, setChecked] = useState(false);

    return (
    <Radio.Card
    className={classes.root}
    radius="md"
    checked={checked}
    onClick={() => setChecked((c) => !c)}
    >
    <Group wrap="nowrap" align="flex-start">
    <Radio.Indicator />
    <div>
    <Text className={classes.label}>@ mantine/core</Text>
    <Text className={classes.description}>
    Core components library: inputs, buttons, overlays, etc.
    </Text>
    </div>
    </Group>
    </Radio.Card>
    );
    }

    Radio.Card component with Radio.Group:

    import { useState } from 'react';
    import { Group, Radio, Stack, Text } from '@ mantine/core';
    import classes from './Demo.module.css';

    const data = [
    {
    name: '@ mantine/core',
    description: 'Core components library: inputs, buttons, overlays, etc.',
    },
    { name: '@ mantine/hooks', description: 'Collection of reusable hooks for React applications.' },
    { name: '@ mantine/notifications', description: 'Notifications system' },
    ];

    function Demo() {
    const [value, setValue] = useState<string | null>(null);

    const cards = data.map((item) => (
    <Radio.Card className={classes.root} radius=<sp...

Snyk has created this PR to upgrade @mantine/core from 7.9.1 to 7.10.1.

See this package in npm:
@mantine/core

See this project in Snyk:
https://app.snyk.io/org/thearyadev/project/556003a2-23d0-448e-beb7-86dc60c30428?utm_source=github&utm_medium=referral&page=upgrade-pr
Copy link

vercel bot commented Jun 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
top500-aggregator ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 22, 2024 6:51am

@thearyadev thearyadev closed this Jul 25, 2024
@thearyadev thearyadev deleted the snyk-upgrade-57b6a0cca74b73ffce5b7d7ecb2dc6fd branch September 12, 2024 17:54
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