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

Update mantine monorepo to v7.15.2 #142

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

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Dec 14, 2023

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@mantine/code-highlight (source) 7.3.1 -> 7.15.2 age adoption passing confidence
@mantine/core (source) 7.3.1 -> 7.15.2 age adoption passing confidence
@mantine/hooks (source) 7.3.1 -> 7.15.2 age adoption passing confidence
@mantine/notifications (source) 7.3.1 -> 7.15.2 age adoption passing confidence

Release Notes

mantinedev/mantine (@​mantine/code-highlight)

v7.15.2

Compare Source

What's Changed

  • [@mantine/dates] DatePicker: Fix incorrect handling of receiving partial value when type="range" (#​7278)
  • [@mantine/hooks] use-local-storage: Fix value not being updated when key changes (#​7286)
  • [@mantine/charts] Fix gridColor prop being passed down as attribute to html element (#​7288)
  • [@mantine/core] Update react-textarea-autosize to support React 19 (#​7297)
  • [@mantine/core] TypographyStylesProvider: Fix margin removal affecting non-typography elements (#​7290)
  • [@mantine/core] Tooltip: Add middlewares prop support (#​7281)
  • [@mantine/core] FloatingIndicator: Fix incorrect position calculations when the parent element has border (#​7267)
  • [@mantine/core] ScrollArea: Fix scrollbar not changing with the scroll position on first render (#​7257, #​7260)
  • [@mantine/tiptap] Fix incorrect paragraph styles inside lists (#​7255)
  • [@mantine/hooks] Fix incorrect ref types in use-move, use-radial-move, use-in-viewport and use-scroll-into-view (#​7252)
  • [@mantine/form] Fix incorrect validators types (#​7242)

New Contributors

Full Changelog: mantinedev/mantine@7.15.1...7.15.2

v7.15.1

Compare Source

What's Changed

  • [@mantine/dates] Improve focus behavior of DatePickerInput, DateInput and other components
  • [@mantine/form] Add touchTrigger option support
  • [@mantine/hooks] Add option to specify prefix in randonId function
  • [@mantine/core] Fix withProps function requiring all component props instead of partial
  • [@mantine/core] Add useModalStackContext and useDrawerStackContext hooks exports
  • [@mantine/core] ActionIcon: Add input-* autocomplete for size prop
  • [@mantine/core] AppShell: Fix incorrect default offsetScrollbars value for layout="alt"
  • [@mantine/core] Fix virtualColor function not working in server components (#​7184)
  • [@mantine/core] Checkbox: Fix incorrect Checkbox.Card behavior inside Checkbox.Group (#​7187)
  • [@mantine/core] Checkbox: Fix incorrect Checkbox.Card behavior inside Checkbox.Group (#​7187)
  • [@mantine/core] Slider: Add option to pass attributes down to thumb with thumbProps (#​7214)
  • [@mantine/core] Switch: Add data-checked attribute to the input (#​7228)
  • [@mantine/dates] Fix hasNextLevel prop type leak to DatePicker component (#​7229)
  • [@mantine/dates] Fix timezone not being applied to the formatted value (#​7162)
  • [@mantine/modals] Fix modalId being passed to the DOM node as attribute (#​7189)
  • [@mantine/core] TypographyStylesProvider: Fix incorrect paragraphs inside lists styles (#​7226)
  • [@mantine/core] Slider: Fix icon used as thumb child not being visible with the dark color scheme (#​7231, #​7232)
  • [@mantine/tiptap] Fix missing border in custom controls (#​7239)

New Contributors

Full Changelog: mantinedev/mantine@7.15.0...7.15.1

v7.15.0: 💋

Compare Source

View changelog with demos on mantine.dev website

Support Mantine development

You can now sponsor Mantine development with OpenCollective.
All funds will be used to improve Mantine and create new features and components.

use-radial-move hook

New use-radial-move hook can be used to create custom radial sliders:

import { useState } from 'react';
import { Box } from '@​mantine/core';
import { useRadialMove } from '@​mantine/hooks';
import classes from './Demo.module.css';

function Demo() {
  const [value, setValue] = useState(115);
  const { ref } = useRadialMove(setValue);

  return (
    <Box className={classes.root} ref={ref} style={{ '--angle': `${value}deg` }}>
      <div className={classes.value}>{value}°</div>
      <div className={classes.thumb} />
    </Box>
  );
}

BarChart color based on value

BarChart component now supports getBarColor prop to assign color based on value.
getBarColor function is called with two arguments: value and series object. It should return a color
string (theme color reference or any valid CSS color value).

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

function Demo() {
  return (
    <BarChart
      h={300}
      data={data}
      dataKey="month"
      getBarColor={(value) => (value > 700 ? 'teal.8' : 'red.8')}
      series={[{ name: 'Laptops', color: 'gray.6' }]}
    />
  );
}

Button.GroupSection and ActionIcon.GroupSection

ActionIcon.GroupSection and Button.GroupSection are new components that
can be used in ActionIcon.Group/Button.Group to create sections that are
not ActionIcon/Button components:

import { IconChevronDown, IconChevronUp } from '@&#8203;tabler/icons-react';
import { ActionIcon } from '@&#8203;mantine/core';
import { useCounter } from '@&#8203;mantine/hooks';

function Demo() {
  const [value, { increment, decrement }] = useCounter(135, { min: 0 });

  return (
    <ActionIcon.Group>
      <ActionIcon variant="default" size="lg" radius="md" onClick={decrement}>
        <IconChevronDown color="var(--mantine-color-red-text)" />
      </ActionIcon>
      <ActionIcon.GroupSection variant="default" size="lg" bg="var(--mantine-color-body)" miw={60}>
        {value}
      </ActionIcon.GroupSection>
      <ActionIcon variant="default" size="lg" radius="md" onClick={increment}>
        <IconChevronUp color="var(--mantine-color-teal-text)" />
      </ActionIcon>
    </ActionIcon.Group>
  );
}

Table vertical variant

Table component now support variant="vertical":

import { Table } from '@&#8203;mantine/core';

export function Demo() {
  return (
    <Table variant="vertical" layout="fixed" withTableBorder>
      <Table.Tbody>
        <Table.Tr>
          <Table.Th w={160}>Epic name</Table.Th>
          <Table.Td>7.x migration</Table.Td>
        </Table.Tr>

        <Table.Tr>
          <Table.Th>Status</Table.Th>
          <Table.Td>Open</Table.Td>
        </Table.Tr>

        <Table.Tr>
          <Table.Th>Total issues</Table.Th>
          <Table.Td>135</Table.Td>
        </Table.Tr>

        <Table.Tr>
          <Table.Th>Total story points</Table.Th>
          <Table.Td>874</Table.Td>
        </Table.Tr>

        <Table.Tr>
          <Table.Th>Last updated at</Table.Th>
          <Table.Td>September 26, 2024 17:41:26</Table.Td>
        </Table.Tr>
      </Table.Tbody>
    </Table>
  );
}

Table tabular numbers

Table component now supports tabularNums prop to render numbers in tabular style. It sets
font-variant-numeric: tabular-nums which makes numbers to have equal width.
This is useful when you have columns with numbers and you want them to be aligned:

import { NumberFormatter, Table } from '@&#8203;mantine/core';

const data = [
  { product: 'Apples', unitsSold: 2214411234 },
  { product: 'Oranges', unitsSold: 9983812411 },
  { product: 'Bananas', unitsSold: 1234567890 },
  { product: 'Pineapples', unitsSold: 9948810000 },
  { product: 'Pears', unitsSold: 9933771111 },
];

function Demo() {
  const rows = data.map((item) => (
    <Table.Tr key={item.product}>
      <Table.Td>{item.product}</Table.Td>
      <Table.Td>
        <NumberFormatter value={item.unitsSold} thousandSeparator />
      </Table.Td>
    </Table.Tr>
  ));

  return (
    <Table tabularNums>
      <Table.Thead>
        <Table.Tr>
          <Table.Th>Product</Table.Th>
          <Table.Th>Units sold</Table.Th>
        </Table.Tr>
      </Table.Thead>
      <Table.Tbody>{rows}</Table.Tbody>
    </Table>
  );
}

Update function in modals manager

Modals manager now supports modals.updateModal and modals.updateContextModal
function to update modal after it was opened:

import { Button } from '@&#8203;mantine/core';
import { modals } from '@&#8203;mantine/modals';

function Demo() {
  return (
    <Button
      onClick={() => {
        const modalId = modals.open({
          title: 'Initial Modal Title',
          children: <Text>This text will update in 2 seconds.</Text>,
        });

        setTimeout(() => {
          modals.updateModal({
            modalId,
            title: 'Updated Modal Title',
            children: (
              <Text size="sm" c="dimmed">
                This is the updated content of the modal.
              </Text>
            ),
          });
        }, 2000);
      }}
    >
      Open updating modal
    </Button>
  );
}

useForm submitting state

use-form hook now supports form.submitting field
and form.setSubmitting function to track form submission state.

form.submitting field will be set to true if function passed to
form.onSubmit returns a promise. After the promise is resolved or rejected,
form.submitting will be set to false:

import { useState } from 'react';
import { Button, Group, Stack, Text, TextInput } from '@&#8203;mantine/core';
import { useForm } from '@&#8203;mantine/form';

const asyncSubmit = (values: any) =>
  new Promise((resolve) => setTimeout(() => resolve(values), 3000));

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

  const [completed, setCompleted] = useState(false);

  const handleSubmit = async (values: typeof form.values) => {
    await asyncSubmit(values);
    setCompleted(true);
  };

  if (completed) {
    return (
      <Stack>
        <Text>Form submitted!</Text>
        <Button onClick={() => setCompleted(false)}>Reset to initial state</Button>
      </Stack>
    );
  }

  return (
    <form onSubmit={form.onSubmit(handleSubmit)}>
      <TextInput
        withAsterisk
        label="Name"
        placeholder="Your name"
        key={form.key('name')}
        disabled={form.submitting}
        {...form.getInputProps('name')}
      />

      <Group justify="flex-end" mt="md">
        <Button type="submit" loading={form.submitting}>
          Submit
        </Button>
      </Group>
    </form>
  );
}

You can also manually set form.submitting to true or false:

import { useForm } from '@&#8203;mantine/form';

const form = useForm({ mode: 'uncontrolled' });
form.submitting; // -> false

form.setSubmitting(true);
form.submitting; // -> true

form.setSubmitting(false);
form.submitting; // -> false

useForm onSubmitPreventDefault option

use-form hook now supports onSubmitPreventDefault option.
This option is useful if you want to integrate useForm hook with server actions.
By default, event.preventDefault() is called on the form onSubmit handler.
If you want to change this behavior, you can pass onSubmitPreventDefault option
to useForm hook. It can have the following values:

  • always (default) - always call event.preventDefault()
  • never - never call event.preventDefault()
  • validation-failed - call event.preventDefault() only if validation failed
import { useForm } from '@&#8203;mantine/form';

const form = useForm({
  mode: 'uncontrolled',
  onSubmitPreventDefault: 'never',
});

Subtle RichTextEditor variant

RichTextEditor component now supports subtle variant:

import Highlight from '@&#8203;tiptap/extension-highlight';
import Underline from '@&#8203;tiptap/extension-underline';
import { useEditor } from '@&#8203;tiptap/react';
import StarterKit from '@&#8203;tiptap/starter-kit';
import { RichTextEditor } from '@&#8203;mantine/tiptap';

const content = '<p>Subtle rich text editor variant</p>';

function Demo() {
  const editor = useEditor({
    extensions: [StarterKit, Underline, Highlight],
    content,
  });

  return (
    <RichTextEditor editor={editor} variant="subtle">
      <RichTextEditor.Toolbar sticky stickyOffset={60}>
        <RichTextEditor.ControlsGroup>
          <RichTextEditor.Bold />
          <RichTextEditor.Italic />
          <RichTextEditor.Underline />
          <RichTextEditor.Strikethrough />
          <RichTextEditor.ClearFormatting />
          <RichTextEditor.Highlight />
          <RichTextEditor.Code />
        </RichTextEditor.ControlsGroup>
      </RichTextEditor.Toolbar>

      <RichTextEditor.Content />
    </RichTextEditor>
  );
}

onExitTransitionEnd and onEnterTransitionEnd

Modal and Drawer components now support onExitTransitionEnd and onEnterTransitionEnd props,
which can be used to run code after exit/enter transition is finished. For example, this is useful when you want to clear
data after modal is closed:

import { useState } from 'react';
import { Button, Group, Modal } from '@&#8203;mantine/core';
import { useDisclosure } from '@&#8203;mantine/hooks';

function Demo() {
  const [firstOpened, firstHandlers] = useDisclosure(false);
  const [secondOpened, secondHandlers] = useDisclosure(false);
  const [modalData, setModalData] = useState({
    title: '',
    message: '',
  });

  return (
    <>
      <Modal
        opened={firstOpened}
        onClose={() => {
          firstHandlers.close();
          setModalData({ title: '', message: '' });
        }}
        title={modalData.title}
      >
        {modalData.message}
      </Modal>
      <Modal
        opened={secondOpened}
        onClose={secondHandlers.close}
        onExitTransitionEnd={() => setModalData({ title: '', message: '' })}
        title={modalData.title}
      >
        {modalData.message}
      </Modal>

      <Group>
        <Button
          onClick={() => {
            firstHandlers.open();
            setModalData({ title: 'Edit your profile', message: 'Imagine a form here' });
          }}
        >
          Clear data in onClose
        </Button>

        <Button
          onClick={() => {
            secondHandlers.open();
            setModalData({ title: 'Edit your profile', message: 'Imagine a form here' });
          }}
        >
          Clear data in onExitTransitionEnd
        </Button>
      </Group>
    </>
  );
}

Week numbers in DatePicker

DatePicker and other components based on Calendar component now support withWeekNumbers prop to display week numbers:

import { DatePicker } from '@&#8203;mantine/dates';

function Demo() {
  return <DatePicker withWeekNumbers />;
}

New demo: BarChart with overlay

import { BarChart } from '@&#8203;mantine/charts';
import { data } from './data';
import classes from './Demo.module.css';

function Demo() {
  const bigBarWidth = useMediaQuery('(min-width: 48em)') ? 42 : 26;
  const ratio = 0.5;
  const smallBarWidth = bigBarWidth * ratio;
  const barGap = (bigBarWidth + smallBarWidth) / -2;

  return (
    <BarChart
      h={300}
      data={overlayData}
      dataKey="index"
      barChartProps={{ barGap }}
      barProps={(data) => ({ barSize: data.name === 'you' ? bigBarWidth : smallBarWidth })}
      classNames={classes}
      series={[
        { name: 'you', color: 'var(--you-bar-color)' },
        { name: 'average', color: 'var(--average-bar-color)' },
      ]}
    />
  );
}

Variants types augmentation

Custom variants types augmentation guide was added to the documentation.

Example of adding custom variant type to Button component:

import { ButtonVariant, MantineSize } from '@&#8203;mantine/core';

type ExtendedButtonVariant = ButtonVariant | 'contrast' | 'radial-gradient';

declare module '@&#8203;mantine/core' {
  export interface ButtonProps {
    variant?: ExtendedButtonVariant;
  }
}

Help Center updates

v7.14.3

Compare Source

What's Changed

  • [@mantine/core] Slider: Fix restrictToMarks prop not working with arrow and Home/End keys correctly
  • [@mantine/core] Checkbox: Fix Checkbox.Card component not working with form.getInputProps
  • [@mantine/core] Tree: Add checkOnSpace prop support (#​7132)
  • [@mantine/core] ScrollArea: Fix opacity style of thumb being too specific (#​7149)
  • [@mantine/dates] Add withWeekNumbers prop support to all components based on Calendar (#​7179)
  • [@mantine/core] Replace global JSX types with React.JSX to support React 19 types (#​7178)

New Contributors

Full Changelog: mantinedev/mantine@7.14.2...7.14.3

v7.14.2

Compare Source

What's Changed

  • [@mantine/core] Add onEnterTranstionEnd and onExitTransitionEnd props support to Modal, Drawer and Popover components
  • [@mantine/charts] DonutChart: Fix valueFormatter prop not working, add labelsType prop support (#​7153)
  • [@mantine/charts] BarChart: Fix incorrect labels positions in some cases (#​7160)
  • [@mantine/core] PasswordInput: Fix visibilityToggleButtonProps.variant prop being ignored (#​7144)
  • [@mantine/core] Improve window.matchMedia usage to support test environments without matchMedia support (#​7147)
  • [@mantine/core] Fix arrow overlaying Popover, Tooltip and HoverCard content in some cases (#​7148)
  • [@mantine/form] Add onSubmitPreventDefault option support (#​7142)
  • [@mantine/core] TypographyStylesProvider: Fix incorrect lists styles
  • [@mantine/notifications] Fix notifications with bottom-right and top-right positions shifting when modal/drawer is opened
  • [@mantine/core] FileInput: Add missing placeholder Styles API reference
  • [@mantine/core] Update floating-ui, react-textarea-autosize and type-fest dependencies to the latest version
  • [@mantine/modals] Add updateModal and updateContextModal functions (#​7104)
  • [@mantine/tiptap] Fix too specific styles that prevented controls border-radius override without !important
  • [@mantine/tiptap] Fix disabled controls having hover effects and pointer cursor
  • [@mantine/core] FileInput: Add missing component prop
  • [@mantine/core] AngleSlider: Fix page being scrolled when the value is being changed on mobile
  • [@mantine/core] NumberInput: Fix increment/decrement controls not being visible if the value is number like string
  • [@mantine/core] NavLink: Fix collapse for nested links being rendered even if there are no child links (#​7133)
  • [@mantine/dates] Fix defaultDate prop being ignore in YearPickerInput and MonthPickerInput components (#​7108)
  • [@mantine/dropzone] Update react-dropzone-esm to the latest version

New Contributors

Full Changelog: mantinedev/mantine@7.14.1...7.14.2

v7.14.1

Compare Source

What's Changed

  • [@mantine/hooks] use-hotkeys: Fix + sign not being supported (syntax: shift+[plus]) (#​7123)
  • [@mantine/core] Popover: Fix styles prop being handled incorrectly (#​7120)
  • [@mantine/charts] Fix valueFormatter not working in point labels of LineChant, AreaChart and CompositeChart components (#​6989)
  • [@mantine/core] Popover: Fix onOpen and onClose callbacks being called on each render (#​7022, #​7111, #​7115)
  • [@mantine/core] Menu: Fix Blocked aria-hidden warning when an interactive element is clicked outside of the Menu.Dropdown when the Menu is opened (#​7035)
  • [@mantine/core] Fix top style prop not being conveted to rem (#​7112)
  • [@mantine/dates] DateInput: Fix defaultDate prop not working when the value is set to null (#​4426)
  • [@mantine/core] NumberInput: Remove increment/decrement control if value cannot be safely incremented (is larger than Number.MAX_SAFE_INTEGER) (#​7033)
  • [@mantine/core] NumberInput: Fix value being reverted to start value if intial component value is a string
  • [@mantine/notifications] Fix NotificationData type being too broad (#​7097)
  • [@mantine/core] RingProgress: Add transitionDuration prop support (#​7103)
  • [@mantine/core] TagsInput: Fix incorrect tag remove logic with duplicated tags (#​7105)
  • [@mantine/core] Combobox: Fix incorrect aria-controls attribute being set on the target element when the dropdown is closed (#​7114)

New Contributors

Full Changelog: mantinedev/mantine@7.14.0...7.14.1

v7.14.0: 💋

Compare Source

View changelog with demos on mantine.dev website

AngleSlider component

New AngleSlider component:

import { AngleSlider, Group } from '@&#8203;mantine/core';

function Demo() {
  return (
    <Group p="lg" gap={50}>
      <AngleSlider
        aria-label="Angle slider"
        formatLabel={(value) => `${value}°`}
        size={100}
        restrictToMarks
        marks={[
          { value: 0 },
          { value: 45 },
          { value: 90 },
          { value: 135 },
          { value: 180 },
          { value: 225 },
          { value: 270 },
          { value: 315 },
        ]}
      />

      <AngleSlider
        aria-label="Angle slider"
        formatLabel={(value) => `${value}°`}
        size={100}
        marks={[
          { value: 0, label: '0°' },
          { value: 45, label: '45°' },
          { value: 90, label: '90°' },
          { value: 135, label: '135°' },
          { value: 180, label: '180°' },
          { value: 225, label: '225°' },
          { value: 270, label: '270°' },
          { value: 315, label: '315°' },
        ]}
      />
    </Group>
  );
}

RadialBarChart component

New RadialBarChart component:

import { RadialBarChart } from '@&#8203;mantine/charts';

const data = [
  { name: '18-24', value: 31.47, color: 'blue.7' },
  { name: '25-29', value: 26.69, color: 'orange.6' },
  { name: '30-34', value: 15.69, color: 'yellow.7' },
  { name: '35-39', value: 8.22, color: 'cyan.6' },
  { name: '40-49', value: 8.63, color: 'green' },
  { name: '50+', value: 2.63, color: 'pink' },
  { name: 'unknown', value: 6.67, color: 'gray' },
];

function Demo() {
  return <RadialBarChart data={data} dataKey="value" h={280} withLabels />;
}

FunnelChart component

New FunnelChart component:

import { FunnelChart } from '@&#8203;mantine/charts';

const data = [
  { name: 'USA', value: 400, color: 'indigo.6' },
  { name: 'India', value: 300, color: 'yellow.6' },
  { name: 'Japan', value: 100, color: 'teal.6' },
  { name: 'Other', value: 200, color: 'gray.6' },
];

function Demo() {
  return <FunnelChart data={data} />;
}

Modal.Stack and Drawer.Stack components

New Modal.Stack and Drawer.Stack components simplify usage of multiple modals/drawers at the same time.

Use Modal.Stack component to render multiple modals at the same time.
Modal.Stack keeps track of opened modals, manages z-index values, focus trapping
and closeOnEscape behavior. Modal.Stack is designed to be used with useModalsStack hook.

Differences from using multiple Modal components:

  • Modal.Stack manages z-index values – modals that are opened later will always have higher z-index value disregarding their order in the DOM
  • Modal.Stack disables focus trap and Escape key handling for all modals except the one that is currently opened
  • Modals that are not currently opened are present in the DOM but are hidden with opacity: 0 and pointer-events: none
  • Only one overlay is rendered at a time
import { Button, Group, Modal, useModalsStack } from '@&#8203;mantine/core';

function Demo() {
  const stack = useModalsStack(['delete-page', 'confirm-action', 'really-confirm-action']);

  return (
    <>
      <Modal.Stack>
        <Modal {...stack.register('delete-page')} title="Delete this page?">
          Are you sure you want to delete this page? This action cannot be undone.
          <Group mt="lg" justify="flex-end">
            <Button onClick={stack.closeAll} variant="default">
              Cancel
            </Button>
            <Button onClick={() => stack.open('confirm-action')} color="red">
              Delete
            </Button>
          </Group>
        </Modal>

        <Modal {...stack.register('confirm-action')} title="Confirm action">
          Are you sure you want to perform this action? This action cannot be undone. If you are
          sure, press confirm button below.
          <Group mt="lg" justify="flex-end">
            <Button onClick={stack.closeAll} variant="default">
              Cancel
            </Button>
            <Button onClick={() => stack.open('really-confirm-action')} color="red">
              Confirm
            </Button>
          </Group>
        </Modal>

        <Modal {...stack.register('really-confirm-action')} title="Really confirm action">
          Jokes aside. You have confirmed this action. This is your last chance to cancel it. After
          you press confirm button below, action will be performed and cannot be undone. For real
          this time. Are you sure you want to proceed?
          <Group mt="lg" justify="flex-end">
            <Button onClick={stack.closeAll} variant="default">
              Cancel
            </Button>
            <Button onClick={stack.closeAll} color="red">
              Confirm
            </Button>
          </Group>
        </Modal>
      </Modal.Stack>

      <Button onClick={() => stack.open('delete-page')}>Open modal</Button>
    </>
  );
}

useModalsStack/useDrawersStack hooks

useModalsStack hook provides an easy way to control multiple modals at the same time.
It accepts an array of unique modals ids and returns an object with the following properties:

interface ModalStackReturnType<T extends string> {
  // Current opened state of each modal
  state: Record<T, boolean>;

  // Opens modal with the given id
  open: (id: T) => void;

  // Closes modal with the given id
  close: (id: T) => void;

  // Toggles modal with the given id
  toggle: (id: T) => void;

  // Closes all modals within the stack
  closeAll: () => void;

  // Returns props for modal with the given id
  register: (id: T) => {
    opened: boolean;
    onClose: () => void;
    stackId: T;
  };
}

Example of using useModalsStack with Modal component:

import { Modal, useModalsStack } from '@&#8203;mantine/core';

function Demo() {
  const stack = useModalsStack(['first', 'second']);

  return (
    <>
      <Modal {...stack.register('first')}>First</Modal>
      <Modal {...stack.register('second')}>Second</Modal>
      <Button onClick={() => stack.open('first')}>Open first</Button>
    </>
  );
}

Restrict Slider selection to marks

Slider component now supports restrictToMarks prop that restricts slider value to marks only.
Note that in this case step prop is ignored:

import { Slider } from '@&#8203;mantine/core';

function Demo() {
  return (
    <Slider
      restrictToMarks
      defaultValue={25}
      marks={Array.from({ length: 5 }).map((_, index) => ({ value: index * 25 }))}
    />
  );
}

BarChart SVG pattern fill

BarChart now can be used with SVG pattern fill:

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

function Demo() {
  return (
    <BarChart
      h={300}
      data={mixedStackData}
      dataKey="month"
      series={[
        { name: 'Smartphones', color: 'url(#crosshatch)', stackId: 'a' },
        { name: 'Laptops', color: 'blue.6', stackId: 'b' },
        { name: 'Tablets', color: 'url(#diagonalStripes)', stackId: 'b' },
      ]}
    >
      <defs>
        <pattern
          id="diagonalStripes"
          patternUnits="userSpaceOnUse"
          width={6}
          height={8}
          patternTransform="rotate(45)"
        >
          <rect
            width="2"
            height="8"
            transform="translate(0,0)"
            fill="color-mix(in lch, var(--mantine-color-teal-6) 70%, rgba(0,0,0,0))"
          />
        </pattern>

        <pattern id="crosshatch" patternUnits="userSpaceOnUse" width={8} height={8}>
          <path
            d="M 0 0 L 8 0 L 8 8 L 0 8 Z"
            fill="none"
            stroke="color-mix(in lch, var(--mantine-color-indigo-6) 70%, rgba(0,0,0,0))"
            strokeWidth="1"
          />
          <path
            d="M 0 0 L 8 8"
            stroke="color-mix(in lch, var(--mantine-color-indigo-6) 70%, rgba(0,0,0,0))"
            strokeWidth="1"
          />
          <path
            d="M 8 0 L 0 8"
            stroke="color-mix(in lch, var(--mantine-color-indigo-6) 70%, rgba(0,0,0,0))"
            strokeWidth="1"
          />
        </pattern>
      </defs>
    </BarChart>
  );
}

Help center updates

Other changes

  • useTree hook now accepts onNodeExpand and onNodeCollapse callbacks
  • useTree hook now returns additional checkAllNodes, uncheckAllNodes and setCheckedState handlers
  • Tree component now includes getTreeExpandedState to generate expanded state based on the tree data
  • use-form now supports form.replaceListItem handler to replace list item at given index

v7.13.5

Compare Source

What's Changed

  • [@mantine/core] Update peer dependencies range for react to allow react and react-dom 19 as dependcy
  • [@mantine/core] Fix error in Next.js with React 19 related to ref prop usage in Tooltip, Popover and Combobox components (#​7028)
  • [@mantine/core] FileButton: Fix resetRef throwing error if the component is contidionally rendered (#​7025)
  • [@mantine/core] Button: Fix incorrect focus styles of Button.Group (#​6992)
  • [@mantine/charts] CompositeCharts: Fix missing key prop error (#​7020)
  • [@mantine/core] NumberInput: Fix min/max value being bypassed if 0 has been entered as the first digit (#​7021)
  • [@mantine/form] Add useCallback wrapper to form.resetDirty (#​7029)
  • [@mantine/core] Combobox: Fix incorrect logic of selected options when the dropdown is closed without selecting value (#​7039)
  • [@mantine/charts] BarChart: Add barLabelColor prop support
  • [@mantine/charts] BarChart: Fix bar label being positioned incorrectly with horizontal orientation (#​7042)
  • [@mantine/charts] RadarChart: Fix incorrect series prop type (#​7046)
  • [@mantine/form] Add additional type exports from the package (#​7062)
  • [@mantine/core] Tabs: Fix tabIndex not being overridden by Tabs.Tab props (#​7081)
  • [@mantine/dates] DatePickerInput: Fix nextLabel and previousLabel props not being handled correctly (#​7082)
  • [@mantine/charts] Update recharts dependency to the latest version to improve Next.js 15 and React 19 support

New Contributors

Full Changelog: mantinedev/mantine@7.13.4...7.13.5

v7.13.4

Compare Source

Next.js 15 support

The documentation and templates have been updated to support Next.js 15 release, for more information visit – https://mantine.dev/guides/next/

Other changes

  • [@mantine/dates] DatePickerInput: Fix dropdown staying opened after the disabled prop has been set (#​7017)
  • [@mantine/core] NumberInput: Fix incorrect ref node type
  • [@mantine/core] Popover: Fix onClose event firing incorrectly

Full Changelog: mantinedev/mantine@7.13.3...7.13.4

v7.13.3

Compare Source

What's Changed

  • [@mantine/core] Fix cqw, cqh, cqi, cqb, cqmax and cqmin size units not being handled correctly in style props
  • [@mantine/dates] DateTimePicker: Remove defaultValue and value props from timeInputProps types to avoid confusion (#​6959)
  • [@mantine/dropzone] Set data-disabled attribute on the root element if disabled prop is set (#​6946)
  • [@mantine/core] Modal: Fix default Modal.Root transition being different from Modal component (#​6967)
  • [@mantine/core] ColorInput: Fix popoverProps={{ opned: true }} not working (#​6968)
  • [@mantine/charts] Fix valueFormatter prop not working correctly with orientation="vertical" in BarChart, AreaChart and LineChart components (#​6979)
  • [@mantine/core] Popover: Fix onOpen not being called with controlled opened state (#​6981)
  • [@mantine/core] NumberInput: Fix incorrect min prop handling for large numbers (#​6985)
  • [@mantine/dropzone] Add HEIF image mime type (#​6977)
  • [@mantine/core] PasswordInput: Fix cursor shifting when the visibility button is clicked on touch devices (#​6971)

New Contributors

Full Changelog: mantinedev/mantine@7.13.2...7.13.3

v7.13.2

Compare Source

What's Changed

  • [@mantine/dates] DateInput: Fix onClick handler passed to getDayProps not being called
  • [@mantine/core] Badge: Fix incorrect cursor styles
  • [@mantine/core] FileInput: Add resetRef prop support
  • [@mantine/core] Popover: Fix onClose function being called twice with controlled state
  • [@mantine/spotlight] Fix selected index not being reset when the spotlight is closed (#​6842)
  • [@mantine/core] Popover: Improve performance of scrolling when large number of closed Popovers are rendered on the same page (#​6771)
  • [@mantine/core] Pagination: Fix getItemProps not being able to override control children prop (#​6789)
  • [@mantine/core] ScrollArea: Fix onBottomReached not being called if the viewport has decimal px height value (#​6792)
  • [@mantine/hooks] use-in-viewport: Fix hook not reacting to node changes (#​6926)
  • [@mantine/core] NumberInput: Fix incorrect handling of decimal numbers with more than 15 decimal places (#​6823)
  • [@mantine/core] Slider: Fix marks not being aligned correctly (#​6909)
  • [@mantine/hooks] use-fullscreen: Fix target node changes being ignored (#​6923)
  • [@mantine/core] Badge: Fix incorrect sections alignment for variant="dot"
  • [@mantine/core] TagsInput: Fix incorrect logic of removing duplicate tags (#​6922)
  • [@mantine/core] AppShell: Fix error when Suspense is rendered inside AppShell (#​6927)
  • [@mantine/core] Menu: Fix onKeyDown prop not working in Menu.Dropdown component (#​6910)

New Contributors

Full Changelog: mantinedev/mantine@7.13.1...7.13.2

v7.13.1

Compare Source

What's Changed

  • [@mantine/chart] PieChart: Remove unused CSS (#​6903)
  • [@mantine/core] Menu: Fix onKeyDown not working when passed to Menu.Item (#​6906)
  • [@mantine/core] TagsInput: Fix duplicated tags being deleted when one of tags with the same value is deleted (#​6907)
  • [@mantine/dates] Fix hidden input value not respecting specified timezone (#​6881)
  • [@mantine/hooks] use-hover: Fix events not being reattached when the target node changes (#​6782)
  • [@mantine/colors-generator] Update chroma-js version to support the latest version (#​6879)
  • [@mantine/core] PinInput: Fix incorrect Backspace key handling on the first input (#​6880)
  • [@mantine/hooks] use-state-history: Add reset handler support (#​6769)
  • [@mantine/core] ScrollArea: Fix onTopReached prop not being passed down in ScrollArea.Autosize component (#​6747)
  • [@mantine/chart] Fix incorrect types for props passed down to recharts components (#​6820)
  • [@mantine/form] Fix indices over 9 not working in form paths in some cases (#​6794)
  • [@mantine/chart] BarChart: Fix BarLabel logging errors in the console (#​6810)
  • [@mantine/chart] Fix error when chart tooltip label contains period (#​6826)
  • [@mantine/core] Title: Add option to use Text font-size and line-height values with size prop (#​6833)
  • [@mantine/date] Calendar: Fix nextLabel and previousLabel props not working (#​6847)
  • [@mantine/core] Fix 2xl and other similar values being treated as CSS value instead of theme value (#​6855)
  • [@mantine/core] Breadcrumbs: Fix component with large number of values not wrapping on small screens (#​6863)
  • [@mantine/core] Table: Fix thead being overlayed to td in some cases (#​6860)

New Contributors

Full Changelog: mantinedev/mantine@7.13.0...7.13.1

v7.13.0: 🎇

Compare Source

View changelog with demos on mantine.dev website

Container queries support in Grid

You can now use container queries
in Grid component. With container queries, all responsive values
are 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 { Grid } from '@&#8203;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%' }}>
      <Grid
        type="container"
        breakpoints={{ xs: '100px', sm: '2

</details>

---

### Configuration

📅 **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.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/vespa-engine/vespa-search).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy45My4xIiwidXBkYXRlZEluVmVyIjoiMzkuODAuMCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

@renovate renovate bot force-pushed the renovate/mantine-monorepo branch from 66d88dc to 8bc61a6 Compare January 3, 2024 06:25
@renovate renovate bot changed the title Update mantine monorepo to v7.3.2 Update mantine monorepo to v7.4.0 Jan 3, 2024
@renovate renovate bot force-pushed the renovate/mantine-monorepo branch from 8bc61a6 to a958735 Compare January 9, 2024 07:55
@renovate renovate bot changed the title Update mantine monorepo to v7.4.0 Update mantine monorepo to v7.4.1 Jan 9, 2024
@renovate renovate bot changed the title Update mantine monorepo to v7.4.1 Update mantine monorepo to v7.4.2 Jan 17, 2024
@renovate renovate bot force-pushed the renovate/mantine-monorepo branch from a958735 to 127070c Compare January 17, 2024 19:43
@renovate renovate bot force-pushed the renovate/mantine-monorepo branch from 127070c to e378d00 Compare January 26, 2024 11:58
@renovate renovate bot changed the title Update mantine monorepo to v7.4.2 Update mantine monorepo to v7.5.0 Jan 26, 2024
@renovate renovate bot force-pushed the renovate/mantine-monorepo branch from e378d00 to a6945bb Compare February 2, 2024 17:33
@renovate renovate bot changed the title Update mantine monorepo to v7.5.0 Update mantine monorepo to v7.5.1 Feb 2, 2024
@renovate renovate bot force-pushed the renovate/mantine-monorepo branch from a6945bb to f901c8a Compare February 9, 2024 13:33
@renovate renovate bot changed the title Update mantine monorepo to v7.5.1 Update mantine monorepo to v7.5.2 Feb 9, 2024
@renovate renovate bot force-pushed the renovate/mantine-monorepo branch from f901c8a to c3ea87e Compare February 16, 2024 10:52
@renovate renovate bot changed the title Update mantine monorepo to v7.5.2 Update mantine monorepo to v7.5.3 Feb 16, 2024
@renovate renovate bot force-pushed the renovate/mantine-monorepo branch from c3ea87e to ba8a680 Compare February 26, 2024 13:31
@renovate renovate bot changed the title Update mantine monorepo to v7.5.3 Update mantine monorepo to v7.6.0 Feb 26, 2024
@renovate renovate bot force-pushed the renovate/mantine-monorepo branch from ba8a680 to 4c6fd39 Compare February 27, 2024 08:01
@renovate renovate bot changed the title Update mantine monorepo to v7.6.0 Update mantine monorepo to v7.6.1 Feb 27, 2024
@renovate renovate bot force-pushed the renovate/mantine-monorepo branch from 4c6fd39 to 8b8cdd5 Compare March 12, 2024 18:35
@renovate renovate bot changed the title Update mantine monorepo to v7.6.1 Update mantine monorepo to v7.6.2 Mar 12, 2024
@renovate renovate bot force-pushed the renovate/mantine-monorepo branch from 8b8cdd5 to e64636e Compare March 26, 2024 08:42
@renovate renovate bot changed the title Update mantine monorepo to v7.6.2 Update mantine monorepo to v7.7.0 Mar 26, 2024
@renovate renovate bot force-pushed the renovate/mantine-monorepo branch from e64636e to 996a702 Compare March 29, 2024 09:29
@renovate renovate bot changed the title Update mantine monorepo to v7.7.0 Update mantine monorepo to v7.7.1 Mar 29, 2024
@renovate renovate bot force-pushed the renovate/mantine-monorepo branch from 996a702 to fdf8a33 Compare April 11, 2024 15:15
@renovate renovate bot changed the title Update mantine monorepo to v7.7.1 Update mantine monorepo to v7.7.2 Apr 11, 2024
@renovate renovate bot force-pushed the renovate/mantine-monorepo branch from fdf8a33 to ba2675f Compare April 12, 2024 14:45
@renovate renovate bot changed the title Update mantine monorepo to v7.7.2 Update mantine monorepo to v7.8.0 Apr 12, 2024
@renovate renovate bot force-pushed the renovate/mantine-monorepo branch from ba2675f to 4e4bad7 Compare April 23, 2024 14:13
@renovate renovate bot changed the title Update mantine monorepo to v7.8.0 Update mantine monorepo to v7.8.1 Apr 23, 2024
@renovate renovate bot changed the title Update mantine monorepo to v7.12.0 Update mantine monorepo to v7.12.1 Aug 12, 2024
@renovate renovate bot force-pushed the renovate/mantine-monorepo branch from 94ef850 to 0424ddd Compare August 30, 2024 13:48
@renovate renovate bot changed the title Update mantine monorepo to v7.12.1 Update mantine monorepo to v7.12.2 Aug 30, 2024
@renovate renovate bot force-pushed the renovate/mantine-monorepo branch from 0424ddd to 80c3097 Compare September 25, 2024 09:22
@renovate renovate bot changed the title Update mantine monorepo to v7.12.2 Update mantine monorepo to v7.13.0 Sep 25, 2024
@renovate renovate bot force-pushed the renovate/mantine-monorepo branch from 80c3097 to 717d30f Compare September 30, 2024 09:26
@renovate renovate bot changed the title Update mantine monorepo to v7.13.0 Update mantine monorepo to v7.13.1 Sep 30, 2024
@renovate renovate bot force-pushed the renovate/mantine-monorepo branch from 717d30f to 99866fb Compare October 3, 2024 13:08
@renovate renovate bot changed the title Update mantine monorepo to v7.13.1 Update mantine monorepo to v7.13.2 Oct 3, 2024
@renovate renovate bot force-pushed the renovate/mantine-monorepo branch from 99866fb to 3d88b32 Compare October 17, 2024 09:22
@renovate renovate bot changed the title Update mantine monorepo to v7.13.2 Update mantine monorepo to v7.13.3 Oct 17, 2024
@renovate renovate bot force-pushed the renovate/mantine-monorepo branch from 3d88b32 to 5087366 Compare October 23, 2024 20:34
@renovate renovate bot changed the title Update mantine monorepo to v7.13.3 Update mantine monorepo to v7.13.4 Oct 23, 2024
@renovate renovate bot force-pushed the renovate/mantine-monorepo branch from 5087366 to ed902d4 Compare November 8, 2024 11:18
@renovate renovate bot changed the title Update mantine monorepo to v7.13.4 Update mantine monorepo to v7.13.5 Nov 8, 2024
@renovate renovate bot force-pushed the renovate/mantine-monorepo branch from ed902d4 to 4853ff6 Compare November 12, 2024 15:26
@renovate renovate bot changed the title Update mantine monorepo to v7.13.5 Update mantine monorepo to v7.14.0 Nov 12, 2024
@renovate renovate bot force-pushed the renovate/mantine-monorepo branch from 4853ff6 to 0f3cff5 Compare November 16, 2024 15:56
@renovate renovate bot changed the title Update mantine monorepo to v7.14.0 Update mantine monorepo to v7.14.1 Nov 16, 2024
@renovate renovate bot force-pushed the renovate/mantine-monorepo branch from 0f3cff5 to 627ee68 Compare November 24, 2024 10:54
@renovate renovate bot changed the title Update mantine monorepo to v7.14.1 Update mantine monorepo to v7.14.2 Nov 24, 2024
@renovate renovate bot force-pushed the renovate/mantine-monorepo branch from 627ee68 to 2c5ad1f Compare November 28, 2024 12:37
@renovate renovate bot changed the title Update mantine monorepo to v7.14.2 Update mantine monorepo to v7.14.3 Nov 28, 2024
@renovate renovate bot force-pushed the renovate/mantine-monorepo branch from 2c5ad1f to dfd7c8d Compare December 10, 2024 11:36
@renovate renovate bot changed the title Update mantine monorepo to v7.14.3 Update mantine monorepo to v7.15.0 Dec 10, 2024
@renovate renovate bot force-pushed the renovate/mantine-monorepo branch from dfd7c8d to 240a8ea Compare December 12, 2024 11:27
@renovate renovate bot changed the title Update mantine monorepo to v7.15.0 Update mantine monorepo to v7.15.1 Dec 12, 2024
@renovate renovate bot force-pushed the renovate/mantine-monorepo branch from 240a8ea to 36f9797 Compare December 23, 2024 11:02
@renovate renovate bot changed the title Update mantine monorepo to v7.15.1 Update mantine monorepo to v7.15.2 Dec 23, 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.

0 participants