@pareto-engineering/design-system 2.0.0-alpha.34 → 2.0.0-alpha.37

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 (165) hide show
  1. package/dist/cjs/a/Shapes/styles.scss +1 -1
  2. package/dist/cjs/c/{SiteFooter/SiteFooter.js → SocialMediaShareButton/SocialMediaShareButton.js} +48 -16
  3. package/dist/cjs/c/SocialMediaShareButton/index.js +15 -0
  4. package/dist/cjs/c/SocialMediaShareButton/styles.scss +39 -0
  5. package/dist/cjs/c/index.js +9 -1
  6. package/dist/es/a/Shapes/styles.scss +1 -1
  7. package/dist/es/c/SocialMediaShareButton/SocialMediaShareButton.js +89 -0
  8. package/dist/es/c/SocialMediaShareButton/index.js +2 -0
  9. package/dist/es/c/SocialMediaShareButton/styles.scss +39 -0
  10. package/dist/es/c/index.js +2 -1
  11. package/package.json +1 -1
  12. package/src/__snapshots__/Storyshots.test.js.snap +29 -0
  13. package/src/stories/c/SocialMediaShareButton.stories.jsx +25 -0
  14. package/src/ui/a/Shapes/styles.scss +1 -1
  15. package/src/ui/c/SocialMediaShareButton/SocialMediaShareButton.jsx +113 -0
  16. package/src/ui/c/SocialMediaShareButton/index.js +2 -0
  17. package/src/ui/c/SocialMediaShareButton/styles.scss +39 -0
  18. package/src/ui/c/index.js +1 -0
  19. package/dist/cjs/a/GradientBackground/GradientBackground.js +0 -140
  20. package/dist/cjs/a/GradientBackground/index.js +0 -15
  21. package/dist/cjs/a/GradientBackground/styles.scss +0 -191
  22. package/dist/cjs/c/AcceptCookies/AcceptCookies.js +0 -134
  23. package/dist/cjs/c/AcceptCookies/index.js +0 -15
  24. package/dist/cjs/c/AcceptCookies/styles.scss +0 -49
  25. package/dist/cjs/c/BlogCategoryButton/BlogCategoryButton.js +0 -95
  26. package/dist/cjs/c/BlogCategoryButton/index.js +0 -15
  27. package/dist/cjs/c/BlogContext/BlogContextProvider.js +0 -63
  28. package/dist/cjs/c/BlogContext/Context.js +0 -16
  29. package/dist/cjs/c/BlogContext/ContextProvider.js +0 -63
  30. package/dist/cjs/c/BlogContext/index.js +0 -31
  31. package/dist/cjs/c/BlogContext/useBlog.js +0 -16
  32. package/dist/cjs/c/BlogPost/BlogPost.js +0 -147
  33. package/dist/cjs/c/BlogPost/index.js +0 -15
  34. package/dist/cjs/c/BlogPost/styles.scss +0 -33
  35. package/dist/cjs/c/BlogPostsList/BlogPostsList.js +0 -73
  36. package/dist/cjs/c/BlogPostsList/common/Card/Card.js +0 -170
  37. package/dist/cjs/c/BlogPostsList/common/Card/index.js +0 -15
  38. package/dist/cjs/c/BlogPostsList/common/index.js +0 -13
  39. package/dist/cjs/c/BlogPostsList/index.js +0 -15
  40. package/dist/cjs/c/BlogPostsList/styles.scss +0 -72
  41. package/dist/cjs/c/SiteFooter/common/Section/Section.js +0 -95
  42. package/dist/cjs/c/SiteFooter/common/Section/index.js +0 -15
  43. package/dist/cjs/c/SiteFooter/common/index.js +0 -13
  44. package/dist/cjs/c/SiteFooter/index.js +0 -15
  45. package/dist/cjs/c/SiteFooter/styles.scss +0 -34
  46. package/dist/cjs/c/SiteHeaderCTA/SiteHeaderCTA.js +0 -108
  47. package/dist/cjs/c/SiteHeaderCTA/index.js +0 -15
  48. package/dist/cjs/c/SiteHeaderCTA/styles.scss +0 -44
  49. package/dist/cjs/c/SiteMission/SiteMission.js +0 -113
  50. package/dist/cjs/c/SiteMission/index.js +0 -15
  51. package/dist/cjs/c/SiteMission/styles.scss +0 -30
  52. package/dist/cjs/c/SiteNavigation/SiteNavigation.js +0 -130
  53. package/dist/cjs/c/SiteNavigation/index.js +0 -15
  54. package/dist/cjs/c/SiteNavigation/styles.scss +0 -118
  55. package/dist/cjs/c/SiteOnboardingStep/SiteOnboardingStep.js +0 -98
  56. package/dist/cjs/c/SiteOnboardingStep/index.js +0 -15
  57. package/dist/cjs/c/SiteOnboardingStep/styles.scss +0 -51
  58. package/dist/cjs/c/SitePricing/SitePricing.js +0 -108
  59. package/dist/cjs/c/SitePricing/index.js +0 -15
  60. package/dist/cjs/c/SitePricing/styles.scss +0 -73
  61. package/dist/cjs/c/SiteServices/SiteServices.js +0 -211
  62. package/dist/cjs/c/SiteServices/index.js +0 -15
  63. package/dist/cjs/c/SiteServices/styles.scss +0 -138
  64. package/dist/cjs/c/TeamGallery/TeamGallery.js +0 -80
  65. package/dist/cjs/c/TeamGallery/common/PersonCard/PersonCard.js +0 -84
  66. package/dist/cjs/c/TeamGallery/common/PersonCard/index.js +0 -15
  67. package/dist/cjs/c/TeamGallery/common/index.js +0 -13
  68. package/dist/cjs/c/TeamGallery/index.js +0 -15
  69. package/dist/cjs/c/TeamGallery/styles.scss +0 -100
  70. package/dist/cjs/c/Testimonials/Testimonials.js +0 -119
  71. package/dist/cjs/c/Testimonials/index.js +0 -15
  72. package/dist/cjs/c/Testimonials/styles.scss +0 -112
  73. package/dist/cjs/experimental/GradientBackground/GradientBackground.js +0 -98
  74. package/dist/cjs/experimental/GradientBackground/index.js +0 -15
  75. package/dist/cjs/experimental/GradientBackground/styles.scss +0 -64
  76. package/dist/cjs/experimental/index.js +0 -13
  77. package/dist/cjs/f/fields/CheckboxInput/CheckboxInput.js +0 -105
  78. package/dist/cjs/f/fields/CheckboxInput/index.js +0 -15
  79. package/dist/cjs/f/fields/CheckboxInput/styles.scss +0 -28
  80. package/dist/cjs/f/fields/RadioInput/RadioInput.js +0 -110
  81. package/dist/cjs/f/fields/RadioInput/index.js +0 -15
  82. package/dist/cjs/f/fields/RadioInput/styles.scss +0 -26
  83. package/dist/cjs/f/fields/TaskRecommendation/TaskRecommendation.js +0 -129
  84. package/dist/cjs/f/fields/TaskRecommendation/index.js +0 -15
  85. package/dist/cjs/f/fields/TaskRecommendation/styles.scss +0 -37
  86. package/dist/cjs/f/fields/TaskRecommendationInput/TaskRecommendationInput.js +0 -131
  87. package/dist/cjs/f/fields/TaskRecommendationInput/index.js +0 -15
  88. package/dist/cjs/f/fields/TaskRecommendationInput/styles.scss +0 -41
  89. package/dist/cjs/f/fields/TextArea/TextArea.js +0 -141
  90. package/dist/cjs/f/fields/TextArea/index.js +0 -15
  91. package/dist/cjs/f/fields/TextArea/styles.scss +0 -19
  92. package/dist/es/a/GradientBackground/GradientBackground.js +0 -118
  93. package/dist/es/a/GradientBackground/index.js +0 -2
  94. package/dist/es/a/GradientBackground/styles.scss +0 -191
  95. package/dist/es/c/AcceptCookies/AcceptCookies.js +0 -117
  96. package/dist/es/c/AcceptCookies/index.js +0 -2
  97. package/dist/es/c/AcceptCookies/styles.scss +0 -49
  98. package/dist/es/c/BlogCategoryButton/BlogCategoryButton.js +0 -68
  99. package/dist/es/c/BlogCategoryButton/index.js +0 -2
  100. package/dist/es/c/BlogContext/BlogContextProvider.js +0 -45
  101. package/dist/es/c/BlogContext/Context.js +0 -2
  102. package/dist/es/c/BlogContext/ContextProvider.js +0 -45
  103. package/dist/es/c/BlogContext/index.js +0 -4
  104. package/dist/es/c/BlogContext/useBlog.js +0 -3
  105. package/dist/es/c/BlogPost/BlogPost.js +0 -128
  106. package/dist/es/c/BlogPost/index.js +0 -2
  107. package/dist/es/c/BlogPost/styles.scss +0 -33
  108. package/dist/es/c/BlogPostsList/BlogPostsList.js +0 -56
  109. package/dist/es/c/BlogPostsList/common/Card/Card.js +0 -143
  110. package/dist/es/c/BlogPostsList/common/Card/index.js +0 -2
  111. package/dist/es/c/BlogPostsList/common/index.js +0 -1
  112. package/dist/es/c/BlogPostsList/index.js +0 -2
  113. package/dist/es/c/BlogPostsList/styles.scss +0 -72
  114. package/dist/es/c/SiteFooter/SiteFooter.js +0 -56
  115. package/dist/es/c/SiteFooter/common/Section/Section.js +0 -73
  116. package/dist/es/c/SiteFooter/common/Section/index.js +0 -2
  117. package/dist/es/c/SiteFooter/common/index.js +0 -1
  118. package/dist/es/c/SiteFooter/index.js +0 -2
  119. package/dist/es/c/SiteFooter/styles.scss +0 -34
  120. package/dist/es/c/SiteHeaderCTA/SiteHeaderCTA.js +0 -92
  121. package/dist/es/c/SiteHeaderCTA/index.js +0 -2
  122. package/dist/es/c/SiteHeaderCTA/styles.scss +0 -44
  123. package/dist/es/c/SiteMission/SiteMission.js +0 -96
  124. package/dist/es/c/SiteMission/index.js +0 -2
  125. package/dist/es/c/SiteMission/styles.scss +0 -30
  126. package/dist/es/c/SiteNavigation/SiteNavigation.js +0 -111
  127. package/dist/es/c/SiteNavigation/index.js +0 -2
  128. package/dist/es/c/SiteNavigation/styles.scss +0 -118
  129. package/dist/es/c/SiteOnboardingStep/SiteOnboardingStep.js +0 -81
  130. package/dist/es/c/SiteOnboardingStep/index.js +0 -2
  131. package/dist/es/c/SiteOnboardingStep/styles.scss +0 -51
  132. package/dist/es/c/SitePricing/SitePricing.js +0 -91
  133. package/dist/es/c/SitePricing/index.js +0 -2
  134. package/dist/es/c/SitePricing/styles.scss +0 -73
  135. package/dist/es/c/SiteServices/SiteServices.js +0 -195
  136. package/dist/es/c/SiteServices/index.js +0 -2
  137. package/dist/es/c/SiteServices/styles.scss +0 -138
  138. package/dist/es/c/TeamGallery/TeamGallery.js +0 -64
  139. package/dist/es/c/TeamGallery/common/PersonCard/PersonCard.js +0 -64
  140. package/dist/es/c/TeamGallery/common/PersonCard/index.js +0 -2
  141. package/dist/es/c/TeamGallery/common/index.js +0 -1
  142. package/dist/es/c/TeamGallery/index.js +0 -2
  143. package/dist/es/c/TeamGallery/styles.scss +0 -100
  144. package/dist/es/c/Testimonials/Testimonials.js +0 -99
  145. package/dist/es/c/Testimonials/index.js +0 -2
  146. package/dist/es/c/Testimonials/styles.scss +0 -112
  147. package/dist/es/experimental/GradientBackground/GradientBackground.js +0 -76
  148. package/dist/es/experimental/GradientBackground/index.js +0 -2
  149. package/dist/es/experimental/GradientBackground/styles.scss +0 -64
  150. package/dist/es/experimental/index.js +0 -1
  151. package/dist/es/f/fields/CheckboxInput/CheckboxInput.js +0 -85
  152. package/dist/es/f/fields/CheckboxInput/index.js +0 -2
  153. package/dist/es/f/fields/CheckboxInput/styles.scss +0 -28
  154. package/dist/es/f/fields/RadioInput/RadioInput.js +0 -90
  155. package/dist/es/f/fields/RadioInput/index.js +0 -2
  156. package/dist/es/f/fields/RadioInput/styles.scss +0 -26
  157. package/dist/es/f/fields/TaskRecommendation/TaskRecommendation.js +0 -111
  158. package/dist/es/f/fields/TaskRecommendation/index.js +0 -2
  159. package/dist/es/f/fields/TaskRecommendation/styles.scss +0 -37
  160. package/dist/es/f/fields/TaskRecommendationInput/TaskRecommendationInput.js +0 -111
  161. package/dist/es/f/fields/TaskRecommendationInput/index.js +0 -2
  162. package/dist/es/f/fields/TaskRecommendationInput/styles.scss +0 -41
  163. package/dist/es/f/fields/TextArea/TextArea.js +0 -124
  164. package/dist/es/f/fields/TextArea/index.js +0 -2
  165. package/dist/es/f/fields/TextArea/styles.scss +0 -19
