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

fix(deps): update all non-major dependencies #459

Closed
wants to merge 1 commit into from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Dec 30, 2023

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence Type Update
@mantine/core (source) ^7.3.2 -> ^7.8.0 age adoption passing confidence dependencies minor
@mantine/hooks (source) ^7.3.2 -> ^7.8.0 age adoption passing confidence dependencies minor
@mantine/modals (source) ^7.3.2 -> ^7.8.0 age adoption passing confidence dependencies minor
@mantine/notifications (source) ^7.3.2 -> ^7.8.0 age adoption passing confidence dependencies minor
@next/eslint-plugin-next (source) ^14.0.4 -> ^14.2.1 age adoption passing confidence devDependencies minor
actions/upload-artifact v4.0.0 -> v4.3.1 age adoption passing confidence action minor
chart.js (source) ^4.4.1 -> ^4.4.2 age adoption passing confidence dependencies patch
date-fns ^3.0.6 -> ^3.6.0 age adoption passing confidence dependencies minor
eslint-config-next (source) ^14.0.4 -> ^14.2.1 age adoption passing confidence devDependencies minor
eslint-plugin-prettier ^5.1.2 -> ^5.1.3 age adoption passing confidence devDependencies patch
eslint-plugin-react ^7.33.2 -> ^7.34.1 age adoption passing confidence devDependencies minor
eslint-plugin-storybook ^0.6.15 -> ^0.8.0 age adoption passing confidence devDependencies minor
i18next-resources-to-backend ^1.2.0 -> ^1.2.1 age adoption passing confidence dependencies patch
next (source) ^14.0.4 -> ^14.2.1 age adoption passing confidence dependencies minor
next-i18n-router ^5.1.0 -> ^5.4.0 age adoption passing confidence dependencies minor
node 20-alpine -> 20.12.2-alpine age adoption passing confidence final minor
prettier (source) ^3.1.1 -> ^3.2.5 age adoption passing confidence devDependencies minor
prettier-eslint ^16.2.0 -> ^16.3.0 age adoption passing confidence devDependencies minor
react-cookie (source) ^6.1.1 -> ^6.1.3 age adoption passing confidence dependencies patch
typescript (source) ^5.3.3 -> ^5.4.5 age adoption passing confidence devDependencies minor
vitest (source) ^1.1.0 -> ^1.5.0 age adoption passing confidence devDependencies minor
yup ^1.3.3 -> ^1.4.0 age adoption passing confidence dependencies minor

Release Notes

mantinedev/mantine (@​mantine/core)

v7.8.0

Compare Source

v7.7.2

Compare Source

v7.7.1

Compare Source

