You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

@the-control-group/ui

Package Overview
Dependencies
Maintainers
2
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@the-control-group/ui - npm Package Compare versions

Comparing version

to
1.2.5

1

lib/elements/Common/Common.js

@@ -60,2 +60,3 @@ /**

'disabled',
'checked',
'type',

@@ -62,0 +63,0 @@ 'placeholder',

@@ -28,2 +28,5 @@ /**

bare,
name,
id,
checked,
...other

@@ -62,2 +65,24 @@ }) => {

if(type === 'radio' || type === 'checkbox') {
return (
<Fragment>
<Common
{...other}
classes={combinedClasses}
tag="input"
type={type}
name={name}
label={label}
id={id}
checked={checked}
/>
{label &&
<label htmlFor={id}>
{label}
</label>
}
</Fragment>
);
}
return (

@@ -88,8 +113,4 @@ <Fragment>

type: PropTypes.string,
/** Text label for input */
label: PropTypes.oneOfType([
PropTypes.string,
PropTypes.object
]),
bare: PropTypes.bool,
name: PropTypes.string.isRequired,
/** Placeholder for input */

@@ -104,2 +125,23 @@ placeholder: PropTypes.string,

}
},
label: (props, propName) => {
if ((props.type === 'radio' || props.type === 'checkbox') && (props[propName] === undefined)) {
return new Error(
'Label is required for radio and checkbox inputs'
);
}
},
id: (props, propName) => {
if ((props.type === 'radio' || props.type === 'checkbox') && (props[propName] === undefined)) {
return new Error(
'Id attribute is required for radio and checkbox inputs'
);
}
},
checked: (props, propName) => {
if ((props.type === 'radio' || props.type === 'checkbox') && (props[propName] === undefined)) {
return new Error(
'Checked attribute is required for radio and checkbox inputs'
);
}
}

@@ -106,0 +148,0 @@ };

2

package.json
{
"name": "@the-control-group/ui",
"version": "1.2.4",
"version": "1.2.5",
"description": "UI kit based on ReactJS for TCG projects",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

Sorry, the diff of this file is not supported yet