@digigov/react-core 1.0.0-266e80f3 → 1.0.0-3bfc7d37

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 (82) hide show
  1. package/Blockquote/__snapshots__/index.test.tsx.snap +17 -0
  2. package/Blockquote/index.d.ts +8 -1
  3. package/Blockquote/index.js +3 -2
  4. package/Blockquote/index.test.js +8 -0
  5. package/Card/__snapshots__/index.test.tsx.snap +21 -0
  6. package/Card/index.d.ts +8 -1
  7. package/Card/index.js +3 -2
  8. package/Card/index.test.js +23 -15
  9. package/KitchenSinkCard/index.d.ts +1 -1
  10. package/RadioItem/__snapshots__/index.test.tsx.snap +2 -2
  11. package/RadioItem/index.d.ts +4 -4
  12. package/RadioItem/index.js +3 -3
  13. package/RadioItem/index.test.js +4 -4
  14. package/StepNav/__snapshots__/index.test.tsx.snap +17 -0
  15. package/StepNav/index.d.ts +8 -1
  16. package/StepNav/index.js +3 -2
  17. package/StepNav/index.test.js +8 -0
  18. package/TaskList/__snapshots__/index.test.tsx.snap +17 -0
  19. package/TaskList/index.d.ts +8 -1
  20. package/TaskList/index.js +3 -2
  21. package/TaskList/index.test.js +8 -0
  22. package/Timeline/__snapshots__/index.test.tsx.snap +17 -0
  23. package/Timeline/index.d.ts +2 -2
  24. package/Timeline/index.js +2 -3
  25. package/Timeline/index.test.js +8 -0
  26. package/es/Blockquote/__snapshots__/index.test.tsx.snap +17 -0
  27. package/es/Blockquote/index.js +3 -2
  28. package/es/Blockquote/index.test.js +8 -0
  29. package/es/Card/__snapshots__/index.test.tsx.snap +21 -0
  30. package/es/Card/index.js +3 -2
  31. package/es/Card/index.test.js +23 -15
  32. package/es/RadioItem/__snapshots__/index.test.tsx.snap +2 -2
  33. package/es/RadioItem/index.js +3 -3
  34. package/es/RadioItem/index.test.js +4 -4
  35. package/es/StepNav/__snapshots__/index.test.tsx.snap +17 -0
  36. package/es/StepNav/index.js +3 -2
  37. package/es/StepNav/index.test.js +8 -0
  38. package/es/TaskList/__snapshots__/index.test.tsx.snap +17 -0
  39. package/es/TaskList/index.js +3 -2
  40. package/es/TaskList/index.test.js +8 -0
  41. package/es/Timeline/__snapshots__/index.test.tsx.snap +17 -0
  42. package/es/Timeline/index.js +2 -3
  43. package/es/Timeline/index.test.js +8 -0
  44. package/esm/Blockquote/__snapshots__/index.test.tsx.snap +17 -0
  45. package/esm/Blockquote/index.js +3 -2
  46. package/esm/Blockquote/index.test.js +8 -0
  47. package/esm/Card/__snapshots__/index.test.tsx.snap +21 -0
  48. package/esm/Card/index.js +3 -2
  49. package/esm/Card/index.test.js +23 -15
  50. package/esm/RadioItem/__snapshots__/index.test.tsx.snap +2 -2
  51. package/esm/RadioItem/index.js +3 -3
  52. package/esm/RadioItem/index.test.js +4 -4
  53. package/esm/StepNav/__snapshots__/index.test.tsx.snap +17 -0
  54. package/esm/StepNav/index.js +3 -2
  55. package/esm/StepNav/index.test.js +8 -0
  56. package/esm/TaskList/__snapshots__/index.test.tsx.snap +17 -0
  57. package/esm/TaskList/index.js +3 -2
  58. package/esm/TaskList/index.test.js +8 -0
  59. package/esm/Timeline/__snapshots__/index.test.tsx.snap +17 -0
  60. package/esm/Timeline/index.js +2 -3
  61. package/esm/Timeline/index.test.js +8 -0
  62. package/esm/index.js +1 -1
  63. package/package.json +3 -3
  64. package/src/Blockquote/__snapshots__/index.test.tsx.snap +17 -0
  65. package/src/Blockquote/index.test.tsx +4 -0
  66. package/src/Blockquote/index.tsx +11 -2
  67. package/src/Card/__snapshots__/index.test.tsx.snap +21 -0
  68. package/src/Card/index.test.tsx +3 -0
  69. package/src/Card/index.tsx +9 -1
  70. package/src/RadioItem/__snapshots__/index.test.tsx.snap +2 -2
  71. package/src/RadioItem/index.test.tsx +4 -4
  72. package/src/RadioItem/index.tsx +5 -5
  73. package/src/StepNav/__snapshots__/index.test.tsx.snap +17 -0
  74. package/src/StepNav/index.test.tsx +4 -0
  75. package/src/StepNav/index.tsx +11 -2
  76. package/src/TaskList/__snapshots__/index.test.tsx.snap +17 -0
  77. package/src/TaskList/index.test.tsx +4 -0
  78. package/src/TaskList/index.tsx +11 -2
  79. package/src/Timeline/__snapshots__/index.test.tsx.snap +17 -0
  80. package/src/Timeline/index.test.tsx +4 -0
  81. package/src/Timeline/index.tsx +4 -4
  82. package/src/registry.js +2 -1
