Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion package/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
62 changes: 62 additions & 0 deletions package/src/ControlIcons.tsx
Original file line number Diff line number Diff line change
@@ -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<ControlIconProps>) {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
width={size}
height={size}
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth={2}
strokeLinecap="round"
strokeLinejoin="round"
>
{children}
</svg>
);
}

/** Close control — replica of `@tabler/icons-react` `IconX` */
export function IconX({ size }: ControlIconProps) {
return (
<ControlIcon size={size}>
<path d="M18 6l-12 12" />
<path d="M6 6l12 12" />
</ControlIcon>
);
}

/** Expand control — replica of `@tabler/icons-react` `IconPlus` */
export function IconPlus({ size }: ControlIconProps) {
return (
<ControlIcon size={size}>
<path d="M12 5l0 14" />
<path d="M5 12l14 0" />
</ControlIcon>
);
}

/** Collapse control — replica of `@tabler/icons-react` `IconMinus` */
export function IconMinus({ size }: ControlIconProps) {
return (
<ControlIcon size={size}>
<path d="M5 12l14 0" />
</ControlIcon>
);
}
2 changes: 1 addition & 1 deletion package/src/Window.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading