@patternfly/react-templates 1.1.0-prerelease.2 → 1.1.0-prerelease.20

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 (93) hide show
  1. package/CHANGELOG.md +86 -0
  2. package/README.md +2 -17
  3. package/components/package.json +8 -1
  4. package/dist/dynamic/components/Dropdown/package.json +8 -0
  5. package/dist/dynamic/components/Select/package.json +8 -1
  6. package/dist/dynamic-modules.json +15 -0
  7. package/dist/esm/components/Dropdown/SimpleDropdown.d.ts +48 -0
  8. package/dist/esm/components/Dropdown/SimpleDropdown.d.ts.map +1 -0
  9. package/dist/esm/components/Dropdown/SimpleDropdown.js +33 -0
  10. package/dist/esm/components/Dropdown/SimpleDropdown.js.map +1 -0
  11. package/dist/esm/components/Dropdown/index.d.ts +2 -0
  12. package/dist/esm/components/Dropdown/index.d.ts.map +1 -0
  13. package/dist/esm/components/Dropdown/index.js +2 -0
  14. package/dist/esm/components/Dropdown/index.js.map +1 -0
  15. package/dist/esm/components/Select/CheckboxSelect.d.ts +7 -3
  16. package/dist/esm/components/Select/CheckboxSelect.d.ts.map +1 -1
  17. package/dist/esm/components/Select/CheckboxSelect.js +9 -6
  18. package/dist/esm/components/Select/CheckboxSelect.js.map +1 -1
  19. package/dist/esm/components/Select/{SelectSimple.d.ts → SimpleSelect.d.ts} +10 -7
  20. package/dist/esm/components/Select/SimpleSelect.d.ts.map +1 -0
  21. package/dist/esm/components/Select/{SelectSimple.js → SimpleSelect.js} +13 -9
  22. package/dist/esm/components/Select/SimpleSelect.js.map +1 -0
  23. package/dist/esm/components/Select/TypeaheadSelect.d.ts +33 -0
  24. package/dist/esm/components/Select/TypeaheadSelect.d.ts.map +1 -0
  25. package/dist/esm/components/Select/TypeaheadSelect.js +181 -0
  26. package/dist/esm/components/Select/TypeaheadSelect.js.map +1 -0
  27. package/dist/esm/components/Select/index.d.ts +2 -1
  28. package/dist/esm/components/Select/index.d.ts.map +1 -1
  29. package/dist/esm/components/Select/index.js +2 -1
  30. package/dist/esm/components/Select/index.js.map +1 -1
  31. package/dist/esm/components/index.d.ts +1 -0
  32. package/dist/esm/components/index.d.ts.map +1 -1
  33. package/dist/esm/components/index.js +1 -0
  34. package/dist/esm/components/index.js.map +1 -1
  35. package/dist/js/components/Dropdown/SimpleDropdown.d.ts +48 -0
  36. package/dist/js/components/Dropdown/SimpleDropdown.d.ts.map +1 -0
  37. package/dist/js/components/Dropdown/SimpleDropdown.js +36 -0
  38. package/dist/js/components/Dropdown/SimpleDropdown.js.map +1 -0
  39. package/dist/js/components/Dropdown/index.d.ts +2 -0
  40. package/dist/js/components/Dropdown/index.d.ts.map +1 -0
  41. package/dist/js/components/Dropdown/index.js +5 -0
  42. package/dist/js/components/Dropdown/index.js.map +1 -0
  43. package/dist/js/components/Select/CheckboxSelect.d.ts +7 -3
  44. package/dist/js/components/Select/CheckboxSelect.d.ts.map +1 -1
  45. package/dist/js/components/Select/CheckboxSelect.js +9 -6
  46. package/dist/js/components/Select/CheckboxSelect.js.map +1 -1
  47. package/dist/js/components/Select/{SelectSimple.d.ts → SimpleSelect.d.ts} +10 -7
  48. package/dist/js/components/Select/SimpleSelect.d.ts.map +1 -0
  49. package/dist/js/components/Select/{SelectSimple.js → SimpleSelect.js} +14 -10
  50. package/dist/js/components/Select/SimpleSelect.js.map +1 -0
  51. package/dist/js/components/Select/TypeaheadSelect.d.ts +33 -0
  52. package/dist/js/components/Select/TypeaheadSelect.d.ts.map +1 -0
  53. package/dist/js/components/Select/TypeaheadSelect.js +185 -0
  54. package/dist/js/components/Select/TypeaheadSelect.js.map +1 -0
  55. package/dist/js/components/Select/index.d.ts +2 -1
  56. package/dist/js/components/Select/index.d.ts.map +1 -1
  57. package/dist/js/components/Select/index.js +2 -1
  58. package/dist/js/components/Select/index.js.map +1 -1
  59. package/dist/js/components/index.d.ts +1 -0
  60. package/dist/js/components/index.d.ts.map +1 -1
  61. package/dist/js/components/index.js +1 -0
  62. package/dist/js/components/index.js.map +1 -1
  63. package/dist/umd/assets/output-CHuixoZm.css +26010 -0
  64. package/dist/umd/react-templates.min.js +1 -1
  65. package/package.json +7 -10
  66. package/rollup.config.mjs +8 -0
  67. package/src/components/Dropdown/SimpleDropdown.tsx +139 -0
  68. package/src/components/Dropdown/__tests__/SimpleDropdown.test.tsx +266 -0
  69. package/src/components/Dropdown/__tests__/__snapshots__/SimpleDropdown.test.tsx.snap +153 -0
  70. package/src/components/Dropdown/examples/DropdownTemplates.md +24 -0
  71. package/src/components/Dropdown/examples/SimpleDropdownExample.tsx +53 -0
  72. package/src/components/Dropdown/index.ts +1 -0
  73. package/src/components/Select/CheckboxSelect.tsx +18 -7
  74. package/src/components/Select/{SelectSimple.tsx → SimpleSelect.tsx} +27 -14
  75. package/src/components/Select/TypeaheadSelect.tsx +326 -0
  76. package/src/components/Select/{CheckboxSelect.test.tsx → __tests__/CheckboxSelect.test.tsx} +29 -1
  77. package/src/components/Select/{CheckboxSelectSnapshots.test.tsx → __tests__/CheckboxSelectSnapshots.test.tsx} +1 -1
  78. package/src/components/Select/__tests__/SimpleSelect.test.tsx +241 -0
  79. package/src/components/Select/__tests__/TypeaheadSelect.test.tsx +408 -0
  80. package/src/components/Select/{__snapshots__ → __tests__/__snapshots__}/CheckboxSelectSnapshots.test.tsx.snap +6 -1
  81. package/src/components/Select/__tests__/__snapshots__/SimpleSelect.test.tsx.snap +170 -0
  82. package/src/components/Select/__tests__/__snapshots__/TypeaheadSelect.test.tsx.snap +180 -0
  83. package/src/components/Select/examples/CheckboxSelectDemo.tsx +1 -1
  84. package/src/components/Select/examples/SelectTemplates.md +11 -4
  85. package/src/components/Select/examples/{SelectSimpleDemo.tsx → SimpleSelectDemo.tsx} +6 -6
  86. package/src/components/Select/examples/TypeaheadSelectDemo.tsx +21 -0
  87. package/src/components/Select/index.ts +2 -1
  88. package/src/components/index.ts +1 -0
  89. package/dist/esm/components/Select/SelectSimple.d.ts.map +0 -1
  90. package/dist/esm/components/Select/SelectSimple.js.map +0 -1
  91. package/dist/js/components/Select/SelectSimple.d.ts.map +0 -1
  92. package/dist/js/components/Select/SelectSimple.js.map +0 -1
  93. package/rollup.config.js +0 -7
