react-input-emoji 5.7.0 → 5.7.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.
package/README.md CHANGED
@@ -66,6 +66,7 @@ export default function Example() {
66
66
  | `buttonElement` | HTMLElement | - | Allows you to provide a custom HTMLElement that, when clicked, triggers the emoji picker. If this prop is provided, the default emoji picker button is removed. |
67
67
  | `buttonRef` | React.MutableRefObject | - | Accepts a React mutable ref object that, when referenced, triggers the emoji picker. If this prop is provided, the default emoji picker button is removed. |
68
68
  | `cleanOnEnter` | boolean | false | When set to true, the input value will be cleared after the user presses the Enter key. |
69
+ | `color` | string | "black" | Specifies the color of the input text. Accepts any valid CSS color value. |
69
70
  | `fontSize` | number | 15 | Controls the font size (in pixels) of the placeholder text and input value. |
70
71
  | `fontFamily` | string | "sans-serif" | Specifies the font family for the placeholder text and input value. Accepts any valid CSS font-family value. |
71
72
  | `height` | number | 40 | Sets the total height (in pixels) of the area in which the input element is rendered. |
package/dist/index.es.js CHANGED
@@ -936,7 +936,7 @@ var _excluded = ["placeholder", "style", "tabIndex", "className", "onChange"];
936
936
  * @property {(event: React.ClipboardEvent) => void} onCopy
937
937
  * @property {(event: React.ClipboardEvent) => void} onPaste
938
938
  * @property {string} placeholder
939
- * @property {{borderRadius?: number; borderColor?: string; fontSize?: number; fontFamily?: string; background: string; placeholderColor?: string;}} style
939
+ * @property {{borderRadius?: number; color?: string; borderColor?: string; fontSize?: number; fontFamily?: string; background: string; placeholderColor?: string;}} style
940
940
  * @property {number} tabIndex
941
941
  * @property {string} className
942
942
  * @property {(html: string) => void} onChange
@@ -1030,7 +1030,16 @@ var TextInput = function TextInput(_ref, ref) {
1030
1030
  placeholderStyle.color = style.placeholderColor;
1031
1031
  }
1032
1032
  return placeholderStyle;
1033
- }, [style.placeholderColor]);
1033
+ }, [style === null || style === void 0 ? void 0 : style.placeholderColor]);
1034
+
1035
+ /** @type {React.CSSProperties} */
1036
+ var inputStyle = useMemo(function () {
1037
+ var inputStyle = {};
1038
+ if (style.color) {
1039
+ inputStyle.color = style.color;
1040
+ }
1041
+ return inputStyle;
1042
+ }, [style === null || style === void 0 ? void 0 : style.color]);
1034
1043
 
1035
1044
  /** @type {React.MutableRefObject<HTMLDivElement | null>} */
1036
1045
  var placeholderRef = useRef(null);
@@ -1107,7 +1116,8 @@ var TextInput = function TextInput(_ref, ref) {
1107
1116
  onBlur: props.onBlur,
1108
1117
  onCopy: props.onCopy,
1109
1118
  onPaste: props.onPaste,
1110
- "data-testid": "react-input-emoji--input"
1119
+ "data-testid": "react-input-emoji--input",
1120
+ style: inputStyle
1111
1121
  })));
1112
1122
  };
1113
1123
  var TextInputWithRef = /*#__PURE__*/forwardRef(TextInput);
@@ -4501,6 +4511,7 @@ function usePollute() {
4501
4511
  * @property {(text: string) => void=} onEnter
4502
4512
  * @property {string=} placeholder
4503
4513
  * @property {string=} placeholderColor
4514
+ * @property {string=} color
4504
4515
  * @property {(size: {width: number, height: number}) => void=} onResize
4505
4516
  * @property {() => void=} onClick
4506
4517
  * @property {() => void=} onFocus
@@ -4559,7 +4570,8 @@ function InputEmoji(props, ref) {
4559
4570
  fontSize = props.fontSize,
4560
4571
  fontFamily = props.fontFamily,
4561
4572
  background = props.background,
4562
- placeholderColor = props.placeholderColor;
4573
+ placeholderColor = props.placeholderColor,
4574
+ color = props.color;
4563
4575
 
4564
4576
  /** @type {React.MutableRefObject<import('./text-input').Ref | null>} */
4565
4577
  var textInputRef = useRef(null);
@@ -4730,7 +4742,8 @@ function InputEmoji(props, ref) {
4730
4742
  fontSize: fontSize,
4731
4743
  fontFamily: fontFamily,
4732
4744
  background: background,
4733
- placeholderColor: placeholderColor
4745
+ placeholderColor: placeholderColor,
4746
+ color: color
4734
4747
  },
4735
4748
  tabIndex: tabIndex,
4736
4749
  className: inputClass,
@@ -4755,6 +4768,7 @@ InputEmojiWithRef.defaultProps = {
4755
4768
  placeholder: "Type a message",
4756
4769
  borderRadius: 21,
4757
4770
  borderColor: "#EAEAEA",
4771
+ color: "black",
4758
4772
  fontSize: 15,
4759
4773
  fontFamily: "sans-serif",
4760
4774
  background: "white",