From 534ee5e0df77ab4ab2387463b30fa11e66a2e0e8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 10 Dec 2024 16:47:17 +0000 Subject: [PATCH] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20(deps)=20@mantine/hooks@7.?= =?UTF-8?q?15.0=20[skip=20ci]=20(#3077)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@mantine/hooks](https://mantine.dev) ([source](https://redirect.github.com/mantinedev/mantine/tree/HEAD/packages/@mantine/hooks)) | [`7.14.3` -> `7.15.0`](https://renovatebot.com/diffs/npm/@mantine%2fhooks/7.14.3/7.15.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@mantine%2fhooks/7.15.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@mantine%2fhooks/7.15.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@mantine%2fhooks/7.14.3/7.15.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@mantine%2fhooks/7.14.3/7.15.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
mantinedev/mantine (@​mantine/hooks) ### [`v7.15.0`](https://redirect.github.com/mantinedev/mantine/releases/tag/7.15.0): 💋 [Compare Source](https://redirect.github.com/mantinedev/mantine/compare/7.14.3...7.15.0) [View changelog with demos on mantine.dev website](https://mantine.dev/changelog/7-15-0) #### Support Mantine development You can now sponsor Mantine development with [OpenCollective](https://opencollective.com/mantinedev). All funds will be used to improve Mantine and create new features and components. #### use-radial-move hook New [use-radial-move](https://mantine.dev/hooks/use-radial-move) hook can be used to create custom radial sliders: ```tsx 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 (
{value}°
); } ``` #### BarChart color based on value [BarChart](https://mantine.dev/charts/bar-chart) 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). ```tsx import { BarChart } from '@​mantine/charts'; import { data } from './data'; function Demo() { return ( (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: ```tsx import { IconChevronDown, IconChevronUp } from '@​tabler/icons-react'; import { ActionIcon } from '@​mantine/core'; import { useCounter } from '@​mantine/hooks'; function Demo() { const [value, { increment, decrement }] = useCounter(135, { min: 0 }); return ( {value} ); } ``` #### Table vertical variant [Table](https://mantine.dev/core/table) component now support `variant="vertical"`: ```tsx import { Table } from '@​mantine/core'; export function Demo() { return ( Epic name 7.x migration Status Open Total issues 135 Total story points 874 Last updated at September 26, 2024 17:41:26
); } ``` #### Table tabular numbers [Table](https://mantine.dev/core/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: ```tsx import { NumberFormatter, Table } from '@​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) => ( {item.product} )); return ( Product Units sold {rows}
); } ``` #### Update function in modals manager [Modals manager](https://mantine.dev/x/modals) now supports `modals.updateModal` and `modals.updateContextModal` function to update modal after it was opened: ```tsx import { Button } from '@​mantine/core'; import { modals } from '@​mantine/modals'; function Demo() { return ( ); } ``` #### useForm submitting state [use-form](https://mantine.dev/form/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`: ```tsx import { useState } from 'react'; import { Button, Group, Stack, Text, TextInput } from '@​mantine/core'; import { useForm } from '@​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 ( Form submitted! ); } return (
); } ``` You can also manually set `form.submitting` to `true` or `false`: ```tsx import { useForm } from '@​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](https://mantine.dev/form/use-form) hook now supports `onSubmitPreventDefault` option. This option is useful if you want to integrate `useForm` hook with [server actions](https://redirect.github.com/mantinedev/mantine/issues/7142). 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 ```tsx import { useForm } from '@​mantine/form'; const form = useForm({ mode: 'uncontrolled', onSubmitPreventDefault: 'never', }); ``` #### Subtle RichTextEditor variant [RichTextEditor](https://mantine.dev/x/tiptap) component now supports `subtle` variant: ```tsx import Highlight from '@​tiptap/extension-highlight'; import Underline from '@​tiptap/extension-underline'; import { useEditor } from '@​tiptap/react'; import StarterKit from '@​tiptap/starter-kit'; import { RichTextEditor } from '@​mantine/tiptap'; const content = '

Subtle rich text editor variant

