@pareto-engineering/design-system 2.0.0-alpha.11 → 2.0.0-alpha.12
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.
- package/dist/cjs/a/BackgroundGradient/BackgroundGradient.js +77 -0
- package/dist/cjs/a/BackgroundGradient/index.js +15 -0
- package/dist/cjs/a/BackgroundGradient/styles.scss +18 -0
- package/dist/cjs/a/Shapes/Shapes.js +9 -1
- package/dist/cjs/a/Shapes/styles.scss +35 -1
- package/dist/cjs/a/index.js +9 -1
- package/dist/cjs/b/Page/common/Section/Section.js +1 -1
- package/dist/es/a/BackgroundGradient/BackgroundGradient.js +55 -0
- package/dist/es/a/BackgroundGradient/index.js +2 -0
- package/dist/es/a/BackgroundGradient/styles.scss +18 -0
- package/dist/es/a/Shapes/Shapes.js +9 -1
- package/dist/es/a/Shapes/styles.scss +35 -1
- package/dist/es/a/index.js +2 -1
- package/dist/es/b/Page/common/Section/Section.js +1 -1
- package/package.json +1 -1
- package/src/__snapshots__/Storyshots.test.js.snap +86 -0
- package/src/stories/a/BackgroundGradient.stories.jsx +40 -0
- package/src/stories/a/Shapes.stories.jsx +18 -0
- package/src/ui/a/BackgroundGradient/BackgroundGradient.jsx +76 -0
- package/src/ui/a/BackgroundGradient/index.js +2 -0
- package/src/ui/a/BackgroundGradient/styles.scss +18 -0
- package/src/ui/a/Shapes/Shapes.jsx +10 -0
- package/src/ui/a/Shapes/styles.scss +35 -1
- package/src/ui/a/index.js +1 -0
- package/src/ui/b/Page/common/Section/Section.jsx +1 -1
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var _bem = _interopRequireDefault(require("@pareto-engineering/bem"));
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
17
|
+
|
|
18
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
19
|
+
|
|
20
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
21
|
+
|
|
22
|
+
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); }
|
|
23
|
+
|
|
24
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
|
+
|
|
26
|
+
// Local Definitions
|
|
27
|
+
var baseClassName = _bem.default.base;
|
|
28
|
+
var componentClassName = 'background-gradient';
|
|
29
|
+
/**
|
|
30
|
+
* This is the component description.
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
var BackgroundGradient = _ref => {
|
|
34
|
+
var {
|
|
35
|
+
id,
|
|
36
|
+
className: userClassName,
|
|
37
|
+
style,
|
|
38
|
+
height // ...otherProps
|
|
39
|
+
|
|
40
|
+
} = _ref;
|
|
41
|
+
(0, React.useLayoutEffect)(() => {
|
|
42
|
+
Promise.resolve().then(() => _interopRequireWildcard(require("./styles.scss")));
|
|
43
|
+
}, []);
|
|
44
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
45
|
+
id: id,
|
|
46
|
+
className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
|
|
47
|
+
style: _objectSpread(_objectSpread({}, style), {}, {
|
|
48
|
+
'--gradient-height': height
|
|
49
|
+
})
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
BackgroundGradient.propTypes = {
|
|
54
|
+
/**
|
|
55
|
+
* The HTML id for this element
|
|
56
|
+
*/
|
|
57
|
+
id: _propTypes.default.string,
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* The HTML class names for this element
|
|
61
|
+
*/
|
|
62
|
+
className: _propTypes.default.string,
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The React-written, css properties for this element.
|
|
66
|
+
*/
|
|
67
|
+
style: _propTypes.default.objectOf(_propTypes.default.string),
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* The height of the shape.
|
|
71
|
+
*/
|
|
72
|
+
height: _propTypes.default.string
|
|
73
|
+
};
|
|
74
|
+
BackgroundGradient.defaultProps = {// someProp: false,
|
|
75
|
+
};
|
|
76
|
+
var _default = BackgroundGradient;
|
|
77
|
+
exports.default = _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "BackgroundGradient", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _BackgroundGradient.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
var _BackgroundGradient = _interopRequireDefault(require("./BackgroundGradient"));
|
|
14
|
+
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
@use "@pareto-engineering/bem";
|
|
3
|
+
|
|
4
|
+
.#{bem.$base}.background-gradient{
|
|
5
|
+
position: absolute;
|
|
6
|
+
top: 0;
|
|
7
|
+
left: 0;
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
justify-content: var(--vertical-align);
|
|
11
|
+
width: 100%;
|
|
12
|
+
height: var(--gradient-height);
|
|
13
|
+
background-image: linear-gradient(transparent, var(--y) 25%, var(--light-y) 75%, transparent);
|
|
14
|
+
opacity: .8;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
@@ -57,6 +57,8 @@ var Shapes = _ref => {
|
|
|
57
57
|
|
|
58
58
|
}, shape === 'triangle' && /*#__PURE__*/React.createElement("div", {
|
|
59
59
|
className: "triangle"
|
|
60
|
+
}), shape === 'inverted-triangle' && /*#__PURE__*/React.createElement("div", {
|
|
61
|
+
className: "inverted-triangle"
|
|
60
62
|
}), shape === 'half-ellipses' && /*#__PURE__*/React.createElement("div", {
|
|
61
63
|
className: "half-ellipses"
|
|
62
64
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -109,6 +111,12 @@ var Shapes = _ref => {
|
|
|
109
111
|
className: "ellipse-one"
|
|
110
112
|
}), /*#__PURE__*/React.createElement("div", {
|
|
111
113
|
className: "ellipse-two"
|
|
114
|
+
})), shape === 'intersecting-circles' && /*#__PURE__*/React.createElement("div", {
|
|
115
|
+
className: "intersecting-circles"
|
|
116
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
117
|
+
className: "left"
|
|
118
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
119
|
+
className: "right"
|
|
112
120
|
})));
|
|
113
121
|
};
|
|
114
122
|
|
|
@@ -146,7 +154,7 @@ Shapes.propTypes = {
|
|
|
146
154
|
/**
|
|
147
155
|
* The options of a shape to use
|
|
148
156
|
*/
|
|
149
|
-
shape: _propTypes.default.oneOf(['triangle', 'ellipse', 'half-ellipse', 'half-ellipses', 'spiral', 'diamonds', 'circle', 'half-circle', 'ellipses', 'rectangles', 'rotated-ellipses']),
|
|
157
|
+
shape: _propTypes.default.oneOf(['triangle', 'ellipse', 'half-ellipse', 'half-ellipses', 'spiral', 'diamonds', 'circle', 'half-circle', 'ellipses', 'rectangles', 'rotated-ellipses', 'inverted-triangle', 'intersecting-circles']),
|
|
150
158
|
|
|
151
159
|
/**
|
|
152
160
|
* The overflow of the shape.
|
|
@@ -29,6 +29,14 @@ $default-shapes-opacity:.8;
|
|
|
29
29
|
width: var(--shape-height, #{$default-triangle-height});
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
.inverted-triangle {
|
|
33
|
+
background-image: linear-gradient(var(--dark-y), transparent);
|
|
34
|
+
clip-path: polygon(50% 0, 0 100%, 100% 100%);
|
|
35
|
+
height: calc(var(--shape-height, #{$default-triangle-height}) * 0.86);
|
|
36
|
+
opacity: $default-shapes-opacity;
|
|
37
|
+
width: var(--shape-height, #{$default-triangle-height});
|
|
38
|
+
}
|
|
39
|
+
|
|
32
40
|
.half-ellipses {
|
|
33
41
|
height: var(--shape-height, #{$default-ellipse-height});
|
|
34
42
|
opacity: $default-shapes-opacity;
|
|
@@ -218,4 +226,30 @@ $default-shapes-opacity:.8;
|
|
|
218
226
|
clip-path: ellipse(50% 35% at 50% 50%);
|
|
219
227
|
}
|
|
220
228
|
}
|
|
221
|
-
|
|
229
|
+
|
|
230
|
+
.intersecting-circles {
|
|
231
|
+
height: var(--shape-height, #{$default-circle-height});
|
|
232
|
+
opacity: $default-shapes-opacity;
|
|
233
|
+
width: calc(var(--shape-height, #{$default-circle-height}) * 2);
|
|
234
|
+
display: grid;
|
|
235
|
+
grid-template-columns: repeat(7, 1fr);
|
|
236
|
+
position: relative;
|
|
237
|
+
|
|
238
|
+
> * {
|
|
239
|
+
border-radius: 50%;
|
|
240
|
+
height: 100%;
|
|
241
|
+
width: 100%;
|
|
242
|
+
position: absolute;
|
|
243
|
+
opacity: .8;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.left {
|
|
247
|
+
background-image: linear-gradient(to right ,var(--dark-y),var(--y), transparent);
|
|
248
|
+
grid-column: 1 / 5;
|
|
249
|
+
}
|
|
250
|
+
.right {
|
|
251
|
+
background-image: linear-gradient(to left, var(--dark-y), var(--y), transparent);
|
|
252
|
+
grid-column: 4 / 8;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
package/dist/cjs/a/index.js
CHANGED
|
@@ -153,6 +153,12 @@ Object.defineProperty(exports, "OvalIllustration", {
|
|
|
153
153
|
return _OvalIllustration.OvalIllustration;
|
|
154
154
|
}
|
|
155
155
|
});
|
|
156
|
+
Object.defineProperty(exports, "BackgroundGradient", {
|
|
157
|
+
enumerable: true,
|
|
158
|
+
get: function get() {
|
|
159
|
+
return _BackgroundGradient.BackgroundGradient;
|
|
160
|
+
}
|
|
161
|
+
});
|
|
156
162
|
|
|
157
163
|
var _SVG = require("./SVG");
|
|
158
164
|
|
|
@@ -196,4 +202,6 @@ var _Timestamp = require("./Timestamp");
|
|
|
196
202
|
|
|
197
203
|
var _Shapes = require("./Shapes");
|
|
198
204
|
|
|
199
|
-
var _OvalIllustration = require("./OvalIllustration");
|
|
205
|
+
var _OvalIllustration = require("./OvalIllustration");
|
|
206
|
+
|
|
207
|
+
var _BackgroundGradient = require("./BackgroundGradient");
|
|
@@ -57,7 +57,7 @@ var Section = _ref => {
|
|
|
57
57
|
}, otherProps), children, backgroundShape && /*#__PURE__*/React.createElement(_a.Shapes, {
|
|
58
58
|
verticalAlign: backgroundVerticalAlign,
|
|
59
59
|
horizontalAlign: backgroundHorizontalAlign,
|
|
60
|
-
|
|
60
|
+
overflow: backgroundOverflow,
|
|
61
61
|
height: backgroundHeight,
|
|
62
62
|
shape: backgroundShape
|
|
63
63
|
}));
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useLayoutEffect } from 'react';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import styleNames from '@pareto-engineering/bem'; // Local Definitions
|
|
6
|
+
|
|
7
|
+
const baseClassName = styleNames.base;
|
|
8
|
+
const componentClassName = 'background-gradient';
|
|
9
|
+
/**
|
|
10
|
+
* This is the component description.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const BackgroundGradient = ({
|
|
14
|
+
id,
|
|
15
|
+
className: userClassName,
|
|
16
|
+
style,
|
|
17
|
+
height // ...otherProps
|
|
18
|
+
|
|
19
|
+
}) => {
|
|
20
|
+
useLayoutEffect(() => {
|
|
21
|
+
import("./styles.scss");
|
|
22
|
+
}, []);
|
|
23
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
24
|
+
id: id,
|
|
25
|
+
className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
|
|
26
|
+
style: { ...style,
|
|
27
|
+
'--gradient-height': height
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
BackgroundGradient.propTypes = {
|
|
33
|
+
/**
|
|
34
|
+
* The HTML id for this element
|
|
35
|
+
*/
|
|
36
|
+
id: PropTypes.string,
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The HTML class names for this element
|
|
40
|
+
*/
|
|
41
|
+
className: PropTypes.string,
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* The React-written, css properties for this element.
|
|
45
|
+
*/
|
|
46
|
+
style: PropTypes.objectOf(PropTypes.string),
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The height of the shape.
|
|
50
|
+
*/
|
|
51
|
+
height: PropTypes.string
|
|
52
|
+
};
|
|
53
|
+
BackgroundGradient.defaultProps = {// someProp: false,
|
|
54
|
+
};
|
|
55
|
+
export default BackgroundGradient;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
@use "@pareto-engineering/bem";
|
|
3
|
+
|
|
4
|
+
.#{bem.$base}.background-gradient{
|
|
5
|
+
position: absolute;
|
|
6
|
+
top: 0;
|
|
7
|
+
left: 0;
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
justify-content: var(--vertical-align);
|
|
11
|
+
width: 100%;
|
|
12
|
+
height: var(--gradient-height);
|
|
13
|
+
background-image: linear-gradient(transparent, var(--y) 25%, var(--light-y) 75%, transparent);
|
|
14
|
+
opacity: .8;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
@@ -36,6 +36,8 @@ const Shapes = ({
|
|
|
36
36
|
|
|
37
37
|
}, shape === 'triangle' && /*#__PURE__*/React.createElement("div", {
|
|
38
38
|
className: "triangle"
|
|
39
|
+
}), shape === 'inverted-triangle' && /*#__PURE__*/React.createElement("div", {
|
|
40
|
+
className: "inverted-triangle"
|
|
39
41
|
}), shape === 'half-ellipses' && /*#__PURE__*/React.createElement("div", {
|
|
40
42
|
className: "half-ellipses"
|
|
41
43
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -88,6 +90,12 @@ const Shapes = ({
|
|
|
88
90
|
className: "ellipse-one"
|
|
89
91
|
}), /*#__PURE__*/React.createElement("div", {
|
|
90
92
|
className: "ellipse-two"
|
|
93
|
+
})), shape === 'intersecting-circles' && /*#__PURE__*/React.createElement("div", {
|
|
94
|
+
className: "intersecting-circles"
|
|
95
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
96
|
+
className: "left"
|
|
97
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
98
|
+
className: "right"
|
|
91
99
|
})));
|
|
92
100
|
};
|
|
93
101
|
|
|
@@ -125,7 +133,7 @@ Shapes.propTypes = {
|
|
|
125
133
|
/**
|
|
126
134
|
* The options of a shape to use
|
|
127
135
|
*/
|
|
128
|
-
shape: PropTypes.oneOf(['triangle', 'ellipse', 'half-ellipse', 'half-ellipses', 'spiral', 'diamonds', 'circle', 'half-circle', 'ellipses', 'rectangles', 'rotated-ellipses']),
|
|
136
|
+
shape: PropTypes.oneOf(['triangle', 'ellipse', 'half-ellipse', 'half-ellipses', 'spiral', 'diamonds', 'circle', 'half-circle', 'ellipses', 'rectangles', 'rotated-ellipses', 'inverted-triangle', 'intersecting-circles']),
|
|
129
137
|
|
|
130
138
|
/**
|
|
131
139
|
* The overflow of the shape.
|
|
@@ -29,6 +29,14 @@ $default-shapes-opacity:.8;
|
|
|
29
29
|
width: var(--shape-height, #{$default-triangle-height});
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
.inverted-triangle {
|
|
33
|
+
background-image: linear-gradient(var(--dark-y), transparent);
|
|
34
|
+
clip-path: polygon(50% 0, 0 100%, 100% 100%);
|
|
35
|
+
height: calc(var(--shape-height, #{$default-triangle-height}) * 0.86);
|
|
36
|
+
opacity: $default-shapes-opacity;
|
|
37
|
+
width: var(--shape-height, #{$default-triangle-height});
|
|
38
|
+
}
|
|
39
|
+
|
|
32
40
|
.half-ellipses {
|
|
33
41
|
height: var(--shape-height, #{$default-ellipse-height});
|
|
34
42
|
opacity: $default-shapes-opacity;
|
|
@@ -218,4 +226,30 @@ $default-shapes-opacity:.8;
|
|
|
218
226
|
clip-path: ellipse(50% 35% at 50% 50%);
|
|
219
227
|
}
|
|
220
228
|
}
|
|
221
|
-
|
|
229
|
+
|
|
230
|
+
.intersecting-circles {
|
|
231
|
+
height: var(--shape-height, #{$default-circle-height});
|
|
232
|
+
opacity: $default-shapes-opacity;
|
|
233
|
+
width: calc(var(--shape-height, #{$default-circle-height}) * 2);
|
|
234
|
+
display: grid;
|
|
235
|
+
grid-template-columns: repeat(7, 1fr);
|
|
236
|
+
position: relative;
|
|
237
|
+
|
|
238
|
+
> * {
|
|
239
|
+
border-radius: 50%;
|
|
240
|
+
height: 100%;
|
|
241
|
+
width: 100%;
|
|
242
|
+
position: absolute;
|
|
243
|
+
opacity: .8;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.left {
|
|
247
|
+
background-image: linear-gradient(to right ,var(--dark-y),var(--y), transparent);
|
|
248
|
+
grid-column: 1 / 5;
|
|
249
|
+
}
|
|
250
|
+
.right {
|
|
251
|
+
background-image: linear-gradient(to left, var(--dark-y), var(--y), transparent);
|
|
252
|
+
grid-column: 4 / 8;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
package/dist/es/a/index.js
CHANGED
|
@@ -19,4 +19,5 @@ export { ContentCard } from "./ContentCard";
|
|
|
19
19
|
export { DotInfo } from "./DotInfo";
|
|
20
20
|
export { Timestamp } from "./Timestamp";
|
|
21
21
|
export { Shapes } from "./Shapes";
|
|
22
|
-
export { OvalIllustration } from "./OvalIllustration";
|
|
22
|
+
export { OvalIllustration } from "./OvalIllustration";
|
|
23
|
+
export { BackgroundGradient } from "./BackgroundGradient";
|
|
@@ -33,7 +33,7 @@ const Section = ({
|
|
|
33
33
|
}, otherProps), children, backgroundShape && /*#__PURE__*/React.createElement(Shapes, {
|
|
34
34
|
verticalAlign: backgroundVerticalAlign,
|
|
35
35
|
horizontalAlign: backgroundHorizontalAlign,
|
|
36
|
-
|
|
36
|
+
overflow: backgroundOverflow,
|
|
37
37
|
height: backgroundHeight,
|
|
38
38
|
shape: backgroundShape
|
|
39
39
|
}));
|
package/package.json
CHANGED
|
@@ -63,6 +63,27 @@ exports[`Storyshots a/AnimatedCounter Before And After 1`] = `
|
|
|
63
63
|
</div>
|
|
64
64
|
`;
|
|
65
65
|
|
|
66
|
+
exports[`Storyshots a/BackgroundGradient Base 1`] = `
|
|
67
|
+
<div
|
|
68
|
+
className="y-background4"
|
|
69
|
+
style={
|
|
70
|
+
Object {
|
|
71
|
+
"height": "700px",
|
|
72
|
+
"position": "relative",
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
>
|
|
76
|
+
<div
|
|
77
|
+
className="base background-gradient"
|
|
78
|
+
style={
|
|
79
|
+
Object {
|
|
80
|
+
"--gradient-height": "50em",
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/>
|
|
84
|
+
</div>
|
|
85
|
+
`;
|
|
86
|
+
|
|
66
87
|
exports[`Storyshots a/ContentCard Content After 1`] = `
|
|
67
88
|
<div
|
|
68
89
|
className="u1 p-u"
|
|
@@ -1442,6 +1463,71 @@ exports[`Storyshots a/Shapes Half Ellipses 1`] = `
|
|
|
1442
1463
|
</div>
|
|
1443
1464
|
`;
|
|
1444
1465
|
|
|
1466
|
+
exports[`Storyshots a/Shapes Intersecting Circles 1`] = `
|
|
1467
|
+
<div
|
|
1468
|
+
className="y-background5 b-light-y"
|
|
1469
|
+
style={
|
|
1470
|
+
Object {
|
|
1471
|
+
"height": "1000px",
|
|
1472
|
+
"overflow": "hidden",
|
|
1473
|
+
"position": "relative",
|
|
1474
|
+
}
|
|
1475
|
+
}
|
|
1476
|
+
>
|
|
1477
|
+
<div
|
|
1478
|
+
className="base shapes"
|
|
1479
|
+
style={
|
|
1480
|
+
Object {
|
|
1481
|
+
"--horizontal-align": "center",
|
|
1482
|
+
"--overflow": "hidden",
|
|
1483
|
+
"--shape-height": "30em",
|
|
1484
|
+
"--vertical-align": "center",
|
|
1485
|
+
}
|
|
1486
|
+
}
|
|
1487
|
+
>
|
|
1488
|
+
<div
|
|
1489
|
+
className="intersecting-circles"
|
|
1490
|
+
>
|
|
1491
|
+
<div
|
|
1492
|
+
className="left"
|
|
1493
|
+
/>
|
|
1494
|
+
<div
|
|
1495
|
+
className="right"
|
|
1496
|
+
/>
|
|
1497
|
+
</div>
|
|
1498
|
+
</div>
|
|
1499
|
+
</div>
|
|
1500
|
+
`;
|
|
1501
|
+
|
|
1502
|
+
exports[`Storyshots a/Shapes Inverted Triangle 1`] = `
|
|
1503
|
+
<div
|
|
1504
|
+
className="y-background6 b-light-y"
|
|
1505
|
+
style={
|
|
1506
|
+
Object {
|
|
1507
|
+
"height": "1000px",
|
|
1508
|
+
"overflow": "hidden",
|
|
1509
|
+
"position": "relative",
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
>
|
|
1513
|
+
<div
|
|
1514
|
+
className="base shapes"
|
|
1515
|
+
style={
|
|
1516
|
+
Object {
|
|
1517
|
+
"--horizontal-align": "center",
|
|
1518
|
+
"--overflow": "hidden",
|
|
1519
|
+
"--shape-height": "30em",
|
|
1520
|
+
"--vertical-align": "flex-end",
|
|
1521
|
+
}
|
|
1522
|
+
}
|
|
1523
|
+
>
|
|
1524
|
+
<div
|
|
1525
|
+
className="inverted-triangle"
|
|
1526
|
+
/>
|
|
1527
|
+
</div>
|
|
1528
|
+
</div>
|
|
1529
|
+
`;
|
|
1530
|
+
|
|
1445
1531
|
exports[`Storyshots a/Shapes Rectangles 1`] = `
|
|
1446
1532
|
<div
|
|
1447
1533
|
className="y-background5 b-light-y"
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
|
|
4
|
+
import { BackgroundGradient } from 'ui'
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title :'a/BackgroundGradient',
|
|
8
|
+
component :BackgroundGradient,
|
|
9
|
+
subcomponents:{
|
|
10
|
+
// Item:BackgroundGradient.Item
|
|
11
|
+
},
|
|
12
|
+
decorators:[
|
|
13
|
+
// storyfn => <div className="">{ storyfn() }</div>,
|
|
14
|
+
],
|
|
15
|
+
argTypes:{
|
|
16
|
+
verticalAlign:{ control: 'select' },
|
|
17
|
+
height :{ control: 'text' },
|
|
18
|
+
color :{ control: 'text' },
|
|
19
|
+
},
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// eslint-disable-next-line react/prop-types
|
|
23
|
+
const Template = ({ color, ...rest }) => (
|
|
24
|
+
<div
|
|
25
|
+
className={`y-${color}`}
|
|
26
|
+
style={{
|
|
27
|
+
position:'relative',
|
|
28
|
+
height :'700px',
|
|
29
|
+
}}
|
|
30
|
+
>
|
|
31
|
+
<BackgroundGradient {...rest} />
|
|
32
|
+
</div>
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
export const Base = Template.bind({})
|
|
36
|
+
Base.args = {
|
|
37
|
+
height :'50em',
|
|
38
|
+
verticalAlign:'center',
|
|
39
|
+
color :'background4',
|
|
40
|
+
}
|
|
@@ -42,6 +42,15 @@ Triangle.args = {
|
|
|
42
42
|
shape :'triangle',
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
export const InvertedTriangle = Template.bind({})
|
|
46
|
+
InvertedTriangle.args = {
|
|
47
|
+
height :'30em',
|
|
48
|
+
verticalAlign :'flex-end',
|
|
49
|
+
horizontalAlign:'center',
|
|
50
|
+
color :'background6',
|
|
51
|
+
shape :'inverted-triangle',
|
|
52
|
+
}
|
|
53
|
+
|
|
45
54
|
export const HalfEllipses = Template.bind({})
|
|
46
55
|
HalfEllipses.args = {
|
|
47
56
|
height :'25em',
|
|
@@ -123,3 +132,12 @@ RotatedEllipses.args = {
|
|
|
123
132
|
color :'background5',
|
|
124
133
|
shape :'rotated-ellipses',
|
|
125
134
|
}
|
|
135
|
+
|
|
136
|
+
export const IntersectingCircles = Template.bind({})
|
|
137
|
+
IntersectingCircles.args = {
|
|
138
|
+
height :'30em',
|
|
139
|
+
verticalAlign :'center',
|
|
140
|
+
horizontalAlign:'center',
|
|
141
|
+
color :'background5',
|
|
142
|
+
shape :'intersecting-circles',
|
|
143
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
|
|
4
|
+
import { useLayoutEffect } from 'react'
|
|
5
|
+
|
|
6
|
+
import PropTypes from 'prop-types'
|
|
7
|
+
|
|
8
|
+
import styleNames from '@pareto-engineering/bem'
|
|
9
|
+
|
|
10
|
+
// Local Definitions
|
|
11
|
+
|
|
12
|
+
const baseClassName = styleNames.base
|
|
13
|
+
|
|
14
|
+
const componentClassName = 'background-gradient'
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* This is the component description.
|
|
18
|
+
*/
|
|
19
|
+
const BackgroundGradient = ({
|
|
20
|
+
id,
|
|
21
|
+
className:userClassName,
|
|
22
|
+
style,
|
|
23
|
+
height,
|
|
24
|
+
// ...otherProps
|
|
25
|
+
}) => {
|
|
26
|
+
useLayoutEffect(() => {
|
|
27
|
+
import('./styles.scss')
|
|
28
|
+
}, [])
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<div
|
|
32
|
+
id={id}
|
|
33
|
+
className={[
|
|
34
|
+
|
|
35
|
+
baseClassName,
|
|
36
|
+
|
|
37
|
+
componentClassName,
|
|
38
|
+
userClassName,
|
|
39
|
+
]
|
|
40
|
+
.filter((e) => e)
|
|
41
|
+
.join(' ')}
|
|
42
|
+
style={{
|
|
43
|
+
...style,
|
|
44
|
+
'--gradient-height':height,
|
|
45
|
+
}}
|
|
46
|
+
/>
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
BackgroundGradient.propTypes = {
|
|
51
|
+
/**
|
|
52
|
+
* The HTML id for this element
|
|
53
|
+
*/
|
|
54
|
+
id:PropTypes.string,
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* The HTML class names for this element
|
|
58
|
+
*/
|
|
59
|
+
className:PropTypes.string,
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* The React-written, css properties for this element.
|
|
63
|
+
*/
|
|
64
|
+
style:PropTypes.objectOf(PropTypes.string),
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* The height of the shape.
|
|
68
|
+
*/
|
|
69
|
+
height:PropTypes.string,
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
BackgroundGradient.defaultProps = {
|
|
73
|
+
// someProp: false,
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export default BackgroundGradient
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
@use "@pareto-engineering/bem";
|
|
3
|
+
|
|
4
|
+
.#{bem.$base}.background-gradient{
|
|
5
|
+
position: absolute;
|
|
6
|
+
top: 0;
|
|
7
|
+
left: 0;
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
justify-content: var(--vertical-align);
|
|
11
|
+
width: 100%;
|
|
12
|
+
height: var(--gradient-height);
|
|
13
|
+
background-image: linear-gradient(transparent, var(--y) 25%, var(--light-y) 75%, transparent);
|
|
14
|
+
opacity: .8;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
@@ -54,6 +54,8 @@ const Shapes = ({
|
|
|
54
54
|
>
|
|
55
55
|
{ shape === 'triangle'
|
|
56
56
|
&& <div className="triangle" />}
|
|
57
|
+
{ shape === 'inverted-triangle'
|
|
58
|
+
&& <div className="inverted-triangle" />}
|
|
57
59
|
{ shape === 'half-ellipses'
|
|
58
60
|
&& (
|
|
59
61
|
<div className="half-ellipses">
|
|
@@ -105,6 +107,12 @@ const Shapes = ({
|
|
|
105
107
|
<div className="ellipse-two" />
|
|
106
108
|
</div>
|
|
107
109
|
)}
|
|
110
|
+
{shape === 'intersecting-circles' && (
|
|
111
|
+
<div className="intersecting-circles">
|
|
112
|
+
<div className="left" />
|
|
113
|
+
<div className="right" />
|
|
114
|
+
</div>
|
|
115
|
+
)}
|
|
108
116
|
</div>
|
|
109
117
|
)
|
|
110
118
|
}
|
|
@@ -163,6 +171,8 @@ Shapes.propTypes = {
|
|
|
163
171
|
'ellipses',
|
|
164
172
|
'rectangles',
|
|
165
173
|
'rotated-ellipses',
|
|
174
|
+
'inverted-triangle',
|
|
175
|
+
'intersecting-circles',
|
|
166
176
|
]),
|
|
167
177
|
|
|
168
178
|
/**
|
|
@@ -29,6 +29,14 @@ $default-shapes-opacity:.8;
|
|
|
29
29
|
width: var(--shape-height, #{$default-triangle-height});
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
.inverted-triangle {
|
|
33
|
+
background-image: linear-gradient(var(--dark-y), transparent);
|
|
34
|
+
clip-path: polygon(50% 0, 0 100%, 100% 100%);
|
|
35
|
+
height: calc(var(--shape-height, #{$default-triangle-height}) * 0.86);
|
|
36
|
+
opacity: $default-shapes-opacity;
|
|
37
|
+
width: var(--shape-height, #{$default-triangle-height});
|
|
38
|
+
}
|
|
39
|
+
|
|
32
40
|
.half-ellipses {
|
|
33
41
|
height: var(--shape-height, #{$default-ellipse-height});
|
|
34
42
|
opacity: $default-shapes-opacity;
|
|
@@ -218,4 +226,30 @@ $default-shapes-opacity:.8;
|
|
|
218
226
|
clip-path: ellipse(50% 35% at 50% 50%);
|
|
219
227
|
}
|
|
220
228
|
}
|
|
221
|
-
|
|
229
|
+
|
|
230
|
+
.intersecting-circles {
|
|
231
|
+
height: var(--shape-height, #{$default-circle-height});
|
|
232
|
+
opacity: $default-shapes-opacity;
|
|
233
|
+
width: calc(var(--shape-height, #{$default-circle-height}) * 2);
|
|
234
|
+
display: grid;
|
|
235
|
+
grid-template-columns: repeat(7, 1fr);
|
|
236
|
+
position: relative;
|
|
237
|
+
|
|
238
|
+
> * {
|
|
239
|
+
border-radius: 50%;
|
|
240
|
+
height: 100%;
|
|
241
|
+
width: 100%;
|
|
242
|
+
position: absolute;
|
|
243
|
+
opacity: .8;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.left {
|
|
247
|
+
background-image: linear-gradient(to right ,var(--dark-y),var(--y), transparent);
|
|
248
|
+
grid-column: 1 / 5;
|
|
249
|
+
}
|
|
250
|
+
.right {
|
|
251
|
+
background-image: linear-gradient(to left, var(--dark-y), var(--y), transparent);
|
|
252
|
+
grid-column: 4 / 8;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
package/src/ui/a/index.js
CHANGED