@uncinc/uncinc-react-kitchen-sink 2.1.11 → 2.2.0

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.
@@ -0,0 +1,31 @@
1
+ import React from 'react';
2
+ import './style.scss';
3
+
4
+ const CheckboxAndRadio = ({
5
+ name,
6
+ id,
7
+ value,
8
+ label,
9
+ checked,
10
+ onChange,
11
+ disabled,
12
+ type
13
+ }) => {
14
+ return /*#__PURE__*/React.createElement("div", {
15
+ className: "Checkbox"
16
+ }, /*#__PURE__*/React.createElement("input", {
17
+ type: type || "checkbox",
18
+ className: "Checkbox__input",
19
+ name: name,
20
+ id: id,
21
+ value: value,
22
+ checked: checked,
23
+ onChange: onChange,
24
+ disabled: disabled
25
+ }), /*#__PURE__*/React.createElement("label", {
26
+ htmlFor: id,
27
+ className: "icon-before icon-checkmark"
28
+ }, label));
29
+ };
30
+
31
+ export default CheckboxAndRadio;
@@ -0,0 +1,36 @@
1
+ @import 'assets/variables';
2
+ @import 'assets/mixins';
3
+
4
+ // Radio's and checkboxes
5
+ input[type='checkbox'],
6
+ input[type='radio'] {
7
+ position: absolute;
8
+ opacity: 0;
9
+
10
+ // Unchecked
11
+ ~ label:not(.no-styling) {
12
+ position: relative;
13
+ display: inline-block;
14
+ margin-bottom: 0;
15
+ font-weight: bold;
16
+ color: black;
17
+ user-select: none;
18
+ cursor: pointer;
19
+
20
+ display: flex;
21
+ align-items: center;
22
+
23
+ &:before {
24
+ margin-right: 1rem;
25
+ font-size: 1.8rem;
26
+ }
27
+ }
28
+
29
+ // Checked
30
+ &:checked ~ label:not(.no-styling) {
31
+ &:before {
32
+
33
+ background-position-y: -1em;
34
+ }
35
+ }
36
+ }
@@ -0,0 +1,211 @@
1
+ import React, { useEffect, useState } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import useCookie from 'react-use-cookie';
4
+ import Cookies from 'js-cookie';
5
+ import classNames from 'classnames';
6
+ import Button from '../Button';
7
+ import Container from '../Layout/Container';
8
+ import Checkbox from './Checkbox';
9
+ import './style.scss';
10
+
11
+ const CookieCompliancePopup = props => {
12
+ const {
13
+ className,
14
+ cookieLevels,
15
+ children,
16
+ manualText,
17
+ agreeText,
18
+ onDisagree,
19
+ cookieOptions,
20
+ cookieDomain
21
+ } = props; // This is an internal state to check whether we should show the options.
22
+
23
+ const [manualChoiceVisible, setManualChoiceVisible] = useState(false); // This is an extra hidden variable to internally check if we should show the notification.
24
+ // This also allows us to add an animation when the user accepts.
25
+
26
+ const [hiddenInternal, setHiddenInternal] = useState(false); // Cookie stating if the cookie has already been accepted. Uses the following states:
27
+ // 0: Declined (Not yet used).
28
+ // 1: Not yet agreed/disagreed (Not yet used).
29
+ // 2: Accepted.
30
+
31
+ const [didConsent, setDidConsent] = useCookie('cookie-agreed', null); // Cookie stating whether we should render the notification.
32
+
33
+ const [hidden, setHidden] = useState(didConsent !== null); // Default choices for select, this way we can locally manage the state of the form.
34
+
35
+ const [choicesSelected, setChoicesSelected] = useState({
36
+ necessary: true,
37
+ voorkeuren: true,
38
+ statistieken: true,
39
+ marketing: true
40
+ });
41
+ useEffect(() => {
42
+ if (hidden) {
43
+ setHiddenInternal(true);
44
+ } // We don't want to add hidden to the dependency list, as this would -
45
+ // unrender the notification immediately on save.
46
+ // eslint-disable-next-line react-hooks/exhaustive-deps
47
+
48
+ }, []); // Check if didConsent has been changed.
49
+ // If so, set the hidden cookie for page reloads.
50
+
51
+ useEffect(() => {
52
+ if (didConsent !== null) {
53
+ setHidden(true);
54
+ }
55
+ }, [didConsent, cookieOptions, setHidden]); // This function expands the notification to show the options.
56
+
57
+ const displayConsentChoices = e => {
58
+ e.preventDefault();
59
+ setManualChoiceVisible(true);
60
+ }; // This function sets cookie-agreed to 2 ( accepted state ),
61
+ // and also sets the accepted categories in CookieAgreedCategories.
62
+
63
+
64
+ const onAgree = choices => {
65
+ const selectedChoices = Object.keys(choices).filter(key => {
66
+ return choices[key];
67
+ });
68
+ Object.keys(choices).forEach(key => {
69
+ if (choicesSelected[key]) {
70
+ window.dataLayer = window.dataLayer || [];
71
+ window.dataLayer.push({
72
+ event: `cookies-accepted-${key}`
73
+ });
74
+ }
75
+ });
76
+ setDidConsent('2', cookieOptions); // I used js-cookie for this insead of react-use-cookie because the encoding is not what we want
77
+ // for arrays in react-use-cookie. This shouldn't be an issue, as we don't want to keep track of
78
+ // CookieAgreedCategories, as we have that in state already.
79
+
80
+ Cookies.set('cookie-agreed-categories', JSON.stringify(selectedChoices), {
81
+ expires: 365,
82
+ domain: cookieDomain
83
+ }); // Set cookie for current domain, so it does not appear twice.
84
+
85
+ const timestamp = Math.round(new Date().getTime() / 1000);
86
+ const value = {
87
+ necessary: true,
88
+ preferences: true,
89
+ statistics: true,
90
+ marketing: true,
91
+ ver: 1,
92
+ utc: timestamp,
93
+ region: 'nl'
94
+ };
95
+ Cookies.set('cookie-consent', value, {
96
+ expires: 365,
97
+ domain: cookieDomain
98
+ });
99
+ }; // This function is fired when the accept button is pressed.
100
+ // Also has eventual support for a false case.
101
+
102
+
103
+ const onConsent = value => {
104
+ return () => {
105
+ if (value === true) {
106
+ onAgree(choicesSelected);
107
+ } else {
108
+ onDisagree();
109
+ }
110
+ };
111
+ }; // This function sets the value of the checkmark in the form state.
112
+
113
+
114
+ const handleChoiceState = event => {
115
+ const {
116
+ value,
117
+ checked
118
+ } = event.target;
119
+ setChoicesSelected({ ...choicesSelected,
120
+ [value]: checked
121
+ });
122
+ };
123
+
124
+ const classes = classNames('Cookie', className, {
125
+ 'Cookie--hidden': didConsent !== null
126
+ }); // If hiddenInternal is true, we do not render the notification.
127
+
128
+ if (hiddenInternal === true) {
129
+ return null;
130
+ } // This function renders the different options of checkboxes,
131
+ // allowing us to add more checkboxes eventually.
132
+
133
+
134
+ const renderChoices = () => {
135
+ return cookieLevels.map(choice => {
136
+ return /*#__PURE__*/React.createElement("div", {
137
+ className: "Cookie__category col-xs-12 col-lg-6",
138
+ key: choice.value
139
+ }, /*#__PURE__*/React.createElement("div", {
140
+ className: "Checkbox"
141
+ }, /*#__PURE__*/React.createElement(Checkbox, {
142
+ name: "cookie-categories",
143
+ type: "checkbox",
144
+ id: `cookie-category-${choice.value}`,
145
+ onChange: handleChoiceState,
146
+ label: choice.label,
147
+ value: choice.value,
148
+ checked: choicesSelected[choice.value],
149
+ disabled: choice.disabled
150
+ })), /*#__PURE__*/React.createElement("div", {
151
+ className: "Cookie__category__description"
152
+ }, choice.description));
153
+ });
154
+ };
155
+
156
+ return /*#__PURE__*/React.createElement("div", {
157
+ className: classes
158
+ }, /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement("div", {
159
+ className: `Cookie__content ${manualChoiceVisible ? 'Cookie__content--full-height' : ''}`
160
+ }, !manualChoiceVisible ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
161
+ className: "row"
162
+ }, /*#__PURE__*/React.createElement("div", {
163
+ className: "col-12 Cookie__content__message"
164
+ }, children), /*#__PURE__*/React.createElement("div", {
165
+ className: "col-12 Cookie__content__buttons"
166
+ }, /*#__PURE__*/React.createElement(Button, {
167
+ id: "complete-agree",
168
+ className: "Button--cta",
169
+ primary: true,
170
+ onClick: onConsent(true)
171
+ }, agreeText), /*#__PURE__*/React.createElement("a", {
172
+ className: "Cookie__content__buttons__manual-agree icon-after icon-chevron-right icon-variant-2",
173
+ onClick: e => {
174
+ displayConsentChoices(e);
175
+ }
176
+ }, manualText)))) : /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
177
+ className: "Cookie__content__message"
178
+ }, /*#__PURE__*/React.createElement("div", {
179
+ className: "Cookie__checkboxes-container row"
180
+ }, renderChoices())), /*#__PURE__*/React.createElement("div", {
181
+ className: "Cookie__content__buttons"
182
+ }, /*#__PURE__*/React.createElement(Button, {
183
+ className: "Button--cta",
184
+ onClick: onConsent(true)
185
+ }, agreeText))))));
186
+ };
187
+
188
+ export default CookieCompliancePopup;
189
+ CookieCompliancePopup.defaultProps = {
190
+ agreeText: 'Accepteren',
191
+ manualText: 'Zelf instellen',
192
+ onDisagree: () => {},
193
+ cookieLevels: [],
194
+ cookieDomain: null,
195
+ cookieOptions: {
196
+ days: 365,
197
+ path: '/'
198
+ }
199
+ };
200
+ CookieCompliancePopup.propTypes = {
201
+ agreeText: PropTypes.string,
202
+ manualText: PropTypes.string,
203
+ onDisagree: PropTypes.func,
204
+ // eslint-disable-next-line react/forbid-prop-types
205
+ cookieLevels: PropTypes.arrayOf(PropTypes.shape({
206
+ value: PropTypes.string,
207
+ label: PropTypes.string,
208
+ description: PropTypes.string,
209
+ disabled: PropTypes.bool
210
+ }))
211
+ };
@@ -0,0 +1,32 @@
1
+ import React from 'react';
2
+ import Cookie from './';
3
+ import './stories.scss';
4
+ export default {
5
+ title: 'Organisms/Cookie'
6
+ };
7
+ export const Default = () => /*#__PURE__*/React.createElement(Cookie, {
8
+ agreeText: 'Accepteren',
9
+ manualText: 'Zelf instellen',
10
+ onDisagree: () => {},
11
+ cookieLevels: [{
12
+ value: "necessary",
13
+ label: "Noodzakelijk",
14
+ description: "Noodzakelijke cookies helpen een website bruikbaarder te maken, door basisfuncties als paginanavigatie en toegang tot beveiligde gedeelten van de website mogelijk te maken. Zonder deze cookies kan de website niet naar behoren werken.",
15
+ disabled: true
16
+ }, {
17
+ value: "voorkeuren",
18
+ label: "Voorkeuren",
19
+ description: "Voorkeurscookies zorgen ervoor dat een website informatie kan onthouden die van invloed is op het gedrag en de vormgeving van de website, zoals de taal van uw voorkeur of de regio waar u woont.",
20
+ disabled: false
21
+ }, {
22
+ value: "statistieken",
23
+ label: "Statistieken",
24
+ description: "Statistische cookies helpen eigenaren van websites begrijpen hoe bezoekers hun website gebruiken, door anoniem gegevens te verzamelen en te rapporteren.",
25
+ disabled: false
26
+ }, {
27
+ value: "marketing",
28
+ label: "Marketing",
29
+ description: "Marketingcookies worden gebruikt om bezoekers te volgen wanneer ze verschillende websites bezoeken. Hun doel is advertenties weergeven die zijn toegesneden op en relevant zijn voor de individuele gebruiker. Deze advertenties worden zo waardevoller voor uitgevers en externe adverteerders.",
30
+ disabled: false
31
+ }]
32
+ }, /*#__PURE__*/React.createElement("h1", null, "Wij gebruiken cookies"), /*#__PURE__*/React.createElement("p", null, "Aliquam accumsan sem lacus, ut laoreet urna aliquam quis. Ut ut imperdiet tortor, sed vestibulum felis. Etiam a eleifend leo, eu interdum nulla. Etiam id elit ex. Etiam condimentum facilisis venenatis. Curabitur accumsan ut dui vel laoreet. Donec dapibus convallis diam, at sodales nulla laoreet ac. Nunc maximus, orci ac tristique dapibus, dolor felis semper lorem, eu dapibus turpis enim quis urna."));
@@ -0,0 +1,71 @@
1
+ @import 'assets/variables';
2
+ @import 'assets/mixins';
3
+
4
+
5
+ @keyframes fade-out-and-transform {
6
+ 0% {
7
+ transform: translateX(-50%) translateY(0px);
8
+ }
9
+
10
+ 25% {
11
+ opacity: 1;
12
+ }
13
+
14
+ 75% {
15
+ opacity: 0;
16
+ }
17
+
18
+ 100% {
19
+ transform: translateX(-50%) translateY(110%);
20
+ opacity: 0;
21
+ }
22
+ }
23
+
24
+ .Cookie {
25
+ bottom: 1rem;
26
+
27
+ @media #{$tablet} {
28
+ bottom: 3rem;
29
+ }
30
+
31
+ &--hidden {
32
+ animation-name: fade-out-and-transform;
33
+ animation-duration: .6s;
34
+ animation-timing-function: cubic-bezier(0.32, 0, 0.67, 0);
35
+ animation-fill-mode: forwards;
36
+ }
37
+
38
+ &__content {
39
+ background: #F4F4F4;
40
+ padding: 2rem;
41
+ border-radius: 10px;
42
+ margin-bottom: 10px;
43
+ width: 100%;
44
+ box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2);
45
+
46
+ @media #{$tablet-down} {
47
+ width: auto;
48
+ }
49
+
50
+ @media #{$tablet} {
51
+ padding: 4rem;
52
+ }
53
+
54
+ &__full-height {
55
+ overflow-y: scroll;
56
+
57
+ @media #{$mobile-down} {
58
+ position: fixed;
59
+ top: 2rem;
60
+ bottom: 2rem;
61
+ right: 2rem;
62
+ left: 2rem;
63
+ }
64
+
65
+ @media #{$normal} {
66
+ height: auto;
67
+ overflow-y: unset;
68
+ }
69
+ }
70
+ }
71
+ }
@@ -0,0 +1,55 @@
1
+ @import 'assets/variables';
2
+ @import 'assets/mixins';
3
+
4
+ .Cookie {
5
+ width: 100%;
6
+ position: fixed;
7
+ left: 50%;
8
+ max-height: 100%;
9
+ bottom: 0;
10
+ transform: translateX(-50%);
11
+ z-index: 10000;
12
+
13
+ &--hidden {
14
+ &__content__full-height {
15
+ position: inherit;
16
+ top: inherit;
17
+ bottom: inherit;
18
+ right: inherit;
19
+ left: inherit;
20
+ }
21
+ }
22
+
23
+ &__content {
24
+ max-height: 100vh;
25
+ overflow-y: auto;
26
+
27
+ &__full-height {
28
+ overflow-y: scroll;
29
+
30
+ @media #{$normal} {
31
+ height: auto;
32
+ overflow-y: unset;
33
+ }
34
+ }
35
+
36
+ &__buttons {
37
+ display: flex;
38
+ align-items: center;
39
+ flex-direction: column;
40
+
41
+ @media #{$tablet} {
42
+ flex-direction: row;
43
+ }
44
+
45
+ .Button {
46
+ margin-right: 1rem;
47
+ }
48
+ }
49
+ }
50
+
51
+ &__category {
52
+ display: inline-block;
53
+ margin-bottom: 2rem;
54
+ }
55
+ }
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { useRef } from 'react';
2
2
  import Lottie from './';
