+expression: "ToBTreeSet::from(extract(\"test.cjs\",\nr#\"'use client'\n\nimport type { Conditional } from 'src/types/utils'\n\nimport { DevupTheme } from '../types/theme'\n\n/**\n * Initialize the theme, if you can't use the `ThemeScript` component\n * e.g. in vite\n * @param auto - Whether to use the system theme\n * @param theme - The theme to use\n */\nexport function initTheme(\n auto?: boolean,\n theme?: Conditional<DevupTheme>,\n): void {\n if (theme) {\n document.documentElement.setAttribute('data-theme', theme)\n } else {\n console.log(\n 'hello',\n typeof process.env.DEVUP_UI_DEFAULT_THEME,\n process.env.DEVUP_UI_DEFAULT_THEME,\n localStorage.getItem('__DF_THEME_SELECTED__') ||\n (auto && window.matchMedia('(prefers-color-scheme:dark)').matches\n ? 'dark'\n : (process.env.DEVUP_UI_DEFAULT_THEME ?? 'default')),\n )\n document.documentElement.setAttribute(\n 'data-theme',\n localStorage.getItem('__DF_THEME_SELECTED__') ||\n (auto && window.matchMedia('(prefers-color-scheme:dark)').matches\n ? 'dark'\n : (process.env.DEVUP_UI_DEFAULT_THEME ?? 'default')),\n )\n }\n}\n\"#,\nExtractOption\n{ package: \"@devup-ui/react\".to_string(), css_file: None }).unwrap())"
0 commit comments