@@ -1,5 +1,22 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
+ exports[`renders the Blockquote with dense props 1`] = `
4
+ <ForwardRef(Blockquote)
5
+ dense={true}
6
+ >
7
+ <ForwardRef(Base)
8
+ as="blockquote"
9
+ className="govgr-blockquote--dense govgr-blockquote"
10
+ >
11
+ <blockquote
12
+ className="govgr-blockquote--dense govgr-blockquote"
13
+ >
14
+ hello
15
+ </blockquote>
16
+ </ForwardRef(Base)>
17
+ </ForwardRef(Blockquote)>
18
+ `;
19
+
3
20
  exports[`renders the Blockquote with no props 1`] = `
4
21
  <ForwardRef(Blockquote)>
5
22
  <ForwardRef(Base)
@@ -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", "children"];
3
+ var _excluded = ["className", "dense", "children"];
4
4
  import React from 'react';
5
5
  import clsx from 'clsx';
6
6
  import Base from '@digigov/react-core/Base';
@@ -10,13 +10,14 @@ import Base from '@digigov/react-core/Base';
10
10
  */
11
11
  export var Blockquote = /*#__PURE__*/React.forwardRef(function Blockquote(_ref, ref) {
12
12
  var className = _ref.className,
13
+ dense = _ref.dense,
13
14
  children = _ref.children,
14
15
  props = _objectWithoutProperties(_ref, _excluded);
15
16
 
16
17
  return /*#__PURE__*/React.createElement(Base, _extends({
17
18
  as: "blockquote",
18
19
  ref: ref,
19
- className: clsx(className, true && 'govgr-blockquote')
20
+ className: clsx(className, dense && 'govgr-blockquote--dense', true && 'govgr-blockquote')
20
21
  }, props), children);
21
22
  });
22
23
  export default Blockquote;
@@ -6,4 +6,12 @@ var _ref = /*#__PURE__*/React.createElement(Blockquote, null, "hello");
6
6
 
7
7
  it('renders the Blockquote with no props', function () {
8
8
  expect(mount(_ref)).toMatchSnapshot();
9
+ });
10
+
11
+ var _ref2 = /*#__PURE__*/React.createElement(Blockquote, {
12
+ dense: true
13
+ }, "hello");
14
+
15
+ it('renders the Blockquote with dense props', function () {
16
+ expect(mount(_ref2)).toMatchSnapshot();
9
17
  });
@@ -21,6 +21,27 @@ exports[`renders the Card with callToActon props 1`] = `
21
21
  </ForwardRef(Card)>
