@pareto-engineering/design-system 2.0.0-alpha.38 → 2.0.0-alpha.40

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.
@@ -22,18 +22,29 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
22
22
  // Local Definitions
23
23
  var baseClassName = _bem.default.base;
24
24
  var componentClassName = 'logo';
25
- var defaultTargets = [{
25
+ var defaultTargetssquare = [{
26
+ id: 'logo',
27
+ target: 'logo'
28
+ }];
29
+ var contentMapSquare = {
30
+ default: {
31
+ sprite: '/logo_square.svg',
32
+ viewBox: '0 0 39 39',
33
+ targets: defaultTargetssquare
34
+ }
35
+ };
36
+ var defaultTargetsWithName = [{
26
37
  id: 'logo_squares',
27
38
  target: 'logo_squares'
28
39
  }, {
29
40
  id: 'logo_pareto',
30
41
  target: 'logo_pareto'
31
42
  }];
32
- var contentMap = {
43
+ var contentMapWithName = {
33
44
  default: {
34
45
  sprite: '/logo.svg',
35
46
  viewBox: '0 0 156 30',
36
- targets: defaultTargets
47
+ targets: defaultTargetsWithName
37
48
  }
38
49
  };
39
50
  /**
@@ -49,12 +60,14 @@ var Logo = _ref => {
49
60
  height,
50
61
  width,
51
62
  variant,
52
- strokeColor // ...otherProps
63
+ strokeColor,
64
+ square // ...otherProps
53
65
 
54
66
  } = _ref;
55
67
  (0, React.useLayoutEffect)(() => {
56
68
  Promise.resolve().then(() => _interopRequireWildcard(require("./styles.scss")));
57
69
  }, []);
70
+ var contentMap = square ? contentMapSquare : contentMapWithName;
58
71
  var svgConfig = (0, React.useMemo)(() => contentMap[variant], [variant]);
59
72
  return /*#__PURE__*/React.createElement(_a.SVG, {
60
73
  height: height,
@@ -108,13 +121,19 @@ Logo.propTypes = {
108
121
  /**
109
122
  * The color of the svg stroke
110
123
  */
111
- strokeColor: _propTypes.default.string
124
+ strokeColor: _propTypes.default.string,
125
+
126
+ /**
127
+ * Whether the logo should have a name.
128
+ */
129
+ square: _propTypes.default.bool
112
130
  };
113
131
  Logo.defaultProps = {
114
132
  color: 'paragraph',
115
133
  height: '2em',
116
134
  variant: 'default',
117
- strokeColor: 'transparent'
135
+ strokeColor: 'transparent',
136
+ square: false
118
137
  };
119
138
  var _default = Logo;
120
139
  exports.default = _default;
@@ -13,6 +13,8 @@ var _bem = _interopRequireDefault(require("@pareto-engineering/bem"));
13
13
 
14
14
  var _common = require("./common");
15
15
 
16
+ var _common2 = require("../../common");
17
+
16
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
19
 
18
20
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -33,9 +35,12 @@ var RatingsInput = _ref => {
33
35
  name,
34
36
  ratingCount,
35
37
  showRatingValue,
38
+ oneInputLabel,
39
+ label,
36
40
  labelMax,
37
41
  labelMin,
38
- displayRatingsLabel // ...otherProps
42
+ displayRatingsLabel,
43
+ optional // ...otherProps
39
44
 
40
45
  } = _ref;
41
46
  (0, React.useLayoutEffect)(() => {
@@ -45,8 +50,13 @@ var RatingsInput = _ref => {
45
50
  return /*#__PURE__*/React.createElement("div", {
46
51
  id: id,
47
52
  className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
48
- style: style // {...otherProps}
49
-
53
+ style: style
54
+ }, /*#__PURE__*/React.createElement(_common2.FormLabel, {
55
+ className: ['input-label', oneInputLabel ? 'md-s2 s0 v1 mb-v' : 'v50 mb-v'].filter(e => e).join(' '),
56
+ name: name,
57
+ optional: optional
58
+ }, label), /*#__PURE__*/React.createElement("div", {
59
+ className: "stars"
50
60
  }, displayRatingsLabel && /*#__PURE__*/React.createElement("p", {
51
61
  className: "label-text md-s-1 s-2 x-metadata c-x"
52
62
  }, labelMin), [...Array(ratingCount)].map((_, index) => {
@@ -62,7 +72,7 @@ var RatingsInput = _ref => {
62
72
  });
63
73
  }), displayRatingsLabel && /*#__PURE__*/React.createElement("p", {
64
74
  className: "label-text md-s-1 s-2 x-metadata c-x"
65
- }, labelMax));
75
+ }, labelMax)));
66
76
  };
67
77
 
68
78
  RatingsInput.propTypes = {
@@ -96,6 +106,11 @@ RatingsInput.propTypes = {
96
106
  */
97
107
  showRatingValue: _propTypes.default.bool,
98
108
 
109
+ /**
110
+ * The label of the ratings input
111
+ */
112
+ label: _propTypes.default.string.isRequired,
113
+
99
114
  /**
100
115
  * description for the highest rating value
101
116
  */
@@ -109,7 +124,17 @@ RatingsInput.propTypes = {
109
124
  /**
110
125
  * If the rating lables should be shown
111
126
  */
112
- displayRatingsLabel: _propTypes.default.bool
127
+ displayRatingsLabel: _propTypes.default.bool,
128
+
129
+ /**
130
+ * Whether the input is optional or not
131
+ */
132
+ optional: _propTypes.default.bool,
133
+
134
+ /**
135
+ * If the slide will only have one input
136
+ */
137
+ oneInputLabel: _propTypes.default.bool
113
138
  };
114
139
  RatingsInput.defaultProps = {
115
140
  labelMin: 'not satisfied.',
@@ -7,34 +7,43 @@ $default-transition: all .2s;
7
7
 
8
8
  .#{bem.$base}.ratings-input {
9
9
  display: flex;
10
+ flex-direction: column;
10
11
 
11
- >:not(:last-child) {
12
- margin-right: $default-rating-icon-margin;
12
+ p {
13
+ padding: $default-padding;
13
14
  }
14
15
 
15
- .#{bem.$base}.rating {
16
+ .stars {
16
17
  display: flex;
17
18
 
18
- input {
19
- opacity: 0;
20
- position: absolute;
21
- visibility: none;
22
- z-index: -1;
19
+ >:not(:last-child) {
20
+ margin-right: $default-rating-icon-margin;
23
21
  }
24
-
25
- label {
22
+
23
+ .#{bem.$base}.rating {
26
24
  display: flex;
27
- flex-direction: column;
28
- align-items: center;
29
- padding: $default-padding;
30
- transition: $default-transition;
31
- cursor: pointer;
25
+
26
+ input {
27
+ opacity: 0;
28
+ position: absolute;
29
+ visibility: none;
30
+ z-index: -1;
31
+ }
32
+
33
+ label {
34
+ display: flex;
35
+ flex-direction: column;
36
+ align-items: center;
37
+ padding: $default-padding;
38
+ transition: $default-transition;
39
+ cursor: pointer;
40
+ }
41
+ }
42
+
43
+ .label-text {
44
+ margin-bottom: 0;
45
+ align-self: flex-end;
32
46
  }
33
- }
34
-
35
- .label-text {
36
- margin-bottom: 0;
37
- align-self: flex-end;
38
47
  }
39
48
  }
40
49
 
@@ -7,18 +7,29 @@ import { SVG } from "../../a"; // Local Definitions
7
7
 
8
8
  const baseClassName = styleNames.base;
9
9
  const componentClassName = 'logo';
10
- const defaultTargets = [{
10
+ const defaultTargetssquare = [{
11
+ id: 'logo',
12
+ target: 'logo'
13
+ }];
14
+ const contentMapSquare = {
15
+ default: {
16
+ sprite: '/logo_square.svg',
17
+ viewBox: '0 0 39 39',
18
+ targets: defaultTargetssquare
19
+ }
20
+ };
21
+ const defaultTargetsWithName = [{
11
22
  id: 'logo_squares',
12
23
  target: 'logo_squares'
13
24
  }, {
14
25
  id: 'logo_pareto',
15
26
  target: 'logo_pareto'
16
27
  }];
17
- const contentMap = {
28
+ const contentMapWithName = {
18
29
  default: {
19
30
  sprite: '/logo.svg',
20
31
  viewBox: '0 0 156 30',
21
- targets: defaultTargets
32
+ targets: defaultTargetsWithName
22
33
  }
23
34
  };
24
35
  /**
@@ -33,12 +44,14 @@ const Logo = ({
33
44
  height,
34
45
  width,
35
46
  variant,
36
- strokeColor // ...otherProps
47
+ strokeColor,
48
+ square // ...otherProps
37
49
 
38
50
  }) => {
39
51
  useLayoutEffect(() => {
40
52
  import("./styles.scss");
41
53
  }, []);
54
+ const contentMap = square ? contentMapSquare : contentMapWithName;
42
55
  const svgConfig = useMemo(() => contentMap[variant], [variant]);
43
56
  return /*#__PURE__*/React.createElement(SVG, {
44
57
  height: height,
@@ -92,12 +105,18 @@ Logo.propTypes = {
92
105
  /**
93
106
  * The color of the svg stroke
94
107
  */
95
- strokeColor: PropTypes.string
108
+ strokeColor: PropTypes.string,
109
+
110
+ /**
111
+ * Whether the logo should have a name.
112
+ */
113
+ square: PropTypes.bool
96
114
  };
97
115
  Logo.defaultProps = {
98
116
  color: 'paragraph',
99
117
  height: '2em',
100
118
  variant: 'default',
101
- strokeColor: 'transparent'
119
+ strokeColor: 'transparent',
120
+ square: false
102
121
  };
103
122
  export default Logo;
@@ -5,6 +5,7 @@ import PropTypes from 'prop-types';
5
5
  import styleNames from '@pareto-engineering/bem'; // Local Definitions
6
6
 
7
7
  import { Rating } from "./common";
8
+ import { FormLabel } from "../../common";
8
9
  const baseClassName = styleNames.base;
9
10
  const componentClassName = 'ratings-input';
10
11
  /**
@@ -18,9 +19,12 @@ const RatingsInput = ({
18
19
  name,
19
20
  ratingCount,
20
21
  showRatingValue,
22
+ oneInputLabel,
23
+ label,
21
24
  labelMax,
22
25
  labelMin,
23
- displayRatingsLabel // ...otherProps
26
+ displayRatingsLabel,
27
+ optional // ...otherProps
24
28
 
25
29
  }) => {
26
30
  useLayoutEffect(() => {
@@ -30,8 +34,13 @@ const RatingsInput = ({
30
34
  return /*#__PURE__*/React.createElement("div", {
31
35
  id: id,
32
36
  className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
33
- style: style // {...otherProps}
34
-
37
+ style: style
38
+ }, /*#__PURE__*/React.createElement(FormLabel, {
39
+ className: ['input-label', oneInputLabel ? 'md-s2 s0 v1 mb-v' : 'v50 mb-v'].filter(e => e).join(' '),
40
+ name: name,
41
+ optional: optional
42
+ }, label), /*#__PURE__*/React.createElement("div", {
43
+ className: "stars"
35
44
  }, displayRatingsLabel && /*#__PURE__*/React.createElement("p", {
36
45
  className: "label-text md-s-1 s-2 x-metadata c-x"
37
46
  }, labelMin), [...Array(ratingCount)].map((_, index) => {
@@ -47,7 +56,7 @@ const RatingsInput = ({
47
56
  });
48
57
  }), displayRatingsLabel && /*#__PURE__*/React.createElement("p", {
49
58
  className: "label-text md-s-1 s-2 x-metadata c-x"
50
- }, labelMax));
59
+ }, labelMax)));
51
60
  };
52
61
 
53
62
  RatingsInput.propTypes = {
@@ -81,6 +90,11 @@ RatingsInput.propTypes = {
81
90
  */
82
91
  showRatingValue: PropTypes.bool,
83
92
 
93
+ /**
94
+ * The label of the ratings input
95
+ */
96
+ label: PropTypes.string.isRequired,
97
+
84
98
  /**
85
99
  * description for the highest rating value
86
100
  */
@@ -94,7 +108,17 @@ RatingsInput.propTypes = {
94
108
  /**
95
109
  * If the rating lables should be shown
96
110
  */
97
- displayRatingsLabel: PropTypes.bool
111
+ displayRatingsLabel: PropTypes.bool,
112
+
113
+ /**
114
+ * Whether the input is optional or not
115
+ */
116
+ optional: PropTypes.bool,
117
+
118
+ /**
119
+ * If the slide will only have one input
120
+ */
121
+ oneInputLabel: PropTypes.bool
98
122
  };
99
123
  RatingsInput.defaultProps = {
100
124
  labelMin: 'not satisfied.',
@@ -7,34 +7,43 @@ $default-transition: all .2s;
7
7
 
8
8
  .#{bem.$base}.ratings-input {
9
9
  display: flex;
10
+ flex-direction: column;
10
11
 
11
- >:not(:last-child) {
12
- margin-right: $default-rating-icon-margin;
12
+ p {
13
+ padding: $default-padding;
13
14
  }
14
15
 
15
- .#{bem.$base}.rating {
16
+ .stars {
16
17
  display: flex;
17
18
 
18
- input {
19
- opacity: 0;
20
- position: absolute;
21
- visibility: none;
22
- z-index: -1;
19
+ >:not(:last-child) {
20
+ margin-right: $default-rating-icon-margin;
23
21
  }
24
-
25
- label {
22
+
23
+ .#{bem.$base}.rating {
26
24
  display: flex;
27
- flex-direction: column;
28
- align-items: center;
29
- padding: $default-padding;
30
- transition: $default-transition;
31
- cursor: pointer;
25
+
26
+ input {
27
+ opacity: 0;
28
+ position: absolute;
29
+ visibility: none;
30
+ z-index: -1;
31
+ }
32
+
33
+ label {
34
+ display: flex;
35
+ flex-direction: column;
36
+ align-items: center;
37
+ padding: $default-padding;
38
+ transition: $default-transition;
39
+ cursor: pointer;
40
+ }
41
+ }
42
+
43
+ .label-text {
44
+ margin-bottom: 0;
45
+ align-self: flex-end;
32
46
  }
33
- }
34
-
35
- .label-text {
36
- margin-bottom: 0;
37
- align-self: flex-end;
38
47
  }
39
48
  }
40
49
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pareto-engineering/design-system",
3
- "version": "2.0.0-alpha.38",
3
+ "version": "2.0.0-alpha.40",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/es/index.js",
@@ -79,7 +79,7 @@
79
79
  "stylelint-config-palantir": "^5.1.0"
80
80
  },
81
81
  "dependencies": {
82
- "@pareto-engineering/assets": "^2.0.0-alpha.16",
82
+ "@pareto-engineering/assets": "^2.0.0-alpha.18",
83
83
  "@pareto-engineering/bem": "^0.1.5",
84
84
  "@pareto-engineering/styles": "^2.0.0-alpha.8",
85
85
  "date-fns": "^2.22.1",