From 06107ead0598e8d297f159fea51d6069924513bc Mon Sep 17 00:00:00 2001 From: Giovambattista Fazioli Date: Fri, 3 Jul 2026 07:49:02 +0200 Subject: [PATCH 1/3] fix: inline window control icons to drop @tabler/icons-react barrel import (#39) Replace the barrel import of IconMinus/IconPlus/IconX from @tabler/icons-react with three inline SVG replicas in ControlIcons.tsx, matching Tabler's outline geometry and stroke attributes 1:1 (verified via SSR markup comparison). Also drops @tabler/icons-react from peerDependencies. This stops mantine-window from triggering the Rolldown/Vite LARGE_BARREL_MODULES optimizer warning and removes a peer dependency consumers previously had to install. --- package/package.json | 1 - package/src/ControlIcons.tsx | 62 ++++++++++++++++++++++++++++++++++++ package/src/Window.tsx | 2 +- 3 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 package/src/ControlIcons.tsx diff --git a/package/package.json b/package/package.json index ecd2dc9..96fcd0f 100644 --- a/package/package.json +++ b/package/package.json @@ -41,7 +41,6 @@ "peerDependencies": { "@mantine/core": ">=9.0.0", "@mantine/hooks": ">=9.0.0", - "@tabler/icons-react": "^3.34.0", "react": "^18.x || ^19.x", "react-dom": "^18.x || ^19.x" }, diff --git a/package/src/ControlIcons.tsx b/package/src/ControlIcons.tsx new file mode 100644 index 0000000..b30dd81 --- /dev/null +++ b/package/src/ControlIcons.tsx @@ -0,0 +1,62 @@ +import React from 'react'; + +interface ControlIconProps { + size?: number; +} + +/** + * Inline replicas of the three `@tabler/icons-react` outline icons used by the + * window controls (x, plus, minus). + * + * Inlining them removes `@tabler/icons-react` as a peer dependency and avoids + * the `LARGE_BARREL_MODULES` warning that the Rolldown/Vite dependency + * optimizer raises when it has to resolve every entry of Tabler's 6000+ + * re-export barrel module (see issue #39). Geometry and stroke attributes match + * the Tabler outline icons 1:1, so the rendered result is unchanged. + */ +function ControlIcon({ size = 24, children }: React.PropsWithChildren) { + return ( + + {children} + + ); +} + +/** Close control — replica of `@tabler/icons-react` `IconX` */ +export function IconX({ size }: ControlIconProps) { + return ( + + + + + ); +} + +/** Expand control — replica of `@tabler/icons-react` `IconPlus` */ +export function IconPlus({ size }: ControlIconProps) { + return ( + + + + + ); +} + +/** Collapse control — replica of `@tabler/icons-react` `IconMinus` */ +export function IconMinus({ size }: ControlIconProps) { + return ( + + + + ); +} diff --git a/package/src/Window.tsx b/package/src/Window.tsx index 579b6f8..e59e194 100644 --- a/package/src/Window.tsx +++ b/package/src/Window.tsx @@ -18,8 +18,8 @@ import { type MantineRadius, type MantineShadow, } from '@mantine/core'; -import { IconMinus, IconPlus, IconX } from '@tabler/icons-react'; import React from 'react'; +import { IconMinus, IconPlus, IconX } from './ControlIcons'; import { useMantineWindow } from './hooks/use-mantine-window'; import { useResponsiveValue, type ResponsiveValue } from './hooks/use-responsive-value'; import { From fcb27b13cb1de3cab475614eb3932048adfa1de7 Mon Sep 17 00:00:00 2001 From: Giovambattista Fazioli Date: Fri, 3 Jul 2026 07:51:52 +0200 Subject: [PATCH 2/3] chore: sync yarn.lock after dropping @tabler/icons-react peer dependency --- yarn.lock | 1 - 1 file changed, 1 deletion(-) diff --git a/yarn.lock b/yarn.lock index 601e716..72a9b2c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1561,7 +1561,6 @@ __metadata: peerDependencies: "@mantine/core": ">=9.0.0" "@mantine/hooks": ">=9.0.0" - "@tabler/icons-react": ^3.34.0 react: ^18.x || ^19.x react-dom: ^18.x || ^19.x languageName: unknown From 0af594be1fee029377ee7f777a2be7699145c16d Mon Sep 17 00:00:00 2001 From: Giovambattista Fazioli Date: Fri, 3 Jul 2026 07:55:26 +0200 Subject: [PATCH 3/3] fix(a11y): mark decorative control icons as aria-hidden Addresses CodeRabbit review nitpick on PR #40: the control icons are always rendered inside an ActionIcon that carries its own aria-label (Close/Collapse/Expand window), so marking the SVGs aria-hidden avoids redundant screen-reader announcements. No visual change. --- package/src/ControlIcons.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/package/src/ControlIcons.tsx b/package/src/ControlIcons.tsx index b30dd81..774450d 100644 --- a/package/src/ControlIcons.tsx +++ b/package/src/ControlIcons.tsx @@ -26,6 +26,7 @@ function ControlIcon({ size = 24, children }: React.PropsWithChildren