@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
@@ -23,6 +23,7 @@ const Button = ({
23
23
  isCompact,
24
24
  isGhost,
25
25
  isSimple,
26
+ arrowDirection,
26
27
  ...otherProps
27
28
  }) => {
28
29
  useLayoutEffect(() => {
@@ -40,6 +41,7 @@ const Button = ({
40
41
  isGhost && styleNames.modifierGhost,
41
42
  isCompact && styleNames.modifierCompact,
42
43
  isSimple && styleNames.modifierSimple,
44
+ arrowDirection && `arrow-${arrowDirection}`,
43
45
  ]
44
46
  .filter((e) => e)
45
47
  .join(' ')}
@@ -98,11 +100,17 @@ Button.propTypes = {
98
100
  /**
99
101
  * The button color
100
102
  */
101
- color :PropTypes.string,
103
+ color:PropTypes.string,
104
+
102
105
  /**
103
106
  * Button loading state
104
107
  */
105
108
  isLoading:PropTypes.bool,
109
+
110
+ /**
111
+ * The direction of the arrow if the button has one
112
+ */
113
+ arrowDirection:PropTypes.string,
106
114
  }
107
115
 
108
116
  Button.defaultProps = {
@@ -4,28 +4,64 @@
4
4
 
5
5
  $default-padding: 1em 1em .84em;
6
6
  $compact-padding: .6em .6em .48em;
7
- $default-border-radius:2em;
8
7
  $default-color:primary;
9
8
  $font-weight:bold;
9
+ $default-margin:.5em;
10
+ $default-animation-time: .3s;
10
11
 
11
12
  .#{bem.$base}.button {
12
13
  background: var(--x, var(--#{$default-color}));
13
14
  border: transparent;
14
- //border-radius: var(--theme-border-radius);
15
- border-radius: $default-border-radius;
15
+ border-radius: var(--theme-border-radius);
16
16
  color: var(--on-x, var(--on-#{$default-color}));
17
+ display: inline-flex;
18
+ font-family: var(--theme-default-paragraph);
17
19
  font-weight: 600;
20
+ justify-content: space-between;
18
21
  padding: $default-padding;
19
22
  transition: all .25s;
20
23
 
24
+ &.arrow-right {
25
+ &::after {
26
+ content: "-->";
27
+ margin-left: $default-margin;
28
+ vertical-align: middle;
29
+ }
30
+
31
+ &:hover {
32
+ &::after {
33
+ --final-position: 50%;
34
+ animation: animateArrow $default-animation-time forwards;
35
+ }
36
+ }
37
+ }
38
+
39
+ &.arrow-left {
40
+ &::before {
41
+ content: "<--";
42
+ margin-right: $default-margin;
43
+ vertical-align: middle;
44
+ }
45
+
46
+ &:hover {
47
+ &::before {
48
+ --final-position: -50%;
49
+ animation: animateArrow $default-animation-time forwards;
50
+ }
51
+ }
52
+ }
53
+
21
54
  &:not(:disabled) {
22
55
  cursor: pointer;
23
56
 
24
57
  &:hover {
25
58
  background: var(--light-x, var(--light-#{$default-color}));
26
59
  }
27
- }
28
60
 
61
+ &:focus {
62
+ background: var(--dark-x, var(--dark-#{$default-color}));
63
+ }
64
+ }
29
65
 
30
66
  &.#{bem.$modifier-compact} {
31
67
  padding: $compact-padding;
@@ -36,42 +72,70 @@ $font-weight:bold;
36
72
  border: 1px solid var(--x, var(--#{$default-color}));
37
73
  color: var(--x, var(--#{$default-color}));
38
74
 
39
- &:not(:disabled) {
40
- &:hover,
41
- &:focus {
42
- border: 1px solid transparent;
43
- color: var(--on-x, var(--on-#{$default-color}));
44
- }
75
+ &:hover,
76
+ &:focus,
77
+ &:disabled {
78
+ background: transparent;
79
+ }
45
80
 
81
+ &:not(:disabled) {
46
82
  &:hover {
47
- background: var(--x, var(--#{$default-color}));
83
+ border: 1px solid var(--light-x, var(--light-#{$default-color}));
84
+ color: var(--light-x, var(--light-#{$default-color}));
48
85
  }
49
86
 
50
87
  &:focus {
51
- background: var(--dark-x, var(--#{$default-color}));
88
+ border: 1px solid var(--dark-x, var(--dark-#{$default-color}));
89
+ color: var(--dark-x, var(--dark-#{$default-color}));
52
90
  }
53
91
  }
92
+
93
+ &:disabled {
94
+ border: 1px solid var(--x, var(--#{$default-color}));
95
+ color: var(--x, var(--#{$default-color}));
96
+ }
54
97
  }
55
98
 
56
99
  &.#{bem.$modifier-simple} {
57
100
  background: transparent;
58
101
  border: 1px solid transparent;
59
102
  color: var(--x, var(--#{$default-color}));
103
+ padding: 0;
104
+
105
+ &:disabled,
106
+ &:hover,
107
+ &:focus {
108
+ background: transparent;
109
+ }
60
110
 
61
111
  &:not(:disabled) {
62
- &:hover,
112
+ &:hover {
113
+ color: var(--light-x, var(--light-#{$default-color}));
114
+ }
115
+
63
116
  &:focus {
64
- background:transparent;
65
- border: 1px solid transparent;
66
- color: var(--dark-x, var(--on-#{$default-color}));
117
+ color: var(--dark-x, var(--dark-#{$default-color}));
67
118
  }
68
119
  }
120
+
121
+ &:disabled {
122
+ color: var(--x, var(--#{$default-color}));
123
+ }
69
124
  }
70
125
 
71
126
  &:disabled {
72
- background: var(--light-x);
73
- filter: brightness(150%);
127
+ background: var(--x);
128
+ filter: brightness(125%);
74
129
  }
75
130
  }
76
131
 
77
132
 
133
+ @keyframes animateArrow {
134
+ from {
135
+ transform: translateX(0);
136
+ }
137
+
138
+ to {
139
+ transform: translateX(var(--final-position));
140
+ }
141
+ }
@@ -0,0 +1,93 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ import * as React from 'react'
3
+
4
+ import { useLayoutEffect } from 'react'
5
+
6
+ import { AnimatedCounter } from 'ui'
7
+
8
+ import PropTypes from 'prop-types'
9
+
10
+ import styleNames from '@pareto-engineering/bem'
11
+
12
+ // Local Definitions
13
+
14
+ const baseClassName = styleNames.base
15
+
16
+ const componentClassName = 'metrics'
17
+
18
+ /**
19
+ * This is the component description.
20
+ */
21
+ const Metrics = ({
22
+ id,
23
+ className:userClassName,
24
+ style,
25
+ items,
26
+ // ...otherProps
27
+ }) => {
28
+ useLayoutEffect(() => {
29
+ import('./styles.scss')
30
+ }, [])
31
+
32
+ return (
33
+ <div
34
+ id={id}
35
+ className={[
36
+
37
+ baseClassName,
38
+
39
+ componentClassName,
40
+ userClassName,
41
+ ]
42
+ .filter((e) => e)
43
+ .join(' ')}
44
+ style={style}
45
+ // {...otherProps}
46
+ >
47
+ {items.map((counter) => (
48
+ <div className="metric">
49
+ <div className={`circle y-${counter.circleColor}`}>
50
+ <AnimatedCounter
51
+ color={counter.color}
52
+ delay={counter.delay}
53
+ number={counter.number}
54
+ before={counter.before}
55
+ after={counter.after}
56
+ />
57
+ <p className="description-md sm-h xs-h md-s1">{counter.description}</p>
58
+ </div>
59
+ <p className="description-sm md-h lg-h sm-s-2">{counter.description}</p>
60
+ </div>
61
+ ))}
62
+ </div>
63
+ )
64
+ }
65
+
66
+ Metrics.propTypes = {
67
+ /**
68
+ * The HTML id for this element
69
+ */
70
+ id:PropTypes.string,
71
+
72
+ /**
73
+ * The HTML class names for this element
74
+ */
75
+ className:PropTypes.string,
76
+
77
+ /**
78
+ * The React-written, css properties for this element.
79
+ */
80
+ style:PropTypes.objectOf(PropTypes.string),
81
+
82
+ /**
83
+ * The array of details
84
+ */
85
+ items:PropTypes.node,
86
+ }
87
+
88
+ /*
89
+ Metrics.defaultProps = {
90
+ }
91
+ */
92
+
93
+ export default Metrics
@@ -0,0 +1,2 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ export { default as Metrics } from './Metrics'
@@ -0,0 +1,91 @@
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-mobile-row-gap: 1em;
8
+ $default-desktop-row-gap: 3em;
9
+ $default-border-radius: 50%;
10
+ $default-mobile-circle-size: 8em;
11
+ $default-desktop-circle-size: 10em;
12
+ $default-translateY:3em;
13
+ $default-desktop-description-width:12em;
14
+
15
+
16
+ $default-mobile-description-width:9em;
17
+
18
+ .#{bem.$base}.metrics {
19
+ display: grid;
20
+ row-gap: 1em;
21
+
22
+ .metric {
23
+ align-items: center;
24
+ display: flex;
25
+ row-gap: $default-mobile-row-gap;
26
+
27
+ .circle {
28
+ align-items: center;
29
+ background: var(--light-y);
30
+ border-radius: $default-border-radius;
31
+ display: flex;
32
+ height: $default-mobile-circle-size;
33
+ justify-content: center;
34
+ width: $default-mobile-circle-size;
35
+
36
+ .description-md {
37
+ color: var(--subtitle);
38
+ font-style: italic;
39
+ }
40
+ }
41
+
42
+ .description-sm {
43
+ color: var(--subtitle);
44
+ font-style: italic;
45
+ }
46
+ }
47
+
48
+ // mobile style
49
+ @include mixins.media($to:$sm-md) {
50
+ .metric {
51
+ column-gap: $default-mobile-row-gap;
52
+
53
+ .description-sm {
54
+ width: 50%;
55
+ }
56
+ }
57
+ }
58
+
59
+ // tablet style
60
+ @include mixins.media($from:$xs-sm,$to:$sm-md) {
61
+ .metric {
62
+ .description-sm {
63
+ width: 30%;
64
+ }
65
+ }
66
+ }
67
+
68
+ // desktop style
69
+ @include mixins.media($from:$sm-md) {
70
+ grid-template-columns: repeat(2, 1fr);
71
+ row-gap: 2em;
72
+
73
+ .metric {
74
+ .circle {
75
+ display: flex;
76
+ flex-direction: column;
77
+ height: $default-desktop-circle-size;
78
+ justify-content: center;
79
+ position: relative;
80
+ width: $default-desktop-circle-size;
81
+
82
+ .description-md {
83
+ left: 40%;
84
+ position: absolute;
85
+ top: 70%;
86
+ width: $default-desktop-description-width;
87
+ }
88
+ }
89
+ }
90
+ }
91
+ }
@@ -3,9 +3,10 @@ import * as React from 'react'
3
3
  import PropTypes from 'prop-types'
4
4
  import styleNames from '@pareto-engineering/bem'
5
5
 
6
+ // Local Definitions
7
+ import { Shapes, BackgroundGradient } from 'ui/a'
6
8
  import usePage from '../../usePage'
7
9
 
8
- // Local Definitions
9
10
  const baseClassName = styleNames.base
10
11
  const componentClassName = 'section'
11
12
 
@@ -14,6 +15,13 @@ const Section = ({
14
15
  className:userClassName,
15
16
  style,
16
17
  children,
18
+ backgroundShape,
19
+ backgroundGradient,
20
+ backgroundGradientHeight,
21
+ backgroundVerticalAlign,
22
+ backgroundHorizontalAlign,
23
+ backgroundHeight,
24
+ backgroundOverflow,
17
25
  ...otherProps
18
26
  }) => {
19
27
  const {
@@ -21,7 +29,6 @@ const Section = ({
21
29
  } = usePage()
22
30
 
23
31
  const sectionId = userId && `${pageId}_${userId}`
24
-
25
32
  return (
26
33
  <section
27
34
  id={sectionId}
@@ -36,6 +43,20 @@ const Section = ({
36
43
  {...otherProps}
37
44
  >
38
45
  {children}
46
+ {backgroundShape && (
47
+ <Shapes
48
+ verticalAlign={backgroundVerticalAlign}
49
+ horizontalAlign={backgroundHorizontalAlign}
50
+ overflow={backgroundOverflow}
51
+ height={backgroundHeight}
52
+ shape={backgroundShape}
53
+ />
54
+ )}
55
+ {backgroundGradient && (
56
+ <BackgroundGradient
57
+ height={backgroundGradientHeight}
58
+ />
59
+ )}
39
60
  </section>
40
61
  )
41
62
  }
@@ -60,6 +81,51 @@ Section.propTypes = {
60
81
  * The children JSX
61
82
  */
62
83
  children:PropTypes.node,
84
+
85
+ /**
86
+ * The background shape to use for this section.
87
+ */
88
+ backgroundShape:PropTypes.oneOf([
89
+ 'triangle',
90
+ 'ellipse',
91
+ 'half-ellipse',
92
+ 'half-ellipses',
93
+ 'spiral',
94
+ 'diamonds',
95
+ 'circle',
96
+ 'half-circle',
97
+ 'ellipses',
98
+ 'rectangles',
99
+ ]),
100
+
101
+ /**
102
+ * The background vertical alingment to use for if the background shape is set.
103
+ */
104
+ backgroundVerticalAlign :PropTypes.oneOf(['flex-start', 'center', 'flex-end']),
105
+ /**
106
+ * The background horizontal alingment to use for if the background shape is set.
107
+ */
108
+ backgroundHorizontalAlign:PropTypes.oneOf(['flex-start', 'center', 'flex-end']),
109
+
110
+ /**
111
+ * The background height to use for if the background shape is set.
112
+ */
113
+ backgroundHeight:PropTypes.string,
114
+
115
+ /**
116
+ * The background overflow to use for if the background shape is set.
117
+ */
118
+ backgroundOverflow:PropTypes.oneOf(['visible', 'hidden', 'scroll']),
119
+
120
+ /**
121
+ * The background gradient to use for if the background gradient is set.
122
+ */
123
+ backgroundGradient:PropTypes.bool,
124
+
125
+ /**
126
+ * The background gradient height to use for if the background gradient is set.
127
+ */
128
+ backgroundGradientHeight:PropTypes.string,
63
129
  }
64
130
 
65
131
  Section.defaultProps = {
@@ -2,9 +2,15 @@
2
2
 
3
3
  @use "@pareto-engineering/bem";
4
4
 
5
- /*
5
+
6
6
  .#{bem.$base}.page{
7
+ .#{bem.$base}.section {
8
+ position: relative;
7
9
 
8
- } */
10
+ > *:not(:last-child) {
11
+ z-index: 1;
12
+ }
13
+ }
14
+ }
9
15
 
10
16
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  //make all colors as vars
6
6
 
7
- $border-color: var(--dark-background);
7
+ $border-color: var(--dark-background1);
8
8
  $border-width: 2px;
9
9
  $button-background-color: transparent;
10
10
  $button-background-color-hover: var(--light-accent3);
package/src/ui/b/index.js CHANGED
@@ -7,3 +7,4 @@ export { QuestionDropdown } from './QuestionDropdown'
7
7
  export { ThemeSelector } from './ThemeSelector'
8
8
  export { Logo } from './Logo'
9
9
  export { SocialMediaButton } from './SocialMediaButton'
10
+ export { Metrics } from './Metrics'
@@ -59,7 +59,7 @@ const HorizontalMenu = ({
59
59
  >
60
60
  {
61
61
  (currentStep?.progress > 0)
62
- && <ProgressBar progress={currentStep.progress} attached height=".4em" color="main2" className="y-background b-dark-y" />
62
+ && <ProgressBar progress={currentStep.progress} attached height=".4em" color="main2" className="y-background1 b-dark-y" />
63
63
  }
64
64
  <div className={styleNames.elementContent}>
65
65
  <div className="left">
@@ -77,6 +77,7 @@ const Navigator = ({
77
77
  setNextStepIndex(stepsForward)
78
78
  }
79
79
  }}
80
+ isCompact
80
81
  >
81
82
  Next
82
83
  </Button>
@@ -140,8 +141,8 @@ Navigator.propTypes = {
140
141
 
141
142
  Navigator.defaultProps = {
142
143
  canMoveForward:true,
143
- previousColor :'main1',
144
- nextColor :'main1',
144
+ previousColor :'main2',
145
+ nextColor :'main2',
145
146
  stepsForward :1,
146
147
  stepsBackwards:1,
147
148
  }
@@ -41,7 +41,7 @@ const Debugger = ({
41
41
  .join(' ')}
42
42
  style={style}
43
43
  >
44
- <Button onClick={toggleDebugger} color="main1">
44
+ <Button onClick={toggleDebugger} color="main2">
45
45
  { isOpen
46
46
  ? 'Close FormDebugger'
47
47
  : 'Open FormDebugger'}
@@ -90,7 +90,7 @@ Label.propTypes = {
90
90
  Label.defaultProps = {
91
91
  // someProp:false
92
92
  as :'label',
93
- color:'main1',
93
+ color:'main2',
94
94
  }
95
95
 
96
96
  export default Label
@@ -147,8 +147,8 @@ ChoicesInput.propTypes = {
147
147
  ChoicesInput.defaultProps = {
148
148
  gridColumnsMobile :2,
149
149
  gridColumnsDesktop:3,
150
- color :'background',
151
- colorChecked :'main1',
150
+ color :'background2',
151
+ colorChecked :'main2',
152
152
  disabled :false,
153
153
  }
154
154
 
@@ -128,8 +128,8 @@ Rating.propTypes = {
128
128
  }
129
129
 
130
130
  Rating.defaultProps = {
131
- activeBackgroundColor :'secondary2',
132
- inactiveBackgroundColor:'background',
131
+ activeBackgroundColor :'main1',
132
+ inactiveBackgroundColor:'background2',
133
133
  showRatingValue :false,
134
134
  }
135
135
 
@@ -27,6 +27,8 @@ const SelectInput = ({
27
27
  name,
28
28
  label,
29
29
  options,
30
+ validate,
31
+ description,
30
32
  disabled,
31
33
  // ...otherProps
32
34
  }) => {
@@ -34,7 +36,7 @@ const SelectInput = ({
34
36
  import('./styles.scss')
35
37
  }, [])
36
38
 
37
- const [field, meta] = useField(name)
39
+ const [field, meta] = useField({ name, validate })
38
40
 
39
41
  return (
40
42
  <div
@@ -52,18 +54,30 @@ const SelectInput = ({
52
54
  // {...otherProps}
53
55
  >
54
56
  <FormLabel className="input-label" name={name}>{label}</FormLabel>
55
- <select className="input v25 pv-v" {...field} id={name} disabled={disabled}>
57
+ <select className="input v25 pv-v" {...field} value={field.value || ''} id={name} disabled={disabled}>
56
58
  {
57
59
  options.map((option) => {
58
60
  // i.e if option is a string like "blah", return { value: "blah", label: "blah" }
59
61
  const newOption = typeof option === 'string' ? { value: option, label: option } : option
62
+
60
63
  return (
61
- <option key={newOption.value} value={newOption.value}>{newOption.label}</option>
64
+ <option
65
+ key={newOption.value}
66
+ value={newOption.value}
67
+ disabled={newOption?.disabled || false}
68
+ >
69
+ {newOption.label}
70
+ </option>
62
71
  )
63
72
  })
64
73
  }
65
74
  </select>
66
- {meta.error && meta.touched && <FormDescription error>{meta.error}</FormDescription>}
75
+ {(description || (meta.touched && meta.error))
76
+ && (
77
+ <FormDescription isError={!!meta.error} className="v50 mt-v s-1">
78
+ { meta.error || description }
79
+ </FormDescription>
80
+ )}
67
81
  </div>
68
82
  )
69
83
  }
@@ -93,12 +107,28 @@ SelectInput.propTypes = {
93
107
  */
94
108
  label:PropTypes.string,
95
109
 
110
+ /**
111
+ * The input field validator function
112
+ */
113
+ validate:PropTypes.func,
114
+
115
+ /**
116
+ * The select input description
117
+ */
118
+ description:PropTypes.string,
119
+
96
120
  /**
97
121
  * The options of the select input
98
122
  */
99
123
  options:PropTypes.arrayOf(
100
124
  PropTypes.oneOfType(
101
- [PropTypes.string, PropTypes.shape({ value: PropTypes.string, label: PropTypes.string })],
125
+ [
126
+ PropTypes.string,
127
+ PropTypes.shape({
128
+ value :PropTypes.string,
129
+ label :PropTypes.string,
130
+ disabled:PropTypes.bool,
131
+ })],
102
132
  ),
103
133
  ),
104
134
  /**
@@ -14,16 +14,16 @@ $default-padding: 0.75em 0.75em 0.55em;
14
14
 
15
15
 
16
16
  .input-label {
17
- color: var(--main1);
17
+ color: var(--main2);
18
18
  }
19
19
 
20
20
  .input {
21
- background: var(--light-background);
22
- color: var(--on-background);
21
+ background: var(--light-background2);
22
+ color: var(--on-background2);
23
23
  padding: $default-padding;
24
24
 
25
25
  &:focus {
26
- background: var(--dark-background);
26
+ background: var(--dark-background2);
27
27
  }
28
28
  }
29
29
  }