@bigbinary/neeto-molecules 1.1.9 → 1.1.10

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.
@@ -752,10 +752,11 @@ var classnames$1 = {exports: {}};
752
752
  var classnames = classnames$1.exports;
753
753
 
754
754
  var KEY_SHORTFORM_MAP = {
755
- command: "cmd",
755
+ command: "",
756
756
  escape: "esc",
757
757
  control: "ctrl",
758
- option: "opt"
758
+ option: "opt",
759
+ "return": "enter"
759
760
  };
760
761
  var MAC_TO_WINDOWS_KEYS_MAP = {
761
762
  option: "alt",
@@ -768,6 +769,13 @@ var OS = {
768
769
  windows: "Windows"
769
770
  };
770
771
  var FULL_SHORTCUTS_LINK_PROP_NAME = "fullShortcutsLink";
772
+ var TOOLTIP_CONTENT = {
773
+ "⌘": "command",
774
+ esc: "escape",
775
+ ctrl: "control",
776
+ opt: "option",
777
+ backspace: "delete"
778
+ };
771
779
 
772
780
  function _typeof(obj) {
773
781
  "@babel/helpers - typeof";
@@ -2106,6 +2114,16 @@ var getGlobalShortcuts = function getGlobalShortcuts() {
2106
2114
  }
2107
2115
  });
2108
2116
  };
2117
+ var getTooltipProps = function getTooltipProps(key) {
2118
+ if (TOOLTIP_CONTENT[key]) {
2119
+ return {
2120
+ position: "top",
2121
+ content: TOOLTIP_CONTENT[key],
2122
+ followCursor: "horizontal"
2123
+ };
2124
+ }
2125
+ return null;
2126
+ };
2109
2127
 
2110
2128
  var HotKey = function HotKey(_ref) {
2111
2129
  var description = _ref.description,
@@ -2138,7 +2156,8 @@ var HotKey = function HotKey(_ref) {
2138
2156
  return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, {
2139
2157
  key: idx
2140
2158
  }, /*#__PURE__*/React__default["default"].createElement(neetoui.Kbd, {
2141
- keyName: keyName
2159
+ keyName: keyName,
2160
+ tooltipProps: getTooltipProps(keyName)
2142
2161
  }), isSequentialHotkey && idx + 1 !== sequences.length && /*#__PURE__*/React__default["default"].createElement(neetoui.Kbd, {
2143
2162
  keyName: "then"
2144
2163
  }));