@pareto-engineering/design-system 4.0.0-alpha.18 → 4.0.0-alpha.20

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.
@@ -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
- <Card.Section
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 === 'ours' && 'ours',
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
- </Card.Section>
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
- display: flex;
16
- flex-direction: column;
17
- padding: $default-padding;
18
-
19
- > .#{bem.$base}.message {
20
- align-self: flex-start;
21
- max-width: $default-message-max-width;
22
- min-width: $default-message-min-width;
23
- position: relative;
24
-
25
- > .message-content {
26
- background-color: var(--x);
27
- border: $default-message-border;
28
- border-radius: $default-border-radius;
29
- display: flex;
30
- flex-direction: column;
31
- padding: 0 $default-padding;
32
-
33
- > p {
34
- color: var(--on-x);
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
- > .attachment {
38
- align-items: center;
39
- align-self: flex-end;
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: row;
42
- gap: calc($default-padding / 2);
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
- &.#{bem.$base}.ours {
47
- align-self: flex-end;
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, 1em);
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
- &:last-child {
32
- margin-right: $default-spacing;
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
- ) : children}
66
+ ) : buttonText}
64
67
  </button>
65
68
  )
66
69
  }
@@ -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;//var(--theme-default-paragraph);
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(to left, var(--soft-x), var(--hard-x) 60%);
71
- transition: unset;
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 {
@@ -20,7 +20,6 @@ const ThemeSelector = ({
20
20
  className:userClassName,
21
21
  style,
22
22
  themes,
23
- iconMap,
24
23
  }) => {
25
24
  const {
26
25
  userTheme,
@@ -37,9 +36,11 @@ const ThemeSelector = ({
37
36
  },
38
37
  [userTheme])
39
38
 
39
+ const themeText = userTheme && userTheme.charAt(0).toUpperCase() + userTheme.slice(1)
40
+
40
41
  return (
41
- <button
42
- type="button"
42
+ // eslint-disable-next-line jsx-a11y/anchor-is-valid, jsx-a11y/no-static-element-interactions
43
+ <a
43
44
  className={[
44
45
  baseClassName,
45
46
  componentClassName,
@@ -50,14 +51,10 @@ const ThemeSelector = ({
50
51
  id={id}
51
52
  style={style}
52
53
  onClick={loopThemes}
54
+ onKeyDown={loopThemes}
53
55
  >
54
- <span className="icon">
55
- { iconMap[userTheme] }
56
- </span>
57
- <span>
58
- { userTheme }
59
- </span>
60
- </button>
56
+ {themeText}
57
+ </a>
61
58
  )
62
59
  }
63
60
 
@@ -81,20 +78,10 @@ ThemeSelector.propTypes = {
81
78
  * The themes and the order in which they appear
82
79
  */
83
80
  themes:PropTypes.arrayOf(PropTypes.string),
84
-
85
- /**
86
- * A map of the theme names with the icons that represent them. Uses the default font icon.
87
- */
88
- iconMap:PropTypes.objectOf(PropTypes.string),
89
-
90
81
  }
91
82
 
92
83
  ThemeSelector.defaultProps = {
93
- themes :['light', 'dark'],
94
- iconMap:{
95
- dark :'d', // sun,
96
- light:'T', // moon,
97
- },
84
+ themes:['light', 'dark'],
98
85
  }
99
86
 
100
87
  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: flex;
14
- gap: var(--gap);
7
+ display: block;
8
+ text-decoration: none;
15
9
  }