@digigov/react-core 0.23.1 → 0.25.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 (136) hide show
  1. package/AccessibilityIcon/index.d.ts +0 -6
  2. package/AccessibilityTextIcon/index.d.ts +0 -6
  3. package/AccordionSection/index.d.ts +0 -9
  4. package/AccordionSectionSummary/index.d.ts +1 -2
  5. package/AccordionSectionSummary/index.js +2 -5
  6. package/ArrowIcon/index.d.ts +0 -5
  7. package/BackLink/index.d.ts +0 -4
  8. package/Base/index.d.ts +1 -2
  9. package/BurgerIcon/index.d.ts +0 -6
  10. package/Button/index.d.ts +0 -4
  11. package/CHANGELOG.md +21 -1
  12. package/CallToAction/index.d.ts +0 -1
  13. package/CaretContainer/__snapshots__/index.test.tsx.snap +16 -0
  14. package/CaretContainer/index.d.ts +11 -0
  15. package/CaretContainer/index.js +40 -0
  16. package/CaretContainer/index.test.d.ts +1 -0
  17. package/CaretContainer/index.test.js +15 -0
  18. package/CaretIcon/index.d.ts +0 -1
  19. package/CheckIcon/index.d.ts +0 -6
  20. package/CheckboxConditional/index.js +5 -5
  21. package/CheckboxItem/index.d.ts +0 -13
  22. package/CheckboxItem/index.js +5 -4
  23. package/CloseIcon/index.d.ts +0 -6
  24. package/DateInputItem/index.d.ts +0 -4
  25. package/FileUpload/index.d.ts +0 -8
  26. package/FooterImage/index.d.ts +0 -4
  27. package/FooterLink/index.d.ts +0 -4
  28. package/FooterLink/index.js +2 -4
  29. package/FooterList/index.d.ts +1 -1
  30. package/GlobeIcon/index.d.ts +0 -6
  31. package/Grid/index.d.ts +1 -2
  32. package/HeaderLogo/index.d.ts +0 -4
  33. package/HeaderSecondaryLogo/index.d.ts +0 -4
  34. package/HeaderTitle/index.d.ts +0 -4
  35. package/HeaderTitle/index.js +1 -1
  36. package/HellenicRepublicLogo/index.d.ts +0 -5
  37. package/Hidden/index.d.ts +0 -1
  38. package/MoreVertIcon/index.d.ts +0 -6
  39. package/NavListItemLink/index.d.ts +0 -5
  40. package/NotificationBannerLink/index.d.ts +0 -4
  41. package/NotificationBannerLink/index.js +3 -3
  42. package/PhaseBannerHeaderContainer/index.d.ts +1 -3
  43. package/RadioConditional/index.js +5 -5
  44. package/RadioItem/index.d.ts +0 -13
  45. package/RadioItem/index.js +4 -2
  46. package/SelectContainer/index.d.ts +0 -4
  47. package/SelectOption/index.d.ts +0 -8
  48. package/SingleCharacterInputItem/index.d.ts +0 -5
  49. package/SkipLink/index.d.ts +0 -1
  50. package/Table/index.d.ts +7 -1
  51. package/Table/index.js +4 -2
  52. package/TabsListItem/index.d.ts +0 -4
  53. package/TextArea/index.d.ts +0 -8
  54. package/TextInput/index.d.ts +0 -4
  55. package/UncheckIcon/index.d.ts +0 -6
  56. package/es/AccordionSectionSummary/index.js +2 -5
  57. package/es/CaretContainer/__snapshots__/index.test.tsx.snap +16 -0
  58. package/es/CaretContainer/index.js +24 -0
  59. package/es/CaretContainer/index.test.js +9 -0
  60. package/es/CheckboxConditional/index.js +3 -5
  61. package/es/CheckboxItem/index.js +4 -4
  62. package/es/FooterLink/index.js +2 -4
  63. package/es/HeaderTitle/index.js +1 -1
  64. package/es/NotificationBannerLink/index.js +3 -3
  65. package/es/RadioConditional/index.js +3 -5
  66. package/es/RadioItem/index.js +3 -2
  67. package/es/Table/index.js +4 -2
  68. package/es/index.js +1 -0
  69. package/es/registry.js +2 -0
  70. package/esm/AccordionSectionSummary/index.js +2 -5
  71. package/esm/CaretContainer/__snapshots__/index.test.tsx.snap +16 -0
  72. package/esm/CaretContainer/index.js +24 -0
  73. package/esm/CaretContainer/index.test.js +9 -0
  74. package/esm/CheckboxConditional/index.js +3 -5
  75. package/esm/CheckboxItem/index.js +4 -4
  76. package/esm/FooterLink/index.js +2 -4
  77. package/esm/HeaderTitle/index.js +1 -1
  78. package/esm/NotificationBannerLink/index.js +3 -3
  79. package/esm/RadioConditional/index.js +3 -5
  80. package/esm/RadioItem/index.js +3 -2
  81. package/esm/Table/index.js +4 -2
  82. package/esm/index.js +2 -1
  83. package/esm/registry.js +2 -0
  84. package/index.d.ts +1 -0
  85. package/index.js +13 -0
  86. package/package.json +2 -2
  87. package/registry.d.ts +1 -0
  88. package/registry.js +3 -0
  89. package/src/AccessibilityIcon/index.tsx +2 -9
  90. package/src/AccessibilityTextIcon/index.tsx +1 -8
  91. package/src/AccordionSection/index.tsx +1 -7
  92. package/src/AccordionSectionSummary/index.tsx +2 -8
  93. package/src/ArrowIcon/index.tsx +0 -5
  94. package/src/BackLink/index.tsx +2 -7
  95. package/src/Base/index.tsx +1 -1
  96. package/src/BurgerIcon/index.tsx +0 -6
  97. package/src/Button/index.tsx +1 -6
  98. package/src/CallToAction/index.tsx +5 -4
  99. package/src/CaretContainer/__snapshots__/index.test.tsx.snap +16 -0
  100. package/src/CaretContainer/index.test.tsx +8 -0
  101. package/src/CaretContainer/index.tsx +29 -0
  102. package/src/CaretIcon/index.tsx +0 -1
  103. package/src/CheckIcon/index.tsx +2 -8
  104. package/src/CheckboxConditional/index.tsx +5 -13
  105. package/src/CheckboxItem/index.tsx +6 -20
  106. package/src/CloseIcon/index.tsx +2 -8
  107. package/src/DateInputItem/index.tsx +0 -4
  108. package/src/Fieldset/index.tsx +1 -2
  109. package/src/FileUpload/index.tsx +7 -12
  110. package/src/FooterImage/index.tsx +1 -6
  111. package/src/FooterLink/index.tsx +2 -8
  112. package/src/FooterList/index.tsx +1 -1
  113. package/src/GlobeIcon/index.tsx +0 -6
  114. package/src/Grid/index.tsx +1 -2
  115. package/src/HeaderLogo/index.tsx +0 -4
  116. package/src/HeaderSecondaryLogo/index.tsx +0 -6
  117. package/src/HeaderTitle/index.tsx +2 -7
  118. package/src/HellenicRepublicLogo/index.tsx +24 -29
  119. package/src/Hidden/index.tsx +0 -1
  120. package/src/MoreVertIcon/index.tsx +1 -8
  121. package/src/NavListItemLink/index.tsx +0 -5
  122. package/src/NotificationBannerLink/index.tsx +2 -7
  123. package/src/PhaseBannerHeaderContainer/index.tsx +1 -4
  124. package/src/RadioConditional/index.tsx +5 -13
  125. package/src/RadioItem/index.tsx +5 -19
  126. package/src/SelectContainer/index.tsx +1 -6
  127. package/src/SelectOption/index.tsx +1 -11
  128. package/src/SingleCharacterInputItem/index.tsx +0 -5
  129. package/src/SkipLink/index.tsx +1 -3
  130. package/src/Table/index.tsx +10 -0
  131. package/src/TabsListItem/index.tsx +0 -5
  132. package/src/TextArea/index.tsx +0 -10
  133. package/src/TextInput/index.tsx +0 -5
  134. package/src/UncheckIcon/index.tsx +1 -8
  135. package/src/index.ts +1 -0
  136. package/src/registry.js +2 -0
