import * as tslib_1 from "tslib";
import * as React from 'react';
import { css, styled } from '../../Utilities';
import { Check } from '../../Check';
import { getClassNames as getCheckClassNames } from '../Check/Check.classNames';
import { getStyles as getCheckStyles } from '../Check/Check.styles';
import { getStyles } from './DetailsRowCheck.styles';
import { classNamesFunction } from '../../Utilities';
var getClassNames = classNamesFunction();
var DetailsRowCheckBase = function (props) {
    var _a = props.canSelect, canSelect = _a === void 0 ? false : _a, _b = props.isSelected, isSelected = _b === void 0 ? false : _b, _c = props.anySelected, anySelected = _c === void 0 ? false : _c, _d = props.selected, selected = _d === void 0 ? false : _d, _e = props.isHeader, isHeader = _e === void 0 ? false : _e, className = props.className, checkClassName = props.checkClassName, styles = props.styles, theme = props.theme, compact = props.compact, buttonProps = tslib_1.__rest(props, ["canSelect", "isSelected", "anySelected", "selected", "isHeader", "className", "checkClassName", "styles", "theme", "compact"]);
    var isPressed = props.isSelected || props.selected;
    var checkStyles = getCheckStyles({ theme: theme });
    var checkClassNames = getCheckClassNames(checkStyles, {
        theme: theme
    });
    var classNames = getClassNames(styles, {
        theme: theme,
        canSelect: canSelect,
        selected: isPressed,
        anySelected: anySelected,
        className: className,
        isHeader: isHeader,
        compact: compact
    });
    return (React.createElement("div", tslib_1.__assign({}, buttonProps, { role: "checkbox", className: css(classNames.root, classNames.check, checkClassNames.checkHost), "aria-checked": isPressed, "data-selection-toggle": true, "data-automationid": "DetailsRowCheck" }),
        React.createElement(Check, { checked: isPressed })));
};
export var DetailsRowCheck = styled(DetailsRowCheckBase, getStyles, undefined, { scope: 'DetailsRowCheck' });
//# sourceMappingURL=DetailsRowCheck.js.map