@pareto-engineering/design-system 2.0.0-alpha.4 → 2.0.0-alpha.42

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 (225) hide show
  1. package/dist/cjs/a/BackgroundGradient/BackgroundGradient.js +77 -0
  2. package/dist/cjs/a/BackgroundGradient/index.js +15 -0
  3. package/dist/cjs/a/BackgroundGradient/styles.scss +16 -0
  4. package/dist/cjs/a/ContentTree/ContentTree.js +83 -0
  5. package/dist/cjs/a/ContentTree/common/Tree/Tree.js +116 -0
  6. package/dist/cjs/a/ContentTree/common/Tree/index.js +15 -0
  7. package/dist/cjs/a/ContentTree/common/index.js +31 -0
  8. package/dist/cjs/a/ContentTree/common/useContentTree.js +82 -0
  9. package/dist/cjs/a/ContentTree/common/useFirstVisibleNode.js +65 -0
  10. package/dist/cjs/a/ContentTree/index.js +15 -0
  11. package/dist/cjs/a/ContentTree/styles.scss +33 -0
  12. package/dist/cjs/a/Conversation/Conversation.js +14 -8
  13. package/dist/cjs/a/Conversation/common/Message/Message.js +32 -6
  14. package/dist/cjs/a/Conversation/styles.scss +132 -33
  15. package/dist/cjs/a/OvalIllustration/OvalIllustration.js +133 -0
  16. package/dist/cjs/a/OvalIllustration/index.js +15 -0
  17. package/dist/cjs/a/OvalIllustration/styles.scss +102 -0
  18. package/dist/cjs/a/Popover/Popover.js +134 -0
  19. package/dist/cjs/a/Popover/common/Divider/Divider.js +67 -0
  20. package/dist/cjs/a/Popover/common/Divider/index.js +15 -0
  21. package/dist/cjs/a/Popover/common/Item/Item.js +67 -0
  22. package/dist/cjs/a/Popover/common/Item/index.js +15 -0
  23. package/dist/cjs/a/Popover/common/index.js +21 -0
  24. package/dist/cjs/a/Popover/index.js +15 -0
  25. package/dist/cjs/a/Popover/styles.scss +43 -0
  26. package/dist/cjs/a/Shapes/Shapes.js +39 -9
  27. package/dist/cjs/a/Shapes/styles.scss +78 -22
  28. package/dist/cjs/a/SnapScroller/SnapScroller.js +77 -0
  29. package/dist/cjs/a/SnapScroller/index.js +15 -0
  30. package/dist/cjs/a/SnapScroller/styles.scss +38 -0
  31. package/dist/cjs/a/index.js +49 -1
  32. package/dist/cjs/b/Button/Button.js +10 -4
  33. package/dist/cjs/b/Button/styles.scss +55 -10
  34. package/dist/cjs/b/Logo/Logo.js +41 -41
  35. package/dist/cjs/b/Logo/styles.scss +0 -138
  36. package/dist/cjs/b/Page/common/Section/Section.js +56 -5
  37. package/dist/cjs/b/Page/styles.scss +8 -2
  38. package/dist/cjs/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +16 -9
  39. package/dist/cjs/c/ContentSlides/common/Navigator/Navigator.js +4 -3
  40. package/dist/cjs/c/ContentSlides/styles.scss +10 -4
  41. package/dist/cjs/c/SocialMediaShareButton/SocialMediaShareButton.js +105 -0
  42. package/dist/cjs/c/SocialMediaShareButton/index.js +15 -0
  43. package/dist/cjs/c/SocialMediaShareButton/styles.scss +39 -0
  44. package/dist/cjs/c/index.js +9 -1
  45. package/dist/cjs/f/common/Debugger/Debugger.js +1 -1
  46. package/dist/cjs/f/common/Label/Label.js +1 -1
  47. package/dist/cjs/f/common/Label/styles.scss +1 -1
  48. package/dist/cjs/f/fields/ChoicesInput/ChoicesInput.js +1 -1
  49. package/dist/cjs/f/fields/ChoicesInput/styles.scss +17 -2
  50. package/dist/cjs/f/fields/RatingsInput/RatingsInput.js +39 -6
  51. package/dist/cjs/f/fields/RatingsInput/styles.scss +29 -20
  52. package/dist/cjs/f/fields/SelectInput/SelectInput.js +36 -10
  53. package/dist/cjs/f/fields/SelectInput/styles.scss +13 -8
  54. package/dist/cjs/f/fields/TaskRecommendationInput/TaskRecommendationInput.js +1 -1
  55. package/dist/cjs/f/fields/TextInput/TextInput.js +35 -7
  56. package/dist/cjs/f/fields/TextInput/styles.scss +16 -7
  57. package/dist/cjs/f/fields/TextareaInput/TextareaInput.js +15 -8
  58. package/dist/cjs/f/fields/TextareaInput/styles.scss +19 -6
  59. package/dist/cjs/f/fields/index.js +0 -24
  60. package/dist/cjs/form-reset.scss +1 -1
  61. package/dist/cjs/index.js +13 -0
  62. package/dist/cjs/utils/hooks/index.js +23 -0
  63. package/dist/cjs/utils/hooks/useDynamicPosition.js +107 -0
  64. package/dist/cjs/utils/hooks/useWindowSize.js +39 -0
  65. package/dist/cjs/utils/index.js +19 -0
  66. package/dist/es/a/BackgroundGradient/BackgroundGradient.js +55 -0
  67. package/dist/es/a/BackgroundGradient/index.js +2 -0
  68. package/dist/es/a/BackgroundGradient/styles.scss +16 -0
  69. package/dist/es/a/ContentTree/ContentTree.js +67 -0
  70. package/dist/es/a/ContentTree/common/Tree/Tree.js +98 -0
  71. package/dist/es/a/ContentTree/common/Tree/index.js +2 -0
  72. package/dist/es/a/ContentTree/common/index.js +3 -0
  73. package/dist/es/a/ContentTree/common/useContentTree.js +74 -0
  74. package/dist/es/a/ContentTree/common/useFirstVisibleNode.js +54 -0
  75. package/dist/es/a/ContentTree/index.js +2 -0
  76. package/dist/es/a/ContentTree/styles.scss +33 -0
  77. package/dist/es/a/Conversation/Conversation.js +14 -8
  78. package/dist/es/a/Conversation/common/Message/Message.js +32 -6
  79. package/dist/es/a/Conversation/styles.scss +132 -33
  80. package/dist/es/a/OvalIllustration/OvalIllustration.js +111 -0
  81. package/dist/es/a/OvalIllustration/index.js +2 -0
  82. package/dist/es/a/OvalIllustration/styles.scss +102 -0
  83. package/dist/es/a/Popover/Popover.js +118 -0
  84. package/dist/es/a/Popover/common/Divider/Divider.js +47 -0
  85. package/dist/es/a/Popover/common/Divider/index.js +2 -0
  86. package/dist/es/a/Popover/common/Item/Item.js +47 -0
  87. package/dist/es/a/Popover/common/Item/index.js +2 -0
  88. package/dist/es/a/Popover/common/index.js +2 -0
  89. package/dist/es/a/Popover/index.js +2 -0
  90. package/dist/es/a/Popover/styles.scss +43 -0
  91. package/dist/es/a/Shapes/Shapes.js +39 -9
  92. package/dist/es/a/Shapes/styles.scss +78 -22
  93. package/dist/es/a/SnapScroller/SnapScroller.js +61 -0
  94. package/dist/es/a/SnapScroller/index.js +2 -0
  95. package/dist/es/a/SnapScroller/styles.scss +38 -0
  96. package/dist/es/a/index.js +7 -1
  97. package/dist/es/b/Button/Button.js +8 -2
  98. package/dist/es/b/Button/styles.scss +55 -10
  99. package/dist/es/b/Logo/Logo.js +41 -41
  100. package/dist/es/b/Logo/styles.scss +0 -138
  101. package/dist/es/b/Page/common/Section/Section.js +55 -4
  102. package/dist/es/b/Page/styles.scss +8 -2
  103. package/dist/es/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +16 -9
  104. package/dist/es/c/ContentSlides/common/Navigator/Navigator.js +4 -3
  105. package/dist/es/c/ContentSlides/styles.scss +10 -4
  106. package/dist/es/c/SocialMediaShareButton/SocialMediaShareButton.js +89 -0
  107. package/dist/es/c/SocialMediaShareButton/index.js +2 -0
  108. package/dist/es/c/SocialMediaShareButton/styles.scss +39 -0
  109. package/dist/es/c/index.js +2 -1
  110. package/dist/es/f/common/Debugger/Debugger.js +1 -1
  111. package/dist/es/f/common/Label/Label.js +1 -1
  112. package/dist/es/f/common/Label/styles.scss +1 -1
  113. package/dist/es/f/fields/ChoicesInput/ChoicesInput.js +1 -1
  114. package/dist/es/f/fields/ChoicesInput/styles.scss +17 -2
  115. package/dist/es/f/fields/RatingsInput/RatingsInput.js +38 -6
  116. package/dist/es/f/fields/RatingsInput/styles.scss +29 -20
  117. package/dist/es/f/fields/SelectInput/SelectInput.js +36 -10
  118. package/dist/es/f/fields/SelectInput/styles.scss +13 -8
  119. package/dist/es/f/fields/TaskRecommendationInput/TaskRecommendationInput.js +1 -1
  120. package/dist/es/f/fields/TextInput/TextInput.js +35 -7
  121. package/dist/es/f/fields/TextInput/styles.scss +16 -7
  122. package/dist/es/f/fields/TextareaInput/TextareaInput.js +15 -8
  123. package/dist/es/f/fields/TextareaInput/styles.scss +19 -6
  124. package/dist/es/f/fields/index.js +0 -3
  125. package/dist/es/form-reset.scss +1 -1
  126. package/dist/es/index.js +2 -1
  127. package/dist/es/utils/hooks/index.js +2 -0
  128. package/dist/es/utils/hooks/useDynamicPosition.js +93 -0
  129. package/dist/es/utils/hooks/useWindowSize.js +27 -0
  130. package/dist/es/utils/index.js +1 -0
  131. package/package.json +4 -3
  132. package/src/__snapshots__/Storyshots.test.js.snap +4755 -1734
  133. package/src/local.scss +2 -0
  134. package/src/stories/StyleGuide/Sprites.stories.mdx +25 -0
  135. package/src/stories/StyleGuide/helpers.js +16 -0
  136. package/src/stories/a/BackgroundGradient.stories.jsx +38 -0
  137. package/src/stories/a/ContentTree.stories.jsx +662 -0
  138. package/src/stories/a/Conversation.stories.jsx +78 -1
  139. package/src/stories/a/OvalIllustration.stories.jsx +59 -0
  140. package/src/stories/a/Popover.stories.jsx +106 -0
  141. package/src/stories/a/Shapes.stories.jsx +143 -0
  142. package/src/stories/a/SnapScroller.stories.jsx +98 -0
  143. package/src/stories/b/Button.stories.jsx +27 -4
  144. package/src/stories/b/Logo.stories.jsx +17 -9
  145. package/src/stories/b/Page.stories.jsx +51 -1
  146. package/src/stories/c/ContentSlides.stories.jsx +154 -2
  147. package/src/stories/c/SocialMediaShareButton.stories.jsx +25 -0
  148. package/src/stories/f/RatingsInput.stories.jsx +3 -2
  149. package/src/stories/f/SelectInput.stories.jsx +36 -5
  150. package/src/stories/f/TextInput.stories.jsx +15 -4
  151. package/src/stories/f/TextareaInput.stories.jsx +42 -6
  152. package/src/stories/utils/lorem.js +15 -0
  153. package/src/ui/a/BackgroundGradient/BackgroundGradient.jsx +76 -0
  154. package/src/ui/a/BackgroundGradient/index.js +2 -0
  155. package/src/ui/a/BackgroundGradient/styles.scss +16 -0
  156. package/src/ui/a/ContentTree/ContentTree.jsx +88 -0
  157. package/src/ui/a/ContentTree/common/Tree/Tree.jsx +138 -0
  158. package/src/ui/a/ContentTree/common/Tree/index.js +2 -0
  159. package/src/ui/a/ContentTree/common/index.js +3 -0
  160. package/src/ui/a/ContentTree/common/useContentTree.js +83 -0
  161. package/src/ui/a/ContentTree/common/useFirstVisibleNode.js +59 -0
  162. package/src/ui/a/ContentTree/index.js +2 -0
  163. package/src/ui/a/ContentTree/styles.scss +33 -0
  164. package/src/ui/a/Conversation/Conversation.jsx +15 -7
  165. package/src/ui/a/Conversation/common/Message/Message.jsx +38 -6
  166. package/src/ui/a/Conversation/styles.scss +132 -33
  167. package/src/ui/a/OvalIllustration/OvalIllustration.jsx +134 -0
  168. package/src/ui/a/OvalIllustration/index.js +2 -0
  169. package/src/ui/a/OvalIllustration/styles.scss +102 -0
  170. package/src/ui/a/Popover/Popover.jsx +157 -0
  171. package/src/ui/a/Popover/index.js +2 -0
  172. package/src/ui/a/Popover/styles.scss +43 -0
  173. package/src/ui/a/Shapes/Shapes.jsx +191 -0
  174. package/src/ui/a/Shapes/index.js +2 -0
  175. package/src/ui/a/Shapes/styles.scss +255 -0
  176. package/src/ui/a/SnapScroller/SnapScroller.jsx +83 -0
  177. package/src/ui/a/SnapScroller/index.js +2 -0
  178. package/src/ui/a/SnapScroller/styles.scss +38 -0
  179. package/src/ui/a/index.js +6 -0
  180. package/src/ui/b/Button/Button.jsx +9 -1
  181. package/src/ui/b/Button/styles.scss +55 -10
  182. package/src/ui/b/Logo/Logo.jsx +41 -41
  183. package/src/ui/b/Logo/styles.scss +0 -138
  184. package/src/ui/b/Page/common/Section/Section.jsx +68 -2
  185. package/src/ui/b/Page/styles.scss +8 -2
  186. package/src/ui/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.jsx +12 -5
  187. package/src/ui/c/ContentSlides/common/Navigator/Navigator.jsx +3 -2
  188. package/src/ui/c/ContentSlides/styles.scss +10 -4
  189. package/src/ui/c/SocialMediaShareButton/SocialMediaShareButton.jsx +113 -0
  190. package/src/ui/c/SocialMediaShareButton/index.js +2 -0
  191. package/src/ui/c/SocialMediaShareButton/styles.scss +39 -0
  192. package/src/ui/c/index.js +1 -0
  193. package/src/ui/f/common/Debugger/Debugger.jsx +1 -1
  194. package/src/ui/f/common/Label/Label.jsx +1 -1
  195. package/src/ui/f/common/Label/styles.scss +1 -1
  196. package/src/ui/f/fields/ChoicesInput/ChoicesInput.jsx +1 -1
  197. package/src/ui/f/fields/ChoicesInput/styles.scss +17 -2
  198. package/src/ui/f/fields/RatingsInput/RatingsInput.jsx +54 -19
  199. package/src/ui/f/fields/RatingsInput/styles.scss +29 -20
  200. package/src/ui/f/fields/SelectInput/SelectInput.jsx +43 -5
  201. package/src/ui/f/fields/SelectInput/styles.scss +13 -8
  202. package/src/ui/f/fields/TextInput/TextInput.jsx +31 -3
  203. package/src/ui/f/fields/TextInput/styles.scss +16 -7
  204. package/src/ui/f/fields/TextareaInput/TextareaInput.jsx +24 -13
  205. package/src/ui/f/fields/TextareaInput/styles.scss +19 -6
  206. package/src/ui/f/fields/index.js +0 -3
  207. package/src/ui/form-reset.scss +1 -1
  208. package/src/ui/index.js +1 -0
  209. package/src/ui/utils/hooks/index.js +2 -0
  210. package/src/ui/utils/hooks/useDynamicPosition.js +104 -0
  211. package/src/ui/utils/hooks/useWindowSize.js +32 -0
  212. package/src/ui/utils/index.js +1 -0
  213. package/stylelint.config.js +13 -13
  214. package/src/stories/f/CheckboxInput.stories.jsx +0 -37
  215. package/src/stories/f/RadioInput.stories.jsx +0 -37
  216. package/src/stories/f/TaskRecommendationInput.stories.jsx +0 -38
  217. package/src/ui/f/fields/CheckboxInput/CheckboxInput.jsx +0 -107
  218. package/src/ui/f/fields/CheckboxInput/index.js +0 -2
  219. package/src/ui/f/fields/CheckboxInput/styles.scss +0 -28
  220. package/src/ui/f/fields/RadioInput/RadioInput.jsx +0 -112
  221. package/src/ui/f/fields/RadioInput/index.js +0 -2
  222. package/src/ui/f/fields/RadioInput/styles.scss +0 -26
  223. package/src/ui/f/fields/TaskRecommendationInput/TaskRecommendationInput.jsx +0 -130
  224. package/src/ui/f/fields/TaskRecommendationInput/index.js +0 -2
  225. package/src/ui/f/fields/TaskRecommendationInput/styles.scss +0 -41
