@flodesk/grain 2.5.0 → 2.7.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,20 @@ 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 text-align: ", ";\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.align;
22
+ }, function (p) {
23
+ return p.hasEllipsis && "\n overflow: hidden;\n text-overflow: ellipsis;\n ";
24
+ }, function (p) {
25
+ return p.hasEllipsis && !p.ellipsisLines && "\n white-space: nowrap;\n ";
26
+ }, function (p) {
27
+ return p.hasEllipsis && p.ellipsisLines && "\n display: -webkit-box;\n -webkit-line-clamp: ".concat(p.ellipsisLines, ";\n -webkit-box-orient: vertical;\n ");
20
28
  });
21
29
  export var Text = function Text(_ref) {
22
30
  var children = _ref.children,
@@ -25,17 +33,26 @@ export var Text = function Text(_ref) {
25
33
  _ref$weight = _ref.weight,
26
34
  weight = _ref$weight === void 0 ? 'normal' : _ref$weight,
27
35
  color = _ref.color,
28
- tag = _ref.tag;
36
+ tag = _ref.tag,
37
+ hasEllipsis = _ref.hasEllipsis,
38
+ ellipsisLines = _ref.ellipsisLines,
39
+ align = _ref.align;
29
40
  return /*#__PURE__*/React.createElement(Wrapper, {
30
41
  size: size,
31
42
  weight: weight,
32
43
  color: color,
33
- as: tag
44
+ as: tag,
45
+ hasEllipsis: hasEllipsis,
46
+ ellipsisLines: ellipsisLines,
47
+ align: align
34
48
  }, children);
35
49
  };
36
50
  Text.propTypes = {
37
51
  size: types.textSize,
38
52
  weight: types.weight,
39
53
  color: types.color,
40
- tag: PropTypes.string
54
+ align: types.textAlign,
55
+ tag: PropTypes.string,
56
+ hasEllipsis: PropTypes.bool,
57
+ ellipsisLines: PropTypes.number
41
58
  };
@@ -18,11 +18,7 @@
18
18
  line-height: var(--grn-lineHeight-global);
19
19
  }
20
20
 
21
- *, *:before, *:after {
22
- box-sizing: border-box;
23
- }
24
-
25
- body {
21
+ .grn-context {
26
22
  font-family: var(--grn-font-global);
27
23
  color: var(--grn-color-body);
28
24
  font-size: var(--grn-text-m);
@@ -30,7 +26,7 @@ body {
30
26
  -moz-osx-font-smoothing: grayscale;
31
27
  }
32
28
 
33
- a {
34
- color: inherit;
35
- text-decoration: none;
36
- }
29
+ *, *:before, *:after {
30
+ box-sizing: border-box;
31
+ }
32
+
package/es/types/index.js CHANGED
@@ -8,5 +8,6 @@ export var types = {
8
8
  radius: PropTypes.oneOf(["s", "m", "l"]),
9
9
  position: PropTypes.oneOf(["static", "relative", "fixed", "absolute", "sticky"]),
10
10
  textSize: PropTypes.oneOfType([PropTypes.oneOf(Object.keys(vars.textSizes)), PropTypes.number, PropTypes.string]),
11
- weight: PropTypes.oneOf(Object.keys(vars.weights))
11
+ weight: PropTypes.oneOf(Object.keys(vars.weights)),
12
+ textAlign: PropTypes.oneOf(["left", "center", "right"])
12
13
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flodesk/grain",
3
- "version": "2.5.0",
3
+ "version": "2.7.0",
4
4
  "description": "Flodesk design system",
5
5
  "module": "es/index.js",
6
6
  "author": "Flodesk",