@primer/react
Version:
An implementation of GitHub's Primer Design System using React
26 lines (19 loc) • 986 B
JavaScript
;
var styled = require('styled-components');
var styledSystem = require('styled-system');
var sx = require('../sx.js');
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
var styled__default = /*#__PURE__*/_interopDefault(styled);
const Truncate = styled__default.default.div.withConfig({
displayName: "Truncate",
componentId: "sc-23o1d2-0"
})(["display:", ";overflow:hidden;text-overflow:ellipsis;vertical-align:", ";white-space:nowrap;", " ", " ", ";"], props => props.inline ? 'inline-block' : 'inherit', props => props.inline ? 'top' : 'initial', styledSystem.maxWidth, props => props.expandable ? `&:hover { max-width: 10000px; }` : '', sx.default);
// TODO: Remove defaultProps to be compatible with the next major version of React
// Reference: https://github.com/primer/react/issues/2758
Truncate.defaultProps = {
expandable: false,
inline: false,
maxWidth: 125
};
var Truncate$1 = Truncate;
module.exports = Truncate$1;