@uncinc/uncinc-react-kitchen-sink 2.2.10 → 2.2.11

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,45 @@
1
+ @import '../../styles/assets/variables';
2
+
3
+ .Button {
4
+ &.Button--styled {
5
+ display: inline-block;
6
+ border-radius: 5px;
7
+ text-decoration: none;
8
+ text-align: center;
9
+ cursor: pointer;
10
+
11
+ &--primary {
12
+ font-size: 21px;
13
+ background-color: black;
14
+ color: #ffffff;
15
+ font-weight: 600;
16
+ line-height: 1.14;
17
+ padding: 19px 30px;
18
+
19
+ &:hover {
20
+ background-color: #434343;
21
+ }
22
+ &:disabled {
23
+ font-family: inherit;
24
+ background-color: rgba(0, 0, 0, 0.3);
25
+ }
26
+ }
27
+
28
+ &--inverted {
29
+ border: solid 1px #888888;
30
+ background-color: #ffffff;
31
+ padding: 18px 34.5px;
32
+ font-size: 18px;
33
+ font-weight: 600;
34
+ color: #000000;
35
+
36
+ &:hover {
37
+ background-color: #f1f1f1;
38
+ }
39
+ &:disabled {
40
+ font-family: inherit;
41
+ opacity: .5;
42
+ }
43
+ }
44
+ }
45
+ }
@@ -1,5 +1,5 @@
1
- @import 'assets/variables';
2
- @import 'assets/mixins';
1
+ @import '../../../styles/assets/mixins';
2
+ @import '../../../styles/assets/variables';
3
3
 
4
4
  // Radio's and checkboxes
5
5
  input[type='checkbox'],
@@ -1,6 +1,5 @@
1
- @import 'assets/variables';
2
- @import 'assets/mixins';
3
-
1
+ @import '../../styles/assets/mixins';
2
+ @import '../../styles/assets/variables';
4
3
 
5
4
  @keyframes fade-out-and-transform {
6
5
  0% {
@@ -1,5 +1,5 @@
1
- @import 'assets/variables';
2
- @import 'assets/mixins';
1
+ @import '../../styles/assets/mixins';
2
+ @import '../../styles/assets/variables';
3
3
 
4
4
  .Cookie {
5
5
  width: 100%;
@@ -30,6 +30,32 @@ function Checkbox(props) {
30
30
  'icon-checkmark': true,
31
31
  'icon-variant-1': checked
32
32
  });
33
+
34
+ if (props.value === '__other__') {
35
+ const inputClasses = c({
36
+ hidden: !field.value.includes('__other__')
37
+ });
38
+ return /*#__PURE__*/React.createElement("div", {
39
+ className: classes
40
+ }, /*#__PURE__*/React.createElement("label", {
41
+ htmlFor: name
42
+ }, /*#__PURE__*/React.createElement("input", _extends({}, field, {
43
+ name: props.name,
44
+ value: value,
45
+ type: "checkbox",
46
+ id: name,
47
+ checked: checked,
48
+ disabled: disabled,
49
+ className: className
50
+ })), props.otherLabel), /*#__PURE__*/React.createElement("textarea", {
51
+ placeholder: props.otherPlaceholder,
52
+ className: inputClasses,
53
+ onChange: e => {
54
+ form.setFieldValue(`${props.name}--other`, e.target.value);
55
+ }
56
+ }));
57
+ }
58
+
33
59
  return /*#__PURE__*/React.createElement("label", {
34
60
  className: classes,
35
61
  htmlFor: name
@@ -39,18 +65,6 @@ function Checkbox(props) {
39
65
  type: "checkbox",
40
66
  id: name,
41
67
  checked: checked,
42
- onChange: e => {
43
- const set = new Set(field.value);
44
-
45
- if (set.has(value)) {
46
- set.delete(value);
47
- } else {
48
- set.add(value);
49
- }
50
-
51
- form.setFieldValue(field.name, Array.from(set));
52
- form.setFieldTouched(field.name, true);
53
- },
54
68
  disabled: disabled,
55
69
  className: className
56
70
  })), props.label);
@@ -72,7 +86,9 @@ const Checkboxes = props => {
72
86
  displayRequiredIndicator,
73
87
  className,
74
88
  wrapperClassName,
75
- disabled = false
89
+ disabled = false,
90
+ otherLabel,
91
+ otherPlaceholder
76
92
  } = props;
77
93
  return /*#__PURE__*/React.createElement(GenericFormElement, {
78
94
  className: c("Checkboxes", wrapperClassName),
@@ -96,7 +112,9 @@ const Checkboxes = props => {
96
112
  value: value,
97
113
  placeholder: placeholder,
98
114
  validate: validation,
99
- disabled: disabled
115
+ disabled: disabled,
116
+ otherLabel: otherLabel,
117
+ otherPlaceholder: otherPlaceholder
100
118
  });
101
119
  }));
102
120
  };
