@digigov/react-core 0.6.4 → 0.8.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/BackLink/__snapshots__/index.test.tsx.snap +34 -6
- package/CHANGELOG.md +23 -1
- package/List/index.d.ts +1 -1
- package/List/index.js +2 -1
- package/TableDataCell/index.d.ts +1 -1
- package/TableHeaderCell/index.d.ts +1 -1
- package/es/BackLink/__snapshots__/index.test.tsx.snap +34 -6
- package/es/List/index.js +2 -1
- package/es/index.js +0 -3
- package/esm/BackLink/__snapshots__/index.test.tsx.snap +34 -6
- package/esm/List/index.js +2 -1
- package/esm/index.js +1 -4
- package/index.d.ts +0 -3
- package/index.js +0 -24
- package/package.json +2 -2
- package/Dropdown/__snapshots__/index.test.tsx.snap +0 -144
- package/Dropdown/index.d.ts +0 -30
- package/Dropdown/index.js +0 -42
- package/Dropdown/index.test.d.ts +0 -1
- package/Dropdown/index.test.js +0 -101
- package/DropdownButton/__snapshots__/index.test.tsx.snap +0 -375
- package/DropdownButton/index.d.ts +0 -28
- package/DropdownButton/index.js +0 -47
- package/DropdownButton/index.test.d.ts +0 -1
- package/DropdownButton/index.test.js +0 -195
- package/DropdownContent/__snapshots__/index.test.tsx.snap +0 -11
- package/DropdownContent/index.d.ts +0 -9
- package/DropdownContent/index.js +0 -35
- package/DropdownContent/index.test.d.ts +0 -1
- package/DropdownContent/index.test.js +0 -15
- package/es/Dropdown/__snapshots__/index.test.tsx.snap +0 -144
- package/es/Dropdown/index.js +0 -27
- package/es/Dropdown/index.test.js +0 -95
- package/es/DropdownButton/__snapshots__/index.test.tsx.snap +0 -375
- package/es/DropdownButton/index.js +0 -31
- package/es/DropdownButton/index.test.js +0 -189
- package/es/DropdownContent/__snapshots__/index.test.tsx.snap +0 -11
- package/es/DropdownContent/index.js +0 -20
- package/es/DropdownContent/index.test.js +0 -9
- package/esm/Dropdown/__snapshots__/index.test.tsx.snap +0 -144
- package/esm/Dropdown/index.js +0 -27
- package/esm/Dropdown/index.test.js +0 -95
- package/esm/DropdownButton/__snapshots__/index.test.tsx.snap +0 -375
- package/esm/DropdownButton/index.js +0 -31
- package/esm/DropdownButton/index.test.js +0 -189
- package/esm/DropdownContent/__snapshots__/index.test.tsx.snap +0 -11
- package/esm/DropdownContent/index.js +0 -20
- package/esm/DropdownContent/index.test.js +0 -9
|
@@ -1,375 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`renders the DropdownButton with arrow=false 1`] = `
|
|
4
|
-
<ForwardRef(DropdownButton)
|
|
5
|
-
arrow={false}
|
|
6
|
-
>
|
|
7
|
-
<summary
|
|
8
|
-
className="govgr-btn-primary govgr-btn govgr-dropdown__button"
|
|
9
|
-
>
|
|
10
|
-
hello
|
|
11
|
-
</summary>
|
|
12
|
-
</ForwardRef(DropdownButton)>
|
|
13
|
-
`;
|
|
14
|
-
|
|
15
|
-
exports[`renders the DropdownButton with arrow=true 1`] = `
|
|
16
|
-
<ForwardRef(DropdownButton)
|
|
17
|
-
arrow={true}
|
|
18
|
-
>
|
|
19
|
-
<summary
|
|
20
|
-
className="govgr-btn-primary govgr-btn govgr-dropdown__button--arrow govgr-dropdown__button"
|
|
21
|
-
>
|
|
22
|
-
hello
|
|
23
|
-
<ForwardRef(ArrowIcon)
|
|
24
|
-
direction="down"
|
|
25
|
-
>
|
|
26
|
-
<ForwardRef(SvgIcon)
|
|
27
|
-
className="govgr-arrow--down"
|
|
28
|
-
>
|
|
29
|
-
<svg
|
|
30
|
-
aria-hidden="true"
|
|
31
|
-
className="govgr-arrow--down govgr-svg-icon"
|
|
32
|
-
focusable="false"
|
|
33
|
-
viewBox="0 0 24 24"
|
|
34
|
-
>
|
|
35
|
-
<path
|
|
36
|
-
d="M22,8.2l-2.3-2.4L12,13.4L4.4,5.8L2,8.2l10,10L22,8.2z"
|
|
37
|
-
/>
|
|
38
|
-
</svg>
|
|
39
|
-
</ForwardRef(SvgIcon)>
|
|
40
|
-
</ForwardRef(ArrowIcon)>
|
|
41
|
-
</summary>
|
|
42
|
-
</ForwardRef(DropdownButton)>
|
|
43
|
-
`;
|
|
44
|
-
|
|
45
|
-
exports[`renders the DropdownButton with color=primary 1`] = `
|
|
46
|
-
<ForwardRef(DropdownButton)
|
|
47
|
-
color="primary"
|
|
48
|
-
>
|
|
49
|
-
<summary
|
|
50
|
-
className="govgr-btn-primary govgr-btn govgr-dropdown__button"
|
|
51
|
-
>
|
|
52
|
-
hello
|
|
53
|
-
</summary>
|
|
54
|
-
</ForwardRef(DropdownButton)>
|
|
55
|
-
`;
|
|
56
|
-
|
|
57
|
-
exports[`renders the DropdownButton with color=primary and arrow={false} 1`] = `
|
|
58
|
-
<ForwardRef(DropdownButton)
|
|
59
|
-
arrow={false}
|
|
60
|
-
color="primary"
|
|
61
|
-
>
|
|
62
|
-
<summary
|
|
63
|
-
className="govgr-btn-primary govgr-btn govgr-dropdown__button"
|
|
64
|
-
>
|
|
65
|
-
hello
|
|
66
|
-
</summary>
|
|
67
|
-
</ForwardRef(DropdownButton)>
|
|
68
|
-
`;
|
|
69
|
-
|
|
70
|
-
exports[`renders the DropdownButton with color=primary and arrow={true} 1`] = `
|
|
71
|
-
<ForwardRef(DropdownButton)
|
|
72
|
-
arrow={true}
|
|
73
|
-
color="primary"
|
|
74
|
-
>
|
|
75
|
-
<summary
|
|
76
|
-
className="govgr-btn-primary govgr-btn govgr-dropdown__button--arrow govgr-dropdown__button"
|
|
77
|
-
>
|
|
78
|
-
<ForwardRef(ArrowIcon)
|
|
79
|
-
direction="down"
|
|
80
|
-
>
|
|
81
|
-
<ForwardRef(SvgIcon)
|
|
82
|
-
className="govgr-arrow--down"
|
|
83
|
-
>
|
|
84
|
-
<svg
|
|
85
|
-
aria-hidden="true"
|
|
86
|
-
className="govgr-arrow--down govgr-svg-icon"
|
|
87
|
-
focusable="false"
|
|
88
|
-
viewBox="0 0 24 24"
|
|
89
|
-
>
|
|
90
|
-
<path
|
|
91
|
-
d="M22,8.2l-2.3-2.4L12,13.4L4.4,5.8L2,8.2l10,10L22,8.2z"
|
|
92
|
-
/>
|
|
93
|
-
</svg>
|
|
94
|
-
</ForwardRef(SvgIcon)>
|
|
95
|
-
</ForwardRef(ArrowIcon)>
|
|
96
|
-
</summary>
|
|
97
|
-
</ForwardRef(DropdownButton)>
|
|
98
|
-
`;
|
|
99
|
-
|
|
100
|
-
exports[`renders the DropdownButton with color=primary and variant="button" 1`] = `
|
|
101
|
-
<ForwardRef(DropdownButton)
|
|
102
|
-
color="primary"
|
|
103
|
-
variant="button"
|
|
104
|
-
>
|
|
105
|
-
<summary
|
|
106
|
-
className="govgr-btn-primary govgr-btn govgr-dropdown__button"
|
|
107
|
-
>
|
|
108
|
-
hello
|
|
109
|
-
</summary>
|
|
110
|
-
</ForwardRef(DropdownButton)>
|
|
111
|
-
`;
|
|
112
|
-
|
|
113
|
-
exports[`renders the DropdownButton with color=primary and variant="link" 1`] = `
|
|
114
|
-
<ForwardRef(DropdownButton)
|
|
115
|
-
color="primary"
|
|
116
|
-
variant="link"
|
|
117
|
-
>
|
|
118
|
-
<summary
|
|
119
|
-
className="govgr-link govgr-dropdown__button"
|
|
120
|
-
>
|
|
121
|
-
hello
|
|
122
|
-
</summary>
|
|
123
|
-
</ForwardRef(DropdownButton)>
|
|
124
|
-
`;
|
|
125
|
-
|
|
126
|
-
exports[`renders the DropdownButton with color=primary and variant="link" 2`] = `
|
|
127
|
-
<ForwardRef(DropdownButton)
|
|
128
|
-
color="secondary"
|
|
129
|
-
variant="link"
|
|
130
|
-
>
|
|
131
|
-
<summary
|
|
132
|
-
className="govgr-link govgr-dropdown__button"
|
|
133
|
-
>
|
|
134
|
-
hello
|
|
135
|
-
</summary>
|
|
136
|
-
</ForwardRef(DropdownButton)>
|
|
137
|
-
`;
|
|
138
|
-
|
|
139
|
-
exports[`renders the DropdownButton with color=primary variant="button" and arrow={false} 1`] = `
|
|
140
|
-
<ForwardRef(DropdownButton)
|
|
141
|
-
arrow={false}
|
|
142
|
-
color="primary"
|
|
143
|
-
variant="button"
|
|
144
|
-
>
|
|
145
|
-
<summary
|
|
146
|
-
className="govgr-btn-primary govgr-btn govgr-dropdown__button"
|
|
147
|
-
>
|
|
148
|
-
hello
|
|
149
|
-
</summary>
|
|
150
|
-
</ForwardRef(DropdownButton)>
|
|
151
|
-
`;
|
|
152
|
-
|
|
153
|
-
exports[`renders the DropdownButton with color=primary variant="button" arrow={true} 1`] = `
|
|
154
|
-
<ForwardRef(DropdownButton)
|
|
155
|
-
arrow={true}
|
|
156
|
-
color="primary"
|
|
157
|
-
variant="button"
|
|
158
|
-
>
|
|
159
|
-
<summary
|
|
160
|
-
className="govgr-btn-primary govgr-btn govgr-dropdown__button--arrow govgr-dropdown__button"
|
|
161
|
-
>
|
|
162
|
-
<ForwardRef(ArrowIcon)
|
|
163
|
-
direction="down"
|
|
164
|
-
>
|
|
165
|
-
<ForwardRef(SvgIcon)
|
|
166
|
-
className="govgr-arrow--down"
|
|
167
|
-
>
|
|
168
|
-
<svg
|
|
169
|
-
aria-hidden="true"
|
|
170
|
-
className="govgr-arrow--down govgr-svg-icon"
|
|
171
|
-
focusable="false"
|
|
172
|
-
viewBox="0 0 24 24"
|
|
173
|
-
>
|
|
174
|
-
<path
|
|
175
|
-
d="M22,8.2l-2.3-2.4L12,13.4L4.4,5.8L2,8.2l10,10L22,8.2z"
|
|
176
|
-
/>
|
|
177
|
-
</svg>
|
|
178
|
-
</ForwardRef(SvgIcon)>
|
|
179
|
-
</ForwardRef(ArrowIcon)>
|
|
180
|
-
</summary>
|
|
181
|
-
</ForwardRef(DropdownButton)>
|
|
182
|
-
`;
|
|
183
|
-
|
|
184
|
-
exports[`renders the DropdownButton with color=primary variant="link" arrow={false} 1`] = `
|
|
185
|
-
<ForwardRef(DropdownButton)
|
|
186
|
-
arrow={false}
|
|
187
|
-
color="primary"
|
|
188
|
-
variant="link"
|
|
189
|
-
>
|
|
190
|
-
<summary
|
|
191
|
-
className="govgr-link govgr-dropdown__button"
|
|
192
|
-
>
|
|
193
|
-
hello
|
|
194
|
-
</summary>
|
|
195
|
-
</ForwardRef(DropdownButton)>
|
|
196
|
-
`;
|
|
197
|
-
|
|
198
|
-
exports[`renders the DropdownButton with color=primary variant="link" arrow={true} 1`] = `
|
|
199
|
-
<ForwardRef(DropdownButton)
|
|
200
|
-
arrow={true}
|
|
201
|
-
color="primary"
|
|
202
|
-
variant="link"
|
|
203
|
-
>
|
|
204
|
-
<summary
|
|
205
|
-
className="govgr-link govgr-dropdown__button--arrow govgr-dropdown__button"
|
|
206
|
-
>
|
|
207
|
-
<ForwardRef(ArrowIcon)
|
|
208
|
-
direction="down"
|
|
209
|
-
>
|
|
210
|
-
<ForwardRef(SvgIcon)
|
|
211
|
-
className="govgr-arrow--down"
|
|
212
|
-
>
|
|
213
|
-
<svg
|
|
214
|
-
aria-hidden="true"
|
|
215
|
-
className="govgr-arrow--down govgr-svg-icon"
|
|
216
|
-
focusable="false"
|
|
217
|
-
viewBox="0 0 24 24"
|
|
218
|
-
>
|
|
219
|
-
<path
|
|
220
|
-
d="M22,8.2l-2.3-2.4L12,13.4L4.4,5.8L2,8.2l10,10L22,8.2z"
|
|
221
|
-
/>
|
|
222
|
-
</svg>
|
|
223
|
-
</ForwardRef(SvgIcon)>
|
|
224
|
-
</ForwardRef(ArrowIcon)>
|
|
225
|
-
</summary>
|
|
226
|
-
</ForwardRef(DropdownButton)>
|
|
227
|
-
`;
|
|
228
|
-
|
|
229
|
-
exports[`renders the DropdownButton with color=secondary 1`] = `
|
|
230
|
-
<ForwardRef(DropdownButton)
|
|
231
|
-
color="secondary"
|
|
232
|
-
>
|
|
233
|
-
<summary
|
|
234
|
-
className="govgr-btn-secondary govgr-btn govgr-dropdown__button"
|
|
235
|
-
>
|
|
236
|
-
hello
|
|
237
|
-
</summary>
|
|
238
|
-
</ForwardRef(DropdownButton)>
|
|
239
|
-
`;
|
|
240
|
-
|
|
241
|
-
exports[`renders the DropdownButton with color=secondary and arrow={false} 1`] = `
|
|
242
|
-
<ForwardRef(DropdownButton)
|
|
243
|
-
arrow={false}
|
|
244
|
-
color="secondary"
|
|
245
|
-
>
|
|
246
|
-
<summary
|
|
247
|
-
className="govgr-btn-secondary govgr-btn govgr-dropdown__button"
|
|
248
|
-
>
|
|
249
|
-
hello
|
|
250
|
-
</summary>
|
|
251
|
-
</ForwardRef(DropdownButton)>
|
|
252
|
-
`;
|
|
253
|
-
|
|
254
|
-
exports[`renders the DropdownButton with color=secondary and arrow={true} 1`] = `
|
|
255
|
-
<ForwardRef(DropdownButton)
|
|
256
|
-
arrow={true}
|
|
257
|
-
color="secondary"
|
|
258
|
-
>
|
|
259
|
-
<summary
|
|
260
|
-
className="govgr-btn-secondary govgr-btn govgr-dropdown__button--arrow govgr-dropdown__button"
|
|
261
|
-
>
|
|
262
|
-
<ForwardRef(ArrowIcon)
|
|
263
|
-
direction="down"
|
|
264
|
-
>
|
|
265
|
-
<ForwardRef(SvgIcon)
|
|
266
|
-
className="govgr-arrow--down"
|
|
267
|
-
>
|
|
268
|
-
<svg
|
|
269
|
-
aria-hidden="true"
|
|
270
|
-
className="govgr-arrow--down govgr-svg-icon"
|
|
271
|
-
focusable="false"
|
|
272
|
-
viewBox="0 0 24 24"
|
|
273
|
-
>
|
|
274
|
-
<path
|
|
275
|
-
d="M22,8.2l-2.3-2.4L12,13.4L4.4,5.8L2,8.2l10,10L22,8.2z"
|
|
276
|
-
/>
|
|
277
|
-
</svg>
|
|
278
|
-
</ForwardRef(SvgIcon)>
|
|
279
|
-
</ForwardRef(ArrowIcon)>
|
|
280
|
-
</summary>
|
|
281
|
-
</ForwardRef(DropdownButton)>
|
|
282
|
-
`;
|
|
283
|
-
|
|
284
|
-
exports[`renders the DropdownButton with color=secondary and variant="button" 1`] = `
|
|
285
|
-
<ForwardRef(DropdownButton)
|
|
286
|
-
color="secondary"
|
|
287
|
-
variant="button"
|
|
288
|
-
>
|
|
289
|
-
<summary
|
|
290
|
-
className="govgr-btn-secondary govgr-btn govgr-dropdown__button"
|
|
291
|
-
>
|
|
292
|
-
hello
|
|
293
|
-
</summary>
|
|
294
|
-
</ForwardRef(DropdownButton)>
|
|
295
|
-
`;
|
|
296
|
-
|
|
297
|
-
exports[`renders the DropdownButton with color=warning variant="button" arrow={false} 1`] = `
|
|
298
|
-
<ForwardRef(DropdownButton)
|
|
299
|
-
arrow={false}
|
|
300
|
-
color="warning"
|
|
301
|
-
variant="link"
|
|
302
|
-
>
|
|
303
|
-
<summary
|
|
304
|
-
className="govgr-link govgr-dropdown__button"
|
|
305
|
-
>
|
|
306
|
-
hello
|
|
307
|
-
</summary>
|
|
308
|
-
</ForwardRef(DropdownButton)>
|
|
309
|
-
`;
|
|
310
|
-
|
|
311
|
-
exports[`renders the DropdownButton with color=warning variant="button" arrow={true} 1`] = `
|
|
312
|
-
<ForwardRef(DropdownButton)
|
|
313
|
-
arrow={true}
|
|
314
|
-
color="warning"
|
|
315
|
-
variant="link"
|
|
316
|
-
>
|
|
317
|
-
<summary
|
|
318
|
-
className="govgr-link govgr-dropdown__button--arrow govgr-dropdown__button"
|
|
319
|
-
>
|
|
320
|
-
hello
|
|
321
|
-
<ForwardRef(ArrowIcon)
|
|
322
|
-
direction="down"
|
|
323
|
-
>
|
|
324
|
-
<ForwardRef(SvgIcon)
|
|
325
|
-
className="govgr-arrow--down"
|
|
326
|
-
>
|
|
327
|
-
<svg
|
|
328
|
-
aria-hidden="true"
|
|
329
|
-
className="govgr-arrow--down govgr-svg-icon"
|
|
330
|
-
focusable="false"
|
|
331
|
-
viewBox="0 0 24 24"
|
|
332
|
-
>
|
|
333
|
-
<path
|
|
334
|
-
d="M22,8.2l-2.3-2.4L12,13.4L4.4,5.8L2,8.2l10,10L22,8.2z"
|
|
335
|
-
/>
|
|
336
|
-
</svg>
|
|
337
|
-
</ForwardRef(SvgIcon)>
|
|
338
|
-
</ForwardRef(ArrowIcon)>
|
|
339
|
-
</summary>
|
|
340
|
-
</ForwardRef(DropdownButton)>
|
|
341
|
-
`;
|
|
342
|
-
|
|
343
|
-
exports[`renders the DropdownButton with no props 1`] = `
|
|
344
|
-
<ForwardRef(DropdownButton)>
|
|
345
|
-
<summary
|
|
346
|
-
className="govgr-btn-primary govgr-btn govgr-dropdown__button"
|
|
347
|
-
>
|
|
348
|
-
hello
|
|
349
|
-
</summary>
|
|
350
|
-
</ForwardRef(DropdownButton)>
|
|
351
|
-
`;
|
|
352
|
-
|
|
353
|
-
exports[`renders the DropdownButton with variant=button 1`] = `
|
|
354
|
-
<ForwardRef(DropdownButton)
|
|
355
|
-
variant="button"
|
|
356
|
-
>
|
|
357
|
-
<summary
|
|
358
|
-
className="govgr-btn-primary govgr-btn govgr-dropdown__button"
|
|
359
|
-
>
|
|
360
|
-
hello
|
|
361
|
-
</summary>
|
|
362
|
-
</ForwardRef(DropdownButton)>
|
|
363
|
-
`;
|
|
364
|
-
|
|
365
|
-
exports[`renders the DropdownButton with variant=link 1`] = `
|
|
366
|
-
<ForwardRef(DropdownButton)
|
|
367
|
-
variant="link"
|
|
368
|
-
>
|
|
369
|
-
<summary
|
|
370
|
-
className="govgr-link govgr-dropdown__button"
|
|
371
|
-
>
|
|
372
|
-
hello
|
|
373
|
-
</summary>
|
|
374
|
-
</ForwardRef(DropdownButton)>
|
|
375
|
-
`;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["className", "children", "color", "variant", "arrow"];
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import clsx from 'clsx';
|
|
6
|
-
import ArrowIcon from '@digigov/react-core/ArrowIcon';
|
|
7
|
-
|
|
8
|
-
var _ref2 = /*#__PURE__*/React.createElement(ArrowIcon, {
|
|
9
|
-
direction: "down"
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* DropdownButton it should be inside the Dropdown and it is used for opening or closing dropdown.
|
|
14
|
-
*/
|
|
15
|
-
export var DropdownButton = /*#__PURE__*/React.forwardRef(function DropdownButton(_ref, ref) {
|
|
16
|
-
var className = _ref.className,
|
|
17
|
-
children = _ref.children,
|
|
18
|
-
_ref$color = _ref.color,
|
|
19
|
-
color = _ref$color === void 0 ? 'primary' : _ref$color,
|
|
20
|
-
_ref$variant = _ref.variant,
|
|
21
|
-
variant = _ref$variant === void 0 ? 'button' : _ref$variant,
|
|
22
|
-
_ref$arrow = _ref.arrow,
|
|
23
|
-
arrow = _ref$arrow === void 0 ? false : _ref$arrow,
|
|
24
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
25
|
-
|
|
26
|
-
return /*#__PURE__*/React.createElement("summary", _extends({
|
|
27
|
-
ref: ref,
|
|
28
|
-
className: clsx(className, variant === 'button' && [color === 'secondary' && 'govgr-btn-secondary', color === 'primary' && 'govgr-btn-primary', color === 'warning' && 'govgr-btn-warning', 'govgr-btn'], variant === 'link' && 'govgr-link', arrow === true && 'govgr-dropdown__button--arrow', true && 'govgr-dropdown__button')
|
|
29
|
-
}, props), children, arrow === true && _ref2);
|
|
30
|
-
});
|
|
31
|
-
export default DropdownButton;
|
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { mount } from 'enzyme';
|
|
3
|
-
import DropdownButton from '@digigov/react-core/DropdownButton';
|
|
4
|
-
|
|
5
|
-
var _ref = /*#__PURE__*/React.createElement(DropdownButton, null, "hello");
|
|
6
|
-
|
|
7
|
-
it('renders the DropdownButton with no props', function () {
|
|
8
|
-
expect(mount(_ref)).toMatchSnapshot();
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
var _ref2 = /*#__PURE__*/React.createElement(DropdownButton, {
|
|
12
|
-
color: "primary"
|
|
13
|
-
}, "hello");
|
|
14
|
-
|
|
15
|
-
it('renders the DropdownButton with color=primary', function () {
|
|
16
|
-
expect(mount(_ref2)).toMatchSnapshot();
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
var _ref3 = /*#__PURE__*/React.createElement(DropdownButton, {
|
|
20
|
-
color: "secondary"
|
|
21
|
-
}, "hello");
|
|
22
|
-
|
|
23
|
-
it('renders the DropdownButton with color=secondary', function () {
|
|
24
|
-
expect(mount(_ref3)).toMatchSnapshot();
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
var _ref4 = /*#__PURE__*/React.createElement(DropdownButton, {
|
|
28
|
-
variant: "button"
|
|
29
|
-
}, "hello");
|
|
30
|
-
|
|
31
|
-
it('renders the DropdownButton with variant=button', function () {
|
|
32
|
-
expect(mount(_ref4)).toMatchSnapshot();
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
var _ref5 = /*#__PURE__*/React.createElement(DropdownButton, {
|
|
36
|
-
variant: "link"
|
|
37
|
-
}, "hello");
|
|
38
|
-
|
|
39
|
-
it('renders the DropdownButton with variant=link', function () {
|
|
40
|
-
expect(mount(_ref5)).toMatchSnapshot();
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
var _ref6 = /*#__PURE__*/React.createElement(DropdownButton, {
|
|
44
|
-
arrow: false
|
|
45
|
-
}, "hello");
|
|
46
|
-
|
|
47
|
-
it('renders the DropdownButton with arrow=false', function () {
|
|
48
|
-
expect(mount(_ref6)).toMatchSnapshot();
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
var _ref7 = /*#__PURE__*/React.createElement(DropdownButton, {
|
|
52
|
-
arrow: true
|
|
53
|
-
}, "hello");
|
|
54
|
-
|
|
55
|
-
it('renders the DropdownButton with arrow=true', function () {
|
|
56
|
-
expect(mount(_ref7)).toMatchSnapshot();
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
var _ref8 = /*#__PURE__*/React.createElement(DropdownButton, {
|
|
60
|
-
color: "primary",
|
|
61
|
-
variant: "button"
|
|
62
|
-
}, "hello");
|
|
63
|
-
|
|
64
|
-
it('renders the DropdownButton with color=primary and variant="button"', function () {
|
|
65
|
-
expect(mount(_ref8)).toMatchSnapshot();
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
var _ref9 = /*#__PURE__*/React.createElement(DropdownButton, {
|
|
69
|
-
color: "primary",
|
|
70
|
-
variant: "link"
|
|
71
|
-
}, "hello");
|
|
72
|
-
|
|
73
|
-
it('renders the DropdownButton with color=primary and variant="link"', function () {
|
|
74
|
-
expect(mount(_ref9)).toMatchSnapshot();
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
var _ref10 = /*#__PURE__*/React.createElement(DropdownButton, {
|
|
78
|
-
color: "primary",
|
|
79
|
-
arrow: false
|
|
80
|
-
}, "hello");
|
|
81
|
-
|
|
82
|
-
it('renders the DropdownButton with color=primary and arrow={false}', function () {
|
|
83
|
-
expect(mount(_ref10)).toMatchSnapshot();
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
var _ref11 = /*#__PURE__*/React.createElement(DropdownButton, {
|
|
87
|
-
color: "primary",
|
|
88
|
-
arrow: true
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
it('renders the DropdownButton with color=primary and arrow={true}', function () {
|
|
92
|
-
expect(mount(_ref11)).toMatchSnapshot();
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
var _ref12 = /*#__PURE__*/React.createElement(DropdownButton, {
|
|
96
|
-
color: "secondary",
|
|
97
|
-
variant: "button"
|
|
98
|
-
}, "hello");
|
|
99
|
-
|
|
100
|
-
it('renders the DropdownButton with color=secondary and variant="button"', function () {
|
|
101
|
-
expect(mount(_ref12)).toMatchSnapshot();
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
var _ref13 = /*#__PURE__*/React.createElement(DropdownButton, {
|
|
105
|
-
color: "secondary",
|
|
106
|
-
variant: "link"
|
|
107
|
-
}, "hello");
|
|
108
|
-
|
|
109
|
-
it('renders the DropdownButton with color=primary and variant="link"', function () {
|
|
110
|
-
expect(mount(_ref13)).toMatchSnapshot();
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
var _ref14 = /*#__PURE__*/React.createElement(DropdownButton, {
|
|
114
|
-
color: "secondary",
|
|
115
|
-
arrow: false
|
|
116
|
-
}, "hello");
|
|
117
|
-
|
|
118
|
-
it('renders the DropdownButton with color=secondary and arrow={false}', function () {
|
|
119
|
-
expect(mount(_ref14)).toMatchSnapshot();
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
var _ref15 = /*#__PURE__*/React.createElement(DropdownButton, {
|
|
123
|
-
color: "secondary",
|
|
124
|
-
arrow: true
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
it('renders the DropdownButton with color=secondary and arrow={true}', function () {
|
|
128
|
-
expect(mount(_ref15)).toMatchSnapshot();
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
var _ref16 = /*#__PURE__*/React.createElement(DropdownButton, {
|
|
132
|
-
color: "primary",
|
|
133
|
-
variant: "button",
|
|
134
|
-
arrow: false
|
|
135
|
-
}, "hello");
|
|
136
|
-
|
|
137
|
-
it('renders the DropdownButton with color=primary variant="button" and arrow={false}', function () {
|
|
138
|
-
expect(mount(_ref16)).toMatchSnapshot();
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
var _ref17 = /*#__PURE__*/React.createElement(DropdownButton, {
|
|
142
|
-
color: "primary",
|
|
143
|
-
variant: "button",
|
|
144
|
-
arrow: true
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
it('renders the DropdownButton with color=primary variant="button" arrow={true}', function () {
|
|
148
|
-
expect(mount(_ref17)).toMatchSnapshot();
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
var _ref18 = /*#__PURE__*/React.createElement(DropdownButton, {
|
|
152
|
-
color: "primary",
|
|
153
|
-
variant: "link",
|
|
154
|
-
arrow: true
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
it('renders the DropdownButton with color=primary variant="link" arrow={true}', function () {
|
|
158
|
-
expect(mount(_ref18)).toMatchSnapshot();
|
|
159
|
-
});
|
|
160
|
-
|
|
161
|
-
var _ref19 = /*#__PURE__*/React.createElement(DropdownButton, {
|
|
162
|
-
color: "primary",
|
|
163
|
-
variant: "link",
|
|
164
|
-
arrow: false
|
|
165
|
-
}, "hello");
|
|
166
|
-
|
|
167
|
-
it('renders the DropdownButton with color=primary variant="link" arrow={false}', function () {
|
|
168
|
-
expect(mount(_ref19)).toMatchSnapshot();
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
var _ref20 = /*#__PURE__*/React.createElement(DropdownButton, {
|
|
172
|
-
color: "warning",
|
|
173
|
-
variant: "link",
|
|
174
|
-
arrow: false
|
|
175
|
-
}, "hello");
|
|
176
|
-
|
|
177
|
-
it('renders the DropdownButton with color=warning variant="button" arrow={false}', function () {
|
|
178
|
-
expect(mount(_ref20)).toMatchSnapshot();
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
var _ref21 = /*#__PURE__*/React.createElement(DropdownButton, {
|
|
182
|
-
color: "warning",
|
|
183
|
-
variant: "link",
|
|
184
|
-
arrow: true
|
|
185
|
-
}, "hello");
|
|
186
|
-
|
|
187
|
-
it('renders the DropdownButton with color=warning variant="button" arrow={true}', function () {
|
|
188
|
-
expect(mount(_ref21)).toMatchSnapshot();
|
|
189
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["className", "children"];
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import clsx from 'clsx';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* You should use DropdownContent component inside Dropdown component.
|
|
9
|
-
*/
|
|
10
|
-
export var DropdownContent = /*#__PURE__*/React.forwardRef(function DropdownContent(_ref, ref) {
|
|
11
|
-
var className = _ref.className,
|
|
12
|
-
children = _ref.children,
|
|
13
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
14
|
-
|
|
15
|
-
return /*#__PURE__*/React.createElement("div", _extends({
|
|
16
|
-
ref: ref,
|
|
17
|
-
className: clsx(className, true && 'govgr-dropdown__content')
|
|
18
|
-
}, props), children);
|
|
19
|
-
});
|
|
20
|
-
export default DropdownContent;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { mount } from 'enzyme';
|
|
3
|
-
import DropdownContent from '@digigov/react-core/DropdownContent';
|
|
4
|
-
|
|
5
|
-
var _ref = /*#__PURE__*/React.createElement(DropdownContent, null, "hello");
|
|
6
|
-
|
|
7
|
-
it('renders the DropdownContent with no props', function () {
|
|
8
|
-
expect(mount(_ref)).toMatchSnapshot();
|
|
9
|
-
});
|