'; function Demo() { const editor = useEditor({ extensions: [StarterKit, Underline, Highlight], content, }); return ( ); } ``` #### onExitTransitionEnd and onEnterTransitionEnd [Modal](https://mantine.dev/core/modal) and [Drawer](https://mantine.dev/core/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: ```tsx import { useState } from 'react'; import { Button, Group, Modal } from '@​mantine/core'; import { useDisclosure } from '@​mantine/hooks'; function Demo() { const [firstOpened, firstHandlers] = useDisclosure(false); const [secondOpened, secondHandlers] = useDisclosure(false); const [modalData, setModalData] = useState({ title: '', message: '', }); return ( <> { firstHandlers.close(); setModalData({ title: '', message: '' }); }} title={modalData.title} > {modalData.message} setModalData({ title: '', message: '' })} title={modalData.title} > {modalData.message} ); } ``` #### Week numbers in DatePicker [DatePicker](https://mantine.dev/dates/date-picker) and other components based on Calendar component now support `withWeekNumbers` prop to display week numbers: ```tsx import { DatePicker } from '@​mantine/dates'; function Demo() { return ; } ``` #### New demo: BarChart with overlay ```tsx import { BarChart } from '@​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 ( ({ 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](https://mantine.dev/styles/variants-sizes#custom-variants-types) types augmentation guide was added to the documentation. Example of adding custom variant type to [Button](https://mantine.dev/core/button) component: ```tsx import { ButtonVariant, MantineSize } from '@​mantine/core'; type ExtendedButtonVariant = ButtonVariant | 'contrast' | 'radial-gradient'; declare module '@​mantine/core' { export interface ButtonProps { variant?: ExtendedButtonVariant; } } ``` #### Help Center updates - [How to use Mantine template on GitHub?](https://help.mantine.dev/q/templates-usage) and [How can I submit a template to Mantine documentation?](https://help.mantine.dev/q/submit-template) pages were moved from the documentation to Help Center - [How that thing is done on mantine.dev website?](https://help.mantine.dev/q/how-that-thing-is-done) question - [Why is it required to have 10 shades per color?](https://help.mantine.dev/q/ten-shades-per-color) question - [Why I see color scheme flickering on page load?](https://help.mantine.dev/q/color-scheme-flickering) question - [How can I test Modal/Drawer/Popover components?](https://help.mantine.dev/q/portals-testing) question
--- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **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. --- - [ ] If you want to rebase/retry this PR, check this box --- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- packages/design-system/package.json | 2 +- pnpm-lock.yaml | 18 +++++++++--------- sites/jerandky.com/package.json | 2 +- sites/jeromefitzgerald.com/package.json | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/design-system/package.json b/packages/design-system/package.json index 4798bbdcc..add2c5d7b 100644 --- a/packages/design-system/package.json +++ b/packages/design-system/package.json @@ -110,7 +110,7 @@ "@jeromefitz/next-config": "workspace:*", "@jeromefitz/storybook-config": "workspace:*", "@jeromefitz/tailwind-config": "workspace:*", - "@mantine/hooks": "7.14.3", + "@mantine/hooks": "7.15.0", "next": "15.0.4", "react": "19.0.0", "react-dom": "19.0.0" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 320c28820..d0213e2f8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -237,8 +237,8 @@ importers: specifier: workspace:* version: link:../tailwind-config '@mantine/hooks': - specifier: 7.14.3 - version: 7.14.3(react@19.0.0) + specifier: 7.15.0 + version: 7.15.0(react@19.0.0) next: specifier: 15.0.4 version: 15.0.4(react-dom@19.0.0(react@19.0.0))(react@19.0.0) @@ -600,8 +600,8 @@ importers: specifier: 3.0.8 version: 3.0.8(lodash@4.17.21) '@mantine/hooks': - specifier: 7.14.3 - version: 7.14.3(react@19.0.0) + specifier: 7.15.0 + version: 7.15.0(react@19.0.0) '@notionhq/client': specifier: 2.2.15 version: 2.2.15 @@ -904,8 +904,8 @@ importers: specifier: 3.0.8 version: 3.0.8(lodash@4.17.21) '@mantine/hooks': - specifier: 7.14.3 - version: 7.14.3(react@19.0.0) + specifier: 7.15.0 + version: 7.15.0(react@19.0.0) '@notionhq/client': specifier: 2.2.15 version: 2.2.15 @@ -2478,8 +2478,8 @@ packages: '@juggle/resize-observer@3.4.0': resolution: {integrity: sha512-dfLbk+PwWvFzSxwk3n5ySL0hfBog779o8h68wK/7/APo/7cgyWp5jcXockbxdk5kFRkbeXWm4Fbi9FrdN381sA==} - '@mantine/hooks@7.14.3': - resolution: {integrity: sha512-cU3R9b8GLs6aCvpsVC56ZOOJCUIoDqX3RcLWkcfpA5a47LjWa/rzegP4YWfNW6/E9vodPJT4AEbYXVffYlyNwA==} + '@mantine/hooks@7.15.0': + resolution: {integrity: sha512-AV4ItRbVIWVDzpOPyj3ICrfQq7HEdKhO7IE7xxkdbJ4oj73DAq2jFsMoNdj3dN9u2tOn1bhPBIaP+8gKd0oAcw==} peerDependencies: react: ^18.x || ^19.x @@ -11653,7 +11653,7 @@ snapshots: '@juggle/resize-observer@3.4.0': {} - '@mantine/hooks@7.14.3(react@19.0.0)': + '@mantine/hooks@7.15.0(react@19.0.0)': dependencies: react: 19.0.0 diff --git a/sites/jerandky.com/package.json b/sites/jerandky.com/package.json index a888c237d..e774a1ddf 100644 --- a/sites/jerandky.com/package.json +++ b/sites/jerandky.com/package.json @@ -41,7 +41,7 @@ "@jeromefitz/notion": "5.0.15", "@jeromefitz/spotify": "4.0.15", "@jeromefitz/utils": "3.0.8", - "@mantine/hooks": "7.14.3", + "@mantine/hooks": "7.15.0", "@notionhq/client": "2.2.15", "@radix-ui/colors": "3.0.0", "@radix-ui/react-accessible-icon": "1.1.0", diff --git a/sites/jeromefitzgerald.com/package.json b/sites/jeromefitzgerald.com/package.json index 655c267c0..fe6b65606 100644 --- a/sites/jeromefitzgerald.com/package.json +++ b/sites/jeromefitzgerald.com/package.json @@ -45,7 +45,7 @@ "@jeromefitz/notion": "5.0.15", "@jeromefitz/spotify": "4.0.15", "@jeromefitz/utils": "3.0.8", - "@mantine/hooks": "7.14.3", + "@mantine/hooks": "7.15.0", "@notionhq/client": "2.2.15", "@radix-ui/colors": "3.0.0", "@radix-ui/react-accessible-icon": "1.1.0",