3
3
  import LottieAnimationWithMousePosition from './LottieAnimationWithMousePosition';
4
4
  import exampleLottie from '../../assets/lottie/example.json';
@@ -10,7 +10,8 @@ export default {
10
10
  export const DefaultAnimation = () => /*#__PURE__*/React.createElement(Lottie, {
11
11
  id: "example",
12
12
  data: exampleLottie,
13
- onInit: lottie => console.log(lottie)
13
+ onInit: lottie => console.log(lottie),
14
+ autoPlay: false
14
15
  }); // Animation active on hover
15
16
 
16
17
  export const activateOnHoverAnimation = () => /*#__PURE__*/React.createElement(Lottie, {
@@ -33,4 +34,28 @@ export const pauseOnClickAnimation = () => /*#__PURE__*/React.createElement(Lott
33
34
 
34
35
  export const PathLoad = () => /*#__PURE__*/React.createElement(Lottie, {
35
36
  path: "https://maxst.icons8.com/vue-static/landings/animated-icons/icons/checkmark-ok/checkmark-ok.json"
36
- });
37
+ });
38
+ export const Custom = () => {
39
+ const l = useRef();
40
+ const direction = useRef(true);
41
+ return /*#__PURE__*/React.createElement("div", {
42
+ className: "fooo",
43
+ onClick: () => {
44
+ console.log('click');
45
+
46
+ if (direction.current) {
47
+ direction.current = false;
48
+ l.current.playSegments([0, 5], true);
49
+ } else {
50
+ direction.current = true;
51
+ l.current.playSegments([5, 0], true);
52
+ }
53
+ }
54
+ }, /*#__PURE__*/React.createElement(Lottie, {
55
+ id: "example",
56
+ data: exampleLottie,
57
+ onInit: lottie => l.current = lottie,
58
+ autoPlay: false,
59
+ loop: false
60
+ }));
61
+ };
@@ -1,4 +1,4 @@
1
- import React, { useMemo } from 'react';
1
+ import React, { useMemo, useState, useEffect } from 'react';
2
2
  import { gql, useQuery } from '@apollo/client';
3
3
  import { useSearchkitVariables } from '@searchkit/client';
4
4
  import SearchPage from '../SearchPage';
@@ -21,13 +21,21 @@ function Query({
21
21
  loading
22
22
  } = useQuery(graphQuery, {
23
23
  variables
24
- });
24
+ }); // In between searches, Searchkit will empty it's results, resulting
25
+ // in a re-render with an empty screen. Use a local state to prevent this.
26
+
27
+ const [dataLoaded, setDataLoaded] = useState(null);
28
+ useEffect(() => {
29
+ if (data) {
30
+ setDataLoaded(data);
31
+ }
32
+ }, [data]);
25
33
 
26
34
  if (!useRouting) {
27
- return /*#__PURE__*/React.createElement("div", null, children(data, loading));
35
+ return /*#__PURE__*/React.createElement("div", null, children(dataLoaded, loading));
28
36
  }
29
37
 
30
- return /*#__PURE__*/React.createElement(SearchPage, null, children(data, loading));
38
+ return /*#__PURE__*/React.createElement(SearchPage, null, children(dataLoaded, loading));
31
39
  }
