define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Theme"], function (require, exports, tslib_1, React, Theme_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.AccessTheme = exports.ApplyThemeToBody = void 0;
    exports.default = {
        title: 'ThemeProvider',
    };
    var lightTheme = {
        semanticColors: {
            bodyBackground: 'white',
            bodyText: 'black',
        },
    };
    var darkTheme = {
        semanticColors: {
            bodyBackground: 'black',
            bodyText: 'white',
        },
    };
    var ApplyThemeToBody = function () {
        var _a = React.useState(true), isLight = _a[0], setIsLight = _a[1];
        return (React.createElement(Theme_1.ThemeProvider, { className: "root", applyTo: "body", theme: isLight ? lightTheme : darkTheme },
            React.createElement("button", { onClick: function () { return setIsLight(function (l) { return !l; }); } }, "Toggle theme"),
            React.createElement("div", null,
                "I am ",
                isLight ? 'light theme' : 'dark theme'),
            React.createElement(Theme_1.ThemeProvider, { theme: isLight ? darkTheme : lightTheme },
                React.createElement("div", null,
                    "I am a nested ",
                    isLight ? 'dark theme' : 'light theme'))));
    };
    exports.ApplyThemeToBody = ApplyThemeToBody;
    var ThemedContentFC = function () {
        var theme = Theme_1.useTheme();
        console.log('theme from useTheme', theme);
        return null;
    };
    var ThemedContent = /** @class */ (function (_super) {
        tslib_1.__extends(ThemedContent, _super);
        function ThemedContent() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ThemedContent.prototype.render = function () {
            return (React.createElement(Theme_1.ThemeContext.Consumer, null, function (theme) {
                console.log('theme from context consumer', theme);
                return null;
            }));
        };
        return ThemedContent;
    }(React.Component));
    var AccessTheme = function () { return (React.createElement(Theme_1.ThemeProvider, null,
        React.createElement(ThemedContent, null),
        React.createElement(ThemedContentFC, null),
        React.createElement("div", null, "See console log"))); };
    exports.AccessTheme = AccessTheme;
});
//# sourceMappingURL=ThemeProvider.stories.js.map