@pareto-engineering/design-system 2.0.0-alpha.39 → 2.0.0-alpha.41

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 (163) hide show
  1. package/dist/cjs/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +11 -4
  2. package/dist/cjs/f/fields/RatingsInput/RatingsInput.js +39 -6
  3. package/dist/cjs/f/fields/RatingsInput/styles.scss +29 -20
  4. package/dist/cjs/f/fields/TextInput/TextInput.js +10 -3
  5. package/dist/es/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +11 -4
  6. package/dist/es/f/fields/RatingsInput/RatingsInput.js +38 -6
  7. package/dist/es/f/fields/RatingsInput/styles.scss +29 -20
  8. package/dist/es/f/fields/TextInput/TextInput.js +10 -3
  9. package/package.json +1 -1
  10. package/src/__snapshots__/Storyshots.test.js.snap +655 -625
  11. package/src/stories/f/RatingsInput.stories.jsx +3 -2
  12. package/src/ui/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.jsx +8 -1
  13. package/src/ui/f/fields/RatingsInput/RatingsInput.jsx +54 -19
  14. package/src/ui/f/fields/RatingsInput/styles.scss +29 -20
  15. package/src/ui/f/fields/TextInput/TextInput.jsx +7 -0
  16. package/dist/cjs/a/GradientBackground/GradientBackground.js +0 -140
  17. package/dist/cjs/a/GradientBackground/index.js +0 -15
  18. package/dist/cjs/a/GradientBackground/styles.scss +0 -191
  19. package/dist/cjs/c/AcceptCookies/AcceptCookies.js +0 -134
  20. package/dist/cjs/c/AcceptCookies/index.js +0 -15
  21. package/dist/cjs/c/AcceptCookies/styles.scss +0 -49
  22. package/dist/cjs/c/BlogCategoryButton/BlogCategoryButton.js +0 -95
  23. package/dist/cjs/c/BlogCategoryButton/index.js +0 -15
  24. package/dist/cjs/c/BlogContext/BlogContextProvider.js +0 -63
  25. package/dist/cjs/c/BlogContext/Context.js +0 -16
  26. package/dist/cjs/c/BlogContext/ContextProvider.js +0 -63
  27. package/dist/cjs/c/BlogContext/index.js +0 -31
  28. package/dist/cjs/c/BlogContext/useBlog.js +0 -16
  29. package/dist/cjs/c/BlogPost/BlogPost.js +0 -147
  30. package/dist/cjs/c/BlogPost/index.js +0 -15
  31. package/dist/cjs/c/BlogPost/styles.scss +0 -33
  32. package/dist/cjs/c/BlogPostsList/BlogPostsList.js +0 -73
  33. package/dist/cjs/c/BlogPostsList/common/Card/Card.js +0 -170
  34. package/dist/cjs/c/BlogPostsList/common/Card/index.js +0 -15
  35. package/dist/cjs/c/BlogPostsList/common/index.js +0 -13
  36. package/dist/cjs/c/BlogPostsList/index.js +0 -15
  37. package/dist/cjs/c/BlogPostsList/styles.scss +0 -72
  38. package/dist/cjs/c/SiteFooter/SiteFooter.js +0 -73
  39. package/dist/cjs/c/SiteFooter/common/Section/Section.js +0 -95
  40. package/dist/cjs/c/SiteFooter/common/Section/index.js +0 -15
  41. package/dist/cjs/c/SiteFooter/common/index.js +0 -13
  42. package/dist/cjs/c/SiteFooter/index.js +0 -15
  43. package/dist/cjs/c/SiteFooter/styles.scss +0 -34
  44. package/dist/cjs/c/SiteHeaderCTA/SiteHeaderCTA.js +0 -108
  45. package/dist/cjs/c/SiteHeaderCTA/index.js +0 -15
  46. package/dist/cjs/c/SiteHeaderCTA/styles.scss +0 -44
  47. package/dist/cjs/c/SiteMission/SiteMission.js +0 -113
  48. package/dist/cjs/c/SiteMission/index.js +0 -15
  49. package/dist/cjs/c/SiteMission/styles.scss +0 -30
  50. package/dist/cjs/c/SiteNavigation/SiteNavigation.js +0 -130
  51. package/dist/cjs/c/SiteNavigation/index.js +0 -15
  52. package/dist/cjs/c/SiteNavigation/styles.scss +0 -118
  53. package/dist/cjs/c/SiteOnboardingStep/SiteOnboardingStep.js +0 -98
  54. package/dist/cjs/c/SiteOnboardingStep/index.js +0 -15
  55. package/dist/cjs/c/SiteOnboardingStep/styles.scss +0 -51
  56. package/dist/cjs/c/SitePricing/SitePricing.js +0 -108
  57. package/dist/cjs/c/SitePricing/index.js +0 -15
  58. package/dist/cjs/c/SitePricing/styles.scss +0 -73
  59. package/dist/cjs/c/SiteServices/SiteServices.js +0 -211
  60. package/dist/cjs/c/SiteServices/index.js +0 -15
  61. package/dist/cjs/c/SiteServices/styles.scss +0 -138
  62. package/dist/cjs/c/TeamGallery/TeamGallery.js +0 -80
  63. package/dist/cjs/c/TeamGallery/common/PersonCard/PersonCard.js +0 -84
  64. package/dist/cjs/c/TeamGallery/common/PersonCard/index.js +0 -15
  65. package/dist/cjs/c/TeamGallery/common/index.js +0 -13
  66. package/dist/cjs/c/TeamGallery/index.js +0 -15
  67. package/dist/cjs/c/TeamGallery/styles.scss +0 -100
  68. package/dist/cjs/c/Testimonials/Testimonials.js +0 -119
  69. package/dist/cjs/c/Testimonials/index.js +0 -15
  70. package/dist/cjs/c/Testimonials/styles.scss +0 -112
  71. package/dist/cjs/experimental/GradientBackground/GradientBackground.js +0 -98
  72. package/dist/cjs/experimental/GradientBackground/index.js +0 -15
  73. package/dist/cjs/experimental/GradientBackground/styles.scss +0 -64
  74. package/dist/cjs/experimental/index.js +0 -13
  75. package/dist/cjs/f/fields/CheckboxInput/CheckboxInput.js +0 -105
  76. package/dist/cjs/f/fields/CheckboxInput/index.js +0 -15
  77. package/dist/cjs/f/fields/CheckboxInput/styles.scss +0 -28
  78. package/dist/cjs/f/fields/RadioInput/RadioInput.js +0 -110
  79. package/dist/cjs/f/fields/RadioInput/index.js +0 -15
  80. package/dist/cjs/f/fields/RadioInput/styles.scss +0 -26
  81. package/dist/cjs/f/fields/TaskRecommendation/TaskRecommendation.js +0 -129
  82. package/dist/cjs/f/fields/TaskRecommendation/index.js +0 -15
  83. package/dist/cjs/f/fields/TaskRecommendation/styles.scss +0 -37
  84. package/dist/cjs/f/fields/TaskRecommendationInput/TaskRecommendationInput.js +0 -131
  85. package/dist/cjs/f/fields/TaskRecommendationInput/index.js +0 -15
  86. package/dist/cjs/f/fields/TaskRecommendationInput/styles.scss +0 -41
  87. package/dist/cjs/f/fields/TextArea/TextArea.js +0 -141
  88. package/dist/cjs/f/fields/TextArea/index.js +0 -15
  89. package/dist/cjs/f/fields/TextArea/styles.scss +0 -19
  90. package/dist/es/a/GradientBackground/GradientBackground.js +0 -118
  91. package/dist/es/a/GradientBackground/index.js +0 -2
  92. package/dist/es/a/GradientBackground/styles.scss +0 -191
  93. package/dist/es/c/AcceptCookies/AcceptCookies.js +0 -117
  94. package/dist/es/c/AcceptCookies/index.js +0 -2
  95. package/dist/es/c/AcceptCookies/styles.scss +0 -49
  96. package/dist/es/c/BlogCategoryButton/BlogCategoryButton.js +0 -68
  97. package/dist/es/c/BlogCategoryButton/index.js +0 -2
  98. package/dist/es/c/BlogContext/BlogContextProvider.js +0 -45
  99. package/dist/es/c/BlogContext/Context.js +0 -2
  100. package/dist/es/c/BlogContext/ContextProvider.js +0 -45
  101. package/dist/es/c/BlogContext/index.js +0 -4
  102. package/dist/es/c/BlogContext/useBlog.js +0 -3
  103. package/dist/es/c/BlogPost/BlogPost.js +0 -128
  104. package/dist/es/c/BlogPost/index.js +0 -2
  105. package/dist/es/c/BlogPost/styles.scss +0 -33
  106. package/dist/es/c/BlogPostsList/BlogPostsList.js +0 -56
  107. package/dist/es/c/BlogPostsList/common/Card/Card.js +0 -143
  108. package/dist/es/c/BlogPostsList/common/Card/index.js +0 -2
  109. package/dist/es/c/BlogPostsList/common/index.js +0 -1
  110. package/dist/es/c/BlogPostsList/index.js +0 -2
  111. package/dist/es/c/BlogPostsList/styles.scss +0 -72
  112. package/dist/es/c/SiteFooter/SiteFooter.js +0 -56
  113. package/dist/es/c/SiteFooter/common/Section/Section.js +0 -73
  114. package/dist/es/c/SiteFooter/common/Section/index.js +0 -2
  115. package/dist/es/c/SiteFooter/common/index.js +0 -1
  116. package/dist/es/c/SiteFooter/index.js +0 -2
  117. package/dist/es/c/SiteFooter/styles.scss +0 -34
  118. package/dist/es/c/SiteHeaderCTA/SiteHeaderCTA.js +0 -92
  119. package/dist/es/c/SiteHeaderCTA/index.js +0 -2
  120. package/dist/es/c/SiteHeaderCTA/styles.scss +0 -44
  121. package/dist/es/c/SiteMission/SiteMission.js +0 -96
  122. package/dist/es/c/SiteMission/index.js +0 -2
  123. package/dist/es/c/SiteMission/styles.scss +0 -30
  124. package/dist/es/c/SiteNavigation/SiteNavigation.js +0 -111
  125. package/dist/es/c/SiteNavigation/index.js +0 -2
  126. package/dist/es/c/SiteNavigation/styles.scss +0 -118
  127. package/dist/es/c/SiteOnboardingStep/SiteOnboardingStep.js +0 -81
  128. package/dist/es/c/SiteOnboardingStep/index.js +0 -2
  129. package/dist/es/c/SiteOnboardingStep/styles.scss +0 -51
  130. package/dist/es/c/SitePricing/SitePricing.js +0 -91
  131. package/dist/es/c/SitePricing/index.js +0 -2
  132. package/dist/es/c/SitePricing/styles.scss +0 -73
  133. package/dist/es/c/SiteServices/SiteServices.js +0 -195
  134. package/dist/es/c/SiteServices/index.js +0 -2
  135. package/dist/es/c/SiteServices/styles.scss +0 -138
  136. package/dist/es/c/TeamGallery/TeamGallery.js +0 -64
  137. package/dist/es/c/TeamGallery/common/PersonCard/PersonCard.js +0 -64
  138. package/dist/es/c/TeamGallery/common/PersonCard/index.js +0 -2
  139. package/dist/es/c/TeamGallery/common/index.js +0 -1
  140. package/dist/es/c/TeamGallery/index.js +0 -2
  141. package/dist/es/c/TeamGallery/styles.scss +0 -100
  142. package/dist/es/c/Testimonials/Testimonials.js +0 -99
  143. package/dist/es/c/Testimonials/index.js +0 -2
  144. package/dist/es/c/Testimonials/styles.scss +0 -112
  145. package/dist/es/experimental/GradientBackground/GradientBackground.js +0 -76
  146. package/dist/es/experimental/GradientBackground/index.js +0 -2
  147. package/dist/es/experimental/GradientBackground/styles.scss +0 -64
  148. package/dist/es/experimental/index.js +0 -1
  149. package/dist/es/f/fields/CheckboxInput/CheckboxInput.js +0 -85
  150. package/dist/es/f/fields/CheckboxInput/index.js +0 -2
  151. package/dist/es/f/fields/CheckboxInput/styles.scss +0 -28
  152. package/dist/es/f/fields/RadioInput/RadioInput.js +0 -90
  153. package/dist/es/f/fields/RadioInput/index.js +0 -2
  154. package/dist/es/f/fields/RadioInput/styles.scss +0 -26
  155. package/dist/es/f/fields/TaskRecommendation/TaskRecommendation.js +0 -111
  156. package/dist/es/f/fields/TaskRecommendation/index.js +0 -2
  157. package/dist/es/f/fields/TaskRecommendation/styles.scss +0 -37
  158. package/dist/es/f/fields/TaskRecommendationInput/TaskRecommendationInput.js +0 -111
  159. package/dist/es/f/fields/TaskRecommendationInput/index.js +0 -2
  160. package/dist/es/f/fields/TaskRecommendationInput/styles.scss +0 -41
  161. package/dist/es/f/fields/TextArea/TextArea.js +0 -124
  162. package/dist/es/f/fields/TextArea/index.js +0 -2
  163. package/dist/es/f/fields/TextArea/styles.scss +0 -19
