@flodesk/grain 1.1.3 → 1.2.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/base-styles.css
CHANGED
|
@@ -1,20 +1,41 @@
|
|
|
1
1
|
:root {
|
|
2
|
-
--
|
|
3
|
-
--
|
|
2
|
+
--baseTextSize: 15px;
|
|
3
|
+
--textIncrement: calc(0.2vw + 2px);
|
|
4
4
|
|
|
5
5
|
--grn-text-s: 13px;
|
|
6
|
-
--grn-text-m: var(--
|
|
7
|
-
--grn-text-l: calc(var(--grn-text-m) + var(--
|
|
8
|
-
--grn-text-xl: calc(var(--grn-text-l) + var(--
|
|
9
|
-
--grn-text-xxl: calc(var(--grn-text-xl) + var(--
|
|
6
|
+
--grn-text-m: var(--baseTextSize);
|
|
7
|
+
--grn-text-l: calc(var(--grn-text-m) + var(--textIncrement));
|
|
8
|
+
--grn-text-xl: calc(var(--grn-text-l) + var(--textIncrement));
|
|
9
|
+
--grn-text-xxl: calc(var(--grn-text-xl) + var(--textIncrement));
|
|
10
|
+
}
|
|
10
11
|
|
|
12
|
+
:root {
|
|
11
13
|
--grn-weight-normal: 400;
|
|
14
|
+
--grn-weight-medium: 500;
|
|
12
15
|
--grn-weight-semiBold: 600;
|
|
13
16
|
}
|
|
14
17
|
|
|
18
|
+
:root {
|
|
19
|
+
--grn-space-xs: 4px;
|
|
20
|
+
--grn-space-s: 8px;
|
|
21
|
+
--grn-space-m: 16px;
|
|
22
|
+
--grn-space-l: 24px;
|
|
23
|
+
--grn-space-xl: 40px;
|
|
24
|
+
--grn-space-xxl: 56px;
|
|
25
|
+
}
|
|
26
|
+
|
|
15
27
|
* {
|
|
16
28
|
letter-spacing: calc(1.3px - 0.07em);
|
|
17
29
|
line-height: calc(5px + 1em);
|
|
18
30
|
-webkit-font-smoothing: antialiased;
|
|
19
31
|
-moz-osx-font-smoothing: grayscale;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
body {
|
|
35
|
+
font-family: 'BeausiteClassic';
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
a {
|
|
39
|
+
color: inherit;
|
|
40
|
+
text-decoration: none;
|
|
20
41
|
}
|
package/es/components/index.js
CHANGED
|
@@ -4,17 +4,16 @@ 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
|
-
|
|
9
7
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
10
8
|
|
|
11
9
|
import PropTypes from 'prop-types';
|
|
12
10
|
import React from "react";
|
|
11
|
+
import { getTextSize } from '../../utilities';
|
|
13
12
|
import styled from "@emotion/styled";
|
|
14
|
-
var
|
|
15
|
-
var weights = ['normal', 'semiBold'];
|
|
13
|
+
export var textSizes = ['s', 'm', 'l', 'xl', 'xxl'];
|
|
14
|
+
export var weights = ['normal', 'medium', 'semiBold'];
|
|
16
15
|
var Wrapper = styled.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: block;\n font-size: ", ";\n font-weight: var(--grn-weight-", ");\n"])), function (p) {
|
|
17
|
-
return
|
|
16
|
+
return getTextSize(p.size);
|
|
18
17
|
}, function (p) {
|
|
19
18
|
return p.weight;
|
|
20
19
|
});
|
|
@@ -30,6 +29,6 @@ export var Text = function Text(_ref) {
|
|
|
30
29
|
}, children);
|
|
31
30
|
};
|
|
32
31
|
Text.propTypes = {
|
|
33
|
-
size: PropTypes.oneOf(
|
|
32
|
+
size: PropTypes.oneOf(textSizes),
|
|
34
33
|
weight: PropTypes.oneOf(weights)
|
|
35
34
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "core-js/modules/es.array.includes.js";
|
|
2
|
+
import "core-js/modules/es.string.includes.js";
|
|
3
|
+
import { textSizes } from "../components/text";
|
|
4
|
+
export var getTextSize = function getTextSize(size) {
|
|
5
|
+
if (textSizes.includes(size)) {
|
|
6
|
+
return "var(--grn-text-".concat(size, ")");
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
return size;
|
|
10
|
+
};
|
package/package.json
CHANGED