@flodesk/grain 1.1.0 → 1.1.3
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/base-styles.css
CHANGED
|
@@ -2,17 +2,19 @@
|
|
|
2
2
|
--base: 15px;
|
|
3
3
|
--ratio: calc(0.2vw + 2px);
|
|
4
4
|
|
|
5
|
-
--grn-text-
|
|
6
|
-
--grn-text-
|
|
7
|
-
--grn-text-
|
|
8
|
-
--grn-text-xl: calc(var(--grn-text-
|
|
5
|
+
--grn-text-s: 13px;
|
|
6
|
+
--grn-text-m: var(--base);
|
|
7
|
+
--grn-text-l: calc(var(--grn-text-m) + var(--ratio));
|
|
8
|
+
--grn-text-xl: calc(var(--grn-text-l) + var(--ratio));
|
|
9
9
|
--grn-text-xxl: calc(var(--grn-text-xl) + var(--ratio));
|
|
10
10
|
|
|
11
11
|
--grn-weight-normal: 400;
|
|
12
|
-
--grn-weight-
|
|
12
|
+
--grn-weight-semiBold: 600;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
* {
|
|
16
16
|
letter-spacing: calc(1.3px - 0.07em);
|
|
17
17
|
line-height: calc(5px + 1em);
|
|
18
|
+
-webkit-font-smoothing: antialiased;
|
|
19
|
+
-moz-osx-font-smoothing: grayscale;
|
|
18
20
|
}
|
|
@@ -4,20 +4,24 @@ import "core-js/modules/es.object.define-properties.js";
|
|
|
4
4
|
|
|
5
5
|
var _templateObject;
|
|
6
6
|
|
|
7
|
+
import "core-js/modules/es.array.includes.js";
|
|
8
|
+
|
|
7
9
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
8
10
|
|
|
9
11
|
import PropTypes from 'prop-types';
|
|
10
12
|
import React from "react";
|
|
11
13
|
import styled from "@emotion/styled";
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
+
var sizes = ['s', 'm', 'l', 'xl', 'xxl'];
|
|
15
|
+
var weights = ['normal', 'semiBold'];
|
|
16
|
+
var Wrapper = styled.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: block;\n font-size: ", ";\n font-weight: var(--grn-weight-", ");\n"])), function (p) {
|
|
17
|
+
return sizes.includes(p.size) ? "var(--grn-text-".concat(p.size, ")") : p.size;
|
|
14
18
|
}, function (p) {
|
|
15
19
|
return p.weight;
|
|
16
20
|
});
|
|
17
21
|
export var Text = function Text(_ref) {
|
|
18
22
|
var children = _ref.children,
|
|
19
23
|
_ref$size = _ref.size,
|
|
20
|
-
size = _ref$size === void 0 ? '
|
|
24
|
+
size = _ref$size === void 0 ? 'm' : _ref$size,
|
|
21
25
|
_ref$weight = _ref.weight,
|
|
22
26
|
weight = _ref$weight === void 0 ? 'normal' : _ref$weight;
|
|
23
27
|
return /*#__PURE__*/React.createElement(Wrapper, {
|
|
@@ -25,8 +29,6 @@ export var Text = function Text(_ref) {
|
|
|
25
29
|
weight: weight
|
|
26
30
|
}, children);
|
|
27
31
|
};
|
|
28
|
-
var sizes = ['sm', 'md', 'lg', 'xl', 'xxl'];
|
|
29
|
-
var weights = ['normal', 'bold'];
|
|
30
32
|
Text.propTypes = {
|
|
31
33
|
size: PropTypes.oneOf(sizes),
|
|
32
34
|
weight: PropTypes.oneOf(weights)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flodesk/grain",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "Flodesk design system",
|
|
5
5
|
"module": "es/index.js",
|
|
6
6
|
"author": "Flodesk",
|
|
@@ -21,9 +21,10 @@
|
|
|
21
21
|
"es"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"core-js": "^3.22.8",
|
|
25
24
|
"@emotion/react": "^11.9.0",
|
|
26
|
-
"@emotion/styled": "^11.8.1"
|
|
25
|
+
"@emotion/styled": "^11.8.1",
|
|
26
|
+
"core-js": "^3.22.8",
|
|
27
|
+
"prop-types": "^15.8.1"
|
|
27
28
|
},
|
|
28
29
|
"peerDependencies": {
|
|
29
30
|
"react": ">=16.8",
|