@splunk/react-ui 4.33.0 → 4.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/Breadcrumbs.js +20 -29
  2. package/Button.js +20 -23
  3. package/ButtonGroup.js +20 -23
  4. package/ButtonSimple.js +33 -34
  5. package/CHANGELOG.md +56 -1
  6. package/Card.js +129 -113
  7. package/Chip.js +75 -82
  8. package/CollapsiblePanel.js +281 -264
  9. package/Color.js +103 -93
  10. package/ComboBox.js +3 -2
  11. package/Concertina.js +139 -138
  12. package/ControlGroup.js +43 -39
  13. package/DualListbox.js +8 -11
  14. package/File.js +25 -30
  15. package/FormRows.js +53 -53
  16. package/Image.js +13 -13
  17. package/JSONTree.js +87 -85
  18. package/List.js +9 -13
  19. package/MIGRATION.mdx +100 -0
  20. package/Markdown.js +12 -12
  21. package/Menu.js +492 -699
  22. package/Message.js +192 -194
  23. package/MessageBar.js +104 -104
  24. package/Modal.js +2 -2
  25. package/Monogram.js +140 -94
  26. package/Multiselect.js +45 -49
  27. package/Paginator.js +8 -8
  28. package/Popover.js +53 -54
  29. package/Progress.js +45 -46
  30. package/RadioBar.js +117 -115
  31. package/RadioList.js +8 -5
  32. package/ResultsMenu.js +272 -279
  33. package/Search.js +197 -199
  34. package/Select.js +86 -84
  35. package/Slider.js +9 -9
  36. package/SplitButton.js +1 -4
  37. package/StaticContent.js +1 -1
  38. package/StepBar.js +92 -88
  39. package/Switch.js +217 -211
  40. package/TabBar.js +13 -5
  41. package/Table.js +714 -717
  42. package/Text.js +94 -83
  43. package/TextArea.js +162 -163
  44. package/Tooltip.js +1 -1
  45. package/package.json +8 -8
  46. package/stubs-splunkui.d.ts +11 -0
  47. package/types/src/Breadcrumbs/Breadcrumbs.d.ts +0 -1
  48. package/types/src/Breadcrumbs/Item.d.ts +0 -1
  49. package/types/src/Card/Card.d.ts +3 -1
  50. package/types/src/Card/Header.d.ts +22 -5
  51. package/types/src/Chip/Chip.d.ts +2 -4
  52. package/types/src/CollapsiblePanel/CollapsiblePanel.d.ts +5 -0
  53. package/types/src/CollapsiblePanel/icons/ExpandPanel.d.ts +1 -3
  54. package/types/src/Color/Color.d.ts +5 -5
  55. package/types/src/ComboBox/Option.d.ts +0 -1
  56. package/types/src/List/List.d.ts +2 -4
  57. package/types/src/Menu/Heading.d.ts +1 -1
  58. package/types/src/Menu/Item.d.ts +10 -5
  59. package/types/src/Menu/Menu.d.ts +18 -26
  60. package/types/src/Menu/MenuContext.d.ts +3 -2
  61. package/types/src/Menu/docs/examples/Dimmed.d.ts +2 -0
  62. package/types/src/Monogram/Monogram.d.ts +5 -6
  63. package/types/src/Multiselect/Option.d.ts +0 -1
  64. package/types/src/Progress/Progress.d.ts +4 -1
  65. package/types/src/RadioBar/Option.d.ts +4 -1
  66. package/types/src/RadioBar/RadioBar.d.ts +6 -4
  67. package/types/src/RadioBar/docs/examples/MenuBar.d.ts +2 -0
  68. package/types/src/ResultsMenu/ResultsMenu.d.ts +13 -28
  69. package/types/src/ResultsMenu/VirtualizedResultsMenu/VirtualizedResultsMenu.d.ts +3 -5
  70. package/types/src/Search/Option.d.ts +19 -6
  71. package/types/src/Search/docs/examples/OptionsLinks.d.ts +2 -0
  72. package/types/src/Select/Option.d.ts +0 -1
  73. package/types/src/Select/OptionBase.d.ts +2 -3
  74. package/types/src/Select/Select.d.ts +2 -2
  75. package/types/src/Select/SelectBase.d.ts +2 -2
  76. package/types/src/Table/Body.d.ts +0 -4
  77. package/types/src/Table/DragHandle.d.ts +1 -2
  78. package/types/src/Text/Text.d.ts +2 -0
  79. package/useRovingFocus.js +26 -40
  80. package/types/src/Select/docs/examples/prisma/Appearance.d.ts +0 -14
