@instructure/ui-drilldown 10.16.1-snapshot-0 → 10.16.1

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 (51) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/es/Drilldown/DrilldownGroup/__new-tests__/DrilldownGroup.test.js +448 -325
  3. package/es/Drilldown/DrilldownGroup/index.js +0 -1
  4. package/es/Drilldown/DrilldownOption/__new-tests__/DrilldownOption.test.js +422 -309
  5. package/es/Drilldown/DrilldownOption/index.js +0 -1
  6. package/es/Drilldown/DrilldownPage/__new-tests__/DrilldownPage.test.js +201 -147
  7. package/es/Drilldown/DrilldownPage/index.js +0 -1
  8. package/es/Drilldown/DrilldownSeparator/__new-tests__/DrilldownSeparator.test.js +22 -17
  9. package/es/Drilldown/DrilldownSeparator/index.js +0 -1
  10. package/es/Drilldown/__examples__/Drilldown.examples.js +99 -82
  11. package/es/Drilldown/__new-tests__/Drilldown.test.js +533 -352
  12. package/es/Drilldown/index.js +144 -126
  13. package/lib/Drilldown/DrilldownGroup/__new-tests__/DrilldownGroup.test.js +463 -340
  14. package/lib/Drilldown/DrilldownGroup/index.js +0 -1
  15. package/lib/Drilldown/DrilldownOption/__new-tests__/DrilldownOption.test.js +448 -336
  16. package/lib/Drilldown/DrilldownOption/index.js +0 -1
  17. package/lib/Drilldown/DrilldownPage/__new-tests__/DrilldownPage.test.js +221 -167
  18. package/lib/Drilldown/DrilldownPage/index.js +0 -2
  19. package/lib/Drilldown/DrilldownSeparator/__new-tests__/DrilldownSeparator.test.js +25 -21
  20. package/lib/Drilldown/DrilldownSeparator/index.js +0 -1
  21. package/lib/Drilldown/__examples__/Drilldown.examples.js +99 -83
  22. package/lib/Drilldown/__new-tests__/Drilldown.test.js +568 -387
  23. package/lib/Drilldown/index.js +143 -126
  24. package/package.json +21 -21
  25. package/src/Drilldown/DrilldownGroup/__new-tests__/DrilldownGroup.test.tsx +0 -1
  26. package/src/Drilldown/DrilldownGroup/index.tsx +0 -1
  27. package/src/Drilldown/DrilldownOption/__new-tests__/DrilldownOption.test.tsx +1 -1
  28. package/src/Drilldown/DrilldownOption/index.tsx +0 -1
  29. package/src/Drilldown/DrilldownPage/__new-tests__/DrilldownPage.test.tsx +0 -1
  30. package/src/Drilldown/DrilldownPage/index.tsx +0 -1
  31. package/src/Drilldown/DrilldownSeparator/__new-tests__/DrilldownSeparator.test.tsx +0 -1
  32. package/src/Drilldown/DrilldownSeparator/index.tsx +0 -1
  33. package/src/Drilldown/__examples__/Drilldown.examples.tsx +0 -2
  34. package/src/Drilldown/__new-tests__/Drilldown.test.tsx +0 -1
  35. package/src/Drilldown/index.tsx +4 -6
  36. package/tsconfig.build.tsbuildinfo +1 -1
  37. package/types/Drilldown/DrilldownGroup/__new-tests__/DrilldownGroup.test.d.ts.map +1 -1
  38. package/types/Drilldown/DrilldownGroup/index.d.ts +0 -1
  39. package/types/Drilldown/DrilldownGroup/index.d.ts.map +1 -1
  40. package/types/Drilldown/DrilldownOption/index.d.ts +0 -1
  41. package/types/Drilldown/DrilldownOption/index.d.ts.map +1 -1
  42. package/types/Drilldown/DrilldownPage/__new-tests__/DrilldownPage.test.d.ts.map +1 -1
  43. package/types/Drilldown/DrilldownPage/index.d.ts +0 -1
  44. package/types/Drilldown/DrilldownPage/index.d.ts.map +1 -1
  45. package/types/Drilldown/DrilldownSeparator/__new-tests__/DrilldownSeparator.test.d.ts.map +1 -1
  46. package/types/Drilldown/DrilldownSeparator/index.d.ts +0 -1
  47. package/types/Drilldown/DrilldownSeparator/index.d.ts.map +1 -1
  48. package/types/Drilldown/__examples__/Drilldown.examples.d.ts.map +1 -1
  49. package/types/Drilldown/__new-tests__/Drilldown.test.d.ts.map +1 -1
  50. package/types/Drilldown/index.d.ts +7 -10
  51. package/types/Drilldown/index.d.ts.map +1 -1
@@ -23,7 +23,6 @@ var _Drilldown, _Drilldown2, _Drilldown3, _Drilldown4, _Drilldown5, _Drilldown6,
23
23
  * SOFTWARE.
24
24
  */
25
25
 
26
- import React from 'react';
27
26
  import { render, screen, waitFor } from '@testing-library/react';
28
27
  import { vi } from 'vitest';
29
28
  import userEvent from '@testing-library/user-event';
@@ -35,6 +34,7 @@ import { runAxeCheck } from '@instructure/ui-axe-check';
35
34
  import { IconCheckSolid } from '@instructure/ui-icons';
36
35
  import { Drilldown } from '../index';
37
36
  import DrilldownExamples from '../__examples__/Drilldown.examples';
