@digigov/react-core 0.21.0 → 0.22.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.
Files changed (87) hide show
  1. package/AccessibilityIcon/__snapshots__/index.test.tsx.snap +626 -0
  2. package/AccessibilityIcon/index.d.ts +15 -0
  3. package/AccessibilityIcon/index.js +52 -0
  4. package/AccessibilityIcon/index.test.d.ts +1 -0
  5. package/AccessibilityIcon/index.test.js +137 -0
  6. package/AccessibilityTextIcon/__snapshots__/index.test.tsx.snap +511 -0
  7. package/AccessibilityTextIcon/index.d.ts +15 -0
  8. package/AccessibilityTextIcon/index.js +34 -0
  9. package/AccessibilityTextIcon/index.test.d.ts +1 -0
  10. package/AccessibilityTextIcon/index.test.js +129 -0
  11. package/CHANGELOG.md +21 -1
  12. package/CheckboxItem/__snapshots__/index.test.tsx.snap +68 -0
  13. package/CheckboxItem/index.d.ts +5 -0
  14. package/CheckboxItem/index.js +6 -3
  15. package/CheckboxItem/index.test.js +18 -0
  16. package/DetailsSummary/index.d.ts +2 -1
  17. package/DetailsSummary/index.js +4 -3
  18. package/FieldContainer/index.js +10 -3
  19. package/Nav/index.d.ts +16 -1
  20. package/Nav/index.js +8 -2
  21. package/RadioItem/__snapshots__/index.test.tsx.snap +70 -0
  22. package/RadioItem/index.d.ts +5 -0
  23. package/RadioItem/index.js +6 -3
  24. package/RadioItem/index.test.js +18 -0
  25. package/SectionBreak/index.d.ts +1 -1
  26. package/SectionBreak/index.js +4 -2
  27. package/SvgIcon/index.d.ts +1 -1
  28. package/es/AccessibilityIcon/__snapshots__/index.test.tsx.snap +626 -0
  29. package/es/AccessibilityIcon/index.js +36 -0
  30. package/es/AccessibilityIcon/index.test.js +131 -0
  31. package/es/AccessibilityTextIcon/__snapshots__/index.test.tsx.snap +511 -0
  32. package/es/AccessibilityTextIcon/index.js +21 -0
  33. package/es/AccessibilityTextIcon/index.test.js +123 -0
  34. package/es/CheckboxItem/__snapshots__/index.test.tsx.snap +68 -0
  35. package/es/CheckboxItem/index.js +6 -3
  36. package/es/CheckboxItem/index.test.js +18 -0
  37. package/es/DetailsSummary/index.js +4 -3
  38. package/es/FieldContainer/index.js +8 -3
  39. package/es/Nav/index.js +8 -2
  40. package/es/RadioItem/__snapshots__/index.test.tsx.snap +70 -0
  41. package/es/RadioItem/index.js +6 -3
  42. package/es/RadioItem/index.test.js +18 -0
  43. package/es/SectionBreak/index.js +4 -2
  44. package/es/index.js +2 -0
  45. package/es/registry.js +4 -0
  46. package/esm/AccessibilityIcon/__snapshots__/index.test.tsx.snap +626 -0
  47. package/esm/AccessibilityIcon/index.js +36 -0
  48. package/esm/AccessibilityIcon/index.test.js +131 -0
  49. package/esm/AccessibilityTextIcon/__snapshots__/index.test.tsx.snap +511 -0
  50. package/esm/AccessibilityTextIcon/index.js +21 -0
  51. package/esm/AccessibilityTextIcon/index.test.js +123 -0
  52. package/esm/CheckboxItem/__snapshots__/index.test.tsx.snap +68 -0
  53. package/esm/CheckboxItem/index.js +6 -3
  54. package/esm/CheckboxItem/index.test.js +18 -0
  55. package/esm/DetailsSummary/index.js +4 -3
  56. package/esm/FieldContainer/index.js +8 -3
  57. package/esm/Nav/index.js +8 -2
  58. package/esm/RadioItem/__snapshots__/index.test.tsx.snap +70 -0
  59. package/esm/RadioItem/index.js +6 -3
  60. package/esm/RadioItem/index.test.js +18 -0
  61. package/esm/SectionBreak/index.js +4 -2
  62. package/esm/index.js +3 -1
  63. package/esm/registry.js +4 -0
  64. package/index.d.ts +2 -0
  65. package/index.js +26 -0
  66. package/package.json +2 -2
  67. package/registry.d.ts +2 -0
  68. package/registry.js +6 -0
  69. package/src/AccessibilityIcon/__snapshots__/index.test.tsx.snap +626 -0
  70. package/src/AccessibilityIcon/index.test.tsx +53 -0
  71. package/src/AccessibilityIcon/index.tsx +41 -0
  72. package/src/AccessibilityTextIcon/__snapshots__/index.test.tsx.snap +511 -0
  73. package/src/AccessibilityTextIcon/index.test.tsx +50 -0
  74. package/src/AccessibilityTextIcon/index.tsx +28 -0
  75. package/src/CheckboxItem/__snapshots__/index.test.tsx.snap +68 -0
  76. package/src/CheckboxItem/index.test.tsx +14 -0
  77. package/src/CheckboxItem/index.tsx +11 -1
  78. package/src/DetailsSummary/index.tsx +8 -2
  79. package/src/FieldContainer/index.tsx +2 -1
  80. package/src/Nav/index.tsx +29 -2
  81. package/src/RadioItem/__snapshots__/index.test.tsx.snap +70 -0
  82. package/src/RadioItem/index.test.tsx +14 -0
  83. package/src/RadioItem/index.tsx +11 -1
  84. package/src/SectionBreak/index.tsx +5 -2
  85. package/src/SvgIcon/index.tsx +1 -1
  86. package/src/index.ts +2 -0
  87. package/src/registry.js +4 -0
