@flodesk/grain 5.11.0 → 5.11.1

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.
@@ -96,7 +96,7 @@ export var Select = function Select(_ref3) {
96
96
  onChange: handleChange
97
97
  }, /*#__PURE__*/React.createElement(Listbox.Button, {
98
98
  as: Fragment
99
- }, trigger ? trigger(selectedOption) : /*#__PURE__*/React.createElement(DefaultTrigger, null, selectedOption)), /*#__PURE__*/React.createElement(Listbox.Options, {
99
+ }, trigger ? trigger(selectedOption) : /*#__PURE__*/React.createElement(DefaultTrigger, null, selectedOption.content)), /*#__PURE__*/React.createElement(Listbox.Options, {
100
100
  menuAlign: menuAlign,
101
101
  menuWidth: menuWidth,
102
102
  as: MenuCard
@@ -104,20 +104,22 @@ export var Select = function Select(_ref3) {
104
104
  return /*#__PURE__*/React.createElement(Listbox.Option, {
105
105
  key: index,
106
106
  value: option,
107
- as: Fragment
107
+ as: Fragment,
108
+ disabled: option.isDisabled
108
109
  }, function (_ref4) {
109
110
  var active = _ref4.active,
110
111
  selected = _ref4.selected;
111
112
  return /*#__PURE__*/React.createElement(MenuCardItem, {
112
113
  isSelected: selected,
113
- isActive: active
114
- }, option);
114
+ isActive: active,
115
+ isDisabled: option.isDisabled
116
+ }, option.content);
115
117
  });
116
118
  })));
117
119
  };
118
120
  Select.propTypes = {
119
121
  options: PropTypes.array,
120
- defaultOption: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
122
+ defaultOption: PropTypes.object,
121
123
  onChange: PropTypes.func,
122
124
  menuAlign: PropTypes.oneOf(['left', 'right']),
123
125
  menuWidth: types.dimension,
@@ -4,7 +4,7 @@ import "core-js/modules/es.object.define-properties.js";
4
4
  import "core-js/modules/es.object.keys.js";
5
5
  import "core-js/modules/es.array.index-of.js";
6
6
  import "core-js/modules/es.symbol.js";
7
- var _excluded = ["children", "isSelected", "isActive", "icon"];
7
+ var _excluded = ["children", "isSelected", "isActive", "isDisabled", "icon"];
8
8
 
9
9
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
10
10
 
@@ -43,22 +43,27 @@ export var MenuCard = styled.ul(_templateObject5 || (_templateObject5 = _taggedT
43
43
  var menuAlign = _ref3.menuAlign;
44
44
  return "".concat(menuAlign, ": 0;");
45
45
  });
46
- var MenuItemWrapper = styled.li(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n display: grid;\n grid-auto-flow: column;\n grid-template-columns: ", ";\n ", ";\n align-items: center;\n justify-content: start;\n list-style: none;\n padding: 0 12px;\n min-height: ", ";\n cursor: pointer;\n border-radius: ", ";\n appearance: none;\n"])), function (p) {
46
+ var MenuItemWrapper = styled.li(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n display: grid;\n grid-auto-flow: column;\n grid-template-columns: ", ";\n ", ";\n ", ";\n align-items: center;\n justify-content: start;\n list-style: none;\n padding: 0 12px;\n min-height: ", ";\n cursor: pointer;\n border-radius: ", ";\n appearance: none;\n"])), function (p) {
47
47
  return p.hasIcon ? 'auto 1fr' : '1fr auto';
48
48
  }, function (p) {
49
49
  return (p.hasIcon || p.isSelected) && 'gap: 8px';
50
+ }, function (_ref4) {
51
+ var isDisabled = _ref4.isDisabled;
52
+ return isDisabled && "color: ".concat(getColor('contentDisabled'));
50
53
  }, textBoxHeight, getRadius('s'));
51
- export var MenuCardItem = /*#__PURE__*/forwardRef(function (_ref4, ref) {
52
- var children = _ref4.children,
53
- isSelected = _ref4.isSelected,
54
- isActive = _ref4.isActive,
55
- icon = _ref4.icon,
56
- props = _objectWithoutProperties(_ref4, _excluded);
54
+ export var MenuCardItem = /*#__PURE__*/forwardRef(function (_ref5, ref) {
55
+ var children = _ref5.children,
56
+ isSelected = _ref5.isSelected,
57
+ isActive = _ref5.isActive,
58
+ isDisabled = _ref5.isDisabled,
59
+ icon = _ref5.icon,
60
+ props = _objectWithoutProperties(_ref5, _excluded);
57
61
 
58
62
  return /*#__PURE__*/React.createElement(MenuItemWrapper, Object.assign({
59
63
  ref: ref,
60
64
  isActive: isActive,
61
65
  isSelected: isSelected,
66
+ isDisabled: isDisabled,
62
67
  style: {
63
68
  background: isActive ? getColor('overlay') : undefined
64
69
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flodesk/grain",
3
- "version": "5.11.0",
3
+ "version": "5.11.1",
4
4
  "description": "Flodesk design system",
5
5
  "module": "es/index.js",
6
6
  "author": "Flodesk",