@digigov/react-core 0.6.3 → 0.6.4

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.
Files changed (41) hide show
  1. package/CHANGELOG.md +8 -1
  2. package/Dropdown/__snapshots__/index.test.tsx.snap +144 -0
  3. package/Dropdown/index.d.ts +30 -0
  4. package/Dropdown/index.js +42 -0
  5. package/Dropdown/index.test.d.ts +1 -0
  6. package/Dropdown/index.test.js +101 -0
  7. package/DropdownButton/__snapshots__/index.test.tsx.snap +375 -0
  8. package/DropdownButton/index.d.ts +28 -0
  9. package/DropdownButton/index.js +47 -0
  10. package/DropdownButton/index.test.d.ts +1 -0
  11. package/DropdownButton/index.test.js +195 -0
  12. package/DropdownContent/__snapshots__/index.test.tsx.snap +11 -0
  13. package/DropdownContent/index.d.ts +9 -0
  14. package/DropdownContent/index.js +35 -0
  15. package/DropdownContent/index.test.d.ts +1 -0
  16. package/DropdownContent/index.test.js +15 -0
  17. package/TableDataCell/index.d.ts +1 -1
  18. package/TableHeaderCell/index.d.ts +1 -1
  19. package/es/Dropdown/__snapshots__/index.test.tsx.snap +144 -0
  20. package/es/Dropdown/index.js +27 -0
  21. package/es/Dropdown/index.test.js +95 -0
  22. package/es/DropdownButton/__snapshots__/index.test.tsx.snap +375 -0
  23. package/es/DropdownButton/index.js +31 -0
  24. package/es/DropdownButton/index.test.js +189 -0
  25. package/es/DropdownContent/__snapshots__/index.test.tsx.snap +11 -0
  26. package/es/DropdownContent/index.js +20 -0
  27. package/es/DropdownContent/index.test.js +9 -0
  28. package/es/index.js +3 -0
  29. package/esm/Dropdown/__snapshots__/index.test.tsx.snap +144 -0
  30. package/esm/Dropdown/index.js +27 -0
  31. package/esm/Dropdown/index.test.js +95 -0
  32. package/esm/DropdownButton/__snapshots__/index.test.tsx.snap +375 -0
  33. package/esm/DropdownButton/index.js +31 -0
  34. package/esm/DropdownButton/index.test.js +189 -0
  35. package/esm/DropdownContent/__snapshots__/index.test.tsx.snap +11 -0
  36. package/esm/DropdownContent/index.js +20 -0
  37. package/esm/DropdownContent/index.test.js +9 -0
  38. package/esm/index.js +4 -1
  39. package/index.d.ts +3 -0
  40. package/index.js +24 -0
  41. package/package.json +2 -2
