{"version":3,"file":"Buttons-CxblNmrx.js","sources":["../../Client/legacy/Components/FormGroups/Buttons.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport { forwardRef, RefObject } from 'react';\r\nimport { LoadingButton } from '../../FormFields';\r\nimport { Svg } from '../Svg';\r\n\r\nexport interface IButtonProps {\r\n    /** The human-readable label shown to the user for the form group. */\r\n    label: string | JSX.Element;\r\n\r\n    /** An optional flag indicating whether the button is loading, which shows a spinner in place of the label. */\r\n    loading?: boolean;\r\n\r\n    /** An optional CSS class. */\r\n    className?: string;\r\n\r\n    /** The click handler for the button. Can pass in an optional event. */\r\n    onClick?: (e?: any) => void;\r\n\r\n    /** An optional flag to disable the button. */\r\n    disabled?: boolean;\r\n\r\n    /** An optional type for the button. Defaults to 'button'. Use 'submit' if the button needs to submit a form. */\r\n    type?: 'button' | 'reset' | 'submit';\r\n\r\n    /** An optional id parameter for the button */\r\n    id?: string;\r\n\r\n    /** An optional label to display while loading. */\r\n    loadingLabel?: string;\r\n\r\n    /** Optional. A name for the underlying button element used in retrieving the value after form submission. */\r\n    name?: string;\r\n\r\n    /** Optional. A value for the underlying button element used in retrieving the value after form submission. */\r\n    value?: string;\r\n\r\n    /** Optional. An explicitly defined role for the button. */\r\n    role?: string;\r\n}\r\n\r\nexport const Button = forwardRef((props: IButtonProps, ref: RefObject<HTMLButtonElement>) => {\r\n    return (\r\n        <LoadingButton\r\n            {...props}\r\n            loading={props.loading || false}\r\n            className={`form-group-button-cp ${props.className || ''}`}\r\n            ref={ref}\r\n        />\r\n    );\r\n});\r\n\r\nexport const PrimaryGreenButton = forwardRef((props: IButtonProps, ref: RefObject<HTMLButtonElement>) => {\r\n    return <Button {...props} className={`primary-green-button-cp ${props.className || ''}`} ref={ref} />;\r\n});\r\n\r\nexport const PrimaryBlackButton = forwardRef((props: IButtonProps, ref: RefObject<HTMLButtonElement>) => {\r\n    return (\r\n        <Button\r\n            {...props}\r\n            ref={ref}\r\n            className={`primary-black-button-cp ${props.className || ''} ${props.disabled ? 'disabled' : ''}`}\r\n        />\r\n    );\r\n});\r\n\r\nexport const PrimaryWhiteButton = forwardRef((props: IButtonProps, ref: RefObject<HTMLButtonElement>) => {\r\n    return <Button {...props} className={`primary-white-button-cp ${props.className || ''}`} ref={ref} />;\r\n});\r\n\r\nexport const SecondaryGreenButton = forwardRef((props: IButtonProps, ref: RefObject<HTMLButtonElement>) => {\r\n    return <Button {...props} className={`secondary-green-button-cp ${props.className || ''}`} ref={ref} />;\r\n});\r\n\r\nexport const SecondaryYellowButton = forwardRef((props: IButtonProps, ref: RefObject<HTMLButtonElement>) => {\r\n    return <Button {...props} className={`secondary-yellow-button-cp ${props.className || ''}`} ref={ref} />;\r\n});\r\n\r\nexport const SecondaryRedButton = forwardRef((props: IButtonProps, ref: RefObject<HTMLButtonElement>) => {\r\n    return <Button {...props} className={`secondary-red-button-cp ${props.className || ''}`} ref={ref} />;\r\n});\r\n\r\nexport const SecondaryBlackButton = forwardRef((props: IButtonProps, ref: RefObject<HTMLButtonElement>) => {\r\n    return <Button {...props} className={`secondary-black-button-cp ${props.className || ''}`} ref={ref} />;\r\n});\r\n\r\nexport const SecondaryWhiteButton = forwardRef((props: IButtonProps, ref: RefObject<HTMLButtonElement>) => {\r\n    return <Button {...props} className={`secondary-white-button-cp ${props.className || ''}`} ref={ref} />;\r\n});\r\n\r\nexport const SecondaryDarkGrayButton = forwardRef((props: IButtonProps, ref: RefObject<HTMLButtonElement>) => {\r\n    return <Button {...props} className={`secondary-button-cp dark-gray-cp ${props.className || ''}`} ref={ref} />;\r\n});\r\n\r\nexport const TertiaryGreenButton = forwardRef((props: IButtonProps, ref: RefObject<HTMLButtonElement>) => {\r\n    return <Button {...props} className={`tertiary-button-cp ${props.className || ''}`} ref={ref} />;\r\n});\r\n\r\nexport const TertiaryRedButton = forwardRef((props: IButtonProps, ref: RefObject<HTMLButtonElement>) => {\r\n    return <Button {...props} className={`tertiary-red-button-cp ${props.className || ''}`} ref={ref} />;\r\n});\r\n\r\ninterface ICloseButtonProps {\r\n    onClick: () => void;\r\n    id?: string;\r\n    className?: string;\r\n}\r\n\r\nexport class CloseButton extends React.Component<ICloseButtonProps, {}> {\r\n    render() {\r\n        const { id, className, onClick } = this.props;\r\n\r\n        return (\r\n            <div id={id} className={`std-close-cp${className ? ` ${className}` : ''}`} onClick={() => onClick()}>\r\n                <Svg path='/images/close.svg' alt='Click to close' />\r\n            </div>\r\n        );\r\n    }\r\n}\r\n"],"names":["Button","forwardRef","props","ref","jsx","LoadingButton","PrimaryGreenButton","PrimaryBlackButton","PrimaryWhiteButton","SecondaryGreenButton","SecondaryBlackButton","SecondaryWhiteButton","CloseButton","React.Component","id","className","onClick","Svg"],"mappings":"6HAwCO,MAAMA,EAASC,EAAA,WAAW,CAACC,EAAqBC,IAE/CC,EAAA,IAACC,EAAA,CACI,GAAGH,EACJ,QAASA,EAAM,SAAW,GAC1B,UAAW,wBAAwBA,EAAM,WAAa,EAAE,GACxD,IAAAC,CAAA,CACJ,CAEP,EAEYG,EAAqBL,EAAA,WAAW,CAACC,EAAqBC,IACxDC,EAAA,IAACJ,EAAQ,CAAA,GAAGE,EAAO,UAAW,2BAA2BA,EAAM,WAAa,EAAE,GAAI,IAAAC,CAAU,CAAA,CACtG,EAEYI,EAAqBN,EAAA,WAAW,CAACC,EAAqBC,IAE3DC,EAAA,IAACJ,EAAA,CACI,GAAGE,EACJ,IAAAC,EACA,UAAW,2BAA2BD,EAAM,WAAa,EAAE,IAAIA,EAAM,SAAW,WAAa,EAAE,EAAA,CACnG,CAEP,EAEYM,EAAqBP,EAAA,WAAW,CAACC,EAAqBC,IACxDC,EAAA,IAACJ,EAAQ,CAAA,GAAGE,EAAO,UAAW,2BAA2BA,EAAM,WAAa,EAAE,GAAI,IAAAC,CAAU,CAAA,CACtG,EAEYM,EAAuBR,EAAA,WAAW,CAACC,EAAqBC,IAC1DC,EAAA,IAACJ,EAAQ,CAAA,GAAGE,EAAO,UAAW,6BAA6BA,EAAM,WAAa,EA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