UNPKG

@primer/components

Version:
29 lines (21 loc) 1.04 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _styledComponents = _interopRequireDefault(require("styled-components")); var _styledSystem = require("styled-system"); var _constants = require("./constants"); var _sx = _interopRequireDefault(require("./sx")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const Truncate = _styledComponents.default.div.withConfig({ displayName: "Truncate", componentId: "sc-1074h1l-0" })(["", " ", " display:", ";overflow:hidden;text-overflow:ellipsis;vertical-align:", ";white-space:nowrap;", " ", " ", ";"], _constants.TYPOGRAPHY, _constants.COMMON, props => props.inline ? 'inline-block' : 'inherit', props => props.inline ? 'top' : 'initial', _styledSystem.maxWidth, props => props.expandable ? `&:hover { max-width: 10000px; }` : '', _sx.default); Truncate.defaultProps = { expandable: false, inline: false, maxWidth: 125 }; var _default = Truncate; exports.default = _default;