import { styled, View } from '@hanzo/gui';
import * as React from 'react';
// eslint-disable-next-line max-len
const CLOSE_ICON_PATH = 'M9.44 8.035a.791.791 0 0 0 1.12 0l3.802-3.803a.791.791 0 0 1 1.119 0l.287.287a.79.79 0 0 1 0 1.119L11.965 9.44a.79.79 0 0 0 0 1.118l3.803 3.803a.791.791 0 0 1 0 1.119l-.287.287a.791.791 0 0 1-1.119 0l-3.803-3.803a.79.79 0 0 0-1.118 0l-3.803 3.803a.79.79 0 0 1-1.119 0l-.287-.287a.791.791 0 0 1 0-1.119l3.803-3.803a.791.791 0 0 0 0-1.118L4.232 5.638a.791.791 0 0 1 0-1.119l.287-.287a.791.791 0 0 1 1.119 0L9.44 8.035Z';
const CloseButtonFrame = styled(View, {
name: 'LuxCloseButton',
render: ,
role: 'button',
cursor: 'pointer',
display: 'inline-flex',
alignItems: 'center',
justifyContent: 'center',
width: 20,
height: 20,
minWidth: 0,
flexShrink: 1,
padding: 0,
borderRadius: 4,
borderWidth: 0,
overflow: 'hidden',
backgroundColor: 'transparent',
hoverStyle: {
backgroundColor: 'transparent',
},
variants: {
disabled: {
true: {
opacity: 0.4,
pointerEvents: 'none',
},
},
} as const,
});
export interface CloseButtonProps extends Omit, 'size'> {
readonly variant?: 'plain';
readonly size?: 'md';
}
export const CloseButton = React.forwardRef<
HTMLButtonElement,
CloseButtonProps
>(function CloseButton(props, ref) {
const { variant: _variant, size: _size, className, children, ...rest } = props;
return (
{children ?? (
)}
);
});