@pareto-engineering/design-system 4.0.0-alpha.16 → 4.0.0-alpha.18
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/AnimatedGradient/AnimatedGradient.js +5 -1
- package/dist/cjs/a/AppContext/useTheme.js +0 -4
- package/dist/cjs/a/Conversation/Conversation.js +9 -14
- package/dist/cjs/a/Conversation/common/Message/Message.js +11 -12
- package/dist/cjs/a/Conversation/styles.scss +16 -120
- package/dist/cjs/a/SnapScroller/styles.scss +8 -0
- package/dist/cjs/b/Button/Button.js +6 -1
- package/dist/cjs/b/Button/styles.scss +7 -2
- package/dist/cjs/b/Page/Page.js +5 -1
- package/dist/cjs/b/Page/common/Section/Section.js +2 -2
- package/dist/cjs/b/ThemeSelector/ThemeSelector.js +3 -10
- package/dist/cjs/b/ThemeSelector/styles.scss +3 -2
- package/dist/cjs/f/fields/TextInput/TextInput.js +12 -3
- package/dist/cjs/f/fields/TextInput/styles.scss +20 -0
- package/dist/es/a/AnimatedGradient/AnimatedGradient.js +5 -1
- package/dist/es/a/AppContext/useTheme.js +0 -4
- package/dist/es/a/Conversation/Conversation.js +9 -14
- package/dist/es/a/Conversation/common/Message/Message.js +11 -12
- package/dist/es/a/Conversation/styles.scss +16 -120
- package/dist/es/a/SnapScroller/styles.scss +8 -0
- package/dist/es/b/Button/Button.js +6 -1
- package/dist/es/b/Button/styles.scss +7 -2
- package/dist/es/b/Page/Page.js +5 -1
- package/dist/es/b/Page/common/Section/Section.js +2 -2
- package/dist/es/b/ThemeSelector/ThemeSelector.js +3 -10
- package/dist/es/b/ThemeSelector/styles.scss +3 -2
- package/dist/es/f/fields/TextInput/TextInput.js +12 -3
- package/dist/es/f/fields/TextInput/styles.scss +20 -0
- package/package.json +3 -3
- package/src/stories/a/Conversation.stories.jsx +8 -43
- package/src/stories/b/Button/Button.stories.jsx +11 -8
- package/src/stories/colors.js +17 -5
- package/src/stories/f/TextInput.stories.jsx +7 -0
- package/src/ui/a/AnimatedGradient/AnimatedGradient.jsx +5 -1
- package/src/ui/a/AppContext/useTheme.js +0 -4
- package/src/ui/a/Conversation/Conversation.jsx +11 -17
- package/src/ui/a/Conversation/common/Message/Message.jsx +11 -8
- package/src/ui/a/Conversation/styles.scss +16 -120
- package/src/ui/a/SnapScroller/styles.scss +8 -0
- package/src/ui/b/Button/Button.jsx +7 -0
- package/src/ui/b/Button/styles.scss +7 -2
- package/src/ui/b/Page/Page.jsx +4 -0
- package/src/ui/b/Page/common/Section/Section.jsx +2 -2
- package/src/ui/b/ThemeSelector/ThemeSelector.jsx +3 -10
- package/src/ui/b/ThemeSelector/styles.scss +3 -2
- package/src/ui/f/fields/TextInput/TextInput.jsx +12 -1
- package/src/ui/f/fields/TextInput/styles.scss +20 -0
- package/tests/__snapshots__/Storyshots.test.js.snap +6073 -2491
|
@@ -3,6 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { useInsertionEffect } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import styleNames from '@pareto-engineering/bem/exports';
|
|
6
|
+
import { Card } from "../..";
|
|
6
7
|
|
|
7
8
|
// Local Definitions
|
|
8
9
|
|
|
@@ -18,11 +19,10 @@ const Conversation = ({
|
|
|
18
19
|
id,
|
|
19
20
|
className: userClassName,
|
|
20
21
|
style,
|
|
21
|
-
backgroundColor,
|
|
22
22
|
ourColor,
|
|
23
23
|
theirColor,
|
|
24
24
|
children,
|
|
25
|
-
|
|
25
|
+
backgroundColor
|
|
26
26
|
// ...otherProps
|
|
27
27
|
}) => {
|
|
28
28
|
useInsertionEffect(() => {
|
|
@@ -33,9 +33,9 @@ const Conversation = ({
|
|
|
33
33
|
ourColor,
|
|
34
34
|
theirColor
|
|
35
35
|
}
|
|
36
|
-
}, /*#__PURE__*/React.createElement(
|
|
36
|
+
}, /*#__PURE__*/React.createElement(Card, {
|
|
37
37
|
id: id,
|
|
38
|
-
className: [baseClassName, componentClassName, userClassName,
|
|
38
|
+
className: [baseClassName, componentClassName, userClassName, `y-${backgroundColor}`].filter(e => e).join(' '),
|
|
39
39
|
style: style
|
|
40
40
|
}, children));
|
|
41
41
|
};
|
|
@@ -60,24 +60,19 @@ Conversation.propTypes = {
|
|
|
60
60
|
* The base color to their messages component
|
|
61
61
|
*/
|
|
62
62
|
theirColor: PropTypes.string,
|
|
63
|
-
/**
|
|
64
|
-
* The component background color
|
|
65
|
-
*/
|
|
66
|
-
backgroundColor: PropTypes.string,
|
|
67
63
|
/**
|
|
68
64
|
* The children JSX
|
|
69
65
|
*/
|
|
70
66
|
children: PropTypes.node,
|
|
71
67
|
/**
|
|
72
|
-
*
|
|
68
|
+
* The background color
|
|
73
69
|
*/
|
|
74
|
-
|
|
70
|
+
backgroundColor: PropTypes.string
|
|
75
71
|
};
|
|
76
72
|
Conversation.defaultProps = {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
hasTriangle: false
|
|
73
|
+
ourColor: 'main',
|
|
74
|
+
theirColor: 'main2',
|
|
75
|
+
backgroundColor: 'background-near'
|
|
81
76
|
};
|
|
82
77
|
Conversation.Message = Message;
|
|
83
78
|
export default Conversation;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import styleNames from '@pareto-engineering/bem/exports';
|
|
5
|
+
import { Card } from "../../../..";
|
|
5
6
|
|
|
6
7
|
// Local Definitions
|
|
7
8
|
|
|
@@ -28,21 +29,19 @@ const Message = ({
|
|
|
28
29
|
ourColor,
|
|
29
30
|
theirColor
|
|
30
31
|
} = useConversation();
|
|
31
|
-
return /*#__PURE__*/React.createElement(
|
|
32
|
+
return /*#__PURE__*/React.createElement(Card.Section, {
|
|
32
33
|
id: id,
|
|
33
|
-
className: [baseClassName, componentClassName, userClassName, `x-${from === 'ours' ? ourColor : theirColor}`, from === 'ours' && 'ours'
|
|
34
|
+
className: [baseClassName, componentClassName, userClassName, `x-${from === 'ours' ? ourColor : theirColor}`, from === 'ours' && 'ours'].filter(e => e).join(' '),
|
|
34
35
|
style: style
|
|
35
|
-
}, /*#__PURE__*/React.createElement("
|
|
36
|
-
className:
|
|
37
|
-
}, /*#__PURE__*/React.createElement("
|
|
38
|
-
className: "
|
|
39
|
-
},
|
|
36
|
+
}, sender && /*#__PURE__*/React.createElement("p", {
|
|
37
|
+
className: "sender"
|
|
38
|
+
}, sender, ":"), /*#__PURE__*/React.createElement("div", {
|
|
39
|
+
className: "message-content"
|
|
40
|
+
}, /*#__PURE__*/React.createElement("p", null, message), attachment && /*#__PURE__*/React.createElement("div", {
|
|
40
41
|
className: `attachment y-${attachmentColor}`
|
|
41
42
|
}, /*#__PURE__*/React.createElement("span", {
|
|
42
|
-
className: "
|
|
43
|
-
}, attachmentIcon), /*#__PURE__*/React.createElement("p",
|
|
44
|
-
className: "ml-v"
|
|
45
|
-
}, attachment))));
|
|
43
|
+
className: "icon"
|
|
44
|
+
}, attachmentIcon), /*#__PURE__*/React.createElement("p", null, attachment))));
|
|
46
45
|
};
|
|
47
46
|
Message.propTypes = {
|
|
48
47
|
/**
|
|
@@ -85,6 +84,6 @@ Message.propTypes = {
|
|
|
85
84
|
Message.defaultProps = {
|
|
86
85
|
from: 'theirs',
|
|
87
86
|
attachmentIcon: 'A',
|
|
88
|
-
attachmentColor: '
|
|
87
|
+
attachmentColor: 'interactive'
|
|
89
88
|
};
|
|
90
89
|
export default Message;
|
|
@@ -1,154 +1,50 @@
|
|
|
1
1
|
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
-
/* stylelint-disable selector-max-compound-selectors -- exception */
|
|
3
2
|
|
|
4
3
|
@use "@pareto-engineering/bem";
|
|
5
4
|
@use "@pareto-engineering/styles/src/mixins";
|
|
6
5
|
@use "@pareto-engineering/styles/src/globals" as *;
|
|
7
6
|
|
|
8
|
-
$default-
|
|
9
|
-
$default-
|
|
7
|
+
$default-border-radius: var(--theme-default-border-radius);
|
|
8
|
+
$default-padding: var(--gap);
|
|
10
9
|
$default-message-max-width: calc(100% - 4 * #{$default-padding});
|
|
11
10
|
$default-message-min-width: 12em;
|
|
12
|
-
$default-message-border: var(--
|
|
13
|
-
$triangle-border-size: 15px;
|
|
14
|
-
$triangle-border-style: $triangle-border-size solid;
|
|
15
|
-
$triangle-border-style-subtracted: ($triangle-border-size - 1px) solid;
|
|
16
|
-
$triangle-border1: $triangle-border-style var(--paragraph);
|
|
17
|
-
$triangle-border2: $triangle-border-style transparent;
|
|
18
|
-
$triangle-border3: $triangle-border-style-subtracted var(--x);
|
|
19
|
-
$triangle-border4: $triangle-border-style-subtracted transparent;
|
|
20
|
-
$triangle-before-side:24px;
|
|
21
|
-
$triangle-before-bottom:-30px;
|
|
22
|
-
$triangle-after-bottom:-27px;
|
|
23
|
-
$triangle-after-side:25px;
|
|
11
|
+
$default-message-border: 1px solid var(--hard-background-cards);
|
|
24
12
|
|
|
25
13
|
.#{bem.$base}.conversation {
|
|
26
|
-
background
|
|
27
|
-
border-radius: var(--theme-border-radius);
|
|
14
|
+
background: var(--y);
|
|
28
15
|
display: flex;
|
|
29
16
|
flex-direction: column;
|
|
30
17
|
padding: $default-padding;
|
|
31
18
|
|
|
32
|
-
|
|
33
|
-
margin-bottom: $default-padding;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// >:nth-child(1) {
|
|
37
|
-
// animation-delay: 1s;
|
|
38
|
-
// }
|
|
39
|
-
// >:nth-child(2) {
|
|
40
|
-
// animation-delay: 3s;
|
|
41
|
-
// }
|
|
42
|
-
|
|
43
|
-
&.has-triangle {
|
|
44
|
-
padding-bottom: calc(#{$default-padding} * 2);
|
|
45
|
-
.#{bem.$base}.message {
|
|
46
|
-
::before {
|
|
47
|
-
border-bottom: $triangle-border2;
|
|
48
|
-
border-left: $triangle-border2;
|
|
49
|
-
border-right: $triangle-border1;
|
|
50
|
-
border-top: $triangle-border1;
|
|
51
|
-
bottom: $triangle-before-bottom;
|
|
52
|
-
content: "";
|
|
53
|
-
height: 0;
|
|
54
|
-
position: absolute;
|
|
55
|
-
right: $triangle-before-side;
|
|
56
|
-
width: 0;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
::after {
|
|
60
|
-
border-bottom: $triangle-border4;
|
|
61
|
-
border-left: $triangle-border4;
|
|
62
|
-
border-right: $triangle-border3;
|
|
63
|
-
border-top: $triangle-border3;
|
|
64
|
-
bottom: $triangle-after-bottom;
|
|
65
|
-
content: "";
|
|
66
|
-
height: 0;
|
|
67
|
-
position: absolute;
|
|
68
|
-
right: $triangle-after-side;
|
|
69
|
-
width: 0;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
&:not(.ours) {
|
|
73
|
-
::before {
|
|
74
|
-
border-bottom: $triangle-border2;
|
|
75
|
-
border-left: $triangle-border1;
|
|
76
|
-
border-right: $triangle-border2;
|
|
77
|
-
border-top: $triangle-border1;
|
|
78
|
-
bottom: $triangle-before-bottom;
|
|
79
|
-
content: "";
|
|
80
|
-
height: 0;
|
|
81
|
-
left: $triangle-before-side;
|
|
82
|
-
position: absolute;
|
|
83
|
-
width: 0;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
::after {
|
|
87
|
-
border-bottom: $triangle-border4;
|
|
88
|
-
border-left: $triangle-border3;
|
|
89
|
-
border-right: $triangle-border4;
|
|
90
|
-
border-top: $triangle-border3;
|
|
91
|
-
bottom: $triangle-after-bottom;
|
|
92
|
-
content: "";
|
|
93
|
-
height: 0;
|
|
94
|
-
left: $triangle-after-side;
|
|
95
|
-
position: absolute;
|
|
96
|
-
width: 0;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.#{bem.$base}.message {
|
|
19
|
+
> .#{bem.$base}.message {
|
|
103
20
|
align-self: flex-start;
|
|
104
|
-
background-color: var(--x);
|
|
105
|
-
// animation: fadeIn 1s ease-in both;
|
|
106
|
-
border: $default-message-border;
|
|
107
|
-
border-radius: var(--theme-border-radius);
|
|
108
21
|
max-width: $default-message-max-width;
|
|
109
22
|
min-width: $default-message-min-width;
|
|
110
|
-
padding: $default-padding;
|
|
111
23
|
position: relative;
|
|
112
24
|
|
|
113
|
-
|
|
25
|
+
> .message-content {
|
|
26
|
+
background-color: var(--x);
|
|
27
|
+
border: $default-message-border;
|
|
28
|
+
border-radius: $default-border-radius;
|
|
114
29
|
display: flex;
|
|
115
30
|
flex-direction: column;
|
|
31
|
+
padding: 0 $default-padding;
|
|
116
32
|
|
|
117
|
-
>p {
|
|
33
|
+
> p {
|
|
118
34
|
color: var(--on-x);
|
|
119
35
|
}
|
|
120
36
|
|
|
121
|
-
.
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
.attachment {
|
|
127
|
-
align-self: baseline;
|
|
128
|
-
background-color: var(--y);
|
|
37
|
+
> .attachment {
|
|
38
|
+
align-items: center;
|
|
39
|
+
align-self: flex-end;
|
|
129
40
|
display: flex;
|
|
130
41
|
flex-direction: row;
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
> p {
|
|
134
|
-
margin-bottom: 0;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
> img {
|
|
138
|
-
width: 40px;
|
|
139
|
-
}
|
|
42
|
+
gap: calc($default-padding / 2);
|
|
140
43
|
}
|
|
141
44
|
}
|
|
45
|
+
|
|
142
46
|
&.#{bem.$base}.ours {
|
|
143
47
|
align-self: flex-end;
|
|
144
48
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
// mobile style
|
|
148
|
-
@include mixins.media($to:$sm-md) {
|
|
149
|
-
.message {
|
|
150
|
-
margin-top: 2em;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
49
|
}
|
|
154
50
|
}
|
|
@@ -27,6 +27,10 @@ $default-spacing: var(--gap, 1em);
|
|
|
27
27
|
&:first-child {
|
|
28
28
|
margin-left: $default-spacing;
|
|
29
29
|
}
|
|
30
|
+
|
|
31
|
+
&:last-child {
|
|
32
|
+
margin-right: $default-spacing;
|
|
33
|
+
}
|
|
30
34
|
}
|
|
31
35
|
|
|
32
36
|
@include mixins.media($from: $sm-md) {
|
|
@@ -42,6 +46,10 @@ $default-spacing: var(--gap, 1em);
|
|
|
42
46
|
&:first-child {
|
|
43
47
|
margin-left: unset;
|
|
44
48
|
}
|
|
49
|
+
|
|
50
|
+
&:last-child {
|
|
51
|
+
margin-right: unset;
|
|
52
|
+
}
|
|
45
53
|
}
|
|
46
54
|
}
|
|
47
55
|
}
|
|
@@ -24,6 +24,7 @@ const Button = ({
|
|
|
24
24
|
isGhost,
|
|
25
25
|
isSimple,
|
|
26
26
|
isGradient,
|
|
27
|
+
isSpaced,
|
|
27
28
|
arrowDirection,
|
|
28
29
|
...otherProps
|
|
29
30
|
}) => {
|
|
@@ -32,7 +33,7 @@ const Button = ({
|
|
|
32
33
|
}, []);
|
|
33
34
|
return /*#__PURE__*/React.createElement("button", _extends({
|
|
34
35
|
id: id,
|
|
35
|
-
className: [baseClassName, componentClassName, userClassName, `x-${color}`, isGhost && styleNames.modifierGhost, isCompact && styleNames.modifierCompact, isSimple && styleNames.modifierSimple, isGradient && styleNames.modifierGradient, arrowDirection && `arrow-${arrowDirection}`].filter(e => e).join(' '),
|
|
36
|
+
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(' '),
|
|
36
37
|
style: style,
|
|
37
38
|
type: "button"
|
|
38
39
|
}, otherProps), isLoading ? /*#__PURE__*/React.createElement(LoadingCircle, {
|
|
@@ -75,6 +76,10 @@ Button.propTypes = {
|
|
|
75
76
|
* Should this button have a gradient
|
|
76
77
|
*/
|
|
77
78
|
isGradient: PropTypes.bool,
|
|
79
|
+
/**
|
|
80
|
+
* Should this button be spaced
|
|
81
|
+
*/
|
|
82
|
+
isSpaced: PropTypes.bool,
|
|
78
83
|
/**
|
|
79
84
|
* The button color
|
|
80
85
|
*/
|
|
@@ -30,7 +30,7 @@ $default-animation-time: .31s;
|
|
|
30
30
|
vertical-align: middle;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
&:hover {
|
|
33
|
+
&:hover:not(:disabled) {
|
|
34
34
|
&::after {
|
|
35
35
|
--final-position: 50%;
|
|
36
36
|
animation: animateArrow $default-animation-time forwards;
|
|
@@ -46,7 +46,7 @@ $default-animation-time: .31s;
|
|
|
46
46
|
vertical-align: middle;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
&:hover {
|
|
49
|
+
&:hover:not(:disabled) {
|
|
50
50
|
&::before {
|
|
51
51
|
--final-position: -50%;
|
|
52
52
|
animation: animateArrow $default-animation-time forwards;
|
|
@@ -104,6 +104,11 @@ $default-animation-time: .31s;
|
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
+
&.#{bem.$modifier-spaced} {
|
|
108
|
+
margin-bottom: var(--spacing-2);
|
|
109
|
+
margin-top: var(--spacing-2);
|
|
110
|
+
}
|
|
111
|
+
|
|
107
112
|
&.#{bem.$modifier-simple} {
|
|
108
113
|
background: transparent;
|
|
109
114
|
border: 1px solid transparent;
|
package/dist/es/b/Page/Page.js
CHANGED
|
@@ -4,6 +4,7 @@ import * as React from 'react';
|
|
|
4
4
|
import { useInsertionEffect, useEffect } from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import styleNames from '@pareto-engineering/bem/exports';
|
|
7
|
+
import { useApp } from "../../a";
|
|
7
8
|
|
|
8
9
|
// Imports from the component folder
|
|
9
10
|
import { PageHelmet, Section } from "./common";
|
|
@@ -33,6 +34,9 @@ const Page = ({
|
|
|
33
34
|
useInsertionEffect(() => {
|
|
34
35
|
import("./styles.scss");
|
|
35
36
|
}, []);
|
|
37
|
+
const {
|
|
38
|
+
userTheme
|
|
39
|
+
} = useApp();
|
|
36
40
|
useEffect(() => {
|
|
37
41
|
// If we're on the client, we make sure to scroll up when the page loads
|
|
38
42
|
// This is a necessary transform to make react apt for website pages
|
|
@@ -47,7 +51,7 @@ const Page = ({
|
|
|
47
51
|
}
|
|
48
52
|
}, /*#__PURE__*/React.createElement(Wrapper, _extends({
|
|
49
53
|
id: id,
|
|
50
|
-
className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
|
|
54
|
+
className: [baseClassName, componentClassName, userClassName, userTheme && `ui-${userTheme}`].filter(e => e).join(' '),
|
|
51
55
|
style: style,
|
|
52
56
|
itemType: itemType,
|
|
53
57
|
itemScope: itemType && ' '
|
|
@@ -13,7 +13,7 @@ const Section = ({
|
|
|
13
13
|
className: userClassName,
|
|
14
14
|
style,
|
|
15
15
|
children,
|
|
16
|
-
|
|
16
|
+
isSpaced,
|
|
17
17
|
padded,
|
|
18
18
|
...otherProps
|
|
19
19
|
}) => {
|
|
@@ -23,7 +23,7 @@ const Section = ({
|
|
|
23
23
|
const sectionId = userId && `${pageId}_${userId}`;
|
|
24
24
|
return /*#__PURE__*/React.createElement("section", _extends({
|
|
25
25
|
id: sectionId,
|
|
26
|
-
className: [baseClassName, componentClassName, userClassName,
|
|
26
|
+
className: [baseClassName, componentClassName, userClassName, isSpaced && styleNames.modifierSpaced, padded && 'padded', 'grid'].filter(e => e).join(' '),
|
|
27
27
|
style: style
|
|
28
28
|
}, otherProps), children);
|
|
29
29
|
};
|
|
@@ -17,8 +17,6 @@ const ThemeSelector = ({
|
|
|
17
17
|
id,
|
|
18
18
|
className: userClassName,
|
|
19
19
|
style,
|
|
20
|
-
// children
|
|
21
|
-
|
|
22
20
|
themes,
|
|
23
21
|
iconMap
|
|
24
22
|
}) => {
|
|
@@ -40,7 +38,7 @@ const ThemeSelector = ({
|
|
|
40
38
|
style: style,
|
|
41
39
|
onClick: loopThemes
|
|
42
40
|
}, /*#__PURE__*/React.createElement("span", {
|
|
43
|
-
className: "
|
|
41
|
+
className: "icon"
|
|
44
42
|
}, iconMap[userTheme]), /*#__PURE__*/React.createElement("span", null, userTheme));
|
|
45
43
|
};
|
|
46
44
|
ThemeSelector.propTypes = {
|
|
@@ -56,11 +54,6 @@ ThemeSelector.propTypes = {
|
|
|
56
54
|
* The React-written, css properties for this element.
|
|
57
55
|
*/
|
|
58
56
|
style: PropTypes.objectOf(PropTypes.string),
|
|
59
|
-
/**
|
|
60
|
-
* The children JSX
|
|
61
|
-
*/
|
|
62
|
-
// children: PropTypes.node,
|
|
63
|
-
|
|
64
57
|
/**
|
|
65
58
|
* The themes and the order in which they appear
|
|
66
59
|
*/
|
|
@@ -73,9 +66,9 @@ ThemeSelector.propTypes = {
|
|
|
73
66
|
ThemeSelector.defaultProps = {
|
|
74
67
|
themes: ['light', 'dark'],
|
|
75
68
|
iconMap: {
|
|
76
|
-
dark: '
|
|
69
|
+
dark: 'd',
|
|
77
70
|
// sun,
|
|
78
|
-
light: '
|
|
71
|
+
light: 'T' // moon,
|
|
79
72
|
}
|
|
80
73
|
};
|
|
81
74
|
|
|
@@ -30,7 +30,8 @@ const TextInput = ({
|
|
|
30
30
|
disabled,
|
|
31
31
|
placeholder,
|
|
32
32
|
optional,
|
|
33
|
-
autoComplete
|
|
33
|
+
autoComplete,
|
|
34
|
+
symbol
|
|
34
35
|
// ...otherProps
|
|
35
36
|
}) => {
|
|
36
37
|
useInsertionEffect(() => {
|
|
@@ -40,6 +41,9 @@ const TextInput = ({
|
|
|
40
41
|
name,
|
|
41
42
|
validate
|
|
42
43
|
});
|
|
44
|
+
const symbolStyle = symbol ? {
|
|
45
|
+
'--symbol': symbol
|
|
46
|
+
} : {};
|
|
43
47
|
return /*#__PURE__*/React.createElement("div", {
|
|
44
48
|
id: id,
|
|
45
49
|
className: [baseClassName, componentClassName, userClassName, `y-${color}`].filter(e => e).join(' '),
|
|
@@ -51,7 +55,8 @@ const TextInput = ({
|
|
|
51
55
|
color: labelColor,
|
|
52
56
|
optional: optional
|
|
53
57
|
}, label), /*#__PURE__*/React.createElement("div", {
|
|
54
|
-
className:
|
|
58
|
+
className: `input-wrapper with-faded-border ${symbol ? 'has-symbol' : ''}`,
|
|
59
|
+
style: symbolStyle
|
|
55
60
|
}, /*#__PURE__*/React.createElement("input", _extends({
|
|
56
61
|
id: name,
|
|
57
62
|
className: "input",
|
|
@@ -126,7 +131,11 @@ TextInput.propTypes = {
|
|
|
126
131
|
* The autoComplete value that the browser should watch for the input
|
|
127
132
|
* `https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete`
|
|
128
133
|
*/
|
|
129
|
-
autoComplete: PropTypes.string
|
|
134
|
+
autoComplete: PropTypes.string,
|
|
135
|
+
/**
|
|
136
|
+
* A symbol to be set inside the input field
|
|
137
|
+
*/
|
|
138
|
+
symbol: PropTypes.string
|
|
130
139
|
};
|
|
131
140
|
TextInput.defaultProps = {
|
|
132
141
|
type: 'text',
|
|
@@ -4,6 +4,12 @@
|
|
|
4
4
|
@use "../../../form.scss";
|
|
5
5
|
|
|
6
6
|
$default-padding: .75em .75em .55em;
|
|
7
|
+
$default-symbol-left: 3em;
|
|
8
|
+
$default-padding-with-symbol:
|
|
9
|
+
.75em
|
|
10
|
+
calc($default-symbol-left - 1em)
|
|
11
|
+
.55em
|
|
12
|
+
calc($default-symbol-left + 1em);
|
|
7
13
|
$default-input-border-radius: var(--theme-default-input-border-radius);
|
|
8
14
|
|
|
9
15
|
|
|
@@ -18,6 +24,20 @@ $default-input-border-radius: var(--theme-default-input-border-radius);
|
|
|
18
24
|
border-radius: $default-input-border-radius;
|
|
19
25
|
}
|
|
20
26
|
|
|
27
|
+
&.has-symbol {
|
|
28
|
+
&::before {
|
|
29
|
+
color: var(--interactive);
|
|
30
|
+
content: var(--symbol);
|
|
31
|
+
left: $default-symbol-left;
|
|
32
|
+
position: absolute;
|
|
33
|
+
top: .5em;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
input {
|
|
37
|
+
padding: $default-padding-with-symbol;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
21
41
|
> input {
|
|
22
42
|
background-color: var(--background-inputs);
|
|
23
43
|
border-radius: $default-input-border-radius;
|
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.18",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/es/index.js",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@pareto-engineering/assets": "^4.0.0-alpha.11",
|
|
54
54
|
"@pareto-engineering/bem": "^4.0.0-alpha.11",
|
|
55
|
-
"@pareto-engineering/styles": "^4.0.0-alpha.
|
|
55
|
+
"@pareto-engineering/styles": "^4.0.0-alpha.18",
|
|
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": "e1735bceb078ee7d063407d7f6fcd36ff11d0ef9"
|
|
71
71
|
}
|
|
@@ -21,22 +21,22 @@ export const Base = () => {
|
|
|
21
21
|
const conversations = [
|
|
22
22
|
{
|
|
23
23
|
message:'Hi Camille, please compile an assesment of top 5 firms/brand providers for the listed fields in the US.',
|
|
24
|
-
sender :'
|
|
24
|
+
sender :'Humbl',
|
|
25
25
|
from :'theirs',
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
28
|
message:'Hi Morgan! Here is the database we prepared for you.',
|
|
29
|
-
sender :'
|
|
29
|
+
sender :'Camille',
|
|
30
30
|
from :'ours',
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
message:'Hi Camille, please compile an assesment of top 6 firms/brand providers for the listed fields in the US.',
|
|
34
|
-
sender :'
|
|
34
|
+
sender :'Humbl',
|
|
35
35
|
from :'theirs',
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
message:'Hi Morgan! Here is the spreadsheet we prepared for you.',
|
|
39
|
-
sender :'
|
|
39
|
+
sender :'Camille',
|
|
40
40
|
from :'ours',
|
|
41
41
|
},
|
|
42
42
|
]
|
|
@@ -50,63 +50,28 @@ export const Base = () => {
|
|
|
50
50
|
)
|
|
51
51
|
}
|
|
52
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 6 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 spreadsheet 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
53
|
export const WithAttachment = () => {
|
|
89
54
|
const conversations = [
|
|
90
55
|
{
|
|
91
56
|
message:'Hi Camille, please compile an assesment of top 5 firms/brand providers for the listed fields in the US.',
|
|
92
|
-
sender :'
|
|
57
|
+
sender :'Humbl',
|
|
93
58
|
from :'theirs',
|
|
94
59
|
},
|
|
95
60
|
{
|
|
96
61
|
message :'Hi Morgan! Here is the database we prepared for you.',
|
|
97
|
-
sender :'
|
|
62
|
+
sender :'Camille',
|
|
98
63
|
from :'ours',
|
|
99
64
|
attachment :'spreadsheet.xlsx',
|
|
100
65
|
attachmentColor:'main4',
|
|
101
66
|
},
|
|
102
67
|
{
|
|
103
68
|
message:'Hi Camille, please compile an assesment of top 6 firms/brand providers for the listed fields in the US.',
|
|
104
|
-
sender :'
|
|
69
|
+
sender :'Humbl',
|
|
105
70
|
from :'theirs',
|
|
106
71
|
},
|
|
107
72
|
{
|
|
108
73
|
message :'Hi Morgan! Here is the spreadsheet we prepared for you.',
|
|
109
|
-
sender :'
|
|
74
|
+
sender :'Camille',
|
|
110
75
|
from :'ours',
|
|
111
76
|
attachment :'spreadsheet.xlsx',
|
|
112
77
|
attachmentColor:'main4',
|
|
@@ -112,11 +112,14 @@ ArrowRightSimple.args = {
|
|
|
112
112
|
isSimple :true,
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
export const
|
|
122
|
-
|
|
115
|
+
export const DisabledArrowLeft = MultipleTemplate.bind({})
|
|
116
|
+
DisabledArrowLeft.args = {
|
|
117
|
+
arrowDirection:'left',
|
|
118
|
+
disabled :true,
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export const DisabledArrowRight = MultipleTemplate.bind({})
|
|
122
|
+
DisabledArrowRight.args = {
|
|
123
|
+
arrowDirection:'right',
|
|
124
|
+
disabled :true,
|
|
125
|
+
}
|