/** * Copyright (c) 2023-present Plane Software, Inc. and contributors * SPDX-License-Identifier: AGPL-3.0-only * See the LICENSE file for details. */ import * as React from "react"; import { cn } from "../utils"; import type { TButtonVariant, TButtonSizes } from "./helper"; import { getIconStyling, getButtonStyling } from "./helper"; export interface ButtonProps extends React.ButtonHTMLAttributes { variant?: TButtonVariant; size?: TButtonSizes; className?: string; loading?: boolean; disabled?: boolean; appendIcon?: any; prependIcon?: any; children: React.ReactNode; } const Button = React.forwardRef(function Button(props: ButtonProps, ref: React.ForwardedRef) { const { variant = "primary", size = "md", className = "", type = "button", loading = false, disabled = false, prependIcon = null, appendIcon = null, children, ...rest } = props; const buttonStyle = getButtonStyling(variant, size, disabled || loading); const buttonIconStyle = getIconStyling(size); return ( ); }); Button.displayName = "plane-ui-button"; export { Button };