@pareto-engineering/design-system 4.0.0-alpha.18 → 4.0.0-alpha.21
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/ContentTree/ContentTree.js +8 -2
- package/dist/cjs/a/ContentTree/common/Tree/Tree.js +12 -5
- package/dist/cjs/a/ContentTree/styles.scss +24 -14
- package/dist/cjs/a/Conversation/Conversation.js +1 -1
- package/dist/cjs/a/Conversation/common/Message/Message.js +2 -3
- package/dist/cjs/a/Conversation/styles.scss +44 -28
- package/dist/cjs/a/SnapScroller/styles.scss +9 -4
- package/dist/cjs/b/Button/Button.js +4 -1
- package/dist/cjs/b/Button/styles.scss +22 -4
- package/dist/cjs/b/ThemeSelector/ThemeSelector.js +15 -22
- package/dist/cjs/b/ThemeSelector/styles.scss +2 -8
- package/dist/es/a/ContentTree/ContentTree.js +8 -2
- package/dist/es/a/ContentTree/common/Tree/Tree.js +12 -5
- package/dist/es/a/ContentTree/styles.scss +24 -14
- package/dist/es/a/Conversation/Conversation.js +1 -1
- package/dist/es/a/Conversation/common/Message/Message.js +2 -3
- package/dist/es/a/Conversation/styles.scss +44 -28
- package/dist/es/a/SnapScroller/styles.scss +9 -4
- package/dist/es/b/Button/Button.js +4 -1
- package/dist/es/b/Button/styles.scss +22 -4
- package/dist/es/b/ThemeSelector/ThemeSelector.js +15 -23
- package/dist/es/b/ThemeSelector/styles.scss +2 -8
- package/package.json +4 -4
- package/src/stories/a/Conversation.stories.jsx +5 -1
- package/src/ui/a/ContentTree/ContentTree.jsx +7 -3
- package/src/ui/a/ContentTree/common/Tree/Tree.jsx +19 -7
- package/src/ui/a/ContentTree/styles.scss +24 -14
- package/src/ui/a/Conversation/Conversation.jsx +3 -1
- package/src/ui/a/Conversation/common/Message/Message.jsx +3 -5
- package/src/ui/a/Conversation/styles.scss +44 -28
- package/src/ui/a/SnapScroller/styles.scss +9 -4
- package/src/ui/b/Button/Button.jsx +4 -1
- package/src/ui/b/Button/styles.scss +22 -4
- package/src/ui/b/ThemeSelector/ThemeSelector.jsx +8 -21
- package/src/ui/b/ThemeSelector/styles.scss +2 -8
- package/tests/__snapshots__/Storyshots.test.js.snap +1615 -949
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
/* stylelint-disable selector-max-compound-selectors -- Required here */
|
|
2
3
|
|
|
3
4
|
@use "@pareto-engineering/bem";
|
|
4
5
|
@use "@pareto-engineering/styles/src/mixins";
|
|
@@ -12,39 +13,54 @@ $default-message-border: 1px solid var(--hard-background-cards);
|
|
|
12
13
|
|
|
13
14
|
.#{bem.$base}.conversation {
|
|
14
15
|
background: var(--y);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
> .message
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
16
|
+
|
|
17
|
+
> .#{bem.$base}.section {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
|
|
21
|
+
> .#{bem.$base}.message + .#{bem.$base}.message {
|
|
22
|
+
padding-top: $default-padding;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
> .#{bem.$base}.message.ours + .#{bem.$base}.message.ours,
|
|
26
|
+
> .#{bem.$base}.message.theirs + .#{bem.$base}.message.theirs {
|
|
27
|
+
padding-top: calc($default-padding / 2);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
> .#{bem.$base}.message {
|
|
31
|
+
align-self: flex-start;
|
|
32
|
+
max-width: $default-message-max-width;
|
|
33
|
+
min-width: $default-message-min-width;
|
|
34
|
+
position: relative;
|
|
35
|
+
|
|
36
|
+
> .sender {
|
|
37
|
+
margin: 0;
|
|
35
38
|
}
|
|
36
39
|
|
|
37
|
-
> .
|
|
38
|
-
|
|
39
|
-
|
|
40
|
+
> .message-content {
|
|
41
|
+
background-color: var(--x);
|
|
42
|
+
border: $default-message-border;
|
|
43
|
+
border-radius: $default-border-radius;
|
|
40
44
|
display: flex;
|
|
41
|
-
flex-direction:
|
|
42
|
-
|
|
45
|
+
flex-direction: column;
|
|
46
|
+
padding: 0 $default-padding;
|
|
47
|
+
|
|
48
|
+
> p {
|
|
49
|
+
color: var(--on-x);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
> .attachment {
|
|
53
|
+
align-items: center;
|
|
54
|
+
align-self: flex-end;
|
|
55
|
+
display: flex;
|
|
56
|
+
flex-direction: row;
|
|
57
|
+
gap: calc($default-padding / 2);
|
|
58
|
+
}
|
|
43
59
|
}
|
|
44
|
-
}
|
|
45
60
|
|
|
46
|
-
|
|
47
|
-
|
|
61
|
+
&.#{bem.$base}.ours {
|
|
62
|
+
align-self: flex-end;
|
|
63
|
+
}
|
|
48
64
|
}
|
|
49
65
|
}
|
|
50
66
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
@use "@pareto-engineering/styles/src/mixins";
|
|
6
6
|
@use "@pareto-engineering/styles/src/globals" as *;
|
|
7
7
|
|
|
8
|
-
$default-spacing: var(--gap
|
|
8
|
+
$default-spacing: var(--gap);
|
|
9
9
|
|
|
10
10
|
.#{bem.$base}.snap-scroller {
|
|
11
11
|
display: flex;
|
|
@@ -27,10 +27,11 @@ $default-spacing: var(--gap, 1em);
|
|
|
27
27
|
&:first-child {
|
|
28
28
|
margin-left: $default-spacing;
|
|
29
29
|
}
|
|
30
|
+
}
|
|
30
31
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
&::after {
|
|
33
|
+
content: "";
|
|
34
|
+
min-width: calc($default-spacing / 2);
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
@include mixins.media($from: $sm-md) {
|
|
@@ -40,6 +41,10 @@ $default-spacing: var(--gap, 1em);
|
|
|
40
41
|
scroll-snap-type: none;
|
|
41
42
|
scrollbar-width: unset;
|
|
42
43
|
|
|
44
|
+
&::after {
|
|
45
|
+
display: none;
|
|
46
|
+
}
|
|
47
|
+
|
|
43
48
|
>* {
|
|
44
49
|
min-width: unset;
|
|
45
50
|
|
|
@@ -31,6 +31,9 @@ const Button = ({
|
|
|
31
31
|
useInsertionEffect(() => {
|
|
32
32
|
import("./styles.scss");
|
|
33
33
|
}, []);
|
|
34
|
+
const buttonText = isSimple ? /*#__PURE__*/React.createElement("span", {
|
|
35
|
+
className: styleNames.modifierUnderlined
|
|
36
|
+
}, children) : children;
|
|
34
37
|
return /*#__PURE__*/React.createElement("button", _extends({
|
|
35
38
|
id: id,
|
|
36
39
|
className: [baseClassName, componentClassName, userClassName, `x-${color}`, isGhost && styleNames.modifierGhost, isCompact && styleNames.modifierCompact, isSimple && styleNames.modifierSimple, isGradient && styleNames.modifierGradient, isSpaced && styleNames.modifierSpaced, arrowDirection && `arrow-${arrowDirection}`].filter(e => e).join(' '),
|
|
@@ -41,7 +44,7 @@ const Button = ({
|
|
|
41
44
|
'--x': 'var(--on-x)'
|
|
42
45
|
},
|
|
43
46
|
heightWidth: "1.15em"
|
|
44
|
-
}) :
|
|
47
|
+
}) : buttonText);
|
|
45
48
|
};
|
|
46
49
|
Button.propTypes = {
|
|
47
50
|
/**
|
|
@@ -20,7 +20,8 @@ $default-animation-time: .31s;
|
|
|
20
20
|
font-weight: 400;
|
|
21
21
|
justify-content: space-between;
|
|
22
22
|
padding: $default-padding;
|
|
23
|
-
transition: all .25s
|
|
23
|
+
transition: all .25s;
|
|
24
|
+
white-space: nowrap;//var(--theme-default-paragraph);
|
|
24
25
|
|
|
25
26
|
&.arrow-right {
|
|
26
27
|
&::after {
|
|
@@ -57,7 +58,10 @@ $default-animation-time: .31s;
|
|
|
57
58
|
&:not(:disabled) {
|
|
58
59
|
cursor: pointer;
|
|
59
60
|
|
|
60
|
-
&:hover
|
|
61
|
+
&:hover
|
|
62
|
+
:not(.#{bem.$modifier-gradient})
|
|
63
|
+
:not(.#{bem.$modifier-ghost})
|
|
64
|
+
:not(.#{bem.$modifier-simple}) {
|
|
61
65
|
background: var(--soft-x, var(--soft-#{$default-color}));
|
|
62
66
|
}
|
|
63
67
|
|
|
@@ -67,8 +71,18 @@ $default-animation-time: .31s;
|
|
|
67
71
|
}
|
|
68
72
|
|
|
69
73
|
&.#{bem.$modifier-gradient} {
|
|
70
|
-
background: linear-gradient(
|
|
71
|
-
|
|
74
|
+
background-image: linear-gradient(
|
|
75
|
+
to right,
|
|
76
|
+
var(--hard-x) 30%,
|
|
77
|
+
var(--x) 50%,
|
|
78
|
+
var(--hard-x) 100%
|
|
79
|
+
);
|
|
80
|
+
background-position: left;
|
|
81
|
+
background-size: 200% auto;
|
|
82
|
+
|
|
83
|
+
&:not(:disabled):hover {
|
|
84
|
+
background-position: right center;
|
|
85
|
+
}
|
|
72
86
|
}
|
|
73
87
|
|
|
74
88
|
&.#{bem.$modifier-compact} {
|
|
@@ -115,6 +129,10 @@ $default-animation-time: .31s;
|
|
|
115
129
|
color: var(--x, var(--#{$default-color}));
|
|
116
130
|
padding: 0;
|
|
117
131
|
|
|
132
|
+
> .#{bem.$modifier-underlined} {
|
|
133
|
+
text-decoration: underline;
|
|
134
|
+
}
|
|
135
|
+
|
|
118
136
|
&:disabled,
|
|
119
137
|
&:hover,
|
|
120
138
|
&:focus {
|
|
@@ -17,8 +17,7 @@ const ThemeSelector = ({
|
|
|
17
17
|
id,
|
|
18
18
|
className: userClassName,
|
|
19
19
|
style,
|
|
20
|
-
themes
|
|
21
|
-
iconMap
|
|
20
|
+
themes
|
|
22
21
|
}) => {
|
|
23
22
|
const {
|
|
24
23
|
userTheme,
|
|
@@ -31,15 +30,18 @@ const ThemeSelector = ({
|
|
|
31
30
|
const current = themes.indexOf(userTheme);
|
|
32
31
|
setPreferredTheme(themes[(current + 1) % themes.length]);
|
|
33
32
|
}, [userTheme]);
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
33
|
+
const themeText = userTheme && userTheme.charAt(0).toUpperCase() + userTheme.slice(1);
|
|
34
|
+
return (
|
|
35
|
+
/*#__PURE__*/
|
|
36
|
+
// eslint-disable-next-line jsx-a11y/anchor-is-valid, jsx-a11y/no-static-element-interactions
|
|
37
|
+
React.createElement("a", {
|
|
38
|
+
className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
|
|
39
|
+
id: id,
|
|
40
|
+
style: style,
|
|
41
|
+
onClick: loopThemes,
|
|
42
|
+
onKeyDown: loopThemes
|
|
43
|
+
}, themeText)
|
|
44
|
+
);
|
|
43
45
|
};
|
|
44
46
|
ThemeSelector.propTypes = {
|
|
45
47
|
/**
|
|
@@ -57,19 +59,9 @@ ThemeSelector.propTypes = {
|
|
|
57
59
|
/**
|
|
58
60
|
* The themes and the order in which they appear
|
|
59
61
|
*/
|
|
60
|
-
themes: PropTypes.arrayOf(PropTypes.string)
|
|
61
|
-
/**
|
|
62
|
-
* A map of the theme names with the icons that represent them. Uses the default font icon.
|
|
63
|
-
*/
|
|
64
|
-
iconMap: PropTypes.objectOf(PropTypes.string)
|
|
62
|
+
themes: PropTypes.arrayOf(PropTypes.string)
|
|
65
63
|
};
|
|
66
64
|
ThemeSelector.defaultProps = {
|
|
67
|
-
themes: ['light', 'dark']
|
|
68
|
-
iconMap: {
|
|
69
|
-
dark: 'd',
|
|
70
|
-
// sun,
|
|
71
|
-
light: 'T' // moon,
|
|
72
|
-
}
|
|
65
|
+
themes: ['light', 'dark']
|
|
73
66
|
};
|
|
74
|
-
|
|
75
67
|
export default ThemeSelector;
|
|
@@ -2,14 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
@use "@pareto-engineering/bem";
|
|
4
4
|
|
|
5
|
-
$default-color:var(--x, var(--contrast));
|
|
6
|
-
|
|
7
5
|
.#{bem.$base}.theme-selector {
|
|
8
|
-
align-items: center;
|
|
9
|
-
background: transparent;
|
|
10
|
-
border: none;
|
|
11
|
-
color: $default-color;
|
|
12
6
|
cursor: pointer;
|
|
13
|
-
display:
|
|
14
|
-
|
|
7
|
+
display: block;
|
|
8
|
+
text-decoration: none;
|
|
15
9
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pareto-engineering/design-system",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.21",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/es/index.js",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@pareto-engineering/assets": "^4.0.0-alpha.11",
|
|
54
|
-
"@pareto-engineering/bem": "^4.0.0-alpha.
|
|
55
|
-
"@pareto-engineering/styles": "^4.0.0-alpha.
|
|
54
|
+
"@pareto-engineering/bem": "^4.0.0-alpha.20",
|
|
55
|
+
"@pareto-engineering/styles": "^4.0.0-alpha.20",
|
|
56
56
|
"date-fns": "^2.29.3",
|
|
57
57
|
"downshift": "^6.1.12",
|
|
58
58
|
"formik": "^2.2.9",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"relay-test-utils": "^15.0.0"
|
|
68
68
|
},
|
|
69
69
|
"browserslist": "> 2%",
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "470f5e6dbe7b4b4da5f6e066303e9a41a744583e"
|
|
71
71
|
}
|
|
@@ -30,10 +30,14 @@ export const Base = () => {
|
|
|
30
30
|
from :'ours',
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
|
-
message:'
|
|
33
|
+
message:'That looks amazing',
|
|
34
34
|
sender :'Humbl',
|
|
35
35
|
from :'theirs',
|
|
36
36
|
},
|
|
37
|
+
{
|
|
38
|
+
message:'Thank you for the great work, can we also get this information in a spreadsheet?',
|
|
39
|
+
from :'theirs',
|
|
40
|
+
},
|
|
37
41
|
{
|
|
38
42
|
message:'Hi Morgan! Here is the spreadsheet we prepared for you.',
|
|
39
43
|
sender :'Camille',
|
|
@@ -23,6 +23,7 @@ const ContentTree = ({
|
|
|
23
23
|
style,
|
|
24
24
|
target,
|
|
25
25
|
selectors,
|
|
26
|
+
color,
|
|
26
27
|
// ...otherProps
|
|
27
28
|
}) => {
|
|
28
29
|
useInsertionEffect(() => {
|
|
@@ -35,9 +36,7 @@ const ContentTree = ({
|
|
|
35
36
|
<div
|
|
36
37
|
id={id}
|
|
37
38
|
className={[
|
|
38
|
-
|
|
39
39
|
baseClassName,
|
|
40
|
-
|
|
41
40
|
componentClassName,
|
|
42
41
|
userClassName,
|
|
43
42
|
]
|
|
@@ -46,7 +45,7 @@ const ContentTree = ({
|
|
|
46
45
|
style={style}
|
|
47
46
|
// {...otherProps}
|
|
48
47
|
>
|
|
49
|
-
<Tree tree={contentTree} />
|
|
48
|
+
<Tree color={color} tree={contentTree} />
|
|
50
49
|
</div>
|
|
51
50
|
)
|
|
52
51
|
}
|
|
@@ -79,6 +78,11 @@ ContentTree.propTypes = {
|
|
|
79
78
|
PropTypes.func,
|
|
80
79
|
PropTypes.shape({ current: PropTypes.node }),
|
|
81
80
|
]),
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* The color for the tree.
|
|
84
|
+
*/
|
|
85
|
+
color:PropTypes.string,
|
|
82
86
|
}
|
|
83
87
|
|
|
84
88
|
ContentTree.defaultProps = {
|
|
@@ -7,6 +7,8 @@ import PropTypes from 'prop-types'
|
|
|
7
7
|
|
|
8
8
|
import styleNames from '@pareto-engineering/bem/exports'
|
|
9
9
|
|
|
10
|
+
import { Card } from 'ui'
|
|
11
|
+
|
|
10
12
|
// Local Definitions
|
|
11
13
|
|
|
12
14
|
import useFirstVisibleNode from '../useFirstVisibleNode'
|
|
@@ -24,6 +26,7 @@ const Tree = ({
|
|
|
24
26
|
style,
|
|
25
27
|
tree,
|
|
26
28
|
displayDepth,
|
|
29
|
+
color,
|
|
27
30
|
// ...otherProps
|
|
28
31
|
}) => {
|
|
29
32
|
// The nodeIds to be used to get the first visible node
|
|
@@ -80,23 +83,26 @@ const Tree = ({
|
|
|
80
83
|
[tree],
|
|
81
84
|
)
|
|
82
85
|
|
|
83
|
-
return (
|
|
84
|
-
<
|
|
86
|
+
return ContentTree.length ? (
|
|
87
|
+
<Card
|
|
85
88
|
id={id}
|
|
86
89
|
className={[
|
|
87
|
-
|
|
88
90
|
baseClassName,
|
|
89
|
-
|
|
90
91
|
componentClassName,
|
|
91
92
|
userClassName,
|
|
93
|
+
color && `x-${color}`,
|
|
92
94
|
]
|
|
93
95
|
.filter((e) => e)
|
|
94
96
|
.join(' ')}
|
|
95
97
|
style={style}
|
|
96
98
|
>
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
99
|
+
<Card.Section>
|
|
100
|
+
<ul>
|
|
101
|
+
{ContentTree}
|
|
102
|
+
</ul>
|
|
103
|
+
</Card.Section>
|
|
104
|
+
</Card>
|
|
105
|
+
) : null
|
|
100
106
|
}
|
|
101
107
|
Tree.propTypes = {
|
|
102
108
|
/**
|
|
@@ -129,9 +135,15 @@ Tree.propTypes = {
|
|
|
129
135
|
* The levels of the tree to display.
|
|
130
136
|
*/
|
|
131
137
|
displayDepth:PropTypes.number,
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* The color of the tree.
|
|
141
|
+
*/
|
|
142
|
+
color:PropTypes.string,
|
|
132
143
|
}
|
|
133
144
|
|
|
134
145
|
Tree.defaultProps = {
|
|
146
|
+
color :'interactive',
|
|
135
147
|
displayDepth:4,
|
|
136
148
|
}
|
|
137
149
|
|
|
@@ -3,26 +3,38 @@
|
|
|
3
3
|
|
|
4
4
|
@use "@pareto-engineering/bem";
|
|
5
5
|
|
|
6
|
+
$default-dot-size: .5em;
|
|
6
7
|
$default-margin: 1em;
|
|
7
8
|
$default-padding: 1em;
|
|
8
9
|
|
|
9
10
|
.#{bem.$base}.content-tree {
|
|
10
|
-
|
|
11
|
-
list-style: none;
|
|
12
|
-
|
|
13
|
-
> li > p > a {
|
|
14
|
-
color: var(--paragraph);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.#{bem.$base}.tree {
|
|
19
|
-
padding: 0;
|
|
11
|
+
> .#{bem.$base}.tree {
|
|
20
12
|
position: sticky;
|
|
21
13
|
top: 0;
|
|
22
14
|
|
|
15
|
+
ul {
|
|
16
|
+
list-style: none;
|
|
17
|
+
padding: 0 $default-padding;
|
|
18
|
+
|
|
19
|
+
> li > p > a {
|
|
20
|
+
color: var(--paragraph);
|
|
21
|
+
text-decoration: none;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
23
25
|
.#{bem.$modifier-active} {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
font-weight: 700;
|
|
27
|
+
|
|
28
|
+
&::before {
|
|
29
|
+
background: var(--x);
|
|
30
|
+
border-radius: 50%;
|
|
31
|
+
content: "";
|
|
32
|
+
display: inline-block;
|
|
33
|
+
height: $default-dot-size;
|
|
34
|
+
margin-right: $default-margin;
|
|
35
|
+
text-align: center;
|
|
36
|
+
width: $default-dot-size;
|
|
37
|
+
}
|
|
26
38
|
}
|
|
27
39
|
|
|
28
40
|
li:not(:last-child) {
|
|
@@ -34,5 +46,3 @@ $default-padding: 1em;
|
|
|
34
46
|
}
|
|
35
47
|
}
|
|
36
48
|
}
|
|
37
|
-
|
|
38
|
-
|
|
@@ -5,8 +5,6 @@ import PropTypes from 'prop-types'
|
|
|
5
5
|
|
|
6
6
|
import styleNames from '@pareto-engineering/bem/exports'
|
|
7
7
|
|
|
8
|
-
import { Card } from 'ui'
|
|
9
|
-
|
|
10
8
|
// Local Definitions
|
|
11
9
|
|
|
12
10
|
import useConversation from '../../useConversation'
|
|
@@ -33,14 +31,14 @@ const Message = ({
|
|
|
33
31
|
const { ourColor, theirColor } = useConversation()
|
|
34
32
|
|
|
35
33
|
return (
|
|
36
|
-
<
|
|
34
|
+
<div
|
|
37
35
|
id={id}
|
|
38
36
|
className={[
|
|
39
37
|
baseClassName,
|
|
40
38
|
componentClassName,
|
|
41
39
|
userClassName,
|
|
42
40
|
`x-${from === 'ours' ? ourColor : theirColor}`,
|
|
43
|
-
from
|
|
41
|
+
from,
|
|
44
42
|
]
|
|
45
43
|
.filter((e) => e)
|
|
46
44
|
.join(' ')}
|
|
@@ -66,7 +64,7 @@ const Message = ({
|
|
|
66
64
|
</div>
|
|
67
65
|
)}
|
|
68
66
|
</div>
|
|
69
|
-
</
|
|
67
|
+
</div>
|
|
70
68
|
)
|
|
71
69
|
}
|
|
72
70
|
Message.propTypes = {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
/* stylelint-disable selector-max-compound-selectors -- Required here */
|
|
2
3
|
|
|
3
4
|
@use "@pareto-engineering/bem";
|
|
4
5
|
@use "@pareto-engineering/styles/src/mixins";
|
|
@@ -12,39 +13,54 @@ $default-message-border: 1px solid var(--hard-background-cards);
|
|
|
12
13
|
|
|
13
14
|
.#{bem.$base}.conversation {
|
|
14
15
|
background: var(--y);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
> .message
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
16
|
+
|
|
17
|
+
> .#{bem.$base}.section {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
|
|
21
|
+
> .#{bem.$base}.message + .#{bem.$base}.message {
|
|
22
|
+
padding-top: $default-padding;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
> .#{bem.$base}.message.ours + .#{bem.$base}.message.ours,
|
|
26
|
+
> .#{bem.$base}.message.theirs + .#{bem.$base}.message.theirs {
|
|
27
|
+
padding-top: calc($default-padding / 2);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
> .#{bem.$base}.message {
|
|
31
|
+
align-self: flex-start;
|
|
32
|
+
max-width: $default-message-max-width;
|
|
33
|
+
min-width: $default-message-min-width;
|
|
34
|
+
position: relative;
|
|
35
|
+
|
|
36
|
+
> .sender {
|
|
37
|
+
margin: 0;
|
|
35
38
|
}
|
|
36
39
|
|
|
37
|
-
> .
|
|
38
|
-
|
|
39
|
-
|
|
40
|
+
> .message-content {
|
|
41
|
+
background-color: var(--x);
|
|
42
|
+
border: $default-message-border;
|
|
43
|
+
border-radius: $default-border-radius;
|
|
40
44
|
display: flex;
|
|
41
|
-
flex-direction:
|
|
42
|
-
|
|
45
|
+
flex-direction: column;
|
|
46
|
+
padding: 0 $default-padding;
|
|
47
|
+
|
|
48
|
+
> p {
|
|
49
|
+
color: var(--on-x);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
> .attachment {
|
|
53
|
+
align-items: center;
|
|
54
|
+
align-self: flex-end;
|
|
55
|
+
display: flex;
|
|
56
|
+
flex-direction: row;
|
|
57
|
+
gap: calc($default-padding / 2);
|
|
58
|
+
}
|
|
43
59
|
}
|
|
44
|
-
}
|
|
45
60
|
|
|
46
|
-
|
|
47
|
-
|
|
61
|
+
&.#{bem.$base}.ours {
|
|
62
|
+
align-self: flex-end;
|
|
63
|
+
}
|
|
48
64
|
}
|
|
49
65
|
}
|
|
50
66
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
@use "@pareto-engineering/styles/src/mixins";
|
|
6
6
|
@use "@pareto-engineering/styles/src/globals" as *;
|
|
7
7
|
|
|
8
|
-
$default-spacing: var(--gap
|
|
8
|
+
$default-spacing: var(--gap);
|
|
9
9
|
|
|
10
10
|
.#{bem.$base}.snap-scroller {
|
|
11
11
|
display: flex;
|
|
@@ -27,10 +27,11 @@ $default-spacing: var(--gap, 1em);
|
|
|
27
27
|
&:first-child {
|
|
28
28
|
margin-left: $default-spacing;
|
|
29
29
|
}
|
|
30
|
+
}
|
|
30
31
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
&::after {
|
|
33
|
+
content: "";
|
|
34
|
+
min-width: calc($default-spacing / 2);
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
@include mixins.media($from: $sm-md) {
|
|
@@ -40,6 +41,10 @@ $default-spacing: var(--gap, 1em);
|
|
|
40
41
|
scroll-snap-type: none;
|
|
41
42
|
scrollbar-width: unset;
|
|
42
43
|
|
|
44
|
+
&::after {
|
|
45
|
+
display: none;
|
|
46
|
+
}
|
|
47
|
+
|
|
43
48
|
>* {
|
|
44
49
|
min-width: unset;
|
|
45
50
|
|
|
@@ -32,6 +32,9 @@ const Button = ({
|
|
|
32
32
|
import('./styles.scss')
|
|
33
33
|
}, [])
|
|
34
34
|
|
|
35
|
+
const buttonText = isSimple ? <span className={styleNames.modifierUnderlined}>{children}</span>
|
|
36
|
+
: children
|
|
37
|
+
|
|
35
38
|
return (
|
|
36
39
|
<button
|
|
37
40
|
id={id}
|
|
@@ -60,7 +63,7 @@ const Button = ({
|
|
|
60
63
|
}}
|
|
61
64
|
heightWidth="1.15em"
|
|
62
65
|
/>
|
|
63
|
-
) :
|
|
66
|
+
) : buttonText}
|
|
64
67
|
</button>
|
|
65
68
|
)
|
|
66
69
|
}
|