@digigov/react-core 0.5.2 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ArrowIcon/__snapshots__/index.test.tsx.snap +67 -0
- package/ArrowIcon/index.d.ts +15 -0
- package/ArrowIcon/index.js +73 -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 +146 -30
- package/BurgerIcon/index.d.ts +9 -3
- package/BurgerIcon/index.js +50 -11
- package/BurgerIcon/index.test.js +32 -6
- package/Button/index.d.ts +1 -1
- package/ButtonLink/index.d.ts +1 -1
- package/CHANGELOG.md +31 -1
- package/CallToAction/index.d.ts +1 -1
- package/CallToAction/index.js +3 -8
- package/CaretIcon/__snapshots__/index.test.tsx.snap +67 -0
- package/CaretIcon/index.d.ts +15 -0
- package/CaretIcon/index.js +73 -0
- package/CaretIcon/index.test.d.ts +1 -0
- package/CaretIcon/index.test.js +39 -0
- package/CheckIcon/__snapshots__/index.test.tsx.snap +256 -0
- package/CheckIcon/index.d.ts +19 -0
- package/CheckIcon/index.js +68 -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 +16 -0
- package/CloseIcon/index.d.ts +10 -0
- package/CloseIcon/index.js +42 -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/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/Link/index.d.ts +1 -1
- package/MoreVertIcon/__snapshots__/index.test.tsx.snap +436 -0
- package/MoreVertIcon/index.d.ts +19 -0
- package/MoreVertIcon/index.js +82 -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/NormalText/index.d.ts +1 -1
- package/NotificationBannerLink/index.d.ts +1 -1
- package/Paragraph/index.d.ts +1 -1
- package/RadioItem/index.d.ts +1 -1
- package/Select/index.d.ts +1 -1
- package/Table/index.d.ts +1 -1
- 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 +256 -0
- package/UncheckIcon/index.d.ts +19 -0
- package/UncheckIcon/index.js +68 -0
- package/UncheckIcon/index.test.d.ts +1 -0
- package/UncheckIcon/index.test.js +129 -0
- package/es/ArrowIcon/__snapshots__/index.test.tsx.snap +67 -0
- package/es/ArrowIcon/index.js +50 -0
- package/es/ArrowIcon/index.test.js +33 -0
- package/es/BackLink/index.js +4 -3
- package/es/BurgerIcon/__snapshots__/index.test.tsx.snap +146 -30
- package/es/BurgerIcon/index.js +42 -11
- package/es/BurgerIcon/index.test.js +32 -6
- package/es/CallToAction/index.js +2 -8
- package/es/CaretIcon/__snapshots__/index.test.tsx.snap +67 -0
- package/es/CaretIcon/index.js +50 -0
- package/es/CaretIcon/index.test.js +33 -0
- package/es/CheckIcon/__snapshots__/index.test.tsx.snap +256 -0
- package/es/CheckIcon/index.js +45 -0
- package/es/CheckIcon/index.test.js +123 -0
- package/es/CloseIcon/__snapshots__/index.test.tsx.snap +16 -0
- package/es/CloseIcon/index.js +27 -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 +436 -0
- package/es/MoreVertIcon/index.js +59 -0
- package/es/MoreVertIcon/index.test.js +123 -0
- package/es/UncheckIcon/__snapshots__/index.test.tsx.snap +256 -0
- package/es/UncheckIcon/index.js +45 -0
- package/es/UncheckIcon/index.test.js +123 -0
- package/es/index.js +6 -0
- package/esm/ArrowIcon/__snapshots__/index.test.tsx.snap +67 -0
- package/esm/ArrowIcon/index.js +50 -0
- package/esm/ArrowIcon/index.test.js +33 -0
- package/esm/BackLink/index.js +4 -3
- package/esm/BurgerIcon/__snapshots__/index.test.tsx.snap +146 -30
- package/esm/BurgerIcon/index.js +42 -11
- package/esm/BurgerIcon/index.test.js +32 -6
- package/esm/CallToAction/index.js +2 -8
- package/esm/CaretIcon/__snapshots__/index.test.tsx.snap +67 -0
- package/esm/CaretIcon/index.js +50 -0
- package/esm/CaretIcon/index.test.js +33 -0
- package/esm/CheckIcon/__snapshots__/index.test.tsx.snap +256 -0
- package/esm/CheckIcon/index.js +45 -0
- package/esm/CheckIcon/index.test.js +123 -0
- package/esm/CloseIcon/__snapshots__/index.test.tsx.snap +16 -0
- package/esm/CloseIcon/index.js +27 -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 +436 -0
- package/esm/MoreVertIcon/index.js +59 -0
- package/esm/MoreVertIcon/index.test.js +123 -0
- package/esm/UncheckIcon/__snapshots__/index.test.tsx.snap +256 -0
- package/esm/UncheckIcon/index.js +45 -0
- package/esm/UncheckIcon/index.test.js +123 -0
- package/esm/index.js +7 -1
- package/index.d.ts +6 -0
- package/index.js +48 -0
- package/package.json +3 -3
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`renders the CheckIcon with no props 1`] = `
|
|
4
|
+
<ForwardRef(CheckIcon)>
|
|
5
|
+
<svg
|
|
6
|
+
aria-hidden="true"
|
|
7
|
+
className="govgr-svg-icon--dark govgr-svg-icon--m govgr-svg-icon--check govgr-svg-icon"
|
|
8
|
+
focusable="false"
|
|
9
|
+
viewBox="0 0 24 24"
|
|
10
|
+
>
|
|
11
|
+
<polygon
|
|
12
|
+
points="9.63 18.697 2.339 11.478 4.661 9.133 9.631 14.055 19.34 4.451 21.66 6.796 9.63 18.697"
|
|
13
|
+
/>
|
|
14
|
+
</svg>
|
|
15
|
+
</ForwardRef(CheckIcon)>
|
|
16
|
+
`;
|
|
17
|
+
|
|
18
|
+
exports[`renders the CheckIcon with prop size=l 1`] = `
|
|
19
|
+
<ForwardRef(CheckIcon)
|
|
20
|
+
size="l"
|
|
21
|
+
>
|
|
22
|
+
<svg
|
|
23
|
+
aria-hidden="true"
|
|
24
|
+
className="govgr-svg-icon--dark govgr-svg-icon--l govgr-svg-icon--check govgr-svg-icon"
|
|
25
|
+
focusable="false"
|
|
26
|
+
viewBox="0 0 24 24"
|
|
27
|
+
>
|
|
28
|
+
<polygon
|
|
29
|
+
points="9.63 18.697 2.339 11.478 4.661 9.133 9.631 14.055 19.34 4.451 21.66 6.796 9.63 18.697"
|
|
30
|
+
/>
|
|
31
|
+
</svg>
|
|
32
|
+
</ForwardRef(CheckIcon)>
|
|
33
|
+
`;
|
|
34
|
+
|
|
35
|
+
exports[`renders the CheckIcon with prop size=m 1`] = `
|
|
36
|
+
<ForwardRef(CheckIcon)
|
|
37
|
+
size="m"
|
|
38
|
+
>
|
|
39
|
+
<svg
|
|
40
|
+
aria-hidden="true"
|
|
41
|
+
className="govgr-svg-icon--dark govgr-svg-icon--m govgr-svg-icon--check govgr-svg-icon"
|
|
42
|
+
focusable="false"
|
|
43
|
+
viewBox="0 0 24 24"
|
|
44
|
+
>
|
|
45
|
+
<polygon
|
|
46
|
+
points="9.63 18.697 2.339 11.478 4.661 9.133 9.631 14.055 19.34 4.451 21.66 6.796 9.63 18.697"
|
|
47
|
+
/>
|
|
48
|
+
</svg>
|
|
49
|
+
</ForwardRef(CheckIcon)>
|
|
50
|
+
`;
|
|
51
|
+
|
|
52
|
+
exports[`renders the CheckIcon with prop size=s 1`] = `
|
|
53
|
+
<ForwardRef(CheckIcon)
|
|
54
|
+
size="s"
|
|
55
|
+
>
|
|
56
|
+
<svg
|
|
57
|
+
aria-hidden="true"
|
|
58
|
+
className="govgr-svg-icon--dark govgr-svg-icon--s govgr-svg-icon--check govgr-svg-icon"
|
|
59
|
+
focusable="false"
|
|
60
|
+
viewBox="0 0 24 24"
|
|
61
|
+
>
|
|
62
|
+
<polygon
|
|
63
|
+
points="9.63 18.697 2.339 11.478 4.661 9.133 9.631 14.055 19.34 4.451 21.66 6.796 9.63 18.697"
|
|
64
|
+
/>
|
|
65
|
+
</svg>
|
|
66
|
+
</ForwardRef(CheckIcon)>
|
|
67
|
+
`;
|
|
68
|
+
|
|
69
|
+
exports[`renders the CheckIcon with prop size=xl 1`] = `
|
|
70
|
+
<ForwardRef(CheckIcon)
|
|
71
|
+
size="xl"
|
|
72
|
+
>
|
|
73
|
+
<svg
|
|
74
|
+
aria-hidden="true"
|
|
75
|
+
className="govgr-svg-icon--dark govgr-svg-icon--xl govgr-svg-icon--check govgr-svg-icon"
|
|
76
|
+
focusable="false"
|
|
77
|
+
viewBox="0 0 24 24"
|
|
78
|
+
>
|
|
79
|
+
<polygon
|
|
80
|
+
points="9.63 18.697 2.339 11.478 4.661 9.133 9.631 14.055 19.34 4.451 21.66 6.796 9.63 18.697"
|
|
81
|
+
/>
|
|
82
|
+
</svg>
|
|
83
|
+
</ForwardRef(CheckIcon)>
|
|
84
|
+
`;
|
|
85
|
+
|
|
86
|
+
exports[`renders the CheckIcon with prop variant=dark 1`] = `
|
|
87
|
+
<ForwardRef(CheckIcon)
|
|
88
|
+
variant="dark"
|
|
89
|
+
>
|
|
90
|
+
<svg
|
|
91
|
+
aria-hidden="true"
|
|
92
|
+
className="govgr-svg-icon--dark govgr-svg-icon--m govgr-svg-icon--check govgr-svg-icon"
|
|
93
|
+
focusable="false"
|
|
94
|
+
viewBox="0 0 24 24"
|
|
95
|
+
>
|
|
96
|
+
<polygon
|
|
97
|
+
points="9.63 18.697 2.339 11.478 4.661 9.133 9.631 14.055 19.34 4.451 21.66 6.796 9.63 18.697"
|
|
98
|
+
/>
|
|
99
|
+
</svg>
|
|
100
|
+
</ForwardRef(CheckIcon)>
|
|
101
|
+
`;
|
|
102
|
+
|
|
103
|
+
exports[`renders the CheckIcon with prop variant=error 1`] = `
|
|
104
|
+
<ForwardRef(CheckIcon)
|
|
105
|
+
variant="error"
|
|
106
|
+
>
|
|
107
|
+
<svg
|
|
108
|
+
aria-hidden="true"
|
|
109
|
+
className="govgr-svg-icon--error govgr-svg-icon--m govgr-svg-icon--check govgr-svg-icon"
|
|
110
|
+
focusable="false"
|
|
111
|
+
viewBox="0 0 24 24"
|
|
112
|
+
>
|
|
113
|
+
<polygon
|
|
114
|
+
points="9.63 18.697 2.339 11.478 4.661 9.133 9.631 14.055 19.34 4.451 21.66 6.796 9.63 18.697"
|
|
115
|
+
/>
|
|
116
|
+
</svg>
|
|
117
|
+
</ForwardRef(CheckIcon)>
|
|
118
|
+
`;
|
|
119
|
+
|
|
120
|
+
exports[`renders the CheckIcon with prop variant=error and size= xl 1`] = `
|
|
121
|
+
<ForwardRef(CheckIcon)
|
|
122
|
+
size="xl"
|
|
123
|
+
variant="warning"
|
|
124
|
+
>
|
|
125
|
+
<svg
|
|
126
|
+
aria-hidden="true"
|
|
127
|
+
className="govgr-svg-icon--warning govgr-svg-icon--xl govgr-svg-icon--check govgr-svg-icon"
|
|
128
|
+
focusable="false"
|
|
129
|
+
viewBox="0 0 24 24"
|
|
130
|
+
>
|
|
131
|
+
<polygon
|
|
132
|
+
points="9.63 18.697 2.339 11.478 4.661 9.133 9.631 14.055 19.34 4.451 21.66 6.796 9.63 18.697"
|
|
133
|
+
/>
|
|
134
|
+
</svg>
|
|
135
|
+
</ForwardRef(CheckIcon)>
|
|
136
|
+
`;
|
|
137
|
+
|
|
138
|
+
exports[`renders the CheckIcon with prop variant=focus 1`] = `
|
|
139
|
+
<ForwardRef(CheckIcon)
|
|
140
|
+
variant="focus"
|
|
141
|
+
>
|
|
142
|
+
<svg
|
|
143
|
+
aria-hidden="true"
|
|
144
|
+
className="govgr-svg-icon--focus govgr-svg-icon--m govgr-svg-icon--check govgr-svg-icon"
|
|
145
|
+
focusable="false"
|
|
146
|
+
viewBox="0 0 24 24"
|
|
147
|
+
>
|
|
148
|
+
<polygon
|
|
149
|
+
points="9.63 18.697 2.339 11.478 4.661 9.133 9.631 14.055 19.34 4.451 21.66 6.796 9.63 18.697"
|
|
150
|
+
/>
|
|
151
|
+
</svg>
|
|
152
|
+
</ForwardRef(CheckIcon)>
|
|
153
|
+
`;
|
|
154
|
+
|
|
155
|
+
exports[`renders the CheckIcon with prop variant=gray 1`] = `
|
|
156
|
+
<ForwardRef(CheckIcon)
|
|
157
|
+
variant="gray"
|
|
158
|
+
>
|
|
159
|
+
<svg
|
|
160
|
+
aria-hidden="true"
|
|
161
|
+
className="govgr-svg-icon--gray govgr-svg-icon--m govgr-svg-icon--check govgr-svg-icon"
|
|
162
|
+
focusable="false"
|
|
163
|
+
viewBox="0 0 24 24"
|
|
164
|
+
>
|
|
165
|
+
<polygon
|
|
166
|
+
points="9.63 18.697 2.339 11.478 4.661 9.133 9.631 14.055 19.34 4.451 21.66 6.796 9.63 18.697"
|
|
167
|
+
/>
|
|
168
|
+
</svg>
|
|
169
|
+
</ForwardRef(CheckIcon)>
|
|
170
|
+
`;
|
|
171
|
+
|
|
172
|
+
exports[`renders the CheckIcon with prop variant=light 1`] = `
|
|
173
|
+
<ForwardRef(CheckIcon)
|
|
174
|
+
variant="light"
|
|
175
|
+
>
|
|
176
|
+
<svg
|
|
177
|
+
aria-hidden="true"
|
|
178
|
+
className="govgr-svg-icon--light 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.63 18.697 2.339 11.478 4.661 9.133 9.631 14.055 19.34 4.451 21.66 6.796 9.63 18.697"
|
|
184
|
+
/>
|
|
185
|
+
</svg>
|
|
186
|
+
</ForwardRef(CheckIcon)>
|
|
187
|
+
`;
|
|
188
|
+
|
|
189
|
+
exports[`renders the CheckIcon with prop variant=primary 1`] = `
|
|
190
|
+
<ForwardRef(CheckIcon)
|
|
191
|
+
variant="primary"
|
|
192
|
+
>
|
|
193
|
+
<svg
|
|
194
|
+
aria-hidden="true"
|
|
195
|
+
className="govgr-svg-icon--primary govgr-svg-icon--m govgr-svg-icon--check govgr-svg-icon"
|
|
196
|
+
focusable="false"
|
|
197
|
+
viewBox="0 0 24 24"
|
|
198
|
+
>
|
|
199
|
+
<polygon
|
|
200
|
+
points="9.63 18.697 2.339 11.478 4.661 9.133 9.631 14.055 19.34 4.451 21.66 6.796 9.63 18.697"
|
|
201
|
+
/>
|
|
202
|
+
</svg>
|
|
203
|
+
</ForwardRef(CheckIcon)>
|
|
204
|
+
`;
|
|
205
|
+
|
|
206
|
+
exports[`renders the CheckIcon with prop variant=success 1`] = `
|
|
207
|
+
<ForwardRef(CheckIcon)
|
|
208
|
+
variant="success"
|
|
209
|
+
>
|
|
210
|
+
<svg
|
|
211
|
+
aria-hidden="true"
|
|
212
|
+
className="govgr-svg-icon--success govgr-svg-icon--m govgr-svg-icon--check govgr-svg-icon"
|
|
213
|
+
focusable="false"
|
|
214
|
+
viewBox="0 0 24 24"
|
|
215
|
+
>
|
|
216
|
+
<polygon
|
|
217
|
+
points="9.63 18.697 2.339 11.478 4.661 9.133 9.631 14.055 19.34 4.451 21.66 6.796 9.63 18.697"
|
|
218
|
+
/>
|
|
219
|
+
</svg>
|
|
220
|
+
</ForwardRef(CheckIcon)>
|
|
221
|
+
`;
|
|
222
|
+
|
|
223
|
+
exports[`renders the CheckIcon with prop variant=warning 1`] = `
|
|
224
|
+
<ForwardRef(CheckIcon)
|
|
225
|
+
variant="warning"
|
|
226
|
+
>
|
|
227
|
+
<svg
|
|
228
|
+
aria-hidden="true"
|
|
229
|
+
className="govgr-svg-icon--warning govgr-svg-icon--m govgr-svg-icon--check govgr-svg-icon"
|
|
230
|
+
focusable="false"
|
|
231
|
+
viewBox="0 0 24 24"
|
|
232
|
+
>
|
|
233
|
+
<polygon
|
|
234
|
+
points="9.63 18.697 2.339 11.478 4.661 9.133 9.631 14.055 19.34 4.451 21.66 6.796 9.63 18.697"
|
|
235
|
+
/>
|
|
236
|
+
</svg>
|
|
237
|
+
</ForwardRef(CheckIcon)>
|
|
238
|
+
`;
|
|
239
|
+
|
|
240
|
+
exports[`renders the CheckIcon with prop variant=warning and size=s 1`] = `
|
|
241
|
+
<ForwardRef(CheckIcon)
|
|
242
|
+
size="s"
|
|
243
|
+
variant="warning"
|
|
244
|
+
>
|
|
245
|
+
<svg
|
|
246
|
+
aria-hidden="true"
|
|
247
|
+
className="govgr-svg-icon--warning govgr-svg-icon--s govgr-svg-icon--check govgr-svg-icon"
|
|
248
|
+
focusable="false"
|
|
249
|
+
viewBox="0 0 24 24"
|
|
250
|
+
>
|
|
251
|
+
<polygon
|
|
252
|
+
points="9.63 18.697 2.339 11.478 4.661 9.133 9.631 14.055 19.34 4.451 21.66 6.796 9.63 18.697"
|
|
253
|
+
/>
|
|
254
|
+
</svg>
|
|
255
|
+
</ForwardRef(CheckIcon)>
|
|
256
|
+
`;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
+
var _excluded = ["size", "variant", "className"];
|
|
5
|
+
import React, { useEffect, useState } from 'react';
|
|
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 _ref$size = _ref.size,
|
|
17
|
+
size = _ref$size === void 0 ? 'm' : _ref$size,
|
|
18
|
+
_ref$variant = _ref.variant,
|
|
19
|
+
variant = _ref$variant === void 0 ? 'dark' : _ref$variant,
|
|
20
|
+
className = _ref.className,
|
|
21
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
22
|
+
|
|
23
|
+
var _useState = useState(size),
|
|
24
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
25
|
+
checkSize = _useState2[0],
|
|
26
|
+
setSize = _useState2[1];
|
|
27
|
+
|
|
28
|
+
var _useState3 = useState(variant),
|
|
29
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
30
|
+
checkVariant = _useState4[0],
|
|
31
|
+
setVariant = _useState4[1];
|
|
32
|
+
|
|
33
|
+
useEffect(function () {
|
|
34
|
+
setSize(size);
|
|
35
|
+
setVariant(variant);
|
|
36
|
+
}, [size, variant]);
|
|
37
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
38
|
+
ref: ref,
|
|
39
|
+
className: clsx(checkVariant === 'success' && 'govgr-svg-icon--success', checkVariant === 'primary' && 'govgr-svg-icon--primary', checkVariant === 'warning' && 'govgr-svg-icon--warning', checkVariant === 'light' && 'govgr-svg-icon--light', checkVariant === 'error' && 'govgr-svg-icon--error', checkVariant === 'focus' && 'govgr-svg-icon--focus', checkVariant === 'dark' && 'govgr-svg-icon--dark', checkVariant === 'gray' && 'govgr-svg-icon--gray', checkVariant === 'link' && 'govgr-svg-icon--link', checkSize === 'xl' && 'govgr-svg-icon--xl', checkSize === 's' && 'govgr-svg-icon--s', checkSize === 'm' && 'govgr-svg-icon--m', checkSize === 'l' && 'govgr-svg-icon--l', className && className, true && ['govgr-svg-icon--check', 'govgr-svg-icon']),
|
|
40
|
+
focusable: "false",
|
|
41
|
+
viewBox: "0 0 24 24",
|
|
42
|
+
"aria-hidden": "true"
|
|
43
|
+
}, props), _ref2);
|
|
44
|
+
});
|
|
45
|
+
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,16 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`renders the CloseIcon with no props 1`] = `
|
|
4
|
+
<ForwardRef(CloseIcon)>
|
|
5
|
+
<svg
|
|
6
|
+
aria-hidden="true"
|
|
7
|
+
className="govgr-close-icon"
|
|
8
|
+
focusable="false"
|
|
9
|
+
viewBox="0 0 24 24"
|
|
10
|
+
>
|
|
11
|
+
<polygon
|
|
12
|
+
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 "
|
|
13
|
+
/>
|
|
14
|
+
</svg>
|
|
15
|
+
</ForwardRef(CloseIcon)>
|
|
16
|
+
`;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["className"];
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
|
|
7
|
+
var _ref2 = /*#__PURE__*/React.createElement("polygon", {
|
|
8
|
+
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 "
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* CloseIcon component is used to add close icon.
|
|
13
|
+
* CloseIcon component can be used for dismissing contents
|
|
14
|
+
*/
|
|
15
|
+
export var CloseIcon = /*#__PURE__*/React.forwardRef(function CloseIcon(_ref, ref) {
|
|
16
|
+
var className = _ref.className,
|
|
17
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
18
|
+
|
|
19
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
20
|
+
ref: ref,
|
|
21
|
+
className: clsx(className && className, true && 'govgr-close-icon'),
|
|
22
|
+
focusable: "false",
|
|
23
|
+
viewBox: "0 0 24 24",
|
|
24
|
+
"aria-hidden": "true"
|
|
25
|
+
}, props), _ref2);
|
|
26
|
+
});
|
|
27
|
+
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;
|