@coorpacademy/components 11.19.0 → 11.19.1-alpha.10

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 (165) hide show
  1. package/es/atom/button-link/index.js +2 -2
  2. package/es/atom/button-link/index.js.map +1 -1
  3. package/es/atom/button-link/style.css +1 -0
  4. package/es/atom/drag-and-drop/index.d.ts +1 -0
  5. package/es/atom/drag-and-drop/index.d.ts.map +1 -1
  6. package/es/atom/drag-and-drop/index.js +24 -6
  7. package/es/atom/drag-and-drop/index.js.map +1 -1
  8. package/es/atom/drag-and-drop/style.css +22 -7
  9. package/es/atom/{image-upload → input-file-draggable}/index.d.ts +10 -5
  10. package/es/atom/input-file-draggable/index.d.ts.map +1 -0
  11. package/es/atom/{image-upload → input-file-draggable}/index.js +34 -11
  12. package/es/atom/input-file-draggable/index.js.map +1 -0
  13. package/es/atom/input-file-draggable/style.css +81 -0
  14. package/es/atom/video-upload/index.d.ts +1 -0
  15. package/es/molecule/brand-form-group/index.js +5 -5
  16. package/es/molecule/brand-form-group/index.js.map +1 -1
  17. package/es/molecule/cm-popin/index.d.ts.map +1 -1
  18. package/es/molecule/cm-popin/index.js +27 -20
  19. package/es/molecule/cm-popin/index.js.map +1 -1
  20. package/es/molecule/cm-popin/style.css +111 -72
  21. package/es/molecule/cm-popin/types.d.ts +182 -5
  22. package/es/molecule/cm-popin/types.d.ts.map +1 -1
  23. package/es/molecule/cm-popin/types.js +5 -3
  24. package/es/molecule/cm-popin/types.js.map +1 -1
  25. package/es/molecule/drag-and-drop-wrapper/index.d.ts +2 -1
  26. package/es/molecule/drag-and-drop-wrapper/index.js +3 -3
  27. package/es/molecule/drag-and-drop-wrapper/index.js.map +1 -1
  28. package/es/molecule/setup-slider/index.js +3 -3
  29. package/es/molecule/setup-slider/index.js.map +1 -1
  30. package/es/molecule/title-and-checkbox-wrapper/index.d.ts +2 -1
  31. package/es/molecule/title-radio-wrapper/index.d.ts +18 -17
  32. package/es/molecule/title-radio-wrapper/index.d.ts.map +1 -1
  33. package/es/molecule/title-radio-wrapper/index.js +2 -2
  34. package/es/molecule/title-radio-wrapper/index.js.map +1 -1
  35. package/es/molecule/title-radio-wrapper/types.d.ts +20 -19
  36. package/es/molecule/title-radio-wrapper/types.d.ts.map +1 -1
  37. package/es/molecule/title-radio-wrapper/types.js +2 -2
  38. package/es/molecule/title-radio-wrapper/types.js.map +1 -1
  39. package/es/organism/list-item/index.d.ts.map +1 -1
  40. package/es/organism/list-item/index.js +2 -5
  41. package/es/organism/list-item/index.js.map +1 -1
  42. package/es/organism/list-item/style.css +3 -7
  43. package/es/organism/list-items/index.d.ts.map +1 -1
  44. package/es/organism/list-items/index.js +1 -3
  45. package/es/organism/list-items/index.js.map +1 -1
  46. package/es/organism/list-items/style.css +1 -4
  47. package/es/organism/rewards-form/index.d.ts +2 -1
  48. package/es/organism/select-opponents/index.d.ts +18 -17
  49. package/es/organism/select-opponents/index.d.ts.map +1 -1
  50. package/es/organism/select-opponents/types.d.ts +18 -17
  51. package/es/organism/select-opponents/types.d.ts.map +1 -1
  52. package/es/organism/setup-header/style.css +3 -1
  53. package/es/organism/title-and-input/index.d.ts +18 -17
  54. package/es/organism/title-and-input/index.d.ts.map +1 -1
  55. package/es/organism/title-and-input/types.d.ts +18 -17
  56. package/es/organism/title-and-input/types.d.ts.map +1 -1
  57. package/es/organism/wizard-contents/index.d.ts +2 -1
  58. package/es/template/app-player/loading/index.d.ts +178 -2
  59. package/es/template/app-player/player/index.d.ts +356 -4
  60. package/es/template/app-player/player/slides/index.d.ts +178 -2
  61. package/es/template/app-player/player/slides/index.d.ts.map +1 -1
  62. package/es/template/app-player/popin-correction/index.d.ts +178 -2
  63. package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
  64. package/es/template/app-player/popin-end/index.d.ts +178 -2
  65. package/es/template/app-review/index.d.ts +178 -2
  66. package/es/template/app-review/index.d.ts.map +1 -1
  67. package/es/template/app-review/player/prop-types.d.ts +178 -2
  68. package/es/template/app-review/player/prop-types.d.ts.map +1 -1
  69. package/es/template/app-review/prop-types.d.ts +178 -2
  70. package/es/template/app-review/prop-types.d.ts.map +1 -1
  71. package/es/template/back-office/brand-update/index.d.ts +178 -2
  72. package/es/template/cockpit/jw-uploader/index.d.ts +1 -0
  73. package/es/template/common/dashboard/index.d.ts +356 -4
  74. package/es/template/common/search-page/index.d.ts +178 -2
  75. package/es/template/external-course/index.d.ts +178 -2
  76. package/es/util/proptypes.d.ts +1 -1
  77. package/es/util/proptypes.d.ts.map +1 -1
  78. package/es/util/proptypes.js +6 -5
  79. package/es/util/proptypes.js.map +1 -1
  80. package/lib/atom/button-link/index.js +2 -2
  81. package/lib/atom/button-link/index.js.map +1 -1
  82. package/lib/atom/button-link/style.css +1 -0
  83. package/lib/atom/drag-and-drop/index.d.ts +1 -0
  84. package/lib/atom/drag-and-drop/index.d.ts.map +1 -1
  85. package/lib/atom/drag-and-drop/index.js +24 -6
  86. package/lib/atom/drag-and-drop/index.js.map +1 -1
  87. package/lib/atom/drag-and-drop/style.css +22 -7
  88. package/lib/atom/{image-upload → input-file-draggable}/index.d.ts +10 -5
  89. package/lib/atom/input-file-draggable/index.d.ts.map +1 -0
  90. package/lib/atom/{image-upload → input-file-draggable}/index.js +34 -10
  91. package/lib/atom/input-file-draggable/index.js.map +1 -0
  92. package/lib/atom/input-file-draggable/style.css +81 -0
  93. package/lib/atom/video-upload/index.d.ts +1 -0
  94. package/lib/molecule/brand-form-group/index.js +5 -5
  95. package/lib/molecule/brand-form-group/index.js.map +1 -1
  96. package/lib/molecule/cm-popin/index.d.ts.map +1 -1
  97. package/lib/molecule/cm-popin/index.js +29 -19
  98. package/lib/molecule/cm-popin/index.js.map +1 -1
  99. package/lib/molecule/cm-popin/style.css +111 -72
  100. package/lib/molecule/cm-popin/types.d.ts +182 -5
  101. package/lib/molecule/cm-popin/types.d.ts.map +1 -1
  102. package/lib/molecule/cm-popin/types.js +6 -3
  103. package/lib/molecule/cm-popin/types.js.map +1 -1
  104. package/lib/molecule/drag-and-drop-wrapper/index.d.ts +2 -1
  105. package/lib/molecule/drag-and-drop-wrapper/index.js +3 -3
  106. package/lib/molecule/drag-and-drop-wrapper/index.js.map +1 -1
  107. package/lib/molecule/setup-slider/index.js +3 -3
  108. package/lib/molecule/setup-slider/index.js.map +1 -1
  109. package/lib/molecule/title-and-checkbox-wrapper/index.d.ts +2 -1
  110. package/lib/molecule/title-radio-wrapper/index.d.ts +18 -17
  111. package/lib/molecule/title-radio-wrapper/index.d.ts.map +1 -1
  112. package/lib/molecule/title-radio-wrapper/index.js +2 -2
  113. package/lib/molecule/title-radio-wrapper/index.js.map +1 -1
  114. package/lib/molecule/title-radio-wrapper/types.d.ts +20 -19
  115. package/lib/molecule/title-radio-wrapper/types.d.ts.map +1 -1
  116. package/lib/molecule/title-radio-wrapper/types.js +2 -2
  117. package/lib/molecule/title-radio-wrapper/types.js.map +1 -1
  118. package/lib/organism/list-item/index.d.ts.map +1 -1
  119. package/lib/organism/list-item/index.js +3 -5
  120. package/lib/organism/list-item/index.js.map +1 -1
  121. package/lib/organism/list-item/style.css +3 -7
  122. package/lib/organism/list-items/index.d.ts.map +1 -1
  123. package/lib/organism/list-items/index.js +1 -3
  124. package/lib/organism/list-items/index.js.map +1 -1
  125. package/lib/organism/list-items/style.css +1 -4
  126. package/lib/organism/rewards-form/index.d.ts +2 -1
  127. package/lib/organism/select-opponents/index.d.ts +18 -17
  128. package/lib/organism/select-opponents/index.d.ts.map +1 -1
  129. package/lib/organism/select-opponents/types.d.ts +18 -17
  130. package/lib/organism/select-opponents/types.d.ts.map +1 -1
  131. package/lib/organism/setup-header/style.css +3 -1
  132. package/lib/organism/title-and-input/index.d.ts +18 -17
  133. package/lib/organism/title-and-input/index.d.ts.map +1 -1
  134. package/lib/organism/title-and-input/types.d.ts +18 -17
  135. package/lib/organism/title-and-input/types.d.ts.map +1 -1
  136. package/lib/organism/wizard-contents/index.d.ts +2 -1
  137. package/lib/template/app-player/loading/index.d.ts +178 -2
  138. package/lib/template/app-player/player/index.d.ts +356 -4
  139. package/lib/template/app-player/player/slides/index.d.ts +178 -2
  140. package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
  141. package/lib/template/app-player/popin-correction/index.d.ts +178 -2
  142. package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
  143. package/lib/template/app-player/popin-end/index.d.ts +178 -2
  144. package/lib/template/app-review/index.d.ts +178 -2
  145. package/lib/template/app-review/index.d.ts.map +1 -1
  146. package/lib/template/app-review/player/prop-types.d.ts +178 -2
  147. package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
  148. package/lib/template/app-review/prop-types.d.ts +178 -2
  149. package/lib/template/app-review/prop-types.d.ts.map +1 -1
  150. package/lib/template/back-office/brand-update/index.d.ts +178 -2
  151. package/lib/template/cockpit/jw-uploader/index.d.ts +1 -0
  152. package/lib/template/common/dashboard/index.d.ts +356 -4
  153. package/lib/template/common/search-page/index.d.ts +178 -2
  154. package/lib/template/external-course/index.d.ts +178 -2
  155. package/lib/util/proptypes.d.ts +1 -1
  156. package/lib/util/proptypes.d.ts.map +1 -1
  157. package/lib/util/proptypes.js +10 -7
  158. package/lib/util/proptypes.js.map +1 -1
  159. package/package.json +2 -2
  160. package/es/atom/image-upload/index.d.ts.map +0 -1
  161. package/es/atom/image-upload/index.js.map +0 -1
  162. package/es/atom/image-upload/style.css +0 -28
  163. package/lib/atom/image-upload/index.d.ts.map +0 -1
  164. package/lib/atom/image-upload/index.js.map +0 -1
  165. package/lib/atom/image-upload/style.css +0 -28
