@pareto-engineering/design-system 2.0.0-alpha.3 → 2.0.0-alpha.7

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.
Files changed (34) hide show
  1. package/dist/cjs/a/OvalIllustration/OvalIllustration.js +102 -0
  2. package/dist/cjs/a/OvalIllustration/index.js +15 -0
  3. package/dist/cjs/a/OvalIllustration/styles.scss +105 -0
  4. package/dist/cjs/a/Shapes/Shapes.js +31 -9
  5. package/dist/cjs/a/Shapes/styles.scss +40 -17
  6. package/dist/cjs/a/index.js +17 -1
  7. package/dist/cjs/b/Button/styles.scss +38 -19
  8. package/dist/cjs/b/Page/common/Section/Section.js +42 -5
  9. package/dist/cjs/b/Page/styles.scss +8 -2
  10. package/dist/es/a/OvalIllustration/OvalIllustration.js +86 -0
  11. package/dist/es/a/OvalIllustration/index.js +2 -0
  12. package/dist/es/a/OvalIllustration/styles.scss +105 -0
  13. package/dist/es/a/Shapes/Shapes.js +31 -9
  14. package/dist/es/a/Shapes/styles.scss +40 -17
  15. package/dist/es/a/index.js +3 -1
  16. package/dist/es/b/Button/styles.scss +38 -19
  17. package/dist/es/b/Page/common/Section/Section.js +41 -4
  18. package/dist/es/b/Page/styles.scss +8 -2
  19. package/package.json +1 -1
  20. package/src/__snapshots__/Storyshots.test.js.snap +1480 -336
  21. package/src/stories/a/OvalIllustration.stories.jsx +36 -0
  22. package/src/stories/a/Shapes.stories.jsx +125 -0
  23. package/src/stories/b/Button.stories.jsx +57 -82
  24. package/src/stories/b/Page.stories.jsx +27 -1
  25. package/src/ui/a/OvalIllustration/OvalIllustration.jsx +108 -0
  26. package/src/ui/a/OvalIllustration/index.js +2 -0
  27. package/src/ui/a/OvalIllustration/styles.scss +105 -0
  28. package/src/ui/a/Shapes/Shapes.jsx +181 -0
  29. package/src/ui/a/Shapes/index.js +2 -0
  30. package/src/ui/a/Shapes/styles.scss +222 -0
  31. package/src/ui/a/index.js +2 -0
  32. package/src/ui/b/Button/styles.scss +38 -19
  33. package/src/ui/b/Page/common/Section/Section.jsx +51 -2
  34. package/src/ui/b/Page/styles.scss +8 -2
@@ -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;
@@ -0,0 +1,2 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ export { default as OvalIllustration } from "./OvalIllustration";
@@ -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,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: 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
  }
@@ -109,8 +110,8 @@ $default-shapes-opacity:.8;
109
110
  }
110
111
 
111
112
  .half-ellipse {
112
- background-image: linear-gradient(var(--light-y), var(--dark-y));
113
- clip-path: ellipse(50% 50% at 50% 0);
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: 55%;
178
- width: 55%;
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: 70%;
183
- width: 70%;
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: 85%;
189
- width: 85%;
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: 100%;
195
- width: 100%;
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
  }
@@ -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";
@@ -4,15 +4,13 @@
4
4
 
5
5
  $default-padding: 1em 1em .84em;
6
6
  $compact-padding: .6em .6em .48em;
7
- $default-border-radius:2em;
8
7
  $default-color:primary;
9
8
  $font-weight:bold;
10
9
 
11
10
  .#{bem.$base}.button {
12
11
  background: var(--x, var(--#{$default-color}));
13
12
  border: transparent;
14
- //border-radius: var(--theme-border-radius);
15
- border-radius: $default-border-radius;
13
+ border-radius: var(--theme-border-radius);
16
14
  color: var(--on-x, var(--on-#{$default-color}));
17
15
  font-weight: 600;
18
16
  padding: $default-padding;
@@ -24,6 +22,9 @@ $font-weight:bold;
24
22
  &:hover {
25
23
  background: var(--light-x, var(--light-#{$default-color}));
26
24
  }
25
+ &:focus {
26
+ background: var(--dark-x, var(--dark-#{$default-color}));
27
+ }
27
28
  }
28
29
 
29
30
 
@@ -36,21 +37,28 @@ $font-weight:bold;
36
37
  border: 1px solid var(--x, var(--#{$default-color}));
37
38
  color: var(--x, var(--#{$default-color}));
38
39
 
39
- &:not(:disabled) {
40
- &:hover,
41
- &:focus {
42
- border: 1px solid transparent;
43
- color: var(--on-x, var(--on-#{$default-color}));
44
- }
40
+ &:hover,
41
+ &:focus,
42
+ &:disabled{
43
+ background: transparent;
44
+ }
45
45
 
46
+ &:not(:disabled) {
46
47
  &:hover {
47
- background: var(--x, var(--#{$default-color}));
48
+ border: 1px solid var(--light-x, var(--light-#{$default-color}));
49
+ color: var(--light-x, var(--light-#{$default-color}));
48
50
  }
49
51
 
50
52
  &:focus {
51
- background: var(--dark-x, var(--#{$default-color}));
53
+ border: 1px solid var(--dark-x, var(--dark-#{$default-color}));
54
+ color: var(--dark-x, var(--dark-#{$default-color}));
52
55
  }
53
56
  }
57
+
58
+ &:disabled{
59
+ border: 1px solid var(--x, var(--#{$default-color}));
60
+ color: var(--x, var(--#{$default-color}));
61
+ }
54
62
  }
55
63
 
56
64
  &.#{bem.$modifier-simple} {
@@ -58,19 +66,30 @@ $font-weight:bold;
58
66
  border: 1px solid transparent;
59
67
  color: var(--x, var(--#{$default-color}));
60
68
 
69
+ &:disabled,
70
+ &:hover,
71
+ &:focus {
72
+ background: transparent;
73
+ }
74
+
61
75
  &:not(:disabled) {
62
- &:hover,
63
- &:focus {
64
- background:transparent;
65
- border: 1px solid transparent;
66
- color: var(--dark-x, var(--on-#{$default-color}));
67
- }
76
+ &:hover {
77
+ color: var(--light-x, var(--light-#{$default-color}));
78
+ }
79
+
80
+ &:focus {
81
+ color: var(--dark-x, var(--dark-#{$default-color}));
82
+ }
83
+ }
84
+
85
+ &:disabled {
86
+ color: var(--x, var(--#{$default-color}));
68
87
  }
69
88
  }
70
89
 
71
90
  &:disabled {
72
- background: var(--light-x);
73
- filter: brightness(120%);
91
+ background: var(--x);
92
+ filter: brightness(125%);
74
93
  }
75
94
  }
76
95
 
@@ -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.3",
3
+ "version": "2.0.0-alpha.7",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/es/index.js",