UNPKG

745 BJavaScriptView Raw
1'use client';
2
3import * as React from 'react';
4import ThemeProviderNoVars from "./ThemeProviderNoVars.js";
5import { CssVarsProvider } from "./ThemeProviderWithVars.js";
6import THEME_ID from "./identifier.js";
7import { jsx as _jsx } from "react/jsx-runtime";
8export default function ThemeProvider({
9 theme,
10 ...props
11}) {
12 if (typeof theme === 'function') {
13 return /*#__PURE__*/_jsx(ThemeProviderNoVars, {
14 theme: theme,
15 ...props
16 });
17 }
18 const muiTheme = THEME_ID in theme ? theme[THEME_ID] : theme;
19 if (!('colorSchemes' in muiTheme)) {
20 return /*#__PURE__*/_jsx(ThemeProviderNoVars, {
21 theme: theme,
22 ...props
23 });
24 }
25 return /*#__PURE__*/_jsx(CssVarsProvider, {
26 theme: theme,
27 ...props
28 });
29}
\No newline at end of file