vcc-ui
Version:
A React library for building user interfaces at Volvo Cars
46 lines (43 loc) • 1.47 kB
JavaScript
import _extends from "@babel/runtime/helpers/extends";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-nocheck
import PropTypes from 'prop-types';
// TODO: Fix eslint issues the next time this file is edited.
/* eslint-disable @typescript-eslint/ban-types */
import React from 'react';
import { useFela } from 'react-fela';
const style = {
display: 'inline'
};
/**
* @deprecated Use a `<span>` element instead
*/
export const Inline = /*#__PURE__*/React.forwardRef((_ref, ref) => {
let {
children,
className,
as: As = 'span',
extend,
...props
} = _ref;
const {
css
} = useFela(props);
return /*#__PURE__*/React.createElement(As, _extends({}, props, {
ref: ref,
className: css(style, extend) + (className ? ' ' + className : '')
}), children);
});
// @ts-ignore
Inline.displayName = 'Inline';
// @ts-ignore
Inline.propTypes = {
/** Any valid React element, function, or a string specifying a name for an HTML element */
as: PropTypes.oneOfType([PropTypes.string, PropTypes.element, PropTypes.elementType, PropTypes.func]),
/** An object containing valid CSS style declarations */
extend: PropTypes.oneOfType([PropTypes.object, PropTypes.func, PropTypes.array]),
/** A JSX node */
children: PropTypes.node,
/** Add an additional custom className to element. Warning: make sure it doesn't collide with the classNames being generated for the atomic CSS **/
className: PropTypes.string
};