package/es/index.js CHANGED
@@ -24,6 +24,7 @@ export * from '@digigov/react-core/Card';
24
24
  export * from '@digigov/react-core/CardAction';
25
25
  export * from '@digigov/react-core/CardHeading';
26
26
  export * from '@digigov/react-core/CardText';
27
+ export * from '@digigov/react-core/CaretContainer';
27
28
  export * from '@digigov/react-core/CaretIcon';
28
29
  export * from '@digigov/react-core/Checkbox';
29
30
  export * from '@digigov/react-core/CheckboxConditional';
package/es/registry.js CHANGED
@@ -25,6 +25,7 @@ import * as _digigov_react_core_Card from '@digigov/react-core/Card';
25
25
  import * as _digigov_react_core_CardAction from '@digigov/react-core/CardAction';
26
26
  import * as _digigov_react_core_CardHeading from '@digigov/react-core/CardHeading';
27
27
  import * as _digigov_react_core_CardText from '@digigov/react-core/CardText';
28
+ import * as _digigov_react_core_CaretContainer from '@digigov/react-core/CaretContainer';
28
29
  import * as _digigov_react_core_CaretIcon from '@digigov/react-core/CaretIcon';
29
30
  import * as _digigov_react_core_Checkbox from '@digigov/react-core/Checkbox';
30
31
  import * as _digigov_react_core_CheckboxConditional from '@digigov/react-core/CheckboxConditional';
