@pareto-engineering/design-system 2.0.0-alpha.37 → 2.0.0-alpha.38
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/Conversation/Conversation.js +3 -4
- package/dist/cjs/a/Conversation/common/Message/Message.js +1 -2
- package/dist/cjs/a/Conversation/styles.scss +49 -45
- package/dist/es/a/Conversation/Conversation.js +3 -4
- package/dist/es/a/Conversation/common/Message/Message.js +1 -2
- package/dist/es/a/Conversation/styles.scss +49 -45
- package/package.json +2 -2
- package/src/__snapshots__/Storyshots.test.js.snap +6 -6
- package/src/ui/a/Conversation/Conversation.jsx +2 -2
- package/src/ui/a/Conversation/common/Message/Message.jsx +1 -2
- package/src/ui/a/Conversation/styles.scss +49 -45
|
@@ -45,12 +45,11 @@ var Conversation = _ref => {
|
|
|
45
45
|
return /*#__PURE__*/React.createElement(_Context.default.Provider, {
|
|
46
46
|
value: {
|
|
47
47
|
ourColor,
|
|
48
|
-
theirColor
|
|
49
|
-
hasTriangle
|
|
48
|
+
theirColor
|
|
50
49
|
}
|
|
51
50
|
}, /*#__PURE__*/React.createElement("div", {
|
|
52
51
|
id: id,
|
|
53
|
-
className: [baseClassName, componentClassName, userClassName, "y-".concat(backgroundColor), 'u1'].filter(e => e).join(' '),
|
|
52
|
+
className: [baseClassName, componentClassName, userClassName, hasTriangle && 'has-triangle', "y-".concat(backgroundColor), 'u1'].filter(e => e).join(' '),
|
|
54
53
|
style: style
|
|
55
54
|
}, children));
|
|
56
55
|
};
|
|
@@ -100,7 +99,7 @@ Conversation.defaultProps = {
|
|
|
100
99
|
backgroundColor: 'background2',
|
|
101
100
|
ourColor: 'background1',
|
|
102
101
|
theirColor: 'background1',
|
|
103
|
-
hasTriangle:
|
|
102
|
+
hasTriangle: false
|
|
104
103
|
};
|
|
105
104
|
Conversation.Message = _common.Message;
|
|
106
105
|
var _default = Conversation;
|
|
@@ -41,13 +41,12 @@ var Message = _ref => {
|
|
|
41
41
|
|
|
42
42
|
} = _ref;
|
|
43
43
|
var {
|
|
44
|
-
hasTriangle,
|
|
45
44
|
ourColor,
|
|
46
45
|
theirColor
|
|
47
46
|
} = (0, _useConversation.default)();
|
|
48
47
|
return /*#__PURE__*/React.createElement("div", {
|
|
49
48
|
id: id,
|
|
50
|
-
className: [baseClassName, componentClassName, userClassName, "x-".concat(from === 'ours' ? ourColor : theirColor), from === 'ours' && 'ours',
|
|
49
|
+
className: [baseClassName, componentClassName, userClassName, "x-".concat(from === 'ours' ? ourColor : theirColor), from === 'ours' && 'ours', 'v1'].filter(e => e).join(' '),
|
|
51
50
|
style: style
|
|
52
51
|
}, /*#__PURE__*/React.createElement("div", {
|
|
53
52
|
className: _bem.default.elementContent
|
|
@@ -39,51 +39,9 @@ $triangle-after-side:25px;
|
|
|
39
39
|
// animation-delay: 3s;
|
|
40
40
|
// }
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
// animation: fadeIn 1s ease-in both;
|
|
46
|
-
border: $default-message-border;
|
|
47
|
-
border-radius: var(--theme-border-radius);
|
|
48
|
-
max-width: $default-message-max-width;
|
|
49
|
-
min-width: $default-message-min-width;
|
|
50
|
-
padding: $default-padding;
|
|
51
|
-
position: relative;
|
|
52
|
-
|
|
53
|
-
.#{bem.$element-content} {
|
|
54
|
-
display: flex;
|
|
55
|
-
flex-direction: column;
|
|
56
|
-
|
|
57
|
-
>p {
|
|
58
|
-
color: var(--on-x);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.sender {
|
|
62
|
-
font-weight: 800;
|
|
63
|
-
margin-bottom: .5em;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.attachment {
|
|
67
|
-
align-self: baseline;
|
|
68
|
-
background-color: var(--y);
|
|
69
|
-
display: flex;
|
|
70
|
-
flex-direction: row;
|
|
71
|
-
padding: .5em 1em;
|
|
72
|
-
|
|
73
|
-
> p {
|
|
74
|
-
margin-bottom: 0;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
> img {
|
|
78
|
-
width: 40px;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
&.#{bem.$base}.ours {
|
|
83
|
-
align-self: flex-end;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
&.has-triangle {
|
|
42
|
+
&.has-triangle {
|
|
43
|
+
padding-bottom: calc(#{$default-padding} * 2);
|
|
44
|
+
.#{bem.$base}.message {
|
|
87
45
|
::before {
|
|
88
46
|
border-bottom: $triangle-border2;
|
|
89
47
|
border-left: $triangle-border2;
|
|
@@ -138,6 +96,52 @@ $triangle-after-side:25px;
|
|
|
138
96
|
}
|
|
139
97
|
}
|
|
140
98
|
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.#{bem.$base}.message {
|
|
102
|
+
align-self: flex-start;
|
|
103
|
+
background-color: var(--x);
|
|
104
|
+
// animation: fadeIn 1s ease-in both;
|
|
105
|
+
border: $default-message-border;
|
|
106
|
+
border-radius: var(--theme-border-radius);
|
|
107
|
+
max-width: $default-message-max-width;
|
|
108
|
+
min-width: $default-message-min-width;
|
|
109
|
+
padding: $default-padding;
|
|
110
|
+
position: relative;
|
|
111
|
+
|
|
112
|
+
.#{bem.$element-content} {
|
|
113
|
+
display: flex;
|
|
114
|
+
flex-direction: column;
|
|
115
|
+
|
|
116
|
+
>p {
|
|
117
|
+
color: var(--on-x);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.sender {
|
|
121
|
+
font-weight: 800;
|
|
122
|
+
margin-bottom: .5em;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.attachment {
|
|
126
|
+
align-self: baseline;
|
|
127
|
+
background-color: var(--y);
|
|
128
|
+
display: flex;
|
|
129
|
+
flex-direction: row;
|
|
130
|
+
padding: .5em 1em;
|
|
131
|
+
|
|
132
|
+
> p {
|
|
133
|
+
margin-bottom: 0;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
> img {
|
|
137
|
+
width: 40px;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
&.#{bem.$base}.ours {
|
|
142
|
+
align-self: flex-end;
|
|
143
|
+
}
|
|
144
|
+
|
|
141
145
|
|
|
142
146
|
// mobile style
|
|
143
147
|
@include mixins.media($to:$sm-md) {
|
|
@@ -29,12 +29,11 @@ const Conversation = ({
|
|
|
29
29
|
return /*#__PURE__*/React.createElement(ConversationContext.Provider, {
|
|
30
30
|
value: {
|
|
31
31
|
ourColor,
|
|
32
|
-
theirColor
|
|
33
|
-
hasTriangle
|
|
32
|
+
theirColor
|
|
34
33
|
}
|
|
35
34
|
}, /*#__PURE__*/React.createElement("div", {
|
|
36
35
|
id: id,
|
|
37
|
-
className: [baseClassName, componentClassName, userClassName, `y-${backgroundColor}`, 'u1'].filter(e => e).join(' '),
|
|
36
|
+
className: [baseClassName, componentClassName, userClassName, hasTriangle && 'has-triangle', `y-${backgroundColor}`, 'u1'].filter(e => e).join(' '),
|
|
38
37
|
style: style
|
|
39
38
|
}, children));
|
|
40
39
|
};
|
|
@@ -84,7 +83,7 @@ Conversation.defaultProps = {
|
|
|
84
83
|
backgroundColor: 'background2',
|
|
85
84
|
ourColor: 'background1',
|
|
86
85
|
theirColor: 'background1',
|
|
87
|
-
hasTriangle:
|
|
86
|
+
hasTriangle: false
|
|
88
87
|
};
|
|
89
88
|
Conversation.Message = Message;
|
|
90
89
|
export default Conversation;
|
|
@@ -23,13 +23,12 @@ const Message = ({
|
|
|
23
23
|
|
|
24
24
|
}) => {
|
|
25
25
|
const {
|
|
26
|
-
hasTriangle,
|
|
27
26
|
ourColor,
|
|
28
27
|
theirColor
|
|
29
28
|
} = useConversation();
|
|
30
29
|
return /*#__PURE__*/React.createElement("div", {
|
|
31
30
|
id: id,
|
|
32
|
-
className: [baseClassName, componentClassName, userClassName, `x-${from === 'ours' ? ourColor : theirColor}`, from === 'ours' && 'ours',
|
|
31
|
+
className: [baseClassName, componentClassName, userClassName, `x-${from === 'ours' ? ourColor : theirColor}`, from === 'ours' && 'ours', 'v1'].filter(e => e).join(' '),
|
|
33
32
|
style: style
|
|
34
33
|
}, /*#__PURE__*/React.createElement("div", {
|
|
35
34
|
className: styleNames.elementContent
|
|
@@ -39,51 +39,9 @@ $triangle-after-side:25px;
|
|
|
39
39
|
// animation-delay: 3s;
|
|
40
40
|
// }
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
// animation: fadeIn 1s ease-in both;
|
|
46
|
-
border: $default-message-border;
|
|
47
|
-
border-radius: var(--theme-border-radius);
|
|
48
|
-
max-width: $default-message-max-width;
|
|
49
|
-
min-width: $default-message-min-width;
|
|
50
|
-
padding: $default-padding;
|
|
51
|
-
position: relative;
|
|
52
|
-
|
|
53
|
-
.#{bem.$element-content} {
|
|
54
|
-
display: flex;
|
|
55
|
-
flex-direction: column;
|
|
56
|
-
|
|
57
|
-
>p {
|
|
58
|
-
color: var(--on-x);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.sender {
|
|
62
|
-
font-weight: 800;
|
|
63
|
-
margin-bottom: .5em;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.attachment {
|
|
67
|
-
align-self: baseline;
|
|
68
|
-
background-color: var(--y);
|
|
69
|
-
display: flex;
|
|
70
|
-
flex-direction: row;
|
|
71
|
-
padding: .5em 1em;
|
|
72
|
-
|
|
73
|
-
> p {
|
|
74
|
-
margin-bottom: 0;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
> img {
|
|
78
|
-
width: 40px;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
&.#{bem.$base}.ours {
|
|
83
|
-
align-self: flex-end;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
&.has-triangle {
|
|
42
|
+
&.has-triangle {
|
|
43
|
+
padding-bottom: calc(#{$default-padding} * 2);
|
|
44
|
+
.#{bem.$base}.message {
|
|
87
45
|
::before {
|
|
88
46
|
border-bottom: $triangle-border2;
|
|
89
47
|
border-left: $triangle-border2;
|
|
@@ -138,6 +96,52 @@ $triangle-after-side:25px;
|
|
|
138
96
|
}
|
|
139
97
|
}
|
|
140
98
|
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.#{bem.$base}.message {
|
|
102
|
+
align-self: flex-start;
|
|
103
|
+
background-color: var(--x);
|
|
104
|
+
// animation: fadeIn 1s ease-in both;
|
|
105
|
+
border: $default-message-border;
|
|
106
|
+
border-radius: var(--theme-border-radius);
|
|
107
|
+
max-width: $default-message-max-width;
|
|
108
|
+
min-width: $default-message-min-width;
|
|
109
|
+
padding: $default-padding;
|
|
110
|
+
position: relative;
|
|
111
|
+
|
|
112
|
+
.#{bem.$element-content} {
|
|
113
|
+
display: flex;
|
|
114
|
+
flex-direction: column;
|
|
115
|
+
|
|
116
|
+
>p {
|
|
117
|
+
color: var(--on-x);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.sender {
|
|
121
|
+
font-weight: 800;
|
|
122
|
+
margin-bottom: .5em;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.attachment {
|
|
126
|
+
align-self: baseline;
|
|
127
|
+
background-color: var(--y);
|
|
128
|
+
display: flex;
|
|
129
|
+
flex-direction: row;
|
|
130
|
+
padding: .5em 1em;
|
|
131
|
+
|
|
132
|
+
> p {
|
|
133
|
+
margin-bottom: 0;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
> img {
|
|
137
|
+
width: 40px;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
&.#{bem.$base}.ours {
|
|
142
|
+
align-self: flex-end;
|
|
143
|
+
}
|
|
144
|
+
|
|
141
145
|
|
|
142
146
|
// mobile style
|
|
143
147
|
@include mixins.media($to:$sm-md) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pareto-engineering/design-system",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.38",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/es/index.js",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"stylelint-config-palantir": "^5.1.0"
|
|
80
80
|
},
|
|
81
81
|
"dependencies": {
|
|
82
|
-
"@pareto-engineering/assets": "^2.0.0-alpha.
|
|
82
|
+
"@pareto-engineering/assets": "^2.0.0-alpha.16",
|
|
83
83
|
"@pareto-engineering/bem": "^0.1.5",
|
|
84
84
|
"@pareto-engineering/styles": "^2.0.0-alpha.8",
|
|
85
85
|
"date-fns": "^2.22.1",
|
|
@@ -711,10 +711,10 @@ exports[`Storyshots a/Conversation With Attachment 1`] = `
|
|
|
711
711
|
|
|
712
712
|
exports[`Storyshots a/Conversation With Triangle 1`] = `
|
|
713
713
|
<div
|
|
714
|
-
className="base conversation y-background2 u1"
|
|
714
|
+
className="base conversation has-triangle y-background2 u1"
|
|
715
715
|
>
|
|
716
716
|
<div
|
|
717
|
-
className="base message x-background1
|
|
717
|
+
className="base message x-background1 v1"
|
|
718
718
|
>
|
|
719
719
|
<div
|
|
720
720
|
className="elementContent"
|
|
@@ -731,7 +731,7 @@ exports[`Storyshots a/Conversation With Triangle 1`] = `
|
|
|
731
731
|
</div>
|
|
732
732
|
</div>
|
|
733
733
|
<div
|
|
734
|
-
className="base message x-background1 ours
|
|
734
|
+
className="base message x-background1 ours v1"
|
|
735
735
|
>
|
|
736
736
|
<div
|
|
737
737
|
className="elementContent"
|
|
@@ -748,7 +748,7 @@ exports[`Storyshots a/Conversation With Triangle 1`] = `
|
|
|
748
748
|
</div>
|
|
749
749
|
</div>
|
|
750
750
|
<div
|
|
751
|
-
className="base message x-background1
|
|
751
|
+
className="base message x-background1 v1"
|
|
752
752
|
>
|
|
753
753
|
<div
|
|
754
754
|
className="elementContent"
|
|
@@ -765,7 +765,7 @@ exports[`Storyshots a/Conversation With Triangle 1`] = `
|
|
|
765
765
|
</div>
|
|
766
766
|
</div>
|
|
767
767
|
<div
|
|
768
|
-
className="base message x-background1 ours
|
|
768
|
+
className="base message x-background1 ours v1"
|
|
769
769
|
>
|
|
770
770
|
<div
|
|
771
771
|
className="elementContent"
|
|
@@ -2251,7 +2251,7 @@ exports[`Storyshots a/Timestamp Distance Format 1`] = `
|
|
|
2251
2251
|
className="base timestamp"
|
|
2252
2252
|
onClick={[Function]}
|
|
2253
2253
|
>
|
|
2254
|
-
in
|
|
2254
|
+
in 7 months
|
|
2255
2255
|
</p>
|
|
2256
2256
|
`;
|
|
2257
2257
|
|
|
@@ -40,7 +40,6 @@ const Conversation = ({
|
|
|
40
40
|
value={{
|
|
41
41
|
ourColor,
|
|
42
42
|
theirColor,
|
|
43
|
-
hasTriangle,
|
|
44
43
|
}}
|
|
45
44
|
>
|
|
46
45
|
<div
|
|
@@ -49,6 +48,7 @@ const Conversation = ({
|
|
|
49
48
|
baseClassName,
|
|
50
49
|
componentClassName,
|
|
51
50
|
userClassName,
|
|
51
|
+
hasTriangle && 'has-triangle',
|
|
52
52
|
`y-${backgroundColor}`,
|
|
53
53
|
'u1',
|
|
54
54
|
]
|
|
@@ -107,7 +107,7 @@ Conversation.defaultProps = {
|
|
|
107
107
|
backgroundColor:'background2',
|
|
108
108
|
ourColor :'background1',
|
|
109
109
|
theirColor :'background1',
|
|
110
|
-
hasTriangle :
|
|
110
|
+
hasTriangle :false,
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
Conversation.Message = Message
|
|
@@ -28,7 +28,7 @@ const Message = ({
|
|
|
28
28
|
attachmentColor,
|
|
29
29
|
// ...otherProps
|
|
30
30
|
}) => {
|
|
31
|
-
const {
|
|
31
|
+
const { ourColor, theirColor } = useConversation()
|
|
32
32
|
|
|
33
33
|
return (
|
|
34
34
|
<div
|
|
@@ -39,7 +39,6 @@ const Message = ({
|
|
|
39
39
|
userClassName,
|
|
40
40
|
`x-${from === 'ours' ? ourColor : theirColor}`,
|
|
41
41
|
from === 'ours' && 'ours',
|
|
42
|
-
hasTriangle === true ? 'has-triangle' : '',
|
|
43
42
|
'v1',
|
|
44
43
|
]
|
|
45
44
|
.filter((e) => e)
|
|
@@ -39,51 +39,9 @@ $triangle-after-side:25px;
|
|
|
39
39
|
// animation-delay: 3s;
|
|
40
40
|
// }
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
// animation: fadeIn 1s ease-in both;
|
|
46
|
-
border: $default-message-border;
|
|
47
|
-
border-radius: var(--theme-border-radius);
|
|
48
|
-
max-width: $default-message-max-width;
|
|
49
|
-
min-width: $default-message-min-width;
|
|
50
|
-
padding: $default-padding;
|
|
51
|
-
position: relative;
|
|
52
|
-
|
|
53
|
-
.#{bem.$element-content} {
|
|
54
|
-
display: flex;
|
|
55
|
-
flex-direction: column;
|
|
56
|
-
|
|
57
|
-
>p {
|
|
58
|
-
color: var(--on-x);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.sender {
|
|
62
|
-
font-weight: 800;
|
|
63
|
-
margin-bottom: .5em;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.attachment {
|
|
67
|
-
align-self: baseline;
|
|
68
|
-
background-color: var(--y);
|
|
69
|
-
display: flex;
|
|
70
|
-
flex-direction: row;
|
|
71
|
-
padding: .5em 1em;
|
|
72
|
-
|
|
73
|
-
> p {
|
|
74
|
-
margin-bottom: 0;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
> img {
|
|
78
|
-
width: 40px;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
&.#{bem.$base}.ours {
|
|
83
|
-
align-self: flex-end;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
&.has-triangle {
|
|
42
|
+
&.has-triangle {
|
|
43
|
+
padding-bottom: calc(#{$default-padding} * 2);
|
|
44
|
+
.#{bem.$base}.message {
|
|
87
45
|
::before {
|
|
88
46
|
border-bottom: $triangle-border2;
|
|
89
47
|
border-left: $triangle-border2;
|
|
@@ -138,6 +96,52 @@ $triangle-after-side:25px;
|
|
|
138
96
|
}
|
|
139
97
|
}
|
|
140
98
|
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.#{bem.$base}.message {
|
|
102
|
+
align-self: flex-start;
|
|
103
|
+
background-color: var(--x);
|
|
104
|
+
// animation: fadeIn 1s ease-in both;
|
|
105
|
+
border: $default-message-border;
|
|
106
|
+
border-radius: var(--theme-border-radius);
|
|
107
|
+
max-width: $default-message-max-width;
|
|
108
|
+
min-width: $default-message-min-width;
|
|
109
|
+
padding: $default-padding;
|
|
110
|
+
position: relative;
|
|
111
|
+
|
|
112
|
+
.#{bem.$element-content} {
|
|
113
|
+
display: flex;
|
|
114
|
+
flex-direction: column;
|
|
115
|
+
|
|
116
|
+
>p {
|
|
117
|
+
color: var(--on-x);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.sender {
|
|
121
|
+
font-weight: 800;
|
|
122
|
+
margin-bottom: .5em;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.attachment {
|
|
126
|
+
align-self: baseline;
|
|
127
|
+
background-color: var(--y);
|
|
128
|
+
display: flex;
|
|
129
|
+
flex-direction: row;
|
|
130
|
+
padding: .5em 1em;
|
|
131
|
+
|
|
132
|
+
> p {
|
|
133
|
+
margin-bottom: 0;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
> img {
|
|
137
|
+
width: 40px;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
&.#{bem.$base}.ours {
|
|
142
|
+
align-self: flex-end;
|
|
143
|
+
}
|
|
144
|
+
|
|
141
145
|
|
|
142
146
|
// mobile style
|
|
143
147
|
@include mixins.media($to:$sm-md) {
|