@lostmyname/components
Advanced tools
Comparing version 0.2.2 to 1.0.0
@@ -139,3 +139,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
exports.__esModule = true; | ||
exports.Row = exports.RowPropTypes = exports.Col = exports.ColPropTypes = undefined; | ||
exports.Row = exports.componentPropTypes = exports.oneOfProps = exports.Col = undefined; | ||
@@ -152,4 +152,2 @@ var _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; }; | ||
var _definitions = __webpack_require__(6); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
@@ -159,27 +157,20 @@ | ||
__webpack_require__(7); | ||
__webpack_require__(6); | ||
var ColPropTypes = exports.ColPropTypes = { | ||
numOfCols: { | ||
type: 'number', | ||
required: true, | ||
defaultValue: 1, | ||
description: 'The number of sibling columns so we can determine the column class programmatically.' | ||
}, | ||
className: { | ||
type: 'string', | ||
description: 'Any other CSS classes to go on this component.' | ||
}, | ||
children: { | ||
type: 'any', | ||
description: 'The contents of the column. If the value returns falsy, the column does not get rendered or affect any other column width calculation.' | ||
} | ||
var colPropTypes = { | ||
numOfCols: _react.PropTypes.number.isRequired, | ||
className: _react.PropTypes.string, | ||
children: _react.PropTypes.any | ||
}; | ||
var colDefaultProps = { | ||
numOfCols: 1 | ||
}; | ||
var Col = exports.Col = _react2['default'].createClass({ | ||
displayName: 'Col', | ||
propTypes: (0, _definitions.getPropTypes)(ColPropTypes), | ||
propTypes: colPropTypes, | ||
getDefaultProps: function getDefaultProps() { | ||
return (0, _definitions.getDefaultProps)(ColPropTypes); | ||
return colDefaultProps; | ||
}, | ||
@@ -210,33 +201,18 @@ | ||
var RowPropTypes = exports.RowPropTypes = { | ||
className: { | ||
type: 'string' | ||
}, | ||
rowsSpacedOn: { | ||
type: 'oneOf', | ||
allowedValues: mqs, | ||
canBeNull: true | ||
}, | ||
colsSpacedOn: { | ||
type: 'oneOf', | ||
allowedValues: mqs, | ||
defaultValue: 'base', | ||
canBeNull: true | ||
}, | ||
colsReversedOn: { | ||
type: 'oneOf', | ||
allowedValues: mqs, | ||
canBeNull: true | ||
}, | ||
colsToRowsOn: { | ||
type: 'oneOf', | ||
allowedValues: mqs, | ||
canBeNull: true | ||
}, | ||
children: { | ||
type: 'any', | ||
description: 'A `<Col>` element is the only acceptable component here.' | ||
} | ||
var oneOfProps = exports.oneOfProps = { | ||
rowsSpacedOn: mqs, | ||
colsSpacedOn: mqs, | ||
colsReversedOn: mqs, | ||
colsToRowsOn: mqs | ||
}; | ||
var componentPropTypes = exports.componentPropTypes = { | ||
className: _react.PropTypes.string, | ||
rowsSpacedOn: _react.PropTypes.oneOf(oneOfProps.rowsSpacedOn), | ||
colsSpacedOn: _react.PropTypes.oneOf(oneOfProps.colsSpacedOn), | ||
colsReversedOn: _react.PropTypes.oneOf(oneOfProps.colsReversedOn), | ||
colsToRowsOn: _react.PropTypes.oneOf(oneOfProps.colsToRowsOn), | ||
children: _react.PropTypes.any | ||
}; | ||
var getSuffix = function getSuffix(value) { | ||
@@ -252,6 +228,3 @@ if (value === 'base') { | ||
propTypes: (0, _definitions.getPropTypes)(RowPropTypes), | ||
getDefaultProps: function getDefaultProps() { | ||
return (0, _definitions.getDefaultProps)(RowPropTypes); | ||
}, | ||
propTypes: componentPropTypes, | ||
getEmptyChildren: function getEmptyChildren() { | ||
@@ -392,79 +365,2 @@ if (this.props.children) { | ||
/* 6 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
exports.__esModule = true; | ||
exports.translationsToDefinitions = exports.getPropTypes = exports.getDefaultProps = exports.getInitialState = undefined; | ||
var _react = __webpack_require__(2); | ||
var getInitialState = exports.getInitialState = function getInitialState(definitionObj) { | ||
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var defaults = {}; | ||
definitionObj.propTypes.forEach(function (_ref) { | ||
var propName = _ref.propName, | ||
defaultValue = _ref.defaultValue; | ||
if (Object.hasOwnProperty.call(props, propName)) { | ||
defaults[propName] = props[propName]; | ||
} else { | ||
defaults[propName] = defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; // const PropTypes = require('react').PropTypes; | ||
var getDefaultProps = exports.getDefaultProps = function getDefaultProps(propsObject) { | ||
var defaults = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
if (typeof prop.defaultValue !== 'undefined') { | ||
defaults[propName] = prop.defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; | ||
var getPropTypes = exports.getPropTypes = function getPropTypes() { | ||
var propsObject = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var propTypes = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
var propType = void 0; | ||
if (prop.allowedValues) { | ||
propType = _react.PropTypes[prop.type](prop.allowedValues); | ||
} else { | ||
propType = _react.PropTypes[prop.type]; | ||
} | ||
if (prop.required) { | ||
propType = propType.isRequired; | ||
} | ||
propTypes[propName] = propType; | ||
}); | ||
return propTypes; | ||
}; | ||
var translationsToDefinitions = exports.translationsToDefinitions = function translationsToDefinitions(translations) { | ||
var translationProps = {}; | ||
Object.keys(translations).forEach(function (translationKey) { | ||
translationProps[translationKey] = { | ||
type: 'string', | ||
required: true, | ||
defaultValue: translations[translationKey] | ||
}; | ||
}); | ||
return translationProps; | ||
}; | ||
/***/ }, | ||
/* 7 */ | ||
/***/ function(module, exports) { | ||
@@ -471,0 +367,0 @@ |
@@ -57,3 +57,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
module.exports = __webpack_require__(11); | ||
module.exports = __webpack_require__(10); | ||
@@ -125,84 +125,7 @@ | ||
/***/ }, | ||
/* 6 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
exports.__esModule = true; | ||
exports.translationsToDefinitions = exports.getPropTypes = exports.getDefaultProps = exports.getInitialState = undefined; | ||
var _react = __webpack_require__(2); | ||
var getInitialState = exports.getInitialState = function getInitialState(definitionObj) { | ||
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var defaults = {}; | ||
definitionObj.propTypes.forEach(function (_ref) { | ||
var propName = _ref.propName, | ||
defaultValue = _ref.defaultValue; | ||
if (Object.hasOwnProperty.call(props, propName)) { | ||
defaults[propName] = props[propName]; | ||
} else { | ||
defaults[propName] = defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; // const PropTypes = require('react').PropTypes; | ||
var getDefaultProps = exports.getDefaultProps = function getDefaultProps(propsObject) { | ||
var defaults = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
if (typeof prop.defaultValue !== 'undefined') { | ||
defaults[propName] = prop.defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; | ||
var getPropTypes = exports.getPropTypes = function getPropTypes() { | ||
var propsObject = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var propTypes = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
var propType = void 0; | ||
if (prop.allowedValues) { | ||
propType = _react.PropTypes[prop.type](prop.allowedValues); | ||
} else { | ||
propType = _react.PropTypes[prop.type]; | ||
} | ||
if (prop.required) { | ||
propType = propType.isRequired; | ||
} | ||
propTypes[propName] = propType; | ||
}); | ||
return propTypes; | ||
}; | ||
var translationsToDefinitions = exports.translationsToDefinitions = function translationsToDefinitions(translations) { | ||
var translationProps = {}; | ||
Object.keys(translations).forEach(function (translationKey) { | ||
translationProps[translationKey] = { | ||
type: 'string', | ||
required: true, | ||
defaultValue: translations[translationKey] | ||
}; | ||
}); | ||
return translationProps; | ||
}; | ||
/***/ }, | ||
/* 6 */, | ||
/* 7 */, | ||
/* 8 */, | ||
/* 9 */, | ||
/* 10 */, | ||
/* 11 */ | ||
/* 10 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -213,3 +136,3 @@ | ||
exports.__esModule = true; | ||
exports.Animation = exports.PropTypes = undefined; | ||
exports.Animation = exports.componentPropTypes = exports.defaultProps = exports.oneOfProps = undefined; | ||
@@ -224,6 +147,4 @@ var _react = __webpack_require__(2); | ||
var _definitions = __webpack_require__(6); | ||
__webpack_require__(11); | ||
__webpack_require__(12); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
@@ -233,36 +154,25 @@ | ||
var PropTypes = exports.PropTypes = { | ||
name: { | ||
type: 'oneOf', | ||
allowedValues: ['fade', 'scale-down-fade', 'swivel-fade', 'jelly'], | ||
required: true | ||
}, | ||
easing: { | ||
type: 'oneOf', | ||
allowedValues: ['in', 'out', 'bounce'], | ||
defaultValue: 'out', | ||
required: true | ||
}, | ||
duration: { | ||
type: 'oneOf', | ||
allowedValues: ['250ms', '500ms', '1s'], | ||
required: true, | ||
defaultValue: '500ms' | ||
}, | ||
direction: { | ||
type: 'oneOf', | ||
allowedValues: ['normal', 'reverse', 'alternate', 'alternate-reverse'], | ||
defaultValue: 'normal' | ||
}, | ||
infinite: { | ||
type: 'bool' | ||
}, | ||
animating: { | ||
type: 'bool' | ||
}, | ||
children: { | ||
type: 'any' | ||
} | ||
var oneOfProps = exports.oneOfProps = { | ||
name: ['fade', 'scale-down-fade', 'swivel-fade', 'jelly'], | ||
easing: ['in', 'out', 'bounce'], | ||
duration: ['0.25s', '0.5s', '1s'], | ||
direction: ['normal', 'reverse', 'alternate', 'alternate-reverse'] | ||
}; | ||
var defaultProps = exports.defaultProps = { | ||
easing: 'out', | ||
duration: '0.5s', | ||
direction: 'normal' | ||
}; | ||
var componentPropTypes = exports.componentPropTypes = { | ||
name: _react.PropTypes.oneOf(oneOfProps.name).isRequired, | ||
easing: _react.PropTypes.oneOf(oneOfProps.easing).isRequired, | ||
duration: _react.PropTypes.oneOf(oneOfProps.duration).isRequired, | ||
direction: _react.PropTypes.oneOf(oneOfProps.direction).isRequired, | ||
infinite: _react.PropTypes.bool, | ||
animating: _react.PropTypes.bool, | ||
children: _react.PropTypes.any | ||
}; | ||
/** | ||
@@ -284,6 +194,8 @@ * Component Signature | ||
{ | ||
className: (0, _classnames2['default'])('animation', _defineProperty({}, 'animation-' + props.name, props.animating && !!props.name), _defineProperty({}, 'animation-' + props.easing, props.easing), _defineProperty({}, 'animation-' + props.duration, props.duration), { 'animation-infinite': props.infinite }), | ||
className: (0, _classnames2['default'])('animation', _defineProperty({}, 'animation-' + props.name, props.animating && !!props.name), _defineProperty({}, 'animation-' + props.easing, props.easing), { 'animation-infinite': props.infinite }), | ||
style: { | ||
animationDirection: props.direction, | ||
WebkitAnimationDirection: props.direction | ||
WebkitAnimationDirection: props.direction, | ||
animationDuration: props.duration, | ||
WebkitAnimationDuration: props.duration | ||
} }, | ||
@@ -294,3 +206,4 @@ props.children | ||
Animation.propTypes = (0, _definitions.getPropTypes)(PropTypes); | ||
Animation.propTypes = componentPropTypes; | ||
Animation.defaultProps = defaultProps; | ||
@@ -300,3 +213,3 @@ exports['default'] = Animation; | ||
/***/ }, | ||
/* 12 */ | ||
/* 11 */ | ||
/***/ function(module, exports) { | ||
@@ -303,0 +216,0 @@ |
144
lib/Badge.js
@@ -57,3 +57,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
module.exports = __webpack_require__(14); | ||
module.exports = __webpack_require__(13); | ||
@@ -125,79 +125,3 @@ | ||
/***/ }, | ||
/* 6 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
exports.__esModule = true; | ||
exports.translationsToDefinitions = exports.getPropTypes = exports.getDefaultProps = exports.getInitialState = undefined; | ||
var _react = __webpack_require__(2); | ||
var getInitialState = exports.getInitialState = function getInitialState(definitionObj) { | ||
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var defaults = {}; | ||
definitionObj.propTypes.forEach(function (_ref) { | ||
var propName = _ref.propName, | ||
defaultValue = _ref.defaultValue; | ||
if (Object.hasOwnProperty.call(props, propName)) { | ||
defaults[propName] = props[propName]; | ||
} else { | ||
defaults[propName] = defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; // const PropTypes = require('react').PropTypes; | ||
var getDefaultProps = exports.getDefaultProps = function getDefaultProps(propsObject) { | ||
var defaults = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
if (typeof prop.defaultValue !== 'undefined') { | ||
defaults[propName] = prop.defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; | ||
var getPropTypes = exports.getPropTypes = function getPropTypes() { | ||
var propsObject = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var propTypes = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
var propType = void 0; | ||
if (prop.allowedValues) { | ||
propType = _react.PropTypes[prop.type](prop.allowedValues); | ||
} else { | ||
propType = _react.PropTypes[prop.type]; | ||
} | ||
if (prop.required) { | ||
propType = propType.isRequired; | ||
} | ||
propTypes[propName] = propType; | ||
}); | ||
return propTypes; | ||
}; | ||
var translationsToDefinitions = exports.translationsToDefinitions = function translationsToDefinitions(translations) { | ||
var translationProps = {}; | ||
Object.keys(translations).forEach(function (translationKey) { | ||
translationProps[translationKey] = { | ||
type: 'string', | ||
required: true, | ||
defaultValue: translations[translationKey] | ||
}; | ||
}); | ||
return translationProps; | ||
}; | ||
/***/ }, | ||
/* 6 */, | ||
/* 7 */, | ||
@@ -209,4 +133,3 @@ /* 8 */, | ||
/* 12 */, | ||
/* 13 */, | ||
/* 14 */ | ||
/* 13 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -217,3 +140,3 @@ | ||
exports.__esModule = true; | ||
exports.PropTypes = undefined; | ||
exports.defaultProps = exports.componentPropTypes = undefined; | ||
@@ -228,25 +151,20 @@ var _react = __webpack_require__(2); | ||
var _Icon = __webpack_require__(15); | ||
var _Icon = __webpack_require__(14); | ||
var _Icon2 = _interopRequireDefault(_Icon); | ||
var _definitions = __webpack_require__(6); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
__webpack_require__(19); | ||
var PropTypes = exports.PropTypes = { | ||
icon: { | ||
type: 'string', | ||
defaultValue: 'heart' | ||
}, | ||
absolute: { | ||
type: 'bool' | ||
}, | ||
children: { | ||
type: 'string', | ||
required: true | ||
} | ||
__webpack_require__(18); | ||
var componentPropTypes = exports.componentPropTypes = { | ||
icon: _react.PropTypes.string.isRequired, | ||
absolute: _react.PropTypes.bool, | ||
children: _react.PropTypes.string.isRequired | ||
}; | ||
var defaultProps = exports.defaultProps = { | ||
icon: 'heart' | ||
}; | ||
var Badge = function Badge(props) { | ||
@@ -270,4 +188,4 @@ var badgeClasses = (0, _classnames2['default'])('badge', { 'badge-is-absolute': props.absolute }); | ||
Badge.propTypes = (0, _definitions.getPropTypes)(PropTypes); | ||
Badge.defaultProps = (0, _definitions.getDefaultProps)(PropTypes); | ||
Badge.propTypes = componentPropTypes; | ||
Badge.defaultProps = defaultProps; | ||
@@ -277,3 +195,3 @@ exports['default'] = Badge; | ||
/***/ }, | ||
/* 15 */ | ||
/* 14 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -285,3 +203,3 @@ | ||
var _Icon = __webpack_require__(16); | ||
var _Icon = __webpack_require__(15); | ||
@@ -298,3 +216,3 @@ Object.defineProperty(exports, 'default', { | ||
/***/ }, | ||
/* 16 */ | ||
/* 15 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -305,3 +223,3 @@ | ||
exports.__esModule = true; | ||
exports.Icon = exports.PropTypes = undefined; | ||
exports.Icon = exports.componentPropTypes = undefined; | ||
@@ -316,14 +234,8 @@ var _react = __webpack_require__(2); | ||
var _definitions = __webpack_require__(6); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
__webpack_require__(17); | ||
__webpack_require__(16); | ||
var PropTypes = exports.PropTypes = { | ||
icon: { | ||
type: 'string', | ||
required: true, | ||
desription: 'The icon to show, based off of the ss-pika naming conventions' | ||
} | ||
var componentPropTypes = exports.componentPropTypes = { | ||
icon: _react.PropTypes.string.isRequired | ||
}; | ||
@@ -337,3 +249,3 @@ | ||
Icon.propTypes = (0, _definitions.getPropTypes)(PropTypes); | ||
Icon.propTypes = componentPropTypes; | ||
@@ -343,3 +255,3 @@ exports['default'] = Icon; | ||
/***/ }, | ||
/* 17 */ | ||
/* 16 */ | ||
/***/ function(module, exports) { | ||
@@ -350,4 +262,4 @@ | ||
/***/ }, | ||
/* 18 */, | ||
/* 19 */ | ||
/* 17 */, | ||
/* 18 */ | ||
/***/ function(module, exports) { | ||
@@ -354,0 +266,0 @@ |
@@ -57,3 +57,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
module.exports = __webpack_require__(21); | ||
module.exports = __webpack_require__(20); | ||
@@ -125,79 +125,3 @@ | ||
/***/ }, | ||
/* 6 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
exports.__esModule = true; | ||
exports.translationsToDefinitions = exports.getPropTypes = exports.getDefaultProps = exports.getInitialState = undefined; | ||
var _react = __webpack_require__(2); | ||
var getInitialState = exports.getInitialState = function getInitialState(definitionObj) { | ||
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var defaults = {}; | ||
definitionObj.propTypes.forEach(function (_ref) { | ||
var propName = _ref.propName, | ||
defaultValue = _ref.defaultValue; | ||
if (Object.hasOwnProperty.call(props, propName)) { | ||
defaults[propName] = props[propName]; | ||
} else { | ||
defaults[propName] = defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; // const PropTypes = require('react').PropTypes; | ||
var getDefaultProps = exports.getDefaultProps = function getDefaultProps(propsObject) { | ||
var defaults = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
if (typeof prop.defaultValue !== 'undefined') { | ||
defaults[propName] = prop.defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; | ||
var getPropTypes = exports.getPropTypes = function getPropTypes() { | ||
var propsObject = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var propTypes = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
var propType = void 0; | ||
if (prop.allowedValues) { | ||
propType = _react.PropTypes[prop.type](prop.allowedValues); | ||
} else { | ||
propType = _react.PropTypes[prop.type]; | ||
} | ||
if (prop.required) { | ||
propType = propType.isRequired; | ||
} | ||
propTypes[propName] = propType; | ||
}); | ||
return propTypes; | ||
}; | ||
var translationsToDefinitions = exports.translationsToDefinitions = function translationsToDefinitions(translations) { | ||
var translationProps = {}; | ||
Object.keys(translations).forEach(function (translationKey) { | ||
translationProps[translationKey] = { | ||
type: 'string', | ||
required: true, | ||
defaultValue: translations[translationKey] | ||
}; | ||
}); | ||
return translationProps; | ||
}; | ||
/***/ }, | ||
/* 6 */, | ||
/* 7 */, | ||
@@ -210,4 +134,3 @@ /* 8 */, | ||
/* 13 */, | ||
/* 14 */, | ||
/* 15 */ | ||
/* 14 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -219,3 +142,3 @@ | ||
var _Icon = __webpack_require__(16); | ||
var _Icon = __webpack_require__(15); | ||
@@ -232,3 +155,3 @@ Object.defineProperty(exports, 'default', { | ||
/***/ }, | ||
/* 16 */ | ||
/* 15 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -239,3 +162,3 @@ | ||
exports.__esModule = true; | ||
exports.Icon = exports.PropTypes = undefined; | ||
exports.Icon = exports.componentPropTypes = undefined; | ||
@@ -250,14 +173,8 @@ var _react = __webpack_require__(2); | ||
var _definitions = __webpack_require__(6); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
__webpack_require__(17); | ||
__webpack_require__(16); | ||
var PropTypes = exports.PropTypes = { | ||
icon: { | ||
type: 'string', | ||
required: true, | ||
desription: 'The icon to show, based off of the ss-pika naming conventions' | ||
} | ||
var componentPropTypes = exports.componentPropTypes = { | ||
icon: _react.PropTypes.string.isRequired | ||
}; | ||
@@ -271,3 +188,3 @@ | ||
Icon.propTypes = (0, _definitions.getPropTypes)(PropTypes); | ||
Icon.propTypes = componentPropTypes; | ||
@@ -277,3 +194,3 @@ exports['default'] = Icon; | ||
/***/ }, | ||
/* 17 */ | ||
/* 16 */ | ||
/***/ function(module, exports) { | ||
@@ -284,6 +201,6 @@ | ||
/***/ }, | ||
/* 17 */, | ||
/* 18 */, | ||
/* 19 */, | ||
/* 20 */, | ||
/* 21 */ | ||
/* 20 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -294,3 +211,3 @@ | ||
exports.__esModule = true; | ||
exports.PropTypes = undefined; | ||
exports.defaultProps = exports.componentPropTypes = exports.oneOfProps = undefined; | ||
@@ -305,9 +222,7 @@ var _react = __webpack_require__(2); | ||
var _definitions = __webpack_require__(6); | ||
var _Button = __webpack_require__(21); | ||
var _Button = __webpack_require__(22); | ||
var _Button2 = _interopRequireDefault(_Button); | ||
var _Icon = __webpack_require__(15); | ||
var _Icon = __webpack_require__(14); | ||
@@ -318,29 +233,25 @@ var _Icon2 = _interopRequireDefault(_Icon); | ||
__webpack_require__(26); | ||
__webpack_require__(25); | ||
var PropTypes = exports.PropTypes = { | ||
type: { | ||
type: 'oneOf', | ||
allowedValues: ['secondary', 'alert'], | ||
defaultValue: 'secondary', | ||
required: true | ||
}, | ||
showCloseButton: { | ||
type: 'bool' | ||
}, | ||
visible: { | ||
type: 'bool' | ||
}, | ||
onCloseClick: { | ||
type: 'func' | ||
}, | ||
children: { | ||
type: 'node' | ||
} | ||
var oneOfProps = exports.oneOfProps = { | ||
type: ['secondary', 'alert'] | ||
}; | ||
var componentPropTypes = exports.componentPropTypes = { | ||
type: _react.PropTypes.oneOf(oneOfProps.type).isRequired, | ||
showCloseButton: _react.PropTypes.bool, | ||
visible: _react.PropTypes.bool, | ||
onCloseClick: _react.PropTypes.func, | ||
children: _react.PropTypes.any | ||
}; | ||
var defaultProps = exports.defaultProps = { | ||
type: 'secondary' | ||
}; | ||
var Banner = _react2['default'].createClass({ | ||
displayName: 'Banner', | ||
PropTypes: (0, _definitions.getPropTypes)(PropTypes), | ||
propTypes: componentPropTypes, | ||
defaultProps: defaultProps, | ||
getColour: function getColour() { | ||
@@ -389,3 +300,3 @@ var map = { | ||
/***/ }, | ||
/* 22 */ | ||
/* 21 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -397,3 +308,3 @@ | ||
var _Button = __webpack_require__(23); | ||
var _Button = __webpack_require__(22); | ||
@@ -410,3 +321,3 @@ Object.defineProperty(exports, 'default', { | ||
/***/ }, | ||
/* 23 */ | ||
/* 22 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -417,3 +328,3 @@ | ||
exports.__esModule = true; | ||
exports.PropTypes = undefined; | ||
exports.defaultProps = exports.componentPropTypes = exports.oneOfProps = undefined; | ||
@@ -430,4 +341,2 @@ var _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; }; | ||
var _definitions = __webpack_require__(6); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
@@ -437,52 +346,33 @@ | ||
__webpack_require__(24); | ||
__webpack_require__(23); | ||
var PropTypes = exports.PropTypes = { | ||
colour: { | ||
type: 'oneOf', | ||
allowedValues: ['default', 'primary', 'secondary'], | ||
defaultValue: 'default', | ||
required: true | ||
}, | ||
raised: { | ||
type: 'bool' | ||
}, | ||
outlined: { | ||
type: 'bool' | ||
}, | ||
unstyled: { | ||
type: 'bool' | ||
}, | ||
disabled: { | ||
type: 'bool' | ||
}, | ||
textSize: { | ||
type: 'oneOf', | ||
allowedValues: ['small'], | ||
canBeNull: true | ||
}, | ||
fullWidth: { | ||
type: 'bool' | ||
}, | ||
href: { | ||
type: 'string' | ||
}, | ||
className: { | ||
type: 'string' | ||
}, | ||
onClick: { | ||
type: 'func' | ||
}, | ||
children: { | ||
type: 'any', | ||
required: true | ||
} | ||
var oneOfProps = exports.oneOfProps = { | ||
colour: ['default', 'primary', 'secondary'], | ||
textSize: ['small'] | ||
}; | ||
var componentPropTypes = exports.componentPropTypes = { | ||
colour: _react.PropTypes.oneOf(oneOfProps.colour).isRequired, | ||
raised: _react.PropTypes.bool, | ||
outlined: _react.PropTypes.bool, | ||
unstyled: _react.PropTypes.bool, | ||
disabled: _react.PropTypes.bool, | ||
textSize: _react.PropTypes.oneOf(oneOfProps.textSize), | ||
fullWidth: _react.PropTypes.bool, | ||
href: _react.PropTypes.string, | ||
className: _react.PropTypes.string, | ||
onClick: _react.PropTypes.func, | ||
children: _react.PropTypes.any.isRequired | ||
}; | ||
var defaultProps = exports.defaultProps = { | ||
colour: 'default' | ||
}; | ||
var Button = _react2['default'].createClass({ | ||
displayName: 'Button', | ||
propTypes: (0, _definitions.getPropTypes)(PropTypes), | ||
propTypes: componentPropTypes, | ||
getDefaultProps: function getDefaultProps() { | ||
return (0, _definitions.getDefaultProps)(PropTypes); | ||
return defaultProps; | ||
}, | ||
@@ -522,3 +412,3 @@ handleClick: function handleClick(e) { | ||
/***/ }, | ||
/* 24 */ | ||
/* 23 */ | ||
/***/ function(module, exports) { | ||
@@ -529,4 +419,4 @@ | ||
/***/ }, | ||
/* 25 */, | ||
/* 26 */ | ||
/* 24 */, | ||
/* 25 */ | ||
/***/ function(module, exports) { | ||
@@ -533,0 +423,0 @@ |
@@ -58,3 +58,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
module.exports = __webpack_require__(23); | ||
module.exports = __webpack_require__(22); | ||
@@ -126,3 +126,3 @@ | ||
/***/ 6: | ||
/***/ 22: | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -133,82 +133,4 @@ | ||
exports.__esModule = true; | ||
exports.translationsToDefinitions = exports.getPropTypes = exports.getDefaultProps = exports.getInitialState = undefined; | ||
exports.defaultProps = exports.componentPropTypes = exports.oneOfProps = undefined; | ||
var _react = __webpack_require__(2); | ||
var getInitialState = exports.getInitialState = function getInitialState(definitionObj) { | ||
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var defaults = {}; | ||
definitionObj.propTypes.forEach(function (_ref) { | ||
var propName = _ref.propName, | ||
defaultValue = _ref.defaultValue; | ||
if (Object.hasOwnProperty.call(props, propName)) { | ||
defaults[propName] = props[propName]; | ||
} else { | ||
defaults[propName] = defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; // const PropTypes = require('react').PropTypes; | ||
var getDefaultProps = exports.getDefaultProps = function getDefaultProps(propsObject) { | ||
var defaults = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
if (typeof prop.defaultValue !== 'undefined') { | ||
defaults[propName] = prop.defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; | ||
var getPropTypes = exports.getPropTypes = function getPropTypes() { | ||
var propsObject = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var propTypes = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
var propType = void 0; | ||
if (prop.allowedValues) { | ||
propType = _react.PropTypes[prop.type](prop.allowedValues); | ||
} else { | ||
propType = _react.PropTypes[prop.type]; | ||
} | ||
if (prop.required) { | ||
propType = propType.isRequired; | ||
} | ||
propTypes[propName] = propType; | ||
}); | ||
return propTypes; | ||
}; | ||
var translationsToDefinitions = exports.translationsToDefinitions = function translationsToDefinitions(translations) { | ||
var translationProps = {}; | ||
Object.keys(translations).forEach(function (translationKey) { | ||
translationProps[translationKey] = { | ||
type: 'string', | ||
required: true, | ||
defaultValue: translations[translationKey] | ||
}; | ||
}); | ||
return translationProps; | ||
}; | ||
/***/ }, | ||
/***/ 23: | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
exports.__esModule = true; | ||
exports.PropTypes = undefined; | ||
var _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; }; | ||
@@ -224,4 +146,2 @@ | ||
var _definitions = __webpack_require__(6); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
@@ -231,52 +151,33 @@ | ||
__webpack_require__(24); | ||
__webpack_require__(23); | ||
var PropTypes = exports.PropTypes = { | ||
colour: { | ||
type: 'oneOf', | ||
allowedValues: ['default', 'primary', 'secondary'], | ||
defaultValue: 'default', | ||
required: true | ||
}, | ||
raised: { | ||
type: 'bool' | ||
}, | ||
outlined: { | ||
type: 'bool' | ||
}, | ||
unstyled: { | ||
type: 'bool' | ||
}, | ||
disabled: { | ||
type: 'bool' | ||
}, | ||
textSize: { | ||
type: 'oneOf', | ||
allowedValues: ['small'], | ||
canBeNull: true | ||
}, | ||
fullWidth: { | ||
type: 'bool' | ||
}, | ||
href: { | ||
type: 'string' | ||
}, | ||
className: { | ||
type: 'string' | ||
}, | ||
onClick: { | ||
type: 'func' | ||
}, | ||
children: { | ||
type: 'any', | ||
required: true | ||
} | ||
var oneOfProps = exports.oneOfProps = { | ||
colour: ['default', 'primary', 'secondary'], | ||
textSize: ['small'] | ||
}; | ||
var componentPropTypes = exports.componentPropTypes = { | ||
colour: _react.PropTypes.oneOf(oneOfProps.colour).isRequired, | ||
raised: _react.PropTypes.bool, | ||
outlined: _react.PropTypes.bool, | ||
unstyled: _react.PropTypes.bool, | ||
disabled: _react.PropTypes.bool, | ||
textSize: _react.PropTypes.oneOf(oneOfProps.textSize), | ||
fullWidth: _react.PropTypes.bool, | ||
href: _react.PropTypes.string, | ||
className: _react.PropTypes.string, | ||
onClick: _react.PropTypes.func, | ||
children: _react.PropTypes.any.isRequired | ||
}; | ||
var defaultProps = exports.defaultProps = { | ||
colour: 'default' | ||
}; | ||
var Button = _react2['default'].createClass({ | ||
displayName: 'Button', | ||
propTypes: (0, _definitions.getPropTypes)(PropTypes), | ||
propTypes: componentPropTypes, | ||
getDefaultProps: function getDefaultProps() { | ||
return (0, _definitions.getDefaultProps)(PropTypes); | ||
return defaultProps; | ||
}, | ||
@@ -317,3 +218,3 @@ handleClick: function handleClick(e) { | ||
/***/ 24: | ||
/***/ 23: | ||
/***/ function(module, exports) { | ||
@@ -320,0 +221,0 @@ |
@@ -58,3 +58,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
module.exports = __webpack_require__(178); | ||
module.exports = __webpack_require__(177); | ||
@@ -71,3 +71,3 @@ | ||
/***/ 178: | ||
/***/ 177: | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -87,3 +87,4 @@ | ||
__webpack_require__(179); | ||
__webpack_require__(178); | ||
var Checkbox = _react2['default'].createClass({ | ||
@@ -125,3 +126,3 @@ displayName: 'Checkbox', | ||
/***/ 179: | ||
/***/ 178: | ||
/***/ function(module, exports) { | ||
@@ -128,0 +129,0 @@ |
@@ -58,3 +58,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
module.exports = __webpack_require__(181); | ||
module.exports = __webpack_require__(180); | ||
@@ -71,3 +71,3 @@ | ||
/***/ 6: | ||
/***/ 180: | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -78,82 +78,4 @@ | ||
exports.__esModule = true; | ||
exports.translationsToDefinitions = exports.getPropTypes = exports.getDefaultProps = exports.getInitialState = undefined; | ||
exports.componentPropTypes = undefined; | ||
var _react = __webpack_require__(2); | ||
var getInitialState = exports.getInitialState = function getInitialState(definitionObj) { | ||
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var defaults = {}; | ||
definitionObj.propTypes.forEach(function (_ref) { | ||
var propName = _ref.propName, | ||
defaultValue = _ref.defaultValue; | ||
if (Object.hasOwnProperty.call(props, propName)) { | ||
defaults[propName] = props[propName]; | ||
} else { | ||
defaults[propName] = defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; // const PropTypes = require('react').PropTypes; | ||
var getDefaultProps = exports.getDefaultProps = function getDefaultProps(propsObject) { | ||
var defaults = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
if (typeof prop.defaultValue !== 'undefined') { | ||
defaults[propName] = prop.defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; | ||
var getPropTypes = exports.getPropTypes = function getPropTypes() { | ||
var propsObject = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var propTypes = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
var propType = void 0; | ||
if (prop.allowedValues) { | ||
propType = _react.PropTypes[prop.type](prop.allowedValues); | ||
} else { | ||
propType = _react.PropTypes[prop.type]; | ||
} | ||
if (prop.required) { | ||
propType = propType.isRequired; | ||
} | ||
propTypes[propName] = propType; | ||
}); | ||
return propTypes; | ||
}; | ||
var translationsToDefinitions = exports.translationsToDefinitions = function translationsToDefinitions(translations) { | ||
var translationProps = {}; | ||
Object.keys(translations).forEach(function (translationKey) { | ||
translationProps[translationKey] = { | ||
type: 'string', | ||
required: true, | ||
defaultValue: translations[translationKey] | ||
}; | ||
}); | ||
return translationProps; | ||
}; | ||
/***/ }, | ||
/***/ 181: | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
exports.__esModule = true; | ||
exports.PropTypes = undefined; | ||
var _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; }; | ||
@@ -165,40 +87,18 @@ | ||
var _makeQueryParams = __webpack_require__(182); | ||
var _makeQueryParams = __webpack_require__(181); | ||
var _makeQueryParams2 = _interopRequireDefault(_makeQueryParams); | ||
var _definitions = __webpack_require__(6); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var PropTypes = exports.PropTypes = { | ||
src: { | ||
type: 'string', | ||
required: true | ||
}, | ||
width: { | ||
type: 'number', | ||
required: true | ||
}, | ||
height: { | ||
type: 'number' | ||
}, | ||
sizes: { | ||
type: 'string' | ||
}, | ||
retina: { | ||
type: 'bool' | ||
}, | ||
className: { | ||
type: 'string' | ||
}, | ||
alt: { | ||
type: 'string' | ||
}, | ||
fit: { | ||
type: 'string' | ||
}, | ||
quality: { | ||
type: 'number' | ||
} | ||
var componentPropTypes = exports.componentPropTypes = { | ||
src: _react.PropTypes.string.isRequired, | ||
width: _react.PropTypes.number.isRequired, | ||
height: _react.PropTypes.number, | ||
sizes: _react.PropTypes.string, | ||
retina: _react.PropTypes.bool, | ||
className: _react.PropTypes.string, | ||
alt: _react.PropTypes.string, | ||
fit: _react.PropTypes.string, | ||
quality: _react.PropTypes.number | ||
}; | ||
@@ -209,3 +109,3 @@ | ||
propTypes: (0, _definitions.getPropTypes)(PropTypes), | ||
propTypes: componentPropTypes, | ||
getSrcset: function getSrcset() { | ||
@@ -294,3 +194,3 @@ var srcset = []; | ||
/***/ 182: | ||
/***/ 181: | ||
/***/ function(module, exports) { | ||
@@ -297,0 +197,0 @@ |
@@ -58,3 +58,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
module.exports = __webpack_require__(183); | ||
module.exports = __webpack_require__(182); | ||
@@ -126,3 +126,3 @@ | ||
/***/ 6: | ||
/***/ 14: | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -133,83 +133,5 @@ | ||
exports.__esModule = true; | ||
exports.translationsToDefinitions = exports.getPropTypes = exports.getDefaultProps = exports.getInitialState = undefined; | ||
var _react = __webpack_require__(2); | ||
var _Icon = __webpack_require__(15); | ||
var getInitialState = exports.getInitialState = function getInitialState(definitionObj) { | ||
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var defaults = {}; | ||
definitionObj.propTypes.forEach(function (_ref) { | ||
var propName = _ref.propName, | ||
defaultValue = _ref.defaultValue; | ||
if (Object.hasOwnProperty.call(props, propName)) { | ||
defaults[propName] = props[propName]; | ||
} else { | ||
defaults[propName] = defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; // const PropTypes = require('react').PropTypes; | ||
var getDefaultProps = exports.getDefaultProps = function getDefaultProps(propsObject) { | ||
var defaults = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
if (typeof prop.defaultValue !== 'undefined') { | ||
defaults[propName] = prop.defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; | ||
var getPropTypes = exports.getPropTypes = function getPropTypes() { | ||
var propsObject = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var propTypes = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
var propType = void 0; | ||
if (prop.allowedValues) { | ||
propType = _react.PropTypes[prop.type](prop.allowedValues); | ||
} else { | ||
propType = _react.PropTypes[prop.type]; | ||
} | ||
if (prop.required) { | ||
propType = propType.isRequired; | ||
} | ||
propTypes[propName] = propType; | ||
}); | ||
return propTypes; | ||
}; | ||
var translationsToDefinitions = exports.translationsToDefinitions = function translationsToDefinitions(translations) { | ||
var translationProps = {}; | ||
Object.keys(translations).forEach(function (translationKey) { | ||
translationProps[translationKey] = { | ||
type: 'string', | ||
required: true, | ||
defaultValue: translations[translationKey] | ||
}; | ||
}); | ||
return translationProps; | ||
}; | ||
/***/ }, | ||
/***/ 15: | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
exports.__esModule = true; | ||
var _Icon = __webpack_require__(16); | ||
Object.defineProperty(exports, 'default', { | ||
@@ -226,3 +148,3 @@ enumerable: true, | ||
/***/ 16: | ||
/***/ 15: | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -233,3 +155,3 @@ | ||
exports.__esModule = true; | ||
exports.Icon = exports.PropTypes = undefined; | ||
exports.Icon = exports.componentPropTypes = undefined; | ||
@@ -244,14 +166,8 @@ var _react = __webpack_require__(2); | ||
var _definitions = __webpack_require__(6); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
__webpack_require__(17); | ||
__webpack_require__(16); | ||
var PropTypes = exports.PropTypes = { | ||
icon: { | ||
type: 'string', | ||
required: true, | ||
desription: 'The icon to show, based off of the ss-pika naming conventions' | ||
} | ||
var componentPropTypes = exports.componentPropTypes = { | ||
icon: _react.PropTypes.string.isRequired | ||
}; | ||
@@ -265,3 +181,3 @@ | ||
Icon.propTypes = (0, _definitions.getPropTypes)(PropTypes); | ||
Icon.propTypes = componentPropTypes; | ||
@@ -272,3 +188,3 @@ exports['default'] = Icon; | ||
/***/ 17: | ||
/***/ 16: | ||
/***/ function(module, exports) { | ||
@@ -280,3 +196,3 @@ | ||
/***/ 183: | ||
/***/ 182: | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -287,3 +203,3 @@ | ||
exports.__esModule = true; | ||
exports.PropTypes = undefined; | ||
exports.componentPropTypes = undefined; | ||
@@ -300,15 +216,12 @@ var _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; }; | ||
var _Icon = __webpack_require__(15); | ||
var _Icon = __webpack_require__(14); | ||
var _Icon2 = _interopRequireDefault(_Icon); | ||
var _definitions = __webpack_require__(6); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
__webpack_require__(184); | ||
var PropTypes = exports.PropTypes = { | ||
ticked: { | ||
type: 'bool' | ||
} | ||
__webpack_require__(183); | ||
var componentPropTypes = exports.componentPropTypes = { | ||
ticked: _react.PropTypes.bool | ||
}; | ||
@@ -331,3 +244,3 @@ | ||
CompleteTick.propTypes = (0, _definitions.getPropTypes)(PropTypes); | ||
CompleteTick.propTypes = componentPropTypes; | ||
@@ -338,3 +251,3 @@ exports['default'] = CompleteTick; | ||
/***/ 184: | ||
/***/ 183: | ||
/***/ function(module, exports) { | ||
@@ -341,0 +254,0 @@ |
@@ -53,12 +53,13 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
/************************************************************************/ | ||
/******/ ([ | ||
/* 0 */ | ||
/******/ ({ | ||
/***/ 0: | ||
/***/ function(module, exports, __webpack_require__) { | ||
module.exports = __webpack_require__(6); | ||
module.exports = __webpack_require__(219); | ||
/***/ }, | ||
/* 1 */, | ||
/* 2 */ | ||
/***/ 2: | ||
/***/ function(module, exports) { | ||
@@ -69,6 +70,4 @@ | ||
/***/ }, | ||
/* 3 */, | ||
/* 4 */, | ||
/* 5 */, | ||
/* 6 */ | ||
/***/ 219: | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -150,4 +149,5 @@ | ||
/***/ } | ||
/******/ ]) | ||
/******/ }) | ||
}); | ||
; |
@@ -58,3 +58,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
module.exports = __webpack_require__(186); | ||
module.exports = __webpack_require__(185); | ||
@@ -126,3 +126,3 @@ | ||
/***/ 6: | ||
/***/ 185: | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -133,88 +133,8 @@ | ||
exports.__esModule = true; | ||
exports.translationsToDefinitions = exports.getPropTypes = exports.getDefaultProps = exports.getInitialState = undefined; | ||
exports.componentPropTypes = exports.oneOfProps = undefined; | ||
var _react = __webpack_require__(2); | ||
var getInitialState = exports.getInitialState = function getInitialState(definitionObj) { | ||
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var defaults = {}; | ||
definitionObj.propTypes.forEach(function (_ref) { | ||
var propName = _ref.propName, | ||
defaultValue = _ref.defaultValue; | ||
if (Object.hasOwnProperty.call(props, propName)) { | ||
defaults[propName] = props[propName]; | ||
} else { | ||
defaults[propName] = defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; // const PropTypes = require('react').PropTypes; | ||
var getDefaultProps = exports.getDefaultProps = function getDefaultProps(propsObject) { | ||
var defaults = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
if (typeof prop.defaultValue !== 'undefined') { | ||
defaults[propName] = prop.defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; | ||
var getPropTypes = exports.getPropTypes = function getPropTypes() { | ||
var propsObject = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var propTypes = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
var propType = void 0; | ||
if (prop.allowedValues) { | ||
propType = _react.PropTypes[prop.type](prop.allowedValues); | ||
} else { | ||
propType = _react.PropTypes[prop.type]; | ||
} | ||
if (prop.required) { | ||
propType = propType.isRequired; | ||
} | ||
propTypes[propName] = propType; | ||
}); | ||
return propTypes; | ||
}; | ||
var translationsToDefinitions = exports.translationsToDefinitions = function translationsToDefinitions(translations) { | ||
var translationProps = {}; | ||
Object.keys(translations).forEach(function (translationKey) { | ||
translationProps[translationKey] = { | ||
type: 'string', | ||
required: true, | ||
defaultValue: translations[translationKey] | ||
}; | ||
}); | ||
return translationProps; | ||
}; | ||
/***/ }, | ||
/***/ 186: | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
exports.__esModule = true; | ||
exports.PropTypes = undefined; | ||
var _react = __webpack_require__(2); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _definitions = __webpack_require__(6); | ||
var _classnames = __webpack_require__(5); | ||
@@ -228,27 +148,20 @@ | ||
__webpack_require__(187); | ||
__webpack_require__(186); | ||
var PropTypes = exports.PropTypes = { | ||
colour: { | ||
type: 'oneOf', | ||
allowedValues: ['white', 'green', 'stone'] | ||
}, | ||
top: { | ||
type: 'bool' | ||
}, | ||
right: { | ||
type: 'bool' | ||
}, | ||
bottom: { | ||
type: 'bool' | ||
}, | ||
left: { | ||
type: 'bool' | ||
} | ||
var oneOfProps = exports.oneOfProps = { | ||
colour: ['white', 'green', 'stone'] | ||
}; | ||
var componentPropTypes = exports.componentPropTypes = { | ||
colour: _react.PropTypes.oneOf(oneOfProps.colour), | ||
top: _react.PropTypes.bool, | ||
right: _react.PropTypes.bool, | ||
bottom: _react.PropTypes.bool, | ||
left: _react.PropTypes.bool | ||
}; | ||
var Divider = _react2['default'].createClass({ | ||
displayName: 'Divider', | ||
PropTypes: (0, _definitions.getPropTypes)(PropTypes), | ||
PropTypes: componentPropTypes, | ||
@@ -270,3 +183,3 @@ render: function render() { | ||
/***/ 187: | ||
/***/ 186: | ||
/***/ function(module, exports) { | ||
@@ -273,0 +186,0 @@ |
@@ -58,3 +58,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
module.exports = __webpack_require__(189); | ||
module.exports = __webpack_require__(188); | ||
@@ -71,3 +71,3 @@ | ||
/***/ 6: | ||
/***/ 188: | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -78,103 +78,21 @@ | ||
exports.__esModule = true; | ||
exports.translationsToDefinitions = exports.getPropTypes = exports.getDefaultProps = exports.getInitialState = undefined; | ||
exports.defaultProps = exports.componentPropTypes = undefined; | ||
var _react = __webpack_require__(2); | ||
var getInitialState = exports.getInitialState = function getInitialState(definitionObj) { | ||
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var _react2 = _interopRequireDefault(_react); | ||
var defaults = {}; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
definitionObj.propTypes.forEach(function (_ref) { | ||
var propName = _ref.propName, | ||
defaultValue = _ref.defaultValue; | ||
__webpack_require__(189); | ||
if (Object.hasOwnProperty.call(props, propName)) { | ||
defaults[propName] = props[propName]; | ||
} else { | ||
defaults[propName] = defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; // const PropTypes = require('react').PropTypes; | ||
var getDefaultProps = exports.getDefaultProps = function getDefaultProps(propsObject) { | ||
var defaults = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
if (typeof prop.defaultValue !== 'undefined') { | ||
defaults[propName] = prop.defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
var componentPropTypes = exports.componentPropTypes = { | ||
number: _react.PropTypes.number.isRequired, | ||
duration: _react.PropTypes.number.isRequired | ||
}; | ||
var getPropTypes = exports.getPropTypes = function getPropTypes() { | ||
var propsObject = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var propTypes = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
var propType = void 0; | ||
if (prop.allowedValues) { | ||
propType = _react.PropTypes[prop.type](prop.allowedValues); | ||
} else { | ||
propType = _react.PropTypes[prop.type]; | ||
} | ||
if (prop.required) { | ||
propType = propType.isRequired; | ||
} | ||
propTypes[propName] = propType; | ||
}); | ||
return propTypes; | ||
var defaultProps = exports.defaultProps = { | ||
duration: 1000 | ||
}; | ||
var translationsToDefinitions = exports.translationsToDefinitions = function translationsToDefinitions(translations) { | ||
var translationProps = {}; | ||
Object.keys(translations).forEach(function (translationKey) { | ||
translationProps[translationKey] = { | ||
type: 'string', | ||
required: true, | ||
defaultValue: translations[translationKey] | ||
}; | ||
}); | ||
return translationProps; | ||
}; | ||
/***/ }, | ||
/***/ 189: | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
exports.__esModule = true; | ||
exports.PropTypes = undefined; | ||
var _react = __webpack_require__(2); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _definitions = __webpack_require__(6); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
__webpack_require__(190); | ||
var PropTypes = exports.PropTypes = { | ||
number: { | ||
type: 'number', | ||
required: true | ||
}, | ||
duration: { | ||
type: 'number', | ||
defaultValue: 1000 | ||
} | ||
}; | ||
var classes = { | ||
@@ -190,6 +108,4 @@ changed: 'js-flipper--changed', | ||
propTypes: (0, _definitions.getPropTypes)(PropTypes), | ||
getDefaultProps: function getDefaultProps() { | ||
return (0, _definitions.getDefaultProps)(PropTypes); | ||
}, | ||
propTypes: componentPropTypes, | ||
defaultProps: defaultProps, | ||
getInitialState: function getInitialState() { | ||
@@ -309,3 +225,3 @@ return { | ||
/***/ 190: | ||
/***/ 189: | ||
/***/ function(module, exports) { | ||
@@ -312,0 +228,0 @@ |
158
lib/Grid.js
@@ -75,3 +75,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
exports.__esModule = true; | ||
exports.Row = exports.RowPropTypes = exports.Col = exports.ColPropTypes = undefined; | ||
exports.Row = exports.componentPropTypes = exports.oneOfProps = exports.Col = undefined; | ||
@@ -88,4 +88,2 @@ var _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; }; | ||
var _definitions = __webpack_require__(6); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
@@ -95,27 +93,20 @@ | ||
__webpack_require__(7); | ||
__webpack_require__(6); | ||
var ColPropTypes = exports.ColPropTypes = { | ||
numOfCols: { | ||
type: 'number', | ||
required: true, | ||
defaultValue: 1, | ||
description: 'The number of sibling columns so we can determine the column class programmatically.' | ||
}, | ||
className: { | ||
type: 'string', | ||
description: 'Any other CSS classes to go on this component.' | ||
}, | ||
children: { | ||
type: 'any', | ||
description: 'The contents of the column. If the value returns falsy, the column does not get rendered or affect any other column width calculation.' | ||
} | ||
var colPropTypes = { | ||
numOfCols: _react.PropTypes.number.isRequired, | ||
className: _react.PropTypes.string, | ||
children: _react.PropTypes.any | ||
}; | ||
var colDefaultProps = { | ||
numOfCols: 1 | ||
}; | ||
var Col = exports.Col = _react2['default'].createClass({ | ||
displayName: 'Col', | ||
propTypes: (0, _definitions.getPropTypes)(ColPropTypes), | ||
propTypes: colPropTypes, | ||
getDefaultProps: function getDefaultProps() { | ||
return (0, _definitions.getDefaultProps)(ColPropTypes); | ||
return colDefaultProps; | ||
}, | ||
@@ -146,33 +137,18 @@ | ||
var RowPropTypes = exports.RowPropTypes = { | ||
className: { | ||
type: 'string' | ||
}, | ||
rowsSpacedOn: { | ||
type: 'oneOf', | ||
allowedValues: mqs, | ||
canBeNull: true | ||
}, | ||
colsSpacedOn: { | ||
type: 'oneOf', | ||
allowedValues: mqs, | ||
defaultValue: 'base', | ||
canBeNull: true | ||
}, | ||
colsReversedOn: { | ||
type: 'oneOf', | ||
allowedValues: mqs, | ||
canBeNull: true | ||
}, | ||
colsToRowsOn: { | ||
type: 'oneOf', | ||
allowedValues: mqs, | ||
canBeNull: true | ||
}, | ||
children: { | ||
type: 'any', | ||
description: 'A `<Col>` element is the only acceptable component here.' | ||
} | ||
var oneOfProps = exports.oneOfProps = { | ||
rowsSpacedOn: mqs, | ||
colsSpacedOn: mqs, | ||
colsReversedOn: mqs, | ||
colsToRowsOn: mqs | ||
}; | ||
var componentPropTypes = exports.componentPropTypes = { | ||
className: _react.PropTypes.string, | ||
rowsSpacedOn: _react.PropTypes.oneOf(oneOfProps.rowsSpacedOn), | ||
colsSpacedOn: _react.PropTypes.oneOf(oneOfProps.colsSpacedOn), | ||
colsReversedOn: _react.PropTypes.oneOf(oneOfProps.colsReversedOn), | ||
colsToRowsOn: _react.PropTypes.oneOf(oneOfProps.colsToRowsOn), | ||
children: _react.PropTypes.any | ||
}; | ||
var getSuffix = function getSuffix(value) { | ||
@@ -188,6 +164,3 @@ if (value === 'base') { | ||
propTypes: (0, _definitions.getPropTypes)(RowPropTypes), | ||
getDefaultProps: function getDefaultProps() { | ||
return (0, _definitions.getDefaultProps)(RowPropTypes); | ||
}, | ||
propTypes: componentPropTypes, | ||
getEmptyChildren: function getEmptyChildren() { | ||
@@ -328,79 +301,2 @@ if (this.props.children) { | ||
/* 6 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
exports.__esModule = true; | ||
exports.translationsToDefinitions = exports.getPropTypes = exports.getDefaultProps = exports.getInitialState = undefined; | ||
var _react = __webpack_require__(2); | ||
var getInitialState = exports.getInitialState = function getInitialState(definitionObj) { | ||
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var defaults = {}; | ||
definitionObj.propTypes.forEach(function (_ref) { | ||
var propName = _ref.propName, | ||
defaultValue = _ref.defaultValue; | ||
if (Object.hasOwnProperty.call(props, propName)) { | ||
defaults[propName] = props[propName]; | ||
} else { | ||
defaults[propName] = defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; // const PropTypes = require('react').PropTypes; | ||
var getDefaultProps = exports.getDefaultProps = function getDefaultProps(propsObject) { | ||
var defaults = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
if (typeof prop.defaultValue !== 'undefined') { | ||
defaults[propName] = prop.defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; | ||
var getPropTypes = exports.getPropTypes = function getPropTypes() { | ||
var propsObject = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var propTypes = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
var propType = void 0; | ||
if (prop.allowedValues) { | ||
propType = _react.PropTypes[prop.type](prop.allowedValues); | ||
} else { | ||
propType = _react.PropTypes[prop.type]; | ||
} | ||
if (prop.required) { | ||
propType = propType.isRequired; | ||
} | ||
propTypes[propName] = propType; | ||
}); | ||
return propTypes; | ||
}; | ||
var translationsToDefinitions = exports.translationsToDefinitions = function translationsToDefinitions(translations) { | ||
var translationProps = {}; | ||
Object.keys(translations).forEach(function (translationKey) { | ||
translationProps[translationKey] = { | ||
type: 'string', | ||
required: true, | ||
defaultValue: translations[translationKey] | ||
}; | ||
}); | ||
return translationProps; | ||
}; | ||
/***/ }, | ||
/* 7 */ | ||
/***/ function(module, exports) { | ||
@@ -407,0 +303,0 @@ |
@@ -58,3 +58,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
module.exports = __webpack_require__(192); | ||
module.exports = __webpack_require__(191); | ||
@@ -71,129 +71,39 @@ | ||
/***/ 6: | ||
/***/ 191: | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
"use strict"; | ||
exports.__esModule = true; | ||
exports.translationsToDefinitions = exports.getPropTypes = exports.getDefaultProps = exports.getInitialState = undefined; | ||
exports.componentPropTypes = undefined; | ||
var _react = __webpack_require__(2); | ||
var getInitialState = exports.getInitialState = function getInitialState(definitionObj) { | ||
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var _react2 = _interopRequireDefault(_react); | ||
var defaults = {}; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
definitionObj.propTypes.forEach(function (_ref) { | ||
var propName = _ref.propName, | ||
defaultValue = _ref.defaultValue; | ||
if (Object.hasOwnProperty.call(props, propName)) { | ||
defaults[propName] = props[propName]; | ||
} else { | ||
defaults[propName] = defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; // const PropTypes = require('react').PropTypes; | ||
var getDefaultProps = exports.getDefaultProps = function getDefaultProps(propsObject) { | ||
var defaults = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
if (typeof prop.defaultValue !== 'undefined') { | ||
defaults[propName] = prop.defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
var componentPropTypes = exports.componentPropTypes = { | ||
fields: _react.PropTypes.object.isRequired | ||
}; | ||
var getPropTypes = exports.getPropTypes = function getPropTypes() { | ||
var propsObject = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var propTypes = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
var propType = void 0; | ||
if (prop.allowedValues) { | ||
propType = _react.PropTypes[prop.type](prop.allowedValues); | ||
} else { | ||
propType = _react.PropTypes[prop.type]; | ||
} | ||
if (prop.required) { | ||
propType = propType.isRequired; | ||
} | ||
propTypes[propName] = propType; | ||
}); | ||
return propTypes; | ||
var HiddenFields = function HiddenFields(props) { | ||
return _react2["default"].createElement( | ||
"div", | ||
null, | ||
Object.keys(props.fields).map(function (key) { | ||
return _react2["default"].createElement("input", { | ||
type: "hidden", | ||
name: key, | ||
key: key, | ||
value: props.fields[key] | ||
}); | ||
}) | ||
); | ||
}; | ||
var translationsToDefinitions = exports.translationsToDefinitions = function translationsToDefinitions(translations) { | ||
var translationProps = {}; | ||
Object.keys(translations).forEach(function (translationKey) { | ||
translationProps[translationKey] = { | ||
type: 'string', | ||
required: true, | ||
defaultValue: translations[translationKey] | ||
}; | ||
}); | ||
return translationProps; | ||
}; | ||
HiddenFields.propTypes = componentPropTypes; | ||
/***/ }, | ||
exports["default"] = HiddenFields; | ||
/***/ 192: | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
exports.__esModule = true; | ||
exports.PropTypes = undefined; | ||
var _react = __webpack_require__(2); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _definitions = __webpack_require__(6); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var PropTypes = exports.PropTypes = { | ||
fields: { | ||
type: 'object', | ||
required: true, | ||
description: 'Values to turn into hidden fields.' | ||
} | ||
}; | ||
var HiddenFields = _react2['default'].createClass({ | ||
displayName: 'HiddenFields', | ||
propTypes: (0, _definitions.getPropTypes)(PropTypes), | ||
render: function render() { | ||
var _this = this; | ||
return _react2['default'].createElement( | ||
'div', | ||
null, | ||
Object.keys(this.props.fields).map(function (key) { | ||
return _react2['default'].createElement('input', { | ||
type: 'hidden', | ||
name: key, | ||
key: key, | ||
value: _this.props.fields[key] | ||
}); | ||
}) | ||
); | ||
} | ||
}); | ||
exports['default'] = HiddenFields; | ||
/***/ } | ||
@@ -200,0 +110,0 @@ |
125
lib/Icon.js
@@ -53,12 +53,13 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
/************************************************************************/ | ||
/******/ ([ | ||
/* 0 */ | ||
/******/ ({ | ||
/***/ 0: | ||
/***/ function(module, exports, __webpack_require__) { | ||
module.exports = __webpack_require__(16); | ||
module.exports = __webpack_require__(15); | ||
/***/ }, | ||
/* 1 */, | ||
/* 2 */ | ||
/***/ 2: | ||
/***/ function(module, exports) { | ||
@@ -69,5 +70,4 @@ | ||
/***/ }, | ||
/* 3 */, | ||
/* 4 */, | ||
/* 5 */ | ||
/***/ 5: | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -126,89 +126,4 @@ | ||
/***/ }, | ||
/* 6 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
exports.__esModule = true; | ||
exports.translationsToDefinitions = exports.getPropTypes = exports.getDefaultProps = exports.getInitialState = undefined; | ||
var _react = __webpack_require__(2); | ||
var getInitialState = exports.getInitialState = function getInitialState(definitionObj) { | ||
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var defaults = {}; | ||
definitionObj.propTypes.forEach(function (_ref) { | ||
var propName = _ref.propName, | ||
defaultValue = _ref.defaultValue; | ||
if (Object.hasOwnProperty.call(props, propName)) { | ||
defaults[propName] = props[propName]; | ||
} else { | ||
defaults[propName] = defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; // const PropTypes = require('react').PropTypes; | ||
var getDefaultProps = exports.getDefaultProps = function getDefaultProps(propsObject) { | ||
var defaults = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
if (typeof prop.defaultValue !== 'undefined') { | ||
defaults[propName] = prop.defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; | ||
var getPropTypes = exports.getPropTypes = function getPropTypes() { | ||
var propsObject = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var propTypes = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
var propType = void 0; | ||
if (prop.allowedValues) { | ||
propType = _react.PropTypes[prop.type](prop.allowedValues); | ||
} else { | ||
propType = _react.PropTypes[prop.type]; | ||
} | ||
if (prop.required) { | ||
propType = propType.isRequired; | ||
} | ||
propTypes[propName] = propType; | ||
}); | ||
return propTypes; | ||
}; | ||
var translationsToDefinitions = exports.translationsToDefinitions = function translationsToDefinitions(translations) { | ||
var translationProps = {}; | ||
Object.keys(translations).forEach(function (translationKey) { | ||
translationProps[translationKey] = { | ||
type: 'string', | ||
required: true, | ||
defaultValue: translations[translationKey] | ||
}; | ||
}); | ||
return translationProps; | ||
}; | ||
/***/ }, | ||
/* 7 */, | ||
/* 8 */, | ||
/* 9 */, | ||
/* 10 */, | ||
/* 11 */, | ||
/* 12 */, | ||
/* 13 */, | ||
/* 14 */, | ||
/* 15 */, | ||
/* 16 */ | ||
/***/ 15: | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -219,3 +134,3 @@ | ||
exports.__esModule = true; | ||
exports.Icon = exports.PropTypes = undefined; | ||
exports.Icon = exports.componentPropTypes = undefined; | ||
@@ -230,14 +145,8 @@ var _react = __webpack_require__(2); | ||
var _definitions = __webpack_require__(6); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
__webpack_require__(17); | ||
__webpack_require__(16); | ||
var PropTypes = exports.PropTypes = { | ||
icon: { | ||
type: 'string', | ||
required: true, | ||
desription: 'The icon to show, based off of the ss-pika naming conventions' | ||
} | ||
var componentPropTypes = exports.componentPropTypes = { | ||
icon: _react.PropTypes.string.isRequired | ||
}; | ||
@@ -251,3 +160,3 @@ | ||
Icon.propTypes = (0, _definitions.getPropTypes)(PropTypes); | ||
Icon.propTypes = componentPropTypes; | ||
@@ -257,3 +166,4 @@ exports['default'] = Icon; | ||
/***/ }, | ||
/* 17 */ | ||
/***/ 16: | ||
/***/ function(module, exports) { | ||
@@ -264,4 +174,5 @@ | ||
/***/ } | ||
/******/ ]) | ||
/******/ }) | ||
}); | ||
; |
@@ -58,3 +58,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
module.exports = __webpack_require__(193); | ||
module.exports = __webpack_require__(192); | ||
@@ -71,3 +71,3 @@ | ||
/***/ 6: | ||
/***/ 192: | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -78,82 +78,4 @@ | ||
exports.__esModule = true; | ||
exports.translationsToDefinitions = exports.getPropTypes = exports.getDefaultProps = exports.getInitialState = undefined; | ||
exports.componentPropTypes = undefined; | ||
var _react = __webpack_require__(2); | ||
var getInitialState = exports.getInitialState = function getInitialState(definitionObj) { | ||
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var defaults = {}; | ||
definitionObj.propTypes.forEach(function (_ref) { | ||
var propName = _ref.propName, | ||
defaultValue = _ref.defaultValue; | ||
if (Object.hasOwnProperty.call(props, propName)) { | ||
defaults[propName] = props[propName]; | ||
} else { | ||
defaults[propName] = defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; // const PropTypes = require('react').PropTypes; | ||
var getDefaultProps = exports.getDefaultProps = function getDefaultProps(propsObject) { | ||
var defaults = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
if (typeof prop.defaultValue !== 'undefined') { | ||
defaults[propName] = prop.defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; | ||
var getPropTypes = exports.getPropTypes = function getPropTypes() { | ||
var propsObject = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var propTypes = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
var propType = void 0; | ||
if (prop.allowedValues) { | ||
propType = _react.PropTypes[prop.type](prop.allowedValues); | ||
} else { | ||
propType = _react.PropTypes[prop.type]; | ||
} | ||
if (prop.required) { | ||
propType = propType.isRequired; | ||
} | ||
propTypes[propName] = propType; | ||
}); | ||
return propTypes; | ||
}; | ||
var translationsToDefinitions = exports.translationsToDefinitions = function translationsToDefinitions(translations) { | ||
var translationProps = {}; | ||
Object.keys(translations).forEach(function (translationKey) { | ||
translationProps[translationKey] = { | ||
type: 'string', | ||
required: true, | ||
defaultValue: translations[translationKey] | ||
}; | ||
}); | ||
return translationProps; | ||
}; | ||
/***/ }, | ||
/***/ 193: | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
exports.__esModule = true; | ||
exports.PropTypes = undefined; | ||
var _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; }; | ||
@@ -165,18 +87,8 @@ | ||
var _definitions = __webpack_require__(6); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var PropTypes = exports.PropTypes = { | ||
src: { | ||
type: 'string', | ||
required: true | ||
}, | ||
width: { | ||
type: 'number', | ||
required: true | ||
}, | ||
alt: { | ||
type: 'string' | ||
} | ||
var componentPropTypes = exports.componentPropTypes = { | ||
src: _react.PropTypes.string.isRequired, | ||
width: _react.PropTypes.number.isRequired, | ||
alt: _react.PropTypes.string.isRequired | ||
}; | ||
@@ -207,3 +119,3 @@ | ||
ImageSrcset.propTypes = (0, _definitions.getPropTypes)(PropTypes); | ||
ImageSrcset.propTypes = componentPropTypes; | ||
@@ -210,0 +122,0 @@ exports['default'] = ImageSrcset; |
@@ -58,3 +58,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
module.exports = __webpack_require__(194); | ||
module.exports = __webpack_require__(193); | ||
@@ -126,3 +126,3 @@ | ||
/***/ 6: | ||
/***/ 193: | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -133,84 +133,6 @@ | ||
exports.__esModule = true; | ||
exports.translationsToDefinitions = exports.getPropTypes = exports.getDefaultProps = exports.getInitialState = undefined; | ||
exports.componentPropTypes = exports.oneOfProps = undefined; | ||
var _react = __webpack_require__(2); | ||
var getInitialState = exports.getInitialState = function getInitialState(definitionObj) { | ||
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var defaults = {}; | ||
definitionObj.propTypes.forEach(function (_ref) { | ||
var propName = _ref.propName, | ||
defaultValue = _ref.defaultValue; | ||
if (Object.hasOwnProperty.call(props, propName)) { | ||
defaults[propName] = props[propName]; | ||
} else { | ||
defaults[propName] = defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; // const PropTypes = require('react').PropTypes; | ||
var getDefaultProps = exports.getDefaultProps = function getDefaultProps(propsObject) { | ||
var defaults = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
if (typeof prop.defaultValue !== 'undefined') { | ||
defaults[propName] = prop.defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; | ||
var getPropTypes = exports.getPropTypes = function getPropTypes() { | ||
var propsObject = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var propTypes = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
var propType = void 0; | ||
if (prop.allowedValues) { | ||
propType = _react.PropTypes[prop.type](prop.allowedValues); | ||
} else { | ||
propType = _react.PropTypes[prop.type]; | ||
} | ||
if (prop.required) { | ||
propType = propType.isRequired; | ||
} | ||
propTypes[propName] = propType; | ||
}); | ||
return propTypes; | ||
}; | ||
var translationsToDefinitions = exports.translationsToDefinitions = function translationsToDefinitions(translations) { | ||
var translationProps = {}; | ||
Object.keys(translations).forEach(function (translationKey) { | ||
translationProps[translationKey] = { | ||
type: 'string', | ||
required: true, | ||
defaultValue: translations[translationKey] | ||
}; | ||
}); | ||
return translationProps; | ||
}; | ||
/***/ }, | ||
/***/ 194: | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
exports.__esModule = true; | ||
exports.PropTypes = undefined; | ||
var _react = __webpack_require__(2); | ||
var _react2 = _interopRequireDefault(_react); | ||
@@ -222,50 +144,39 @@ | ||
var _InlineLabel = __webpack_require__(195); | ||
var _InlineLabel = __webpack_require__(194); | ||
var _InlineLabel2 = _interopRequireDefault(_InlineLabel); | ||
var _TextField = __webpack_require__(199); | ||
var _TextField = __webpack_require__(198); | ||
var _TextField2 = _interopRequireDefault(_TextField); | ||
var _TextArea = __webpack_require__(203); | ||
var _TextArea = __webpack_require__(202); | ||
var _TextArea2 = _interopRequireDefault(_TextArea); | ||
var _Select = __webpack_require__(207); | ||
var _Select = __webpack_require__(206); | ||
var _Select2 = _interopRequireDefault(_Select); | ||
var _definitions = __webpack_require__(6); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
__webpack_require__(211); | ||
__webpack_require__(210); | ||
var PropTypes = exports.PropTypes = { | ||
id: { | ||
type: 'string', | ||
required: true | ||
}, | ||
fieldType: { | ||
type: 'oneOf', | ||
allowedValues: ['input', 'textarea', 'select'], | ||
required: true | ||
}, | ||
label: { | ||
type: 'any', | ||
required: true | ||
}, | ||
className: { | ||
type: 'string' | ||
} | ||
var oneOfProps = exports.oneOfProps = { | ||
fieldType: ['input', 'textarea', 'select'] | ||
}; | ||
var componentPropTypes = exports.componentPropTypes = { | ||
id: _react.PropTypes.string.isRequired, | ||
fieldType: _react.PropTypes.oneOf(oneOfProps.fieldType).isRequired, | ||
label: _react.PropTypes.any.isRequired, | ||
value: _react.PropTypes.string.isRequired, | ||
onChange: _react.PropTypes.func, | ||
className: _react.PropTypes.string | ||
}; | ||
var InlineFormField = _react2['default'].createClass({ | ||
displayName: 'InlineFormField', | ||
propTypes: (0, _definitions.getPropTypes)(PropTypes), | ||
getDefaultProps: function getDefaultProps() { | ||
return (0, _definitions.getDefaultProps)(PropTypes); | ||
}, | ||
propTypes: componentPropTypes, | ||
getContents: function getContents() { | ||
@@ -300,3 +211,3 @@ if (this.props.fieldType === 'input') { | ||
/***/ 195: | ||
/***/ 194: | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -308,3 +219,3 @@ | ||
var _InlineLabel = __webpack_require__(196); | ||
var _InlineLabel = __webpack_require__(195); | ||
@@ -322,3 +233,3 @@ Object.defineProperty(exports, 'default', { | ||
/***/ 196: | ||
/***/ 195: | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -329,3 +240,3 @@ | ||
exports.__esModule = true; | ||
exports.PropTypes = undefined; | ||
exports.componentPropTypes = undefined; | ||
@@ -338,35 +249,24 @@ var _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; }; | ||
var _definitions = __webpack_require__(6); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
__webpack_require__(197); | ||
var PropTypes = exports.PropTypes = { | ||
htmlFor: { | ||
type: 'string', | ||
required: true | ||
}, | ||
children: { | ||
type: 'any', | ||
required: true | ||
} | ||
__webpack_require__(196); | ||
var componentPropTypes = exports.componentPropTypes = { | ||
htmlFor: _react.PropTypes.string.isRequired, | ||
children: _react.PropTypes.any.isRequired | ||
}; | ||
var InlineLabel = _react2['default'].createClass({ | ||
displayName: 'InlineLabel', | ||
var InlineLabel = function InlineLabel(props) { | ||
return _react2['default'].createElement( | ||
'label', | ||
_extends({ | ||
className: 'inline-label__tag', | ||
htmlFor: props.htmlFor | ||
}, props), | ||
props.children | ||
); | ||
}; | ||
propTypes: (0, _definitions.getPropTypes)(PropTypes), | ||
InlineLabel.propTypes = componentPropTypes; | ||
render: function render() { | ||
return _react2['default'].createElement( | ||
'label', | ||
_extends({ | ||
className: 'inline-label__tag', | ||
htmlFor: this.props.htmlFor | ||
}, this.props), | ||
this.props.children | ||
); | ||
} | ||
}); | ||
exports['default'] = InlineLabel; | ||
@@ -376,3 +276,3 @@ | ||
/***/ 197: | ||
/***/ 196: | ||
/***/ function(module, exports) { | ||
@@ -384,3 +284,3 @@ | ||
/***/ 199: | ||
/***/ 198: | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -392,3 +292,3 @@ | ||
var _TextField = __webpack_require__(200); | ||
var _TextField = __webpack_require__(199); | ||
@@ -406,3 +306,3 @@ Object.defineProperty(exports, 'default', { | ||
/***/ 200: | ||
/***/ 199: | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -413,3 +313,3 @@ | ||
exports.__esModule = true; | ||
exports.PropTypes = undefined; | ||
exports.defaultProps = exports.componentPropTypes = undefined; | ||
@@ -426,51 +326,30 @@ var _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; }; | ||
var _definitions = __webpack_require__(6); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
__webpack_require__(201); | ||
__webpack_require__(200); | ||
var PropTypes = exports.PropTypes = { | ||
id: { | ||
type: 'string', | ||
required: true | ||
}, | ||
value: { | ||
type: 'string' | ||
}, | ||
type: { | ||
type: 'string', | ||
defaultValue: 'text' | ||
}, | ||
required: { | ||
type: 'bool', | ||
defaultValue: false | ||
}, | ||
touched: { | ||
type: 'bool' | ||
}, | ||
error: { | ||
type: 'string' | ||
}, | ||
onChange: { | ||
type: 'func' | ||
} | ||
var componentPropTypes = exports.componentPropTypes = { | ||
id: _react.PropTypes.string.isRequired, | ||
value: _react.PropTypes.string, | ||
type: _react.PropTypes.string.isRequired, | ||
required: _react.PropTypes.bool, | ||
touched: _react.PropTypes.bool, | ||
error: _react.PropTypes.string, | ||
onChange: _react.PropTypes.func | ||
}; | ||
var TextField = _react2['default'].createClass({ | ||
displayName: 'TextField', | ||
var defaultProps = exports.defaultProps = { | ||
type: 'text' | ||
}; | ||
propTypes: (0, _definitions.getPropTypes)(PropTypes), | ||
getDefaultProps: function getDefaultProps() { | ||
return (0, _definitions.getDefaultProps)(PropTypes); | ||
}, | ||
render: function render() { | ||
return _react2['default'].createElement('input', _extends({}, this.props, { | ||
className: (0, _classnames2['default'])(this.props.className, { 'input--alert': this.props.touched && this.props.error }), | ||
name: this.props.id, | ||
value: this.props.value | ||
})); | ||
} | ||
}); | ||
var TextField = function TextField(props) { | ||
return _react2['default'].createElement('input', _extends({}, props, { | ||
className: (0, _classnames2['default'])(props.className, { 'input--alert': props.touched && props.error }), | ||
name: props.id, | ||
value: props.value | ||
})); | ||
}; | ||
TextField.propTypes = componentPropTypes; | ||
TextField.defaultProps = defaultProps; | ||
exports['default'] = TextField; | ||
@@ -480,3 +359,3 @@ | ||
/***/ 201: | ||
/***/ 200: | ||
/***/ function(module, exports) { | ||
@@ -488,3 +367,3 @@ | ||
/***/ 203: | ||
/***/ 202: | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -496,3 +375,3 @@ | ||
var _TextArea = __webpack_require__(204); | ||
var _TextArea = __webpack_require__(203); | ||
@@ -510,3 +389,3 @@ Object.defineProperty(exports, 'default', { | ||
/***/ 204: | ||
/***/ 203: | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -517,3 +396,3 @@ | ||
exports.__esModule = true; | ||
exports.PropTypes = undefined; | ||
exports.componentPropTypes = undefined; | ||
@@ -530,45 +409,24 @@ var _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; }; | ||
var _definitions = __webpack_require__(6); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
__webpack_require__(205); | ||
__webpack_require__(204); | ||
var PropTypes = exports.PropTypes = { | ||
id: { | ||
type: 'string', | ||
defaultValue: 'field-id', | ||
required: true | ||
}, | ||
value: { | ||
type: 'string', | ||
required: true | ||
}, | ||
required: { | ||
type: 'bool', | ||
defaultValue: false | ||
}, | ||
touched: { | ||
type: 'bool' | ||
}, | ||
error: { | ||
type: 'string' | ||
}, | ||
onChange: { | ||
type: 'func' | ||
} | ||
var componentPropTypes = exports.componentPropTypes = { | ||
id: _react.PropTypes.string.isRequired, | ||
value: _react.PropTypes.string.isRequired, | ||
required: _react.PropTypes.bool, | ||
touched: _react.PropTypes.bool, | ||
error: _react.PropTypes.string, | ||
onChange: _react.PropTypes.func | ||
}; | ||
var TextArea = _react2['default'].createClass({ | ||
displayName: 'TextArea', | ||
var TextArea = function TextArea(props) { | ||
return _react2['default'].createElement('textarea', _extends({}, props, { | ||
className: (0, _classnames2['default'])(props.className, { 'textarea--alert': props.touched && props.error }), | ||
name: props.id, | ||
value: props.value | ||
})); | ||
}; | ||
propTypes: (0, _definitions.getPropTypes)(PropTypes), | ||
render: function render() { | ||
return _react2['default'].createElement('textarea', _extends({}, this.props, { | ||
className: (0, _classnames2['default'])(this.props.className, { 'textarea--alert': this.props.touched && this.props.error }), | ||
name: this.props.id, | ||
value: this.props.value | ||
})); | ||
} | ||
}); | ||
TextArea.propTypes = componentPropTypes; | ||
@@ -579,3 +437,3 @@ exports['default'] = TextArea; | ||
/***/ 205: | ||
/***/ 204: | ||
/***/ function(module, exports) { | ||
@@ -587,3 +445,3 @@ | ||
/***/ 207: | ||
/***/ 206: | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -595,3 +453,3 @@ | ||
var _Select = __webpack_require__(208); | ||
var _Select = __webpack_require__(207); | ||
@@ -609,3 +467,3 @@ Object.defineProperty(exports, 'default', { | ||
/***/ 208: | ||
/***/ 207: | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -616,3 +474,3 @@ | ||
exports.__esModule = true; | ||
exports.PropTypes = undefined; | ||
exports.componentPropTypes = exports.oneOfProps = undefined; | ||
@@ -625,42 +483,25 @@ var _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; }; | ||
var _definitions = __webpack_require__(6); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
__webpack_require__(209); | ||
__webpack_require__(208); | ||
var PropTypes = exports.PropTypes = { | ||
id: { | ||
type: 'string', | ||
required: true | ||
}, | ||
options: { | ||
type: 'arrayOf', | ||
allowedValues: _react2['default'].PropTypes.object, | ||
required: true | ||
}, | ||
className: { | ||
type: 'string' | ||
}, | ||
value: { | ||
type: 'string' | ||
}, | ||
onChange: { | ||
type: 'func' | ||
} | ||
var oneOfProps = exports.oneOfProps = { | ||
options: _react.PropTypes.object | ||
}; | ||
var Select = _react2['default'].createClass({ | ||
displayName: 'Select', | ||
var componentPropTypes = exports.componentPropTypes = { | ||
id: _react.PropTypes.string.isRequired, | ||
options: _react.PropTypes.arrayOf(oneOfProps.options).isRequired, | ||
className: _react.PropTypes.string, | ||
value: _react.PropTypes.string, | ||
onChange: _react.PropTypes.func | ||
}; | ||
propTypes: (0, _definitions.getPropTypes)(PropTypes), | ||
getFirstOptionValue: function getFirstOptionValue() { | ||
if (!this.props.options[0]) { | ||
return ''; | ||
} | ||
return this.props.options[0].value; | ||
}, | ||
render: function render() { | ||
var options = this.props.options.map(function (key) { | ||
var Select = function Select(props) { | ||
return _react2['default'].createElement( | ||
'select', | ||
_extends({}, props, { | ||
name: props.id, | ||
value: props.value }), | ||
props.options.map(function (key) { | ||
return _react2['default'].createElement( | ||
@@ -673,13 +514,8 @@ 'option', | ||
); | ||
}); | ||
return _react2['default'].createElement( | ||
'select', | ||
_extends({}, this.props, { | ||
name: this.props.id, | ||
value: this.props.value }), | ||
options | ||
); | ||
} | ||
}); | ||
}) | ||
); | ||
}; | ||
Select.propTypes = componentPropTypes; | ||
exports['default'] = Select; | ||
@@ -689,3 +525,3 @@ | ||
/***/ 209: | ||
/***/ 208: | ||
/***/ function(module, exports) { | ||
@@ -697,3 +533,3 @@ | ||
/***/ 211: | ||
/***/ 210: | ||
/***/ function(module, exports) { | ||
@@ -700,0 +536,0 @@ |
@@ -58,3 +58,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
module.exports = __webpack_require__(196); | ||
module.exports = __webpack_require__(195); | ||
@@ -71,3 +71,3 @@ | ||
/***/ 6: | ||
/***/ 195: | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -78,82 +78,4 @@ | ||
exports.__esModule = true; | ||
exports.translationsToDefinitions = exports.getPropTypes = exports.getDefaultProps = exports.getInitialState = undefined; | ||
exports.componentPropTypes = undefined; | ||
var _react = __webpack_require__(2); | ||
var getInitialState = exports.getInitialState = function getInitialState(definitionObj) { | ||
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var defaults = {}; | ||
definitionObj.propTypes.forEach(function (_ref) { | ||
var propName = _ref.propName, | ||
defaultValue = _ref.defaultValue; | ||
if (Object.hasOwnProperty.call(props, propName)) { | ||
defaults[propName] = props[propName]; | ||
} else { | ||
defaults[propName] = defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; // const PropTypes = require('react').PropTypes; | ||
var getDefaultProps = exports.getDefaultProps = function getDefaultProps(propsObject) { | ||
var defaults = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
if (typeof prop.defaultValue !== 'undefined') { | ||
defaults[propName] = prop.defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; | ||
var getPropTypes = exports.getPropTypes = function getPropTypes() { | ||
var propsObject = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var propTypes = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
var propType = void 0; | ||
if (prop.allowedValues) { | ||
propType = _react.PropTypes[prop.type](prop.allowedValues); | ||
} else { | ||
propType = _react.PropTypes[prop.type]; | ||
} | ||
if (prop.required) { | ||
propType = propType.isRequired; | ||
} | ||
propTypes[propName] = propType; | ||
}); | ||
return propTypes; | ||
}; | ||
var translationsToDefinitions = exports.translationsToDefinitions = function translationsToDefinitions(translations) { | ||
var translationProps = {}; | ||
Object.keys(translations).forEach(function (translationKey) { | ||
translationProps[translationKey] = { | ||
type: 'string', | ||
required: true, | ||
defaultValue: translations[translationKey] | ||
}; | ||
}); | ||
return translationProps; | ||
}; | ||
/***/ }, | ||
/***/ 196: | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
exports.__esModule = true; | ||
exports.PropTypes = undefined; | ||
var _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; }; | ||
@@ -165,35 +87,24 @@ | ||
var _definitions = __webpack_require__(6); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
__webpack_require__(197); | ||
var PropTypes = exports.PropTypes = { | ||
htmlFor: { | ||
type: 'string', | ||
required: true | ||
}, | ||
children: { | ||
type: 'any', | ||
required: true | ||
} | ||
__webpack_require__(196); | ||
var componentPropTypes = exports.componentPropTypes = { | ||
htmlFor: _react.PropTypes.string.isRequired, | ||
children: _react.PropTypes.any.isRequired | ||
}; | ||
var InlineLabel = _react2['default'].createClass({ | ||
displayName: 'InlineLabel', | ||
var InlineLabel = function InlineLabel(props) { | ||
return _react2['default'].createElement( | ||
'label', | ||
_extends({ | ||
className: 'inline-label__tag', | ||
htmlFor: props.htmlFor | ||
}, props), | ||
props.children | ||
); | ||
}; | ||
propTypes: (0, _definitions.getPropTypes)(PropTypes), | ||
InlineLabel.propTypes = componentPropTypes; | ||
render: function render() { | ||
return _react2['default'].createElement( | ||
'label', | ||
_extends({ | ||
className: 'inline-label__tag', | ||
htmlFor: this.props.htmlFor | ||
}, this.props), | ||
this.props.children | ||
); | ||
} | ||
}); | ||
exports['default'] = InlineLabel; | ||
@@ -203,3 +114,3 @@ | ||
/***/ 197: | ||
/***/ 196: | ||
/***/ function(module, exports) { | ||
@@ -206,0 +117,0 @@ |
@@ -58,3 +58,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
module.exports = __webpack_require__(213); | ||
module.exports = __webpack_require__(212); | ||
@@ -126,3 +126,3 @@ | ||
/***/ 6: | ||
/***/ 212: | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -133,84 +133,6 @@ | ||
exports.__esModule = true; | ||
exports.translationsToDefinitions = exports.getPropTypes = exports.getDefaultProps = exports.getInitialState = undefined; | ||
exports.componentPropTypes = undefined; | ||
var _react = __webpack_require__(2); | ||
var getInitialState = exports.getInitialState = function getInitialState(definitionObj) { | ||
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var defaults = {}; | ||
definitionObj.propTypes.forEach(function (_ref) { | ||
var propName = _ref.propName, | ||
defaultValue = _ref.defaultValue; | ||
if (Object.hasOwnProperty.call(props, propName)) { | ||
defaults[propName] = props[propName]; | ||
} else { | ||
defaults[propName] = defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; // const PropTypes = require('react').PropTypes; | ||
var getDefaultProps = exports.getDefaultProps = function getDefaultProps(propsObject) { | ||
var defaults = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
if (typeof prop.defaultValue !== 'undefined') { | ||
defaults[propName] = prop.defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; | ||
var getPropTypes = exports.getPropTypes = function getPropTypes() { | ||
var propsObject = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var propTypes = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
var propType = void 0; | ||
if (prop.allowedValues) { | ||
propType = _react.PropTypes[prop.type](prop.allowedValues); | ||
} else { | ||
propType = _react.PropTypes[prop.type]; | ||
} | ||
if (prop.required) { | ||
propType = propType.isRequired; | ||
} | ||
propTypes[propName] = propType; | ||
}); | ||
return propTypes; | ||
}; | ||
var translationsToDefinitions = exports.translationsToDefinitions = function translationsToDefinitions(translations) { | ||
var translationProps = {}; | ||
Object.keys(translations).forEach(function (translationKey) { | ||
translationProps[translationKey] = { | ||
type: 'string', | ||
required: true, | ||
defaultValue: translations[translationKey] | ||
}; | ||
}); | ||
return translationProps; | ||
}; | ||
/***/ }, | ||
/***/ 213: | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
exports.__esModule = true; | ||
exports.PropTypes = undefined; | ||
var _react = __webpack_require__(2); | ||
var _react2 = _interopRequireDefault(_react); | ||
@@ -222,20 +144,10 @@ | ||
var _definitions = __webpack_require__(6); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
__webpack_require__(214); | ||
var PropTypes = exports.PropTypes = { | ||
maxLength: { | ||
type: 'number', | ||
required: true | ||
}, | ||
length: { | ||
type: 'number', | ||
required: true | ||
}, | ||
charsRemaining: { | ||
type: 'string', | ||
required: true | ||
} | ||
__webpack_require__(213); | ||
var componentPropTypes = exports.componentPropTypes = { | ||
maxLength: _react.PropTypes.number.isRequired, | ||
length: _react.PropTypes.number.isRequired, | ||
charsRemaining: _react.PropTypes.string.isRequired | ||
}; | ||
@@ -247,20 +159,14 @@ | ||
var InputCounter = _react2['default'].createClass({ | ||
displayName: 'InputCounter', | ||
var InputCounter = function InputCounter(props) { | ||
return _react2['default'].createElement( | ||
'span', | ||
{ className: classes(props.maxLength - props.length >= 0) }, | ||
props.maxLength - props.length, | ||
' ', | ||
props.charsRemaining | ||
); | ||
}; | ||
propTypes: (0, _definitions.getPropTypes)(PropTypes), | ||
InputCounter.propTypes = componentPropTypes; | ||
render: function render() { | ||
var remaining = this.props.maxLength - this.props.length; | ||
return _react2['default'].createElement( | ||
'span', | ||
{ className: classes(remaining >= 0) }, | ||
remaining, | ||
' ', | ||
this.props.charsRemaining | ||
); | ||
} | ||
}); | ||
exports['default'] = InputCounter; | ||
@@ -270,3 +176,3 @@ | ||
/***/ 214: | ||
/***/ 213: | ||
/***/ function(module, exports) { | ||
@@ -273,0 +179,0 @@ |
112
lib/List.js
@@ -58,3 +58,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
module.exports = __webpack_require__(216); | ||
module.exports = __webpack_require__(215); | ||
@@ -126,3 +126,3 @@ | ||
/***/ 6: | ||
/***/ 215: | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -133,84 +133,6 @@ | ||
exports.__esModule = true; | ||
exports.translationsToDefinitions = exports.getPropTypes = exports.getDefaultProps = exports.getInitialState = undefined; | ||
exports.componentPropTypes = exports.oneOfProps = undefined; | ||
var _react = __webpack_require__(2); | ||
var getInitialState = exports.getInitialState = function getInitialState(definitionObj) { | ||
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var defaults = {}; | ||
definitionObj.propTypes.forEach(function (_ref) { | ||
var propName = _ref.propName, | ||
defaultValue = _ref.defaultValue; | ||
if (Object.hasOwnProperty.call(props, propName)) { | ||
defaults[propName] = props[propName]; | ||
} else { | ||
defaults[propName] = defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; // const PropTypes = require('react').PropTypes; | ||
var getDefaultProps = exports.getDefaultProps = function getDefaultProps(propsObject) { | ||
var defaults = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
if (typeof prop.defaultValue !== 'undefined') { | ||
defaults[propName] = prop.defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; | ||
var getPropTypes = exports.getPropTypes = function getPropTypes() { | ||
var propsObject = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var propTypes = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
var propType = void 0; | ||
if (prop.allowedValues) { | ||
propType = _react.PropTypes[prop.type](prop.allowedValues); | ||
} else { | ||
propType = _react.PropTypes[prop.type]; | ||
} | ||
if (prop.required) { | ||
propType = propType.isRequired; | ||
} | ||
propTypes[propName] = propType; | ||
}); | ||
return propTypes; | ||
}; | ||
var translationsToDefinitions = exports.translationsToDefinitions = function translationsToDefinitions(translations) { | ||
var translationProps = {}; | ||
Object.keys(translations).forEach(function (translationKey) { | ||
translationProps[translationKey] = { | ||
type: 'string', | ||
required: true, | ||
defaultValue: translations[translationKey] | ||
}; | ||
}); | ||
return translationProps; | ||
}; | ||
/***/ }, | ||
/***/ 216: | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
exports.__esModule = true; | ||
exports.PropTypes = undefined; | ||
var _react = __webpack_require__(2); | ||
var _react2 = _interopRequireDefault(_react); | ||
@@ -222,4 +144,2 @@ | ||
var _definitions = __webpack_require__(6); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
@@ -229,18 +149,14 @@ | ||
__webpack_require__(217); | ||
__webpack_require__(216); | ||
var PropTypes = exports.PropTypes = { | ||
items: { | ||
type: 'array', | ||
required: true | ||
}, | ||
type: { | ||
type: 'oneOf', | ||
allowedValues: ['default', 'bulletless', 'inline', 'spaced', 'slashed', 'ticked'] | ||
}, | ||
className: { | ||
type: 'string' | ||
} | ||
var oneOfProps = exports.oneOfProps = { | ||
type: ['default', 'bulletless', 'inline', 'spaced', 'slashed', 'ticked'] | ||
}; | ||
var componentPropTypes = exports.componentPropTypes = { | ||
items: _react.PropTypes.array.isRequired, | ||
type: _react.PropTypes.oneOf(oneOfProps.type), | ||
className: _react.PropTypes.string | ||
}; | ||
var List = function List(props) { | ||
@@ -262,3 +178,3 @@ var items = props.items.map(function (item, index) { | ||
List.propTypes = (0, _definitions.getPropTypes)(PropTypes); | ||
List.propTypes = componentPropTypes; | ||
@@ -269,3 +185,3 @@ exports['default'] = List; | ||
/***/ 217: | ||
/***/ 216: | ||
/***/ function(module, exports) { | ||
@@ -272,0 +188,0 @@ |
@@ -58,3 +58,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
module.exports = __webpack_require__(182); | ||
module.exports = __webpack_require__(181); | ||
@@ -64,3 +64,3 @@ | ||
/***/ 182: | ||
/***/ 181: | ||
/***/ function(module, exports) { | ||
@@ -67,0 +67,0 @@ |
162
lib/Media.js
@@ -58,3 +58,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
module.exports = __webpack_require__(219); | ||
module.exports = __webpack_require__(218); | ||
@@ -126,3 +126,3 @@ | ||
/***/ 6: | ||
/***/ 218: | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -133,80 +133,2 @@ | ||
exports.__esModule = true; | ||
exports.translationsToDefinitions = exports.getPropTypes = exports.getDefaultProps = exports.getInitialState = undefined; | ||
var _react = __webpack_require__(2); | ||
var getInitialState = exports.getInitialState = function getInitialState(definitionObj) { | ||
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var defaults = {}; | ||
definitionObj.propTypes.forEach(function (_ref) { | ||
var propName = _ref.propName, | ||
defaultValue = _ref.defaultValue; | ||
if (Object.hasOwnProperty.call(props, propName)) { | ||
defaults[propName] = props[propName]; | ||
} else { | ||
defaults[propName] = defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; // const PropTypes = require('react').PropTypes; | ||
var getDefaultProps = exports.getDefaultProps = function getDefaultProps(propsObject) { | ||
var defaults = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
if (typeof prop.defaultValue !== 'undefined') { | ||
defaults[propName] = prop.defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; | ||
var getPropTypes = exports.getPropTypes = function getPropTypes() { | ||
var propsObject = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var propTypes = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
var propType = void 0; | ||
if (prop.allowedValues) { | ||
propType = _react.PropTypes[prop.type](prop.allowedValues); | ||
} else { | ||
propType = _react.PropTypes[prop.type]; | ||
} | ||
if (prop.required) { | ||
propType = propType.isRequired; | ||
} | ||
propTypes[propName] = propType; | ||
}); | ||
return propTypes; | ||
}; | ||
var translationsToDefinitions = exports.translationsToDefinitions = function translationsToDefinitions(translations) { | ||
var translationProps = {}; | ||
Object.keys(translations).forEach(function (translationKey) { | ||
translationProps[translationKey] = { | ||
type: 'string', | ||
required: true, | ||
defaultValue: translations[translationKey] | ||
}; | ||
}); | ||
return translationProps; | ||
}; | ||
/***/ }, | ||
/***/ 219: | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
exports.__esModule = true; | ||
exports.Body = exports.BodyPropTypes = exports.Thumb = exports.ThumbPropTypes = exports.Media = exports.MediaPropTypes = undefined; | ||
@@ -222,3 +144,3 @@ | ||
var _definitions = __webpack_require__(6); | ||
var _definitions = __webpack_require__(219); | ||
@@ -318,2 +240,80 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
/***/ 219: | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
exports.__esModule = true; | ||
exports.translationsToDefinitions = exports.getPropTypes = exports.getDefaultProps = exports.getInitialState = undefined; | ||
var _react = __webpack_require__(2); | ||
var getInitialState = exports.getInitialState = function getInitialState(definitionObj) { | ||
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var defaults = {}; | ||
definitionObj.propTypes.forEach(function (_ref) { | ||
var propName = _ref.propName, | ||
defaultValue = _ref.defaultValue; | ||
if (Object.hasOwnProperty.call(props, propName)) { | ||
defaults[propName] = props[propName]; | ||
} else { | ||
defaults[propName] = defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; // const PropTypes = require('react').PropTypes; | ||
var getDefaultProps = exports.getDefaultProps = function getDefaultProps(propsObject) { | ||
var defaults = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
if (typeof prop.defaultValue !== 'undefined') { | ||
defaults[propName] = prop.defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; | ||
var getPropTypes = exports.getPropTypes = function getPropTypes() { | ||
var propsObject = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var propTypes = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
var propType = void 0; | ||
if (prop.allowedValues) { | ||
propType = _react.PropTypes[prop.type](prop.allowedValues); | ||
} else { | ||
propType = _react.PropTypes[prop.type]; | ||
} | ||
if (prop.required) { | ||
propType = propType.isRequired; | ||
} | ||
propTypes[propName] = propType; | ||
}); | ||
return propTypes; | ||
}; | ||
var translationsToDefinitions = exports.translationsToDefinitions = function translationsToDefinitions(translations) { | ||
var translationProps = {}; | ||
Object.keys(translations).forEach(function (translationKey) { | ||
translationProps[translationKey] = { | ||
type: 'string', | ||
required: true, | ||
defaultValue: translations[translationKey] | ||
}; | ||
}); | ||
return translationProps; | ||
}; | ||
/***/ }, | ||
/***/ 220: | ||
@@ -320,0 +320,0 @@ /***/ function(module, exports) { |
121
lib/Panel.js
@@ -125,80 +125,2 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
/***/ 6: | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
exports.__esModule = true; | ||
exports.translationsToDefinitions = exports.getPropTypes = exports.getDefaultProps = exports.getInitialState = undefined; | ||
var _react = __webpack_require__(2); | ||
var getInitialState = exports.getInitialState = function getInitialState(definitionObj) { | ||
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var defaults = {}; | ||
definitionObj.propTypes.forEach(function (_ref) { | ||
var propName = _ref.propName, | ||
defaultValue = _ref.defaultValue; | ||
if (Object.hasOwnProperty.call(props, propName)) { | ||
defaults[propName] = props[propName]; | ||
} else { | ||
defaults[propName] = defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; // const PropTypes = require('react').PropTypes; | ||
var getDefaultProps = exports.getDefaultProps = function getDefaultProps(propsObject) { | ||
var defaults = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
if (typeof prop.defaultValue !== 'undefined') { | ||
defaults[propName] = prop.defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; | ||
var getPropTypes = exports.getPropTypes = function getPropTypes() { | ||
var propsObject = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var propTypes = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
var propType = void 0; | ||
if (prop.allowedValues) { | ||
propType = _react.PropTypes[prop.type](prop.allowedValues); | ||
} else { | ||
propType = _react.PropTypes[prop.type]; | ||
} | ||
if (prop.required) { | ||
propType = propType.isRequired; | ||
} | ||
propTypes[propName] = propType; | ||
}); | ||
return propTypes; | ||
}; | ||
var translationsToDefinitions = exports.translationsToDefinitions = function translationsToDefinitions(translations) { | ||
var translationProps = {}; | ||
Object.keys(translations).forEach(function (translationKey) { | ||
translationProps[translationKey] = { | ||
type: 'string', | ||
required: true, | ||
defaultValue: translations[translationKey] | ||
}; | ||
}); | ||
return translationProps; | ||
}; | ||
/***/ }, | ||
/***/ 224: | ||
@@ -210,3 +132,3 @@ /***/ function(module, exports, __webpack_require__) { | ||
exports.__esModule = true; | ||
exports.PropTypes = undefined; | ||
exports.componentPropTypes = exports.oneOfProps = undefined; | ||
@@ -221,4 +143,2 @@ var _react = __webpack_require__(2); | ||
var _definitions = __webpack_require__(6); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
@@ -230,28 +150,16 @@ | ||
var PropTypes = exports.PropTypes = { | ||
border: { | ||
type: 'oneOf', | ||
canBeNull: true, | ||
allowedValues: ['shadow', 'solid'], | ||
defaultValue: 'shadow' | ||
}, | ||
highlight: { | ||
type: 'oneOf', | ||
canBeNull: true, | ||
allowedValues: ['grass-ceiling', 'grass-ceiling-red'] | ||
}, | ||
background: { | ||
type: 'oneOf', | ||
canBeNull: true, | ||
allowedValues: ['alert', 'light', 'notice', 'semi-transparent', 'semi-transparent-tinted'] | ||
}, | ||
className: { | ||
type: 'string' | ||
}, | ||
children: { | ||
type: 'node', | ||
required: true | ||
} | ||
var oneOfProps = exports.oneOfProps = { | ||
border: ['shadow', 'solid'], | ||
highlight: ['grass-ceiling', 'grass-ceiling-red'], | ||
background: ['alert', 'light', 'notice', 'semi-transparent', 'semi-transparent-tinted'] | ||
}; | ||
var componentPropTypes = exports.componentPropTypes = { | ||
border: _react.PropTypes.oneOf(oneOfProps.border), | ||
highlight: _react.PropTypes.oneOf(oneOfProps.highlight), | ||
background: _react.PropTypes.oneOf(oneOfProps.background), | ||
className: _react.PropTypes.string, | ||
children: _react.PropTypes.any.isRequired | ||
}; | ||
var Panel = function Panel(props) { | ||
@@ -268,4 +176,3 @@ var _classNames; | ||
Panel.propTypes = (0, _definitions.getPropTypes)(PropTypes); | ||
Panel.defaultProps = (0, _definitions.getDefaultProps)(PropTypes); | ||
Panel.propTypes = componentPropTypes; | ||
@@ -272,0 +179,0 @@ exports['default'] = Panel; |
102
lib/Rule.js
@@ -70,3 +70,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
/***/ 6: | ||
/***/ 241: | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -77,100 +77,24 @@ | ||
exports.__esModule = true; | ||
exports.translationsToDefinitions = exports.getPropTypes = exports.getDefaultProps = exports.getInitialState = undefined; | ||
exports.defaultProps = exports.componentPropTypes = exports.oneOfProps = undefined; | ||
var _react = __webpack_require__(2); | ||
var getInitialState = exports.getInitialState = function getInitialState(definitionObj) { | ||
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var _react2 = _interopRequireDefault(_react); | ||
var defaults = {}; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
definitionObj.propTypes.forEach(function (_ref) { | ||
var propName = _ref.propName, | ||
defaultValue = _ref.defaultValue; | ||
__webpack_require__(242); | ||
if (Object.hasOwnProperty.call(props, propName)) { | ||
defaults[propName] = props[propName]; | ||
} else { | ||
defaults[propName] = defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; // const PropTypes = require('react').PropTypes; | ||
var getDefaultProps = exports.getDefaultProps = function getDefaultProps(propsObject) { | ||
var defaults = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
if (typeof prop.defaultValue !== 'undefined') { | ||
defaults[propName] = prop.defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
var oneOfProps = exports.oneOfProps = { | ||
type: ['medium'] | ||
}; | ||
var getPropTypes = exports.getPropTypes = function getPropTypes() { | ||
var propsObject = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var propTypes = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
var propType = void 0; | ||
if (prop.allowedValues) { | ||
propType = _react.PropTypes[prop.type](prop.allowedValues); | ||
} else { | ||
propType = _react.PropTypes[prop.type]; | ||
} | ||
if (prop.required) { | ||
propType = propType.isRequired; | ||
} | ||
propTypes[propName] = propType; | ||
}); | ||
return propTypes; | ||
var componentPropTypes = exports.componentPropTypes = { | ||
type: _react.PropTypes.oneOf(oneOfProps.type).isRequired | ||
}; | ||
var translationsToDefinitions = exports.translationsToDefinitions = function translationsToDefinitions(translations) { | ||
var translationProps = {}; | ||
Object.keys(translations).forEach(function (translationKey) { | ||
translationProps[translationKey] = { | ||
type: 'string', | ||
required: true, | ||
defaultValue: translations[translationKey] | ||
}; | ||
}); | ||
return translationProps; | ||
var defaultProps = exports.defaultProps = { | ||
type: 'medium' | ||
}; | ||
/***/ }, | ||
/***/ 241: | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
exports.__esModule = true; | ||
exports.PropTypes = undefined; | ||
var _react = __webpack_require__(2); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _definitions = __webpack_require__(6); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
__webpack_require__(242); | ||
var PropTypes = exports.PropTypes = { | ||
type: { | ||
type: 'oneOf', | ||
allowedValues: ['medium'], | ||
defaultValue: 'medium', | ||
required: true | ||
} | ||
}; | ||
var Rule = function Rule(props) { | ||
@@ -180,4 +104,4 @@ return _react2['default'].createElement('div', { className: 'rule--' + props.type }); | ||
Rule.PropTypes = (0, _definitions.getPropTypes)(PropTypes); | ||
Rule.defaultProps = (0, _definitions.getDefaultProps)(PropTypes); | ||
Rule.PropTypes = componentPropTypes; | ||
Rule.defaultProps = defaultProps; | ||
@@ -184,0 +108,0 @@ exports['default'] = Rule; |
@@ -58,3 +58,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
module.exports = __webpack_require__(208); | ||
module.exports = __webpack_require__(207); | ||
@@ -71,3 +71,3 @@ | ||
/***/ 6: | ||
/***/ 207: | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -78,82 +78,4 @@ | ||
exports.__esModule = true; | ||
exports.translationsToDefinitions = exports.getPropTypes = exports.getDefaultProps = exports.getInitialState = undefined; | ||
exports.componentPropTypes = exports.oneOfProps = undefined; | ||
var _react = __webpack_require__(2); | ||
var getInitialState = exports.getInitialState = function getInitialState(definitionObj) { | ||
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var defaults = {}; | ||
definitionObj.propTypes.forEach(function (_ref) { | ||
var propName = _ref.propName, | ||
defaultValue = _ref.defaultValue; | ||
if (Object.hasOwnProperty.call(props, propName)) { | ||
defaults[propName] = props[propName]; | ||
} else { | ||
defaults[propName] = defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; // const PropTypes = require('react').PropTypes; | ||
var getDefaultProps = exports.getDefaultProps = function getDefaultProps(propsObject) { | ||
var defaults = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
if (typeof prop.defaultValue !== 'undefined') { | ||
defaults[propName] = prop.defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; | ||
var getPropTypes = exports.getPropTypes = function getPropTypes() { | ||
var propsObject = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var propTypes = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
var propType = void 0; | ||
if (prop.allowedValues) { | ||
propType = _react.PropTypes[prop.type](prop.allowedValues); | ||
} else { | ||
propType = _react.PropTypes[prop.type]; | ||
} | ||
if (prop.required) { | ||
propType = propType.isRequired; | ||
} | ||
propTypes[propName] = propType; | ||
}); | ||
return propTypes; | ||
}; | ||
var translationsToDefinitions = exports.translationsToDefinitions = function translationsToDefinitions(translations) { | ||
var translationProps = {}; | ||
Object.keys(translations).forEach(function (translationKey) { | ||
translationProps[translationKey] = { | ||
type: 'string', | ||
required: true, | ||
defaultValue: translations[translationKey] | ||
}; | ||
}); | ||
return translationProps; | ||
}; | ||
/***/ }, | ||
/***/ 208: | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
exports.__esModule = true; | ||
exports.PropTypes = undefined; | ||
var _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; }; | ||
@@ -165,42 +87,25 @@ | ||
var _definitions = __webpack_require__(6); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
__webpack_require__(209); | ||
__webpack_require__(208); | ||
var PropTypes = exports.PropTypes = { | ||
id: { | ||
type: 'string', | ||
required: true | ||
}, | ||
options: { | ||
type: 'arrayOf', | ||
allowedValues: _react2['default'].PropTypes.object, | ||
required: true | ||
}, | ||
className: { | ||
type: 'string' | ||
}, | ||
value: { | ||
type: 'string' | ||
}, | ||
onChange: { | ||
type: 'func' | ||
} | ||
var oneOfProps = exports.oneOfProps = { | ||
options: _react.PropTypes.object | ||
}; | ||
var Select = _react2['default'].createClass({ | ||
displayName: 'Select', | ||
var componentPropTypes = exports.componentPropTypes = { | ||
id: _react.PropTypes.string.isRequired, | ||
options: _react.PropTypes.arrayOf(oneOfProps.options).isRequired, | ||
className: _react.PropTypes.string, | ||
value: _react.PropTypes.string, | ||
onChange: _react.PropTypes.func | ||
}; | ||
propTypes: (0, _definitions.getPropTypes)(PropTypes), | ||
getFirstOptionValue: function getFirstOptionValue() { | ||
if (!this.props.options[0]) { | ||
return ''; | ||
} | ||
return this.props.options[0].value; | ||
}, | ||
render: function render() { | ||
var options = this.props.options.map(function (key) { | ||
var Select = function Select(props) { | ||
return _react2['default'].createElement( | ||
'select', | ||
_extends({}, props, { | ||
name: props.id, | ||
value: props.value }), | ||
props.options.map(function (key) { | ||
return _react2['default'].createElement( | ||
@@ -213,13 +118,8 @@ 'option', | ||
); | ||
}); | ||
return _react2['default'].createElement( | ||
'select', | ||
_extends({}, this.props, { | ||
name: this.props.id, | ||
value: this.props.value }), | ||
options | ||
); | ||
} | ||
}); | ||
}) | ||
); | ||
}; | ||
Select.propTypes = componentPropTypes; | ||
exports['default'] = Select; | ||
@@ -229,3 +129,3 @@ | ||
/***/ 209: | ||
/***/ 208: | ||
/***/ function(module, exports) { | ||
@@ -232,0 +132,0 @@ |
@@ -70,80 +70,2 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
/***/ 6: | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
exports.__esModule = true; | ||
exports.translationsToDefinitions = exports.getPropTypes = exports.getDefaultProps = exports.getInitialState = undefined; | ||
var _react = __webpack_require__(2); | ||
var getInitialState = exports.getInitialState = function getInitialState(definitionObj) { | ||
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var defaults = {}; | ||
definitionObj.propTypes.forEach(function (_ref) { | ||
var propName = _ref.propName, | ||
defaultValue = _ref.defaultValue; | ||
if (Object.hasOwnProperty.call(props, propName)) { | ||
defaults[propName] = props[propName]; | ||
} else { | ||
defaults[propName] = defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; // const PropTypes = require('react').PropTypes; | ||
var getDefaultProps = exports.getDefaultProps = function getDefaultProps(propsObject) { | ||
var defaults = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
if (typeof prop.defaultValue !== 'undefined') { | ||
defaults[propName] = prop.defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; | ||
var getPropTypes = exports.getPropTypes = function getPropTypes() { | ||
var propsObject = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var propTypes = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
var propType = void 0; | ||
if (prop.allowedValues) { | ||
propType = _react.PropTypes[prop.type](prop.allowedValues); | ||
} else { | ||
propType = _react.PropTypes[prop.type]; | ||
} | ||
if (prop.required) { | ||
propType = propType.isRequired; | ||
} | ||
propTypes[propName] = propType; | ||
}); | ||
return propTypes; | ||
}; | ||
var translationsToDefinitions = exports.translationsToDefinitions = function translationsToDefinitions(translations) { | ||
var translationProps = {}; | ||
Object.keys(translations).forEach(function (translationKey) { | ||
translationProps[translationKey] = { | ||
type: 'string', | ||
required: true, | ||
defaultValue: translations[translationKey] | ||
}; | ||
}); | ||
return translationProps; | ||
}; | ||
/***/ }, | ||
/***/ 245: | ||
@@ -155,3 +77,3 @@ /***/ function(module, exports, __webpack_require__) { | ||
exports.__esModule = true; | ||
exports.PropTypes = undefined; | ||
exports.componentPropTypes = exports.oneOfProps = undefined; | ||
@@ -164,32 +86,26 @@ var _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; }; | ||
var _definitions = __webpack_require__(6); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
__webpack_require__(246); | ||
var PropTypes = exports.PropTypes = { | ||
network: { | ||
type: 'string', | ||
required: true | ||
}, | ||
href: { | ||
type: 'string', | ||
required: true | ||
} | ||
var oneOfProps = exports.oneOfProps = { | ||
network: ['facebook', 'twitter', 'pinterest', 'instagram'] | ||
}; | ||
var SocialIcon = _react2['default'].createClass({ | ||
displayName: 'SocialIcon', | ||
var componentPropTypes = exports.componentPropTypes = { | ||
network: _react.PropTypes.oneOf(oneOfProps.network).isRequired, | ||
href: _react.PropTypes.string.isRequired | ||
}; | ||
propTypes: (0, _definitions.getPropTypes)(PropTypes), | ||
render: function render() { | ||
return _react2['default'].createElement( | ||
'a', | ||
_extends({}, this.props, { | ||
target: this.props.href.startsWith('#') ? '' : '_blank' }), | ||
_react2['default'].createElement('i', { className: 'icon-' + this.props.network }) | ||
); | ||
} | ||
}); | ||
var SocialIcon = function SocialIcon(props) { | ||
return _react2['default'].createElement( | ||
'a', | ||
_extends({}, props, { | ||
target: props.href.startsWith('#') ? '' : '_blank' }), | ||
_react2['default'].createElement('i', { className: 'icon-' + props.network }) | ||
); | ||
}; | ||
SocialIcon.propTypes = componentPropTypes; | ||
exports['default'] = SocialIcon; | ||
@@ -196,0 +112,0 @@ |
@@ -125,3 +125,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
/***/ 6: | ||
/***/ 14: | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -132,83 +132,5 @@ | ||
exports.__esModule = true; | ||
exports.translationsToDefinitions = exports.getPropTypes = exports.getDefaultProps = exports.getInitialState = undefined; | ||
var _react = __webpack_require__(2); | ||
var _Icon = __webpack_require__(15); | ||
var getInitialState = exports.getInitialState = function getInitialState(definitionObj) { | ||
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var defaults = {}; | ||
definitionObj.propTypes.forEach(function (_ref) { | ||
var propName = _ref.propName, | ||
defaultValue = _ref.defaultValue; | ||
if (Object.hasOwnProperty.call(props, propName)) { | ||
defaults[propName] = props[propName]; | ||
} else { | ||
defaults[propName] = defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; // const PropTypes = require('react').PropTypes; | ||
var getDefaultProps = exports.getDefaultProps = function getDefaultProps(propsObject) { | ||
var defaults = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
if (typeof prop.defaultValue !== 'undefined') { | ||
defaults[propName] = prop.defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; | ||
var getPropTypes = exports.getPropTypes = function getPropTypes() { | ||
var propsObject = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var propTypes = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
var propType = void 0; | ||
if (prop.allowedValues) { | ||
propType = _react.PropTypes[prop.type](prop.allowedValues); | ||
} else { | ||
propType = _react.PropTypes[prop.type]; | ||
} | ||
if (prop.required) { | ||
propType = propType.isRequired; | ||
} | ||
propTypes[propName] = propType; | ||
}); | ||
return propTypes; | ||
}; | ||
var translationsToDefinitions = exports.translationsToDefinitions = function translationsToDefinitions(translations) { | ||
var translationProps = {}; | ||
Object.keys(translations).forEach(function (translationKey) { | ||
translationProps[translationKey] = { | ||
type: 'string', | ||
required: true, | ||
defaultValue: translations[translationKey] | ||
}; | ||
}); | ||
return translationProps; | ||
}; | ||
/***/ }, | ||
/***/ 15: | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
exports.__esModule = true; | ||
var _Icon = __webpack_require__(16); | ||
Object.defineProperty(exports, 'default', { | ||
@@ -225,3 +147,3 @@ enumerable: true, | ||
/***/ 16: | ||
/***/ 15: | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -232,3 +154,3 @@ | ||
exports.__esModule = true; | ||
exports.Icon = exports.PropTypes = undefined; | ||
exports.Icon = exports.componentPropTypes = undefined; | ||
@@ -243,14 +165,8 @@ var _react = __webpack_require__(2); | ||
var _definitions = __webpack_require__(6); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
__webpack_require__(17); | ||
__webpack_require__(16); | ||
var PropTypes = exports.PropTypes = { | ||
icon: { | ||
type: 'string', | ||
required: true, | ||
desription: 'The icon to show, based off of the ss-pika naming conventions' | ||
} | ||
var componentPropTypes = exports.componentPropTypes = { | ||
icon: _react.PropTypes.string.isRequired | ||
}; | ||
@@ -264,3 +180,3 @@ | ||
Icon.propTypes = (0, _definitions.getPropTypes)(PropTypes); | ||
Icon.propTypes = componentPropTypes; | ||
@@ -271,3 +187,3 @@ exports['default'] = Icon; | ||
/***/ 17: | ||
/***/ 16: | ||
/***/ function(module, exports) { | ||
@@ -285,3 +201,3 @@ | ||
exports.__esModule = true; | ||
exports.StarRating = exports.PropTypes = undefined; | ||
exports.StarRating = exports.componentPropTypes = exports.oneOfProps = undefined; | ||
@@ -296,8 +212,6 @@ var _react = __webpack_require__(2); | ||
var _Icon = __webpack_require__(15); | ||
var _Icon = __webpack_require__(14); | ||
var _Icon2 = _interopRequireDefault(_Icon); | ||
var _definitions = __webpack_require__(6); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
@@ -307,13 +221,11 @@ | ||
var PropTypes = exports.PropTypes = { | ||
stars: { | ||
type: 'oneOf', | ||
allowedValues: ['5', '4', '3', '2', '1'], | ||
required: true | ||
}, | ||
className: { | ||
type: 'string' | ||
} | ||
var oneOfProps = exports.oneOfProps = { | ||
stars: ['5', '4', '3', '2', '1'] | ||
}; | ||
var componentPropTypes = exports.componentPropTypes = { | ||
stars: _react.PropTypes.oneOf(oneOfProps.stars).isRequired, | ||
className: _react.PropTypes.string | ||
}; | ||
var StarRating = exports.StarRating = function StarRating(props) { | ||
@@ -338,3 +250,3 @@ var stars = []; | ||
StarRating.PropTypes = (0, _definitions.getPropTypes)(PropTypes); | ||
StarRating.PropTypes = componentPropTypes; | ||
@@ -341,0 +253,0 @@ exports['default'] = StarRating; |
@@ -70,80 +70,2 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
/***/ 6: | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
exports.__esModule = true; | ||
exports.translationsToDefinitions = exports.getPropTypes = exports.getDefaultProps = exports.getInitialState = undefined; | ||
var _react = __webpack_require__(2); | ||
var getInitialState = exports.getInitialState = function getInitialState(definitionObj) { | ||
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var defaults = {}; | ||
definitionObj.propTypes.forEach(function (_ref) { | ||
var propName = _ref.propName, | ||
defaultValue = _ref.defaultValue; | ||
if (Object.hasOwnProperty.call(props, propName)) { | ||
defaults[propName] = props[propName]; | ||
} else { | ||
defaults[propName] = defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; // const PropTypes = require('react').PropTypes; | ||
var getDefaultProps = exports.getDefaultProps = function getDefaultProps(propsObject) { | ||
var defaults = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
if (typeof prop.defaultValue !== 'undefined') { | ||
defaults[propName] = prop.defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; | ||
var getPropTypes = exports.getPropTypes = function getPropTypes() { | ||
var propsObject = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var propTypes = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
var propType = void 0; | ||
if (prop.allowedValues) { | ||
propType = _react.PropTypes[prop.type](prop.allowedValues); | ||
} else { | ||
propType = _react.PropTypes[prop.type]; | ||
} | ||
if (prop.required) { | ||
propType = propType.isRequired; | ||
} | ||
propTypes[propName] = propType; | ||
}); | ||
return propTypes; | ||
}; | ||
var translationsToDefinitions = exports.translationsToDefinitions = function translationsToDefinitions(translations) { | ||
var translationProps = {}; | ||
Object.keys(translations).forEach(function (translationKey) { | ||
translationProps[translationKey] = { | ||
type: 'string', | ||
required: true, | ||
defaultValue: translations[translationKey] | ||
}; | ||
}); | ||
return translationProps; | ||
}; | ||
/***/ }, | ||
/***/ 251: | ||
@@ -155,3 +77,3 @@ /***/ function(module, exports, __webpack_require__) { | ||
exports.__esModule = true; | ||
exports.PropTypes = undefined; | ||
exports.defaultProps = exports.componentPropTypes = undefined; | ||
@@ -164,23 +86,14 @@ var _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; }; | ||
var _definitions = __webpack_require__(6); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var PropTypes = exports.PropTypes = { | ||
src: { | ||
type: 'string', | ||
required: true, | ||
description: 'The src of the SVG tag.' | ||
}, | ||
width: { | ||
type: 'number', | ||
required: true, | ||
description: 'The width of the SVG component.' | ||
}, | ||
alt: { | ||
type: 'string', | ||
description: 'Defaults back to an empty string if none is set' | ||
} | ||
var componentPropTypes = exports.componentPropTypes = { | ||
src: _react.PropTypes.string.isRequired, | ||
width: _react.PropTypes.number.isRequired, | ||
alt: _react.PropTypes.string | ||
}; | ||
var defaultProps = exports.defaultProps = { | ||
alt: '' | ||
}; | ||
var SvgTag = function SvgTag(props) { | ||
@@ -204,6 +117,4 @@ return _react2['default'].createElement( | ||
SvgTag.propTypes = (0, _definitions.getPropTypes)(PropTypes); | ||
SvgTag.defaultProps = { | ||
alt: '' | ||
}; | ||
SvgTag.propTypes = componentPropTypes; | ||
SvgTag.defaultProps = defaultProps; | ||
@@ -210,0 +121,0 @@ exports['default'] = SvgTag; |
@@ -58,3 +58,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
module.exports = __webpack_require__(204); | ||
module.exports = __webpack_require__(203); | ||
@@ -126,3 +126,3 @@ | ||
/***/ 6: | ||
/***/ 203: | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -133,82 +133,4 @@ | ||
exports.__esModule = true; | ||
exports.translationsToDefinitions = exports.getPropTypes = exports.getDefaultProps = exports.getInitialState = undefined; | ||
exports.componentPropTypes = undefined; | ||
var _react = __webpack_require__(2); | ||
var getInitialState = exports.getInitialState = function getInitialState(definitionObj) { | ||
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var defaults = {}; | ||
definitionObj.propTypes.forEach(function (_ref) { | ||
var propName = _ref.propName, | ||
defaultValue = _ref.defaultValue; | ||
if (Object.hasOwnProperty.call(props, propName)) { | ||
defaults[propName] = props[propName]; | ||
} else { | ||
defaults[propName] = defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; // const PropTypes = require('react').PropTypes; | ||
var getDefaultProps = exports.getDefaultProps = function getDefaultProps(propsObject) { | ||
var defaults = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
if (typeof prop.defaultValue !== 'undefined') { | ||
defaults[propName] = prop.defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; | ||
var getPropTypes = exports.getPropTypes = function getPropTypes() { | ||
var propsObject = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var propTypes = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
var propType = void 0; | ||
if (prop.allowedValues) { | ||
propType = _react.PropTypes[prop.type](prop.allowedValues); | ||
} else { | ||
propType = _react.PropTypes[prop.type]; | ||
} | ||
if (prop.required) { | ||
propType = propType.isRequired; | ||
} | ||
propTypes[propName] = propType; | ||
}); | ||
return propTypes; | ||
}; | ||
var translationsToDefinitions = exports.translationsToDefinitions = function translationsToDefinitions(translations) { | ||
var translationProps = {}; | ||
Object.keys(translations).forEach(function (translationKey) { | ||
translationProps[translationKey] = { | ||
type: 'string', | ||
required: true, | ||
defaultValue: translations[translationKey] | ||
}; | ||
}); | ||
return translationProps; | ||
}; | ||
/***/ }, | ||
/***/ 204: | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
exports.__esModule = true; | ||
exports.PropTypes = undefined; | ||
var _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; }; | ||
@@ -224,45 +146,24 @@ | ||
var _definitions = __webpack_require__(6); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
__webpack_require__(205); | ||
__webpack_require__(204); | ||
var PropTypes = exports.PropTypes = { | ||
id: { | ||
type: 'string', | ||
defaultValue: 'field-id', | ||
required: true | ||
}, | ||
value: { | ||
type: 'string', | ||
required: true | ||
}, | ||
required: { | ||
type: 'bool', | ||
defaultValue: false | ||
}, | ||
touched: { | ||
type: 'bool' | ||
}, | ||
error: { | ||
type: 'string' | ||
}, | ||
onChange: { | ||
type: 'func' | ||
} | ||
var componentPropTypes = exports.componentPropTypes = { | ||
id: _react.PropTypes.string.isRequired, | ||
value: _react.PropTypes.string.isRequired, | ||
required: _react.PropTypes.bool, | ||
touched: _react.PropTypes.bool, | ||
error: _react.PropTypes.string, | ||
onChange: _react.PropTypes.func | ||
}; | ||
var TextArea = _react2['default'].createClass({ | ||
displayName: 'TextArea', | ||
var TextArea = function TextArea(props) { | ||
return _react2['default'].createElement('textarea', _extends({}, props, { | ||
className: (0, _classnames2['default'])(props.className, { 'textarea--alert': props.touched && props.error }), | ||
name: props.id, | ||
value: props.value | ||
})); | ||
}; | ||
propTypes: (0, _definitions.getPropTypes)(PropTypes), | ||
render: function render() { | ||
return _react2['default'].createElement('textarea', _extends({}, this.props, { | ||
className: (0, _classnames2['default'])(this.props.className, { 'textarea--alert': this.props.touched && this.props.error }), | ||
name: this.props.id, | ||
value: this.props.value | ||
})); | ||
} | ||
}); | ||
TextArea.propTypes = componentPropTypes; | ||
@@ -273,3 +174,3 @@ exports['default'] = TextArea; | ||
/***/ 205: | ||
/***/ 204: | ||
/***/ function(module, exports) { | ||
@@ -276,0 +177,0 @@ |
@@ -58,3 +58,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
module.exports = __webpack_require__(200); | ||
module.exports = __webpack_require__(199); | ||
@@ -126,3 +126,3 @@ | ||
/***/ 6: | ||
/***/ 199: | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -133,82 +133,4 @@ | ||
exports.__esModule = true; | ||
exports.translationsToDefinitions = exports.getPropTypes = exports.getDefaultProps = exports.getInitialState = undefined; | ||
exports.defaultProps = exports.componentPropTypes = undefined; | ||
var _react = __webpack_require__(2); | ||
var getInitialState = exports.getInitialState = function getInitialState(definitionObj) { | ||
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var defaults = {}; | ||
definitionObj.propTypes.forEach(function (_ref) { | ||
var propName = _ref.propName, | ||
defaultValue = _ref.defaultValue; | ||
if (Object.hasOwnProperty.call(props, propName)) { | ||
defaults[propName] = props[propName]; | ||
} else { | ||
defaults[propName] = defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; // const PropTypes = require('react').PropTypes; | ||
var getDefaultProps = exports.getDefaultProps = function getDefaultProps(propsObject) { | ||
var defaults = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
if (typeof prop.defaultValue !== 'undefined') { | ||
defaults[propName] = prop.defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; | ||
var getPropTypes = exports.getPropTypes = function getPropTypes() { | ||
var propsObject = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var propTypes = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
var propType = void 0; | ||
if (prop.allowedValues) { | ||
propType = _react.PropTypes[prop.type](prop.allowedValues); | ||
} else { | ||
propType = _react.PropTypes[prop.type]; | ||
} | ||
if (prop.required) { | ||
propType = propType.isRequired; | ||
} | ||
propTypes[propName] = propType; | ||
}); | ||
return propTypes; | ||
}; | ||
var translationsToDefinitions = exports.translationsToDefinitions = function translationsToDefinitions(translations) { | ||
var translationProps = {}; | ||
Object.keys(translations).forEach(function (translationKey) { | ||
translationProps[translationKey] = { | ||
type: 'string', | ||
required: true, | ||
defaultValue: translations[translationKey] | ||
}; | ||
}); | ||
return translationProps; | ||
}; | ||
/***/ }, | ||
/***/ 200: | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
exports.__esModule = true; | ||
exports.PropTypes = undefined; | ||
var _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; }; | ||
@@ -224,51 +146,30 @@ | ||
var _definitions = __webpack_require__(6); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
__webpack_require__(201); | ||
__webpack_require__(200); | ||
var PropTypes = exports.PropTypes = { | ||
id: { | ||
type: 'string', | ||
required: true | ||
}, | ||
value: { | ||
type: 'string' | ||
}, | ||
type: { | ||
type: 'string', | ||
defaultValue: 'text' | ||
}, | ||
required: { | ||
type: 'bool', | ||
defaultValue: false | ||
}, | ||
touched: { | ||
type: 'bool' | ||
}, | ||
error: { | ||
type: 'string' | ||
}, | ||
onChange: { | ||
type: 'func' | ||
} | ||
var componentPropTypes = exports.componentPropTypes = { | ||
id: _react.PropTypes.string.isRequired, | ||
value: _react.PropTypes.string, | ||
type: _react.PropTypes.string.isRequired, | ||
required: _react.PropTypes.bool, | ||
touched: _react.PropTypes.bool, | ||
error: _react.PropTypes.string, | ||
onChange: _react.PropTypes.func | ||
}; | ||
var TextField = _react2['default'].createClass({ | ||
displayName: 'TextField', | ||
var defaultProps = exports.defaultProps = { | ||
type: 'text' | ||
}; | ||
propTypes: (0, _definitions.getPropTypes)(PropTypes), | ||
getDefaultProps: function getDefaultProps() { | ||
return (0, _definitions.getDefaultProps)(PropTypes); | ||
}, | ||
render: function render() { | ||
return _react2['default'].createElement('input', _extends({}, this.props, { | ||
className: (0, _classnames2['default'])(this.props.className, { 'input--alert': this.props.touched && this.props.error }), | ||
name: this.props.id, | ||
value: this.props.value | ||
})); | ||
} | ||
}); | ||
var TextField = function TextField(props) { | ||
return _react2['default'].createElement('input', _extends({}, props, { | ||
className: (0, _classnames2['default'])(props.className, { 'input--alert': props.touched && props.error }), | ||
name: props.id, | ||
value: props.value | ||
})); | ||
}; | ||
TextField.propTypes = componentPropTypes; | ||
TextField.defaultProps = defaultProps; | ||
exports['default'] = TextField; | ||
@@ -278,3 +179,3 @@ | ||
/***/ 201: | ||
/***/ 200: | ||
/***/ function(module, exports) { | ||
@@ -281,0 +182,0 @@ |
@@ -125,80 +125,2 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
/***/ 6: | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
exports.__esModule = true; | ||
exports.translationsToDefinitions = exports.getPropTypes = exports.getDefaultProps = exports.getInitialState = undefined; | ||
var _react = __webpack_require__(2); | ||
var getInitialState = exports.getInitialState = function getInitialState(definitionObj) { | ||
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var defaults = {}; | ||
definitionObj.propTypes.forEach(function (_ref) { | ||
var propName = _ref.propName, | ||
defaultValue = _ref.defaultValue; | ||
if (Object.hasOwnProperty.call(props, propName)) { | ||
defaults[propName] = props[propName]; | ||
} else { | ||
defaults[propName] = defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; // const PropTypes = require('react').PropTypes; | ||
var getDefaultProps = exports.getDefaultProps = function getDefaultProps(propsObject) { | ||
var defaults = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
if (typeof prop.defaultValue !== 'undefined') { | ||
defaults[propName] = prop.defaultValue; | ||
} | ||
}); | ||
return defaults; | ||
}; | ||
var getPropTypes = exports.getPropTypes = function getPropTypes() { | ||
var propsObject = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var propTypes = {}; | ||
Object.keys(propsObject).forEach(function (propName) { | ||
var prop = propsObject[propName]; | ||
var propType = void 0; | ||
if (prop.allowedValues) { | ||
propType = _react.PropTypes[prop.type](prop.allowedValues); | ||
} else { | ||
propType = _react.PropTypes[prop.type]; | ||
} | ||
if (prop.required) { | ||
propType = propType.isRequired; | ||
} | ||
propTypes[propName] = propType; | ||
}); | ||
return propTypes; | ||
}; | ||
var translationsToDefinitions = exports.translationsToDefinitions = function translationsToDefinitions(translations) { | ||
var translationProps = {}; | ||
Object.keys(translations).forEach(function (translationKey) { | ||
translationProps[translationKey] = { | ||
type: 'string', | ||
required: true, | ||
defaultValue: translations[translationKey] | ||
}; | ||
}); | ||
return translationProps; | ||
}; | ||
/***/ }, | ||
/***/ 252: | ||
@@ -210,3 +132,3 @@ /***/ function(module, exports, __webpack_require__) { | ||
exports.__esModule = true; | ||
exports.PropTypes = undefined; | ||
exports.componentPropTypes = exports.defaultProps = exports.oneOfProps = undefined; | ||
@@ -221,4 +143,2 @@ var _react = __webpack_require__(2); | ||
var _definitions = __webpack_require__(6); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
@@ -230,49 +150,32 @@ | ||
var PropTypes = exports.PropTypes = { | ||
visible: { | ||
type: 'bool' | ||
}, | ||
absolute: { | ||
type: 'bool' | ||
}, | ||
unstyledIfNoJs: { | ||
type: 'bool' | ||
}, | ||
inlineOn: { | ||
type: 'oneOf', | ||
allowedValues: ['mobile', 'fablet-down', 'fablet', 'fablet-up', 'tablet-down', 'tablet', 'tablet-up'], | ||
canBeNull: true | ||
}, | ||
huge: { | ||
type: 'bool' | ||
}, | ||
type: { | ||
type: 'oneOf', | ||
allowedValues: ['default', 'alert'] | ||
}, | ||
tooltipAlignment: { | ||
type: 'oneOf', | ||
allowedValues: ['below', 'above'], | ||
defaultValue: 'above' | ||
}, | ||
tooltipSide: { | ||
type: 'oneOf', | ||
allowedValues: ['center', 'left', 'right'], | ||
defaultValue: 'center' | ||
}, | ||
noPadding: { | ||
type: 'bool' | ||
}, | ||
children: { | ||
type: 'any' | ||
} | ||
var oneOfProps = exports.oneOfProps = { | ||
inlineOn: ['mobile', 'fablet-down', 'fablet', 'fablet-up', 'tablet', 'tablet-up'], | ||
type: ['default', 'alert'], | ||
tooltipAlignment: ['below', 'above'], | ||
tooltipSide: ['left', 'center', 'right'] | ||
}; | ||
var defaultProps = exports.defaultProps = { | ||
tooltipAlignment: 'above', | ||
tooltipSide: 'center' | ||
}; | ||
var componentPropTypes = exports.componentPropTypes = { | ||
visible: _react.PropTypes.bool, | ||
absolute: _react.PropTypes.bool, | ||
unstyledIfNoJs: _react.PropTypes.bool, | ||
inlineOn: _react.PropTypes.oneOf(oneOfProps.inlineOn), | ||
huge: _react.PropTypes.bool, | ||
type: _react.PropTypes.oneOf(oneOfProps.type), | ||
tooltipAlignment: _react.PropTypes.oneOf(oneOfProps.tooltipAlignment), | ||
tooltipSide: _react.PropTypes.oneOf(oneOfProps.tooltipSide), | ||
noPadding: _react.PropTypes.bool, | ||
children: _react.PropTypes.any | ||
}; | ||
exports['default'] = _react2['default'].createClass({ | ||
displayName: 'Tooltip', | ||
propTypes: (0, _definitions.getPropTypes)(PropTypes), | ||
getDefaultProps: function getDefaultProps() { | ||
return (0, _definitions.getDefaultProps)(PropTypes); | ||
}, | ||
propTypes: componentPropTypes, | ||
defaultProps: defaultProps, | ||
render: function render() { | ||
@@ -279,0 +182,0 @@ var classes = (0, _classnames2['default'])({ tooltip: !this.props.unstyledifNoJs }, { 'tooltip-if-js': this.props.unstyledifNoJs }, _defineProperty({}, 'tooltip--inline-on-' + this.props.inlineOn, this.props.inlineOn), { 'tooltip--padded': !this.props.noPadding }, { 'tooltip--visible': this.props.visible }, { 'tooltip--absolute': this.props.absolute }, _defineProperty({}, 'tooltip--' + this.props.type, this.props.type && this.props.type !== 'default'), _defineProperty({}, 'tooltip--' + this.props.tooltipSide, this.props.tooltipSide), _defineProperty({}, 'tooltip--' + this.props.tooltipAlignment, this.props.tooltipAlignment), _defineProperty({}, 'tooltip--huge', this.props.huge)); |
@@ -100,3 +100,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
exports.__esModule = true; | ||
exports.Row = exports.RowPropTypes = exports.Col = exports.ColPropTypes = undefined; | ||
exports.Row = exports.componentPropTypes = exports.oneOfProps = exports.Col = undefined; | ||
@@ -113,4 +113,2 @@ var _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; }; | ||
var _definitions = __webpack_require__(6); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
@@ -120,27 +118,20 @@ | ||
__webpack_require__(7); | ||
__webpack_require__(6); | ||
var ColPropTypes = exports.ColPropTypes = { | ||
numOfCols: { | ||
type: 'number', | ||
required: true, | ||
defaultValue: 1, | ||
description: 'The number of sibling columns so we can determine the column class programmatically.' | ||
}, | ||
className: { | ||
type: 'string', | ||
description: 'Any other CSS classes to go on this component.' | ||
}, | ||
children: { | ||
type: 'any', | ||
description: 'The contents of the column. If the value returns falsy, the column does not get rendered or affect any other column width calculation.' | ||
} | ||
var colPropTypes = { | ||
numOfCols: _react.PropTypes.number.isRequired, | ||
className: _react.PropTypes.string, | ||
children: _react.PropTypes.any | ||
}; | ||
var colDefaultProps = { | ||
numOfCols: 1 | ||
}; | ||
var Col = exports.Col = _react2['default'].createClass({ | ||
displayName: 'Col', | ||
propTypes: (0, _definitions.getPropTypes)(ColPropTypes), | ||
propTypes: colPropTypes, | ||
getDefaultProps: function getDefaultProps() { | ||
return (0, _definitions.getDefaultProps)(ColPropTypes); | ||
return colDefaultProps; | ||
}, | ||
@@ -171,33 +162,18 @@ | ||
var RowPropTypes = exports.RowPropTypes = { | ||
className: { | ||
type: 'string' | ||
}, | ||
rowsSpacedOn: { | ||
type: 'oneOf', | ||
allowedValues: mqs, | ||
canBeNull: true | ||
}, | ||
colsSpacedOn: { | ||
type: 'oneOf', | ||
allowedValues: mqs, | ||
defaultValue: 'base', | ||
canBeNull: true | ||
}, | ||
colsReversedOn: { | ||
type: 'oneOf', | ||
allowedValues: mqs, | ||
canBeNull: true | ||
}, | ||
colsToRowsOn: { | ||
type: 'oneOf', | ||
allowedValues: mqs, | ||
canBeNull: true | ||
}, | ||
children: { | ||
type: 'any', | ||
description: 'A `<Col>` element is the only acceptable component here.' | ||
} | ||
var oneOfProps = exports.oneOfProps = { | ||
rowsSpacedOn: mqs, | ||
colsSpacedOn: mqs, | ||
colsReversedOn: mqs, | ||
colsToRowsOn: mqs | ||
}; | ||
var componentPropTypes = exports.componentPropTypes = { | ||
className: _react.PropTypes.string, | ||
rowsSpacedOn: _react.PropTypes.oneOf(oneOfProps.rowsSpacedOn), | ||
colsSpacedOn: _react.PropTypes.oneOf(oneOfProps.colsSpacedOn), | ||
colsReversedOn: _react.PropTypes.oneOf(oneOfProps.colsReversedOn), | ||
colsToRowsOn: _react.PropTypes.oneOf(oneOfProps.colsToRowsOn), | ||
children: _react.PropTypes.any | ||
}; | ||
var getSuffix = function getSuffix(value) { | ||
@@ -213,6 +189,3 @@ if (value === 'base') { | ||
propTypes: (0, _definitions.getPropTypes)(RowPropTypes), | ||
getDefaultProps: function getDefaultProps() { | ||
return (0, _definitions.getDefaultProps)(RowPropTypes); | ||
}, | ||
propTypes: componentPropTypes, | ||
getEmptyChildren: function getEmptyChildren() { | ||
@@ -355,2 +328,9 @@ if (this.props.children) { | ||
/***/ 6: | ||
/***/ function(module, exports) { | ||
// removed by extract-text-webpack-plugin | ||
/***/ }, | ||
/***/ 219: | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -433,9 +413,2 @@ | ||
/***/ 7: | ||
/***/ function(module, exports) { | ||
// removed by extract-text-webpack-plugin | ||
/***/ }, | ||
/***/ 255: | ||
@@ -455,3 +428,3 @@ /***/ function(module, exports, __webpack_require__) { | ||
var _definitions = __webpack_require__(6); | ||
var _definitions = __webpack_require__(219); | ||
@@ -458,0 +431,0 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } |
{ | ||
"name": "@lostmyname/components", | ||
"version": "0.2.2", | ||
"version": "1.0.0", | ||
"description": "The home of all of Lost My Name's reusable React Components", | ||
@@ -5,0 +5,0 @@ "main": "lib/components.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
743825
22987