@pareto-engineering/design-system 3.0.0-alpha.28 → 4.0.0-alpha.3

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 (205) hide show
  1. package/.storybook/main.js +25 -63
  2. package/.storybook/preview.js +26 -9
  3. package/.storybook/webpackFinal.js +68 -0
  4. package/babel.config.js +14 -45
  5. package/dist/cjs/a/ContentTree/styles.scss +20 -20
  6. package/dist/cjs/a/Conversation/styles.scss +1 -0
  7. package/dist/cjs/a/Label/styles.scss +18 -17
  8. package/dist/cjs/a/LoadingCircle/styles.scss +35 -37
  9. package/dist/cjs/a/People/styles.scss +4 -4
  10. package/dist/cjs/a/Popover/styles.scss +4 -3
  11. package/dist/cjs/a/Quote/styles.scss +41 -38
  12. package/dist/cjs/a/SnapScroller/styles.scss +6 -4
  13. package/dist/cjs/a/index.js +0 -7
  14. package/dist/cjs/b/Button/styles.scss +2 -2
  15. package/dist/cjs/b/Logo/styles.scss +4 -2
  16. package/dist/cjs/b/Page/common/PageHelmet/PageHelmet.js +2 -2
  17. package/dist/cjs/b/Page/styles.scss +7 -6
  18. package/dist/cjs/b/SocialMediaButton/styles.scss +1 -1
  19. package/dist/cjs/c/ContentSlides/styles.scss +2 -4
  20. package/dist/cjs/c/Modal/styles.scss +7 -5
  21. package/dist/cjs/c/SocialMediaShareButton/styles.scss +3 -3
  22. package/dist/cjs/f/FormInput/styles.scss +4 -4
  23. package/dist/cjs/f/common/Label/styles.scss +1 -1
  24. package/dist/cjs/f/fields/Checkbox/styles.scss +9 -8
  25. package/dist/cjs/f/fields/ChoicesInput/styles.scss +4 -4
  26. package/dist/cjs/f/fields/QueryCombobox/styles.scss +59 -59
  27. package/dist/cjs/f/fields/RatingsInput/styles.scss +8 -9
  28. package/dist/cjs/f/fields/SelectInput/styles.scss +6 -6
  29. package/dist/cjs/f/fields/TextInput/styles.scss +4 -4
  30. package/dist/cjs/f/fields/TextareaInput/styles.scss +7 -6
  31. package/dist/es/a/AppContext/ContextProvider.js +7 -8
  32. package/dist/es/a/AppContext/useTheme.js +1 -2
  33. package/dist/es/a/ContentTree/ContentTree.js +8 -9
  34. package/dist/es/a/ContentTree/common/Tree/Tree.js +8 -9
  35. package/dist/es/a/ContentTree/styles.scss +20 -20
  36. package/dist/es/a/Conversation/Conversation.js +11 -12
  37. package/dist/es/a/Conversation/common/Message/Message.js +12 -13
  38. package/dist/es/a/Conversation/styles.scss +1 -0
  39. package/dist/es/a/DotInfo/DotInfo.js +11 -12
  40. package/dist/es/a/Figure/Figure.js +8 -9
  41. package/dist/es/a/HamburgerButton/HamburgerButton.js +10 -11
  42. package/dist/es/a/IconList/IconList.js +9 -10
  43. package/dist/es/a/IconList/common/Item/Item.js +17 -20
  44. package/dist/es/a/Label/Label.js +9 -10
  45. package/dist/es/a/Label/styles.scss +18 -17
  46. package/dist/es/a/LoadingCircle/LoadingCircle.js +10 -11
  47. package/dist/es/a/LoadingCircle/styles.scss +35 -37
  48. package/dist/es/a/People/People.js +9 -10
  49. package/dist/es/a/People/common/Person/Person.js +24 -27
  50. package/dist/es/a/People/styles.scss +4 -4
  51. package/dist/es/a/Popover/Popover.js +14 -15
  52. package/dist/es/a/Popover/styles.scss +4 -3
  53. package/dist/es/a/ProgressBar/ProgressBar.js +10 -11
  54. package/dist/es/a/Quote/Quote.js +10 -11
  55. package/dist/es/a/Quote/styles.scss +41 -38
  56. package/dist/es/a/SVG/SVG.js +17 -18
  57. package/dist/es/a/SVG/common/UseSVG/UseSVG.js +19 -22
  58. package/dist/es/a/SnapScroller/SnapScroller.js +8 -9
  59. package/dist/es/a/SnapScroller/styles.scss +6 -4
  60. package/dist/es/a/Spinner/Spinner.js +7 -8
  61. package/dist/es/a/Timestamp/Timestamp.js +14 -15
  62. package/dist/es/a/index.js +0 -1
  63. package/dist/es/b/Button/Button.js +13 -14
  64. package/dist/es/b/Button/styles.scss +2 -2
  65. package/dist/es/b/Logo/Logo.js +12 -13
  66. package/dist/es/b/Logo/styles.scss +4 -2
  67. package/dist/es/b/Page/Page.js +10 -11
  68. package/dist/es/b/Page/common/PageHelmet/PageHelmet.js +9 -11
  69. package/dist/es/b/Page/common/Section/Section.js +7 -8
  70. package/dist/es/b/Page/styles.scss +7 -6
  71. package/dist/es/b/SocialMediaButton/SocialMediaButton.js +11 -12
  72. package/dist/es/b/SocialMediaButton/styles.scss +1 -1
  73. package/dist/es/b/ThemeSelector/ThemeSelector.js +8 -9
  74. package/dist/es/b/Title/Title.js +27 -30
  75. package/dist/es/c/ContentSlides/ContentSlides.js +12 -15
  76. package/dist/es/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +11 -12
  77. package/dist/es/c/ContentSlides/common/Navigator/Navigator.js +14 -15
  78. package/dist/es/c/ContentSlides/common/Sidebar/Sidebar.js +8 -9
  79. package/dist/es/c/ContentSlides/common/Slide/Slide.js +8 -9
  80. package/dist/es/c/ContentSlides/styles.scss +2 -4
  81. package/dist/es/c/Modal/Modal.js +10 -11
  82. package/dist/es/c/Modal/common/ModalHeader/ModalHeader.js +20 -23
  83. package/dist/es/c/Modal/styles.scss +7 -5
  84. package/dist/es/c/Shortener/Shortener.js +11 -12
  85. package/dist/es/c/SocialMediaShareButton/SocialMediaShareButton.js +9 -10
  86. package/dist/es/c/SocialMediaShareButton/styles.scss +3 -3
  87. package/dist/es/f/FormInput/FormInput.js +7 -8
  88. package/dist/es/f/FormInput/styles.scss +4 -4
  89. package/dist/es/f/common/Debugger/Debugger.js +7 -8
  90. package/dist/es/f/common/Description/Description.js +9 -10
  91. package/dist/es/f/common/Label/Label.js +11 -12
  92. package/dist/es/f/common/Label/styles.scss +1 -1
  93. package/dist/es/f/fields/Checkbox/Checkbox.js +11 -12
  94. package/dist/es/f/fields/Checkbox/styles.scss +9 -8
  95. package/dist/es/f/fields/ChoicesInput/ChoicesInput.js +17 -18
  96. package/dist/es/f/fields/ChoicesInput/common/Choice/Choice.js +13 -14
  97. package/dist/es/f/fields/ChoicesInput/styles.scss +4 -4
  98. package/dist/es/f/fields/QueryChoices/QueryChoices.js +16 -20
  99. package/dist/es/f/fields/QueryCombobox/QueryCombobox.js +27 -31
  100. package/dist/es/f/fields/QueryCombobox/common/Combobox/Combobox.js +22 -24
  101. package/dist/es/f/fields/QueryCombobox/common/Menu/Menu.js +22 -25
  102. package/dist/es/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +24 -26
  103. package/dist/es/f/fields/QueryCombobox/styles.scss +59 -59
  104. package/dist/es/f/fields/QuerySelect/QuerySelect.js +24 -28
  105. package/dist/es/f/fields/RatingsInput/RatingsInput.js +16 -17
  106. package/dist/es/f/fields/RatingsInput/common/Rating/Rating.js +15 -16
  107. package/dist/es/f/fields/RatingsInput/styles.scss +8 -9
  108. package/dist/es/f/fields/SelectInput/SelectInput.js +16 -17
  109. package/dist/es/f/fields/SelectInput/styles.scss +6 -6
  110. package/dist/es/f/fields/TextInput/TextInput.js +18 -19
  111. package/dist/es/f/fields/TextInput/styles.scss +4 -4
  112. package/dist/es/f/fields/TextareaInput/TextareaInput.js +20 -21
  113. package/dist/es/f/fields/TextareaInput/styles.scss +7 -6
  114. package/dist/es/r/SwitchRouteMap/SwitchRouteMap.js +15 -21
  115. package/dist/es/r/common/PrivateRoute/PrivateRoute.js +6 -7
  116. package/dist/es/test/QueryLoader/QueryLoader.js +1 -1
  117. package/dist/es/test/QueryLoader/common/PreloadedTestData/PreloadedTestData.js +5 -6
  118. package/dist/es/utils/hooks/useDynamicPosition.js +9 -10
  119. package/dist/es/utils/hooks/useWindowSize.js +1 -2
  120. package/jest.config.js +5 -5
  121. package/package.json +44 -81
  122. package/src/stories/b/Page.stories.jsx +2 -1
  123. package/src/stories/original/Button.jsx +55 -0
  124. package/src/stories/original/Button.stories.js +39 -0
  125. package/src/stories/original/Header.jsx +64 -0
  126. package/src/stories/original/Header.stories.js +22 -0
  127. package/src/stories/original/Introduction.mdx +211 -0
  128. package/src/stories/original/Page.jsx +76 -0
  129. package/src/stories/original/Page.stories.js +26 -0
  130. package/src/stories/original/assets/code-brackets.svg +1 -0
  131. package/src/stories/original/assets/colors.svg +1 -0
  132. package/src/stories/original/assets/comments.svg +1 -0
  133. package/src/stories/original/assets/direction.svg +1 -0
  134. package/src/stories/original/assets/flow.svg +1 -0
  135. package/src/stories/original/assets/plugin.svg +1 -0
  136. package/src/stories/original/assets/repo.svg +1 -0
  137. package/src/stories/original/assets/stackalt.svg +1 -0
  138. package/src/stories/original/button.css +30 -0
  139. package/src/stories/original/header.css +32 -0
  140. package/src/stories/original/page.css +69 -0
  141. package/src/ui/a/ContentTree/styles.scss +20 -20
  142. package/src/ui/a/Conversation/styles.scss +1 -0
  143. package/src/ui/a/Label/styles.scss +18 -17
  144. package/src/ui/a/LoadingCircle/styles.scss +35 -37
  145. package/src/ui/a/People/styles.scss +4 -4
  146. package/src/ui/a/Popover/styles.scss +4 -3
  147. package/src/ui/a/Quote/styles.scss +41 -38
  148. package/src/ui/a/SnapScroller/styles.scss +6 -4
  149. package/src/ui/a/index.js +0 -1
  150. package/src/ui/b/Button/styles.scss +2 -2
  151. package/src/ui/b/Logo/styles.scss +4 -2
  152. package/src/ui/b/Page/common/PageHelmet/PageHelmet.jsx +1 -1
  153. package/src/ui/b/Page/styles.scss +7 -6
  154. package/src/ui/b/SocialMediaButton/styles.scss +1 -1
  155. package/src/ui/c/ContentSlides/styles.scss +2 -4
  156. package/src/ui/c/Modal/styles.scss +7 -5
  157. package/src/ui/c/SocialMediaShareButton/styles.scss +3 -3
  158. package/src/ui/f/FormInput/styles.scss +4 -4
  159. package/src/ui/f/common/Label/styles.scss +1 -1
  160. package/src/ui/f/fields/Checkbox/styles.scss +9 -8
  161. package/src/ui/f/fields/ChoicesInput/styles.scss +4 -4
  162. package/src/ui/f/fields/QueryCombobox/styles.scss +59 -59
  163. package/src/ui/f/fields/RatingsInput/styles.scss +8 -9
  164. package/src/ui/f/fields/SelectInput/styles.scss +6 -6
  165. package/src/ui/f/fields/TextInput/styles.scss +4 -4
  166. package/src/ui/f/fields/TextareaInput/styles.scss +7 -6
  167. package/src/ui/test/QueryLoader/QueryLoader.jsx +1 -1
  168. package/{src → tests}/__snapshots__/Storyshots.test.js.snap +687 -301
  169. package/tests/staticStub.js +1 -0
  170. package/.storybook/manager-head.html +0 -6
  171. package/.storybook/preview-head.html +0 -5
  172. package/README.md +0 -1
  173. package/build-storybook.log +0 -2978
  174. package/config/CSSStub.js +0 -1
  175. package/dist/cjs/a/AnimatedCounter/AnimatedCounter.js +0 -105
  176. package/dist/cjs/a/AnimatedCounter/index.js +0 -13
  177. package/dist/cjs/a/AnimatedCounter/styles.scss +0 -16
  178. package/dist/es/a/AnimatedCounter/AnimatedCounter.js +0 -98
  179. package/dist/es/a/AnimatedCounter/index.js +0 -2
  180. package/dist/es/a/AnimatedCounter/styles.scss +0 -16
  181. package/postcss.config.js +0 -13
  182. package/relay.config.js +0 -12
  183. package/src/assets/images/Ellipse1.png +0 -0
  184. package/src/assets/images/Ellipse2.png +0 -0
  185. package/src/assets/images/Fundraising.svg +0 -40
  186. package/src/assets/images/ParetoSupport.svg +0 -190
  187. package/src/assets/images/ParetoWorld.svg +0 -207
  188. package/src/assets/images/Vector.png +0 -0
  189. package/src/assets/images/email-attach.svg +0 -1
  190. package/src/assets/images/email-delete.svg +0 -1
  191. package/src/assets/images/favicon.png +0 -0
  192. package/src/assets/images/onboarding/focus-on-strategic-work.webp +0 -0
  193. package/src/assets/images/onboarding/launch-project.webp +0 -0
  194. package/src/assets/images/onboarding/meet-pareto-partner.webp +0 -0
  195. package/src/assets/images/quality.png +0 -0
  196. package/src/assets/images/sprite.svg +0 -253
  197. package/src/assets/images/test +0 -1
  198. package/src/local.scss +0 -16
  199. package/src/stories/a/AnimatedCounter.stories.jsx +0 -34
  200. package/src/ui/a/AnimatedCounter/AnimatedCounter.jsx +0 -118
  201. package/src/ui/a/AnimatedCounter/index.js +0 -2
  202. package/src/ui/a/AnimatedCounter/styles.scss +0 -16
  203. /package/{src → tests}/Storyshots.test.js +0 -0
  204. /package/{config → tests}/global-setup.js +0 -0
  205. /package/{config → tests}/test-setup.js +0 -0
