@pareto-engineering/design-system 2.0.0-alpha.2 → 2.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.
Files changed (181) hide show
  1. package/dist/cjs/a/AnimatedCounter/AnimatedCounter.js +16 -29
  2. package/dist/cjs/a/AnimatedCounter/styles.scss +3 -11
  3. package/dist/cjs/a/{RatingsInput/common/Rating/Rating.js → BackgroundGradient/BackgroundGradient.js} +22 -65
  4. package/dist/cjs/a/BackgroundGradient/index.js +15 -0
  5. package/dist/cjs/a/BackgroundGradient/styles.scss +16 -0
  6. package/dist/cjs/a/Conversation/Conversation.js +15 -8
  7. package/dist/cjs/a/Conversation/common/Message/Message.js +33 -6
  8. package/dist/cjs/a/Conversation/styles.scss +129 -32
  9. package/dist/cjs/a/GradientBackground/GradientBackground.js +140 -0
  10. package/dist/cjs/a/GradientBackground/index.js +15 -0
  11. package/dist/cjs/a/GradientBackground/styles.scss +191 -0
  12. package/dist/cjs/a/OvalIllustration/OvalIllustration.js +133 -0
  13. package/dist/cjs/a/OvalIllustration/index.js +15 -0
  14. package/dist/cjs/a/OvalIllustration/styles.scss +102 -0
  15. package/dist/cjs/a/People/People.js +15 -7
  16. package/dist/cjs/a/People/common/Person/Person.js +11 -4
  17. package/dist/cjs/a/People/styles.scss +13 -15
  18. package/dist/cjs/a/Shapes/Shapes.js +171 -0
  19. package/dist/cjs/a/{RatingsInput/common/Rating → Shapes}/index.js +3 -3
  20. package/dist/cjs/a/Shapes/styles.scss +255 -0
  21. package/dist/cjs/a/{RatingsInput/RatingsInput.js → SnapScroller/SnapScroller.js} +15 -26
  22. package/dist/cjs/a/{RatingsInput → SnapScroller}/index.js +3 -3
  23. package/dist/cjs/a/SnapScroller/styles.scss +38 -0
  24. package/dist/cjs/a/TeamInfo/styles.scss +2 -2
  25. package/dist/cjs/a/index.js +33 -1
  26. package/dist/cjs/b/Button/Button.js +10 -4
  27. package/dist/cjs/b/Button/styles.scss +82 -18
  28. package/dist/cjs/b/Metrics/Metrics.js +89 -0
  29. package/dist/cjs/b/Metrics/index.js +15 -0
  30. package/dist/cjs/b/Metrics/styles.scss +91 -0
  31. package/dist/cjs/b/Page/common/Section/Section.js +56 -5
  32. package/dist/cjs/b/Page/styles.scss +8 -2
  33. package/dist/cjs/b/QuestionDropdown/styles.scss +1 -1
  34. package/dist/cjs/b/index.js +9 -1
  35. package/dist/cjs/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +1 -1
  36. package/dist/cjs/c/ContentSlides/common/Navigator/Navigator.js +4 -3
  37. package/dist/cjs/experimental/GradientBackground/GradientBackground.js +98 -0
  38. package/dist/cjs/experimental/GradientBackground/index.js +15 -0
  39. package/dist/cjs/experimental/GradientBackground/styles.scss +64 -0
  40. package/dist/cjs/experimental/index.js +13 -0
  41. package/dist/cjs/f/common/Debugger/Debugger.js +1 -1
  42. package/dist/cjs/f/common/Label/Label.js +1 -1
  43. package/dist/cjs/f/fields/ChoicesInput/ChoicesInput.js +2 -2
  44. package/dist/cjs/f/fields/RatingsInput/common/Rating/Rating.js +2 -2
  45. package/dist/cjs/f/fields/SelectInput/SelectInput.js +25 -6
  46. package/dist/cjs/f/fields/SelectInput/styles.scss +4 -4
  47. package/dist/cjs/f/fields/TaskRecommendationInput/TaskRecommendationInput.js +1 -1
  48. package/dist/cjs/f/fields/TaskRecommendationInput/styles.scss +4 -0
  49. package/dist/cjs/f/fields/TextInput/TextInput.js +19 -5
  50. package/dist/cjs/f/fields/TextInput/styles.scss +3 -7
  51. package/dist/cjs/f/fields/TextareaInput/TextareaInput.js +14 -7
  52. package/dist/cjs/form.scss +1 -1
  53. package/dist/es/a/AnimatedCounter/AnimatedCounter.js +17 -30
  54. package/dist/es/a/AnimatedCounter/styles.scss +3 -11
  55. package/dist/es/a/BackgroundGradient/BackgroundGradient.js +55 -0
  56. package/dist/es/a/BackgroundGradient/index.js +2 -0
  57. package/dist/es/a/BackgroundGradient/styles.scss +16 -0
  58. package/dist/es/a/Conversation/Conversation.js +15 -8
  59. package/dist/es/a/Conversation/common/Message/Message.js +33 -6
  60. package/dist/es/a/Conversation/styles.scss +129 -32
  61. package/dist/es/a/GradientBackground/GradientBackground.js +118 -0
  62. package/dist/es/a/GradientBackground/index.js +2 -0
  63. package/dist/es/a/GradientBackground/styles.scss +191 -0
  64. package/dist/es/a/OvalIllustration/OvalIllustration.js +111 -0
  65. package/dist/es/a/OvalIllustration/index.js +2 -0
  66. package/dist/es/a/OvalIllustration/styles.scss +102 -0
  67. package/dist/es/a/People/People.js +14 -7
  68. package/dist/es/a/People/common/Person/Person.js +11 -4
  69. package/dist/es/a/People/styles.scss +13 -15
  70. package/dist/es/a/Shapes/Shapes.js +149 -0
  71. package/dist/es/a/{RatingsInput/common/Rating → Shapes}/index.js +1 -1
  72. package/dist/es/a/Shapes/styles.scss +255 -0
  73. package/dist/es/a/{RatingsInput/RatingsInput.js → SnapScroller/SnapScroller.js} +15 -26
  74. package/dist/es/a/SnapScroller/index.js +2 -0
  75. package/dist/es/a/SnapScroller/styles.scss +38 -0
  76. package/dist/es/a/TeamInfo/styles.scss +2 -2
  77. package/dist/es/a/index.js +5 -1
  78. package/dist/es/b/Button/Button.js +8 -2
  79. package/dist/es/b/Button/styles.scss +82 -18
  80. package/dist/es/b/Metrics/Metrics.js +72 -0
  81. package/dist/es/b/Metrics/index.js +2 -0
  82. package/dist/es/b/Metrics/styles.scss +91 -0
  83. package/dist/es/b/Page/common/Section/Section.js +55 -4
  84. package/dist/es/b/Page/styles.scss +8 -2
  85. package/dist/es/b/QuestionDropdown/styles.scss +1 -1
  86. package/dist/es/b/index.js +2 -1
  87. package/dist/es/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +1 -1
  88. package/dist/es/c/ContentSlides/common/Navigator/Navigator.js +4 -3
  89. package/dist/es/experimental/GradientBackground/GradientBackground.js +76 -0
  90. package/dist/es/experimental/GradientBackground/index.js +2 -0
  91. package/dist/es/experimental/GradientBackground/styles.scss +64 -0
  92. package/dist/es/experimental/index.js +1 -0
  93. package/dist/es/f/common/Debugger/Debugger.js +1 -1
  94. package/dist/es/f/common/Label/Label.js +1 -1
  95. package/dist/es/f/fields/ChoicesInput/ChoicesInput.js +2 -2
  96. package/dist/es/f/fields/RatingsInput/common/Rating/Rating.js +2 -2
  97. package/dist/es/f/fields/SelectInput/SelectInput.js +25 -6
  98. package/dist/es/f/fields/SelectInput/styles.scss +4 -4
  99. package/dist/es/f/fields/TaskRecommendationInput/TaskRecommendationInput.js +1 -1
  100. package/dist/es/f/fields/TaskRecommendationInput/styles.scss +4 -0
  101. package/dist/es/f/fields/TextInput/TextInput.js +19 -5
  102. package/dist/es/f/fields/TextInput/styles.scss +3 -7
  103. package/dist/es/f/fields/TextareaInput/TextareaInput.js +14 -7
  104. package/dist/es/form.scss +1 -1
  105. package/package.json +3 -3
  106. package/src/__snapshots__/Storyshots.test.js.snap +5662 -449
  107. package/src/local.scss +4 -0
  108. package/src/stories/a/AnimatedCounter.stories.jsx +9 -5
  109. package/src/stories/a/BackgroundGradient.stories.jsx +38 -0
  110. package/src/stories/a/ContentCard.stories.jsx +1 -1
  111. package/src/stories/a/Conversation.stories.jsx +78 -1
  112. package/src/stories/a/OvalIllustration.stories.jsx +59 -0
  113. package/src/stories/a/People.stories.jsx +25 -1
  114. package/src/stories/a/ProgressBar.stories.jsx +1 -1
  115. package/src/stories/a/Quote.stories.jsx +1 -1
  116. package/src/stories/a/Shapes.stories.jsx +143 -0
  117. package/src/stories/a/SnapScroller.stories.jsx +98 -0
  118. package/src/stories/a/Spinner.stories.jsx +1 -1
  119. package/src/stories/b/Button.stories.jsx +83 -54
  120. package/src/stories/b/Metrics.stories.jsx +62 -0
  121. package/src/stories/b/Page.stories.jsx +51 -1
  122. package/src/stories/b/ThemeSelector.stories.jsx +1 -1
  123. package/src/stories/b/Title.stories.jsx +1 -1
  124. package/src/stories/c/ContentSlides.stories.jsx +2 -2
  125. package/src/stories/colors.js +5 -3
  126. package/src/stories/f/CheckboxInput.stories.jsx +1 -1
  127. package/src/stories/f/SelectInput.stories.jsx +29 -0
  128. package/src/stories/f/TaskRecommendationInput.stories.jsx +1 -1
  129. package/src/stories/f/TextInput.stories.jsx +14 -4
  130. package/src/stories/f/TextareaInput.stories.jsx +42 -6
  131. package/src/ui/a/AnimatedCounter/AnimatedCounter.jsx +21 -27
  132. package/src/ui/a/AnimatedCounter/styles.scss +3 -11
  133. package/src/ui/a/BackgroundGradient/BackgroundGradient.jsx +76 -0
  134. package/src/ui/a/BackgroundGradient/index.js +2 -0
  135. package/src/ui/a/BackgroundGradient/styles.scss +16 -0
  136. package/src/ui/a/Conversation/Conversation.jsx +15 -7
  137. package/src/ui/a/Conversation/common/Message/Message.jsx +40 -7
  138. package/src/ui/a/Conversation/styles.scss +129 -32
  139. package/src/ui/a/OvalIllustration/OvalIllustration.jsx +134 -0
  140. package/src/ui/a/OvalIllustration/index.js +2 -0
  141. package/src/ui/a/OvalIllustration/styles.scss +102 -0
  142. package/src/ui/a/People/People.jsx +12 -4
  143. package/src/ui/a/People/common/Person/Person.jsx +7 -1
  144. package/src/ui/a/People/styles.scss +13 -15
  145. package/src/ui/a/Shapes/Shapes.jsx +191 -0
  146. package/src/ui/a/Shapes/index.js +2 -0
  147. package/src/ui/a/Shapes/styles.scss +255 -0
  148. package/src/ui/a/SnapScroller/SnapScroller.jsx +83 -0
  149. package/src/ui/a/SnapScroller/index.js +2 -0
  150. package/src/ui/a/SnapScroller/styles.scss +38 -0
  151. package/src/ui/a/TeamInfo/styles.scss +2 -2
  152. package/src/ui/a/index.js +4 -0
  153. package/src/ui/b/Button/Button.jsx +9 -1
  154. package/src/ui/b/Button/styles.scss +82 -18
  155. package/src/ui/b/Metrics/Metrics.jsx +93 -0
  156. package/src/ui/b/Metrics/index.js +2 -0
  157. package/src/ui/b/Metrics/styles.scss +91 -0
  158. package/src/ui/b/Page/common/Section/Section.jsx +68 -2
  159. package/src/ui/b/Page/styles.scss +8 -2
  160. package/src/ui/b/QuestionDropdown/styles.scss +1 -1
  161. package/src/ui/b/index.js +1 -0
  162. package/src/ui/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.jsx +1 -1
  163. package/src/ui/c/ContentSlides/common/Navigator/Navigator.jsx +3 -2
  164. package/src/ui/f/common/Debugger/Debugger.jsx +1 -1
  165. package/src/ui/f/common/Label/Label.jsx +1 -1
  166. package/src/ui/f/fields/ChoicesInput/ChoicesInput.jsx +2 -2
  167. package/src/ui/f/fields/RatingsInput/common/Rating/Rating.jsx +2 -2
  168. package/src/ui/f/fields/SelectInput/SelectInput.jsx +35 -5
  169. package/src/ui/f/fields/SelectInput/styles.scss +4 -4
  170. package/src/ui/f/fields/TaskRecommendationInput/TaskRecommendationInput.jsx +1 -1
  171. package/src/ui/f/fields/TaskRecommendationInput/styles.scss +4 -0
  172. package/src/ui/f/fields/TextInput/TextInput.jsx +15 -2
  173. package/src/ui/f/fields/TextInput/styles.scss +3 -7
  174. package/src/ui/f/fields/TextareaInput/TextareaInput.jsx +22 -11
  175. package/src/ui/form.scss +1 -1
  176. package/dist/cjs/a/RatingsInput/common/index.js +0 -13
  177. package/dist/cjs/a/RatingsInput/styles.scss +0 -35
  178. package/dist/es/a/RatingsInput/common/Rating/Rating.js +0 -102
  179. package/dist/es/a/RatingsInput/common/index.js +0 -1
  180. package/dist/es/a/RatingsInput/index.js +0 -2
  181. package/dist/es/a/RatingsInput/styles.scss +0 -35
