@uncinc/uncinc-react-kitchen-sink 2.3.3 → 2.3.5

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 (118) hide show
  1. package/dist/Context/withMapping.js +1 -6
  2. package/dist/components/AbbreviationAnnotation/index.js +47 -0
  3. package/dist/components/AbbreviationAnnotation/stories.js +23 -0
  4. package/dist/components/AbbreviationAnnotation/stories.scss +39 -0
  5. package/dist/components/AbbreviationAnnotation/style.scss +33 -0
  6. package/dist/components/Accordion/AccordionItem/index.js +0 -5
  7. package/dist/components/Accordion/AccordionItemVariant/index.js +0 -5
  8. package/dist/components/Accordion/index.js +0 -2
  9. package/dist/components/ApiAutocomplete/index.js +6 -12
  10. package/dist/components/Button/index.js +4 -10
  11. package/dist/components/Cookie/Checkbox/index.js +0 -2
  12. package/dist/components/Cookie/index.js +39 -34
  13. package/dist/components/FontSizeSwitcher/index.js +2 -8
  14. package/dist/components/Form/Checkbox/index.js +1 -4
  15. package/dist/components/Form/Checkbox/stories.js +0 -2
  16. package/dist/components/Form/Checkboxes/index.js +1 -7
  17. package/dist/components/Form/Checkboxes/index.test.js +8 -4
  18. package/dist/components/Form/Checkboxes/stories.js +1 -4
  19. package/dist/components/Form/Date/index.js +1 -4
  20. package/dist/components/Form/Date/stories.js +0 -2
  21. package/dist/components/Form/DatePicker/index.js +0 -2
  22. package/dist/components/Form/DatePicker/stories.js +0 -2
  23. package/dist/components/Form/DateSelect/index.js +110 -85
  24. package/dist/components/Form/DateSelect/stories.js +24 -15
  25. package/dist/components/Form/DateSelect/style.scss +10 -4
  26. package/dist/components/Form/Email/index.js +1 -4
  27. package/dist/components/Form/Email/stories.js +0 -2
  28. package/dist/components/Form/FormikWrapper/index.js +9 -15
  29. package/dist/components/Form/GenericFormElement/index.js +0 -2
  30. package/dist/components/Form/Number/index.js +12 -13
  31. package/dist/components/Form/Number/stories.js +0 -2
  32. package/dist/components/Form/RadioButtons/index.js +1 -7
  33. package/dist/components/Form/RadioButtons/index.test.js +8 -4
  34. package/dist/components/Form/RadioButtons/stories.js +1 -4
  35. package/dist/components/Form/SearchField/index.js +0 -2
  36. package/dist/components/Form/Select/Input/index.js +6 -14
  37. package/dist/components/Form/Select/index.js +1 -4
  38. package/dist/components/Form/Select/stories.js +0 -4
  39. package/dist/components/Form/TextField/index.js +0 -6
  40. package/dist/components/Form/TextField/index.test.js +8 -4
  41. package/dist/components/Form/TextField/stories.js +1 -4
  42. package/dist/components/Form/Textarea/index.js +0 -2
  43. package/dist/components/Form/Textarea/stories.js +0 -2
  44. package/dist/components/Hamburger/index.js +0 -2
  45. package/dist/components/Header/index.js +4 -9
  46. package/dist/components/Image/Background/index.js +1 -7
  47. package/dist/components/Image/LazyLoadWrapper/index.js +0 -12
  48. package/dist/components/Image/Picture/index.js +4 -19
  49. package/dist/components/Image/index.js +0 -4
  50. package/dist/components/InlineMenu/index.js +0 -9
  51. package/dist/components/Layout/Container/index.js +1 -4
  52. package/dist/components/Layout/Container/stories.js +0 -3
  53. package/dist/components/Layout/QuickLayout/Auto/index.js +0 -2
  54. package/dist/components/Layout/QuickLayout/Center/index.js +0 -2
  55. package/dist/components/Layout/QuickLayout/Clamp/index.js +0 -2
  56. package/dist/components/Layout/QuickLayout/Sidebar/index.js +0 -2
  57. package/dist/components/Layout/QuickLayout/SpaceBetween/index.js +0 -2
  58. package/dist/components/Layout/QuickLayout/Stack/index.js +1 -4
  59. package/dist/components/Layout/QuickLayout/Wrap/index.js +0 -2
  60. package/dist/components/Layout/QuickLayout/index.js +0 -9
  61. package/dist/components/Lottie/LottieAnimation/index.js +12 -17
  62. package/dist/components/Lottie/LottieAnimationWithMousePosition.js +8 -9
  63. package/dist/components/Lottie/index.js +3 -3
  64. package/dist/components/Lottie/stories.js +10 -5
  65. package/dist/components/MagicLine/index.js +0 -14
  66. package/dist/components/MagicLine/stories.js +0 -2
  67. package/dist/components/NavigationScroll/index.js +2 -12
  68. package/dist/components/Pagination/index.js +0 -7
  69. package/dist/components/SearchKit/Facets/ChipFacet/index.js +0 -2
  70. package/dist/components/SearchKit/Facets/HierarchicalFilterFacet/index.js +0 -2
  71. package/dist/components/SearchKit/Facets/HierarchicalMenuFacet/index.js +0 -2
  72. package/dist/components/SearchKit/Facets/SelectFacet/index.js +0 -6
  73. package/dist/components/SearchKit/Query/index.js +3 -6
  74. package/dist/components/SearchKit/SearchFacets/index.js +0 -7
  75. package/dist/components/SearchKit/SearchField/index.js +0 -9
  76. package/dist/components/SearchKit/SearchLoadMore/index.js +0 -7
  77. package/dist/components/SearchKit/SearchPage/index.js +3 -9
  78. package/dist/components/SearchKit/SearchPagination/index.js +0 -5
  79. package/dist/components/SearchKit/SearchReset/index.js +0 -2
  80. package/dist/components/SearchKit/SearchResults/index.js +9 -16
  81. package/dist/components/SearchKit/SearchSelectedFilters/index.js +0 -4
  82. package/dist/components/SearchKit/SearchSorting/index.js +2 -4
  83. package/dist/components/SearchKit/index.js +0 -3
  84. package/dist/components/SearchKit/stories.js +2 -7
  85. package/dist/components/Share/index.js +0 -3
  86. package/dist/components/Sliders/SliderRelated/index.js +1 -6
  87. package/dist/components/Sliders/SliderRelated/stories.js +1 -4
  88. package/dist/components/Webform/WebformActions/index.js +0 -2
  89. package/dist/components/Webform/WebformCheckbox/index.js +1 -8
  90. package/dist/components/Webform/WebformCheckboxes/index.js +1 -9
  91. package/dist/components/Webform/WebformContainer/index.js +5 -6
  92. package/dist/components/Webform/WebformDate/index.js +12 -18
  93. package/dist/components/Webform/WebformMapper/index.js +1 -18
  94. package/dist/components/Webform/WebformNumber/index.js +1 -4
  95. package/dist/components/Webform/WebformRadioButtons/index.js +1 -9
  96. package/dist/components/Webform/WebformSelect/index.js +1 -9
  97. package/dist/components/Webform/WebformTextField/index.js +1 -8
  98. package/dist/components/Webform/WebformTextarea/index.js +1 -8
  99. package/dist/components/Webform/WebformWizardPage/index.js +6 -8
  100. package/dist/components/Webform/index.js +1 -8
  101. package/dist/components/Webform/withStates.js +6 -19
  102. package/dist/components/WysiwygField/index.js +1 -8
  103. package/dist/components/WysiwygField/stories.js +4 -14
  104. package/dist/config/constants.js +3 -4
  105. package/dist/config/i18next/index.js +23 -0
  106. package/dist/config/i18next/locales/en.json +22 -0
  107. package/dist/config/i18next/locales/nl.json +22 -0
  108. package/dist/helpers/gtm.js +11 -15
  109. package/dist/helpers/link.js +0 -4
  110. package/dist/helpers/useValueForCurrentViewPort.js +20 -14
  111. package/dist/hooks/useOnScreen.js +2 -2
  112. package/dist/hooks/usePrevious.js +3 -2
  113. package/dist/hooks/useScrollPosition.js +0 -3
  114. package/dist/hooks/useWindowDimensions.js +0 -3
  115. package/dist/index.js +2 -1
  116. package/dist/styles/assets/_base.scss +0 -1
  117. package/package.json +14 -5
  118. package/dist/pages/api/graphql.js +0 -25
