@flodesk/grain 2.2.0 → 2.3.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.
@@ -7,6 +7,7 @@ var _templateObject;
7
7
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
8
8
 
9
9
  import { getColor, getTextSize, getWeight } from '../../utilities';
10
+ import { PropTypes } from 'prop-types';
10
11
  import React from "react";
11
12
  import styled from "@emotion/styled";
12
13
  import { types } from '../../types';
@@ -23,15 +24,18 @@ export var Text = function Text(_ref) {
23
24
  size = _ref$size === void 0 ? 'm' : _ref$size,
24
25
  _ref$weight = _ref.weight,
25
26
  weight = _ref$weight === void 0 ? 'normal' : _ref$weight,
26
- color = _ref.color;
27
+ color = _ref.color,
28
+ tag = _ref.tag;
27
29
  return /*#__PURE__*/React.createElement(Wrapper, {
28
30
  size: size,
29
31
  weight: weight,
30
- color: color
32
+ color: color,
33
+ as: tag
31
34
  }, children);
32
35
  };
33
36
  Text.propTypes = {
34
37
  size: types.textSize,
35
38
  weight: types.weight,
36
- color: types.color
39
+ color: types.color,
40
+ tag: PropTypes.string
37
41
  };
@@ -1,67 +1,20 @@
1
- :root {
2
- --grn-unit: 8px;
3
- }
4
-
5
- :root {
6
- --grn-text-s: calc(var(--grn-unit) * 1.625);
7
- --grn-text-m: calc(var(--grn-unit) * 1.875);
8
- --grn-text-l: calc(var(--grn-unit) * 2.5);
9
- --grn-text-xl: calc(var(--grn-unit) * 3.125);
10
- --grn-text-xxl: calc(var(--grn-unit) * 3.75);
11
- }
12
-
13
- :root {
14
- --grn-weight-normal: 400;
15
- --grn-weight-medium: 500;
16
- --grn-weight-semiBold: 600;
17
- }
18
-
19
- :root {
20
- --grn-space-xs: calc(var(--grn-unit) / 2);
21
- --grn-space-s: calc(var(--grn-unit) * 1);
22
- --grn-space-m: calc(var(--grn-unit) * 2);
23
- --grn-space-l: calc(var(--grn-unit) * 3);
24
- --grn-space-xl: calc(var(--grn-unit) * 5);
25
- --grn-space-xxl: calc(var(--grn-unit) * 7);
26
- }
1
+ @import './variables.css';
27
2
 
28
3
  :root {
29
- --grn-radius-s: calc(var(--grn-unit) / 2);
30
- --grn-radius-m: calc(var(--grn-unit) / 1.33);
31
- --grn-radius-l: calc(var(--grn-unit) * 1.25);
32
- }
33
-
34
- :root {
35
- --grey8-HSL: 0 0% 7%;
36
-
37
- --grn-color-grey8: hsl(var(--grey8-HSL));
38
- --grn-color-grey7: hsl(0 0% 20%);
39
- --grn-color-grey6: hsl(0 0% 32%);
40
- --grn-color-grey5: hsl(0 0% 44%);
41
- --grn-color-grey4: hsl(0 0% 63%);
42
- --grn-color-grey3: hsl(0 0% 78%);
43
- --grn-color-grey2: hsl(0 0% 87%);
44
- --grn-color-grey1: hsl(0 0% 96%);
4
+ --grn-letterSpacing-fixed: 1.3px;
5
+ --grn-letterSpacing-relative: 0.07em;
6
+ --grn-letterSpacing-global: calc(var(--grn-letterSpacing-fixed) - var(--grn-letterSpacing-relative));
45
7
 
46
- --grn-color-blue: hsl(218 74% 54%);
47
- --grn-color-red: hsl(6 66% 65%);
48
-
49
- --grn-color-body: var(--grn-color-grey8);
50
- --grn-color-bodyDimmed: hsl(var(--grey8-HSL) / 50%);
51
- --grn-color-accent: var(--grn-color-grey8);
52
- --grn-color-backgroundSecondary: hsl(0 0% 100%);
53
- --grn-color-background: var(--grn-color-grey1);
54
- --grn-color-overlay: hsl(var(--grey8-HSL) / 7%);
55
- --grn-color-border: hsl(var(--grey8-HSL) / 9%);
56
- --grn-color-selection: var(--grn-color-blue);
57
- --grn-color-danger: var(--grn-color-red);
8
+ --grn-lineHeight-fixed: 5px;
9
+ --grn-lineHeight-relative: 1em;
10
+ --grn-lineHeight-global: calc(var(--grn-lineHeight-fixed) + var(--grn-lineHeight-relative));
11
+
12
+ --grn-font-global: 'Beausite Classic', sans-serif;
58
13
  }
59
14
 