@@ -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,2 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ export { default as BackgroundGradient } from './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 :PropTypes.objectOf(PropTypes.string),
79
+ style:PropTypes.objectOf(PropTypes.string),
80
+
80
81
  /**
81
82
  * The base color to our messages component
82
83
  */
83
- ourColor :PropTypes.string,
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:'background',
101
- ourColor :'main2',
102
- theirColor :'background2',
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 :PropTypes.string.isRequired,
94
+ sender:PropTypes.string.isRequired,
95
+
76
96
  /**
77
97
  * The owner of the message
78
98
  */
79
- from :PropTypes.oneOf(['ours', 'theirs']),
99
+ from:PropTypes.oneOf(['ours', 'theirs']),
100
+
80
101
  /**
81
- * The React-written, css properties for this element.
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
- style :PropTypes.objectOf(PropTypes.string),
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,52 +1,149 @@
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 *;
5
6
 
6
7
  $default-padding: var(--u);
7
8
  $default-conversation-background: var(--y);
8
- $default-message-max-width: calc(100% - #{$default-padding});
9
+ $default-message-max-width: calc(100% - 4 * #{$default-padding});
9
10
  $default-message-min-width: 12em;
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;
10
23
 
11
24
  .#{bem.$base}.conversation {
12
- display: flex;
13
- flex-direction: column;
14
- background-color: $default-conversation-background;
15
- padding: $default-padding;
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;
16
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;
17
52
 
18
- >:not(:last-child) {
19
- margin-bottom: $default-padding;
20
- }
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
+ }
65
+
66
+ .attachment {
67
+ align-self: baseline;
68
+ background-color: var(--y);
69
+ display: flex;
70
+ flex-direction: row;
71
+ padding: .5em 1em;
21
72
 
22
- .#{bem.$base}.message {
23
- min-width: $default-message-min-width;
24
- max-width: $default-message-max-width;
25
- padding: $default-padding;
26
- border-radius: var(--theme-border-radius);
27
- background-color: var(--x);
28
- align-self: flex-start;
29
-
30
- .#{bem.$element-content} {
31
- display: flex;
32
- flex-direction: column;
33
-
34
- >p {
35
- color: var(--on-x);
36
- }
37
-
38
- .sender {
39
- font-weight: 800;
40
- margin-bottom: .5em;
41
- }
73
+ > p {
74
+ margin-bottom: 0;
42
75
  }
43
- }
44
76
 
45
- .#{bem.$base}.ours {
46
- align-self: flex-end;
77
+ > img {
78
+ width: 40px;
79
+ }
80
+ }
81
+ }
82
+ &.#{bem.$base}.ours {
83
+ align-self: flex-end;
47
84
  }
48
85
 
49
- }
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
+ }
50
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
+ }
51
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
+ }
52
141
 
142
+ // mobile style
143
+ @include mixins.media($to:$sm-md) {
144
+ .message {
145
+ margin-top: 2em;
146
+ }
147
+ }
148
+ }
149
+ }
@@ -0,0 +1,134 @@
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 = 'oval-illustration'
15
+
16
+ /**
17
+ * This is the component description.
18
+ */
19
+ const OvalIllustration = ({
20
+ id,
21
+ className:userClassName,
22
+ style,
23
+ layout,
24
+ src,
25
+ alt,
26
+ ovalBackground,
27
+ backgroundColor,
28
+ mobileSize,
29
+ tabletSize,
30
+ desktopSize,
31
+ // ...otherProps
32
+ }) => {
33
+ useLayoutEffect(() => {
34
+ import('./styles.scss')
35
+ }, [])
36
+
37
+ return (
38
+ <div
39
+ id={id}
40
+ className={[
41
+
42
+ baseClassName,
43
+
44
+ componentClassName,
45
+ userClassName,
46
+ layout,
47
+ ]
48
+ .filter((e) => e)
49
+ .join(' ')}
50
+ style={{
51
+ ...style,
52
+ '--mobile-size' :mobileSize,
53
+ '--tablet-size' :tabletSize,
54
+ '--desktop-size':desktopSize,
55
+ }}
56
+ // {...otherProps}
57
+ >
58
+ {ovalBackground
59
+ && <div className={`oval-background y-${backgroundColor}`} />}
60
+ <div className="illustration">
61
+ <img src={src} alt={alt} />
62
+ </div>
63
+ </div>
64
+ )
65
+ }
66
+
67
+ OvalIllustration.propTypes = {
68
+ /**
69
+ * The HTML id for this element
70
+ */
71
+ id:PropTypes.string,
72
+
73
+ /**
74
+ * The HTML class names for this element
75
+ */
76
+ className:PropTypes.string,
77
+
78
+ /**
79
+ * The React-written, css properties for this element.
80
+ */
81
+ style:PropTypes.objectOf(PropTypes.string),
82
+
83
+ /**
84
+ * side definition of the illustration
85
+ */
86
+ layout:PropTypes.oneOf([
87
+ 'left',
88
+ 'right',
89
+ ]),
90
+
91
+ /**
92
+ * image url
93
+ */
94
+ src:PropTypes.string,
95
+
96
+ /**
97
+ * alt tag for the image
98
+ */
99
+ alt:PropTypes.string,
100
+
101
+ /**
102
+ * whether to have a oval shape as background
103
+ */
104
+ ovalBackground:PropTypes.bool,
105
+
106
+ /**
107
+ * background color of the oval behind the image
108
+ */
109
+ backgroundColor:PropTypes.string,
110
+
111
+ /**
112
+ * size of the oval for mobile screen
113
+ */
114
+ mobileSize:PropTypes.string,
115
+
116
+ /**
117
+ * size of the oval for tablet screen
118
+ */
119
+ tabletSize:PropTypes.string,
120
+
121
+ /**
122
+ * size of the oval for desktop screen
123
+ */
124
+ desktopSize:PropTypes.string,
125
+ }
126
+
127
+ OvalIllustration.defaultProps = {
128
+ layout :'left',
129
+ mobileSize :'20em',
130
+ tabletSize :'35em',
131
+ desktopSize:'45em',
132
+ }
133
+
134
+ export default OvalIllustration
@@ -0,0 +1,2 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ export { default as OvalIllustration } from './OvalIllustration'
@@ -0,0 +1,102 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+
3
+ @use "@pareto-engineering/bem";
4
+ @use "@aztlan/stylebook/src/mixins";
5
+ @use "@aztlan/stylebook/src/globals" as *;
6
+
7
+ $default-clockwise-degree:60deg;
8
+ $default-counter-clockwise-degree:-60deg;
9
+ $default-ellipse-size:30% 43% at 50% 50%;
10
+
11
+ .#{bem.$base}.oval-illustration {
12
+ display: flex;
13
+ justify-content: center;
14
+ overflow: hidden;
15
+ position: relative;
16
+
17
+ &.left {
18
+ .oval-background {
19
+ transform: rotate($default-clockwise-degree);
20
+ }
21
+
22
+ .illustration {
23
+ transform: rotate($default-counter-clockwise-degree);
24
+
25
+ > img {
26
+ transform: rotate($default-clockwise-degree);
27
+ }
28
+ }
29
+ }
30
+
31
+ &.right {
32
+ .oval-background {
33
+ transform: rotate($default-counter-clockwise-degree);
34
+ }
35
+
36
+ .illustration {
37
+ transform: rotate($default-clockwise-degree);
38
+
39
+ > img {
40
+ transform: rotate($default-counter-clockwise-degree);
41
+ }
42
+ }
43
+ }
44
+
45
+ .oval-background {
46
+ background: var(--y);
47
+ clip-path: ellipse($default-ellipse-size);
48
+ overflow: hidden;
49
+ position: absolute;
50
+ z-index: 0;
51
+ }
52
+
53
+ .illustration {
54
+ clip-path: ellipse($default-ellipse-size);
55
+ overflow: hidden;
56
+
57
+ > img {
58
+ height: 100%;
59
+ object-fit: cover;
60
+ width: 100%;
61
+ }
62
+ }
63
+
64
+ // mobile style
65
+ @include mixins.media($to:$sm-md) {
66
+ .oval-background {
67
+ height: var(--mobile-size);
68
+ width: var(--mobile-size);
69
+ }
70
+
71
+ .illustration {
72
+ height: var(--mobile-size);
73
+ width: var(--mobile-size);
74
+ }
75
+ }
76
+
77
+ // tablet style
78
+ @include mixins.media($from:$xs-sm, $to:$sm-md) {
79
+ .oval-background {
80
+ height: var(--tablet-size);
81
+ width: var(--tablet-size);
82
+ }
83
+
84
+ .illustration {
85
+ height: var(--tablet-size);
86
+ width: var(--tablet-size);
87
+ }
88
+ }
89
+
90
+ // desktop style
91
+ @include mixins.media($from:$sm-md) {
92
+ .oval-background {
93
+ height: var(--desktop-size);
94
+ width: var(--desktop-size);
95
+ }
96
+
97
+ .illustration {
98
+ height: var(--desktop-size);
99
+ width: var(--desktop-size);
100
+ }
101
+ }
102
+ }
@@ -22,8 +22,9 @@ const People = ({
22
22
  id,
23
23
  className:userClassName,
24
24
  style,
25
- imageHeightWidth,
25
+ imageSize,
26
26
  children,
27
+ columnWidth,
27
28
  // ...otherProps
28
29
  }) => {
29
30
  useLayoutEffect(() => {
@@ -44,8 +45,9 @@ const People = ({
44
45
  .filter((e) => e)
45
46
  .join(' ')}
46
47
  style={{
47
- '--image-height-width':imageHeightWidth,
48
48
  ...style,
49
+ '--image-size' :imageSize,
50
+ '--column-width':columnWidth,
49
51
  }}
50
52
  // {...otherProps}
51
53
  >
@@ -78,11 +80,17 @@ People.propTypes = {
78
80
  /**
79
81
  * The height and width of all the person's image
80
82
  */
81
- imageHeightWidth:PropTypes.string,
83
+ imageSize:PropTypes.string,
84
+
85
+ /**
86
+ * The width of the a person's column
87
+ */
88
+ columnWidth:PropTypes.string,
82
89
  }
83
90
 
84
91
  People.defaultProps = {
85
- imageHeightWidth:'3em',
92
+ imageSize :'3em',
93
+ columnWidth:'12em',
86
94
  }
87
95
 
88
96
  People.Person = Person