@digigov/react-core 1.0.0-290a96e2 → 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.
- package/Blockquote/__snapshots__/index.test.tsx.snap +17 -0
- package/Blockquote/index.d.ts +8 -1
- package/Blockquote/index.js +3 -2
- package/Blockquote/index.test.js +8 -0
- package/Card/__snapshots__/index.test.tsx.snap +21 -0
- package/Card/index.d.ts +8 -1
- package/Card/index.js +3 -2
- package/Card/index.test.js +23 -15
- package/ImageLogo/__snapshots__/index.test.tsx.snap +36 -0
- package/ImageLogo/index.d.ts +20 -0
- package/ImageLogo/index.js +45 -0
- package/ImageLogo/index.test.d.ts +1 -0
- package/ImageLogo/index.test.js +26 -0
- package/ImageLogoSet/__snapshots__/index.test.tsx.snap +118 -0
- package/ImageLogoSet/index.d.ts +20 -0
- package/ImageLogoSet/index.js +45 -0
- package/ImageLogoSet/index.test.d.ts +1 -0
- package/ImageLogoSet/index.test.js +29 -0
- package/KitchenSinkCard/index.d.ts +1 -1
- package/RadioItem/__snapshots__/index.test.tsx.snap +2 -2
- package/RadioItem/index.d.ts +4 -4
- package/RadioItem/index.js +3 -3
- package/RadioItem/index.test.js +4 -4
- package/StepNav/__snapshots__/index.test.tsx.snap +17 -0
- package/StepNav/index.d.ts +8 -1
- package/StepNav/index.js +3 -2
- package/StepNav/index.test.js +8 -0
- package/TaskList/__snapshots__/index.test.tsx.snap +17 -0
- package/TaskList/index.d.ts +8 -1
- package/TaskList/index.js +3 -2
- package/TaskList/index.test.js +8 -0
- package/Timeline/__snapshots__/index.test.tsx.snap +17 -0
- package/Timeline/index.d.ts +2 -2
- package/Timeline/index.js +2 -3
- package/Timeline/index.test.js +8 -0
- package/Unpurge/index.js +1 -1
- package/es/Blockquote/__snapshots__/index.test.tsx.snap +17 -0
- package/es/Blockquote/index.js +3 -2
- package/es/Blockquote/index.test.js +8 -0
- package/es/Card/__snapshots__/index.test.tsx.snap +21 -0
- package/es/Card/index.js +3 -2
- package/es/Card/index.test.js +23 -15
- package/es/ImageLogo/__snapshots__/index.test.tsx.snap +36 -0
- package/es/ImageLogo/index.js +29 -0
- package/es/ImageLogo/index.test.js +20 -0
- package/es/ImageLogoSet/__snapshots__/index.test.tsx.snap +118 -0
- package/es/ImageLogoSet/index.js +30 -0
- package/es/ImageLogoSet/index.test.js +23 -0
- package/es/RadioItem/__snapshots__/index.test.tsx.snap +2 -2
- package/es/RadioItem/index.js +3 -3
- package/es/RadioItem/index.test.js +4 -4
- package/es/StepNav/__snapshots__/index.test.tsx.snap +17 -0
- package/es/StepNav/index.js +3 -2
- package/es/StepNav/index.test.js +8 -0
- package/es/TaskList/__snapshots__/index.test.tsx.snap +17 -0
- package/es/TaskList/index.js +3 -2
- package/es/TaskList/index.test.js +8 -0
- package/es/Timeline/__snapshots__/index.test.tsx.snap +17 -0
- package/es/Timeline/index.js +2 -3
- package/es/Timeline/index.test.js +8 -0
- package/es/Unpurge/index.js +1 -1
- package/es/index.js +2 -1
- package/es/registry.js +4 -0
- package/esm/Blockquote/__snapshots__/index.test.tsx.snap +17 -0
- package/esm/Blockquote/index.js +3 -2
- package/esm/Blockquote/index.test.js +8 -0
- package/esm/Card/__snapshots__/index.test.tsx.snap +21 -0
- package/esm/Card/index.js +3 -2
- package/esm/Card/index.test.js +23 -15
- package/esm/ImageLogo/__snapshots__/index.test.tsx.snap +36 -0
- package/esm/ImageLogo/index.js +29 -0
- package/esm/ImageLogo/index.test.js +20 -0
- package/esm/ImageLogoSet/__snapshots__/index.test.tsx.snap +118 -0
- package/esm/ImageLogoSet/index.js +30 -0
- package/esm/ImageLogoSet/index.test.js +23 -0
- package/esm/RadioItem/__snapshots__/index.test.tsx.snap +2 -2
- package/esm/RadioItem/index.js +3 -3
- package/esm/RadioItem/index.test.js +4 -4
- package/esm/StepNav/__snapshots__/index.test.tsx.snap +17 -0
- package/esm/StepNav/index.js +3 -2
- package/esm/StepNav/index.test.js +8 -0
- package/esm/TaskList/__snapshots__/index.test.tsx.snap +17 -0
- package/esm/TaskList/index.js +3 -2
- package/esm/TaskList/index.test.js +8 -0
- package/esm/Timeline/__snapshots__/index.test.tsx.snap +17 -0
- package/esm/Timeline/index.js +2 -3
- package/esm/Timeline/index.test.js +8 -0
- package/esm/Unpurge/index.js +1 -1
- package/esm/index.js +3 -2
- package/esm/registry.js +4 -0
- package/index.d.ts +2 -1
- package/index.js +17 -4
- package/package.json +3 -3
- package/registry.d.ts +2 -0
- package/registry.js +6 -0
- package/src/Blockquote/__snapshots__/index.test.tsx.snap +17 -0
- package/src/Blockquote/index.test.tsx +4 -0
- package/src/Blockquote/index.tsx +11 -2
- package/src/Card/__snapshots__/index.test.tsx.snap +21 -0
- package/src/Card/index.test.tsx +3 -0
- package/src/Card/index.tsx +9 -1
- package/src/ImageLogo/__snapshots__/index.test.tsx.snap +36 -0
- package/src/ImageLogo/index.test.tsx +13 -0
- package/src/ImageLogo/index.tsx +43 -0
- package/src/ImageLogoSet/__snapshots__/index.test.tsx.snap +118 -0
- package/src/ImageLogoSet/index.test.tsx +17 -0
- package/src/ImageLogoSet/index.tsx +36 -0
- package/src/RadioItem/__snapshots__/index.test.tsx.snap +2 -2
- package/src/RadioItem/index.test.tsx +4 -4
- package/src/RadioItem/index.tsx +5 -5
- package/src/StepNav/__snapshots__/index.test.tsx.snap +17 -0
- package/src/StepNav/index.test.tsx +4 -0
- package/src/StepNav/index.tsx +11 -2
- package/src/TaskList/__snapshots__/index.test.tsx.snap +17 -0
- package/src/TaskList/index.test.tsx +4 -0
- package/src/TaskList/index.tsx +11 -2
- package/src/Timeline/__snapshots__/index.test.tsx.snap +17 -0
- package/src/Timeline/index.test.tsx +4 -0
- package/src/Timeline/index.tsx +4 -4
- package/src/Unpurge/index.tsx +2 -0
- package/src/index.ts +2 -1
- package/src/registry.js +4 -0
package/es/Blockquote/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 = ["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/es/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));
|
package/es/Card/index.test.js
CHANGED
|
@@ -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
|
-
|
|
20
|
+
dense: true
|
|
21
21
|
}, "hello");
|
|
22
22
|
|
|
23
|
-
it('renders the Card with
|
|
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: "
|
|
28
|
+
variant: "border"
|
|
29
29
|
}, "hello");
|
|
30
30
|
|
|
31
|
-
it('renders the Card with variant="
|
|
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: "
|
|
36
|
+
variant: "divider"
|
|
37
37
|
}, "hello");
|
|
38
38
|
|
|
39
|
-
it('renders the Card with variant="
|
|
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(
|
|
57
|
+
expect(mount(_ref7)).toMatchSnapshot();
|
|
50
58
|
});
|
|
51
59
|
|
|
52
|
-
var
|
|
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(
|
|
66
|
+
expect(mount(_ref8)).toMatchSnapshot();
|
|
59
67
|
});
|
|
60
68
|
|
|
61
|
-
var
|
|
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(
|
|
75
|
+
expect(mount(_ref9)).toMatchSnapshot();
|
|
68
76
|
});
|
|
69
77
|
|
|
70
|
-
var
|
|
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(
|
|
84
|
+
expect(mount(_ref10)).toMatchSnapshot();
|
|
77
85
|
});
|
|
78
86
|
|
|
79
|
-
var
|
|
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(
|
|
94
|
+
expect(mount(_ref11)).toMatchSnapshot();
|
|
87
95
|
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`renders the Hint with variant and src props 1`] = `
|
|
4
|
+
<ForwardRef(ImageLogo)
|
|
5
|
+
src="logo.png"
|
|
6
|
+
variant="dark"
|
|
7
|
+
>
|
|
8
|
+
<ForwardRef(Base)
|
|
9
|
+
as="img"
|
|
10
|
+
className="govgr-image-logo--dark"
|
|
11
|
+
src="logo.png"
|
|
12
|
+
>
|
|
13
|
+
<img
|
|
14
|
+
className="govgr-image-logo--dark"
|
|
15
|
+
src="logo.png"
|
|
16
|
+
/>
|
|
17
|
+
</ForwardRef(Base)>
|
|
18
|
+
</ForwardRef(ImageLogo)>
|
|
19
|
+
`;
|
|
20
|
+
|
|
21
|
+
exports[`renders the Hint with src prop 1`] = `
|
|
22
|
+
<ForwardRef(ImageLogo)
|
|
23
|
+
src="logo.png"
|
|
24
|
+
>
|
|
25
|
+
<ForwardRef(Base)
|
|
26
|
+
as="img"
|
|
27
|
+
className="govgr-image-logo--light"
|
|
28
|
+
src="logo.png"
|
|
29
|
+
>
|
|
30
|
+
<img
|
|
31
|
+
className="govgr-image-logo--light"
|
|
32
|
+
src="logo.png"
|
|
33
|
+
/>
|
|
34
|
+
</ForwardRef(Base)>
|
|
35
|
+
</ForwardRef(ImageLogo)>
|
|
36
|
+
`;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["lang", "src", "variant", "className", "children"];
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
import Base from '@digigov/react-core/Base';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* ImageLogo is used as a generic component for digigov images.
|
|
10
|
+
* This component can't have children.
|
|
11
|
+
*/
|
|
12
|
+
export var ImageLogo = /*#__PURE__*/React.forwardRef(function ImageLogo(_ref, ref) {
|
|
13
|
+
var lang = _ref.lang,
|
|
14
|
+
src = _ref.src,
|
|
15
|
+
variant = _ref.variant,
|
|
16
|
+
className = _ref.className,
|
|
17
|
+
children = _ref.children,
|
|
18
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
19
|
+
|
|
20
|
+
console.log('src is', src);
|
|
21
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Base, _extends({
|
|
22
|
+
as: "img",
|
|
23
|
+
src: src,
|
|
24
|
+
ref: ref,
|
|
25
|
+
printHidden: true,
|
|
26
|
+
className: clsx(className, variant === undefined && 'govgr-image-logo', variant !== undefined && "govgr-image-logo--".concat(variant))
|
|
27
|
+
}, props)));
|
|
28
|
+
});
|
|
29
|
+
export default ImageLogo;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { mount } from 'enzyme';
|
|
3
|
+
import ImageLogo from '@digigov/react-core/ImageLogo';
|
|
4
|
+
|
|
5
|
+
var _ref = /*#__PURE__*/React.createElement(ImageLogo, {
|
|
6
|
+
src: "logo.png"
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
it('renders the Hint with src prop', function () {
|
|
10
|
+
expect(mount(_ref)).toMatchSnapshot();
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
var _ref2 = /*#__PURE__*/React.createElement(ImageLogo, {
|
|
14
|
+
variant: "dark",
|
|
15
|
+
src: "logo.png"
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('renders the Hint with variant and src props', function () {
|
|
19
|
+
expect(mount(_ref2)).toMatchSnapshot();
|
|
20
|
+
});
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`renders the Hint with variants=[light, dark] and src props 1`] = `
|
|
4
|
+
<ForwardRef(ImageLogoSet)
|
|
5
|
+
src="logo.png"
|
|
6
|
+
variants={
|
|
7
|
+
Array [
|
|
8
|
+
"light",
|
|
9
|
+
"dark",
|
|
10
|
+
]
|
|
11
|
+
}
|
|
12
|
+
>
|
|
13
|
+
<ForwardRef(ImageLogo)
|
|
14
|
+
key="light"
|
|
15
|
+
src="logo--light.png"
|
|
16
|
+
variant="light"
|
|
17
|
+
>
|
|
18
|
+
<ForwardRef(Base)
|
|
19
|
+
as="img"
|
|
20
|
+
className="govgr-image-logo--light"
|
|
21
|
+
printHidden={true}
|
|
22
|
+
src="logo--light.png"
|
|
23
|
+
>
|
|
24
|
+
<img
|
|
25
|
+
className="govgr-image-logo--light govgr-print-hidden"
|
|
26
|
+
src="logo--light.png"
|
|
27
|
+
/>
|
|
28
|
+
</ForwardRef(Base)>
|
|
29
|
+
</ForwardRef(ImageLogo)>
|
|
30
|
+
<ForwardRef(ImageLogo)
|
|
31
|
+
key="dark"
|
|
32
|
+
src="logo--dark.png"
|
|
33
|
+
variant="dark"
|
|
34
|
+
>
|
|
35
|
+
<ForwardRef(Base)
|
|
36
|
+
as="img"
|
|
37
|
+
className="govgr-image-logo--dark"
|
|
38
|
+
printHidden={true}
|
|
39
|
+
src="logo--dark.png"
|
|
40
|
+
>
|
|
41
|
+
<img
|
|
42
|
+
className="govgr-image-logo--dark govgr-print-hidden"
|
|
43
|
+
src="logo--dark.png"
|
|
44
|
+
/>
|
|
45
|
+
</ForwardRef(Base)>
|
|
46
|
+
</ForwardRef(ImageLogo)>
|
|
47
|
+
</ForwardRef(ImageLogoSet)>
|
|
48
|
+
`;
|
|
49
|
+
|
|
50
|
+
exports[`renders the Hint with variants=[light] and src props 1`] = `
|
|
51
|
+
<ForwardRef(ImageLogoSet)
|
|
52
|
+
src="logo.png"
|
|
53
|
+
variants={
|
|
54
|
+
Array [
|
|
55
|
+
"light",
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
>
|
|
59
|
+
<ForwardRef(ImageLogo)
|
|
60
|
+
key="light"
|
|
61
|
+
src="logo--light.png"
|
|
62
|
+
variant="light"
|
|
63
|
+
>
|
|
64
|
+
<ForwardRef(Base)
|
|
65
|
+
as="img"
|
|
66
|
+
className="govgr-image-logo--light"
|
|
67
|
+
printHidden={true}
|
|
68
|
+
src="logo--light.png"
|
|
69
|
+
>
|
|
70
|
+
<img
|
|
71
|
+
className="govgr-image-logo--light govgr-print-hidden"
|
|
72
|
+
src="logo--light.png"
|
|
73
|
+
/>
|
|
74
|
+
</ForwardRef(Base)>
|
|
75
|
+
</ForwardRef(ImageLogo)>
|
|
76
|
+
</ForwardRef(ImageLogoSet)>
|
|
77
|
+
`;
|
|
78
|
+
|
|
79
|
+
exports[`renders the Hint with src prop 1`] = `
|
|
80
|
+
<ForwardRef(ImageLogoSet)
|
|
81
|
+
src="logo.png"
|
|
82
|
+
>
|
|
83
|
+
<ForwardRef(ImageLogo)
|
|
84
|
+
key="dark"
|
|
85
|
+
src="logo--dark.png"
|
|
86
|
+
variant="dark"
|
|
87
|
+
>
|
|
88
|
+
<ForwardRef(Base)
|
|
89
|
+
as="img"
|
|
90
|
+
className="govgr-image-logo--dark"
|
|
91
|
+
printHidden={true}
|
|
92
|
+
src="logo--dark.png"
|
|
93
|
+
>
|
|
94
|
+
<img
|
|
95
|
+
className="govgr-image-logo--dark govgr-print-hidden"
|
|
96
|
+
src="logo--dark.png"
|
|
97
|
+
/>
|
|
98
|
+
</ForwardRef(Base)>
|
|
99
|
+
</ForwardRef(ImageLogo)>
|
|
100
|
+
<ForwardRef(ImageLogo)
|
|
101
|
+
key="light"
|
|
102
|
+
src="logo--light.png"
|
|
103
|
+
variant="light"
|
|
104
|
+
>
|
|
105
|
+
<ForwardRef(Base)
|
|
106
|
+
as="img"
|
|
107
|
+
className="govgr-image-logo--light"
|
|
108
|
+
printHidden={true}
|
|
109
|
+
src="logo--light.png"
|
|
110
|
+
>
|
|
111
|
+
<img
|
|
112
|
+
className="govgr-image-logo--light govgr-print-hidden"
|
|
113
|
+
src="logo--light.png"
|
|
114
|
+
/>
|
|
115
|
+
</ForwardRef(Base)>
|
|
116
|
+
</ForwardRef(ImageLogo)>
|
|
117
|
+
</ForwardRef(ImageLogoSet)>
|
|
118
|
+
`;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["lang", "src", "variants", "className", "children"];
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import ImageLogo from '@digigov/react-core/ImageLogo';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* ImageLogoSet is used as image inverter depending the theme (dark, light).
|
|
9
|
+
* This component can't have children.
|
|
10
|
+
*/
|
|
11
|
+
export var ImageLogoSet = /*#__PURE__*/React.forwardRef(function ImageLogoSet(_ref, ref) {
|
|
12
|
+
var lang = _ref.lang,
|
|
13
|
+
src = _ref.src,
|
|
14
|
+
_ref$variants = _ref.variants,
|
|
15
|
+
variants = _ref$variants === void 0 ? ['dark', 'light'] : _ref$variants,
|
|
16
|
+
className = _ref.className,
|
|
17
|
+
children = _ref.children,
|
|
18
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
19
|
+
|
|
20
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, variants.map(function (variant) {
|
|
21
|
+
var imageSrc = src === null || src === void 0 ? void 0 : src.replace(/(\.[^\.]+)$/, "--".concat(variant, "$1"));
|
|
22
|
+
return /*#__PURE__*/React.createElement(ImageLogo, _extends({
|
|
23
|
+
key: variant,
|
|
24
|
+
ref: ref,
|
|
25
|
+
variant: variant,
|
|
26
|
+
src: imageSrc
|
|
27
|
+
}, props));
|
|
28
|
+
}));
|
|
29
|
+
});
|
|
30
|
+
export default ImageLogoSet;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { mount } from 'enzyme';
|
|
3
|
+
import ImageLogoSet from '@digigov/react-core/ImageLogoSet';
|
|
4
|
+
|
|
5
|
+
var _ref = /*#__PURE__*/React.createElement(ImageLogoSet, {
|
|
6
|
+
src: "logo.png"
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
it('renders the Hint with src prop', function () {
|
|
10
|
+
expect(mount(_ref)).toMatchSnapshot();
|
|
11
|
+
});
|
|
12
|
+
it('renders the Hint with variants=[light] and src props', function () {
|
|
13
|
+
expect(mount( /*#__PURE__*/React.createElement(ImageLogoSet, {
|
|
14
|
+
variants: ['light'],
|
|
15
|
+
src: "logo.png"
|
|
16
|
+
}))).toMatchSnapshot();
|
|
17
|
+
});
|
|
18
|
+
it('renders the Hint with variants=[light, dark] and src props', function () {
|
|
19
|
+
expect(mount( /*#__PURE__*/React.createElement(ImageLogoSet, {
|
|
20
|
+
variants: ['light', 'dark'],
|
|
21
|
+
src: "logo.png"
|
|
22
|
+
}))).toMatchSnapshot();
|
|
23
|
+
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`renders the RadioItem \`divider\` props 1`] = `
|
|
4
4
|
<ForwardRef(RadioItem)
|
|
5
|
-
|
|
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
|
-
|
|
94
|
+
dividerText="ή"
|
|
95
95
|
name="name"
|
|
96
96
|
value="someValue"
|
|
97
97
|
>
|
package/es/RadioItem/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 = ["
|
|
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
|
|
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,
|
|
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
|
-
|
|
28
|
+
dividerText: 'ή'
|
|
29
29
|
}, "hello");
|
|
30
30
|
|
|
31
|
-
it('renders the RadioItem `
|
|
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
|
-
|
|
65
|
+
dividerText: 'ή',
|
|
66
66
|
disabled: true
|
|
67
67
|
}, "hello");
|
|
68
68
|
|
|
69
|
-
it('renders the RadioItem with `name`, `disabled`, `
|
|
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)
|
package/es/StepNav/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 = ["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;
|
package/es/StepNav/index.test.js
CHANGED
|
@@ -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)
|
package/es/TaskList/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 = ["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)
|