package/Card.js CHANGED
@@ -64,7 +64,7 @@
64
64
  Body: () => /* reexport */ m,
65
65
  Footer: () => /* reexport */ k,
66
66
  Header: () => /* reexport */ Q,
67
- default: () => /* reexport */ Be
67
+ default: () => /* reexport */ Re
68
68
  });
69
69
  // CONCATENATED MODULE: external "react"
70
70
  const t = require("react");
@@ -87,7 +87,7 @@
87
87
  })([ "flex:1 1 auto;overflow:auto;height:100%;", ";", "" ], (function(e) {
88
88
  var r = e.$inset;
89
89
  return r ? (0, a.css)([ "", "" ], (0, u.pick)({
90
- enterprise: (0, a.css)([ "padding:", ";&:not(:first-child){padding-top:0;}" ], u.variables.spacing),
90
+ enterprise: (0, a.css)([ "padding:", ";&:not(:first-child){padding-top:0;}" ], u.variables.spacingLarge),
91
91
  prisma: {
92
92
  comfortable: (0, a.css)([ "padding:12px 24px;&:first-child{padding-top:28px;}&:last-child{padding-bottom:28px;}" ]),
93
93
  compact: (0, a.css)([ "padding:8px 24px;&:first-child{padding-top:20px;}&:last-child{padding-bottom:20px;}" ])
@@ -164,7 +164,7 @@
164
164
  displayName: "FooterStyles__StyledBox",
165
165
  componentId: "sc-1yu3r4s-0"
166
166
  })([ "", ";text-align:right;color:", ";", "" ], (0, u.pick)({
167
- enterprise: (0, a.css)([ "padding:", ";&:first-child{border-top:none;}" ], u.variables.spacing),
167
+ enterprise: (0, a.css)([ "padding:", ";&:first-child{border-top:none;}" ], u.variables.spacingLarge),
168
168
  prisma: {
169
169
  comfortable: (0, a.css)([ "padding:24px;" ]),
170
170
  compact: "padding: 18px 24px"
@@ -242,19 +242,19 @@
242
242
  var P = e.n(C);
243
243
  // CONCATENATED MODULE: external "@splunk/react-icons/enterprise/MoreVertical"
244
244
  const _ = require("@splunk/react-icons/enterprise/MoreVertical");
245
- var T = e.n(_);
245
+ var E = e.n(_);
246
246
  // CONCATENATED MODULE: external "@splunk/react-ui/Anchor"
247
- const E = require("@splunk/react-ui/Anchor");
248
- var B = e.n(E);
247
+ const T = require("@splunk/react-ui/Anchor");
248
+ var B = e.n(T);
249
249
  // CONCATENATED MODULE: external "@splunk/react-ui/Dropdown"
250
250
  const R = require("@splunk/react-ui/Dropdown");
251
251
  var I = e.n(R);
252
252
  // CONCATENATED MODULE: external "@splunk/react-ui/Tooltip"
253
253
  const q = require("@splunk/react-ui/Tooltip");
254
- var H = e.n(q);
254
+ var N = e.n(q);
255
255
  // CONCATENATED MODULE: external "@splunk/react-ui/Button"
256
- const N = require("@splunk/react-ui/Button");
257
- var $ = e.n(N);
256
+ const H = require("@splunk/react-ui/Button");
257
+ var $ = e.n(H);
258
258
  // CONCATENATED MODULE: ./src/Card/HeaderStyles.ts
259
259
  var A = l().div.withConfig({
260
260
  displayName: "HeaderStyles__StyledTitle",
@@ -282,10 +282,7 @@
282
282
  A,
283
283
  /* sc-sel */
284
284
  W);
285
- }), (0, u.pick)({
286
- enterprise: u.variables.spacingHalf,
287
- prisma: u.variables.spacingSmall
288
- }));
285
+ }), u.variables.spacingSmall);
289
286
  var M = l().div.withConfig({
290
287
  displayName: "HeaderStyles__StyledActionContainer",
291
288
  componentId: "eqi6uk-3"
@@ -300,12 +297,12 @@
300
297
  displayName: "HeaderStyles__StyledSecondaryAction",
301
298
  componentId: "eqi6uk-4"
302
299
  })([ "margin-left:10px;" ]);
303
- var z = l()(s()).withConfig({
300
+ var L = l()(s()).withConfig({
304
301
  displayName: "HeaderStyles__StyledBox",
305
302
  componentId: "eqi6uk-5"
306
303
  })([ "align-items:start;display:flex;flex:0 0 auto;justify-content:space-between;position:relative;min-height:30px;", " ", " >:not(", "):not(", "){flex:1 0 auto;}" ], (0,
307
304
  u.pick)({
308
- enterprise: (0, a.css)([ "padding:", ";" ], u.variables.spacing),
305
+ enterprise: (0, a.css)([ "padding:", ";" ], u.variables.spacingLarge),
309
306
  prisma: {
310
307
  comfortable: (0, a.css)([ "padding:16px 24px;&:last-child{padding-bottom:32px;}" ]),
311
308
  compact: (0, a.css)([ "padding:12px 24px;&:last-child{padding-bottom:24px;}" ])
@@ -318,7 +315,7 @@
318
315
  /* sc-sel */
319
316
  M);
320
317
  // CONCATENATED MODULE: ./src/Card/Header.tsx
321
- function L(e, r) {
318
+ function z(e, r) {
322
319
  if (e == null) return {};
323
320
  var t = V(e, r);
324
321
  var n, o;
@@ -369,6 +366,10 @@
369
366
  title: i().node,
370
367
  truncateTitle: i().bool
371
368
  };
369
+ // The order of the interfaces is necessary to maintain proper error messages: HeaderWithActions then HeaderWithActionsRenderProp
370
+ // If the actions comes first the error will report that actions should be undefined
371
+ // when we want actions to be the intended use case
372
+ // type HeaderProps = ComponentProps<HeaderPropsBase, 'div'>;
372
373
  // `forwardRef` is used to enable focus on toggle when Dropdown is closing
373
374
  var J = n().forwardRef((function(e, r) {
374
375
  var t = (0, u.useSplunkTheme)(), o = t.family, i = t.isCompact;
@@ -376,9 +377,9 @@
376
377
  var l = o === "prisma" ? n().createElement(P(), {
377
378
  height: a,
378
379
  width: a
379
- }) : n().createElement(T(), null);
380
+ }) : n().createElement(E(), null);
380
381
 
381
- return n().createElement(H(), G({
382
+ return n().createElement(N(), G({
382
383
  content: (0, j._)("Actions"),
383
384
  contentRelationship: "label"
384
385
  }, e), n().createElement(F, {
@@ -391,21 +392,28 @@
391
392
  /**
392
393
  * A styled container for `Card` header content.
393
394
  */ function K(e) {
394
- var r = e.actionPrimary, t = e.actionsSecondary, o = e.anchor, i = e.children, a = e.subtitle, l = e.title, c = e.truncateTitle, s = c === void 0 ? true : c, p = L(e, [ "actionPrimary", "actionsSecondary", "anchor", "children", "subtitle", "title", "truncateTitle" ]);
395
+ var r = e.actions, t = e.actionPrimary, o = e.actionsSecondary, i = e.anchor, a = e.children, l = e.subtitle, c = e.title, s = e.truncateTitle, p = s === void 0 ? true : s, d = z(e, [ "actions", "actionPrimary", "actionsSecondary", "anchor", "children", "subtitle", "title", "truncateTitle" ]);
395
396
  // @docs-props-type HeaderPropsBase
396
- var d = (0, u.useSplunkTheme)(), f = d.family;
397
- var b = f === "prisma" ? "right" : "below";
397
+ var f = (0, u.useSplunkTheme)(), b = f.family;
398
+ var v = b === "prisma" ? "right" : "below";
399
+ if (false) {}
400
+ var y;
401
+ if (r) {
402
+ y = r();
403
+ } else if (t || o) {
404
+ y = n().createElement(n().Fragment, null, t, o && n().createElement(I(), {
405
+ defaultPlacement: v,
406
+ toggle: n().createElement(J, null)
407
+ }, o));
408
+ }
398
409
 
399
- return n().createElement(z, G({
410
+ return n().createElement(L, G({
400
411
  "data-test": "header"
401
- }, p), (l || a) && n().createElement(D, {
402
- $truncateTitle: s
403
- }, l && n().createElement(A, null, o ? n().createElement(B(), {
404
- name: o
405
- }, l) : l), a && n().createElement(W, null, a)), i, (r || t) && n().createElement(M, null, r, t && n().createElement(I(), {
406
- defaultPlacement: b,
407
- toggle: n().createElement(J, null)
408
- }, t)));
412
+ }, d), (c || l) && n().createElement(D, {
413
+ $truncateTitle: p
414
+ }, c && n().createElement(A, null, i ? n().createElement(B(), {
415
+ name: i
416
+ }, c) : c), l && n().createElement(W, null, l)), a, y && n().createElement(M, null, y));
409
417
  }
410
418
  K.propTypes = U;
411
419
  /* harmony default export */ const Q = K;
@@ -414,10 +422,7 @@
414
422
  var Y = e.n(X);
415
423
  // CONCATENATED MODULE: ./src/Card/CardStyles.ts
416
424
  var Z = "0.2s";
417
- var ee = l().div.withConfig({
418
- displayName: "CardStyles__Styled",
419
- componentId: "ola3x0-0"
420
- })([ "", ";flex-direction:column;align-items:stretch;min-width:100px;flex:1;vertical-align:top;", " transition:height ", ",width ", ",min-width ", ",max-width ", ",margin ", ",box-shadow ", ",border-color ", ";", " &[data-clickable='true']{cursor:pointer;", " &:hover{", "}&:focus{", "}}" ], u.mixins.reset("inline-flex"), (0,
425
+ var ee = (0, a.css)([ "", ";flex-direction:column;align-items:stretch;min-width:100px;flex:1;vertical-align:top;", " transition:height ", ",width ", ",min-width ", ",max-width ", ",margin ", ",box-shadow ", ",border-color ", ";", " &[data-clickable='true']{cursor:pointer;", " &:hover{", "}&:focus{", "}}" ], u.mixins.reset("inline-flex"), (0,
421
426
  u.pick)({
422
427
  enterprise: (0, a.css)([ "background-color:", ";border:1px solid transparent;" ], u.variables.backgroundColor),
423
428
  prisma: (0, a.css)([ "background-color:", ";border-radius:", ";box-shadow:", ";" ], u.variables.backgroundColorSection, u.variables.borderRadius, u.variables.embossShadow)
@@ -439,36 +444,43 @@
439
444
  enterprise: (0, a.css)([ "box-shadow:", ";" ], u.variables.focusShadow),
440
445
  prisma: (0, a.css)([ "box-shadow:", ",", ";background-color:", ";" ], u.variables.embossShadow, u.variables.focusShadow, u.mixins.overlayColors(u.variables.backgroundColorSection, u.variables.interactiveColorOverlayHover))
441
446
  }));
442
- var re = ee.withComponent(Y());
447
+ var re = l().article.withConfig({
448
+ displayName: "CardStyles__Styled",
449
+ componentId: "ola3x0-0"
450
+ })([ "", "" ], ee);
451
+ var te = l()(Y()).withConfig({
452
+ displayName: "CardStyles__StyledClickable",
453
+ componentId: "ola3x0-1"
454
+ })([ "", "" ], ee);
443
455
  /* A child element we add to <button>s to make flexbox work.
444
456
  Without this wrapper element, child elements won't flex
445
457
  in Firefox.
446
458
  This unfortunately exposes some fragility in IE (e.g., adding
447
459
  a flex: 1 style here will cause the card to collapse) so test
448
460
  across the supported browsers if making a change here.
449
- */ var te = l().div.withConfig({
461
+ */ var ne = l().div.withConfig({
450
462
  displayName: "CardStyles__StyledFirefoxFlexHack",
451
- componentId: "ola3x0-1"
463
+ componentId: "ola3x0-2"
452
464
  })([ "display:flex;flex:1 1 auto;flex-direction:column;align-items:stretch;justify-content:stretch;height:100%;", "" ], (0,
453
465
  u.pick)({
454
466
  prisma: (0, a.css)([ "border-radius:", ";" ], u.variables.borderRadius)
455
467
  }));
456
468
  // CONCATENATED MODULE: ./src/Card/Card.tsx
457
- function ne(e) {
469
+ function oe(e) {
458
470
  "@babel/helpers - typeof";
459
471
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
460
- ne = function e(r) {
472
+ oe = function e(r) {
461
473
  return typeof r;
462
474
  };
463
475
  } else {
464
- ne = function e(r) {
476
+ oe = function e(r) {
465
477
  return r && typeof Symbol === "function" && r.constructor === Symbol && r !== Symbol.prototype ? "symbol" : typeof r;
466
478
  };
467
479
  }
468
- return ne(e);
480
+ return oe(e);
469
481
  }
470
- function oe() {
471
- oe = Object.assign || function(e) {
482
+ function ie() {
483
+ ie = Object.assign || function(e) {
472
484
  for (var r = 1; r < arguments.length; r++) {
473
485
  var t = arguments[r];
474
486
  for (var n in t) {
@@ -479,30 +491,30 @@
479
491
  }
480
492
  return e;
481
493
  };
482
- return oe.apply(this, arguments);
494
+ return ie.apply(this, arguments);
483
495
  }
484
- function ie(e, r) {
485
- return ue(e) || se(e, r) || le(e, r) || ae();
496
+ function ae(e, r) {
497
+ return pe(e) || ue(e, r) || ce(e, r) || le();
486
498
  }
487
- function ae() {
499
+ function le() {
488
500
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
489
501
  }
490
- function le(e, r) {
502
+ function ce(e, r) {
491
503
  if (!e) return;
492
- if (typeof e === "string") return ce(e, r);
504
+ if (typeof e === "string") return se(e, r);
493
505
  var t = Object.prototype.toString.call(e).slice(8, -1);
494
506
  if (t === "Object" && e.constructor) t = e.constructor.name;
495
507
  if (t === "Map" || t === "Set") return Array.from(e);
496
- if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return ce(e, r);
508
+ if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return se(e, r);
497
509
  }
498
- function ce(e, r) {
510
+ function se(e, r) {
499
511
  if (r == null || r > e.length) r = e.length;
500
512
  for (var t = 0, n = new Array(r); t < r; t++) {
501
513
  n[t] = e[t];
502
514
  }
503
515
  return n;
504
516
  }
505
- function se(e, r) {
517
+ function ue(e, r) {
506
518
  if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(e))) return;
507
519
  var t = [];
508
520
  var n = true;
@@ -525,15 +537,15 @@
525
537
  }
526
538
  return t;
527
539
  }
528
- function ue(e) {
540
+ function pe(e) {
529
541
  if (Array.isArray(e)) return e;
530
542
  }
531
- function pe(e, r) {
543
+ function de(e, r) {
532
544
  if (!(e instanceof r)) {
533
545
  throw new TypeError("Cannot call a class as a function");
534
546
  }
535
547
  }
536
- function de(e, r) {
548
+ function fe(e, r) {
537
549
  for (var t = 0; t < r.length; t++) {
538
550
  var n = r[t];
539
551
  n.enumerable = n.enumerable || false;
@@ -542,12 +554,12 @@
542
554
  Object.defineProperty(e, n.key, n);
543
555
  }
544
556
  }
545
- function fe(e, r, t) {
546
- if (r) de(e.prototype, r);
547
- if (t) de(e, t);
557
+ function be(e, r, t) {
558
+ if (r) fe(e.prototype, r);
559
+ if (t) fe(e, t);
548
560
  return e;
549
561
  }
550
- function be(e, r) {
562
+ function ve(e, r) {
551
563
  if (typeof r !== "function" && r !== null) {
552
564
  throw new TypeError("Super expression must either be null or a function");
553
565
  }
@@ -558,41 +570,41 @@
558
570
  configurable: true
559
571
  }
560
572
  });
561
- if (r) ve(e, r);
573
+ if (r) ye(e, r);
562
574
  }
563
- function ve(e, r) {
564
- ve = Object.setPrototypeOf || function e(r, t) {
575
+ function ye(e, r) {
576
+ ye = Object.setPrototypeOf || function e(r, t) {
565
577
  r.__proto__ = t;
566
578
  return r;
567
579
  };
568
- return ve(e, r);
580
+ return ye(e, r);
569
581
  }
570
- function ye(e) {
571
- var r = ge();
582
+ function me(e) {
583
+ var r = we();
572
584
  return function t() {
573
- var n = we(e), o;
585
+ var n = Oe(e), o;
574
586
  if (r) {
575
- var i = we(this).constructor;
587
+ var i = Oe(this).constructor;
576
588
  o = Reflect.construct(n, arguments, i);
577
589
  } else {
578
590
  o = n.apply(this, arguments);
579
591
  }
580
- return me(this, o);
592
+ return he(this, o);
581
593
  };
582
594
  }
583
- function me(e, r) {
584
- if (r && (ne(r) === "object" || typeof r === "function")) {
595
+ function he(e, r) {
596
+ if (r && (oe(r) === "object" || typeof r === "function")) {
585
597
  return r;
586
598
  }
587
- return he(e);
599
+ return ge(e);
588
600
  }
589
- function he(e) {
601
+ function ge(e) {
590
602
  if (e === void 0) {
591
603
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
592
604
  }
593
605
  return e;
594
606
  }
595
- function ge() {
607
+ function we() {
596
608
  if (typeof Reflect === "undefined" || !Reflect.construct) return false;
597
609
  if (Reflect.construct.sham) return false;
598
610
  if (typeof Proxy === "function") return true;
@@ -603,13 +615,13 @@
603
615
  return false;
604
616
  }
605
617
  }
606
- function we(e) {
607
- we = Object.setPrototypeOf ? Object.getPrototypeOf : function e(r) {
618
+ function Oe(e) {
619
+ Oe = Object.setPrototypeOf ? Object.getPrototypeOf : function e(r) {
608
620
  return r.__proto__ || Object.getPrototypeOf(r);
609
621
  };
610
- return we(e);
622
+ return Oe(e);
611
623
  }
612
- function Oe(e, r) {
624
+ function xe(e, r) {
613
625
  var t = Object.keys(e);
614
626
  if (Object.getOwnPropertySymbols) {
615
627
  var n = Object.getOwnPropertySymbols(e);
@@ -620,24 +632,24 @@
620
632
  }
621
633
  return t;
622
634
  }
623
- function xe(e) {
635
+ function Se(e) {
624
636
  for (var r = 1; r < arguments.length; r++) {
625
637
  var t = arguments[r] != null ? arguments[r] : {};
626
638
  if (r % 2) {
627
- Oe(Object(t), true).forEach((function(r) {
628
- Se(e, r, t[r]);
639
+ xe(Object(t), true).forEach((function(r) {
640
+ ke(e, r, t[r]);
629
641
  }));
630
642
  } else if (Object.getOwnPropertyDescriptors) {
631
643
  Object.defineProperties(e, Object.getOwnPropertyDescriptors(t));
632
644
  } else {
633
- Oe(Object(t)).forEach((function(r) {
645
+ xe(Object(t)).forEach((function(r) {
634
646
  Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
635
647
  }));
636
648
  }
637
649
  }
638
650
  return e;
639
651
  }
640
- function Se(e, r, t) {
652
+ function ke(e, r, t) {
641
653
  if (r in e) {
642
654
  Object.defineProperty(e, r, {
643
655
  value: t,
@@ -650,9 +662,9 @@
650
662
  }
651
663
  return e;
652
664
  }
653
- function ke(e, r) {
665
+ function je(e, r) {
654
666
  if (e == null) return {};
655
- var t = je(e, r);
667
+ var t = Ce(e, r);
656
668
  var n, o;
657
669
  if (Object.getOwnPropertySymbols) {
658
670
  var i = Object.getOwnPropertySymbols(e);
@@ -665,7 +677,7 @@
665
677
  }
666
678
  return t;
667
679
  }
668
- function je(e, r) {
680
+ function Ce(e, r) {
669
681
  if (e == null) return {};
670
682
  var t = {};
671
683
  var n = Object.keys(e);
@@ -677,7 +689,7 @@
677
689
  }
678
690
  return t;
679
691
  }
680
- var Ce = {
692
+ var Pe = {
681
693
  children: i().node,
682
694
  elementRef: i().oneOfType([ i().func, i().object ]),
683
695
  /** @private */
@@ -691,18 +703,19 @@
691
703
  selected: i().bool,
692
704
  showBorder: i().bool,
693
705
  to: i().string,
694
- value: i().any
706
+ value: i().any,
707
+ tag: i().oneOf([ "article", "div", "aside", "section" ])
695
708
  };
696
- var Pe = {
709
+ var _e = {
697
710
  openInNewContext: false,
698
711
  showBorder: true
699
712
  };
700
- function _e(e) {
713
+ function Ee(e) {
701
714
  return !!e.onClick || !!e.to;
702
715
  }
703
716
  function Te(e) {
704
- var r = e.margin, t = e.maxWidth, n = e.minWidth, o = e.showBorder, i = e.style, a = ke(e, [ "margin", "maxWidth", "minWidth", "showBorder", "style" ]);
705
- var l = xe({
717
+ var r = e.margin, t = e.maxWidth, n = e.minWidth, o = e.showBorder, i = e.style, a = je(e, [ "margin", "maxWidth", "minWidth", "showBorder", "style" ]);
718
+ var l = Se({
706
719
  minWidth: n,
707
720
  maxWidth: t,
708
721
  margin: r
@@ -714,17 +727,17 @@
714
727
  };
715
728
  return [ c, a ];
716
729
  }
717
- var Ee = function(e) {
718
- be(t, e);
719
- var r = ye(t);
730
+ var Be = function(e) {
731
+ ve(t, e);
732
+ var r = me(t);
720
733
  function t() {
721
734
  var e;
722
- pe(this, t);
735
+ de(this, t);
723
736
  for (var n = arguments.length, o = new Array(n), i = 0; i < n; i++) {
724
737
  o[i] = arguments[i];
725
738
  }
726
739
  e = r.call.apply(r, [ this ].concat(o));
727
- Se(he(e), "handleCardClick", (function(r) {
740
+ ke(ge(e), "handleCardClick", (function(r) {
728
741
  var t, n;
729
742
  var o = e.props, i = o.selected, a = o.value;
730
743
  (t = (n = e.props).onClick) === null || t === void 0 ? void 0 : t.call(n, r, {
@@ -734,15 +747,15 @@
734
747
  }));
735
748
  return e;
736
749
  }
737
- fe(t, [ {
750
+ be(t, [ {
738
751
  key: "render",
739
752
  value: function e() {
740
- if (_e(this.props)) {
741
- var r = Te(this.props), t = ie(r, 2), o = t[0], i = t[1];
753
+ if (Ee(this.props)) {
754
+ var r = Te(this.props), t = ae(r, 2), o = t[0], i = t[1];
742
755
  var a = o.showBorder;
743
- var l = i.children, c = i.elementRef, s = i.onClick, u = i.openInNewContext, p = i.selected, d = i.to, f = ke(i, [ "children", "elementRef", "onClick", "openInNewContext", "selected", "to" ]);
756
+ var l = i.children, c = i.elementRef, s = i.onClick, u = i.openInNewContext, p = i.selected, d = i.to, f = je(i, [ "children", "elementRef", "onClick", "openInNewContext", "selected", "to" ]);
744
757
 
745
- return n().createElement(re, oe({
758
+ return n().createElement(te, ie({
746
759
  "data-clickable": true,
747
760
  $selected: p || false,
748
761
  $cardHasBorder: a,
@@ -751,27 +764,30 @@
751
764
  onClick: s ? this.handleCardClick : undefined,
752
765
  openInNewContext: u,
753
766
  to: d || undefined
754
- }), n().createElement(te, null, l));
767
+ }), n().createElement(ne, null, l));
755
768
  }
756
- var b = Te(this.props), v = ie(b, 2), y = v[0], m = v[1];
769
+ var b = Te(this.props), v = ae(b, 2), y = v[0], m = v[1];
757
770
  var h = y.showBorder;
758
- var g = m.children, w = m.elementRef, O = ke(m, [ "children", "elementRef" ]);
771
+ var g = m.children, w = m.elementRef, O = m.tag, x = je(m, [ "children", "elementRef", "tag" ]);
759
772
 
760
- return n().createElement(ee, oe({
773
+ return n().createElement(re, ie({
761
774
  $selected: false,
762
775
  $cardHasBorder: h,
763
- ref: w
764
- }, y, O), g);
776
+ ref: w,
777
+ as: O
778
+ }, y, x, {
779
+ onClick: undefined
780
+ }), g);
765
781
  }
766
782
  } ]);
767
783
  return t;
768
784
  }(t.Component);
769
- Se(Ee, "propTypes", Ce);
770
- Se(Ee, "defaultProps", Pe);
771
- Se(Ee, "Header", Q);
772
- Se(Ee, "Body", m);
773
- Se(Ee, "Footer", k);
774
- /* harmony default export */ const Be = Ee;
785
+ ke(Be, "propTypes", Pe);
786
+ ke(Be, "defaultProps", _e);
787
+ ke(Be, "Header", Q);
788
+ ke(Be, "Body", m);
789
+ ke(Be, "Footer", k);
790
+ /* harmony default export */ const Re = Be;
775
791
  // CONCATENATED MODULE: ./src/Card/index.ts
776
792
  module.exports = r;
777
793
  /******/})();