What's Changed
  • [@mantine/tiptap] Improve toolbar items alignment for non-native elements (#​5993)
  • [@mantine/spotlight] Fix incorrect down key handling when the spotlight is opened repeatedly (#​5995)
  • [@mantine/core] Image: Fix ref not being assigned for fallback images (#​5989)
  • [@mantine/core] PinInput: Fix incorrect focus logic (#​5963)
  • [@mantine/core] Table: Fix highlightOnHoverColor prop not working
  • [@mantine/core] AppShell: Adjust footer position to include env(safe-area-inset-bottom) (#​5502)
  • [@mantine/core] PinInput: Fix placeholder not being visible on the element that had focus when the component becomes disabled (#​5831)
  • [@mantine/dates] Calendar: Fix double timezone shift (#​5916)
  • [@mantine/hooks] use-local-storage: Fix value not being updated when key is changed (#​5910)
  • [@mantine/charts] Fix incorrect charts legends height for multiline values (#​5923)
  • [@mantine/core] NumberInput: Fix incorrect increment/decrement functions logic when step is a float value (#​5926)
  • [@mantine/core] Combobox: Fix incorrect IME input handling (#​5935)
  • [@mantine/core] Menu: Fix unexpected focus styles in the dropdown element in Firefox (#​5957)
  • [@mantine/core] Fix incorrect disabled prop handling in TagsInput and MultiSelect (#​5959)
  • [@mantine/core] Fix renderOption not working for grouped items in Combobox-based components (#​5952)
  • [@mantine/core] AppShell: Fix error when used inside Suspense (#​5979)
  • [@mantine/core] Update CSS selectors hashing algorithm to prevent collisions with other libraries (#​5968)
  • [@mantine/carousel] Fix specificity issues of some selectors (#​5973)
  • [@mantine/core] AppShell: Fix missing Aside offset in Header and Footer for layout=alt (#​5974)
New Contributors

Full Changelog: mantinedev/mantine@7.7.0...7.7.1

v7.7.0

Compare Source

View changelog with demos on mantine.dev website

Virtual colors

Virtual color is a special color which values should be different for light and dark color schemes.
To define a virtual color, use virtualColor function which accepts an object with the following
properties as a single argument:

  • name – color name, must be the same as the key in theme.colors object
  • light – a key of theme.colors object for light color scheme
  • dark – a key of theme.colors object for dark color scheme

To see the demo in action, switch between light and dark color schemes (Ctrl + J):

import { createTheme, MantineProvider, virtualColor } from '@​mantine/core';

const theme = createTheme({
  colors: {
    primary: virtualColor({
      name: 'primary',
      dark: 'pink',
      light: 'cyan',
    }),
  },
});

function App() {
  return <MantineProvider theme={theme}>{/* Your app here */}</MantineProvider>;
}
FloatingIndicator component

New FloatingIndicator component:

import { useState } from 'react';
import {
  IconArrowDown,
  IconArrowDownLeft,
  IconArrowDownRight,
  IconArrowLeft,
  IconArrowRight,
  IconArrowUp,
  IconArrowUpLeft,
  IconArrowUpRight,
  IconCircle,
} from '@&#8203;tabler/icons-react';
import { FloatingIndicator, UnstyledButton } from '@&#8203;mantine/core';
import classes from './Demo.module.css';

function Demo() {
  const [rootRef, setRootRef] = useState<HTMLDivElement | null>(null);
  const [controlsRefs, setControlsRefs] = useState<Record<string, HTMLButtonElement | null>>({});
  const [active, setActive] = useState('center');

  const setControlRef = (name: string) => (node: HTMLButtonElement) => {
    controlsRefs[name] = node;
    setControlsRefs(controlsRefs);
  };

  return (
    <div className={classes.root} dir="ltr" ref={setRootRef}>
      <FloatingIndicator
        target={controlsRefs[active]}
        parent={rootRef}
        className={classes.indicator}
      />

      <div className={classes.controlsGroup}>
        <UnstyledButton
          className={classes.control}
          onClick={() => setActive('up-left')}
          ref={setControlRef('up-left')}
          mod={{ active: active === 'up-left' }}
        >
          <IconArrowUpLeft size={26} stroke={1.5} />
        </UnstyledButton>
        <UnstyledButton
          className={classes.control}
          onClick={() => setActive('up')}
          ref={setControlRef('up')}
          mod={{ active: active === 'up' }}
        >
          <IconArrowUp size={26} stroke={1.5} />
        </UnstyledButton>
        <UnstyledButton
          className={classes.control}
          onClick={() => setActive('up-right')}
          ref={setControlRef('up-right')}
          mod={{ active: active === 'up-right' }}
        >
          <IconArrowUpRight size={26} stroke={1.5} />
        </UnstyledButton>
      </div>
      <div className={classes.controlsGroup}>
        <UnstyledButton
          className={classes.control}
          onClick={() => setActive('left')}
          ref={setControlRef('left')}
          mod={{ active: active === 'left' }}
        >
          <IconArrowLeft size={26} stroke={1.5} />
        </UnstyledButton>
        <UnstyledButton
          className={classes.control}
          onClick={() => setActive('center')}
          ref={setControlRef('center')}
          mod={{ active: active === 'center' }}
        >
          <IconCircle size={26} stroke={1.5} />
        </UnstyledButton>
        <UnstyledButton
          className={classes.control}
          onClick={() => setActive('right')}
          ref={setControlRef('right')}
          mod={{ active: active === 'right' }}
        >
          <IconArrowRight size={26} stroke={1.5} />
        </UnstyledButton>
      </div>
      <div className={classes.controlsGroup}>
        <UnstyledButton
          className={classes.control}
          onClick={() => setActive('down-left')}
          ref={setControlRef('down-left')}
          mod={{ active: active === 'down-left' }}
        >
          <IconArrowDownLeft size={26} stroke={1.5} />
        </UnstyledButton>
        <UnstyledButton
          className={classes.control}
          onClick={() => setActive('down')}
          ref={setControlRef('down')}
          mod={{ active: active === 'down' }}
        >
          <IconArrowDown size={26} stroke={1.5} />
        </UnstyledButton>
        <UnstyledButton
          className={classes.control}
          onClick={() => setActive('down-right')}
          ref={setControlRef('down-right')}
          mod={{ active: active === 'down-right' }}
        >
          <IconArrowDownRight size={26} stroke={1.5} />
        </UnstyledButton>
      </div>
    </div>
  );
}
ScatterChart component

New ScatterChart component:

import { useState } from 'react';
import {
  IconArrowDown,
  IconArrowDownLeft,
  IconArrowDownRight,
  IconArrowLeft,
  IconArrowRight,
  IconArrowUp,
  IconArrowUpLeft,
  IconArrowUpRight,
  IconCircle,
} from '@&#8203;tabler/icons-react';
import { FloatingIndicator, UnstyledButton } from '@&#8203;mantine/core';
import classes from './Demo.module.css';

function Demo() {
  const [rootRef, setRootRef] = useState<HTMLDivElement | null>(null);
  const [controlsRefs, setControlsRefs] = useState<Record<string, HTMLButtonElement | null>>({});
  const [active, setActive] = useState('center');

  const setControlRef = (name: string) => (node: HTMLButtonElement) => {
    controlsRefs[name] = node;
    setControlsRefs(controlsRefs);
  };

  return (
    <div className={classes.root} dir="ltr" ref={setRootRef}>
      <FloatingIndicator
        target={controlsRefs[active]}
        parent={rootRef}
        className={classes.indicator}
      />

      <div className={classes.controlsGroup}>
        <UnstyledButton
          className={classes.control}
          onClick={() => setActive('up-left')}
          ref={setControlRef('up-left')}
          mod={{ active: active === 'up-left' }}
        >
          <IconArrowUpLeft size={26} stroke={1.5} />
        </UnstyledButton>
        <UnstyledButton
          className={classes.control}
          onClick={() => setActive('up')}
          ref={setControlRef('up')}
          mod={{ active: active === 'up' }}
        >
          <IconArrowUp size={26} stroke={1.5} />
        </UnstyledButton>
        <UnstyledButton
          className={classes.control}
          onClick={() => setActive('up-right')}
          ref={setControlRef('up-right')}
          mod={{ active: active === 'up-right' }}
        >
          <IconArrowUpRight size={26} stroke={1.5} />
        </UnstyledButton>
      </div>
      <div className={classes.controlsGroup}>
        <UnstyledButton
          className={classes.control}
          onClick={() => setActive('left')}
          ref={setControlRef('left')}
          mod={{ active: active === 'left' }}
        >
          <IconArrowLeft size={26} stroke={1.5} />
        </UnstyledButton>
        <UnstyledButton
          className={classes.control}
          onClick={() => setActive('center')}
          ref={setControlRef('center')}
          mod={{ active: active === 'center' }}
        >
          <IconCircle size={26} stroke={1.5} />
        </UnstyledButton>
        <UnstyledButton
          className={classes.control}
          onClick={() => setActive('right')}
          ref={setControlRef('right')}
          mod={{ active: active === 'right' }}
        >
          <IconArrowRight size={26} stroke={1.5} />
        </UnstyledButton>
      </div>
      <div className={classes.controlsGroup}>
        <UnstyledButton
          className={classes.control}
          onClick={() => setActive('down-left')}
          ref={setControlRef('down-left')}
          mod={{ active: active === 'down-left' }}
        >
          <IconArrowDownLeft size={26} stroke={1.5} />
        </UnstyledButton>
        <UnstyledButton
          className={classes.control}
          onClick={() => setActive('down')}
          ref={setControlRef('down')}
          mod={{ active: active === 'down' }}
        >
          <IconArrowDown size={26} stroke={1.5} />
        </UnstyledButton>
        <UnstyledButton
          className={classes.control}
          onClick={() => setActive('down-right')}
          ref={setControlRef('down-right')}
          mod={{ active: active === 'down-right' }}
        >
          <IconArrowDownRight size={26} stroke={1.5} />
        </UnstyledButton>
      </div>
    </div>
  );
}
colorsTuple function

New colorsTuple function can be used to:

  • Use single color as the same color for all shades
  • Transform dynamic string arrays to Mantine color tuple (the array should still have 10 values)
import { colorsTuple, createTheme } from '@&#8203;mantine/core';

const theme = createTheme({
  colors: {
    custom: colorsTuple('#FFC0CB'),
    dynamic: colorsTuple(Array.from({ length: 10 }, (_, index) => '#FFC0CB')),
  },
});
use-mutation-observer hook

New useMutationObserver hook:

import { useState } from 'react';
import { Kbd, Text } from '@&#8203;mantine/core';
import { useMutationObserver } from '@&#8203;mantine/hooks';

function Demo() {
  const [lastMutation, setLastMutation] = useState('');

  useMutationObserver(
    (mutations) => {
      mutations.forEach((mutation) => {
        if (mutation.type === 'attributes' && mutation.attributeName === 'dir') {
          mutation.target instanceof HTMLElement &&
            setLastMutation(mutation.target.getAttribute('dir') || '');
        }
      });
    },
    {
      attributes: true,
      attributeFilter: ['dir'],
    },
    () => document.documentElement
  );

  return (
    <>
      <Text>
        Press <Kbd>Ctrl</Kbd> + <Kbd>Shift</Kbd> + <Kbd>L</Kbd> to change direction
      </Text>

      <Text mt={10}>Direction was changed to: {lastMutation || 'Not changed yet'}</Text>
    </>
  );
}
use-state-history hook

New useStateHistory hook:

import { Button, Code, Group, Text } from '@&#8203;mantine/core';
import { useStateHistory } from '@&#8203;mantine/hooks';

function Demo() {
  const [value, handlers, history] = useStateHistory(1);
  return (
    <>
      <Text>Current value: {value}</Text>
      <Group my="md">
        <Button onClick={() => handlers.set(Math.ceil(Math.random() * 100) + 1)}>Set value</Button>
        <Button onClick={() => handlers.back()}>Back</Button>
        <Button onClick={() => handlers.forward()}>Forward</Button>
      </Group>
      <Code block>{JSON.stringify(history, null, 2)}</Code>
    </>
  );
}
Axis labels

AreaChart, BarChart and LineChart
components now support xAxisLabel and yAxisLabel props:

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

function Demo() {
  return (
    <AreaChart
      h={300}
      data={data}
      dataKey="date"
      type="stacked"
      xAxisLabel="Date"
      yAxisLabel="Amount"
      series={[
        { name: 'Apples', color: 'indigo.6' },
        { name: 'Oranges', color: 'blue.6' },
        { name: 'Tomatoes', color: 'teal.6' },
      ]}
    />
  );
}
Documentation updates
  • New section has been added to the responsive guide on how to use mantine-hidden-from-{x} and mantine-visible-from-{x} classes.
  • Remix guide has been updated to use new Vite bundler
  • Jest and Vitest guides configuration has been updated to include mocks for window.HTMLElement.prototype.scrollIntoView
  • CSS variables documentation has been updated to include more information about typography and colors variables
Help center updates

New articles added to the help center:

Other changes
  • SegmentedControl indicator positioning logic has been migrated to FloatingIndicator. It is now more performant and works better when used inside elements with transform: scale().
  • New use-mounted hook
  • Sparkline now supports connectNulls and areaProps props
  • Remix template has been updated to use new Vite bundler
  • Select, MultiSelect, Autocomplete and TagsInput components now support scrollAreaProps prop to pass props down to the ScrollArea component in the dropdown
  • Transition component now supports 4 new transitions: fade-up, fade-down, fade-left, fade-right
  • Default Modal transition was changed to fade-down. This change resolves issues with SegmentedControl indicator positioning when used inside modals.
  • You can now reference headings font sizes and line heights in fz and lh style props with h1, h2, h3, h4, h5, h6 values

v7.6.2

Compare Source

What's Changed

  • [@mantine/hooks] use-resize-observer: Fix types (#​5847)
  • [@mantine/hooks] use-local-storage: Fix undefined being written to the local storage when defaultValue is not defined (#​5848)
  • [@mantine/core] NumberInput: Fix onValueChange not being called in increment/decrement functions (#​5856)
  • [@mantine/core] InputWrapper: Fix className specified in labelProps, descriptionProps and errorProps not being passed to the corresponding element (#​5862)
  • [@mantine/core] Fix some functions not working correctly with TypeScript 5.4 (#​5891)
  • [@mantine/form] Fix onValuesChange not using updated function (#​5901)
  • [@mantine/core] Popover: Fix incorrect dropdown selectors (#​5903)
  • [@mantine/core] Indicator: Fix processing animation in Safari (#​5908)
  • [@mantine/hooks] use-headroom: Fix incorrect pinning logic when scrolling up (#​5793)
  • [@mantine/dropzone] Add heic images format to default mime types (#​5867)
  • [@mantine/core] Transition: Fix transitions resolving instantly in some cases (#​5873)
  • [@mantine/dropzone] Add inputProps prop support to pass props down to the underlying hidden input element (#​5880)
  • [@mantine/core] Timeline: Fix autoContrast being passed to the dom node as attribute (#​5890)

New Contributors

Full Changelog: mantinedev/mantine@7.6.1...7.6.2

v7.6.1

Compare Source

What's Changed
  • [@mantine/core] Fix incorrect focus ring styles in Button.Group and ActionIcon.Group components (#​5736)
  • [@mantine/core] Progress: Fix incorrect border-radius with multiple sections
  • [@mantine/dates] DateTimePicker: Fix minDate and maxDate not being respected in time input (#​5819)
  • [@mantine/core] Switch: Use role="switch" for better accessibility (#​5746)
  • [@mantine/hooks] use-resize-observer: Fix incorrect ref type (#​5780)
  • [@mantine/dates] Fix popoverProps.onClose overriding original component value in DatePickerInput and other similar components (#​4105)
  • [@mantine/core] Fix incorrect Escape key handling in Modal and Drawer components in some cases (#​2827)
  • [@mantine/core] Combobox: Fix incorrect Escape key handling in Modal, Drawer and Popover
  • [@mantine/core] Transition: Fix transition resolving instantly in some cases (#​3126, #​5193)
  • [@mantine/core] Remove loader from the DOM if loading prop is not set on ActionIcon and Button components (#​5795)
  • [@mantine/hooks] use-local-storage: Fix inconsistent default value persistence if getInitialValueInEffect is set (#​5796)
  • [@mantine/core] Select: Fix autoComplete prop not working (#​5813)
  • [@mantine/core] Tabs: Fix incorrect border styles in outline variant
  • [@mantine/core] Checkbox: Fix incorrect indeterminate + disabled styles for outline variant (#​5806)
  • [@mantine/core] SegmentedControl: Fix indicator state not being updated correctly when controlled state changes to a value that is not present in the data array (#​5689)
  • [@mantine/core] Fix incorrect label offset with left label position in Checkbox, Switch and Radio components (#​5823)
  • [@mantine/core] PinInput: Fix updating controlled value to an empty string working incorrectly
  • [@mantine/core] Menu: Fix incorrect role of dropdown elements
New Contributors

Full Changelog: mantinedev/mantine@7.6.0...7.6.1

v7.6.0: 🌟

Compare Source

View changelog with demos on mantine.dev website

Container queries support

You can now use container queries
with Mantine components. rem and em functions from postcss-preset-mantine
are available in container queries staring from postcss-preset-mantine@1.13.0.

.root {
  min-width: rem(200px);
  max-width: 100%;
  min-height: rem(120px);
  container-type: inline-size;
  overflow: auto;
  resize: horizontal;
}

.child {
  background-color: var(--mantine-color-dimmed);
  color: var(--mantine-color-white);
  padding: var(--mantine-spacing-md);

  @&#8203;container (max-width: rem(500px)) {
    background-color: var(--mantine-color-blue-filled);
  }

  @&#8203;container (max-width: rem(300px)) {
    background-color: var(--mantine-color-red-filled);
  }
}
RadarChart component

New RadarChart component:

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

function Demo() {
  return (
    <RadarChart
      h={300}
      data={multiData}
      dataKey="product"
      withPolarRadiusAxis
      series={[
        { name: 'sales_january', color: 'lime.4', opacity: 0.1 },
        { name: 'sales_february', color: 'cyan.4', opacity: 0.1 },
      ]}
    />
  );
}
FocusTrap.InitialFocus component

FocusTrap.InitialFocus is a new component that adds a visually hidden
element which will receive the focus when the focus trap is activated.
Once FocusTrap.InitialFocus loses focus, it is removed from the tab order.

For example, it is useful if you do not want to focus any elements inside the Modal when it is opened:

import { Button, FocusTrap, Modal, TextInput } from '@&#8203;mantine/core';
import { useDisclosure } from '@&#8203;mantine/hooks';

function Demo() {
  const [opened, { open, close }] = useDisclosure(false);

  return (
    <>
      <Modal opened={opened} onClose={close} title="Focus demo">
        <FocusTrap.InitialFocus />
        <TextInput label="First input" placeholder="First input" />
        <TextInput
          data-autofocus
          label="Input with initial focus"
          placeholder="It has data-autofocus attribute"
          mt="md"
        />
      </Modal>

      <Button onClick={open}>Open modal</Button>
    </>
  );
}
New MantineProvider props

MantineProvider now includes more props to control how styles
are generated and injected. These props are useful if you use Mantine as a headless library
and in test environments.

deduplicateCssVariables

deduplicateCssVariables prop determines whether CSS variables should be deduplicated: if CSS variable has the same value as in default theme, it is not added in the runtime.
By default, it is set to true. If set to false, all Mantine CSS variables will be added in <style /> tag
even if they have the same value as in the default theme.

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

function Demo() {
  return (
    <MantineProvider deduplicateCssVariables={false}>
      <App />
    </MantineProvider>
  );
}
withStaticClasses

withStaticClasses determines whether components should have static classes, for example, mantine-Button-root.
By default, static classes are enabled, to disable them set withStaticClasses to false:

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

function Demo() {
  return (
    <MantineProvider withStaticClasses={false}>
      <App />
    </MantineProvider>
  );
}
withGlobalClasses

withGlobalClasses determines whether global classes should be added with <style /> tag.
Global classes are required for hiddenFrom/visibleFrom and lightHidden/darkHidden props to work.
By default, global classes are enabled, to disable them set withGlobalClasses to false. Note that
disabling global classes may break styles of some components.

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

function Demo() {
  return (
    <MantineProvider withGlobalClasses={false}>
      <App />
    </MantineProvider>
  );
}
HeadlessMantineProvider

HeadlessMantineProvider is an alternative to MantineProvider
that should be used when you want to use Mantine as a headless UI library. It removes all
features that are related to Mantine styles:

  • Mantine classes are not applied to components
  • Inline CSS variables are not added with style attribute
  • All color scheme related features are removed
  • Global styles are not generated

Limitations of HeadlessMantineProvider:

  • Color scheme switching will not work. If your application has a dark mode, you will need to implement it on your side.
  • Props that are related to styles in all components (color, radius, size, etc.) will have no effect.
  • Some components that rely on styles will become unusable (Grid, SimpleGrid, Container, etc.).
  • lightHidden/darkHidden, visibleFrom/hiddenFrom props will not work.
  • Style props will work only with explicit values, for example mt="xs" will not work, but mt={5} will.

To use HeadlessMantineProvider, follow getting started guide and replace MantineProvider with HeadlessMantineProvider.
Note that you do not need to use ColorSchemeScript in your application, it will not have any effect,
you can ignore this part of the guide.

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

function App() {
  return <HeadlessMantineProvider>{/* Your application */}</HeadlessMantineProvider>;
}
Sparkline trendColors

Sparkline now supports trendColors prop to change chart color depending on the trend.
The prop accepts an object with positive, negative and neutral properties:

  • positive - color for positive trend (first value is less than the last value in data array)
  • negative - color for negative trend (first value is greater than the last value in data array)
  • neutral - color for neutral trend (first and last values are equal)

neutral is optional, if not provided, the color will be the same as positive.

import { Sparkline } from '@&#8203;mantine/charts';
import { Stack, Text } from '@&#8203;mantine/core';

const positiveTrend = [10, 20, 40, 20, 40, 10, 50];
const negativeTrend = [50, 40, 20, 40, 20, 40, 10];
const neutralTrend = [10, 20, 40, 20, 40, 10, 50, 5, 10];

function Demo() {
  return (
    <Stack gap="sm">
      <Text>Positive trend:</Text>
      <Sparkline
        w={200}
        h={60}
        data={positiveTrend}
        trendColors={{ positive: 'teal.6', negative: 'red.6', neutral: 'gray.5' }}
        fillOpacity={0.2}
      />

      <Text mt="md">Negative trend:</Text>
      <Sparkline
        w={200}
        h={60}
        data={negativeTrend}
        trendColors={{ positive: 'teal.6', negative: 'red.6', neutral: 'gray.5' }}
        fillOpacity={0.2}
      />

      <Text mt="md">Neutral trend:</Text>
      <Sparkline
        w={200}
        h={60}
        data={neutralTrend}
        trendColors={{ positive: 'teal.6', negative: 'red.6', neutral: 'gray.5' }}
        fillOpacity={0.2}
      />
    </Stack>
  );
}
RichTextEditor tasks extension

RichTextEditor now supports tasks tiptap extension:

import TaskItem from '@&#8203;tiptap/extension-task-item';
import { useEditor } from '@&#8203;tiptap/react';
import StarterKit from '@&#8203;tiptap/starter-kit';
import { getTaskListExtension, RichTextEditor } from '@&#8203;mantine/tiptap';

function Demo() {
  const editor = useEditor({
    extensions: [
      StarterKit,
      getTaskListExtension(TipTapTaskList),
      TaskItem.configure({
        nested: true,
        HTMLAttributes: {
          class: 'test-item',
        },
      }),
    ],
    content: `
        <ul data-type="taskList">
          <li data-type="taskItem" data-checked="true">A list item</li>
          <li data-type="taskItem" data-checked="false">And another one</li>
        </ul>
      `,
  });

  return (
    <div style={{ padding: 40 }}>
      <RichTextEditor editor={editor}>
        <RichTextEditor.Toolbar>
          <RichTextEditor.ControlsGroup>
            <RichTextEditor.TaskList />
            <RichTextEditor.TaskListLift />
            <RichTextEditor.TaskListSink />
          </RichTextEditor.ControlsGroup>
        </RichTextEditor.Toolbar>

        <RichTextEditor.Content />
      </RichTextEditor>
    </div>
  );
}
renderOption prop

Select, MultiSelect, TagsInput and Autocomplete
components now support renderOption prop that allows to customize option rendering:

import {
  IconAlignCenter,
  IconAlignJustified,
  IconAlignLeft,
  IconAlignRight,
  IconCheck,
} from '@&#8203;tabler/icons-react';
import { Group, Select, SelectProps } from '@&#8203;mantine/core';

const iconProps = {
  stroke: 1.5,
  color: 'currentColor',
  opacity: 0.6,
  size: 18,
};

const icons: Record<string, React.ReactNode> = {
  left: <IconAlignLeft {...iconProps} />,
  center: <IconAlignCenter {...iconProps} />,
  right: <IconAlignRight {...iconProps} />,
  justify: <IconAlignJustified {...iconProps} />,
};

const renderSelectOption: SelectProps['renderOption'] = ({ option, checked }) => (
  <Group flex="1" gap="xs">
    {icons[option.value]}
    {option.label}
    {checked && <IconCheck style={{ marginInlineStart: 'auto' }} {...iconProps} />}
  </Group>
);

function Demo() {
  return (
    <Select
      label="Select with renderOption"
      placeholder="Select text align"
      data={[
        { value: 'left', label: 'Left' },
        { value: 'center', label: 'Center' },
        { value: 'right', label: 'Right' },
        { value: 'justify', label: 'Justify' },
      ]}
      renderOption={renderSelectOption}
    />
  );
}
Styles improvements

All Mantine components have been migrated to logical CSS properties
(as a replacement for rtl styles) and :where pseudo-class
(as a replacement for private CSS variables). These changes
should not impact the usage of Mantine components, but now Mantine CSS files have smaller size. For example,
@mantine/core/styles.css now has ~ 8% smaller size (192kb -> 177kb).

Pass props to inner recharts components

You can now pass props down to recharts Bar, Area and Line components
with barProps, areaProps and lineProps props on BarChart, AreaChart and LineChart components.

All props accepts either an object with props or a function that receives
series data as an argument and returns an object with props.

PieChart percent labels

PieChart now supports percent labels:

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

function Demo() {
  return (
    <BarChart
      h={200}
      data={data}
      dataKey="month"
      orientation="vertical"
      yAxisProps={{ width: 80 }}
      barProps={{ radius: 10 }}
      series={[{ name: 'Smartphones', color: 'blue.6' }]}
    />
  );
}
Documentation updates
Help center updates

New articles added to the help center:


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.

👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

Copy link

vercel bot commented Dec 30, 2023

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

Name Status Preview Comments Updated (UTC)
testaustime ❌ Failed (Inspect) Apr 14, 2024 10:13am
testaustime-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 14, 2024 10:13am

@renovate renovate bot changed the title fix(deps): update dependency react-cookie to ^6.1.2 fix(deps): update dependency react-cookie to ^6.1.3 Dec 30, 2023
@renovate renovate bot changed the title fix(deps): update dependency react-cookie to ^6.1.3 fix(deps): update all non-major dependencies Dec 31, 2023
@renovate renovate bot force-pushed the renovate/all-minor-patch branch from b2e907e to 1aefc20 Compare January 3, 2024 10:38
@renovate renovate bot force-pushed the renovate/all-minor-patch branch from 1aefc20 to a2972c7 Compare January 4, 2024 19:21
@renovate renovate bot force-pushed the renovate/all-minor-patch branch from a2972c7 to f068221 Compare January 5, 2024 10:47
@renovate renovate bot force-pushed the renovate/all-minor-patch branch from f068221 to ebfd403 Compare January 5, 2024 20:13
@renovate renovate bot force-pushed the renovate/all-minor-patch branch from ebfd403 to 4470bd2 Compare January 9, 2024 08:19
@renovate renovate bot force-pushed the renovate/all-minor-patch branch from 4470bd2 to b026a90 Compare January 9, 2024 12:11
@renovate renovate bot force-pushed the renovate/all-minor-patch branch from e55d5c3 to 35c2125 Compare April 4, 2024 20:42
@renovate renovate bot force-pushed the renovate/all-minor-patch branch from 35c2125 to 53aa56c Compare April 10, 2024 17:31
@renovate renovate bot force-pushed the renovate/all-minor-patch branch from 53aa56c to adc69cb Compare April 10, 2024 21:54
@renovate renovate bot force-pushed the renovate/all-minor-patch branch from adc69cb to 7193ad8 Compare April 11, 2024 17:30
@renovate renovate bot force-pushed the renovate/all-minor-patch branch from 7193ad8 to 704464d Compare April 11, 2024 19:23
@renovate renovate bot force-pushed the renovate/all-minor-patch branch from 704464d to 45d577b Compare April 11, 2024 23:57
@renovate renovate bot force-pushed the renovate/all-minor-patch branch from 45d577b to b997173 Compare April 12, 2024 11:40
@renovate renovate bot force-pushed the renovate/all-minor-patch branch from b997173 to 4fe3f6b Compare April 12, 2024 23:31
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.

None yet

1 participant