{"version":3,"sources":["theme-provider/theme-provider.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,YAAY,CAAC;AAC9B,OAAO,EAAqC,KAAK,EAAE,MAAM,OAAO,CAAC;AAEjE,oBAAY,kBAAkB,GAAG;IAC7B;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;CACjB,CAAC;AAEF;;;GAGG;AACH,cAAM,aAAc,SAAQ,KAAK,CAAC,SAAS,CAAC,kBAAkB,CAAC;IAC3D,MAAM,CAAC,YAAY;;MAEjB;IAEF,MAAM,CAAC,iBAAiB;;MAEtB;IAEF,eAAe;;;IAMf,MAAM;CAOT;AAED,eAAe,aAAa,CAAC","file":"theme-provider.d.ts","sourcesContent":["/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\nimport React from 'react';\nimport Type from 'prop-types';\nimport { ThemeProvider as NewThemeProvider, Theme } from '../cn';\n\nexport type ThemeProviderProps = {\n    /**\n     * Дочерний элемент `ThemeProvider`\n     */\n    children?: React.ReactNode;\n\n    /**\n     * Дополнительный класс\n     */\n    className?: string;\n\n    /**\n     * Тема компонента\n     */\n    theme?: Theme;\n};\n\n/**\n * Компонент задающий тему для своих дочерних компонентов.\n * Важно! Может содержать в себе строго один дочерний компонент.\n */\nclass ThemeProvider extends React.Component<ThemeProviderProps> {\n    static contextTypes = {\n        theme: Type.string,\n    };\n\n    static childContextTypes = {\n        theme: Type.string,\n    };\n\n    getChildContext() {\n        return {\n            theme: this.props.theme,\n        };\n    }\n\n    render() {\n        return (\n            <NewThemeProvider value={ this.props.theme }>\n                { React.Children.only(this.props.children) }\n            </NewThemeProvider>\n        );\n    }\n}\n\nexport default ThemeProvider;\n"]}