@@ -9,6 +9,11 @@ export interface RadioItemProps extends BaseProps<'input'> {
9
9
  * Value property is optional and it specifies the value of an <input> element.
10
10
  */
11
11
  value?: string;
12
+ /**
13
+ * disabled prop disables the radio input.
14
+ * disabled property is optional and it is false by default.
15
+ */
16
+ disabled?: boolean;
12
17
  }
13
18
  /**
14
19
  * RadioItem component is used for display radio buttons.
@@ -17,7 +17,7 @@ var _Base = _interopRequireDefault(require("@digigov/react-core/Base"));
17
17
 
18
18
  var _clsx = _interopRequireDefault(require("clsx"));
19
19
 
20
- var _excluded = ["name", "value", "className", "children"];
20
+ var _excluded = ["name", "value", "className", "disabled", "children"];
21
21
 
22
22
  /**
23
23
  * RadioItem component is used for display radio buttons.
@@ -27,19 +27,22 @@ var RadioItem = /*#__PURE__*/_react["default"].forwardRef(function RadioItem(_re
27
27
  var name = _ref.name,
28
28
  value = _ref.value,
29
29
  className = _ref.className,
30
+ _ref$disabled = _ref.disabled,
31
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
30
32
  children = _ref.children,
31
33
  props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
32
34
  return /*#__PURE__*/_react["default"].createElement("div", {
33
35
  className: (0, _clsx["default"])(className, true && 'govgr-radios__item')
34
36
  }, /*#__PURE__*/_react["default"].createElement("label", {
35
- className: (0, _clsx["default"])(true && 'govgr-label govgr-radios__label')
37
+ className: (0, _clsx["default"])(disabled === true && 'govgr-radios__label--disabled', true && 'govgr-label govgr-radios__label')
36
38
  }, children, /*#__PURE__*/_react["default"].createElement(_Base["default"], (0, _extends2["default"])({
37
39
  as: "input",
38
40
  ref: ref,
39
41
  type: "radio",
40
42
  name: name,
41
43
  value: value,
42
- className: (0, _clsx["default"])(true && 'govgr-radios__input')
44
+ className: (0, _clsx["default"])(true && 'govgr-radios__input'),
45
+ disabled: disabled
43
46
  }, props))));
44
47
  });
45
48
 
@@ -37,4 +37,22 @@ var _ref4 = /*#__PURE__*/_react["default"].createElement(_RadioItem["default"],
37
37
 
38
38
  it('renders the RadioItem with name and value props', function () {
39
39
  expect((0, _enzyme.mount)(_ref4)).toMatchSnapshot();
40
+ });
41
+
42
+ var _ref5 = /*#__PURE__*/_react["default"].createElement(_RadioItem["default"], {
43
+ disabled: true
44
+ }, "hello");
45
+
46
+ it('renders the RadioItem with disabled prop', function () {
47
+ expect((0, _enzyme.mount)(_ref5)).toMatchSnapshot();
48
+ });
49
+
50
+ var _ref6 = /*#__PURE__*/_react["default"].createElement(_RadioItem["default"], {
51
+ name: 'name',
52
+ value: 'someValue',
53
+ disabled: true
54
+ }, "hello");
55
+
56
+ it('renders the RadioItem with name disabled and value props', function () {
57
+ expect((0, _enzyme.mount)(_ref6)).toMatchSnapshot();
40
58
  });
@@ -9,7 +9,7 @@ export interface SectionBreakProps extends BaseProps<'hr'> {
9
9
  /**
10
10
  * size is optional and it is about the different size margins.
11
11
  */
12
- size?: 'xl' | 'l' | 'm';
12
+ size?: 'xl' | 'l' | 'm' | 's';
13
13
  }
14
14
  /**
15
15
  * SectionBreak is used to create a thematic break between sections of content.
@@ -23,8 +23,10 @@ var _excluded = ["visible", "size", "className"];
23
23
  * SectionBreak is used to create a thematic break between sections of content.
24
24
  */
25
25
  var SectionBreak = /*#__PURE__*/_react["default"].forwardRef(function SectionBreak(_ref, ref) {
26
- var visible = _ref.visible,
27
- size = _ref.size,
26
+ var _ref$visible = _ref.visible,
27
+ visible = _ref$visible === void 0 ? true : _ref$visible,
28
+ _ref$size = _ref.size,
29
+ size = _ref$size === void 0 ? 's' : _ref$size,
28
30
  className = _ref.className,
29
31
  props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
30
32
  return /*#__PURE__*/_react["default"].createElement(_Base["default"], (0, _extends2["default"])({
@@ -5,7 +5,7 @@ export interface SvgIconProps extends BaseProps<'svg'> {
5
5
  * size prop declares the size of the svg icon.
6
6
  * size is optional. The default value is 'm'.
7
7
  */
8
- size?: 's' | 'm' | 'l' | 'xl';
8
+ size?: 's' | 'm' | 'l' | 'xl' | 'xxl';
9
9
  /**
10
10
  * variant property styles svg icon with Gov.gr palette's basic colors.
11
11
  * variant property is optional.