@flodesk/grain 1.4.0 → 1.5.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.
@@ -26,10 +26,6 @@
26
26
  }
27
27
 
28
28
  :root {
29
- --grn-color-body: hsl(0 0% 7%);
30
- --grn-color-bodyDimmed: hsl(0 0% 7% / 50%);
31
- --grn-color-primary: hsl(0 0% 7%);
32
-
33
29
  --grn-color-grey8: hsl(0 0% 7%);
34
30
  --grn-color-grey7: hsl(0 0% 20%);
35
31
  --grn-color-grey6: hsl(0 0% 32%);
@@ -38,6 +34,13 @@
38
34
  --grn-color-grey3: hsl(0 0% 78%);
39
35
  --grn-color-grey2: hsl(0 0% 87%);
40
36
  --grn-color-grey1: hsl(0 0% 96%);
37
+
38
+ --grn-color-body: var(--grn-color-grey8);
39
+ --grn-color-bodyDimmed: hsl(0 0% 7% / 50%);
40
+ --grn-color-primary: var(--grn-color-grey8);
41
+ --grn-color-backgroundSecondary: hsl(0 0% 100%);
42
+ --grn-color-background: var(--grn-color-grey1);
43
+ --grn-color-border: hsl(0 0% 7% / 15%);
41
44
  }
42
45
 
43
46
  * {
@@ -52,7 +55,7 @@
52
55
  }
53
56
 
54
57
  body {
55
- font-family: 'BeausiteClassic';
58
+ font-family: 'BeausiteClassic', sans-serif;
56
59
  color: var(--grn-color-body);
57
60
  font-size: var(--grn-text-m);
58
61
  }
@@ -7,10 +7,10 @@ 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 { textSizes, weights } from '../../variables';
11
10
  import PropTypes from 'prop-types';
12
11
  import React from "react";
13
12
  import styled from "@emotion/styled";
13
+ import { varOptions } from '../../variables';
14
14
  var Wrapper = styled.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: block;\n font-size: ", ";\n font-weight: ", ";\n color: ", ";\n"])), function (p) {
15
15
  return getTextSize(p.size);
16
16
  }, function (p) {
@@ -32,7 +32,7 @@ export var Text = function Text(_ref) {
32
32
  }, children);
33
33
  };
34
34
  Text.propTypes = {
35
- size: PropTypes.oneOf(textSizes),
36
- weight: PropTypes.oneOf(weights),
37
- color: PropTypes.oneOfType([PropTypes.oneOf(weights), PropTypes.string])
35
+ size: PropTypes.oneOf(varOptions.textSizes),
36
+ weight: PropTypes.oneOf(varOptions.weights),
37
+ color: PropTypes.oneOfType([PropTypes.oneOf(varOptions.weights), PropTypes.string])
38
38
  };
@@ -1,23 +1,23 @@
1
1
  import "core-js/modules/es.array.includes.js";
2
2
  import "core-js/modules/es.string.includes.js";
3
3
  import "core-js/modules/es.array.concat.js";
4
- import { allColors, colorVarPrefix, cssVarPrefix, textSizes, textVarPrefix, weightVarPrefix, weights } from "../variables";
4
+ import { grnPrefix, varOptions, varPrefixes } from "../variables";
5
5
  export var getColor = function getColor(color) {
6
- if (allColors.includes(color)) {
7
- return "var(".concat(cssVarPrefix).concat(colorVarPrefix).concat(color, ")");
6
+ if (varOptions.allColors.includes(color)) {
7
+ return "var(".concat(grnPrefix).concat(varPrefixes.color).concat(color, ")");
8
8
  }
9
9
 
10
10
  return color;
11
11
  };
12
12
  export var getTextSize = function getTextSize(size) {
13
- if (textSizes.includes(size)) {
14
- return "var(".concat(cssVarPrefix).concat(textVarPrefix).concat(size, ")");
13
+ if (varOptions.textSizes.includes(size)) {
14
+ return "var(".concat(grnPrefix).concat(varPrefixes.text).concat(size, ")");
15
15
  }
16
16
 
17
17
  return size;
18
18
  };
19
19
  export var getWeight = function getWeight(weight) {
20
- if (weights.includes(weight)) {
21
- return "var(".concat(cssVarPrefix).concat(weightVarPrefix).concat(weight, ")");
20
+ if (varOptions.weights.includes(weight)) {
21
+ return "var(".concat(grnPrefix).concat(varPrefixes.weight).concat(weight, ")");
22
22
  }
23
23
  };
@@ -29,14 +29,18 @@ for (var step = 1; step < greysAmount + 1; step++) {
29
29
  greysArray.push("grey" + step);
30
30
  }
31
31
 
32
- export var cssVarPrefix = "--grn-";
33
- export var spaceVarPrefix = "space-";
34
- export var weightVarPrefix = "weight-";
35
- export var textVarPrefix = "text-";
36
- export var colorVarPrefix = "color-";
32
+ export var grnPrefix = "--grn-";
33
+ export var varPrefixes = {
34
+ space: "space-",
35
+ weight: "weight-",
36
+ text: "text-",
37
+ color: "color-"
38
+ };
37
39
  export var greys = greysArray.reverse();
38
- export var semanticColors = ["body", "bodyDimmed", "primary"];
39
- export var textSizes = ["s", "m", "l", "xl", "xxl"];
40
- export var spaces = ["xs", "s", "m", "l", "xl", "xxl"];
41
- export var weights = ["normal", "medium", "semiBold"];
42
- export var allColors = [].concat(_toConsumableArray(greys), semanticColors);
40
+ export var semanticColors = ["body", "bodyDimmed", "primary", "backgroundSecondary", "background", "border"];
41
+ export var varOptions = {
42
+ textSizes: ["s", "m", "l", "xl", "xxl"],
43
+ spaces: ["xs", "s", "m", "l", "xl", "xxl"],
44
+ weights: ["normal", "medium", "semiBold"],
45
+ allColors: [].concat(_toConsumableArray(greys), semanticColors)
46
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flodesk/grain",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "Flodesk design system",
5
5
  "module": "es/index.js",
6
6
  "author": "Flodesk",