Modal.extend() is not available at module evaluation time in the Next.js/Turbopack ESM context, causing a runtime TypeError. Define the vars resolver as a plain object in createTheme's components key.
23 lines
529 B
TypeScript
23 lines
529 B
TypeScript
import { createTheme } from "@mantine/core";
|
|
|
|
import { primaryColor } from "./theme/colors/primary";
|
|
import { secondaryColor } from "./theme/colors/secondary";
|
|
|
|
export const theme = createTheme({
|
|
colors: {
|
|
primaryColor,
|
|
secondaryColor,
|
|
},
|
|
primaryColor: "primaryColor",
|
|
components: {
|
|
Modal: {
|
|
vars: (_theme: unknown, props: { size?: string }) => {
|
|
if (props.size === "xxl") {
|
|
return { root: { "--modal-size": "75rem" } };
|
|
}
|
|
return { root: {} };
|
|
},
|
|
},
|
|
},
|
|
});
|