@flodesk/grain 2.6.0 → 2.7.2

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.
@@ -1,9 +1,19 @@
1
1
  import "core-js/modules/es.array.slice.js";
2
2
  import "core-js/modules/es.object.freeze.js";
3
3
  import "core-js/modules/es.object.define-properties.js";
4
+ import "core-js/modules/es.object.keys.js";
5
+ import "core-js/modules/es.array.index-of.js";
6
+ import "core-js/modules/es.symbol.js";
7
+ var _excluded = ["children", "size", "weight", "color", "tag", "hasEllipsis", "ellipsisLines", "align"];
4
8
 
5
9
  var _templateObject;
6
10
 
11
+ import "core-js/modules/es.object.assign.js";
12
+
13
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
14
+
15
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
16
+
7
17
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
8
18
 
9
19
  import { getColor, getTextSize, getWeight } from '../../utilities';
@@ -11,12 +21,14 @@ import { PropTypes } from 'prop-types';
11
21
  import React from "react";
12
22
  import styled from "@emotion/styled";
13
23
  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) {
24
+ 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
25
  return getTextSize(p.size);
16
26
  }, function (p) {
17
27
  return getWeight(p.weight);
18
28
  }, function (p) {
19
29
  return getColor(p.color);
30
+ }, function (p) {
31
+ return p.align;
20
32
  }, function (p) {
21
33
  return p.hasEllipsis && "\n overflow: hidden;\n text-overflow: ellipsis;\n ";
22
34
  }, function (p) {
@@ -33,20 +45,25 @@ export var Text = function Text(_ref) {
33
45
  color = _ref.color,
34
46
  tag = _ref.tag,
35
47
  hasEllipsis = _ref.hasEllipsis,
36
- ellipsisLines = _ref.ellipsisLines;
37
- return /*#__PURE__*/React.createElement(Wrapper, {
48
+ ellipsisLines = _ref.ellipsisLines,
49
+ align = _ref.align,
50
+ props = _objectWithoutProperties(_ref, _excluded);
51
+
52
+ return /*#__PURE__*/React.createElement(Wrapper, Object.assign({
38
53
  size: size,
39
54
  weight: weight,
40
55
  color: color,
41
56
  as: tag,
42
57
  hasEllipsis: hasEllipsis,
43
- ellipsisLines: ellipsisLines
44
- }, children);
58
+ ellipsisLines: ellipsisLines,
59
+ align: align
60
+ }, props), children);
45
61
  };
46
62
  Text.propTypes = {
47
63
  size: types.textSize,
48
64
  weight: types.weight,
49
65
  color: types.color,
66
+ align: types.textAlign,
50
67
  tag: PropTypes.string,
51
68
  hasEllipsis: PropTypes.bool,
52
69
  ellipsisLines: PropTypes.number
@@ -26,11 +26,6 @@
26
26
  -moz-osx-font-smoothing: grayscale;
27
27
  }
28
28
 
29
- .grn-context a {
30
- color: inherit;
31
- text-decoration: none;
32
- }
33
-
34
29
  *, *:before, *:after {
35
30
  box-sizing: border-box;
36
31
  }
@@ -3,11 +3,11 @@
3
3
  }
4
4
 
5
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);
6
+ --grn-text-s: 13px;
7
+ --grn-text-m: 15px;
8
+ --grn-text-l: 20px;
9
+ --grn-text-xl: 24px;
10
+ --grn-text-xxl: 30px;
11
11
  }
12
12
 
13
13
  :root {
@@ -26,9 +26,9 @@
26
26
  }
27
27
 
28
28
  :root {
29
- --grn-radius-m: calc(var(--grn-unit) * 0.625);
30
- --grn-radius-l: calc(var(--grn-unit) * 1.25);
31
- --grn-radius-xl: calc(var(--grn-unit) * 2);
29
+ --grn-radius-m: 5px;
30
+ --grn-radius-l: 10px;
31
+ --grn-radius-xl: 15px;
32
32
  }
33
33
 
34
34
  :root {
@@ -58,23 +58,23 @@
58
58
  }
59
59
 
60
60
  :root {
61
- --grn-shadowLayer-1: 0 calc(var(--grn-unit) * 0.125) calc(var(--grn-unit) * 0.5) hsl(var(--grn-color-grey8-HSL) / 7%);
62
- --grn-shadowLayer-2: 0 calc(var(--grn-unit) * 0.25) calc(var(--grn-unit) * 1.5) hsl(var(--grn-color-grey8-HSL) / 7%);
63
- --grn-shadowLayer-3: 0 calc(var(--grn-unit) * 0.25) calc(var(--grn-unit) * 2.5) hsl(var(--grn-color-grey8-HSL) / 10%);
64
- --grn-shadowLayer-4: 0 calc(var(--grn-unit) * 0.25) calc(var(--grn-unit) * 7) hsl(var(--grn-color-grey8-HSL) / 10%);
65
-
61
+ --c: hsl(var(--grn-color-grey8-HSL) / 4%);
62
+
66
63
  --grn-shadow-s:
67
- var(--grn-shadowLayer-1),
68
- var(--grn-shadowLayer-2)
64
+ 0 0px 1px hsl(0 0% 0% / 6%),
65
+ 0 1px 2px hsl(0 0% 0% / 5%),
66
+ 0 2px 4px hsl(0 0% 0% / 3%),
67
+ 0 4px 8px hsl(0 0% 0% / 3%)
69
68
  ;
70
69
 
71
70
  --grn-shadow-m:
72
- var(--grn-shadowLayer-1),
73
- var(--grn-shadowLayer-3)
71
+ var(--grn-shadow-s),
72
+ 0 8px 16px hsl(0 0% 0% / 3%)
74
73
  ;
75
74
 
76
75
  --grn-shadow-l:
77
- var(--grn-shadowLayer-1),
78
- var(--grn-shadowLayer-4)
76
+ var(--grn-shadow-m),
77
+ 0 16px 64px hsl(0 0% 0% / 2%),
78
+ 0 32px 128px hsl(0 0% 0% / 2%)
79
79
  ;
80
- }
80
+ }
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
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flodesk/grain",
3
- "version": "2.6.0",
3
+ "version": "2.7.2",
4
4
  "description": "Flodesk design system",
5
5
  "module": "es/index.js",
6
6
  "author": "Flodesk",