@s-ui/react-atom-input
Advanced tools
Comparing version 5.15.0 to 5.16.0
# CHANGELOG | ||
# 5.16.0 (2022-05-25) | ||
### Bug Fixes | ||
* **components/atom/button:** atom icon sizes explicit declaration ([d3f2c6a](https://github.com/SUI-Components/sui-components/commit/d3f2c6a95a7118448406df128d25ff6936f21e5d)), closes [#2052](https://github.com/SUI-Components/sui-components/issues/2052) | ||
### Features | ||
* **components/atom/input:** add missing dep ([bfcb281](https://github.com/SUI-Components/sui-components/commit/bfcb2815fdda3cdd0970fb72a96a5dfb97057868)) | ||
* **components/atom/input:** add ref ([9abc652](https://github.com/SUI-Components/sui-components/commit/9abc6525154faf10539986102351c7c0fa874a64)) | ||
* **components/atom/input:** change children position ([0d55f11](https://github.com/SUI-Components/sui-components/commit/0d55f1128dcda1b84bf8c5d6c816099834532e85)) | ||
* **components/atom/input:** update children prop ([b28e876](https://github.com/SUI-Components/sui-components/commit/b28e876ad380b102c9312cf1d981defff20afb75)) | ||
* **components/atom/input:** use polymorphic input ([4e37214](https://github.com/SUI-Components/sui-components/commit/4e37214c4a433335d71d3b117016444e0f397687)) | ||
# 5.15.0 (2022-02-23) | ||
@@ -4,0 +22,0 @@ |
import _extends from "@babel/runtime/helpers/esm/extends"; | ||
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; | ||
var _excluded = ["type"]; | ||
import { forwardRef } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
@@ -10,4 +11,3 @@ import Input, { inputSizes, inputStates } from './Input/index.js'; | ||
import { jsx as _jsx } from "react/jsx-runtime"; | ||
var AtomInput = function AtomInput(_ref) { | ||
var AtomInput = /*#__PURE__*/forwardRef(function (_ref, ref) { | ||
var type = _ref.type, | ||
@@ -18,16 +18,21 @@ props = _objectWithoutPropertiesLoose(_ref, _excluded); | ||
case 'sui-password': | ||
return /*#__PURE__*/_jsx(Password, _extends({}, props)); | ||
return /*#__PURE__*/_jsx(Password, _extends({ | ||
ref: ref | ||
}, props)); | ||
case 'mask': | ||
return /*#__PURE__*/_jsx(Mask, _extends({}, props)); | ||
return /*#__PURE__*/_jsx(Mask, _extends({ | ||
ref: ref | ||
}, props)); | ||
default: | ||
return /*#__PURE__*/_jsx(Input, _extends({}, props, { | ||
return /*#__PURE__*/_jsx(Input, _extends({ | ||
ref: ref | ||
}, props, { | ||
type: type | ||
})); | ||
} | ||
}; | ||
}); | ||
AtomInput.displayName = 'AtomInput'; | ||
export default AtomInput; | ||
export { inputSizes, inputStates, TYPES as inputTypes, INPUT_SHAPES as inputShapes }; |
import { forwardRef } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import PolymorphicElement from '@s-ui/react-primitive-polymorphic-element'; | ||
import useMergeRefs from '@s-ui/react-hooks/lib/useMergeRefs'; | ||
@@ -7,3 +8,5 @@ import { SIZES, INPUT_STATES, INPUT_SHAPES, noop, getClassNames } from '../../config.js'; | ||
var Input = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) { | ||
var disabled = _ref.disabled, | ||
var _ref$as = _ref.as, | ||
as = _ref$as === void 0 ? 'input' : _ref$as, | ||
disabled = _ref.disabled, | ||
readOnly = _ref.readOnly, | ||
@@ -45,3 +48,4 @@ hideInput = _ref.hideInput, | ||
inputMode = _ref.inputMode, | ||
shape = _ref.shape; | ||
shape = _ref.shape, | ||
children = _ref.children; | ||
@@ -83,3 +87,4 @@ var changeHandler = function changeHandler(ev) { | ||
}); | ||
return /*#__PURE__*/_jsx("input", { | ||
return /*#__PURE__*/_jsx(PolymorphicElement, { | ||
as: as, | ||
className: className, | ||
@@ -111,3 +116,4 @@ tabIndex: tabIndex, | ||
pattern: pattern, | ||
inputMode: inputMode | ||
inputMode: inputMode, | ||
children: as === 'input' ? undefined : children | ||
}); | ||
@@ -114,0 +120,0 @@ }); |
@@ -40,3 +40,4 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
}, inputProps, { | ||
size: size | ||
size: size, | ||
children: children | ||
})) | ||
@@ -43,0 +44,0 @@ }) |
{ | ||
"name": "@s-ui/react-atom-input", | ||
"version": "5.15.0", | ||
"version": "5.16.0", | ||
"description": "", | ||
@@ -13,2 +13,3 @@ "main": "lib/index.js", | ||
"@s-ui/react-hooks": "1", | ||
"@s-ui/react-primitive-polymorphic-element": "1", | ||
"imask": "3.4.0" | ||
@@ -15,0 +16,0 @@ }, |
61503
442
4
+ Added@s-ui/react-primitive-polymorphic-element@1.2.0(transitive)