@digigov/react-core 0.5.5 → 0.6.2
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/__snapshots__/index.test.tsx.snap +83 -0
- package/ArrowIcon/index.d.ts +16 -0
- package/ArrowIcon/index.js +59 -0
- package/ArrowIcon/index.test.d.ts +1 -0
- package/ArrowIcon/index.test.js +39 -0
- package/BackLink/index.d.ts +1 -1
- package/BackLink/index.js +5 -3
- package/BurgerIcon/__snapshots__/index.test.tsx.snap +353 -40
- package/BurgerIcon/index.d.ts +15 -3
- package/BurgerIcon/index.js +31 -12
- package/BurgerIcon/index.test.js +74 -6
- package/Button/index.d.ts +1 -1
- package/ButtonLink/index.d.ts +1 -1
- package/CHANGELOG.md +27 -1
- package/CallToAction/index.d.ts +1 -1
- package/CallToAction/index.js +3 -8
- package/CaretIcon/__snapshots__/index.test.tsx.snap +83 -0
- package/CaretIcon/index.d.ts +16 -0
- package/CaretIcon/index.js +59 -0
- package/CaretIcon/index.test.d.ts +1 -0
- package/CaretIcon/index.test.js +39 -0
- package/CheckIcon/__snapshots__/index.test.tsx.snap +316 -0
- package/CheckIcon/index.d.ts +15 -0
- package/CheckIcon/index.js +44 -0
- package/CheckIcon/index.test.d.ts +1 -0
- package/CheckIcon/index.test.js +129 -0
- package/CheckboxItem/index.d.ts +1 -1
- package/CloseIcon/__snapshots__/index.test.tsx.snap +20 -0
- package/CloseIcon/index.d.ts +16 -0
- package/CloseIcon/index.js +45 -0
- package/CloseIcon/index.test.d.ts +1 -0
- package/CloseIcon/index.test.js +15 -0
- package/DateInputItem/index.d.ts +2 -2
- package/DateInputItem/index.js +5 -5
- package/Fieldset/index.d.ts +1 -1
- package/FieldsetLegend/index.d.ts +1 -1
- package/FileUpload/index.d.ts +1 -1
- package/FooterContainer/index.d.ts +8 -1
- package/FooterContainer/index.js +4 -2
- package/FooterImage/index.d.ts +1 -1
- package/FooterLink/index.d.ts +1 -1
- package/GovGRLogo/index.d.ts +1 -1
- package/Grid/index.d.ts +1 -1
- package/HeaderLogo/index.d.ts +1 -1
- package/HeaderSecondaryLogo/index.d.ts +1 -1
- package/HeaderTitle/index.d.ts +1 -1
- package/HellenicRepublicLogo/index.d.ts +1 -1
- package/LabelTitle/index.d.ts +1 -1
- package/Link/index.d.ts +1 -1
- package/MoreVertIcon/__snapshots__/index.test.tsx.snap +512 -0
- package/MoreVertIcon/index.d.ts +15 -0
- package/MoreVertIcon/index.js +58 -0
- package/MoreVertIcon/index.test.d.ts +1 -0
- package/MoreVertIcon/index.test.js +129 -0
- package/NavHorizontalListItem/index.d.ts +1 -1
- package/NavVerticalItem/index.d.ts +1 -1
- package/NotificationBannerLink/index.d.ts +1 -1
- package/RadioItem/index.d.ts +1 -1
- package/Select/index.d.ts +1 -1
- package/SvgIcon/__snapshots__/index.test.tsx.snap +224 -0
- package/SvgIcon/index.d.ts +20 -0
- package/SvgIcon/index.js +41 -0
- package/SvgIcon/index.test.d.ts +1 -0
- package/SvgIcon/index.test.js +129 -0
- package/TabsListItem/index.d.ts +1 -1
- package/TextArea/index.d.ts +1 -1
- package/TextInput/index.d.ts +1 -1
- package/UncheckIcon/__snapshots__/index.test.tsx.snap +332 -0
- package/UncheckIcon/index.d.ts +15 -0
- package/UncheckIcon/index.js +44 -0
- package/UncheckIcon/index.test.d.ts +1 -0
- package/UncheckIcon/index.test.js +129 -0
- package/es/ArrowIcon/__snapshots__/index.test.tsx.snap +83 -0
- package/es/ArrowIcon/index.js +43 -0
- package/es/ArrowIcon/index.test.js +33 -0
- package/es/BackLink/index.js +4 -3
- package/es/BurgerIcon/__snapshots__/index.test.tsx.snap +353 -40
- package/es/BurgerIcon/index.js +30 -12
- package/es/BurgerIcon/index.test.js +74 -6
- package/es/CallToAction/index.js +2 -8
- package/es/CaretIcon/__snapshots__/index.test.tsx.snap +83 -0
- package/es/CaretIcon/index.js +43 -0
- package/es/CaretIcon/index.test.js +33 -0
- package/es/CheckIcon/__snapshots__/index.test.tsx.snap +316 -0
- package/es/CheckIcon/index.js +28 -0
- package/es/CheckIcon/index.test.js +123 -0
- package/es/CloseIcon/__snapshots__/index.test.tsx.snap +20 -0
- package/es/CloseIcon/index.js +29 -0
- package/es/CloseIcon/index.test.js +9 -0
- package/es/DateInputItem/index.js +5 -5
- package/es/FooterContainer/index.js +4 -2
- package/es/MoreVertIcon/__snapshots__/index.test.tsx.snap +512 -0
- package/es/MoreVertIcon/index.js +42 -0
- package/es/MoreVertIcon/index.test.js +123 -0
- package/es/SvgIcon/__snapshots__/index.test.tsx.snap +224 -0
- package/es/SvgIcon/index.js +26 -0
- package/es/SvgIcon/index.test.js +123 -0
- package/es/UncheckIcon/__snapshots__/index.test.tsx.snap +332 -0
- package/es/UncheckIcon/index.js +28 -0
- package/es/UncheckIcon/index.test.js +123 -0
- package/es/index.js +7 -0
- package/esm/ArrowIcon/__snapshots__/index.test.tsx.snap +83 -0
- package/esm/ArrowIcon/index.js +43 -0
- package/esm/ArrowIcon/index.test.js +33 -0
- package/esm/BackLink/index.js +4 -3
- package/esm/BurgerIcon/__snapshots__/index.test.tsx.snap +353 -40
- package/esm/BurgerIcon/index.js +30 -12
- package/esm/BurgerIcon/index.test.js +74 -6
- package/esm/CallToAction/index.js +2 -8
- package/esm/CaretIcon/__snapshots__/index.test.tsx.snap +83 -0
- package/esm/CaretIcon/index.js +43 -0
- package/esm/CaretIcon/index.test.js +33 -0
- package/esm/CheckIcon/__snapshots__/index.test.tsx.snap +316 -0
- package/esm/CheckIcon/index.js +28 -0
- package/esm/CheckIcon/index.test.js +123 -0
- package/esm/CloseIcon/__snapshots__/index.test.tsx.snap +20 -0
- package/esm/CloseIcon/index.js +29 -0
- package/esm/CloseIcon/index.test.js +9 -0
- package/esm/DateInputItem/index.js +5 -5
- package/esm/FooterContainer/index.js +4 -2
- package/esm/MoreVertIcon/__snapshots__/index.test.tsx.snap +512 -0
- package/esm/MoreVertIcon/index.js +42 -0
- package/esm/MoreVertIcon/index.test.js +123 -0
- package/esm/SvgIcon/__snapshots__/index.test.tsx.snap +224 -0
- package/esm/SvgIcon/index.js +26 -0
- package/esm/SvgIcon/index.test.js +123 -0
- package/esm/UncheckIcon/__snapshots__/index.test.tsx.snap +332 -0
- package/esm/UncheckIcon/index.js +28 -0
- package/esm/UncheckIcon/index.test.js +123 -0
- package/esm/index.js +8 -1
- package/index.d.ts +7 -0
- package/index.js +56 -0
- package/package.json +2 -2
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["size", "variant", "direction", "className"];
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import SvgIcon from '@digigov/react-core/SvgIcon';
|
|
6
|
+
import clsx from 'clsx';
|
|
7
|
+
|
|
8
|
+
var _ref2 = /*#__PURE__*/React.createElement("path", {
|
|
9
|
+
d: "M18,22V2L6,12L18,22z"
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
var _ref3 = /*#__PURE__*/React.createElement("path", {
|
|
13
|
+
d: "M6,2v20l12-10L6,2z"
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
var _ref4 = /*#__PURE__*/React.createElement("path", {
|
|
17
|
+
d: "M2,18h20L12,6L2,18z"
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
var _ref5 = /*#__PURE__*/React.createElement("path", {
|
|
21
|
+
d: "M22,6H2l10,12L22,6z"
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* CaretIcon component is used to add caret icon.
|
|
26
|
+
* CaretIcon can be used inside other components, for example BackLink component.
|
|
27
|
+
*/
|
|
28
|
+
export var CaretIcon = /*#__PURE__*/React.forwardRef(function CaretIcon(_ref, ref) {
|
|
29
|
+
var size = _ref.size,
|
|
30
|
+
variant = _ref.variant,
|
|
31
|
+
_ref$direction = _ref.direction,
|
|
32
|
+
direction = _ref$direction === void 0 ? 'left' : _ref$direction,
|
|
33
|
+
className = _ref.className,
|
|
34
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
35
|
+
|
|
36
|
+
return /*#__PURE__*/React.createElement(SvgIcon, _extends({
|
|
37
|
+
size: size,
|
|
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', className && className),
|
|
40
|
+
ref: ref
|
|
41
|
+
}, props), direction === 'left' && _ref2, direction === 'right' && _ref3, direction === 'up' && _ref4, direction === 'down' && _ref5);
|
|
42
|
+
});
|
|
43
|
+
export default CaretIcon;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { mount } from 'enzyme';
|
|
3
|
+
import CaretIcon from '@digigov/react-core/CaretIcon';
|
|
4
|
+
|
|
5
|
+
var _ref = /*#__PURE__*/React.createElement(CaretIcon, null);
|
|
6
|
+
|
|
7
|
+
it('renders the CaretIcon with no props, direction prop is left by default', function () {
|
|
8
|
+
expect(mount(_ref)).toMatchSnapshot();
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
var _ref2 = /*#__PURE__*/React.createElement(CaretIcon, {
|
|
12
|
+
direction: "right"
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it('renders the CaretIcon with direction right prop', function () {
|
|
16
|
+
expect(mount(_ref2)).toMatchSnapshot();
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
var _ref3 = /*#__PURE__*/React.createElement(CaretIcon, {
|
|
20
|
+
direction: "up"
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('renders the CaretIcon with direction up prop', function () {
|
|
24
|
+
expect(mount(_ref3)).toMatchSnapshot();
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
var _ref4 = /*#__PURE__*/React.createElement(CaretIcon, {
|
|
28
|
+
direction: "down"
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('renders the CaretIcon with direction down prop', function () {
|
|
32
|
+
expect(mount(_ref4)).toMatchSnapshot();
|
|
33
|
+
});
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`renders the CheckIcon with no props 1`] = `
|
|
4
|
+
<ForwardRef(CheckIcon)>
|
|
5
|
+
<ForwardRef(SvgIcon)>
|
|
6
|
+
<svg
|
|
7
|
+
aria-hidden="true"
|
|
8
|
+
className="govgr-svg-icon--dark govgr-svg-icon--m govgr-svg-icon--check govgr-svg-icon"
|
|
9
|
+
focusable="false"
|
|
10
|
+
viewBox="0 0 24 24"
|
|
11
|
+
>
|
|
12
|
+
<polygon
|
|
13
|
+
points="9.49 14.94 4.16 9.67 1.84 12.01 9.5 19.6 22.16 7.05 19.84 4.7 9.5 14.94"
|
|
14
|
+
/>
|
|
15
|
+
</svg>
|
|
16
|
+
</ForwardRef(SvgIcon)>
|
|
17
|
+
</ForwardRef(CheckIcon)>
|
|
18
|
+
`;
|
|
19
|
+
|
|
20
|
+
exports[`renders the CheckIcon with prop size=l 1`] = `
|
|
21
|
+
<ForwardRef(CheckIcon)
|
|
22
|
+
size="l"
|
|
23
|
+
>
|
|
24
|
+
<ForwardRef(SvgIcon)
|
|
25
|
+
size="l"
|
|
26
|
+
>
|
|
27
|
+
<svg
|
|
28
|
+
aria-hidden="true"
|
|
29
|
+
className="govgr-svg-icon--dark govgr-svg-icon--l govgr-svg-icon--check govgr-svg-icon"
|
|
30
|
+
focusable="false"
|
|
31
|
+
viewBox="0 0 24 24"
|
|
32
|
+
>
|
|
33
|
+
<polygon
|
|
34
|
+
points="9.49 14.94 4.16 9.67 1.84 12.01 9.5 19.6 22.16 7.05 19.84 4.7 9.5 14.94"
|
|
35
|
+
/>
|
|
36
|
+
</svg>
|
|
37
|
+
</ForwardRef(SvgIcon)>
|
|
38
|
+
</ForwardRef(CheckIcon)>
|
|
39
|
+
`;
|
|
40
|
+
|
|
41
|
+
exports[`renders the CheckIcon with prop size=m 1`] = `
|
|
42
|
+
<ForwardRef(CheckIcon)
|
|
43
|
+
size="m"
|
|
44
|
+
>
|
|
45
|
+
<ForwardRef(SvgIcon)
|
|
46
|
+
size="m"
|
|
47
|
+
>
|
|
48
|
+
<svg
|
|
49
|
+
aria-hidden="true"
|
|
50
|
+
className="govgr-svg-icon--dark govgr-svg-icon--m govgr-svg-icon--check govgr-svg-icon"
|
|
51
|
+
focusable="false"
|
|
52
|
+
viewBox="0 0 24 24"
|
|
53
|
+
>
|
|
54
|
+
<polygon
|
|
55
|
+
points="9.49 14.94 4.16 9.67 1.84 12.01 9.5 19.6 22.16 7.05 19.84 4.7 9.5 14.94"
|
|
56
|
+
/>
|
|
57
|
+
</svg>
|
|
58
|
+
</ForwardRef(SvgIcon)>
|
|
59
|
+
</ForwardRef(CheckIcon)>
|
|
60
|
+
`;
|
|
61
|
+
|
|
62
|
+
exports[`renders the CheckIcon with prop size=s 1`] = `
|
|
63
|
+
<ForwardRef(CheckIcon)
|
|
64
|
+
size="s"
|
|
65
|
+
>
|
|
66
|
+
<ForwardRef(SvgIcon)
|
|
67
|
+
size="s"
|
|
68
|
+
>
|
|
69
|
+
<svg
|
|
70
|
+
aria-hidden="true"
|
|
71
|
+
className="govgr-svg-icon--dark govgr-svg-icon--s govgr-svg-icon--check govgr-svg-icon"
|
|
72
|
+
focusable="false"
|
|
73
|
+
viewBox="0 0 24 24"
|
|
74
|
+
>
|
|
75
|
+
<polygon
|
|
76
|
+
points="9.49 14.94 4.16 9.67 1.84 12.01 9.5 19.6 22.16 7.05 19.84 4.7 9.5 14.94"
|
|
77
|
+
/>
|
|
78
|
+
</svg>
|
|
79
|
+
</ForwardRef(SvgIcon)>
|
|
80
|
+
</ForwardRef(CheckIcon)>
|
|
81
|
+
`;
|
|
82
|
+
|
|
83
|
+
exports[`renders the CheckIcon with prop size=xl 1`] = `
|
|
84
|
+
<ForwardRef(CheckIcon)
|
|
85
|
+
size="xl"
|
|
86
|
+
>
|
|
87
|
+
<ForwardRef(SvgIcon)
|
|
88
|
+
size="xl"
|
|
89
|
+
>
|
|
90
|
+
<svg
|
|
91
|
+
aria-hidden="true"
|
|
92
|
+
className="govgr-svg-icon--dark govgr-svg-icon--xl govgr-svg-icon--check govgr-svg-icon"
|
|
93
|
+
focusable="false"
|
|
94
|
+
viewBox="0 0 24 24"
|
|
95
|
+
>
|
|
96
|
+
<polygon
|
|
97
|
+
points="9.49 14.94 4.16 9.67 1.84 12.01 9.5 19.6 22.16 7.05 19.84 4.7 9.5 14.94"
|
|
98
|
+
/>
|
|
99
|
+
</svg>
|
|
100
|
+
</ForwardRef(SvgIcon)>
|
|
101
|
+
</ForwardRef(CheckIcon)>
|
|
102
|
+
`;
|
|
103
|
+
|
|
104
|
+
exports[`renders the CheckIcon with prop variant=dark 1`] = `
|
|
105
|
+
<ForwardRef(CheckIcon)
|
|
106
|
+
variant="dark"
|
|
107
|
+
>
|
|
108
|
+
<ForwardRef(SvgIcon)
|
|
109
|
+
variant="dark"
|
|
110
|
+
>
|
|
111
|
+
<svg
|
|
112
|
+
aria-hidden="true"
|
|
113
|
+
className="govgr-svg-icon--dark govgr-svg-icon--m govgr-svg-icon--check govgr-svg-icon"
|
|
114
|
+
focusable="false"
|
|
115
|
+
viewBox="0 0 24 24"
|
|
116
|
+
>
|
|
117
|
+
<polygon
|
|
118
|
+
points="9.49 14.94 4.16 9.67 1.84 12.01 9.5 19.6 22.16 7.05 19.84 4.7 9.5 14.94"
|
|
119
|
+
/>
|
|
120
|
+
</svg>
|
|
121
|
+
</ForwardRef(SvgIcon)>
|
|
122
|
+
</ForwardRef(CheckIcon)>
|
|
123
|
+
`;
|
|
124
|
+
|
|
125
|
+
exports[`renders the CheckIcon with prop variant=error 1`] = `
|
|
126
|
+
<ForwardRef(CheckIcon)
|
|
127
|
+
variant="error"
|
|
128
|
+
>
|
|
129
|
+
<ForwardRef(SvgIcon)
|
|
130
|
+
variant="error"
|
|
131
|
+
>
|
|
132
|
+
<svg
|
|
133
|
+
aria-hidden="true"
|
|
134
|
+
className="govgr-svg-icon--error govgr-svg-icon--m govgr-svg-icon--check govgr-svg-icon"
|
|
135
|
+
focusable="false"
|
|
136
|
+
viewBox="0 0 24 24"
|
|
137
|
+
>
|
|
138
|
+
<polygon
|
|
139
|
+
points="9.49 14.94 4.16 9.67 1.84 12.01 9.5 19.6 22.16 7.05 19.84 4.7 9.5 14.94"
|
|
140
|
+
/>
|
|
141
|
+
</svg>
|
|
142
|
+
</ForwardRef(SvgIcon)>
|
|
143
|
+
</ForwardRef(CheckIcon)>
|
|
144
|
+
`;
|
|
145
|
+
|
|
146
|
+
exports[`renders the CheckIcon with prop variant=error and size= xl 1`] = `
|
|
147
|
+
<ForwardRef(CheckIcon)
|
|
148
|
+
size="xl"
|
|
149
|
+
variant="warning"
|
|
150
|
+
>
|
|
151
|
+
<ForwardRef(SvgIcon)
|
|
152
|
+
size="xl"
|
|
153
|
+
variant="warning"
|
|
154
|
+
>
|
|
155
|
+
<svg
|
|
156
|
+
aria-hidden="true"
|
|
157
|
+
className="govgr-svg-icon--warning govgr-svg-icon--xl govgr-svg-icon--check govgr-svg-icon"
|
|
158
|
+
focusable="false"
|
|
159
|
+
viewBox="0 0 24 24"
|
|
160
|
+
>
|
|
161
|
+
<polygon
|
|
162
|
+
points="9.49 14.94 4.16 9.67 1.84 12.01 9.5 19.6 22.16 7.05 19.84 4.7 9.5 14.94"
|
|
163
|
+
/>
|
|
164
|
+
</svg>
|
|
165
|
+
</ForwardRef(SvgIcon)>
|
|
166
|
+
</ForwardRef(CheckIcon)>
|
|
167
|
+
`;
|
|
168
|
+
|
|
169
|
+
exports[`renders the CheckIcon with prop variant=focus 1`] = `
|
|
170
|
+
<ForwardRef(CheckIcon)
|
|
171
|
+
variant="focus"
|
|
172
|
+
>
|
|
173
|
+
<ForwardRef(SvgIcon)
|
|
174
|
+
variant="focus"
|
|
175
|
+
>
|
|
176
|
+
<svg
|
|
177
|
+
aria-hidden="true"
|
|
178
|
+
className="govgr-svg-icon--focus govgr-svg-icon--m govgr-svg-icon--check govgr-svg-icon"
|
|
179
|
+
focusable="false"
|
|
180
|
+
viewBox="0 0 24 24"
|
|
181
|
+
>
|
|
182
|
+
<polygon
|
|
183
|
+
points="9.49 14.94 4.16 9.67 1.84 12.01 9.5 19.6 22.16 7.05 19.84 4.7 9.5 14.94"
|
|
184
|
+
/>
|
|
185
|
+
</svg>
|
|
186
|
+
</ForwardRef(SvgIcon)>
|
|
187
|
+
</ForwardRef(CheckIcon)>
|
|
188
|
+
`;
|
|
189
|
+
|
|
190
|
+
exports[`renders the CheckIcon with prop variant=gray 1`] = `
|
|
191
|
+
<ForwardRef(CheckIcon)
|
|
192
|
+
variant="gray"
|
|
193
|
+
>
|
|
194
|
+
<ForwardRef(SvgIcon)
|
|
195
|
+
variant="gray"
|
|
196
|
+
>
|
|
197
|
+
<svg
|
|
198
|
+
aria-hidden="true"
|
|
199
|
+
className="govgr-svg-icon--gray govgr-svg-icon--m govgr-svg-icon--check govgr-svg-icon"
|
|
200
|
+
focusable="false"
|
|
201
|
+
viewBox="0 0 24 24"
|
|
202
|
+
>
|
|
203
|
+
<polygon
|
|
204
|
+
points="9.49 14.94 4.16 9.67 1.84 12.01 9.5 19.6 22.16 7.05 19.84 4.7 9.5 14.94"
|
|
205
|
+
/>
|
|
206
|
+
</svg>
|
|
207
|
+
</ForwardRef(SvgIcon)>
|
|
208
|
+
</ForwardRef(CheckIcon)>
|
|
209
|
+
`;
|
|
210
|
+
|
|
211
|
+
exports[`renders the CheckIcon with prop variant=light 1`] = `
|
|
212
|
+
<ForwardRef(CheckIcon)
|
|
213
|
+
variant="light"
|
|
214
|
+
>
|
|
215
|
+
<ForwardRef(SvgIcon)
|
|
216
|
+
variant="light"
|
|
217
|
+
>
|
|
218
|
+
<svg
|
|
219
|
+
aria-hidden="true"
|
|
220
|
+
className="govgr-svg-icon--light govgr-svg-icon--m govgr-svg-icon--check govgr-svg-icon"
|
|
221
|
+
focusable="false"
|
|
222
|
+
viewBox="0 0 24 24"
|
|
223
|
+
>
|
|
224
|
+
<polygon
|
|
225
|
+
points="9.49 14.94 4.16 9.67 1.84 12.01 9.5 19.6 22.16 7.05 19.84 4.7 9.5 14.94"
|
|
226
|
+
/>
|
|
227
|
+
</svg>
|
|
228
|
+
</ForwardRef(SvgIcon)>
|
|
229
|
+
</ForwardRef(CheckIcon)>
|
|
230
|
+
`;
|
|
231
|
+
|
|
232
|
+
exports[`renders the CheckIcon with prop variant=primary 1`] = `
|
|
233
|
+
<ForwardRef(CheckIcon)
|
|
234
|
+
variant="primary"
|
|
235
|
+
>
|
|
236
|
+
<ForwardRef(SvgIcon)
|
|
237
|
+
variant="primary"
|
|
238
|
+
>
|
|
239
|
+
<svg
|
|
240
|
+
aria-hidden="true"
|
|
241
|
+
className="govgr-svg-icon--primary govgr-svg-icon--m govgr-svg-icon--check govgr-svg-icon"
|
|
242
|
+
focusable="false"
|
|
243
|
+
viewBox="0 0 24 24"
|
|
244
|
+
>
|
|
245
|
+
<polygon
|
|
246
|
+
points="9.49 14.94 4.16 9.67 1.84 12.01 9.5 19.6 22.16 7.05 19.84 4.7 9.5 14.94"
|
|
247
|
+
/>
|
|
248
|
+
</svg>
|
|
249
|
+
</ForwardRef(SvgIcon)>
|
|
250
|
+
</ForwardRef(CheckIcon)>
|
|
251
|
+
`;
|
|
252
|
+
|
|
253
|
+
exports[`renders the CheckIcon with prop variant=success 1`] = `
|
|
254
|
+
<ForwardRef(CheckIcon)
|
|
255
|
+
variant="success"
|
|
256
|
+
>
|
|
257
|
+
<ForwardRef(SvgIcon)
|
|
258
|
+
variant="success"
|
|
259
|
+
>
|
|
260
|
+
<svg
|
|
261
|
+
aria-hidden="true"
|
|
262
|
+
className="govgr-svg-icon--success govgr-svg-icon--m govgr-svg-icon--check govgr-svg-icon"
|
|
263
|
+
focusable="false"
|
|
264
|
+
viewBox="0 0 24 24"
|
|
265
|
+
>
|
|
266
|
+
<polygon
|
|
267
|
+
points="9.49 14.94 4.16 9.67 1.84 12.01 9.5 19.6 22.16 7.05 19.84 4.7 9.5 14.94"
|
|
268
|
+
/>
|
|
269
|
+
</svg>
|
|
270
|
+
</ForwardRef(SvgIcon)>
|
|
271
|
+
</ForwardRef(CheckIcon)>
|
|
272
|
+
`;
|
|
273
|
+
|
|
274
|
+
exports[`renders the CheckIcon with prop variant=warning 1`] = `
|
|
275
|
+
<ForwardRef(CheckIcon)
|
|
276
|
+
variant="warning"
|
|
277
|
+
>
|
|
278
|
+
<ForwardRef(SvgIcon)
|
|
279
|
+
variant="warning"
|
|
280
|
+
>
|
|
281
|
+
<svg
|
|
282
|
+
aria-hidden="true"
|
|
283
|
+
className="govgr-svg-icon--warning govgr-svg-icon--m govgr-svg-icon--check govgr-svg-icon"
|
|
284
|
+
focusable="false"
|
|
285
|
+
viewBox="0 0 24 24"
|
|
286
|
+
>
|
|
287
|
+
<polygon
|
|
288
|
+
points="9.49 14.94 4.16 9.67 1.84 12.01 9.5 19.6 22.16 7.05 19.84 4.7 9.5 14.94"
|
|
289
|
+
/>
|
|
290
|
+
</svg>
|
|
291
|
+
</ForwardRef(SvgIcon)>
|
|
292
|
+
</ForwardRef(CheckIcon)>
|
|
293
|
+
`;
|
|
294
|
+
|
|
295
|
+
exports[`renders the CheckIcon with prop variant=warning and size=s 1`] = `
|
|
296
|
+
<ForwardRef(CheckIcon)
|
|
297
|
+
size="s"
|
|
298
|
+
variant="warning"
|
|
299
|
+
>
|
|
300
|
+
<ForwardRef(SvgIcon)
|
|
301
|
+
size="s"
|
|
302
|
+
variant="warning"
|
|
303
|
+
>
|
|
304
|
+
<svg
|
|
305
|
+
aria-hidden="true"
|
|
306
|
+
className="govgr-svg-icon--warning govgr-svg-icon--s govgr-svg-icon--check govgr-svg-icon"
|
|
307
|
+
focusable="false"
|
|
308
|
+
viewBox="0 0 24 24"
|
|
309
|
+
>
|
|
310
|
+
<polygon
|
|
311
|
+
points="9.49 14.94 4.16 9.67 1.84 12.01 9.5 19.6 22.16 7.05 19.84 4.7 9.5 14.94"
|
|
312
|
+
/>
|
|
313
|
+
</svg>
|
|
314
|
+
</ForwardRef(SvgIcon)>
|
|
315
|
+
</ForwardRef(CheckIcon)>
|
|
316
|
+
`;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["size", "variant", "className"];
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import SvgIcon from '@digigov/react-core/SvgIcon';
|
|
6
|
+
import clsx from 'clsx';
|
|
7
|
+
|
|
8
|
+
var _ref2 = /*#__PURE__*/React.createElement("polygon", {
|
|
9
|
+
points: "9.49 14.94 4.16 9.67 1.84 12.01 9.5 19.6 22.16 7.05 19.84 4.7 9.5 14.94"
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Use CheckIcon component when you need a check icon.
|
|
14
|
+
*/
|
|
15
|
+
export var CheckIcon = /*#__PURE__*/React.forwardRef(function CheckIcon(_ref, ref) {
|
|
16
|
+
var size = _ref.size,
|
|
17
|
+
variant = _ref.variant,
|
|
18
|
+
className = _ref.className,
|
|
19
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
20
|
+
|
|
21
|
+
return /*#__PURE__*/React.createElement(SvgIcon, _extends({
|
|
22
|
+
size: size,
|
|
23
|
+
variant: variant,
|
|
24
|
+
className: clsx(className && className, true && 'govgr-svg-icon--check'),
|
|
25
|
+
ref: ref
|
|
26
|
+
}, props), _ref2);
|
|
27
|
+
});
|
|
28
|
+
export default CheckIcon;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { mount } from 'enzyme';
|
|
3
|
+
import CheckIcon from '@digigov/react-core/CheckIcon';
|
|
4
|
+
|
|
5
|
+
var _ref = /*#__PURE__*/React.createElement(CheckIcon, null);
|
|
6
|
+
|
|
7
|
+
it('renders the CheckIcon with no props', function () {
|
|
8
|
+
expect(mount(_ref)).toMatchSnapshot();
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
var _ref2 = /*#__PURE__*/React.createElement(CheckIcon, {
|
|
12
|
+
size: "s"
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it('renders the CheckIcon with prop size=s', function () {
|
|
16
|
+
expect(mount(_ref2)).toMatchSnapshot();
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
var _ref3 = /*#__PURE__*/React.createElement(CheckIcon, {
|
|
20
|
+
size: "m"
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('renders the CheckIcon with prop size=m', function () {
|
|
24
|
+
expect(mount(_ref3)).toMatchSnapshot();
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
var _ref4 = /*#__PURE__*/React.createElement(CheckIcon, {
|
|
28
|
+
size: "l"
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('renders the CheckIcon with prop size=l', function () {
|
|
32
|
+
expect(mount(_ref4)).toMatchSnapshot();
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
var _ref5 = /*#__PURE__*/React.createElement(CheckIcon, {
|
|
36
|
+
size: "xl"
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('renders the CheckIcon with prop size=xl', function () {
|
|
40
|
+
expect(mount(_ref5)).toMatchSnapshot();
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
var _ref6 = /*#__PURE__*/React.createElement(CheckIcon, {
|
|
44
|
+
variant: "dark"
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('renders the CheckIcon with prop variant=dark', function () {
|
|
48
|
+
expect(mount(_ref6)).toMatchSnapshot();
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
var _ref7 = /*#__PURE__*/React.createElement(CheckIcon, {
|
|
52
|
+
variant: "light"
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('renders the CheckIcon with prop variant=light', function () {
|
|
56
|
+
expect(mount(_ref7)).toMatchSnapshot();
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
var _ref8 = /*#__PURE__*/React.createElement(CheckIcon, {
|
|
60
|
+
variant: "gray"
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('renders the CheckIcon with prop variant=gray', function () {
|
|
64
|
+
expect(mount(_ref8)).toMatchSnapshot();
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
var _ref9 = /*#__PURE__*/React.createElement(CheckIcon, {
|
|
68
|
+
variant: "primary"
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it('renders the CheckIcon with prop variant=primary', function () {
|
|
72
|
+
expect(mount(_ref9)).toMatchSnapshot();
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
var _ref10 = /*#__PURE__*/React.createElement(CheckIcon, {
|
|
76
|
+
variant: "success"
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it('renders the CheckIcon with prop variant=success', function () {
|
|
80
|
+
expect(mount(_ref10)).toMatchSnapshot();
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
var _ref11 = /*#__PURE__*/React.createElement(CheckIcon, {
|
|
84
|
+
variant: "warning"
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it('renders the CheckIcon with prop variant=warning', function () {
|
|
88
|
+
expect(mount(_ref11)).toMatchSnapshot();
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
var _ref12 = /*#__PURE__*/React.createElement(CheckIcon, {
|
|
92
|
+
variant: "error"
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
it('renders the CheckIcon with prop variant=error', function () {
|
|
96
|
+
expect(mount(_ref12)).toMatchSnapshot();
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
var _ref13 = /*#__PURE__*/React.createElement(CheckIcon, {
|
|
100
|
+
variant: "focus"
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it('renders the CheckIcon with prop variant=focus', function () {
|
|
104
|
+
expect(mount(_ref13)).toMatchSnapshot();
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
var _ref14 = /*#__PURE__*/React.createElement(CheckIcon, {
|
|
108
|
+
variant: "warning",
|
|
109
|
+
size: "s"
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
it('renders the CheckIcon with prop variant=warning and size=s', function () {
|
|
113
|
+
expect(mount(_ref14)).toMatchSnapshot();
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
var _ref15 = /*#__PURE__*/React.createElement(CheckIcon, {
|
|
117
|
+
variant: "warning",
|
|
118
|
+
size: "xl"
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
it('renders the CheckIcon with prop variant=error and size= xl', function () {
|
|
122
|
+
expect(mount(_ref15)).toMatchSnapshot();
|
|
123
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`renders the CloseIcon with no props 1`] = `
|
|
4
|
+
<ForwardRef(CloseIcon)>
|
|
5
|
+
<ForwardRef(SvgIcon)
|
|
6
|
+
className="govgr-close-icon"
|
|
7
|
+
>
|
|
8
|
+
<svg
|
|
9
|
+
aria-hidden="true"
|
|
10
|
+
className="govgr-svg-icon--dark govgr-svg-icon--m govgr-close-icon govgr-svg-icon"
|
|
11
|
+
focusable="false"
|
|
12
|
+
viewBox="0 0 24 24"
|
|
13
|
+
>
|
|
14
|
+
<polygon
|
|
15
|
+
points="14.4,11.8 22,4.2 19.7,1.8 12,9.4 4.4,1.8 2,4.2 9.7,11.9 2.1,19.5 4.4,21.9 12.1,14.3 19.7,21.9 22.1,19.5 "
|
|
16
|
+
/>
|
|
17
|
+
</svg>
|
|
18
|
+
</ForwardRef(SvgIcon)>
|
|
19
|
+
</ForwardRef(CloseIcon)>
|
|
20
|
+
`;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["size", "variant", "className"];
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import SvgIcon from '@digigov/react-core/SvgIcon';
|
|
6
|
+
import clsx from 'clsx';
|
|
7
|
+
|
|
8
|
+
var _ref2 = /*#__PURE__*/React.createElement("polygon", {
|
|
9
|
+
points: "14.4,11.8 22,4.2 19.7,1.8 12,9.4 4.4,1.8 2,4.2 9.7,11.9 2.1,19.5 4.4,21.9 12.1,14.3 19.7,21.9 22.1,19.5 "
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* CloseIcon component is used to add close icon.
|
|
14
|
+
* CloseIcon component can be used for dismissing contents
|
|
15
|
+
*/
|
|
16
|
+
export var CloseIcon = /*#__PURE__*/React.forwardRef(function CloseIcon(_ref, ref) {
|
|
17
|
+
var size = _ref.size,
|
|
18
|
+
variant = _ref.variant,
|
|
19
|
+
className = _ref.className,
|
|
20
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
21
|
+
|
|
22
|
+
return /*#__PURE__*/React.createElement(SvgIcon, _extends({
|
|
23
|
+
size: size,
|
|
24
|
+
variant: variant,
|
|
25
|
+
className: clsx(className && className, true && 'govgr-close-icon'),
|
|
26
|
+
ref: ref
|
|
27
|
+
}, props), _ref2);
|
|
28
|
+
});
|
|
29
|
+
export default CloseIcon;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { mount } from 'enzyme';
|
|
3
|
+
import CloseIcon from '@digigov/react-core/CloseIcon';
|
|
4
|
+
|
|
5
|
+
var _ref = /*#__PURE__*/React.createElement(CloseIcon, null);
|
|
6
|
+
|
|
7
|
+
it('renders the CloseIcon with no props', function () {
|
|
8
|
+
expect(mount(_ref)).toMatchSnapshot();
|
|
9
|
+
});
|
|
@@ -18,17 +18,17 @@ export var DateInputItem = /*#__PURE__*/React.forwardRef(function DateInputItem(
|
|
|
18
18
|
children = _ref.children,
|
|
19
19
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
20
20
|
|
|
21
|
-
return /*#__PURE__*/React.createElement("div",
|
|
22
|
-
ref: ref,
|
|
21
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
23
22
|
className: clsx(className, true && 'govgr-date-input__item')
|
|
24
|
-
},
|
|
23
|
+
}, /*#__PURE__*/React.createElement("label", {
|
|
25
24
|
className: clsx(true && 'govgr-label')
|
|
26
|
-
}, children, /*#__PURE__*/React.createElement("input", {
|
|
25
|
+
}, children, /*#__PURE__*/React.createElement("input", _extends({
|
|
26
|
+
ref: ref,
|
|
27
27
|
type: "text",
|
|
28
28
|
pattern: "[0-9]*",
|
|
29
29
|
inputMode: "numeric",
|
|
30
30
|
name: name,
|
|
31
31
|
className: clsx(error === true && 'govgr-error-input', width === 2 && 'govgr-input--width-2', width === 4 && 'govgr-input--width-4', true && 'govgr-input')
|
|
32
|
-
})));
|
|
32
|
+
}, props))));
|
|
33
33
|
});
|
|
34
34
|
export default DateInputItem;
|
|
@@ -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", "fullWidth", "children"];
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
|
|
@@ -9,12 +9,14 @@ import clsx from 'clsx';
|
|
|
9
9
|
*/
|
|
10
10
|
export var FooterContainer = /*#__PURE__*/React.forwardRef(function FooterContainer(_ref, ref) {
|
|
11
11
|
var className = _ref.className,
|
|
12
|
+
_ref$fullWidth = _ref.fullWidth,
|
|
13
|
+
fullWidth = _ref$fullWidth === void 0 ? false : _ref$fullWidth,
|
|
12
14
|
children = _ref.children,
|
|
13
15
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
14
16
|
|
|
15
17
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
16
18
|
ref: ref,
|
|
17
|
-
className: clsx(className, true && 'govgr-width-container')
|
|
19
|
+
className: clsx(className, fullWidth === false && 'govgr-width-container', fullWidth === true && 'govgr-full-width-container')
|
|
18
20
|
}, props), children);
|
|
19
21
|
});
|
|
20
22
|
export default FooterContainer;
|