@@ -13,22 +13,21 @@ const componentClassName = 'rating';
13
13
  /**
14
14
  * This is the component description.
15
15
  */
16
- const Rating = _ref => {
17
- let {
18
- id,
19
- className: userClassName,
20
- style,
21
- value,
22
- name,
23
- ratingId,
24
- hover,
25
- setHover,
26
- validate,
27
- activeBackgroundColor,
28
- inactiveBackgroundColor,
29
- showRatingValue
30
- // ...otherProps
31
- } = _ref;
16
+ const Rating = ({
17
+ id,
18
+ className: userClassName,
19
+ style,
20
+ value,
21
+ name,
22
+ ratingId,
23
+ hover,
24
+ setHover,
25
+ validate,
26
+ activeBackgroundColor,
27
+ inactiveBackgroundColor,
28
+ showRatingValue
29
+ // ...otherProps
30
+ }) => {
32
31
  const [field] = useField({
33
32
  name,
34
33
  validate
@@ -1,4 +1,5 @@
1
1
  /* @pareto-engineering/generator-front 1.0.12 */
2
+
2
3
  @use "@pareto-engineering/bem";
3
4
 
4
5
  $default-rating-icon-margin: .5em;
@@ -19,34 +20,32 @@ $default-transition: all .2s;
19
20
  >:not(:last-child) {
20
21
  margin-right: $default-rating-icon-margin;
21
22
  }
22
-
23
+
23
24
  .#{bem.$base}.rating {
24
25
  display: flex;
25
-
26
+
26
27
  input {
27
28
  opacity: 0;
28
29
  position: absolute;
29
30
  visibility: none;
30
31
  z-index: -1;
31
32
  }
32
-
33
+
33
34
  label {
35
+ align-items: center;
36
+ cursor: pointer;
34
37
  display: flex;
35
38
  flex-direction: column;
36
- align-items: center;
37
39
  padding: $default-padding;
38
40
  transition: $default-transition;
39
- cursor: pointer;
40
41
  }
41
42
  }
42
-
43
+
43
44
  .label-text {
44
- margin-bottom: 0;
45
45
  align-self: flex-end;
46
+ margin-bottom: 0;
46
47
  }
47
48
  }
48
49
  }
49
50
 
50
51
 
51
-
52
-
@@ -16,23 +16,22 @@ const componentClassName = 'select-input';
16
16
  /**
17
17
  * This is the component description.
18
18
  */
19
- const SelectInput = _ref => {
20
- let {
21
- id,
22
- className: userClassName,
23
- style,
24
- name,
25
- label,
26
- color,
27
- options,
28
- validate,
29
- optional,
30
- description,
31
- disabled,
32
- isLoading,
33
- autoComplete
34
- // ...otherProps
35
- } = _ref;
19
+ const SelectInput = ({
20
+ id,
21
+ className: userClassName,
22
+ style,
23
+ name,
24
+ label,
25
+ color,
26
+ options,
27
+ validate,
28
+ optional,
29
+ description,
30
+ disabled,
31
+ isLoading,
32
+ autoComplete
33
+ // ...otherProps
34
+ }) => {
36
35
  useLayoutEffect(() => {
37
36
  import("./styles.scss");
38
37
  }, []);
@@ -5,7 +5,7 @@
5
5
  @use "../../../form.scss";
6
6
 
7
7
 
8
- $default-padding: 0.75em;
8
+ $default-padding: .75em;
9
9
  $default-margin: 1em;
10
10
 
11
11
  .#{bem.$base}.select-input {
@@ -13,7 +13,7 @@ $default-margin: 1em;
13
13
  flex-direction: column;
14
14
 
15
15
  .#{bem.$base}.label {
16
- margin-bottom: $default-margin
16
+ margin-bottom: $default-margin;
17
17
  }
18
18
 
19
19
  .select-wrapper {
@@ -27,19 +27,19 @@ $default-margin: 1em;
27
27
  }
28
28
 
29
29
  >.input {
30
- width: 100%;
31
- border: var(--theme-border-style) var(--hard-y);
32
30
  background: var(--soft-y);
31
+ border: var(--theme-border-style) var(--hard-y);
33
32
  color: var(--on-y);
34
33
  padding: $default-padding;
34
+ width: 100%;
35
35
 
36
36
  &:not(:disabled):hover {
37
37
  border: var(--theme-border-style) var(--soft-background4);
38
38
  }
39
39
 
40
40
  &:disabled {
41
- background-color: var(--hard-y);
42
41
  appearance: none;
42
+ background-color: var(--hard-y);
43
43
  }
44
44
 
45
45
  &:focus {
@@ -47,4 +47,4 @@ $default-margin: 1em;
47
47
  }
48
48
  }
49
49
  }
50
- }
50
+ }
@@ -15,25 +15,24 @@ const componentClassName = 'text-input';
15
15
  /**
16
16
  * This is the component description.
17
17
  */
