@digigov/react-core 0.14.0 → 0.15.1
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/ArrowIcon/index.js +1 -1
- package/BackLink/__snapshots__/index.test.tsx.snap +2 -0
- package/BackLink/index.js +5 -2
- package/BurgerIcon/index.js +1 -1
- package/Button/__snapshots__/index.test.tsx.snap +26 -0
- package/Button/index.test.js +16 -0
- package/ButtonLink/__snapshots__/index.test.tsx.snap +138 -0
- package/ButtonLink/index.test.js +16 -0
- package/CHANGELOG.md +26 -1
- package/CardAction/index.js +1 -1
- package/CardHeading/index.js +1 -1
- package/CardText/index.js +1 -1
- package/CaretIcon/index.js +1 -1
- package/CheckIcon/index.js +1 -1
- package/CloseIcon/index.js +1 -1
- package/FooterImage/__snapshots__/index.test.tsx.snap +1 -0
- package/FooterImage/index.d.ts +4 -0
- package/FooterImage/index.js +6 -2
- package/GovGRLogo/__snapshots__/index.test.tsx.snap +10 -4
- package/GovGRLogo/index.js +2 -1
- package/HeaderLogo/__snapshots__/index.test.tsx.snap +0 -2
- package/HeaderLogo/index.d.ts +5 -1
- package/HeaderLogo/index.js +4 -2
- package/HeaderSecondaryLogo/__snapshots__/index.test.tsx.snap +6 -2
- package/HeaderSecondaryLogo/index.d.ts +5 -1
- package/HeaderSecondaryLogo/index.js +4 -2
- package/HeaderSecondaryLogo/index.test.js +6 -4
- package/HellenicRepublicLogo/__snapshots__/index.test.tsx.snap +2 -1
- package/HellenicRepublicLogo/index.js +3 -1
- package/Main/index.js +4 -1
- package/MoreVertIcon/index.js +1 -1
- package/Radio/index.d.ts +5 -1
- package/Radio/index.js +3 -2
- package/SkipLink/__snapshots__/index.test.tsx.snap +13 -0
- package/SkipLink/index.d.ts +10 -0
- package/SkipLink/index.js +39 -0
- package/SkipLink/index.test.d.ts +1 -0
- package/SkipLink/index.test.js +15 -0
- package/SummaryList/index.d.ts +7 -1
- package/SummaryList/index.js +4 -2
- package/UncheckIcon/index.js +1 -1
- package/es/ArrowIcon/index.js +1 -1
- package/es/BackLink/__snapshots__/index.test.tsx.snap +2 -0
- package/es/BackLink/index.js +5 -2
- package/es/BurgerIcon/index.js +1 -1
- package/es/Button/__snapshots__/index.test.tsx.snap +26 -0
- package/es/Button/index.test.js +16 -0
- package/es/ButtonLink/__snapshots__/index.test.tsx.snap +138 -0
- package/es/ButtonLink/index.test.js +16 -0
- package/es/CardAction/index.js +1 -1
- package/es/CardHeading/index.js +1 -1
- package/es/CardText/index.js +1 -1
- package/es/CaretIcon/index.js +1 -1
- package/es/CheckIcon/index.js +1 -1
- package/es/CloseIcon/index.js +1 -1
- package/es/FooterImage/__snapshots__/index.test.tsx.snap +1 -0
- package/es/FooterImage/index.js +6 -2
- package/es/GovGRLogo/__snapshots__/index.test.tsx.snap +10 -4
- package/es/GovGRLogo/index.js +2 -1
- package/es/HeaderLogo/__snapshots__/index.test.tsx.snap +0 -2
- package/es/HeaderLogo/index.js +4 -2
- package/es/HeaderSecondaryLogo/__snapshots__/index.test.tsx.snap +6 -2
- package/es/HeaderSecondaryLogo/index.js +4 -2
- package/es/HeaderSecondaryLogo/index.test.js +6 -4
- package/es/HellenicRepublicLogo/__snapshots__/index.test.tsx.snap +2 -1
- package/es/HellenicRepublicLogo/index.js +3 -1
- package/es/Main/index.js +4 -1
- package/es/MoreVertIcon/index.js +1 -1
- package/es/Radio/index.js +3 -2
- package/es/SkipLink/__snapshots__/index.test.tsx.snap +13 -0
- package/es/SkipLink/index.js +24 -0
- package/es/SkipLink/index.test.js +9 -0
- package/es/SummaryList/index.js +4 -2
- package/es/UncheckIcon/index.js +1 -1
- package/es/index.js +1 -0
- package/es/registry.js +301 -0
- package/esm/ArrowIcon/index.js +1 -1
- package/esm/BackLink/__snapshots__/index.test.tsx.snap +2 -0
- package/esm/BackLink/index.js +5 -2
- package/esm/BurgerIcon/index.js +1 -1
- package/esm/Button/__snapshots__/index.test.tsx.snap +26 -0
- package/esm/Button/index.test.js +16 -0
- package/esm/ButtonLink/__snapshots__/index.test.tsx.snap +138 -0
- package/esm/ButtonLink/index.test.js +16 -0
- package/esm/CardAction/index.js +1 -1
- package/esm/CardHeading/index.js +1 -1
- package/esm/CardText/index.js +1 -1
- package/esm/CaretIcon/index.js +1 -1
- package/esm/CheckIcon/index.js +1 -1
- package/esm/CloseIcon/index.js +1 -1
- package/esm/FooterImage/__snapshots__/index.test.tsx.snap +1 -0
- package/esm/FooterImage/index.js +6 -2
- package/esm/GovGRLogo/__snapshots__/index.test.tsx.snap +10 -4
- package/esm/GovGRLogo/index.js +2 -1
- package/esm/HeaderLogo/__snapshots__/index.test.tsx.snap +0 -2
- package/esm/HeaderLogo/index.js +4 -2
- package/esm/HeaderSecondaryLogo/__snapshots__/index.test.tsx.snap +6 -2
- package/esm/HeaderSecondaryLogo/index.js +4 -2
- package/esm/HeaderSecondaryLogo/index.test.js +6 -4
- package/esm/HellenicRepublicLogo/__snapshots__/index.test.tsx.snap +2 -1
- package/esm/HellenicRepublicLogo/index.js +3 -1
- package/esm/Main/index.js +4 -1
- package/esm/MoreVertIcon/index.js +1 -1
- package/esm/Radio/index.js +3 -2
- package/esm/SkipLink/__snapshots__/index.test.tsx.snap +13 -0
- package/esm/SkipLink/index.js +24 -0
- package/esm/SkipLink/index.test.js +9 -0
- package/esm/SummaryList/index.js +4 -2
- package/esm/UncheckIcon/index.js +1 -1
- package/esm/index.js +2 -1
- package/esm/registry.js +301 -0
- package/index.d.ts +1 -0
- package/index.js +8 -0
- package/package.json +2 -2
- package/registry.d.ts +146 -0
- package/registry.js +457 -0
package/es/BackLink/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 = ["href", "className", "children"];
|
|
3
|
+
var _excluded = ["href", "tabIndex", "className", "children"];
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import CaretIcon from '@digigov/react-core/CaretIcon';
|
|
@@ -12,6 +12,8 @@ var _ref2 = /*#__PURE__*/React.createElement(CaretIcon, null);
|
|
|
12
12
|
*/
|
|
13
13
|
export var BackLink = /*#__PURE__*/React.forwardRef(function BackLink(_ref, ref) {
|
|
14
14
|
var href = _ref.href,
|
|
15
|
+
_ref$tabIndex = _ref.tabIndex,
|
|
16
|
+
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex,
|
|
15
17
|
className = _ref.className,
|
|
16
18
|
children = _ref.children,
|
|
17
19
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -22,7 +24,8 @@ export var BackLink = /*#__PURE__*/React.forwardRef(function BackLink(_ref, ref)
|
|
|
22
24
|
!href && window.history.back();
|
|
23
25
|
},
|
|
24
26
|
ref: ref,
|
|
25
|
-
className: clsx(className, true && 'govgr-back-link')
|
|
27
|
+
className: clsx(className, true && 'govgr-back-link'),
|
|
28
|
+
tabIndex: tabIndex
|
|
26
29
|
}, props), _ref2, children);
|
|
27
30
|
});
|
|
28
31
|
export default BackLink;
|
package/es/BurgerIcon/index.js
CHANGED
|
@@ -38,7 +38,7 @@ export var BurgerIcon = /*#__PURE__*/React.forwardRef(function BurgerIcon(_ref,
|
|
|
38
38
|
return /*#__PURE__*/React.createElement(SvgIcon, _extends({
|
|
39
39
|
variant: variant,
|
|
40
40
|
size: size,
|
|
41
|
-
className: clsx(active === true && 'govgr-burger-icon--active', hidden === 's' && 'govgr-burger-icon--hidden-s', hidden === 'm' && 'govgr-burger-icon--hidden-m', hidden === 'l' && 'govgr-burger-icon--hidden-l',
|
|
41
|
+
className: clsx(className, active === true && 'govgr-burger-icon--active', hidden === 's' && 'govgr-burger-icon--hidden-s', hidden === 'm' && 'govgr-burger-icon--hidden-m', hidden === 'l' && 'govgr-burger-icon--hidden-l', true && 'govgr-burger-icon'),
|
|
42
42
|
ref: ref
|
|
43
43
|
}, props), _ref2, _ref3, _ref4);
|
|
44
44
|
});
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
+
exports[`renders the Button with ariaLabel prop 1`] = `
|
|
4
|
+
<ForwardRef(Button)
|
|
5
|
+
aria-label="button for opening menu"
|
|
6
|
+
>
|
|
7
|
+
<button
|
|
8
|
+
aria-label="button for opening menu"
|
|
9
|
+
className="govgr-btn-primary govgr-btn"
|
|
10
|
+
>
|
|
11
|
+
Menu
|
|
12
|
+
</button>
|
|
13
|
+
</ForwardRef(Button)>
|
|
14
|
+
`;
|
|
15
|
+
|
|
3
16
|
exports[`renders the Button with color=primary 1`] = `
|
|
4
17
|
<ForwardRef(Button)
|
|
5
18
|
color="primary"
|
|
@@ -113,3 +126,16 @@ exports[`renders the Button with no props 1`] = `
|
|
|
113
126
|
</button>
|
|
114
127
|
</ForwardRef(Button)>
|
|
115
128
|
`;
|
|
129
|
+
|
|
130
|
+
exports[`renders the Button with tabIndex prop 1`] = `
|
|
131
|
+
<ForwardRef(Button)
|
|
132
|
+
tabIndex={0}
|
|
133
|
+
>
|
|
134
|
+
<button
|
|
135
|
+
className="govgr-btn-primary govgr-btn"
|
|
136
|
+
tabIndex={0}
|
|
137
|
+
>
|
|
138
|
+
Menu
|
|
139
|
+
</button>
|
|
140
|
+
</ForwardRef(Button)>
|
|
141
|
+
`;
|
package/es/Button/index.test.js
CHANGED
|
@@ -73,4 +73,20 @@ var _ref9 = /*#__PURE__*/React.createElement(Button, {
|
|
|
73
73
|
|
|
74
74
|
it('renders the Button with color=warning with disabled=true', function () {
|
|
75
75
|
expect(mount(_ref9)).toMatchSnapshot();
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
var _ref10 = /*#__PURE__*/React.createElement(Button, {
|
|
79
|
+
"aria-label": "button for opening menu"
|
|
80
|
+
}, "Menu");
|
|
81
|
+
|
|
82
|
+
it('renders the Button with ariaLabel prop', function () {
|
|
83
|
+
expect(mount(_ref10)).toMatchSnapshot();
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
var _ref11 = /*#__PURE__*/React.createElement(Button, {
|
|
87
|
+
tabIndex: 0
|
|
88
|
+
}, "Menu");
|
|
89
|
+
|
|
90
|
+
it('renders the Button with tabIndex prop', function () {
|
|
91
|
+
expect(mount(_ref11)).toMatchSnapshot();
|
|
76
92
|
});
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`renders the Button with tabIndex prop 1`] = `
|
|
4
|
+
<ForwardRef(ButtonLink)
|
|
5
|
+
tabIndex={0}
|
|
6
|
+
>
|
|
7
|
+
<a
|
|
8
|
+
className="govgr-btn-primary govgr-btn"
|
|
9
|
+
tabIndex={0}
|
|
10
|
+
>
|
|
11
|
+
Menu
|
|
12
|
+
</a>
|
|
13
|
+
</ForwardRef(ButtonLink)>
|
|
14
|
+
`;
|
|
15
|
+
|
|
16
|
+
exports[`renders the ButtonLink with ariaLabel prop 1`] = `
|
|
17
|
+
<ForwardRef(ButtonLink)
|
|
18
|
+
aria-label="button for opening menu"
|
|
19
|
+
>
|
|
20
|
+
<a
|
|
21
|
+
aria-label="button for opening menu"
|
|
22
|
+
className="govgr-btn-primary govgr-btn"
|
|
23
|
+
>
|
|
24
|
+
Menu
|
|
25
|
+
</a>
|
|
26
|
+
</ForwardRef(ButtonLink)>
|
|
27
|
+
`;
|
|
28
|
+
|
|
29
|
+
exports[`renders the ButtonLink with color=primary 1`] = `
|
|
30
|
+
<ForwardRef(ButtonLink)
|
|
31
|
+
color="primary"
|
|
32
|
+
>
|
|
33
|
+
<a
|
|
34
|
+
className="govgr-btn-primary govgr-btn"
|
|
35
|
+
>
|
|
36
|
+
hello
|
|
37
|
+
</a>
|
|
38
|
+
</ForwardRef(ButtonLink)>
|
|
39
|
+
`;
|
|
40
|
+
|
|
41
|
+
exports[`renders the ButtonLink with color=primary with href=# 1`] = `
|
|
42
|
+
<ForwardRef(ButtonLink)
|
|
43
|
+
color="primary"
|
|
44
|
+
href="#"
|
|
45
|
+
>
|
|
46
|
+
<a
|
|
47
|
+
className="govgr-btn-primary govgr-btn"
|
|
48
|
+
href="#"
|
|
49
|
+
>
|
|
50
|
+
hello
|
|
51
|
+
</a>
|
|
52
|
+
</ForwardRef(ButtonLink)>
|
|
53
|
+
`;
|
|
54
|
+
|
|
55
|
+
exports[`renders the ButtonLink with color=secondary 1`] = `
|
|
56
|
+
<ForwardRef(ButtonLink)
|
|
57
|
+
color="secondary"
|
|
58
|
+
>
|
|
59
|
+
<a
|
|
60
|
+
className="govgr-btn-secondary govgr-btn"
|
|
61
|
+
>
|
|
62
|
+
hello
|
|
63
|
+
</a>
|
|
64
|
+
</ForwardRef(ButtonLink)>
|
|
65
|
+
`;
|
|
66
|
+
|
|
67
|
+
exports[`renders the ButtonLink with color=secondary with href=# 1`] = `
|
|
68
|
+
<ForwardRef(ButtonLink)
|
|
69
|
+
color="secondary"
|
|
70
|
+
href="#"
|
|
71
|
+
>
|
|
72
|
+
<a
|
|
73
|
+
className="govgr-btn-secondary govgr-btn"
|
|
74
|
+
href="#"
|
|
75
|
+
>
|
|
76
|
+
hello
|
|
77
|
+
</a>
|
|
78
|
+
</ForwardRef(ButtonLink)>
|
|
79
|
+
`;
|
|
80
|
+
|
|
81
|
+
exports[`renders the ButtonLink with color=warning 1`] = `
|
|
82
|
+
<ForwardRef(ButtonLink)
|
|
83
|
+
color="warning"
|
|
84
|
+
>
|
|
85
|
+
<a
|
|
86
|
+
className="govgr-btn-warning govgr-btn"
|
|
87
|
+
>
|
|
88
|
+
hello
|
|
89
|
+
</a>
|
|
90
|
+
</ForwardRef(ButtonLink)>
|
|
91
|
+
`;
|
|
92
|
+
|
|
93
|
+
exports[`renders the ButtonLink with color=warning with href=# 1`] = `
|
|
94
|
+
<ForwardRef(ButtonLink)
|
|
95
|
+
color="warning"
|
|
96
|
+
href="#"
|
|
97
|
+
>
|
|
98
|
+
<a
|
|
99
|
+
className="govgr-btn-warning govgr-btn"
|
|
100
|
+
href="#"
|
|
101
|
+
>
|
|
102
|
+
hello
|
|
103
|
+
</a>
|
|
104
|
+
</ForwardRef(ButtonLink)>
|
|
105
|
+
`;
|
|
106
|
+
|
|
107
|
+
exports[`renders the ButtonLink with disabled=false 1`] = `
|
|
108
|
+
<ForwardRef(ButtonLink)>
|
|
109
|
+
<a
|
|
110
|
+
className="govgr-btn-primary govgr-btn"
|
|
111
|
+
>
|
|
112
|
+
hello
|
|
113
|
+
</a>
|
|
114
|
+
</ForwardRef(ButtonLink)>
|
|
115
|
+
`;
|
|
116
|
+
|
|
117
|
+
exports[`renders the ButtonLink with href=# 1`] = `
|
|
118
|
+
<ForwardRef(ButtonLink)
|
|
119
|
+
href="#"
|
|
120
|
+
>
|
|
121
|
+
<a
|
|
122
|
+
className="govgr-btn-primary govgr-btn"
|
|
123
|
+
href="#"
|
|
124
|
+
>
|
|
125
|
+
hello
|
|
126
|
+
</a>
|
|
127
|
+
</ForwardRef(ButtonLink)>
|
|
128
|
+
`;
|
|
129
|
+
|
|
130
|
+
exports[`renders the ButtonLink with no props 1`] = `
|
|
131
|
+
<ForwardRef(ButtonLink)>
|
|
132
|
+
<a
|
|
133
|
+
className="govgr-btn-primary govgr-btn"
|
|
134
|
+
>
|
|
135
|
+
hello
|
|
136
|
+
</a>
|
|
137
|
+
</ForwardRef(ButtonLink)>
|
|
138
|
+
`;
|
|
@@ -71,4 +71,20 @@ var _ref9 = /*#__PURE__*/React.createElement(ButtonLink, {
|
|
|
71
71
|
|
|
72
72
|
it('renders the ButtonLink with color=warning with href=#', function () {
|
|
73
73
|
expect(mount(_ref9)).toMatchSnapshot();
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
var _ref10 = /*#__PURE__*/React.createElement(ButtonLink, {
|
|
77
|
+
"aria-label": "button for opening menu"
|
|
78
|
+
}, "Menu");
|
|
79
|
+
|
|
80
|
+
it('renders the ButtonLink with ariaLabel prop', function () {
|
|
81
|
+
expect(mount(_ref10)).toMatchSnapshot();
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
var _ref11 = /*#__PURE__*/React.createElement(ButtonLink, {
|
|
85
|
+
tabIndex: 0
|
|
86
|
+
}, "Menu");
|
|
87
|
+
|
|
88
|
+
it('renders the Button with tabIndex prop', function () {
|
|
89
|
+
expect(mount(_ref11)).toMatchSnapshot();
|
|
74
90
|
});
|
package/es/CardAction/index.js
CHANGED
|
@@ -16,7 +16,7 @@ export var CardAction = /*#__PURE__*/React.forwardRef(function CardText(_ref, re
|
|
|
16
16
|
|
|
17
17
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
18
18
|
ref: ref,
|
|
19
|
-
className: clsx(className
|
|
19
|
+
className: clsx(className, true && 'govgr-card__action')
|
|
20
20
|
}, props), children);
|
|
21
21
|
});
|
|
22
22
|
export default CardAction;
|
package/es/CardHeading/index.js
CHANGED
|
@@ -17,7 +17,7 @@ export var CardHeading = /*#__PURE__*/React.forwardRef(function CardHeading(_ref
|
|
|
17
17
|
ref: ref,
|
|
18
18
|
role: "heading",
|
|
19
19
|
"aria-level": 2,
|
|
20
|
-
className: clsx(className
|
|
20
|
+
className: clsx(className, true && 'govgr-card__heading')
|
|
21
21
|
}, props), children);
|
|
22
22
|
});
|
|
23
23
|
export default CardHeading;
|
package/es/CardText/index.js
CHANGED
|
@@ -15,7 +15,7 @@ export var CardText = /*#__PURE__*/React.forwardRef(function CardText(_ref, ref)
|
|
|
15
15
|
|
|
16
16
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
17
17
|
ref: ref,
|
|
18
|
-
className: clsx(className
|
|
18
|
+
className: clsx(className, true && 'govgr-card__text')
|
|
19
19
|
}, props), children);
|
|
20
20
|
});
|
|
21
21
|
export default CardText;
|
package/es/CaretIcon/index.js
CHANGED
|
@@ -36,7 +36,7 @@ export var CaretIcon = /*#__PURE__*/React.forwardRef(function CaretIcon(_ref, re
|
|
|
36
36
|
return /*#__PURE__*/React.createElement(SvgIcon, _extends({
|
|
37
37
|
size: size,
|
|
38
38
|
variant: variant,
|
|
39
|
-
className: clsx(direction === 'right' && 'govgr-caret--right', direction === 'left' && 'govgr-caret--left', direction === 'down' && 'govgr-caret--down', direction === 'up' && 'govgr-caret--up'
|
|
39
|
+
className: clsx(className, direction === 'right' && 'govgr-caret--right', direction === 'left' && 'govgr-caret--left', direction === 'down' && 'govgr-caret--down', direction === 'up' && 'govgr-caret--up'),
|
|
40
40
|
ref: ref
|
|
41
41
|
}, props), direction === 'left' && _ref2, direction === 'right' && _ref3, direction === 'up' && _ref4, direction === 'down' && _ref5);
|
|
42
42
|
});
|
package/es/CheckIcon/index.js
CHANGED
|
@@ -21,7 +21,7 @@ export var CheckIcon = /*#__PURE__*/React.forwardRef(function CheckIcon(_ref, re
|
|
|
21
21
|
return /*#__PURE__*/React.createElement(SvgIcon, _extends({
|
|
22
22
|
size: size,
|
|
23
23
|
variant: variant,
|
|
24
|
-
className: clsx(className
|
|
24
|
+
className: clsx(className, true && 'govgr-svg-icon--check'),
|
|
25
25
|
ref: ref
|
|
26
26
|
}, props), _ref2);
|
|
27
27
|
});
|
package/es/CloseIcon/index.js
CHANGED
|
@@ -22,7 +22,7 @@ export var CloseIcon = /*#__PURE__*/React.forwardRef(function CloseIcon(_ref, re
|
|
|
22
22
|
return /*#__PURE__*/React.createElement(SvgIcon, _extends({
|
|
23
23
|
size: size,
|
|
24
24
|
variant: variant,
|
|
25
|
-
className: clsx(className
|
|
25
|
+
className: clsx(className, true && 'govgr-close-icon'),
|
|
26
26
|
ref: ref
|
|
27
27
|
}, props), _ref2);
|
|
28
28
|
});
|
package/es/FooterImage/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", "children", "alt"];
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
|
|
@@ -12,11 +12,15 @@ import clsx from 'clsx';
|
|
|
12
12
|
export var FooterImage = /*#__PURE__*/React.forwardRef(function FooterImage(_ref, ref) {
|
|
13
13
|
var className = _ref.className,
|
|
14
14
|
children = _ref.children,
|
|
15
|
+
_ref$alt = _ref.alt,
|
|
16
|
+
alt = _ref$alt === void 0 ? 'footer logo' : _ref$alt,
|
|
15
17
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
16
18
|
|
|
17
19
|
return /*#__PURE__*/React.createElement("img", _extends({
|
|
18
20
|
ref: ref,
|
|
19
21
|
className: clsx(className, true && 'govgr-footer__logo')
|
|
20
|
-
}, props
|
|
22
|
+
}, props, {
|
|
23
|
+
alt: alt
|
|
24
|
+
}), children);
|
|
21
25
|
});
|
|
22
26
|
export default FooterImage;
|
|
@@ -2,9 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`renders the GovGRLogo with no props 1`] = `
|
|
4
4
|
<ForwardRef(GovGRLogo)>
|
|
5
|
-
<
|
|
6
|
-
className="govgr-header-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
<a
|
|
6
|
+
className="govgr-header-link"
|
|
7
|
+
href="https://www.gov.gr/"
|
|
8
|
+
>
|
|
9
|
+
<img
|
|
10
|
+
alt="gov.gr logo"
|
|
11
|
+
className="govgr-header-logo"
|
|
12
|
+
src="https://www.gov.gr/gov_gr_logo.svg"
|
|
13
|
+
/>
|
|
14
|
+
</a>
|
|
9
15
|
</ForwardRef(GovGRLogo)>
|
|
10
16
|
`;
|
package/es/GovGRLogo/index.js
CHANGED
|
@@ -19,7 +19,8 @@ export var GovGRLogo = /*#__PURE__*/React.forwardRef(function GovGRLogo(_ref, re
|
|
|
19
19
|
className: clsx(className, true && 'govgr-header-link')
|
|
20
20
|
}, props), /*#__PURE__*/React.createElement("img", {
|
|
21
21
|
src: "https://www.gov.gr/gov_gr_logo.svg",
|
|
22
|
-
className: clsx(className, true && 'govgr-header-logo')
|
|
22
|
+
className: clsx(className, true && 'govgr-header-logo'),
|
|
23
|
+
alt: "gov.gr logo"
|
|
23
24
|
}));
|
|
24
25
|
});
|
|
25
26
|
export default GovGRLogo;
|
|
@@ -4,11 +4,9 @@ exports[`renders the HeaderLogo with no props 1`] = `
|
|
|
4
4
|
<ForwardRef(HeaderLogo)>
|
|
5
5
|
<a
|
|
6
6
|
className="govgr-header-link"
|
|
7
|
-
href="https://www.gov.gr/"
|
|
8
7
|
>
|
|
9
8
|
<img
|
|
10
9
|
className="govgr-header-logo"
|
|
11
|
-
src="https://www.gov.gr/gov_gr_logo.svg"
|
|
12
10
|
/>
|
|
13
11
|
</a>
|
|
14
12
|
</ForwardRef(HeaderLogo)>
|
package/es/HeaderLogo/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 = ["href", "src", "className"];
|
|
3
|
+
var _excluded = ["href", "src", "altText", "className"];
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
|
|
@@ -10,6 +10,7 @@ import clsx from 'clsx';
|
|
|
10
10
|
export var HeaderLogo = /*#__PURE__*/React.forwardRef(function HeaderLogo(_ref, ref) {
|
|
11
11
|
var href = _ref.href,
|
|
12
12
|
src = _ref.src,
|
|
13
|
+
altText = _ref.altText,
|
|
13
14
|
className = _ref.className,
|
|
14
15
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
15
16
|
|
|
@@ -19,7 +20,8 @@ export var HeaderLogo = /*#__PURE__*/React.forwardRef(function HeaderLogo(_ref,
|
|
|
19
20
|
className: clsx(className, true && 'govgr-header-link')
|
|
20
21
|
}, props), /*#__PURE__*/React.createElement("img", {
|
|
21
22
|
src: src,
|
|
22
|
-
className: clsx(className, true && 'govgr-header-logo')
|
|
23
|
+
className: clsx(className, true && 'govgr-header-logo'),
|
|
24
|
+
alt: altText
|
|
23
25
|
}));
|
|
24
26
|
});
|
|
25
27
|
export default HeaderLogo;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`renders the HeaderSecondaryLogo with src 1`] = `
|
|
3
|
+
exports[`renders the HeaderSecondaryLogo with src and alt 1`] = `
|
|
4
4
|
<ForwardRef(HeaderSecondaryLogo)
|
|
5
|
+
altText="minedu logo"
|
|
5
6
|
src="https://dilosi.services.gov.gr/minedu-logo.svg"
|
|
6
7
|
>
|
|
7
8
|
<a
|
|
8
9
|
className="govgr-header-link"
|
|
9
10
|
>
|
|
10
11
|
<img
|
|
12
|
+
alt="minedu logo"
|
|
11
13
|
className="govgr-header-secondary-logo"
|
|
12
14
|
src="https://dilosi.services.gov.gr/minedu-logo.svg"
|
|
13
15
|
/>
|
|
@@ -15,8 +17,9 @@ exports[`renders the HeaderSecondaryLogo with src 1`] = `
|
|
|
15
17
|
</ForwardRef(HeaderSecondaryLogo)>
|
|
16
18
|
`;
|
|
17
19
|
|
|
18
|
-
exports[`renders the HeaderSecondaryLogo with src and
|
|
20
|
+
exports[`renders the HeaderSecondaryLogo with src, href and alt 1`] = `
|
|
19
21
|
<ForwardRef(HeaderSecondaryLogo)
|
|
22
|
+
altText="minedu logo"
|
|
20
23
|
href="https://www.minedu.gov.gr/"
|
|
21
24
|
src="https://dilosi.services.gov.gr/minedu-logo.svg"
|
|
22
25
|
>
|
|
@@ -25,6 +28,7 @@ exports[`renders the HeaderSecondaryLogo with src and href 1`] = `
|
|
|
25
28
|
href="https://www.minedu.gov.gr/"
|
|
26
29
|
>
|
|
27
30
|
<img
|
|
31
|
+
alt="minedu logo"
|
|
28
32
|
className="govgr-header-secondary-logo"
|
|
29
33
|
src="https://dilosi.services.gov.gr/minedu-logo.svg"
|
|
30
34
|
/>
|
|
@@ -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", "src", "className"];
|
|
3
|
+
var _excluded = ["href", "src", "altText", "className"];
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
|
|
@@ -10,6 +10,7 @@ import clsx from 'clsx';
|
|
|
10
10
|
export var HeaderSecondaryLogo = /*#__PURE__*/React.forwardRef(function HeaderSecondaryLogo(_ref, ref) {
|
|
11
11
|
var href = _ref.href,
|
|
12
12
|
src = _ref.src,
|
|
13
|
+
altText = _ref.altText,
|
|
13
14
|
className = _ref.className,
|
|
14
15
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
15
16
|
|
|
@@ -19,7 +20,8 @@ export var HeaderSecondaryLogo = /*#__PURE__*/React.forwardRef(function HeaderSe
|
|
|
19
20
|
className: clsx(className, true && 'govgr-header-link')
|
|
20
21
|
}, props), /*#__PURE__*/React.createElement("img", {
|
|
21
22
|
src: src,
|
|
22
|
-
className: clsx(className, true && 'govgr-header-secondary-logo')
|
|
23
|
+
className: clsx(className, true && 'govgr-header-secondary-logo'),
|
|
24
|
+
alt: altText
|
|
23
25
|
}));
|
|
24
26
|
});
|
|
25
27
|
export default HeaderSecondaryLogo;
|
|
@@ -3,18 +3,20 @@ import { mount } from 'enzyme';
|
|
|
3
3
|
import HeaderSecondaryLogo from '@digigov/react-core/HeaderSecondaryLogo';
|
|
4
4
|
|
|
5
5
|
var _ref = /*#__PURE__*/React.createElement(HeaderSecondaryLogo, {
|
|
6
|
-
src: "https://dilosi.services.gov.gr/minedu-logo.svg"
|
|
6
|
+
src: "https://dilosi.services.gov.gr/minedu-logo.svg",
|
|
7
|
+
altText: "minedu logo"
|
|
7
8
|
});
|
|
8
9
|
|
|
9
|
-
it('renders the HeaderSecondaryLogo with src', function () {
|
|
10
|
+
it('renders the HeaderSecondaryLogo with src and alt', function () {
|
|
10
11
|
expect(mount(_ref)).toMatchSnapshot();
|
|
11
12
|
});
|
|
12
13
|
|
|
13
14
|
var _ref2 = /*#__PURE__*/React.createElement(HeaderSecondaryLogo, {
|
|
14
15
|
src: "https://dilosi.services.gov.gr/minedu-logo.svg",
|
|
15
|
-
href: "https://www.minedu.gov.gr/"
|
|
16
|
+
href: "https://www.minedu.gov.gr/",
|
|
17
|
+
altText: "minedu logo"
|
|
16
18
|
});
|
|
17
19
|
|
|
18
|
-
it('renders the HeaderSecondaryLogo with src and
|
|
20
|
+
it('renders the HeaderSecondaryLogo with src, href and alt', function () {
|
|
19
21
|
expect(mount(_ref2)).toMatchSnapshot();
|
|
20
22
|
});
|