32
40
 
33
41
  export default Query;
@@ -26,7 +26,8 @@ const SearchField = ({
26
26
  initialValues: {
27
27
  query: query
28
28
  },
29
- displayRequiredIndicator: "required"
29
+ displayRequiredIndicator: "required",
30
+ enableReinitialize: true
30
31
  }, /*#__PURE__*/React.createElement(TextField, {
31
32
  fieldName: "query",
32
33
  title: "Search",
@@ -6,7 +6,6 @@ const SearchPage = ({
6
6
  children
7
7
  }) => /*#__PURE__*/React.createElement(EuiPage, null, children);
8
8
 
9
- console.log('W', typeof withSearchkitRouting, withSearchkitRouting.getInitialProps);
10
9
  export const routeToStateFn = routeState => {
11
10
  const value = {
12
11
  query: routeState.query || '',
@@ -31,7 +30,7 @@ export const routeToStateFn = routeState => {
31
30
  }
32
31
 
33
32
  if (item.boolValue) {
34
- item.boolValue = !!(item.boolValue.toString() === 'true');
33
+ item.boolValue = !!item.boolValue;
35
34
  }
36
35
 
37
36
  if (item.geoBoundingBox) {
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { useEffect, useState, useMemo } from 'react';
2
2
  import Query from './Query';
3
3
  import { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client';
4
4
  import { SearchkitProvider, SearchkitClient } from '@searchkit/client';
@@ -24,19 +24,39 @@ const defaultChildren = (data, loading) => /*#__PURE__*/React.createElement(Reac
24
24
  const SearchKit = ({
25
25
  query,
26
26
  uri,
27
- children,
28
- pageSize = 5,
29
- useRouting = true
27
+ pageSize = 10,
28
+ useRouting = true,
29
+ defaultFilters = [],
30
+ defaultQuery = '',
31
+ children
30
32
  }) => {
31
- const client = new ApolloClient({
32
- uri: uri,
33
- cache: new InMemoryCache()
34
- });
35
- const skClient = new SearchkitClient();
33
+ const client = useMemo(() => {
34
+ return new ApolloClient({
35
+ uri: uri,
36
+ cache: new InMemoryCache()
37
+ });
38
+ }, [uri]);
39
+ const skClient = useMemo(() => {
40
+ const skClient = new SearchkitClient();
41
+
42
+ if (!useRouting) {
43
+ skClient.updateBaseSearchState({
44
+ filters: defaultFilters,
45
+ query: defaultQuery,
46
+ page: {
47
+ size: pageSize,
48
+ from: 0
49
+ }
50
+ });
51
+ }
52
+
53
+ return skClient;
54
+ }, [useRouting, defaultFilters, defaultQuery, pageSize]);
36
55
  return /*#__PURE__*/React.createElement(ApolloProvider, {
37
56
  client: client
38
57
  }, /*#__PURE__*/React.createElement(SearchkitProvider, {
39
- client: skClient
58
+ client: skClient,
59
+ key: `${defaultQuery}-${defaultFilters.toString()}`
40
60
  }, /*#__PURE__*/React.createElement(Query, {
41
61
  query: query,
42
62
  useRouting: useRouting
@@ -45,6 +65,10 @@ const SearchKit = ({
45
65
 
46
66
  SearchKit.propTypes = {
47
67
  queryString: PropTypes.string,
48
- uri: PropTypes.string
68
+ uri: PropTypes.string,
69
+ pageSize: PropTypes.number,
70
+ useRouting: PropTypes.bool,
71
+ defaultFilters: PropTypes.object,
72
+ defaultQuery: PropTypes.string
49
73
  };
50
74
  export default SearchKit;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { useState } from 'react';
2
2
  import { useSearchkit } from '@searchkit/client';
3
3
  import classNames from 'classnames';
4
4
  import SearchKit from '.';
@@ -46,7 +46,7 @@ const query = `
46
46
  }
47
47
  query
48
48
  }
49
- hits(page: $page, sortBy: "relevance") {
49
+ hits(page: $page) {
50
50
  sortedBy
51
51
  page {
52
52
  total
@@ -178,4 +178,48 @@ export const CustomFacets = () => {
178
178
  }), /*#__PURE__*/React.createElement(SearchPagination, {
179
179
  data: data
180
180
  })));
181
+ };
182
+ export const Test = () => {
183
+ const [q, setQ] = useState(null);
184
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("input", {
185
+ onChange: e => setQ(e.target.value),
186
+ value: q
187
+ }), /*#__PURE__*/React.createElement(SearchKit, {
188
+ uri: "http://localhost:4000/api/graphql",
189
+ query: query,
190
+ useRouting: false,
191
+ defaultFilters: [{
192
+ identifier: 'type',
193
+ value: 'article'
194
+ }],
195
+ defaultQuery: q
196
+ }, (data, loading) => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SearchFacets, {
197
+ data: data,
198
+ loading: loading
199
+ }), /*#__PURE__*/React.createElement(SearchResults, {
200
+ data: data,
201
+ renderItem: SearchItem,
202
+ renderHeader: SearchHeader
203
+ }), /*#__PURE__*/React.createElement(SearchPagination, {
204
+ data: data
205
+ }))), /*#__PURE__*/React.createElement(SearchKit, {
206
+ uri: "http://localhost:4000/api/graphql",
207
+ query: query,
208
+ useRouting: false,
209
+ pageSize: 5,
210
+ defaultFilters: [{
211
+ identifier: 'type',
212
+ value: 'landing_page'
213
+ }],
214
+ defaultQuery: q
215
+ }, (data, loading) => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SearchFacets, {
216
+ data: data,
217
+ loading: loading
218
+ }), /*#__PURE__*/React.createElement(SearchResults, {
219
+ data: data,
220
+ renderItem: SearchItem,
221
+ renderHeader: SearchHeader
222
+ }), /*#__PURE__*/React.createElement(SearchPagination, {
223
+ data: data
224
+ }))));
181
225
  };
@@ -14,17 +14,17 @@ export default function useValueForCurrentViewPort(val1, val2, val3, val4, val5)
14
14
  return;
15
15
  } // 768 & 992
16
16
  else if (width >= viewportContext.screenSizes.SCREEN_TABLET && width <= viewportContext.screenSizes.SCREEN_NORMAL) {
17
- setValueForCurrentViewPort(val2);
18
- return;
19
- } // 992 & 1240
20
- else if (width >= viewportContext.screenSizes.SCREEN_NORMAL && width <= viewportContext.screenSizes.SCREEN_WIDE) {
21
- setValueForCurrentViewPort(val3);
22
- return;
23
- } // 1240 & 2000
24
- else if (width >= viewportContext.screenSizes.SCREEN_WIDE && width <= viewportContext.screenSizes.SCREEN_HUGE) {
25
- setValueForCurrentViewPort(val4);
26
- return;
27
- } // SCREEN_HUGE and larger
17
+ setValueForCurrentViewPort(val2);
18
+ return;
19
+ } // 992 & 1240
20
+ else if (width >= viewportContext.screenSizes.SCREEN_NORMAL && width <= viewportContext.screenSizes.SCREEN_WIDE) {
21
+ setValueForCurrentViewPort(val3);
22
+ return;
23
+ } // 1240 & 2000
24
+ else if (width >= viewportContext.screenSizes.SCREEN_WIDE && width <= viewportContext.screenSizes.SCREEN_HUGE) {
25
+ setValueForCurrentViewPort(val4);
26
+ return;
27
+ } // SCREEN_HUGE and larger
28
28
 
29
29
 
30
30
  setValueForCurrentViewPort(val5);
package/dist/index.js CHANGED
@@ -42,4 +42,5 @@ export { default as SearchSelectedFilters } from './components/SearchKit/SearchS
42
42
  export { default as SearchSorting } from './components/SearchKit/SearchSorting';
43
43
  export { default as SearchReset } from './components/SearchKit/SearchReset';
44
44
  export { default as SearchResults } from './components/SearchKit/SearchResults';
45
- export { default as SearchPagination } from './components/SearchKit/SearchPagination';
45
+ export { default as SearchPagination } from './components/SearchKit/SearchPagination';
46
+ export { default as Cookie } from './components/Cookie';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uncinc/uncinc-react-kitchen-sink",
3
- "version": "2.1.11",
3
+ "version": "2.2.0",
4
4
  "description": "Default React components that are easily extended.",
5
5
  "author": "uncinc",
6
6
  "license": "MIT",
@@ -35,34 +35,18 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@apollo/client": "^3.4.16",
38
- "@babel/cli": "^7.0.0-beta.44",
39
- "@babel/helper-define-map": "^7.14.5",
40
- "@babel/plugin-syntax-dynamic-import": "^7.8.3",
41
- "@babel/runtime": "^7.9.6",
42
38
  "@elastic/datemath": "^5.0.3",
43
39
  "@elastic/eui": "^40.0.0",
44
40
  "@loadable/component": "^5.15.0",
45
41
  "@searchkit/client": "^3.0.0-canary.45",
46
42
  "@searchkit/elastic-ui": "^3.0.0-canary.45",
47
- "@storybook/addon-actions": "^6.2.8",
48
- "@storybook/addon-info": "^5.3.21",
49
- "@storybook/addon-links": "^6.2.8",
50
- "@storybook/addons": "^6.2.8",
51
- "@storybook/react": "^6.2.8",
52
- "@storybook/theming": "^6.2.8",
53
- "@testing-library/jest-dom": "^4.2.4",
54
- "@testing-library/react": "^9.3.2",
55
- "@testing-library/user-event": "^7.1.2",
56
43
  "apollo-server-micro": "^3.4.0",
57
44
  "bootstrap": "^4.3.1",
58
- "chai": "^4.2.0",
59
- "cross-env": "^7.0.2",
60
- "enzyme": "^3.11.0",
61
- "enzyme-adapter-react-16": "^1.15.2",
62
45
  "fork-ts-checker-webpack-plugin-alt": "0.4.14",
63
46
  "formik": "^2.2.6",
64
47
  "graphql": "^15.7.0",
65
48
  "immutable": "^4.0.0-rc.15",
49
+ "js-cookie": "^3.0.1",
66
50
  "lottie-web": "^5.7.7",
67
51
  "mini-css-extract-plugin": "^1.4.1",
68
52
  "moment": "^2.29.1",
@@ -84,16 +68,36 @@
84
68
  "react-redux": "^7.2.4",
85
69
  "react-router": "5.2.0",
86
70
  "react-router-dom": "5.2.0",
87
- "react-scripts": "3.4.1",
88
71
  "react-select": "^3.1.0",
89
72
  "react-share": "^4.3.1",
90
73
  "react-slick": "^0.27.14",
91
- "react-test-renderer": "^16.13.1",
74
+ "react-use-cookie": "^1.3.0",
92
75
  "redux": "^4.0.5",
93
76
  "sass-loader": "^8.0.2",
77
+ "slick-carousel": "^1.8.1"
78
+ },
79
+ "devDependencies": {
80
+ "@babel/cli": "^7.0.0-beta.44",
81
+ "@babel/helper-define-map": "^7.14.5",
82
+ "@babel/plugin-syntax-dynamic-import": "^7.8.3",
83
+ "@babel/runtime": "^7.9.6",
84
+ "@storybook/addon-actions": "^6.2.8",
85
+ "@storybook/addon-info": "^5.3.21",
86
+ "@storybook/addon-links": "^6.2.8",
87
+ "@storybook/addons": "^6.2.8",
88
+ "@storybook/react": "^6.2.8",
89
+ "@storybook/theming": "^6.2.8",
90
+ "@testing-library/jest-dom": "^4.2.4",
91
+ "@testing-library/react": "^9.3.2",
92
+ "@testing-library/user-event": "^7.1.2",
93
+ "chai": "^4.2.0",
94
+ "cross-env": "^7.0.2",
95
+ "enzyme": "^3.11.0",
96
+ "enzyme-adapter-react-16": "^1.15.2",
97
+ "react-scripts": "3.4.1",
98
+ "react-test-renderer": "^16.13.1",
94
99
  "sinon": "^9.0.2",
95
100
  "sinon-chai": "^3.5.0",
96
- "slick-carousel": "^1.8.1",
97
101
  "storybook-addon-export-stories": "^1.0.0"
98
102
  },
99
103
  "eslintConfig": {