@@ -125,7 +125,7 @@ $default-shapes-opacity:.8;
125
125
  }
126
126
 
127
127
  .circle {
128
- background-image: linear-gradient(var(--light-y), var(--dark-y));
128
+ background-image: linear-gradient(var(--dark-y), var(--light-y));
129
129
  clip-path: circle(50% at 50% 50%);
130
130
  height: var(--shape-height, #{$default-circle-height});
131
131
  opacity: $default-shapes-opacity;
@@ -11,8 +11,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
12
12
  var _bem = _interopRequireDefault(require("@pareto-engineering/bem"));
13
13
 
14
- var _common = require("./common");
15
-
16
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
15
 
18
16
  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); }
@@ -21,31 +19,50 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
21
19
 
22
20
  // Local Definitions
23
21
  var baseClassName = _bem.default.base;
24
- var componentClassName = 'site-footer';
22
+ var componentClassName = 'social-media-share-button';
25
23
  /**
26
24
  * This is the component description.
27
25
  */
28
26
 
29
- var SiteFooter = _ref => {
27
+ var SocialMediaShareButton = _ref => {
30
28
  var {
31
29
  id,
32
30
  className: userClassName,
33
31
  style,
34
- children // ...otherProps
35
-
32
+ icon,
33
+ // children,
34
+ type,
35
+ color
36
36
  } = _ref;
37
37
  (0, React.useLayoutEffect)(() => {
38
38
  Promise.resolve().then(() => _interopRequireWildcard(require("./styles.scss")));
39
39
  }, []);
40
- return /*#__PURE__*/React.createElement("footer", {
40
+ var isServer = typeof window === 'undefined';
41
+ var title = isServer ? '' : document.title;
42
+ var link = isServer ? '' : window.location.href;
43
+ var defaultsMap = {
44
+ facebook: {
45
+ icon: 'f',
46
+ link: "https://www.facebook.com/sharer/sharer.php?u=".concat(link, "&quote=").concat(title)
47
+ },
48
+ twitter: {
49
+ icon: 't',
50
+ link: "https://twitter.com/intent/tweet?text=".concat(title, "&url=").concat(link)
51
+ }
52
+ };
53
+ return /*#__PURE__*/React.createElement("a", {
54
+ href: defaultsMap[type].link,
55
+ target: "_blank",
56
+ rel: "noreferrer",
41
57
  id: id,
42
- className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
43
- style: style // {...otherProps}
44
-
45
- }, children);
58
+ className: [baseClassName, componentClassName, "x-".concat(color || type), userClassName].filter(e => e).join(' '),
59
+ style: style
60
+ }, /*#__PURE__*/React.createElement("button", {
61
+ type: "button"
62
+ }, icon || defaultsMap[type].icon));
46
63
  };
47
64
 
48
- SiteFooter.propTypes = {
65
+ SocialMediaShareButton.propTypes = {
49
66
  /**
50
67
  * The HTML id for this element
51
68
  */
@@ -64,10 +81,25 @@ SiteFooter.propTypes = {
64
81
  /**
65
82
  * The children JSX
66
83
  */
67
- children: _propTypes.default.node
84
+ // children:PropTypes.node,
85
+
86
+ /**
87
+ * The Social Media to Target.
88
+ * If blank, you need to provide both an icon letter (from glyphter) and a link.
89
+ */
90
+ type: _propTypes.default.oneOf(['twitter', 'facebook']),
91
+
92
+ /**
93
+ * The icon of the social media
94
+ */
95
+ icon: _propTypes.default.string,
96
+
97
+ /**
98
+ * The button color
99
+ */
100
+ color: _propTypes.default.string
68
101
  };
69
- SiteFooter.defaultProps = {// someProp:false
102
+ SocialMediaShareButton.defaultProps = {// someProp:false
70
103
  };
71
- SiteFooter.Section = _common.Section;
72
- var _default = SiteFooter;
104
+ var _default = SocialMediaShareButton;
73
105
  exports.default = _default;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "SocialMediaShareButton", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _SocialMediaShareButton.default;
10
+ }
11
+ });
12
+
13
+ var _SocialMediaShareButton = _interopRequireDefault(require("./SocialMediaShareButton"));
14
+
15
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -0,0 +1,39 @@
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-dimensions: 2em;
8
+ $mobile-dimensions: 2.75em;
9
+
10
+ .#{bem.$base}.social-media-share-button{
11
+
12
+ > button {
13
+ appearance: none;
14
+ background: transparent;
15
+ border: 0;
16
+ border-radius: 3em;
17
+ color: var(--x);
18
+ cursor: pointer;
19
+ font-family: "icons", sans-serif;
20
+ height: $default-dimensions;
21
+ transition: all .3s;
22
+ width: $default-dimensions;
23
+
24
+ @include mixins.media($to:$sm-md) {
25
+ height: $mobile-dimensions;
26
+ width: $mobile-dimensions;
27
+ }
28
+
29
+ &:hover {
30
+ background: var(--x);
31
+ color: var(--on-x);
32
+ }
33
+
34
+ &:focus, &:active {
35
+ background: var(--light-x);
36
+ color: var(--on-x);
37
+ }
38
+ }
39
+ }
@@ -27,9 +27,17 @@ Object.defineProperty(exports, "Shortener", {
27
27
  return _Shortener.Shortener;
28
28
  }
29
29
  });
