@digibib/deichman-ui
Advanced tools
Comparing version 6.8.0 to 6.8.1
@@ -5,2 +5,8 @@ # Change Log | ||
## 6.8.0 | ||
### Changed | ||
- Added Radio component | ||
## 6.7.0 | ||
@@ -7,0 +13,0 @@ |
@@ -1188,2 +1188,61 @@ import React, { Component, Fragment } from 'react'; | ||
var Radio = function Radio(_ref) { | ||
var name = _ref.name, | ||
value = _ref.value, | ||
label = _ref.label, | ||
onChange = _ref.onChange, | ||
checked = _ref.checked, | ||
disabled = _ref.disabled, | ||
full = _ref.full, | ||
props = objectWithoutProperties(_ref, ['name', 'value', 'label', 'onChange', 'checked', 'disabled', 'full']); | ||
var radioClass = classNames({ | ||
radio: true, | ||
'radio--full': full, | ||
'radio--checked': checked, | ||
'radio--disabled': disabled | ||
}); | ||
return React.createElement( | ||
'label', | ||
{ className: radioClass }, | ||
React.createElement('input', _extends({ | ||
className: 'radio__input', | ||
type: 'radio', | ||
name: name, | ||
value: value, | ||
disabled: disabled, | ||
checked: checked, | ||
onChange: onChange | ||
}, props)), | ||
React.createElement( | ||
'span', | ||
{ className: 'radio__box' }, | ||
React.createElement('span', { className: 'radio__dot' }) | ||
), | ||
React.createElement( | ||
'span', | ||
{ className: 'radio__label' }, | ||
label | ||
) | ||
); | ||
}; | ||
Radio.defaultProps = { | ||
checked: false, | ||
disabled: false, | ||
full: false, | ||
icon: '' | ||
}; | ||
Radio.propTypes = { | ||
name: PropTypes.string.isRequired, | ||
label: PropTypes.string.isRequired, | ||
value: PropTypes.string.isRequired, | ||
checked: PropTypes.bool, | ||
disabled: PropTypes.bool, | ||
full: PropTypes.bool, | ||
onChange: PropTypes.func.isRequired | ||
}; | ||
var Select = function Select(_ref) { | ||
@@ -1871,3 +1930,3 @@ var name = _ref.name, | ||
export { Accordion, Badge, Banner, Block, Blockquote, Breakpoint, Burger, Button, Checkbox, CircleButton, Container, Hr, Flex, Grid, GridItem, Icon, IconLoader, Input, List, Loader, Modal, Overlay, Overflow, Select, ShowMore, Sidebar, Sorter, Table, Tag, TagList, Text, Textarea }; | ||
export { Accordion, Badge, Banner, Block, Blockquote, Breakpoint, Burger, Button, Checkbox, CircleButton, Container, Hr, Flex, Grid, GridItem, Icon, IconLoader, Input, List, Loader, Modal, Overlay, Overflow, Radio, Select, ShowMore, Sidebar, Sorter, Table, Tag, TagList, Text, Textarea }; | ||
//# sourceMappingURL=index.es.js.map |
@@ -1195,2 +1195,61 @@ 'use strict'; | ||
var Radio = function Radio(_ref) { | ||
var name = _ref.name, | ||
value = _ref.value, | ||
label = _ref.label, | ||
onChange = _ref.onChange, | ||
checked = _ref.checked, | ||
disabled = _ref.disabled, | ||
full = _ref.full, | ||
props = objectWithoutProperties(_ref, ['name', 'value', 'label', 'onChange', 'checked', 'disabled', 'full']); | ||
var radioClass = classNames({ | ||
radio: true, | ||
'radio--full': full, | ||
'radio--checked': checked, | ||
'radio--disabled': disabled | ||
}); | ||
return React__default.createElement( | ||
'label', | ||
{ className: radioClass }, | ||
React__default.createElement('input', _extends({ | ||
className: 'radio__input', | ||
type: 'radio', | ||
name: name, | ||
value: value, | ||
disabled: disabled, | ||
checked: checked, | ||
onChange: onChange | ||
}, props)), | ||
React__default.createElement( | ||
'span', | ||
{ className: 'radio__box' }, | ||
React__default.createElement('span', { className: 'radio__dot' }) | ||
), | ||
React__default.createElement( | ||
'span', | ||
{ className: 'radio__label' }, | ||
label | ||
) | ||
); | ||
}; | ||
Radio.defaultProps = { | ||
checked: false, | ||
disabled: false, | ||
full: false, | ||
icon: '' | ||
}; | ||
Radio.propTypes = { | ||
name: PropTypes.string.isRequired, | ||
label: PropTypes.string.isRequired, | ||
value: PropTypes.string.isRequired, | ||
checked: PropTypes.bool, | ||
disabled: PropTypes.bool, | ||
full: PropTypes.bool, | ||
onChange: PropTypes.func.isRequired | ||
}; | ||
var Select = function Select(_ref) { | ||
@@ -1901,2 +1960,3 @@ var name = _ref.name, | ||
exports.Overflow = Overflow; | ||
exports.Radio = Radio; | ||
exports.Select = Select; | ||
@@ -1903,0 +1963,0 @@ exports.ShowMore = ShowMore; |
{ | ||
"name": "@digibib/deichman-ui", | ||
"version": "6.8.0", | ||
"version": "6.8.1", | ||
"description": "Deichman style-guide and component library", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
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
764539
4198