@sendbird/uikit-react
Version:
Sendbird UIKit for React: A feature-rich and customizable chat UI kit with messaging, channel management, and user authentication.
31 lines (24 loc) • 1.75 kB
JavaScript
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var React = require('react');
var ui_Label = require('../chunks/bundle-zgmRG2KL.js');
require('../chunks/bundle-Conb-pOy.js');
require('../chunks/bundle-BbrBawlX.js');
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
var InputLabel = function (_a) {
var children = _a.children;
return (React__default.default.createElement(ui_Label.Label, { className: "sendbird-input-label", type: ui_Label.LabelTypography.CAPTION_3, color: ui_Label.LabelColors.ONBACKGROUND_1 }, children));
};
var Input = React__default.default.forwardRef(function (props, ref) {
var name = props.name, required = props.required, disabled = props.disabled, value = props.value, placeHolder = props.placeHolder, _a = props.autoFocus, autoFocus = _a === void 0 ? false : _a;
var _b = React.useState(value), inputValue = _b[0], setInputValue = _b[1];
return (React__default.default.createElement("div", { className: "sendbird-input" },
React__default.default.createElement("input", { className: "sendbird-input__input", ref: ref, name: name, required: required, disabled: disabled, value: inputValue, onChange: function (e) {
setInputValue(e.target.value);
}, autoFocus: autoFocus }),
(placeHolder && !inputValue) && (React__default.default.createElement(ui_Label.Label, { className: "sendbird-input__placeholder", type: ui_Label.LabelTypography.BODY_1, color: ui_Label.LabelColors.ONBACKGROUND_3 }, placeHolder))));
});
exports.InputLabel = InputLabel;
exports.default = Input;
//# sourceMappingURL=Input.js.map