@flodesk/grain 2.7.6 → 2.9.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.
@@ -17,13 +17,13 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
17
17
 
18
18
  require("core-js/modules/es.array.concat.js");
19
19
 
20
- var _utilities = require("../../utilities");
20
+ var _utilities = require("../utilities");
21
21
 
22
22
  var _react = _interopRequireDefault(require("react"));
23
23
 
24
24
  var _styled = _interopRequireDefault(require("@emotion/styled"));
25
25
 
26
- var _types = require("../../types");
26
+ var _types = require("../types");
27
27
 
28
28
  var _excluded = ["children", "color", "backgroundColor", "borderSide", "borderWidth", "borderColor", "width", "height", "radius", "padding", "paddingTop", "paddingBottom", "paddingLeft", "paddingRight", "paddingX", "paddingY", "margin", "marginTop", "marginBottom", "marginLeft", "marginRight", "marginX", "marginY", "position", "top", "bottom", "left", "right", "shadow", "overflow", "aspectRatio"];
29
29
 
@@ -164,6 +164,9 @@ Box.__docgenInfo = {
164
164
  "value": [{
165
165
  "value": "\"greys\"",
166
166
  "computed": false
167
+ }, {
168
+ "value": "\"fades\"",
169
+ "computed": false
167
170
  }, {
168
171
  "value": "\"baseColors\"",
169
172
  "computed": false
@@ -186,6 +189,9 @@ Box.__docgenInfo = {
186
189
  "value": [{
187
190
  "value": "\"greys\"",
188
191
  "computed": false
192
+ }, {
193
+ "value": "\"fades\"",
194
+ "computed": false
189
195
  }, {
190
196
  "value": "\"baseColors\"",
191
197
  "computed": false
@@ -249,6 +255,9 @@ Box.__docgenInfo = {
249
255
  "value": [{
250
256
  "value": "\"greys\"",
251
257
  "computed": false
258
+ }, {
259
+ "value": "\"fades\"",
260
+ "computed": false
252
261
  }, {
253
262
  "value": "\"baseColors\"",
254
263
  "computed": false
@@ -293,6 +302,9 @@ Box.__docgenInfo = {
293
302
  "value": [{
294
303
  "name": "enum",
295
304
  "value": [{
305
+ "value": "\"xs\"",
306
+ "computed": false
307
+ }, {
296
308
  "value": "\"s\"",
297
309
  "computed": false
298
310
  }, {
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.object.define-property.js");
4
+
5
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
6
+
7
+ Object.defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+ exports.Button = void 0;
11
+
12
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
+
14
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
15
+
16
+ require("core-js/modules/es.array.concat.js");
17
+
18
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
19
+
20
+ var _utilities = require("../utilities");
21
+
22
+ var _react = _interopRequireDefault(require("react"));
23
+
24
+ var _styled = _interopRequireDefault(require("@emotion/styled"));
25
+
26
+ var _react2 = require("@emotion/react");
27
+
28
+ var _excluded = ["children", "tag", "variant", "isDisabled"];
29
+
30
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
31
+
32
+ var __jsx = _react.default.createElement;
33
+ var variables = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n --grn-buttonTextBoxPaddingX-m: 20px;\n --grn-color-buttonBorder: var(--grn-color-fade4);\n --grn-color-buttonBorder-hover: var(--grn-color-fade6);\n --grn-color-buttonBorder-active: var(--grn-color-grey8);\n"])));
34
+ var variants = {
35
+ neutral: (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n color: inherit;\n background-color: transparent;\n border-color: var(--grn-color-buttonBorder);\n\n &:hover {\n border-color: var(--grn-color-buttonBorder-hover);\n }\n &:active {\n border-color: var(--grn-color-buttonBorder-active);\n }\n "]))),
36
+ primary: (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n color: white;\n background-color: ", ";\n border-color: transparent;\n\n &:hover {\n background-color: ", ";\n }\n &:active {\n color: ", ";\n background-color: black;\n }\n "])), (0, _utilities.getColor)('accent'), (0, _utilities.getColor)('grey7'), (0, _utilities.getColor)('grey2'))
37
+ };
38
+
39
+ var Wrapper = _styled.default.button(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n ", ";\n appearance: none;\n border: none;\n font-family: inherit;\n font-size: inherit;\n cursor: pointer;\n border-width: 1px;\n border-style: solid;\n font-weight: ", ";\n border-radius: ", ";\n transition: ", ";\n height: var(--grn-textBoxHeight-m);\n padding: 0 var(--grn-buttonTextBoxPaddingX-m);\n background-color: transparent;\n\n ", ";\n\n ", ";\n\n &:hover {\n transition: ", ";\n }\n\n &:active {\n transition: 0s;\n }\n"])), variables, (0, _utilities.getWeight)('medium'), (0, _utilities.getRadius)('s'), (0, _utilities.getTransition)('slow'), function (p) {
40
+ return !p.isDisabled && variants[p.variant];
41
+ }, function (p) {
42
+ return p.isDisabled && "\n color: ".concat((0, _utilities.getColor)('disabledContent'), ";\n background-color: ").concat((0, _utilities.getColor)('disabledBackground'), ";\n border-color: transparent;\n cursor: default;\n ");
43
+ }, (0, _utilities.getTransition)('fast'));
44
+
45
+ var ButtonText = _styled.default.span(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n --opticalCompensation: -0.3px;\n\n position: relative;\n top: var(--opticalCompensation);\n"])));
46
+
47
+ var Button = function Button(_ref) {
48
+ var children = _ref.children,
49
+ tag = _ref.tag,
50
+ _ref$variant = _ref.variant,
51
+ variant = _ref$variant === void 0 ? 'neutral' : _ref$variant,
52
+ isDisabled = _ref.isDisabled,
53
+ props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
54
+ return __jsx(Wrapper, (0, _extends2.default)({
55
+ as: tag,
56
+ variant: variant,
57
+ isDisabled: isDisabled
58
+ }, props), __jsx(ButtonText, null, children));
59
+ };
60
+
61
+ exports.Button = Button;
62
+ Button.__docgenInfo = {
63
+ "description": "",
64
+ "methods": [],
65
+ "displayName": "Button",
66
+ "props": {
67
+ "variant": {
68
+ "defaultValue": {
69
+ "value": "'neutral'",
70
+ "computed": false
71
+ },
72
+ "type": {
73
+ "name": "enum",
74
+ "value": [{
75
+ "value": "\"neutral\"",
76
+ "computed": false
77
+ }, {
78
+ "value": "\"primary\"",
79
+ "computed": false
80
+ }]
81
+ },
82
+ "required": false,
83
+ "description": ""
84
+ },
85
+ "children": {
86
+ "type": {
87
+ "name": "node"
88
+ },
89
+ "required": false,
90
+ "description": ""
91
+ },
92
+ "onClick": {
93
+ "type": {
94
+ "name": "func"
95
+ },
96
+ "required": false,
97
+ "description": ""
98
+ },
99
+ "isDisabled": {
100
+ "type": {
101
+ "name": "bool"
102
+ },
103
+ "required": false,
104
+ "description": ""
105
+ }
106
+ }
107
+ };
@@ -23,10 +23,10 @@ Object.defineProperty(exports, "Button", {
23
23
  return _button.Button;
24
24
  }
25
25
  });
26
- Object.defineProperty(exports, "Input", {
26
+ Object.defineProperty(exports, "TextInput", {
27
27
  enumerable: true,
28
28
  get: function get() {
29
- return _input.Input;
29
+ return _textInput.TextInput;
30
30
  }
31
31
  });
32
32
 
@@ -36,4 +36,4 @@ var _box = require("./box");
36
36
 
37
37
  var _button = require("./button");
38
38
 
39
- var _input = require("./input");
39
+ var _textInput = require("./text-input");
@@ -0,0 +1,124 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.object.define-property.js");
4
+
5
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
6
+
7
+ Object.defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+ exports.TextInput = void 0;
11
+
12
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
+
14
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
15
+
16
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
17
+
18
+ var _utilities = require("../utilities");
19
+
20
+ var _react = _interopRequireDefault(require("react"));
21
+
22
+ var _styled = _interopRequireDefault(require("@emotion/styled"));
23
+
24
+ var _types = require("../types");
25
+
26
+ var _react2 = require("@emotion/react");
27
+
28
+ var _excluded = ["value", "placeholder", "size", "label", "id"];
29
+
30
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
31
+
32
+ var __jsx = _react.default.createElement;
33
+ var variables = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n --grn-fieldTextBoxPaddingX-s: 8px;\n --grn-fieldTextBoxPaddingX-m: 12px;\n --grn-color-fieldBorder: var(--grn-color-fade3);\n --grn-color-fieldBorder-hover: var(--grn-color-fade6);\n"])));
34
+ var inputSizes = {
35
+ s: (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n height: var(--grn-textBoxHeight-s);\n padding: 0 var(--grn-fieldTextBoxPaddingX-s);\n border-radius: ", ";\n "])), (0, _utilities.getRadius)('xs')),
36
+ m: (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n height: var(--grn-textBoxHeight-m);\n padding: 0 var(--grn-fieldTextBoxPaddingX-m);\n border-radius: ", ";\n "])), (0, _utilities.getRadius)('s'))
37
+ };
38
+ var labelSizes = {
39
+ s: '2px',
40
+ m: 'xs'
41
+ };
42
+
43
+ var Wrapper = _styled.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n ", ";\n font-size: ", ";\n"])), variables, function (p) {
44
+ return (0, _utilities.getTextSize)(p.size);
45
+ });
46
+
47
+ var Label = _styled.default.label(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n display: block;\n margin-bottom: ", ";\n"])), function (p) {
48
+ return (0, _utilities.getSpace)(labelSizes[p.size]);
49
+ });
50
+
51
+ var InputField = _styled.default.input(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n appearance: none;\n border: none;\n font-family: inherit;\n background-color: transparent;\n color: inherit;\n font-size: inherit;\n transition: ", ";\n border: 1px solid var(--grn-color-fieldBorder);\n width: 100%;\n ", ";\n outline: none;\n\n &::placeholder {\n color: ", ";\n }\n\n &:hover {\n transition: ", ";\n border-color: var(--grn-color-fieldBorder-hover);\n }\n \n &:focus {\n transition: 0s;\n border-color: var(--grn-color-selection);\n }\n"])), (0, _utilities.getTransition)('slow'), function (p) {
52
+ return inputSizes[p.size];
53
+ }, (0, _utilities.getColor)('grey5'), (0, _utilities.getTransition)('fast'));
54
+
55
+ var TextInput = function TextInput(_ref) {
56
+ var value = _ref.value,
57
+ placeholder = _ref.placeholder,
58
+ _ref$size = _ref.size,
59
+ size = _ref$size === void 0 ? 'm' : _ref$size,
60
+ label = _ref.label,
61
+ id = _ref.id,
62
+ props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
63
+ return __jsx(Wrapper, {
64
+ size: size,
65
+ type: "text"
66
+ }, label && __jsx(Label, {
67
+ htmlFor: id,
68
+ size: size
69
+ }, label), __jsx(InputField, (0, _extends2.default)({
70
+ value: value,
71
+ placeholder: placeholder,
72
+ size: size,
73
+ label: label,
74
+ id: id
75
+ }, props)));
76
+ };
77
+
78
+ exports.TextInput = TextInput;
79
+ TextInput.__docgenInfo = {
80
+ "description": "",
81
+ "methods": [],
82
+ "displayName": "TextInput",
83
+ "props": {
84
+ "size": {
85
+ "defaultValue": {
86
+ "value": "'m'",
87
+ "computed": false
88
+ },
89
+ "type": {
90
+ "name": "enum",
91
+ "value": [{
92
+ "value": "\"s\"",
93
+ "computed": false
94
+ }, {
95
+ "value": "\"m\"",
96
+ "computed": false
97
+ }]
98
+ },
99
+ "required": false,
100
+ "description": ""
101
+ },
102
+ "id": {
103
+ "type": {
104
+ "name": "string"
105
+ },
106
+ "required": true,
107
+ "description": ""
108
+ },
109
+ "value": {
110
+ "type": {
111
+ "name": "string"
112
+ },
113
+ "required": false,
114
+ "description": ""
115
+ },
116
+ "label": {
117
+ "type": {
118
+ "name": "node"
119
+ },
120
+ "required": false,
121
+ "description": ""
122
+ }
123
+ }
124
+ };
@@ -15,13 +15,13 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
15
15
 
16
16
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
17
17
 
18
- var _utilities = require("../../utilities");
18
+ var _utilities = require("../utilities");
19
19
 
20
20
  var _react = _interopRequireDefault(require("react"));
21
21
 
22
22
  var _styled = _interopRequireDefault(require("@emotion/styled"));
23
23
 
24
- var _types = require("../../types");
24
+ var _types = require("../types");
25
25
 
26
26
  var _excluded = ["children", "size", "weight", "color", "tag", "hasEllipsis", "ellipsisLines", "align"];
27
27
 
@@ -137,6 +137,9 @@ Text.__docgenInfo = {
137
137
  "value": [{
138
138
  "value": "\"greys\"",
139
139
  "computed": false
140
+ }, {
141
+ "value": "\"fades\"",
142
+ "computed": false
140
143
  }, {
141
144
  "value": "\"baseColors\"",
142
145
  "computed": false
@@ -16,6 +16,7 @@
16
16
  .grn-context, .grn-context * {
17
17
  letter-spacing: var(--grn-letterSpacing-global);
18
18
  line-height: var(--grn-lineHeight-global);
19
+ outline-color: var(--grn-color-selection);
19
20
  }
20
21
 
21
22
  .grn-context {
@@ -1,9 +1,4 @@
1
1
  :root {
2
- --grn-textBoxHeight-s: calc(var(--grn-unit) * 3.5);
3
- --grn-textBoxHeight-m: calc(var(--grn-unit) * 5);
4
-
5
- --grn-fieldTextBoxPaddingX-s: calc(var(--grn-unit) * 1);
6
- --grn-fieldTextBoxPaddingX-m: calc(var(--grn-unit) * 1.5);
7
-
8
- --grn-buttonTextBoxPaddingX-m: calc(var(--grn-unit) * 2.5);
2
+ --grn-textBoxHeight-s: 28px;
3
+ --grn-textBoxHeight-m: 40px;
9
4
  }
@@ -26,35 +26,58 @@
26
26
  }
27
27
 
28
28
  :root {
29
+ --grn-radius-xs: 3.5px;
29
30
  --grn-radius-s: 5px;
30
31
  --grn-radius-m: 10px;
31
32
  --grn-radius-l: 15px;
32
33
  }
33
34
 
34
35
  :root {
35
- --grn-color-grey8-HSL: 0 0% 7%;
36
+ --grn-transition-slow: 400ms;
37
+ --grn-transition-fast: 200ms;
38
+ }
39
+
40
+ :root {
41
+ --grn-color-grey8-HS: 0 0%;
42
+ --grn-color-grey8-HSL: var(--grn-color-grey8-HS) 7%;
36
43
 
37
44
  --grn-color-grey8: hsl(var(--grn-color-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% 50%);
41
- --grn-color-grey4: hsl(0 0% 66%);
42
- --grn-color-grey3: hsl(0 0% 83%);
43
- --grn-color-grey2: hsl(0 0% 93%);
44
- --grn-color-grey1: hsl(0 0% 98%);
45
+ --grn-color-grey7: hsl(var(--grn-color-grey8-HS) 20%);
46
+ --grn-color-grey6: hsl(var(--grn-color-grey8-HS) 32%);
47
+ --grn-color-grey5: hsl(var(--grn-color-grey8-HS) 50%);
48
+ --grn-color-grey4: hsl(var(--grn-color-grey8-HS) 66%);
49
+ --grn-color-grey3: hsl(var(--grn-color-grey8-HS) 83%);
50
+ --grn-color-grey2: hsl(var(--grn-color-grey8-HS) 93%);
51
+ --grn-color-grey1: hsl(var(--grn-color-grey8-HS) 98%);
52
+ }
53
+
54
+ :root {
55
+ --grn-color-fade7: hsl(var(--grn-color-grey8-HS) 0% / 49%);
56
+ --grn-color-fade6: hsl(var(--grn-color-grey8-HS) 0% / 42%);
57
+ --grn-color-fade5: hsl(var(--grn-color-grey8-HS) 0% / 35%);
58
+ --grn-color-fade4: hsl(var(--grn-color-grey8-HS) 0% / 28%);
59
+ --grn-color-fade3: hsl(var(--grn-color-grey8-HS) 0% / 21%);
60
+ --grn-color-fade2: hsl(var(--grn-color-grey8-HS) 0% / 14%);
61
+ --grn-color-fade1: hsl(var(--grn-color-grey8-HS) 0% / 7%);
62
+ }
45
63
 
64
+ :root {
46
65
  --grn-color-blue: hsl(218 74% 54%);
47
66
  --grn-color-red: hsl(6 66% 65%);
67
+ }
48
68
 
69
+ :root {
49
70
  --grn-color-body: var(--grn-color-grey8);
50
- --grn-color-bodyDimmed: hsl(var(--grn-color-grey8-HSL) / 50%);
71
+ --grn-color-bodyDimmed: var(--grn-color-fade7);
51
72
  --grn-color-accent: var(--grn-color-grey8);
52
- --grn-color-backgroundSecondary: hsl(0 0% 100%);
73
+ --grn-color-backgroundSecondary: white;
53
74
  --grn-color-background: var(--grn-color-grey1);
54
- --grn-color-overlay: hsl(var(--grn-color-grey8-HSL) / 7%);
55
- --grn-color-border: hsl(var(--grn-color-grey8-HSL) / 15%);
75
+ --grn-color-overlay: var(--grn-color-fade1);
76
+ --grn-color-border: var(--grn-color-fade2);
56
77
  --grn-color-selection: var(--grn-color-blue);
57
78
  --grn-color-danger: var(--grn-color-red);
79
+ --grn-color-disabledContent: var(--grn-color-grey5);
80
+ --grn-color-disabledBackground: var(--grn-color-fade1);
58
81
  }
59
82
 
60
83
  :root {
@@ -13,7 +13,7 @@ require("core-js/modules/es.object.keys.js");
13
13
 
14
14
  var _propTypes = _interopRequireDefault(require("prop-types"));
15
15
 
16
- var _variables = require("../variables");
16
+ var _variables = require("./variables");
17
17
 
18
18
  var types = {
19
19
  color: _propTypes.default.oneOfType([_propTypes.default.oneOf(Object.keys(_variables.vars.colors)), _propTypes.default.string]),
@@ -26,6 +26,7 @@ var types = {
26
26
  textSize: _propTypes.default.oneOfType([_propTypes.default.oneOf(Object.keys(_variables.vars.textSizes)), _propTypes.default.number, _propTypes.default.string]),
27
27
  weight: _propTypes.default.oneOf(Object.keys(_variables.vars.weights)),
28
28
  textAlign: _propTypes.default.oneOf(["left", "center", "right"]),
29
- overflow: _propTypes.default.oneOf(["visible", "hidden", "scroll", "auto"])
29
+ overflow: _propTypes.default.oneOf(["visible", "hidden", "scroll", "auto"]),
30
+ fieldSize: _propTypes.default.oneOf(["s", "m"])
30
31
  };
31
32
  exports.types = types;
@@ -23,13 +23,13 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
23
23
  Object.defineProperty(exports, "__esModule", {
24
24
  value: true
25
25
  });
26
- exports.getBorder = exports.getSpace = exports.getRadius = exports.getWeight = exports.getTextSize = exports.getShadow = exports.getColor = exports.getCssVar = exports.getCssVarCore = exports.isBrowser = void 0;
26
+ exports.getBorder = exports.getSpace = exports.getTransition = exports.getRadius = exports.getWeight = exports.getTextSize = exports.getShadow = exports.getColor = exports.getCssVar = exports.getCssVarCore = exports.isBrowser = void 0;
27
27
 
28
28
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
29
29
 
30
30
  require("core-js/modules/es.array.concat.js");
31
31
 
32
- var _variables = require("../variables");
32
+ var _variables = require("./variables");
33
33
 
34
34
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
35
35
 
@@ -55,7 +55,7 @@ var u = function u(amount) {
55
55
  };
56
56
 
57
57
  var getColor = function getColor(color) {
58
- if (color in _objectSpread(_objectSpread(_objectSpread({}, _variables.vars.colors.baseColors), _variables.vars.colors.greys), _variables.vars.colors.semanticColors)) {
58
+ if (color in _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, _variables.vars.colors.baseColors), _variables.vars.colors.greys), _variables.vars.colors.semanticColors), _variables.vars.colors.fades)) {
59
59
  return getCssVar("color", color);
60
60
  }
61
61
 
@@ -104,6 +104,14 @@ var getRadius = function getRadius(radius) {
104
104
 
105
105
  exports.getRadius = getRadius;
106
106
 
107
+ var getTransition = function getTransition(transition) {
108
+ if (transition in _variables.vars.transitions) {
109
+ return getCssVar("transition", transition);
110
+ }
111
+ };
112
+
113
+ exports.getTransition = getTransition;
114
+
107
115
  var getSpace = function getSpace(space) {
108
116
  if (isNaN(space)) {
109
117
  if (space in _variables.vars.spaces) {
@@ -30,6 +30,7 @@ var vars = {
30
30
  semiBold: "semiBold"
31
31
  },
32
32
  radiuses: {
33
+ xs: "xs",
33
34
  s: "s",
34
35
  m: "m",
35
36
  l: "l"
@@ -39,6 +40,10 @@ var vars = {
39
40
  m: "m",
40
41
  l: "l"
41
42
  },
43
+ transitions: {
44
+ slow: "slow",
45
+ fast: "fast"
46
+ },
42
47
  colors: {
43
48
  greys: {
44
49
  grey8: "grey8",
@@ -50,6 +55,15 @@ var vars = {
50
55
  grey2: "grey2",
51
56
  grey1: "grey1"
52
57
  },
58
+ fades: {
59
+ fade7: "fade7",
60
+ fade6: "fade6",
61
+ fade5: "fade5",
62
+ fade4: "fade4",
63
+ fade3: "fade3",
64
+ fade2: "fade2",
65
+ fade1: "fade1"
66
+ },
53
67
  baseColors: {
54
68
  blue: "blue",
55
69
  red: "red"
@@ -63,7 +77,9 @@ var vars = {
63
77
  overlay: "overlay",
64
78
  border: "border",
65
79
  selection: "selection",
66
- danger: "danger"
80
+ danger: "danger",
81
+ disabledContent: "disabledContent",
82
+ disabledBackground: "disabledBackground"
67
83
  }
68
84
  }
69
85
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flodesk/grain",
3
- "version": "2.7.6",
3
+ "version": "2.9.0",
4
4
  "description": "Flodesk design system",
5
5
  "module": "es/index.js",
6
6
  "author": "Flodesk",
@@ -1,72 +0,0 @@
1
- "use strict";
2
-
3
- require("core-js/modules/es.object.define-property.js");
4
-
5
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
6
-
7
- Object.defineProperty(exports, "__esModule", {
8
- value: true
9
- });
10
- exports.Button = void 0;
11
-
12
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
-
14
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
15
-
16
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
17
-
18
- var _utilities = require("../../utilities");
19
-
20
- var _react = _interopRequireDefault(require("react"));
21
-
22
- var _styled = _interopRequireDefault(require("@emotion/styled"));
23
-
24
- var _excluded = ["children", "size", "weight", "color", "tag"];
25
-
26
- var _templateObject, _templateObject2;
27
-
28
- var __jsx = _react.default.createElement;
29
-
30
- var Wrapper = _styled.default.button(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n appearance: none;\n border: none;\n font-family: inherit;\n font-size: ", ";\n font-weight: ", ";\n cursor: pointer;\n background-color: ", ";\n color: ", ";\n border-radius: ", ";\n height: var(--grn-textBoxHeight-m);\n padding: 0 var(--grn-buttonTextBoxPaddingX-m);\n"])), (0, _utilities.getTextSize)('m'), (0, _utilities.getWeight)('medium'), (0, _utilities.getColor)('body'), (0, _utilities.getColor)('white'), (0, _utilities.getRadius)('m'));
31
-
32
- var ButtonText = _styled.default.span(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n --opticalCompensation: -0.3px;\n\n position: relative;\n top: var(--opticalCompensation);\n"])));
33
-
34
- var Button = function Button(_ref) {
35
- var children = _ref.children,
36
- _ref$size = _ref.size,
37
- size = _ref$size === void 0 ? 'm' : _ref$size,
38
- _ref$weight = _ref.weight,
39
- weight = _ref$weight === void 0 ? 'normal' : _ref$weight,
40
- color = _ref.color,
41
- tag = _ref.tag,
42
- props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
43
- return __jsx(Wrapper, (0, _extends2.default)({
44
- size: size,
45
- weight: weight,
46
- color: color,
47
- as: tag
48
- }, props), __jsx(ButtonText, null, children));
49
- };
50
-
51
- exports.Button = Button;
52
- Button.__docgenInfo = {
53
- "description": "",
54
- "methods": [],
55
- "displayName": "Button",
56
- "props": {
57
- "size": {
58
- "defaultValue": {
59
- "value": "'m'",
60
- "computed": false
61
- },
62
- "required": false
63
- },
64
- "weight": {
65
- "defaultValue": {
66
- "value": "'normal'",
67
- "computed": false
68
- },
69
- "required": false
70
- }
71
- }
72
- };
@@ -1,75 +0,0 @@
1
- "use strict";
2
-
3
- require("core-js/modules/es.object.define-property.js");
4
-
5
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
6
-
7
- Object.defineProperty(exports, "__esModule", {
8
- value: true
9
- });
10
- exports.Input = void 0;
11
-
12
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
-
14
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
15
-
16
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
17
-
18
- var _utilities = require("../../utilities");
19
-
20
- var _react = _interopRequireDefault(require("react"));
21
-
22
- var _styled = _interopRequireDefault(require("@emotion/styled"));
23
-
24
- var _types = require("../../types");
25
-
26
- var _excluded = ["value", "placeholder", "size"];
27
-
28
- var _templateObject;
29
-
30
- var __jsx = _react.default.createElement;
31
-
32
- var Wrapper = _styled.default.input(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n appearance: none;\n border: none;\n font-family: inherit;\n background-color: transparent;\n color: inherit;\n font-size: ", ";\n border-radius: ", ";\n border: 1px solid ", ";\n height: ", ";\n padding: 0 ", ";\n width: 100%;\n"])), function (p) {
33
- return (0, _utilities.getTextSize)(p.size);
34
- }, (0, _utilities.getRadius)('m'), (0, _utilities.getColor)('grey3'), function (p) {
35
- return "var(--grn-textBoxHeight-".concat(p.size, ")");
36
- }, function (p) {
37
- return "var(--grn-fieldTextBoxPaddingX-".concat(p.size, ")");
38
- });
39
-
40
- var Input = function Input(_ref) {
41
- var value = _ref.value,
42
- _ref$placeholder = _ref.placeholder,
43
- placeholder = _ref$placeholder === void 0 ? 'Placeholder' : _ref$placeholder,
44
- _ref$size = _ref.size,
45
- size = _ref$size === void 0 ? 'm' : _ref$size,
46
- props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
47
- return __jsx(Wrapper, (0, _extends2.default)({
48
- value: value,
49
- placeholder: placeholder,
50
- size: size
51
- }, props));
52
- };
53
-
54
- exports.Input = Input;
55
- Input.__docgenInfo = {
56
- "description": "",
57
- "methods": [],
58
- "displayName": "Input",
59
- "props": {
60
- "placeholder": {
61
- "defaultValue": {
62
- "value": "'Placeholder'",
63
- "computed": false
64
- },
65
- "required": false
66
- },
67
- "size": {
68
- "defaultValue": {
69
- "value": "'m'",
70
- "computed": false
71
- },
72
- "required": false
73
- }
74
- }
75
- };