@kubit-ui-web/react-components
Version:
Kubit React Components is a customizable, accessible library of React web components, designed to enhance your application's user experience
19 lines • 1.72 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import React from 'react';
import { ElementOrIcon } from '../../components/elementOrIcon/elementOrIcon';
import { LabelStandAlone as Label } from '../label/labelStandAlone';
import { QuickButtonContainerStyled, QuickButtonStyled } from './quickButton.styled';
import { QuickButtonState } from './types/state';
const QuickButtonStandAloneComponent = ({ dataTestId = 'quick-button', ...props }, ref) => {
const button = (_jsx(QuickButtonStyled, { ref: ref, "aria-label": props.label ? '' : props['aria-label'], "data-testid": dataTestId, disabled: props.state === QuickButtonState.DISABLED, id: props.buttonId, role: props.role, styles: props.styles, type: props.type, onClick: props.onClick, children: _jsx(ElementOrIcon, { color: props.styles?.[props.state]?.icon?.color, height: props.styles?.[props.state]?.icon?.height, width: props.styles?.[props.state]?.icon?.width, ...props.icon }) }));
return props.label ? (_jsxs(QuickButtonContainerStyled, { maxWidth: props.maxWidth, styles: props.styles, children: [button, _jsx(Label, { color: props.styles?.[props.state]?.label?.color, inputId: props.buttonId, textVariant: props.styles?.[props.state]?.label?.font_family, weight: props.styles?.[props.state]?.label?.font_weight, ...props.label, children: props.label.content })] })) : (button);
};
/**
* @description
* QuickButton component is a button component that can be used to create a button.
* @param {React.PropsWithChildren<IQuickButtonStandAlone>} props
* @returns {JSX.Element}
* @constructor
*/
export const QuickButtonStandAlone = React.forwardRef(QuickButtonStandAloneComponent);
//# sourceMappingURL=quickButtonStandAlone.js.map