60
15
  * {
61
- letter-spacing: calc(1.3px - 0.07em);
62
- line-height: calc(5px + 1em);
63
- -webkit-font-smoothing: antialiased;
64
- -moz-osx-font-smoothing: grayscale;
16
+ letter-spacing: var(--grn-letterSpacing-global);
17
+ line-height: var(--grn-lineHeight-global);
65
18
  }
66
19
 
67
20
  *, *:before, *:after {
@@ -69,9 +22,11 @@
69
22
  }
70
23
 
71
24
  body {
72
- font-family: 'BeausiteClassic', sans-serif;
25
+ font-family: var(--grn-font-global);
73
26
  color: var(--grn-color-body);
74
27
  font-size: var(--grn-text-m);
28
+ -webkit-font-smoothing: antialiased;
29
+ -moz-osx-font-smoothing: grayscale;
75
30
  }
76
31
 
77
32
  a {
@@ -0,0 +1,57 @@
1
+ :root {
2
+ --grn-unit: 8px;
3
+ }
4
+
5
+ :root {
6
+ --grn-text-s: calc(var(--grn-unit) * 1.625);
7
+ --grn-text-m: calc(var(--grn-unit) * 1.875);
8
+ --grn-text-l: calc(var(--grn-unit) * 2.5);
9
+ --grn-text-xl: calc(var(--grn-unit) * 3.125);
10
+ --grn-text-xxl: calc(var(--grn-unit) * 3.75);
11
+ }
12
+
13
+ :root {
14
+ --grn-weight-normal: 400;
15
+ --grn-weight-medium: 500;
16
+ --grn-weight-semiBold: 600;
17
+ }
18
+
19
+ :root {
20
+ --grn-space-xs: calc(var(--grn-unit) / 2);
21
+ --grn-space-s: calc(var(--grn-unit) * 1);
22
+ --grn-space-m: calc(var(--grn-unit) * 2);
23
+ --grn-space-l: calc(var(--grn-unit) * 3);
24
+ --grn-space-xl: calc(var(--grn-unit) * 5);
25
+ --grn-space-xxl: calc(var(--grn-unit) * 7);
26
+ }
27
+
28
+ :root {
29
+ --grn-radius-s: calc(var(--grn-unit) / 1.333333);
30
+ --grn-radius-m: calc(var(--grn-unit) * 1.5);
31
+ }
32
+
33
+ :root {
34
+ --grn-color-grey8-HSL: 0 0% 7%;
35
+
36
+ --grn-color-grey8: hsl(var(--grn-color-grey8-HSL));
37
+ --grn-color-grey7: hsl(0 0% 20%);
38
+ --grn-color-grey6: hsl(0 0% 32%);
39
+ --grn-color-grey5: hsl(0 0% 44%);
40
+ --grn-color-grey4: hsl(0 0% 63%);
41
+ --grn-color-grey3: hsl(0 0% 78%);
42
+ --grn-color-grey2: hsl(0 0% 87%);
43
+ --grn-color-grey1: hsl(0 0% 96%);
44
+
45
+ --grn-color-blue: hsl(218 74% 54%);
46
+ --grn-color-red: hsl(6 66% 65%);
47
+
48
+ --grn-color-body: var(--grn-color-grey8);
49
+ --grn-color-bodyDimmed: hsl(var(--grn-color-grey8-HSL) / 50%);
50
+ --grn-color-accent: var(--grn-color-grey8);
51
+ --grn-color-backgroundSecondary: hsl(0 0% 100%);
52
+ --grn-color-background: var(--grn-color-grey1);
53
+ --grn-color-overlay: hsl(var(--grn-color-grey8-HSL) / 7%);
54
+ --grn-color-border: hsl(var(--grn-color-grey8-HSL) / 9%);
55
+ --grn-color-selection: var(--grn-color-blue);
56
+ --grn-color-danger: var(--grn-color-red);
57
+ }
@@ -47,7 +47,6 @@ export var getSpace = function getSpace(space) {
47
47
  if (space === 0) return space;
48
48
  return u(space);
49
49
  };
50
- console.log("getSpace", getSpace(0));
51
50
  export var getBorder = function getBorder(borderSide) {
52
51
  var borderWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "1px";
53
52
  var borderColor = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "border";
@@ -63,8 +63,7 @@ export var vars = {
63
63
  },
64
64
  radiuses: {
65
65
  s: "s",
66
- m: "m",
67
- l: "l"
66
+ m: "m"
68
67
  },
69
68
  colors: _objectSpread(_objectSpread(_objectSpread({}, greys), baseColors), semanticColors)
70
69
  };
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@flodesk/grain",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "Flodesk design system",
5
5
  "module": "es/index.js",
6
6
  "author": "Flodesk",
7
7
  "license": "UNLICENSED",
8
8
  "scripts": {
9
9
  "test": "echo \"Error: no test specified\" && exit 1",
10
- "dev": "next dev",
10
+ "dev": "next dev -p 4000",
11
11
  "build": "next build",
12
12
  "start": "next start",
13
13
  "lint": "next lint",