import { useId, type SVGProps } from 'react';

export type OpenIconProps = SVGProps<SVGSVGElement> & {
  /** Accessibility title for the icon, set aria-hidden="true" if the icon is purely decorative. */
  title?: string;
  /**
   * The size of the icon.
   * It sets the font-size, possible as the width and height is `1em`. If not set, the icon will inherit the font size of its parent.
   */
  size?: '2xl' | 'xl' | 'large' | 'medium' | 'small';
  /**
   * The color of the icon.
   * @default 'inherit'
   */
  color?: 'inherit' | 'primary' | 'gray' | 'black' | 'white';
};

export const OpenIcon = ({ title, size, color, ...props }: OpenIconProps) => {
  const titleId = useId();
  return (
    <svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24" focusable='false' role='img' width='1em' height='1em'  aria-labelledby={title ? titleId : undefined} data-size={size} data-color={color} {...props}>{title ? <title id={titleId}>{title}</title> : null}<path fillRule="evenodd" d="M5.012 7.654a2.644 2.644 0 0 1 2.642-2.642h4.349v1.5H7.654c-.63 0-1.142.513-1.142 1.142v8.697c0 .63.513 1.143 1.142 1.143h8.697c.63 0 1.143-.514 1.143-1.143v-3.903h1.5v3.903a2.644 2.644 0 0 1-2.643 2.643H7.654a2.644 2.644 0 0 1-2.642-2.643zm8.314-2.642h5.668v5.427h-1.5V7.571l-5.276 5.272-1.06-1.061 5.274-5.27h-3.106z" clipRule="evenodd" /></svg>
  );
};