@qlean/york-web
Advanced tools
Comparing version 5.0.0 to 5.0.1
@@ -22,18 +22,25 @@ "use strict"; | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
var StyledView = _styledComponents["default"].div.withConfig({ | ||
displayName: "RadioItem__StyledView", | ||
componentId: "sc-1hwdocm-0" | ||
})(["flex:1;"]); | ||
var StyledLabel = _styledComponents["default"].label.withConfig({ | ||
displayName: "RadioItem__StyledLabel", | ||
componentId: "sc-1hwdocm-0" | ||
})(["align-items:center;display:flex;font-family:", ";font-size:16px;line-height:", "px;color:", ";margin:", "px;&:before{content:' ';margin-right:", "px;display:inline-block;width:", "px;height:", "px;border-radius:calc(", "px + 1px);border:1px solid ", ";background-color:transparent;}&:hover:before{border:1px solid ", ";}"], _utils.fontFamily, _utils.sizes[5], _yorkCore.colors.coal, _utils.sizes[2], _utils.sizes[2], _utils.sizes[4], _utils.sizes[4], _utils.sizes[2], _yorkCore.colors.silver, _yorkCore.colors.green); | ||
componentId: "sc-1hwdocm-1" | ||
})(["align-items:center;display:flex;font-family:", ";font-size:16px;line-height:", "px;color:", ";margin:", "px;&:before{content:' ';margin-right:", "px;display:inline-block;width:", "px;height:", "px;border-radius:calc(", "px + 1px);border:1px solid ", ";background-color:transparent;box-sizing:content-box;}&:hover:before{border:1px solid ", ";}"], _utils.fontFamily, _utils.sizes[5], _yorkCore.colors.coal, _utils.sizes[2], _utils.sizes[2], _utils.sizes[4], _utils.sizes[4], _utils.sizes[2], _yorkCore.colors.silver, _yorkCore.colors.green); | ||
var StyledInput = _styledComponents["default"].input.withConfig({ | ||
displayName: "RadioItem__StyledInput", | ||
componentId: "sc-1hwdocm-1" | ||
componentId: "sc-1hwdocm-2" | ||
})(["display:none;&:checked + ", ":before{width:", "px;height:", "px;border:6px solid ", ";}"], StyledLabel, _utils.sizes[2], _utils.sizes[2], _yorkCore.colors.green); | ||
var RadioItem = function RadioItem(_ref) { | ||
var value = _ref.value, | ||
id = _ref.id, | ||
name = _ref.name, | ||
label = _ref.label; | ||
return _react["default"].createElement(_react["default"].Fragment, null, _react["default"].createElement(StyledInput, { | ||
var RadioItem = function RadioItem(props) { | ||
var value = props.value, | ||
id = props.id, | ||
name = props.name, | ||
label = props.label; | ||
return _react["default"].createElement(StyledView, null, _react["default"].createElement(StyledInput, _extends({ | ||
id: id, | ||
@@ -43,3 +50,3 @@ type: "radio", | ||
value: value | ||
}), _react["default"].createElement(StyledLabel, { | ||
}, props)), _react["default"].createElement(StyledLabel, { | ||
htmlFor: id | ||
@@ -46,0 +53,0 @@ }, label)); |
{ | ||
"name": "@qlean/york-web", | ||
"version": "5.0.0", | ||
"version": "5.0.1", | ||
"description": "", | ||
@@ -25,3 +25,3 @@ "license": "MIT", | ||
}, | ||
"gitHead": "f9df10bdd208e8bbfa5d0d832919fb249b56560e" | ||
"gitHead": "e3920ad98d9c660367d52a7232e392c35c0d7570" | ||
} |
@@ -9,2 +9,6 @@ import React from 'react' | ||
const StyledView = styled.div` | ||
flex: 1; | ||
` | ||
const StyledLabel = styled.label` | ||
@@ -27,2 +31,3 @@ align-items: center; | ||
background-color: transparent; | ||
box-sizing: content-box; | ||
} | ||
@@ -43,8 +48,9 @@ &:hover:before { | ||
const RadioItem = ({ value, id, name, label }) => { | ||
const RadioItem = props => { | ||
const { value, id, name, label } = props | ||
return ( | ||
<> | ||
<StyledInput id={id} type="radio" name={name} value={value} /> | ||
<StyledView> | ||
<StyledInput id={id} type="radio" name={name} value={value} {...props} /> | ||
<StyledLabel htmlFor={id}>{label}</StyledLabel> | ||
</> | ||
</StyledView> | ||
) | ||
@@ -51,0 +57,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2337605
11145