From afb82ca8a1c8b364f96cee4d25ddd8fddc905dd9 Mon Sep 17 00:00:00 2001 From: Kenzo Wada <79452224+Kenzo-Wada@users.noreply.github.com> Date: Wed, 25 Sep 2024 22:14:07 +0900 Subject: [PATCH 01/10] [@mantine/chart] BarChart: Fix BarLabel logging errors in the console (#6810) * [@mantine/chart] fix: console error of barlabel * fix: fix confict issue --- packages/@mantine/charts/src/BarChart/BarChart.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/@mantine/charts/src/BarChart/BarChart.tsx b/packages/@mantine/charts/src/BarChart/BarChart.tsx index 367e0ef2834..1bc4ab4350a 100644 --- a/packages/@mantine/charts/src/BarChart/BarChart.tsx +++ b/packages/@mantine/charts/src/BarChart/BarChart.tsx @@ -123,7 +123,13 @@ const varsResolver = createVarsResolver( }) ); -export function BarLabel({ value, valueFormatter, ...others }: Record) { +export function BarLabel({ + value, + valueFormatter, + textBreakAll, + parentViewBox, + ...others +}: Record) { return ( Date: Wed, 25 Sep 2024 23:22:30 +0900 Subject: [PATCH 02/10] [@mantine/form] Fix indices over 9 not working in form paths in some cases (#6794) --- .../@mantine/form/src/validate/should-validate-on-change.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@mantine/form/src/validate/should-validate-on-change.ts b/packages/@mantine/form/src/validate/should-validate-on-change.ts index 0e77c76d0d0..f9110ad3760 100644 --- a/packages/@mantine/form/src/validate/should-validate-on-change.ts +++ b/packages/@mantine/form/src/validate/should-validate-on-change.ts @@ -10,7 +10,7 @@ export function shouldValidateOnChange(path: unknown, validateInputOnChange: boo } if (Array.isArray(validateInputOnChange)) { - return validateInputOnChange.includes((path as string).replace(/[.][0-9]/g, `.${FORM_INDEX}`)); + return validateInputOnChange.includes((path as string).replace(/[.][0-9]+/g, `.${FORM_INDEX}`)); } return false; From 27fb837622e45611bb65f5ffb30e45b0652520de Mon Sep 17 00:00:00 2001 From: Kenzo Wada <79452224+Kenzo-Wada@users.noreply.github.com> Date: Wed, 25 Sep 2024 23:23:10 +0900 Subject: [PATCH 03/10] [mantine.dev] Fix tiptap installation instructions (#6807) --- .../src/components/MdxProvider/MdxPackagesInstallation/data.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/mantine.dev/src/components/MdxProvider/MdxPackagesInstallation/data.ts b/apps/mantine.dev/src/components/MdxProvider/MdxPackagesInstallation/data.ts index c6b204dbab6..9fec840ac9e 100644 --- a/apps/mantine.dev/src/components/MdxProvider/MdxPackagesInstallation/data.ts +++ b/apps/mantine.dev/src/components/MdxProvider/MdxPackagesInstallation/data.ts @@ -41,7 +41,7 @@ export const PACKAGES_DATA = [ '@mantine/hooks', '@mantine/core', '@mantine/tiptap', - '@tabler/icons-react', + '@tiptap/pm', '@tiptap/react', '@tiptap/extension-link', '@tiptap/starter-kit', From d9994f5b4273500ff6abc38f09f7e787594b8d59 Mon Sep 17 00:00:00 2001 From: Kenzo Wada <79452224+Kenzo-Wada@users.noreply.github.com> Date: Wed, 25 Sep 2024 23:24:07 +0900 Subject: [PATCH 04/10] [mantine.dev] Remove unused placeholder from the TimeInput demo (#6793) * [@mantine/date] remove placeholder from TimeInput props * [@mantine/date] add placeholder to Timeinput Props --- .../src/demos/dates/TimeInput/TimeInput.demo.configurator.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/@docs/demos/src/demos/dates/TimeInput/TimeInput.demo.configurator.tsx b/packages/@docs/demos/src/demos/dates/TimeInput/TimeInput.demo.configurator.tsx index 3e9a979fb52..dc0eddf8cdd 100644 --- a/packages/@docs/demos/src/demos/dates/TimeInput/TimeInput.demo.configurator.tsx +++ b/packages/@docs/demos/src/demos/dates/TimeInput/TimeInput.demo.configurator.tsx @@ -10,14 +10,13 @@ function Demo() { return ( ); } `; function Wrapper(props: any) { - return ; + return ; } export const configurator: MantineDemo = { From 2ee78ab29e164eb13bbdde98604d4b018261231e Mon Sep 17 00:00:00 2001 From: Griffin Jones <62632538+Jones-Griffin@users.noreply.github.com> Date: Wed, 25 Sep 2024 22:33:52 +0800 Subject: [PATCH 05/10] [@mantine/chart] Fix incorrect types for props passed down to recharts components (#6820) * fix: chart props to take partials * fix: linting --------- Co-authored-by: Vitaly Rtishchev --- packages/@mantine/charts/src/BubbleChart/BubbleChart.tsx | 2 +- packages/@mantine/charts/src/DonutChart/DonutChart.tsx | 2 +- packages/@mantine/charts/src/PieChart/PieChart.tsx | 2 +- packages/@mantine/charts/src/RadarChart/RadarChart.tsx | 4 +++- packages/@mantine/charts/src/ScatterChart/ScatterChart.tsx | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/@mantine/charts/src/BubbleChart/BubbleChart.tsx b/packages/@mantine/charts/src/BubbleChart/BubbleChart.tsx index 209f0245a9e..1aefdf1268c 100644 --- a/packages/@mantine/charts/src/BubbleChart/BubbleChart.tsx +++ b/packages/@mantine/charts/src/BubbleChart/BubbleChart.tsx @@ -107,7 +107,7 @@ export interface BubbleChartProps tooltipProps?: Omit, 'ref'>; /** Props passed down to the `Scatter` component */ - scatterProps?: Omit; + scatterProps?: Partial>; /** Color of the text displayed inside the chart, `'dimmed'` by default */ textColor?: MantineColor; diff --git a/packages/@mantine/charts/src/DonutChart/DonutChart.tsx b/packages/@mantine/charts/src/DonutChart/DonutChart.tsx index 5340a46c5f2..dd8279b058e 100644 --- a/packages/@mantine/charts/src/DonutChart/DonutChart.tsx +++ b/packages/@mantine/charts/src/DonutChart/DonutChart.tsx @@ -54,7 +54,7 @@ export interface DonutChartProps tooltipProps?: Omit, 'ref'>; /** Props passed down to recharts `Pie` component */ - pieProps?: Omit; + pieProps?: Partial>; /** Controls color of the segments stroke, by default depends on color scheme */ strokeColor?: MantineColor; diff --git a/packages/@mantine/charts/src/PieChart/PieChart.tsx b/packages/@mantine/charts/src/PieChart/PieChart.tsx index 8b555738d8f..2dc8211cf20 100644 --- a/packages/@mantine/charts/src/PieChart/PieChart.tsx +++ b/packages/@mantine/charts/src/PieChart/PieChart.tsx @@ -56,7 +56,7 @@ export interface PieChartProps tooltipProps?: Omit, 'ref'>; /** Props passed down to recharts `Pie` component */ - pieProps?: Omit; + pieProps?: Partial>; /** Controls color of the segments stroke, by default depends on color scheme */ strokeColor?: MantineColor; diff --git a/packages/@mantine/charts/src/RadarChart/RadarChart.tsx b/packages/@mantine/charts/src/RadarChart/RadarChart.tsx index 3b129781601..bdc85328a0f 100644 --- a/packages/@mantine/charts/src/RadarChart/RadarChart.tsx +++ b/packages/@mantine/charts/src/RadarChart/RadarChart.tsx @@ -72,7 +72,9 @@ export interface RadarChartProps withPolarRadiusAxis?: boolean; /** Props passed down to recharts Radar component */ - radarProps?: ((series: RadarChartSeries) => Omit) | Omit; + radarProps?: + | ((series: RadarChartSeries) => Partial>) + | Partial>; /** Props passed down to recharts RadarChart component */ radarChartProps?: React.ComponentPropsWithoutRef; diff --git a/packages/@mantine/charts/src/ScatterChart/ScatterChart.tsx b/packages/@mantine/charts/src/ScatterChart/ScatterChart.tsx index 10d45848288..ca6e9e3de9d 100644 --- a/packages/@mantine/charts/src/ScatterChart/ScatterChart.tsx +++ b/packages/@mantine/charts/src/ScatterChart/ScatterChart.tsx @@ -75,7 +75,7 @@ export interface ScatterChartProps scatterChartProps?: React.ComponentPropsWithoutRef; /** Props passed down to recharts `Scatter` component */ - scatterProps?: Omit; + scatterProps?: Partial>; /** If set, displays labels next to points for the given axis */ pointLabels?: 'x' | 'y'; From 5896d46b6d77aa7745685f5ed646e77dba9d6391 Mon Sep 17 00:00:00 2001 From: zrll_ <46812903+zrll12@users.noreply.github.com> Date: Wed, 25 Sep 2024 22:35:00 +0800 Subject: [PATCH 06/10] [@mantine/core] ScrollArea: Fix `onTopReached` prop not being passed down in ScrollArea.Autosize component (#6747) --- packages/@mantine/core/src/components/ScrollArea/ScrollArea.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/@mantine/core/src/components/ScrollArea/ScrollArea.tsx b/packages/@mantine/core/src/components/ScrollArea/ScrollArea.tsx index e27df973070..34d916009aa 100644 --- a/packages/@mantine/core/src/components/ScrollArea/ScrollArea.tsx +++ b/packages/@mantine/core/src/components/ScrollArea/ScrollArea.tsx @@ -213,6 +213,7 @@ export const ScrollAreaAutosize = factory((props, ref) => { style, vars, onBottomReached, + onTopReached, ...others } = useProps('ScrollAreaAutosize', defaultProps, props); @@ -235,6 +236,7 @@ export const ScrollAreaAutosize = factory((props, ref) => { vars={vars} scrollbars={scrollbars} onBottomReached={onBottomReached} + onTopReached={onTopReached} > {children} From 16c4d9c86c01f13c2a986dfd8c150169d3844b6a Mon Sep 17 00:00:00 2001 From: Adham Moussa Date: Wed, 25 Sep 2024 18:36:03 +0400 Subject: [PATCH 07/10] [@mantine/hooks] use-state-history: Add `reset` handler support (#6769) * support useStateHistory reset * add test and fix lint errors * update docs --- .../mantine.dev/src/pages/hooks/use-state-history.mdx | 1 + .../src/demos/hooks/use-state-history.demo.usage.tsx | 2 ++ .../src/use-state-history/use-state-history.test.ts | 11 +++++++++++ .../hooks/src/use-state-history/use-state-history.ts | 7 ++++++- 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/apps/mantine.dev/src/pages/hooks/use-state-history.mdx b/apps/mantine.dev/src/pages/hooks/use-state-history.mdx index 29fc8cb74d3..4f13e005351 100644 --- a/apps/mantine.dev/src/pages/hooks/use-state-history.mdx +++ b/apps/mantine.dev/src/pages/hooks/use-state-history.mdx @@ -21,6 +21,7 @@ interface UseStateHistoryHandlers { set: (value: T) => void; back: (steps?: number) => void; forward: (steps?: number) => void; + reset: () => void; } interface StateHistory { diff --git a/packages/@docs/demos/src/demos/hooks/use-state-history.demo.usage.tsx b/packages/@docs/demos/src/demos/hooks/use-state-history.demo.usage.tsx index 09f550410be..1ddef192b89 100644 --- a/packages/@docs/demos/src/demos/hooks/use-state-history.demo.usage.tsx +++ b/packages/@docs/demos/src/demos/hooks/use-state-history.demo.usage.tsx @@ -15,6 +15,7 @@ function Demo() { + {JSON.stringify(history, null, 2)} @@ -31,6 +32,7 @@ function Demo() { + {JSON.stringify(history, null, 2)} diff --git a/packages/@mantine/hooks/src/use-state-history/use-state-history.test.ts b/packages/@mantine/hooks/src/use-state-history/use-state-history.test.ts index c2bec81a7a7..258456a59e9 100644 --- a/packages/@mantine/hooks/src/use-state-history/use-state-history.test.ts +++ b/packages/@mantine/hooks/src/use-state-history/use-state-history.test.ts @@ -83,4 +83,15 @@ describe('@mantine/hooks/use-state-history', () => { expect(hook.result.current[0]).toBe(5); expect(hook.result.current[2]).toStrictEqual({ history: [1, 5], current: 1 }); }); + + it('resets history', () => { + const hook = renderHook(() => useStateHistory(1)); + act(() => hook.result.current[1].set(2)); + act(() => hook.result.current[1].set(3)); + act(() => hook.result.current[1].set(4)); + act(() => hook.result.current[1].reset()); + + expect(hook.result.current[0]).toBe(1); + expect(hook.result.current[2]).toStrictEqual({ history: [1], current: 0 }); + }); }); diff --git a/packages/@mantine/hooks/src/use-state-history/use-state-history.ts b/packages/@mantine/hooks/src/use-state-history/use-state-history.ts index 408e39edf7e..36de0ecaa65 100644 --- a/packages/@mantine/hooks/src/use-state-history/use-state-history.ts +++ b/packages/@mantine/hooks/src/use-state-history/use-state-history.ts @@ -4,6 +4,7 @@ export interface UseStateHistoryHandlers { set: (value: T) => void; back: (steps?: number) => void; forward: (steps?: number) => void; + reset: () => void; } export interface StateHistory { @@ -49,7 +50,11 @@ export function useStateHistory( [] ); - const handlers = useMemo(() => ({ set, forward, back }), []); + const reset = useCallback(() => { + setState({ history: [initialValue], current: 0 }); + }, [initialValue]); + + const handlers = useMemo(() => ({ back, forward, reset, set }), [back, forward, reset, set]); return [state.history[state.current], handlers, state]; } From 219878dd4fc2ff68bfefe309a46234b62425b525 Mon Sep 17 00:00:00 2001 From: Kenzo Wada <79452224+Kenzo-Wada@users.noreply.github.com> Date: Wed, 25 Sep 2024 23:36:48 +0900 Subject: [PATCH 08/10] [mantine.dev] Update Twitter to X (#6801) --- README.md | 4 ++-- apps/help.mantine.dev/src/pages/q/roadmap.mdx | 2 +- apps/mantine.dev/src/components/Footer/data.ts | 2 +- apps/mantine.dev/src/pages/contribute.mdx | 2 +- .../src/demos/core/HoverCard/HoverCard.demo.profile.tsx | 9 ++------- .../demos/src/demos/hooks/use-favicon.demo.usage.tsx | 8 ++++---- packages/@mantinex/mantine-meta/src/meta.ts | 2 +- 7 files changed, 12 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 537ee671859..9ce1b30f6dc 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![npm](https://img.shields.io/npm/dm/@mantine/hooks)](https://www.npmjs.com/package/@mantine/hooks) [![Help wanted](https://img.shields.io/github/labels/mantinedev/mantine/help%20wanted?label=Contribute)](https://github.com/mantinedev/mantine/labels/help%20wanted) [![Discord](https://img.shields.io/badge/Chat%20on-Discord-%235865f2)](https://discord.gg/wbH82zuWMN) -[![Twitter Follow](https://img.shields.io/twitter/follow/mantinedev?style=social)](https://twitter.com/mantinedev) +[![X Follow](https://img.shields.io/twitter/follow/mantinedev?style=social)](https://x.com/mantinedev) ## Links @@ -14,7 +14,7 @@ - [Contribute](https://mantine.dev/contribute) - [Ask question or give feedback](https://github.com/mantinedev/mantine/discussions) - [Changelog](https://mantine.dev/changelog/all-releases) -- [Follow on Twitter](https://twitter.com/mantinedev) +- [Follow on X](https://x.com/mantinedev) - [Join Discord community](https://discord.gg/wbH82zuWMN) ## Packages diff --git a/apps/help.mantine.dev/src/pages/q/roadmap.mdx b/apps/help.mantine.dev/src/pages/q/roadmap.mdx index c110f7bf4c4..4c9fe8b0bdd 100644 --- a/apps/help.mantine.dev/src/pages/q/roadmap.mdx +++ b/apps/help.mantine.dev/src/pages/q/roadmap.mdx @@ -22,7 +22,7 @@ We are constantly working on improving Mantine and adding new features, but we d ## How can I know what is coming next? -New features are usually announced in the [Discord server](https://discord.gg/wbH82zuWMN) and on [Twitter](https://twitter.com/mantinedev) +New features are usually announced in the [Discord server](https://discord.gg/wbH82zuWMN) and on [X](https://x.com/mantinedev) when they are released. Upcoming features are usually discussed with the community on [Discord](https://discord.gg/wbH82zuWMN). ## When will the next version be released? diff --git a/apps/mantine.dev/src/components/Footer/data.ts b/apps/mantine.dev/src/components/Footer/data.ts index 158da087901..ffd69c0d9ef 100644 --- a/apps/mantine.dev/src/components/Footer/data.ts +++ b/apps/mantine.dev/src/components/Footer/data.ts @@ -16,7 +16,7 @@ export const FOOTER_LINKS_DATA: LinksGroupProps[] = [ title: 'Community', data: [ { type: 'link', label: 'Chat on Discord', link: meta.discordLink }, - { type: 'link', label: 'Follow on Twitter', link: meta.twitterLink }, + { type: 'link', label: 'Follow on X', link: meta.twitterLink }, { type: 'link', label: 'Follow on Github', link: 'https://github.com/rtivital' }, { type: 'link', diff --git a/apps/mantine.dev/src/pages/contribute.mdx b/apps/mantine.dev/src/pages/contribute.mdx index ba66495d675..1db7facb598 100644 --- a/apps/mantine.dev/src/pages/contribute.mdx +++ b/apps/mantine.dev/src/pages/contribute.mdx @@ -11,7 +11,7 @@ First of all, thank you for showing interest in contributing to Mantine! All you - **Improve documentation:** Fix incomplete or missing docs, bad wording, examples or explanations. - **Give feedback:** We are constantly working on making Mantine better. Please share how you use Mantine, what features are missing and what is done well via [GitHub Discussions](https://github.com/mantinedev/mantine/discussions/new) or [Discord](https://discord.gg/wbH82zuWMN). -- **Share Mantine:** Share links to the Mantine docs with everyone who might be interested! [Share Mantine on Twitter here](https://twitter.com/intent/tweet?text=Mantine%20%E2%80%93%20new%20React%20library%20with%20100%2B%20components%20and%20hooks.%20It%20has%20native%20dark%20theme%20support%20and%20focuses%20on%20accessibility%20and%20usability.%0A%0Ahttp%3A%2F%2Fmantine.dev%0A%0A%23reactjs%20). +- **Share Mantine:** Share links to the Mantine docs with everyone who might be interested! [Share Mantine on X here](https://x.com/intent/tweet?text=Mantine%20%E2%80%93%20new%20React%20library%20with%20100%2B%20components%20and%20hooks.%20It%20has%20native%20dark%20theme%20support%20and%20focuses%20on%20accessibility%20and%20usability.%0A%0Ahttp%3A%2F%2Fmantine.dev%0A%0A%23reactjs%20). - **Contribute to the codebase:** Propose new features via [GitHub Issues](https://github.com/mantinedev/mantine/issues/new), or find an [existing issue](https://github.com/mantinedev/mantine/labels/help%20wanted) that you are interested in and work on it! - **Give us a code review:** Help us identify problems with the [source code](https://github.com/mantinedev/mantine/tree/master/packages) or make Mantine more performant. diff --git a/packages/@docs/demos/src/demos/core/HoverCard/HoverCard.demo.profile.tsx b/packages/@docs/demos/src/demos/core/HoverCard/HoverCard.demo.profile.tsx index 741f438f39c..edd23b30a10 100644 --- a/packages/@docs/demos/src/demos/core/HoverCard/HoverCard.demo.profile.tsx +++ b/packages/@docs/demos/src/demos/core/HoverCard/HoverCard.demo.profile.tsx @@ -19,7 +19,7 @@ function Demo() { Mantine Mantine - + @mantinedev diff --git a/packages/@docs/demos/src/demos/hooks/use-favicon.demo.usage.tsx b/packages/@docs/demos/src/demos/hooks/use-favicon.demo.usage.tsx index ccb643b3625..d6cdf2f7268 100644 --- a/packages/@docs/demos/src/demos/hooks/use-favicon.demo.usage.tsx +++ b/packages/@docs/demos/src/demos/hooks/use-favicon.demo.usage.tsx @@ -10,14 +10,14 @@ import { Group, Button } from '@mantine/core'; function Demo() { const [favicon, setFavicon] = useState('https://mantine.dev/favicon.svg'); - const setTwitterFavicon = () => setFavicon('https://twitter.com/favicon.ico'); + const setXFavicon = () => setFavicon('https://x.com/favicon.ico'); const setMantineFavicon = () => setFavicon('https://mantine.dev/favicon.svg'); useFavicon(favicon); return ( - + ); @@ -26,14 +26,14 @@ function Demo() { function Demo() { const [favicon, setFavicon] = useState('https://mantine.dev/favicon.svg'); - const setTwitterFavicon = () => setFavicon('https://twitter.com/favicon.ico'); + const setXFavicon = () => setFavicon('https://x.com/favicon.ico'); const setMantineFavicon = () => setFavicon('https://mantine.dev/favicon.svg'); useFavicon(favicon); return ( - + ); diff --git a/packages/@mantinex/mantine-meta/src/meta.ts b/packages/@mantinex/mantine-meta/src/meta.ts index 698bdaf1606..96b79da68d8 100644 --- a/packages/@mantinex/mantine-meta/src/meta.ts +++ b/packages/@mantinex/mantine-meta/src/meta.ts @@ -3,7 +3,7 @@ export const meta = { uiLink: 'https://ui.mantine.dev/', discordLink: 'https://discord.gg/wbH82zuWMN', - twitterLink: 'https://twitter.com/mantinedev', + twitterLink: 'https://x.com/mantinedev', npmLink: 'https://www.npmjs.com/org/mantine', From b4f9628b7871b47aae81d2467d6ef0a800725e42 Mon Sep 17 00:00:00 2001 From: Kenzo Wada <79452224+Kenzo-Wada@users.noreply.github.com> Date: Wed, 25 Sep 2024 23:37:21 +0900 Subject: [PATCH 09/10] [core] Update Next.js (#6856) * [mantine.dev] chore: update next for vulnerability * chore: fix syncpack --- apps/help.mantine.dev/package.json | 2 +- apps/mantine.dev/package.json | 2 +- yarn.lock | 94 +++++++++++++++--------------- 3 files changed, 49 insertions(+), 49 deletions(-) diff --git a/apps/help.mantine.dev/package.json b/apps/help.mantine.dev/package.json index dfeed7aa4f7..830b75cf0fa 100644 --- a/apps/help.mantine.dev/package.json +++ b/apps/help.mantine.dev/package.json @@ -26,7 +26,7 @@ "@tabler/icons-react": "^3.3.0", "dayjs": "^1.11.10", "fuse.js": "7.0.0", - "next": "14.2.3", + "next": "14.2.12", "react": "^18.3.1", "react-dom": "^18.3.1", "react-imask": "^7.1.3", diff --git a/apps/mantine.dev/package.json b/apps/mantine.dev/package.json index 131769205f7..566315a3336 100644 --- a/apps/mantine.dev/package.json +++ b/apps/mantine.dev/package.json @@ -67,7 +67,7 @@ "github-slugger": "^2.0.0", "highlight.js": "^11.9.0", "lowlight": "^3.1.0", - "next": "14.2.3", + "next": "14.2.12", "next-sitemap": "^4.2.3", "react": "^18.3.1", "react-dom": "^18.3.1", diff --git a/yarn.lock b/yarn.lock index 57b0039131b..963441d249e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5813,10 +5813,10 @@ __metadata: languageName: node linkType: hard -"@next/env@npm:14.2.3": - version: 14.2.3 - resolution: "@next/env@npm:14.2.3" - checksum: 10c0/25ab3ac2739c8e5ce35e1f50373238c5c428ab6b01d448ba78a6068dcdef88978b64f9a92790c324b2926ccc41390a67107154a0b0fee32fe980a485f4ef20d8 +"@next/env@npm:14.2.12": + version: 14.2.12 + resolution: "@next/env@npm:14.2.12" + checksum: 10c0/fd9b3da4e530487bc12bb4e64bf910e7017763a447939f3c116b4208f111646452a9ded283ed7032d85217fa657aed71f98e9fc89409346d1fd51a59549a7a00 languageName: node linkType: hard @@ -5844,65 +5844,65 @@ __metadata: languageName: node linkType: hard -"@next/swc-darwin-arm64@npm:14.2.3": - version: 14.2.3 - resolution: "@next/swc-darwin-arm64@npm:14.2.3" +"@next/swc-darwin-arm64@npm:14.2.12": + version: 14.2.12 + resolution: "@next/swc-darwin-arm64@npm:14.2.12" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@next/swc-darwin-x64@npm:14.2.3": - version: 14.2.3 - resolution: "@next/swc-darwin-x64@npm:14.2.3" +"@next/swc-darwin-x64@npm:14.2.12": + version: 14.2.12 + resolution: "@next/swc-darwin-x64@npm:14.2.12" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@next/swc-linux-arm64-gnu@npm:14.2.3": - version: 14.2.3 - resolution: "@next/swc-linux-arm64-gnu@npm:14.2.3" +"@next/swc-linux-arm64-gnu@npm:14.2.12": + version: 14.2.12 + resolution: "@next/swc-linux-arm64-gnu@npm:14.2.12" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@next/swc-linux-arm64-musl@npm:14.2.3": - version: 14.2.3 - resolution: "@next/swc-linux-arm64-musl@npm:14.2.3" +"@next/swc-linux-arm64-musl@npm:14.2.12": + version: 14.2.12 + resolution: "@next/swc-linux-arm64-musl@npm:14.2.12" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@next/swc-linux-x64-gnu@npm:14.2.3": - version: 14.2.3 - resolution: "@next/swc-linux-x64-gnu@npm:14.2.3" +"@next/swc-linux-x64-gnu@npm:14.2.12": + version: 14.2.12 + resolution: "@next/swc-linux-x64-gnu@npm:14.2.12" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@next/swc-linux-x64-musl@npm:14.2.3": - version: 14.2.3 - resolution: "@next/swc-linux-x64-musl@npm:14.2.3" +"@next/swc-linux-x64-musl@npm:14.2.12": + version: 14.2.12 + resolution: "@next/swc-linux-x64-musl@npm:14.2.12" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@next/swc-win32-arm64-msvc@npm:14.2.3": - version: 14.2.3 - resolution: "@next/swc-win32-arm64-msvc@npm:14.2.3" +"@next/swc-win32-arm64-msvc@npm:14.2.12": + version: 14.2.12 + resolution: "@next/swc-win32-arm64-msvc@npm:14.2.12" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@next/swc-win32-ia32-msvc@npm:14.2.3": - version: 14.2.3 - resolution: "@next/swc-win32-ia32-msvc@npm:14.2.3" +"@next/swc-win32-ia32-msvc@npm:14.2.12": + version: 14.2.12 + resolution: "@next/swc-win32-ia32-msvc@npm:14.2.12" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@next/swc-win32-x64-msvc@npm:14.2.3": - version: 14.2.3 - resolution: "@next/swc-win32-x64-msvc@npm:14.2.3" +"@next/swc-win32-x64-msvc@npm:14.2.12": + version: 14.2.12 + resolution: "@next/swc-win32-x64-msvc@npm:14.2.12" conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -12138,7 +12138,7 @@ __metadata: github-slugger: "npm:^2.0.0" highlight.js: "npm:^11.9.0" lowlight: "npm:^3.1.0" - next: "npm:14.2.3" + next: "npm:14.2.12" next-sitemap: "npm:^4.2.3" react: "npm:^18.3.1" react-dom: "npm:^18.3.1" @@ -15112,7 +15112,7 @@ __metadata: "@types/react-dom": "npm:18.2.15" dayjs: "npm:^1.11.10" fuse.js: "npm:7.0.0" - next: "npm:14.2.3" + next: "npm:14.2.12" react: "npm:^18.3.1" react-dom: "npm:^18.3.1" react-imask: "npm:^7.1.3" @@ -19104,20 +19104,20 @@ __metadata: languageName: node linkType: hard -"next@npm:14.2.3": - version: 14.2.3 - resolution: "next@npm:14.2.3" +"next@npm:14.2.12": + version: 14.2.12 + resolution: "next@npm:14.2.12" dependencies: - "@next/env": "npm:14.2.3" - "@next/swc-darwin-arm64": "npm:14.2.3" - "@next/swc-darwin-x64": "npm:14.2.3" - "@next/swc-linux-arm64-gnu": "npm:14.2.3" - "@next/swc-linux-arm64-musl": "npm:14.2.3" - "@next/swc-linux-x64-gnu": "npm:14.2.3" - "@next/swc-linux-x64-musl": "npm:14.2.3" - "@next/swc-win32-arm64-msvc": "npm:14.2.3" - "@next/swc-win32-ia32-msvc": "npm:14.2.3" - "@next/swc-win32-x64-msvc": "npm:14.2.3" + "@next/env": "npm:14.2.12" + "@next/swc-darwin-arm64": "npm:14.2.12" + "@next/swc-darwin-x64": "npm:14.2.12" + "@next/swc-linux-arm64-gnu": "npm:14.2.12" + "@next/swc-linux-arm64-musl": "npm:14.2.12" + "@next/swc-linux-x64-gnu": "npm:14.2.12" + "@next/swc-linux-x64-musl": "npm:14.2.12" + "@next/swc-win32-arm64-msvc": "npm:14.2.12" + "@next/swc-win32-ia32-msvc": "npm:14.2.12" + "@next/swc-win32-x64-msvc": "npm:14.2.12" "@swc/helpers": "npm:0.5.5" busboy: "npm:1.6.0" caniuse-lite: "npm:^1.0.30001579" @@ -19158,7 +19158,7 @@ __metadata: optional: true bin: next: dist/bin/next - checksum: 10c0/2c409154720846d07a7a995cc3bfba24b9ee73c87360ce3266528c8a217f5f1ab6f916cffbe1be83509b4e8d7b1d713921bb5c69338b4ecaa57df3212f79a8c5 + checksum: 10c0/3ec6bb480c2f3ab41e6ea06f5d151961a841b7c8436d3a0142a294b644668df96a0b209b810d2954ec800e8fc33e8f8c7b77a92aea6e32b02e4935135b5201ec languageName: node linkType: hard From 81440bc2ccb1906cdbc24088eb8705d6dee3712c Mon Sep 17 00:00:00 2001 From: Kenzo Wada <79452224+Kenzo-Wada@users.noreply.github.com> Date: Wed, 25 Sep 2024 23:37:59 +0900 Subject: [PATCH 10/10] [@mantine/core] PinInput: Fix incorrect `Backspace` key handling on the first input (#6880) --- .../core/src/components/PinInput/PinInput.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/@mantine/core/src/components/PinInput/PinInput.tsx b/packages/@mantine/core/src/components/PinInput/PinInput.tsx index dcc667a6900..5dc907eb259 100644 --- a/packages/@mantine/core/src/components/PinInput/PinInput.tsx +++ b/packages/@mantine/core/src/components/PinInput/PinInput.tsx @@ -310,13 +310,15 @@ export const PinInput = factory((props, ref) => { } else if (key === 'Delete') { setFieldValue('', index); } else if (key === 'Backspace') { - setFieldValue('', index); - if (length === index + 1) { - if ((event.target as HTMLInputElement).value === '') { + if (index !== 0) { + setFieldValue('', index); + if (length === index + 1) { + if ((event.target as HTMLInputElement).value === '') { + focusInputField('prev', index, event); + } + } else { focusInputField('prev', index, event); } - } else { - focusInputField('prev', index, event); } } else if (inputValue.length > 0 && key === _value[index]) { focusInputField('next', index, event);