@@ -0,0 +1,408 @@
1
+ import * as React from 'react';
2
+ import { render, screen, waitForElementToBeRemoved } from '@testing-library/react';
3
+ import userEvent from '@testing-library/user-event';
4
+ import { TypeaheadSelect } from '../TypeaheadSelect';
5
+ import styles from '@patternfly/react-styles/css/components/Menu/menu';
6
+
7
+ test('renders typeahead select with options', async () => {
8
+ const initialOptions = [
9
+ { content: 'Option 1', value: 'option1' },
10
+ { content: 'Option 2', value: 'option2' },
11
+ { content: 'Option 3', value: 'option3' }
12
+ ];
13
+
14
+ const user = userEvent.setup();
15
+
16
+ render(<TypeaheadSelect initialOptions={initialOptions} />);
17
+
18
+ const toggle = screen.getByRole('button', { name: 'Typeahead menu toggle' });
19
+
20
+ await user.click(toggle);
21
+
22
+ const option1 = screen.getByText('Option 1');
23
+ const option2 = screen.getByText('Option 2');
24
+ const option3 = screen.getByText('Option 3');
25
+
26
+ expect(option1).toBeInTheDocument();
27
+ expect(option2).toBeInTheDocument();
28
+ expect(option3).toBeInTheDocument();
29
+ });
30
+
31
+ test('selects options when clicked', async () => {
32
+ const initialOptions = [
33
+ { content: 'Option 1', value: 'option1' },
34
+ { content: 'Option 2', value: 'option2' },
35
+ { content: 'Option 3', value: 'option3' }
36
+ ];
37
+
38
+ const user = userEvent.setup();
39
+
40
+ render(<TypeaheadSelect initialOptions={initialOptions} />);
41
+
42
+ const toggle = screen.getByRole('button', { name: 'Typeahead menu toggle' });
43
+
44
+ await user.click(toggle);
45
+
46
+ const option1 = screen.getByRole('option', { name: 'Option 1' });
47
+
48
+ expect(option1).not.toHaveClass(styles.modifiers.selected);
49
+
50
+ await user.click(option1);
51
+
52
+ expect(option1).toHaveClass(styles.modifiers.selected);
53
+ });
54
+
55
+ test('calls the onSelect callback with the selected value when an option is selected', async () => {
56
+ const initialOptions = [
57
+ { content: 'Option 1', value: 'option1' },
58
+ { content: 'Option 2', value: 'option2' },
59
+ { content: 'Option 3', value: 'option3' }
60
+ ];
61
+
62
+ const user = userEvent.setup();
63
+ const onSelectMock = jest.fn();
64
+
65
+ render(<TypeaheadSelect initialOptions={initialOptions} onSelect={onSelectMock} />);
66
+
67
+ const toggle = screen.getByRole('button', { name: 'Typeahead menu toggle' });
68
+
69
+ await user.click(toggle);
70
+
71
+ expect(onSelectMock).not.toHaveBeenCalled();
72
+
73
+ const option1 = screen.getByRole('option', { name: 'Option 1' });
74
+
75
+ await user.click(option1);
76
+
77
+ expect(onSelectMock).toHaveBeenCalledTimes(1);
78
+ expect(onSelectMock).toHaveBeenCalledWith(expect.anything(), 'option1');
79
+ });
80
+
81
+ test('deselects options when clear button is clicked', async () => {
82
+ const initialOptions = [
83
+ { content: 'Option 1', value: 'option1' },
84
+ { content: 'Option 2', value: 'option2' },
85
+ { content: 'Option 3', value: 'option3' }
86
+ ];
87
+
88
+ const user = userEvent.setup();
89
+
90
+ render(<TypeaheadSelect initialOptions={initialOptions} />);
91
+
92
+ const toggle = screen.getByRole('button', { name: 'Typeahead menu toggle' });
93
+
94
+ await user.click(toggle);
95
+
96
+ const option1 = screen.getByRole('option', { name: 'Option 1' });
97
+ await user.click(option1);
98
+ expect(option1).toHaveClass(styles.modifiers.selected);
99
+
100
+ const input = screen.getByRole('combobox');
101
+ expect(input).toHaveValue('Option 1');
102
+
103
+ const clearButton = screen.getByRole('button', { name: 'Clear input value' });
104
+ await user.click(clearButton);
105
+ expect(input).toHaveValue('');
106
+
107
+ await user.click(toggle);
108
+ expect(screen.getByRole('option', { name: 'Option 1' })).not.toHaveClass(styles.modifiers.selected);
109
+ });
110
+
111
+ test('toggles the select menu when the toggle button is clicked', async () => {
112
+ const initialOptions = [
113
+ { content: 'Option 1', value: 'option1' },
114
+ { content: 'Option 2', value: 'option2' },
115
+ { content: 'Option 3', value: 'option3' }
116
+ ];
117
+
118
+ const user = userEvent.setup();
119
+
120
+ render(<TypeaheadSelect initialOptions={initialOptions} />);
121
+
122
+ const toggle = screen.getByRole('button', { name: 'Typeahead menu toggle' });
123
+
124
+ await user.click(toggle);
125
+
126
+ const menu = screen.getByRole('listbox');
127
+ expect(menu).toBeInTheDocument();
128
+
129
+ await user.click(toggle);
130
+
131
+ await waitForElementToBeRemoved(menu);
132
+
133
+ expect(screen.queryByRole('listbox')).not.toBeInTheDocument();
134
+ });
135
+
136
+ test('calls the onToggle callback when the toggle is clicked', async () => {
137
+ const initialOptions = [
138
+ { content: 'Option 1', value: 'option1' },
139
+ { content: 'Option 2', value: 'option2' },
140
+ { content: 'Option 3', value: 'option3' }
141
+ ];
142
+
143
+ const user = userEvent.setup();
144
+ const onToggleMock = jest.fn();
145
+
146
+ render(<TypeaheadSelect initialOptions={initialOptions} onToggle={onToggleMock} />);
147
+
148
+ const toggle = screen.getByRole('button', { name: 'Typeahead menu toggle' });
149
+
150
+ expect(onToggleMock).not.toHaveBeenCalled();
151
+
152
+ await user.click(toggle);
153
+
154
+ expect(onToggleMock).toHaveBeenCalledTimes(1);
155
+ expect(onToggleMock).toHaveBeenCalledWith(true);
156
+
157
+ await user.click(toggle);
158
+
159
+ expect(onToggleMock).toHaveBeenCalledTimes(2);
160
+ expect(onToggleMock).toHaveBeenCalledWith(false);
161
+ });
162
+
163
+ test('Passes toggleWidth', () => {
164
+ const initialOptions = [
165
+ { content: 'Option 1', value: 'option1' },
166
+ { content: 'Option 2', value: 'option2' },
167
+ { content: 'Option 3', value: 'option3' }
168
+ ];
169
+
170
+ render(<TypeaheadSelect initialOptions={initialOptions} toggleWidth="500px" />);
171
+
172
+ const toggle = screen.getByRole('button', { name: 'Typeahead menu toggle' });
173
+ expect(toggle.parentElement).toHaveAttribute('style', 'width: 500px;');
174
+ });
175
+
176
+ test('Passes additional toggleProps', () => {
177
+ const initialOptions = [
178
+ { content: 'Option 1', value: 'option1' },
179
+ { content: 'Option 2', value: 'option2' },
180
+ { content: 'Option 3', value: 'option3' }
181
+ ];
182
+
183
+ render(<TypeaheadSelect initialOptions={initialOptions} toggleProps={{ id: 'toggle' }} />);
184
+
185
+ const toggle = screen.getByRole('button', { name: 'Typeahead menu toggle' });
186
+ expect(toggle.parentElement).toHaveAttribute('id', 'toggle');
187
+ });
188
+
189
+ test('passes custom placeholder text', async () => {
190
+ const initialOptions = [
191
+ { content: 'Option 1', value: 'option1' },
192
+ { content: 'Option 2', value: 'option2' },
193
+ { content: 'Option 3', value: 'option3' }
194
+ ];
195
+
196
+ render(<TypeaheadSelect initialOptions={initialOptions} placeholder="custom" />);
197
+
198
+ const input = screen.getByRole('combobox');
199
+
200
+ expect(input).toHaveAttribute('placeholder', 'custom');
201
+ });
202
+
203
+ test('displays noOptionsFoundMessage when filter returns no results', async () => {
204
+ const initialOptions = [
205
+ { content: 'Option 1', value: 'option1' },
206
+ { content: 'Option 2', value: 'option2' },
207
+ { content: 'Option 3', value: 'option3' }
208
+ ];
209
+ const user = userEvent.setup();
210
+
211
+ render(<TypeaheadSelect initialOptions={initialOptions} />);
212
+
213
+ const toggle = screen.getByRole('button', { name: 'Typeahead menu toggle' });
214
+ const input = screen.getByRole('combobox');
215
+
216
+ expect(input).toHaveAttribute('placeholder', 'Select an option');
217
+
218
+ await user.click(toggle);
219
+
220
+ const option1 = screen.getByRole('option', { name: 'Option 1' });
221
+ const option2 = screen.getByRole('option', { name: 'Option 2' });
222
+ const option3 = screen.getByRole('option', { name: 'Option 3' });
223
+
224
+ expect(option1).toBeInTheDocument();
225
+ expect(option2).toBeInTheDocument();
226
+ expect(option3).toBeInTheDocument();
227
+
228
+ await user.type(input, '9');
229
+ expect(input).toHaveValue('9');
230
+
231
+ expect(option1).not.toBeInTheDocument();
232
+ expect(option2).not.toBeInTheDocument();
233
+ expect(option3).not.toBeInTheDocument();
234
+ expect(screen.getByRole('option', { name: 'No results found for "9"' })).toBeInTheDocument();
235
+ });
236
+
237
+ test('displays custom noOptionsFoundMessage', async () => {
238
+ const initialOptions = [
239
+ { content: 'Option 1', value: 'option1' },
240
+ { content: 'Option 2', value: 'option2' },
241
+ { content: 'Option 3', value: 'option3' }
242
+ ];
243
+ const user = userEvent.setup();
244
+
245
+ render(<TypeaheadSelect initialOptions={initialOptions} noOptionsFoundMessage="custom" />);
246
+
247
+ const toggle = screen.getByRole('button', { name: 'Typeahead menu toggle' });
248
+ const input = screen.getByRole('combobox');
249
+
250
+ expect(input).toHaveAttribute('placeholder', 'Select an option');
251
+
252
+ await user.click(toggle);
253
+
254
+ const option1 = screen.getByRole('option', { name: 'Option 1' });
255
+ const option2 = screen.getByRole('option', { name: 'Option 2' });
256
+ const option3 = screen.getByRole('option', { name: 'Option 3' });
257
+
258
+ expect(option1).toBeInTheDocument();
259
+ expect(option2).toBeInTheDocument();
260
+ expect(option3).toBeInTheDocument();
261
+
262
+ await user.type(input, '9');
263
+ expect(input).toHaveValue('9');
264
+
265
+ expect(option1).not.toBeInTheDocument();
266
+ expect(option2).not.toBeInTheDocument();
267
+ expect(option3).not.toBeInTheDocument();
268
+ expect(screen.getByRole('option', { name: 'custom' })).toBeInTheDocument();
269
+ });
270
+
271
+ test('disables the select when isDisabled prop is true', async () => {
272
+ const initialOptions = [
273
+ { content: 'Option 1', value: 'option1' },
274
+ { content: 'Option 2', value: 'option2' },
275
+ { content: 'Option 3', value: 'option3' }
276
+ ];
277
+
278
+ const user = userEvent.setup();
279
+
280
+ render(<TypeaheadSelect initialOptions={initialOptions} isDisabled={true} />);
281
+
282
+ const toggle = screen.getByRole('button', { name: 'Typeahead menu toggle' });
283
+
284
+ expect(toggle.parentElement).toHaveClass(styles.modifiers.disabled);
285
+
286
+ await user.click(toggle);
287
+
288
+ expect(screen.queryByRole('menu')).not.toBeInTheDocument();
289
+ });
290
+
291
+ test('passes other SelectOption props to the SelectOption component', async () => {
292
+ const initialOptions = [{ content: 'Option 1', value: 'option1', isDisabled: true }];
293
+
294
+ const user = userEvent.setup();
295
+
296
+ render(<TypeaheadSelect initialOptions={initialOptions} />);
297
+
298
+ const toggle = screen.getByRole('button', { name: 'Typeahead menu toggle' });
299
+
300
+ await user.click(toggle);
301
+
302
+ const option1 = screen.getByRole('option', { name: 'Option 1' });
303
+ expect(option1).toBeDisabled();
304
+ });
305
+
306
+ test('displays the option in input when option is selected', async () => {
307
+ const initialOptions = [
308
+ { content: 'Option 1', value: 'option1' },
309
+ { content: 'Option 2', value: 'option2' },
310
+ { content: 'Option 3', value: 'option3' }
311
+ ];
312
+
313
+ const user = userEvent.setup();
314
+
315
+ render(<TypeaheadSelect initialOptions={initialOptions} />);
316
+
317
+ const toggle = screen.getByRole('button', { name: 'Typeahead menu toggle' });
318
+ const input = screen.getByRole('combobox');
319
+
320
+ expect(input).toHaveAttribute('placeholder', 'Select an option');
321
+
322
+ await user.click(toggle);
323
+
324
+ const option1 = screen.getByRole('option', { name: 'Option 1' });
325
+
326
+ await user.click(option1);
327
+
328
+ expect(input).toHaveValue('Option 1');
329
+
330
+ const clearButton = screen.getByRole('button', { name: 'Clear input value' });
331
+ await user.click(clearButton);
332
+
333
+ expect(input).toHaveValue('');
334
+ });
335
+
336
+ test('typing in input filters options', async () => {
337
+ const initialOptions = [
338
+ { content: 'Option 1', value: 'option1' },
339
+ { content: 'Option 2', value: 'option2' },
340
+ { content: 'Option 3', value: 'option3' }
341
+ ];
342
+
343
+ const user = userEvent.setup();
344
+
345
+ render(<TypeaheadSelect initialOptions={initialOptions} />);
346
+
347
+ const toggle = screen.getByRole('button', { name: 'Typeahead menu toggle' });
348
+ const input = screen.getByRole('combobox');
349
+
350
+ expect(input).toHaveAttribute('placeholder', 'Select an option');
351
+
352
+ await user.click(toggle);
353
+
354
+ const option1 = screen.getByRole('option', { name: 'Option 1' });
355
+ const option2 = screen.getByRole('option', { name: 'Option 2' });
356
+ const option3 = screen.getByRole('option', { name: 'Option 3' });
357
+
358
+ expect(option1).toBeInTheDocument();
359
+ expect(option2).toBeInTheDocument();
360
+ expect(option3).toBeInTheDocument();
361
+
362
+ await user.type(input, '1');
363
+ expect(input).toHaveValue('1');
364
+
365
+ expect(option1).toBeInTheDocument();
366
+ expect(option2).not.toBeInTheDocument();
367
+ expect(option3).not.toBeInTheDocument();
368
+ });
369
+
370
+ test('typing in input triggers onInputChange callback', async () => {
371
+ const initialOptions = [
372
+ { content: 'Option 1', value: 'option1' },
373
+ { content: 'Option 2', value: 'option2' },
374
+ { content: 'Option 3', value: 'option3' }
375
+ ];
376
+
377
+ const user = userEvent.setup();
378
+ const onInputChangeMock = jest.fn();
379
+
380
+ render(<TypeaheadSelect initialOptions={initialOptions} onInputChange={onInputChangeMock} />);
381
+
382
+ const input = screen.getByRole('combobox');
383
+
384
+ expect(input).toHaveAttribute('placeholder', 'Select an option');
385
+
386
+ await user.type(input, '1');
387
+
388
+ expect(input).toHaveValue('1');
389
+ expect(onInputChangeMock).toHaveBeenCalledTimes(1);
390
+ expect(onInputChangeMock).toHaveBeenCalledWith('1');
391
+ });
392
+
393
+ test('Matches snapshot', async () => {
394
+ const initialOptions = [
395
+ { content: 'Option 1', value: 'option1' },
396
+ { content: 'Option 2', value: 'option2' },
397
+ { content: 'Option 3', value: 'option3' }
398
+ ];
399
+
400
+ const user = userEvent.setup();
401
+
402
+ const { asFragment } = render(<TypeaheadSelect initialOptions={initialOptions} />);
403
+
404
+ const toggle = screen.getByRole('button', { name: 'Typeahead menu toggle' });
405
+ await user.click(toggle);
406
+
407
+ expect(asFragment()).toMatchSnapshot();
408
+ });
@@ -5,6 +5,9 @@ exports[`checkbox select with no props snapshot 1`] = `
5
5
  <button
6
6
  aria-expanded="false"
7
7
  class="pf-v5-c-menu-toggle"
8
+ data-ouia-component-id="OUIA-Generated-MenuToggle-1"
9
+ data-ouia-component-type="PF5/MenuToggle"
10
+ data-ouia-safe="true"
8
11
  style="width: 200px;"
9
12
  type="button"
10
13
  >
@@ -43,6 +46,9 @@ exports[`opened checkbox select snapshot 1`] = `
43
46
  <button