@@ -221,6 +221,7 @@ declare namespace SearchPage {
221
221
  backgroundImageUrl: PropTypes.Requireable<string>;
222
222
  descriptionText: PropTypes.Requireable<string>;
223
223
  cookieTitle: PropTypes.Requireable<string>;
224
+ headerSubtitle: PropTypes.Requireable<string>;
224
225
  descriptionBtnTxt: PropTypes.Requireable<string>;
225
226
  listBtnSwicth: PropTypes.Requireable<(PropTypes.InferProps<{
226
227
  title: PropTypes.Requireable<string>;
@@ -241,10 +242,185 @@ declare namespace SearchPage {
241
242
  }> | null | undefined)[]>;
242
243
  items: PropTypes.Requireable<PropTypes.InferProps<{
243
244
  type: PropTypes.Requireable<string>;
244
- list: PropTypes.Requireable<PropTypes.InferProps<{
245
+ list: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
245
246
  list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
246
247
  loading: PropTypes.Requireable<boolean>;
247
- }>>;
248
+ }> | PropTypes.InferProps<{
249
+ 'aria-label': PropTypes.Requireable<string>;
250
+ buttonLink: PropTypes.Requireable<PropTypes.InferProps<{
251
+ type: PropTypes.Requireable<string>;
252
+ label: PropTypes.Requireable<string>;
253
+ 'aria-label': PropTypes.Requireable<string>;
254
+ 'data-name': PropTypes.Requireable<string>;
255
+ 'data-testid': PropTypes.Requireable<string>;
256
+ icon: PropTypes.Requireable<PropTypes.InferProps<{
257
+ position: PropTypes.Requireable<string>;
258
+ type: PropTypes.Requireable<string>;
259
+ }>>;
260
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
261
+ link: PropTypes.Requireable<PropTypes.InferProps<{
262
+ href: PropTypes.Requireable<string>;
263
+ download: PropTypes.Requireable<boolean>;
264
+ target: PropTypes.Requireable<string>;
265
+ }>>;
266
+ disabled: PropTypes.Requireable<boolean>;
267
+ className: PropTypes.Requireable<string>;
268
+ customStyle: PropTypes.Requireable<PropTypes.InferProps<{}>>;
269
+ }>>;
270
+ selectMultiple: PropTypes.Requireable<PropTypes.InferProps<{
271
+ title: PropTypes.Requireable<string>;
272
+ placeholder: PropTypes.Requireable<string>;
273
+ description: PropTypes.Requireable<string>;
274
+ hint: PropTypes.Requireable<string>;
275
+ options: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
276
+ selected: PropTypes.Validator<boolean>;
277
+ name: PropTypes.Validator<string>;
278
+ value: PropTypes.Requireable<string>;
279
+ }>>[]>;
280
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
281
+ onError: PropTypes.Requireable<(...args: any[]) => any>;
282
+ multiple: PropTypes.Requireable<boolean>;
283
+ modified: PropTypes.Requireable<boolean>;
284
+ disabled: PropTypes.Requireable<boolean>;
285
+ error: PropTypes.Requireable<string>;
286
+ theme: PropTypes.Requireable<string>;
287
+ }>>;
288
+ content: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
289
+ items: PropTypes.Requireable<(PropTypes.InferProps<{
290
+ title: PropTypes.Validator<string>;
291
+ dataColumns: PropTypes.Requireable<(PropTypes.InferProps<{
292
+ label: PropTypes.Requireable<string>;
293
+ type: PropTypes.Requireable<string>;
294
+ className: PropTypes.Requireable<string>;
295
+ }> | null | undefined)[]>;
296
+ buttonLink: PropTypes.Requireable<PropTypes.InferProps<{
297
+ type: PropTypes.Requireable<string>;
298
+ label: PropTypes.Requireable<string>;
299
+ ariaLabel: PropTypes.Requireable<string>;
300
+ dataName: PropTypes.Requireable<string>;
301
+ icon: PropTypes.Requireable<PropTypes.InferProps<{
302
+ position: PropTypes.Requireable<string>;
303
+ type: PropTypes.Requireable<string>;
304
+ }>>;
305
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
306
+ }>>;
307
+ buttonLinkIcon: PropTypes.Requireable<PropTypes.InferProps<{
308
+ size: PropTypes.Requireable<string>;
309
+ 'aria-label': PropTypes.Requireable<string>;
310
+ 'data-name': PropTypes.Requireable<string>;
311
+ icon: PropTypes.Requireable<string>;
312
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
313
+ link: PropTypes.Requireable<PropTypes.InferProps<{
314
+ href: PropTypes.Requireable<string>;
315
+ download: PropTypes.Requireable<boolean>;
316
+ target: PropTypes.Requireable<string>;
317
+ }>>;
318
+ disabled: PropTypes.Requireable<boolean>;
319
+ className: PropTypes.Requireable<string>;
320
+ }>>;
321
+ bulletPointMenuButton: PropTypes.Requireable<PropTypes.InferProps<{
322
+ buttonAriaLabel: PropTypes.Requireable<string>;
323
+ menuAriaLabel: PropTypes.Requireable<string>;
324
+ buttons: PropTypes.Requireable<(PropTypes.InferProps<{
325
+ 'data-name': PropTypes.Requireable<string>;
326
+ label: PropTypes.Requireable<string>;
327
+ type: PropTypes.Requireable<string>;
328
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
329
+ }> | null | undefined)[]>;
330
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
331
+ }>>;
332
+ tags: PropTypes.Requireable<(PropTypes.InferProps<{
333
+ label: PropTypes.Requireable<string>;
334
+ type: PropTypes.Requireable<string>;
335
+ }> | null | undefined)[]>;
336
+ isBulkStyle: PropTypes.Requireable<boolean>;
337
+ order: PropTypes.Requireable<number>;
338
+ 'aria-label': PropTypes.Requireable<string>;
339
+ contentType: PropTypes.Requireable<string>;
340
+ id: PropTypes.Requireable<string>;
341
+ }> | null | undefined)[]>;
342
+ type: PropTypes.Requireable<string>;
343
+ itemType: PropTypes.Requireable<string>;
344
+ onDrop: PropTypes.Requireable<(...args: any[]) => any>;
345
+ isDraggable: PropTypes.Requireable<boolean>;
346
+ tableHeader: PropTypes.Requireable<(string | null | undefined)[]>;
347
+ }> | PropTypes.InferProps<{
348
+ type: PropTypes.Requireable<string>;
349
+ columns: PropTypes.Requireable<(PropTypes.InferProps<{
350
+ title: PropTypes.Validator<string>;
351
+ }> | null | undefined)[]>;
352
+ rows: PropTypes.Requireable<(PropTypes.InferProps<{
353
+ fields: PropTypes.Requireable<(NonNullable<string | PropTypes.InferProps<{
354
+ type: PropTypes.Requireable<string>;
355
+ current: PropTypes.Requireable<boolean>;
356
+ selected: PropTypes.Requireable<boolean>;
357
+ icon: PropTypes.Requireable<string>;
358
+ value: PropTypes.Requireable<string>;
359
+ }> | null | undefined> | null | undefined)[]>;
360
+ isRowExpandible: PropTypes.Requireable<boolean>;
361
+ lastField: PropTypes.Requireable<NonNullable<string | PropTypes.InferProps<{
362
+ type: PropTypes.Requireable<string>;
363
+ disabled: PropTypes.Requireable<boolean>;
364
+ buttonAriaLabel: PropTypes.Requireable<string>;
365
+ menuAriaLabel: PropTypes.Requireable<string>;
366
+ buttons: PropTypes.Validator<(PropTypes.InferProps<{
367
+ 'data-name': PropTypes.Requireable<string>;
368
+ disabled: PropTypes.Requireable<boolean>;
369
+ label: PropTypes.Validator<string>;
370
+ onClick: PropTypes.Validator<(...args: any[]) => any>;
371
+ type: PropTypes.Requireable<string>;
372
+ }> | null | undefined)[]>;
373
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
374
+ menuButtonClassName: PropTypes.Requireable<string>;
375
+ isBulkMenu: PropTypes.Requireable<boolean>;
376
+ }> | null | undefined>>;
377
+ }> | null | undefined)[]>;
378
+ stickyFirstColumn: PropTypes.Requireable<boolean>;
379
+ stickyLastColumn: PropTypes.Requireable<boolean>;
380
+ columnWidth: PropTypes.Requireable<string>;
381
+ ariaDescribedby: PropTypes.Requireable<string>;
382
+ lastField: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
383
+ componentType: PropTypes.Requireable<string>;
384
+ type: PropTypes.Requireable<string>;
385
+ label: PropTypes.Requireable<string>;
386
+ 'aria-label': PropTypes.Requireable<string>;
387
+ 'data-name': PropTypes.Requireable<string>;
388
+ 'data-testid': PropTypes.Requireable<string>;
389
+ icon: PropTypes.Requireable<PropTypes.InferProps<{
390
+ position: PropTypes.Requireable<string>;
391
+ type: PropTypes.Requireable<string>;
392
+ }>>;
393
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
394
+ link: PropTypes.Requireable<PropTypes.InferProps<{
395
+ href: PropTypes.Requireable<string>;
396
+ download: PropTypes.Requireable<boolean>;
397
+ target: PropTypes.Requireable<string>;
398
+ }>>;
399
+ disabled: PropTypes.Requireable<boolean>;
400
+ className: PropTypes.Requireable<string>;
401
+ customStyle: PropTypes.Requireable<PropTypes.InferProps<{}>>;
402
+ }> | PropTypes.InferProps<{
403
+ componentType: PropTypes.Requireable<string>;
404
+ disabled: PropTypes.Requireable<boolean>;
405
+ buttonAriaLabel: PropTypes.Requireable<string>;
406
+ menuAriaLabel: PropTypes.Requireable<string>;
407
+ buttons: PropTypes.Validator<(PropTypes.InferProps<{
408
+ 'data-name': PropTypes.Requireable<string>;
409
+ disabled: PropTypes.Requireable<boolean>;
410
+ label: PropTypes.Validator<string>;
411
+ onClick: PropTypes.Validator<(...args: any[]) => any>;
412
+ type: PropTypes.Requireable<string>;
413
+ }> | null | undefined)[]>;
414
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
415
+ menuButtonClassName: PropTypes.Requireable<string>;
416
+ isBulkMenu: PropTypes.Requireable<boolean>;
417
+ }> | null | undefined>>;
418
+ isNestedTable: PropTypes.Requireable<boolean>;
419
+ emptyStateFirstMessage: PropTypes.Requireable<string>;
420
+ emptyStateSecondMessage: PropTypes.Requireable<string>;
421
+ }> | null | undefined>>;
422
+ title: PropTypes.Requireable<string>;
423
+ }> | null | undefined>>;
248
424
  }>>;