30
+ Object.defineProperty(exports, "SocialMediaShareButton", {
31
+ enumerable: true,
32
+ get: function get() {
33
+ return _SocialMediaShareButton.SocialMediaShareButton;
34
+ }
35
+ });
30
36
 
31
37
  var _Hero = require("./Hero");
32
38
 
33
39
  var _ContentSlides = require("./ContentSlides");
34
40
 
35
- var _Shortener = require("./Shortener");
41
+ var _Shortener = require("./Shortener");
42
+
43
+ var _SocialMediaShareButton = require("./SocialMediaShareButton");
@@ -125,7 +125,7 @@ $default-shapes-opacity:.8;
125
125
  }
126
126
 
127
127
  .circle {
128
- background-image: linear-gradient(var(--light-y), var(--dark-y));
128
+ background-image: linear-gradient(var(--dark-y), var(--light-y));
129
129
  clip-path: circle(50% at 50% 50%);
130
130
  height: var(--shape-height, #{$default-circle-height});
131
131
  opacity: $default-shapes-opacity;
@@ -0,0 +1,89 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ import * as React from 'react';
3
+ import { useLayoutEffect } from 'react';
4
+ import PropTypes from 'prop-types';
5
+ import styleNames from '@pareto-engineering/bem'; // Local Definitions
6
+
7
+ const baseClassName = styleNames.base;
8
+ const componentClassName = 'social-media-share-button';
9
+ /**
10
+ * This is the component description.
11
+ */
12
+
13
+ const SocialMediaShareButton = ({
14
+ id,
15
+ className: userClassName,
16
+ style,
17
+ icon,
18
+ // children,
19
+ type,
20
+ color
21
+ }) => {
22
+ useLayoutEffect(() => {
23
+ import("./styles.scss");
24
+ }, []);
25
+ const isServer = typeof window === 'undefined';
26
+ const title = isServer ? '' : document.title;
27
+ const link = isServer ? '' : window.location.href;
28
+ const defaultsMap = {
29
+ facebook: {
30
+ icon: 'f',
31
+ link: `https://www.facebook.com/sharer/sharer.php?u=${link}&quote=${title}`
32
+ },
33
+ twitter: {
34
+ icon: 't',
35
+ link: `https://twitter.com/intent/tweet?text=${title}&url=${link}`
36
+ }
37
+ };
38
+ return /*#__PURE__*/React.createElement("a", {
39
+ href: defaultsMap[type].link,
40
+ target: "_blank",
41
+ rel: "noreferrer",
42
+ id: id,
43
+ className: [baseClassName, componentClassName, `x-${color || type}`, userClassName].filter(e => e).join(' '),
44
+ style: style
45
+ }, /*#__PURE__*/React.createElement("button", {
46
+ type: "button"
47
+ }, icon || defaultsMap[type].icon));
48
+ };
49
+
50
+ SocialMediaShareButton.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 children JSX
68
+ */
69
+ // children:PropTypes.node,
70
+
71
+ /**
72
+ * The Social Media to Target.
73
+ * If blank, you need to provide both an icon letter (from glyphter) and a link.
74
+ */
75
+ type: PropTypes.oneOf(['twitter', 'facebook']),
76
+
77
+ /**
78
+ * The icon of the social media
79
+ */
80
+ icon: PropTypes.string,
81
+
82
+ /**
83
+ * The button color
84
+ */
85
+ color: PropTypes.string
86
+ };
87
+ SocialMediaShareButton.defaultProps = {// someProp:false
88
+ };
89
+ export default SocialMediaShareButton;
@@ -0,0 +1,2 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ export { default as SocialMediaShareButton } from "./SocialMediaShareButton";
@@ -0,0 +1,39 @@
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-dimensions: 2em;
8
+ $mobile-dimensions: 2.75em;
9
+
10
+ .#{bem.$base}.social-media-share-button{
11
+
12
+ > button {
13
+ appearance: none;
14
+ background: transparent;
15
+ border: 0;
16
+ border-radius: 3em;
17
+ color: var(--x);
18
+ cursor: pointer;
19
+ font-family: "icons", sans-serif;
20
+ height: $default-dimensions;
21
+ transition: all .3s;
22
+ width: $default-dimensions;
23
+
24
+ @include mixins.media($to:$sm-md) {
25
+ height: $mobile-dimensions;
26
+ width: $mobile-dimensions;
27
+ }
28
+
29
+ &:hover {
30
+ background: var(--x);
31
+ color: var(--on-x);
32
+ }
33
+
34
+ &:focus, &:active {
35
+ background: var(--light-x);
36
+ color: var(--on-x);
37
+ }
38
+ }
39
+ }
@@ -1,3 +1,4 @@
1
1
  export { Hero } from "./Hero";
