@automattic/vip-design-system 0.9.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,7 +19,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
19
19
 
20
20
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
21
21
 
22
- var CardComponent = function CardComponent(_ref, ref) {
22
+ var Card = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
23
23
  var _ref$variant = _ref.variant,
24
24
  variant = _ref$variant === void 0 ? 'primary' : _ref$variant,
25
25
  _ref$sx = _ref.sx,
@@ -34,13 +34,11 @@ var CardComponent = function CardComponent(_ref, ref) {
34
34
  overflow: 'hidden'
35
35
  }, sx)
36
36
  }, props));
37
- };
37
+ });
38
38
 
39
- CardComponent.propTypes = {
39
+ exports.Card = Card;
40
+ Card.propTypes = {
40
41
  variant: _propTypes["default"].string,
41
42
  sx: _propTypes["default"].object
42
43
  };
43
-
44
- var Card = /*#__PURE__*/_react["default"].forwardRef(CardComponent);
45
-
46
- exports.Card = Card;
44
+ Card.displayName = 'Card';
@@ -19,7 +19,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
19
19
 
20
20
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
21
21
 
22
- var InputComponent = function InputComponent(_ref, ref) {
22
+ var Input = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
23
23
  var variant = _ref.variant,
24
24
  label = _ref.label,
25
25
  forLabel = _ref.forLabel,
@@ -64,9 +64,10 @@ var InputComponent = function InputComponent(_ref, ref) {
64
64
  children: errorMessage
65
65
  })]
66
66
  });
67
- };
67
+ });
68
68
 
69
- InputComponent.propTypes = {
69
+ exports.Input = Input;
70
+ Input.propTypes = {
70
71
  variant: _propTypes["default"].string,
71
72
  label: _propTypes["default"].string,
72
73
  hasError: _propTypes["default"].bool,
@@ -74,7 +75,4 @@ InputComponent.propTypes = {
74
75
  forLabel: _propTypes["default"].string,
75
76
  errorMessage: _propTypes["default"].string
76
77
  };
77
-
78
- var Input = /*#__PURE__*/_react["default"].forwardRef(InputComponent);
79
-
80
- exports.Input = Input;
78
+ Input.displayName = 'Input';
@@ -19,7 +19,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
19
19
 
20
20
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
21
21
 
22
- var TextareaComponent = function TextareaComponent(_ref, ref) {
22
+ var Textarea = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
23
23
  var variant = _ref.variant,
24
24
  label = _ref.label,
25
25
  forLabel = _ref.forLabel,
@@ -59,9 +59,10 @@ var TextareaComponent = function TextareaComponent(_ref, ref) {
59
59
  children: errorMessage
60
60
  })]
61
61
  });
62
- };
62
+ });
63
63
 
64
- TextareaComponent.propTypes = {
64
+ exports.Textarea = Textarea;
65
+ Textarea.propTypes = {
65
66
  variant: _propTypes["default"].string,
66
67
  label: _propTypes["default"].string,
67
68
  hasError: _propTypes["default"].bool,
@@ -69,7 +70,4 @@ TextareaComponent.propTypes = {
69
70
  forLabel: _propTypes["default"].string,
70
71
  errorMessage: _propTypes["default"].string
71
72
  };
72
-
73
- var Textarea = /*#__PURE__*/_react["default"].forwardRef(TextareaComponent);
74
-
75
- exports.Textarea = Textarea;
73
+ Textarea.displayName = 'Textarea';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/vip-design-system",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "main": "build/system/index.js",
5
5
  "scripts": {
6
6
  "build-storybook": "build-storybook",
@@ -11,24 +11,26 @@ import PropTypes from 'prop-types';
11
11
  */
12
12
  import { Box } from '..';
13
13
 
14
- const CardComponent = ( { variant = 'primary', sx = {}, ...props }, ref ) => (
15
- <Box
16
- ref={ref}
17
- sx={{
18
- // pass variant prop to sx
19
- variant: `cards.${ variant }`,
20
- overflow: 'hidden',
21
- ...sx,
22
- }}
23
- {...props}
24
- />
25
- );
14
+ const Card = React.forwardRef( ( { variant = 'primary', sx = {}, ...props }, ref ) => {
15
+ return (
16
+ <Box
17
+ ref={ref}
18
+ sx={{
19
+ // pass variant prop to sx
20
+ variant: `cards.${ variant }`,
21
+ overflow: 'hidden',
22
+ ...sx,
23
+ }}
24
+ {...props}
25
+ />
26
+ );
27
+ } );
26
28
 
27
- CardComponent.propTypes = {
29
+ Card.propTypes = {
28
30
  variant: PropTypes.string,
29
31
  sx: PropTypes.object,
30
32
  };
31
33
 
32
- const Card = React.forwardRef( CardComponent );
34
+ Card.displayName = 'Card';
33
35
 
34
36
  export { Card };
@@ -11,7 +11,7 @@ import PropTypes from 'prop-types';
11
11
  */
12
12
  import { Validation, Label } from '../';
13
13
 
14
- const InputComponent = ( { variant, label, forLabel, hasError, required, errorMessage, ...props }, ref ) => (
14
+ const Input = React.forwardRef( ( { variant, label, forLabel, hasError, required, errorMessage, ...props }, ref ) => (
15
15
  <React.Fragment>
16
16
  { label &&
17
17
  <Label htmlFor={ forLabel }>
@@ -55,9 +55,9 @@ const InputComponent = ( { variant, label, forLabel, hasError, required, errorMe
55
55
  <Validation>{ errorMessage }</Validation>
56
56
  }
57
57
  </React.Fragment>
58
- );
58
+ ) );
59
59
 
60
- InputComponent.propTypes = {
60
+ Input.propTypes = {
61
61
  variant: PropTypes.string,
62
62
  label: PropTypes.string,
63
63
  hasError: PropTypes.bool,
@@ -66,6 +66,6 @@ InputComponent.propTypes = {
66
66
  errorMessage: PropTypes.string,
67
67
  };
68
68
 
69
- const Input = React.forwardRef( InputComponent );
69
+ Input.displayName = 'Input';
70
70
 
71
71
  export { Input };
@@ -11,7 +11,7 @@ import PropTypes from 'prop-types';
11
11
  */
12
12
  import { Validation, Label } from '../';
13
13
 
14
- const TextareaComponent = ( { variant, label, forLabel, hasError, required, errorMessage, ...props }, ref ) => (
14
+ const Textarea = React.forwardRef( ( { variant, label, forLabel, hasError, required, errorMessage, ...props }, ref ) => (
15
15
  <React.Fragment>
16
16
  { label &&
17
17
  <Label htmlFor={ forLabel }>
@@ -50,9 +50,9 @@ const TextareaComponent = ( { variant, label, forLabel, hasError, required, erro
50
50
  <Validation>{ errorMessage }</Validation>
51
51
  }
52
52
  </React.Fragment>
53
- );
53
+ ) );
54
54
 
55
- TextareaComponent.propTypes = {
55
+ Textarea.propTypes = {
56
56
  variant: PropTypes.string,
57
57
  label: PropTypes.string,
58
58
  hasError: PropTypes.bool,
@@ -61,6 +61,6 @@ TextareaComponent.propTypes = {
61
61
  errorMessage: PropTypes.string,
62
62
  };
63
63
 
64
- const Textarea = React.forwardRef( TextareaComponent );
64
+ Textarea.displayName = 'Textarea';
65
65
 
66
66
  export { Textarea };