@@ -0,0 +1,375 @@
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
+ `;
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ declare type HTMLAttributes = JSX.IntrinsicElements['summary'];
3
+ export interface DropdownButtonProps extends HTMLAttributes {
4
+ /**
5
+ * color is optional.
6
+ * 'primary' color gives DropdownButton the primary green color.
7
+ * 'secondary' color gives DropdownButton the secondary gray color.
8
+ * 'warning' color gives DropdownButton the warning red color.
9
+ * The default value is 'primary'.
10
+ */
11
+ color?: 'primary' | 'secondary' | 'warning';
12
+ /**
13
+ * variant is optional.
14
+ * variant prop changes DropdownButton to button or link.
15
+ */
16
+ variant?: 'link' | 'button';
17
+ /**
18
+ * arrow is optional.
19
+ * arrow prop adds checkIcon component inside DropdownButton.
20
+ * arrow prop is false by default
21
+ */
22
+ arrow?: boolean;
23
+ }
24
+ /**
25
+ * DropdownButton it should be inside the Dropdown and it is used for opening or closing dropdown.
26
+ */
27
+ export declare const DropdownButton: React.ForwardRefExoticComponent<Pick<DropdownButtonProps, "className" | "children" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "variant" | "arrow"> & React.RefAttributes<HTMLElement>>;
28
+ export default DropdownButton;
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = exports.DropdownButton = void 0;
9
+
10
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
+
12
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
13
+
14
+ var _react = _interopRequireDefault(require("react"));
15
+
16
+ var _clsx = _interopRequireDefault(require("clsx"));
17
+
18
+ var _ArrowIcon = _interopRequireDefault(require("@digigov/react-core/ArrowIcon"));
19
+
20
+ var _excluded = ["className", "children", "color", "variant", "arrow"];
21
+
22
+ var _ref2 = /*#__PURE__*/_react["default"].createElement(_ArrowIcon["default"], {
23
+ direction: "down"
24
+ });
25
+
26
+ /**
27
+ * DropdownButton it should be inside the Dropdown and it is used for opening or closing dropdown.
28
+ */
29
+ var DropdownButton = /*#__PURE__*/_react["default"].forwardRef(function DropdownButton(_ref, ref) {
30
+ var className = _ref.className,
31
+ children = _ref.children,
32
+ _ref$color = _ref.color,
33
+ color = _ref$color === void 0 ? 'primary' : _ref$color,
34
+ _ref$variant = _ref.variant,
35
+ variant = _ref$variant === void 0 ? 'button' : _ref$variant,
36
+ _ref$arrow = _ref.arrow,
37
+ arrow = _ref$arrow === void 0 ? false : _ref$arrow,
38
+ props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
39
+ return /*#__PURE__*/_react["default"].createElement("summary", (0, _extends2["default"])({
40
+ ref: ref,
41
+ className: (0, _clsx["default"])(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')
42
+ }, props), children, arrow === true && _ref2);
43
+ });
44
+
45
+ exports.DropdownButton = DropdownButton;
46
+ var _default = DropdownButton;
47
+ exports["default"] = _default;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,195 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ var _react = _interopRequireDefault(require("react"));
6
+
7
+ var _enzyme = require("enzyme");
8
+
9
+ var _DropdownButton = _interopRequireDefault(require("@digigov/react-core/DropdownButton"));
10
+
11
+ var _ref = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], null, "hello");
12
+
13
+ it('renders the DropdownButton with no props', function () {
14
+ expect((0, _enzyme.mount)(_ref)).toMatchSnapshot();
15
+ });
16
+
17
+ var _ref2 = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
18
+ color: "primary"
19
+ }, "hello");
20
+
21
+ it('renders the DropdownButton with color=primary', function () {
22
+ expect((0, _enzyme.mount)(_ref2)).toMatchSnapshot();
23
+ });
24
+
25
+ var _ref3 = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
26
+ color: "secondary"
27
+ }, "hello");
28
+
29
+ it('renders the DropdownButton with color=secondary', function () {
30
+ expect((0, _enzyme.mount)(_ref3)).toMatchSnapshot();
31
+ });
32
+
33
+ var _ref4 = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
34
+ variant: "button"
35
+ }, "hello");
36
+
37
+ it('renders the DropdownButton with variant=button', function () {
38
+ expect((0, _enzyme.mount)(_ref4)).toMatchSnapshot();
39
+ });
40
+
41
+ var _ref5 = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
42
+ variant: "link"
43
+ }, "hello");
44
+
45
+ it('renders the DropdownButton with variant=link', function () {
46
+ expect((0, _enzyme.mount)(_ref5)).toMatchSnapshot();
47
+ });
48
+
49
+ var _ref6 = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
50
+ arrow: false
51
+ }, "hello");
52
+
53
+ it('renders the DropdownButton with arrow=false', function () {
54
+ expect((0, _enzyme.mount)(_ref6)).toMatchSnapshot();
55
+ });
56
+
57
+ var _ref7 = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
58
+ arrow: true
59
+ }, "hello");
60
+
61
+ it('renders the DropdownButton with arrow=true', function () {
62
+ expect((0, _enzyme.mount)(_ref7)).toMatchSnapshot();
63
+ });
64
+
65
+ var _ref8 = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
66
+ color: "primary",
67
+ variant: "button"
68
+ }, "hello");
69
+
70
+ it('renders the DropdownButton with color=primary and variant="button"', function () {
71
+ expect((0, _enzyme.mount)(_ref8)).toMatchSnapshot();
72
+ });
73
+
74
+ var _ref9 = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
75
+ color: "primary",
76
+ variant: "link"
77
+ }, "hello");
78
+
79
+ it('renders the DropdownButton with color=primary and variant="link"', function () {
80
+ expect((0, _enzyme.mount)(_ref9)).toMatchSnapshot();
81
+ });
82
+
83
+ var _ref10 = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
84
+ color: "primary",
85
+ arrow: false
86
+ }, "hello");
87
+
88
+ it('renders the DropdownButton with color=primary and arrow={false}', function () {
89
+ expect((0, _enzyme.mount)(_ref10)).toMatchSnapshot();
90
+ });
91
+
92
+ var _ref11 = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
93
+ color: "primary",
94
+ arrow: true
95
+ });
96
+
97
+ it('renders the DropdownButton with color=primary and arrow={true}', function () {
98
+ expect((0, _enzyme.mount)(_ref11)).toMatchSnapshot();
99
+ });
100
+
101
+ var _ref12 = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
102
+ color: "secondary",
103
+ variant: "button"
104
+ }, "hello");
105
+
106
+ it('renders the DropdownButton with color=secondary and variant="button"', function () {
107
+ expect((0, _enzyme.mount)(_ref12)).toMatchSnapshot();
108
+ });
109
+
110
+ var _ref13 = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
111
+ color: "secondary",
112
+ variant: "link"
113
+ }, "hello");
114
+
115
+ it('renders the DropdownButton with color=primary and variant="link"', function () {
116
+ expect((0, _enzyme.mount)(_ref13)).toMatchSnapshot();
117
+ });
118
+
119
+ var _ref14 = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
120
+ color: "secondary",
121
+ arrow: false
122
+ }, "hello");
123
+
124
+ it('renders the DropdownButton with color=secondary and arrow={false}', function () {
125
+ expect((0, _enzyme.mount)(_ref14)).toMatchSnapshot();
126
+ });
127
+
128
+ var _ref15 = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
129
+ color: "secondary",
130
+ arrow: true
131
+ });
132
+
133
+ it('renders the DropdownButton with color=secondary and arrow={true}', function () {
134
+ expect((0, _enzyme.mount)(_ref15)).toMatchSnapshot();
135
+ });
136
+
137
+ var _ref16 = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
138
+ color: "primary",
139
+ variant: "button",
140
+ arrow: false
141
+ }, "hello");
142
+
143
+ it('renders the DropdownButton with color=primary variant="button" and arrow={false}', function () {
144
+ expect((0, _enzyme.mount)(_ref16)).toMatchSnapshot();
145
+ });
146
+
147
+ var _ref17 = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
148
+ color: "primary",
149
+ variant: "button",
150
+ arrow: true
151
+ });
152
+
153
+ it('renders the DropdownButton with color=primary variant="button" arrow={true}', function () {
154
+ expect((0, _enzyme.mount)(_ref17)).toMatchSnapshot();
155
+ });
156
+
157
+ var _ref18 = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
158
+ color: "primary",
159
+ variant: "link",
160
+ arrow: true
161
+ });
162
+
163
+ it('renders the DropdownButton with color=primary variant="link" arrow={true}', function () {
164
+ expect((0, _enzyme.mount)(_ref18)).toMatchSnapshot();
165
+ });
166
+
167
+ var _ref19 = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
168
+ color: "primary",
169
+ variant: "link",
170
+ arrow: false
171
+ }, "hello");
172
+
173
+ it('renders the DropdownButton with color=primary variant="link" arrow={false}', function () {
174
+ expect((0, _enzyme.mount)(_ref19)).toMatchSnapshot();
175
+ });
176
+
177
+ var _ref20 = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
178
+ color: "warning",
179
+ variant: "link",
180
+ arrow: false
181
+ }, "hello");
182
+
183
+ it('renders the DropdownButton with color=warning variant="button" arrow={false}', function () {
184
+ expect((0, _enzyme.mount)(_ref20)).toMatchSnapshot();
185
+ });
186
+
187
+ var _ref21 = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
188
+ color: "warning",
189
+ variant: "link",
190
+ arrow: true
191
+ }, "hello");
192
+
193
+ it('renders the DropdownButton with color=warning variant="button" arrow={true}', function () {
194
+ expect((0, _enzyme.mount)(_ref21)).toMatchSnapshot();
195
+ });
@@ -0,0 +1,11 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`renders the DropdownContent with no props 1`] = `
4
+ <ForwardRef(DropdownContent)>
5
+ <div
6
+ className="govgr-dropdown__content"
7
+ >
8
+ hello
9
+ </div>
10
+ </ForwardRef(DropdownContent)>
11
+ `;