This commit is contained in:
2026-03-24 18:22:47 +08:00
parent ef6fe2e16c
commit 3a7b48e483
19 changed files with 163 additions and 147 deletions

View File

@@ -1,5 +1,4 @@
import React from "react";
import { useThemeContext } from "./ThemeProvider/useThemeContext";
import { cn } from "tailwind-variants";
import type { CommonProps } from "@/common/CommonProps";
@@ -23,12 +22,8 @@ const Box = <C extends React.ElementType = "div">(
) => {
const { as: Component = "div", children, className, ...rest } = props;
const { themeClass } = useThemeContext();
if (!themeClass) {
throw new Error("Box must be used within a ThemeProvider");
}
const boxRootClass = cn(themeClass, className);
const boxRootClass = cn( className);
return (
<Component ref={ref} className={boxRootClass} {...(rest as any)}>