@pareto-engineering/design-system 2.0.0-alpha.10 → 2.0.0-alpha.14
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/BackgroundGradient.js +77 -0
- package/dist/cjs/a/BackgroundGradient/index.js +15 -0
- package/dist/cjs/a/BackgroundGradient/styles.scss +16 -0
- package/dist/cjs/a/Conversation/Conversation.js +15 -8
- package/dist/cjs/a/Conversation/common/Message/Message.js +33 -6
- package/dist/cjs/a/Conversation/styles.scss +139 -32
- package/dist/cjs/a/Shapes/Shapes.js +9 -1
- package/dist/cjs/a/Shapes/styles.scss +35 -1
- package/dist/cjs/a/index.js +9 -1
- package/dist/cjs/b/Button/Button.js +10 -4
- package/dist/cjs/b/Button/styles.scss +28 -8
- package/dist/cjs/b/Page/common/Section/Section.js +17 -3
- package/dist/es/a/BackgroundGradient/BackgroundGradient.js +55 -0
- package/dist/es/a/BackgroundGradient/index.js +2 -0
- package/dist/es/a/BackgroundGradient/styles.scss +16 -0
- package/dist/es/a/Conversation/Conversation.js +15 -8
- package/dist/es/a/Conversation/common/Message/Message.js +33 -6
- package/dist/es/a/Conversation/styles.scss +139 -32
- package/dist/es/a/Shapes/Shapes.js +9 -1
- package/dist/es/a/Shapes/styles.scss +35 -1
- package/dist/es/a/index.js +2 -1
- package/dist/es/b/Button/Button.js +8 -2
- package/dist/es/b/Button/styles.scss +28 -8
- package/dist/es/b/Page/common/Section/Section.js +17 -3
- package/package.json +3 -3
- package/src/__snapshots__/Storyshots.test.js.snap +1632 -162
- package/src/local.scss +1 -0
- package/src/stories/a/BackgroundGradient.stories.jsx +38 -0
- package/src/stories/a/Conversation.stories.jsx +78 -1
- package/src/stories/a/Shapes.stories.jsx +18 -0
- package/src/stories/b/Button.stories.jsx +22 -0
- package/src/stories/b/Page.stories.jsx +25 -1
- package/src/ui/a/BackgroundGradient/BackgroundGradient.jsx +76 -0
- package/src/ui/a/BackgroundGradient/index.js +2 -0
- package/src/ui/a/BackgroundGradient/styles.scss +16 -0
- package/src/ui/a/Conversation/Conversation.jsx +15 -7
- package/src/ui/a/Conversation/common/Message/Message.jsx +40 -7
- package/src/ui/a/Conversation/styles.scss +139 -32
- package/src/ui/a/Shapes/Shapes.jsx +10 -0
- package/src/ui/a/Shapes/styles.scss +35 -1
- package/src/ui/a/index.js +1 -0
- package/src/ui/b/Button/Button.jsx +7 -0
- package/src/ui/b/Button/styles.scss +28 -8
- package/src/ui/b/Page/common/Section/Section.jsx +19 -2
|
@@ -54,6 +54,8 @@ const Shapes = ({
|
|
|
54
54
|
>
|
|
55
55
|
{ shape === 'triangle'
|
|
56
56
|
&& <div className="triangle" />}
|
|
57
|
+
{ shape === 'inverted-triangle'
|
|
58
|
+
&& <div className="inverted-triangle" />}
|
|
57
59
|
{ shape === 'half-ellipses'
|
|
58
60
|
&& (
|
|
59
61
|
<div className="half-ellipses">
|
|
@@ -105,6 +107,12 @@ const Shapes = ({
|
|
|
105
107
|
<div className="ellipse-two" />
|
|
106
108
|
</div>
|
|
107
109
|
)}
|
|
110
|
+
{shape === 'intersecting-circles' && (
|
|
111
|
+
<div className="intersecting-circles">
|
|
112
|
+
<div className="left" />
|
|
113
|
+
<div className="right" />
|
|
114
|
+
</div>
|
|
115
|
+
)}
|
|
108
116
|
</div>
|
|
109
117
|
)
|
|
110
118
|
}
|
|
@@ -163,6 +171,8 @@ Shapes.propTypes = {
|
|
|
163
171
|
'ellipses',
|
|
164
172
|
'rectangles',
|
|
165
173
|
'rotated-ellipses',
|
|
174
|
+
'inverted-triangle',
|
|
175
|
+
'intersecting-circles',
|
|
166
176
|
]),
|
|
167
177
|
|
|
168
178
|
/**
|
|
@@ -29,6 +29,14 @@ $default-shapes-opacity:.8;
|
|
|
29
29
|
width: var(--shape-height, #{$default-triangle-height});
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
.inverted-triangle {
|
|
33
|
+
background-image: linear-gradient(var(--dark-y), transparent);
|
|
34
|
+
clip-path: polygon(50% 0, 0 100%, 100% 100%);
|
|
35
|
+
height: calc(var(--shape-height, #{$default-triangle-height}) * 0.86);
|
|
36
|
+
opacity: $default-shapes-opacity;
|
|
37
|
+
width: var(--shape-height, #{$default-triangle-height});
|
|
38
|
+
}
|
|
39
|
+
|
|
32
40
|
.half-ellipses {
|
|
33
41
|
height: var(--shape-height, #{$default-ellipse-height});
|
|
34
42
|
opacity: $default-shapes-opacity;
|
|
@@ -218,4 +226,30 @@ $default-shapes-opacity:.8;
|
|
|
218
226
|
clip-path: ellipse(50% 35% at 50% 50%);
|
|
219
227
|
}
|
|
220
228
|
}
|
|
221
|
-
|
|
229
|
+
|
|
230
|
+
.intersecting-circles {
|
|
231
|
+
height: var(--shape-height, #{$default-circle-height});
|
|
232
|
+
opacity: $default-shapes-opacity;
|
|
233
|
+
width: calc(var(--shape-height, #{$default-circle-height}) * 2);
|
|
234
|
+
display: grid;
|
|
235
|
+
grid-template-columns: repeat(7, 1fr);
|
|
236
|
+
position: relative;
|
|
237
|
+
|
|
238
|
+
> * {
|
|
239
|
+
border-radius: 50%;
|
|
240
|
+
height: 100%;
|
|
241
|
+
width: 100%;
|
|
242
|
+
position: absolute;
|
|
243
|
+
opacity: .8;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.left {
|
|
247
|
+
background-image: linear-gradient(to right ,var(--dark-y),var(--y), transparent);
|
|
248
|
+
grid-column: 1 / 5;
|
|
249
|
+
}
|
|
250
|
+
.right {
|
|
251
|
+
background-image: linear-gradient(to left, var(--dark-y), var(--y), transparent);
|
|
252
|
+
grid-column: 4 / 8;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
package/src/ui/a/index.js
CHANGED
|
@@ -23,6 +23,7 @@ const Button = ({
|
|
|
23
23
|
isCompact,
|
|
24
24
|
isGhost,
|
|
25
25
|
isSimple,
|
|
26
|
+
arrowDirection,
|
|
26
27
|
...otherProps
|
|
27
28
|
}) => {
|
|
28
29
|
useLayoutEffect(() => {
|
|
@@ -40,6 +41,7 @@ const Button = ({
|
|
|
40
41
|
isGhost && styleNames.modifierGhost,
|
|
41
42
|
isCompact && styleNames.modifierCompact,
|
|
42
43
|
isSimple && styleNames.modifierSimple,
|
|
44
|
+
arrowDirection && `arrow-${arrowDirection}`,
|
|
43
45
|
]
|
|
44
46
|
.filter((e) => e)
|
|
45
47
|
.join(' ')}
|
|
@@ -103,6 +105,11 @@ Button.propTypes = {
|
|
|
103
105
|
* Button loading state
|
|
104
106
|
*/
|
|
105
107
|
isLoading:PropTypes.bool,
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* The direction of the arrow if the button has one
|
|
111
|
+
*/
|
|
112
|
+
arrowDirection:PropTypes.string,
|
|
106
113
|
}
|
|
107
114
|
|
|
108
115
|
Button.defaultProps = {
|
|
@@ -6,22 +6,41 @@ $default-padding: 1em 1em .84em;
|
|
|
6
6
|
$compact-padding: .6em .6em .48em;
|
|
7
7
|
$default-color:primary;
|
|
8
8
|
$font-weight:bold;
|
|
9
|
+
$default-margin:.5em;
|
|
9
10
|
|
|
10
11
|
.#{bem.$base}.button {
|
|
11
12
|
background: var(--x, var(--#{$default-color}));
|
|
12
13
|
border: transparent;
|
|
13
14
|
border-radius: var(--theme-border-radius);
|
|
14
15
|
color: var(--on-x, var(--on-#{$default-color}));
|
|
16
|
+
display: inline-flex;
|
|
15
17
|
font-weight: 600;
|
|
18
|
+
font-family: var(--theme-default-paragraph);
|
|
19
|
+
justify-content: space-between;
|
|
16
20
|
padding: $default-padding;
|
|
17
21
|
transition: all .25s;
|
|
18
22
|
|
|
23
|
+
&.arrow-right {
|
|
24
|
+
&::after {
|
|
25
|
+
content: "-->";
|
|
26
|
+
margin-left: $default-margin;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&.arrow-left {
|
|
31
|
+
&::before {
|
|
32
|
+
content: "<--";
|
|
33
|
+
margin-right: $default-margin;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
19
37
|
&:not(:disabled) {
|
|
20
38
|
cursor: pointer;
|
|
21
39
|
|
|
22
40
|
&:hover {
|
|
23
41
|
background: var(--light-x, var(--light-#{$default-color}));
|
|
24
42
|
}
|
|
43
|
+
|
|
25
44
|
&:focus {
|
|
26
45
|
background: var(--dark-x, var(--dark-#{$default-color}));
|
|
27
46
|
}
|
|
@@ -39,7 +58,7 @@ $font-weight:bold;
|
|
|
39
58
|
|
|
40
59
|
&:hover,
|
|
41
60
|
&:focus,
|
|
42
|
-
&:disabled{
|
|
61
|
+
&:disabled {
|
|
43
62
|
background: transparent;
|
|
44
63
|
}
|
|
45
64
|
|
|
@@ -55,7 +74,7 @@ $font-weight:bold;
|
|
|
55
74
|
}
|
|
56
75
|
}
|
|
57
76
|
|
|
58
|
-
&:disabled{
|
|
77
|
+
&:disabled {
|
|
59
78
|
border: 1px solid var(--x, var(--#{$default-color}));
|
|
60
79
|
color: var(--x, var(--#{$default-color}));
|
|
61
80
|
}
|
|
@@ -65,6 +84,7 @@ $font-weight:bold;
|
|
|
65
84
|
background: transparent;
|
|
66
85
|
border: 1px solid transparent;
|
|
67
86
|
color: var(--x, var(--#{$default-color}));
|
|
87
|
+
padding: 0;
|
|
68
88
|
|
|
69
89
|
&:disabled,
|
|
70
90
|
&:hover,
|
|
@@ -73,13 +93,13 @@ $font-weight:bold;
|
|
|
73
93
|
}
|
|
74
94
|
|
|
75
95
|
&:not(:disabled) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
96
|
+
&:hover {
|
|
97
|
+
color: var(--light-x, var(--light-#{$default-color}));
|
|
98
|
+
}
|
|
79
99
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
100
|
+
&:focus {
|
|
101
|
+
color: var(--dark-x, var(--dark-#{$default-color}));
|
|
102
|
+
}
|
|
83
103
|
}
|
|
84
104
|
|
|
85
105
|
&:disabled {
|
|
@@ -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,
|
|
@@ -45,11 +47,16 @@ const Section = ({
|
|
|
45
47
|
<Shapes
|
|
46
48
|
verticalAlign={backgroundVerticalAlign}
|
|
47
49
|
horizontalAlign={backgroundHorizontalAlign}
|
|
48
|
-
|
|
50
|
+
overflow={backgroundOverflow}
|
|
49
51
|
height={backgroundHeight}
|
|
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 = {
|