@@ -203,6 +204,7 @@ export default {
203
204
  '@digigov/react-core/CardAction': lazyImport(_digigov_react_core_CardAction),
204
205
  '@digigov/react-core/CardHeading': lazyImport(_digigov_react_core_CardHeading),
205
206
  '@digigov/react-core/CardText': lazyImport(_digigov_react_core_CardText),
207
+ '@digigov/react-core/CaretContainer': lazyImport(_digigov_react_core_CaretContainer),
206
208
  '@digigov/react-core/CaretIcon': lazyImport(_digigov_react_core_CaretIcon),
207
209
  '@digigov/react-core/Checkbox': lazyImport(_digigov_react_core_Checkbox),
208
210
  '@digigov/react-core/CheckboxConditional': lazyImport(_digigov_react_core_CheckboxConditional),
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["className", "ariaLevel", "children"];
3
+ var _excluded = ["className", "children"];
4
4
  import React from 'react';
5
5
  import Base from '@digigov/react-core/Base';
6
6
  import clsx from 'clsx';
@@ -10,8 +10,6 @@ import clsx from 'clsx';
10
10
  */
11
11
  export var AccordionSectionSummary = /*#__PURE__*/React.forwardRef(function AccordionSectionSummary(_ref, ref) {
12
12
  var className = _ref.className,
13
- _ref$ariaLevel = _ref.ariaLevel,
14
- ariaLevel = _ref$ariaLevel === void 0 ? 2 : _ref$ariaLevel,
15
13
  children = _ref.children,
16
14
  props = _objectWithoutProperties(_ref, _excluded);
17
15
 
@@ -19,8 +17,7 @@ export var AccordionSectionSummary = /*#__PURE__*/React.forwardRef(function Acco
19
17
  as: "summary",
20
18
  ref: ref,
21
19
  className: clsx(className, true && 'govgr-accordion__section-summary'),
22
- role: "heading",
23
- "aria-level": ariaLevel
20
+ role: "heading"
24
21
  }, props), children);
25
22
  });
26
23
  export default AccordionSectionSummary;
@@ -0,0 +1,16 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`renders the CaretContainer with no props 1`] = `
4
+ <ForwardRef(CaretContainer)>
5
+ <ForwardRef(Base)
6
+ as="div"
7
+ className="govgr-caret-container"
8
+ >
9
+ <div
10
+ className="govgr-caret-container"
11
+ >
12
+ hello
13
+ </div>
14
+ </ForwardRef(Base)>
15
+ </ForwardRef(CaretContainer)>
16
+ `;
@@ -0,0 +1,24 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["className", "children"];
4
+ import React from 'react';
5
+ import Base from '@digigov/react-core/Base';
6
+ import clsx from 'clsx';
7
+
8
+ /**
9
+ *
10
+ * Use CaretContainer to wrap CaretIcon like ascending descending style.
11
+ *
12
+ */
13
+ export var CaretContainer = /*#__PURE__*/React.forwardRef(function CaretContainer(_ref, ref) {
14
+ var className = _ref.className,
15
+ children = _ref.children,
16
+ props = _objectWithoutProperties(_ref, _excluded);
17
+
18
+ return /*#__PURE__*/React.createElement(Base, _extends({
19
+ as: "div",
20
+ ref: ref,
21
+ className: clsx(className, true && 'govgr-caret-container')
22
+ }, props), children);
23
+ });
24
+ export default CaretContainer;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { mount } from 'enzyme';
3
+ import CaretContainer from '@digigov/react-core/CaretContainer';
4
+
5
+ var _ref = /*#__PURE__*/React.createElement(CaretContainer, null, "hello");
6
+
7
+ it('renders the CaretContainer with no props', function () {
8
+ expect(mount(_ref)).toMatchSnapshot();
9
+ });
@@ -3,6 +3,8 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
3
3
  var _excluded = ["className", "children"];
4
4
  import React from 'react';
5
5
  import Base from '@digigov/react-core/Base';
6
+ import LabelContainer from '@digigov/react-core/LabelContainer';
7
+ import FieldContainer from '@digigov/react-core/FieldContainer';
6
8
  import clsx from 'clsx';
7
9
 
8
10
  /**
@@ -19,10 +21,6 @@ export var CheckboxConditional = /*#__PURE__*/React.forwardRef(function Checkbox
19
21
  as: "div",
20
22
  ref: ref,
21
23
  className: clsx(className, true && 'govgr-checkboxes__conditional')
22
- }, props), /*#__PURE__*/React.createElement("div", {
23
- className: clsx(true && 'govgr-field')
24
- }, /*#__PURE__*/React.createElement("label", {
25
- className: clsx(true && 'govgr-label')
26
- }, children)));
24
+ }, props), /*#__PURE__*/React.createElement(FieldContainer, null, /*#__PURE__*/React.createElement(LabelContainer, null, children)));
27
25
  });
28
26
  export default CheckboxConditional;
@@ -3,6 +3,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
3
3
  var _excluded = ["name", "value", "className", "disabled", "children"];
4
4
  import React from 'react';
5
5
  import Base from '@digigov/react-core/Base';
