"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ShadowDepthTestSection = void 0;
var tslib_1 = require("tslib");
var React = tslib_1.__importStar(require("react"));
var react_native_1 = require("react-native");
var react_native_2 = require("@fluentui/react-native");
var experimental_shadow_1 = require("@fluentui-react-native/experimental-shadow");
var framework_1 = require("@fluentui-react-native/framework");
var theme_types_1 = require("@fluentui-react-native/theme-types");
var themed_stylesheet_1 = require("@fluentui-react-native/themed-stylesheet");
var ShadowTestPageStyles_1 = require("./ShadowTestPageStyles");
var getThemedStyles = (0, themed_stylesheet_1.themedStyleSheet)(function (t) {
    return {
        shadowTestBox: {
            maxWidth: 732,
            minHeight: 64,
            borderRadius: 8,
            padding: 20,
            marginVertical: 16,
            marginHorizontal: 32,
        },
        defaultBackground: (0, ShadowTestPageStyles_1.shadowTestPageStyles)(t).backgroundColor,
        brandedBackground: {
            backgroundColor: t.colors.brandedBackground,
        },
    };
});
var ShadowTestBox = function (props) {
    var theme = (0, theme_types_1.useTheme)();
    var themedStyles = getThemedStyles(theme);
    var backgroundColor = props.isBrand ? themedStyles.brandedBackground : themedStyles.defaultBackground;
    var textColor = props.isBrand ? theme.colors.primaryButtonText : theme.colors.bodyText;
    return (React.createElement(experimental_shadow_1.Shadow, { shadowToken: props.shadowToken },
        React.createElement(react_native_1.View, { style: (0, framework_1.mergeStyles)(themedStyles.shadowTestBox, backgroundColor) },
            React.createElement(react_native_2.Text, { variant: "bodySemibold", color: textColor }, props.shadowDepthText),
            React.createElement(react_native_2.Text, { color: textColor }, getShadowDescription(props.shadowToken)))));
};
var ShadowDepthTestSection = function () {
    var theme = (0, framework_1.useFluentTheme)();
    var backgroundViewStyle = (0, ShadowTestPageStyles_1.shadowTestPageStyles)(theme).backgroundColor;
    return (React.createElement(react_native_1.View, { style: backgroundViewStyle },
        React.createElement(ShadowTestBox, { shadowDepthText: "Shadow 2", shadowToken: theme.shadows.shadow2 }),
        React.createElement(ShadowTestBox, { shadowDepthText: "Shadow 4", shadowToken: theme.shadows.shadow4 }),
        React.createElement(ShadowTestBox, { shadowDepthText: "Shadow 8", shadowToken: theme.shadows.shadow8 }),
        React.createElement(ShadowTestBox, { shadowDepthText: "Shadow 16", shadowToken: theme.shadows.shadow16 }),
        React.createElement(ShadowTestBox, { shadowDepthText: "Shadow 28", shadowToken: theme.shadows.shadow28 }),
        React.createElement(ShadowTestBox, { shadowDepthText: "Shadow 64", shadowToken: theme.shadows.shadow64 }),
        React.createElement(ShadowTestBox, { shadowDepthText: "Brand Shadow 2", shadowToken: theme.shadows.shadow2brand, isBrand: true }),
        React.createElement(ShadowTestBox, { shadowDepthText: "Brand Shadow 4", shadowToken: theme.shadows.shadow4brand, isBrand: true }),
        React.createElement(ShadowTestBox, { shadowDepthText: "Brand Shadow 8", shadowToken: theme.shadows.shadow8brand, isBrand: true }),
        React.createElement(ShadowTestBox, { shadowDepthText: "Brand Shadow 16", shadowToken: theme.shadows.shadow16brand, isBrand: true }),
        React.createElement(ShadowTestBox, { shadowDepthText: "Brand Shadow 28", shadowToken: theme.shadows.shadow28brand, isBrand: true }),
        React.createElement(ShadowTestBox, { shadowDepthText: "Brand Shadow 64", shadowToken: theme.shadows.shadow64brand, isBrand: true })));
};
exports.ShadowDepthTestSection = ShadowDepthTestSection;
function getShadowDescription(shadowToken) {
    var shadowStyle = (0, experimental_shadow_1.getShadowTokenStyleSet)(shadowToken);
    return ('\nAmbient: ' +
        JSON.stringify(shadowStyle.ambient, undefined, ' ').split('\n').join('').replace(/['"]+/g, '') +
        '\n\nKey: ' +
        JSON.stringify(shadowStyle.key, undefined, ' ').split('\n').join('').replace(/['"]+/g, ''));
}
//# sourceMappingURL=ShadowDepthTestSection.js.map