@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.
Files changed (36) hide show
  1. package/dist/cjs/a/ContentTree/ContentTree.js +8 -2
  2. package/dist/cjs/a/ContentTree/common/Tree/Tree.js +12 -5
  3. package/dist/cjs/a/ContentTree/styles.scss +24 -14
  4. package/dist/cjs/a/Conversation/Conversation.js +1 -1
  5. package/dist/cjs/a/Conversation/common/Message/Message.js +2 -3
  6. package/dist/cjs/a/Conversation/styles.scss +44 -28
  7. package/dist/cjs/a/SnapScroller/styles.scss +9 -4
  8. package/dist/cjs/b/Button/Button.js +4 -1
  9. package/dist/cjs/b/Button/styles.scss +22 -4
  10. package/dist/cjs/b/ThemeSelector/ThemeSelector.js +15 -22
  11. package/dist/cjs/b/ThemeSelector/styles.scss +2 -8
  12. package/dist/es/a/ContentTree/ContentTree.js +8 -2
  13. package/dist/es/a/ContentTree/common/Tree/Tree.js +12 -5
  14. package/dist/es/a/ContentTree/styles.scss +24 -14
  15. package/dist/es/a/Conversation/Conversation.js +1 -1
  16. package/dist/es/a/Conversation/common/Message/Message.js +2 -3
  17. package/dist/es/a/Conversation/styles.scss +44 -28
  18. package/dist/es/a/SnapScroller/styles.scss +9 -4
  19. package/dist/es/b/Button/Button.js +4 -1
  20. package/dist/es/b/Button/styles.scss +22 -4
  21. package/dist/es/b/ThemeSelector/ThemeSelector.js +15 -23
  22. package/dist/es/b/ThemeSelector/styles.scss +2 -8
  23. package/package.json +4 -4
  24. package/src/stories/a/Conversation.stories.jsx +5 -1
  25. package/src/ui/a/ContentTree/ContentTree.jsx +7 -3
  26. package/src/ui/a/ContentTree/common/Tree/Tree.jsx +19 -7
  27. package/src/ui/a/ContentTree/styles.scss +24 -14
  28. package/src/ui/a/Conversation/Conversation.jsx +3 -1
  29. package/src/ui/a/Conversation/common/Message/Message.jsx +3 -5
  30. package/src/ui/a/Conversation/styles.scss +44 -28
  31. package/src/ui/a/SnapScroller/styles.scss +9 -4
  32. package/src/ui/b/Button/Button.jsx +4 -1
  33. package/src/ui/b/Button/styles.scss +22 -4
  34. package/src/ui/b/ThemeSelector/ThemeSelector.jsx +8 -21
  35. package/src/ui/b/ThemeSelector/styles.scss +2 -8
  36. package/tests/__snapshots__/Storyshots.test.js.snap +1615 -949
@@ -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
  }