6
+ import LabelContainer from '@digigov/react-core/LabelContainer';
6
7
  import clsx from 'clsx';
7
8
 
8
9
  /**
@@ -14,15 +15,14 @@ export var CheckboxItem = /*#__PURE__*/React.forwardRef(function CheckboxItem(_r
14
15
  var name = _ref.name,
15
16
  value = _ref.value,
16
17
  className = _ref.className,
17
- _ref$disabled = _ref.disabled,
18
- disabled = _ref$disabled === void 0 ? false : _ref$disabled,
18
+ disabled = _ref.disabled,
19
19
  children = _ref.children,
20
20
  props = _objectWithoutProperties(_ref, _excluded);
21
21
 
22
22
  return /*#__PURE__*/React.createElement("div", {
23
23
  className: clsx(className, true && 'govgr-checkboxes__item')
24
- }, /*#__PURE__*/React.createElement("label", {
25
- className: clsx(disabled === true && 'govgr-checkboxes__label--disabled', true && 'govgr-label govgr-checkboxes__label')
24
+ }, /*#__PURE__*/React.createElement(LabelContainer, {
25
+ className: clsx(disabled === true && 'govgr-checkboxes__label--disabled', true && 'govgr-checkboxes__label')
26
26
  }, children, /*#__PURE__*/React.createElement(Base, _extends({
27
27
  as: "input",
28
28
  ref: ref,
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["href", "className", "children"];
3
+ var _excluded = ["className", "children"];
4
4
  import React from 'react';
5
5
  import Base from '@digigov/react-core/Base';
6
6
  import clsx from 'clsx';
@@ -9,14 +9,12 @@ import clsx from 'clsx';
9
9
  * FooterLink in used inside the Footer component.
10
10
  */
11
11
  export var FooterLink = /*#__PURE__*/React.forwardRef(function FooterLink(_ref, ref) {
12
- var href = _ref.href,
13
- className = _ref.className,
12
+ var className = _ref.className,
14
13
  children = _ref.children,
15
14
  props = _objectWithoutProperties(_ref, _excluded);
16
15
 
17
16
  return /*#__PURE__*/React.createElement(Base, _extends({
18
17
  as: "a",
19
- href: href,
20
18
  ref: ref,
21
19
  className: clsx(className, true && 'govgr-footer__link')
22
20
  }, props), children);
@@ -17,8 +17,8 @@ export var HeaderTitle = /*#__PURE__*/React.forwardRef(function HeaderTitle(_ref
17
17
 
18
18
  return /*#__PURE__*/React.createElement(Base, _extends({
19
19
  as: "a",
20
- href: href,
21
20
  ref: ref,
21
+ href: href,
22
22
  className: clsx(className, true && 'govgr-header-title')
23
23
  }, props), children);
24
24
  });
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["href", "className", "children"];
3
+ var _excluded = ["className", "href", "children"];
4
4
  import React from 'react';
5
5
  import Base from '@digigov/react-core/Base';
6
6
  import clsx from 'clsx';
@@ -11,9 +11,9 @@ import clsx from 'clsx';
11
11
  * NotificationBannerLink must be wrapped inside NotificationContent component as children
12
12
  */
13
13
  export var NotificationBannerLink = /*#__PURE__*/React.forwardRef(function NotificationBannerLink(_ref, ref) {
14
- var _ref$href = _ref.href,
14
+ var className = _ref.className,
15
+ _ref$href = _ref.href,
15
16
  href = _ref$href === void 0 ? '#' : _ref$href,
16
- className = _ref.className,
17
17
  children = _ref.children,
18
18
  props = _objectWithoutProperties(_ref, _excluded);
19
19
 
@@ -3,6 +3,8 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
3
3
  var _excluded = ["className", "children"];
4
4
  import React from 'react';
5
5
  import Base from '@digigov/react-core/Base';
6
+ import LabelContainer from '@digigov/react-core/LabelContainer';
7
+ import FieldContainer from '@digigov/react-core/FieldContainer';
6
8
  import clsx from 'clsx';
7
9
 
8
10
  /**
@@ -19,10 +21,6 @@ export var RadioConditional = /*#__PURE__*/React.forwardRef(function RadioCondit
19
21
  as: "div",
20
22
  ref: ref,
21
23
  className: clsx(className, true && 'govgr-radios__conditional')
22
- }, props), /*#__PURE__*/React.createElement("div", {
23
- className: clsx(true && 'govgr-field')
24
- }, /*#__PURE__*/React.createElement("label", {
25
- className: clsx(true && 'govgr-label')
26
- }, children)));
24
+ }, props), /*#__PURE__*/React.createElement(FieldContainer, null, /*#__PURE__*/React.createElement(LabelContainer, null, children)));
27
25
  });
28
26
  export default RadioConditional;
@@ -3,6 +3,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
3
3
  var _excluded = ["name", "value", "className", "disabled", "children"];
4
4
  import React from 'react';
5
5
  import Base from '@digigov/react-core/Base';
6
+ import LabelContainer from '@digigov/react-core/LabelContainer';
6
7
  import clsx from 'clsx';
7
8
 
8
9
  /**
@@ -20,8 +21,8 @@ export var RadioItem = /*#__PURE__*/React.forwardRef(function RadioItem(_ref, re
20
21
 
21
22
  return /*#__PURE__*/React.createElement("div", {
22
23
  className: clsx(className, true && 'govgr-radios__item')
23
- }, /*#__PURE__*/React.createElement("label", {
24
- className: clsx(disabled === true && 'govgr-radios__label--disabled', true && 'govgr-label govgr-radios__label')
24
+ }, /*#__PURE__*/React.createElement(LabelContainer, {
25
+ className: clsx(disabled === true && 'govgr-radios__label--disabled', true && 'govgr-radios__label')
25
26
  }, children, /*#__PURE__*/React.createElement(Base, _extends({
26
27
  as: "input",
27
28
  ref: ref,
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["variant", "zebra", "dense", "verticalBorders", "className", "children"];
3
+ var _excluded = ["variant", "zebra", "dense", "verticalBorders", "stacked", "className", "children"];
4
4
  import React from 'react';
5
5
  import Base from '@digigov/react-core/Base';
6
6
  import clsx from 'clsx';
@@ -16,6 +16,8 @@ export var Table = /*#__PURE__*/React.forwardRef(function Table(_ref, ref) {
16
16
  dense = _ref$dense === void 0 ? false : _ref$dense,
17
17
  _ref$verticalBorders = _ref.verticalBorders,
18
18
  verticalBorders = _ref$verticalBorders === void 0 ? false : _ref$verticalBorders,
19
+ _ref$stacked = _ref.stacked,
20
+ stacked = _ref$stacked === void 0 ? 'never' : _ref$stacked,
19
21
  className = _ref.className,
20
22
  children = _ref.children,
21
23
  props = _objectWithoutProperties(_ref, _excluded);
@@ -23,7 +25,7 @@ export var Table = /*#__PURE__*/React.forwardRef(function Table(_ref, ref) {
23
25
  return /*#__PURE__*/React.createElement(Base, _extends({
24
26
  as: "table",
25
27
  ref: ref,
26
- className: clsx(className, verticalBorders === true && ['govgr-table--with-vertical-header', 'govgr-table--with-vertical-lines'], variant === 'light' && 'govgr-table--light', variant === 'dark' && 'govgr-table--dark', zebra === true && 'govgr-table--zebra', dense === true && 'govgr-table--dense', true && 'govgr-table')
28
+ className: clsx(className, verticalBorders === true && ['govgr-table--with-vertical-header', 'govgr-table--with-vertical-lines'], stacked === 'always' && 'govgr-table--stacked-always', variant === 'light' && 'govgr-table--light', variant === 'dark' && 'govgr-table--dark', stacked === 's' && 'govgr-table--stacked-s', stacked == 'm' && 'govgr-table--stacked-m', zebra === true && 'govgr-table--zebra', dense === true && 'govgr-table--dense', true && 'govgr-table')
27
29
  }, props), children);
28
30
  });
29
31
  export default Table;
package/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Digigov v0.23.1
1
+ /** @license Digigov v0.25.0
2
2
  *
3
3
  * This source code is licensed under the BSD-2-Clause license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -29,6 +29,7 @@ export * from '@digigov/react-core/Card';
29
29
  export * from '@digigov/react-core/CardAction';
30
30
  export * from '@digigov/react-core/CardHeading';
31
31
  export * from '@digigov/react-core/CardText';
32
+ export * from '@digigov/react-core/CaretContainer';
32
33
  export * from '@digigov/react-core/CaretIcon';
33
34
  export * from '@digigov/react-core/Checkbox';
34
35
  export * from '@digigov/react-core/CheckboxConditional';
package/esm/registry.js CHANGED
@@ -25,6 +25,7 @@ import * as _digigov_react_core_Card from '@digigov/react-core/Card';
25
25
  import * as _digigov_react_core_CardAction from '@digigov/react-core/CardAction';
26
26
  import * as _digigov_react_core_CardHeading from '@digigov/react-core/CardHeading';
27
27
  import * as _digigov_react_core_CardText from '@digigov/react-core/CardText';
28
+ import * as _digigov_react_core_CaretContainer from '@digigov/react-core/CaretContainer';
28
29
  import * as _digigov_react_core_CaretIcon from '@digigov/react-core/CaretIcon';
29
30
  import * as _digigov_react_core_Checkbox from '@digigov/react-core/Checkbox';
30
31
  import * as _digigov_react_core_CheckboxConditional from '@digigov/react-core/CheckboxConditional';
@@ -203,6 +204,7 @@ export default {
203
204
  '@digigov/react-core/CardAction': lazyImport(_digigov_react_core_CardAction),
204
205
  '@digigov/react-core/CardHeading': lazyImport(_digigov_react_core_CardHeading),
205
206
  '@digigov/react-core/CardText': lazyImport(_digigov_react_core_CardText),
207
+ '@digigov/react-core/CaretContainer': lazyImport(_digigov_react_core_CaretContainer),
206
208
  '@digigov/react-core/CaretIcon': lazyImport(_digigov_react_core_CaretIcon),
207
209
  '@digigov/react-core/Checkbox': lazyImport(_digigov_react_core_Checkbox),
208
210
  '@digigov/react-core/CheckboxConditional': lazyImport(_digigov_react_core_CheckboxConditional),
package/index.d.ts CHANGED
@@ -24,6 +24,7 @@ export * from '@digigov/react-core/Card';
24
24
  export * from '@digigov/react-core/CardAction';
25
25
  export * from '@digigov/react-core/CardHeading';
26
26
  export * from '@digigov/react-core/CardText';
27
+ export * from '@digigov/react-core/CaretContainer';
27
28
  export * from '@digigov/react-core/CaretIcon';
28
29
  export * from '@digigov/react-core/Checkbox';
29
30
  export * from '@digigov/react-core/CheckboxConditional';
package/index.js CHANGED
@@ -342,6 +342,19 @@ Object.keys(_CardText).forEach(function (key) {
342
342
  });
343
343
  });
344
344
 
345
+ var _CaretContainer = require("@digigov/react-core/CaretContainer");
346
+
347
+ Object.keys(_CaretContainer).forEach(function (key) {
348
+ if (key === "default" || key === "__esModule") return;
349
+ if (key in exports && exports[key] === _CaretContainer[key]) return;
350
+ Object.defineProperty(exports, key, {
351
+ enumerable: true,
352
+ get: function get() {
353
+ return _CaretContainer[key];
354
+ }
355
+ });
356
+ });
357
+
345
358
  var _CaretIcon = require("@digigov/react-core/CaretIcon");
346
359
 
347
360
  Object.keys(_CaretIcon).forEach(function (key) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digigov/react-core",
3
- "version": "0.23.1",
3
+ "version": "0.25.0",
4
4
  "description": "@digigov react core components",
5
5
  "author": "GRNET Developers <devs@lists.grnet.gr>",
6
6
  "license": "BSD-2-Clause",
@@ -11,7 +11,7 @@
11
11
  "directory": "dist"
12
12
  },
13
13
  "peerDependencies": {
14
- "@digigov/css": "0.35.0",
14
+ "@digigov/css": "0.37.0",
15
15
  "clsx": "1.1.1",
16
16
  "react": "^16.8.0 || ^17.0.0",
17
17
  "react-dom": "^16.8.0 || ^17.0.0"
package/registry.d.ts CHANGED
@@ -26,6 +26,7 @@ declare var _default: {
26
26
  '@digigov/react-core/CardAction': {};
27
27
  '@digigov/react-core/CardHeading': {};
28
28
  '@digigov/react-core/CardText': {};
29
+ '@digigov/react-core/CaretContainer': {};
29
30
  '@digigov/react-core/CaretIcon': {};
30
31
  '@digigov/react-core/Checkbox': {};
31
32
  '@digigov/react-core/CheckboxConditional': {};
package/registry.js CHANGED
@@ -61,6 +61,8 @@ var _digigov_react_core_CardHeading = _interopRequireWildcard(require("@digigov/
61
61
 
62
62
  var _digigov_react_core_CardText = _interopRequireWildcard(require("@digigov/react-core/CardText"));
63
63
 
64
+ var _digigov_react_core_CaretContainer = _interopRequireWildcard(require("@digigov/react-core/CaretContainer"));
65
+
64
66
  var _digigov_react_core_CaretIcon = _interopRequireWildcard(require("@digigov/react-core/CaretIcon"));
65
67
 
66
68
  var _digigov_react_core_Checkbox = _interopRequireWildcard(require("@digigov/react-core/Checkbox"));
@@ -377,6 +379,7 @@ var _default = {
377
379
  '@digigov/react-core/CardAction': lazyImport(_digigov_react_core_CardAction),
378
380
  '@digigov/react-core/CardHeading': lazyImport(_digigov_react_core_CardHeading),
379
381
  '@digigov/react-core/CardText': lazyImport(_digigov_react_core_CardText),
382
+ '@digigov/react-core/CaretContainer': lazyImport(_digigov_react_core_CaretContainer),
380
383
  '@digigov/react-core/CaretIcon': lazyImport(_digigov_react_core_CaretIcon),
381
384
  '@digigov/react-core/Checkbox': lazyImport(_digigov_react_core_Checkbox),
382
385
  '@digigov/react-core/CheckboxConditional': lazyImport(_digigov_react_core_CheckboxConditional),
@@ -1,14 +1,7 @@
1
1
  import React from 'react';
2
2
  import SvgIcon, { SvgIconProps } from '@digigov/react-core/SvgIcon';
3
3
  import clsx from 'clsx';
4
- export interface AccessibilityIconProps extends SvgIconProps {
5
- /**
6
- * ref is optional.
7
- * ref prop declares the reference of the svg icon component.
8
- * It can be used to to access the DOM element and the React element.
9
- */
10
- ref?: React.Ref<SVGSVGElement>;
11
- }
4
+ export interface AccessibilityIconProps extends SvgIconProps {}
12
5
  /**
13
6
  * Use AccessibilityIcon component when you need to show web accessibility options.
14
7
  */
@@ -27,7 +20,7 @@ export const AccessibilityIcon: React.FC<AccessibilityIconProps> = React.forward
27
20
  {...props}
28
21
  >
29
22
  <title>Μενού Προσβασιμότητας</title>
30
- <circle cx="12" cy="3" r="3"/>
23
+ <circle cx="12" cy="3" r="3" />
31
24
  <path
32
25
  d="M19.76,6.13c-4.94,2.01-10.57,2.01-15.51,0c-0.71-0.3-1.55-0.04-1.98,0.66c-1.41,2.6,3.27,3.76,4.94,4.37
33
26
  c0.4,0.11,0.81,0.2,1.22,0.28c0.56,0.11,0.92,0.67,0.79,1.25c-0.79,3.66-1.96,9.1-1.96,9.1c-0.46,2.27,2.72,3.15,3.39,0.92L12,17.93
@@ -1,13 +1,6 @@
1
1
  import React from 'react';
2
2
  import SvgIcon, { SvgIconProps } from '@digigov/react-core/SvgIcon';
3
- export interface AccessibilityTextIconProps extends SvgIconProps {
4
- /**
5
- * ref is optional.
6
- * ref prop declares the reference of the svg icon component.
7
- * It can be used to to access the DOM element and the React element.
8
- */
9
- ref?: React.Ref<SVGSVGElement>;
10
- }
3
+ export interface AccessibilityTextIconProps extends SvgIconProps {}
11
4
  /**
12
5
  * Use AccessibilityTextIcon component when you need to show web accessibility options about text.
13
6
  */
@@ -2,13 +2,7 @@ import React from 'react';
2
2
  import Base, { BaseProps } from '@digigov/react-core/Base';
3
3
  import clsx from 'clsx';
4
4
  export interface AccordionSectionProps extends BaseProps<'details'> {
5
- /**
6
- * open is optional. The default value is false.
7
- * Add this prop when an AccordionSection should be open.
8
- */
9
- open?: boolean;
10
-
11
- /**
5
+ /*
12
6
  * border is optional. The default value is true.
13
7
  * In order to remove top and bottom border, change this value to false.
14
8
  */
@@ -2,19 +2,14 @@ import React from 'react';
2
2
  import Base, { BaseProps } from '@digigov/react-core/Base';
3
3
  import clsx from 'clsx';
4
4
 
5
- export interface AccordionSectionSummaryProps extends BaseProps<'summary'> {
6
- ariaLevel?: 1 | 2 | 3 | 4 | 5 | 6;
7
- }
5
+ export interface AccordionSectionSummaryProps extends BaseProps<'summary'> {}
8
6
  /**
9
7
  * AccordionSectionSummary is used as a wrapper component for AccordionSectionSummaryHeading.
10
8
  */
11
9
  export const AccordionSectionSummary = React.forwardRef<
12
10
  HTMLDivElement,
13
11
  AccordionSectionSummaryProps
14
- >(function AccordionSectionSummary(
15
- { className, ariaLevel = 2, children, ...props },
16
- ref
17
- ) {
12
+ >(function AccordionSectionSummary({ className, children, ...props }, ref) {
18
13
  return (
19
14
  <Base
20
15
  as="summary"
@@ -23,7 +18,6 @@ export const AccordionSectionSummary = React.forwardRef<
23
18
  'govgr-accordion__section-summary': true,
24
19
  })}
25
20
  role="heading"
26
- aria-level={ariaLevel}
27
21
  {...props}
28
22
  >
29
23
  {children}
@@ -2,11 +2,6 @@ import React from 'react';
2
2
  import SvgIcon, { SvgIconProps } from '@digigov/react-core/SvgIcon';
3
3
  import clsx from 'clsx';
4
4
  export interface ArrowIconProps extends SvgIconProps {
5
- ref?: React.Ref<SVGSVGElement>;
6
- /**
7
- * direction is optional.
8
- * direction prop declares the direction of the svg icon.
9
- */
10
5
  direction?: 'up' | 'right' | 'down' | 'left';
11
6
  }
12
7
  /**
@@ -2,18 +2,13 @@ import React from 'react';
2
2
  import Base, { BaseProps } from '@digigov/react-core/Base';
3
3
  import clsx from 'clsx';
4
4
  import CaretIcon from '@digigov/react-core/CaretIcon';
5
- export interface BackLinkProps extends BaseProps<'a'> {
6
- /**
7
- * href is optional.
8
- */
9
- href?: string;
10
- }
5
+ export interface BackLinkProps extends BaseProps<'a'> {}
11
6
  /**
12
7
  * Use BackLink component to help users go back to the previous page in a multi-page transaction.
13
8
  */
14
9
  export const BackLink = React.forwardRef<HTMLAnchorElement, BackLinkProps>(
15
10
  function BackLink(
16
- { href, tabIndex = 0, printHidden= true, className, children, ...props },
11
+ { href, tabIndex = 0, printHidden = true, className, children, ...props },
17
12
  ref
18
13
  ) {
19
14
  return (
@@ -18,7 +18,7 @@ type PolymorphicComponentProp<
18
18
  type PolymorphicComponentPropWithRef<
19
19
  C extends React.ElementType,
20
20
  Props = Record<string, unknown>
21
- > = PolymorphicComponentProp<C, Props> & { ref?: PolymorphicRef<C> };
21
+ > = PolymorphicComponentProp<C, Props> & { ref?: any };
22
22
 
23
23
  // This is the type for the "ref" only
24
24
  type PolymorphicRef<C extends React.ElementType> = React.ComponentPropsWithRef<
@@ -2,12 +2,6 @@ import React from 'react';
2
2
  import SvgIcon, { SvgIconProps } from '@digigov/react-core/SvgIcon';
3
3
  import clsx from 'clsx';
4
4
  export interface BurgerIconProps extends SvgIconProps {
5
- /**
6
- * ref is optional.
7
- * ref prop declares the reference of the svg icon component.
8
- * It can be used to to access the DOM element and the React element.
9
- */
10
- ref?: React.Ref<SVGSVGElement>;
11
5
  /**
12
6
  * active is optional.
13
7
  * The default is 'false'.
@@ -11,11 +11,6 @@ export interface ButtonProps extends BaseProps<'button'> {
11
11
  * The default value is 'primary'.
12
12
  */
13
13
  color?: 'primary' | 'secondary' | 'warning';
14
-
15
- /**
16
- * disabled is optional.
17
- */
18
- disabled?: boolean;
19
14
  /**
20
15
  * variant is optional.
21
16
  */
@@ -30,7 +25,7 @@ export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
30
25
  color = 'primary',
31
26
  variant = 'button',
32
27
  disabled,
33
- printHidden = true,
28
+ printHidden = true,
34
29
  className,
35
30
  children,
36
31
  ...props
@@ -3,16 +3,17 @@ import clsx from 'clsx';
3
3
  import ButtonLink, { ButtonLinkProps } from '@digigov/react-core/ButtonLink';
4
4
  import ArrowIcon from '@digigov/react-core/ArrowIcon';
5
5
 
6
- export interface CallToActionProps extends ButtonLinkProps {
7
- ref?: React.Ref<HTMLAnchorElement>;
8
- }
6
+ export interface CallToActionProps extends ButtonLinkProps {}
9
7
  /**
10
8
  * Use this button for the main call to action on your service’s start page.
11
9
  */
12
10
  export const CallToAction = React.forwardRef<
13
11
  HTMLAnchorElement,
14
12
  CallToActionProps
15
- >(function CallToAction({ printHidden = true, className, children, ...props }, ref) {
13
+ >(function CallToAction(
14
+ { printHidden = true, className, children, ...props },
15
+ ref
16
+ ) {
16
17
  return (
17
18
  <ButtonLink
18
19
  ref={ref}
@@ -0,0 +1,16 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`renders the CaretContainer with no props 1`] = `
4
+ <ForwardRef(CaretContainer)>
5
+ <ForwardRef(Base)
6
+ as="div"
7
+ className="govgr-caret-container"
8
+ >
9
+ <div
10
+ className="govgr-caret-container"
11
+ >
12
+ hello
13
+ </div>
14
+ </ForwardRef(Base)>
15
+ </ForwardRef(CaretContainer)>
16
+ `;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { mount } from 'enzyme';
3
+
4
+ import CaretContainer from '@digigov/react-core/CaretContainer';
5
+
6
+ it('renders the CaretContainer with no props', () => {
7
+ expect(mount(<CaretContainer>hello</CaretContainer>)).toMatchSnapshot();
8
+ });
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ import Base, { BaseProps } from '@digigov/react-core/Base';
3
+ import clsx from 'clsx';
4
+
5
+ export interface CaretContainerProps extends BaseProps<'div'> {}
6
+ /**
7
+ *
8
+ * Use CaretContainer to wrap CaretIcon like ascending descending style.
9
+ *
10
+ */
11
+ export const CaretContainer = React.forwardRef<
12
+ HTMLDivElement,
13
+ CaretContainerProps
14
+ >(function CaretContainer({ className, children, ...props }, ref) {
15
+ return (
16
+ <Base
17
+ as="div"
18
+ ref={ref}
19
+ className={clsx(className, {
20
+ 'govgr-caret-container': true,
21
+ })}
22
+ {...props}
23
+ >
24
+ {children}
25
+ </Base>
26
+ );
27
+ });
28
+
29
+ export default CaretContainer;