@pareto-engineering/design-system 2.0.0-alpha.5 → 2.0.0-alpha.6
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/Shapes/Shapes.js +31 -9
- package/dist/cjs/a/Shapes/styles.scss +39 -16
- package/dist/cjs/b/Page/common/Section/Section.js +21 -7
- package/dist/es/a/Shapes/Shapes.js +31 -9
- package/dist/es/a/Shapes/styles.scss +39 -16
- package/dist/es/b/Page/common/Section/Section.js +19 -5
- package/package.json +1 -1
- package/src/__snapshots__/Storyshots.test.js.snap +70 -12
- package/src/stories/a/Shapes.stories.jsx +56 -43
- package/src/stories/b/Page.stories.jsx +2 -1
- package/src/ui/a/Shapes/Shapes.jsx +34 -7
- package/src/ui/a/Shapes/styles.scss +39 -16
- package/src/ui/b/Page/common/Section/Section.jsx +21 -4
|
@@ -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,8 +15,9 @@ $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
|
|
|
@@ -34,14 +35,14 @@ $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
|
}
|
|
@@ -109,8 +110,8 @@ $default-shapes-opacity:.8;
|
|
|
109
110
|
}
|
|
110
111
|
|
|
111
112
|
.half-ellipse {
|
|
112
|
-
background-image:
|
|
113
|
-
clip-path: ellipse(
|
|
113
|
+
background-image: radial-gradient(ellipse at center bottom, var(--y) 10%, transparent 65%);
|
|
114
|
+
clip-path: ellipse(60% 100% at 50% 0%);
|
|
114
115
|
height: var(--shape-height, #{$default-ellipse-height});
|
|
115
116
|
opacity: $default-shapes-opacity;
|
|
116
117
|
width: calc(var(--shape-height, #{$default-ellipse-height}) * 2);
|
|
@@ -174,26 +175,48 @@ $default-shapes-opacity:.8;
|
|
|
174
175
|
|
|
175
176
|
.circle-one {
|
|
176
177
|
transform: rotate(45deg);
|
|
177
|
-
height:
|
|
178
|
-
width:
|
|
178
|
+
height:calc(var(--shape-height, #{$default-ellipse-height})* 0.4);
|
|
179
|
+
width: calc(var(--shape-height, #{$default-ellipse-height})* 0.4);
|
|
179
180
|
}
|
|
180
181
|
|
|
181
182
|
.circle-two {
|
|
182
|
-
height:
|
|
183
|
-
width:
|
|
183
|
+
height: calc(var(--shape-height, #{$default-ellipse-height})* 0.6);
|
|
184
|
+
width: calc(var(--shape-height, #{$default-ellipse-height})* 0.6);
|
|
184
185
|
}
|
|
185
186
|
|
|
186
187
|
.circle-three {
|
|
187
188
|
transform: rotate(-45deg);
|
|
188
|
-
height:
|
|
189
|
-
width:
|
|
189
|
+
height: calc(var(--shape-height, #{$default-ellipse-height})* 0.8);
|
|
190
|
+
width: calc(var(--shape-height, #{$default-ellipse-height})* 0.8);
|
|
190
191
|
}
|
|
191
192
|
|
|
192
193
|
.circle-four {
|
|
193
194
|
transform: rotate(-90deg);
|
|
194
|
-
height:
|
|
195
|
-
width:
|
|
195
|
+
height: calc(var(--shape-height, #{$default-ellipse-height})* 1);
|
|
196
|
+
width: calc(var(--shape-height, #{$default-ellipse-height})* 1);
|
|
196
197
|
}
|
|
197
198
|
}
|
|
199
|
+
.rotated-ellipses {
|
|
200
|
+
height: var(--shape-height, #{$default-ellipse-height});
|
|
201
|
+
opacity: $default-shapes-opacity;
|
|
202
|
+
width: var(--shape-height, #{$default-ellipse-height});
|
|
203
|
+
display: flex;
|
|
198
204
|
|
|
205
|
+
> *{
|
|
206
|
+
width: 100%;
|
|
207
|
+
height: 100%;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.ellipse-one {
|
|
211
|
+
background-image: radial-gradient(ellipse at bottom left, var(--y) 30%, transparent 65%);
|
|
212
|
+
transform: rotate(-15deg);
|
|
213
|
+
clip-path: ellipse(50% 35% at 50% 50%);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.ellipse-two {
|
|
217
|
+
background-image: radial-gradient(ellipse at top right, var(--y) 30%, transparent 65%);
|
|
218
|
+
transform: rotate(-15deg);
|
|
219
|
+
clip-path: ellipse(50% 35% at 50% 50%);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
199
222
|
}
|
|
@@ -15,7 +15,7 @@ var _a = require("../../../../a");
|
|
|
15
15
|
|
|
16
16
|
var _usePage = _interopRequireDefault(require("../../usePage"));
|
|
17
17
|
|
|
18
|
-
var _excluded = ["id", "className", "style", "children", "backgroundShape", "
|
|
18
|
+
var _excluded = ["id", "className", "style", "children", "backgroundShape", "backgroundVerticalAlign", "backgroundHorizontalAlign", "backgroundHeight", "backgroundOverflow"];
|
|
19
19
|
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
21
|
|
|
@@ -39,8 +39,10 @@ var Section = _ref => {
|
|
|
39
39
|
style,
|
|
40
40
|
children,
|
|
41
41
|
backgroundShape,
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
backgroundVerticalAlign,
|
|
43
|
+
backgroundHorizontalAlign,
|
|
44
|
+
backgroundHeight,
|
|
45
|
+
backgroundOverflow
|
|
44
46
|
} = _ref,
|
|
45
47
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
46
48
|
|
|
@@ -53,7 +55,9 @@ var Section = _ref => {
|
|
|
53
55
|
className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
|
|
54
56
|
style: style
|
|
55
57
|
}, otherProps), children, backgroundShape && /*#__PURE__*/React.createElement(_a.Shapes, {
|
|
56
|
-
|
|
58
|
+
verticalAlign: backgroundVerticalAlign,
|
|
59
|
+
horizontalAlign: backgroundHorizontalAlign,
|
|
60
|
+
backgroundOverflow: backgroundOverflow,
|
|
57
61
|
height: backgroundHeight,
|
|
58
62
|
shape: backgroundShape
|
|
59
63
|
}));
|
|
@@ -86,14 +90,24 @@ Section.propTypes = {
|
|
|
86
90
|
backgroundShape: _propTypes.default.oneOf(['triangle', 'ellipse', 'half-ellipse', 'half-ellipses', 'spiral', 'diamonds', 'circle', 'half-circle', 'ellipses', 'rectangles']),
|
|
87
91
|
|
|
88
92
|
/**
|
|
89
|
-
* The background
|
|
93
|
+
* The background vertical alingment to use for if the background shape is set.
|
|
90
94
|
*/
|
|
91
|
-
|
|
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']),
|
|
92
101
|
|
|
93
102
|
/**
|
|
94
103
|
* The background height to use for if the background shape is set.
|
|
95
104
|
*/
|
|
96
|
-
backgroundHeight: _propTypes.default.string
|
|
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'])
|
|
97
111
|
};
|
|
98
112
|
Section.defaultProps = {// someProp:false
|
|
99
113
|
};
|
|
@@ -14,9 +14,11 @@ const Shapes = ({
|
|
|
14
14
|
id,
|
|
15
15
|
className: userClassName,
|
|
16
16
|
style,
|
|
17
|
-
pin,
|
|
18
17
|
shape,
|
|
19
|
-
height
|
|
18
|
+
height,
|
|
19
|
+
overflow,
|
|
20
|
+
verticalAlign,
|
|
21
|
+
horizontalAlign // ...otherProps
|
|
20
22
|
|
|
21
23
|
}) => {
|
|
22
24
|
useLayoutEffect(() => {
|
|
@@ -26,8 +28,10 @@ const Shapes = ({
|
|
|
26
28
|
id: id,
|
|
27
29
|
className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
|
|
28
30
|
style: { ...style,
|
|
29
|
-
'--
|
|
30
|
-
'--
|
|
31
|
+
'--shape-height': height,
|
|
32
|
+
'--overflow': overflow,
|
|
33
|
+
'--vertical-align': verticalAlign,
|
|
34
|
+
'--horizontal-align': horizontalAlign
|
|
31
35
|
} // {...otherProps}
|
|
32
36
|
|
|
33
37
|
}, shape === 'triangle' && /*#__PURE__*/React.createElement("div", {
|
|
@@ -78,6 +82,12 @@ const Shapes = ({
|
|
|
78
82
|
className: "circle-three"
|
|
79
83
|
}), /*#__PURE__*/React.createElement("div", {
|
|
80
84
|
className: "circle-four"
|
|
85
|
+
})), shape === 'rotated-ellipses' && /*#__PURE__*/React.createElement("div", {
|
|
86
|
+
className: "rotated-ellipses"
|
|
87
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
88
|
+
className: "ellipse-one"
|
|
89
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
90
|
+
className: "ellipse-two"
|
|
81
91
|
})));
|
|
82
92
|
};
|
|
83
93
|
|
|
@@ -103,17 +113,29 @@ Shapes.propTypes = {
|
|
|
103
113
|
height: PropTypes.string,
|
|
104
114
|
|
|
105
115
|
/**
|
|
106
|
-
*
|
|
116
|
+
* The vertical alignment of the shape.
|
|
117
|
+
*/
|
|
118
|
+
verticalAlign: PropTypes.oneOf(['flex-start', 'center', 'flex-end']),
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* The horizontal alignment of the shape.
|
|
107
122
|
*/
|
|
108
|
-
|
|
123
|
+
horizontalAlign: PropTypes.oneOf(['flex-start', 'center', 'flex-end']),
|
|
109
124
|
|
|
110
125
|
/**
|
|
111
126
|
* The options of a shape to use
|
|
112
127
|
*/
|
|
113
|
-
shape: PropTypes.oneOf(['triangle', 'ellipse', 'half-ellipse', 'half-ellipses', 'spiral', 'diamonds', 'circle', 'half-circle', 'ellipses', 'rectangles'])
|
|
128
|
+
shape: PropTypes.oneOf(['triangle', 'ellipse', 'half-ellipse', 'half-ellipses', 'spiral', 'diamonds', 'circle', 'half-circle', 'ellipses', 'rectangles', 'rotated-ellipses']),
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* The overflow of the shape.
|
|
132
|
+
*/
|
|
133
|
+
overflow: PropTypes.oneOf(['hidden', 'visible'])
|
|
114
134
|
};
|
|
115
135
|
Shapes.defaultProps = {
|
|
116
|
-
|
|
117
|
-
|
|
136
|
+
verticalAlign: 'center',
|
|
137
|
+
horizontalAlign: 'center',
|
|
138
|
+
shape: 'triangle',
|
|
139
|
+
overflow: 'hidden'
|
|
118
140
|
};
|
|
119
141
|
export default Shapes;
|
|
@@ -15,8 +15,9 @@ $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
|
|
|
@@ -34,14 +35,14 @@ $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
|
}
|
|
@@ -109,8 +110,8 @@ $default-shapes-opacity:.8;
|
|
|
109
110
|
}
|
|
110
111
|
|
|
111
112
|
.half-ellipse {
|
|
112
|
-
background-image:
|
|
113
|
-
clip-path: ellipse(
|
|
113
|
+
background-image: radial-gradient(ellipse at center bottom, var(--y) 10%, transparent 65%);
|
|
114
|
+
clip-path: ellipse(60% 100% at 50% 0%);
|
|
114
115
|
height: var(--shape-height, #{$default-ellipse-height});
|
|
115
116
|
opacity: $default-shapes-opacity;
|
|
116
117
|
width: calc(var(--shape-height, #{$default-ellipse-height}) * 2);
|
|
@@ -174,26 +175,48 @@ $default-shapes-opacity:.8;
|
|
|
174
175
|
|
|
175
176
|
.circle-one {
|
|
176
177
|
transform: rotate(45deg);
|
|
177
|
-
height:
|
|
178
|
-
width:
|
|
178
|
+
height:calc(var(--shape-height, #{$default-ellipse-height})* 0.4);
|
|
179
|
+
width: calc(var(--shape-height, #{$default-ellipse-height})* 0.4);
|
|
179
180
|
}
|
|
180
181
|
|
|
181
182
|
.circle-two {
|
|
182
|
-
height:
|
|
183
|
-
width:
|
|
183
|
+
height: calc(var(--shape-height, #{$default-ellipse-height})* 0.6);
|
|
184
|
+
width: calc(var(--shape-height, #{$default-ellipse-height})* 0.6);
|
|
184
185
|
}
|
|
185
186
|
|
|
186
187
|
.circle-three {
|
|
187
188
|
transform: rotate(-45deg);
|
|
188
|
-
height:
|
|
189
|
-
width:
|
|
189
|
+
height: calc(var(--shape-height, #{$default-ellipse-height})* 0.8);
|
|
190
|
+
width: calc(var(--shape-height, #{$default-ellipse-height})* 0.8);
|
|
190
191
|
}
|
|
191
192
|
|
|
192
193
|
.circle-four {
|
|
193
194
|
transform: rotate(-90deg);
|
|
194
|
-
height:
|
|
195
|
-
width:
|
|
195
|
+
height: calc(var(--shape-height, #{$default-ellipse-height})* 1);
|
|
196
|
+
width: calc(var(--shape-height, #{$default-ellipse-height})* 1);
|
|
196
197
|
}
|
|
197
198
|
}
|
|
199
|
+
.rotated-ellipses {
|
|
200
|
+
height: var(--shape-height, #{$default-ellipse-height});
|
|
201
|
+
opacity: $default-shapes-opacity;
|
|
202
|
+
width: var(--shape-height, #{$default-ellipse-height});
|
|
203
|
+
display: flex;
|
|
198
204
|
|
|
205
|
+
> *{
|
|
206
|
+
width: 100%;
|
|
207
|
+
height: 100%;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.ellipse-one {
|
|
211
|
+
background-image: radial-gradient(ellipse at bottom left, var(--y) 30%, transparent 65%);
|
|
212
|
+
transform: rotate(-15deg);
|
|
213
|
+
clip-path: ellipse(50% 35% at 50% 50%);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.ellipse-two {
|
|
217
|
+
background-image: radial-gradient(ellipse at top right, var(--y) 30%, transparent 65%);
|
|
218
|
+
transform: rotate(-15deg);
|
|
219
|
+
clip-path: ellipse(50% 35% at 50% 50%);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
199
222
|
}
|
|
@@ -16,8 +16,10 @@ const Section = ({
|
|
|
16
16
|
style,
|
|
17
17
|
children,
|
|
18
18
|
backgroundShape,
|
|
19
|
-
|
|
19
|
+
backgroundVerticalAlign,
|
|
20
|
+
backgroundHorizontalAlign,
|
|
20
21
|
backgroundHeight,
|
|
22
|
+
backgroundOverflow,
|
|
21
23
|
...otherProps
|
|
22
24
|
}) => {
|
|
23
25
|
const {
|
|
@@ -29,7 +31,9 @@ const Section = ({
|
|
|
29
31
|
className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
|
|
30
32
|
style: style
|
|
31
33
|
}, otherProps), children, backgroundShape && /*#__PURE__*/React.createElement(Shapes, {
|
|
32
|
-
|
|
34
|
+
verticalAlign: backgroundVerticalAlign,
|
|
35
|
+
horizontalAlign: backgroundHorizontalAlign,
|
|
36
|
+
backgroundOverflow: backgroundOverflow,
|
|
33
37
|
height: backgroundHeight,
|
|
34
38
|
shape: backgroundShape
|
|
35
39
|
}));
|
|
@@ -62,14 +66,24 @@ Section.propTypes = {
|
|
|
62
66
|
backgroundShape: PropTypes.oneOf(['triangle', 'ellipse', 'half-ellipse', 'half-ellipses', 'spiral', 'diamonds', 'circle', 'half-circle', 'ellipses', 'rectangles']),
|
|
63
67
|
|
|
64
68
|
/**
|
|
65
|
-
* The background
|
|
69
|
+
* The background vertical alingment to use for if the background shape is set.
|
|
66
70
|
*/
|
|
67
|
-
|
|
71
|
+
backgroundVerticalAlign: PropTypes.oneOf(['flex-start', 'center', 'flex-end']),
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* The background horizontal alingment to use for if the background shape is set.
|
|
75
|
+
*/
|
|
76
|
+
backgroundHorizontalAlign: PropTypes.oneOf(['flex-start', 'center', 'flex-end']),
|
|
68
77
|
|
|
69
78
|
/**
|
|
70
79
|
* The background height to use for if the background shape is set.
|
|
71
80
|
*/
|
|
72
|
-
backgroundHeight: PropTypes.string
|
|
81
|
+
backgroundHeight: PropTypes.string,
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* The background overflow to use for if the background shape is set.
|
|
85
|
+
*/
|
|
86
|
+
backgroundOverflow: PropTypes.oneOf(['visible', 'hidden', 'scroll'])
|
|
73
87
|
};
|
|
74
88
|
Section.defaultProps = {// someProp:false
|
|
75
89
|
};
|
package/package.json
CHANGED
|
@@ -1161,8 +1161,10 @@ exports[`Storyshots a/Shapes Circle 1`] = `
|
|
|
1161
1161
|
className="base shapes"
|
|
1162
1162
|
style={
|
|
1163
1163
|
Object {
|
|
1164
|
-
"--
|
|
1164
|
+
"--horizontal-align": "center",
|
|
1165
|
+
"--overflow": "hidden",
|
|
1165
1166
|
"--shape-height": "30em",
|
|
1167
|
+
"--vertical-align": "flex-end",
|
|
1166
1168
|
}
|
|
1167
1169
|
}
|
|
1168
1170
|
>
|
|
@@ -1188,8 +1190,10 @@ exports[`Storyshots a/Shapes Diamonds 1`] = `
|
|
|
1188
1190
|
className="base shapes"
|
|
1189
1191
|
style={
|
|
1190
1192
|
Object {
|
|
1191
|
-
"--
|
|
1193
|
+
"--horizontal-align": "center",
|
|
1194
|
+
"--overflow": "hidden",
|
|
1192
1195
|
"--shape-height": "30em",
|
|
1196
|
+
"--vertical-align": "flex-end",
|
|
1193
1197
|
}
|
|
1194
1198
|
}
|
|
1195
1199
|
>
|
|
@@ -1225,8 +1229,10 @@ exports[`Storyshots a/Shapes Ellipse 1`] = `
|
|
|
1225
1229
|
className="base shapes"
|
|
1226
1230
|
style={
|
|
1227
1231
|
Object {
|
|
1228
|
-
"--
|
|
1232
|
+
"--horizontal-align": "center",
|
|
1233
|
+
"--overflow": "hidden",
|
|
1229
1234
|
"--shape-height": "30em",
|
|
1235
|
+
"--vertical-align": "flex-end",
|
|
1230
1236
|
}
|
|
1231
1237
|
}
|
|
1232
1238
|
>
|
|
@@ -1252,8 +1258,10 @@ exports[`Storyshots a/Shapes Ellipses 1`] = `
|
|
|
1252
1258
|
className="base shapes"
|
|
1253
1259
|
style={
|
|
1254
1260
|
Object {
|
|
1255
|
-
"--
|
|
1261
|
+
"--horizontal-align": "center",
|
|
1262
|
+
"--overflow": "hidden",
|
|
1256
1263
|
"--shape-height": "30em",
|
|
1264
|
+
"--vertical-align": "flex-end",
|
|
1257
1265
|
}
|
|
1258
1266
|
}
|
|
1259
1267
|
>
|
|
@@ -1286,8 +1294,10 @@ exports[`Storyshots a/Shapes Half Circle 1`] = `
|
|
|
1286
1294
|
className="base shapes"
|
|
1287
1295
|
style={
|
|
1288
1296
|
Object {
|
|
1289
|
-
"--
|
|
1297
|
+
"--horizontal-align": "center",
|
|
1298
|
+
"--overflow": "hidden",
|
|
1290
1299
|
"--shape-height": "30em",
|
|
1300
|
+
"--vertical-align": "flex-end",
|
|
1291
1301
|
}
|
|
1292
1302
|
}
|
|
1293
1303
|
>
|
|
@@ -1313,8 +1323,10 @@ exports[`Storyshots a/Shapes Half Ellipse 1`] = `
|
|
|
1313
1323
|
className="base shapes"
|
|
1314
1324
|
style={
|
|
1315
1325
|
Object {
|
|
1316
|
-
"--
|
|
1326
|
+
"--horizontal-align": "center",
|
|
1327
|
+
"--overflow": "hidden",
|
|
1317
1328
|
"--shape-height": "25em",
|
|
1329
|
+
"--vertical-align": "flex-end",
|
|
1318
1330
|
}
|
|
1319
1331
|
}
|
|
1320
1332
|
>
|
|
@@ -1340,8 +1352,10 @@ exports[`Storyshots a/Shapes Half Ellipses 1`] = `
|
|
|
1340
1352
|
className="base shapes"
|
|
1341
1353
|
style={
|
|
1342
1354
|
Object {
|
|
1343
|
-
"--
|
|
1355
|
+
"--horizontal-align": "center",
|
|
1356
|
+
"--overflow": "hidden",
|
|
1344
1357
|
"--shape-height": "25em",
|
|
1358
|
+
"--vertical-align": "flex-end",
|
|
1345
1359
|
}
|
|
1346
1360
|
}
|
|
1347
1361
|
>
|
|
@@ -1374,8 +1388,10 @@ exports[`Storyshots a/Shapes Rectangles 1`] = `
|
|
|
1374
1388
|
className="base shapes"
|
|
1375
1389
|
style={
|
|
1376
1390
|
Object {
|
|
1377
|
-
"--
|
|
1391
|
+
"--horizontal-align": "center",
|
|
1392
|
+
"--overflow": "hidden",
|
|
1378
1393
|
"--shape-height": "30em",
|
|
1394
|
+
"--vertical-align": "flex-end",
|
|
1379
1395
|
}
|
|
1380
1396
|
}
|
|
1381
1397
|
>
|
|
@@ -1396,6 +1412,42 @@ exports[`Storyshots a/Shapes Rectangles 1`] = `
|
|
|
1396
1412
|
</div>
|
|
1397
1413
|
`;
|
|
1398
1414
|
|
|
1415
|
+
exports[`Storyshots a/Shapes Rotated Ellipses 1`] = `
|
|
1416
|
+
<div
|
|
1417
|
+
className="y-background5 b-light-y"
|
|
1418
|
+
style={
|
|
1419
|
+
Object {
|
|
1420
|
+
"height": "1000px",
|
|
1421
|
+
"overflow": "hidden",
|
|
1422
|
+
"position": "relative",
|
|
1423
|
+
}
|
|
1424
|
+
}
|
|
1425
|
+
>
|
|
1426
|
+
<div
|
|
1427
|
+
className="base shapes"
|
|
1428
|
+
style={
|
|
1429
|
+
Object {
|
|
1430
|
+
"--horizontal-align": "center",
|
|
1431
|
+
"--overflow": "hidden",
|
|
1432
|
+
"--shape-height": "60em",
|
|
1433
|
+
"--vertical-align": "center",
|
|
1434
|
+
}
|
|
1435
|
+
}
|
|
1436
|
+
>
|
|
1437
|
+
<div
|
|
1438
|
+
className="rotated-ellipses"
|
|
1439
|
+
>
|
|
1440
|
+
<div
|
|
1441
|
+
className="ellipse-one"
|
|
1442
|
+
/>
|
|
1443
|
+
<div
|
|
1444
|
+
className="ellipse-two"
|
|
1445
|
+
/>
|
|
1446
|
+
</div>
|
|
1447
|
+
</div>
|
|
1448
|
+
</div>
|
|
1449
|
+
`;
|
|
1450
|
+
|
|
1399
1451
|
exports[`Storyshots a/Shapes Spiral 1`] = `
|
|
1400
1452
|
<div
|
|
1401
1453
|
className="y-background6 b-light-y"
|
|
@@ -1411,8 +1463,10 @@ exports[`Storyshots a/Shapes Spiral 1`] = `
|
|
|
1411
1463
|
className="base shapes"
|
|
1412
1464
|
style={
|
|
1413
1465
|
Object {
|
|
1414
|
-
"--
|
|
1415
|
-
"--
|
|
1466
|
+
"--horizontal-align": "center",
|
|
1467
|
+
"--overflow": "hidden",
|
|
1468
|
+
"--shape-height": "100em",
|
|
1469
|
+
"--vertical-align": "center",
|
|
1416
1470
|
}
|
|
1417
1471
|
}
|
|
1418
1472
|
>
|
|
@@ -1451,8 +1505,10 @@ exports[`Storyshots a/Shapes Triangle 1`] = `
|
|
|
1451
1505
|
className="base shapes"
|
|
1452
1506
|
style={
|
|
1453
1507
|
Object {
|
|
1454
|
-
"--
|
|
1508
|
+
"--horizontal-align": "center",
|
|
1509
|
+
"--overflow": "hidden",
|
|
1455
1510
|
"--shape-height": "30em",
|
|
1511
|
+
"--vertical-align": "flex-end",
|
|
1456
1512
|
}
|
|
1457
1513
|
}
|
|
1458
1514
|
>
|
|
@@ -6343,8 +6399,10 @@ exports[`Storyshots b/Page Sections With Background 1`] = `
|
|
|
6343
6399
|
className="base shapes"
|
|
6344
6400
|
style={
|
|
6345
6401
|
Object {
|
|
6346
|
-
"--
|
|
6402
|
+
"--horizontal-align": "center",
|
|
6403
|
+
"--overflow": "hidden",
|
|
6347
6404
|
"--shape-height": "30em",
|
|
6405
|
+
"--vertical-align": "flex-end",
|
|
6348
6406
|
}
|
|
6349
6407
|
}
|
|
6350
6408
|
>
|
|
@@ -13,10 +13,11 @@ export default {
|
|
|
13
13
|
// storyfn => <div className="">{ storyfn() }</div>,
|
|
14
14
|
],
|
|
15
15
|
argTypes:{
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
verticalAlign :{ control: 'select' },
|
|
17
|
+
horizontalAlign:{ control: 'select' },
|
|
18
|
+
shape :{ control: 'select' },
|
|
19
|
+
height :{ control: 'text' },
|
|
20
|
+
color :{ control: 'text' },
|
|
20
21
|
},
|
|
21
22
|
}
|
|
22
23
|
|
|
@@ -34,79 +35,91 @@ const Template = ({ color, ...rest }) => (
|
|
|
34
35
|
|
|
35
36
|
export const Triangle = Template.bind({})
|
|
36
37
|
Triangle.args = {
|
|
37
|
-
height:'30em',
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
height :'30em',
|
|
39
|
+
verticalAlign :'flex-end',
|
|
40
|
+
horizontalAlign:'center',
|
|
41
|
+
color :'background6',
|
|
42
|
+
shape :'triangle',
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
export const HalfEllipses = Template.bind({})
|
|
44
46
|
HalfEllipses.args = {
|
|
45
|
-
height:'25em',
|
|
46
|
-
|
|
47
|
-
color
|
|
48
|
-
shape
|
|
47
|
+
height :'25em',
|
|
48
|
+
verticalAlign:'flex-end',
|
|
49
|
+
color :'background3',
|
|
50
|
+
shape :'half-ellipses',
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
export const Ellipse = Template.bind({})
|
|
52
54
|
Ellipse.args = {
|
|
53
|
-
height:'30em',
|
|
54
|
-
|
|
55
|
-
color
|
|
56
|
-
shape
|
|
55
|
+
height :'30em',
|
|
56
|
+
verticalAlign:'flex-end',
|
|
57
|
+
color :'main3',
|
|
58
|
+
shape :'ellipse',
|
|
57
59
|
}
|
|
58
60
|
|
|
59
61
|
export const HalfEllipse = Template.bind({})
|
|
60
62
|
HalfEllipse.args = {
|
|
61
|
-
height:'25em',
|
|
62
|
-
|
|
63
|
-
color
|
|
64
|
-
shape
|
|
63
|
+
height :'25em',
|
|
64
|
+
verticalAlign:'flex-end',
|
|
65
|
+
color :'background3',
|
|
66
|
+
shape :'half-ellipse',
|
|
65
67
|
}
|
|
66
68
|
|
|
67
69
|
export const Diamonds = Template.bind({})
|
|
68
70
|
Diamonds.args = {
|
|
69
|
-
height:'30em',
|
|
70
|
-
|
|
71
|
-
color
|
|
72
|
-
shape
|
|
71
|
+
height :'30em',
|
|
72
|
+
verticalAlign:'flex-end',
|
|
73
|
+
color :'background4',
|
|
74
|
+
shape :'diamonds',
|
|
73
75
|
}
|
|
74
76
|
|
|
75
77
|
export const Rectangles = Template.bind({})
|
|
76
78
|
Rectangles.args = {
|
|
77
|
-
height:'30em',
|
|
78
|
-
|
|
79
|
-
color
|
|
80
|
-
shape
|
|
79
|
+
height :'30em',
|
|
80
|
+
verticalAlign:'flex-end',
|
|
81
|
+
color :'background5',
|
|
82
|
+
shape :'rectangles',
|
|
81
83
|
}
|
|
82
84
|
|
|
83
85
|
export const Circle = Template.bind({})
|
|
84
86
|
Circle.args = {
|
|
85
|
-
height:'30em',
|
|
86
|
-
|
|
87
|
-
color
|
|
88
|
-
shape
|
|
87
|
+
height :'30em',
|
|
88
|
+
verticalAlign:'flex-end',
|
|
89
|
+
color :'background5',
|
|
90
|
+
shape :'circle',
|
|
89
91
|
}
|
|
90
92
|
|
|
91
93
|
export const HalfCircle = Template.bind({})
|
|
92
94
|
HalfCircle.args = {
|
|
93
|
-
height:'30em',
|
|
94
|
-
|
|
95
|
-
color
|
|
96
|
-
shape
|
|
95
|
+
height :'30em',
|
|
96
|
+
verticalAlign:'flex-end',
|
|
97
|
+
color :'background4',
|
|
98
|
+
shape :'half-circle',
|
|
97
99
|
}
|
|
98
100
|
|
|
99
101
|
export const Ellipses = Template.bind({})
|
|
100
102
|
Ellipses.args = {
|
|
101
|
-
height:'30em',
|
|
102
|
-
|
|
103
|
-
color
|
|
104
|
-
shape
|
|
103
|
+
height :'30em',
|
|
104
|
+
verticalAlign:'flex-end',
|
|
105
|
+
color :'background4',
|
|
106
|
+
shape :'ellipses',
|
|
105
107
|
}
|
|
106
108
|
|
|
107
109
|
export const Spiral = Template.bind({})
|
|
108
110
|
Spiral.args = {
|
|
109
|
-
height:'
|
|
110
|
-
|
|
111
|
-
|
|
111
|
+
height :'100em',
|
|
112
|
+
verticalAlign :'center',
|
|
113
|
+
horizontalAlign:'center',
|
|
114
|
+
color :'background6',
|
|
115
|
+
shape :'spiral',
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export const RotatedEllipses = Template.bind({})
|
|
119
|
+
RotatedEllipses.args = {
|
|
120
|
+
height :'60em',
|
|
121
|
+
verticalAlign :'center',
|
|
122
|
+
horizontalAlign:'center',
|
|
123
|
+
color :'background5',
|
|
124
|
+
shape :'rotated-ellipses',
|
|
112
125
|
}
|
|
@@ -66,7 +66,8 @@ export const SectionsWithBackground = () => (
|
|
|
66
66
|
id="s1"
|
|
67
67
|
backgroundShape="triangle"
|
|
68
68
|
backgroundHeight="30em"
|
|
69
|
-
|
|
69
|
+
backgroundVerticalAlign="flex-end"
|
|
70
|
+
backgroundHorizontalAlign="center"
|
|
70
71
|
className="y-success b-light-y"
|
|
71
72
|
style={{
|
|
72
73
|
height :'30em',
|
|
@@ -20,9 +20,11 @@ const Shapes = ({
|
|
|
20
20
|
id,
|
|
21
21
|
className:userClassName,
|
|
22
22
|
style,
|
|
23
|
-
pin,
|
|
24
23
|
shape,
|
|
25
24
|
height,
|
|
25
|
+
overflow,
|
|
26
|
+
verticalAlign,
|
|
27
|
+
horizontalAlign,
|
|
26
28
|
// ...otherProps
|
|
27
29
|
}) => {
|
|
28
30
|
useLayoutEffect(() => {
|
|
@@ -43,8 +45,10 @@ const Shapes = ({
|
|
|
43
45
|
.join(' ')}
|
|
44
46
|
style={{
|
|
45
47
|
...style,
|
|
46
|
-
'--
|
|
47
|
-
'--
|
|
48
|
+
'--shape-height' :height,
|
|
49
|
+
'--overflow' :overflow,
|
|
50
|
+
'--vertical-align' :verticalAlign,
|
|
51
|
+
'--horizontal-align':horizontalAlign,
|
|
48
52
|
}}
|
|
49
53
|
// {...otherProps}
|
|
50
54
|
>
|
|
@@ -95,6 +99,12 @@ const Shapes = ({
|
|
|
95
99
|
<div className="circle-four" />
|
|
96
100
|
</div>
|
|
97
101
|
)}
|
|
102
|
+
{shape === 'rotated-ellipses' && (
|
|
103
|
+
<div className="rotated-ellipses">
|
|
104
|
+
<div className="ellipse-one" />
|
|
105
|
+
<div className="ellipse-two" />
|
|
106
|
+
</div>
|
|
107
|
+
)}
|
|
98
108
|
</div>
|
|
99
109
|
)
|
|
100
110
|
}
|
|
@@ -121,9 +131,18 @@ Shapes.propTypes = {
|
|
|
121
131
|
height:PropTypes.string,
|
|
122
132
|
|
|
123
133
|
/**
|
|
124
|
-
*
|
|
134
|
+
* The vertical alignment of the shape.
|
|
135
|
+
*/
|
|
136
|
+
verticalAlign:PropTypes.oneOf([
|
|
137
|
+
'flex-start',
|
|
138
|
+
'center',
|
|
139
|
+
'flex-end',
|
|
140
|
+
]),
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* The horizontal alignment of the shape.
|
|
125
144
|
*/
|
|
126
|
-
|
|
145
|
+
horizontalAlign:PropTypes.oneOf([
|
|
127
146
|
'flex-start',
|
|
128
147
|
'center',
|
|
129
148
|
'flex-end',
|
|
@@ -143,12 +162,20 @@ Shapes.propTypes = {
|
|
|
143
162
|
'half-circle',
|
|
144
163
|
'ellipses',
|
|
145
164
|
'rectangles',
|
|
165
|
+
'rotated-ellipses',
|
|
146
166
|
]),
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* The overflow of the shape.
|
|
170
|
+
*/
|
|
171
|
+
overflow:PropTypes.oneOf(['hidden', 'visible']),
|
|
147
172
|
}
|
|
148
173
|
|
|
149
174
|
Shapes.defaultProps = {
|
|
150
|
-
|
|
151
|
-
|
|
175
|
+
verticalAlign :'center',
|
|
176
|
+
horizontalAlign:'center',
|
|
177
|
+
shape :'triangle',
|
|
178
|
+
overflow :'hidden',
|
|
152
179
|
}
|
|
153
180
|
|
|
154
181
|
export default Shapes
|
|
@@ -15,8 +15,9 @@ $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
|
|
|
@@ -34,14 +35,14 @@ $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
|
}
|
|
@@ -109,8 +110,8 @@ $default-shapes-opacity:.8;
|
|
|
109
110
|
}
|
|
110
111
|
|
|
111
112
|
.half-ellipse {
|
|
112
|
-
background-image:
|
|
113
|
-
clip-path: ellipse(
|
|
113
|
+
background-image: radial-gradient(ellipse at center bottom, var(--y) 10%, transparent 65%);
|
|
114
|
+
clip-path: ellipse(60% 100% at 50% 0%);
|
|
114
115
|
height: var(--shape-height, #{$default-ellipse-height});
|
|
115
116
|
opacity: $default-shapes-opacity;
|
|
116
117
|
width: calc(var(--shape-height, #{$default-ellipse-height}) * 2);
|
|
@@ -174,26 +175,48 @@ $default-shapes-opacity:.8;
|
|
|
174
175
|
|
|
175
176
|
.circle-one {
|
|
176
177
|
transform: rotate(45deg);
|
|
177
|
-
height:
|
|
178
|
-
width:
|
|
178
|
+
height:calc(var(--shape-height, #{$default-ellipse-height})* 0.4);
|
|
179
|
+
width: calc(var(--shape-height, #{$default-ellipse-height})* 0.4);
|
|
179
180
|
}
|
|
180
181
|
|
|
181
182
|
.circle-two {
|
|
182
|
-
height:
|
|
183
|
-
width:
|
|
183
|
+
height: calc(var(--shape-height, #{$default-ellipse-height})* 0.6);
|
|
184
|
+
width: calc(var(--shape-height, #{$default-ellipse-height})* 0.6);
|
|
184
185
|
}
|
|
185
186
|
|
|
186
187
|
.circle-three {
|
|
187
188
|
transform: rotate(-45deg);
|
|
188
|
-
height:
|
|
189
|
-
width:
|
|
189
|
+
height: calc(var(--shape-height, #{$default-ellipse-height})* 0.8);
|
|
190
|
+
width: calc(var(--shape-height, #{$default-ellipse-height})* 0.8);
|
|
190
191
|
}
|
|
191
192
|
|
|
192
193
|
.circle-four {
|
|
193
194
|
transform: rotate(-90deg);
|
|
194
|
-
height:
|
|
195
|
-
width:
|
|
195
|
+
height: calc(var(--shape-height, #{$default-ellipse-height})* 1);
|
|
196
|
+
width: calc(var(--shape-height, #{$default-ellipse-height})* 1);
|
|
196
197
|
}
|
|
197
198
|
}
|
|
199
|
+
.rotated-ellipses {
|
|
200
|
+
height: var(--shape-height, #{$default-ellipse-height});
|
|
201
|
+
opacity: $default-shapes-opacity;
|
|
202
|
+
width: var(--shape-height, #{$default-ellipse-height});
|
|
203
|
+
display: flex;
|
|
198
204
|
|
|
205
|
+
> *{
|
|
206
|
+
width: 100%;
|
|
207
|
+
height: 100%;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.ellipse-one {
|
|
211
|
+
background-image: radial-gradient(ellipse at bottom left, var(--y) 30%, transparent 65%);
|
|
212
|
+
transform: rotate(-15deg);
|
|
213
|
+
clip-path: ellipse(50% 35% at 50% 50%);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.ellipse-two {
|
|
217
|
+
background-image: radial-gradient(ellipse at top right, var(--y) 30%, transparent 65%);
|
|
218
|
+
transform: rotate(-15deg);
|
|
219
|
+
clip-path: ellipse(50% 35% at 50% 50%);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
199
222
|
}
|
|
@@ -16,8 +16,10 @@ const Section = ({
|
|
|
16
16
|
style,
|
|
17
17
|
children,
|
|
18
18
|
backgroundShape,
|
|
19
|
-
|
|
19
|
+
backgroundVerticalAlign,
|
|
20
|
+
backgroundHorizontalAlign,
|
|
20
21
|
backgroundHeight,
|
|
22
|
+
backgroundOverflow,
|
|
21
23
|
...otherProps
|
|
22
24
|
}) => {
|
|
23
25
|
const {
|
|
@@ -40,7 +42,13 @@ const Section = ({
|
|
|
40
42
|
>
|
|
41
43
|
{children}
|
|
42
44
|
{backgroundShape && (
|
|
43
|
-
<Shapes
|
|
45
|
+
<Shapes
|
|
46
|
+
verticalAlign={backgroundVerticalAlign}
|
|
47
|
+
horizontalAlign={backgroundHorizontalAlign}
|
|
48
|
+
backgroundOverflow={backgroundOverflow}
|
|
49
|
+
height={backgroundHeight}
|
|
50
|
+
shape={backgroundShape}
|
|
51
|
+
/>
|
|
44
52
|
)}
|
|
45
53
|
</section>
|
|
46
54
|
)
|
|
@@ -84,14 +92,23 @@ Section.propTypes = {
|
|
|
84
92
|
]),
|
|
85
93
|
|
|
86
94
|
/**
|
|
87
|
-
* The background
|
|
95
|
+
* The background vertical alingment to use for if the background shape is set.
|
|
88
96
|
*/
|
|
89
|
-
|
|
97
|
+
backgroundVerticalAlign :PropTypes.oneOf(['flex-start', 'center', 'flex-end']),
|
|
98
|
+
/**
|
|
99
|
+
* The background horizontal alingment to use for if the background shape is set.
|
|
100
|
+
*/
|
|
101
|
+
backgroundHorizontalAlign:PropTypes.oneOf(['flex-start', 'center', 'flex-end']),
|
|
90
102
|
|
|
91
103
|
/**
|
|
92
104
|
* The background height to use for if the background shape is set.
|
|
93
105
|
*/
|
|
94
106
|
backgroundHeight:PropTypes.string,
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* The background overflow to use for if the background shape is set.
|
|
110
|
+
*/
|
|
111
|
+
backgroundOverflow:PropTypes.oneOf(['visible', 'hidden', 'scroll']),
|
|
95
112
|
}
|
|
96
113
|
|
|
97
114
|
Section.defaultProps = {
|