18
- const TextInput = _ref => {
19
- let {
20
- id,
21
- className: userClassName,
22
- style,
23
- type,
24
- name,
25
- label,
26
- color,
27
- labelColor,
28
- validate,
29
- oneInputLabel,
30
- description,
31
- disabled,
32
- placeholder,
33
- optional,
34
- autoComplete
35
- // ...otherProps
36
- } = _ref;
18
+ const TextInput = ({
19
+ id,
20
+ className: userClassName,
21
+ style,
22
+ type,
23
+ name,
24
+ label,
25
+ color,
26
+ labelColor,
27
+ validate,
28
+ oneInputLabel,
29
+ description,
30
+ disabled,
31
+ placeholder,
32
+ optional,
33
+ autoComplete
34
+ // ...otherProps
35
+ }) => {
37
36
  useLayoutEffect(() => {
38
37
  import("./styles.scss");
39
38
  }, []);
@@ -3,23 +3,23 @@
3
3
  @use "@pareto-engineering/bem";
4
4
  @use "../../../form.scss";
5
5
 
6
- $default-padding: 0.75em 0.75em 0.55em;
6
+ $default-padding: .75em .75em .55em;
7
7
 
8
8
  .#{bem.$base}.text-input {
9
9
  display: flex;
10
10
  flex-direction: column;
11
11
 
12
12
  .input {
13
- border: var(--theme-border-style) var(--hard-y);
14
13
  background: var(--soft-y);
14
+ border: var(--theme-border-style) var(--hard-y);
15
15
  color: var(--on-y);
16
16
  padding: $default-padding;
17
17
 
18
- &::placeholder{
18
+ &::placeholder {
19
19
  color: var(--metadata);
20
20
  }
21
21
 
22
- &:not(:disabled):hover{
22
+ &:not(:disabled):hover {
23
23
  border: var(--theme-border-style) var(--soft-background4);
24
24
  }
25
25
 
@@ -15,27 +15,26 @@ const componentClassName = 'text-area-input';
15
15
  /**
16
16
  * This is the component description.
17
17
  */
18
- const TextareaInput = _ref => {
19
- let {
20
- id,
21
- className: userClassName,
22
- style,
23
- name,
24
- label,
25
- validate,
26
- labelAsDescription,
27
- textAreaId,
28
- rows,
29
- optional,
30
- textAreaColor,
31
- labelColor,
32
- description,
33
- disabled,
34
- placeholder,
35
- autoComplete,
36
- resize
37
- // ...otherProps
38
- } = _ref;
18
+ const TextareaInput = ({
19
+ id,
20
+ className: userClassName,
21
+ style,
22
+ name,
23
+ label,
24
+ validate,
25
+ labelAsDescription,
26
+ textAreaId,
27
+ rows,
28
+ optional,
29
+ textAreaColor,
30
+ labelColor,
31
+ description,
32
+ disabled,
33
+ placeholder,
34
+ autoComplete,
35
+ resize
36
+ // ...otherProps
37
+ }) => {
39
38
  useLayoutEffect(() => {
40
39
  import("./styles.scss");
41
40
  }, []);
@@ -1,27 +1,28 @@
1
1
  /* @pareto-engineering/generator-front 1.0.12 */
2
+
2
3
  @use "@pareto-engineering/bem";
3
4
 
4
5
  $default-padding: .5em;
5
6
 
6
- .#{bem.$base}.text-area-input{
7
+ .#{bem.$base}.text-area-input {
7
8
  display: flex;
8
9
  flex-direction: column;
9
10
 
10
11
  .textarea {
11
- border: var(--theme-border-style) var(--hard-y);
12
12
  background: var(--soft-y);
13
+ border: var(--theme-border-style) var(--hard-y);
13
14
  color: var(--on-y);
14
15
  padding: $default-padding;
15
16
 
16
- &::placeholder{
17
+ &::placeholder {
17
18
  color: var(--metadata);
18
19
  }
19
20
 
20
- &:not(:disabled):hover{
21
+ &:not(:disabled):hover {
21
22
  border: var(--theme-border-style) var(--soft-background4);
22
23
  }
23
24
 
24
- &:disabled {
25
+ &:disabled {
25
26
  background-color: var(--hard-y);
26
27
  }
27
28
 
@@ -29,4 +30,4 @@ $default-padding: .5em;
29
30
  background: var(--soft-background4);
30
31
  }
31
32
  }
32
- }
33
+ }
@@ -11,27 +11,21 @@ import { PrivateRoute } from "../common";
11
11
  * **`SessionContextProvider` in case you're using PrivateRoutes. **
12
12
  * `SwitchRouteMap` generates a routing `Switch` from an array of route Props
13
13
  */
14
- const SwitchRouteMap = _ref => {
15
- let {
16
- routes,
17
- NotFound
18
- } = _ref;
19
- return /*#__PURE__*/React.createElement(Switch, {
20
- children: [...routes.map(_ref2 => {
21
- let {
22
- isPrivate,
23
- ...routeProps
24
- } = _ref2;
25
- return isPrivate ? /*#__PURE__*/React.createElement(PrivateRoute, _extends({
26
- key: routeProps.path
27
- }, routeProps)) : /*#__PURE__*/React.createElement(Route, _extends({
28
- key: routeProps.path
29
- }, routeProps));
30
- }), ...(NotFound ? [/*#__PURE__*/React.createElement(Route, {
31
- component: NotFound
32
- })] : [])]
33
- });
34
- };
14
+ const SwitchRouteMap = ({
15
+ routes,
16
+ NotFound
17
+ }) => /*#__PURE__*/React.createElement(Switch, {
18
+ children: [...routes.map(({
19
+ isPrivate,
20
+ ...routeProps
21
+ }) => isPrivate ? /*#__PURE__*/React.createElement(PrivateRoute, _extends({
22
+ key: routeProps.path
23
+ }, routeProps)) : /*#__PURE__*/React.createElement(Route, _extends({
24
+ key: routeProps.path
25
+ }, routeProps))), ...(NotFound ? [/*#__PURE__*/React.createElement(Route, {
26
+ component: NotFound
27
+ })] : [])]
28
+ });
35
29
  SwitchRouteMap.propTypes = {
36
30
  /**
37
31
  * The routes to render
@@ -21,13 +21,12 @@ const SessionContext = /*#__PURE__*/React.createContext({});
21
21
  * Please remember this is a front-end test, and is not equivalent to back-end permission checks.
22
22
  * This component is meant to be used alongside back-end checks.
23
23
  */
24
- const PrivateRoute = _ref => {
25
- let {
26
- component: Component,
27
- render,
28
- test,
29
- ...rest
30
- } = _ref;
24
+ const PrivateRoute = ({
25
+ component: Component,
26
+ render,
27
+ test,
28
+ ...rest
29
+ }) => {
31
30
  const {
32
31
  currentUserData: currentUser,
33
32
  loginPath
@@ -2,7 +2,7 @@ var _QueryLoaderHelloQuery;
2
2
  /* @pareto-engineering/generator-front 1.0.12 */
3
3
  import * as React from 'react';
4
4
  import { useEffect, Suspense } from 'react';
5
- import { useQueryLoader } from 'react-relay';
5
+ import { useQueryLoader, graphql } from 'react-relay';
6
6
 
7
7
  // Local Definitions
8
8
 
@@ -6,12 +6,11 @@ import { usePreloadedQuery } from 'react-relay';
6
6
  /**
7
7
  * This is the component description.
8
8
  */
9
- const PreloadedTestData = _ref => {
10
- let {
11
- query,
12
- queryReference
13
- // ...otherProps
14
- } = _ref;
9
+ const PreloadedTestData = ({
10
+ query,
11
+ queryReference
12
+ // ...otherProps
13
+ }) => {
15
14
  const data = usePreloadedQuery(query, queryReference);
16
15
  return /*#__PURE__*/React.createElement("pre", null, JSON.stringify(data, null, 2));
17
16
  };
@@ -12,16 +12,15 @@ const findCompatiblePositions = (primary, secondaryArray) => {
12
12
  }
13
13
  return [];
14
14
  };
15
- const useDynamicPosition = _ref => {
16
- let {
17
- elementRef,
18
- parentRef,
19
- preferredPrimaryOrder,
20
- preferredSecondaryOrder,
21
- // offsetYPx,
22
- offsetXPx,
23
- throttleMs = 200
24
- } = _ref;
15
+ const useDynamicPosition = ({
16
+ elementRef,
17
+ parentRef,
18
+ preferredPrimaryOrder,
19
+ preferredSecondaryOrder,
20
+ // offsetYPx,
21
+ offsetXPx,
22
+ throttleMs = 200
23
+ }) => {
25
24
  const isClient = typeof window === 'object';
26
25
  const {
27
26
  height: currentHeight,
@@ -1,7 +1,6 @@
1
1
  import { useCallback, useState, useEffect } from 'react';
2
2
  import debounce from 'lodash/debounce';
3
- const useWindowSize = function () {
4
- let debounceMs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 700;
3
+ const useWindowSize = (debounceMs = 700) => {
5
4
  const isClient = typeof window === 'object';
6
5
  const getSize = () => ({
7
6
  width: isClient ? window.innerWidth : undefined,
package/jest.config.js CHANGED
@@ -8,18 +8,18 @@ module.exports = {
8
8
  cache :false,
9
9
  // https://stackoverflow.com/questions/39418555/syntaxerror-with-jest-and-react-and-importing-css-files
10
10
  moduleNameMapper:{
11
- '^.+\\.(css|scss)$' :'<rootDir>/config/CSSStub.js',
12
- '^.+\\.(mdx)$' :'<rootDir>/config/CSSStub.js',
11
+ '^.+\\.(css|scss)$' :'<rootDir>/tests/staticStub.js',
12
+ '^.+\\.(mdx)$' :'<rootDir>/tests/staticStub.js',
13
13
  // https://jestjs.io/docs/webpack#mocking-css-modules
14
- '^@pareto-engineering/bem$':'identity-obj-proxy',
14
+ '^@pareto-engineering/bem$' :'identity-obj-proxy',
15
15
  '^@pareto-engineering/bem/exports$':'identity-obj-proxy',
16
16
  },
17
17
  transform:{
18
18
  '^.+\\.[tj]sx?$':'babel-jest',
19
19
  '^.+\\.mdx$' :'@storybook/addon-docs/jest-transform-mdx',
20
20
  },
21
- setupFiles :['<rootDir>/config/test-setup.js'],
21
+ setupFiles :['<rootDir>/tests/test-setup.js'],
22
22
  testEnvironment:'jsdom',
23
23
  // transformIgnorePatterns: [`node_modules/(?!${esModules})`],
24
- globalSetup :'<rootDir>/config/global-setup.js',
24
+ globalSetup :'<rootDir>/tests/global-setup.js',
25
25
  }
package/package.json CHANGED
@@ -1,108 +1,71 @@
1
1
  {
2
2
  "name": "@pareto-engineering/design-system",
3
- "version": "3.0.0-alpha.28",
3
+ "version": "4.0.0-alpha.3",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/es/index.js",
7
7
  "scripts": {
8
- "storybook": "start-storybook --no-manager-cache -p 6006 -s ./src/assets/images,../../node_modules/@pareto-engineering/assets/images,../../node_modules/@pareto-engineering/assets/fonts",
9
- "build-storybook": "build-storybook -s ./src/assets/images,../../node_modules/@pareto-engineering/assets/images,../../node_modules/@pareto-engineering/assets/fonts",
10
- "vercel-build": "build-storybook --quiet -o public",
11
- "copy-css:cjs": "copyfiles -u 2 src/ui/**/*.scss dist/cjs",
12
- "copy-css:es": "copyfiles -u 2 src/ui/**/*.scss dist/es",
13
- "compile:cjs": "COMPILE_ENV=cjs babel src/ui --extensions '.js,.jsx' --out-dir dist/cjs",
14
- "compile:es": "COMPILE_ENV=es babel src/ui --extensions '.js,.jsx' --out-dir dist/es",
15
- "build:cjs": "npm run compile:cjs && npm run copy-css:cjs",
16
- "build:es": "npm run compile:es && npm run copy-css:es",
17
- "compile": "npm run build:es && npm run build:cjs",
18
- "chromatic": "chromatic --project-token=b63af653a850",
19
- "prepare": "npm run compile",
20
- "prepare:watch": "nodemon --watch src --ignore 'src/stories' --exec 'npm run build:es' && echo done",
21
- "postinstall:old": "node ../../scripts/postinstall.js",
22
- "upgrade": "../../scripts/upgrade.sh",
23
8
  "test": "npm run test:stylelint && npm run test:eslint && npm run test:jest",
9
+ "storybook": "storybook dev -p 6006",
10
+ "build-storybook": "storybook build",
24
11
  "testconfig:stylelint": "stylelint src/local.scss",
25
12
  "testconfig:eslint": "eslint src/**/*.jsx",
26
13
  "test:jest": "jest",
27
14
  "test:jest:update": "jest --updateSnapshot",
28
15
  "test:eslint": "eslint --ext .jsx,.js src/",
29
- "test:stylelint": "stylelint src/**/*.scss --rd --rdd --risd --color --formatter verbose",
16
+ "test:stylelint": "stylelint 'src/**/*.scss' --rd --rdd --risd --color --formatter verbose",
30
17
  "fix:stylelint": "npm run test:stylelint -- --fix",
31
18
  "fix:eslint": "npm run test:eslint -- --fix",
32
- "link:assets": "npm link @pareto-engineering/assets",
33
- "link:bem": "npm link @pareto-engineering/bem",
34
- "link:styles": "npm link @pareto-engineering/styles",
35
- "link:all": "npm run link:bem && npm run link:styles && npm run link:assets",
36
- "relay": "relay-compiler",
37
- "fetch-schema:prod": "node ../../scripts/fetchSchema.js -- --ref production",
38
- "fetch-schema": "npm run fetch-schema:prod"
19
+ "copy-css:cjs": "copyfiles -u 2 src/ui/**/*.scss dist/cjs",
20
+ "copy-css:es": "copyfiles -u 2 src/ui/**/*.scss dist/es",
21
+ "compile:cjs": "TARGET=cjs babel src/ui --extensions '.js,.jsx' --out-dir dist/cjs",
22
+ "compile:es": "TARGET=es babel src/ui --extensions '.js,.jsx' --out-dir dist/es",
23
+ "build:cjs": "npm run compile:cjs && npm run copy-css:cjs",
24
+ "build:es": "npm run compile:es && npm run copy-css:es",
25
+ "compile": "npm run build:es && npm run build:cjs",
26
+ "prepare": "npm run compile"
39
27
  },
40
28
  "keywords": [],
41
29
  "author": "",
42
30
  "license": "ISC",
43
31
  "devDependencies": {
44
- "@babel/cli": "^7.14.5",
45
- "@babel/core": "^7.14.6",
46
- "@babel/preset-env": "^7.14.7",
47
- "@babel/preset-react": "^7.14.5",
48
- "@mdx-js/react": "^2.2.1",
49
- "@pareto-engineering/eslint-config": "^3.0.0-alpha.17",
50
- "@pareto-engineering/stylelint-config": "^3.0.0-alpha.16",
51
- "@storybook/addon-actions": "^6.3.3",
52
- "@storybook/addon-essentials": "^6.3.3",
53
- "@storybook/addon-links": "^6.3.3",
54
- "@storybook/addon-storyshots": "^6.3.3",
55
- "@storybook/builder-webpack5": "^6.5.15",
56
- "@storybook/manager-webpack5": "^6.5.15",
57
- "@storybook/mdx2-csf": "^0.0.3",
58
- "@storybook/react": "^6.3.3",
59
- "babel-jest": "^27.0.6",
60
- "babel-loader": "^8.2.2",
61
- "babel-plugin-module-resolver": "^4.1.0",
62
- "babel-plugin-relay": "^13.2.0",
63
- "chromatic": "^5.9.2",
32
+ "@babel/cli": "^7.21.0",
33
+ "@pareto-engineering/eslint-config": "*",
34
+ "@pareto-engineering/stylelint-config": "*",
35
+ "@storybook/addon-essentials": "^7.0.0-rc.3",
36
+ "@storybook/addon-interactions": "^7.0.0-rc.3",
37
+ "@storybook/addon-links": "^7.0.0-rc.3",
38
+ "@storybook/addon-storyshots": "^7.0.0-rc.3",
39
+ "@storybook/blocks": "^7.0.0-rc.3",
40
+ "@storybook/react": "^7.0.0-rc.3",
41
+ "@storybook/react-webpack5": "^7.0.0-rc.3",
42
+ "@storybook/testing-library": "^0.0.14-next.1",
43
+ "babel-plugin-relay": "^15.0.0",
64
44
  "copyfiles": "^2.4.1",
65
- "css-mqpacker": "^7.0.0",
66
- "cssnano": "^5.0.6",
67
- "faker": "^5.5.3",
68
- "graphql": "^15.8.0",
45
+ "css-loader": "^6.7.3",
69
46
  "identity-obj-proxy": "^3.0.0",
70
- "jest": "^27.0.6",
71
- "jsonlint": "^1.6.3",
72
- "nodemon": "^2.0.9",
73
- "postcss": "^8.3.5",
74
- "postcss-cli": "^8.3.1",
75
- "postcss-preset-env": "^6.7.0",
76
- "postcss-scss": "^4.0.0",
77
- "relay-compiler": "^11.0.2",
78
- "relay-config": "^11.0.2",
79
- "sass": "^1.35.1",
80
- "sass-loader": "=10.1.1",
81
- "storybook-addon-themes": "^6.1.0",
82
- "webpack": "^5.75.0"
47
+ "jest-environment-jsdom": "^29.5.0",
48
+ "sass-loader": "^13.2.0",
49
+ "storybook": "^7.0.0-rc.3",
50
+ "style-loader": "^3.3.1"
83
51
  },
84
52
  "dependencies": {
85
- "@pareto-engineering/assets": "^3.0.0-alpha.16",
86
- "@pareto-engineering/bem": "^3.0.0-alpha.16",
87
- "@pareto-engineering/styles": "^3.0.0-alpha.16",
88
- "date-fns": "^2.22.1",
89
- "downshift": "^6.1.7",
53
+ "@pareto-engineering/assets": "^4.0.0-alpha.3",
54
+ "@pareto-engineering/bem": "^4.0.0-alpha.3",
55
+ "@pareto-engineering/styles": "^4.0.0-alpha.3",
56
+ "date-fns": "^2.29.3",
57
+ "downshift": "^6.1.12",
90
58
  "formik": "^2.2.9",
91
- "hamburgers": "^1.1.3",
59
+ "hamburgers": "^1.2.1",
92
60
  "lodash": "^4.17.21",
93
- "prop-types": "^15.7.2",
94
- "react": "^17.0.2",
95
- "react-countup": "^4.4.0",
96
- "react-dom": "^17.0.2",
97
- "react-helmet": "^6.1.0",
98
- "react-relay": "^11.0.2",
99
- "react-router-dom": "^5.2.0",
100
- "react-visibility-sensor": "^5.1.1",
101
- "relay-runtime": "^11.0.2",
102
- "relay-test-utils": "^11.0.2",
103
- "style-loader": "^3.3.1",
104
- "swiper": "^6.7.5",
105
- "typed.js": "^2.0.12"
61
+ "prop-types": "^15.8.1",
62
+ "react": "^18.2.0",
63
+ "react-dom": "^18.2.0",
64
+ "react-helmet-async": "^1.3.0",
65
+ "react-relay": "^15.0.0",
66
+ "react-router-dom": "^5.3.4",
67
+ "relay-test-utils": "^15.0.0"
106
68
  },
107
- "browserslist": "> 2%, not ie > 0, not opera > 0, not op_mini > 0"
69
+ "browserslist": "> 2%",
70
+ "gitHead": "e05a71fc6d317cee44e352d38ed62b3c66440858"
108
71
  }