249
425
  }>>;
250
426
  }
@@ -66,6 +66,7 @@ declare namespace ExternalCourse {
66
66
  backgroundImageUrl: PropTypes.Requireable<string>;
67
67
  descriptionText: PropTypes.Requireable<string>;
68
68
  cookieTitle: PropTypes.Requireable<string>;
69
+ headerSubtitle: PropTypes.Requireable<string>;
69
70
  descriptionBtnTxt: PropTypes.Requireable<string>;
70
71
  listBtnSwicth: PropTypes.Requireable<(PropTypes.InferProps<{
71
72
  title: PropTypes.Requireable<string>;
@@ -86,10 +87,185 @@ declare namespace ExternalCourse {
86
87
  }> | null | undefined)[]>;
87
88
  items: PropTypes.Requireable<PropTypes.InferProps<{
88
89
  type: PropTypes.Requireable<string>;
89
- list: PropTypes.Requireable<PropTypes.InferProps<{
90
+ list: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
90
91
  list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
91
92
  loading: PropTypes.Requireable<boolean>;
92
- }>>;
93
+ }> | PropTypes.InferProps<{
94
+ 'aria-label': PropTypes.Requireable<string>;
95
+ buttonLink: PropTypes.Requireable<PropTypes.InferProps<{
96
+ type: PropTypes.Requireable<string>;
97
+ label: PropTypes.Requireable<string>;
98
+ 'aria-label': PropTypes.Requireable<string>;
99
+ 'data-name': PropTypes.Requireable<string>;
100
+ 'data-testid': PropTypes.Requireable<string>;
101
+ icon: PropTypes.Requireable<PropTypes.InferProps<{
102
+ position: PropTypes.Requireable<string>;
103
+ type: PropTypes.Requireable<string>;
104
+ }>>;
105
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
106
+ link: PropTypes.Requireable<PropTypes.InferProps<{
107
+ href: PropTypes.Requireable<string>;
108
+ download: PropTypes.Requireable<boolean>;
109
+ target: PropTypes.Requireable<string>;
110
+ }>>;
111
+ disabled: PropTypes.Requireable<boolean>;
112
+ className: PropTypes.Requireable<string>;
113
+ customStyle: PropTypes.Requireable<PropTypes.InferProps<{}>>;
114
+ }>>;
115
+ selectMultiple: PropTypes.Requireable<PropTypes.InferProps<{
116
+ title: PropTypes.Requireable<string>;
117
+ placeholder: PropTypes.Requireable<string>;
118
+ description: PropTypes.Requireable<string>;
119
+ hint: PropTypes.Requireable<string>;
120
+ options: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
121
+ selected: PropTypes.Validator<boolean>;
122
+ name: PropTypes.Validator<string>;
123
+ value: PropTypes.Requireable<string>;
124
+ }>>[]>;
125
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
126
+ onError: PropTypes.Requireable<(...args: any[]) => any>;
127
+ multiple: PropTypes.Requireable<boolean>;
128
+ modified: PropTypes.Requireable<boolean>;
129
+ disabled: PropTypes.Requireable<boolean>;
130
+ error: PropTypes.Requireable<string>;
131
+ theme: PropTypes.Requireable<string>;
132
+ }>>;
133
+ content: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
134
+ items: PropTypes.Requireable<(PropTypes.InferProps<{
135
+ title: PropTypes.Validator<string>;
136
+ dataColumns: PropTypes.Requireable<(PropTypes.InferProps<{
137
+ label: PropTypes.Requireable<string>;
138
+ type: PropTypes.Requireable<string>;
139
+ className: PropTypes.Requireable<string>;
140
+ }> | null | undefined)[]>;
141
+ buttonLink: PropTypes.Requireable<PropTypes.InferProps<{
142
+ type: PropTypes.Requireable<string>;
143
+ label: PropTypes.Requireable<string>;
144
+ ariaLabel: PropTypes.Requireable<string>;
145
+ dataName: PropTypes.Requireable<string>;
146
+ icon: PropTypes.Requireable<PropTypes.InferProps<{
147
+ position: PropTypes.Requireable<string>;
148
+ type: PropTypes.Requireable<string>;
149
+ }>>;
150
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
151
+ }>>;
152
+ buttonLinkIcon: PropTypes.Requireable<PropTypes.InferProps<{
153
+ size: PropTypes.Requireable<string>;
154
+ 'aria-label': PropTypes.Requireable<string>;
155
+ 'data-name': PropTypes.Requireable<string>;
156
+ icon: PropTypes.Requireable<string>;
157
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
158
+ link: PropTypes.Requireable<PropTypes.InferProps<{
159
+ href: PropTypes.Requireable<string>;
160
+ download: PropTypes.Requireable<boolean>;
161
+ target: PropTypes.Requireable<string>;
162
+ }>>;
163
+ disabled: PropTypes.Requireable<boolean>;
164
+ className: PropTypes.Requireable<string>;
165
+ }>>;
166
+ bulletPointMenuButton: PropTypes.Requireable<PropTypes.InferProps<{
167
+ buttonAriaLabel: PropTypes.Requireable<string>;
168
+ menuAriaLabel: PropTypes.Requireable<string>;
169
+ buttons: PropTypes.Requireable<(PropTypes.InferProps<{
170
+ 'data-name': PropTypes.Requireable<string>;
171
+ label: PropTypes.Requireable<string>;
172
+ type: PropTypes.Requireable<string>;
173
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
174
+ }> | null | undefined)[]>;
175
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
176
+ }>>;
177
+ tags: PropTypes.Requireable<(PropTypes.InferProps<{
178
+ label: PropTypes.Requireable<string>;
179
+ type: PropTypes.Requireable<string>;
180
+ }> | null | undefined)[]>;
181
+ isBulkStyle: PropTypes.Requireable<boolean>;
182
+ order: PropTypes.Requireable<number>;
183
+ 'aria-label': PropTypes.Requireable<string>;
184
+ contentType: PropTypes.Requireable<string>;
185
+ id: PropTypes.Requireable<string>;
186
+ }> | null | undefined)[]>;
187
+ type: PropTypes.Requireable<string>;
188
+ itemType: PropTypes.Requireable<string>;
189
+ onDrop: PropTypes.Requireable<(...args: any[]) => any>;
190
+ isDraggable: PropTypes.Requireable<boolean>;
191
+ tableHeader: PropTypes.Requireable<(string | null | undefined)[]>;
192
+ }> | PropTypes.InferProps<{
193
+ type: PropTypes.Requireable<string>;
194
+ columns: PropTypes.Requireable<(PropTypes.InferProps<{
195
+ title: PropTypes.Validator<string>;
196
+ }> | null | undefined)[]>;
197
+ rows: PropTypes.Requireable<(PropTypes.InferProps<{
198
+ fields: PropTypes.Requireable<(NonNullable<string | PropTypes.InferProps<{
199
+ type: PropTypes.Requireable<string>;
200
+ current: PropTypes.Requireable<boolean>;
201
+ selected: PropTypes.Requireable<boolean>;
202
+ icon: PropTypes.Requireable<string>;
203
+ value: PropTypes.Requireable<string>;
204
+ }> | null | undefined> | null | undefined)[]>;
205
+ isRowExpandible: PropTypes.Requireable<boolean>;
206
+ lastField: PropTypes.Requireable<NonNullable<string | PropTypes.InferProps<{
207
+ type: PropTypes.Requireable<string>;
208
+ disabled: PropTypes.Requireable<boolean>;
209
+ buttonAriaLabel: PropTypes.Requireable<string>;
210
+ menuAriaLabel: PropTypes.Requireable<string>;
211
+ buttons: PropTypes.Validator<(PropTypes.InferProps<{
212
+ 'data-name': PropTypes.Requireable<string>;
213
+ disabled: PropTypes.Requireable<boolean>;
214
+ label: PropTypes.Validator<string>;
215
+ onClick: PropTypes.Validator<(...args: any[]) => any>;
216
+ type: PropTypes.Requireable<string>;
217
+ }> | null | undefined)[]>;
218
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
219
+ menuButtonClassName: PropTypes.Requireable<string>;
220
+ isBulkMenu: PropTypes.Requireable<boolean>;
221
+ }> | null | undefined>>;
222
+ }> | null | undefined)[]>;
223
+ stickyFirstColumn: PropTypes.Requireable<boolean>;
224
+ stickyLastColumn: PropTypes.Requireable<boolean>;
225
+ columnWidth: PropTypes.Requireable<string>;
226
+ ariaDescribedby: PropTypes.Requireable<string>;
227
+ lastField: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
228
+ componentType: PropTypes.Requireable<string>;
229
+ type: PropTypes.Requireable<string>;
230
+ label: PropTypes.Requireable<string>;
231
+ 'aria-label': PropTypes.Requireable<string>;
232
+ 'data-name': PropTypes.Requireable<string>;
233
+ 'data-testid': PropTypes.Requireable<string>;
234
+ icon: PropTypes.Requireable<PropTypes.InferProps<{
235
+ position: PropTypes.Requireable<string>;
236
+ type: PropTypes.Requireable<string>;
237
+ }>>;
238
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
239
+ link: PropTypes.Requireable<PropTypes.InferProps<{
240
+ href: PropTypes.Requireable<string>;
241
+ download: PropTypes.Requireable<boolean>;
242
+ target: PropTypes.Requireable<string>;
243
+ }>>;
244
+ disabled: PropTypes.Requireable<boolean>;
245
+ className: PropTypes.Requireable<string>;
246
+ customStyle: PropTypes.Requireable<PropTypes.InferProps<{}>>;
247
+ }> | PropTypes.InferProps<{
248
+ componentType: PropTypes.Requireable<string>;
249
+ disabled: PropTypes.Requireable<boolean>;
250
+ buttonAriaLabel: PropTypes.Requireable<string>;
251
+ menuAriaLabel: PropTypes.Requireable<string>;
252
+ buttons: PropTypes.Validator<(PropTypes.InferProps<{
253
+ 'data-name': PropTypes.Requireable<string>;
254
+ disabled: PropTypes.Requireable<boolean>;
255
+ label: PropTypes.Validator<string>;
256
+ onClick: PropTypes.Validator<(...args: any[]) => any>;
257
+ type: PropTypes.Requireable<string>;
258
+ }> | null | undefined)[]>;
259
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
260
+ menuButtonClassName: PropTypes.Requireable<string>;
261
+ isBulkMenu: PropTypes.Requireable<boolean>;
262
+ }> | null | undefined>>;
263
+ isNestedTable: PropTypes.Requireable<boolean>;
264
+ emptyStateFirstMessage: PropTypes.Requireable<string>;
265
+ emptyStateSecondMessage: PropTypes.Requireable<string>;
266
+ }> | null | undefined>>;
267
+ title: PropTypes.Requireable<string>;
268
+ }> | null | undefined>>;
93
269
  }>>;
