@flodesk/grain 2.5.1 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,12 +11,18 @@ import { PropTypes } from 'prop-types';
11
11
  import React from "react";
12
12
  import styled from "@emotion/styled";
13
13
  import { types } from '../../types';
14
- var Wrapper = styled.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: block;\n font-size: ", ";\n font-weight: ", ";\n color: ", ";\n"])), function (p) {
14
+ var Wrapper = styled.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: block;\n font-size: ", ";\n font-weight: ", ";\n color: ", ";\n \n ", ";\n ", ";\n ", ";\n"])), function (p) {
15
15
  return getTextSize(p.size);
16
16
  }, function (p) {
17
17
  return getWeight(p.weight);
18
18
  }, function (p) {
19
19
  return getColor(p.color);
20
+ }, function (p) {
21
+ return p.hasEllipsis && "\n overflow: hidden;\n text-overflow: ellipsis;\n ";
22
+ }, function (p) {
23
+ return p.hasEllipsis && !p.ellipsisLines && "\n white-space: nowrap;\n ";
24
+ }, function (p) {
25
+ return p.hasEllipsis && p.ellipsisLines && "\n display: -webkit-box;\n -webkit-line-clamp: ".concat(p.ellipsisLines, ";\n -webkit-box-orient: vertical;\n ");
20
26
  });
21
27
  export var Text = function Text(_ref) {
22
28
  var children = _ref.children,
@@ -25,17 +31,23 @@ export var Text = function Text(_ref) {
25
31
  _ref$weight = _ref.weight,
26
32
  weight = _ref$weight === void 0 ? 'normal' : _ref$weight,
27
33
  color = _ref.color,
28
- tag = _ref.tag;
34
+ tag = _ref.tag,
35
+ hasEllipsis = _ref.hasEllipsis,
36
+ ellipsisLines = _ref.ellipsisLines;
29
37
  return /*#__PURE__*/React.createElement(Wrapper, {
30
38
  size: size,
31
39
  weight: weight,
32
40
  color: color,
33
- as: tag
41
+ as: tag,
42
+ hasEllipsis: hasEllipsis,
43
+ ellipsisLines: ellipsisLines
34
44
  }, children);
35
45
  };
36
46
  Text.propTypes = {
37
47
  size: types.textSize,
38
48
  weight: types.weight,
39
49
  color: types.color,
40
- tag: PropTypes.string
50
+ tag: PropTypes.string,
51
+ hasEllipsis: PropTypes.bool,
52
+ ellipsisLines: PropTypes.number
41
53
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flodesk/grain",
3
- "version": "2.5.1",
3
+ "version": "2.6.0",
4
4
  "description": "Flodesk design system",
5
5
  "module": "es/index.js",
6
6
  "author": "Flodesk",