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

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 (162) hide show
  1. package/dist/cjs/c/{SiteFooter/SiteFooter.js → SocialMediaShareButton/SocialMediaShareButton.js} +49 -16
  2. package/dist/cjs/c/SocialMediaShareButton/index.js +15 -0
  3. package/dist/cjs/c/SocialMediaShareButton/styles.scss +39 -0
  4. package/dist/cjs/c/index.js +9 -1
  5. package/dist/es/c/SocialMediaShareButton/SocialMediaShareButton.js +90 -0
  6. package/dist/es/c/SocialMediaShareButton/index.js +2 -0
  7. package/dist/es/c/SocialMediaShareButton/styles.scss +39 -0
  8. package/dist/es/c/index.js +2 -1
  9. package/package.json +1 -1
  10. package/src/__snapshots__/Storyshots.test.js.snap +29 -0
  11. package/src/stories/c/SocialMediaShareButton.stories.jsx +25 -0
  12. package/src/ui/c/SocialMediaShareButton/SocialMediaShareButton.jsx +111 -0
  13. package/src/ui/c/SocialMediaShareButton/index.js +2 -0
  14. package/src/ui/c/SocialMediaShareButton/styles.scss +39 -0
  15. package/src/ui/c/index.js +1 -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/common/Section/Section.js +0 -95
  39. package/dist/cjs/c/SiteFooter/common/Section/index.js +0 -15
  40. package/dist/cjs/c/SiteFooter/common/index.js +0 -13
  41. package/dist/cjs/c/SiteFooter/index.js +0 -15
  42. package/dist/cjs/c/SiteFooter/styles.scss +0 -34
  43. package/dist/cjs/c/SiteHeaderCTA/SiteHeaderCTA.js +0 -108
  44. package/dist/cjs/c/SiteHeaderCTA/index.js +0 -15
  45. package/dist/cjs/c/SiteHeaderCTA/styles.scss +0 -44
  46. package/dist/cjs/c/SiteMission/SiteMission.js +0 -113
  47. package/dist/cjs/c/SiteMission/index.js +0 -15
  48. package/dist/cjs/c/SiteMission/styles.scss +0 -30
  49. package/dist/cjs/c/SiteNavigation/SiteNavigation.js +0 -130
  50. package/dist/cjs/c/SiteNavigation/index.js +0 -15
  51. package/dist/cjs/c/SiteNavigation/styles.scss +0 -118
  52. package/dist/cjs/c/SiteOnboardingStep/SiteOnboardingStep.js +0 -98
  53. package/dist/cjs/c/SiteOnboardingStep/index.js +0 -15
  54. package/dist/cjs/c/SiteOnboardingStep/styles.scss +0 -51
  55. package/dist/cjs/c/SitePricing/SitePricing.js +0 -108
  56. package/dist/cjs/c/SitePricing/index.js +0 -15
  57. package/dist/cjs/c/SitePricing/styles.scss +0 -73
  58. package/dist/cjs/c/SiteServices/SiteServices.js +0 -211
  59. package/dist/cjs/c/SiteServices/index.js +0 -15
  60. package/dist/cjs/c/SiteServices/styles.scss +0 -138
  61. package/dist/cjs/c/TeamGallery/TeamGallery.js +0 -80
  62. package/dist/cjs/c/TeamGallery/common/PersonCard/PersonCard.js +0 -84
  63. package/dist/cjs/c/TeamGallery/common/PersonCard/index.js +0 -15
  64. package/dist/cjs/c/TeamGallery/common/index.js +0 -13
  65. package/dist/cjs/c/TeamGallery/index.js +0 -15
  66. package/dist/cjs/c/TeamGallery/styles.scss +0 -100
  67. package/dist/cjs/c/Testimonials/Testimonials.js +0 -119
  68. package/dist/cjs/c/Testimonials/index.js +0 -15
  69. package/dist/cjs/c/Testimonials/styles.scss +0 -112
  70. package/dist/cjs/experimental/GradientBackground/GradientBackground.js +0 -98
  71. package/dist/cjs/experimental/GradientBackground/index.js +0 -15
  72. package/dist/cjs/experimental/GradientBackground/styles.scss +0 -64
  73. package/dist/cjs/experimental/index.js +0 -13
  74. package/dist/cjs/f/fields/CheckboxInput/CheckboxInput.js +0 -105
  75. package/dist/cjs/f/fields/CheckboxInput/index.js +0 -15
  76. package/dist/cjs/f/fields/CheckboxInput/styles.scss +0 -28
  77. package/dist/cjs/f/fields/RadioInput/RadioInput.js +0 -110
  78. package/dist/cjs/f/fields/RadioInput/index.js +0 -15
  79. package/dist/cjs/f/fields/RadioInput/styles.scss +0 -26
  80. package/dist/cjs/f/fields/TaskRecommendation/TaskRecommendation.js +0 -129
  81. package/dist/cjs/f/fields/TaskRecommendation/index.js +0 -15
  82. package/dist/cjs/f/fields/TaskRecommendation/styles.scss +0 -37
  83. package/dist/cjs/f/fields/TaskRecommendationInput/TaskRecommendationInput.js +0 -131
  84. package/dist/cjs/f/fields/TaskRecommendationInput/index.js +0 -15
  85. package/dist/cjs/f/fields/TaskRecommendationInput/styles.scss +0 -41
  86. package/dist/cjs/f/fields/TextArea/TextArea.js +0 -141
  87. package/dist/cjs/f/fields/TextArea/index.js +0 -15
  88. package/dist/cjs/f/fields/TextArea/styles.scss +0 -19
  89. package/dist/es/a/GradientBackground/GradientBackground.js +0 -118
  90. package/dist/es/a/GradientBackground/index.js +0 -2
  91. package/dist/es/a/GradientBackground/styles.scss +0 -191
  92. package/dist/es/c/AcceptCookies/AcceptCookies.js +0 -117
  93. package/dist/es/c/AcceptCookies/index.js +0 -2
  94. package/dist/es/c/AcceptCookies/styles.scss +0 -49
  95. package/dist/es/c/BlogCategoryButton/BlogCategoryButton.js +0 -68
  96. package/dist/es/c/BlogCategoryButton/index.js +0 -2
  97. package/dist/es/c/BlogContext/BlogContextProvider.js +0 -45
  98. package/dist/es/c/BlogContext/Context.js +0 -2
  99. package/dist/es/c/BlogContext/ContextProvider.js +0 -45
  100. package/dist/es/c/BlogContext/index.js +0 -4
  101. package/dist/es/c/BlogContext/useBlog.js +0 -3
  102. package/dist/es/c/BlogPost/BlogPost.js +0 -128
  103. package/dist/es/c/BlogPost/index.js +0 -2
  104. package/dist/es/c/BlogPost/styles.scss +0 -33
  105. package/dist/es/c/BlogPostsList/BlogPostsList.js +0 -56
  106. package/dist/es/c/BlogPostsList/common/Card/Card.js +0 -143
  107. package/dist/es/c/BlogPostsList/common/Card/index.js +0 -2
  108. package/dist/es/c/BlogPostsList/common/index.js +0 -1
  109. package/dist/es/c/BlogPostsList/index.js +0 -2
  110. package/dist/es/c/BlogPostsList/styles.scss +0 -72
  111. package/dist/es/c/SiteFooter/SiteFooter.js +0 -56
  112. package/dist/es/c/SiteFooter/common/Section/Section.js +0 -73
  113. package/dist/es/c/SiteFooter/common/Section/index.js +0 -2
  114. package/dist/es/c/SiteFooter/common/index.js +0 -1
  115. package/dist/es/c/SiteFooter/index.js +0 -2
  116. package/dist/es/c/SiteFooter/styles.scss +0 -34
  117. package/dist/es/c/SiteHeaderCTA/SiteHeaderCTA.js +0 -92
  118. package/dist/es/c/SiteHeaderCTA/index.js +0 -2
  119. package/dist/es/c/SiteHeaderCTA/styles.scss +0 -44
  120. package/dist/es/c/SiteMission/SiteMission.js +0 -96
  121. package/dist/es/c/SiteMission/index.js +0 -2
  122. package/dist/es/c/SiteMission/styles.scss +0 -30
  123. package/dist/es/c/SiteNavigation/SiteNavigation.js +0 -111
  124. package/dist/es/c/SiteNavigation/index.js +0 -2
  125. package/dist/es/c/SiteNavigation/styles.scss +0 -118
  126. package/dist/es/c/SiteOnboardingStep/SiteOnboardingStep.js +0 -81
  127. package/dist/es/c/SiteOnboardingStep/index.js +0 -2
  128. package/dist/es/c/SiteOnboardingStep/styles.scss +0 -51
  129. package/dist/es/c/SitePricing/SitePricing.js +0 -91
  130. package/dist/es/c/SitePricing/index.js +0 -2
  131. package/dist/es/c/SitePricing/styles.scss +0 -73
  132. package/dist/es/c/SiteServices/SiteServices.js +0 -195
  133. package/dist/es/c/SiteServices/index.js +0 -2
  134. package/dist/es/c/SiteServices/styles.scss +0 -138
  135. package/dist/es/c/TeamGallery/TeamGallery.js +0 -64
  136. package/dist/es/c/TeamGallery/common/PersonCard/PersonCard.js +0 -64
  137. package/dist/es/c/TeamGallery/common/PersonCard/index.js +0 -2
  138. package/dist/es/c/TeamGallery/common/index.js +0 -1
  139. package/dist/es/c/TeamGallery/index.js +0 -2
  140. package/dist/es/c/TeamGallery/styles.scss +0 -100
  141. package/dist/es/c/Testimonials/Testimonials.js +0 -99
  142. package/dist/es/c/Testimonials/index.js +0 -2
  143. package/dist/es/c/Testimonials/styles.scss +0 -112
  144. package/dist/es/experimental/GradientBackground/GradientBackground.js +0 -76
  145. package/dist/es/experimental/GradientBackground/index.js +0 -2
  146. package/dist/es/experimental/GradientBackground/styles.scss +0 -64
  147. package/dist/es/experimental/index.js +0 -1
  148. package/dist/es/f/fields/CheckboxInput/CheckboxInput.js +0 -85
  149. package/dist/es/f/fields/CheckboxInput/index.js +0 -2
  150. package/dist/es/f/fields/CheckboxInput/styles.scss +0 -28
  151. package/dist/es/f/fields/RadioInput/RadioInput.js +0 -90
  152. package/dist/es/f/fields/RadioInput/index.js +0 -2
  153. package/dist/es/f/fields/RadioInput/styles.scss +0 -26
  154. package/dist/es/f/fields/TaskRecommendation/TaskRecommendation.js +0 -111
  155. package/dist/es/f/fields/TaskRecommendation/index.js +0 -2
  156. package/dist/es/f/fields/TaskRecommendation/styles.scss +0 -37
  157. package/dist/es/f/fields/TaskRecommendationInput/TaskRecommendationInput.js +0 -111
  158. package/dist/es/f/fields/TaskRecommendationInput/index.js +0 -2
  159. package/dist/es/f/fields/TaskRecommendationInput/styles.scss +0 -41
  160. package/dist/es/f/fields/TextArea/TextArea.js +0 -124
  161. package/dist/es/f/fields/TextArea/index.js +0 -2
  162. package/dist/es/f/fields/TextArea/styles.scss +0 -19
