@flodesk/grain 2.17.0 → 2.18.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.
@@ -27,7 +27,7 @@ var _react2 = require("@emotion/react");
27
27
 
28
28
  var _types = require("../types");
29
29
 
30
- var _excluded = ["children", "variant", "isDisabled", "icon"];
30
+ var _excluded = ["children", "variant", "isDisabled", "icon", "hasFullWidth"];
31
31
 
32
32
  var _templateObject, _templateObject2, _templateObject3, _templateObject4;
33
33
 
@@ -38,8 +38,10 @@ var variants = {
38
38
  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'))
39
39
  };
40
40
 
41
- 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-paddingX-m);\n background-color: transparent;\n display: flex;\n align-items: center;\n gap: 12px;\n\n ", ";\n \n &:hover {\n transition: ", ";\n }\n\n &:active {\n transition: 0s;\n }\n \n &:disabled {\n color: ", ";\n background-color: ", ";\n border-color: transparent;\n cursor: default;\n }\n"])), variables, (0, _utilities.getWeight)('medium'), (0, _utilities.getRadius)('s'), (0, _utilities.getTransition)('slow'), function (p) {
41
+ 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-paddingX-m);\n background-color: transparent;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 12px;\n\n ", ";\n ", ";\n \n &:hover {\n transition: ", ";\n }\n\n &:active {\n transition: 0s;\n }\n \n &:disabled {\n color: ", ";\n background-color: ", ";\n border-color: transparent;\n cursor: default;\n }\n"])), variables, (0, _utilities.getWeight)('medium'), (0, _utilities.getRadius)('s'), (0, _utilities.getTransition)('slow'), function (p) {
42
42
  return !p.isDisabled && variants[p.variant];
43
+ }, function (p) {
44
+ return p.hasFullWidth && "width: 100%";
43
45
  }, (0, _utilities.getTransition)('fast'), (0, _utilities.getColor)('disabledContent'), (0, _utilities.getColor)('disabledBackground'));
44
46
 
45
47
  var Button = function Button(_ref) {
@@ -48,11 +50,13 @@ var Button = function Button(_ref) {
48
50
  variant = _ref$variant === void 0 ? 'neutral' : _ref$variant,
49
51
  isDisabled = _ref.isDisabled,
50
52
  icon = _ref.icon,
53
+ hasFullWidth = _ref.hasFullWidth,
51
54
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
52
55
  return __jsx(Wrapper, (0, _extends2.default)({
53
56
  variant: variant,
54
57
  disabled: isDisabled,
55
- icon: icon
58
+ icon: icon,
59
+ hasFullWidth: hasFullWidth
56
60
  }, props), icon && __jsx(_components.Icon, {
57
61
  icon: icon,
58
62
  color: "currentColor"
@@ -110,6 +114,13 @@ Button.__docgenInfo = {
110
114
  },
111
115
  "required": false,
112
116
  "description": ""
117
+ },
118
+ "hasFullWidth": {
119
+ "type": {
120
+ "name": "bool"
121
+ },
122
+ "required": false,
123
+ "description": ""
113
124
  }
114
125
  }
115
126
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flodesk/grain",
3
- "version": "2.17.0",
3
+ "version": "2.18.0",
4
4
  "description": "Flodesk design system",
5
5
  "module": "es/index.js",
6
6
  "author": "Flodesk",