@flodesk/grain 2.6.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.
- package/es/components/text/index.js +8 -3
- package/es/styles/base.css +0 -5
- package/es/types/index.js +2 -1
- package/package.json +1 -1
|
@@ -11,12 +11,14 @@ 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 \n ", ";\n ", ";\n ", ";\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;
|
|
20
22
|
}, function (p) {
|
|
21
23
|
return p.hasEllipsis && "\n overflow: hidden;\n text-overflow: ellipsis;\n ";
|
|
22
24
|
}, function (p) {
|
|
@@ -33,20 +35,23 @@ export var Text = function Text(_ref) {
|
|
|
33
35
|
color = _ref.color,
|
|
34
36
|
tag = _ref.tag,
|
|
35
37
|
hasEllipsis = _ref.hasEllipsis,
|
|
36
|
-
ellipsisLines = _ref.ellipsisLines
|
|
38
|
+
ellipsisLines = _ref.ellipsisLines,
|
|
39
|
+
align = _ref.align;
|
|
37
40
|
return /*#__PURE__*/React.createElement(Wrapper, {
|
|
38
41
|
size: size,
|
|
39
42
|
weight: weight,
|
|
40
43
|
color: color,
|
|
41
44
|
as: tag,
|
|
42
45
|
hasEllipsis: hasEllipsis,
|
|
43
|
-
ellipsisLines: ellipsisLines
|
|
46
|
+
ellipsisLines: ellipsisLines,
|
|
47
|
+
align: align
|
|
44
48
|
}, children);
|
|
45
49
|
};
|
|
46
50
|
Text.propTypes = {
|
|
47
51
|
size: types.textSize,
|
|
48
52
|
weight: types.weight,
|
|
49
53
|
color: types.color,
|
|
54
|
+
align: types.textAlign,
|
|
50
55
|
tag: PropTypes.string,
|
|
51
56
|
hasEllipsis: PropTypes.bool,
|
|
52
57
|
ellipsisLines: PropTypes.number
|
package/es/styles/base.css
CHANGED
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
|
};
|