react-mention-input 1.0.12 → 1.0.13

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.
package/README.md CHANGED
@@ -43,7 +43,7 @@ A customizable input component with @mention functionality.
43
43
 
44
44
  ```tsx
45
45
  import React from 'react';
46
- import {MentionInput} from 'react-mention-input';
46
+ import MentionInput from 'react-mention-input';
47
47
 
48
48
  const users = [
49
49
  { id: 1, name: 'John Doe' },
@@ -16,5 +16,5 @@ interface MentionInputProps {
16
16
  sendButtonIcon?: ReactNode;
17
17
  onSendMessage?: (message: string) => void;
18
18
  }
19
- export declare const MentionInput: React.FC<MentionInputProps>;
20
- export {};
19
+ declare const MentionInput: React.FC<MentionInputProps>;
20
+ export default MentionInput;
@@ -1,6 +1,6 @@
1
1
  import React, { useState } from 'react';
2
2
  import './MentionInput.css'; // Import the SCSS file
3
- export var MentionInput = function (_a) {
3
+ var MentionInput = function (_a) {
4
4
  var users = _a.users, placeholder = _a.placeholder, containerClassName = _a.containerClassName, inputContainerClassName = _a.inputContainerClassName, inputClassName = _a.inputClassName, sendBtnClassName = _a.sendBtnClassName, suggestionListClassName = _a.suggestionListClassName, suggestionItemClassName = _a.suggestionItemClassName, sendButtonIcon = _a.sendButtonIcon, onSendMessage = _a.onSendMessage;
5
5
  var _b = useState(''), inputValue = _b[0], setInputValue = _b[1];
6
6
  var _c = useState([]), suggestions = _c[0], setSuggestions = _c[1];
@@ -45,3 +45,4 @@ export var MentionInput = function (_a) {
45
45
  React.createElement("button", { onClick: handleSendMessage, className: "send-button ".concat(sendBtnClassName || '') }, sendButtonIcon ? (typeof sendButtonIcon === 'string' ? (React.createElement("img", { src: sendButtonIcon, alt: "Send Icon", style: { width: '20px', height: '20px' } })) : (sendButtonIcon)) : ('➤'))),
46
46
  showSuggestions && (React.createElement("ul", { className: "suggestion-list ".concat(suggestionListClassName || '') }, suggestions.map(function (user) { return (React.createElement("li", { key: user.id, onClick: function () { return handleSuggestionClick(user); }, className: "suggestion-item ".concat(suggestionItemClassName || '') }, user.name)); })))));
47
47
  };
48
+ export default MentionInput;
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { MentionInput } from './MentionInput';
1
+ export { default as MentionInput } from './MentionInput';
2
2
  export { ShowMessageCard } from './ShowMessageCard';
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { MentionInput } from './MentionInput';
1
+ export { default as MentionInput } from './MentionInput';
2
2
  export { ShowMessageCard } from './ShowMessageCard';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-mention-input",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -19,7 +19,7 @@ interface MentionInputProps {
19
19
  onSendMessage?: (message: string) => void;
20
20
  }
21
21
 
22
- export const MentionInput: React.FC<MentionInputProps> = ({
22
+ const MentionInput: React.FC<MentionInputProps> = ({
23
23
  users,
24
24
  placeholder,
25
25
  containerClassName,
@@ -119,3 +119,4 @@ export const MentionInput: React.FC<MentionInputProps> = ({
119
119
  };
120
120
 
121
121
 
122
+ export default MentionInput
package/src/index.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { MentionInput } from './MentionInput';
1
+ export {default as MentionInput} from './MentionInput';
2
2
  export { ShowMessageCard } from './ShowMessageCard';