@pingux/astro 1.1.0-alpha.0 → 1.1.0-alpha.12
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/CHANGELOG.md +132 -0
- package/lib/cjs/components/AccordionGridGroup/AccordionGridGroup.test.js +24 -0
- package/lib/cjs/components/AccordionGridItem/AccordionGridItemBody.js +1 -1
- package/lib/cjs/components/AccordionGridItem/AccordionGridItemHeader.js +1 -1
- package/lib/cjs/components/AccordionGroup/AccordionGroup.test.js +33 -1
- package/lib/cjs/components/AccordionItem/AccordionItem.js +5 -4
- package/lib/cjs/components/Button/Button.js +1 -2
- package/lib/cjs/components/Button/Button.stories.js +2 -1
- package/lib/cjs/components/Button/Button.test.js +2 -1
- package/lib/cjs/components/CodeView/CodeView.js +165 -0
- package/lib/cjs/components/CodeView/CodeView.stories.js +93 -0
- package/lib/cjs/components/CodeView/CodeView.test.js +211 -0
- package/lib/cjs/components/CodeView/index.js +18 -0
- package/lib/cjs/components/ColorField/ColorField.js +1 -0
- package/lib/cjs/components/ComboBoxField/ComboBoxField.js +7 -0
- package/lib/cjs/components/ComboBoxField/ComboBoxField.stories.js +25 -1
- package/lib/cjs/components/ComboBoxField/ComboBoxField.test.js +44 -0
- package/lib/cjs/components/CopyText/CopyText.js +34 -11
- package/lib/cjs/components/FileInputField/FileItem.js +2 -1
- package/lib/cjs/components/IconButton/IconButton.js +1 -1
- package/lib/cjs/components/IconButton/IconButton.stories.js +8 -17
- package/lib/cjs/components/IconButton/IconButton.test.js +4 -5
- package/lib/cjs/components/ImageUploadField/ImagePreviewButton.js +2 -1
- package/lib/cjs/components/List/List.js +3 -0
- package/lib/cjs/components/List/List.stories.js +7 -2
- package/lib/cjs/components/ListBox/ListBox.js +3 -6
- package/lib/cjs/components/ListBox/ListBox.test.js +2 -0
- package/lib/cjs/components/ListBox/Option.js +6 -0
- package/lib/cjs/components/ListView/ListView.stories.js +580 -39
- package/lib/cjs/components/Messages/Message.js +2 -2
- package/lib/cjs/components/MultivaluesField/MultivaluesField.js +2 -1
- package/lib/cjs/components/OverlayPanel/OverlayPanel.stories.js +15 -14
- package/lib/cjs/components/PopoverContainer/PopoverContainer.test.js +15 -0
- package/lib/cjs/components/TextArea/TextArea.js +5 -1
- package/lib/cjs/components/TooltipTrigger/TooltipTrigger.js +10 -5
- package/lib/cjs/index.js +10 -0
- package/lib/cjs/styles/variants/accordion.js +2 -2
- package/lib/cjs/styles/variants/buttons.js +11 -1
- package/lib/cjs/styles/variants/codeView.js +80 -0
- package/lib/cjs/styles/variants/variants.js +3 -0
- package/lib/components/AccordionGridGroup/AccordionGridGroup.test.js +23 -1
- package/lib/components/AccordionGridItem/AccordionGridItemBody.js +1 -1
- package/lib/components/AccordionGridItem/AccordionGridItemHeader.js +1 -1
- package/lib/components/AccordionGroup/AccordionGroup.test.js +30 -1
- package/lib/components/AccordionItem/AccordionItem.js +6 -5
- package/lib/components/Button/Button.js +2 -3
- package/lib/components/Button/Button.stories.js +2 -1
- package/lib/components/Button/Button.test.js +2 -1
- package/lib/components/CodeView/CodeView.js +130 -0
- package/lib/components/CodeView/CodeView.stories.js +67 -0
- package/lib/components/CodeView/CodeView.test.js +171 -0
- package/lib/components/CodeView/index.js +1 -0
- package/lib/components/ColorField/ColorField.js +1 -0
- package/lib/components/ComboBoxField/ComboBoxField.js +7 -0
- package/lib/components/ComboBoxField/ComboBoxField.stories.js +21 -0
- package/lib/components/ComboBoxField/ComboBoxField.test.js +35 -0
- package/lib/components/CopyText/CopyText.js +35 -11
- package/lib/components/FileInputField/FileItem.js +2 -1
- package/lib/components/IconButton/IconButton.js +1 -1
- package/lib/components/IconButton/IconButton.stories.js +7 -13
- package/lib/components/IconButton/IconButton.test.js +4 -5
- package/lib/components/ImageUploadField/ImagePreviewButton.js +2 -1
- package/lib/components/List/List.js +2 -0
- package/lib/components/List/List.stories.js +6 -2
- package/lib/components/ListBox/ListBox.js +3 -5
- package/lib/components/ListBox/ListBox.test.js +2 -0
- package/lib/components/ListBox/Option.js +6 -0
- package/lib/components/ListView/ListView.stories.js +577 -39
- package/lib/components/Messages/Message.js +2 -2
- package/lib/components/MultivaluesField/MultivaluesField.js +2 -1
- package/lib/components/OverlayPanel/OverlayPanel.stories.js +7 -5
- package/lib/components/PopoverContainer/PopoverContainer.test.js +16 -1
- package/lib/components/TextArea/TextArea.js +5 -1
- package/lib/components/TooltipTrigger/TooltipTrigger.js +10 -5
- package/lib/index.js +1 -0
- package/lib/styles/variants/accordion.js +2 -2
- package/lib/styles/variants/buttons.js +11 -1
- package/lib/styles/variants/codeView.js +68 -0
- package/lib/styles/variants/variants.js +2 -0
- package/package.json +3 -1
@@ -1,6 +1,9 @@
|
|
1
|
+
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
|
1
2
|
import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
|
3
|
+
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
2
4
|
import _setTimeout from "@babel/runtime-corejs3/core-js-stable/set-timeout";
|
3
5
|
import _Promise from "@babel/runtime-corejs3/core-js-stable/promise";
|
6
|
+
import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/index-of";
|
4
7
|
import _asyncToGenerator from "@babel/runtime-corejs3/helpers/esm/asyncToGenerator";
|
5
8
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
6
9
|
import React from 'react';
|
@@ -55,6 +58,455 @@ var items = [{
|
|
55
58
|
name: 'Snake',
|
56
59
|
id: '3'
|
57
60
|
}];
|
61
|
+
var animals = [{
|
62
|
+
name: 'Aardvark'
|
63
|
+
}, {
|
64
|
+
name: 'Albatross'
|
65
|
+
}, {
|
66
|
+
name: 'Alligator'
|
67
|
+
}, {
|
68
|
+
name: 'Alpaca'
|
69
|
+
}, {
|
70
|
+
name: 'Ant'
|
71
|
+
}, {
|
72
|
+
name: 'Anteater'
|
73
|
+
}, {
|
74
|
+
name: 'Antelope'
|
75
|
+
}, {
|
76
|
+
name: 'Ape'
|
77
|
+
}, {
|
78
|
+
name: 'Armadillo'
|
79
|
+
}, {
|
80
|
+
name: 'Donkey'
|
81
|
+
}, {
|
82
|
+
name: 'Baboon'
|
83
|
+
}, {
|
84
|
+
name: 'Badger'
|
85
|
+
}, {
|
86
|
+
name: 'Barracuda'
|
87
|
+
}, {
|
88
|
+
name: 'Bat'
|
89
|
+
}, {
|
90
|
+
name: 'Bear'
|
91
|
+
}, {
|
92
|
+
name: 'Beaver'
|
93
|
+
}, {
|
94
|
+
name: 'Bee'
|
95
|
+
}, {
|
96
|
+
name: 'Bison'
|
97
|
+
}, {
|
98
|
+
name: 'Boar'
|
99
|
+
}, {
|
100
|
+
name: 'Buffalo'
|
101
|
+
}, {
|
102
|
+
name: 'Butterfly'
|
103
|
+
}, {
|
104
|
+
name: 'Camel'
|
105
|
+
}, {
|
106
|
+
name: 'Capybara'
|
107
|
+
}, {
|
108
|
+
name: 'Caribou'
|
109
|
+
}, {
|
110
|
+
name: 'Cassowary'
|
111
|
+
}, {
|
112
|
+
name: 'Cat'
|
113
|
+
}, {
|
114
|
+
name: 'Caterpillar'
|
115
|
+
}, {
|
116
|
+
name: 'Cattle'
|
117
|
+
}, {
|
118
|
+
name: 'Chamois'
|
119
|
+
}, {
|
120
|
+
name: 'Cheetah'
|
121
|
+
}, {
|
122
|
+
name: 'Chicken'
|
123
|
+
}, {
|
124
|
+
name: 'Chimpanzee'
|
125
|
+
}, {
|
126
|
+
name: 'Chinchilla'
|
127
|
+
}, {
|
128
|
+
name: 'Chough'
|
129
|
+
}, {
|
130
|
+
name: 'Clam'
|
131
|
+
}, {
|
132
|
+
name: 'Cobra'
|
133
|
+
}, {
|
134
|
+
name: 'Cockroach'
|
135
|
+
}, {
|
136
|
+
name: 'Cod'
|
137
|
+
}, {
|
138
|
+
name: 'Cormorant'
|
139
|
+
}, {
|
140
|
+
name: 'Coyote'
|
141
|
+
}, {
|
142
|
+
name: 'Crab'
|
143
|
+
}, {
|
144
|
+
name: 'Crane'
|
145
|
+
}, {
|
146
|
+
name: 'Crocodile'
|
147
|
+
}, {
|
148
|
+
name: 'Crow'
|
149
|
+
}, {
|
150
|
+
name: 'Curlew'
|
151
|
+
}, {
|
152
|
+
name: 'Deer'
|
153
|
+
}, {
|
154
|
+
name: 'Dinosaur'
|
155
|
+
}, {
|
156
|
+
name: 'Dog'
|
157
|
+
}, {
|
158
|
+
name: 'Dogfish'
|
159
|
+
}, {
|
160
|
+
name: 'Dolphin'
|
161
|
+
}, {
|
162
|
+
name: 'Dotterel'
|
163
|
+
}, {
|
164
|
+
name: 'Dove'
|
165
|
+
}, {
|
166
|
+
name: 'Dragonfly'
|
167
|
+
}, {
|
168
|
+
name: 'Duck'
|
169
|
+
}, {
|
170
|
+
name: 'Dugong'
|
171
|
+
}, {
|
172
|
+
name: 'Dunlin'
|
173
|
+
}, {
|
174
|
+
name: 'Eagle'
|
175
|
+
}, {
|
176
|
+
name: 'Echidna'
|
177
|
+
}, {
|
178
|
+
name: 'Eel'
|
179
|
+
}, {
|
180
|
+
name: 'Eland'
|
181
|
+
}, {
|
182
|
+
name: 'Elephant'
|
183
|
+
}, {
|
184
|
+
name: 'Elk'
|
185
|
+
}, {
|
186
|
+
name: 'Emu'
|
187
|
+
}, {
|
188
|
+
name: 'Falcon'
|
189
|
+
}, {
|
190
|
+
name: 'Ferret'
|
191
|
+
}, {
|
192
|
+
name: 'Finch'
|
193
|
+
}, {
|
194
|
+
name: 'Fish'
|
195
|
+
}, {
|
196
|
+
name: 'Flamingo'
|
197
|
+
}, {
|
198
|
+
name: 'Fly'
|
199
|
+
}, {
|
200
|
+
name: 'Fox'
|
201
|
+
}, {
|
202
|
+
name: 'Frog'
|
203
|
+
}, {
|
204
|
+
name: 'Gaur'
|
205
|
+
}, {
|
206
|
+
name: 'Gazelle'
|
207
|
+
}, {
|
208
|
+
name: 'Gerbil'
|
209
|
+
}, {
|
210
|
+
name: 'Giraffe'
|
211
|
+
}, {
|
212
|
+
name: 'Gnat'
|
213
|
+
}, {
|
214
|
+
name: 'Gnu'
|
215
|
+
}, {
|
216
|
+
name: 'Goat'
|
217
|
+
}, {
|
218
|
+
name: 'Goldfinch'
|
219
|
+
}, {
|
220
|
+
name: 'Goldfish'
|
221
|
+
}, {
|
222
|
+
name: 'Goose'
|
223
|
+
}, {
|
224
|
+
name: 'Gorilla'
|
225
|
+
}, {
|
226
|
+
name: 'Goshawk'
|
227
|
+
}, {
|
228
|
+
name: 'Grasshopper'
|
229
|
+
}, {
|
230
|
+
name: 'Grouse'
|
231
|
+
}, {
|
232
|
+
name: 'Guanaco'
|
233
|
+
}, {
|
234
|
+
name: 'Gull'
|
235
|
+
}, {
|
236
|
+
name: 'Hamster'
|
237
|
+
}, {
|
238
|
+
name: 'Hare'
|
239
|
+
}, {
|
240
|
+
name: 'Hawk'
|
241
|
+
}, {
|
242
|
+
name: 'Hedgehog'
|
243
|
+
}, {
|
244
|
+
name: 'Heron'
|
245
|
+
}, {
|
246
|
+
name: 'Herring'
|
247
|
+
}, {
|
248
|
+
name: 'Hippopotamus'
|
249
|
+
}, {
|
250
|
+
name: 'Hornet'
|
251
|
+
}, {
|
252
|
+
name: 'Horse'
|
253
|
+
}, {
|
254
|
+
name: 'Human'
|
255
|
+
}, {
|
256
|
+
name: 'Hummingbird'
|
257
|
+
}, {
|
258
|
+
name: 'Hyena'
|
259
|
+
}, {
|
260
|
+
name: 'Ibex'
|
261
|
+
}, {
|
262
|
+
name: 'Ibis'
|
263
|
+
}, {
|
264
|
+
name: 'Jackal'
|
265
|
+
}, {
|
266
|
+
name: 'Jaguar'
|
267
|
+
}, {
|
268
|
+
name: 'Jay'
|
269
|
+
}, {
|
270
|
+
name: 'Jellyfish'
|
271
|
+
}, {
|
272
|
+
name: 'Kangaroo'
|
273
|
+
}, {
|
274
|
+
name: 'Kingfisher'
|
275
|
+
}, {
|
276
|
+
name: 'Koala'
|
277
|
+
}, {
|
278
|
+
name: 'Kookabura'
|
279
|
+
}, {
|
280
|
+
name: 'Kouprey'
|
281
|
+
}, {
|
282
|
+
name: 'Kudu'
|
283
|
+
}, {
|
284
|
+
name: 'Lapwing'
|
285
|
+
}, {
|
286
|
+
name: 'Lark'
|
287
|
+
}, {
|
288
|
+
name: 'Lemur'
|
289
|
+
}, {
|
290
|
+
name: 'Leopard'
|
291
|
+
}, {
|
292
|
+
name: 'Lion'
|
293
|
+
}, {
|
294
|
+
name: 'Llama'
|
295
|
+
}, {
|
296
|
+
name: 'Lobster'
|
297
|
+
}, {
|
298
|
+
name: 'Locust'
|
299
|
+
}, {
|
300
|
+
name: 'Loris'
|
301
|
+
}, {
|
302
|
+
name: 'Louse'
|
303
|
+
}, {
|
304
|
+
name: 'Lyrebird'
|
305
|
+
}, {
|
306
|
+
name: 'Magpie'
|
307
|
+
}, {
|
308
|
+
name: 'Mallard'
|
309
|
+
}, {
|
310
|
+
name: 'Manatee'
|
311
|
+
}, {
|
312
|
+
name: 'Mandrill'
|
313
|
+
}, {
|
314
|
+
name: 'Mantis'
|
315
|
+
}, {
|
316
|
+
name: 'Marten'
|
317
|
+
}, {
|
318
|
+
name: 'Meerkat'
|
319
|
+
}, {
|
320
|
+
name: 'Mink'
|
321
|
+
}, {
|
322
|
+
name: 'Mole'
|
323
|
+
}, {
|
324
|
+
name: 'Mongoose'
|
325
|
+
}, {
|
326
|
+
name: 'Monkey'
|
327
|
+
}, {
|
328
|
+
name: 'Moose'
|
329
|
+
}, {
|
330
|
+
name: 'Mosquito'
|
331
|
+
}, {
|
332
|
+
name: 'Mouse'
|
333
|
+
}, {
|
334
|
+
name: 'Mule'
|
335
|
+
}, {
|
336
|
+
name: 'Narwhal'
|
337
|
+
}, {
|
338
|
+
name: 'Newt'
|
339
|
+
}, {
|
340
|
+
name: 'Nightingale'
|
341
|
+
}, {
|
342
|
+
name: 'Octopus'
|
343
|
+
}, {
|
344
|
+
name: 'Okapi'
|
345
|
+
}, {
|
346
|
+
name: 'Opossum'
|
347
|
+
}, {
|
348
|
+
name: 'Oryx'
|
349
|
+
}, {
|
350
|
+
name: 'Ostrich'
|
351
|
+
}, {
|
352
|
+
name: 'Otter'
|
353
|
+
}, {
|
354
|
+
name: 'Owl'
|
355
|
+
}, {
|
356
|
+
name: 'Oyster'
|
357
|
+
}, {
|
358
|
+
name: 'Panther'
|
359
|
+
}, {
|
360
|
+
name: 'Parrot'
|
361
|
+
}, {
|
362
|
+
name: 'Partridge'
|
363
|
+
}, {
|
364
|
+
name: 'Peafowl'
|
365
|
+
}, {
|
366
|
+
name: 'Pelican'
|
367
|
+
}, {
|
368
|
+
name: 'Penguin'
|
369
|
+
}, {
|
370
|
+
name: 'Pheasant'
|
371
|
+
}, {
|
372
|
+
name: 'Pig'
|
373
|
+
}, {
|
374
|
+
name: 'Pigeon'
|
375
|
+
}, {
|
376
|
+
name: 'Pony'
|
377
|
+
}, {
|
378
|
+
name: 'Porcupine'
|
379
|
+
}, {
|
380
|
+
name: 'Porpoise'
|
381
|
+
}, {
|
382
|
+
name: 'Quail'
|
383
|
+
}, {
|
384
|
+
name: 'Quelea'
|
385
|
+
}, {
|
386
|
+
name: 'Quetzal'
|
387
|
+
}, {
|
388
|
+
name: 'Rabbit'
|
389
|
+
}, {
|
390
|
+
name: 'Raccoon'
|
391
|
+
}, {
|
392
|
+
name: 'Rail'
|
393
|
+
}, {
|
394
|
+
name: 'Ram'
|
395
|
+
}, {
|
396
|
+
name: 'Rat'
|
397
|
+
}, {
|
398
|
+
name: 'Raven'
|
399
|
+
}, {
|
400
|
+
name: 'Red deer'
|
401
|
+
}, {
|
402
|
+
name: 'Red panda'
|
403
|
+
}, {
|
404
|
+
name: 'Reindeer'
|
405
|
+
}, {
|
406
|
+
name: 'Rhinoceros'
|
407
|
+
}, {
|
408
|
+
name: 'Rook'
|
409
|
+
}, {
|
410
|
+
name: 'Salamander'
|
411
|
+
}, {
|
412
|
+
name: 'Salmon'
|
413
|
+
}, {
|
414
|
+
name: 'Sand Dollar'
|
415
|
+
}, {
|
416
|
+
name: 'Sandpiper'
|
417
|
+
}, {
|
418
|
+
name: 'Sardine'
|
419
|
+
}, {
|
420
|
+
name: 'Scorpion'
|
421
|
+
}, {
|
422
|
+
name: 'Seahorse'
|
423
|
+
}, {
|
424
|
+
name: 'Seal'
|
425
|
+
}, {
|
426
|
+
name: 'Shark'
|
427
|
+
}, {
|
428
|
+
name: 'Sheep'
|
429
|
+
}, {
|
430
|
+
name: 'Shrew'
|
431
|
+
}, {
|
432
|
+
name: 'Skunk'
|
433
|
+
}, {
|
434
|
+
name: 'Snail'
|
435
|
+
}, {
|
436
|
+
name: 'Snake'
|
437
|
+
}, {
|
438
|
+
name: 'Sparrow'
|
439
|
+
}, {
|
440
|
+
name: 'Spider'
|
441
|
+
}, {
|
442
|
+
name: 'Spoonbill'
|
443
|
+
}, {
|
444
|
+
name: 'Squid'
|
445
|
+
}, {
|
446
|
+
name: 'Squirrel'
|
447
|
+
}, {
|
448
|
+
name: 'Starling'
|
449
|
+
}, {
|
450
|
+
name: 'Stingray'
|
451
|
+
}, {
|
452
|
+
name: 'Stinkbug'
|
453
|
+
}, {
|
454
|
+
name: 'Stork'
|
455
|
+
}, {
|
456
|
+
name: 'Swallow'
|
457
|
+
}, {
|
458
|
+
name: 'Swan'
|
459
|
+
}, {
|
460
|
+
name: 'Tapir'
|
461
|
+
}, {
|
462
|
+
name: 'Tarsier'
|
463
|
+
}, {
|
464
|
+
name: 'Termite'
|
465
|
+
}, {
|
466
|
+
name: 'Tiger'
|
467
|
+
}, {
|
468
|
+
name: 'Toad'
|
469
|
+
}, {
|
470
|
+
name: 'Trout'
|
471
|
+
}, {
|
472
|
+
name: 'Turkey'
|
473
|
+
}, {
|
474
|
+
name: 'Turtle'
|
475
|
+
}, {
|
476
|
+
name: 'Viper'
|
477
|
+
}, {
|
478
|
+
name: 'Vulture'
|
479
|
+
}, {
|
480
|
+
name: 'Wallaby'
|
481
|
+
}, {
|
482
|
+
name: 'Walrus'
|
483
|
+
}, {
|
484
|
+
name: 'Wasp'
|
485
|
+
}, {
|
486
|
+
name: 'Weasel'
|
487
|
+
}, {
|
488
|
+
name: 'Whale'
|
489
|
+
}, {
|
490
|
+
name: 'Wildcat'
|
491
|
+
}, {
|
492
|
+
name: 'Wolf'
|
493
|
+
}, {
|
494
|
+
name: 'Wolverine'
|
495
|
+
}, {
|
496
|
+
name: 'Wombat'
|
497
|
+
}, {
|
498
|
+
name: 'Woodcock'
|
499
|
+
}, {
|
500
|
+
name: 'Woodpecker'
|
501
|
+
}, {
|
502
|
+
name: 'Worm'
|
503
|
+
}, {
|
504
|
+
name: 'Wren'
|
505
|
+
}, {
|
506
|
+
name: 'Yak'
|
507
|
+
}, {
|
508
|
+
name: 'Zebra'
|
509
|
+
}];
|
58
510
|
var props = {
|
59
511
|
disabledKeys: ['Snake']
|
60
512
|
};
|
@@ -129,61 +581,140 @@ export var Default = function Default(_ref2) {
|
|
129
581
|
});
|
130
582
|
};
|
131
583
|
export var InfiniteLoadingList = function InfiniteLoadingList() {
|
584
|
+
var getMockData = /*#__PURE__*/function () {
|
585
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(signal, cursor) {
|
586
|
+
var pageNumber;
|
587
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
588
|
+
while (1) {
|
589
|
+
switch (_context.prev = _context.next) {
|
590
|
+
case 0:
|
591
|
+
pageNumber = 1;
|
592
|
+
|
593
|
+
if (cursor) {
|
594
|
+
pageNumber = Number(cursor.substr(_indexOfInstanceProperty(cursor).call(cursor, '-') + 1));
|
595
|
+
} // With this we will emulate load even with mocked API
|
596
|
+
|
597
|
+
|
598
|
+
_context.next = 4;
|
599
|
+
return new _Promise(function (resolve) {
|
600
|
+
return _setTimeout(resolve, cursor ? 2000 : 3000);
|
601
|
+
});
|
602
|
+
|
603
|
+
case 4:
|
604
|
+
return _context.abrupt("return", {
|
605
|
+
items: _sliceInstanceProperty(animals).call(animals, (pageNumber - 1) * 10, pageNumber * 10),
|
606
|
+
cursor: "mock-".concat(pageNumber + 1)
|
607
|
+
});
|
608
|
+
|
609
|
+
case 5:
|
610
|
+
case "end":
|
611
|
+
return _context.stop();
|
612
|
+
}
|
613
|
+
}
|
614
|
+
}, _callee);
|
615
|
+
}));
|
616
|
+
|
617
|
+
return function getMockData(_x, _x2) {
|
618
|
+
return _ref3.apply(this, arguments);
|
619
|
+
};
|
620
|
+
}();
|
621
|
+
|
622
|
+
var fetchApiData = /*#__PURE__*/function () {
|
623
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(signal, cursor, filterText) {
|
624
|
+
var res, json;
|
625
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
626
|
+
while (1) {
|
627
|
+
switch (_context2.prev = _context2.next) {
|
628
|
+
case 0:
|
629
|
+
_context2.prev = 0;
|
630
|
+
_context2.next = 3;
|
631
|
+
return _Promise.race([// If no cursor is available, then we're loading the first page,
|
632
|
+
// filtering the results returned via a query string that
|
633
|
+
// mirrors the ComboBox input text.
|
634
|
+
// Otherwise, the cursor is the next URL to load,
|
635
|
+
// as returned from the previous page.
|
636
|
+
fetch(cursor || "https://swapi.dev/api/people/?search=".concat(filterText), {
|
637
|
+
signal: signal
|
638
|
+
}), new _Promise(function (_resolve, reject) {
|
639
|
+
return _setTimeout(function () {
|
640
|
+
return reject(new Error('timeout'));
|
641
|
+
}, 3000);
|
642
|
+
})]);
|
643
|
+
|
644
|
+
case 3:
|
645
|
+
res = _context2.sent;
|
646
|
+
_context2.next = 6;
|
647
|
+
return res.json();
|
648
|
+
|
649
|
+
case 6:
|
650
|
+
json = _context2.sent;
|
651
|
+
_context2.next = 9;
|
652
|
+
return new _Promise(function (resolve) {
|
653
|
+
return _setTimeout(resolve, cursor ? 2000 : 3000);
|
654
|
+
});
|
655
|
+
|
656
|
+
case 9:
|
657
|
+
return _context2.abrupt("return", {
|
658
|
+
items: json.results,
|
659
|
+
cursor: json.next
|
660
|
+
});
|
661
|
+
|
662
|
+
case 12:
|
663
|
+
_context2.prev = 12;
|
664
|
+
_context2.t0 = _context2["catch"](0);
|
665
|
+
return _context2.abrupt("return", getMockData());
|
666
|
+
|
667
|
+
case 15:
|
668
|
+
case "end":
|
669
|
+
return _context2.stop();
|
670
|
+
}
|
671
|
+
}
|
672
|
+
}, _callee2, null, [[0, 12]]);
|
673
|
+
}));
|
674
|
+
|
675
|
+
return function fetchApiData(_x3, _x4, _x5) {
|
676
|
+
return _ref4.apply(this, arguments);
|
677
|
+
};
|
678
|
+
}();
|
679
|
+
|
132
680
|
var list = useAsyncList({
|
133
|
-
load: function load(
|
134
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
135
|
-
var signal, cursor, filterText
|
136
|
-
return _regeneratorRuntime.wrap(function
|
681
|
+
load: function load(_ref5) {
|
682
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
683
|
+
var signal, cursor, filterText;
|
684
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
137
685
|
while (1) {
|
138
|
-
switch (
|
686
|
+
switch (_context3.prev = _context3.next) {
|
139
687
|
case 0:
|
140
|
-
signal =
|
688
|
+
signal = _ref5.signal, cursor = _ref5.cursor, filterText = _ref5.filterText;
|
141
689
|
|
142
690
|
if (cursor) {
|
143
691
|
// eslint-disable-next-line
|
144
|
-
cursor = cursor.replace(/^http:\/\//i,
|
145
|
-
} //
|
146
|
-
// filtering the results returned via a query string that
|
147
|
-
// mirrors the ComboBox input text.
|
148
|
-
// Otherwise, the cursor is the next URL to load,
|
149
|
-
// as returned from the previous page.
|
692
|
+
cursor = cursor.replace(/^http:\/\//i, "https://");
|
693
|
+
} // check if we are mocking pages
|
150
694
|
|
151
695
|
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
}
|
696
|
+
if (!(cursor && _includesInstanceProperty(cursor).call(cursor, 'mock'))) {
|
697
|
+
_context3.next = 4;
|
698
|
+
break;
|
699
|
+
}
|
700
|
+
|
701
|
+
return _context3.abrupt("return", getMockData(signal, cursor, filterText));
|
156
702
|
|
157
703
|
case 4:
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
case 7:
|
163
|
-
json = _context.sent;
|
164
|
-
_context.next = 10;
|
165
|
-
return new _Promise(function (resolve) {
|
166
|
-
return _setTimeout(resolve, cursor ? 2000 : 3000);
|
167
|
-
});
|
168
|
-
|
169
|
-
case 10:
|
170
|
-
return _context.abrupt("return", {
|
171
|
-
items: json.results,
|
172
|
-
cursor: json.next
|
173
|
-
});
|
174
|
-
|
175
|
-
case 11:
|
704
|
+
return _context3.abrupt("return", fetchApiData(signal, cursor, filterText));
|
705
|
+
|
706
|
+
case 5:
|
176
707
|
case "end":
|
177
|
-
return
|
708
|
+
return _context3.stop();
|
178
709
|
}
|
179
710
|
}
|
180
|
-
},
|
711
|
+
}, _callee3);
|
181
712
|
}))();
|
182
713
|
}
|
183
714
|
});
|
184
715
|
return ___EmotionJSX(Box, {
|
185
716
|
sx: {
|
186
|
-
maxHeight: '
|
717
|
+
maxHeight: '400px'
|
187
718
|
}
|
188
719
|
}, ___EmotionJSX(ListView, _extends({}, actions, {
|
189
720
|
items: list.items,
|
@@ -198,8 +729,15 @@ export var InfiniteLoadingList = function InfiniteLoadingList() {
|
|
198
729
|
}));
|
199
730
|
}));
|
200
731
|
};
|
201
|
-
|
202
|
-
|
732
|
+
InfiniteLoadingList.parameters = {
|
733
|
+
docs: {
|
734
|
+
description: {
|
735
|
+
story: 'Note: Keep in mind the maxHeight may impact when the scroll callback is triggered. If you notice it\'s being called too often, try adjusting that value or loading more objects to prevent this behavior.'
|
736
|
+
}
|
737
|
+
}
|
738
|
+
};
|
739
|
+
export var MultipleSelection = function MultipleSelection(_ref6) {
|
740
|
+
var args = _extends({}, _ref6);
|
203
741
|
|
204
742
|
return ___EmotionJSX(ListView, _extends({}, props, args, {
|
205
743
|
items: items,
|
@@ -20,8 +20,8 @@ import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
20
20
|
export var icons = {
|
21
21
|
"default": AlertCircleOutlineIcon,
|
22
22
|
success: CheckCircleIcon,
|
23
|
-
error:
|
24
|
-
warning:
|
23
|
+
error: AlertCircleIcon,
|
24
|
+
warning: AlertCircleOutlineIcon
|
25
25
|
};
|
26
26
|
|
27
27
|
var CloseButton = function CloseButton(_ref) {
|
@@ -311,7 +311,8 @@ var MultivaluesField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
311
311
|
hasAutoFocus: hasAutoFocus,
|
312
312
|
hasVirtualFocus: true,
|
313
313
|
hasNoEmptySelection: true,
|
314
|
-
state: state
|
314
|
+
state: state,
|
315
|
+
"aria-label": "List of options"
|
315
316
|
})), ___EmotionJSX(DismissButton, {
|
316
317
|
onDismiss: close
|
317
318
|
}));
|
@@ -3,9 +3,8 @@ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
|
3
3
|
import React, { useState } from 'react';
|
4
4
|
import { Item } from '@react-stately/collections';
|
5
5
|
import { useOverlayPanelState } from '../../hooks';
|
6
|
-
import Button from '../Button/Button';
|
7
6
|
import OverlayPanel from './OverlayPanel';
|
8
|
-
import { OverlayProvider, Box, Text, List, ListItem, Separator, Messages } from '../../index';
|
7
|
+
import { OverlayProvider, Box, Text, List, ListItem, Separator, Messages, Button, AccordionGroup } from '../../index';
|
9
8
|
import { panelSizes } from '../../utils/devUtils/constants/panelSizes';
|
10
9
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
11
10
|
export default {
|
@@ -47,9 +46,12 @@ export var Default = function Default(_ref) {
|
|
47
46
|
isOpen: state.isOpen
|
48
47
|
}, args), ___EmotionJSX(Box, null, ___EmotionJSX(Button, {
|
49
48
|
onPress: state.close
|
50
|
-
}, "Close Panel"), ___EmotionJSX(
|
51
|
-
|
52
|
-
|
49
|
+
}, "Close Panel"), ___EmotionJSX(AccordionGroup, args, ___EmotionJSX(Item, {
|
50
|
+
key: "accordionKey",
|
51
|
+
textValue: "accordionKey",
|
52
|
+
label: "Accordion Label",
|
53
|
+
"data-id": "accordionItem"
|
54
|
+
}, ___EmotionJSX(Text, null, "Render me!"))))))
|
53
55
|
);
|
54
56
|
};
|
55
57
|
export var InnerPanel = function InnerPanel(_ref2) {
|