import { createComponents, } from "./createComponents";
import createMixins from "./createMixins";
import { createPalette } from "./createPalette";
import { createShadows } from "./createShadows";
import createTransitions from "./createTransitions";
import { createTypography, } from "./createTypography";
import { createZIndex } from "./createZIndex";
import createBreakpoints from "@suid/system/createTheme/createBreakpoints";
import createSpacing from "@suid/system/createTheme/createSpacing";
import createShape from "@suid/system/createTheme/shape";
export function createThemeOptions(options) {
    return options;
}
export function createTheme(input = {}) {
    const theme = {
        direction: "ltr",
        ...input,
    };
    function def(key, defaults) {
        const inputValue = input[key];
        Object.defineProperty(theme, key, {
            configurable: true,
            enumerable: true,
            ...(typeof inputValue === "function"
                ? {
                    get: inputValue,
                }
                : {
                    value: defaults({ [key]: inputValue }),
                }),
        });
    }
    def("breakpoints", (input) => createBreakpoints(input.breakpoints));
    def("components", (input) => createComponents(input.components));
    def("palette", (input) => createPalette(input.palette));
    def("shape", (input) => createShape(input.shape));
    def("spacing", (input) => createSpacing(input.spacing));
    def("typography", (input) => createTypography(input.typography));
    def("shadows", () => createShadows());
    def("transitions", () => createTransitions({}));
    def("zIndex", (input) => createZIndex(input.zIndex));
    def("mixins", () => createMixins(theme.breakpoints));
    return theme;
}
export default createTheme;