22
22
  `;
23
23
 
24
+ exports[`renders the Card with dense props 1`] = `
25
+ <ForwardRef(Card)
26
+ dense={true}
27
+ >
28
+ <ForwardRef(Base)
29
+ as="div"
30
+ className="govgr-card--dense govgr-card"
31
+ >
32
+ <div
33
+ className="govgr-card--dense govgr-card"
34
+ >
35
+ <div
36
+ className="govgr-card__body"
37
+ >
38
+ hello
39
+ </div>
40
+ </div>
41
+ </ForwardRef(Base)>
42
+ </ForwardRef(Card)>
43
+ `;
44
+
24
45
  exports[`renders the Card with no props 1`] = `
25
46
  <ForwardRef(Card)>
26
47
  <ForwardRef(Base)
package/esm/Card/index.js CHANGED
@@ -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", "borderColor", "callToAction", "className", "children"];
3
+ var _excluded = ["variant", "borderColor", "callToAction", "dense", "className", "children"];
4
4
  import React from 'react';
5
5
  import clsx from 'clsx';
6
6
  import Base from '@digigov/react-core/Base';
@@ -14,6 +14,7 @@ export var Card = /*#__PURE__*/React.forwardRef(function Card(_ref, ref) {
14
14
  var variant = _ref.variant,
15
15
  borderColor = _ref.borderColor,
16
16
  callToAction = _ref.callToAction,
17
+ dense = _ref.dense,
17
18
  className = _ref.className,
18
19
  children = _ref.children,
19
20
  props = _objectWithoutProperties(_ref, _excluded);
@@ -21,7 +22,7 @@ export var Card = /*#__PURE__*/React.forwardRef(function Card(_ref, ref) {
21
22
  return /*#__PURE__*/React.createElement(Base, _extends({
22
23
  as: "div",
23
24
  ref: ref,
24
- className: clsx(className, variant === 'border-top' && 'govgr-card--border-top', borderColor === 'light' && 'govgr-card--border-light', borderColor === 'dark' && 'govgr-card--border-dark', variant === 'divider' && 'govgr-card--divider', variant === 'border' && 'govgr-card--border', callToAction && 'govgr-card--cta', true && 'govgr-card')
25
+ className: clsx(className, variant === 'border-top' && 'govgr-card--border-top', borderColor === 'light' && 'govgr-card--border-light', borderColor === 'dark' && 'govgr-card--border-dark', variant === 'divider' && 'govgr-card--divider', variant === 'border' && 'govgr-card--border', callToAction && 'govgr-card--cta', dense && 'govgr-card--dense', true && 'govgr-card')
25
26
  }, props), /*#__PURE__*/React.createElement("div", {
26
27
  className: clsx(true && 'govgr-card__body')
27
28
  }, children));
@@ -17,71 +17,79 @@ it('renders the Card with callToActon props', function () {
17
17
  });
18
18
 
19
19
  var _ref3 = /*#__PURE__*/React.createElement(Card, {
20
- variant: "border"
20
+ dense: true
21
21
  }, "hello");
22
22
 
23
- it('renders the Card with variant="border" props', function () {
23
+ it('renders the Card with dense props', function () {
24
24
  expect(mount(_ref3)).toMatchSnapshot();
25
25
  });
26
26
 
27
27
  var _ref4 = /*#__PURE__*/React.createElement(Card, {
28
- variant: "divider"
28
+ variant: "border"
29
29
  }, "hello");
30
30
 
31
- it('renders the Card with variant="divider" props', function () {
31
+ it('renders the Card with variant="border" props', function () {
32
32
  expect(mount(_ref4)).toMatchSnapshot();
33
33
  });
34
34
 
35
35
  var _ref5 = /*#__PURE__*/React.createElement(Card, {
36
- variant: "border-top"
36
+ variant: "divider"
37
37
  }, "hello");
38
38
 
39
- it('renders the Card with variant="border-top" props', function () {
39
+ it('renders the Card with variant="divider" props', function () {
40
40
  expect(mount(_ref5)).toMatchSnapshot();
41
41
  });
42
42
 
43
43
  var _ref6 = /*#__PURE__*/React.createElement(Card, {
44
+ variant: "border-top"
45
+ }, "hello");
46
+
47
+ it('renders the Card with variant="border-top" props', function () {
48
+ expect(mount(_ref6)).toMatchSnapshot();
49
+ });
50
+
51
+ var _ref7 = /*#__PURE__*/React.createElement(Card, {
44
52
  variant: "border",
45
53
  borderColor: "dark"
46
54
  }, "hello");
47
55
 
48
56
  it('renders the Card with variant="border" and borderColor="dark" props', function () {
49
- expect(mount(_ref6)).toMatchSnapshot();
57
+ expect(mount(_ref7)).toMatchSnapshot();
50
58
  });
51
59
 
52
- var _ref7 = /*#__PURE__*/React.createElement(Card, {
60
+ var _ref8 = /*#__PURE__*/React.createElement(Card, {
53
61
  variant: "border",
54
62
  borderColor: "light"
55
63
  }, "hello");
56
64
 
57
65
  it('renders the Card with variant="border" and borderColor="light" props', function () {
58
- expect(mount(_ref7)).toMatchSnapshot();
66
+ expect(mount(_ref8)).toMatchSnapshot();
59
67
  });
60
68
 
61
- var _ref8 = /*#__PURE__*/React.createElement(Card, {
69
+ var _ref9 = /*#__PURE__*/React.createElement(Card, {
62
70
  variant: "border-top",
63
71
  borderColor: "dark"
64
72
  }, "hello");
65
73
 
66
74
  it('renders the Card with variant="border-top" and borderColor="dark" props', function () {
67
- expect(mount(_ref8)).toMatchSnapshot();
75
+ expect(mount(_ref9)).toMatchSnapshot();
68
76
  });
69
77
 
70
- var _ref9 = /*#__PURE__*/React.createElement(Card, {
78
+ var _ref10 = /*#__PURE__*/React.createElement(Card, {
71
79
  variant: "border-top",
72
80
  borderColor: "light"
73
81
  }, "hello");
74
82
 
75
83
  it('renders the Card with variant="border-top" and borderColor="light" props', function () {
76
- expect(mount(_ref9)).toMatchSnapshot();
84
+ expect(mount(_ref10)).toMatchSnapshot();
77
85
  });
78
86
 
79
- var _ref10 = /*#__PURE__*/React.createElement(Card, {
87
+ var _ref11 = /*#__PURE__*/React.createElement(Card, {
80
88
  variant: "border-top",
81
89
  borderColor: "dark",
82
90
  callToAction: true
83
91
  }, "hello");
84
92
 
85
93
  it('renders the Card with variant="border-top" and borderColor="dark" callToAction props', function () {
86
- expect(mount(_ref10)).toMatchSnapshot();
94
+ expect(mount(_ref11)).toMatchSnapshot();
87
95
  });
@@ -2,7 +2,7 @@
2
2
 
3
3
  exports[`renders the RadioItem \`divider\` props 1`] = `
4
4
  <ForwardRef(RadioItem)
5
- divider="ή"
5
+ dividerText="ή"
6
6
  >
7
7
  <ForwardRef(ChoiceDividerText)>
8
8
  <ForwardRef(Base)
@@ -91,7 +91,7 @@ exports[`renders the RadioItem value props 1`] = `
91
91
  exports[`renders the RadioItem with \`name\`, \`disabled\`, \`divider\` and \`value\` props 1`] = `
92
92
  <ForwardRef(RadioItem)
93
93
  disabled={true}
94
- divider="ή"
94
+ dividerText="ή"
95
95
  name="name"
96
96
  value="someValue"
97
97
  >
@@ -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 = ["divider", "name", "value", "className", "disabled", "children"];
3
+ var _excluded = ["dividerText", "name", "value", "className", "disabled", "children"];
4
4
  import React from 'react';
5
5
  import clsx from 'clsx';
6
6
  import Base from '@digigov/react-core/Base';
@@ -12,7 +12,7 @@ import LabelContainer from '@digigov/react-core/LabelContainer';
12
12
  * RadioItem component must be included inside Radio component, as a children component.
13
13
  */
14
14
  export var RadioItem = /*#__PURE__*/React.forwardRef(function RadioItem(_ref, ref) {
15
- var divider = _ref.divider,
15
+ var dividerText = _ref.dividerText,
16
16
  name = _ref.name,
17
17
  value = _ref.value,
18
18
  className = _ref.className,
@@ -21,7 +21,7 @@ export var RadioItem = /*#__PURE__*/React.forwardRef(function RadioItem(_ref, re
21
21
  children = _ref.children,
22
22
  props = _objectWithoutProperties(_ref, _excluded);
23
23
 
24
- return /*#__PURE__*/React.createElement(React.Fragment, null, divider && /*#__PURE__*/React.createElement(ChoiceDividerText, null, divider), /*#__PURE__*/React.createElement("div", {
24
+ return /*#__PURE__*/React.createElement(React.Fragment, null, dividerText && /*#__PURE__*/React.createElement(ChoiceDividerText, null, dividerText), /*#__PURE__*/React.createElement("div", {
25
25
  className: clsx(className, true && 'govgr-radios__item')
26
26
  }, /*#__PURE__*/React.createElement(LabelContainer, {
27
27
  className: clsx(disabled && 'govgr-radios__label--disabled', true && 'govgr-radios__label')
@@ -25,10 +25,10 @@ it('renders the RadioItem value props', function () {
25
25
  });
26
26
 
27
27
  var _ref4 = /*#__PURE__*/React.createElement(RadioItem, {
28
- divider: 'ή'
28
+ dividerText: 'ή'
29
29
  }, "hello");
30
30
 
31
- it('renders the RadioItem `divider` props', function () {
31
+ it('renders the RadioItem `dividerText` props', function () {
32
32
  expect(mount(_ref4)).toMatchSnapshot();
33
33
  });
34
34
 
@@ -62,10 +62,10 @@ it('renders the RadioItem with name disabled and value props', function () {
62
62
  var _ref8 = /*#__PURE__*/React.createElement(RadioItem, {
63
63
  name: 'name',
64
64
  value: 'someValue',
65
- divider: 'ή',
65
+ dividerText: 'ή',
66
66
  disabled: true
67
67
  }, "hello");
68
68
 
69
- it('renders the RadioItem with `name`, `disabled`, `divider` and `value` props', function () {
69
+ it('renders the RadioItem with `name`, `disabled`, `dividerText` and `value` props', function () {
70
70
  expect(mount(_ref8)).toMatchSnapshot();
71
71
  });
@@ -1,5 +1,22 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
+ exports[`renders the StepNav with dense props 1`] = `
4
+ <ForwardRef(StepNav)
5
+ dense={true}
6
+ >
7
+ <ForwardRef(Base)
8
+ as="div"
9
+ className="govgr-step--dense govgr-step-nav"
10
+ >
11
+ <div
12
+ className="govgr-step--dense govgr-step-nav"
13
+ >
14
+ hello
15
+ </div>
16
+ </ForwardRef(Base)>
17
+ </ForwardRef(StepNav)>
18
+ `;
19
+
3
20
  exports[`renders the StepNav with no props 1`] = `
4
21
  <ForwardRef(StepNav)>
5
22
  <ForwardRef(Base)
@@ -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", "children"];
3
+ var _excluded = ["className", "dense", "children"];
4
4
  import React from 'react';
5
5
  import clsx from 'clsx';
6
6
  import Base from '@digigov/react-core/Base';
@@ -11,13 +11,14 @@ import Base from '@digigov/react-core/Base';
11
11
  */
12
12
  export var StepNav = /*#__PURE__*/React.forwardRef(function StepNav(_ref, ref) {
13
13
  var className = _ref.className,
14
+ dense = _ref.dense,
14
15
  children = _ref.children,
15
16
  props = _objectWithoutProperties(_ref, _excluded);
16
17
 
17
18
  return /*#__PURE__*/React.createElement(Base, _extends({
18
19
  as: "div",
19
20
  ref: ref,
20
- className: clsx(className, true && 'govgr-step-nav')
21
+ className: clsx(className, dense && 'govgr-step-nav--dense', true && 'govgr-step-nav')
21
22
  }, props), children);
22
23
  });
23
24
  export default StepNav;
@@ -6,4 +6,12 @@ var _ref = /*#__PURE__*/React.createElement(StepNav, null, "hello");
6
6
 
7
7
  it('renders the StepNav with no props', function () {
8
8
  expect(mount(_ref)).toMatchSnapshot();
9
+ });
10
+
11
+ var _ref2 = /*#__PURE__*/React.createElement(StepNav, {
12
+ dense: true
13
+ }, "hello");
14
+
15
+ it('renders the StepNav with dense props', function () {
16
+ expect(mount(_ref2)).toMatchSnapshot();
9
17
  });
@@ -1,5 +1,22 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
+ exports[`renders the TaskList with dense prop 1`] = `
4
+ <ForwardRef(TaskList)
5
+ dense={true}
6
+ >
7
+ <ForwardRef(Base)
8
+ as="ol"
9
+ className="govgr-task--dense govgr-task-list"
10
+ >
11
+ <ol
12
+ className="govgr-task--dense govgr-task-list"
13
+ >
14
+ hello
15
+ </ol>
16
+ </ForwardRef(Base)>
17
+ </ForwardRef(TaskList)>
18
+ `;
19
+
3
20
  exports[`renders the TaskList with no prop 1`] = `
4
21
  <ForwardRef(TaskList)>
5
22
  <ForwardRef(Base)
@@ -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", "children"];
3
+ var _excluded = ["className", "dense", "children"];
4
4
  import React from 'react';
5
5
  import clsx from 'clsx';
6
6
  import Base from '@digigov/react-core/Base';
@@ -11,13 +11,14 @@ import Base from '@digigov/react-core/Base';
11
11
  */
12
12
  export var TaskList = /*#__PURE__*/React.forwardRef(function TaskList(_ref, ref) {
13
13
  var className = _ref.className,
14
+ dense = _ref.dense,
14
15
  children = _ref.children,
15
16
  props = _objectWithoutProperties(_ref, _excluded);
16
17
 
17
18
  return /*#__PURE__*/React.createElement(Base, _extends({
18
19
  as: "ol",
19
20
  ref: ref,
20
- className: clsx(className, true && 'govgr-task-list')
21
+ className: clsx(className, dense && 'govgr-task-list--dense', true && 'govgr-task-list')
21
22
  }, props), children);
22
23
  });
23
24
  export default TaskList;
@@ -6,4 +6,12 @@ var _ref = /*#__PURE__*/React.createElement(TaskList, null, "hello");
6
6
 
7
7
  it('renders the TaskList with no prop', function () {
8
8
  expect(mount(_ref)).toMatchSnapshot();
9
+ });
10
+
11
+ var _ref2 = /*#__PURE__*/React.createElement(TaskList, {
12
+ dense: true
13
+ }, "hello");
14
+
15
+ it('renders the TaskList with dense prop', function () {
16
+ expect(mount(_ref2)).toMatchSnapshot();
9
17
  });
@@ -1,5 +1,22 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
+ exports[`renders the Timeline with dense prop 1`] = `
4
+ <ForwardRef(Timeline)
5
+ dense={true}
6
+ >
7
+ <ForwardRef(Base)
8
+ as="ol"
9
+ className="govgr-timeline--dense govgr-timeline"
10
+ >
11
+ <ol
12
+ className="govgr-timeline--dense govgr-timeline"
13
+ >
14
+ hello
15
+ </ol>
16
+ </ForwardRef(Base)>
17
+ </ForwardRef(Timeline)>
18
+ `;
19
+
3
20
  exports[`renders the Timeline with no prop 1`] = `
4
21
  <ForwardRef(Timeline)>
5
22
  <ForwardRef(Base)
@@ -10,8 +10,7 @@ import Base from '@digigov/react-core/Base';
10
10
  * This component must contain TimelineItem component.
11
11
  */
12
12
  export var Timeline = /*#__PURE__*/React.forwardRef(function Timeline(_ref, ref) {
13
- var _ref$dense = _ref.dense,
14
- dense = _ref$dense === void 0 ? true : _ref$dense,
13
+ var dense = _ref.dense,
15
14
  className = _ref.className,
16
15
  children = _ref.children,
17
16
  props = _objectWithoutProperties(_ref, _excluded);
@@ -19,7 +18,7 @@ export var Timeline = /*#__PURE__*/React.forwardRef(function Timeline(_ref, ref)
19
18
  return /*#__PURE__*/React.createElement(Base, _extends({
20
19
  as: "ol",
21
20
  ref: ref,
22
- className: clsx(className, !dense && 'govgr-timeline--spaced', true && 'govgr-timeline')
21
+ className: clsx(className, dense && 'govgr-timeline--dense', true && 'govgr-timeline')
23
22
  }, props), children);
24
23
  });
25
24
  export default Timeline;
@@ -6,4 +6,12 @@ var _ref = /*#__PURE__*/React.createElement(Timeline, null, "hello");
6
6
 
7
7
  it('renders the Timeline with no prop', function () {
8
8
  expect(mount(_ref)).toMatchSnapshot();
9
+ });
10
+
11
+ var _ref2 = /*#__PURE__*/React.createElement(Timeline, {
12
+ dense: true
13
+ }, "hello");
14
+
15
+ it('renders the Timeline with dense prop', function () {
16
+ expect(mount(_ref2)).toMatchSnapshot();
9
17
  });
package/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Digigov v1.0.0-266e80f3
1
+ /** @license Digigov v1.0.0-3bfc7d37
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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digigov/react-core",
3
- "version": "1.0.0-266e80f3",
3
+ "version": "1.0.0-3bfc7d37",
4
4
  "description": "@digigov react core components",
5
5
  "author": "GRNET Developers <devs@lists.grnet.gr>",
6
6
  "license": "BSD-2-Clause",
@@ -11,8 +11,8 @@
11
11
  "directory": "dist"
12
12
  },
13
13
  "peerDependencies": {
14
- "@digigov/css": "1.0.0-266e80f3",
15
- "@digigov/react-icons": "1.0.0-266e80f3",
14
+ "@digigov/css": "1.0.0-3bfc7d37",
15
+ "@digigov/react-icons": "1.0.0-3bfc7d37",
16
16
  "clsx": "1.1.1",
17
17
  "react": "^16.8.0 || ^17.0.0",
18
18
  "react-dom": "^16.8.0 || ^17.0.0"
@@ -1,5 +1,22 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
+ exports[`renders the Blockquote with dense props 1`] = `
4
+ <ForwardRef(Blockquote)
5
+ dense={true}
6
+ >
7
+ <ForwardRef(Base)
8
+ as="blockquote"
9
+ className="govgr-blockquote--dense govgr-blockquote"
10
+ >
11
+ <blockquote
12
+ className="govgr-blockquote--dense govgr-blockquote"
13
+ >
14
+ hello
15
+ </blockquote>
16
+ </ForwardRef(Base)>
17
+ </ForwardRef(Blockquote)>
18
+ `;
19
+
3
20
  exports[`renders the Blockquote with no props 1`] = `
4
21
  <ForwardRef(Blockquote)>
5
22
  <ForwardRef(Base)
@@ -6,3 +6,7 @@ import Blockquote from '@digigov/react-core/Blockquote';
6
6
  it('renders the Blockquote with no props', () => {
7
7
  expect(mount(<Blockquote>hello</Blockquote>)).toMatchSnapshot();
8
8
  });
9
+
10
+ it('renders the Blockquote with dense props', () => {
11
+ expect(mount(<Blockquote dense>hello</Blockquote>)).toMatchSnapshot();
12
+ });
@@ -2,18 +2,27 @@ import React from 'react';
2
2
  import clsx from 'clsx';
3
3
  import Base, { BaseProps } from '@digigov/react-core/Base';
4
4
 
5
- export interface BlockquoteProps extends BaseProps<'blockquote'> {}
5
+ export interface BlockquoteProps extends BaseProps<'blockquote'> {
6
+ /**
7
+ * dense is optional.
8
+ * @value true Blockquote will be dense.
9
+ * @value false
10
+ * @default false
11
+ * */
12
+ dense?: boolean;
13
+ }
6
14
  /**
7
15
  * Use Blockquote to differentiate a block of text from the content that surrounds it.
8
16
  */
9
17
  export const Blockquote = React.forwardRef<HTMLElement, BlockquoteProps>(
10
- function Blockquote({ className, children, ...props }, ref) {
18
+ function Blockquote({ className, dense, children, ...props }, ref) {
11
19
  return (
12
20
  <Base
13
21
  as="blockquote"
14
22
  ref={ref}
15
23
  className={clsx(className, {
16
24
  'govgr-blockquote': true,
25
+ 'govgr-blockquote--dense': dense,
17
26
  })}
18
27
  {...props}
19
28
  >
@@ -21,6 +21,27 @@ exports[`renders the Card with callToActon props 1`] = `
21
21
  </ForwardRef(Card)>
22
22
  `;
23
23
 
24
+ exports[`renders the Card with dense props 1`] = `
25
+ <ForwardRef(Card)
26
+ dense={true}
27
+ >
28
+ <ForwardRef(Base)
29
+ as="div"
30
+ className="govgr-card--dense govgr-card"
31
+ >
32
+ <div
33
+ className="govgr-card--dense govgr-card"
34
+ >
35
+ <div
36
+ className="govgr-card__body"
37
+ >
38
+ hello
39
+ </div>
40
+ </div>
41
+ </ForwardRef(Base)>
42
+ </ForwardRef(Card)>
43
+ `;
44
+
24
45
  exports[`renders the Card with no props 1`] = `
25
46
  <ForwardRef(Card)>
26
47
  <ForwardRef(Base)
@@ -10,6 +10,9 @@ it('renders the Card with no props', () => {
10
10
  it('renders the Card with callToActon props', () => {
11
11
  expect(mount(<Card callToAction>hello</Card>)).toMatchSnapshot();
12
12
  });
13
+ it('renders the Card with dense props', () => {
14
+ expect(mount(<Card dense>hello</Card>)).toMatchSnapshot();
15
+ });
13
16
  it('renders the Card with variant="border" props', () => {
14
17
  expect(mount(<Card variant="border">hello</Card>)).toMatchSnapshot();
15
18
  });
@@ -30,6 +30,13 @@ export interface CardProps extends BaseProps<'div'> {
30
30
  * @value false
31
31
  */
32
32
  callToAction?: boolean;
33
+ /**
34
+ * dense is optional.
35
+ * @value true Card will be dense.
36
+ * @value false
37
+ * @default false
38
+ * */
39
+ dense?: boolean;
33
40
  }
34
41
  /**
35
42
  * Cards can be used to divide and organise interface content for better understandability and readability.
@@ -37,7 +44,7 @@ export interface CardProps extends BaseProps<'div'> {
37
44
  * Use Card as parent component to wrap CardHeading, CardContent and CartAction components
38
45
  */
39
46
  export const Card = React.forwardRef<HTMLDivElement, CardProps>(function Card(
40
- { variant, borderColor, callToAction, className, children, ...props },
47
+ { variant, borderColor, callToAction, dense, className, children, ...props },
41
48
  ref
42
49
  ) {
43
50
  return (
@@ -46,6 +53,7 @@ export const Card = React.forwardRef<HTMLDivElement, CardProps>(function Card(
46
53
  ref={ref}
47
54
  className={clsx(className, {
48
55
  'govgr-card': true,
56
+ 'govgr-card--dense': dense,
49
57
  'govgr-card--border': variant === 'border',
50
58
  'govgr-card--border-top': variant === 'border-top',
51
59
  'govgr-card--divider': variant === 'divider',
@@ -2,7 +2,7 @@
2
2
 
3
3
  exports[`renders the RadioItem \`divider\` props 1`] = `
4
4
  <ForwardRef(RadioItem)
5
- divider="ή"
5
+ dividerText="ή"
6
6
  >
7
7
  <ForwardRef(ChoiceDividerText)>
8
8
  <ForwardRef(Base)
@@ -91,7 +91,7 @@ exports[`renders the RadioItem value props 1`] = `
91
91
  exports[`renders the RadioItem with \`name\`, \`disabled\`, \`divider\` and \`value\` props 1`] = `
92
92
  <ForwardRef(RadioItem)
93
93
  disabled={true}
94
- divider="ή"
94
+ dividerText="ή"
95
95
  name="name"
96
96
  value="someValue"
97
97
  >