@flodesk/grain 1.1.2 → 1.1.5

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.
@@ -9,7 +9,7 @@
9
9
  --grn-text-xxl: calc(var(--grn-text-xl) + var(--ratio));
10
10
 
11
11
  --grn-weight-normal: 400;
12
- --grn-weight-bold: 600;
12
+ --grn-weight-semiBold: 600;
13
13
  }
14
14
 
15
15
  * {
@@ -17,4 +17,13 @@
17
17
  line-height: calc(5px + 1em);
18
18
  -webkit-font-smoothing: antialiased;
19
19
  -moz-osx-font-smoothing: grayscale;
20
+ }
21
+
22
+ body {
23
+ font-family: 'BeausiteClassic';
24
+ }
25
+
26
+ a {
27
+ color: inherit;
28
+ text-decoration: none;
20
29
  }
@@ -1,3 +1 @@
1
- export { TestComponent } from "./test-component";
2
- export { AnotherTestComponent } from "./another-test-component";
3
1
  export { Text } from "./text";
@@ -8,9 +8,12 @@ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(
8
8
 
9
9
  import PropTypes from 'prop-types';
10
10
  import React from "react";
11
+ import { getTextSize } from '../../utilities';
11
12
  import styled from "@emotion/styled";
12
- var Wrapper = styled.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: block;\n font-size: var(--grn-text-", ");\n font-weight: var(--grn-weight-", ");\n"])), function (p) {
13
- return p.size;
13
+ export var textSizes = ['s', 'm', 'l', 'xl', 'xxl'];
14
+ export var weights = ['normal', 'semiBold'];
15
+ var Wrapper = styled.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: block;\n font-size: ", ";\n font-weight: var(--grn-weight-", ");\n"])), function (p) {
16
+ return getTextSize(p.size);
14
17
  }, function (p) {
15
18
  return p.weight;
16
19
  });
@@ -25,9 +28,7 @@ export var Text = function Text(_ref) {
25
28
  weight: weight
26
29
  }, children);
27
30
  };
28
- var sizes = ['s', 'm', 'l', 'xl', 'xxl'];
29
- var weights = ['normal', 'bold'];
30
31
  Text.propTypes = {
31
- size: PropTypes.oneOf(sizes),
32
+ size: PropTypes.oneOf(textSizes),
32
33
  weight: PropTypes.oneOf(weights)
33
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flodesk/grain",
3
- "version": "1.1.2",
3
+ "version": "1.1.5",
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",
@@ -1,5 +0,0 @@
1
- import React from "react";
2
- export var AnotherTestComponent = function AnotherTestComponent(_ref) {
3
- var children = _ref.children;
4
- return /*#__PURE__*/React.createElement("h1", null, children);
5
- };
@@ -1,5 +0,0 @@
1
- import React from "react";
2
- export var TestComponent = function TestComponent(_ref) {
3
- var children = _ref.children;
4
- return /*#__PURE__*/React.createElement("button", null, children);
5
- };