UNPKG

@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

17 lines 1.68 kB
import { jsx as _jsx } from "react/jsx-runtime"; import React from 'react'; import { ButtonStyled } from '../../../components/button/button.styled'; import { ButtonStandAloneStructure } from '../../../components/button/buttonStandAlone'; import { Text } from '../../../components/text/text'; import { pickAriaProps } from '../../../utils/aria/aria'; import { ButtonStateType } from '../../button/types/state'; import { TextDecorationType } from '../../text/types/decoration'; import { LinkAsButtonWrapperStyled } from './linkAsButton.styled'; export const LinkAsButtonStandAloneComponent = ({ dataTestId = 'link-as-button', children, url, component, target, role, onClick, ['aria-label']: ariaLabel, ...props }, ref) => { const ariaProps = pickAriaProps(props); return ( // Apply button border radius to the link when focus-visible _jsx(LinkAsButtonWrapperStyled, { "$fullWidth": props.fullWidth, "$sizeStyles": props.sizeStyles, "$state": props.state, "$styles": props.styles, "data-testid": dataTestId, children: _jsx(Text, { ref: ref, "aria-label": ariaLabel, component: component, decoration: TextDecorationType.NONE, isDisabled: props.state === ButtonStateType.DISABLED, role: role, target: target, url: url, onClick: onClick, children: _jsx(ButtonStyled, { as: "span", ...props, "$fullWidth": props.fullWidth, "$iconPosition": props.iconPosition, "$sizeStyles": props.sizeStyles, "$state": props.state, "$styles": props.styles, children: _jsx(ButtonStandAloneStructure, { ...props, children: children }) }) }) })); }; export const LinkAsButtonStandAlone = React.forwardRef(LinkAsButtonStandAloneComponent); //# sourceMappingURL=linkAsButtonStandAlone.js.map