@pareto-engineering/design-system 2.0.0-alpha.50 → 2.0.0-alpha.53

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 (193) hide show
  1. package/dist/cjs/{c/BlogContext → a/AppContext}/Context.js +0 -0
  2. package/dist/cjs/{c/SiteFooter/common/Section/Section.js → a/AppContext/ContextProvider.js} +50 -49
  3. package/dist/cjs/{c/BlogContext → a/AppContext}/index.js +13 -5
  4. package/dist/cjs/{c/BlogContext/useBlog.js → a/AppContext/useApp.js} +0 -0
  5. package/dist/cjs/a/AppContext/useTheme.js +45 -0
  6. package/dist/cjs/a/index.js +8 -8
  7. package/dist/cjs/b/Page/common/PageHelmet/PageHelmet.js +1 -1
  8. package/dist/cjs/b/SocialMediaButton/SocialMediaButton.js +4 -4
  9. package/dist/cjs/b/ThemeSelector/ThemeSelector.js +1 -1
  10. package/dist/cjs/c/SocialMediaShareButton/SocialMediaShareButton.js +10 -4
  11. package/dist/es/{c/BlogContext → a/AppContext}/Context.js +0 -0
  12. package/dist/es/a/AppContext/ContextProvider.js +78 -0
  13. package/dist/es/a/AppContext/index.js +5 -0
  14. package/dist/es/{c/BlogContext/useBlog.js → a/AppContext/useApp.js} +0 -0
  15. package/dist/es/a/AppContext/useTheme.js +34 -0
  16. package/dist/es/a/index.js +1 -1
  17. package/dist/es/b/Page/common/PageHelmet/PageHelmet.js +2 -2
  18. package/dist/es/b/SocialMediaButton/SocialMediaButton.js +5 -5
  19. package/dist/es/b/ThemeSelector/ThemeSelector.js +2 -2
  20. package/dist/es/c/SocialMediaShareButton/SocialMediaShareButton.js +10 -4
  21. package/package.json +1 -1
  22. package/src/__snapshots__/Storyshots.test.js.snap +4 -4
  23. package/src/stories/a/{SiteContext.stories.jsx → AppContext.stories.jsx} +8 -8
  24. package/src/stories/b/SocialMediaButton.stories.jsx +6 -6
  25. package/src/stories/b/ThemeSelector.stories.jsx +5 -5
  26. package/src/stories/c/ContentSlides.stories.jsx +6 -6
  27. package/src/ui/a/{SiteContext → AppContext}/Context.js +0 -0
  28. package/src/ui/a/{SiteContext → AppContext}/ContextProvider.jsx +8 -7
  29. package/src/ui/a/AppContext/index.js +5 -0
  30. package/src/ui/a/{SiteContext/useSite.js → AppContext/useApp.js} +0 -0
  31. package/src/ui/a/{SiteContext → AppContext}/useTheme.js +0 -0
  32. package/src/ui/a/index.js +4 -4
  33. package/src/ui/b/Page/common/PageHelmet/PageHelmet.jsx +2 -2
  34. package/src/ui/b/SocialMediaButton/SocialMediaButton.jsx +4 -4
  35. package/src/ui/b/ThemeSelector/ThemeSelector.jsx +2 -2
  36. package/src/ui/c/SocialMediaShareButton/SocialMediaShareButton.jsx +11 -3
  37. package/dist/cjs/a/GradientBackground/GradientBackground.js +0 -140
  38. package/dist/cjs/a/GradientBackground/index.js +0 -15
  39. package/dist/cjs/a/GradientBackground/styles.scss +0 -191
  40. package/dist/cjs/a/Popover/common/Divider/Divider.js +0 -67
  41. package/dist/cjs/a/Popover/common/Divider/index.js +0 -15
  42. package/dist/cjs/a/Popover/common/Item/Item.js +0 -67
  43. package/dist/cjs/a/Popover/common/Item/index.js +0 -15
  44. package/dist/cjs/a/Popover/common/index.js +0 -21
  45. package/dist/cjs/c/AcceptCookies/AcceptCookies.js +0 -134
  46. package/dist/cjs/c/AcceptCookies/index.js +0 -15
  47. package/dist/cjs/c/AcceptCookies/styles.scss +0 -49
  48. package/dist/cjs/c/BlogCategoryButton/BlogCategoryButton.js +0 -95
  49. package/dist/cjs/c/BlogCategoryButton/index.js +0 -15
  50. package/dist/cjs/c/BlogContext/BlogContextProvider.js +0 -63
  51. package/dist/cjs/c/BlogContext/ContextProvider.js +0 -63
  52. package/dist/cjs/c/BlogPost/BlogPost.js +0 -147
  53. package/dist/cjs/c/BlogPost/index.js +0 -15
  54. package/dist/cjs/c/BlogPost/styles.scss +0 -33
  55. package/dist/cjs/c/BlogPostsList/BlogPostsList.js +0 -73
  56. package/dist/cjs/c/BlogPostsList/common/Card/Card.js +0 -170
  57. package/dist/cjs/c/BlogPostsList/common/Card/index.js +0 -15
  58. package/dist/cjs/c/BlogPostsList/common/index.js +0 -13
  59. package/dist/cjs/c/BlogPostsList/index.js +0 -15
  60. package/dist/cjs/c/BlogPostsList/styles.scss +0 -72
  61. package/dist/cjs/c/SiteFooter/SiteFooter.js +0 -73
  62. package/dist/cjs/c/SiteFooter/common/Section/index.js +0 -15
  63. package/dist/cjs/c/SiteFooter/common/index.js +0 -13
  64. package/dist/cjs/c/SiteFooter/index.js +0 -15
  65. package/dist/cjs/c/SiteFooter/styles.scss +0 -34
  66. package/dist/cjs/c/SiteHeaderCTA/SiteHeaderCTA.js +0 -108
  67. package/dist/cjs/c/SiteHeaderCTA/index.js +0 -15
  68. package/dist/cjs/c/SiteHeaderCTA/styles.scss +0 -44
  69. package/dist/cjs/c/SiteMission/SiteMission.js +0 -113
  70. package/dist/cjs/c/SiteMission/index.js +0 -15
  71. package/dist/cjs/c/SiteMission/styles.scss +0 -30
  72. package/dist/cjs/c/SiteNavigation/SiteNavigation.js +0 -130
  73. package/dist/cjs/c/SiteNavigation/index.js +0 -15
  74. package/dist/cjs/c/SiteNavigation/styles.scss +0 -118
  75. package/dist/cjs/c/SiteOnboardingStep/SiteOnboardingStep.js +0 -98
  76. package/dist/cjs/c/SiteOnboardingStep/index.js +0 -15
  77. package/dist/cjs/c/SiteOnboardingStep/styles.scss +0 -51
  78. package/dist/cjs/c/SitePricing/SitePricing.js +0 -108
  79. package/dist/cjs/c/SitePricing/index.js +0 -15
  80. package/dist/cjs/c/SitePricing/styles.scss +0 -73
  81. package/dist/cjs/c/SiteServices/SiteServices.js +0 -211
  82. package/dist/cjs/c/SiteServices/index.js +0 -15
  83. package/dist/cjs/c/SiteServices/styles.scss +0 -138
  84. package/dist/cjs/c/TeamGallery/TeamGallery.js +0 -80
  85. package/dist/cjs/c/TeamGallery/common/PersonCard/PersonCard.js +0 -84
  86. package/dist/cjs/c/TeamGallery/common/PersonCard/index.js +0 -15
  87. package/dist/cjs/c/TeamGallery/common/index.js +0 -13
  88. package/dist/cjs/c/TeamGallery/index.js +0 -15
  89. package/dist/cjs/c/TeamGallery/styles.scss +0 -100
  90. package/dist/cjs/c/Testimonials/Testimonials.js +0 -119
  91. package/dist/cjs/c/Testimonials/index.js +0 -15
  92. package/dist/cjs/c/Testimonials/styles.scss +0 -112
  93. package/dist/cjs/experimental/GradientBackground/GradientBackground.js +0 -98
  94. package/dist/cjs/experimental/GradientBackground/index.js +0 -15
  95. package/dist/cjs/experimental/GradientBackground/styles.scss +0 -64
  96. package/dist/cjs/experimental/index.js +0 -13
  97. package/dist/cjs/f/fields/CheckboxInput/CheckboxInput.js +0 -105
  98. package/dist/cjs/f/fields/CheckboxInput/index.js +0 -15
  99. package/dist/cjs/f/fields/CheckboxInput/styles.scss +0 -28
  100. package/dist/cjs/f/fields/QuerySelect/styles.scss +0 -21
  101. package/dist/cjs/f/fields/RadioInput/RadioInput.js +0 -110
  102. package/dist/cjs/f/fields/RadioInput/index.js +0 -15
  103. package/dist/cjs/f/fields/RadioInput/styles.scss +0 -26
  104. package/dist/cjs/f/fields/TaskRecommendation/TaskRecommendation.js +0 -129
  105. package/dist/cjs/f/fields/TaskRecommendation/index.js +0 -15
  106. package/dist/cjs/f/fields/TaskRecommendation/styles.scss +0 -37
  107. package/dist/cjs/f/fields/TaskRecommendationInput/TaskRecommendationInput.js +0 -131
  108. package/dist/cjs/f/fields/TaskRecommendationInput/index.js +0 -15
  109. package/dist/cjs/f/fields/TaskRecommendationInput/styles.scss +0 -41
  110. package/dist/cjs/f/fields/TextArea/TextArea.js +0 -141
  111. package/dist/cjs/f/fields/TextArea/index.js +0 -15
  112. package/dist/cjs/f/fields/TextArea/styles.scss +0 -19
  113. package/dist/cjs/test/QueryLoader/styles.scss +0 -9
  114. package/dist/es/a/GradientBackground/GradientBackground.js +0 -118
  115. package/dist/es/a/GradientBackground/index.js +0 -2
  116. package/dist/es/a/GradientBackground/styles.scss +0 -191
  117. package/dist/es/a/Popover/common/Divider/Divider.js +0 -47
  118. package/dist/es/a/Popover/common/Divider/index.js +0 -2
  119. package/dist/es/a/Popover/common/Item/Item.js +0 -47
  120. package/dist/es/a/Popover/common/Item/index.js +0 -2
  121. package/dist/es/a/Popover/common/index.js +0 -2
  122. package/dist/es/c/AcceptCookies/AcceptCookies.js +0 -117
  123. package/dist/es/c/AcceptCookies/index.js +0 -2
  124. package/dist/es/c/AcceptCookies/styles.scss +0 -49
  125. package/dist/es/c/BlogCategoryButton/BlogCategoryButton.js +0 -68
  126. package/dist/es/c/BlogCategoryButton/index.js +0 -2
  127. package/dist/es/c/BlogContext/BlogContextProvider.js +0 -45
  128. package/dist/es/c/BlogContext/ContextProvider.js +0 -45
  129. package/dist/es/c/BlogContext/index.js +0 -4
  130. package/dist/es/c/BlogPost/BlogPost.js +0 -128
  131. package/dist/es/c/BlogPost/index.js +0 -2
  132. package/dist/es/c/BlogPost/styles.scss +0 -33
  133. package/dist/es/c/BlogPostsList/BlogPostsList.js +0 -56
  134. package/dist/es/c/BlogPostsList/common/Card/Card.js +0 -143
  135. package/dist/es/c/BlogPostsList/common/Card/index.js +0 -2
  136. package/dist/es/c/BlogPostsList/common/index.js +0 -1
  137. package/dist/es/c/BlogPostsList/index.js +0 -2
  138. package/dist/es/c/BlogPostsList/styles.scss +0 -72
  139. package/dist/es/c/SiteFooter/SiteFooter.js +0 -56
  140. package/dist/es/c/SiteFooter/common/Section/Section.js +0 -73
  141. package/dist/es/c/SiteFooter/common/Section/index.js +0 -2
  142. package/dist/es/c/SiteFooter/common/index.js +0 -1
  143. package/dist/es/c/SiteFooter/index.js +0 -2
  144. package/dist/es/c/SiteFooter/styles.scss +0 -34
  145. package/dist/es/c/SiteHeaderCTA/SiteHeaderCTA.js +0 -92
  146. package/dist/es/c/SiteHeaderCTA/index.js +0 -2
  147. package/dist/es/c/SiteHeaderCTA/styles.scss +0 -44
  148. package/dist/es/c/SiteMission/SiteMission.js +0 -96
  149. package/dist/es/c/SiteMission/index.js +0 -2
  150. package/dist/es/c/SiteMission/styles.scss +0 -30
  151. package/dist/es/c/SiteNavigation/SiteNavigation.js +0 -111
  152. package/dist/es/c/SiteNavigation/index.js +0 -2
  153. package/dist/es/c/SiteNavigation/styles.scss +0 -118
  154. package/dist/es/c/SiteOnboardingStep/SiteOnboardingStep.js +0 -81
  155. package/dist/es/c/SiteOnboardingStep/index.js +0 -2
  156. package/dist/es/c/SiteOnboardingStep/styles.scss +0 -51
  157. package/dist/es/c/SitePricing/SitePricing.js +0 -91
  158. package/dist/es/c/SitePricing/index.js +0 -2
  159. package/dist/es/c/SitePricing/styles.scss +0 -73
  160. package/dist/es/c/SiteServices/SiteServices.js +0 -195
  161. package/dist/es/c/SiteServices/index.js +0 -2
  162. package/dist/es/c/SiteServices/styles.scss +0 -138
  163. package/dist/es/c/TeamGallery/TeamGallery.js +0 -64
  164. package/dist/es/c/TeamGallery/common/PersonCard/PersonCard.js +0 -64
  165. package/dist/es/c/TeamGallery/common/PersonCard/index.js +0 -2
  166. package/dist/es/c/TeamGallery/common/index.js +0 -1
  167. package/dist/es/c/TeamGallery/index.js +0 -2
  168. package/dist/es/c/TeamGallery/styles.scss +0 -100
  169. package/dist/es/c/Testimonials/Testimonials.js +0 -99
  170. package/dist/es/c/Testimonials/index.js +0 -2
  171. package/dist/es/c/Testimonials/styles.scss +0 -112
  172. package/dist/es/experimental/GradientBackground/GradientBackground.js +0 -76
  173. package/dist/es/experimental/GradientBackground/index.js +0 -2
  174. package/dist/es/experimental/GradientBackground/styles.scss +0 -64
  175. package/dist/es/experimental/index.js +0 -1
  176. package/dist/es/f/fields/CheckboxInput/CheckboxInput.js +0 -85
  177. package/dist/es/f/fields/CheckboxInput/index.js +0 -2
  178. package/dist/es/f/fields/CheckboxInput/styles.scss +0 -28
  179. package/dist/es/f/fields/QuerySelect/styles.scss +0 -21
  180. package/dist/es/f/fields/RadioInput/RadioInput.js +0 -90
  181. package/dist/es/f/fields/RadioInput/index.js +0 -2
  182. package/dist/es/f/fields/RadioInput/styles.scss +0 -26
  183. package/dist/es/f/fields/TaskRecommendation/TaskRecommendation.js +0 -111
  184. package/dist/es/f/fields/TaskRecommendation/index.js +0 -2
  185. package/dist/es/f/fields/TaskRecommendation/styles.scss +0 -37
  186. package/dist/es/f/fields/TaskRecommendationInput/TaskRecommendationInput.js +0 -111
  187. package/dist/es/f/fields/TaskRecommendationInput/index.js +0 -2
  188. package/dist/es/f/fields/TaskRecommendationInput/styles.scss +0 -41
  189. package/dist/es/f/fields/TextArea/TextArea.js +0 -124
  190. package/dist/es/f/fields/TextArea/index.js +0 -2
  191. package/dist/es/f/fields/TextArea/styles.scss +0 -19
  192. package/dist/es/test/QueryLoader/styles.scss +0 -9
  193. package/src/ui/a/SiteContext/index.js +0 -5
