@app-garage/text-input
Advanced tools
Comparing version 2.2.2 to 2.3.0
# Change Log | ||
## 2.3.0 | ||
### Minor Changes | ||
- [#119](https://github.com/electronic33/ag-ui-react/pull/119) [`3d64d61`](https://github.com/electronic33/ag-ui-react/commit/3d64d61dfab927e882c866c672b5581c1b1b4d99) Thanks [@Levi1235](https://github.com/Levi1235)! - error className | ||
## 2.2.2 | ||
@@ -4,0 +10,0 @@ |
@@ -93,3 +93,3 @@ import React, { forwardRef, useState } from 'react'; | ||
var TextInput = forwardRef(function (_a, ref) { | ||
var id = _a.id, label = _a.label, secondaryLabel = _a.secondaryLabel, Icon = _a.Icon, withRequiredIndicator = _a.withRequiredIndicator, name = _a.name, value = _a.value, onChange = _a.onChange, onClick = _a.onClick, onKeyDown = _a.onKeyDown, onEnterPress = _a.onEnterPress, onButtonClick = _a.onButtonClick, error = _a.error, containerClassName = _a.containerClassName, labelClassName = _a.labelClassName, inputClassName = _a.inputClassName, _b = _a.type, type = _b === void 0 ? 'text' : _b, max = _a.max, withMax = _a.withMax, placeholder = _a.placeholder, field = _a.field, form = _a.form, onBlur = _a.onBlur, onFocus = _a.onFocus, withErrorInLabel = _a.withErrorInLabel, isDisabled = _a.isDisabled, withButton = _a.withButton, buttonText = _a.buttonText, buttonClassName = _a.buttonClassName; | ||
var id = _a.id, label = _a.label, secondaryLabel = _a.secondaryLabel, Icon = _a.Icon, withRequiredIndicator = _a.withRequiredIndicator, name = _a.name, value = _a.value, onChange = _a.onChange, onClick = _a.onClick, onKeyDown = _a.onKeyDown, onEnterPress = _a.onEnterPress, onButtonClick = _a.onButtonClick, error = _a.error, containerClassName = _a.containerClassName, labelClassName = _a.labelClassName, inputClassName = _a.inputClassName, _b = _a.type, type = _b === void 0 ? 'text' : _b, max = _a.max, withMax = _a.withMax, placeholder = _a.placeholder, field = _a.field, form = _a.form, onBlur = _a.onBlur, onFocus = _a.onFocus, withErrorInLabel = _a.withErrorInLabel, isDisabled = _a.isDisabled, withButton = _a.withButton, buttonText = _a.buttonText, buttonClassName = _a.buttonClassName, errorClassName = _a.errorClassName; | ||
var _c = __read(useState(false), 2), isFocused = _c[0], setIsFocused = _c[1]; | ||
@@ -133,5 +133,5 @@ var _d = useTextInputValues({ | ||
withMax && (React.createElement("p", { className: "text-input-with-max" }, "".concat(String(formikCompatibleValue).length, "/").concat(max))), | ||
!withErrorInLabel && formikCompatibleError && (React.createElement("p", { className: "text-input-with-error" }, formikCompatibleError)))); | ||
!withErrorInLabel && formikCompatibleError && (React.createElement("p", { className: classNames('text-input-with-error', errorClassName) }, formikCompatibleError)))); | ||
}); | ||
export { TextInput, useTextInputValues }; |
@@ -102,3 +102,3 @@ 'use strict'; | ||
var TextInput = React.forwardRef(function (_a, ref) { | ||
var id = _a.id, label$1 = _a.label, secondaryLabel = _a.secondaryLabel, Icon = _a.Icon, withRequiredIndicator = _a.withRequiredIndicator, name = _a.name, value = _a.value, onChange = _a.onChange, onClick = _a.onClick, onKeyDown = _a.onKeyDown, onEnterPress = _a.onEnterPress, onButtonClick = _a.onButtonClick, error = _a.error, containerClassName = _a.containerClassName, labelClassName = _a.labelClassName, inputClassName = _a.inputClassName, _b = _a.type, type = _b === void 0 ? 'text' : _b, max = _a.max, withMax = _a.withMax, placeholder = _a.placeholder, field = _a.field, form = _a.form, onBlur = _a.onBlur, onFocus = _a.onFocus, withErrorInLabel = _a.withErrorInLabel, isDisabled = _a.isDisabled, withButton = _a.withButton, buttonText = _a.buttonText, buttonClassName = _a.buttonClassName; | ||
var id = _a.id, label$1 = _a.label, secondaryLabel = _a.secondaryLabel, Icon = _a.Icon, withRequiredIndicator = _a.withRequiredIndicator, name = _a.name, value = _a.value, onChange = _a.onChange, onClick = _a.onClick, onKeyDown = _a.onKeyDown, onEnterPress = _a.onEnterPress, onButtonClick = _a.onButtonClick, error = _a.error, containerClassName = _a.containerClassName, labelClassName = _a.labelClassName, inputClassName = _a.inputClassName, _b = _a.type, type = _b === void 0 ? 'text' : _b, max = _a.max, withMax = _a.withMax, placeholder = _a.placeholder, field = _a.field, form = _a.form, onBlur = _a.onBlur, onFocus = _a.onFocus, withErrorInLabel = _a.withErrorInLabel, isDisabled = _a.isDisabled, withButton = _a.withButton, buttonText = _a.buttonText, buttonClassName = _a.buttonClassName, errorClassName = _a.errorClassName; | ||
var _c = __read(React.useState(false), 2), isFocused = _c[0], setIsFocused = _c[1]; | ||
@@ -142,3 +142,3 @@ var _d = useTextInputValues({ | ||
withMax && (React__default["default"].createElement("p", { className: "text-input-with-max" }, "".concat(String(formikCompatibleValue).length, "/").concat(max))), | ||
!withErrorInLabel && formikCompatibleError && (React__default["default"].createElement("p", { className: "text-input-with-error" }, formikCompatibleError)))); | ||
!withErrorInLabel && formikCompatibleError && (React__default["default"].createElement("p", { className: classNames__default["default"]('text-input-with-error', errorClassName) }, formikCompatibleError)))); | ||
}); | ||
@@ -145,0 +145,0 @@ |
@@ -35,4 +35,5 @@ import React from 'react'; | ||
buttonClassName?: string; | ||
errorClassName?: string; | ||
}; | ||
export declare const TextInput: React.ForwardRefExoticComponent<TextInputProps & React.RefAttributes<HTMLInputElement>>; | ||
//# sourceMappingURL=text-input.d.ts.map |
{ | ||
"name": "@app-garage/text-input", | ||
"version": "2.2.2", | ||
"version": "2.3.0", | ||
"author": "Matyas Furtos", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
26254
342