@pareto-engineering/design-system 2.0.0-alpha.4 → 2.0.0-alpha.8
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/OvalIllustration/OvalIllustration.js +102 -0
- package/dist/cjs/a/OvalIllustration/index.js +15 -0
- package/dist/cjs/a/OvalIllustration/styles.scss +105 -0
- package/dist/cjs/a/Shapes/Shapes.js +31 -9
- package/dist/cjs/a/Shapes/styles.scss +42 -20
- package/dist/cjs/a/index.js +17 -1
- package/dist/cjs/b/Page/common/Section/Section.js +42 -5
- package/dist/cjs/b/Page/styles.scss +8 -2
- package/dist/es/a/OvalIllustration/OvalIllustration.js +86 -0
- package/dist/es/a/OvalIllustration/index.js +2 -0
- package/dist/es/a/OvalIllustration/styles.scss +105 -0
- package/dist/es/a/Shapes/Shapes.js +31 -9
- package/dist/es/a/Shapes/styles.scss +42 -20
- package/dist/es/a/index.js +3 -1
- package/dist/es/b/Page/common/Section/Section.js +41 -4
- package/dist/es/b/Page/styles.scss +8 -2
- package/package.json +2 -2
- package/src/__snapshots__/Storyshots.test.js.snap +462 -0
- package/src/stories/a/OvalIllustration.stories.jsx +36 -0
- package/src/stories/a/Shapes.stories.jsx +125 -0
- package/src/stories/b/Page.stories.jsx +27 -1
- package/src/ui/a/OvalIllustration/OvalIllustration.jsx +108 -0
- package/src/ui/a/OvalIllustration/index.js +2 -0
- package/src/ui/a/OvalIllustration/styles.scss +105 -0
- package/src/ui/a/Shapes/Shapes.jsx +181 -0
- package/src/ui/a/Shapes/index.js +2 -0
- package/src/ui/a/Shapes/styles.scss +221 -0
- package/src/ui/a/index.js +2 -0
- package/src/ui/b/Page/common/Section/Section.jsx +51 -2
- package/src/ui/b/Page/styles.scss +8 -2
|
@@ -0,0 +1,102 @@
|
|
|
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 _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); }
|
|
17
|
+
|
|
18
|
+
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; }
|
|
19
|
+
|
|
20
|
+
// Local Definitions
|
|
21
|
+
var baseClassName = _bem.default.base;
|
|
22
|
+
var componentClassName = 'oval-illustration';
|
|
23
|
+
/**
|
|
24
|
+
* This is the component description.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
var OvalIllustration = _ref => {
|
|
28
|
+
var {
|
|
29
|
+
id,
|
|
30
|
+
className: userClassName,
|
|
31
|
+
style,
|
|
32
|
+
layout,
|
|
33
|
+
src,
|
|
34
|
+
alt,
|
|
35
|
+
ovalBackground,
|
|
36
|
+
backgroundColor // ...otherProps
|
|
37
|
+
|
|
38
|
+
} = _ref;
|
|
39
|
+
(0, React.useLayoutEffect)(() => {
|
|
40
|
+
Promise.resolve().then(() => _interopRequireWildcard(require("./styles.scss")));
|
|
41
|
+
}, []);
|
|
42
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
43
|
+
id: id,
|
|
44
|
+
className: [baseClassName, componentClassName, userClassName, layout].filter(e => e).join(' '),
|
|
45
|
+
style: style // {...otherProps}
|
|
46
|
+
|
|
47
|
+
}, ovalBackground && /*#__PURE__*/React.createElement("div", {
|
|
48
|
+
className: "oval-background y-".concat(backgroundColor)
|
|
49
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
50
|
+
className: "illustration"
|
|
51
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
52
|
+
src: src,
|
|
53
|
+
alt: alt
|
|
54
|
+
})));
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
OvalIllustration.propTypes = {
|
|
58
|
+
/**
|
|
59
|
+
* The HTML id for this element
|
|
60
|
+
*/
|
|
61
|
+
id: _propTypes.default.string,
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* The HTML class names for this element
|
|
65
|
+
*/
|
|
66
|
+
className: _propTypes.default.string,
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The React-written, css properties for this element.
|
|
70
|
+
*/
|
|
71
|
+
style: _propTypes.default.objectOf(_propTypes.default.string),
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* side definition of the illustration
|
|
75
|
+
*/
|
|
76
|
+
layout: _propTypes.default.oneOf(['left', 'right']),
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* image url
|
|
80
|
+
*/
|
|
81
|
+
src: _propTypes.default.string,
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* alt tag for the image
|
|
85
|
+
*/
|
|
86
|
+
alt: _propTypes.default.string,
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* whether to have a oval shape as background
|
|
90
|
+
*/
|
|
91
|
+
ovalBackground: _propTypes.default.bool,
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* background color of the oval behind the image
|
|
95
|
+
*/
|
|
96
|
+
backgroundColor: _propTypes.default.string
|
|
97
|
+
};
|
|
98
|
+
OvalIllustration.defaultProps = {
|
|
99
|
+
layout: 'left'
|
|
100
|
+
};
|
|
101
|
+
var _default = OvalIllustration;
|
|
102
|
+
exports.default = _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "OvalIllustration", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _OvalIllustration.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
var _OvalIllustration = _interopRequireDefault(require("./OvalIllustration"));
|
|
14
|
+
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
|
|
3
|
+
@use "@pareto-engineering/bem";
|
|
4
|
+
@use "@aztlan/stylebook/src/mixins";
|
|
5
|
+
@use "@aztlan/stylebook/src/globals" as *;
|
|
6
|
+
|
|
7
|
+
$default-desktop-shape-size:45em;
|
|
8
|
+
$default-tablet-shape-size:35em;
|
|
9
|
+
$default-mobile-shape-size:20em;
|
|
10
|
+
$default-clockwise-degree:60deg;
|
|
11
|
+
$default-counter-clockwise-degree:-60deg;
|
|
12
|
+
$default-ellipse-size:30% 43% at 50% 50%;
|
|
13
|
+
|
|
14
|
+
.#{bem.$base}.oval-illustration {
|
|
15
|
+
display: flex;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
position: relative;
|
|
19
|
+
|
|
20
|
+
&.left {
|
|
21
|
+
.oval-background {
|
|
22
|
+
transform: rotate($default-clockwise-degree);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.illustration {
|
|
26
|
+
transform: rotate($default-counter-clockwise-degree);
|
|
27
|
+
|
|
28
|
+
> img {
|
|
29
|
+
transform: rotate($default-clockwise-degree);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&.right {
|
|
35
|
+
.oval-background {
|
|
36
|
+
transform: rotate($default-counter-clockwise-degree);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.illustration {
|
|
40
|
+
transform: rotate($default-clockwise-degree);
|
|
41
|
+
|
|
42
|
+
> img {
|
|
43
|
+
transform: rotate($default-counter-clockwise-degree);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.oval-background {
|
|
49
|
+
background: var(--y);
|
|
50
|
+
clip-path: ellipse($default-ellipse-size);
|
|
51
|
+
overflow: hidden;
|
|
52
|
+
position: absolute;
|
|
53
|
+
z-index: -100;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.illustration {
|
|
57
|
+
clip-path: ellipse($default-ellipse-size);
|
|
58
|
+
overflow: hidden;
|
|
59
|
+
|
|
60
|
+
> img {
|
|
61
|
+
height: 100%;
|
|
62
|
+
object-fit: cover;
|
|
63
|
+
width: 100%;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// mobile style
|
|
68
|
+
@include mixins.media($to:$sm-md) {
|
|
69
|
+
.oval-background {
|
|
70
|
+
height: $default-mobile-shape-size;
|
|
71
|
+
width: $default-mobile-shape-size;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.illustration {
|
|
75
|
+
height: $default-mobile-shape-size;
|
|
76
|
+
width: $default-mobile-shape-size;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// tablet style
|
|
81
|
+
@include mixins.media($from:$xs-sm, $to:$sm-md) {
|
|
82
|
+
.oval-background {
|
|
83
|
+
height: $default-tablet-shape-size;
|
|
84
|
+
width: $default-tablet-shape-size;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.illustration {
|
|
88
|
+
height: $default-tablet-shape-size;
|
|
89
|
+
width: $default-tablet-shape-size;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// desktop style
|
|
94
|
+
@include mixins.media($from:$sm-md) {
|
|
95
|
+
.oval-background {
|
|
96
|
+
height: $default-desktop-shape-size;
|
|
97
|
+
width: $default-desktop-shape-size;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.illustration {
|
|
101
|
+
height: $default-desktop-shape-size;
|
|
102
|
+
width: $default-desktop-shape-size;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -35,9 +35,11 @@ var Shapes = _ref => {
|
|
|
35
35
|
id,
|
|
36
36
|
className: userClassName,
|
|
37
37
|
style,
|
|
38
|
-
pin,
|
|
39
38
|
shape,
|
|
40
|
-
height
|
|
39
|
+
height,
|
|
40
|
+
overflow,
|
|
41
|
+
verticalAlign,
|
|
42
|
+
horizontalAlign // ...otherProps
|
|
41
43
|
|
|
42
44
|
} = _ref;
|
|
43
45
|
(0, React.useLayoutEffect)(() => {
|
|
@@ -47,8 +49,10 @@ var Shapes = _ref => {
|
|
|
47
49
|
id: id,
|
|
48
50
|
className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
|
|
49
51
|
style: _objectSpread(_objectSpread({}, style), {}, {
|
|
50
|
-
'--
|
|
51
|
-
'--
|
|
52
|
+
'--shape-height': height,
|
|
53
|
+
'--overflow': overflow,
|
|
54
|
+
'--vertical-align': verticalAlign,
|
|
55
|
+
'--horizontal-align': horizontalAlign
|
|
52
56
|
}) // {...otherProps}
|
|
53
57
|
|
|
54
58
|
}, shape === 'triangle' && /*#__PURE__*/React.createElement("div", {
|
|
@@ -99,6 +103,12 @@ var Shapes = _ref => {
|
|
|
99
103
|
className: "circle-three"
|
|
100
104
|
}), /*#__PURE__*/React.createElement("div", {
|
|
101
105
|
className: "circle-four"
|
|
106
|
+
})), shape === 'rotated-ellipses' && /*#__PURE__*/React.createElement("div", {
|
|
107
|
+
className: "rotated-ellipses"
|
|
108
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
109
|
+
className: "ellipse-one"
|
|
110
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
111
|
+
className: "ellipse-two"
|
|
102
112
|
})));
|
|
103
113
|
};
|
|
104
114
|
|
|
@@ -124,18 +134,30 @@ Shapes.propTypes = {
|
|
|
124
134
|
height: _propTypes.default.string,
|
|
125
135
|
|
|
126
136
|
/**
|
|
127
|
-
*
|
|
137
|
+
* The vertical alignment of the shape.
|
|
138
|
+
*/
|
|
139
|
+
verticalAlign: _propTypes.default.oneOf(['flex-start', 'center', 'flex-end']),
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* The horizontal alignment of the shape.
|
|
128
143
|
*/
|
|
129
|
-
|
|
144
|
+
horizontalAlign: _propTypes.default.oneOf(['flex-start', 'center', 'flex-end']),
|
|
130
145
|
|
|
131
146
|
/**
|
|
132
147
|
* The options of a shape to use
|
|
133
148
|
*/
|
|
134
|
-
shape: _propTypes.default.oneOf(['triangle', 'ellipse', 'half-ellipse', 'half-ellipses', 'spiral', 'diamonds', 'circle', 'half-circle', 'ellipses', 'rectangles'])
|
|
149
|
+
shape: _propTypes.default.oneOf(['triangle', 'ellipse', 'half-ellipse', 'half-ellipses', 'spiral', 'diamonds', 'circle', 'half-circle', 'ellipses', 'rectangles', 'rotated-ellipses']),
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* The overflow of the shape.
|
|
153
|
+
*/
|
|
154
|
+
overflow: _propTypes.default.oneOf(['hidden', 'visible'])
|
|
135
155
|
};
|
|
136
156
|
Shapes.defaultProps = {
|
|
137
|
-
|
|
138
|
-
|
|
157
|
+
verticalAlign: 'center',
|
|
158
|
+
horizontalAlign: 'center',
|
|
159
|
+
shape: 'triangle',
|
|
160
|
+
overflow: 'hidden'
|
|
139
161
|
};
|
|
140
162
|
var _default = Shapes;
|
|
141
163
|
exports.default = _default;
|
|
@@ -15,13 +15,14 @@ $default-shapes-opacity:.8;
|
|
|
15
15
|
left: 0;
|
|
16
16
|
display: flex;
|
|
17
17
|
flex-direction: column;
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
overflow: var(--overflow);
|
|
19
|
+
justify-content: var(--vertical-align);
|
|
20
|
+
align-items: var(--horizontal-align);
|
|
20
21
|
height: 100%;
|
|
21
22
|
width: 100%;
|
|
22
23
|
|
|
23
24
|
.triangle {
|
|
24
|
-
background-image: linear-gradient(
|
|
25
|
+
background-image: linear-gradient(transparent, var(--dark-y));
|
|
25
26
|
clip-path: polygon(0 0, 50% 100%, 100% 0);
|
|
26
27
|
height: calc(var(--shape-height, #{$default-triangle-height}) * 0.86);
|
|
27
28
|
opacity: $default-shapes-opacity;
|
|
@@ -34,24 +35,23 @@ $default-shapes-opacity:.8;
|
|
|
34
35
|
width: calc(var(--shape-height, #{$default-ellipse-height}) * 2);
|
|
35
36
|
|
|
36
37
|
.up {
|
|
37
|
-
background-image:
|
|
38
|
-
clip-path: ellipse(
|
|
38
|
+
background-image: radial-gradient(ellipse at center bottom, var(--y) 5%, transparent 65%);
|
|
39
|
+
clip-path: ellipse(35% 100% at 50% 0%);
|
|
39
40
|
height: 50%;
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
.down {
|
|
43
|
-
background-image:
|
|
44
|
-
clip-path: ellipse(
|
|
44
|
+
background-image: radial-gradient(ellipse at center top, var(--y) 5%, transparent 65%);
|
|
45
|
+
clip-path: ellipse(35% 100% at 50% 100%);
|
|
45
46
|
height: 50%;
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
.ellipse {
|
|
50
|
-
background-image: linear-gradient(
|
|
51
|
-
clip-path: ellipse(50%
|
|
51
|
+
background-image: linear-gradient(var(--dark-y), var(--light-y));
|
|
52
|
+
clip-path: ellipse(50% 30% at 50% 70%);
|
|
52
53
|
height: var(--shape-height, #{$default-ellipse-height});
|
|
53
54
|
opacity: $default-shapes-opacity;
|
|
54
|
-
transform: rotate3d(0, 0, -1, 10deg);
|
|
55
55
|
width: calc(var(--shape-height, #{$default-ellipse-height}) * 2);
|
|
56
56
|
}
|
|
57
57
|
|
|
@@ -109,8 +109,8 @@ $default-shapes-opacity:.8;
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
.half-ellipse {
|
|
112
|
-
background-image:
|
|
113
|
-
clip-path: ellipse(
|
|
112
|
+
background-image: radial-gradient(ellipse at center bottom, var(--y) 10%, transparent 65%);
|
|
113
|
+
clip-path: ellipse(60% 100% at 50% 0%);
|
|
114
114
|
height: var(--shape-height, #{$default-ellipse-height});
|
|
115
115
|
opacity: $default-shapes-opacity;
|
|
116
116
|
width: calc(var(--shape-height, #{$default-ellipse-height}) * 2);
|
|
@@ -174,26 +174,48 @@ $default-shapes-opacity:.8;
|
|
|
174
174
|
|
|
175
175
|
.circle-one {
|
|
176
176
|
transform: rotate(45deg);
|
|
177
|
-
height:
|
|
178
|
-
width:
|
|
177
|
+
height:calc(var(--shape-height, #{$default-ellipse-height})* 0.4);
|
|
178
|
+
width: calc(var(--shape-height, #{$default-ellipse-height})* 0.4);
|
|
179
179
|
}
|
|
180
180
|
|
|
181
181
|
.circle-two {
|
|
182
|
-
height:
|
|
183
|
-
width:
|
|
182
|
+
height: calc(var(--shape-height, #{$default-ellipse-height})* 0.6);
|
|
183
|
+
width: calc(var(--shape-height, #{$default-ellipse-height})* 0.6);
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
.circle-three {
|
|
187
187
|
transform: rotate(-45deg);
|
|
188
|
-
height:
|
|
189
|
-
width:
|
|
188
|
+
height: calc(var(--shape-height, #{$default-ellipse-height})* 0.8);
|
|
189
|
+
width: calc(var(--shape-height, #{$default-ellipse-height})* 0.8);
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
.circle-four {
|
|
193
193
|
transform: rotate(-90deg);
|
|
194
|
-
height:
|
|
195
|
-
width:
|
|
194
|
+
height: calc(var(--shape-height, #{$default-ellipse-height})* 1);
|
|
195
|
+
width: calc(var(--shape-height, #{$default-ellipse-height})* 1);
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
|
+
.rotated-ellipses {
|
|
199
|
+
height: var(--shape-height, #{$default-ellipse-height});
|
|
200
|
+
opacity: $default-shapes-opacity;
|
|
201
|
+
width: var(--shape-height, #{$default-ellipse-height});
|
|
202
|
+
display: flex;
|
|
198
203
|
|
|
204
|
+
> *{
|
|
205
|
+
width: 100%;
|
|
206
|
+
height: 100%;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.ellipse-one {
|
|
210
|
+
background-image: radial-gradient(ellipse at bottom left, var(--y) 30%, transparent 65%);
|
|
211
|
+
transform: rotate(-15deg);
|
|
212
|
+
clip-path: ellipse(50% 35% at 50% 50%);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.ellipse-two {
|
|
216
|
+
background-image: radial-gradient(ellipse at top right, var(--y) 30%, transparent 65%);
|
|
217
|
+
transform: rotate(-15deg);
|
|
218
|
+
clip-path: ellipse(50% 35% at 50% 50%);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
199
221
|
}
|
package/dist/cjs/a/index.js
CHANGED
|
@@ -141,6 +141,18 @@ Object.defineProperty(exports, "Timestamp", {
|
|
|
141
141
|
return _Timestamp.Timestamp;
|
|
142
142
|
}
|
|
143
143
|
});
|
|
144
|
+
Object.defineProperty(exports, "Shapes", {
|
|
145
|
+
enumerable: true,
|
|
146
|
+
get: function get() {
|
|
147
|
+
return _Shapes.Shapes;
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
Object.defineProperty(exports, "OvalIllustration", {
|
|
151
|
+
enumerable: true,
|
|
152
|
+
get: function get() {
|
|
153
|
+
return _OvalIllustration.OvalIllustration;
|
|
154
|
+
}
|
|
155
|
+
});
|
|
144
156
|
|
|
145
157
|
var _SVG = require("./SVG");
|
|
146
158
|
|
|
@@ -180,4 +192,8 @@ var _ContentCard = require("./ContentCard");
|
|
|
180
192
|
|
|
181
193
|
var _DotInfo = require("./DotInfo");
|
|
182
194
|
|
|
183
|
-
var _Timestamp = require("./Timestamp");
|
|
195
|
+
var _Timestamp = require("./Timestamp");
|
|
196
|
+
|
|
197
|
+
var _Shapes = require("./Shapes");
|
|
198
|
+
|
|
199
|
+
var _OvalIllustration = require("./OvalIllustration");
|
|
@@ -11,9 +11,11 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
11
11
|
|
|
12
12
|
var _bem = _interopRequireDefault(require("@pareto-engineering/bem"));
|
|
13
13
|
|
|
14
|
+
var _a = require("../../../../a");
|
|
15
|
+
|
|
14
16
|
var _usePage = _interopRequireDefault(require("../../usePage"));
|
|
15
17
|
|
|
16
|
-
var _excluded = ["id", "className", "style", "children"];
|
|
18
|
+
var _excluded = ["id", "className", "style", "children", "backgroundShape", "backgroundVerticalAlign", "backgroundHorizontalAlign", "backgroundHeight", "backgroundOverflow"];
|
|
17
19
|
|
|
18
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
21
|
|
|
@@ -27,7 +29,6 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
27
29
|
|
|
28
30
|
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; }
|
|
29
31
|
|
|
30
|
-
// Local Definitions
|
|
31
32
|
var baseClassName = _bem.default.base;
|
|
32
33
|
var componentClassName = 'section';
|
|
33
34
|
|
|
@@ -36,7 +37,12 @@ var Section = _ref => {
|
|
|
36
37
|
id: userId,
|
|
37
38
|
className: userClassName,
|
|
38
39
|
style,
|
|
39
|
-
children
|
|
40
|
+
children,
|
|
41
|
+
backgroundShape,
|
|
42
|
+
backgroundVerticalAlign,
|
|
43
|
+
backgroundHorizontalAlign,
|
|
44
|
+
backgroundHeight,
|
|
45
|
+
backgroundOverflow
|
|
40
46
|
} = _ref,
|
|
41
47
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
42
48
|
|
|
@@ -48,7 +54,13 @@ var Section = _ref => {
|
|
|
48
54
|
id: sectionId,
|
|
49
55
|
className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
|
|
50
56
|
style: style
|
|
51
|
-
}, otherProps), children
|
|
57
|
+
}, otherProps), children, backgroundShape && /*#__PURE__*/React.createElement(_a.Shapes, {
|
|
58
|
+
verticalAlign: backgroundVerticalAlign,
|
|
59
|
+
horizontalAlign: backgroundHorizontalAlign,
|
|
60
|
+
backgroundOverflow: backgroundOverflow,
|
|
61
|
+
height: backgroundHeight,
|
|
62
|
+
shape: backgroundShape
|
|
63
|
+
}));
|
|
52
64
|
};
|
|
53
65
|
|
|
54
66
|
Section.propTypes = {
|
|
@@ -70,7 +82,32 @@ Section.propTypes = {
|
|
|
70
82
|
/**
|
|
71
83
|
* The children JSX
|
|
72
84
|
*/
|
|
73
|
-
children: _propTypes.default.node
|
|
85
|
+
children: _propTypes.default.node,
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* The background shape to use for this section.
|
|
89
|
+
*/
|
|
90
|
+
backgroundShape: _propTypes.default.oneOf(['triangle', 'ellipse', 'half-ellipse', 'half-ellipses', 'spiral', 'diamonds', 'circle', 'half-circle', 'ellipses', 'rectangles']),
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* The background vertical alingment to use for if the background shape is set.
|
|
94
|
+
*/
|
|
95
|
+
backgroundVerticalAlign: _propTypes.default.oneOf(['flex-start', 'center', 'flex-end']),
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* The background horizontal alingment to use for if the background shape is set.
|
|
99
|
+
*/
|
|
100
|
+
backgroundHorizontalAlign: _propTypes.default.oneOf(['flex-start', 'center', 'flex-end']),
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* The background height to use for if the background shape is set.
|
|
104
|
+
*/
|
|
105
|
+
backgroundHeight: _propTypes.default.string,
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* The background overflow to use for if the background shape is set.
|
|
109
|
+
*/
|
|
110
|
+
backgroundOverflow: _propTypes.default.oneOf(['visible', 'hidden', 'scroll'])
|
|
74
111
|
};
|
|
75
112
|
Section.defaultProps = {// someProp:false
|
|
76
113
|
};
|
|
@@ -0,0 +1,86 @@
|
|
|
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 = 'oval-illustration';
|
|
9
|
+
/**
|
|
10
|
+
* This is the component description.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const OvalIllustration = ({
|
|
14
|
+
id,
|
|
15
|
+
className: userClassName,
|
|
16
|
+
style,
|
|
17
|
+
layout,
|
|
18
|
+
src,
|
|
19
|
+
alt,
|
|
20
|
+
ovalBackground,
|
|
21
|
+
backgroundColor // ...otherProps
|
|
22
|
+
|
|
23
|
+
}) => {
|
|
24
|
+
useLayoutEffect(() => {
|
|
25
|
+
import("./styles.scss");
|
|
26
|
+
}, []);
|
|
27
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
28
|
+
id: id,
|
|
29
|
+
className: [baseClassName, componentClassName, userClassName, layout].filter(e => e).join(' '),
|
|
30
|
+
style: style // {...otherProps}
|
|
31
|
+
|
|
32
|
+
}, ovalBackground && /*#__PURE__*/React.createElement("div", {
|
|
33
|
+
className: `oval-background y-${backgroundColor}`
|
|
34
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
35
|
+
className: "illustration"
|
|
36
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
37
|
+
src: src,
|
|
38
|
+
alt: alt
|
|
39
|
+
})));
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
OvalIllustration.propTypes = {
|
|
43
|
+
/**
|
|
44
|
+
* The HTML id for this element
|
|
45
|
+
*/
|
|
46
|
+
id: PropTypes.string,
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The HTML class names for this element
|
|
50
|
+
*/
|
|
51
|
+
className: PropTypes.string,
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* The React-written, css properties for this element.
|
|
55
|
+
*/
|
|
56
|
+
style: PropTypes.objectOf(PropTypes.string),
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* side definition of the illustration
|
|
60
|
+
*/
|
|
61
|
+
layout: PropTypes.oneOf(['left', 'right']),
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* image url
|
|
65
|
+
*/
|
|
66
|
+
src: PropTypes.string,
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* alt tag for the image
|
|
70
|
+
*/
|
|
71
|
+
alt: PropTypes.string,
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* whether to have a oval shape as background
|
|
75
|
+
*/
|
|
76
|
+
ovalBackground: PropTypes.bool,
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* background color of the oval behind the image
|
|
80
|
+
*/
|
|
81
|
+
backgroundColor: PropTypes.string
|
|
82
|
+
};
|
|
83
|
+
OvalIllustration.defaultProps = {
|
|
84
|
+
layout: 'left'
|
|
85
|
+
};
|
|
86
|
+
export default OvalIllustration;
|