@pareto-engineering/design-system 2.0.0-alpha.67 → 2.0.0-alpha.68

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 (228) hide show
  1. package/dist/cjs/{experimental/GradientBackground/GradientBackground.js → a/ColumnLabel/ColumnLabel.js} +32 -30
  2. package/dist/cjs/{c/SiteMission → a/ColumnLabel}/index.js +3 -3
  3. package/dist/cjs/a/ColumnLabel/styles.scss +22 -0
  4. package/dist/cjs/a/ContentTree/ContentTree.js +1 -1
  5. package/dist/cjs/{c/BlogContext → a/ModalContextProvider}/Context.js +0 -0
  6. package/dist/cjs/{c/BlogContext/ContextProvider.js → a/ModalContextProvider/ModalContextProvider.js} +27 -25
  7. package/dist/cjs/{c/SiteFooter/SiteFooter.js → a/ModalContextProvider/common/ModalRoot/ModalRoot.js} +18 -38
  8. package/dist/cjs/a/{Popover/common/Divider → ModalContextProvider/common/ModalRoot}/index.js +3 -3
  9. package/dist/cjs/a/ModalContextProvider/common/ModalRoot/styles.scss +14 -0
  10. package/dist/cjs/{c/SiteFooter → a/ModalContextProvider}/common/index.js +3 -3
  11. package/dist/cjs/a/ModalContextProvider/index.js +31 -0
  12. package/dist/cjs/{c/BlogContext/useBlog.js → a/ModalContextProvider/useModal.js} +0 -0
  13. package/dist/cjs/a/Popover/Popover.js +1 -1
  14. package/dist/cjs/{v3/Button/Button.js → c/Modal/Modal.js} +46 -8
  15. package/dist/cjs/c/{TeamGallery/TeamGallery.js → Modal/common/ModalHeader/ModalHeader.js} +36 -28
  16. package/dist/cjs/c/{SitePricing → Modal/common/ModalHeader}/index.js +3 -3
  17. package/dist/cjs/c/{TeamGallery → Modal}/common/index.js +3 -3
  18. package/dist/cjs/{a/Popover/common/Item → c/Modal}/index.js +3 -3
  19. package/dist/cjs/c/Modal/styles.scss +43 -0
  20. package/dist/cjs/c/ModalButton/ModalButton.js +66 -0
  21. package/dist/cjs/c/{TeamGallery → ModalButton}/index.js +3 -3
  22. package/dist/cjs/{f/fields/TaskRecommendation/TaskRecommendation.js → c/ObjectButton/ObjectButton.js} +56 -56
  23. package/dist/cjs/c/{BlogPost → ObjectButton}/index.js +3 -3
  24. package/dist/cjs/c/ObjectButton/styles.scss +52 -0
  25. package/dist/cjs/c/index.js +9 -1
  26. package/dist/cjs/{c/BlogPostsList/BlogPostsList.js → d/Modal/Modal.js} +31 -10
  27. package/dist/cjs/{a/Popover/common/Divider/Divider.js → d/Modal/common/ModalFooter/ModalFooter.js} +26 -16
  28. package/dist/cjs/d/Modal/common/ModalFooter/index.js +15 -0
  29. package/dist/cjs/{a/Popover/common/Item/Item.js → d/Modal/common/ModalHeader/ModalHeader.js} +28 -16
  30. package/dist/cjs/d/Modal/common/ModalHeader/index.js +15 -0
  31. package/dist/cjs/d/Modal/common/index.js +21 -0
  32. package/dist/cjs/{c/BlogPostsList/common/Card → d/Modal}/index.js +3 -3
  33. package/dist/cjs/d/Modal/styles.scss +52 -0
  34. package/dist/cjs/f/fields/TaskRecommendationInput/TaskRecommendationInput.js +1 -1
  35. package/dist/cjs/f/fields/TaskRecommendationInput/styles.scss +0 -4
  36. package/dist/cjs/utils/relay/EnvironmentProvider.js +23 -0
  37. package/dist/cjs/utils/relay/environment.js +12 -0
  38. package/dist/cjs/utils/relay/index.js +39 -0
  39. package/dist/cjs/utils/relay/mockRelayOperation.js +23 -0
  40. package/dist/cjs/utils/relay/mockResolvers.js +282 -0
  41. package/dist/es/{v3/Button/Button.js → a/ColumnLabel/ColumnLabel.js} +36 -12
  42. package/dist/es/a/ColumnLabel/index.js +2 -0
  43. package/dist/es/a/ColumnLabel/styles.scss +22 -0
  44. package/dist/es/a/ContentTree/ContentTree.js +1 -1
  45. package/dist/es/{c/BlogContext → a/ModalContextProvider}/Context.js +0 -0
  46. package/dist/es/a/ModalContextProvider/ModalContextProvider.js +47 -0
  47. package/dist/es/a/ModalContextProvider/common/ModalRoot/ModalRoot.js +36 -0
  48. package/dist/es/a/ModalContextProvider/common/ModalRoot/index.js +2 -0
  49. package/dist/es/a/ModalContextProvider/common/ModalRoot/styles.scss +14 -0
  50. package/dist/es/{c/BlogPostsList/common/Card → a/ModalContextProvider/common}/index.js +1 -1
  51. package/dist/es/a/ModalContextProvider/index.js +4 -0
  52. package/dist/es/{c/BlogContext/useBlog.js → a/ModalContextProvider/useModal.js} +0 -0
  53. package/dist/es/a/Popover/Popover.js +1 -1
  54. package/dist/es/c/Modal/Modal.js +91 -0
  55. package/dist/es/c/Modal/common/ModalHeader/ModalHeader.js +67 -0
  56. package/dist/es/c/Modal/common/ModalHeader/index.js +1 -0
  57. package/dist/es/c/Modal/common/index.js +1 -0
  58. package/dist/es/{a/Popover/common/Item → c/Modal}/index.js +1 -1
  59. package/dist/es/c/Modal/styles.scss +43 -0
  60. package/dist/es/c/ModalButton/ModalButton.js +48 -0
  61. package/dist/es/c/ModalButton/index.js +2 -0
  62. package/dist/es/c/ObjectButton/ObjectButton.js +111 -0
  63. package/dist/es/c/ObjectButton/index.js +2 -0
  64. package/dist/es/c/ObjectButton/styles.scss +52 -0
  65. package/dist/es/c/index.js +2 -1
  66. package/dist/es/{c/BlogPostsList/BlogPostsList.js → d/Modal/Modal.js} +32 -11
  67. package/dist/es/d/Modal/common/ModalFooter/ModalFooter.js +56 -0
  68. package/dist/es/d/Modal/common/ModalFooter/index.js +1 -0
  69. package/dist/es/d/Modal/common/ModalHeader/ModalHeader.js +60 -0
  70. package/dist/es/d/Modal/common/ModalHeader/index.js +1 -0
  71. package/dist/es/d/Modal/common/index.js +2 -0
  72. package/dist/es/{v3/Button → d/Modal}/index.js +1 -1
  73. package/dist/es/d/Modal/styles.scss +52 -0
  74. package/dist/es/f/fields/TaskRecommendationInput/TaskRecommendationInput.js +1 -1
  75. package/dist/es/f/fields/TaskRecommendationInput/styles.scss +0 -4
  76. package/dist/es/utils/relay/EnvironmentProvider.js +11 -0
  77. package/dist/es/utils/relay/environment.js +3 -0
  78. package/dist/es/utils/relay/index.js +4 -0
  79. package/dist/es/utils/relay/mockRelayOperation.js +9 -0
  80. package/dist/es/utils/relay/mockResolvers.js +275 -0
  81. package/package.json +1 -1
  82. package/src/__snapshots__/Storyshots.test.js.snap +43 -1
  83. package/src/stories/c/Modal.stories.jsx +66 -0
  84. package/src/ui/a/ContentTree/ContentTree.jsx +1 -1
  85. package/src/ui/a/Popover/Popover.jsx +1 -1
  86. package/src/ui/c/Modal/Modal.jsx +112 -0
  87. package/src/ui/c/Modal/common/ModalHeader/ModalHeader.jsx +89 -0
  88. package/src/ui/c/Modal/common/ModalHeader/index.js +1 -0
  89. package/src/ui/c/Modal/common/index.js +1 -0
  90. package/{dist/es/a/Popover/common/Divider → src/ui/c/Modal}/index.js +1 -1
  91. package/src/ui/c/Modal/styles.scss +43 -0
  92. package/src/ui/c/index.js +1 -0
  93. package/dist/cjs/a/GradientBackground/GradientBackground.js +0 -140
  94. package/dist/cjs/a/GradientBackground/index.js +0 -15
  95. package/dist/cjs/a/GradientBackground/styles.scss +0 -191
  96. package/dist/cjs/a/Popover/common/index.js +0 -21
  97. package/dist/cjs/c/AcceptCookies/AcceptCookies.js +0 -134
  98. package/dist/cjs/c/AcceptCookies/index.js +0 -15
  99. package/dist/cjs/c/AcceptCookies/styles.scss +0 -49
  100. package/dist/cjs/c/BlogCategoryButton/BlogCategoryButton.js +0 -95
  101. package/dist/cjs/c/BlogCategoryButton/index.js +0 -15
  102. package/dist/cjs/c/BlogContext/BlogContextProvider.js +0 -63
  103. package/dist/cjs/c/BlogContext/index.js +0 -31
  104. package/dist/cjs/c/BlogPost/BlogPost.js +0 -147
  105. package/dist/cjs/c/BlogPost/styles.scss +0 -33
  106. package/dist/cjs/c/BlogPostsList/common/Card/Card.js +0 -170
  107. package/dist/cjs/c/BlogPostsList/common/index.js +0 -13
  108. package/dist/cjs/c/BlogPostsList/index.js +0 -15
  109. package/dist/cjs/c/BlogPostsList/styles.scss +0 -72
  110. package/dist/cjs/c/SiteFooter/common/Section/Section.js +0 -95
  111. package/dist/cjs/c/SiteFooter/common/Section/index.js +0 -15
  112. package/dist/cjs/c/SiteFooter/index.js +0 -15
  113. package/dist/cjs/c/SiteFooter/styles.scss +0 -34
  114. package/dist/cjs/c/SiteHeaderCTA/SiteHeaderCTA.js +0 -108
  115. package/dist/cjs/c/SiteHeaderCTA/index.js +0 -15
  116. package/dist/cjs/c/SiteHeaderCTA/styles.scss +0 -44
  117. package/dist/cjs/c/SiteMission/SiteMission.js +0 -113
  118. package/dist/cjs/c/SiteMission/styles.scss +0 -30
  119. package/dist/cjs/c/SiteNavigation/SiteNavigation.js +0 -130
  120. package/dist/cjs/c/SiteNavigation/index.js +0 -15
  121. package/dist/cjs/c/SiteNavigation/styles.scss +0 -118
  122. package/dist/cjs/c/SiteOnboardingStep/SiteOnboardingStep.js +0 -98
  123. package/dist/cjs/c/SiteOnboardingStep/index.js +0 -15
  124. package/dist/cjs/c/SiteOnboardingStep/styles.scss +0 -51
  125. package/dist/cjs/c/SitePricing/SitePricing.js +0 -108
  126. package/dist/cjs/c/SitePricing/styles.scss +0 -73
  127. package/dist/cjs/c/SiteServices/SiteServices.js +0 -211
  128. package/dist/cjs/c/SiteServices/index.js +0 -15
  129. package/dist/cjs/c/SiteServices/styles.scss +0 -138
  130. package/dist/cjs/c/TeamGallery/common/PersonCard/PersonCard.js +0 -84
  131. package/dist/cjs/c/TeamGallery/common/PersonCard/index.js +0 -15
  132. package/dist/cjs/c/TeamGallery/styles.scss +0 -100
  133. package/dist/cjs/c/Testimonials/Testimonials.js +0 -119
  134. package/dist/cjs/c/Testimonials/index.js +0 -15
  135. package/dist/cjs/c/Testimonials/styles.scss +0 -112
  136. package/dist/cjs/experimental/GradientBackground/index.js +0 -15
  137. package/dist/cjs/experimental/GradientBackground/styles.scss +0 -64
  138. package/dist/cjs/experimental/index.js +0 -13
  139. package/dist/cjs/f/fields/IntlTelInput/IntlTelInput.js +0 -170
  140. package/dist/cjs/f/fields/IntlTelInput/index.js +0 -15
  141. package/dist/cjs/f/fields/IntlTelInput/styles.scss +0 -37
  142. package/dist/cjs/f/fields/PhoneIntlTelInput/PhoneIntlTelInput.js +0 -180
  143. package/dist/cjs/f/fields/PhoneIntlTelInput/index.js +0 -15
  144. package/dist/cjs/f/fields/PhoneIntlTelInput/styles.scss +0 -43
  145. package/dist/cjs/f/fields/QuerySelect/styles.scss +0 -21
  146. package/dist/cjs/f/fields/TaskRecommendation/index.js +0 -15
  147. package/dist/cjs/f/fields/TaskRecommendation/styles.scss +0 -37
  148. package/dist/cjs/f/fields/TextArea/TextArea.js +0 -141
  149. package/dist/cjs/f/fields/TextArea/index.js +0 -15
  150. package/dist/cjs/f/fields/TextArea/styles.scss +0 -19
  151. package/dist/cjs/test/QueryLoader/styles.scss +0 -9
  152. package/dist/cjs/v3/Button/index.js +0 -15
  153. package/dist/cjs/v3/Button/styles.scss +0 -9
  154. package/dist/cjs/v3/index.js +0 -13
  155. package/dist/es/a/GradientBackground/GradientBackground.js +0 -118
  156. package/dist/es/a/GradientBackground/index.js +0 -2
  157. package/dist/es/a/GradientBackground/styles.scss +0 -191
  158. package/dist/es/a/Popover/common/Divider/Divider.js +0 -47
  159. package/dist/es/a/Popover/common/Item/Item.js +0 -47
  160. package/dist/es/a/Popover/common/index.js +0 -2
  161. package/dist/es/c/AcceptCookies/AcceptCookies.js +0 -117
  162. package/dist/es/c/AcceptCookies/index.js +0 -2
  163. package/dist/es/c/AcceptCookies/styles.scss +0 -49
  164. package/dist/es/c/BlogCategoryButton/BlogCategoryButton.js +0 -68
  165. package/dist/es/c/BlogCategoryButton/index.js +0 -2
  166. package/dist/es/c/BlogContext/BlogContextProvider.js +0 -45
  167. package/dist/es/c/BlogContext/ContextProvider.js +0 -45
  168. package/dist/es/c/BlogContext/index.js +0 -4
  169. package/dist/es/c/BlogPost/BlogPost.js +0 -128
  170. package/dist/es/c/BlogPost/index.js +0 -2
  171. package/dist/es/c/BlogPost/styles.scss +0 -33
  172. package/dist/es/c/BlogPostsList/common/Card/Card.js +0 -143
  173. package/dist/es/c/BlogPostsList/common/index.js +0 -1
  174. package/dist/es/c/BlogPostsList/index.js +0 -2
  175. package/dist/es/c/BlogPostsList/styles.scss +0 -72
  176. package/dist/es/c/SiteFooter/SiteFooter.js +0 -56
  177. package/dist/es/c/SiteFooter/common/Section/Section.js +0 -73
  178. package/dist/es/c/SiteFooter/common/Section/index.js +0 -2
  179. package/dist/es/c/SiteFooter/common/index.js +0 -1
  180. package/dist/es/c/SiteFooter/index.js +0 -2
  181. package/dist/es/c/SiteFooter/styles.scss +0 -34
  182. package/dist/es/c/SiteHeaderCTA/SiteHeaderCTA.js +0 -92
  183. package/dist/es/c/SiteHeaderCTA/index.js +0 -2
  184. package/dist/es/c/SiteHeaderCTA/styles.scss +0 -44
  185. package/dist/es/c/SiteMission/SiteMission.js +0 -96
  186. package/dist/es/c/SiteMission/index.js +0 -2
  187. package/dist/es/c/SiteMission/styles.scss +0 -30
  188. package/dist/es/c/SiteNavigation/SiteNavigation.js +0 -111
  189. package/dist/es/c/SiteNavigation/index.js +0 -2
  190. package/dist/es/c/SiteNavigation/styles.scss +0 -118
  191. package/dist/es/c/SiteOnboardingStep/SiteOnboardingStep.js +0 -81
  192. package/dist/es/c/SiteOnboardingStep/index.js +0 -2
  193. package/dist/es/c/SiteOnboardingStep/styles.scss +0 -51
  194. package/dist/es/c/SitePricing/SitePricing.js +0 -91
  195. package/dist/es/c/SitePricing/index.js +0 -2
  196. package/dist/es/c/SitePricing/styles.scss +0 -73
  197. package/dist/es/c/SiteServices/SiteServices.js +0 -195
  198. package/dist/es/c/SiteServices/index.js +0 -2
  199. package/dist/es/c/SiteServices/styles.scss +0 -138
  200. package/dist/es/c/TeamGallery/TeamGallery.js +0 -64
  201. package/dist/es/c/TeamGallery/common/PersonCard/PersonCard.js +0 -64
  202. package/dist/es/c/TeamGallery/common/PersonCard/index.js +0 -2
  203. package/dist/es/c/TeamGallery/common/index.js +0 -1
  204. package/dist/es/c/TeamGallery/index.js +0 -2
  205. package/dist/es/c/TeamGallery/styles.scss +0 -100
  206. package/dist/es/c/Testimonials/Testimonials.js +0 -99
  207. package/dist/es/c/Testimonials/index.js +0 -2
  208. package/dist/es/c/Testimonials/styles.scss +0 -112
  209. package/dist/es/experimental/GradientBackground/GradientBackground.js +0 -76
  210. package/dist/es/experimental/GradientBackground/index.js +0 -2
  211. package/dist/es/experimental/GradientBackground/styles.scss +0 -64
  212. package/dist/es/experimental/index.js +0 -1
  213. package/dist/es/f/fields/IntlTelInput/IntlTelInput.js +0 -152
  214. package/dist/es/f/fields/IntlTelInput/index.js +0 -2
  215. package/dist/es/f/fields/IntlTelInput/styles.scss +0 -37
  216. package/dist/es/f/fields/PhoneIntlTelInput/PhoneIntlTelInput.js +0 -163
  217. package/dist/es/f/fields/PhoneIntlTelInput/index.js +0 -2
  218. package/dist/es/f/fields/PhoneIntlTelInput/styles.scss +0 -43
  219. package/dist/es/f/fields/QuerySelect/styles.scss +0 -21
  220. package/dist/es/f/fields/TaskRecommendation/TaskRecommendation.js +0 -111
  221. package/dist/es/f/fields/TaskRecommendation/index.js +0 -2
  222. package/dist/es/f/fields/TaskRecommendation/styles.scss +0 -37
  223. package/dist/es/f/fields/TextArea/TextArea.js +0 -124
  224. package/dist/es/f/fields/TextArea/index.js +0 -2
  225. package/dist/es/f/fields/TextArea/styles.scss +0 -19
  226. package/dist/es/test/QueryLoader/styles.scss +0 -9
  227. package/dist/es/v3/Button/styles.scss +0 -9
  228. package/dist/es/v3/index.js +0 -1
