UNPKG

@ozen-ui/kit

Version:

React component library

14 lines (13 loc) 799 B
import { __assign } from "tslib"; import React from 'react'; import { cn } from '../../../../utils/classname'; import { polymorphicComponentWithRef } from '../../../../utils/polymorphicComponentWithRef'; import { IconButton } from '../../../IconButtonNext'; import { useTitleContext } from '../../TitleContext'; import { TITLE_ICON_BUTTON_DEFAULT_TAG } from './constants'; export var cnTitleIconButton = cn('TitleIconButton'); export var TitleIconButton = polymorphicComponentWithRef(function (props, ref) { var size = useTitleContext().size; return (React.createElement(IconButton, __assign({ compressed: true, as: TITLE_ICON_BUTTON_DEFAULT_TAG }, props, { ref: ref, size: size, className: cnTitleIconButton('', [props.className]) }))); }); TitleIconButton.displayName = 'TitleIconButton';