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..774450d --- /dev/null +++ b/package/src/ControlIcons.tsx @@ -0,0 +1,63 @@ +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 ( + + ); +} + +/** 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 { 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