@@ -0,0 +1,14 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ @use "@pareto-engineering/bem";
3
+
4
+ .#{bem.$base}.modal-root{
5
+ align-items: center;
6
+ background-color: rgba($color: #000000, $alpha: 0.35);
7
+ bottom: 0;
8
+ display: flex;
9
+ justify-content: center;
10
+ left: 0;
11
+ position: fixed;
12
+ right: 0;
13
+ top: 0;
14
+ }
@@ -1,2 +1,2 @@
1
1
  /* @pareto-engineering/generator-front 1.0.12 */
2
- export { default as Card } from "./Card";
2
+ export { ModalRoot } from "./ModalRoot";
@@ -0,0 +1,4 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ export { default as Context } from "./Context";
3
+ export { default as ModalContextProvider } from "./ModalContextProvider";
4
+ export { default as useModal } from "./useModal";
@@ -104,7 +104,7 @@ Popover.propTypes = {
104
104
  * The reference to the parent element
105
105
  */
106
106
  parentRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
107
- current: PropTypes.instanceOf(String)
107
+ current: PropTypes.instanceOf(Element)
108
108
  })])
109
109
  };
110
110
  Popover.defaultProps = {
@@ -0,0 +1,91 @@
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';
6
+ import { ModalHeader } from "./common"; // Local Definitions
7
+
8
+ const baseClassName = styleNames.base;
9
+ const componentClassName = 'modal';
10
+ /**
11
+ * This is the component description.
12
+ */
13
+
14
+ const Modal = ({
15
+ id,
16
+ className: userClassName,
17
+ style,
18
+ children,
19
+ title,
20
+ setOpen,
21
+ color,
22
+ onClose // ...otherProps
23
+
24
+ }) => {
25
+ useLayoutEffect(() => {
26
+ import("./styles.scss");
27
+ }, []);
28
+
29
+ const close = () => {
30
+ setOpen === null || setOpen === void 0 ? void 0 : setOpen(false);
31
+ onClose === null || onClose === void 0 ? void 0 : onClose();
32
+ };
33
+
34
+ return /*#__PURE__*/React.createElement("div", {
35
+ id: id,
36
+ className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
37
+ style: style // {...otherProps}
38
+
39
+ }, /*#__PURE__*/React.createElement(ModalHeader, {
40
+ title: title,
41
+ close: close,
42
+ color: color
43
+ }), /*#__PURE__*/React.createElement("div", {
44
+ className: "modal-body"
45
+ }, children));
46
+ };
47
+
48
+ Modal.propTypes = {
49
+ /**
50
+ * The HTML id for this element
51
+ */
52
+ id: PropTypes.string,
53
+
54
+ /**
55
+ * The HTML class names for this element
56
+ */
57
+ className: PropTypes.string,
58
+
59
+ /**
60
+ * The React-written, css properties for this element.
61
+ */
62
+ style: PropTypes.objectOf(PropTypes.string),
63
+
64
+ /**
65
+ * The children JSX
66
+ */
67
+ children: PropTypes.node,
68
+
69
+ /**
70
+ * The title to pass to the header
71
+ */
72
+ title: PropTypes.string.isRequired,
73
+
74
+ /**
75
+ * The color for the button to open and close the modal
76
+ */
77
+ color: PropTypes.string.isRequired,
78
+
79
+ /**
80
+ * The function to open the modal
81
+ */
82
+ setOpen: PropTypes.func.isRequired,
83
+
84
+ /**
85
+ * The function to run upon closing the modal, if any
86
+ */
87
+ onClose: PropTypes.func
88
+ };
89
+ Modal.defaultProps = {//
90
+ };
91
+ export default Modal;
@@ -0,0 +1,67 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ import * as React from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import styleNames from '@pareto-engineering/bem';
5
+ import { Button } from "../../../.."; // Local Definitions
6
+
7
+ const baseClassName = styleNames.base;
8
+ const componentClassName = 'modal-header';
9
+ /**
10
+ * This is the component description.
11
+ */
12
+
13
+ const ModalHeader = ({
14
+ id,
15
+ className: userClassName,
16
+ style,
17
+ title,
18
+ close,
19
+ color // ...otherProps
20
+
21
+ }) => /*#__PURE__*/React.createElement("div", {
22
+ id: id,
23
+ className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
24
+ style: style
25
+ }, /*#__PURE__*/React.createElement("p", null, title), /*#__PURE__*/React.createElement(Button, {
26
+ color: color,
27
+ onClick: () => close(),
28
+ isCompact: true,
29
+ className: "close-button"
30
+ }, /*#__PURE__*/React.createElement("span", {
31
+ className: "f-icons"
32
+ }, "Y")));
33
+
34
+ ModalHeader.propTypes = {
35
+ /**
36
+ * The HTML id for this element
37
+ */
38
+ id: PropTypes.string,
39
+
40
+ /**
41
+ * The HTML class names for this element
42
+ */
43
+ className: PropTypes.string,
44
+
45
+ /**
46
+ * The React-written, css properties for this element.
47
+ */
48
+ style: PropTypes.objectOf(PropTypes.string),
49
+
50
+ /**
51
+ * The children JSX
52
+ */
53
+ title: PropTypes.string,
54
+
55
+ /**
56
+ * The close modal function
57
+ */
58
+ close: PropTypes.func,
59
+
60
+ /**
61
+ * The color for the button to open and close the modal
62
+ */
63
+ color: PropTypes.string.isRequired
64
+ };
65
+ ModalHeader.defaultProps = {// someProp:false
66
+ };
67
+ export default ModalHeader;
@@ -0,0 +1 @@
1
+ export { default as ModalHeader } from "./ModalHeader";
@@ -0,0 +1 @@
1
+ export { ModalHeader } from "./ModalHeader";
@@ -1,2 +1,2 @@
1
1
  /* @pareto-engineering/generator-front 1.0.12 */
2
- export { default as Item } from "./Item";
2
+ export { default as Modal } from "./Modal";
@@ -0,0 +1,43 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ @use "@pareto-engineering/bem";
3
+
4
+ $default-box-shadow: 0 10px 20px rgba(black, 0.2);
5
+ $default-padding: 1em / 2;
6
+ $default-margin: 2em;
7
+ $default-max-height: 75vh;
8
+ $default-max-width: 90%;
9
+ $default-min-width: 20em;
10
+
11
+ .#{bem.$base}.modal{
12
+ display: flex;
13
+ box-shadow: $default-box-shadow;
14
+ flex-direction: column;
15
+ left: 50%;
16
+ max-height: $default-max-height;
17
+ max-width: $default-max-width;
18
+ min-width: $default-min-width;
19
+ overflow: auto;
20
+ position: absolute;
21
+ top: 50%;
22
+ transform: translate(-50%, -50%);
23
+ z-index: 100;
24
+
25
+ .modal-body {
26
+ border-top: var(--theme-border);
27
+ padding: $default-padding;
28
+ }
29
+
30
+ .modal-header {
31
+ display: flex;
32
+ justify-content: space-between;
33
+
34
+ > p {
35
+ padding: $default-padding;
36
+ margin: 0;
37
+ }
38
+
39
+ .ds.button {
40
+ height: 100%;
41
+ }
42
+ }
43
+ }
@@ -0,0 +1,48 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ import * as React from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import { Button, useModal } from "../..";
5
+ /**
6
+ * This is the component description.
7
+ */
8
+
9
+ const ModalButton = ({
10
+ style,
11
+ children,
12
+ color,
13
+ modal: ModalComponent
14
+ }) => {
15
+ const {
16
+ openModal
17
+ } = useModal();
18
+ return /*#__PURE__*/React.createElement(Button, {
19
+ color: color,
20
+ style: style,
21
+ onClick: () => openModal(ModalComponent)
22
+ }, children);
23
+ };
24
+
25
+ ModalButton.propTypes = {
26
+ /**
27
+ * The React-written, css properties for this element.
28
+ */
29
+ style: PropTypes.objectOf(PropTypes.string),
30
+
31
+ /**
32
+ * The children JSX
33
+ */
34
+ children: PropTypes.node,
35
+
36
+ /**
37
+ * The color of the ModalButton
38
+ */
39
+ color: PropTypes.node,
40
+
41
+ /**
42
+ * The component to render in the modal pop-up
43
+ */
44
+ modal: PropTypes.elementType.isRequired
45
+ };
46
+ ModalButton.defaultProps = {// someProp:false
47
+ };
48
+ export default ModalButton;
@@ -0,0 +1,2 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ export { default as ModalButton } from "./ModalButton";
@@ -0,0 +1,111 @@
1
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
3
+ /* @pareto-engineering/generator-front 1.0.12 */
4
+ import * as React from 'react';
5
+ import { useState, useRef, useLayoutEffect } from 'react';
6
+ import { Popover, Label } from "../../a";
7
+ import { Button } from "../../b";
8
+ import PropTypes from 'prop-types';
9
+ import styleNames from '@pareto-engineering/bem'; // Local Definitions
10
+
11
+ const baseClassName = styleNames.base;
12
+ const componentClassName = 'object-button';
13
+ /**
14
+ * This is the component description.
15
+ */
16
+
17
+ const ObjectButton = ({
18
+ id,
19
+ className: userClassName,
20
+ style,
21
+ color,
22
+ node,
23
+ nodeToString,
24
+ options,
25
+ image // ...otherProps
26
+
27
+ }) => {
28
+ useLayoutEffect(() => {
29
+ import("./styles.scss");
30
+ }, []);
31
+ const parentRef = useRef(null);
32
+ const [isOpen, setIsOpen] = useState(false);
33
+
34
+ const handleClick = () => {
35
+ setIsOpen(!isOpen);
36
+ };
37
+
38
+ const nodeName = nodeToString(node);
39
+ return /*#__PURE__*/React.createElement("div", {
40
+ className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
41
+ style: style,
42
+ ref: parentRef
43
+ }, /*#__PURE__*/React.createElement(Label, {
44
+ id: id,
45
+ color: color
46
+ }, image && /*#__PURE__*/React.createElement("img", {
47
+ src: image,
48
+ alt: nodeName
49
+ }), /*#__PURE__*/React.createElement("span", null, nodeName)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
50
+ id: id,
51
+ color: color,
52
+ onClick: handleClick
53
+ }, /*#__PURE__*/React.createElement("span", {
54
+ className: "f-icons"
55
+ }, "E")), /*#__PURE__*/React.createElement(Popover, {
56
+ isOpen: isOpen,
57
+ parentRef: parentRef,
58
+ preferredPrimaryOrder: ['bottom', 'top', 'right', 'left']
59
+ }, /*#__PURE__*/React.createElement("ul", null, options.map(option => /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement(Button, _extends({}, option, {
60
+ color: color,
61
+ isSimple: true
62
+ }))))))));
63
+ };
64
+
65
+ ObjectButton.propTypes = {
66
+ /**
67
+ * The HTML id for this element
68
+ */
69
+ id: PropTypes.string,
70
+
71
+ /**
72
+ * The HTML class names for this element
73
+ */
74
+ className: PropTypes.string,
75
+
76
+ /**
77
+ * The React-written, css properties for this element.
78
+ */
79
+ style: PropTypes.objectOf(PropTypes.string),
80
+
81
+ /**
82
+ * The color of the button
83
+ */
84
+ color: PropTypes.string,
85
+
86
+ /**
87
+ * The node for the button
88
+ */
89
+ node: PropTypes.objectOf(PropTypes.string).isRequired,
90
+
91
+ /**
92
+ * The function to determine the string to display on the button
93
+ */
94
+ nodeToString: PropTypes.func.isRequired,
95
+
96
+ /**
97
+ * The options provided to the button on click
98
+ */
99
+ options: PropTypes.arrayOf(PropTypes.shape({
100
+ name: PropTypes.string,
101
+ func: PropTypes.func
102
+ })),
103
+
104
+ /**
105
+ * Image of the button (optional)
106
+ */
107
+ image: PropTypes.string
108
+ };
109
+ ObjectButton.defaultProps = {// someProp:false
110
+ };
111
+ export default ObjectButton;
@@ -0,0 +1,2 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ export { default as ObjectButton } from "./ObjectButton";
@@ -0,0 +1,52 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ @use "@pareto-engineering/bem";
3
+
4
+ $default-border-radius: 5px;
5
+ $default-border-radius-image: 50%;
6
+ $default-image-size: 1.5em;
7
+ $default-padding: .5em .5em .42em;
8
+
9
+ .#{bem.$base}.object-button{
10
+ display: inline-flex;
11
+ position: relative;
12
+
13
+ > .label {
14
+ border-radius: 0;
15
+ margin-right: .5px;
16
+ padding: $default-padding;
17
+
18
+ p {
19
+ color: inherit;
20
+ }
21
+
22
+ > img {
23
+ border-radius: $default-border-radius-image;
24
+ height: $default-image-size;
25
+ margin-right: .5em;
26
+ width: $default-image-size;
27
+ }
28
+ }
29
+
30
+ > div {
31
+ > .button {
32
+ display: inline-flex;
33
+ height: 100%;
34
+ padding: $default-padding;
35
+ padding-top: .6em;
36
+ }
37
+
38
+ > .popover {
39
+ &.bottom {
40
+ left: auto;
41
+ }
42
+
43
+ > ul {
44
+ margin: 0;
45
+ padding: 0;
46
+ list-style: none;
47
+ max-width: 10em;
48
+ white-space: nowrap;
49
+ }
50
+ }
51
+ }
52
+ }
@@ -1,4 +1,5 @@
1
1
  export { Hero } from "./Hero";
