@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
package/src/local.scss
CHANGED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
|
|
4
|
+
import { BackgroundGradient } from 'ui'
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title :'a/BackgroundGradient',
|
|
8
|
+
component :BackgroundGradient,
|
|
9
|
+
subcomponents:{
|
|
10
|
+
// Item:BackgroundGradient.Item
|
|
11
|
+
},
|
|
12
|
+
decorators:[
|
|
13
|
+
// storyfn => <div className="">{ storyfn() }</div>,
|
|
14
|
+
],
|
|
15
|
+
argTypes:{
|
|
16
|
+
height:{ control: 'text' },
|
|
17
|
+
color :{ control: 'text' },
|
|
18
|
+
},
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// eslint-disable-next-line react/prop-types
|
|
22
|
+
const Template = ({ color, ...rest }) => (
|
|
23
|
+
<div
|
|
24
|
+
className={`y-${color}`}
|
|
25
|
+
style={{
|
|
26
|
+
position:'relative',
|
|
27
|
+
height :'700px',
|
|
28
|
+
}}
|
|
29
|
+
>
|
|
30
|
+
<BackgroundGradient {...rest} />
|
|
31
|
+
</div>
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
export const Base = Template.bind({})
|
|
35
|
+
Base.args = {
|
|
36
|
+
height:'50em',
|
|
37
|
+
color :'background4',
|
|
38
|
+
}
|
|
@@ -25,7 +25,7 @@ export const Base = () => {
|
|
|
25
25
|
from :'theirs',
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
|
-
message:'Hi
|
|
28
|
+
message:'Hi Morgan! Here is the database we prepared for you.',
|
|
29
29
|
sender :'CAMILLE',
|
|
30
30
|
from :'ours',
|
|
31
31
|
},
|
|
@@ -34,6 +34,83 @@ export const Base = () => {
|
|
|
34
34
|
sender :'HUMBL',
|
|
35
35
|
from :'theirs',
|
|
36
36
|
},
|
|
37
|
+
{
|
|
38
|
+
message:'Hi Morgan! Here is the database we prepared for you.',
|
|
39
|
+
sender :'CAMILLE',
|
|
40
|
+
from :'ours',
|
|
41
|
+
},
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<Conversation>
|
|
46
|
+
{conversations.map((conversation) => (
|
|
47
|
+
<Conversation.Message key={conversation.message} {...conversation} />
|
|
48
|
+
))}
|
|
49
|
+
</Conversation>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export const WithTriangle = () => {
|
|
54
|
+
const conversations = [
|
|
55
|
+
{
|
|
56
|
+
message:'Hi Camille, please compile an assesment of top 5 firms/brand providers for the listed fields in the US.',
|
|
57
|
+
sender :'HUMBL',
|
|
58
|
+
from :'theirs',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
message:'Hi Morgan! Here is the database we prepared for you.',
|
|
62
|
+
sender :'CAMILLE',
|
|
63
|
+
from :'ours',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
message:'Hi Camille, please compile an assesment of top 5 firms/brand providers for the listed fields in the US.',
|
|
67
|
+
sender :'HUMBL',
|
|
68
|
+
from :'theirs',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
message:'Hi Morgan! Here is the database we prepared for you.',
|
|
72
|
+
sender :'CAMILLE',
|
|
73
|
+
from :'ours',
|
|
74
|
+
},
|
|
75
|
+
]
|
|
76
|
+
|
|
77
|
+
return (
|
|
78
|
+
<Conversation
|
|
79
|
+
hasTriangle
|
|
80
|
+
>
|
|
81
|
+
{conversations.map((conversation) => (
|
|
82
|
+
<Conversation.Message key={conversation.message} {...conversation} />
|
|
83
|
+
))}
|
|
84
|
+
</Conversation>
|
|
85
|
+
)
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export const WithAttachment = () => {
|
|
89
|
+
const conversations = [
|
|
90
|
+
{
|
|
91
|
+
message:'Hi Camille, please compile an assesment of top 5 firms/brand providers for the listed fields in the US.',
|
|
92
|
+
sender :'HUMBL',
|
|
93
|
+
from :'theirs',
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
message :'Hi Morgan! Here is the database we prepared for you.',
|
|
97
|
+
sender :'CAMILLE',
|
|
98
|
+
from :'ours',
|
|
99
|
+
attachment :'spreadsheet.xlsx',
|
|
100
|
+
attachmentColor:'main4',
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
message:'Hi Camille, please compile an assesment of top 5 firms/brand providers for the listed fields in the US.',
|
|
104
|
+
sender :'HUMBL',
|
|
105
|
+
from :'theirs',
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
message :'Hi Morgan! Here is the database we prepared for you.',
|
|
109
|
+
sender :'CAMILLE',
|
|
110
|
+
from :'ours',
|
|
111
|
+
attachment :'spreadsheet.xlsx',
|
|
112
|
+
attachmentColor:'main4',
|
|
113
|
+
},
|
|
37
114
|
]
|
|
38
115
|
|
|
39
116
|
return (
|
|
@@ -42,6 +42,15 @@ Triangle.args = {
|
|
|
42
42
|
shape :'triangle',
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
export const InvertedTriangle = Template.bind({})
|
|
46
|
+
InvertedTriangle.args = {
|
|
47
|
+
height :'30em',
|
|
48
|
+
verticalAlign :'flex-end',
|
|
49
|
+
horizontalAlign:'center',
|
|
50
|
+
color :'background6',
|
|
51
|
+
shape :'inverted-triangle',
|
|
52
|
+
}
|
|
53
|
+
|
|
45
54
|
export const HalfEllipses = Template.bind({})
|
|
46
55
|
HalfEllipses.args = {
|
|
47
56
|
height :'25em',
|
|
@@ -123,3 +132,12 @@ RotatedEllipses.args = {
|
|
|
123
132
|
color :'background5',
|
|
124
133
|
shape :'rotated-ellipses',
|
|
125
134
|
}
|
|
135
|
+
|
|
136
|
+
export const IntersectingCircles = Template.bind({})
|
|
137
|
+
IntersectingCircles.args = {
|
|
138
|
+
height :'30em',
|
|
139
|
+
verticalAlign :'center',
|
|
140
|
+
horizontalAlign:'center',
|
|
141
|
+
color :'background5',
|
|
142
|
+
shape :'intersecting-circles',
|
|
143
|
+
}
|
|
@@ -82,3 +82,25 @@ export const Loading = MultipleTemplate.bind({})
|
|
|
82
82
|
Loading.args = {
|
|
83
83
|
isLoading:true,
|
|
84
84
|
}
|
|
85
|
+
|
|
86
|
+
export const ArrowLeft = MultipleTemplate.bind({})
|
|
87
|
+
ArrowLeft.args = {
|
|
88
|
+
arrowDirection:'left',
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export const ArrowRight = MultipleTemplate.bind({})
|
|
92
|
+
ArrowRight.args = {
|
|
93
|
+
arrowDirection:'right',
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export const ArrowLeftSimple = MultipleTemplate.bind({})
|
|
97
|
+
ArrowLeftSimple.args = {
|
|
98
|
+
arrowDirection:'left',
|
|
99
|
+
isSimple :true,
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export const ArrowRightSimple = MultipleTemplate.bind({})
|
|
103
|
+
ArrowRightSimple.args = {
|
|
104
|
+
arrowDirection:'right',
|
|
105
|
+
isSimple :true,
|
|
106
|
+
}
|
|
@@ -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
|
+
)
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
|
|
4
|
+
import { useLayoutEffect } from 'react'
|
|
5
|
+
|
|
6
|
+
import PropTypes from 'prop-types'
|
|
7
|
+
|
|
8
|
+
import styleNames from '@pareto-engineering/bem'
|
|
9
|
+
|
|
10
|
+
// Local Definitions
|
|
11
|
+
|
|
12
|
+
const baseClassName = styleNames.base
|
|
13
|
+
|
|
14
|
+
const componentClassName = 'background-gradient'
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* This is the component description.
|
|
18
|
+
*/
|
|
19
|
+
const BackgroundGradient = ({
|
|
20
|
+
id,
|
|
21
|
+
className:userClassName,
|
|
22
|
+
style,
|
|
23
|
+
height,
|
|
24
|
+
// ...otherProps
|
|
25
|
+
}) => {
|
|
26
|
+
useLayoutEffect(() => {
|
|
27
|
+
import('./styles.scss')
|
|
28
|
+
}, [])
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<div
|
|
32
|
+
id={id}
|
|
33
|
+
className={[
|
|
34
|
+
|
|
35
|
+
baseClassName,
|
|
36
|
+
|
|
37
|
+
componentClassName,
|
|
38
|
+
userClassName,
|
|
39
|
+
]
|
|
40
|
+
.filter((e) => e)
|
|
41
|
+
.join(' ')}
|
|
42
|
+
style={{
|
|
43
|
+
...style,
|
|
44
|
+
'--gradient-height':height,
|
|
45
|
+
}}
|
|
46
|
+
/>
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
BackgroundGradient.propTypes = {
|
|
51
|
+
/**
|
|
52
|
+
* The HTML id for this element
|
|
53
|
+
*/
|
|
54
|
+
id:PropTypes.string,
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* The HTML class names for this element
|
|
58
|
+
*/
|
|
59
|
+
className:PropTypes.string,
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* The React-written, css properties for this element.
|
|
63
|
+
*/
|
|
64
|
+
style:PropTypes.objectOf(PropTypes.string),
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* The height of the shape.
|
|
68
|
+
*/
|
|
69
|
+
height:PropTypes.string,
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
BackgroundGradient.defaultProps = {
|
|
73
|
+
// someProp: false,
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export default BackgroundGradient
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
@use "@pareto-engineering/bem";
|
|
3
|
+
|
|
4
|
+
.#{bem.$base}.background-gradient{
|
|
5
|
+
position: absolute;
|
|
6
|
+
top: 0;
|
|
7
|
+
left: 0;
|
|
8
|
+
width: 100%;
|
|
9
|
+
height: var(--gradient-height);
|
|
10
|
+
background-image: linear-gradient(transparent, var(--y) 25%, var(--light-y) 75%, transparent);
|
|
11
|
+
opacity: .4;
|
|
12
|
+
z-index: -1;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
@@ -28,19 +28,19 @@ const Conversation = ({
|
|
|
28
28
|
ourColor,
|
|
29
29
|
theirColor,
|
|
30
30
|
children,
|
|
31
|
+
hasTriangle,
|
|
31
32
|
// ...otherProps
|
|
32
33
|
}) => {
|
|
33
34
|
useLayoutEffect(() => {
|
|
34
35
|
import('./styles.scss')
|
|
35
36
|
}, [])
|
|
36
37
|
|
|
37
|
-
// const messageColors = { ours: color, theirs: 'main2' }
|
|
38
|
-
|
|
39
38
|
return (
|
|
40
39
|
<ConversationContext.Provider
|
|
41
40
|
value={{
|
|
42
41
|
ourColor,
|
|
43
42
|
theirColor,
|
|
43
|
+
hasTriangle,
|
|
44
44
|
}}
|
|
45
45
|
>
|
|
46
46
|
<div
|
|
@@ -76,11 +76,13 @@ Conversation.propTypes = {
|
|
|
76
76
|
/**
|
|
77
77
|
* The React-written, css properties for this element.
|
|
78
78
|
*/
|
|
79
|
-
style
|
|
79
|
+
style:PropTypes.objectOf(PropTypes.string),
|
|
80
|
+
|
|
80
81
|
/**
|
|
81
82
|
* The base color to our messages component
|
|
82
83
|
*/
|
|
83
|
-
ourColor
|
|
84
|
+
ourColor:PropTypes.string,
|
|
85
|
+
|
|
84
86
|
/**
|
|
85
87
|
* The base color to their messages component
|
|
86
88
|
*/
|
|
@@ -94,12 +96,18 @@ Conversation.propTypes = {
|
|
|
94
96
|
* The children JSX
|
|
95
97
|
*/
|
|
96
98
|
children :PropTypes.node,
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* whether to add triangle to bubble chats
|
|
102
|
+
*/
|
|
103
|
+
hasTriangle:PropTypes.bool,
|
|
97
104
|
}
|
|
98
105
|
|
|
99
106
|
Conversation.defaultProps = {
|
|
100
|
-
backgroundColor:'
|
|
101
|
-
ourColor :'
|
|
102
|
-
theirColor :'
|
|
107
|
+
backgroundColor:'background2',
|
|
108
|
+
ourColor :'background1',
|
|
109
|
+
theirColor :'background1',
|
|
110
|
+
hasTriangle :'false',
|
|
103
111
|
}
|
|
104
112
|
|
|
105
113
|
Conversation.Message = Message
|
|
@@ -23,9 +23,12 @@ const Message = ({
|
|
|
23
23
|
message,
|
|
24
24
|
sender,
|
|
25
25
|
from,
|
|
26
|
+
attachment,
|
|
27
|
+
attachmentIcon,
|
|
28
|
+
attachmentColor,
|
|
26
29
|
// ...otherProps
|
|
27
30
|
}) => {
|
|
28
|
-
const { ourColor, theirColor } = useConversation()
|
|
31
|
+
const { hasTriangle, ourColor, theirColor } = useConversation()
|
|
29
32
|
|
|
30
33
|
return (
|
|
31
34
|
<div
|
|
@@ -36,6 +39,8 @@ const Message = ({
|
|
|
36
39
|
userClassName,
|
|
37
40
|
`x-${from === 'ours' ? ourColor : theirColor}`,
|
|
38
41
|
from === 'ours' && 'ours',
|
|
42
|
+
hasTriangle === true ? 'has-triangle' : '',
|
|
43
|
+
'v1',
|
|
39
44
|
]
|
|
40
45
|
.filter((e) => e)
|
|
41
46
|
.join(' ')}
|
|
@@ -49,11 +54,19 @@ const Message = ({
|
|
|
49
54
|
<p>
|
|
50
55
|
{message}
|
|
51
56
|
</p>
|
|
57
|
+
{attachment
|
|
58
|
+
&& (
|
|
59
|
+
<div className={`attachment y-${attachmentColor}`}>
|
|
60
|
+
<span className="f-icons">{attachmentIcon}</span>
|
|
61
|
+
<p className="ml-v">
|
|
62
|
+
{attachment}
|
|
63
|
+
</p>
|
|
64
|
+
</div>
|
|
65
|
+
)}
|
|
52
66
|
</div>
|
|
53
67
|
</div>
|
|
54
68
|
)
|
|
55
69
|
}
|
|
56
|
-
|
|
57
70
|
Message.propTypes = {
|
|
58
71
|
/**
|
|
59
72
|
* The HTML id for this element
|
|
@@ -65,26 +78,46 @@ Message.propTypes = {
|
|
|
65
78
|
*/
|
|
66
79
|
className:PropTypes.string,
|
|
67
80
|
|
|
81
|
+
/**
|
|
82
|
+
* The React-written, css properties for this element.
|
|
83
|
+
*/
|
|
84
|
+
style:PropTypes.objectOf(PropTypes.string),
|
|
85
|
+
|
|
68
86
|
/**
|
|
69
87
|
* The message in the conversation
|
|
70
88
|
*/
|
|
71
89
|
message:PropTypes.string.isRequired,
|
|
90
|
+
|
|
72
91
|
/**
|
|
73
92
|
* The sender of the message
|
|
74
93
|
*/
|
|
75
|
-
sender
|
|
94
|
+
sender:PropTypes.string.isRequired,
|
|
95
|
+
|
|
76
96
|
/**
|
|
77
97
|
* The owner of the message
|
|
78
98
|
*/
|
|
79
|
-
from
|
|
99
|
+
from:PropTypes.oneOf(['ours', 'theirs']),
|
|
100
|
+
|
|
80
101
|
/**
|
|
81
|
-
*
|
|
102
|
+
* name of the attachment file
|
|
103
|
+
*/
|
|
104
|
+
attachment:PropTypes.string,
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* source of the attachment icon
|
|
108
|
+
*/
|
|
109
|
+
attachmentIcon:PropTypes.string,
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* background color of the attachment box
|
|
82
113
|
*/
|
|
83
|
-
|
|
114
|
+
attachmentColor:PropTypes.string,
|
|
84
115
|
}
|
|
85
116
|
|
|
86
117
|
Message.defaultProps = {
|
|
87
|
-
from:'theirs',
|
|
118
|
+
from :'theirs',
|
|
119
|
+
attachmentIcon :'A',
|
|
120
|
+
attachmentColor:'main4',
|
|
88
121
|
}
|
|
89
122
|
|
|
90
123
|
export default Message
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
|
|
2
3
|
@use "@pareto-engineering/bem";
|
|
3
4
|
@use "@aztlan/stylebook/src/mixins";
|
|
4
5
|
@use "@aztlan/stylebook/src/globals" as *;
|
|
@@ -8,47 +9,153 @@ $default-conversation-background: var(--y);
|
|
|
8
9
|
$default-message-max-width: calc(100% - #{$default-padding});
|
|
9
10
|
$default-message-min-width: 12em;
|
|
10
11
|
$default-message-border: var(--theme-border);
|
|
12
|
+
$triangle-border-size: 15px;
|
|
13
|
+
$triangle-border-style: $triangle-border-size solid;
|
|
14
|
+
$triangle-border-style-subtracted: ($triangle-border-size - 1px) solid;
|
|
15
|
+
$triangle-border1: $triangle-border-style var(--paragraph);
|
|
16
|
+
$triangle-border2: $triangle-border-style transparent;
|
|
17
|
+
$triangle-border3: $triangle-border-style-subtracted var(--x);
|
|
18
|
+
$triangle-border4: $triangle-border-style-subtracted transparent;
|
|
19
|
+
$triangle-before-side:24px;
|
|
20
|
+
$triangle-before-bottom:-30px;
|
|
21
|
+
$triangle-after-bottom:-27px;
|
|
22
|
+
$triangle-after-side:25px;
|
|
11
23
|
|
|
12
24
|
.#{bem.$base}.conversation {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
25
|
+
background-color: $default-conversation-background;
|
|
26
|
+
border-radius: var(--theme-border-radius);
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
padding: $default-padding;
|
|
30
|
+
|
|
31
|
+
>:not(:last-child) {
|
|
32
|
+
margin-bottom: $default-padding;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// >:nth-child(1) {
|
|
36
|
+
// animation-delay: 1s;
|
|
37
|
+
// }
|
|
38
|
+
// >:nth-child(2) {
|
|
39
|
+
// animation-delay: 3s;
|
|
40
|
+
// }
|
|
41
|
+
|
|
42
|
+
.#{bem.$base}.message {
|
|
43
|
+
align-self: flex-start;
|
|
44
|
+
background-color: var(--x);
|
|
45
|
+
// animation: fadeIn 1s ease-in both;
|
|
46
|
+
border: $default-message-border;
|
|
17
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;
|
|
18
52
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
+
}
|
|
22
65
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
.#{bem.$element-content} {
|
|
33
|
-
display: flex;
|
|
34
|
-
flex-direction: column;
|
|
35
|
-
|
|
36
|
-
>p {
|
|
37
|
-
color: var(--on-x);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.sender {
|
|
41
|
-
font-weight: 800;
|
|
42
|
-
margin-bottom: .5em;
|
|
43
|
-
}
|
|
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;
|
|
44
75
|
}
|
|
45
|
-
}
|
|
46
76
|
|
|
47
|
-
|
|
48
|
-
|
|
77
|
+
> img {
|
|
78
|
+
width: 40px;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
&.#{bem.$base}.ours {
|
|
83
|
+
align-self: flex-end;
|
|
49
84
|
}
|
|
50
85
|
|
|
51
|
-
|
|
86
|
+
&.has-triangle {
|
|
87
|
+
::before {
|
|
88
|
+
border-bottom: $triangle-border2;
|
|
89
|
+
border-left: $triangle-border2;
|
|
90
|
+
border-right: $triangle-border1;
|
|
91
|
+
border-top: $triangle-border1;
|
|
92
|
+
bottom: $triangle-before-bottom;
|
|
93
|
+
content: "";
|
|
94
|
+
height: 0;
|
|
95
|
+
position: absolute;
|
|
96
|
+
right: $triangle-before-side;
|
|
97
|
+
width: 0;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
::after {
|
|
101
|
+
border-bottom: $triangle-border4;
|
|
102
|
+
border-left: $triangle-border4;
|
|
103
|
+
border-right: $triangle-border3;
|
|
104
|
+
border-top: $triangle-border3;
|
|
105
|
+
bottom: $triangle-after-bottom;
|
|
106
|
+
content: "";
|
|
107
|
+
height: 0;
|
|
108
|
+
position: absolute;
|
|
109
|
+
right: $triangle-after-side;
|
|
110
|
+
width: 0;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&:not(.ours) {
|
|
114
|
+
::before {
|
|
115
|
+
border-bottom: $triangle-border2;
|
|
116
|
+
border-left: $triangle-border1;
|
|
117
|
+
border-right: $triangle-border2;
|
|
118
|
+
border-top: $triangle-border1;
|
|
119
|
+
bottom: $triangle-before-bottom;
|
|
120
|
+
content: "";
|
|
121
|
+
height: 0;
|
|
122
|
+
left: $triangle-before-side;
|
|
123
|
+
position: absolute;
|
|
124
|
+
width: 0;
|
|
125
|
+
}
|
|
52
126
|
|
|
127
|
+
::after {
|
|
128
|
+
border-bottom: $triangle-border4;
|
|
129
|
+
border-left: $triangle-border3;
|
|
130
|
+
border-right: $triangle-border4;
|
|
131
|
+
border-top: $triangle-border3;
|
|
132
|
+
bottom: $triangle-after-bottom;
|
|
133
|
+
content: "";
|
|
134
|
+
height: 0;
|
|
135
|
+
left: $triangle-after-side;
|
|
136
|
+
position: absolute;
|
|
137
|
+
width: 0;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
53
141
|
|
|
142
|
+
// mobile style
|
|
143
|
+
@include mixins.media($to:$sm-md) {
|
|
144
|
+
.message {
|
|
145
|
+
margin-top: 2em;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
54
150
|
|
|
151
|
+
//@keyframes fadeIn {
|
|
152
|
+
// from {
|
|
153
|
+
// opacity: 0;
|
|
154
|
+
// transform: translate3d(0, 50%, 0);
|
|
155
|
+
// }
|
|
156
|
+
//
|
|
157
|
+
// to {
|
|
158
|
+
// opacity: 1;
|
|
159
|
+
// transform: translate3d(0, 0, 0);
|
|
160
|
+
// }
|
|
161
|
+
//}
|