@@ -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,51 @@ 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 {
41
+ title
42
+ } = document;
43
+ var link = window.location.href;
44
+ var defaultsMap = {
45
+ facebook: {
46
+ icon: 'f',
47
+ link: "https://www.facebook.com/sharer/sharer.php?u=".concat(link, "&quote=").concat(title)
48
+ },
49
+ twitter: {
50
+ icon: 't',
51
+ link: "https://twitter.com/intent/tweet?text=".concat(title, "&url=").concat(link)
52
+ }
53
+ };
54
+ return /*#__PURE__*/React.createElement("a", {
55
+ href: defaultsMap[type].link,
56
+ target: "_blank",
57
+ rel: "noreferrer",
41
58
  id: id,
42
- className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
43
- style: style // {...otherProps}
44
-
45
- }, children);
59
+ className: [baseClassName, componentClassName, "x-".concat(color || type), userClassName].filter(e => e).join(' '),
60
+ style: style
61
+ }, /*#__PURE__*/React.createElement("button", {
62
+ type: "button"
63
+ }, icon || defaultsMap[type].icon));
46
64
  };
47
65
 
48
- SiteFooter.propTypes = {
66
+ SocialMediaShareButton.propTypes = {
49
67
  /**
50
68
  * The HTML id for this element
51
69
  */
@@ -64,10 +82,25 @@ SiteFooter.propTypes = {
64
82
  /**
65
83
  * The children JSX
66
84
  */
67
- children: _propTypes.default.node
85
+ // children:PropTypes.node,
86
+
87
+ /**
88
+ * The Social Media to Target.
89
+ * If blank, you need to provide both an icon letter (from glyphter) and a link.
90
+ */
91
+ type: _propTypes.default.oneOf(['twitter', 'facebook']),
92
+
93
+ /**
94
+ * The icon of the social media
95
+ */
96
+ icon: _propTypes.default.string,
97
+
98
+ /**
99
+ * The button color
100
+ */
101
+ color: _propTypes.default.string
68
102
  };
69
- SiteFooter.defaultProps = {// someProp:false
103
+ SocialMediaShareButton.defaultProps = {// someProp:false
70
104
  };
71
- SiteFooter.Section = _common.Section;
72
- var _default = SiteFooter;
105
+ var _default = SocialMediaShareButton;
73
106
  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");
@@ -0,0 +1,90 @@
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 {
26
+ title
27
+ } = document;
28
+ const link = window.location.href;
29
+ const defaultsMap = {
30
+ facebook: {
31
+ icon: 'f',
32
+ link: `https://www.facebook.com/sharer/sharer.php?u=${link}&quote=${title}`
33
+ },
34
+ twitter: {
35
+ icon: 't',
36
+ link: `https://twitter.com/intent/tweet?text=${title}&url=${link}`
37
+ }
38
+ };
39
+ return /*#__PURE__*/React.createElement("a", {
40
+ href: defaultsMap[type].link,
41
+ target: "_blank",
42
+ rel: "noreferrer",
43
+ id: id,
44
+ className: [baseClassName, componentClassName, `x-${color || type}`, userClassName].filter(e => e).join(' '),
45
+ style: style
46
+ }, /*#__PURE__*/React.createElement("button", {
47
+ type: "button"
48
+ }, icon || defaultsMap[type].icon));
49
+ };
50
+
51
+ SocialMediaShareButton.propTypes = {
52
+ /**
53
+ * The HTML id for this element
54
+ */
55
+ id: PropTypes.string,
56
+
57
+ /**
58
+ * The HTML class names for this element
59
+ */
60
+ className: PropTypes.string,
61
+
62
+ /**
63
+ * The React-written, css properties for this element.
64
+ */
65
+ style: PropTypes.objectOf(PropTypes.string),
66
+
67
+ /**
68
+ * The children JSX
69
+ */
70
+ // children:PropTypes.node,
71
+
72
+ /**
73
+ * The Social Media to Target.
74
+ * If blank, you need to provide both an icon letter (from glyphter) and a link.
75
+ */
76
+ type: PropTypes.oneOf(['twitter', 'facebook']),
77
+
78
+ /**
79
+ * The icon of the social media
80
+ */
81
+ icon: PropTypes.string,
82
+
83
+ /**
84
+ * The button color
85
+ */
86
+ color: PropTypes.string
87
+ };
88
+ SocialMediaShareButton.defaultProps = {// someProp:false
89
+ };
90
+ 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.35",
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
+ )
@@ -0,0 +1,111 @@
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 { title } = document
33
+ const link = window.location.href
34
+
35
+ const defaultsMap = {
36
+ facebook:{
37
+ icon:'f',
38
+ link:`https://www.facebook.com/sharer/sharer.php?u=${link}&quote=${title}`,
39
+ },
40
+ twitter:{
41
+ icon:'t',
42
+ link:`https://twitter.com/intent/tweet?text=${title}&url=${link}`,
43
+ },
44
+ }
45
+
46
+ return (
47
+ <a
48
+ href={defaultsMap[type].link}
49
+ target="_blank"
50
+ rel="noreferrer"
51
+ id={id}
52
+ className={[
53
+ baseClassName,
54
+ componentClassName,
55
+ `x-${color || type}`,
56
+ userClassName,
57
+ ]
58
+ .filter((e) => e)
59
+ .join(' ')}
60
+ style={style}
61
+ >
62
+ <button type="button">
63
+ { icon || defaultsMap[type].icon }
64
+ </button>
65
+ </a>
66
+ )
67
+ }
68
+
69
+ SocialMediaShareButton.propTypes = {
70
+ /**
71
+ * The HTML id for this element
72
+ */
73
+ id:PropTypes.string,
74
+
75
+ /**
76
+ * The HTML class names for this element
77
+ */
78
+ className:PropTypes.string,
79
+
80
+ /**
81
+ * The React-written, css properties for this element.
82
+ */
83
+ style:PropTypes.objectOf(PropTypes.string),
84
+
85
+ /**
86
+ * The children JSX
87
+ */
88
+ // children:PropTypes.node,
89
+
90
+ /**
91
+ * The Social Media to Target.
92
+ * If blank, you need to provide both an icon letter (from glyphter) and a link.
93
+ */
94
+ type:PropTypes.oneOf(['twitter', 'facebook']),
95
+
96
+ /**
97
+ * The icon of the social media
98
+ */
99
+ icon:PropTypes.string,
100
+
101
+ /**
102
+ * The button color
103
+ */
104
+ color:PropTypes.string,
105
+ }
106
+
107
+ SocialMediaShareButton.defaultProps = {
108
+ // someProp:false
109
+ }
110
+
111
+ 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'