@govuk-react/hoc
Advanced tools
Comparing version 0.1.27 to 0.1.28
export { default as asAnchor } from './asAnchor'; | ||
export { default as asPaginationItem } from './asPaginationItem'; | ||
export { default as withWhiteSpace } from './withWhiteSpace'; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,1 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
@@ -8,10 +7,3 @@ import glamorous from 'glamorous'; | ||
return function (Component) { | ||
var Whitespace = function Whitespace(props) { | ||
return React.createElement(Component, props, props.children); | ||
}; | ||
Whitespace.propTypes = process.env.NODE_ENV !== "production" ? { | ||
children: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).isRequired | ||
} : {}; | ||
var StyledHoc = glamorous(Whitespace)(function (_ref) { | ||
var StyledHoc = glamorous(Component)(function (_ref) { | ||
var _ref2; | ||
@@ -18,0 +10,0 @@ |
@@ -122,3 +122,3 @@ import React from 'react'; | ||
}); | ||
stories.add('with spacing size 2', function () { | ||
stories.add('with various spacing sizes', function () { | ||
return React.createElement(React.Fragment, null, React.createElement(InputFieldWithWhiteSpace, { | ||
@@ -174,2 +174,3 @@ mb: number('marginBottom1', 1), | ||
}, "ListNavigation Example"), React.createElement(MultiChoiceWithWhiteSpace, { | ||
label: "example", | ||
mb: number('MultiChoice marginBottom', 9) | ||
@@ -181,6 +182,8 @@ }, "MultiChoice Example"), React.createElement(OrderedListWithWhiteSpace, { | ||
}, "Pagination Example"), React.createElement(PanelWithWhiteSpace, { | ||
panelTitle: "Example", | ||
mb: number('Panel marginBottom', 9) | ||
}, "Panel Example"), React.createElement(PhaseBadgeWithWhiteSpace, { | ||
mb: number('PhaseBadge marginBottom', 9) | ||
}, "PhaseBadge Example"), React.createElement(PhaseBannerWithWhiteSpace, { | ||
}, "PhaseBadge"), React.createElement(PhaseBannerWithWhiteSpace, { | ||
level: "EXAMPLE", | ||
mb: number('PhaseBanner marginBottom', 9) | ||
@@ -194,2 +197,3 @@ }, "PhaseBanner Example"), React.createElement(RadioWithWhiteSpace, { | ||
}, "SearchBox Example"), React.createElement(SelectWithWhiteSpace, { | ||
label: "example", | ||
mb: number('Select marginBottom', 9) | ||
@@ -196,0 +200,0 @@ }, "Select Example"), React.createElement(TextAreaWithWhiteSpace, { |
"use strict"; | ||
exports.__esModule = true; | ||
exports.asPaginationItem = exports.asAnchor = void 0; | ||
exports.withWhiteSpace = exports.asPaginationItem = exports.asAnchor = void 0; | ||
@@ -14,3 +14,7 @@ var _asAnchor = _interopRequireDefault(require("./asAnchor")); | ||
var _withWhiteSpace = _interopRequireDefault(require("./withWhiteSpace")); | ||
exports.withWhiteSpace = _withWhiteSpace.default; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
//# sourceMappingURL=index.js.map |
@@ -6,4 +6,2 @@ "use strict"; | ||
var _react = _interopRequireDefault(require("react")); | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
@@ -19,10 +17,3 @@ | ||
return function (Component) { | ||
var Whitespace = function Whitespace(props) { | ||
return _react.default.createElement(Component, props, props.children); | ||
}; | ||
Whitespace.propTypes = process.env.NODE_ENV !== "production" ? { | ||
children: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.element]).isRequired | ||
} : {}; | ||
var StyledHoc = (0, _glamorous.default)(Whitespace)(function (_ref) { | ||
var StyledHoc = (0, _glamorous.default)(Component)(function (_ref) { | ||
var _ref2; | ||
@@ -29,0 +20,0 @@ |
@@ -157,3 +157,3 @@ "use strict"; | ||
}); | ||
stories.add('with spacing size 2', function () { | ||
stories.add('with various spacing sizes', function () { | ||
return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(InputFieldWithWhiteSpace, { | ||
@@ -209,2 +209,3 @@ mb: (0, _react3.number)('marginBottom1', 1), | ||
}, "ListNavigation Example"), _react.default.createElement(MultiChoiceWithWhiteSpace, { | ||
label: "example", | ||
mb: (0, _react3.number)('MultiChoice marginBottom', 9) | ||
@@ -216,6 +217,8 @@ }, "MultiChoice Example"), _react.default.createElement(OrderedListWithWhiteSpace, { | ||
}, "Pagination Example"), _react.default.createElement(PanelWithWhiteSpace, { | ||
panelTitle: "Example", | ||
mb: (0, _react3.number)('Panel marginBottom', 9) | ||
}, "Panel Example"), _react.default.createElement(PhaseBadgeWithWhiteSpace, { | ||
mb: (0, _react3.number)('PhaseBadge marginBottom', 9) | ||
}, "PhaseBadge Example"), _react.default.createElement(PhaseBannerWithWhiteSpace, { | ||
}, "PhaseBadge"), _react.default.createElement(PhaseBannerWithWhiteSpace, { | ||
level: "EXAMPLE", | ||
mb: (0, _react3.number)('PhaseBanner marginBottom', 9) | ||
@@ -229,2 +232,3 @@ }, "PhaseBanner Example"), _react.default.createElement(RadioWithWhiteSpace, { | ||
}, "SearchBox Example"), _react.default.createElement(SelectWithWhiteSpace, { | ||
label: "example", | ||
mb: (0, _react3.number)('Select marginBottom', 9) | ||
@@ -231,0 +235,0 @@ }, "Select Example"), _react.default.createElement(TextAreaWithWhiteSpace, { |
{ | ||
"name": "@govuk-react/hoc", | ||
"version": "0.1.27", | ||
"version": "0.1.28", | ||
"dependencies": { | ||
"@govuk-react/constants": "^0.1.26", | ||
"@govuk-react/icons": "^0.1.27", | ||
"@govuk-react/constants": "^0.1.28", | ||
"@govuk-react/icons": "^0.1.28", | ||
"govuk-colours": "^1.0.3" | ||
@@ -14,40 +14,2 @@ }, | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "^7.0.0-beta.40", | ||
"@govuk-react/back-link": "^0.1.27", | ||
"@govuk-react/breadcrumb": "^0.1.27", | ||
"@govuk-react/button": "^0.1.27", | ||
"@govuk-react/checkbox": "^0.1.27", | ||
"@govuk-react/date-input": "^0.1.27", | ||
"@govuk-react/error-text": "^0.1.27", | ||
"@govuk-react/file-upload": "^0.1.27", | ||
"@govuk-react/header": "^0.1.27", | ||
"@govuk-react/hint-text": "^0.1.27", | ||
"@govuk-react/input": "^0.1.27", | ||
"@govuk-react/input-field": "^0.1.27", | ||
"@govuk-react/label": "^0.1.27", | ||
"@govuk-react/label-text": "^0.1.27", | ||
"@govuk-react/list-item": "^0.1.27", | ||
"@govuk-react/list-navigation": "^0.1.27", | ||
"@govuk-react/multi-choice": "^0.1.27", | ||
"@govuk-react/ordered-list": "^0.1.27", | ||
"@govuk-react/pagination": "^0.1.27", | ||
"@govuk-react/panel": "^0.1.27", | ||
"@govuk-react/phase-badge": "^0.1.27", | ||
"@govuk-react/phase-banner": "^0.1.27", | ||
"@govuk-react/radio": "^0.1.27", | ||
"@govuk-react/related-items": "^0.1.27", | ||
"@govuk-react/search-box": "^0.1.27", | ||
"@govuk-react/select": "^0.1.27", | ||
"@govuk-react/text-area": "^0.1.27", | ||
"@govuk-react/unordered-list": "^0.1.27", | ||
"@storybook/addon-actions": "^3.3.14", | ||
"@storybook/addon-knobs": "^3.4.0", | ||
"@storybook/react": "^3.3.14", | ||
"cross-env": "^5.1.4", | ||
"enzyme": "^3.3.0", | ||
"react-dom": "^16.2.0", | ||
"react-router-dom": "^4.2.2", | ||
"rimraf": "^2.6.2" | ||
}, | ||
"scripts": { | ||
@@ -54,0 +16,0 @@ "build": "npm run build:lib && npm run build:es", |
export { default as asAnchor } from './asAnchor'; | ||
export { default as asPaginationItem } from './asPaginationItem'; | ||
export { default as withWhiteSpace } from './withWhiteSpace'; |
@@ -1,2 +0,1 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
@@ -7,10 +6,3 @@ import glamorous from 'glamorous'; | ||
const withWhiteSpace = config => (Component) => { | ||
const Whitespace = props => <Component {...props}>{props.children}</Component>; | ||
Whitespace.propTypes = { | ||
children: PropTypes.oneOfType([PropTypes.string, PropTypes.element]) | ||
.isRequired, | ||
}; | ||
const StyledHoc = glamorous(Whitespace)(({ | ||
const StyledHoc = glamorous(Component)(({ | ||
mb: marginBottom = config.marginBottom, | ||
@@ -17,0 +9,0 @@ }) => ({ |
@@ -74,3 +74,3 @@ import React from 'react'; | ||
stories.add('with spacing size 2', () => ( | ||
stories.add('with various spacing sizes', () => ( | ||
<React.Fragment> | ||
@@ -103,12 +103,12 @@ <InputFieldWithWhiteSpace mb={number('marginBottom1', 1)} name="group1" hint="hi">Example 1</InputFieldWithWhiteSpace> | ||
<ListNavigationWithWhiteSpace mb={number('ListNavigation marginBottom', 9)}>ListNavigation Example</ListNavigationWithWhiteSpace> | ||
<MultiChoiceWithWhiteSpace mb={number('MultiChoice marginBottom', 9)}>MultiChoice Example</MultiChoiceWithWhiteSpace> | ||
<MultiChoiceWithWhiteSpace label="example" mb={number('MultiChoice marginBottom', 9)}>MultiChoice Example</MultiChoiceWithWhiteSpace> | ||
<OrderedListWithWhiteSpace mb={number('OrderedList marginBottom', 9)}>OrderedList Example</OrderedListWithWhiteSpace> | ||
<PaginationWithWhiteSpace mb={number('Pagination marginBottom', 9)}>Pagination Example</PaginationWithWhiteSpace> | ||
<PanelWithWhiteSpace mb={number('Panel marginBottom', 9)}>Panel Example</PanelWithWhiteSpace> | ||
<PhaseBadgeWithWhiteSpace mb={number('PhaseBadge marginBottom', 9)}>PhaseBadge Example</PhaseBadgeWithWhiteSpace> | ||
<PhaseBannerWithWhiteSpace mb={number('PhaseBanner marginBottom', 9)}>PhaseBanner Example</PhaseBannerWithWhiteSpace> | ||
<PanelWithWhiteSpace panelTitle="Example" mb={number('Panel marginBottom', 9)}>Panel Example</PanelWithWhiteSpace> | ||
<PhaseBadgeWithWhiteSpace mb={number('PhaseBadge marginBottom', 9)}>PhaseBadge</PhaseBadgeWithWhiteSpace> | ||
<PhaseBannerWithWhiteSpace level="EXAMPLE" mb={number('PhaseBanner marginBottom', 9)}>PhaseBanner Example</PhaseBannerWithWhiteSpace> | ||
<RadioWithWhiteSpace mb={number('Radio marginBottom', 9)}>Radio Example</RadioWithWhiteSpace> | ||
<RelatedItemsWithWhiteSpace mb={number('RelatedItems marginBottom', 9)}>RelatedItems Example</RelatedItemsWithWhiteSpace> | ||
<SearchBoxWithWhiteSpace mb={number('SearchBox marginBottom', 9)}>SearchBox Example</SearchBoxWithWhiteSpace> | ||
<SelectWithWhiteSpace mb={number('Select marginBottom', 9)}>Select Example</SelectWithWhiteSpace> | ||
<SelectWithWhiteSpace label="example" mb={number('Select marginBottom', 9)}>Select Example</SelectWithWhiteSpace> | ||
<TextAreaWithWhiteSpace mb={number('TextArea marginBottom', 9)}>TextArea Example</TextAreaWithWhiteSpace> | ||
@@ -115,0 +115,0 @@ <UnorderedListWithWhiteSpace mb={number('UnorderedList marginBottom', 9)}>UnorderedList Example</UnorderedListWithWhiteSpace> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
0
5
135279
1533
Updated@govuk-react/icons@^0.1.28