@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.
@@ -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
+ }
@@ -14,9 +14,11 @@ const Shapes = ({
14
14
  id,
15
15
  className: userClassName,
16
16
  style,
17
- pin,
18
17
  shape,
19
- height // ...otherProps
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
- '--pin': pin,
30
- '--shape-height': height
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
- * Where to pin the shapes
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
- pin: PropTypes.oneOf(['flex-start', 'center', 'flex-end']),
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
- pin: 'center',
117
- shape: 'triangle'
136
+ verticalAlign: 'center',
137
+ horizontalAlign: 'center',
138
+ shape: 'triangle',
139
+ overflow: 'hidden'
118
140
  };
119
141
  export default Shapes;
@@ -15,13 +15,14 @@ $default-shapes-opacity:.8;
15
15
  left: 0;
16
16
  display: flex;
17
17
  flex-direction: column;
18
- justify-content: var(--pin);
19
- align-items: center;
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(var(--light-y), var(--dark-y));
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: linear-gradient(var(--light-y), var(--y));
38
- clip-path: ellipse(40% 100% at 50% 0%);
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: linear-gradient(to top, var(--light-y), var(--y));
44
- clip-path: ellipse(40% 100% at 50% 100%);
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(to top left, var(--dark-y), var(--light-y), var(--dark-y));
51
- clip-path: ellipse(50% 25% at 50% 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: linear-gradient(var(--light-y), var(--dark-y));
113
- clip-path: ellipse(50% 50% at 50% 0);
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: 55%;
178
- width: 55%;
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: 70%;
183
- width: 70%;
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: 85%;
189
- width: 85%;
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: 100%;
195
- width: 100%;
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
  }
@@ -17,4 +17,6 @@ export { CustomerStat } from "./CustomerStat";
17
17
  export { Quote } from "./Quote";
18
18
  export { ContentCard } from "./ContentCard";
19
19
  export { DotInfo } from "./DotInfo";
20
- export { Timestamp } from "./Timestamp";
20
+ export { Timestamp } from "./Timestamp";
21
+ export { Shapes } from "./Shapes";
22
+ export { OvalIllustration } from "./OvalIllustration";
@@ -3,9 +3,10 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
3
3
  /* @pareto-engineering/generator-front 1.0.0 */
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
- import styleNames from '@pareto-engineering/bem';
7
- import usePage from "../../usePage"; // Local Definitions
6
+ import styleNames from '@pareto-engineering/bem'; // Local Definitions
8
7
 
8
+ import { Shapes } from "../../../../a";
9
+ import usePage from "../../usePage";
9
10
  const baseClassName = styleNames.base;
10
11
  const componentClassName = 'section';
11
12
 
@@ -14,6 +15,11 @@ const Section = ({
14
15
  className: userClassName,
15
16
  style,
16
17
  children,
18
+ backgroundShape,
19
+ backgroundVerticalAlign,
20
+ backgroundHorizontalAlign,
21
+ backgroundHeight,
22
+ backgroundOverflow,
17
23
  ...otherProps
18
24
  }) => {
19
25
  const {
@@ -24,7 +30,13 @@ const Section = ({
24
30
  id: sectionId,
25
31
  className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
26
32
  style: style
27
- }, otherProps), children);
33
+ }, otherProps), children, backgroundShape && /*#__PURE__*/React.createElement(Shapes, {
34
+ verticalAlign: backgroundVerticalAlign,
35
+ horizontalAlign: backgroundHorizontalAlign,
36
+ backgroundOverflow: backgroundOverflow,
37
+ height: backgroundHeight,
38
+ shape: backgroundShape
39
+ }));
28
40
  };
29
41
 
30
42
  Section.propTypes = {
@@ -46,7 +58,32 @@ Section.propTypes = {
46
58
  /**
47
59
  * The children JSX
48
60
  */
49
- children: PropTypes.node
61
+ children: PropTypes.node,
62
+
63
+ /**
64
+ * The background shape to use for this section.
65
+ */
66
+ backgroundShape: PropTypes.oneOf(['triangle', 'ellipse', 'half-ellipse', 'half-ellipses', 'spiral', 'diamonds', 'circle', 'half-circle', 'ellipses', 'rectangles']),
67
+
68
+ /**
69
+ * The background vertical alingment to use for if the background shape is set.
70
+ */
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']),
77
+
78
+ /**
79
+ * The background height to use for if the background shape is set.
80
+ */
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'])
50
87
  };
51
88
  Section.defaultProps = {// someProp:false
52
89
  };
@@ -2,9 +2,15 @@
2
2
 
3
3
  @use "@pareto-engineering/bem";
4
4
 
5
- /*
5
+
6
6
  .#{bem.$base}.page{
7
+ .#{bem.$base}.section {
8
+ position: relative;
7
9
 
8
- } */
10
+ > *:not(:last-child) {
11
+ z-index: 1;
12
+ }
13
+ }
14
+ }
9
15
 
10
16
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pareto-engineering/design-system",
3
- "version": "2.0.0-alpha.4",
3
+ "version": "2.0.0-alpha.8",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/es/index.js",
@@ -81,7 +81,7 @@
81
81
  "dependencies": {
82
82
  "@pareto-engineering/assets": "^2.0.0-alpha.3",
83
83
  "@pareto-engineering/bem": "^0.1.5",
84
- "@pareto-engineering/styles": "^2.0.0-alpha.4",
84
+ "@pareto-engineering/styles": "^2.0.0-alpha.6",
85
85
  "date-fns": "^2.22.1",
86
86
  "formik": "^2.2.9",
87
87
  "hamburgers": "^1.1.3",