@entur/component-library
Advanced tools
Comparing version 0.2.4 to 0.2.5
@@ -6,2 +6,3 @@ 'use strict'; | ||
}); | ||
exports.AlertMessage = AlertMessage; | ||
@@ -16,4 +17,14 @@ var _react = require('react'); | ||
var _icons = require('../icons'); | ||
var _error = require('../icons/error'); | ||
var _error2 = _interopRequireDefault(_error); | ||
var _exclamation = require('../icons/exclamation'); | ||
var _exclamation2 = _interopRequireDefault(_exclamation); | ||
var _success = require('../icons/success'); | ||
var _success2 = _interopRequireDefault(_success); | ||
require('../../styles/_colors.css'); | ||
@@ -73,7 +84,7 @@ | ||
case 'success': | ||
return _react2.default.createElement(_icons.Success, { className: _styles.rootClassName + '__icon', color: _colors.dark_mint }); | ||
return _react2.default.createElement(_success2.default, { className: _styles.rootClassName + '__icon', color: _colors.dark_mint }); | ||
case 'error': | ||
return _react2.default.createElement(_icons.Error, { className: _styles.rootClassName + '__icon', color: _colors.dark_coral }); | ||
return _react2.default.createElement(_error2.default, { className: _styles.rootClassName + '__icon', color: _colors.dark_coral }); | ||
case 'warning': | ||
return _react2.default.createElement(_icons.Exclamation, { className: _styles.rootClassName + '__icon' }); | ||
return _react2.default.createElement(_exclamation2.default, { className: _styles.rootClassName + '__icon' }); | ||
case 'none': | ||
@@ -107,4 +118,2 @@ return null; | ||
level: 'none' | ||
}; | ||
exports.default = AlertMessage; | ||
}; |
@@ -60,4 +60,6 @@ 'use strict'; | ||
'focus': '#44c0ff', | ||
'rootClassName': 'entur-radio-checkbox-group', | ||
'rootclassname': 'entur-radio-checkbox-group', | ||
'itemclassname': 'entur-radio-checkbox', | ||
'radiocheckicon': 'entur-radio-check-icon', | ||
'checkboxcheckicon': 'entur-checkbox-check-icon', | ||
'entur-radio-checkbox-group': 'entur-radio-checkbox-group', | ||
@@ -68,3 +70,5 @@ 'entur-radio-checkbox-group--horizontal': 'entur-radio-checkbox-group--horizontal', | ||
'entur-radio-checkbox__input': 'entur-radio-checkbox__input', | ||
'entur-radio-checkbox__label': 'entur-radio-checkbox__label' | ||
'entur-radio-checkbox__label': 'entur-radio-checkbox__label', | ||
'entur-radio-check-icon': 'entur-radio-check-icon', | ||
'entur-checkbox-check-icon': 'entur-checkbox-check-icon' | ||
}; | ||
@@ -83,3 +87,5 @@ | ||
label = props.label, | ||
rest = _objectWithoutProperties(props, ['id', 'className', 'value', 'label']); | ||
checked = props.checked, | ||
disabled = props.disabled, | ||
rest = _objectWithoutProperties(props, ['id', 'className', 'value', 'label', 'checked', 'disabled']); | ||
@@ -97,3 +103,5 @@ var combinedClassNames = (0, _classnames2.default)(_styles.itemclassname, className); | ||
type: 'checkbox', | ||
value: value | ||
value: value, | ||
checked: checked, | ||
disabled: disabled | ||
}, rest)), | ||
@@ -126,3 +134,3 @@ _react2.default.createElement( | ||
var combinedClassNames = (0, _classnames2.default)(_styles.rootClassName, className, _defineProperty({}, _styles.rootClassName + '--' + direction, direction)); | ||
var combinedClassNames = (0, _classnames2.default)(_styles.rootclassname, className, _defineProperty({}, _styles.rootclassname + '--' + direction, direction)); | ||
@@ -129,0 +137,0 @@ var childrenArray = _react2.default.Children.toArray(children); |
@@ -60,4 +60,6 @@ 'use strict'; | ||
'focus': '#44c0ff', | ||
'rootClassName': 'entur-radio-checkbox-group', | ||
'rootclassname': 'entur-radio-checkbox-group', | ||
'itemclassname': 'entur-radio-checkbox', | ||
'radiocheckicon': 'entur-radio-check-icon', | ||
'checkboxcheckicon': 'entur-checkbox-check-icon', | ||
'entur-radio-checkbox-group': 'entur-radio-checkbox-group', | ||
@@ -68,3 +70,5 @@ 'entur-radio-checkbox-group--horizontal': 'entur-radio-checkbox-group--horizontal', | ||
'entur-radio-checkbox__input': 'entur-radio-checkbox__input', | ||
'entur-radio-checkbox__label': 'entur-radio-checkbox__label' | ||
'entur-radio-checkbox__label': 'entur-radio-checkbox__label', | ||
'entur-radio-check-icon': 'entur-radio-check-icon', | ||
'entur-checkbox-check-icon': 'entur-checkbox-check-icon' | ||
}; | ||
@@ -83,3 +87,5 @@ | ||
label = props.label, | ||
rest = _objectWithoutProperties(props, ['id', 'className', 'value', 'label']); | ||
checked = props.checked, | ||
disabled = props.disabled, | ||
rest = _objectWithoutProperties(props, ['id', 'className', 'value', 'label', 'checked', 'disabled']); | ||
@@ -97,3 +103,5 @@ var combinedClassNames = (0, _classnames2.default)(_styles.itemclassname, className); | ||
type: 'radio', | ||
value: value | ||
value: value, | ||
checked: checked, | ||
disabled: disabled | ||
}, rest)), | ||
@@ -129,3 +137,3 @@ _react2.default.createElement( | ||
var combinedClassNames = (0, _classnames2.default)(_styles.rootClassName, className, _defineProperty({}, _styles.rootClassName + '--' + direction, direction)); | ||
var combinedClassNames = (0, _classnames2.default)(_styles.rootclassname, className, _defineProperty({}, _styles.rootclassname + '--' + direction, direction)); | ||
@@ -132,0 +140,0 @@ var childrenArray = _react2.default.Children.toArray(children); |
@@ -81,3 +81,4 @@ 'use strict'; | ||
value: _propTypes2.default.string, | ||
valid: _propTypes2.default.oneOf(['success', 'error', 'warning', 'info', 'none']) | ||
valid: _propTypes2.default.oneOf(['success', 'error', 'warning', 'info', 'none']), | ||
refCallback: _propTypes2.default.func | ||
}; | ||
@@ -88,3 +89,4 @@ | ||
value: '', | ||
onChange: function onChange() {} | ||
onChange: function onChange() {}, | ||
refCallback: function refCallback() {} | ||
}; | ||
@@ -98,12 +100,13 @@ | ||
function TextField(props) { | ||
var className = props.className, | ||
size = props.size, | ||
width = props.width, | ||
valid = props.valid, | ||
rest = _objectWithoutProperties(props, ['className', 'size', 'width', 'valid']); | ||
function TextField(_ref) { | ||
var className = _ref.className, | ||
size = _ref.size, | ||
width = _ref.width, | ||
valid = _ref.valid, | ||
refCallback = _ref.refCallback, | ||
rest = _objectWithoutProperties(_ref, ['className', 'size', 'width', 'valid', 'refCallback']); | ||
var combinedClassNames = getClassNames(className, size, width, valid); | ||
return _react2.default.createElement('input', _extends({}, rest, { className: combinedClassNames })); | ||
return _react2.default.createElement('input', _extends({ ref: refCallback, className: combinedClassNames }, rest)); | ||
} | ||
@@ -114,12 +117,13 @@ | ||
function TextArea(props) { | ||
var className = props.className, | ||
size = props.size, | ||
width = props.width, | ||
valid = props.valid, | ||
rest = _objectWithoutProperties(props, ['className', 'size', 'width', 'valid']); | ||
function TextArea(_ref2) { | ||
var className = _ref2.className, | ||
size = _ref2.size, | ||
width = _ref2.width, | ||
valid = _ref2.valid, | ||
refCallback = _ref2.refCallback, | ||
rest = _objectWithoutProperties(_ref2, ['className', 'size', 'width', 'valid', 'refCallback']); | ||
var combinedClassNames = getClassNames(className, size, width, valid); | ||
return _react2.default.createElement('textarea', _extends({}, rest, { className: combinedClassNames })); | ||
return _react2.default.createElement('textarea', _extends({ ref: refCallback, className: combinedClassNames }, rest)); | ||
} | ||
@@ -126,0 +130,0 @@ |
@@ -39,4 +39,2 @@ 'use strict'; | ||
var _alertMessage2 = _interopRequireDefault(_alertMessage); | ||
var _formControl = require('../formControl'); | ||
@@ -90,3 +88,3 @@ | ||
mappedChildren, | ||
alertLabel && _react2.default.createElement(_alertMessage2.default, { level: alertLevel, label: alertLabel }) | ||
alertLabel && _react2.default.createElement(_alertMessage.AlertMessage, { level: alertLevel, label: alertLabel }) | ||
); | ||
@@ -119,3 +117,3 @@ } | ||
children, | ||
alertLabel && _react2.default.createElement(_alertMessage2.default, { level: alertLevel, label: alertLabel }) | ||
alertLabel && _react2.default.createElement(_alertMessage.AlertMessage, { level: alertLevel, label: alertLabel }) | ||
); | ||
@@ -122,0 +120,0 @@ } |
336
lib/index.js
@@ -64,46 +64,52 @@ 'use strict'; | ||
Object.keys(_label).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function get() { | ||
return _label[key]; | ||
} | ||
}); | ||
Object.defineProperty(exports, 'Label', { | ||
enumerable: true, | ||
get: function get() { | ||
return _label.Label; | ||
} | ||
}); | ||
Object.defineProperty(exports, 'Legend', { | ||
enumerable: true, | ||
get: function get() { | ||
return _label.Legend; | ||
} | ||
}); | ||
var _button = require('./components/button'); | ||
Object.keys(_button).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function get() { | ||
return _button[key]; | ||
} | ||
}); | ||
Object.defineProperty(exports, 'Button', { | ||
enumerable: true, | ||
get: function get() { | ||
return _button.Button; | ||
} | ||
}); | ||
Object.defineProperty(exports, 'LinkButton', { | ||
enumerable: true, | ||
get: function get() { | ||
return _button.LinkButton; | ||
} | ||
}); | ||
var _inputButton = require('./components/button/inputButton'); | ||
Object.keys(_inputButton).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function get() { | ||
return _inputButton[key]; | ||
} | ||
}); | ||
Object.defineProperty(exports, 'RadioButton', { | ||
enumerable: true, | ||
get: function get() { | ||
return _inputButton.RadioButton; | ||
} | ||
}); | ||
Object.defineProperty(exports, 'CheckboxButton', { | ||
enumerable: true, | ||
get: function get() { | ||
return _inputButton.CheckboxButton; | ||
} | ||
}); | ||
var _buttonGroup = require('./components/button/buttonGroup'); | ||
Object.keys(_buttonGroup).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function get() { | ||
return _buttonGroup[key]; | ||
} | ||
}); | ||
Object.defineProperty(exports, 'ButtonGroup', { | ||
enumerable: true, | ||
get: function get() { | ||
return _buttonGroup.ButtonGroup; | ||
} | ||
}); | ||
@@ -113,34 +119,37 @@ | ||
Object.keys(_checkbox).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function get() { | ||
return _checkbox[key]; | ||
} | ||
}); | ||
Object.defineProperty(exports, 'Checkbox', { | ||
enumerable: true, | ||
get: function get() { | ||
return _checkbox.Checkbox; | ||
} | ||
}); | ||
Object.defineProperty(exports, 'CheckboxGroup', { | ||
enumerable: true, | ||
get: function get() { | ||
return _checkbox.CheckboxGroup; | ||
} | ||
}); | ||
var _radio = require('./components/checkbox-radio/radio'); | ||
Object.keys(_radio).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function get() { | ||
return _radio[key]; | ||
} | ||
}); | ||
Object.defineProperty(exports, 'Radio', { | ||
enumerable: true, | ||
get: function get() { | ||
return _radio.Radio; | ||
} | ||
}); | ||
Object.defineProperty(exports, 'RadioGroup', { | ||
enumerable: true, | ||
get: function get() { | ||
return _radio.RadioGroup; | ||
} | ||
}); | ||
var _slideSwitch = require('./components/slideSwitch'); | ||
Object.keys(_slideSwitch).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function get() { | ||
return _slideSwitch[key]; | ||
} | ||
}); | ||
Object.defineProperty(exports, 'SlideSwitch', { | ||
enumerable: true, | ||
get: function get() { | ||
return _slideSwitch.SlideSwitch; | ||
} | ||
}); | ||
@@ -150,62 +159,189 @@ | ||
Object.keys(_formControl).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function get() { | ||
return _formControl[key]; | ||
} | ||
}); | ||
Object.defineProperty(exports, 'TextField', { | ||
enumerable: true, | ||
get: function get() { | ||
return _formControl.TextField; | ||
} | ||
}); | ||
Object.defineProperty(exports, 'TextArea', { | ||
enumerable: true, | ||
get: function get() { | ||
return _formControl.TextArea; | ||
} | ||
}); | ||
var _dropdown = require('./components/formControl/dropdown'); | ||
Object.keys(_dropdown).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function get() { | ||
return _dropdown[key]; | ||
} | ||
}); | ||
Object.defineProperty(exports, 'DropDown', { | ||
enumerable: true, | ||
get: function get() { | ||
return _dropdown.DropDown; | ||
} | ||
}); | ||
Object.defineProperty(exports, 'DropDownOptions', { | ||
enumerable: true, | ||
get: function get() { | ||
return _dropdown.DropDownOptions; | ||
} | ||
}); | ||
var _formGroup = require('./components/formGroup'); | ||
Object.keys(_formGroup).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function get() { | ||
return _formGroup[key]; | ||
} | ||
}); | ||
Object.defineProperty(exports, 'FieldSetGroup', { | ||
enumerable: true, | ||
get: function get() { | ||
return _formGroup.FieldSetGroup; | ||
} | ||
}); | ||
Object.defineProperty(exports, 'FormGroup', { | ||
enumerable: true, | ||
get: function get() { | ||
return _formGroup.FormGroup; | ||
} | ||
}); | ||
var _icons = require('./components/icons'); | ||
var _alertMessage = require('./components/alertMessage'); | ||
Object.keys(_icons).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function get() { | ||
return _icons[key]; | ||
} | ||
}); | ||
Object.defineProperty(exports, 'AlertMessage', { | ||
enumerable: true, | ||
get: function get() { | ||
return _alertMessage.AlertMessage; | ||
} | ||
}); | ||
var _alertMessage = require('./components/alertMessage'); | ||
var _arrow = require('./components/icons/arrow'); | ||
Object.keys(_alertMessage).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function get() { | ||
return _alertMessage[key]; | ||
} | ||
}); | ||
Object.defineProperty(exports, 'ArrowIcon', { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_arrow).default; | ||
} | ||
}); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _add = require('./components/icons/add'); | ||
// components | ||
Object.defineProperty(exports, 'AddIcon', { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_add).default; | ||
} | ||
}); | ||
var _check = require('./components/icons/check'); | ||
Object.defineProperty(exports, 'CheckIcon', { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_check).default; | ||
} | ||
}); | ||
var _close = require('./components/icons/close'); | ||
Object.defineProperty(exports, 'CloseIcon', { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_close).default; | ||
} | ||
}); | ||
var _delete = require('./components/icons/delete'); | ||
Object.defineProperty(exports, 'DeleteIcon', { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_delete).default; | ||
} | ||
}); | ||
var _edit = require('./components/icons/edit'); | ||
Object.defineProperty(exports, 'EditIcon', { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_edit).default; | ||
} | ||
}); | ||
var _error = require('./components/icons/error'); | ||
Object.defineProperty(exports, 'ErrorIcon', { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_error).default; | ||
} | ||
}); | ||
var _exclamation = require('./components/icons/exclamation'); | ||
Object.defineProperty(exports, 'ExclamationIcon', { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_exclamation).default; | ||
} | ||
}); | ||
var _file = require('./components/icons/file'); | ||
Object.defineProperty(exports, 'FileIcon', { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_file).default; | ||
} | ||
}); | ||
var _settings = require('./components/icons/settings'); | ||
Object.defineProperty(exports, 'SettingsIcon', { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_settings).default; | ||
} | ||
}); | ||
var _stats = require('./components/icons/stats'); | ||
Object.defineProperty(exports, 'StatsIcon', { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_stats).default; | ||
} | ||
}); | ||
var _success = require('./components/icons/success'); | ||
Object.defineProperty(exports, 'SuccessIcon', { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_success).default; | ||
} | ||
}); | ||
var _train = require('./components/icons/train'); | ||
Object.defineProperty(exports, 'TrainIcon', { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_train).default; | ||
} | ||
}); | ||
var _user = require('./components/icons/user'); | ||
Object.defineProperty(exports, 'UserIcon', { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_user).default; | ||
} | ||
}); | ||
var _dots = require('./components/icons/dots'); | ||
Object.defineProperty(exports, 'DotsIcon', { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_dots).default; | ||
} | ||
}); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
{ | ||
"name": "@entur/component-library", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"license": "EUPL-1.2", | ||
@@ -10,3 +10,4 @@ "main": "lib/index.js", | ||
"process:css": "node-sass src/index.scss > lib/index.css", | ||
"build": "rm -rf lib && npm run process:js && npm run process:css", | ||
"process:svg": "node scripts/processSvg", | ||
"build": "rm -rf lib && npm run process:js && npm run process:css && npm run process:svg", | ||
"build-storybook": "rm -rf dist && build-storybook -s ./public -c .storybook -o dist", | ||
@@ -41,6 +42,9 @@ "prepublishOnly": "npm run build", | ||
"file-loader": "^1.1.11", | ||
"mkdirp": "^0.5.1", | ||
"node-glob": "^1.2.0", | ||
"node-sass": "^4.7.2", | ||
"react": "^16.2.0", | ||
"react-dom": "^16.2.0", | ||
"sass-loader": "^6.0.6" | ||
"sass-loader": "^6.0.6", | ||
"svgo": "^1.0.5" | ||
}, | ||
@@ -47,0 +51,0 @@ "peerDependencies": { |
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { Error, Exclamation, Success } from '../icons'; | ||
import ErrorIcon from '../icons/error'; | ||
import ExclamationIcon from '../icons/exclamation'; | ||
import SuccessIcon from '../icons/success'; | ||
@@ -14,7 +16,7 @@ import { dark_coral, dark_mint } from '../../styles/_colors.scss'; | ||
case 'success': | ||
return <Success className={`${rootClassName}__icon`} color={dark_mint} />; | ||
return <SuccessIcon className={`${rootClassName}__icon`} color={dark_mint} />; | ||
case 'error': | ||
return <Error className={`${rootClassName}__icon`} color={dark_coral} />; | ||
return <ErrorIcon className={`${rootClassName}__icon`} color={dark_coral} />; | ||
case 'warning': | ||
return <Exclamation className={`${rootClassName}__icon`} />; | ||
return <ExclamationIcon className={`${rootClassName}__icon`} />; | ||
case 'none': | ||
@@ -27,3 +29,3 @@ return null; | ||
function AlertMessage({ level, label }) { | ||
export function AlertMessage({ level, label }) { | ||
return ( | ||
@@ -43,3 +45,1 @@ <div className={rootClassName}> | ||
}; | ||
export default AlertMessage; |
@@ -5,6 +5,6 @@ import React from 'react'; | ||
import { rootClassName, itemclassname } from './styles.scss'; | ||
import { rootclassname, itemclassname } from './styles.scss'; | ||
export function Checkbox(props) { | ||
const { id, className, value, label, ...rest } = props; | ||
const { id, className, value, label, checked, disabled, ...rest } = props; | ||
@@ -22,2 +22,4 @@ const combinedClassNames = cx(itemclassname, className); | ||
value={value} | ||
checked={checked} | ||
disabled={disabled} | ||
{...rest} | ||
@@ -45,4 +47,4 @@ /> | ||
const combinedClassNames = cx(rootClassName, className, { | ||
[`${rootClassName}--${direction}`]: direction | ||
const combinedClassNames = cx(rootclassname, className, { | ||
[`${rootclassname}--${direction}`]: direction | ||
}); | ||
@@ -49,0 +51,0 @@ |
@@ -5,6 +5,6 @@ import React from 'react'; | ||
import { rootClassName, itemclassname } from './styles.scss'; | ||
import { rootclassname, itemclassname } from './styles.scss'; | ||
export function Radio(props) { | ||
const { id, className, value, label, ...rest } = props; | ||
const { id, className, value, label, checked, disabled, ...rest } = props; | ||
@@ -22,2 +22,4 @@ const combinedClassNames = cx(itemclassname, className); | ||
value={value} | ||
checked={checked} | ||
disabled={disabled} | ||
{...rest} | ||
@@ -55,4 +57,4 @@ /> | ||
const combinedClassNames = cx(rootClassName, className, { | ||
[`${rootClassName}--${direction}`]: direction | ||
const combinedClassNames = cx(rootclassname, className, { | ||
[`${rootclassname}--${direction}`]: direction | ||
}); | ||
@@ -59,0 +61,0 @@ |
@@ -12,3 +12,4 @@ import React from 'react'; | ||
value: PropTypes.string, | ||
valid: PropTypes.oneOf(['success', 'error', 'warning', 'info', 'none']) | ||
valid: PropTypes.oneOf(['success', 'error', 'warning', 'info', 'none']), | ||
refCallback: PropTypes.func | ||
}; | ||
@@ -19,3 +20,4 @@ | ||
value: '', | ||
onChange: () => {} | ||
onChange: () => {}, | ||
refCallback: () => {} | ||
}; | ||
@@ -31,7 +33,13 @@ | ||
export function TextField(props) { | ||
const { className, size, width, valid, ...rest } = props; | ||
export function TextField({ | ||
className, | ||
size, | ||
width, | ||
valid, | ||
refCallback, | ||
...rest | ||
}) { | ||
const combinedClassNames = getClassNames(className, size, width, valid); | ||
return <input {...rest} className={combinedClassNames} />; | ||
return <input ref={refCallback} className={combinedClassNames} {...rest} />; | ||
} | ||
@@ -42,7 +50,15 @@ | ||
export function TextArea(props) { | ||
const { className, size, width, valid, ...rest } = props; | ||
export function TextArea({ | ||
className, | ||
size, | ||
width, | ||
valid, | ||
refCallback, | ||
...rest | ||
}) { | ||
const combinedClassNames = getClassNames(className, size, width, valid); | ||
return <textarea {...rest} className={combinedClassNames} />; | ||
return ( | ||
<textarea ref={refCallback} className={combinedClassNames} {...rest} /> | ||
); | ||
} | ||
@@ -49,0 +65,0 @@ |
@@ -7,3 +7,3 @@ import React from 'react'; | ||
import { Label, Legend } from '../label'; | ||
import AlertMessage from '../alertMessage'; | ||
import { AlertMessage } from '../alertMessage'; | ||
import { TextField, TextArea } from '../formControl'; | ||
@@ -10,0 +10,0 @@ import { DropDown } from '../formControl/dropdown'; |
@@ -6,13 +6,28 @@ // config | ||
// components | ||
export * from './components/label'; | ||
export * from './components/button'; | ||
export * from './components/button/inputButton'; | ||
export * from './components/button/buttonGroup'; | ||
export * from './components/checkbox-radio/checkbox'; | ||
export * from './components/checkbox-radio/radio'; | ||
export * from './components/slideSwitch'; | ||
export * from './components/formControl'; | ||
export * from './components/formControl/dropdown'; | ||
export * from './components/formGroup'; | ||
export * from './components/icons'; | ||
export * from './components/alertMessage'; | ||
export { Label, Legend } from './components/label'; | ||
export { Button, LinkButton } from './components/button'; | ||
export { RadioButton, CheckboxButton } from './components/button/inputButton'; | ||
export { ButtonGroup } from './components/button/buttonGroup'; | ||
export { Checkbox, CheckboxGroup } from './components/checkbox-radio/checkbox'; | ||
export { Radio, RadioGroup } from './components/checkbox-radio/radio'; | ||
export { SlideSwitch } from './components/slideSwitch'; | ||
export { TextField, TextArea } from './components/formControl'; | ||
export { DropDown, DropDownOptions } from './components/formControl/dropdown'; | ||
export { FieldSetGroup, FormGroup } from './components/formGroup'; | ||
export { AlertMessage } from './components/alertMessage'; | ||
export { default as ArrowIcon } from './components/icons/arrow'; | ||
export { default as AddIcon } from './components/icons/add'; | ||
export { default as CheckIcon } from './components/icons/check'; | ||
export { default as CloseIcon } from './components/icons/close'; | ||
export { default as DeleteIcon } from './components/icons/delete'; | ||
export { default as EditIcon } from './components/icons/edit'; | ||
export { default as ErrorIcon } from './components/icons/error'; | ||
export { default as ExclamationIcon } from './components/icons/exclamation'; | ||
export { default as FileIcon } from './components/icons/file'; | ||
export { default as SettingsIcon } from './components/icons/settings'; | ||
export { default as StatsIcon } from './components/icons/stats'; | ||
export { default as SuccessIcon } from './components/icons/success'; | ||
export { default as TrainIcon } from './components/icons/train'; | ||
export { default as UserIcon } from './components/icons/user'; | ||
export { default as DotsIcon } from './components/icons/dots'; |
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
444336
93
4368
27
4