@pareto-engineering/design-system 2.0.0-alpha.59 → 2.0.0-alpha.60

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.
@@ -70,7 +70,7 @@ var ChoicesInput = _ref => {
70
70
  }, options.map(choice => /*#__PURE__*/React.createElement(_common.Choice, _extends({
71
71
  key: choice.value,
72
72
  name: name,
73
- id: name,
73
+ id: "".concat(name, "-").concat(choice.value),
74
74
  multiple: multiple,
75
75
  validate: validate,
76
76
  disabled: disabled
@@ -41,15 +41,18 @@ var Choice = _ref => {
41
41
  validate,
42
42
  disabled
43
43
  } = _ref;
44
+ var type = multiple ? 'checkbox' : 'radio';
44
45
  var [field] = (0, _formik.useField)({
45
46
  name,
46
- validate
47
+ validate,
48
+ type,
49
+ value
47
50
  });
48
51
  return /*#__PURE__*/React.createElement("div", {
49
52
  className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
50
53
  style: style
51
54
  }, /*#__PURE__*/React.createElement("input", _extends({
52
- type: multiple ? 'checkbox' : 'radio',
55
+ type: type,
53
56
  id: id,
54
57
  name: name
55
58
  }, field, {
@@ -49,7 +49,7 @@ const ChoicesInput = ({
49
49
  }, options.map(choice => /*#__PURE__*/React.createElement(Choice, _extends({
50
50
  key: choice.value,
51
51
  name: name,
52
- id: name,
52
+ id: `${name}-${choice.value}`,
53
53
  multiple: multiple,
54
54
  validate: validate,
55
55
  disabled: disabled
@@ -25,15 +25,18 @@ const Choice = ({
25
25
  validate,
26
26
  disabled
27
27
  }) => {
28
+ const type = multiple ? 'checkbox' : 'radio';
28
29
  const [field] = useField({
29
30
  name,
30
- validate
31
+ validate,
32
+ type,
33
+ value
31
34
  });
32
35
  return /*#__PURE__*/React.createElement("div", {
33
36
  className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
34
37
  style: style
35
38
  }, /*#__PURE__*/React.createElement("input", _extends({
36
- type: multiple ? 'checkbox' : 'radio',
39
+ type: type,
37
40
  id: id,
38
41
  name: name
39
42
  }, field, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pareto-engineering/design-system",
3
- "version": "2.0.0-alpha.59",
3
+ "version": "2.0.0-alpha.60",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/es/index.js",