react-mention-input 1.0.5 → 1.0.6

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.
@@ -38,7 +38,7 @@ var MentionInput = function (_a) {
38
38
  setShowSuggestions(false);
39
39
  };
40
40
  return (React.createElement("div", { style: { position: 'relative' } },
41
- React.createElement("input", { type: "text", value: inputValue, onChange: handleInputChange, placeholder: placeholder || 'Type a message...', style: __assign({ width: '100%', padding: '10px' }, inputStyle) }),
42
- showSuggestions && (React.createElement("ul", { style: __assign({ position: 'absolute', top: '100%', left: 0, right: 0, backgroundColor: '#fff', border: '1px solid #ddd', listStyle: 'none', margin: 0, padding: 0, maxHeight: '150px', overflowY: 'auto', zIndex: 1 }, suggestionListStyle) }, suggestions.map(function (user) { return (React.createElement("li", { key: user.id, onClick: function () { return handleSuggestionClick(user); }, style: __assign({ padding: '8px', cursor: 'pointer', borderBottom: '1px solid #ddd' }, suggestionItemStyle) }, user.name)); })))));
41
+ React.createElement("input", { type: "text", value: inputValue, onChange: handleInputChange, placeholder: placeholder || 'Type a message...', style: __assign({ width: '100%', padding: '12px 16px', border: '1px solid #ccc', borderRadius: '8px', outline: 'none', fontSize: '16px', boxShadow: '0 2px 4px rgba(0, 0, 0, 0.1)', transition: 'border 0.2s, box-shadow 0.2s' }, inputStyle), onFocus: function (e) { return (e.currentTarget.style.border = '1px solid #007BFF'); }, onBlur: function (e) { return (e.currentTarget.style.border = '1px solid #ccc'); } }),
42
+ showSuggestions && (React.createElement("ul", { style: __assign({ position: 'absolute', top: '100%', left: 0, right: 0, backgroundColor: '#fff', border: '1px solid #ddd', borderRadius: '4px', listStyle: 'none', margin: '4px 0', padding: 0, maxHeight: '150px', overflowY: 'auto', boxShadow: '0 2px 8px rgba(0, 0, 0, 0.1)', zIndex: 1 }, suggestionListStyle) }, suggestions.map(function (user) { return (React.createElement("li", { key: user.id, onClick: function () { return handleSuggestionClick(user); }, style: __assign({ padding: '8px 12px', cursor: 'pointer', borderBottom: '1px solid #ddd', transition: 'background-color 0.2s' }, suggestionItemStyle), onMouseEnter: function (e) { return (e.currentTarget.style.backgroundColor = '#f5f5f5'); }, onMouseLeave: function (e) { return (e.currentTarget.style.backgroundColor = 'transparent'); } }, user.name)); })))));
43
43
  };
44
44
  export default MentionInput;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-mention-input",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -55,7 +55,19 @@ const MentionInput: React.FC<MentionInputProps> = ({
55
55
  value={inputValue}
56
56
  onChange={handleInputChange}
57
57
  placeholder={placeholder || 'Type a message...'}
58
- style={{ width: '100%', padding: '10px', ...inputStyle }}
58
+ style={{
59
+ width: '100%',
60
+ padding: '12px 16px',
61
+ border: '1px solid #ccc',
62
+ borderRadius: '8px',
63
+ outline: 'none',
64
+ fontSize: '16px',
65
+ boxShadow: '0 2px 4px rgba(0, 0, 0, 0.1)',
66
+ transition: 'border 0.2s, box-shadow 0.2s',
67
+ ...inputStyle,
68
+ }}
69
+ onFocus={(e) => (e.currentTarget.style.border = '1px solid #007BFF')}
70
+ onBlur={(e) => (e.currentTarget.style.border = '1px solid #ccc')}
59
71
  />
60
72
  {showSuggestions && (
61
73
  <ul
@@ -66,11 +78,13 @@ const MentionInput: React.FC<MentionInputProps> = ({
66
78
  right: 0,
67
79
  backgroundColor: '#fff',
68
80
  border: '1px solid #ddd',
81
+ borderRadius: '4px',
69
82
  listStyle: 'none',
70
- margin: 0,
83
+ margin: '4px 0',
71
84
  padding: 0,
72
85
  maxHeight: '150px',
73
86
  overflowY: 'auto',
87
+ boxShadow: '0 2px 8px rgba(0, 0, 0, 0.1)',
74
88
  zIndex: 1,
75
89
  ...suggestionListStyle,
76
90
  }}
@@ -80,11 +94,14 @@ const MentionInput: React.FC<MentionInputProps> = ({
80
94
  key={user.id}
81
95
  onClick={() => handleSuggestionClick(user)}
82
96
  style={{
83
- padding: '8px',
97
+ padding: '8px 12px',
84
98
  cursor: 'pointer',
85
99
  borderBottom: '1px solid #ddd',
100
+ transition: 'background-color 0.2s',
86
101
  ...suggestionItemStyle,
87
102
  }}
103
+ onMouseEnter={(e) => (e.currentTarget.style.backgroundColor = '#f5f5f5')}
104
+ onMouseLeave={(e) => (e.currentTarget.style.backgroundColor = 'transparent')}
88
105
  >
89
106
  {user.name}
90
107
  </li>