import React, { useRef, useState } from "react"; import styled, { createGlobalStyle } from "styled-components"; import Interweave from "interweave"; import { IButtonProps, MaybeElement, Button, Alignment, Position, } from "@blueprintjs/core"; import { Popover2 } from "@blueprintjs/popover2"; import { IconName } from "@blueprintjs/icons"; import { ComponentProps } from "widgets/BaseComponent"; import { useScript, ScriptStatus, AddScriptTo } from "utils/hooks/useScript"; import { GOOGLE_RECAPTCHA_KEY_ERROR, GOOGLE_RECAPTCHA_DOMAIN_ERROR, createMessage, } from "@appsmith/constants/messages"; import { ThemeProp, Variant } from "components/ads/common"; import { Toaster } from "components/ads/Toast"; import ReCAPTCHA from "react-google-recaptcha"; import { Colors } from "../../../constants/Colors"; import _ from "lodash"; import { ButtonBoxShadow, ButtonBoxShadowTypes, ButtonBorderRadius, ButtonBorderRadiusTypes, ButtonVariant, ButtonVariantTypes, RecaptchaType, RecaptchaTypes, ButtonPlacement, } from "components/constants"; import { getCustomBackgroundColor, getCustomBorderColor, getCustomTextColor, getCustomJustifyContent, getAlignText, } from "widgets/WidgetUtils"; import { RenderMode } from "constants/WidgetConstants"; import { DragContainer } from "./DragContainer"; import { buttonHoverActiveStyles } from "./utils"; const RecaptchaWrapper = styled.div` position: relative; .grecaptcha-badge { visibility: hidden; } `; const ToolTipWrapper = styled.div` height: 100%; && .bp3-popover2-target { height: 100%; width: 100%; & > div { height: 100%; } } `; const TooltipStyles = createGlobalStyle` .btnTooltipContainer { .bp3-popover2-content { max-width: 350px; overflow-wrap: anywhere; padding: 10px 12px; border-radius: 0px; } } `; /* Don't use buttonHoverActiveStyles in a nested function it won't work - const buttonHoverActiveStyles = css `` const Button = styled.button` // won't work ${({ buttonColor, theme }) => { &:hover, &:active { ${buttonHoverActiveStyles} } }} // will work &:hover, &:active { ${buttonHoverActiveStyles} }` */ const StyledButton = styled((props) => (