@@ -1,22 +1,17 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
2
  import React, { useContext } from 'react';
4
3
  import KitchenSinkComponentMapperContext from './KitchenSinkComponentMapperContext';
5
-
6
4
  const withMapping = BaseComponent => props => {
7
5
  const {
8
6
  componentIsWrapped
9
7
  } = props;
10
8
  const context = useContext(KitchenSinkComponentMapperContext);
11
-
12
9
  if (context && BaseComponent && !componentIsWrapped && context[BaseComponent.name]) {
13
10
  const WrapperComponent = context[BaseComponent.name];
14
11
  return /*#__PURE__*/React.createElement(WrapperComponent, _extends({}, props, {
15
12
  componentIsWrapped: true
16
13
  }), props.children);
17
14
  }
18
-
19
15
  return /*#__PURE__*/React.createElement(BaseComponent, props, props.children);
20
16
  };
21
-
22
17
  export default withMapping;
@@ -0,0 +1,47 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+ import React, { useState } from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import classnames from 'classnames';
5
+ import './style.scss';
6
+ const AbbreviationAnnotation = ({
7
+ title,
8
+ children,
9
+ abbreviationTitle,
10
+ abbreviationContent,
11
+ ...props
12
+ }) => {
13
+ const [visible, setVisible] = useState(false);
14
+ const handleClick = e => {
15
+ e.preventDefault();
16
+ setVisible(!visible);
17
+ };
18
+ const className = classnames('AbbreviationAnnotationLink', {
19
+ 'AbbreviationAnnotationLink--uncollapsed': visible
20
+ });
21
+ const classNameInfo = classnames('AbbreviationAnnotation', {
22
+ 'AbbreviationAnnotation--visible': visible
23
+ });
24
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("a", _extends({
25
+ className: className,
26
+ onClick: handleClick
27
+ }, props), /*#__PURE__*/React.createElement("div", {
28
+ className: "AbbreviationAnnotationLink__content"
29
+ }, abbreviationTitle(children))), /*#__PURE__*/React.createElement("div", {
30
+ className: classNameInfo
31
+ }, abbreviationContent(title)));
32
+ };
33
+ AbbreviationAnnotation.propTypes = {
34
+ title: PropTypes.string.isRequired,
35
+ children: PropTypes.element.isRequired,
36
+ abbreviationTitle: PropTypes.func,
37
+ abbreviationContent: PropTypes.func
38
+ };
39
+ AbbreviationAnnotation.defaultProps = {
40
+ abbreviationTitle: html => {
41
+ return /*#__PURE__*/React.createElement("div", null, html);
42
+ },
43
+ abbreviationContent: html => {
44
+ return /*#__PURE__*/React.createElement("div", null, html);
45
+ }
46
+ };
47
+ export default AbbreviationAnnotation;
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import AbbreviationAnnotation from './';
3
+ export default {
4
+ title: 'Atoms/AbbreviationAnnotation'
5
+ };
6
+ const title = 'Titel';
7
+ const content = 'Content';
8
+ import './stories.scss';
9
+ export const Default = () => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("p", null, "Lorem ipsum dolor sit amet, ", /*#__PURE__*/React.createElement("abbr", {
10
+ title: "Ut ut tellus et augue feugiat sollicitudin sit amet viverra nisi."
11
+ }, "consectetur adipiscing"), " elit. Aliquam in sodales tellus. Ut ut tellus et augue feugiat sollicitudin sit amet viverra nisi. Nulla malesuada erat non massa pellentesque, ut ultricies tellus sodales. Fusce ac feugiat ligula. In vel metus diam. Maecenas diam ex, tincidunt tempor nibh sed, suscipit semper lectus. Sed eu enim vel erat tempus mollis. Integer eget gravida orci. Nunc volutpat velit id dui semper tincidunt. Nulla maximus nisl nec volutpat faucibus. Integer vitae ullamcorper ex. Vestibulum facilisis convallis arcu, ac interdum libero malesuada eget."), /*#__PURE__*/React.createElement("p", null, "Donec feugiat, nunc vitae euismod", /*#__PURE__*/React.createElement(AbbreviationAnnotation, {
12
+ title: title,
13
+ abbreviationTitle: html => {
14
+ return /*#__PURE__*/React.createElement(React.Fragment, null, html, /*#__PURE__*/React.createElement("i", {
15
+ className: "icon icon-arrow icon-right"
16
+ }));
17
+ },
18
+ abbreviationContent: html => {
19
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("i", {
20
+ className: "icon icon-arrow icon-content"
21
+ }), /*#__PURE__*/React.createElement("div", null, html));
22
+ }
23
+ }, content), "posuere, urna nisl elementum nibh, quis ultricies libero leo sed neque. Praesent vel vestibulum sem, eget congue purus. Nunc non volutpat urna, vitae ullamcorper justo. Suspendisse in tortor ex. Phasellus euismod eget neque vitae consequat. Vestibulum sem mi, dictum id consectetur at, hendrerit in massa. Mauris quis sem condimentum, condimentum enim sed, varius sem. Curabitur convallis tempus nulla, eget consectetur quam sagittis at. Nulla a feugiat tortor. Mauris fermentum lectus ac mauris cursus ornare."), /*#__PURE__*/React.createElement("p", null, "Nam venenatis est eget lorem laoreet, id tempor urna hendrerit. Quisque suscipit in magna nec condimentum. Duis id tempor nisi. Sed rutrum urna elit, vitae placerat enim volutpat nec. Vivamus volutpat, magna sit amet commodo ultricies, enim turpis pretium libero, quis molestie nibh augue a ex. Nulla vestibulum vestibulum tellus, vel molestie libero vehicula nec. Sed maximus tortor vel ipsum cursus egestas. Proin suscipit tortor id luctus bibendum."));
@@ -0,0 +1,39 @@
1
+ @import 'assets/variables';
2
+
3
+ .AbbreviationAnnotationLink {
4
+ background-color: $color--tertiary;
5
+ font-family: var(--font--primary);
6
+ font-weight: normal;
7
+
8
+ &__content {
9
+ color: $color--white;
10
+ }
11
+
12
+ .icon-left {
13
+ margin-right: 0.5rem;
14
+ }
15
+
16
+ .icon-right {
17
+ margin-left: 0.5rem;
18
+ transform: rotate(90deg);
19
+ }
20
+
21
+ &--uncollapsed {
22
+ .icon-right {
23
+ transform: rotate(-90deg);
24
+ }
25
+ }
26
+ }
27
+
28
+ .AbbreviationAnnotation {
29
+ color: $color--white;
30
+ background-color: $color--tertiary;
31
+
32
+ .icon-content {
33
+ display: block;
34
+ font-size: 200%;
35
+ margin-top: -0.25rem;
36
+ flex: 0 0 auto;
37
+ margin-right: 1rem;
38
+ }
39
+ }
@@ -0,0 +1,33 @@
1
+ @import 'assets/variables';
2
+
3
+ .AbbreviationAnnotationLink {
4
+ display: inline-block;
5
+ padding: 0 0.5rem;
6
+ margin-right: 0.5rem;
7
+ text-decoration: none;
8
+ cursor: pointer;
9
+
10
+ :hover {
11
+ text-decoration: underline;
12
+ }
13
+
14
+ &__content {
15
+ white-space: nowrap;
16
+ display: flex;
17
+ flex: 0 0 auto;
18
+ align-items: center;
19
+ }
20
+
21
+ }
22
+
23
+ .AbbreviationAnnotation {
24
+ margin: 1rem 0;
25
+ padding: 2.4rem;
26
+ display: none;
27
+ align-items: row;
28
+
29
+ &--visible {
30
+ display: flex;
31
+ }
32
+
33
+ }
@@ -2,7 +2,6 @@ import React, { useState } from 'react';
2
2
  import c from 'classnames';
