@yandex/ui
Version:
Yandex UI components
21 lines (20 loc) • 894 B
JavaScript
import { __assign, __rest } from "tslib";
import React from 'react';
import { compose } from '@bem-react/core';
import { Icon as IconBase } from '../../Icon/Icon';
import { withTypeCross } from '../../Icon/_type/Icon_type_cross';
import { withGlyphXSign } from '../../Icon/_glyph/Icon_glyph_x-sign';
import { cnTextarea } from '../Textarea';
import './Textarea-Clear.css';
var Icon = compose(withGlyphXSign, withTypeCross)(IconBase);
var getIconType = function (view) {
if (view === 'default') {
return { glyph: 'x-sign' };
}
return { type: 'cross' };
};
export var TextareaClear = function (_a) {
var view = _a.view, visible = _a.visible, props = __rest(_a, ["view", "visible"]);
var className = cnTextarea('Clear', { visible: visible }, [props.className]);
return React.createElement(Icon, __assign({}, props, getIconType(view), { className: className }));
};