@@ -1,13 +1,13 @@
1
1
  /* @pareto-engineering/generator-front 1.0.0 */
2
2
  import * as React from 'react'
3
3
 
4
- import { SiteContextProvider } from 'ui'
4
+ import { AppContextProvider } from 'ui'
5
5
 
6
6
  export default {
7
- title :'a/SiteContext',
8
- component :SiteContextProvider,
7
+ title :'a/AppContext',
8
+ component :AppContextProvider,
9
9
  subcomponents:{
10
- // Item:SiteContext.Item
10
+ // Item:AppContext.Item
11
11
  },
12
12
  decorators:[
13
13
  // storyfn => <div className="">{ storyfn() }</div>,
@@ -18,9 +18,9 @@ export default {
18
18
  }
19
19
 
20
20
  export const Base = () => (
21
- <SiteContextProvider
21
+ <AppContextProvider
22
22
  config={{
23
- SITE:{
23
+ APP:{
24
24
  NAME :'Pareto',
25
25
  CANONICAL :'https://hellopareto.com',
26
26
  SUPPORT_EMAIL:'support@hellopareto.com',
@@ -37,6 +37,6 @@ export const Base = () => (
37
37
  }}
38
38
 
39
39
  >
40
- Sample SiteContext
41
- </SiteContextProvider>
40
+ Sample AppContext
41
+ </AppContextProvider>
42
42
  )
@@ -1,7 +1,7 @@
1
1
  /* @pareto-engineering/generator-front 1.0.12 */
2
2
  import * as React from 'react'
3
3
 
4
- import { SiteContextProvider, SocialMediaButton } from 'ui'
4
+ import { AppContextProvider, SocialMediaButton } from 'ui'
5
5
 
6
6
  export default {
7
7
  title :'b/SocialMediaButton',
@@ -18,7 +18,7 @@ export default {
18
18
  }
19
19
 
20
20
  export const Base = () => (
21
- <SiteContextProvider
21
+ <AppContextProvider
22
22
  config={{
23
23
  SITE:{
24
24
  NAME :'Pareto',
@@ -42,13 +42,13 @@ export const Base = () => (
42
42
  <SocialMediaButton type="twitter" />
43
43
  <SocialMediaButton type="instagram" />
44
44
  <SocialMediaButton type="linkedin" />
45
- </SiteContextProvider>
45
+ </AppContextProvider>
46
46
  )
47
47
 
48
48
  export const Transparent = () => (
49
- <SiteContextProvider
49
+ <AppContextProvider
50
50
  config={{
51
- SITE:{
51
+ APP:{
52
52
  NAME :'Pareto',
53
53
  CANONICAL :'https://hellopareto.com',
54
54
  SUPPORT_EMAIL:'support@hellopareto.com',
@@ -69,5 +69,5 @@ export const Transparent = () => (
69
69
  <SocialMediaButton type="twitter" isTransparent />
70
70
  <SocialMediaButton type="instagram" isTransparent />
71
71
  <SocialMediaButton type="linkedin" isTransparent />
72
- </SiteContextProvider>
72
+ </AppContextProvider>
73
73
  )
@@ -1,7 +1,7 @@
1
1
  /* @pareto-engineering/generator-front 1.0.12 */
2
2
  import * as React from 'react'
3
3
 
4
- import { useSite, SiteContextProvider, ThemeSelector } from 'ui'
4
+ import { useApp, AppContextProvider, ThemeSelector } from 'ui'
5
5
 
6
6
  export default {
7
7
  title :'b/ThemeSelector',
@@ -11,15 +11,15 @@ export default {
11
11
  },
12
12
  decorators:[
13
13
  (storyfn) => (
14
- <SiteContextProvider config={{
15
- SITE:{
14
+ <AppContextProvider config={{
15
+ APP:{
16
16
  NAME :'name of my site',
17
17
  CANONICAL:'https://mysite.com',
18
18
  },
19
19
  }}
20
20
  >
21
21
  { storyfn() }
22
- </SiteContextProvider>
22
+ </AppContextProvider>
23
23
  ),
24
24
  ],
25
25
  argTypes:{
@@ -29,7 +29,7 @@ export default {
29
29
 
30
30
  export const Base = () => {
31
31
  const ChildCo = () => {
32
- const { userTheme } = useSite()
32
+ const { userTheme } = useApp()
33
33
  return (
34
34
  <div
35
35
  className={
@@ -3,12 +3,12 @@ import * as React from 'react'
3
3
 
4
4
  import {
5
5
  ContentSlides,
6
- SiteContextProvider,
6
+ AppContextProvider,
7
7
  Shapes,
8
8
  useContentSlides,
9
9
  Title,
10
10
  Logo,
11
- useSite,
11
+ useApp,
12
12
  } from 'ui'
13
13
 
14
14
  // import Router from 'stories/utils/Router'
@@ -26,15 +26,15 @@ export default {
26
26
  decorators:[
27
27
  (storyfn) => <Router>{ storyfn() }</Router>,
28
28
  (storyfn) => (
29
- <SiteContextProvider config={{
30
- SITE:{
29
+ <AppContextProvider config={{
30
+ APP:{
31
31
  NAME :'name of my site',
32
32
  CANONICAL:'https://mysite.com',
33
33
  },
34
34
  }}
35
35
  >
36
36
  { storyfn() }
37
- </SiteContextProvider>
37
+ </AppContextProvider>
38
38
  ),
39
39
  ],
40
40
  argTypes:{
@@ -44,7 +44,7 @@ export default {
44
44
 
45
45
  export const Base = () => {
46
46
  const Main = () => {
47
- const { userTheme } = useSite()
47
+ const { userTheme } = useApp()
48
48
 
49
49
  const steps = [
50
50
  {
File without changes
@@ -24,7 +24,7 @@ const reducer = (state, action) => {
24
24
  }
25
25
  }
26
26
 
27
- const SiteContextProvider = ({
27
+ const AppContextProvider = ({
28
28
  children,
29
29
  initialTheme,
30
30
  config,
@@ -48,7 +48,7 @@ const SiteContextProvider = ({
48
48
  )
49
49
  }
50
50
 
51
- SiteContextProvider.propTypes = {
51
+ AppContextProvider.propTypes = {
52
52
  /**
53
53
  * The children JSX
54
54
  */
@@ -60,10 +60,10 @@ SiteContextProvider.propTypes = {
60
60
  initialTheme:PropTypes.string,
61
61
 
62
62
  /**
63
- * A dictionnary containing settings and preferences to be used site-wide
63
+ * A dictionnary containing settings and preferences to be used application-wide
64
64
  */
65
65
  config:PropTypes.shape({
66
- SITE:PropTypes.shape({
66
+ APP:PropTypes.shape({
67
67
  NAME :PropTypes.string.isRequired,
68
68
  CANONICAL :PropTypes.string.isRequired,
69
69
  SUPPORT_EMAIL:PropTypes.string,
@@ -74,16 +74,17 @@ SiteContextProvider.propTypes = {
74
74
  INSTAGRAM:PropTypes.string,
75
75
  YOUTUBE :PropTypes.string,
76
76
  }),
77
+ CONSTANTS:PropTypes.shape({}),
77
78
  }).isRequired,
78
79
 
79
80
  /**
80
- * Site context initial state
81
+ * Application context initial state
81
82
  */
82
83
  initialState:PropTypes.objectOf(PropTypes.string),
83
84
  }
84
85
 
85
- SiteContextProvider.defaultProps = {
86
+ AppContextProvider.defaultProps = {
86
87
  initialState:{},
87
88
  }
88
89
 
89
- export default SiteContextProvider
90
+ export default AppContextProvider
@@ -0,0 +1,5 @@
1
+ /* @pareto-engineering/generator-front 0.2.3 */
2
+ export { default as AppContext } from './Context'
3
+ export { default as AppContextProvider } from './ContextProvider'
4
+ export { default as useApp } from './useApp'
5
+ export { default as useTheme } from './useTheme'
File without changes
package/src/ui/a/index.js CHANGED
@@ -2,11 +2,11 @@ export { SVG } from './SVG'
2
2
  export { DashboardNavbar } from './DashboardNavbar'
3
3
  export { IconList } from './IconList'
4
4
  export {
5
- SiteContext,
6
- SiteContextProvider,
7
- useSite,
5
+ AppContext,
6
+ AppContextProvider,
7
+ useApp,
8
8
  useTheme,
9
- } from './SiteContext'
9
+ } from './AppContext'
10
10
  export { ProgressBar } from './ProgressBar'
11
11
  export { TeamInfo } from './TeamInfo'
12
12
  export { AnimatedCounter } from './AnimatedCounter'
@@ -3,7 +3,7 @@ import * as React from 'react'
3
3
  import { useMemo } from 'react'
4
4
  import PropTypes from 'prop-types'
5
5
  import { Helmet } from 'react-helmet'
6
- import { useSite } from 'ui/a'
6
+ import { useApp } from 'ui/a'
7
7
 
8
8
  const helmetMap = [
9
9
  {
@@ -163,7 +163,7 @@ const PageHelmet = ({
163
163
  ...props
164
164
  }) => {
165
165
  // const intl = useIntl()
166
- const context = useSite()
166
+ const context = useApp()
167
167
 
168
168
  const HelmetContent = useMemo(() => helmetMap.reduce(
169
169
  /* eslint-disable no-unused-vars -- TODO add test or ssr mode */
@@ -7,7 +7,7 @@ import PropTypes from 'prop-types'
7
7
 
8
8
  import styleNames from '@pareto-engineering/bem'
9
9
 
10
- import { useSite } from 'ui/a'
10
+ import { useApp } from 'ui/a'
11
11
 
12
12
  // Local Definitions
13
13
 
@@ -37,7 +37,7 @@ const defaultsMap = {
37
37
  /**
38
38
  * This is the component description.
39
39
  * This component takes `y` as the default color and `x` as the hover color.
40
- * This components needs to be wrapped within a `SiteContextProvider`.
40
+ * This components needs to be wrapped within a `AppContextProvider`.
41
41
  */
42
42
  const SocialMediaButton = ({
43
43
  id,
@@ -50,14 +50,14 @@ const SocialMediaButton = ({
50
50
  isTransparent,
51
51
  ...otherProps
52
52
  }) => {
53
- const siteContext = useSite()
53
+ const applicationContext = useApp()
54
54
 
55
55
  useLayoutEffect(() => {
56
56
  import('./styles.scss')
57
57
  }, [])
58
58
 
59
59
  const content = type && defaultsMap[type]
60
- const href = link || siteContext?.SOCIAL?.[content.link]
60
+ const href = link || applicationContext?.SOCIAL?.[content.link]
61
61
 
62
62
  return (
63
63
  <a href={href} target="_blank" rel="noreferrer">
@@ -4,7 +4,7 @@ import { useLayoutEffect, useCallback } from 'react'
4
4
  import PropTypes from 'prop-types'
5
5
  import styleNames from '@pareto-engineering/bem'
6
6
 
7
- import { useSite } from 'ui/a'
7
+ import { useApp } from 'ui/a'
8
8
 
9
9
  // Local Definitions
10
10
 
@@ -27,7 +27,7 @@ const ThemeSelector = ({
27
27
  const {
28
28
  userTheme,
29
29
  setPreferredTheme,
30
- } = useSite()
30
+ } = useApp()
31
31
 
32
32
  useLayoutEffect(() => {
33
33
  import('./styles.scss')
@@ -31,17 +31,25 @@ const SocialMediaShareButton = ({
31
31
 
32
32
  const isServer = typeof window === 'undefined'
33
33
 
34
- const title = isServer ? '' : document.title
35
34
  const link = isServer ? '' : window.location.href
36
35
 
36
+ // We can pass additional text to the social media share buttons such as the title.
37
+ // See commented code below for an example on how to pass text.
38
+ // It is important we encode the text with the encodeURIComponent function to pass
39
+ // special characters (such as |, &, etc.) properly through the URL.
40
+
41
+ // const title = isServer ? '' : encodeURIComponent(document.title)
42
+
37
43
  const defaultsMap = {
38
44
  facebook:{
39
45
  icon:'f',
40
- link:`https://www.facebook.com/sharer/sharer.php?u=${link}&quote=${title}`,
46
+ link:`https://www.facebook.com/sharer/sharer.php?u=${link}`,
47
+ // link: `https://www.facebook.com/sharer/sharer.php?u=${link}&quote=${title}`,
41
48
  },
42
49
  twitter:{
43
50
  icon:'t',
44
- link:`https://twitter.com/intent/tweet?text=${title}&url=${link}`,
51
+ link:`https://twitter.com/intent/tweet?url=${link}`,
52
+ // link: `https://twitter.com/intent/tweet?text=${title}&url=${link}`,
45
53
  },
46
54
  }
47
55
 
@@ -1,140 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var React = _interopRequireWildcard(require("react"));
9
-
10
- var _propTypes = _interopRequireDefault(require("prop-types"));
11
-
12
- var _bem = _interopRequireDefault(require("@pareto-engineering/bem"));
13
-
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
17
-
18
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
19
-
20
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
21
-
22
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
-
24
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
-
26
- // Local Definitions
27
- var baseClassName = _bem.default.base;
28
- var componentClassName = 'gradient-background';
29
- /**
30
- * This is the component description.
31
- */
32
-
33
- var GradientBackground = _ref => {
34
- var {
35
- id,
36
- className: userClassName,
37
- style,
38
- pin,
39
- shape,
40
- height,
41
- width // ...otherProps
42
-
43
- } = _ref;
44
- (0, React.useLayoutEffect)(() => {
45
- Promise.resolve().then(() => _interopRequireWildcard(require("./styles.scss")));
46
- }, []);
47
- return /*#__PURE__*/React.createElement("div", {
48
- id: id,
49
- className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
50
- style: _objectSpread(_objectSpread({}, style), {}, {
51
- '--pin': pin,
52
- '--height': height,
53
- '--width': width
54
- }) // {...otherProps}
55
-
56
- }, /*#__PURE__*/React.createElement("div", {
57
- className: "shapes"
58
- }, shape === 'triangle' && /*#__PURE__*/React.createElement("div", {
59
- className: "triangle"
60
- }), shape === 'half-ellipses' && /*#__PURE__*/React.createElement("div", {
61
- className: "half-ellipses"
62
- }, /*#__PURE__*/React.createElement("div", {
63
- className: "up"
64
- }), /*#__PURE__*/React.createElement("div", {
65
- className: "down"
66
- })), shape === 'ellipse' && /*#__PURE__*/React.createElement("div", {
67
- className: "ellipse"
68
- }), shape === 'diamonds' && /*#__PURE__*/React.createElement("div", {
69
- className: "diamonds"
70
- }, /*#__PURE__*/React.createElement("div", {
71
- className: "top-right"
72
- }), /*#__PURE__*/React.createElement("div", {
73
- className: "bottom-left"
74
- }), /*#__PURE__*/React.createElement("div", {
75
- className: "bottom-right"
76
- })), shape === 'rectangles' && /*#__PURE__*/React.createElement("div", {
77
- className: "rectangles"
78
- }, /*#__PURE__*/React.createElement("div", {
79
- className: "top"
80
- }), /*#__PURE__*/React.createElement("div", {
81
- className: "center"
82
- }), /*#__PURE__*/React.createElement("div", {
83
- className: "bottom"
84
- })), shape === 'half-ellipse' && /*#__PURE__*/React.createElement("div", {
85
- className: "half-ellipse"
86
- }), shape === 'circle' && /*#__PURE__*/React.createElement("div", {
87
- className: "circle"
88
- }), shape === 'half-circle' && /*#__PURE__*/React.createElement("div", {
89
- className: "half-circle"
90
- }), shape === 'ellipses' && /*#__PURE__*/React.createElement("div", {
91
- className: "ellipses"
92
- }, /*#__PURE__*/React.createElement("div", {
93
- className: "first"
94
- }), /*#__PURE__*/React.createElement("div", {
95
- className: "second"
96
- })), shape === 'spiral' && /*#__PURE__*/React.createElement("div", {
97
- className: "spiral"
98
- }, /*#__PURE__*/React.createElement("div", {
99
- className: "quater-circle-one"
100
- }), /*#__PURE__*/React.createElement("div", {
101
- className: "quater-circle-two"
102
- }), /*#__PURE__*/React.createElement("div", {
103
- className: "quater-circle-three"
104
- }), /*#__PURE__*/React.createElement("div", {
105
- className: "quater-circle-four"
106
- }))));
107
- };
108
-
109
- GradientBackground.propTypes = {
110
- /**
111
- * The HTML id for this element
112
- */
113
- id: _propTypes.default.string,
114
-
115
- /**
116
- * The HTML class names for this element
117
- */
118
- className: _propTypes.default.string,
119
-
120
- /**
121
- * The React-written, css properties for this element.
122
- */
123
- style: _propTypes.default.objectOf(_propTypes.default.string),
124
-
125
- /**
126
- * Where to pin the shapes
127
- */
128
- pin: _propTypes.default.oneOf(['flex-start', 'center', 'flex-end']),
129
-
130
- /**
131
- * The options of a shape to use
132
- */
133
- shape: _propTypes.default.oneOf(['triangle', 'ellipse', 'half-ellipse', 'half-ellipses', 'spiral', 'diamonds', 'circle', 'half-circle', 'ellipses', 'rectangles'])
134
- };
135
- GradientBackground.defaultProps = {
136
- pin: 'center',
137
- shape: 'triangle'
138
- };
139
- var _default = GradientBackground;
140
- exports.default = _default;
@@ -1,15 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "GradientBackground", {
7
- enumerable: true,
8
- get: function get() {
9
- return _GradientBackground.default;
10
- }
11
- });
12
-
13
- var _GradientBackground = _interopRequireDefault(require("./GradientBackground"));
14
-
15
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }