@pareto-engineering/design-system 2.0.0-alpha.12 → 2.0.0-alpha.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/a/BackgroundGradient/styles.scss +0 -2
- package/dist/cjs/b/Page/common/Section/Section.js +16 -2
- package/dist/es/a/BackgroundGradient/styles.scss +0 -2
- package/dist/es/b/Page/common/Section/Section.js +16 -2
- package/package.json +1 -1
- package/src/__snapshots__/Storyshots.test.js.snap +51 -2
- package/src/stories/a/BackgroundGradient.stories.jsx +2 -3
- package/src/stories/b/Page.stories.jsx +25 -1
- package/src/ui/a/BackgroundGradient/styles.scss +0 -2
- package/src/ui/b/Page/common/Section/Section.jsx +18 -1
|
@@ -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", "backgroundVerticalAlign", "backgroundHorizontalAlign", "backgroundHeight", "backgroundOverflow"];
|
|
18
|
+
var _excluded = ["id", "className", "style", "children", "backgroundShape", "backgroundGradient", "backgroundGradientHeight", "backgroundVerticalAlign", "backgroundHorizontalAlign", "backgroundHeight", "backgroundOverflow"];
|
|
19
19
|
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
21
|
|
|
@@ -39,6 +39,8 @@ var Section = _ref => {
|
|
|
39
39
|
style,
|
|
40
40
|
children,
|
|
41
41
|
backgroundShape,
|
|
42
|
+
backgroundGradient,
|
|
43
|
+
backgroundGradientHeight,
|
|
42
44
|
backgroundVerticalAlign,
|
|
43
45
|
backgroundHorizontalAlign,
|
|
44
46
|
backgroundHeight,
|
|
@@ -60,6 +62,8 @@ var Section = _ref => {
|
|
|
60
62
|
overflow: backgroundOverflow,
|
|
61
63
|
height: backgroundHeight,
|
|
62
64
|
shape: backgroundShape
|
|
65
|
+
}), backgroundGradient && /*#__PURE__*/React.createElement(_a.BackgroundGradient, {
|
|
66
|
+
height: backgroundGradientHeight
|
|
63
67
|
}));
|
|
64
68
|
};
|
|
65
69
|
|
|
@@ -107,7 +111,17 @@ Section.propTypes = {
|
|
|
107
111
|
/**
|
|
108
112
|
* The background overflow to use for if the background shape is set.
|
|
109
113
|
*/
|
|
110
|
-
backgroundOverflow: _propTypes.default.oneOf(['visible', 'hidden', 'scroll'])
|
|
114
|
+
backgroundOverflow: _propTypes.default.oneOf(['visible', 'hidden', 'scroll']),
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* The background gradient to use for if the background gradient is set.
|
|
118
|
+
*/
|
|
119
|
+
backgroundGradient: _propTypes.default.bool,
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* The background gradient height to use for if the background gradient is set.
|
|
123
|
+
*/
|
|
124
|
+
backgroundGradientHeight: _propTypes.default.string
|
|
111
125
|
};
|
|
112
126
|
Section.defaultProps = {// someProp:false
|
|
113
127
|
};
|
|
@@ -5,7 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import styleNames from '@pareto-engineering/bem'; // Local Definitions
|
|
7
7
|
|
|
8
|
-
import { Shapes } from "../../../../a";
|
|
8
|
+
import { Shapes, BackgroundGradient } from "../../../../a";
|
|
9
9
|
import usePage from "../../usePage";
|
|
10
10
|
const baseClassName = styleNames.base;
|
|
11
11
|
const componentClassName = 'section';
|
|
@@ -16,6 +16,8 @@ const Section = ({
|
|
|
16
16
|
style,
|
|
17
17
|
children,
|
|
18
18
|
backgroundShape,
|
|
19
|
+
backgroundGradient,
|
|
20
|
+
backgroundGradientHeight,
|
|
19
21
|
backgroundVerticalAlign,
|
|
20
22
|
backgroundHorizontalAlign,
|
|
21
23
|
backgroundHeight,
|
|
@@ -36,6 +38,8 @@ const Section = ({
|
|
|
36
38
|
overflow: backgroundOverflow,
|
|
37
39
|
height: backgroundHeight,
|
|
38
40
|
shape: backgroundShape
|
|
41
|
+
}), backgroundGradient && /*#__PURE__*/React.createElement(BackgroundGradient, {
|
|
42
|
+
height: backgroundGradientHeight
|
|
39
43
|
}));
|
|
40
44
|
};
|
|
41
45
|
|
|
@@ -83,7 +87,17 @@ Section.propTypes = {
|
|
|
83
87
|
/**
|
|
84
88
|
* The background overflow to use for if the background shape is set.
|
|
85
89
|
*/
|
|
86
|
-
backgroundOverflow: PropTypes.oneOf(['visible', 'hidden', 'scroll'])
|
|
90
|
+
backgroundOverflow: PropTypes.oneOf(['visible', 'hidden', 'scroll']),
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* The background gradient to use for if the background gradient is set.
|
|
94
|
+
*/
|
|
95
|
+
backgroundGradient: PropTypes.bool,
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* The background gradient height to use for if the background gradient is set.
|
|
99
|
+
*/
|
|
100
|
+
backgroundGradientHeight: PropTypes.string
|
|
87
101
|
};
|
|
88
102
|
Section.defaultProps = {// someProp:false
|
|
89
103
|
};
|
package/package.json
CHANGED
|
@@ -7656,11 +7656,11 @@ exports[`Storyshots b/Page Item Type 1`] = `
|
|
|
7656
7656
|
exports[`Storyshots b/Page Sections With Background 1`] = `
|
|
7657
7657
|
<main
|
|
7658
7658
|
className="base page"
|
|
7659
|
-
id="with-
|
|
7659
|
+
id="with-background"
|
|
7660
7660
|
>
|
|
7661
7661
|
<section
|
|
7662
7662
|
className="base section y-success b-light-y"
|
|
7663
|
-
id="with-
|
|
7663
|
+
id="with-background_s1"
|
|
7664
7664
|
style={
|
|
7665
7665
|
Object {
|
|
7666
7666
|
"alignItems": "center",
|
|
@@ -7709,6 +7709,55 @@ exports[`Storyshots b/Page Sections With Background 1`] = `
|
|
|
7709
7709
|
</main>
|
|
7710
7710
|
`;
|
|
7711
7711
|
|
|
7712
|
+
exports[`Storyshots b/Page Sections With Background Gradient 1`] = `
|
|
7713
|
+
<main
|
|
7714
|
+
className="base page"
|
|
7715
|
+
id="with-background-gradient"
|
|
7716
|
+
>
|
|
7717
|
+
<section
|
|
7718
|
+
className="base section y-success"
|
|
7719
|
+
id="with-background-gradient_s1"
|
|
7720
|
+
style={
|
|
7721
|
+
Object {
|
|
7722
|
+
"alignItems": "center",
|
|
7723
|
+
"display": "flex",
|
|
7724
|
+
"height": "30em",
|
|
7725
|
+
"justifyContent": "center",
|
|
7726
|
+
}
|
|
7727
|
+
}
|
|
7728
|
+
>
|
|
7729
|
+
<figure
|
|
7730
|
+
className="base quote x-paragraph"
|
|
7731
|
+
>
|
|
7732
|
+
<blockquote
|
|
7733
|
+
className="blockquote uc"
|
|
7734
|
+
>
|
|
7735
|
+
<p
|
|
7736
|
+
className="quotation c-x md-s0 s-1"
|
|
7737
|
+
>
|
|
7738
|
+
Pareto was like having a full-time employee without having to hire somebody. That’s how I would explain it. An on-call, on-demand full-time employee.
|
|
7739
|
+
</p>
|
|
7740
|
+
</blockquote>
|
|
7741
|
+
<figcaption
|
|
7742
|
+
className="figcaption"
|
|
7743
|
+
>
|
|
7744
|
+
<cite>
|
|
7745
|
+
Austen Spoonts
|
|
7746
|
+
</cite>
|
|
7747
|
+
</figcaption>
|
|
7748
|
+
</figure>
|
|
7749
|
+
<div
|
|
7750
|
+
className="base background-gradient"
|
|
7751
|
+
style={
|
|
7752
|
+
Object {
|
|
7753
|
+
"--gradient-height": "50em",
|
|
7754
|
+
}
|
|
7755
|
+
}
|
|
7756
|
+
/>
|
|
7757
|
+
</section>
|
|
7758
|
+
</main>
|
|
7759
|
+
`;
|
|
7760
|
+
|
|
7712
7761
|
exports[`Storyshots b/Page With Sections 1`] = `
|
|
7713
7762
|
<main
|
|
7714
7763
|
className="base page"
|
|
@@ -60,7 +60,7 @@ export const WithSections = () => (
|
|
|
60
60
|
|
|
61
61
|
export const SectionsWithBackground = () => (
|
|
62
62
|
<Page
|
|
63
|
-
id="with-
|
|
63
|
+
id="with-background"
|
|
64
64
|
>
|
|
65
65
|
<Page.Section
|
|
66
66
|
id="s1"
|
|
@@ -83,3 +83,27 @@ export const SectionsWithBackground = () => (
|
|
|
83
83
|
</Page.Section>
|
|
84
84
|
</Page>
|
|
85
85
|
)
|
|
86
|
+
|
|
87
|
+
export const SectionsWithBackgroundGradient = () => (
|
|
88
|
+
<Page
|
|
89
|
+
id="with-background-gradient"
|
|
90
|
+
>
|
|
91
|
+
<Page.Section
|
|
92
|
+
id="s1"
|
|
93
|
+
backgroundGradient
|
|
94
|
+
backgroundGradientHeight="50em"
|
|
95
|
+
className="y-success"
|
|
96
|
+
style={{
|
|
97
|
+
height :'30em',
|
|
98
|
+
display :'flex',
|
|
99
|
+
justifyContent:'center',
|
|
100
|
+
alignItems :'center',
|
|
101
|
+
}}
|
|
102
|
+
>
|
|
103
|
+
<Quote author="Austen Spoonts" color="paragraph">
|
|
104
|
+
Pareto was like having a full-time employee without having to hire somebody.
|
|
105
|
+
That’s how I would explain it. An on-call, on-demand full-time employee.
|
|
106
|
+
</Quote>
|
|
107
|
+
</Page.Section>
|
|
108
|
+
</Page>
|
|
109
|
+
)
|
|
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types'
|
|
|
4
4
|
import styleNames from '@pareto-engineering/bem'
|
|
5
5
|
|
|
6
6
|
// Local Definitions
|
|
7
|
-
import { Shapes } from 'ui/a'
|
|
7
|
+
import { Shapes, BackgroundGradient } from 'ui/a'
|
|
8
8
|
import usePage from '../../usePage'
|
|
9
9
|
|
|
10
10
|
const baseClassName = styleNames.base
|
|
@@ -16,6 +16,8 @@ const Section = ({
|
|
|
16
16
|
style,
|
|
17
17
|
children,
|
|
18
18
|
backgroundShape,
|
|
19
|
+
backgroundGradient,
|
|
20
|
+
backgroundGradientHeight,
|
|
19
21
|
backgroundVerticalAlign,
|
|
20
22
|
backgroundHorizontalAlign,
|
|
21
23
|
backgroundHeight,
|
|
@@ -50,6 +52,11 @@ const Section = ({
|
|
|
50
52
|
shape={backgroundShape}
|
|
51
53
|
/>
|
|
52
54
|
)}
|
|
55
|
+
{backgroundGradient && (
|
|
56
|
+
<BackgroundGradient
|
|
57
|
+
height={backgroundGradientHeight}
|
|
58
|
+
/>
|
|
59
|
+
)}
|
|
53
60
|
</section>
|
|
54
61
|
)
|
|
55
62
|
}
|
|
@@ -109,6 +116,16 @@ Section.propTypes = {
|
|
|
109
116
|
* The background overflow to use for if the background shape is set.
|
|
110
117
|
*/
|
|
111
118
|
backgroundOverflow:PropTypes.oneOf(['visible', 'hidden', 'scroll']),
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* The background gradient to use for if the background gradient is set.
|
|
122
|
+
*/
|
|
123
|
+
backgroundGradient:PropTypes.bool,
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* The background gradient height to use for if the background gradient is set.
|
|
127
|
+
*/
|
|
128
|
+
backgroundGradientHeight:PropTypes.string,
|
|
112
129
|
}
|
|
113
130
|
|
|
114
131
|
Section.defaultProps = {
|