94
270
  }>>;
95
271
  }
@@ -1,7 +1,7 @@
1
1
  export const UrlPropType: any;
2
2
  export const PathPropType: any;
3
3
  export const SrcPropType: PropTypes.Requireable<any>;
4
- export function ImagePropType(props: any, propName: any, componentName: any): Error | null;
4
+ export function FilesPropType(props: any, propName: any, componentName: any): Error | null;
5
5
  export const ColorPropType: any;
6
6
  export const HexPropType: any;
7
7
  import PropTypes from "prop-types";
@@ -1 +1 @@
1
- {"version":3,"file":"proptypes.d.ts","sourceRoot":"","sources":["../../src/util/proptypes.js"],"names":[],"mappings":"AAYA,8BAAsD;AAGtD,+BAAwD;AAExD,qDAA4E;AAErE,2FAmBN;AAED,gCAA4C;AAC5C,8BAAwC"}
1
+ {"version":3,"file":"proptypes.d.ts","sourceRoot":"","sources":["../../src/util/proptypes.js"],"names":[],"mappings":"AAcA,8BAAsD;AAGtD,+BAAwD;AAExD,qDAA4E;AAErE,2FAoBN;AAED,gCAA4C;AAC5C,8BAAwC"}
@@ -6,17 +6,18 @@ import every from 'lodash/fp/every';
6
6
  import stringMatching from 'extended-proptypes/lib/validators/stringMatching';
