PluginProbe
Elementor Website Builder – more than just a page builder / 3.8.0-beta1
Elementor Website Builder – more than just a page builder v3.8.0-beta1
4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 All 457 releases
elementor / app / assets / js / ui / atoms / text.js

text.js in Elementor Website Builder – more than just a page builder 3.8.0-beta1, at app/assets/js/ui/atoms/text.js

30 lines 680 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { arrayToClassName } from '../../utils/utils';
2
3 export default function Text( props ) {
4 const baseClassName = 'eps',
5 classes = [
6 props.className,
7 ],
8 variant = props.variant && 'md' !== props.variant ? '-' + props.variant : '';
9
10 classes.push( baseClassName + '-text' + variant );
11
12 const Element = () => React.createElement( props.tag, {
13 className: arrayToClassName( classes ),
14 }, props.children );
15
16 return <Element />;
17 }
18
19 Text.propTypes = {
20 className: PropTypes.string,
21 variant: PropTypes.oneOf( [ 'xl', 'lg', 'md', 'sm', 'xs', 'xxs' ] ),
22 tag: PropTypes.string,
23 children: PropTypes.any.isRequired,
24 };
25
26 Text.defaultProps = {
27 className: '',
28 tag: 'p',
29 };
30