@s-ui/react-atom-input
Advanced tools
Comparing version 5.37.0 to 5.38.0
@@ -51,4 +51,5 @@ import cx from 'classnames'; | ||
state = _ref.state, | ||
shape = _ref.shape; | ||
return cx(BASE_CLASS, size && BASE_CLASS + "-size-" + size, charsSize && BASE_CLASS + "--charsSize", hideInput && BASE_CLASS + "--hidden", noBorder && BASE_CLASS + "--noBorder", readOnly && BASE_CLASS + "--readOnly", errorState && BASE_CLASS + "--" + INPUT_STATES.ERROR, errorState === false && BASE_CLASS + "--" + INPUT_STATES.SUCCESS, state && BASE_CLASS + "--" + state, shape && BASE_CLASS + "-shape-" + shape); | ||
shape = _ref.shape, | ||
className = _ref.className; | ||
return cx(BASE_CLASS, size && BASE_CLASS + "-size-" + size, charsSize && BASE_CLASS + "--charsSize", hideInput && BASE_CLASS + "--hidden", noBorder && BASE_CLASS + "--noBorder", readOnly && BASE_CLASS + "--readOnly", errorState && BASE_CLASS + "--state-" + INPUT_STATES.ERROR, errorState === false && BASE_CLASS + "--state-" + INPUT_STATES.SUCCESS, state && BASE_CLASS + "--state-" + state, shape && BASE_CLASS + "-shape-" + shape, className); | ||
}; |
import _extends from "@babel/runtime/helpers/esm/extends"; | ||
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; | ||
var _excluded = ["type"]; | ||
var _excluded = ["type", "shape", "noBorder"]; | ||
import { forwardRef } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import Input, { inputSizes, inputStates } from './Input/index.js'; | ||
import Mask from './Mask/index.js'; | ||
import Password from './Password/index.js'; | ||
import InputContainer from './Container/InputContainer.js'; | ||
import getComponentAndProps from './helpers/getComponentAndProps.js'; | ||
import { inputSizes, inputStates } from './Input/index.js'; | ||
import { INPUT_SHAPES, TYPES } from './config.js'; | ||
@@ -13,19 +13,19 @@ import { jsx as _jsx } from "react/jsx-runtime"; | ||
var type = _ref.type, | ||
shape = _ref.shape, | ||
noBorder = _ref.noBorder, | ||
props = _objectWithoutPropertiesLoose(_ref, _excluded); | ||
switch (type) { | ||
case 'sui-password': | ||
return /*#__PURE__*/_jsx(Password, _extends({ | ||
ref: ref | ||
}, props)); | ||
case 'mask': | ||
return /*#__PURE__*/_jsx(Mask, _extends({ | ||
ref: ref | ||
}, props)); | ||
default: | ||
return /*#__PURE__*/_jsx(Input, _extends({ | ||
ref: ref | ||
}, props, { | ||
type: type | ||
})); | ||
} | ||
var _getComponentAndProps = getComponentAndProps(_extends({ | ||
type: type | ||
}, props)), | ||
Component = _getComponentAndProps[0], | ||
newProps = _getComponentAndProps[1]; | ||
return /*#__PURE__*/_jsx(InputContainer, { | ||
shape: shape, | ||
noBorder: noBorder, | ||
children: /*#__PURE__*/_jsx(Component, _extends({}, newProps, { | ||
shape: shape, | ||
noBorder: noBorder, | ||
ref: ref | ||
})) | ||
}); | ||
}); | ||
@@ -32,0 +32,0 @@ AtomInput.displayName = 'AtomInput'; |
@@ -0,1 +1,4 @@ | ||
import _extends from "@babel/runtime/helpers/esm/extends"; | ||
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; | ||
var _excluded = ["as", "disabled", "readOnly", "hideInput", "noBorder", "id", "name", "onBlur", "onFocus", "onPaste", "onCopy", "placeholder", "reference", "size", "errorState", "state", "type", "value", "charsSize", "tabIndex", "ariaLabel", "maxLength", "minLength", "defaultValue", "min", "max", "step", "autoComplete", "autoFocus", "onChange", "onEnter", "onEnterKey", "onKeyDown", "onKeyPress", "required", "pattern", "inputMode", "shape", "children", "className"]; | ||
import { forwardRef } from 'react'; | ||
@@ -53,3 +56,5 @@ import PropTypes from 'prop-types'; | ||
shape = _ref.shape, | ||
children = _ref.children; | ||
children = _ref.children, | ||
classNameProp = _ref.className, | ||
props = _objectWithoutPropertiesLoose(_ref, _excluded); | ||
var changeHandler = function changeHandler(ev) { | ||
@@ -98,5 +103,6 @@ var _ev$target = ev.target, | ||
state: state, | ||
shape: shape | ||
shape: shape, | ||
className: classNameProp | ||
}); | ||
return /*#__PURE__*/_jsx(PolymorphicElement, { | ||
return /*#__PURE__*/_jsx(PolymorphicElement, _extends({ | ||
as: as, | ||
@@ -134,5 +140,5 @@ className: className, | ||
children: as === 'input' ? undefined : children | ||
}); | ||
}, props)); | ||
}); | ||
export default Input; | ||
export { SIZES as inputSizes, INPUT_STATES as inputStates }; |
import _extends from "@babel/runtime/helpers/esm/extends"; | ||
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; | ||
var _excluded = ["button", "leftAddon", "rightAddon", "leftIcon", "rightIcon", "children", "onClickLeftIcon", "onClickRightIcon", "size"]; | ||
var _excluded = ["button", "leftAddon", "rightAddon", "leftIcon", "rightIcon", "children", "onClickLeftIcon", "onClickRightIcon", "size", "shape"]; | ||
import { forwardRef } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { SIZES } from '../config.js'; | ||
import { INPUT_SHAPES, SIZES } from '../config.js'; | ||
import Input, { inputSizes, inputStates } from './Component/index.js'; | ||
@@ -23,2 +23,3 @@ import InputAddons from './Wrappers/Addons/InputAddons.js'; | ||
size = _ref$size === void 0 ? SIZES.MEDIUM : _ref$size, | ||
shape = _ref.shape, | ||
inputProps = _objectWithoutPropertiesLoose(_ref, _excluded); | ||
@@ -30,3 +31,3 @@ return /*#__PURE__*/_jsx(InputButton, { | ||
rightAddon: rightAddon, | ||
shape: inputProps.shape, | ||
shape: shape, | ||
size: size, | ||
@@ -39,3 +40,4 @@ children: /*#__PURE__*/_jsx(InputIcons, { | ||
children: /*#__PURE__*/_jsx(Input, _extends({ | ||
ref: forwardedRef | ||
ref: forwardedRef, | ||
shape: shape | ||
}, inputProps, { | ||
@@ -42,0 +44,0 @@ size: size, |
import _extends from "@babel/runtime/helpers/esm/extends"; | ||
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; | ||
var _excluded = ["onChange", "pwShowLabel", "pwHideLabel", "value", "defaultValue"]; | ||
var _excluded = ["onChange", "shape", "pwShowLabel", "pwHideLabel", "value", "defaultValue"]; | ||
import { forwardRef, useState } from 'react'; | ||
import cx from 'classnames'; | ||
import PropTypes from 'prop-types'; | ||
import useControlledState from '@s-ui/react-hooks/lib/useControlledState'; | ||
import { INPUT_SHAPES } from '../config.js'; | ||
import Input from '../Input/index.js'; | ||
@@ -12,6 +14,5 @@ import { BASE_CLASS_PASSWORD, BASE_CLASS_PASSWORD_TOGGLE_BUTTON, PASSWORD, TEXT } from './config.js'; | ||
var onChange = _ref.onChange, | ||
_ref$pwShowLabel = _ref.pwShowLabel, | ||
pwShowLabel = _ref$pwShowLabel === void 0 ? 'show' : _ref$pwShowLabel, | ||
_ref$pwHideLabel = _ref.pwHideLabel, | ||
pwHideLabel = _ref$pwHideLabel === void 0 ? 'hide' : _ref$pwHideLabel, | ||
shape = _ref.shape, | ||
pwShowLabel = _ref.pwShowLabel, | ||
pwHideLabel = _ref.pwHideLabel, | ||
value = _ref.value, | ||
@@ -39,12 +40,14 @@ _ref$defaultValue = _ref.defaultValue, | ||
return /*#__PURE__*/_jsxs("div", { | ||
className: BASE_CLASS_PASSWORD, | ||
className: cx(BASE_CLASS_PASSWORD, shape && BASE_CLASS_PASSWORD + "-shape-" + shape), | ||
children: [/*#__PURE__*/_jsx(Input, _extends({ | ||
ref: forwardedRef | ||
ref: forwardedRef, | ||
shape: shape | ||
}, props, { | ||
onChange: handleChange, | ||
value: innerValue, | ||
type: type | ||
})), /*#__PURE__*/_jsx("div", { | ||
type: type, | ||
noBorder: true | ||
})), /*#__PURE__*/_jsx("button", { | ||
onClick: toggle, | ||
className: BASE_CLASS_PASSWORD_TOGGLE_BUTTON, | ||
className: cx(BASE_CLASS_PASSWORD_TOGGLE_BUTTON, shape && BASE_CLASS_PASSWORD_TOGGLE_BUTTON + "-shape-" + shape), | ||
children: type === PASSWORD ? pwShowLabel : pwHideLabel | ||
@@ -51,0 +54,0 @@ })] |
{ | ||
"name": "@s-ui/react-atom-input", | ||
"version": "5.37.0", | ||
"version": "5.38.0", | ||
"description": "", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"keywords": [ | ||
"@s-ui", | ||
"react", | ||
"component", | ||
"atom", | ||
"input" | ||
], | ||
"main": "lib/index.js", | ||
@@ -19,5 +29,17 @@ "scripts": { | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/SUI-Components/sui-components", | ||
"directory": "components/atom/input" | ||
}, | ||
"config": { | ||
"title": "input", | ||
"category": "atom", | ||
"type": "components" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/SUI-Components/sui-components/issues?q=is%3Aopen+label%3A%22Component%3A+input%22" | ||
}, | ||
"homepage": "https://sui-components.vercel.app/", | ||
"license": "MIT" | ||
} |
@@ -5,2 +5,9 @@ # AtomInput | ||
[![documentation](https://img.shields.io/badge/read%20the%20doc-black?logo=readthedocs)](https://sui-components.vercel.app/workbench/atom/input/) | ||
[![issue](https://img.shields.io/badge/report%20a%20bug-black?logo=openbugbounty&logoColor=red)](https://github.com/SUI-Components/sui-components/issues/new?&projects=4&template=bug-report.yml&assignees=&template=report-a-bug.yml&title=🪲+&labels=bug,component,atom,input) | ||
[![npm](https://img.shields.io/npm/dt/%40s-ui/react-atom-input?logo=npm&labelColor=black)](https://www.npmjs.com/package/@s-ui/react-atom-input) | ||
[![Issues open](https://img.shields.io/github/issues-search/SUI-Components/sui-components?query=is%3Aopen%20label%3Acomponent%20label%3Ainput&logo=openbugbounty&logoColor=red&label=issues%20open&color=red)](https://github.com/SUI-Components/sui-components/issues?q=is%3Aopen+label%3Acomponent+label%3Ainput) | ||
[![NPM](https://img.shields.io/npm/l/%40s-ui%2Freact-atom-input)](https://github.com/SUI-Components/sui-components/blob/main/components/atom/input/LICENSE.md) | ||
## Installation | ||
@@ -7,0 +14,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
40636
38
557
1
0
250
0