3
3
  import AnimateHeight from 'react-animate-height';
4
4
  import WysiwygField from '../../WysiwygField';
5
-
6
5
  const ContentParsed = ({
7
6
  children
8
7
  }) => {
@@ -11,10 +10,8 @@ const ContentParsed = ({
11
10
  html: children
12
11
  });
13
12
  }
14
-
15
13
  return /*#__PURE__*/React.createElement("div", null, children);
16
14
  };
17
-
18
15
  const AccordeonTitle = ({
19
16
  className,
20
17
  children
@@ -23,7 +20,6 @@ const AccordeonTitle = ({
23
20
  className: className
24
21
  }, children);
25
22
  };
26
-
27
23
  const AccordionItem = ({
28
24
  title,
29
25
  content,
@@ -55,7 +51,6 @@ const AccordionItem = ({
55
51
  className: "Accordion__item__content"
56
52
  }, /*#__PURE__*/React.createElement(ContentParsed, null, content))));
57
53
  };
58
-
59
54
  AccordionItem.defaultProps = {
60
55
  title: 'Default title',
61
56
  content: 'Default content',
@@ -1,7 +1,6 @@
1
1
  import React, { useState } from 'react';
2
2
  import AnimateHeight from 'react-animate-height';
3
3
  import c from 'classnames';
4
-
5
4
  const AccordionItemVariant = ({
6
5
  title,
7
6
  children,
@@ -14,16 +13,13 @@ const AccordionItemVariant = ({
14
13
  }) => {
15
14
  const [toggleAccordion, setToggleAccordion] = useState(false);
16
15
  const [height, setHeight] = useState(0);
17
-
18
16
  const toggle = () => {
19
17
  setToggleAccordion(!toggleAccordion);
20
18
  setHeight(height === 0 ? 'auto' : 0);
21
-
22
19
  if (onClick) {
23
20
  onClick();
24
21
  }
25
22
  };
26
-
27
23
  const AccordionItem = c('AccordionItem', className, toggleAccordion === true ? 'AccordionItem--active' : 'AccordionItem--inactive');
28
24
  return /*#__PURE__*/React.createElement("div", {
29
25
  className: AccordionItem
@@ -38,7 +34,6 @@ const AccordionItemVariant = ({
38
34
  height: height
39
35
  }, children));
40
36
  };
41
-
42
37
  AccordionItemVariant.defaultProps = {
43
38
  title: 'Default title',
44
39
  className: 'AccordionItemCustomClass',
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import c from 'classnames';
3
3
  import './style.scss';
4
-
5
4
  const Accordion = ({
6
5
  className,
7
6
  children
@@ -11,5 +10,4 @@ const Accordion = ({
11
10
  className: classes
12
11
  }, children);
13
12
  };
14
-
15
13
  export default Accordion;
@@ -1,20 +1,18 @@
1
1
  import React, { useState } from 'react';
2
2
  import Autosuggest from 'react-autosuggest';
3
3
  import './style.scss';
4
-
5
4
  function abortableFetch(request, opts) {
6
5
  const controller = new AbortController();
7
6
  const signal = controller.signal;
8
7
  return {
9
8
  abort: () => controller.abort(),
10
- ready: fetch(request, { ...opts,
9
+ ready: fetch(request, {
10
+ ...opts,
11
11
  signal
12
12
  })
13
13
  };
14
14
  }
15
-
16
15
  let currentFetch = null;
17
-
18
16
  const ApiAutocomplete = ({
19
17
  endpoint,
20
18
  placeholder,
@@ -28,14 +26,11 @@ const ApiAutocomplete = ({
28
26
  }) => {
29
27
  const [queryInput, setQuery] = useState(defaultValue || '');
30
28
  const [results, setResults] = useState([]);
31
-
32
29
  const getSuggestions = query => {
33
30
  const url = `${endpoint}?${queryParameter}=${query}`;
34
-
35
31
  if (currentFetch) {
36
32
  currentFetch.abort();
37
33
  }
38
-
39
34
  currentFetch = abortableFetch(url, requestOptions);
40
35
  currentFetch.ready.then(response => {
41
36
  return response.json();
@@ -45,10 +40,10 @@ const ApiAutocomplete = ({
45
40
  return item;
46
41
  });
47
42
  setResults(ajaxResults);
48
- }).catch(e => {// Catch the error so the browser does not output errors.
43
+ }).catch(e => {
44
+ // Catch the error so the browser does not output errors.
49
45
  });
50
46
  };
51
-
52
47
  return /*#__PURE__*/React.createElement(Autosuggest, {
53
48
  suggestions: results,
54
49
  onSuggestionsFetchRequested: ({
@@ -69,12 +64,12 @@ const ApiAutocomplete = ({
69
64
  }) => {
70
65
  onSelectItem(suggestion);
71
66
  },
72
- inputProps: { ...props,
67
+ inputProps: {
68
+ ...props,
73
69
  placeholder,
74
70
  value: queryInput,
75
71
  onBlur: event => {
76
72
  const value = event.target.value;
77
-
78
73
  if (!value || value.length === 0) {
79
74
  onSelectItem('');
80
75
  }
@@ -87,7 +82,6 @@ const ApiAutocomplete = ({
87
82
  }
88
83
  });
89
84
  };
90
-
91
85
  ApiAutocomplete.defaultProps = {
92
86
  getSuggestionValue: item => {
93
87
  return item.name;
@@ -1,5 +1,4 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
2
  import React from 'react';
4
3
  import { Link } from 'react-router-dom';
5
4
  import PropTypes from 'prop-types';
@@ -8,7 +7,6 @@ import gtm from '../../helpers/gtm';
8
7
  import { isExternalLink } from '../../helpers/link';
9
8
  import withMapping from '../../Context/withMapping';
10
9
  import './style.scss';
11
-
12
10
  const Button = ({
13
11
  href,
14
12
  dispatch,
@@ -27,19 +25,17 @@ const Button = ({
27
25
  'Button--inverted': inverted,
28
26
  'is-loading': loading
29
27
  });
30
-
31
28
  const onClick = event => {
32
- if (loading) return; // Using element.innerText gives us purely the text of the element which is
33
- // perfect for the tracking event. We don't want a string containing HTML.
29
+ if (loading) return;
34
30
 
31
+ // Using element.innerText gives us purely the text of the element which is
32
+ // perfect for the tracking event. We don't want a string containing HTML.
35
33
  const text = event.target ? event.target.innerText : 'Unknown';
36
34
  gtm.trackUserEvent('button', 'click', text, href);
37
-
38
35
  if (props.onClick) {
39
36
  props.onClick(event);
40
37
  }
41
38
  };
42
-
43
39
  if (!href) {
44
40
  return /*#__PURE__*/React.createElement("button", _extends({
45
41
  type: htmlType,
@@ -49,7 +45,6 @@ const Button = ({
49
45
  onClick: onClick
50
46
  }), children);
51
47
  }
52
-
53
48
  return isExternalLink(href) ? /*#__PURE__*/React.createElement("a", _extends({
54
49
  className: classes,
55
50
  href: href,
@@ -64,7 +59,6 @@ const Button = ({
64
59
  onClick: onClick
65
60
  }), children);
66
61
  };
67
-
68
62
  Button.defaultProps = {
69
63
  primary: true,
70
64
  inverted: false,
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import './style.scss';
3
-
4
3
  const CheckboxAndRadio = ({
5
4
  name,
6
5
  id,
@@ -27,5 +26,4 @@ const CheckboxAndRadio = ({
27
26
  className: "icon-before icon-checkmark"
28
27
  }, label));
29
28
  };
30
-
31
29
  export default CheckboxAndRadio;
@@ -7,7 +7,6 @@ import Button from '../Button';
7
7
  import Container from '../Layout/Container';
8
8
  import Checkbox from './Checkbox';
9
9
  import './style.scss';
10
-
11
10
  const CookieCompliancePopup = props => {
12
11
  const {
13
12
  className,
@@ -24,18 +23,22 @@ const CookieCompliancePopup = props => {
24
23
  defaultValues,
25
24
  manualHeader,
26
25
  manualButtonClassname
27
- } = props; // This is an internal state to check whether we should show the options.
26
+ } = props;
27
+
28
+ // This is an internal state to check whether we should show the options.
29
+ const [manualChoiceVisible, setManualChoiceVisible] = useState(false);
28
30
 
29
- const [manualChoiceVisible, setManualChoiceVisible] = useState(false); // This is an extra hidden variable to internally check if we should show the notification.
31
+ // This is an extra hidden variable to internally check if we should show the notification.
30
32
  // This also allows us to add an animation when the user accepts.
33
+ const [hiddenInternal, setHiddenInternal] = useState(false);
31
34
 
32
- const [hiddenInternal, setHiddenInternal] = useState(false); // Cookie stating if the cookie has already been accepted. Uses the following states:
35
+ // Cookie stating if the cookie has already been accepted. Uses the following states:
33
36
  // 0: Declined (Not yet used).
34
37
  // 1: Not yet agreed/disagreed (Not yet used).
35
38
  // 2: Accepted.
39
+ const [didConsent, setDidConsent] = useCookie('cookie-agreed', null);
36
40
 
37
- const [didConsent, setDidConsent] = useCookie('cookie-agreed', null); // Cookie stating whether we should render the notification.
38
-
41
+ // Cookie stating whether we should render the notification.
39
42
  const [hidden, setHidden] = useState(didConsent !== null);
40
43
  const categories = cookieLevels.map(item => {
41
44
  return item.value;
@@ -43,32 +46,35 @@ const CookieCompliancePopup = props => {
43
46
  const defaultState = categories.reduce((prev, category) => {
44
47
  prev[category] = typeof defaultValues[category] !== undefined ? defaultValues[category] : true;
45
48
  return prev;
46
- }, {}); // Default choices for select, this way we can locally manage the state of the form.
49
+ }, {});
47
50
 
51
+ // Default choices for select, this way we can locally manage the state of the form.
48
52
  const [choicesSelected, setChoicesSelected] = useState(defaultState);
49
53
  useEffect(() => {
50
54
  if (hidden) {
51
55
  setHiddenInternal(true);
52
- } // We don't want to add hidden to the dependency list, as this would -
56
+ }
57
+ // We don't want to add hidden to the dependency list, as this would -
53
58
  // unrender the notification immediately on save.
54
59
  // eslint-disable-next-line react-hooks/exhaustive-deps
60
+ }, []);
55
61
 
56
- }, []); // Check if didConsent has been changed.
62
+ // Check if didConsent has been changed.
57
63
  // If so, set the hidden cookie for page reloads.
58
-
59
64
  useEffect(() => {
60
65
  if (didConsent !== null) {
61
66
  setHidden(true);
62
67
  }
63
- }, [didConsent, cookieOptions, setHidden]); // This function expands the notification to show the options.
68
+ }, [didConsent, cookieOptions, setHidden]);
64
69
 
70
+ // This function expands the notification to show the options.
65
71
  const displayConsentChoices = e => {
66
72
  e.preventDefault();
67
73
  setManualChoiceVisible(true);
68
- }; // This function sets cookie-agreed to 2 ( accepted state ),
69
- // and also sets the accepted categories in CookieAgreedCategories.
70
-
74
+ };
71
75
 
76
+ // This function sets cookie-agreed to 2 ( accepted state ),
77
+ // and also sets the accepted categories in CookieAgreedCategories.
72
78
  const _onAgree = choices => {
73
79
  const selectedChoices = Object.keys(choices).filter(key => {
74
80
  return choices[key];
@@ -81,15 +87,17 @@ const CookieCompliancePopup = props => {
81
87
  });
82
88
  }
83
89
  });
84
- setDidConsent('2', cookieOptions); // I used js-cookie for this insead of react-use-cookie because the encoding is not what we want
90
+ setDidConsent('2', cookieOptions);
91
+
92
+ // I used js-cookie for this insead of react-use-cookie because the encoding is not what we want
85
93
  // for arrays in react-use-cookie. This shouldn't be an issue, as we don't want to keep track of
86
94
  // CookieAgreedCategories, as we have that in state already.
87
-
88
95
  Cookies.set('cookie-agreed-categories', JSON.stringify(selectedChoices), {
89
96
  expires: 365,
90
97
  domain: cookieDomain
91
- }); // Set cookie for current domain, so it does not appear twice.
98
+ });
92
99
 
100
+ // Set cookie for current domain, so it does not appear twice.
93
101
  const timestamp = Math.round(new Date().getTime() / 1000);
94
102
  const value = {
95
103
  ver: 1,
@@ -105,7 +113,6 @@ const CookieCompliancePopup = props => {
105
113
  });
106
114
  onAgree(choices);
107
115
  };
108
-
109
116
  const _onDisagree = () => {
110
117
  setDidConsent('0', cookieOptions);
111
118
  Cookies.set('cookie-agreed-categories', JSON.stringify([]), {
@@ -123,20 +130,19 @@ const CookieCompliancePopup = props => {
123
130
  domain: cookieDomain
124
131
  });
125
132
  onDisagree();
126
- }; // Function for accepting al categories at once.
127
-
133
+ };
128
134
 
135
+ // Function for accepting al categories at once.
129
136
  const onConsentAll = () => {
130
137
  const allCategoriesSelected = categories.reduce((prev, category) => {
131
138
  prev[category] = true;
132
139
  return prev;
133
140
  }, {});
134
-
135
141
  _onAgree(allCategoriesSelected);
136
- }; // This function is fired when the accept button is pressed.
137
- // Also has eventual support for a false case.
138
-
142
+ };
139
143
 
144
+ // This function is fired when the accept button is pressed.
145
+ // Also has eventual support for a false case.
140
146
  const onConsent = value => {
141
147
  return () => {
142
148
  if (value === true) {
@@ -145,29 +151,30 @@ const CookieCompliancePopup = props => {
145
151
  _onDisagree();
146
152
  }
147
153
  };
148
- }; // This function sets the value of the checkmark in the form state.
149
-
154
+ };
150
155
 
156
+ // This function sets the value of the checkmark in the form state.
151
157
  const handleChoiceState = event => {
152
158
  const {
153
159
  value,
154
160
  checked
155
161
  } = event.target;
156
- setChoicesSelected({ ...choicesSelected,
162
+ setChoicesSelected({
163
+ ...choicesSelected,
157
164
  [value]: checked
158
165
  });
159
166
  };
160
-
161
167
  const classes = classNames('Cookie', className, {
162
168
  'Cookie--hidden': didConsent !== null
163
- }); // If hiddenInternal is true, we do not render the notification.
169
+ });
164
170
 
171
+ // If hiddenInternal is true, we do not render the notification.
165
172
  if (hiddenInternal === true) {
166
173
  return null;
167
- } // This function renders the different options of checkboxes,
168
- // allowing us to add more checkboxes eventually.
169
-
174
+ }
170
175
 
176
+ // This function renders the different options of checkboxes,
177
+ // allowing us to add more checkboxes eventually.
171
178
  const renderChoices = () => {
172
179
  return cookieLevels.map(choice => {
173
180
  return /*#__PURE__*/React.createElement("div", {
@@ -189,7 +196,6 @@ const CookieCompliancePopup = props => {
189
196
  }, choice.description));
190
197
  });
191
198
  };
192
-
193
199
  return /*#__PURE__*/React.createElement("div", {
194
200
  className: classes
195
201
  }, /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement("div", {
@@ -226,7 +232,6 @@ const CookieCompliancePopup = props => {
226
232
  onClick: onConsent(true)
227
233
  }, agreeText))))));
228
234
  };
229
-
230
235
  export default CookieCompliancePopup;
231
236
  CookieCompliancePopup.defaultProps = {
232
237
  agreeText: 'Accepteren',
@@ -1,7 +1,6 @@
1
1
  import React, { useEffect, useState } from 'react';
2
2
  import classnames from 'classnames';
3
3
  import './style.scss';
4
-
5
4
  const FontSizeSwitcher = ({
6
5
  defaultSize,
7
6
  incrementMode = false
@@ -9,12 +8,11 @@ const FontSizeSwitcher = ({
9
8
  const getCookie = n => {
10
9
  let a = `; ${document.cookie}`.match(`;\\s*${n}=([^;]+)`);
11
10
  return a ? a[1] : '';
12
- }; // Use cookie by default to prevent flickering.
13
-
11
+ };
14
12
 
13
+ // Use cookie by default to prevent flickering.
15
14
  const cookie = getCookie('WCAG_font_size');
16
15
  const [currentSize, setCurrentSize] = useState(cookie ? parseInt(cookie) : defaultSize);
17
-
18
16
  const changeCurrentSize = size => {
19
17
  if (incrementMode === true && size >= 3) {
20
18
  document.cookie = `WCAG_font_size=${0}`;
@@ -24,7 +22,6 @@ const FontSizeSwitcher = ({
24
22
  setCurrentSize(parseInt(size));
25
23
  }
26
24
  };
27
-
28
25
  useEffect(() => {
29
26
  var html = document.getElementsByTagName('html')[0];
30
27
  html.classList.remove('font-size--small', 'font-size--regular', 'font-size--large');
@@ -39,7 +36,6 @@ const FontSizeSwitcher = ({
39
36
  const classesLarge = classnames("FontSizeSwitcher__button FontSizeSwitcher__button--large", {
40
37
  'active': currentSize === 2
41
38
  });
42
-
43
39
  if (incrementMode === true) {
44
40
  return /*#__PURE__*/React.createElement("div", {
45
41
  className: "FontSizeSwitcher FontSizeSwitcher--increment-mode",
@@ -54,7 +50,6 @@ const FontSizeSwitcher = ({
54
50
  className: classesLarge
55
51
  }, "Large"));
56
52
  }
57
-
58
53
  return /*#__PURE__*/React.createElement("div", {
59
54
  className: "FontSizeSwitcher"
60
55
  }, /*#__PURE__*/React.createElement("button", {
@@ -68,7 +63,6 @@ const FontSizeSwitcher = ({
68
63
  onClick: () => changeCurrentSize(2)
69
64
  }, "Large"));
70
65
  };
71
-
72
66
  FontSizeSwitcher.defaultProps = {
73
67
  defaultSize: 1
74
68
  };
@@ -1,12 +1,10 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
2
  import React from 'react';
4
3
  import { Field } from 'formik';
5
4
  import c from 'classnames';
6
5
  import GenericFormElement from '../GenericFormElement';
7
6
  import withMapping from '../../../Context/withMapping';
8
7
  import './style.scss';
9
-
10
8
  const Checkbox = props => {
11
9
  const {
12
10
  title,
@@ -63,7 +61,6 @@ const Checkbox = props => {
63
61
  })), title);
64
62
  }));
65
63
  };
66
-
67
64
  Checkbox.defaultProps = {
68
65
  onChange: () => {}
69
66
  };
@@ -16,11 +16,9 @@ export const Checkbox = () => {
16
16
  fieldName: "agreed_with_statement",
17
17
  validation: value => {
18
18
  let error;
19
-
20
19
  if (!value) {
21
20
  error = 'This field is required';
22
21
  }
23
-
24
22
  return error;
25
23
  },
26
24
  onChange: e => {