@@ -29,14 +29,14 @@ export default {
29
29
 
30
30
  export const Base = () => (
31
31
  <>
32
- <RatingsInput ratingCount={5} name="ratings" />
32
+ <RatingsInput ratingCount={5} name="ratings" label="Your Rating" />
33
33
  <FormDebugger />
34
34
  </>
35
35
  )
36
36
 
37
37
  export const Numbers = () => (
38
38
  <>
39
- <RatingsInput ratingCount={10} name="ratings" showRatingValue />
39
+ <RatingsInput ratingCount={10} name="ratings" showRatingValue label="Your Rating" />
40
40
  <FormDebugger />
41
41
  </>
42
42
  )
@@ -44,6 +44,7 @@ export const Numbers = () => (
44
44
  export const Labels = () => (
45
45
  <>
46
46
  <RatingsInput
47
+ label="Your Rating"
47
48
  labelMax="very satisfied."
48
49
  labelMin="not satisfied."
49
50
  ratingCount={10}
@@ -24,6 +24,7 @@ const HorizontalMenu = ({
24
24
  hideBackIcon,
25
25
  stepsBackwards,
26
26
  customPrevStep,
27
+ color,
27
28
  // ...otherProps
28
29
  }) => {
29
30
  const {
@@ -59,7 +60,7 @@ const HorizontalMenu = ({
59
60
  >
60
61
  {
61
62
  (currentStep?.progress > 0)
62
- && <ProgressBar progress={currentStep.progress} attached height=".4em" color="main2" className="y-background1 b-dark-y" />
63
+ && <ProgressBar progress={currentStep.progress} attached height=".4em" color={color} className="y-background1 b-dark-y" />
63
64
  }
64
65
  <div className={styleNames.elementContent}>
65
66
  <div className="left">
@@ -128,11 +129,17 @@ HorizontalMenu.propTypes = {
128
129
  * Hide back icon boolean
129
130
  */
130
131
  hideBackIcon:PropTypes.bool,
132
+
133
+ /**
134
+ * String that will represent color for Progress bar
135
+ */
136
+ color:PropTypes.string,
131
137
  }
132
138
 
133
139
  HorizontalMenu.defaultProps = {
134
140
  logoColor :'paragraph',
135
141
  stepsBackwards:1,
142
+ color :'main2',
136
143
  }
137
144
 
138
145
  export default HorizontalMenu
@@ -10,6 +10,7 @@ import styleNames from '@pareto-engineering/bem'
10
10
  // Local Definitions
11
11
 
12
12
  import { Rating } from './common'
13
+ import { FormLabel } from '../../common'
13
14
 
14
15
  const baseClassName = styleNames.base
15
16
 
@@ -25,9 +26,13 @@ const RatingsInput = ({
25
26
  name,
26
27
  ratingCount,
27
28
  showRatingValue,
29
+ oneInputLabel,
30
+ label,
31
+ labelColor,
28
32
  labelMax,
29
33
  labelMin,
30
34
  displayRatingsLabel,
35
+ optional,
31
36
  // ...otherProps
32
37
  }) => {
33
38
  useLayoutEffect(() => {
@@ -47,24 +52,36 @@ const RatingsInput = ({
47
52
  .filter((e) => e)
48
53
  .join(' ')}
49
54
  style={style}
50
- // {...otherProps}
51
55
  >
52
- {displayRatingsLabel && <p className="label-text md-s-1 s-2 x-metadata c-x">{labelMin}</p>}
53
- {[...Array(ratingCount)].map((_, index) => {
54
- const ratingValue = index + 1
55
- return (
56
- <Rating
57
- key={ratingValue}
58
- ratingId={`${name}-${ratingValue}`}
59
- value={ratingValue}
60
- name={name}
61
- hover={hover}
62
- setHover={setHover}
63
- showRatingValue={showRatingValue}
64
- />
65
- )
66
- })}
67
- {displayRatingsLabel && <p className="label-text md-s-1 s-2 x-metadata c-x">{labelMax}</p>}
56
+ <FormLabel
57
+ className={[
58
+ 'input-label', oneInputLabel ? 'md-s2 s0 v1 mb-v' : 'v50 mb-v']
59
+ .filter((e) => e)
60
+ .join(' ')}
61
+ name={name}
62
+ color={labelColor}
63
+ optional={optional}
64
+ >
65
+ { label }
66
+ </FormLabel>
67
+ <div className="stars">
68
+ {displayRatingsLabel && <p className="label-text md-s-1 s-2 x-metadata c-x">{labelMin}</p>}
69
+ {[...Array(ratingCount)].map((_, index) => {
70
+ const ratingValue = index + 1
71
+ return (
72
+ <Rating
73
+ key={ratingValue}
74
+ ratingId={`${name}-${ratingValue}`}
75
+ value={ratingValue}
76
+ name={name}
77
+ hover={hover}
78
+ setHover={setHover}
79
+ showRatingValue={showRatingValue}
80
+ />
81
+ )
82
+ })}
83
+ {displayRatingsLabel && <p className="label-text md-s-1 s-2 x-metadata c-x">{labelMax}</p>}
84
+ </div>
68
85
  </div>
69
86
  )
70
87
  }
@@ -97,6 +114,10 @@ RatingsInput.propTypes = {
97
114
  * Determines if the rating start value should be shown
98
115
  */
99
116
  showRatingValue :PropTypes.bool,
117
+ /**
118
+ * The label of the ratings input
119
+ */
120
+ label :PropTypes.string.isRequired,
100
121
  /**
101
122
  * description for the highest rating value
102
123
  */
@@ -109,11 +130,25 @@ RatingsInput.propTypes = {
109
130
  * If the rating lables should be shown
110
131
  */
111
132
  displayRatingsLabel:PropTypes.bool,
133
+ /**
134
+ * Whether the input is optional or not
135
+ */
136
+ optional :PropTypes.bool,
137
+ /**
138
+ * If the slide will only have one input
139
+ */
140
+ oneInputLabel :PropTypes.bool,
141
+
142
+ /**
143
+ * String that will represent color for the label
144
+ */
145
+ labelColor:PropTypes.string,
112
146
  }
113
147
 
114
148
  RatingsInput.defaultProps = {
115
- labelMin:'not satisfied.',
116
- labelMax:'very satisfied.',
149
+ labelMin :'not satisfied.',
150
+ labelMax :'very satisfied.',
151
+ labelColor:'main2',
117
152
  }
118
153
 
119
154
  export default memo(RatingsInput)
@@ -7,34 +7,43 @@ $default-transition: all .2s;
7
7
 
8
8
  .#{bem.$base}.ratings-input {
9
9
  display: flex;
10
+ flex-direction: column;
10
11
 
11
- >:not(:last-child) {
12
- margin-right: $default-rating-icon-margin;
12
+ p {
13
+ padding: $default-padding;
13
14
  }
14
15
 
15
- .#{bem.$base}.rating {
16
+ .stars {
16
17
  display: flex;
17
18
 
18
- input {
19
- opacity: 0;
20
- position: absolute;
21
- visibility: none;
22
- z-index: -1;
19
+ >:not(:last-child) {
20
+ margin-right: $default-rating-icon-margin;
23
21
  }
24
-
25
- label {
22
+
23
+ .#{bem.$base}.rating {
26
24
  display: flex;
27
- flex-direction: column;
28
- align-items: center;
29
- padding: $default-padding;
30
- transition: $default-transition;
31
- cursor: pointer;
25
+
26
+ input {
27
+ opacity: 0;
28
+ position: absolute;
29
+ visibility: none;
30
+ z-index: -1;
31
+ }
32
+
33
+ label {
34
+ display: flex;
35
+ flex-direction: column;
36
+ align-items: center;
37
+ padding: $default-padding;
38
+ transition: $default-transition;
39
+ cursor: pointer;
40
+ }
41
+ }
42
+
43
+ .label-text {
44
+ margin-bottom: 0;
45
+ align-self: flex-end;
32
46
  }
33
- }
34
-
35
- .label-text {
36
- margin-bottom: 0;
37
- align-self: flex-end;
38
47
  }
39
48
  }
40
49
 
@@ -34,6 +34,7 @@ const TextInput = ({
34
34
  description,
35
35
  disabled,
36
36
  placeholder,
37
+ optional,
37
38
  // ...otherProps
38
39
  }) => {
39
40
  useLayoutEffect(() => {
@@ -62,6 +63,7 @@ const TextInput = ({
62
63
  .join(' ')}
63
64
  name={name}
64
65
  color={labelColor}
66
+ optional={optional}
65
67
  >
66
68
  { label }
67
69
  </FormLabel>
@@ -156,6 +158,11 @@ TextInput.propTypes = {
156
158
  * The text input color
157
159
  */
158
160
  color:PropTypes.string,
161
+
162
+ /**
163
+ * Whether the input is optional or not
164
+ */
165
+ optional:PropTypes.bool,
159
166
  }
160
167
 
161
168
  TextInput.defaultProps = {
@@ -1,140 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var React = _interopRequireWildcard(require("react"));
9
-
10
- var _propTypes = _interopRequireDefault(require("prop-types"));
11
-
12
- var _bem = _interopRequireDefault(require("@pareto-engineering/bem"));
13
-
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
17
-
18
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
19
-
20
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
21
-
22
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
-
24
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
-
26
- // Local Definitions
27
- var baseClassName = _bem.default.base;
28
- var componentClassName = 'gradient-background';
29
- /**
30
- * This is the component description.
31
- */
32
-
33
- var GradientBackground = _ref => {
34
- var {
35
- id,
36
- className: userClassName,
37
- style,
38
- pin,
39
- shape,
40
- height,
41
- width // ...otherProps
42
-
43
- } = _ref;
44
- (0, React.useLayoutEffect)(() => {
45
- Promise.resolve().then(() => _interopRequireWildcard(require("./styles.scss")));
46
- }, []);
47
- return /*#__PURE__*/React.createElement("div", {
48
- id: id,
49
- className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
50
- style: _objectSpread(_objectSpread({}, style), {}, {
51
- '--pin': pin,
52
- '--height': height,
53
- '--width': width
54
- }) // {...otherProps}
55
-
56
- }, /*#__PURE__*/React.createElement("div", {
57
- className: "shapes"
58
- }, shape === 'triangle' && /*#__PURE__*/React.createElement("div", {
59
- className: "triangle"
60
- }), shape === 'half-ellipses' && /*#__PURE__*/React.createElement("div", {
61
- className: "half-ellipses"
62
- }, /*#__PURE__*/React.createElement("div", {
63
- className: "up"
64
- }), /*#__PURE__*/React.createElement("div", {
65
- className: "down"
66
- })), shape === 'ellipse' && /*#__PURE__*/React.createElement("div", {
67
- className: "ellipse"
68
- }), shape === 'diamonds' && /*#__PURE__*/React.createElement("div", {
69
- className: "diamonds"
70
- }, /*#__PURE__*/React.createElement("div", {
71
- className: "top-right"
72
- }), /*#__PURE__*/React.createElement("div", {
73
- className: "bottom-left"
74
- }), /*#__PURE__*/React.createElement("div", {
75
- className: "bottom-right"
76
- })), shape === 'rectangles' && /*#__PURE__*/React.createElement("div", {
77
- className: "rectangles"
78
- }, /*#__PURE__*/React.createElement("div", {
79
- className: "top"
80
- }), /*#__PURE__*/React.createElement("div", {
81
- className: "center"
82
- }), /*#__PURE__*/React.createElement("div", {
83
- className: "bottom"
84
- })), shape === 'half-ellipse' && /*#__PURE__*/React.createElement("div", {
85
- className: "half-ellipse"
86
- }), shape === 'circle' && /*#__PURE__*/React.createElement("div", {
87
- className: "circle"
88
- }), shape === 'half-circle' && /*#__PURE__*/React.createElement("div", {
89
- className: "half-circle"
90
- }), shape === 'ellipses' && /*#__PURE__*/React.createElement("div", {
91
- className: "ellipses"
92
- }, /*#__PURE__*/React.createElement("div", {
93
- className: "first"
94
- }), /*#__PURE__*/React.createElement("div", {
95
- className: "second"
96
- })), shape === 'spiral' && /*#__PURE__*/React.createElement("div", {
97
- className: "spiral"
98
- }, /*#__PURE__*/React.createElement("div", {
99
- className: "quater-circle-one"
100
- }), /*#__PURE__*/React.createElement("div", {
101
- className: "quater-circle-two"
102
- }), /*#__PURE__*/React.createElement("div", {
103
- className: "quater-circle-three"
104
- }), /*#__PURE__*/React.createElement("div", {
105
- className: "quater-circle-four"
106
- }))));
107
- };
108
-
109
- GradientBackground.propTypes = {
110
- /**
111
- * The HTML id for this element
112
- */
113
- id: _propTypes.default.string,
114
-
115
- /**
116
- * The HTML class names for this element
117
- */
118
- className: _propTypes.default.string,
119
-
120
- /**
121
- * The React-written, css properties for this element.
122
- */
123
- style: _propTypes.default.objectOf(_propTypes.default.string),
124
-
125
- /**
126
- * Where to pin the shapes
127
- */
128
- pin: _propTypes.default.oneOf(['flex-start', 'center', 'flex-end']),
129
-
130
- /**
131
- * The options of a shape to use
132
- */
133
- shape: _propTypes.default.oneOf(['triangle', 'ellipse', 'half-ellipse', 'half-ellipses', 'spiral', 'diamonds', 'circle', 'half-circle', 'ellipses', 'rectangles'])
134
- };
135
- GradientBackground.defaultProps = {
136
- pin: 'center',
137
- shape: 'triangle'
138
- };
139
- var _default = GradientBackground;
140
- exports.default = _default;
@@ -1,15 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "GradientBackground", {
7
- enumerable: true,
8
- get: function get() {
9
- return _GradientBackground.default;
10
- }
11
- });
12
-
13
- var _GradientBackground = _interopRequireDefault(require("./GradientBackground"));
14
-
15
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -1,191 +0,0 @@
1
- /* @pareto-engineering/generator-front 1.0.12 */
2
-
3
- @use "@pareto-engineering/bem";
4
-
5
- $default-triangle-dimension:30em;
6
- $default-ellipses-dimension:50em;
7
- $default-ellipse-dimension:50em;
8
- $default-shapes-opacity:.8;
9
- $default-diamonds-dimension:40em;
10
- $default-circle-dimension:40em;
11
-
12
- .#{bem.$base}.gradient-background {
13
- align-items: center;
14
- background: var(--light-y);
15
- display: flex;
16
- flex-direction: column;
17
- height: 100%;
18
- justify-content: var(--pin);
19
- position: absolute;
20
- width: 100%;
21
-
22
- .shapes {
23
- display: flex;
24
- justify-content: center;
25
-
26
- .triangle {
27
- background-image: linear-gradient(var(--light-y), var(--dark-y));
28
- clip-path: polygon(0 0, 50% 100%, 100% 0);
29
- height: $default-triangle-dimension * .86;
30
- opacity: $default-shapes-opacity;
31
- width: $default-triangle-dimension;
32
- }
33
-
34
- .half-ellipses {
35
-
36
- height: $default-ellipses-dimension / 2;
37
- width: $default-ellipses-dimension;
38
- opacity: $default-shapes-opacity;
39
-
40
- .up {
41
- background-image: linear-gradient(var(--light-y), var(--y));
42
- clip-path: ellipse(40% 100% at 50% 0%);
43
- height:50%;
44
- }
45
-
46
- .down {
47
- background-image: linear-gradient(to top, var(--light-y), var(--y));
48
- clip-path: ellipse(40% 100% at 50% 100%);
49
- height:50%;
50
- }
51
-
52
- }
53
-
54
- .ellipse {
55
- height: $default-ellipse-dimension / 1.5;
56
- width: $default-ellipse-dimension;
57
- background-image: linear-gradient( to top left, var(--dark-y), var(--light-y),var(--dark-y));
58
- clip-path: ellipse(50% 25% at 50% 50%);
59
- opacity: $default-shapes-opacity;
60
- transform: rotate3d(0, 0, -1, 10deg);
61
- }
62
-
63
- .diamonds {
64
-
65
- height: $default-diamonds-dimension;
66
- width: $default-diamonds-dimension;
67
- opacity: $default-shapes-opacity;
68
- position: relative;
69
-
70
- .top-right {
71
- height: 100%;
72
- width: 100%;
73
- background-image: linear-gradient(to right, var(--dark-y), var(--y));
74
- clip-path: polygon(100% 100%, 0 0, 100% 0);
75
- position: absolute;
76
- }
77
- .bottom-left {
78
- height: 100%;
79
- width: 100%;
80
- background-image: linear-gradient(to left, var(--dark-y), var(--y));
81
- clip-path: polygon(0 100%, 0 0, 100% 100%);
82
- position: absolute;
83
- z-index: 1;
84
- opacity: .95;
85
- }
86
- .bottom-right {
87
- height: 100%;
88
- width: 100%;
89
- background-image: linear-gradient(to bottom, var(--dark-y), var(--y));
90
- clip-path: polygon(100% 100%, 100% 0, 0 100%);
91
- position: absolute;
92
- }
93
- }
94
-
95
- .rectangles {
96
- height: $default-diamonds-dimension;
97
- width: $default-diamonds-dimension;
98
- opacity: $default-shapes-opacity;
99
- display: grid;
100
- grid-template-rows: repeat(3, 1fr);
101
-
102
- .top {
103
- background-image: linear-gradient(to right, var(--dark-y), var(--y));
104
- }
105
-
106
- .center {
107
- background-image: linear-gradient(to left, var(--dark-y), var(--y));
108
- }
109
-
110
- .bottom {
111
- background-image: linear-gradient(to right, var(--dark-y), var(--y));
112
- }
113
- }
114
-
115
- .half-ellipse {
116
- height: $default-ellipses-dimension / 2;
117
- width: $default-ellipses-dimension;
118
- opacity: $default-shapes-opacity;
119
- background-image: linear-gradient(var(--light-y), var(--dark-y));
120
- clip-path: ellipse(50% 50% at 50% 0);
121
- }
122
-
123
- .circle {
124
- height: $default-circle-dimension;
125
- width: $default-circle-dimension;
126
- opacity: $default-shapes-opacity;
127
- background-image: linear-gradient(var(--light-y), var(--dark-y));
128
- clip-path: circle(50% at 50% 50%);
129
- }
130
-
131
- .ellipses {
132
- height: var(--height);
133
- width: var(--width);
134
- opacity: $default-shapes-opacity;
135
- position: relative;
136
-
137
- .first {
138
- height: 100%;
139
- width: 100%;
140
- position: absolute;
141
- background-image: linear-gradient(to top, var(--dark-y), var(--light-y));
142
- clip-path: ellipse(50% 20% at 50% 60%);
143
- }
144
-
145
- .second{
146
- height: 100%;
147
- width: 100%;
148
- position: absolute;
149
- background-image: linear-gradient(to bottom, var(--dark-y), var(--light-y));
150
- clip-path: ellipse(50% 20% at 50% 40%);
151
- }
152
-
153
- }
154
-
155
- // .spiral {
156
- // height: $default-ellipses-dimension;
157
- // width: $default-ellipses-dimension;
158
- // opacity: $default-shapes-opacity;
159
- // position: relative;
160
-
161
- // > *{
162
- // position: absolute;
163
- // height: 100%;
164
- // width: 100%;
165
- // background: radial-gradient(var(--dark-y) 30%, var(--light-y));
166
- // transform-origin: 0 0;
167
- // }
168
-
169
- // .quater-circle-one{
170
- // transform: rotate(90deg);
171
- // clip-path: circle(200px at 0 0);
172
- // z-index: 1;
173
- // }
174
-
175
- // .quater-circle-two {
176
- // clip-path: circle(250px at 0 0);
177
- // transform: rotate(45deg);
178
- // }
179
-
180
- // .quater-circle-three {
181
- // clip-path: circle(300px at 0 0);
182
- // }
183
-
184
- // .quater-circle-four{
185
- // clip-path: circle(350px at 0 0);
186
- // transform: rotate(-45deg);
187
- // }
188
- // }
189
-
190
- }
191
- }