@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
package/Dropdown/index.test.js
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
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 _Dropdown = _interopRequireDefault(require("@digigov/react-core/Dropdown"));
|
|
10
|
-
|
|
11
|
-
var _ref = /*#__PURE__*/_react["default"].createElement(_Dropdown["default"], null, "hello");
|
|
12
|
-
|
|
13
|
-
it('renders the Dropdown with no props', function () {
|
|
14
|
-
expect((0, _enzyme.mount)(_ref)).toMatchSnapshot();
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
var _ref2 = /*#__PURE__*/_react["default"].createElement(_Dropdown["default"], {
|
|
18
|
-
disabled: true
|
|
19
|
-
}, "hello");
|
|
20
|
-
|
|
21
|
-
it('renders the Dropdown disabled', function () {
|
|
22
|
-
expect((0, _enzyme.mount)(_ref2)).toMatchSnapshot();
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
var _ref3 = /*#__PURE__*/_react["default"].createElement(_Dropdown["default"], {
|
|
26
|
-
open: true
|
|
27
|
-
}, "hello");
|
|
28
|
-
|
|
29
|
-
it('renders the Dropdown with open=true', function () {
|
|
30
|
-
expect((0, _enzyme.mount)(_ref3)).toMatchSnapshot();
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
var _ref4 = /*#__PURE__*/_react["default"].createElement(_Dropdown["default"], {
|
|
34
|
-
open: false
|
|
35
|
-
}, "hello");
|
|
36
|
-
|
|
37
|
-
it('renders the Dropdown with open=false', function () {
|
|
38
|
-
expect((0, _enzyme.mount)(_ref4)).toMatchSnapshot();
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
var _ref5 = /*#__PURE__*/_react["default"].createElement(_Dropdown["default"], {
|
|
42
|
-
align: "left"
|
|
43
|
-
}, "hello");
|
|
44
|
-
|
|
45
|
-
it('renders the Dropdown with align=left', function () {
|
|
46
|
-
expect((0, _enzyme.mount)(_ref5)).toMatchSnapshot();
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
var _ref6 = /*#__PURE__*/_react["default"].createElement(_Dropdown["default"], {
|
|
50
|
-
placement: "top"
|
|
51
|
-
}, "hello");
|
|
52
|
-
|
|
53
|
-
it('renders the Dropdown with placement=top', function () {
|
|
54
|
-
expect((0, _enzyme.mount)(_ref6)).toMatchSnapshot();
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
var _ref7 = /*#__PURE__*/_react["default"].createElement(_Dropdown["default"], {
|
|
58
|
-
open: true,
|
|
59
|
-
align: "left"
|
|
60
|
-
}, "hello");
|
|
61
|
-
|
|
62
|
-
it('renders the Dropdown with align=left and open=true', function () {
|
|
63
|
-
expect((0, _enzyme.mount)(_ref7)).toMatchSnapshot();
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
var _ref8 = /*#__PURE__*/_react["default"].createElement(_Dropdown["default"], {
|
|
67
|
-
open: false,
|
|
68
|
-
align: "right"
|
|
69
|
-
}, "hello");
|
|
70
|
-
|
|
71
|
-
it('renders the Dropdown with align=right and open=false', function () {
|
|
72
|
-
expect((0, _enzyme.mount)(_ref8)).toMatchSnapshot();
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
var _ref9 = /*#__PURE__*/_react["default"].createElement(_Dropdown["default"], {
|
|
76
|
-
open: true,
|
|
77
|
-
placement: "top"
|
|
78
|
-
}, "hello");
|
|
79
|
-
|
|
80
|
-
it('renders the Dropdown with placement=top and open=true', function () {
|
|
81
|
-
expect((0, _enzyme.mount)(_ref9)).toMatchSnapshot();
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
var _ref10 = /*#__PURE__*/_react["default"].createElement(_Dropdown["default"], {
|
|
85
|
-
open: false,
|
|
86
|
-
placement: "bottom"
|
|
87
|
-
}, "hello");
|
|
88
|
-
|
|
89
|
-
it('renders the Dropdown with placement=bottom and open=false', function () {
|
|
90
|
-
expect((0, _enzyme.mount)(_ref10)).toMatchSnapshot();
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
var _ref11 = /*#__PURE__*/_react["default"].createElement(_Dropdown["default"], {
|
|
94
|
-
open: true,
|
|
95
|
-
placement: "top",
|
|
96
|
-
align: "left"
|
|
97
|
-
}, "hello");
|
|
98
|
-
|
|
99
|
-
it('renders the Dropdown with placement=top align=left and open=true', function () {
|
|
100
|
-
expect((0, _enzyme.mount)(_ref11)).toMatchSnapshot();
|
|
101
|
-
});
|
|
@@ -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,28 +0,0 @@
|
|
|
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;
|
package/DropdownButton/index.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
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;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|