44
47
  aria-expanded="true"
45
48
  class="pf-v5-c-menu-toggle pf-m-expanded"
49
+ data-ouia-component-id="OUIA-Generated-MenuToggle-2"
50
+ data-ouia-component-type="PF5/MenuToggle"
51
+ data-ouia-safe="true"
46
52
  style="width: 200px;"
47
53
  type="button"
48
54
  >
@@ -81,7 +87,6 @@ exports[`opened checkbox select snapshot 1`] = `
81
87
  data-popper-escaped="true"
82
88
  data-popper-placement="bottom-start"
83
89
  data-popper-reference-hidden="true"
84
- id="checkbox-select"
85
90
  style="position: absolute; left: 0px; top: 0px; z-index: 9999; opacity: 1; transition: opacity 0ms cubic-bezier(.54, 1.5, .38, 1.11); min-width: 0px; transform: translate(0px, 0px);"
86
91
  >
87
92
  <div
@@ -0,0 +1,170 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`Matches snapshot 1`] = `
4
+ <DocumentFragment>
5
+ <button
6
+ aria-expanded="true"
7
+ class="pf-v5-c-menu-toggle pf-m-expanded"
8
+ data-ouia-component-id="OUIA-Generated-MenuToggle-13"
9
+ data-ouia-component-type="PF5/MenuToggle"
10
+ data-ouia-safe="true"
11
+ style="width: 200px;"
12
+ type="button"
13
+ >
14
+ <span
15
+ class="pf-v5-c-menu-toggle__text"
16
+ >
17
+ Select
18
+ </span>
19
+ <span
20
+ class="pf-v5-c-menu-toggle__controls"
21
+ >
22
+ <span
23
+ class="pf-v5-c-menu-toggle__toggle-icon"
24
+ >
25
+ <svg
26
+ aria-hidden="true"
27
+ class="pf-v5-svg"
28
+ fill="currentColor"
29
+ height="1em"
30
+ role="img"
31
+ viewBox="0 0 320 512"
32
+ width="1em"
33
+ >
34
+ <path
35
+ d="M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"
36
+ />
37
+ </svg>
38
+ </span>
39
+ </span>
40
+ </button>
41
+ <div
42
+ class="pf-v5-c-menu"
43
+ data-ouia-component-id="OUIA-Generated-Select-24"
44
+ data-ouia-component-type="PF5/Select"
45
+ data-ouia-safe="true"
46
+ data-popper-escaped="true"
47
+ data-popper-placement="bottom-start"
48
+ data-popper-reference-hidden="true"
49
+ style="position: absolute; left: 0px; top: 0px; z-index: 9999; opacity: 1; transition: opacity 0ms cubic-bezier(.54, 1.5, .38, 1.11); min-width: 0px; transform: translate(0px, 0px);"
50
+ >
51
+ <div
52
+ class="pf-v5-c-menu__content"
53
+ >
54
+ <ul
55
+ aria-multiselectable="false"
56
+ class="pf-v5-c-menu__list"
57
+ role="listbox"
58
+ >
59
+ <li
60
+ class="pf-v5-c-menu__list-item"
61
+ role="none"
62
+ >
63
+ <button
64
+ aria-selected="false"
65
+ class="pf-v5-c-menu__item"
66
+ role="option"
67
+ tabindex="0"
68
+ type="button"
69
+ >
70
+ <span
71
+ class="pf-v5-c-menu__item-main"
72
+ >
73
+ <span
74
+ class="pf-v5-c-menu__item-text"
75
+ >
76
+ Option 1
77
+ </span>
78
+ </span>
79
+ </button>
80
+ </li>
81
+ <li
82
+ class="pf-v5-c-menu__list-item"
83
+ role="none"
84
+ >
85
+ <button
86
+ aria-selected="false"
87
+ class="pf-v5-c-menu__item"
88
+ role="option"
89
+ tabindex="-1"
90
+ type="button"
91
+ >
92
+ <span
93
+ class="pf-v5-c-menu__item-main"
94
+ >
95
+ <span
96
+ class="pf-v5-c-menu__item-text"
97
+ >
98
+ Option 2
99
+ </span>
100
+ </span>
101
+ </button>
102
+ </li>
103
+ <li
104
+ class="pf-v5-c-menu__list-item"
105
+ role="none"
106
+ >
107
+ <button
108
+ aria-selected="false"
109
+ class="pf-v5-c-menu__item"
110
+ role="option"
111
+ tabindex="-1"
112
+ type="button"
113
+ >
114
+ <span
115
+ class="pf-v5-c-menu__item-main"
116
+ >
117
+ <span
118
+ class="pf-v5-c-menu__item-text"
119
+ >
120
+ Option 3
121
+ </span>
122
+ </span>
123
+ </button>
124
+ </li>
125
+ </ul>
126
+ </div>
127
+ </div>
128
+ </DocumentFragment>
129
+ `;
130
+
131
+ exports[`checkbox select with no props snapshot 1`] = `
132
+ <DocumentFragment>
133
+ <button
134
+ aria-expanded="false"
135
+ class="pf-v5-c-menu-toggle"
136
+ data-ouia-component-id="OUIA-Generated-MenuToggle-12"
137
+ data-ouia-component-type="PF5/MenuToggle"
138
+ data-ouia-safe="true"
139
+ style="width: 200px;"
140
+ type="button"
141
+ >
142
+ <span
143
+ class="pf-v5-c-menu-toggle__text"
144
+ >
145
+ Select a value
146
+ </span>
147
+ <span
148
+ class="pf-v5-c-menu-toggle__controls"
149
+ >
150
+ <span
151
+ class="pf-v5-c-menu-toggle__toggle-icon"
152
+ >
153
+ <svg
154
+ aria-hidden="true"
155
+ class="pf-v5-svg"
156
+ fill="currentColor"
157
+ height="1em"
158
+ role="img"
159
+ viewBox="0 0 320 512"
160
+ width="1em"
161
+ >
162
+ <path
163
+ d="M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"
164
+ />
165
+ </svg>
166
+ </span>
167
+ </span>
168
+ </button>
169
+ </DocumentFragment>
170
+ `;