2
2
  export { ContentSlides, useContentSlides } from "./ContentSlides";
3
- export { Shortener } from "./Shortener";
3
+ export { Shortener } from "./Shortener";
4
+ export { SocialMediaShareButton } from "./SocialMediaShareButton";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pareto-engineering/design-system",
3
- "version": "2.0.0-alpha.34",
3
+ "version": "2.0.0-alpha.37",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/es/index.js",
@@ -9242,6 +9242,35 @@ exports[`Storyshots c/Shortener Base 1`] = `
9242
9242
  </span>
9243
9243
  `;
9244
9244
 
9245
+ exports[`Storyshots c/SocialMediaShareButton Base 1`] = `
9246
+ <div>
9247
+ <a
9248
+ className="base social-media-share-button x-facebook"
9249
+ href="https://www.facebook.com/sharer/sharer.php?u=http://localhost/#/welcome&quote="
9250
+ rel="noreferrer"
9251
+ target="_blank"
9252
+ >
9253
+ <button
9254
+ type="button"
9255
+ >
9256
+ f
9257
+ </button>
9258
+ </a>
9259
+ <a
9260
+ className="base social-media-share-button x-twitter"
9261
+ href="https://twitter.com/intent/tweet?text=&url=http://localhost/#/welcome"
9262
+ rel="noreferrer"
9263
+ target="_blank"
9264
+ >
9265
+ <button
9266
+ type="button"
9267
+ >
9268
+ t
9269
+ </button>
9270
+ </a>
9271
+ </div>
9272
+ `;
9273
+
9245
9274
  exports[`Storyshots f/FormInput Base 1`] = `
9246
9275
  <form
9247
9276
  action="#"
@@ -0,0 +1,25 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ import * as React from 'react'
3
+ import { SocialMediaShareButton } from 'ui'
4
+ import Router from '../utils/Router'
5
+
6
+ export default {
7
+ title :'c/SocialMediaShareButton',
8
+ component :SocialMediaShareButton,
9
+ subcomponents:{
10
+ // Item:SocialMediaShareButton.Item
11
+ },
12
+ decorators:[
13
+ (storyfn) => <Router>{storyfn()}</Router>,
14
+ ],
15
+ argTypes:{
16
+ backgroundColor:{ control: 'color' },
17
+ },
18
+ }
19
+
20
+ export const Base = () => (
21
+ <div>
22
+ <SocialMediaShareButton type="facebook" />
23
+ <SocialMediaShareButton type="twitter" />
24
+ </div>
25
+ )
@@ -125,7 +125,7 @@ $default-shapes-opacity:.8;
125
125
  }
126
126
 
127
127
  .circle {
128
- background-image: linear-gradient(var(--light-y), var(--dark-y));
128
+ background-image: linear-gradient(var(--dark-y), var(--light-y));
129
129
  clip-path: circle(50% at 50% 50%);
130
130
  height: var(--shape-height, #{$default-circle-height});
131
131
  opacity: $default-shapes-opacity;
@@ -0,0 +1,113 @@
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 = 'social-media-share-button'
15
+
16
+ /**
17
+ * This is the component description.
18
+ */
19
+ const SocialMediaShareButton = ({
20
+ id,
21
+ className:userClassName,
22
+ style,
23
+ icon,
24
+ // children,
25
+ type,
26
+ color,
27
+ }) => {
28
+ useLayoutEffect(() => {
29
+ import('./styles.scss')
30
+ }, [])
31
+
32
+ const isServer = typeof window === 'undefined'
33
+
34
+ const title = isServer ? '' : document.title
35
+ const link = isServer ? '' : window.location.href
36
+
37
+ const defaultsMap = {
38
+ facebook:{
39
+ icon:'f',
40
+ link:`https://www.facebook.com/sharer/sharer.php?u=${link}&quote=${title}`,
41
+ },
42
+ twitter:{
43
+ icon:'t',
44
+ link:`https://twitter.com/intent/tweet?text=${title}&url=${link}`,
45
+ },
46
+ }
47
+
48
+ return (
49
+ <a
50
+ href={defaultsMap[type].link}
51
+ target="_blank"
52
+ rel="noreferrer"
53
+ id={id}
54
+ className={[
55
+ baseClassName,
56
+ componentClassName,
57
+ `x-${color || type}`,
58
+ userClassName,
59
+ ]
60
+ .filter((e) => e)
61
+ .join(' ')}
62
+ style={style}
63
+ >
64
+ <button type="button">
65
+ { icon || defaultsMap[type].icon }
66
+ </button>
67
+ </a>
68
+ )
69
+ }
70
+
71
+ SocialMediaShareButton.propTypes = {
72
+ /**
73
+ * The HTML id for this element
74
+ */
75
+ id:PropTypes.string,
76
+
77
+ /**
78
+ * The HTML class names for this element
79
+ */
80
+ className:PropTypes.string,
81
+
82
+ /**
83
+ * The React-written, css properties for this element.
84
+ */
85
+ style:PropTypes.objectOf(PropTypes.string),
86
+
87
+ /**
88
+ * The children JSX
89
+ */
90
+ // children:PropTypes.node,
91
+
92
+ /**
93
+ * The Social Media to Target.
94
+ * If blank, you need to provide both an icon letter (from glyphter) and a link.
95
+ */
96
+ type:PropTypes.oneOf(['twitter', 'facebook']),
97
+
98
+ /**
99
+ * The icon of the social media
100
+ */
101
+ icon:PropTypes.string,
102
+
103
+ /**
104
+ * The button color
105
+ */
106
+ color:PropTypes.string,
107
+ }
108
+
109
+ SocialMediaShareButton.defaultProps = {
110
+ // someProp:false
111
+ }
112
+
113
+ export default SocialMediaShareButton
@@ -0,0 +1,2 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ export { default as SocialMediaShareButton } from './SocialMediaShareButton'
@@ -0,0 +1,39 @@
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-dimensions: 2em;
8
+ $mobile-dimensions: 2.75em;
9
+
10
+ .#{bem.$base}.social-media-share-button{
11
+
12
+ > button {
13
+ appearance: none;
14
+ background: transparent;
15
+ border: 0;
16
+ border-radius: 3em;
17
+ color: var(--x);
18
+ cursor: pointer;
19
+ font-family: "icons", sans-serif;
20
+ height: $default-dimensions;
21
+ transition: all .3s;
22
+ width: $default-dimensions;
23
+
24
+ @include mixins.media($to:$sm-md) {
25
+ height: $mobile-dimensions;
26
+ width: $mobile-dimensions;
27
+ }
28
+
29
+ &:hover {
30
+ background: var(--x);
31
+ color: var(--on-x);
32
+ }
33
+
34
+ &:focus, &:active {
35
+ background: var(--light-x);
36
+ color: var(--on-x);
37
+ }
38
+ }
39
+ }
package/src/ui/c/index.js CHANGED
@@ -1,3 +1,4 @@
1
1
  export { Hero } from './Hero'
2
2
  export { ContentSlides, useContentSlides } from './ContentSlides'
3
3
  export { Shortener } from './Shortener'
4
+ export { SocialMediaShareButton } from './SocialMediaShareButton'