37
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
38
38
  const data = Array(5).fill(0).map((_v, ind) => ({
39
39
  label: `option ${ind}`,
40
40
  id: `opt_${ind}`
@@ -53,17 +53,22 @@ describe('<Drilldown />', () => {
53
53
  });
54
54
  describe('rootPageId prop', () => {
55
55
  it('should set the initial page and render it', async () => {
56
- render(_Drilldown || (_Drilldown = /*#__PURE__*/React.createElement(Drilldown, {
57
- rootPageId: "page1"
58
- }, /*#__PURE__*/React.createElement(Drilldown.Page, {
59
- id: "page0"
60
- }, /*#__PURE__*/React.createElement(Drilldown.Option, {
61
- id: "option01"
62
- }, "Option-01")), /*#__PURE__*/React.createElement(Drilldown.Page, {
63
- id: "page1"
64
- }, /*#__PURE__*/React.createElement(Drilldown.Option, {
65
- id: "option11"
66
- }, "Option-11")))));
56
+ render(_Drilldown || (_Drilldown = _jsxs(Drilldown, {
57
+ rootPageId: "page1",
58
+ children: [_jsx(Drilldown.Page, {
59
+ id: "page0",
60
+ children: _jsx(Drilldown.Option, {
61
+ id: "option01",
62
+ children: "Option-01"
63
+ })
64
+ }), _jsx(Drilldown.Page, {
65
+ id: "page1",
66
+ children: _jsx(Drilldown.Option, {
67
+ id: "option11",
68
+ children: "Option-11"
69
+ })
70
+ })]
71
+ })));
67
72
  const drilldown = screen.getByRole('menu');
68
73
  const options = screen.getAllByRole('menuitem');
69
74
  const rootlessOption = screen.queryByText('Option-01');
@@ -76,11 +81,13 @@ describe('<Drilldown />', () => {
76
81
  });
77
82
  describe('children prop', () => {
78
83
  it('should not allow non-DrilldownPage children', async () => {
79
- render(_Drilldown2 || (_Drilldown2 = /*#__PURE__*/React.createElement(Drilldown, {
80
- rootPageId: "page0"
81
- }, /*#__PURE__*/React.createElement("div", {
82
- id: "testDiv"
83
- }, "DIV-child"))));
84
+ render(_Drilldown2 || (_Drilldown2 = _jsx(Drilldown, {
85
+ rootPageId: "page0",
86
+ children: _jsx("div", {
87
+ id: "testDiv",
88
+ children: "DIV-child"
89
+ })
90
+ })));
84
91
  const drilldown = screen.queryByRole('menu');
85
92
  const options = screen.queryAllByRole('menuitem');
86
93
  const notAllowedChild = screen.queryByText('DIV-child');
@@ -91,14 +98,17 @@ describe('<Drilldown />', () => {
91
98
  });
92
99
  describe('id prop', () => {
93
100
  it('should put id attr on the drilldown', async () => {
94
- render(_Drilldown3 || (_Drilldown3 = /*#__PURE__*/React.createElement(Drilldown, {
101
+ render(_Drilldown3 || (_Drilldown3 = _jsx(Drilldown, {
95
102
  rootPageId: "page0",
96
- id: "testId"
97
- }, /*#__PURE__*/React.createElement(Drilldown.Page, {
98
- id: "page0"
99
- }, /*#__PURE__*/React.createElement(Drilldown.Option, {
100
- id: "option01"
101
- }, "Option")))));
103
+ id: "testId",
104
+ children: _jsx(Drilldown.Page, {
105
+ id: "page0",
106
+ children: _jsx(Drilldown.Option, {
107
+ id: "option01",
108
+ children: "Option"
109
+ })
110
+ })
111
+ })));
102
112
  const drilldown = screen.getByRole('menu');
103
113
  expect(drilldown).toBeInTheDocument();
104
114
  expect(drilldown).toHaveAttribute('id', 'testId');
@@ -106,14 +116,17 @@ describe('<Drilldown />', () => {
106
116
  });
107
117
  describe('label prop', () => {
108
118
  it('should be added as aria-label', async () => {
109
- render(_Drilldown4 || (_Drilldown4 = /*#__PURE__*/React.createElement(Drilldown, {
119
+ render(_Drilldown4 || (_Drilldown4 = _jsx(Drilldown, {
110
120
  rootPageId: "page0",
111
- label: "testLabel"
112
- }, /*#__PURE__*/React.createElement(Drilldown.Page, {
113
- id: "page0"
114
- }, /*#__PURE__*/React.createElement(Drilldown.Option, {
115
- id: "option01"
116
- }, "Option")))));
121
+ label: "testLabel",
122
+ children: _jsx(Drilldown.Page, {
123
+ id: "page0",
124
+ children: _jsx(Drilldown.Option, {
125
+ id: "option01",
126
+ children: "Option"
127
+ })
128
+ })
129
+ })));
117
130
  const drilldown = screen.getByRole('menu');
118
131
  expect(drilldown).toBeInTheDocument();
119
132
  expect(drilldown).toHaveAttribute('aria-label', 'testLabel');
@@ -121,19 +134,24 @@ describe('<Drilldown />', () => {
121
134
  });
122
135
  describe('disabled prop', () => {
123
136
  it('should disable all options', async () => {
124
- render(_Drilldown5 || (_Drilldown5 = /*#__PURE__*/React.createElement(Drilldown, {
137
+ render(_Drilldown5 || (_Drilldown5 = _jsx(Drilldown, {
125
138
  rootPageId: "page0",
126
- disabled: true
127
- }, /*#__PURE__*/React.createElement(Drilldown.Page, {
128
- id: "page0",
129
- renderActionLabel: "Action"
130
- }, /*#__PURE__*/React.createElement(Drilldown.Option, {
131
- id: "option01"
132
- }, "Option"), /*#__PURE__*/React.createElement(Drilldown.Option, {
133
- id: "option02"
134
- }, "Option"), /*#__PURE__*/React.createElement(Drilldown.Option, {
135
- id: "option03"
136
- }, "Option")))));
139
+ disabled: true,
140
+ children: _jsxs(Drilldown.Page, {
141
+ id: "page0",
142
+ renderActionLabel: "Action",
143
+ children: [_jsx(Drilldown.Option, {
144
+ id: "option01",
145
+ children: "Option"
146
+ }), _jsx(Drilldown.Option, {
147
+ id: "option02",
148
+ children: "Option"
149
+ }), _jsx(Drilldown.Option, {
150
+ id: "option03",
151
+ children: "Option"
152
+ })]
153
+ })
154
+ })));
137
155
  const options = screen.getAllByRole('menuitem');
138
156
  expect(options.length).toBe(4); // header action + 3 options
139
157
 
@@ -144,26 +162,32 @@ describe('<Drilldown />', () => {
144
162
  });
145
163
  describe('as prop', () => {
146
164
  it('should be "ul" by default', async () => {
147
- const _render = render(_Drilldown6 || (_Drilldown6 = /*#__PURE__*/React.createElement(Drilldown, {
148
- rootPageId: "page0"
149
- }, /*#__PURE__*/React.createElement(Drilldown.Page, {
150
- id: "page0"
151
- }, /*#__PURE__*/React.createElement(Drilldown.Option, {
152
- id: "option01"
153
- }, "Option"))))),
165
+ const _render = render(_Drilldown6 || (_Drilldown6 = _jsx(Drilldown, {
166
+ rootPageId: "page0",
167
+ children: _jsx(Drilldown.Page, {
168
+ id: "page0",
169
+ children: _jsx(Drilldown.Option, {
170
+ id: "option01",
171
+ children: "Option"
172
+ })
173
+ })
174
+ }))),
154
175
  container = _render.container;
155
176
  const drilldownList = container.querySelector('[class$="-options__list"]');
156
177
  expect(drilldownList === null || drilldownList === void 0 ? void 0 : drilldownList.tagName).toBe('UL');
157
178
  });
158
179
  it('should render as passed element', async () => {
159
- const _render2 = render(_Drilldown7 || (_Drilldown7 = /*#__PURE__*/React.createElement(Drilldown, {
180
+ const _render2 = render(_Drilldown7 || (_Drilldown7 = _jsx(Drilldown, {
160
181
  rootPageId: "page0",
161
- as: "ol"
162
- }, /*#__PURE__*/React.createElement(Drilldown.Page, {
163
- id: "page0"
164
- }, /*#__PURE__*/React.createElement(Drilldown.Option, {
165
- id: "option01"
166
- }, "Option"))))),
182
+ as: "ol",
183
+ children: _jsx(Drilldown.Page, {
184
+ id: "page0",
185
+ children: _jsx(Drilldown.Option, {
186
+ id: "option01",
187
+ children: "Option"
188
+ })
189
+ })
190
+ }))),
167
191
  container = _render2.container;
168
192
  const drilldownList = container.querySelector('[class$="-options__list"]');
169
193
  expect(drilldownList === null || drilldownList === void 0 ? void 0 : drilldownList.tagName).toBe('OL');
@@ -171,26 +195,32 @@ describe('<Drilldown />', () => {
171
195
  });
172
196
  describe('role prop', () => {
173
197
  it('should be "menu" by default', async () => {
174
- const _render3 = render(_Drilldown8 || (_Drilldown8 = /*#__PURE__*/React.createElement(Drilldown, {
175
- rootPageId: "page0"
176
- }, /*#__PURE__*/React.createElement(Drilldown.Page, {
177
- id: "page0"
178
- }, /*#__PURE__*/React.createElement(Drilldown.Option, {
179
- id: "option01"
180
- }, "Option"))))),
198
+ const _render3 = render(_Drilldown8 || (_Drilldown8 = _jsx(Drilldown, {
199
+ rootPageId: "page0",
200
+ children: _jsx(Drilldown.Page, {
201
+ id: "page0",
202
+ children: _jsx(Drilldown.Option, {
203
+ id: "option01",
204
+ children: "Option"
205
+ })
206
+ })
207
+ }))),
181
208
  container = _render3.container;
182
209
  const drilldown = container.querySelector('div[id^="Drilldown_"]');
183
210
  expect(drilldown).toHaveAttribute('role', 'menu');
184
211
  });
185
212
  it('should apply passed role', async () => {
186
- const _render4 = render(_Drilldown9 || (_Drilldown9 = /*#__PURE__*/React.createElement(Drilldown, {
213
+ const _render4 = render(_Drilldown9 || (_Drilldown9 = _jsx(Drilldown, {
187
214
  rootPageId: "page0",
188
- role: "list"
189
- }, /*#__PURE__*/React.createElement(Drilldown.Page, {
190
- id: "page0"
191
- }, /*#__PURE__*/React.createElement(Drilldown.Option, {
192
- id: "option01"
193
- }, "Option"))))),
215
+ role: "list",
216
+ children: _jsx(Drilldown.Page, {
217
+ id: "page0",
218
+ children: _jsx(Drilldown.Option, {
219
+ id: "option01",
220
+ children: "Option"
221
+ })
222
+ })
223
+ }))),
194
224
  container = _render4.container;
195
225
  const drilldown = container.querySelector('div[id^="Drilldown_"]');
196
226
  expect(drilldown).toHaveAttribute('role', 'list');
@@ -199,29 +229,37 @@ describe('<Drilldown />', () => {
199
229
  describe('elementRef prop (and ref static prop)', () => {
200
230
  it('should give back the drilldown element when there is no trigger', async () => {
201
231
  const elementRef = vi.fn();
202
- render(/*#__PURE__*/React.createElement(Drilldown, {
232
+ render(_jsx(Drilldown, {
203
233
  rootPageId: "page0",
204
- elementRef: elementRef
205
- }, _Drilldown$Page || (_Drilldown$Page = /*#__PURE__*/React.createElement(Drilldown.Page, {
206
- id: "page0"
207
- }, /*#__PURE__*/React.createElement(Drilldown.Option, {
208
- id: "option01"
209
- }, "Option")))));
234
+ elementRef: elementRef,
235
+ children: _Drilldown$Page || (_Drilldown$Page = _jsx(Drilldown.Page, {
236
+ id: "page0",
237
+ children: _jsx(Drilldown.Option, {
238
+ id: "option01",
239
+ children: "Option"
240
+ })
241
+ }))
242
+ }));
210
243
  const drilldown = screen.getByRole('menu');
211
244
  expect(drilldown).toBeInTheDocument();
212
245
  expect(elementRef).toHaveBeenCalledWith(drilldown);
213
246
  });
214
247
  it('should give back the Popover root when drilldown has trigger and is closed', async () => {
215
248
  const elementRef = vi.fn();
216
- const _render5 = render(/*#__PURE__*/React.createElement(Drilldown, {
249
+ const _render5 = render(_jsx(Drilldown, {
217
250
  rootPageId: "page0",
218
251
  elementRef: elementRef,
219
- trigger: _button || (_button = /*#__PURE__*/React.createElement("button", null, "Toggle"))
220
- }, _Drilldown$Page2 || (_Drilldown$Page2 = /*#__PURE__*/React.createElement(Drilldown.Page, {
221
- id: "page0"
222
- }, /*#__PURE__*/React.createElement(Drilldown.Option, {
223
- id: "option01"
224
- }, "Option"))))),
252
+ trigger: _button || (_button = _jsx("button", {
253
+ children: "Toggle"
254
+ })),
255
+ children: _Drilldown$Page2 || (_Drilldown$Page2 = _jsx(Drilldown.Page, {
256
+ id: "page0",
257
+ children: _jsx(Drilldown.Option, {
258
+ id: "option01",
259
+ children: "Option"
260
+ })
261
+ }))
262
+ })),
225
263
  container = _render5.container;
226
264
  const trigger = screen.getByText('Toggle');
227
265
  const positionId = trigger.getAttribute('data-position-target');
@@ -231,16 +269,21 @@ describe('<Drilldown />', () => {
231
269
  });
232
270
  it('should give back the the Popover root when drilldown has trigger and is open', async () => {
233
271
  const elementRef = vi.fn();
234
- const _render6 = render(/*#__PURE__*/React.createElement(Drilldown, {
272
+ const _render6 = render(_jsx(Drilldown, {
235
273
  rootPageId: "page0",
236
274
  elementRef: elementRef,
237
- trigger: _button2 || (_button2 = /*#__PURE__*/React.createElement("button", null, "Toggle")),
238
- defaultShow: true
239
- }, _Drilldown$Page3 || (_Drilldown$Page3 = /*#__PURE__*/React.createElement(Drilldown.Page, {
240
- id: "page0"
241
- }, /*#__PURE__*/React.createElement(Drilldown.Option, {
242
- id: "option01"
243
- }, "Option"))))),
275
+ trigger: _button2 || (_button2 = _jsx("button", {
276
+ children: "Toggle"
277
+ })),
278
+ defaultShow: true,
279
+ children: _Drilldown$Page3 || (_Drilldown$Page3 = _jsx(Drilldown.Page, {
280
+ id: "page0",
281
+ children: _jsx(Drilldown.Option, {
282
+ id: "option01",
283
+ children: "Option"
284
+ })
285
+ }))
286
+ })),
244
287
  container = _render6.container;
245
288
  const trigger = screen.getByText('Toggle');
246
289
  const positionId = trigger.getAttribute('data-position-target');
@@ -252,42 +295,55 @@ describe('<Drilldown />', () => {
252
295
  describe('drilldownRef prop', () => {
253
296
  it('should give back the drilldown element when there is no trigger', async () => {
254
297
  const drilldownRef = vi.fn();
255
- render(/*#__PURE__*/React.createElement(Drilldown, {
298
+ render(_jsx(Drilldown, {
256
299
  rootPageId: "page0",
257
- drilldownRef: drilldownRef
258
- }, _Drilldown$Page4 || (_Drilldown$Page4 = /*#__PURE__*/React.createElement(Drilldown.Page, {
259
- id: "page0"
260
- }, /*#__PURE__*/React.createElement(Drilldown.Option, {
261
- id: "option01"
262
- }, "Option")))));
300
+ drilldownRef: drilldownRef,
301
+ children: _Drilldown$Page4 || (_Drilldown$Page4 = _jsx(Drilldown.Page, {
302
+ id: "page0",
303
+ children: _jsx(Drilldown.Option, {
304
+ id: "option01",
305
+ children: "Option"
306
+ })
307
+ }))
308
+ }));
263
309
  const drilldown = screen.getByRole('menu');
264
310
  expect(drilldownRef).toHaveBeenCalledWith(drilldown);
265
311
  });
266
312
  it("shouldn't be called when drilldown has trigger and is closed", async () => {
267
313
  const drilldownRef = vi.fn();
268
- render(/*#__PURE__*/React.createElement(Drilldown, {
314
+ render(_jsx(Drilldown, {
269
315
  rootPageId: "page0",
270
316
  drilldownRef: drilldownRef,
271
- trigger: _button3 || (_button3 = /*#__PURE__*/React.createElement("button", null, "Toggle"))
272
- }, _Drilldown$Page5 || (_Drilldown$Page5 = /*#__PURE__*/React.createElement(Drilldown.Page, {
273
- id: "page0"
274
- }, /*#__PURE__*/React.createElement(Drilldown.Option, {
275
- id: "option01"
276
- }, "Option")))));
317
+ trigger: _button3 || (_button3 = _jsx("button", {
318
+ children: "Toggle"
319
+ })),
320
+ children: _Drilldown$Page5 || (_Drilldown$Page5 = _jsx(Drilldown.Page, {
321
+ id: "page0",
322
+ children: _jsx(Drilldown.Option, {
323
+ id: "option01",
324
+ children: "Option"
325
+ })
326
+ }))
327
+ }));
277
328
  expect(drilldownRef).not.toHaveBeenCalled();
278
329
  });
279
330
  it('should give back the drilldown element when drilldown has trigger and is open', async () => {
280
331
  const drilldownRef = vi.fn();
281
- render(/*#__PURE__*/React.createElement(Drilldown, {
332
+ render(_jsx(Drilldown, {
282
333
  rootPageId: "page0",
283
334
  drilldownRef: drilldownRef,
284
- trigger: _button4 || (_button4 = /*#__PURE__*/React.createElement("button", null, "Toggle")),
285
- defaultShow: true
286
- }, _Drilldown$Page6 || (_Drilldown$Page6 = /*#__PURE__*/React.createElement(Drilldown.Page, {
287
- id: "page0"
288
- }, /*#__PURE__*/React.createElement(Drilldown.Option, {
289
- id: "option01"
290
- }, "Option")))));
335
+ trigger: _button4 || (_button4 = _jsx("button", {
336
+ children: "Toggle"
337
+ })),
338
+ defaultShow: true,
339
+ children: _Drilldown$Page6 || (_Drilldown$Page6 = _jsx(Drilldown.Page, {
340
+ id: "page0",
341
+ children: _jsx(Drilldown.Option, {
342
+ id: "option01",
343
+ children: "Option"
344
+ })
345
+ }))
346
+ }));
291
347
  const drilldown = screen.getByRole('menu');
292
348
  expect(drilldownRef).toHaveBeenCalledWith(drilldown);
293
349
  });
@@ -295,27 +351,35 @@ describe('<Drilldown />', () => {
295
351
  describe('popoverRef prop', () => {
296
352
  it('should not be called when there is no trigger', async () => {
297
353
  const popoverRef = vi.fn();
298
- render(/*#__PURE__*/React.createElement(Drilldown, {
354
+ render(_jsx(Drilldown, {
299
355
  rootPageId: "page0",
300
- popoverRef: popoverRef
301
- }, _Drilldown$Page7 || (_Drilldown$Page7 = /*#__PURE__*/React.createElement(Drilldown.Page, {
302
- id: "page0"
303
- }, /*#__PURE__*/React.createElement(Drilldown.Option, {
304
- id: "option01"
305
- }, "Option")))));
356
+ popoverRef: popoverRef,
357
+ children: _Drilldown$Page7 || (_Drilldown$Page7 = _jsx(Drilldown.Page, {
358
+ id: "page0",
359
+ children: _jsx(Drilldown.Option, {
360
+ id: "option01",
361
+ children: "Option"
362
+ })
363
+ }))
364
+ }));
306
365
  expect(popoverRef).not.toHaveBeenCalled();
307
366
  });
308
367
  it('should give back the Popover component when drilldown has trigger and is closed', async () => {
309
368
  const popoverRef = vi.fn();
310
- const _render7 = render(/*#__PURE__*/React.createElement(Drilldown, {
369
+ const _render7 = render(_jsx(Drilldown, {
311
370
  rootPageId: "page0",
312
371
  popoverRef: popoverRef,
313
- trigger: _button5 || (_button5 = /*#__PURE__*/React.createElement("button", null, "Toggle"))
314
- }, _Drilldown$Page8 || (_Drilldown$Page8 = /*#__PURE__*/React.createElement(Drilldown.Page, {
315
- id: "page0"
316
- }, /*#__PURE__*/React.createElement(Drilldown.Option, {
317
- id: "option01"
318
- }, "Option"))))),
372
+ trigger: _button5 || (_button5 = _jsx("button", {
373
+ children: "Toggle"
374
+ })),
375
+ children: _Drilldown$Page8 || (_Drilldown$Page8 = _jsx(Drilldown.Page, {
376
+ id: "page0",
377
+ children: _jsx(Drilldown.Option, {
378
+ id: "option01",
379
+ children: "Option"
380
+ })
381
+ }))
382
+ })),
319
383
  container = _render7.container;
320
384
  const trigger = screen.getByText('Toggle');
321
385
  const positionId = trigger.getAttribute('data-position-target');
@@ -328,16 +392,21 @@ describe('<Drilldown />', () => {
328
392
  });
329
393
  it('should give back the Popover component when drilldown has trigger and is open', async () => {
330
394
  const popoverRef = vi.fn();
331
- const _render8 = render(/*#__PURE__*/React.createElement(Drilldown, {
395
+ const _render8 = render(_jsx(Drilldown, {
332
396
  rootPageId: "page0",
333
397
  popoverRef: popoverRef,
334
- trigger: _button6 || (_button6 = /*#__PURE__*/React.createElement("button", null, "Toggle")),
335
- defaultShow: true
336
- }, _Drilldown$Page9 || (_Drilldown$Page9 = /*#__PURE__*/React.createElement(Drilldown.Page, {
337
- id: "page0"
338
- }, /*#__PURE__*/React.createElement(Drilldown.Option, {
339
- id: "option01"
340
- }, "Option"))))),
398
+ trigger: _button6 || (_button6 = _jsx("button", {
399
+ children: "Toggle"
400
+ })),
401
+ defaultShow: true,
402
+ children: _Drilldown$Page9 || (_Drilldown$Page9 = _jsx(Drilldown.Page, {
403
+ id: "page0",
404
+ children: _jsx(Drilldown.Option, {
405
+ id: "option01",
406
+ children: "Option"
407
+ })
408
+ }))
409
+ })),
341
410
  container = _render8.container;
342
411
  const trigger = screen.getByText('Toggle');
343
412
  const positionId = trigger.getAttribute('data-position-target');
@@ -352,17 +421,19 @@ describe('<Drilldown />', () => {
352
421
  describe('onSelect prop', () => {
353
422
  it('should fire when option is selected', async () => {
354
423
  const onSelect = vi.fn();
355
- render(/*#__PURE__*/React.createElement(Drilldown, {
424
+ render(_jsx(Drilldown, {
356
425
  rootPageId: "page0",
357
- onSelect: onSelect
358
- }, /*#__PURE__*/React.createElement(Drilldown.Page, {
359
- id: "page0"
360
- }, data.map(option => /*#__PURE__*/React.createElement(Drilldown.Option, {
361
- id: option.id,
362
- value: option.id,
363
- key: option.id,
364
- "data-testid": option.id
365
- }, option.label)))));
426
+ onSelect: onSelect,
427
+ children: _jsx(Drilldown.Page, {
428
+ id: "page0",
429
+ children: data.map(option => _jsx(Drilldown.Option, {
430
+ id: option.id,
431
+ value: option.id,
432
+ "data-testid": option.id,
433
+ children: option.label
434
+ }, option.id))
435
+ })
436
+ }));
366
437
  const option_1 = screen.getByTestId('opt_1');
367
438
  await userEvent.click(option_1);
368
439
  await waitFor(() => {
@@ -381,17 +452,19 @@ describe('<Drilldown />', () => {
381
452
  });
382
453
  it('should not fire when drilldown is disabled', async () => {
383
454
  const onSelect = vi.fn();
384
- render(/*#__PURE__*/React.createElement(Drilldown, {
455
+ render(_jsx(Drilldown, {
385
456
  rootPageId: "page0",
386
457
  onSelect: onSelect,
387
- disabled: true
388
- }, /*#__PURE__*/React.createElement(Drilldown.Page, {
389
- id: "page0"
390
- }, data.map(option => /*#__PURE__*/React.createElement(Drilldown.Option, {
391
- id: option.id,
392
- key: option.id,
393
- "data-testid": option.id
394
- }, option.label)))));
458
+ disabled: true,
459
+ children: _jsx(Drilldown.Page, {
460
+ id: "page0",
461
+ children: data.map(option => _jsx(Drilldown.Option, {
462
+ id: option.id,
463
+ "data-testid": option.id,
464
+ children: option.label
465
+ }, option.id))
466
+ })
467
+ }));
395
468
  const option_1 = screen.getByTestId('opt_1');
396
469
  await userEvent.click(option_1);
397
470
  await waitFor(() => {
@@ -401,14 +474,19 @@ describe('<Drilldown />', () => {
401
474
  });
402
475
  describe('with a trigger', () => {
403
476
  it('should not show content by default', async () => {
404
- render(_Drilldown10 || (_Drilldown10 = /*#__PURE__*/React.createElement(Drilldown, {
477
+ render(_Drilldown10 || (_Drilldown10 = _jsx(Drilldown, {
405
478
  rootPageId: "page0",
406
- trigger: /*#__PURE__*/React.createElement("button", null, "click me")
407
- }, /*#__PURE__*/React.createElement(Drilldown.Page, {
408
- id: "page0"
409
- }, /*#__PURE__*/React.createElement(Drilldown.Option, {
410
- id: "option0"
411
- }, "Option 0")))));
479
+ trigger: _jsx("button", {
480
+ children: "click me"
481
+ }),
482
+ children: _jsx(Drilldown.Page, {
483
+ id: "page0",
484
+ children: _jsx(Drilldown.Option, {
485
+ id: "option0",
486
+ children: "Option 0"
487
+ })
488
+ })
489
+ })));
412
490
  const option_0 = screen.queryByText('Option 0');
413
491
  expect(option_0).not.toBeInTheDocument();
414
492
  });
@@ -416,15 +494,20 @@ describe('<Drilldown />', () => {
416
494
  const container = document.createElement('div');
417
495
  container.setAttribute('data-testid', 'container');
418
496
  document.body.appendChild(container);
419
- render(/*#__PURE__*/React.createElement(Drilldown, {
497
+ render(_jsx(Drilldown, {
420
498
  rootPageId: "page0",
421
499
  mountNode: container,
422
- trigger: _button7 || (_button7 = /*#__PURE__*/React.createElement("button", null, "Options"))
423
- }, _Drilldown$Page10 || (_Drilldown$Page10 = /*#__PURE__*/React.createElement(Drilldown.Page, {
424
- id: "page0"
425
- }, /*#__PURE__*/React.createElement(Drilldown.Option, {
426
- id: "option0"
427
- }, "Option 0")))));
500
+ trigger: _button7 || (_button7 = _jsx("button", {
501
+ children: "Options"
502
+ })),
503
+ children: _Drilldown$Page10 || (_Drilldown$Page10 = _jsx(Drilldown.Page, {
504
+ id: "page0",
505
+ children: _jsx(Drilldown.Option, {
506
+ id: "option0",
507
+ children: "Option 0"
508
+ })
509
+ }))
510
+ }));
428
511
  const optionsContainer = screen.getByTestId('container');
429
512
  const trigger = screen.getByRole('button');
430
513
  expect(optionsContainer).not.toHaveTextContent('Option 0');
@@ -435,29 +518,39 @@ describe('<Drilldown />', () => {
435
518
  });
436
519
  });
437
520
  it('should have an aria-haspopup attribute', async () => {
438
- render(_Drilldown11 || (_Drilldown11 = /*#__PURE__*/React.createElement(Drilldown, {
521
+ render(_Drilldown11 || (_Drilldown11 = _jsx(Drilldown, {
439
522
  rootPageId: "page0",
440
- trigger: /*#__PURE__*/React.createElement("button", null, "Options")
441
- }, /*#__PURE__*/React.createElement(Drilldown.Page, {
442
- id: "page0"
443
- }, /*#__PURE__*/React.createElement(Drilldown.Option, {
444
- id: "option0"
445
- }, "Option 0")))));
523
+ trigger: _jsx("button", {
524
+ children: "Options"
525
+ }),
526
+ children: _jsx(Drilldown.Page, {
527
+ id: "page0",
528
+ children: _jsx(Drilldown.Option, {
529
+ id: "option0",
530
+ children: "Option 0"
531
+ })
532
+ })
533
+ })));
446
534
  const trigger = screen.getByRole('button');
447
535
  expect(trigger).toHaveAttribute('aria-haspopup');
448
536
  });
449
537
  it('should call onToggle when Drilldown is opened', async () => {
450
538
  const onToggle = vi.fn();
451
- render(/*#__PURE__*/React.createElement(Drilldown, {
539
+ render(_jsx(Drilldown, {
452
540
  rootPageId: "page0",
453
- trigger: _button8 || (_button8 = /*#__PURE__*/React.createElement("button", null, "Options")),
541
+ trigger: _button8 || (_button8 = _jsx("button", {
542
+ children: "Options"
543
+ })),
454
544
  onToggle: onToggle,
455
- "data-testid": "drilldown"
456
- }, _Drilldown$Page11 || (_Drilldown$Page11 = /*#__PURE__*/React.createElement(Drilldown.Page, {
457
- id: "page0"
458
- }, /*#__PURE__*/React.createElement(Drilldown.Option, {
459
- id: "option0"
460
- }, "Option 0")))));
545
+ "data-testid": "drilldown",
546
+ children: _Drilldown$Page11 || (_Drilldown$Page11 = _jsx(Drilldown.Page, {
547
+ id: "page0",
548
+ children: _jsx(Drilldown.Option, {
549
+ id: "option0",
550
+ children: "Option 0"
551
+ })
552
+ }))
553
+ }));
461
554
  const trigger = screen.getByRole('button');
462
555
  await userEvent.click(trigger);
463
556
  await waitFor(() => {
@@ -473,16 +566,21 @@ describe('<Drilldown />', () => {
473
566
  });
474
567
  it('should call onToggle when Drilldown is closed', async () => {
475
568
  const onToggle = vi.fn();
476
- render(/*#__PURE__*/React.createElement(Drilldown, {
569
+ render(_jsx(Drilldown, {
477
570
  rootPageId: "page0",
478
- trigger: _button9 || (_button9 = /*#__PURE__*/React.createElement("button", null, "Options")),
571
+ trigger: _button9 || (_button9 = _jsx("button", {
572
+ children: "Options"
573
+ })),
479
574
  onToggle: onToggle,
480
- defaultShow: true
481
- }, _Drilldown$Page12 || (_Drilldown$Page12 = /*#__PURE__*/React.createElement(Drilldown.Page, {
482
- id: "page0"
483
- }, /*#__PURE__*/React.createElement(Drilldown.Option, {
484
- id: "option0"
485
- }, "Option 0")))));
575
+ defaultShow: true,
576
+ children: _Drilldown$Page12 || (_Drilldown$Page12 = _jsx(Drilldown.Page, {
577
+ id: "page0",
578
+ children: _jsx(Drilldown.Option, {
579
+ id: "option0",
580
+ children: "Option 0"
581
+ })
582
+ }))
583
+ }));
486
584
  const trigger = screen.getByRole('button');
487
585
  await userEvent.click(trigger);
488
586
  await waitFor(() => {
@@ -499,34 +597,44 @@ describe('<Drilldown />', () => {
499
597
  describe('placement prop', () => {
500
598
  it('should be passed to Popover', async () => {
501
599
  let popoverRef = null;
502
- render(/*#__PURE__*/React.createElement(Drilldown, {
600
+ render(_jsx(Drilldown, {
503
601
  rootPageId: "page0",
504
- trigger: _button10 || (_button10 = /*#__PURE__*/React.createElement("button", null, "Toggle")),
602
+ trigger: _button10 || (_button10 = _jsx("button", {
603
+ children: "Toggle"
604
+ })),
505
605
  defaultShow: true,
506
606
  popoverRef: e => {
507
607
  popoverRef = e;
508
608
  },
509
- placement: 'top start'
510
- }, _Drilldown$Page13 || (_Drilldown$Page13 = /*#__PURE__*/React.createElement(Drilldown.Page, {
511
- id: "page0"
512
- }, /*#__PURE__*/React.createElement(Drilldown.Option, {
513
- id: "option01"
514
- }, "Option")))));
609
+ placement: 'top start',
610
+ children: _Drilldown$Page13 || (_Drilldown$Page13 = _jsx(Drilldown.Page, {
611
+ id: "page0",
612
+ children: _jsx(Drilldown.Option, {
613
+ id: "option01",
614
+ children: "Option"
615
+ })
616
+ }))
617
+ }));
515
618
  const popoverProps = popoverRef.props;
516
619
  expect(popoverProps.placement).toBe('top start');
517
620
  });
518
621
  });
519
622
  describe('defaultShow prop', () => {
520
623
  it('should display Popover on render', async () => {
521
- render(_Drilldown12 || (_Drilldown12 = /*#__PURE__*/React.createElement(Drilldown, {
624
+ render(_Drilldown12 || (_Drilldown12 = _jsx(Drilldown, {
522
625
  rootPageId: "page0",
523
- trigger: /*#__PURE__*/React.createElement("button", null, "Toggle"),
524
- defaultShow: true
525
- }, /*#__PURE__*/React.createElement(Drilldown.Page, {
526
- id: "page0"
527
- }, /*#__PURE__*/React.createElement(Drilldown.Option, {
528
- id: "option01"
529
- }, "Option")))));
626
+ trigger: _jsx("button", {
627
+ children: "Toggle"
628
+ }),
629
+ defaultShow: true,
630
+ children: _jsx(Drilldown.Page, {
631
+ id: "page0",
632
+ children: _jsx(Drilldown.Option, {
633
+ id: "option01",
634
+ children: "Option"
635
+ })
636
+ })
637
+ })));
530
638
  const popoverContent = screen.getByText('Option');
531
639
  expect(popoverContent).toBeVisible();
532
640
  });
@@ -534,29 +642,39 @@ describe('<Drilldown />', () => {
534
642
  describe('show prop', () => {
535
643
  it('should display popover', async () => {
536
644
  const onToggle = vi.fn();
537
- render(/*#__PURE__*/React.createElement(Drilldown, {
645
+ render(_jsx(Drilldown, {
538
646
  rootPageId: "page0",
539
- trigger: _button11 || (_button11 = /*#__PURE__*/React.createElement("button", null, "Toggle")),
647
+ trigger: _button11 || (_button11 = _jsx("button", {
648
+ children: "Toggle"
649
+ })),
540
650
  show: true,
541
- onToggle: onToggle
542
- }, _Drilldown$Page14 || (_Drilldown$Page14 = /*#__PURE__*/React.createElement(Drilldown.Page, {
543
- id: "page0"
544
- }, /*#__PURE__*/React.createElement(Drilldown.Option, {
545
- id: "option01"
546
- }, "Option")))));
651
+ onToggle: onToggle,
652
+ children: _Drilldown$Page14 || (_Drilldown$Page14 = _jsx(Drilldown.Page, {
653
+ id: "page0",
654
+ children: _jsx(Drilldown.Option, {
655
+ id: "option01",
656
+ children: "Option"
657
+ })
658
+ }))
659
+ }));
547
660
  const popoverContent = screen.getByText('Option');
548
661
  expect(popoverContent).toBeVisible();
549
662
  });
550
663
  it('should give error if onToggle is not provided (controllable)', async () => {
551
- render(_Drilldown13 || (_Drilldown13 = /*#__PURE__*/React.createElement(Drilldown, {
664
+ render(_Drilldown13 || (_Drilldown13 = _jsx(Drilldown, {
552
665
  rootPageId: "page0",
553
- trigger: /*#__PURE__*/React.createElement("button", null, "Toggle"),
554
- show: true
555
- }, /*#__PURE__*/React.createElement(Drilldown.Page, {
556
- id: "page0"
557
- }, /*#__PURE__*/React.createElement(Drilldown.Option, {
558
- id: "option01"
559
- }, "Option")))));
666
+ trigger: _jsx("button", {
667
+ children: "Toggle"
668
+ }),
669
+ show: true,
670
+ children: _jsx(Drilldown.Page, {
671
+ id: "page0",
672
+ children: _jsx(Drilldown.Option, {
673
+ id: "option01",
674
+ children: "Option"
675
+ })
676
+ })
677
+ })));
560
678
  const popoverContent = screen.getByText('Option');
561
679
  expect(popoverContent).toBeVisible();
562
680
  expect(popoverContent).toBeVisible();
@@ -567,18 +685,23 @@ describe('<Drilldown />', () => {
567
685
  it('should be passed to Popover', async () => {
568
686
  let popoverRef = null;
569
687
  const onFocus = vi.fn();
570
- render(/*#__PURE__*/React.createElement(Drilldown, {
688
+ render(_jsx(Drilldown, {
571
689
  rootPageId: "page0",
572
- trigger: _button12 || (_button12 = /*#__PURE__*/React.createElement("button", null, "Toggle")),
690
+ trigger: _button12 || (_button12 = _jsx("button", {
691
+ children: "Toggle"
692
+ })),
573
693
  popoverRef: e => {
574
694
  popoverRef = e;
575
695
  },
576
- onFocus: onFocus
577
- }, _Drilldown$Page15 || (_Drilldown$Page15 = /*#__PURE__*/React.createElement(Drilldown.Page, {
578
- id: "page0"
579
- }, /*#__PURE__*/React.createElement(Drilldown.Option, {
580
- id: "option01"
581
- }, "Option")))));
696
+ onFocus: onFocus,
697
+ children: _Drilldown$Page15 || (_Drilldown$Page15 = _jsx(Drilldown.Page, {
698
+ id: "page0",
699
+ children: _jsx(Drilldown.Option, {
700
+ id: "option01",
701
+ children: "Option"
702
+ })
703
+ }))
704
+ }));
582
705
  const popoverProps = popoverRef.props;
583
706
  expect(popoverProps.onFocus).toEqual(onFocus);
584
707
  });
@@ -587,18 +710,23 @@ describe('<Drilldown />', () => {
587
710
  it('should be passed to Popover', async () => {
588
711
  let popoverRef = null;
589
712
  const onMouseOver = vi.fn();
590
- render(/*#__PURE__*/React.createElement(Drilldown, {
713
+ render(_jsx(Drilldown, {
591
714
  rootPageId: "page0",
592
- trigger: _button13 || (_button13 = /*#__PURE__*/React.createElement("button", null, "Toggle")),
715
+ trigger: _button13 || (_button13 = _jsx("button", {
716
+ children: "Toggle"
717
+ })),
593
718
  popoverRef: e => {
594
719
  popoverRef = e;
595
720
  },
596
- onMouseOver: onMouseOver
597
- }, _Drilldown$Page16 || (_Drilldown$Page16 = /*#__PURE__*/React.createElement(Drilldown.Page, {
598
- id: "page0"
599
- }, /*#__PURE__*/React.createElement(Drilldown.Option, {
600
- id: "option01"
601
- }, "Option")))));
721
+ onMouseOver: onMouseOver,
722
+ children: _Drilldown$Page16 || (_Drilldown$Page16 = _jsx(Drilldown.Page, {
723
+ id: "page0",
724
+ children: _jsx(Drilldown.Option, {
725
+ id: "option01",
726
+ children: "Option"
727
+ })
728
+ }))
729
+ }));
602
730
  const popoverProps = popoverRef.props;
603
731
  expect(popoverProps.onMouseOver).toEqual(onMouseOver);
604
732
  });
@@ -606,18 +734,23 @@ describe('<Drilldown />', () => {
606
734
  describe('shouldContainFocus prop', () => {
607
735
  it('should be passed to Popover', async () => {
608
736
  let popoverRef = null;
609
- render(/*#__PURE__*/React.createElement(Drilldown, {
737
+ render(_jsx(Drilldown, {
610
738
  rootPageId: "page0",
611
- trigger: _button14 || (_button14 = /*#__PURE__*/React.createElement("button", null, "Toggle")),
739
+ trigger: _button14 || (_button14 = _jsx("button", {
740
+ children: "Toggle"
741
+ })),
612
742
  popoverRef: e => {
613
743
  popoverRef = e;
614
744
  },
615
- shouldContainFocus: true
616
- }, _Drilldown$Page17 || (_Drilldown$Page17 = /*#__PURE__*/React.createElement(Drilldown.Page, {
617
- id: "page0"
618
- }, /*#__PURE__*/React.createElement(Drilldown.Option, {
619
- id: "option01"
620
- }, "Option")))));
745
+ shouldContainFocus: true,
746
+ children: _Drilldown$Page17 || (_Drilldown$Page17 = _jsx(Drilldown.Page, {
747
+ id: "page0",
748
+ children: _jsx(Drilldown.Option, {
749
+ id: "option01",
750
+ children: "Option"
751
+ })
752
+ }))
753
+ }));
621
754
  const popoverProps = popoverRef.props;
622
755
  expect(popoverProps.shouldContainFocus).toEqual(true);
623
756
  });
@@ -625,18 +758,23 @@ describe('<Drilldown />', () => {
625
758
  describe('shouldReturnFocus prop', () => {
626
759
  it('should be passed to Popover', async () => {
627
760
  let popoverRef = null;
628
- render(/*#__PURE__*/React.createElement(Drilldown, {
761
+ render(_jsx(Drilldown, {
629
762
  rootPageId: "page0",
630
- trigger: _button15 || (_button15 = /*#__PURE__*/React.createElement("button", null, "Toggle")),
763
+ trigger: _button15 || (_button15 = _jsx("button", {
764
+ children: "Toggle"
765
+ })),
631
766
  popoverRef: e => {
632
767
  popoverRef = e;
633
768
  },
634
- shouldReturnFocus: false
635
- }, _Drilldown$Page18 || (_Drilldown$Page18 = /*#__PURE__*/React.createElement(Drilldown.Page, {
636
- id: "page0"
637
- }, /*#__PURE__*/React.createElement(Drilldown.Option, {
638
- id: "option01"
639
- }, "Option")))));
769
+ shouldReturnFocus: false,
770
+ children: _Drilldown$Page18 || (_Drilldown$Page18 = _jsx(Drilldown.Page, {
771
+ id: "page0",
772
+ children: _jsx(Drilldown.Option, {
773
+ id: "option01",
774
+ children: "Option"
775
+ })
776
+ }))
777
+ }));
640
778
  const popoverProps = popoverRef.props;
641
779
  expect(popoverProps.shouldReturnFocus).toEqual(false);
642
780
  });
@@ -644,18 +782,23 @@ describe('<Drilldown />', () => {
644
782
  describe('withArrow prop', () => {
645
783
  it('should be passed to Popover', async () => {
646
784
  let popoverRef = null;
647
- render(/*#__PURE__*/React.createElement(Drilldown, {
785
+ render(_jsx(Drilldown, {
648
786
  rootPageId: "page0",
649
- trigger: _button16 || (_button16 = /*#__PURE__*/React.createElement("button", null, "Toggle")),
787
+ trigger: _button16 || (_button16 = _jsx("button", {
788
+ children: "Toggle"
789
+ })),
650
790
  popoverRef: e => {
651
791
  popoverRef = e;
652
792
  },
653
- withArrow: false
654
- }, _Drilldown$Page19 || (_Drilldown$Page19 = /*#__PURE__*/React.createElement(Drilldown.Page, {
655
- id: "page0"
656
- }, /*#__PURE__*/React.createElement(Drilldown.Option, {
657
- id: "option01"
658
- }, "Option")))));
793
+ withArrow: false,
794
+ children: _Drilldown$Page19 || (_Drilldown$Page19 = _jsx(Drilldown.Page, {
795
+ id: "page0",
796
+ children: _jsx(Drilldown.Option, {
797
+ id: "option01",
798
+ children: "Option"
799
+ })
800
+ }))
801
+ }));
659
802
  const popoverProps = popoverRef.props;
660
803
  expect(popoverProps.withArrow).toEqual(false);
661
804
  });
@@ -663,18 +806,23 @@ describe('<Drilldown />', () => {
663
806
  describe('offsetX prop', () => {
664
807
  it('should be passed to Popover', async () => {
665
808
  let popoverRef = null;
666
- render(/*#__PURE__*/React.createElement(Drilldown, {
809
+ render(_jsx(Drilldown, {
667
810
  rootPageId: "page0",
668
- trigger: _button17 || (_button17 = /*#__PURE__*/React.createElement("button", null, "Toggle")),
811
+ trigger: _button17 || (_button17 = _jsx("button", {
812
+ children: "Toggle"
813
+ })),
669
814
  popoverRef: e => {
670
815
  popoverRef = e;
671
816
  },
672
- offsetX: '2rem'
673
- }, _Drilldown$Page20 || (_Drilldown$Page20 = /*#__PURE__*/React.createElement(Drilldown.Page, {
674
- id: "page0"
675
- }, /*#__PURE__*/React.createElement(Drilldown.Option, {
676
- id: "option01"
677
- }, "Option")))));
817
+ offsetX: '2rem',
818
+ children: _Drilldown$Page20 || (_Drilldown$Page20 = _jsx(Drilldown.Page, {
819
+ id: "page0",
820
+ children: _jsx(Drilldown.Option, {
821
+ id: "option01",
822
+ children: "Option"
823
+ })
824
+ }))
825
+ }));
678
826
  const popoverProps = popoverRef.props;
679
827
  expect(popoverProps.offsetX).toEqual('2rem');
680
828
  });
@@ -682,18 +830,23 @@ describe('<Drilldown />', () => {
682
830
  describe('offsetY prop', () => {
683
831
  it('should be passed to Popover', async () => {
684
832
  let popoverRef = null;
685
- render(/*#__PURE__*/React.createElement(Drilldown, {
833
+ render(_jsx(Drilldown, {
686
834
  rootPageId: "page0",
687
- trigger: _button18 || (_button18 = /*#__PURE__*/React.createElement("button", null, "Toggle")),
835
+ trigger: _button18 || (_button18 = _jsx("button", {
836
+ children: "Toggle"
837
+ })),
688
838
  popoverRef: e => {
689
839
  popoverRef = e;
690
840
  },
691
- offsetY: '2rem'
692
- }, _Drilldown$Page21 || (_Drilldown$Page21 = /*#__PURE__*/React.createElement(Drilldown.Page, {
693
- id: "page0"
694
- }, /*#__PURE__*/React.createElement(Drilldown.Option, {
695
- id: "option01"
696
- }, "Option")))));
841
+ offsetY: '2rem',
842
+ children: _Drilldown$Page21 || (_Drilldown$Page21 = _jsx(Drilldown.Page, {
843
+ id: "page0",
844
+ children: _jsx(Drilldown.Option, {
845
+ id: "option01",
846
+ children: "Option"
847
+ })
848
+ }))
849
+ }));
697
850
  const popoverProps = popoverRef.props;
698
851
  expect(popoverProps.offsetY).toEqual('2rem');
699
852
  });
@@ -701,80 +854,105 @@ describe('<Drilldown />', () => {
701
854
  describe('positionContainerDisplay prop', () => {
702
855
  it('should be passed to Popover', async () => {
703
856
  let popoverRef = null;
704
- render(/*#__PURE__*/React.createElement(Drilldown, {
857
+ render(_jsx(Drilldown, {
705
858
  rootPageId: "page0",
706
- trigger: _button19 || (_button19 = /*#__PURE__*/React.createElement("button", null, "Toggle")),
859
+ trigger: _button19 || (_button19 = _jsx("button", {
860
+ children: "Toggle"
861
+ })),
707
862
  popoverRef: e => {
708
863
  popoverRef = e;
709
864
  },
710
- positionContainerDisplay: "block"
711
- }, _Drilldown$Page22 || (_Drilldown$Page22 = /*#__PURE__*/React.createElement(Drilldown.Page, {
712
- id: "page0"
713
- }, /*#__PURE__*/React.createElement(Drilldown.Option, {
714
- id: "option01"
715
- }, "Option")))));
865
+ positionContainerDisplay: "block",
866
+ children: _Drilldown$Page22 || (_Drilldown$Page22 = _jsx(Drilldown.Page, {
867
+ id: "page0",
868
+ children: _jsx(Drilldown.Option, {
869
+ id: "option01",
870
+ children: "Option"
871
+ })
872
+ }))
873
+ }));
716
874
  const popoverProps = popoverRef.props;
717
875
  expect(popoverProps.positionContainerDisplay).toEqual('block');
718
876
  });
719
877
  });
720
878
  describe('for a11y', () => {
721
879
  it('should be accessible', async () => {
722
- const _render9 = render(_Drilldown14 || (_Drilldown14 = /*#__PURE__*/React.createElement(Drilldown, {
723
- rootPageId: "page0"
724
- }, /*#__PURE__*/React.createElement(Drilldown.Page, {
725
- id: "page0",
726
- renderTitle: "Page Title",
727
- renderActionLabel: "Action Label"
728
- }, /*#__PURE__*/React.createElement(Drilldown.Option, {
729
- id: "item01"
730
- }, "Item1"), /*#__PURE__*/React.createElement(Drilldown.Option, {
731
- id: "item02",
732
- subPageId: "page1"
733
- }, "Item2"), /*#__PURE__*/React.createElement(Drilldown.Option, {
734
- id: "item03",
735
- description: "This is a description"
736
- }, "Item3"), /*#__PURE__*/React.createElement(Drilldown.Option, {
737
- id: "item04",
738
- renderLabelInfo: "After"
739
- }, "Item4"), /*#__PURE__*/React.createElement(Drilldown.Option, {
740
- id: "item05",
741
- disabled: true
742
- }, "Item5"), /*#__PURE__*/React.createElement(Drilldown.Option, {
743
- id: "item06",
744
- href: "/"
745
- }, "Item6"), /*#__PURE__*/React.createElement(Drilldown.Option, {
746
- id: "item07",
747
- renderBeforeLabel: /*#__PURE__*/React.createElement(IconCheckSolid, null)
748
- }, "Item7"), /*#__PURE__*/React.createElement(Drilldown.Option, {
749
- id: "item08",
750
- renderAfterLabel: /*#__PURE__*/React.createElement(IconCheckSolid, null)
751
- }, "Item8"), /*#__PURE__*/React.createElement(Drilldown.Separator, {
752
- id: "sep1"
753
- }), /*#__PURE__*/React.createElement(Drilldown.Group, {
754
- id: "group1",
755
- renderGroupTitle: "Multi-select group",
756
- selectableType: "multiple"
757
- }, /*#__PURE__*/React.createElement(Drilldown.Option, {
758
- id: "groupItem11"
759
- }, "GroupItem"), /*#__PURE__*/React.createElement(Drilldown.Option, {
760
- id: "groupItem12"
761
- }, "GroupItem"), /*#__PURE__*/React.createElement(Drilldown.Option, {
762
- id: "groupItem13"
763
- }, "GroupItem")), /*#__PURE__*/React.createElement(Drilldown.Group, {
764
- id: "group2",
765
- renderGroupTitle: "Single-select group",
766
- selectableType: "single"
767
- }, /*#__PURE__*/React.createElement(Drilldown.Option, {
768
- id: "groupItem21"
769
- }, "GroupItem"), /*#__PURE__*/React.createElement(Drilldown.Option, {
770
- id: "groupItem22"
771
- }, "GroupItem"), /*#__PURE__*/React.createElement(Drilldown.Option, {
772
- id: "groupItem23"
773
- }, "GroupItem"))), /*#__PURE__*/React.createElement(Drilldown.Page, {
774
- id: "page1"
775
- }, /*#__PURE__*/React.createElement(Drilldown.Option, {
776
- id: "item11"
777
- }, "Item1"))))),
880
+ const _render9 = render(_Drilldown14 || (_Drilldown14 = _jsxs(Drilldown, {
881
+ rootPageId: "page0",
882
+ children: [_jsxs(Drilldown.Page, {
883
+ id: "page0",
884
+ renderTitle: "Page Title",
885
+ renderActionLabel: "Action Label",
886
+ children: [_jsx(Drilldown.Option, {
887
+ id: "item01",
888
+ children: "Item1"
889
+ }), _jsx(Drilldown.Option, {
890
+ id: "item02",
891
+ subPageId: "page1",
892
+ children: "Item2"
893
+ }), _jsx(Drilldown.Option, {
894
+ id: "item03",
895
+ description: "This is a description",
896
+ children: "Item3"
897
+ }), _jsx(Drilldown.Option, {
898
+ id: "item04",
899
+ renderLabelInfo: "After",
900
+ children: "Item4"
901
+ }), _jsx(Drilldown.Option, {
902
+ id: "item05",
903
+ disabled: true,
904
+ children: "Item5"
905
+ }), _jsx(Drilldown.Option, {
906
+ id: "item06",
907
+ href: "/",
908
+ children: "Item6"
909
+ }), _jsx(Drilldown.Option, {
910
+ id: "item07",
911
+ renderBeforeLabel: _jsx(IconCheckSolid, {}),
912
+ children: "Item7"
913
+ }), _jsx(Drilldown.Option, {
914
+ id: "item08",
915
+ renderAfterLabel: _jsx(IconCheckSolid, {}),
916
+ children: "Item8"
917
+ }), _jsx(Drilldown.Separator, {
918
+ id: "sep1"
919
+ }), _jsxs(Drilldown.Group, {
920
+ id: "group1",
921
+ renderGroupTitle: "Multi-select group",
922
+ selectableType: "multiple",
923
+ children: [_jsx(Drilldown.Option, {
924
+ id: "groupItem11",
925
+ children: "GroupItem"
926
+ }), _jsx(Drilldown.Option, {
927
+ id: "groupItem12",
928
+ children: "GroupItem"
929
+ }), _jsx(Drilldown.Option, {
930
+ id: "groupItem13",
931
+ children: "GroupItem"
932
+ })]
933
+ }), _jsxs(Drilldown.Group, {
934
+ id: "group2",
935
+ renderGroupTitle: "Single-select group",
936
+ selectableType: "single",
937
+ children: [_jsx(Drilldown.Option, {
938
+ id: "groupItem21",
939
+ children: "GroupItem"
940
+ }), _jsx(Drilldown.Option, {
941
+ id: "groupItem22",
942
+ children: "GroupItem"
943
+ }), _jsx(Drilldown.Option, {
944
+ id: "groupItem23",
945
+ children: "GroupItem"
946
+ })]
947
+ })]
948
+ }), _jsx(Drilldown.Page, {
949
+ id: "page1",
950
+ children: _jsx(Drilldown.Option, {
951
+ id: "item11",
952
+ children: "Item1"
953
+ })
954
+ })]
955
+ }))),
778
956
  container = _render9.container;
779
957
 
780
958
  // axe-check is more strict now, and expects "list" role to have "listitem" children, but we use "role='none'" children. After discussing it with the A11y team, we agreed to ignore this error because the screen readers can read the component perfectly.
@@ -786,14 +964,17 @@ describe('<Drilldown />', () => {
786
964
  expect(axeCheck).toBe(true);
787
965
  });
788
966
  it('should meet a11y standarts when drilldown is open', async () => {
789
- const _render10 = render(_Drilldown15 || (_Drilldown15 = /*#__PURE__*/React.createElement(Drilldown, {
967
+ const _render10 = render(_Drilldown15 || (_Drilldown15 = _jsx(Drilldown, {
790
968
  defaultShow: true,
791
- rootPageId: "page0"
792
- }, /*#__PURE__*/React.createElement(Drilldown.Page, {
793
- id: "page0"
794
- }, /*#__PURE__*/React.createElement(Drilldown.Option, {
795
- id: "option0"
796
- }, "Option 0"))))),
969
+ rootPageId: "page0",
970
+ children: _jsx(Drilldown.Page, {
971
+ id: "page0",
972
+ children: _jsx(Drilldown.Option, {
973
+ id: "option0",
974
+ children: "Option 0"
975
+ })
976
+ })
977
+ }))),
797
978
  container = _render10.container;
798
979
  const axeCheck = await runAxeCheck(container);
799
980
  expect(axeCheck).toBe(true);