7
7
  import _ColorPropType from 'extended-proptypes/lib/validators/color';
8
8
  import _HexPropType from 'extended-proptypes/lib/validators/hex';
9
+ import isEmpty from 'lodash/fp/isEmpty';
10
+ import head from 'lodash/fp/head';
9
11
  const URL_REGEXP = /^(http(s)?:\/\/.)[-a-zA-Z0-9@:%._\\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)$/;
10
12
  export const UrlPropType = stringMatching(URL_REGEXP);
11
13
  const PATH_REGEXP = /^\/([-a-zA-Z0-9@:%_\\+.~#?&//=]*)$/;
12
14
  export const PathPropType = stringMatching(PATH_REGEXP);
13
15
  export const SrcPropType = PropTypes.oneOfType([UrlPropType, PathPropType]);
14
- export const ImagePropType = (props, propName, componentName) => {
15
- const validImageTypes = ['image/jpeg', 'image/png', 'image/svg+xml', 'image/*', 'application/pdf'];
16
+ export const FilesPropType = (props, propName, componentName) => {
17
+ const validFilesTypes = ['image/jpeg', 'image/png', 'image/svg+xml', 'image/*', 'application/pdf', 'application/zip', 'text/csv'];
16
18
  const propValue = props[propName];
17
- if (!propValue) return new Error(`Missing prop: ${propName} at component: ${componentName}`);
18
- const imageTypes = split(',', propValue);
19
- const isValid = every(type => includes(trim(type), validImageTypes), imageTypes);
19
+ const filesTypes = split(',', propValue);
20
+ const isValid = isEmpty(head(filesTypes)) || every(type => includes(trim(type), validFilesTypes), filesTypes);
20
21
  if (isValid) return null;
21
22
  return new Error(`Invalid prop value: ${propValue}, at component: ${componentName}. Expected a valid image type: image/jpeg, image/png, image/* image/svg+xml or application/pdf.`);
22
23
  };
@@ -1 +1 @@
1
- {"version":3,"file":"proptypes.js","names":["PropTypes","split","trim","includes","every","stringMatching","_ColorPropType","_HexPropType","URL_REGEXP","UrlPropType","PATH_REGEXP","PathPropType","SrcPropType","oneOfType","ImagePropType","props","propName","componentName","validImageTypes","propValue","Error","imageTypes","isValid","type","ColorPropType","HexPropType"],"sources":["../../src/util/proptypes.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport split from 'lodash/fp/split';\nimport trim from 'lodash/fp/trim';\nimport includes from 'lodash/fp/includes';\nimport every from 'lodash/fp/every';\nimport stringMatching from 'extended-proptypes/lib/validators/stringMatching';\n\nimport _ColorPropType from 'extended-proptypes/lib/validators/color';\nimport _HexPropType from 'extended-proptypes/lib/validators/hex';\n\nconst URL_REGEXP =\n /^(http(s)?:\\/\\/.)[-a-zA-Z0-9@:%._\\\\+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_\\\\+.~#?&//=]*)$/;\nexport const UrlPropType = stringMatching(URL_REGEXP);\n\nconst PATH_REGEXP = /^\\/([-a-zA-Z0-9@:%_\\\\+.~#?&//=]*)$/;\nexport const PathPropType = stringMatching(PATH_REGEXP);\n\nexport const SrcPropType = PropTypes.oneOfType([UrlPropType, PathPropType]);\n\nexport const ImagePropType = (props, propName, componentName) => {\n const validImageTypes = [\n 'image/jpeg',\n 'image/png',\n 'image/svg+xml',\n 'image/*',\n 'application/pdf'\n ];\n\n const propValue = props[propName];\n if (!propValue) return new Error(`Missing prop: ${propName} at component: ${componentName}`);\n\n const imageTypes = split(',', propValue);\n const isValid = every(type => includes(trim(type), validImageTypes), imageTypes);\n if (isValid) return null;\n\n return new Error(\n `Invalid prop value: ${propValue}, at component: ${componentName}. Expected a valid image type: image/jpeg, image/png, image/* image/svg+xml or application/pdf.`\n );\n};\n\nexport const ColorPropType = _ColorPropType;\nexport const HexPropType = _HexPropType;\n"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,YAAtB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,OAAOC,QAAP,MAAqB,oBAArB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,cAAP,MAA2B,kDAA3B;AAEA,OAAOC,cAAP,MAA2B,yCAA3B;AACA,OAAOC,YAAP,MAAyB,uCAAzB;AAEA,MAAMC,UAAU,GACd,8FADF;AAEA,OAAO,MAAMC,WAAW,GAAGJ,cAAc,CAACG,UAAD,CAAlC;AAEP,MAAME,WAAW,GAAG,oCAApB;AACA,OAAO,MAAMC,YAAY,GAAGN,cAAc,CAACK,WAAD,CAAnC;AAEP,OAAO,MAAME,WAAW,GAAGZ,SAAS,CAACa,SAAV,CAAoB,CAACJ,WAAD,EAAcE,YAAd,CAApB,CAApB;AAEP,OAAO,MAAMG,aAAa,GAAG,CAACC,KAAD,EAAQC,QAAR,EAAkBC,aAAlB,KAAoC;EAC/D,MAAMC,eAAe,GAAG,CACtB,YADsB,EAEtB,WAFsB,EAGtB,eAHsB,EAItB,SAJsB,EAKtB,iBALsB,CAAxB;EAQA,MAAMC,SAAS,GAAGJ,KAAK,CAACC,QAAD,CAAvB;EACA,IAAI,CAACG,SAAL,EAAgB,OAAO,IAAIC,KAAJ,CAAW,iBAAgBJ,QAAS,kBAAiBC,aAAc,EAAnE,CAAP;EAEhB,MAAMI,UAAU,GAAGpB,KAAK,CAAC,GAAD,EAAMkB,SAAN,CAAxB;EACA,MAAMG,OAAO,GAAGlB,KAAK,CAACmB,IAAI,IAAIpB,QAAQ,CAACD,IAAI,CAACqB,IAAD,CAAL,EAAaL,eAAb,CAAjB,EAAgDG,UAAhD,CAArB;EACA,IAAIC,OAAJ,EAAa,OAAO,IAAP;EAEb,OAAO,IAAIF,KAAJ,CACJ,uBAAsBD,SAAU,mBAAkBF,aAAc,iGAD5D,CAAP;AAGD,CAnBM;AAqBP,OAAO,MAAMO,aAAa,GAAGlB,cAAtB;AACP,OAAO,MAAMmB,WAAW,GAAGlB,YAApB"}
1
+ {"version":3,"file":"proptypes.js","names":["PropTypes","split","trim","includes","every","stringMatching","_ColorPropType","_HexPropType","isEmpty","head","URL_REGEXP","UrlPropType","PATH_REGEXP","PathPropType","SrcPropType","oneOfType","FilesPropType","props","propName","componentName","validFilesTypes","propValue","filesTypes","isValid","type","Error","ColorPropType","HexPropType"],"sources":["../../src/util/proptypes.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport split from 'lodash/fp/split';\nimport trim from 'lodash/fp/trim';\nimport includes from 'lodash/fp/includes';\nimport every from 'lodash/fp/every';\nimport stringMatching from 'extended-proptypes/lib/validators/stringMatching';\n\nimport _ColorPropType from 'extended-proptypes/lib/validators/color';\nimport _HexPropType from 'extended-proptypes/lib/validators/hex';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport head from 'lodash/fp/head';\n\nconst URL_REGEXP =\n /^(http(s)?:\\/\\/.)[-a-zA-Z0-9@:%._\\\\+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_\\\\+.~#?&//=]*)$/;\nexport const UrlPropType = stringMatching(URL_REGEXP);\n\nconst PATH_REGEXP = /^\\/([-a-zA-Z0-9@:%_\\\\+.~#?&//=]*)$/;\nexport const PathPropType = stringMatching(PATH_REGEXP);\n\nexport const SrcPropType = PropTypes.oneOfType([UrlPropType, PathPropType]);\n\nexport const FilesPropType = (props, propName, componentName) => {\n const validFilesTypes = [\n 'image/jpeg',\n 'image/png',\n 'image/svg+xml',\n 'image/*',\n 'application/pdf',\n 'application/zip',\n 'text/csv'\n ];\n\n const propValue = props[propName];\n const filesTypes = split(',', propValue);\n const isValid =\n isEmpty(head(filesTypes)) || every(type => includes(trim(type), validFilesTypes), filesTypes);\n if (isValid) return null;\n\n return new Error(\n `Invalid prop value: ${propValue}, at component: ${componentName}. Expected a valid image type: image/jpeg, image/png, image/* image/svg+xml or application/pdf.`\n );\n};\n\nexport const ColorPropType = _ColorPropType;\nexport const HexPropType = _HexPropType;\n"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,YAAtB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,OAAOC,QAAP,MAAqB,oBAArB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,cAAP,MAA2B,kDAA3B;AAEA,OAAOC,cAAP,MAA2B,yCAA3B;AACA,OAAOC,YAAP,MAAyB,uCAAzB;AACA,OAAOC,OAAP,MAAoB,mBAApB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AAEA,MAAMC,UAAU,GACd,8FADF;AAEA,OAAO,MAAMC,WAAW,GAAGN,cAAc,CAACK,UAAD,CAAlC;AAEP,MAAME,WAAW,GAAG,oCAApB;AACA,OAAO,MAAMC,YAAY,GAAGR,cAAc,CAACO,WAAD,CAAnC;AAEP,OAAO,MAAME,WAAW,GAAGd,SAAS,CAACe,SAAV,CAAoB,CAACJ,WAAD,EAAcE,YAAd,CAApB,CAApB;AAEP,OAAO,MAAMG,aAAa,GAAG,CAACC,KAAD,EAAQC,QAAR,EAAkBC,aAAlB,KAAoC;EAC/D,MAAMC,eAAe,GAAG,CACtB,YADsB,EAEtB,WAFsB,EAGtB,eAHsB,EAItB,SAJsB,EAKtB,iBALsB,EAMtB,iBANsB,EAOtB,UAPsB,CAAxB;EAUA,MAAMC,SAAS,GAAGJ,KAAK,CAACC,QAAD,CAAvB;EACA,MAAMI,UAAU,GAAGrB,KAAK,CAAC,GAAD,EAAMoB,SAAN,CAAxB;EACA,MAAME,OAAO,GACXf,OAAO,CAACC,IAAI,CAACa,UAAD,CAAL,CAAP,IAA6BlB,KAAK,CAACoB,IAAI,IAAIrB,QAAQ,CAACD,IAAI,CAACsB,IAAD,CAAL,EAAaJ,eAAb,CAAjB,EAAgDE,UAAhD,CADpC;EAEA,IAAIC,OAAJ,EAAa,OAAO,IAAP;EAEb,OAAO,IAAIE,KAAJ,CACJ,uBAAsBJ,SAAU,mBAAkBF,aAAc,iGAD5D,CAAP;AAGD,CApBM;AAsBP,OAAO,MAAMO,aAAa,GAAGpB,cAAtB;AACP,OAAO,MAAMqB,WAAW,GAAGpB,YAApB"}
@@ -47,9 +47,9 @@ const getButtonContent = (icon, label) => {
47
47
  className: _style.default.buttonContent
48
48
  }, position === 'left' ? /*#__PURE__*/_react.default.createElement(Icon, {
49
49
  className: _style.default.icon
50
- }) : null, /*#__PURE__*/_react.default.createElement("span", {
50
+ }) : null, label ? /*#__PURE__*/_react.default.createElement("span", {
51
51
  className: _style.default.label
52
- }, label), position === 'right' ? /*#__PURE__*/_react.default.createElement(Icon, {
52
+ }, label) : null, position === 'right' ? /*#__PURE__*/_react.default.createElement(Icon, {
53
53
  className: _style.default.icon
54
54
  }) : null);
55
55
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["getButtonContent","icon","label","type","position","Icon","ICONS","style","buttonContent","ButtonLink","props","disabled","dataName","dataTestId","ariaLabel","link","onClick","onKeyDown","className","customStyle","useTitle","contentView","styleButton","classnames","button","primary","secondary","tertiary","text","dangerous","handleOnClick","useCallback","handleOnKeyDown","event","title","propTypes"],"sources":["../../../src/atom/button-link/index.tsx"],"sourcesContent":["import React, {useCallback} from 'react';\nimport {noop} from 'lodash/fp';\nimport classnames from 'classnames';\nimport Link from '../link';\nimport {ICONS} from '../../util/button-icons';\nimport propTypes, {ButtonLinkProps, IconType} from './types';\nimport style from './style.css';\n\nconst getButtonContent = (icon?: IconType, label?: string) => {\n const {type, position} = icon || {type: '', position: ''};\n const Icon = type && ICONS[type];\n\n if (!Icon) {\n return (\n <div className={style.buttonContent}>\n <span className={style.label}>{label}</span>\n </div>\n );\n }\n\n return (\n <div className={style.buttonContent}>\n {position === 'left' ? <Icon className={style.icon} /> : null}\n <span className={style.label}>{label}</span>\n {position === 'right' ? <Icon className={style.icon} /> : null}\n </div>\n );\n};\n\nconst ButtonLink = (props: ButtonLinkProps) => {\n const {\n type,\n label,\n disabled,\n icon,\n 'data-name': dataName,\n 'data-testid': dataTestId = 'button-link',\n 'aria-label': ariaLabel,\n link,\n onClick = noop,\n onKeyDown = noop,\n className,\n customStyle,\n useTitle = true\n } = props;\n const contentView = getButtonContent(icon, label);\n const styleButton = classnames(\n className,\n style.button,\n type === 'primary' && style.primary,\n type === 'secondary' && style.secondary,\n type === 'tertiary' && style.tertiary,\n type === 'text' && style.text,\n type === 'dangerous' && style.dangerous,\n link && style.link,\n disabled && style.disabled\n );\n\n const handleOnClick = useCallback(() => onClick(), [onClick]);\n\n const handleOnKeyDown = useCallback(event => onKeyDown(event), [onKeyDown]);\n\n if (link) {\n return (\n <Link\n {...link}\n {...(useTitle && {\n title: ariaLabel || label\n })}\n style={customStyle}\n className={styleButton}\n data-name={dataName}\n data-testid={dataTestId}\n aria-label={ariaLabel || label}\n >\n {contentView}\n </Link>\n );\n }\n\n return (\n <button\n {...(useTitle && {\n title: ariaLabel || label\n })}\n type=\"button\"\n aria-label={ariaLabel || label}\n data-name={dataName}\n data-testid={dataTestId}\n style={customStyle}\n className={styleButton}\n onClick={handleOnClick}\n onKeyDown={handleOnKeyDown}\n tabIndex={0}\n >\n {contentView}\n </button>\n );\n};\n\nButtonLink.propTypes = propTypes;\n\nexport default ButtonLink;\n"],"mappings":"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"}
1
+ {"version":3,"file":"index.js","names":["getButtonContent","icon","label","type","position","Icon","ICONS","style","buttonContent","ButtonLink","props","disabled","dataName","dataTestId","ariaLabel","link","onClick","onKeyDown","className","customStyle","useTitle","contentView","styleButton","classnames","button","primary","secondary","tertiary","text","dangerous","handleOnClick","useCallback","handleOnKeyDown","event","title","propTypes"],"sources":["../../../src/atom/button-link/index.tsx"],"sourcesContent":["import React, {useCallback} from 'react';\nimport {noop} from 'lodash/fp';\nimport classnames from 'classnames';\nimport Link from '../link';\nimport {ICONS} from '../../util/button-icons';\nimport propTypes, {ButtonLinkProps, IconType} from './types';\nimport style from './style.css';\n\nconst getButtonContent = (icon?: IconType, label?: string) => {\n const {type, position} = icon || {type: '', position: ''};\n const Icon = type && ICONS[type];\n\n if (!Icon) {\n return (\n <div className={style.buttonContent}>\n <span className={style.label}>{label}</span>\n </div>\n );\n }\n\n return (\n <div className={style.buttonContent}>\n {position === 'left' ? <Icon className={style.icon} /> : null}\n {label ? <span className={style.label}>{label}</span> : null}\n {position === 'right' ? <Icon className={style.icon} /> : null}\n </div>\n );\n};\n\nconst ButtonLink = (props: ButtonLinkProps) => {\n const {\n type,\n label,\n disabled,\n icon,\n 'data-name': dataName,\n 'data-testid': dataTestId = 'button-link',\n 'aria-label': ariaLabel,\n link,\n onClick = noop,\n onKeyDown = noop,\n className,\n customStyle,\n useTitle = true\n } = props;\n const contentView = getButtonContent(icon, label);\n const styleButton = classnames(\n className,\n style.button,\n type === 'primary' && style.primary,\n type === 'secondary' && style.secondary,\n type === 'tertiary' && style.tertiary,\n type === 'text' && style.text,\n type === 'dangerous' && style.dangerous,\n link && style.link,\n disabled && style.disabled\n );\n\n const handleOnClick = useCallback(() => onClick(), [onClick]);\n\n const handleOnKeyDown = useCallback(event => onKeyDown(event), [onKeyDown]);\n\n if (link) {\n return (\n <Link\n {...link}\n {...(useTitle && {\n title: ariaLabel || label\n })}\n style={customStyle}\n className={styleButton}\n data-name={dataName}\n data-testid={dataTestId}\n aria-label={ariaLabel || label}\n >\n {contentView}\n </Link>\n );\n }\n\n return (\n <button\n {...(useTitle && {\n title: ariaLabel || label\n })}\n type=\"button\"\n aria-label={ariaLabel || label}\n data-name={dataName}\n data-testid={dataTestId}\n style={customStyle}\n className={styleButton}\n onClick={handleOnClick}\n onKeyDown={handleOnKeyDown}\n tabIndex={0}\n >\n {contentView}\n </button>\n );\n};\n\nButtonLink.propTypes = propTypes;\n\nexport default ButtonLink;\n"],"mappings":"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"}
@@ -21,6 +21,7 @@
21
21
  align-items: center;
22
22
  cursor: pointer;
23
23
  border: none;
24
+ padding: 0px 16px;
24
25
  /* prevents text selection when dragging
25
26
  the mouse over the button */
26
27
  user-select: none;
@@ -20,6 +20,7 @@ declare class DragAndDrop extends React.Component<any, any, any> {
20
20
  errorButtonLabel: PropTypes.Requireable<string>;
21
21
  pdfButtonLabel: PropTypes.Requireable<string>;
22
22
  pdfButtonAriaLabel: PropTypes.Requireable<string>;
23
+ multiple: PropTypes.Requireable<boolean>;
23
24
  };
24
25
  constructor(props: any);
25
26
  state: {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/drag-and-drop/index.js"],"names":[],"mappings":";AAiBA;IACE;;;;;;;;;;;;;;;;;;;;MAoBE;IAEF,wBASC;IANC;;MAEC;IAMH,wBAIC;IAED,uBAIC;IAED,sBA0LC;CACF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/drag-and-drop/index.js"],"names":[],"mappings":";AAiBA;IACE;;;;;;;;;;;;;;;;;;;;;MAqBE;IAEF,wBASC;IANC;;MAEC;IAMH,wBAIC;IAED,uBAIC;IAED,sBA4MC;CACF"}
@@ -70,12 +70,19 @@ class DragAndDrop extends _react.default.Component {
70
70
  errorButtonLabel = '',
71
71
  disabled = false,
72
72
  pdfButtonLabel,
73
- pdfButtonAriaLabel
73
+ pdfButtonAriaLabel,
74
+ multiple
74
75
  } = this.props;
75
76
  const {
76
77
  dragging
77
78
  } = this.state;
78
79
  let previewView = null;
80
+ const customButtonStyle = {
81
+ width: 'auto',
82
+ maxWidth: '150px',
83
+ padding: '12px 24px',
84
+ boxSizing: 'border-box'
85
+ };
79
86
 
80
87
  if (previewContent && previewContent.type === 'image') {
81
88
  previewView = /*#__PURE__*/_react.default.createElement("div", {
@@ -109,7 +116,8 @@ class DragAndDrop extends _react.default.Component {
109
116
  icon: {
110
117
  position: 'left',
111
118
  type: 'pdf'
112
- }
119
+ },
120
+ customStyle: customButtonStyle
113
121
  }));
114
122
  } else if (previewContent && previewContent.type === 'xlsx') {
115
123
  previewView = /*#__PURE__*/_react.default.createElement("div", {
@@ -119,6 +127,14 @@ class DragAndDrop extends _react.default.Component {
119
127
  }, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaSolidFilesBasicFileLines, {
120
128
  className: _style.default.iconFile
121
129
  })));
130
+ } else if (previewContent && (multiple || previewContent.type === 'csv')) {
131
+ previewView = /*#__PURE__*/_react.default.createElement("div", {
132
+ className: _style.default.preview
133
+ }, /*#__PURE__*/_react.default.createElement("div", {
134
+ className: _style.default.multiplePreview
135
+ }, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaSolidFilesBasicFileLines, {
136
+ className: _style.default.iconFile
137
+ })));
122
138
  } else if (loading) {
123
139
  previewView = /*#__PURE__*/_react.default.createElement("div", {
124
140
  className: _style.default.loaderWrapper
@@ -141,7 +157,7 @@ class DragAndDrop extends _react.default.Component {
141
157
  previewView = /*#__PURE__*/_react.default.createElement("span", null, previewLabel);
142
158
  }
143
159
 
144
- const resetContent = previewContent && previewContent.src ? /*#__PURE__*/_react.default.createElement("div", {
160
+ const resetContent = previewContent && previewContent.src && !multiple ? /*#__PURE__*/_react.default.createElement("div", {
145
161
  className: (0, _classnames.default)(_style.default.resetUploadWrapper, disabled && _style.default.disabled)
146
162
  }, /*#__PURE__*/_react.default.createElement("div", {
147
163
  className: _style.default.resetSrcLabel
@@ -161,7 +177,8 @@ class DragAndDrop extends _react.default.Component {
161
177
  icon: {
162
178
  position: 'left',
163
179
  type: 'folders'
164
- }
180
+ },
181
+ customStyle: customButtonStyle
165
182
  };
166
183
 
167
184
  if (dragging) {
@@ -177,7 +194,7 @@ class DragAndDrop extends _react.default.Component {
177
194
  };
178
195
 
179
196
  const button = buildButton(dragging, error);
180
- const previewContainer = (0, _getClassState.default)(_style.default.previewContainer, _style.default.modifiedPreviewContainer, null, modified, error);
197
+ const previewContainer = (0, _getClassState.default)(multiple ? _style.default.previewContainerMultiple : _style.default.previewContainer, _style.default.modifiedPreviewContainer, null, modified, error);
181
198
  const inputWrapper = (0, _getClassState.default)(_style.default.inputWrapper, _style.default.modifiedInputWrapper, _style.default.errorInputWrapper, modified, error);
182
199
 
183
200
  const buildContent = () => {
@@ -238,7 +255,8 @@ DragAndDrop.propTypes = process.env.NODE_ENV !== "production" ? {
238
255
  buttonAriaLabel: _propTypes.default.string,
239
256
  errorButtonLabel: _propTypes.default.string,
240
257
  pdfButtonLabel: _propTypes.default.string,
241
- pdfButtonAriaLabel: _propTypes.default.string
258
+ pdfButtonAriaLabel: _propTypes.default.string,
259
+ multiple: _propTypes.default.bool
242
260
  } : {};
243
261
  var _default = DragAndDrop;
244
262
  exports.default = _default;