@@ -0,0 +1,118 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ import * as React from 'react';
3
+ import { useRef, useLayoutEffect } from 'react';
4
+ import PropTypes from 'prop-types';
5
+ import styleNames from '@pareto-engineering/bem'; // Local Definitions
6
+
7
+ import { useDynamicPosition } from "../../utils";
8
+ const baseClassName = styleNames.base;
9
+ const componentClassName = 'popover';
10
+ /**
11
+ * This is the component description.
12
+ */
13
+
14
+ const Popover = ({
15
+ id,
16
+ className: userClassName,
17
+ style,
18
+ color,
19
+ children,
20
+ isOpen,
21
+ parentRef,
22
+ preferredPrimaryOrder,
23
+ preferredSecondaryOrder,
24
+ offsetXPx,
25
+ offsetYPx // ...otherProps
26
+
27
+ }) => {
28
+ useLayoutEffect(() => {
29
+ import("./styles.scss");
30
+ }, []);
31
+ const popoverRef = useRef(null);
32
+ const {
33
+ primaryPosition,
34
+ secondaryPosition
35
+ } = useDynamicPosition({
36
+ preferredPrimaryOrder,
37
+ preferredSecondaryOrder,
38
+ elementRef: popoverRef,
39
+ parentRef,
40
+ offsetXPx,
41
+ offsetYPx
42
+ });
43
+ return /*#__PURE__*/React.createElement("div", {
44
+ id: id,
45
+ className: [baseClassName, componentClassName, userClassName, isOpen && 'open', `x-${color}`, primaryPosition, secondaryPosition].filter(e => e).join(' '),
46
+ style: style,
47
+ ref: popoverRef // {...otherProps}
48
+
49
+ }, children);
50
+ };
51
+
52
+ Popover.propTypes = {
53
+ /**
54
+ * The HTML id for this element
55
+ */
56
+ id: PropTypes.string,
57
+
58
+ /**
59
+ * The HTML class names for this element
60
+ */
61
+ className: PropTypes.string,
62
+
63
+ /**
64
+ * The React-written, css properties for this element.
65
+ */
66
+ style: PropTypes.objectOf(PropTypes.string),
67
+
68
+ /**
69
+ * The children JSX
70
+ */
71
+ children: PropTypes.node,
72
+
73
+ /**
74
+ * The base color of the popover
75
+ */
76
+ color: PropTypes.string,
77
+
78
+ /**
79
+ * Whether the popover should be visible or not
80
+ */
81
+ isOpen: PropTypes.bool,
82
+
83
+ /**
84
+ * The preferred primary position order of the popover
85
+ */
86
+ preferredPrimaryOrder: PropTypes.arrayOf(PropTypes.oneOf(['bottom', 'top', 'right', 'left'])),
87
+
88
+ /**
89
+ * The preferred secondary position order of the popover
90
+ */
91
+ preferredSecondaryOrder: PropTypes.arrayOf(PropTypes.oneOf(['left', 'right', 'bottom', 'top'])),
92
+
93
+ /**
94
+ * The horizonal offset in pixels from the anchor point to the popover
95
+ */
96
+ offsetXPx: PropTypes.number,
97
+
98
+ /**
99
+ * The vertical offset in pixels from the anchor point to the popover
100
+ */
101
+ offsetYPx: PropTypes.number,
102
+
103
+ /**
104
+ * The reference to the parent element
105
+ */
106
+ parentRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
107
+ current: PropTypes.instanceOf(Element)
108
+ })])
109
+ };
110
+ Popover.defaultProps = {
111
+ color: 'background1',
112
+ isOpen: false,
113
+ preferredPrimaryOrder: ['bottom', 'top', 'right', 'left'],
114
+ preferredSecondaryOrder: ['left', 'right', 'bottom', 'top'],
115
+ offsetXPx: 16,
116
+ offsetYPx: 0
117
+ };
118
+ export default Popover;
@@ -0,0 +1,47 @@
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'; // Local Definitions
5
+
6
+ const baseClassName = styleNames.base;
7
+ const componentClassName = 'divider';
8
+ /**
9
+ * This is the component description.
10
+ */
11
+
12
+ const Divider = ({
13
+ id,
14
+ className: userClassName,
15
+ style,
16
+ children // ...otherProps
17
+
18
+ }) => /*#__PURE__*/React.createElement("div", {
19
+ id: id,
20
+ className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
21
+ style: style
22
+ }, children);
23
+
24
+ Divider.propTypes = {
25
+ /**
26
+ * The HTML id for this element
27
+ */
28
+ id: PropTypes.string,
29
+
30
+ /**
31
+ * The HTML class names for this element
32
+ */
33
+ className: PropTypes.string,
34
+
35
+ /**
36
+ * The React-written, css properties for this element.
37
+ */
38
+ style: PropTypes.objectOf(PropTypes.string),
39
+
40
+ /**
41
+ * The children JSX
42
+ */
43
+ children: PropTypes.node
44
+ };
45
+ Divider.defaultProps = {// someProp:false
46
+ };
47
+ export default Divider;
@@ -0,0 +1,2 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ export { default as Divider } from "./Divider";
@@ -0,0 +1,47 @@
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'; // Local Definitions
5
+
6
+ const baseClassName = styleNames.base;
7
+ const componentClassName = 'item';
8
+ /**
9
+ * This is the component description.
10
+ */
11
+
12
+ const Item = ({
13
+ id,
14
+ className: userClassName,
15
+ style,
16
+ children // ...otherProps
17
+
18
+ }) => /*#__PURE__*/React.createElement("div", {
19
+ id: id,
20
+ className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
21
+ style: style
22
+ }, children);
23
+
24
+ Item.propTypes = {
25
+ /**
26
+ * The HTML id for this element
27
+ */
28
+ id: PropTypes.string,
29
+
30
+ /**
31
+ * The HTML class names for this element
32
+ */
33
+ className: PropTypes.string,
34
+
35
+ /**
36
+ * The React-written, css properties for this element.
37
+ */
38
+ style: PropTypes.objectOf(PropTypes.string),
39
+
40
+ /**
41
+ * The children JSX
42
+ */
43
+ children: PropTypes.node
44
+ };
45
+ Item.defaultProps = {// someProp:false
46
+ };
47
+ export default Item;
@@ -0,0 +1,2 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ export { default as Item } from "./Item";
@@ -0,0 +1,2 @@
1
+ export { Item } from "./Item";
2
+ export { Divider } from "./Divider";
@@ -0,0 +1,2 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ export { default as Popover } from "./Popover";
@@ -0,0 +1,43 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ @use "@pareto-engineering/bem";
3
+
4
+ $default-padding: 1em;
5
+ $default-margin: 1em;
6
+ $default-border: var(--theme-border-style) var(--metadata);
7
+
8
+ .#{bem.$base}.popover{
9
+ position: absolute;
10
+ z-index: 1;
11
+ background-color: var(--x);
12
+ padding: $default-padding;
13
+ border: $default-border;
14
+
15
+ &:not(.open) {
16
+ display: none;
17
+ }
18
+
19
+ > *:not(:last-child) {
20
+ margin-bottom: $default-margin / 2;
21
+ }
22
+
23
+ &.bottom {
24
+ top: 100%;
25
+ // bottom: 0;
26
+ }
27
+
28
+ &.left {
29
+ left: 0;
30
+ }
31
+
32
+ &.right {
33
+ right: 0;
34
+ }
35
+
36
+ &.top {
37
+ bottom: 100%;
38
+ top: auto;
39
+ }
40
+ }
41
+
42
+
43
+
@@ -14,9 +14,11 @@ const Shapes = ({
14
14
  id,
15
15
  className: userClassName,
16
16
  style,
17
- pin,
18
17
  shape,
19
- height // ...otherProps
18
+ height,
19
+ overflow,
20
+ verticalAlign,
21
+ horizontalAlign // ...otherProps
20
22
 
21
23
  }) => {
22
24
  useLayoutEffect(() => {
@@ -26,12 +28,16 @@ const Shapes = ({
26
28
  id: id,
27
29
  className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
28
30
  style: { ...style,
29
- '--pin': pin,
30
- '--shape-height': height
31
+ '--shape-height': height,
32
+ '--overflow': overflow,
33
+ '--vertical-align': verticalAlign,
34
+ '--horizontal-align': horizontalAlign
31
35
  } // {...otherProps}
32
36
 
33
37
  }, shape === 'triangle' && /*#__PURE__*/React.createElement("div", {
34
38
  className: "triangle"
39
+ }), shape === 'inverted-triangle' && /*#__PURE__*/React.createElement("div", {
40
+ className: "inverted-triangle"
35
41
  }), shape === 'half-ellipses' && /*#__PURE__*/React.createElement("div", {
36
42
  className: "half-ellipses"
37
43
  }, /*#__PURE__*/React.createElement("div", {
@@ -78,6 +84,18 @@ const Shapes = ({
78
84
  className: "circle-three"
79
85
  }), /*#__PURE__*/React.createElement("div", {
80
86
  className: "circle-four"
87
+ })), shape === 'rotated-ellipses' && /*#__PURE__*/React.createElement("div", {
88
+ className: "rotated-ellipses"
89
+ }, /*#__PURE__*/React.createElement("div", {
90
+ className: "ellipse-one"
91
+ }), /*#__PURE__*/React.createElement("div", {
92
+ className: "ellipse-two"
93
+ })), shape === 'intersecting-circles' && /*#__PURE__*/React.createElement("div", {
94
+ className: "intersecting-circles"
95
+ }, /*#__PURE__*/React.createElement("div", {
96
+ className: "left"
97
+ }), /*#__PURE__*/React.createElement("div", {
98
+ className: "right"
81
99
  })));
82
100
  };
83
101
 
@@ -103,17 +121,29 @@ Shapes.propTypes = {
103
121
  height: PropTypes.string,
104
122
 
105
123
  /**
106
- * Where to pin the shapes
124
+ * The vertical alignment of the shape.
125
+ */
126
+ verticalAlign: PropTypes.oneOf(['flex-start', 'center', 'flex-end']),
127
+
128
+ /**
129
+ * The horizontal alignment of the shape.
107
130
  */
108
- pin: PropTypes.oneOf(['flex-start', 'center', 'flex-end']),
131
+ horizontalAlign: PropTypes.oneOf(['flex-start', 'center', 'flex-end']),
109
132
 
110
133
  /**
111
134
  * The options of a shape to use
112
135
  */
113
- shape: PropTypes.oneOf(['triangle', 'ellipse', 'half-ellipse', 'half-ellipses', 'spiral', 'diamonds', 'circle', 'half-circle', 'ellipses', 'rectangles'])
136
+ shape: PropTypes.oneOf(['triangle', 'ellipse', 'half-ellipse', 'half-ellipses', 'spiral', 'diamonds', 'circle', 'half-circle', 'ellipses', 'rectangles', 'rotated-ellipses', 'inverted-triangle', 'intersecting-circles']),
137
+
138
+ /**
139
+ * The overflow of the shape.
140
+ */
141
+ overflow: PropTypes.oneOf(['hidden', 'visible'])
114
142
  };
115
143
  Shapes.defaultProps = {
116
- pin: 'center',
117
- shape: 'triangle'
144
+ verticalAlign: 'center',
145
+ horizontalAlign: 'center',
146
+ shape: 'triangle',
147
+ overflow: 'hidden'
118
148
  };
119
149
  export default Shapes;
@@ -15,8 +15,9 @@ $default-shapes-opacity:.8;
15
15
  left: 0;
16
16
  display: flex;
17
17
  flex-direction: column;
18
- justify-content: var(--pin);
19
- align-items: center;
18
+ overflow: var(--overflow);
19
+ justify-content: var(--vertical-align);
20
+ align-items: var(--horizontal-align);
20
21
  height: 100%;
21
22
  width: 100%;
22
23
 
@@ -28,30 +29,37 @@ $default-shapes-opacity:.8;
28
29
  width: var(--shape-height, #{$default-triangle-height});
29
30
  }
30
31
 
32
+ .inverted-triangle {
33
+ background-image: linear-gradient(var(--dark-y), var(--light-y));
34
+ clip-path: polygon(50% 0, 0 100%, 100% 100%);
35
+ height: calc(var(--shape-height, #{$default-triangle-height}) * 0.86);
36
+ opacity: $default-shapes-opacity;
37
+ width: var(--shape-height, #{$default-triangle-height});
38
+ }
39
+
31
40
  .half-ellipses {
32
41
  height: var(--shape-height, #{$default-ellipse-height});
33
42
  opacity: $default-shapes-opacity;
34
43
  width: calc(var(--shape-height, #{$default-ellipse-height}) * 2);
35
44
 
36
45
  .up {
37
- background-image: linear-gradient(var(--light-y), var(--y));
38
- clip-path: ellipse(40% 100% at 50% 0%);
46
+ background-image: radial-gradient(ellipse at center bottom, var(--y) 5%, transparent 65%);
47
+ clip-path: ellipse(35% 100% at 50% 0%);
39
48
  height: 50%;
40
49
  }
41
50
 
42
51
  .down {
43
- background-image: linear-gradient(to top, var(--light-y), var(--y));
44
- clip-path: ellipse(40% 100% at 50% 100%);
52
+ background-image: radial-gradient(ellipse at center top, var(--y) 5%, transparent 65%);
53
+ clip-path: ellipse(35% 100% at 50% 100%);
45
54
  height: 50%;
46
55
  }
47
56
  }
48
57
 
49
58
  .ellipse {
50
- background-image: linear-gradient(to top left, var(--dark-y), var(--light-y), var(--dark-y));
51
- clip-path: ellipse(50% 25% at 50% 50%);
59
+ background-image: linear-gradient(var(--dark-y), var(--light-y));
60
+ clip-path: ellipse(50% 50% at 50% 50%);
52
61
  height: var(--shape-height, #{$default-ellipse-height});
53
62
  opacity: $default-shapes-opacity;
54
- transform: rotate3d(0, 0, -1, 10deg);
55
63
  width: calc(var(--shape-height, #{$default-ellipse-height}) * 2);
56
64
  }
57
65
 
@@ -109,15 +117,15 @@ $default-shapes-opacity:.8;
109
117
  }
110
118
 
111
119
  .half-ellipse {
112
- background-image: linear-gradient(var(--light-y), var(--dark-y));
113
- clip-path: ellipse(50% 50% at 50% 0);
120
+ background-image: radial-gradient(ellipse at center bottom, var(--y) 10%, var(--light-y) 65%);
121
+ clip-path: ellipse(60% 100% at 50% 0%);
114
122
  height: var(--shape-height, #{$default-ellipse-height});
115
123
  opacity: $default-shapes-opacity;
116
124
  width: calc(var(--shape-height, #{$default-ellipse-height}) * 2);
117
125
  }
118
126
 
119
127
  .circle {
120
- background-image: linear-gradient(var(--light-y), var(--dark-y));
128
+ background-image: linear-gradient(var(--dark-y), var(--light-y));
121
129
  clip-path: circle(50% at 50% 50%);
122
130
  height: var(--shape-height, #{$default-circle-height});
123
131
  opacity: $default-shapes-opacity;
@@ -139,7 +147,7 @@ $default-shapes-opacity:.8;
139
147
  width: var(--shape-height, #{$default-ellipse-height});
140
148
 
141
149
  .first {
142
- background-image: linear-gradient(to top, var(--dark-y), var(--y), var(--light-y) 50%, transparent);
150
+ background-image: linear-gradient(to top, var(--dark-y), var(--y), var(--light-y) 50%, var(--background1));
143
151
  clip-path: ellipse(50% 20% at 50% 60%);
144
152
  height: 100%;
145
153
  position: absolute;
@@ -148,7 +156,7 @@ $default-shapes-opacity:.8;
148
156
  }
149
157
 
150
158
  .second {
151
- background-image: linear-gradient(to bottom,var(--dark-y), var(--y), var(--light-y) 45%, transparent);
159
+ background-image: linear-gradient(to bottom,var(--dark-y), var(--y), var(--light-y) 45%, var(--background1));
152
160
  clip-path: ellipse(50% 20% at 50% 40%);
153
161
  height: 100%;
154
162
  position: absolute;
@@ -167,33 +175,81 @@ $default-shapes-opacity:.8;
167
175
 
168
176
  > * {
169
177
  border-radius: 50%;
170
- background: radial-gradient(ellipse at center bottom ,var(--dark-y) 10%, transparent 60%);
178
+ background: radial-gradient(ellipse at center bottom, var(--dark-y) 10%, var(--light-y) 60%);
171
179
  position: absolute;
172
180
  opacity: .5;
173
181
  }
174
182
 
175
183
  .circle-one {
176
184
  transform: rotate(45deg);
177
- height: 55%;
178
- width: 55%;
185
+ height:calc(var(--shape-height, #{$default-ellipse-height})* 0.4);
186
+ width: calc(var(--shape-height, #{$default-ellipse-height})* 0.4);
179
187
  }
180
188
 
181
189
  .circle-two {
182
- height: 70%;
183
- width: 70%;
190
+ height: calc(var(--shape-height, #{$default-ellipse-height})* 0.6);
191
+ width: calc(var(--shape-height, #{$default-ellipse-height})* 0.6);
184
192
  }
185
193
 
186
194
  .circle-three {
187
195
  transform: rotate(-45deg);
188
- height: 85%;
189
- width: 85%;
196
+ height: calc(var(--shape-height, #{$default-ellipse-height})* 0.8);
197
+ width: calc(var(--shape-height, #{$default-ellipse-height})* 0.8);
190
198
  }
191
199
 
192
200
  .circle-four {
193
201
  transform: rotate(-90deg);
194
- height: 100%;
202
+ height: calc(var(--shape-height, #{$default-ellipse-height})* 1);
203
+ width: calc(var(--shape-height, #{$default-ellipse-height})* 1);
204
+ }
205
+ }
206
+ .rotated-ellipses {
207
+ height: var(--shape-height, #{$default-ellipse-height});
208
+ opacity: $default-shapes-opacity;
209
+ width: var(--shape-height, #{$default-ellipse-height});
210
+ display: flex;
211
+
212
+ > *{
195
213
  width: 100%;
214
+ height: 100%;
215
+ }
216
+
217
+ .ellipse-one {
218
+ background-image: radial-gradient(ellipse at bottom left, var(--y) 30%, transparent 65%);
219
+ transform: rotate(-15deg);
220
+ clip-path: ellipse(50% 35% at 50% 50%);
221
+ }
222
+
223
+ .ellipse-two {
224
+ background-image: radial-gradient(ellipse at top right, var(--y) 30%, transparent 65%);
225
+ transform: rotate(-15deg);
226
+ clip-path: ellipse(50% 35% at 50% 50%);
196
227
  }
197
228
  }
198
229
 
230
+ .intersecting-circles {
231
+ height: var(--shape-height, #{$default-circle-height});
232
+ opacity: $default-shapes-opacity;
233
+ width: calc(var(--shape-height, #{$default-circle-height}) * 2);
234
+ display: grid;
235
+ grid-template-columns: repeat(7, 1fr);
236
+ position: relative;
237
+
238
+ > * {
239
+ border-radius: 50%;
240
+ height: 100%;
241
+ width: 100%;
242
+ position: absolute;
243
+ opacity: .8;
244
+ }
245
+
246
+ .left {
247
+ background-image: linear-gradient(to right ,var(--dark-y),var(--y), var(--light-y));
248
+ grid-column: 1 / 5;
249
+ }
250
+ .right {
251
+ background-image: linear-gradient(to left, var(--dark-y), var(--y), var(--light-y));
252
+ grid-column: 4 / 8;
253
+ }
254
+ }
199
255
  }
@@ -0,0 +1,61 @@
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 = 'snap-scroller';
9
+ /**
10
+ * This is the component description.
11
+ */
12
+
13
+ const SnapScroller = ({
14
+ id,
15
+ className: userClassName,
16
+ style,
17
+ children,
18
+ noScrollOnDesktop // ...otherProps
19
+
20
+ }) => {
21
+ useLayoutEffect(() => {
22
+ import("./styles.scss");
23
+ }, []);
24
+ return /*#__PURE__*/React.createElement("div", {
25
+ id: id,
26
+ className: [baseClassName, componentClassName, userClassName, noScrollOnDesktop && 'desktop-no-scroll'].filter(e => e).join(' '),
27
+ style: style // {...otherProps}
28
+
29
+ }, children);
30
+ };
31
+
32
+ SnapScroller.propTypes = {
33
+ /**
34
+ * The HTML id for this element
35
+ */
36
+ id: PropTypes.string,
37
+
38
+ /**
39
+ * The HTML class names for this element
40
+ */
41
+ className: PropTypes.string,
42
+
43
+ /**
44
+ * The React-written, css properties for this element.
45
+ */
46
+ style: PropTypes.objectOf(PropTypes.string),
47
+
48
+ /**
49
+ * The children JSX
50
+ */
51
+ children: PropTypes.node,
52
+
53
+ /**
54
+ * Whether to snap scroll on desktop (false will enable a flexbox)
55
+ */
56
+ noScrollOnDesktop: PropTypes.bool
57
+ };
58
+ SnapScroller.defaultProps = {
59
+ noScrollOnDesktop: false
60
+ };
61
+ export default SnapScroller;
@@ -0,0 +1,2 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ export { default as SnapScroller } from "./SnapScroller";
@@ -0,0 +1,38 @@
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-spacing:var(--spacing, var(--u));
8
+
9
+ .#{bem.$base}.snap-scroller {
10
+ display: flex;
11
+ -ms-overflow-style: none; /* for Internet Explorer, Edge */
12
+ overflow-x: auto;
13
+ scroll-padding: calc(#{$default-spacing} *2);
14
+ scroll-snap-type: x mandatory;
15
+ scrollbar-width: none;
16
+
17
+
18
+ > * {
19
+ &:first-child {
20
+ margin-left: $default-spacing;
21
+ }
22
+ display: inline-block;
23
+ margin-right: $default-spacing;
24
+ scroll-snap-align: start;
25
+ }
26
+
27
+
28
+ @include mixins.media($from:$sm-md) {
29
+ &.desktop-no-scroll {
30
+ overflow: auto;
31
+ -ms-overflow-style: unset; /* for Internet Explorer, Edge */
32
+ scroll-snap-type: none;
33
+ scrollbar-width: unset;
34
+ }
35
+ }
36
+ }
37
+
38
+
@@ -17,4 +17,10 @@ export { CustomerStat } from "./CustomerStat";
17
17
  export { Quote } from "./Quote";
18
18
  export { ContentCard } from "./ContentCard";
19
19
  export { DotInfo } from "./DotInfo";
20
- export { Timestamp } from "./Timestamp";
20
+ export { Timestamp } from "./Timestamp";
21
+ export { Shapes } from "./Shapes";
22
+ export { OvalIllustration } from "./OvalIllustration";
23
+ export { SnapScroller } from "./SnapScroller";
24
+ export { BackgroundGradient } from "./BackgroundGradient";
25
+ export { ContentTree } from "./ContentTree";
26
+ export { Popover } from "./Popover";
@@ -23,6 +23,7 @@ const Button = ({
23
23
  isCompact,
24
24
  isGhost,
25
25
  isSimple,
26
+ arrowDirection,
26
27
  ...otherProps
27
28
  }) => {
28
29
  useLayoutEffect(() => {
@@ -30,7 +31,7 @@ const Button = ({
30
31
  }, []);
31
32
  return /*#__PURE__*/React.createElement("button", _extends({
32
33
  id: id,
33
- className: [baseClassName, componentClassName, userClassName, `x-${color}`, isGhost && styleNames.modifierGhost, isCompact && styleNames.modifierCompact, isSimple && styleNames.modifierSimple].filter(e => e).join(' '),
34
+ className: [baseClassName, componentClassName, userClassName, `x-${color}`, isGhost && styleNames.modifierGhost, isCompact && styleNames.modifierCompact, isSimple && styleNames.modifierSimple, arrowDirection && `arrow-${arrowDirection}`].filter(e => e).join(' '),
34
35
  style: style,
35
36
  type: "button"
36
37
  }, otherProps), isLoading ? /*#__PURE__*/React.createElement(LoadingCircle, {
@@ -85,7 +86,12 @@ Button.propTypes = {
85
86
  /**
86
87
  * Button loading state
87
88
  */
88
- isLoading: PropTypes.bool
89
+ isLoading: PropTypes.bool,
90
+
91
+ /**
92
+ * The direction of the arrow if the button has one
93
+ */
94
+ arrowDirection: PropTypes.string
89
95
  };
90
96
  Button.defaultProps = {
91
97
  color: 'main1'