"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.VerticalButton = exports.StyledButtonGroup = exports.IconButtonWithTitle = exports.TopbarIconBelowLabelDiv = exports.TopbarIconButton = exports.TopbarViewButton = exports.StyledIconButton = exports.StyledButton = exports.ContainerDivider = exports.RowDiv = exports.ContainerDiv = exports.ContextMenuForControl = exports.EditLayerStyledAccordionDetails = exports.EditLayerStyledAccordionSummary = exports.EditLayerStyledAccordion = exports.EditLayerStyledTypography = exports.EditLayerConfigArea = void 0;
const tslib_1 = require("tslib");
const jsx_runtime_1 = require("react/jsx-runtime");
const styled_components_1 = tslib_1.__importDefault(require("styled-components"));
const core_1 = require("@material-ui/core");
const UIStyleConstants_1 = require("@appglue/common/dist/Common/UIStyleConstants");
exports.EditLayerConfigArea = styled_components_1.default.div `
    position: absolute;
    border-left: 2px solid lightgrey;
    border-right: 2px solid lightgrey;
    //   border-radius: 4px;
    overflow: hidden;
    display: flex;
    background: ${UIStyleConstants_1.UIStyleConstants.WHITE_COLOR};
    max-height: calc(100% - 10px);
    right: 0;
    top: 0;
    width: 350px;
    height: 100%;
`;
exports.EditLayerStyledTypography = (0, styled_components_1.default)(core_1.Typography) `
    && {
        width: 100%;
        padding: 20px 0;
        display: flex;
    }
`;
exports.EditLayerStyledAccordion = (0, styled_components_1.default)(core_1.Accordion) `
    && {
        display: flex;
        flex-direction: column;
        flex: 1;
        overflow: auto;

        > .MuiCollapse-container.MuiCollapse-entered {
            flex: 1;
            overflow: auto;
        }
    }
`;
exports.EditLayerStyledAccordionSummary = (0, styled_components_1.default)(core_1.AccordionSummary) `
    && {
        &.Mui-expanded {
            border-bottom: 1px solid #e6e9ed;
        }

        .MuiAccordionSummary-content,
        .MuiAccordionSummary-content.Mui-expanded {
            margin: 0;
        }
    }
`;
exports.EditLayerStyledAccordionDetails = (0, styled_components_1.default)(core_1.AccordionDetails) `
    && {
        padding-top: 20px;
        overflow: auto;
        flex-wrap: wrap;

        > *,
        div[class$="-root"] {
            margin-bottom: 18px;
            width: 100%;
        }

        .property-item {
            margin-bottom: 28px;
        }

        .MuiTypography-caption {
            margin-bottom: 10px;
        }

        .MuiCollapse-wrapperInner > div {
            margin-bottom: 18px;
            width: 100%;
        }
    }
`;
exports.ContextMenuForControl = (0, styled_components_1.default)(core_1.Menu) `
    && {
        .MuiMenu-list {
            background: #01244e;
            border-radius: 6px;
            color: ${UIStyleConstants_1.UIStyleConstants.WHITE_COLOR};
            font-size: 14px;

            img {
                margin-right: 8px;
            }

            .MuiListItem-root {
                border-top: solid 1px ${UIStyleConstants_1.UIStyleConstants.WHITE_COLOR};

                &:first-child {
                    border-top: none;
                }
            }
        }
    }
`;
exports.ContainerDiv = (0, styled_components_1.default)("div") `
    margin: ${(props) => props.colGap || 0}px 0;
`;
exports.RowDiv = (0, styled_components_1.default)("div") `
    margin: ${(props) => -1 * (props.colGap || 0)}px 0;
    overflow: ${(props) => (props.hasOverflow ? "auto" : "initial")};
`;
exports.ContainerDivider = (0, styled_components_1.default)("div") `
    border: ${(props) => `${props.lineWidthBetweenContainers}px ${props.lineStyleBetweenContrainers} ${props.lineColorBetweenContainers}`};
    width: 100%;
    display: flex;
`;
exports.StyledButton = (0, styled_components_1.default)(core_1.Button) `
    && {
        ${(props) => props.color === "primary" &&
    `
            background: #49A0D5;
            color: ${UIStyleConstants_1.UIStyleConstants.WHITE_COLOR};
            &:hover {
                background: #0C4385;
            }
        `}
        border-radius: 4px;
        padding: 8px 12px;

        font-style: normal;
        font-weight: bold;
        font-size: 14px;
        line-height: 24px;
    }
`;
exports.StyledIconButton = (0, styled_components_1.default)(core_1.IconButton) `
    && {
        ${(props) => props.color === "primary" &&
    `
            background: #49A0D5;
            color: ${UIStyleConstants_1.UIStyleConstants.WHITE_COLOR};
            &:hover {
                background: #0C4385;
            }
        `}
        border-radius: 4px;
        padding: 8px 12px;

        font-style: normal;
        font-weight: bold;
        font-size: 14px;
        line-height: 24px;
    }
`;
exports.TopbarViewButton = (0, styled_components_1.default)(core_1.Button) `
  && {
    height 28px;
    ${(props) => props.color === "primary" &&
    `
        background: #49A0D5;
        color: ${UIStyleConstants_1.UIStyleConstants.WHITE_COLOR};
        &:hover {
            background: #0C4385;
        }
    `}
    border-radius: 4px;

    font-style: normal;
    font-weight: bold;
    font-size: 14px;
    line-height: 24px;

    @media (min-width: 768px) {
      height: calc(28px + 4 * (100vw - 768px) / 598);
      font-size: calc(10px + 2 * (100vw - 1366px) / 554);
    }

    @media (min-width: 1366px) {
      height: calc(32px + 10 * (100vw - 1366px) / 554);
      font-size: calc(12px + 3 * (100vw - 1366px) / 554);
      line-height: calc(15px + 4 * (100vw - 1366px) / 554);
    }

    @media (min-width: 1920px) {
      width: 86px;
      height: 42px;
      font-size: 15px;
      line-height: 19px;
    }

  }
`;
exports.TopbarIconButton = (0, styled_components_1.default)(core_1.Button) `
    && {
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 0;
        width: 35px;
        height: 35px;
        min-width: 0;
        border: none;

        position: relative;

        &.TopbarIconButton-selected {
            background: rgb(64, 80, 166, 0.3);
        }

        img {
            transform: scale(1);
            max-width: 20px;
        }
    }
`;
exports.TopbarIconBelowLabelDiv = styled_components_1.default.div `
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
`;
const IconButtonWithTitle = ({ action, disabled, title, icon, testId, selected }) => {
    const button = ((0, jsx_runtime_1.jsx)(exports.TopbarIconButton, { onClick: () => action(), "data-testid": testId, disabled: disabled, classes: {
            root: selected ? "TopbarIconButton-selected" : undefined,
        }, children: icon }));
    if (!disabled) {
        return ((0, jsx_runtime_1.jsx)(core_1.Tooltip, { title: title, "data-testid": testId, children: button }));
    }
    return button;
};
exports.IconButtonWithTitle = IconButtonWithTitle;
exports.StyledButtonGroup = (0, styled_components_1.default)(core_1.ButtonGroup) `
    && {
        border: solid 1px #e6e9ed;
        border-radius: 5px;
    }
`;
exports.VerticalButton = (0, styled_components_1.default)(core_1.Button) `
    && {
        padding: 0;
        background: transparent !important;
        box-shadow: none !important;
        transform: rotate(-90deg);
        transform-origin: bottom right;

        ${(props) => props.open &&
    `
                display: none;
            `}
        .MuiButton-label {
            color: #606881;
        }

        .MuiButton-endIcon {
            padding: 9px 7px;
            background: rgba(64, 80, 166, 0.1);

            ${(props) => !props.open &&
    `
                    transform: rotate(180deg);
                `}
        }
    }
`;
//# sourceMappingURL=CommonStyles.js.map