2
2
  export { ContentSlides, useContentSlides } from "./ContentSlides";
3
3
  export { Shortener } from "./Shortener";
4
- export { SocialMediaShareButton } from "./SocialMediaShareButton";
4
+ export { SocialMediaShareButton } from "./SocialMediaShareButton";
5
+ export { Modal } from "./Modal";
@@ -3,19 +3,21 @@ import * as React from 'react';
3
3
  import { useLayoutEffect } from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import styleNames from '@pareto-engineering/bem';
6
- import { Card } from "./common"; // Local Definitions
6
+ import { ModalFooter, ModalHeader } from "./common"; // Local Definitions
7
7
 
8
8
  const baseClassName = styleNames.base;
9
- const componentClassName = 'blog-posts-list';
9
+ const componentClassName = 'modal';
10
10
  /**
11
11
  * This is the component description.
12
12
  */
13
13
 
14
- const BlogPostsList = ({
14
+ const Modal = ({
15
15
  id,
16
16
  className: userClassName,
17
17
  style,
18
- children // ...otherProps
18
+ children,
19
+ title,
20
+ actions // ...otherProps
19
21
 
20
22
  }) => {
21
23
  useLayoutEffect(() => {
@@ -23,13 +25,19 @@ const BlogPostsList = ({
23
25
  }, []);
24
26
  return /*#__PURE__*/React.createElement("div", {
25
27
  id: id,
26
- className: [baseClassName, componentClassName, userClassName, 'u1'].filter(e => e).join(' '),
28
+ className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
27
29
  style: style // {...otherProps}
28
30
 
29
- }, children);
31
+ }, /*#__PURE__*/React.createElement(ModalHeader, {
32
+ title: title
33
+ }), /*#__PURE__*/React.createElement("div", {
34
+ className: "modal-content"
35
+ }, children), actions && /*#__PURE__*/React.createElement(ModalFooter, {
36
+ actions: actions
37
+ }));
30
38
  };
31
39
 
32
- BlogPostsList.propTypes = {
40
+ Modal.propTypes = {
33
41
  /**
34
42
  * The HTML id for this element
35
43
  */
@@ -48,9 +56,22 @@ BlogPostsList.propTypes = {
48
56
  /**
49
57
  * The children JSX
50
58
  */
51
- children: PropTypes.node
59
+ children: PropTypes.node,
60
+
61
+ /**
62
+ * The title to pass to the header
63
+ */
64
+ title: PropTypes.string.isRequired,
65
+
66
+ /**
67
+ * The button options to provide to the footer
68
+ */
69
+ actions: PropTypes.arrayOf(PropTypes.shape({
70
+ color: PropTypes.string,
71
+ text: PropTypes.string,
72
+ onClick: PropTypes.func
73
+ }))
52
74
  };
53
- BlogPostsList.defaultProps = {// someProp:false
75
+ Modal.defaultProps = {//
54
76
  };
55
- BlogPostsList.Card = Card;
56
- export default BlogPostsList;
77
+ export default Modal;
@@ -0,0 +1,56 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ import * as React from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import styleNames from '@pareto-engineering/bem';
5
+ import { Button } from "../../../.."; // Local Definitions
6
+
7
+ const baseClassName = styleNames.base;
8
+ const componentClassName = 'modal-footer';
9
+ /**
10
+ * This is the component description.
11
+ */
12
+
13
+ const ModalFooter = ({
14
+ id,
15
+ className: userClassName,
16
+ style,
17
+ actions // ...otherProps
18
+
19
+ }) => /*#__PURE__*/React.createElement("div", {
20
+ id: id,
21
+ className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
22
+ style: style
23
+ }, actions.map(action => /*#__PURE__*/React.createElement(Button, {
24
+ color: action.color,
25
+ onClick: action.onClick,
26
+ isCompact: true
27
+ }, action.text)));
28
+
29
+ ModalFooter.propTypes = {
30
+ /**
31
+ * The HTML id for this element
32
+ */
33
+ id: PropTypes.string,
34
+
35
+ /**
36
+ * The HTML class names for this element
37
+ */
38
+ className: PropTypes.string,
39
+
40
+ /**
41
+ * The React-written, css properties for this element.
42
+ */
43
+ style: PropTypes.objectOf(PropTypes.string),
44
+
45
+ /**
46
+ * The button options to provide to the footer
47
+ */
48
+ actions: PropTypes.arrayOf(PropTypes.shape({
49
+ color: PropTypes.string,
50
+ text: PropTypes.string,
51
+ onClick: PropTypes.func
52
+ }))
53
+ };
54
+ ModalFooter.defaultProps = {// someProp:false
55
+ };
56
+ export default ModalFooter;
@@ -0,0 +1 @@
1
+ export { default as ModalFooter } from "./ModalFooter";
@@ -0,0 +1,60 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ import * as React from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import styleNames from '@pareto-engineering/bem';
5
+ import { Button, useModal } from "../../../.."; // Local Definitions
6
+
7
+ const baseClassName = styleNames.base;
8
+ const componentClassName = 'modal-header';
9
+ /**
10
+ * This is the component description.
11
+ */
12
+
13
+ const ModalHeader = ({
14
+ id,
15
+ className: userClassName,
16
+ style,
17
+ title // ...otherProps
18
+
19
+ }) => {
20
+ const {
21
+ setClose
22
+ } = useModal();
23
+ return /*#__PURE__*/React.createElement("div", {
24
+ id: id,
25
+ className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
26
+ style: style
27
+ }, /*#__PURE__*/React.createElement("span", null, title), /*#__PURE__*/React.createElement(Button, {
28
+ color: "anchor",
29
+ onClick: setClose,
30
+ isCompact: true,
31
+ className: "close-button"
32
+ }, /*#__PURE__*/React.createElement("span", {
33
+ className: "f-icons"
34
+ }, "Y")));
35
+ };
36
+
37
+ ModalHeader.propTypes = {
38
+ /**
39
+ * The HTML id for this element
40
+ */
41
+ id: PropTypes.string,
42
+
43
+ /**
44
+ * The HTML class names for this element
45
+ */
46
+ className: PropTypes.string,
47
+
48
+ /**
49
+ * The React-written, css properties for this element.
50
+ */
51
+ style: PropTypes.objectOf(PropTypes.string),
52
+
53
+ /**
54
+ * The children JSX
55
+ */
56
+ title: PropTypes.string
57
+ };
58
+ ModalHeader.defaultProps = {// someProp:false
59
+ };
60
+ export default ModalHeader;
@@ -0,0 +1 @@
1
+ export { default as ModalHeader } from "./ModalHeader";
@@ -0,0 +1,2 @@
1
+ export { ModalHeader } from "./ModalHeader";
2
+ export { ModalFooter } from "./ModalFooter";
@@ -1,2 +1,2 @@
1
1
  /* @pareto-engineering/generator-front 1.0.12 */
2
- export { default as Button } from "./Button";
2
+ export { default as Modal } from "./Modal";