@@ -10,7 +10,8 @@ export const Checkboxes = props => {
10
10
  return /*#__PURE__*/React.createElement(FormikWrapper, _extends({}, props, {
11
11
  initialValues: {
12
12
  'poison': []
13
- }
13
+ },
14
+ onSubmit: values => console.log(values)
14
15
  }), /*#__PURE__*/React.createElement(FormikCheckboxes, {
15
16
  title: "Pick your poison",
16
17
  required: true,
@@ -20,7 +21,8 @@ export const Checkboxes = props => {
20
21
  beer: 'Beer',
21
22
  wine: 'Wine',
22
23
  rum: 'Rum',
23
- whisky: 'Whisk(e)y'
24
+ whisky: 'Whisk(e)y',
25
+ '__other__': 'Anders'
24
26
  },
25
27
  validation: value => {
26
28
  let error;
@@ -30,6 +32,10 @@ export const Checkboxes = props => {
30
32
  }
31
33
 
32
34
  return error;
33
- }
35
+ },
36
+ otherLabel: "Anders"
37
+ }), /*#__PURE__*/React.createElement("input", {
38
+ type: "submit",
39
+ value: "Verzenden"
34
40
  }));
35
41
  };
@@ -10,7 +10,8 @@ export const RadioButtons = props => {
10
10
  return /*#__PURE__*/React.createElement(FormikWrapper, _extends({}, props, {
11
11
  initialValues: {
12
12
  'poison': null
13
- }
13
+ },
14
+ onSubmit: values => console.log(values)
14
15
  }), /*#__PURE__*/React.createElement(FormikRadio, {
15
16
  title: "Pick your poison",
16
17
  required: true,
@@ -20,7 +21,8 @@ export const RadioButtons = props => {
20
21
  beer: 'Beer',
21
22
  wine: 'Wine',
22
23
  rum: 'Rum',
23
- whisky: 'Whisk(e)y'
24
+ whisky: 'Whisk(e)y',
25
+ '__other__': 'Anders'
24
26
  },
25
27
  validation: value => {
26
28
  let error;
@@ -30,6 +32,10 @@ export const RadioButtons = props => {
30
32
  }
31
33
 
32
34
  return error;
33
- }
35
+ },
36
+ otherLabel: "Anders"
37
+ }), /*#__PURE__*/React.createElement("input", {
38
+ type: "submit",
39
+ value: "Verzenden"
34
40
  }));
35
41
  };
@@ -27,7 +27,12 @@ const SearchResults = ({
27
27
  }
28
28
 
29
29
  if (data && previousPage !== undefined && data.results.hits.page.pageNumber !== previousPage) {
30
- setItems([...previousItems, ...data.results.hits.items]);
30
+ if (typeof previousItems === 'undefined') {
31
+ setItems([...data.results.hits.items]);
32
+ } else {
33
+ setItems([...previousItems, ...data.results.hits.items]);
34
+ }
35
+
31
36
  setCurrentPage(data.results.hits.page.pageNumber);
32
37
  }
33
38
  }, [data, previousPage, previousItems, appendResults]);
@@ -239,7 +239,7 @@ export const LoadMore = () => {
239
239
  data: data,
240
240
  renderItem: SearchItem,
241
241
  renderHeader: SearchHeader,
242
- append: true
242
+ appendResults: true
243
243
  }), /*#__PURE__*/React.createElement(SearchLoadMore, {
244
244
  data: data
245
245
  }));
@@ -1,5 +1,5 @@
1
- @import 'assets/variables';
2
- @import 'assets/mixins';
1
+ @import '../../styles/assets/mixins';
2
+ @import '../../styles/assets/variables';
3
3
 
4
4
  $facebook: #3b5998;
5
5
  $twitter: #00aced;
@@ -0,0 +1,3 @@
1
+ .WysiwygField {
2
+ margin-right: 200px;
3
+ }
@@ -0,0 +1,5 @@
1
+ const makeSafeForCSS = value => {
2
+ return encodeURIComponent(value).replace(/\.|%[0-9a-z]{2}/gi, '');
3
+ };
4
+
5
+ export default makeSafeForCSS;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uncinc/uncinc-react-kitchen-sink",
3
- "version": "2.2.10",
3
+ "version": "2.2.11",
4
4
  "description": "Default React components that are easily extended.",
5
5
  "author": "uncinc",
6
6
  "license": "MIT",
@@ -1,25 +0,0 @@
1
- import { ApolloServer, gql } from 'apollo-server-micro';
2
- export const config = {
3
- api: {
4
- bodyParser: false
5
- }
6
- };
7
- const typeDefs = [gql`
8
- type Query {
9
- root: String
10
- }
11
-
12
- type Mutation {
13
- root: String
14
- }
15
- `];
16
- const server = new ApolloServer({
17
- typeDefs,
18
- resolvers: {},
19
- introspection: true,
20
- playground: true,
21
- context: {}
22
- });
23
- export default server.createHandler({
24
- path: '/api/graphql'
25
- });