pebble-web 3.0.0-alpha.0 → 3.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/dist/components/typings/Button.d.ts +1 -0
  2. package/dist/components/typings/Calendar.d.ts +1 -0
  3. package/dist/components/typings/CheckboxGroup.d.ts +1 -0
  4. package/dist/components/typings/Control.d.ts +1 -0
  5. package/dist/components/typings/DateInput.d.ts +1 -0
  6. package/dist/components/typings/Dropdown.d.ts +1 -0
  7. package/dist/components/typings/Input.d.ts +1 -0
  8. package/dist/components/typings/Loader.d.ts +1 -0
  9. package/dist/components/typings/Message.d.ts +1 -0
  10. package/dist/components/typings/OptionGroup.d.ts +1 -0
  11. package/dist/components/typings/OptionGroupCheckBox.d.ts +1 -0
  12. package/dist/components/typings/OptionGroupRadio.d.ts +1 -0
  13. package/dist/components/typings/PhoneNumberInput.d.ts +1 -0
  14. package/dist/components/typings/PopUp.d.ts +1 -0
  15. package/dist/components/typings/RadioGroup.d.ts +1 -0
  16. package/dist/components/typings/Search.d.ts +1 -0
  17. package/dist/components/typings/SecondaryInput.d.ts +1 -0
  18. package/dist/components/typings/Select.d.ts +1 -0
  19. package/dist/components/typings/Text.d.ts +1 -0
  20. package/dist/components/typings/Typeahead.d.ts +1 -0
  21. package/dist/index.d.ts +1 -0
  22. package/dist/pebble-web.dev.js +401 -179
  23. package/dist/pebble-web.dev.js.map +1 -1
  24. package/dist/pebble-web.es.dev.js +283 -85
  25. package/dist/pebble-web.es.dev.js.map +1 -1
  26. package/dist/pebble-web.es.js +277 -79
  27. package/dist/pebble-web.es.js.map +1 -1
  28. package/dist/pebble-web.js +395 -173
  29. package/dist/pebble-web.js.map +1 -1
  30. package/dist/pebble-web.module.dev.js +390 -180
  31. package/dist/pebble-web.module.dev.js.map +1 -1
  32. package/dist/pebble-web.module.js +384 -174
  33. package/dist/pebble-web.module.js.map +1 -1
  34. package/dist/pebble-web.umd.dev.js +409 -181
  35. package/dist/pebble-web.umd.dev.js.map +1 -1
  36. package/dist/pebble-web.umd.js +403 -175
  37. package/dist/pebble-web.umd.js.map +1 -1
  38. package/dist/utils/animation.d.ts +2 -19
  39. package/dist/utils/index.d.ts +1 -0
  40. package/dist/utils/testIds.d.ts +65 -0
  41. package/dist/utils/useragent/index.d.ts +1 -2
  42. package/package.json +3 -4
  43. package/src/components/Button.tsx +3 -1
  44. package/src/components/Calendar.tsx +28 -4
  45. package/src/components/CheckboxGroup.tsx +13 -3
  46. package/src/components/DateInput.tsx +3 -1
  47. package/src/components/DropDown.tsx +3 -1
  48. package/src/components/Input.tsx +15 -3
  49. package/src/components/Loader.tsx +3 -1
  50. package/src/components/Logo.tsx +22 -15
  51. package/src/components/Message.tsx +3 -1
  52. package/src/components/NativeDateInput.tsx +2 -1
  53. package/src/components/OptionGroupCheckBox.tsx +14 -2
  54. package/src/components/PhoneNumberInput.tsx +7 -1
  55. package/src/components/PopUp.tsx +7 -1
  56. package/src/components/RadioGroup.tsx +24 -4
  57. package/src/components/Search.tsx +3 -1
  58. package/src/components/SecondaryInput.tsx +9 -2
  59. package/src/components/Select.tsx +13 -1
  60. package/src/components/Tabs.tsx +1 -1
  61. package/src/components/Text.tsx +7 -2
  62. package/src/components/TimePicker.tsx +2 -2
  63. package/src/components/Toast.tsx +2 -2
  64. package/src/components/TypeAhead.tsx +14 -3
  65. package/src/components/__tests__/__snapshots__/checkboxGroup.test.tsx.snap +88 -0
  66. package/src/components/__tests__/__snapshots__/logo.test.tsx.snap +55 -12
  67. package/src/components/__tests__/__snapshots__/optionGroup.test.tsx.snap +0 -3
  68. package/src/components/__tests__/__snapshots__/select.test.tsx.snap +3 -0
  69. package/src/components/__tests__/__snapshots__/timepicker.test.tsx.snap +18 -18
  70. package/src/components/__tests__/calendar.test.tsx +6 -24
  71. package/src/components/__tests__/checkboxGroup.test.tsx +39 -8
  72. package/src/components/__tests__/select.test.tsx +19 -30
  73. package/src/components/__tests__/timepicker.test.tsx +4 -14
  74. package/src/components/shared/Control.tsx +3 -1
  75. package/src/components/shared/MountTransition.tsx +7 -3
  76. package/src/components/shared/OptionGroup.tsx +23 -5
  77. package/src/components/typings/Button.ts +1 -0
  78. package/src/components/typings/Calendar.ts +1 -0
  79. package/src/components/typings/CheckboxGroup.ts +1 -0
  80. package/src/components/typings/Control.ts +1 -0
  81. package/src/components/typings/DateInput.ts +1 -0
  82. package/src/components/typings/Dropdown.ts +1 -0
  83. package/src/components/typings/Input.ts +1 -0
  84. package/src/components/typings/Loader.ts +1 -0
  85. package/src/components/typings/Message.ts +1 -0
  86. package/src/components/typings/OptionGroup.ts +1 -0
  87. package/src/components/typings/OptionGroupCheckBox.ts +1 -0
  88. package/src/components/typings/OptionGroupRadio.ts +1 -0
  89. package/src/components/typings/PhoneNumberInput.ts +1 -0
  90. package/src/components/typings/PopUp.ts +1 -0
  91. package/src/components/typings/RadioGroup.ts +1 -0
  92. package/src/components/typings/Search.ts +1 -0
  93. package/src/components/typings/SecondaryInput.ts +1 -0
  94. package/src/components/typings/Select.ts +1 -0
  95. package/src/components/typings/Text.ts +1 -0
  96. package/src/components/typings/Typeahead.ts +1 -0
  97. package/src/index.ts +1 -0
  98. package/src/utils/animation.ts +3 -3
  99. package/src/utils/index.ts +1 -0
  100. package/src/utils/testIds.ts +119 -0
  101. package/src/utils/useragent/index.tsx +1 -1
  102. package/src/.DS_Store +0 -0
@@ -431,7 +431,8 @@ const spinnerStyle = /*#__PURE__*/css({ ...flexSpaceBetween,
431
431
  const Loader = ({
432
432
  color = colors.gray.darker,
433
433
  scale = 1,
434
- className
434
+ className,
435
+ testId
435
436
  }) => {
436
437
  const style = {
437
438
  backgroundColor: color
@@ -440,7 +441,8 @@ const Loader = ({
440
441
  className: cx(spinnerStyle, className),
441
442
  style: {
442
443
  transform: `scale(${scale})`
443
- }
444
+ },
445
+ "data-testid": testId
444
446
  }, /*#__PURE__*/createElement("div", {
445
447
  style: style
446
448
  }), /*#__PURE__*/createElement("div", {
@@ -462,7 +464,8 @@ const Button = ({
462
464
  loading,
463
465
  outline,
464
466
  size = "small",
465
- buttonProps
467
+ buttonProps,
468
+ testId
466
469
  }) => {
467
470
  const disableAction = disabled || loading;
468
471
  const _outline = size === "x-small" || !!outline;
@@ -473,7 +476,8 @@ const Button = ({
473
476
  style: {
474
477
  width
475
478
  },
476
- disabled: disabled
479
+ disabled: disabled,
480
+ "data-testid": testId
477
481
  }, buttonProps), loading ? /*#__PURE__*/createElement(Loader, {
478
482
  color: colors.white.base,
479
483
  scale: 0.4
@@ -621,6 +625,76 @@ const buttonsWrapper = /*#__PURE__*/css({ ...flexSpaceBetween,
621
625
  marginTop: 20
622
626
  }, ";label:buttonsWrapper;" + ( "" ));
623
627
 
628
+ function getTestIds(id, builder) {
629
+ return id ? builder(id) : {};
630
+ }
631
+ function getOptionTestId(id, index) {
632
+ return `${id}-${index}`;
633
+ }
634
+ function getRadioGroupTestIds(id) {
635
+ return {
636
+ optionId: `${id}-option`
637
+ };
638
+ }
639
+ function getOptionGroupTestIds(id) {
640
+ return {
641
+ searchBoxId: `${id}-search`,
642
+ optionId: `${id}-option`,
643
+ selectVisibleId: `${id}-select-visible`,
644
+ clearVisibleId: `${id}-clear-visible`
645
+ };
646
+ }
647
+ const getOptionGroupRadioTestIds = id => getOptionGroupTestIds(id);
648
+ function getOptionGroupCheckBoxTestIds(id) {
649
+ return {
650
+ applyButtonId: `${id}-apply-btn`,
651
+ clearButtonId: `${id}-clear-btn`,
652
+ ...getOptionGroupTestIds(id)
653
+ };
654
+ }
655
+ function getPhoneNumberInputTestIds(id) {
656
+ return {
657
+ phoneId: `${id}-phone`,
658
+ countryId: `${id}-country`,
659
+ countryInputIds: getSelectInputTestIds(`${id}-country`)
660
+ };
661
+ }
662
+ function getMessageTestId(id) {
663
+ return `${id}-message`;
664
+ }
665
+ function getSelectInputTestIds(id, multiSelect = false) {
666
+ const optionGroupId = `${id}-option-group`;
667
+ const baseIds = {
668
+ inputId: `${id}-input`,
669
+ optionGroupId
670
+ };
671
+ return { ...(multiSelect ? getOptionGroupCheckBoxTestIds(optionGroupId) : getOptionGroupRadioTestIds(optionGroupId)),
672
+ ...baseIds
673
+ };
674
+ }
675
+ function getTypeaheadTestIds(id) {
676
+ const optionGroupId = `${id}-option-group`;
677
+ return {
678
+ optionGroupId,
679
+ ...getOptionGroupRadioTestIds(optionGroupId)
680
+ };
681
+ }
682
+ function getCalendarTestIds(id) {
683
+ return {
684
+ leftIconId: `${id}-left-icon`,
685
+ rightIconId: `${id}-right-icon`,
686
+ applyButtonId: `${id}-apply-btn`,
687
+ clearButtonId: `${id}-clear-btn`
688
+ };
689
+ }
690
+ function getPopUpTestIds(id) {
691
+ return {
692
+ closeButtonId: `${id}-close-btn`,
693
+ approveButtonId: `${id}-approve-btn`,
694
+ rejectButtonId: `${id}-reject-btn`
695
+ };
696
+ }
697
+
624
698
  class Calendar extends PureComponent {
625
699
  constructor() {
626
700
  super(...arguments);
@@ -734,11 +808,18 @@ class Calendar extends PureComponent {
734
808
  onClear,
735
809
  maxDate,
736
810
  minDate,
811
+ testId,
737
812
  ...rest
738
813
  } = this.props;
739
814
  const {
740
815
  maxRangeDates
741
816
  } = this.state;
817
+ const {
818
+ leftIconId,
819
+ rightIconId,
820
+ clearButtonId,
821
+ applyButtonId
822
+ } = getTestIds(testId, id => getCalendarTestIds(id));
742
823
  return /*#__PURE__*/createElement("div", {
743
824
  className: cx(wrapperStyle, {
744
825
  [/*#__PURE__*/css( {
@@ -763,13 +844,15 @@ class Calendar extends PureComponent {
763
844
  style: {
764
845
  fontSize: 14
765
846
  },
766
- className: "pi pi-chevron-left"
847
+ className: "pi pi-chevron-left",
848
+ "data-testid": leftIconId
767
849
  }),
768
850
  nextLabel: /*#__PURE__*/createElement("i", {
769
851
  style: {
770
852
  fontSize: 14
771
853
  },
772
- className: "pi pi-arrow-right"
854
+ className: "pi pi-arrow-right",
855
+ "data-testid": rightIconId
773
856
  }),
774
857
  maxDate: maxDate || maxRangeDates && maxRangeDates.future,
775
858
  minDate: minDate || maxRangeDates && maxRangeDates.past
@@ -777,9 +860,11 @@ class Calendar extends PureComponent {
777
860
  className: buttonsWrapper
778
861
  }, onClear && /*#__PURE__*/createElement(Button, {
779
862
  onClick: this.onClear,
780
- type: "secondary"
863
+ type: "secondary",
864
+ testId: clearButtonId
781
865
  }, "Clear"), onApply && /*#__PURE__*/createElement(Button, {
782
- onClick: this.onApply
866
+ onClick: this.onApply,
867
+ testId: applyButtonId
783
868
  }, "Apply")));
784
869
  }
785
870
  }
@@ -817,7 +902,8 @@ function Control(props) {
817
902
  children = ControlView,
818
903
  type,
819
904
  className,
820
- indeterminate
905
+ indeterminate,
906
+ testId
821
907
  } = props;
822
908
  return /*#__PURE__*/createElement("div", {
823
909
  className: cx(controlStyle, className),
@@ -830,7 +916,8 @@ function Control(props) {
830
916
  onClick: !disabled ? e => onChange && onChange({
831
917
  value,
832
918
  checked: !checked
833
- }, e) : undefined
919
+ }, e) : undefined,
920
+ "data-testid": testId
834
921
  }, children(props));
835
922
  }
836
923
  const ControlView = ({
@@ -906,14 +993,17 @@ class CheckboxGroup extends PureComponent {
906
993
  selected,
907
994
  className,
908
995
  name,
909
- disabled
996
+ disabled,
997
+ testId
910
998
  } = this.props;
911
- const _children = Children.map(children, _checkbox => {
999
+ const _children = Children.map(children, (_checkbox, i) => {
1000
+ const index = typeof i === "number" ? i : 0;
912
1001
  const checkbox = _checkbox;
913
1002
  return cloneElement(checkbox, {
914
1003
  onChange: this.handleChange,
915
1004
  checked: selected.indexOf(checkbox.props.value) >= 0,
916
- disabled
1005
+ disabled,
1006
+ testId: testId ? getOptionTestId(testId, index) : undefined
917
1007
  });
918
1008
  });
919
1009
  return /*#__PURE__*/createElement("div", {
@@ -1002,8 +1092,7 @@ const animationConfig = {
1002
1092
  };
1003
1093
 
1004
1094
  const MountTransition = props => {
1005
- return /*#__PURE__*/createElement(Transition
1006
- , Object.assign({
1095
+ return /*#__PURE__*/createElement(Transition, Object.assign({
1007
1096
  items: props.visible
1008
1097
  }, animationConfig, props), (styles, show, {
1009
1098
  phase
@@ -1037,7 +1126,8 @@ class DropDown extends PureComponent {
1037
1126
  disabled,
1038
1127
  labelClassName,
1039
1128
  controlled,
1040
- onOutsideClick
1129
+ onOutsideClick,
1130
+ testId
1041
1131
  } = this.props;
1042
1132
  const _isDropDownOpen = controlled ? !!this.props.isOpen : this.state.isOpen;
1043
1133
  return /*#__PURE__*/createElement(OutsideClick, {
@@ -1065,7 +1155,8 @@ class DropDown extends PureComponent {
1065
1155
  isOpen: _isDropDownOpen,
1066
1156
  onClick: this.toggleDropdown,
1067
1157
  disabled: disabled,
1068
- className: labelClassName
1158
+ className: labelClassName,
1159
+ testId: testId
1069
1160
  }, buttonLabel))), /*#__PURE__*/createElement(MountTransition, {
1070
1161
  visible: _isDropDownOpen
1071
1162
  }, transitionStyles => /*#__PURE__*/createElement(animated.div, {
@@ -1273,7 +1364,8 @@ class Input extends PureComponent {
1273
1364
  onClick,
1274
1365
  loading,
1275
1366
  leftElement,
1276
- rightElement
1367
+ rightElement,
1368
+ testId
1277
1369
  } = this.props;
1278
1370
  const {
1279
1371
  isFocused
@@ -1313,9 +1405,13 @@ class Input extends PureComponent {
1313
1405
  onClick: onClick
1314
1406
  }, /*#__PURE__*/createElement("div", {
1315
1407
  className: _inputWrapperClassName
1316
- }, leftElement === null || leftElement === void 0 ? void 0 : leftElement(), this.props.textArea ? /*#__PURE__*/createElement("textarea", Object.assign({}, _inputProps, this.props.inputProps)) : /*#__PURE__*/createElement("input", Object.assign({
1408
+ }, leftElement === null || leftElement === void 0 ? void 0 : leftElement(), this.props.textArea ? /*#__PURE__*/createElement("textarea", Object.assign({}, _inputProps, this.props.inputProps, {
1409
+ "data-testid": testId
1410
+ })) : /*#__PURE__*/createElement("input", Object.assign({
1317
1411
  type: type
1318
- }, _inputProps, this.props.inputProps)), loading && /*#__PURE__*/createElement(Loader, {
1412
+ }, _inputProps, this.props.inputProps, {
1413
+ "data-testid": testId
1414
+ })), loading && /*#__PURE__*/createElement(Loader, {
1319
1415
  color: colors.violet.base,
1320
1416
  scale: 0.6,
1321
1417
  className: _loadingStyle
@@ -1332,6 +1428,7 @@ class Input extends PureComponent {
1332
1428
  }
1333
1429
  }), _message && /*#__PURE__*/createElement("div", {
1334
1430
  className: messageStyle,
1431
+ "data-testid": testId ? getMessageTestId(testId) : undefined,
1335
1432
  style: {
1336
1433
  color: getColor(errorMessage, successMessage)
1337
1434
  }
@@ -1356,7 +1453,8 @@ class NativeDateInput extends PureComponent {
1356
1453
  inputProps,
1357
1454
  placeholder,
1358
1455
  value,
1359
- disabled
1456
+ disabled,
1457
+ testId
1360
1458
  } = this.props;
1361
1459
  return /*#__PURE__*/createElement(Input, Object.assign({
1362
1460
  onChange: this.onDateInputChange,
@@ -1366,7 +1464,8 @@ class NativeDateInput extends PureComponent {
1366
1464
  placeholder: placeholder,
1367
1465
  fixLabelAtTop: true
1368
1466
  }, inputProps, {
1369
- disabled: disabled
1467
+ disabled: disabled,
1468
+ testId: testId
1370
1469
  }));
1371
1470
  }
1372
1471
  }
@@ -1455,7 +1554,8 @@ class DateInput extends PureComponent {
1455
1554
  initiallyOpen,
1456
1555
  onOutsideClick,
1457
1556
  controlled,
1458
- isOpen
1557
+ isOpen,
1558
+ testId
1459
1559
  } = this.props;
1460
1560
  const _wrapperClassName = cx(wrapperStyle$3, wrapperClassName);
1461
1561
  const _dropDownClassName = cx(dropDownClassName, this.props.dropDownClassName);
@@ -1487,7 +1587,8 @@ class DateInput extends PureComponent {
1487
1587
  onChange
1488
1588
  },
1489
1589
  className: cx(inputStyle$1, inputProps && inputProps.className),
1490
- disabled: disabled
1590
+ disabled: disabled,
1591
+ testId: testId
1491
1592
  }))),
1492
1593
  className: _wrapperClassName,
1493
1594
  placement: placement,
@@ -1552,25 +1653,52 @@ const Logo = ({
1552
1653
  return /*#__PURE__*/createElement("svg", {
1553
1654
  version: "1.1",
1554
1655
  id: "Layer_1",
1555
- xmlnsXlink: "http://www.w3.org/1999/xlink",
1656
+ xmlns: "http://www.w3.org/2000/svg",
1556
1657
  height: height,
1557
- viewBox: "0 0 655.35 175.08",
1658
+ viewBox: "0 0 896 240",
1558
1659
  xmlSpace: "preserve",
1559
1660
  style: {
1560
1661
  fill: color
1561
1662
  }
1562
1663
  }, /*#__PURE__*/createElement("path", {
1563
- className: "st0",
1564
- d: "M168.92 65.96l-66.1-64.85v100.61h17.39V40.78l66.11 64.56V4.73h-17.4v61.23zm446.77-18.51L653.4 4.73h-20.6l-41.04 46.48V4.73h-17.4v96.99h17.4V73.34L604 59.84l30.19 41.88h20.33l-38.83-54.27zM422.66 2.92c-27.78 0-50.31 22.53-50.31 50.31s22.52 50.3 50.31 50.3c27.78 0 50.3-22.52 50.3-50.3s-22.52-50.31-50.3-50.31zm0 84.84c-19.05 0-34.54-15.49-34.54-34.53s15.49-34.54 34.54-34.54c19.04 0 34.54 15.49 34.54 34.54 0 19.04-15.5 34.53-34.54 34.53zM0 101.72h18.38L27 82.93h41.75l8.63 18.79h18.51L48.02 0 0 101.72zM33.55 67.9l14.32-31.58L62.21 67.9H33.55zm159.61 33.82h18.37l8.62-18.79h41.75l8.62 18.79h18.51L241.16 0l-48 101.72zm33.53-33.82l14.33-31.58 14.33 31.58h-28.66zm138.43-32.42c0-8.76-3.07-16-9.19-21.84-6.12-5.99-13.5-8.91-22.26-8.91h-37.71v96.99h17.4V67.21h17.25l20.73 34.51h19.62l-23.51-38.68c10.57-4.46 17.67-14.89 17.67-27.56zm-33.25 16.15h-18.51V20.46h19.9c8.34 0 14.6 6.4 14.6 15.31 0 9.32-6.54 15.86-15.99 15.86zm197.61-32.94c9.22 0 17.9 3.59 24.42 10.12l11.15-11.15c-9.82-9.83-22.7-14.74-35.57-14.74-12.87 0-25.75 4.91-35.56 14.74-19.65 19.64-19.65 51.49 0 71.14 9.82 9.82 22.69 14.73 35.56 14.73 12.87 0 25.75-4.91 35.57-14.73L553.9 77.65c-6.52 6.52-15.2 10.11-24.42 10.11-9.23 0-17.89-3.59-24.42-10.11-13.46-13.46-13.46-35.37 0-48.84 6.53-6.52 15.2-10.12 24.42-10.12z"
1565
- }), /*#__PURE__*/createElement("rect", {
1566
- y: "123.84",
1567
- className: "st1",
1568
- width: "654.52",
1569
- height: "4.26",
1570
- id: "XMLID_9_"
1664
+ d: "M724.793 25.5855C737.421 25.5855 749.287 30.5009 758.217 39.4306L773.482 24.1653C760.041 10.7247 742.412 3.9979 724.793 3.9979C707.167 3.9979 689.548 10.7247 676.104 24.1653C649.213 51.0595 649.213 94.6559 676.104 121.55C689.548 134.997 707.167 141.718 724.793 141.718C742.412 141.718 760.041 134.997 773.482 121.55L758.217 106.282C749.287 115.211 737.421 120.127 724.793 120.127C712.164 120.127 700.292 115.211 691.369 106.282C672.938 87.8567 672.938 57.862 691.369 39.4306C700.292 30.5009 712.164 25.5855 724.793 25.5855ZM454.269 70.6648H428.936V27.9989H456.173C467.598 27.9989 476.175 36.7608 476.175 48.9553C476.175 61.7153 467.223 70.6648 454.269 70.6648ZM499.795 48.574C499.795 36.5735 495.603 26.6639 487.219 18.668C478.842 10.4748 468.748 6.47692 456.741 6.47692H405.123V139.238H428.936V91.9992H452.549L480.936 139.238H507.798L475.6 86.2818C490.076 80.1928 499.795 65.9106 499.795 48.574ZM310.299 92.9528L329.921 49.7214L349.542 92.9528H310.299ZM264.398 139.238H289.54L301.346 113.525H358.495L370.302 139.238H395.634L330.108 -0.000120201L264.398 139.238ZM578.561 120.127C552.499 120.127 531.292 98.9234 531.292 72.8609C531.292 46.7919 552.499 25.5855 578.561 25.5855C604.63 25.5855 625.836 46.7919 625.836 72.8609C625.836 98.9234 604.63 120.127 578.561 120.127ZM578.561 3.9979C540.528 3.9979 509.705 34.8243 509.705 72.8609C509.705 110.888 540.528 141.718 578.561 141.718C616.594 141.718 647.424 110.888 647.424 72.8609C647.424 34.8243 616.594 3.9979 578.561 3.9979ZM842.789 64.9504L894.414 6.47692H866.221L810.029 70.096V6.47692H786.216V139.238H810.029V100.383L826.797 81.909L868.128 139.238H895.933L842.789 64.9504ZM231.211 90.2831L140.73 1.5221V139.238H164.544V55.8104L255.018 144.19V6.47692H231.211"
1665
+ }), /*#__PURE__*/createElement("path", {
1666
+ d: "M0 175.342H895.934V169.516H0V175.342Z"
1667
+ }), /*#__PURE__*/createElement("path", {
1668
+ d: "M123.257 205.481H131.5L140.374 229.384L149.244 205.481H157.289L143.566 239.661H136.981"
1669
+ }), /*#__PURE__*/createElement("path", {
1670
+ d: "M185.313 225.215L180.802 214.207L176.295 225.215H185.313ZM177.459 205.241H184.34L198.889 239.418H191.08L187.98 231.807H173.628L170.525 239.418H162.91"
1671
+ }), /*#__PURE__*/createElement("path", {
1672
+ d: "M210.792 205.481H218.255V232.632H235.178V239.421H210.792"
1673
+ }), /*#__PURE__*/createElement("path", {
1674
+ d: "M261.157 239.951C256.6 239.951 253.013 238.691 250.396 236.17C247.779 233.648 246.467 229.887 246.467 224.876V205.478H253.933V224.679C253.933 227.46 254.578 229.555 255.873 230.959C257.165 232.363 258.957 233.066 261.252 233.066C263.55 233.066 265.342 232.386 266.634 231.034C267.923 229.67 268.577 227.638 268.577 224.922V205.478H276.041V224.633C276.041 227.217 275.689 229.463 274.998 231.37C274.301 233.28 273.308 234.871 272.016 236.144C270.724 237.422 269.156 238.373 267.311 239.007C265.47 239.635 263.419 239.951 261.157 239.951Z"
1675
+ }), /*#__PURE__*/createElement("path", {
1676
+ d: "M291.032 205.481H316.581V212.126H298.4V219.011H314.401V225.649H298.4V232.78H316.825V239.421H291.032"
1677
+ }), /*#__PURE__*/createElement("path", {
1678
+ d: "M342.69 239.905C340.106 239.905 337.567 239.458 335.082 238.57C332.59 237.682 330.328 236.318 328.292 234.477L332.705 229.193C334.253 230.449 335.848 231.455 337.482 232.195C339.109 232.941 340.898 233.309 342.835 233.309C344.386 233.309 345.59 233.03 346.445 232.464C347.303 231.896 347.737 231.113 347.737 230.11V230.015C347.737 229.528 347.641 229.101 347.467 228.729C347.286 228.358 346.948 228.009 346.445 227.687C345.945 227.365 345.251 227.039 344.36 226.717C343.476 226.395 342.322 226.057 340.898 225.698C339.182 225.281 337.633 224.81 336.242 224.294C334.855 223.778 333.671 223.14 332.705 222.377C331.728 221.618 330.982 220.674 330.449 219.537C329.917 218.412 329.647 217.005 329.647 215.325V215.226C329.647 213.678 329.936 212.274 330.518 211.035C331.094 209.785 331.903 208.717 332.945 207.809C333.99 206.905 335.24 206.208 336.69 205.725C338.136 205.245 339.734 204.995 341.48 204.995C343.965 204.995 346.257 205.366 348.338 206.109C350.423 206.859 352.34 207.924 354.079 209.312L350.202 214.94C348.683 213.901 347.201 213.086 345.744 212.488C344.291 211.889 342.834 211.59 341.381 211.59C339.928 211.59 338.837 211.88 338.11 212.438C337.38 213.007 337.018 213.708 337.018 214.549V214.648C337.018 215.197 337.12 215.67 337.334 216.075C337.544 216.482 337.923 216.844 338.472 217.166C339.024 217.488 339.774 217.797 340.727 218.087C341.677 218.379 342.884 218.721 344.34 219.106C346.05 219.556 347.582 220.066 348.92 220.632C350.262 221.2 351.393 221.874 352.313 222.67C353.234 223.462 353.928 224.386 354.398 225.455C354.865 226.523 355.105 227.802 355.105 229.285V229.387C355.105 231.067 354.799 232.553 354.187 233.868C353.576 235.177 352.724 236.275 351.636 237.169C350.541 238.057 349.239 238.731 347.727 239.201C346.208 239.671 344.534 239.905 342.69 239.905Z"
1679
+ }), /*#__PURE__*/createElement("path", {
1680
+ d: "M406.346 233.119C407.835 233.119 409.206 232.842 410.469 232.29C411.728 231.744 412.8 230.988 413.691 230.012C414.578 229.042 415.272 227.92 415.775 226.642C416.275 225.369 416.528 224.001 416.528 222.545V222.45C416.528 220.993 416.275 219.625 415.775 218.33C415.272 217.038 414.562 215.904 413.641 214.94C412.718 213.967 411.629 213.198 410.37 212.632C409.108 212.07 407.733 211.787 406.247 211.787C404.728 211.787 403.347 212.057 402.104 212.609C400.858 213.162 399.793 213.914 398.905 214.888C398.014 215.858 397.321 216.979 396.821 218.258C396.315 219.533 396.065 220.901 396.065 222.358V222.45C396.065 223.906 396.315 225.28 396.821 226.572C397.321 227.865 398.031 228.996 398.951 229.966C399.872 230.932 400.957 231.702 402.203 232.267C403.446 232.836 404.827 233.119 406.346 233.119ZM406.247 240C403.63 240 401.22 239.54 399.027 238.619C396.828 237.698 394.927 236.452 393.329 234.884C391.728 233.316 390.485 231.475 389.594 229.361C388.707 227.24 388.266 224.975 388.266 222.545V222.45C388.266 220.026 388.713 217.755 389.617 215.641C390.522 213.52 391.778 211.659 393.379 210.061C394.98 208.46 396.883 207.204 399.096 206.28C401.309 205.36 403.729 204.903 406.346 204.903C408.963 204.903 411.373 205.36 413.569 206.28C415.769 207.204 417.666 208.447 419.267 210.015C420.865 211.583 422.107 213.421 422.998 215.539C423.886 217.659 424.333 219.931 424.333 222.358V222.45C424.333 224.876 423.88 227.141 422.972 229.262C422.068 231.379 420.819 233.24 419.217 234.838C417.62 236.436 415.709 237.698 413.497 238.619C411.281 239.54 408.867 240 406.247 240Z"
1681
+ }), /*#__PURE__*/createElement("path", {
1682
+ d: "M433.024 205.481H441.263L450.137 229.384L459.011 205.481H467.056L453.333 239.661H446.744"
1571
1683
  }), /*#__PURE__*/createElement("path", {
1572
- className: "st0",
1573
- d: "M90.05 150.11h6.02l6.48 17.46 6.48-17.46h5.88l-10.02 24.97h-4.81l-10.03-24.97zm39.59-.17h5.03l10.63 24.97h-5.7l-2.28-5.56h-10.47l-2.27 5.56h-5.56l10.62-24.97zm5.75 14.59l-3.3-8.04-3.29 8.04h6.59zM154 150.11h5.46v19.83h12.36v4.96H154v-24.79zm36.79 25.18c-3.33 0-5.95-.92-7.86-2.76-1.91-1.83-2.87-4.59-2.87-8.25v-14.16h5.46v14.02c0 2.03.46 3.56 1.41 4.58.94 1.03 2.26 1.54 3.93 1.54 1.68 0 2.98-.49 3.93-1.49.95-.99 1.42-2.48 1.42-4.46v-14.2h5.46v13.99c0 1.88-.26 3.53-.77 4.92-.51 1.39-1.23 2.55-2.17 3.49-.95.93-2.08 1.63-3.44 2.08-1.35.47-2.85.7-4.5.7zm21.83-25.18h18.66v4.85H218v5.03h11.7v4.85H218v5.2h13.46v4.86h-18.84v-24.79zm37.74 25.15c-1.89 0-3.75-.33-5.57-.98-1.82-.65-3.47-1.64-4.94-2.99l3.21-3.86c1.14.92 2.3 1.65 3.49 2.19 1.2.54 2.51.82 3.91.82 1.13 0 2.01-.21 2.64-.62.63-.41.94-.99.94-1.72v-.07c0-.36-.07-.67-.19-.94-.14-.27-.39-.53-.75-.77-.36-.23-.87-.47-1.52-.71s-1.49-.48-2.53-.74c-1.26-.31-2.38-.64-3.4-1.03-1.01-.38-1.88-.84-2.59-1.4a5.85 5.85 0 0 1-1.65-2.07c-.38-.82-.58-1.86-.58-3.08v-.07c0-1.13.21-2.16.63-3.07.42-.91 1.01-1.7 1.78-2.35.76-.66 1.67-1.17 2.73-1.52 1.06-.35 2.23-.54 3.5-.54 1.83 0 3.5.28 5.02.82 1.52.54 2.92 1.32 4.19 2.34l-2.83 4.11c-1.1-.76-2.2-1.35-3.26-1.79-1.06-.44-2.12-.66-3.19-.66-1.06 0-1.85.21-2.38.62-.53.41-.8.93-.8 1.54v.07c0 .4.08.75.23 1.04.15.29.43.56.84.79.39.24.94.46 1.64.67.7.21 1.57.47 2.63.75 1.26.33 2.37.7 3.35 1.11.98.41 1.81.91 2.48 1.49.68.58 1.18 1.25 1.52 2.04.34.78.52 1.71.52 2.8v.07c0 1.22-.23 2.32-.67 3.27a6.71 6.71 0 0 1-1.86 2.41c-.81.65-1.76 1.14-2.87 1.48-1.11.37-2.33.55-3.67.55zm46.42.07c-1.92 0-3.68-.34-5.28-1.01-1.61-.67-3-1.58-4.16-2.72-1.17-1.15-2.08-2.5-2.73-4.04-.65-1.55-.98-3.2-.98-4.98v-.07c0-1.77.32-3.42.99-4.97a12.64 12.64 0 0 1 2.74-4.07c1.16-1.17 2.57-2.09 4.18-2.77 1.62-.67 3.39-1.01 5.3-1.01 1.91 0 3.67.34 5.28 1.01 1.61.68 2.99 1.59 4.16 2.73 1.16 1.14 2.07 2.49 2.73 4.04.64 1.54.97 3.21.97 4.98v.07c0 1.77-.33 3.43-.99 4.98-.67 1.55-1.57 2.9-2.74 4.07-1.17 1.17-2.56 2.08-4.18 2.76-1.61.66-3.37 1-5.29 1zm.08-5.03c1.08 0 2.09-.2 3.01-.6.92-.4 1.71-.95 2.35-1.66.65-.71 1.16-1.53 1.53-2.47.36-.93.54-1.93.54-2.99v-.07c0-1.06-.18-2.06-.54-3.01-.36-.94-.89-1.77-1.56-2.47a7.49 7.49 0 0 0-2.39-1.68c-.91-.41-1.93-.62-3.01-.62-1.11 0-2.12.21-3.03.6-.91.4-1.69.96-2.34 1.66a7.76 7.76 0 0 0-1.52 2.46c-.37.94-.55 1.94-.55 3v.07c0 1.06.18 2.07.55 3.02.36.94.88 1.76 1.55 2.47.67.71 1.47 1.27 2.38 1.68.91.4 1.91.61 3.03.61zm19.48-20.19h6.02l6.48 17.46 6.48-17.46h5.88l-10.02 24.97h-4.81l-10.03-24.97zm33.54 0h18.66v4.85h-13.28v5.03h11.68v4.85h-11.68v5.2h13.46v4.86h-18.84v-24.79zm29.16 0h11.34c3.13 0 5.54.83 7.22 2.51 1.42 1.42 2.12 3.31 2.12 5.67v.07c0 2.01-.49 3.65-1.47 4.91-.98 1.26-2.26 2.19-3.84 2.77l6.05 8.86h-6.37l-5.31-7.94h-4.3v7.94h-5.45v-24.79zm10.98 12.04c1.35 0 2.39-.32 3.1-.95.72-.64 1.08-1.48 1.08-2.54v-.07c0-1.17-.37-2.06-1.13-2.64-.75-.59-1.8-.88-3.15-.88h-5.42v7.08h5.52zm33.05-12.04h6.02l6.48 17.46 6.48-17.46h5.87l-10.02 24.97h-4.81l-10.02-24.97zm39.59-.17h5.02l10.63 24.97h-5.7l-2.26-5.56h-10.48l-2.27 5.56h-5.56l10.62-24.97zm5.73 14.59l-3.29-8.04-3.29 8.04h6.58zm18.62-14.42h5.46v19.83h12.36v4.96h-17.82v-24.79zm36.8 25.18c-3.34 0-5.95-.92-7.87-2.76-1.91-1.83-2.87-4.59-2.87-8.25v-14.16h5.46v14.02c0 2.03.47 3.56 1.42 4.58.95 1.03 2.26 1.54 3.93 1.54 1.67 0 2.99-.49 3.94-1.49.94-.99 1.41-2.48 1.41-4.46v-14.2h5.46v13.99c0 1.88-.26 3.53-.76 4.92-.51 1.39-1.24 2.55-2.18 3.49-.95.93-2.09 1.63-3.44 2.08-1.36.47-2.85.7-4.5.7zm21.82-25.18h18.67v4.85h-13.28v5.03h11.69v4.85h-11.69v5.2h13.46v4.86h-18.85v-24.79z"
1684
+ d: "M478.931 205.481H504.484V212.126H486.299V219.011H502.298V225.649H486.299V232.78H504.721V239.421H478.931"
1685
+ }), /*#__PURE__*/createElement("path", {
1686
+ d: "M533.882 221.966C535.724 221.966 537.137 221.536 538.127 220.665C539.11 219.797 539.603 218.633 539.603 217.189V217.094C539.603 215.486 539.087 214.283 538.051 213.477C537.016 212.675 535.579 212.271 533.738 212.271H526.32V221.966H533.882ZM518.851 205.481H534.366C538.666 205.481 541.964 206.632 544.255 208.924C546.192 210.867 547.169 213.454 547.169 216.683V216.778C547.169 219.527 546.494 221.769 545.153 223.489C543.812 225.225 542.059 226.494 539.893 227.299L548.181 239.421H539.462L532.186 228.555H526.32V239.421H518.851"
1687
+ }), /*#__PURE__*/createElement("path", {
1688
+ d: "M579.113 205.481H587.356L596.226 229.384L605.103 205.481H613.149L599.425 239.661H592.833"
1689
+ }), /*#__PURE__*/createElement("path", {
1690
+ d: "M641.169 225.215L636.661 214.207L632.154 225.215H641.169ZM633.314 205.241H640.199L654.744 239.418H646.939L643.835 231.807H629.487L626.384 239.418H618.769"
1691
+ }), /*#__PURE__*/createElement("path", {
1692
+ d: "M666.645 205.481H674.111V232.632H691.033V239.421H666.645"
1693
+ }), /*#__PURE__*/createElement("path", {
1694
+ d: "M717.016 239.951C712.459 239.951 708.872 238.691 706.248 236.17C703.634 233.648 702.326 229.887 702.326 224.876V205.478H709.789V224.679C709.789 227.46 710.437 229.555 711.732 230.959C713.018 232.363 714.819 233.066 717.111 233.066C719.406 233.066 721.201 232.386 722.493 231.034C723.782 229.67 724.433 227.638 724.433 224.922V205.478H731.893V224.633C731.893 227.217 731.548 229.463 730.854 231.37C730.16 233.28 729.167 234.871 727.872 236.144C726.58 237.422 725.012 238.373 723.17 239.007C721.329 239.635 719.278 239.951 717.016 239.951Z"
1695
+ }), /*#__PURE__*/createElement("path", {
1696
+ d: "M746.888 205.481H772.437V212.126H754.256V219.011H770.254V225.649H754.256V232.78H772.681V239.421H746.888"
1697
+ }), /*#__PURE__*/createElement("path", {
1698
+ d: "M46.0351 92.9268L65.7915 49.7053L85.5545 92.9268H46.0351ZM0.0288086 139.239H25.3449L37.0824 113.614H94.1982L105.926 139.239H131.242L65.7915 0.000163794"
1699
+ }), /*#__PURE__*/createElement("path", {
1700
+ fill: "#A84D98",
1701
+ d: "M77.562 25.0368L65.7916 0.000163794L0.0322266 139.239H25.3549L77.562 25.0368Z"
1574
1702
  }));
1575
1703
  };
1576
1704
 
@@ -1727,11 +1855,11 @@ class Toast extends PureComponent {
1727
1855
  emitter.emit("hideToast");
1728
1856
  }
1729
1857
  componentDidMount() {
1730
- emitter.on("showToast", this.show);
1858
+ emitter.on("showToast", e => e && this.show(e));
1731
1859
  emitter.on("hideToast", this.hide);
1732
1860
  }
1733
1861
  componentWillUnmount() {
1734
- emitter.off("showToast", this.show);
1862
+ emitter.off("showToast", e => e && this.show(e));
1735
1863
  emitter.off("hideToast", this.hide);
1736
1864
  }
1737
1865
  render() {
@@ -1788,7 +1916,8 @@ const messageWrapper = /*#__PURE__*/css({
1788
1916
  const Message = ({
1789
1917
  intent,
1790
1918
  className,
1791
- text
1919
+ text,
1920
+ testId
1792
1921
  }) => {
1793
1922
  const bColor = _colors[intent];
1794
1923
  const iconClass = cx("pi", {
@@ -1799,7 +1928,8 @@ const Message = ({
1799
1928
  className: cx(messageWrapper, className),
1800
1929
  style: {
1801
1930
  backgroundColor: bColor
1802
- }
1931
+ },
1932
+ "data-testid": testId
1803
1933
  }, /*#__PURE__*/createElement("i", {
1804
1934
  className: iconClass
1805
1935
  }), text);
@@ -2015,7 +2145,8 @@ class Search extends PureComponent {
2015
2145
  className,
2016
2146
  clearable,
2017
2147
  value,
2018
- loading
2148
+ loading,
2149
+ testId
2019
2150
  } = this.props;
2020
2151
  const wrapperClassName = cx(searchWrapperStyle, {
2021
2152
  __pebble__search__small: type === "small",
@@ -2036,7 +2167,9 @@ class Search extends PureComponent {
2036
2167
  },
2037
2168
  ref: this.searchInputRef,
2038
2169
  value: value
2039
- }, inputProps)), loading && /*#__PURE__*/createElement(Loader, {
2170
+ }, inputProps, {
2171
+ "data-testid": testId
2172
+ })), loading && /*#__PURE__*/createElement(Loader, {
2040
2173
  scale: 0.4,
2041
2174
  color: colors.violet.base
2042
2175
  }), clearable && /*#__PURE__*/createElement("div", {
@@ -2179,12 +2312,14 @@ class OptionGroup extends PureComponent {
2179
2312
  className,
2180
2313
  isSelected,
2181
2314
  handleChange,
2182
- searchBoxProps
2315
+ searchBoxProps,
2316
+ testId
2183
2317
  } = this.props;
2184
2318
  const {
2185
2319
  isScrolled,
2186
2320
  highlighted
2187
2321
  } = this.state;
2322
+ const testIds = getTestIds(testId, getOptionGroupTestIds);
2188
2323
  const _children = Children.map(children, (_option, i) => {
2189
2324
  const option = _option;
2190
2325
  let ref = this.optionsRefsSet.get(i);
@@ -2197,7 +2332,8 @@ class OptionGroup extends PureComponent {
2197
2332
  isActive: highlighted === i,
2198
2333
  isSelected: isSelected(option.props.value),
2199
2334
  multiSelect,
2200
- ref
2335
+ ref,
2336
+ testId: testIds.optionId ? getOptionTestId(testIds.optionId, i) : undefined
2201
2337
  });
2202
2338
  });
2203
2339
  const searchBoxClassName = cx(searchBoxWrapper, {
@@ -2212,7 +2348,8 @@ class OptionGroup extends PureComponent {
2212
2348
  inputProps: { ...(searchBoxProps && searchBoxProps.inputProps),
2213
2349
  onKeyDown: this.handleKeyPress,
2214
2350
  autoFocus: true
2215
- }
2351
+ },
2352
+ testId: testIds.searchBoxId
2216
2353
  }))), !!Children.count(children) && /*#__PURE__*/createElement("div", {
2217
2354
  ref: this.optionRef,
2218
2355
  style: {
@@ -2220,14 +2357,16 @@ class OptionGroup extends PureComponent {
2220
2357
  },
2221
2358
  className: cx(optionsWrapper, className),
2222
2359
  role: multiSelect ? "group" : "radiogroup",
2223
- "data-test-id": "optiongroup",
2360
+ "data-testid": testId,
2224
2361
  "aria-label": searchBoxProps && searchBoxProps.placeholder
2225
2362
  }, advancedOptions && advancedOptionsProps && /*#__PURE__*/createElement("div", {
2226
2363
  className: _class
2227
2364
  }, /*#__PURE__*/createElement("div", {
2228
- onClick: advancedOptionsProps.selectVisible
2365
+ onClick: advancedOptionsProps.selectVisible,
2366
+ "data-testid": testIds.selectVisibleId
2229
2367
  }, "Select Visible"), /*#__PURE__*/createElement("div", {
2230
- onClick: advancedOptionsProps.clearVisible
2368
+ onClick: advancedOptionsProps.clearVisible,
2369
+ "data-testid": testIds.clearVisibleId
2231
2370
  }, "Clear Visible")), _children));
2232
2371
  }
2233
2372
  }
@@ -2292,6 +2431,7 @@ class OptionGroupCheckBox extends PureComponent {
2292
2431
  onClear,
2293
2432
  isSelected,
2294
2433
  onChange,
2434
+ testId,
2295
2435
  ...rest
2296
2436
  } = this.props;
2297
2437
  const advancedOptionsProps = {
@@ -2299,20 +2439,24 @@ class OptionGroupCheckBox extends PureComponent {
2299
2439
  clearVisible: this.clearVisible,
2300
2440
  ...this.props.advancedOptionsProps
2301
2441
  };
2442
+ const testIds = getTestIds(testId, getOptionGroupCheckBoxTestIds);
2302
2443
  return /*#__PURE__*/createElement("div", {
2303
2444
  className: cx(optionGroupCheckBoxWrap, wrapClassName)
2304
2445
  }, /*#__PURE__*/createElement(OptionGroup, Object.assign({}, rest, {
2305
2446
  advancedOptionsProps: advancedOptionsProps,
2306
2447
  isSelected: isSelected || this.isSelected,
2307
2448
  handleChange: this.handleChange,
2308
- multiSelect: true
2449
+ multiSelect: true,
2450
+ testId: testId
2309
2451
  })), (onApply || onClear) && /*#__PURE__*/createElement("div", {
2310
2452
  className: optionGroupCheckBoxButtonWrap
2311
2453
  }, onClear && /*#__PURE__*/createElement(Button, {
2312
2454
  type: "secondary",
2313
- onClick: onClear
2455
+ onClick: onClear,
2456
+ testId: testIds.clearButtonId
2314
2457
  }, "Clear"), onApply && /*#__PURE__*/createElement(Button, {
2315
- onClick: this.onApply
2458
+ onClick: this.onApply,
2459
+ testId: testIds.applyButtonId
2316
2460
  }, "Apply")));
2317
2461
  }
2318
2462
  }
@@ -2411,8 +2555,11 @@ function Select(props) {
2411
2555
  disabled,
2412
2556
  isSelected,
2413
2557
  placement,
2414
- modifiers
2558
+ modifiers,
2559
+ testId
2415
2560
  } = props;
2561
+ const singleSelectTestIds = getTestIds(testId, id => getSelectInputTestIds(id, false));
2562
+ const multiSelectTestIds = getTestIds(testId, id => getSelectInputTestIds(id, true));
2416
2563
  return /*#__PURE__*/createElement("div", {
2417
2564
  className: cx(selectWrapper, className, {
2418
2565
  [relativePosition]: !!fullWidthDropdown
@@ -2434,7 +2581,8 @@ function Select(props) {
2434
2581
  onClick: disabled ? undefined : () => {
2435
2582
  toggleDropdown();
2436
2583
  onDropdownToggle(isOpen);
2437
- }
2584
+ },
2585
+ "data-testid": singleSelectTestIds.inputId
2438
2586
  }, /*#__PURE__*/createElement(Input, Object.assign({
2439
2587
  className: selectInputWrapper,
2440
2588
  inputClassName: selectInput,
@@ -2483,7 +2631,9 @@ function Select(props) {
2483
2631
  onDropdownToggle(isOpen);
2484
2632
  toggle();
2485
2633
  })
2486
- }, commonProps), children);
2634
+ }, commonProps, {
2635
+ testId: multiSelectTestIds.optionGroupId
2636
+ }), children);
2487
2637
  } else {
2488
2638
  return /*#__PURE__*/createElement(OptionGroupRadio, Object.assign({
2489
2639
  selected: props.selected,
@@ -2492,7 +2642,9 @@ function Select(props) {
2492
2642
  onDropdownToggle(isOpen);
2493
2643
  toggle();
2494
2644
  }
2495
- }, commonProps), children);
2645
+ }, commonProps, {
2646
+ testId: singleSelectTestIds.optionGroupId
2647
+ }), children);
2496
2648
  }
2497
2649
  }));
2498
2650
  }
@@ -2538,8 +2690,10 @@ class PhoneNumberInput extends Component {
2538
2690
  selectProps,
2539
2691
  inputProps,
2540
2692
  required,
2541
- placeholder
2693
+ placeholder,
2694
+ testId
2542
2695
  } = this.props;
2696
+ const testIds = getTestIds(testId, getPhoneNumberInputTestIds);
2543
2697
  return /*#__PURE__*/createElement("div", {
2544
2698
  className: cx(wrapper, className)
2545
2699
  }, /*#__PURE__*/createElement("label", {
@@ -2554,12 +2708,15 @@ class PhoneNumberInput extends Component {
2554
2708
  value: countryCode + "",
2555
2709
  selected: countryCode
2556
2710
  }, selectProps, {
2557
- className: cx(selectStyle, selectProps && selectProps.className)
2711
+ className: cx(selectStyle, selectProps && selectProps.className),
2712
+ testId: testIds.countryId
2558
2713
  }), this.props.children), /*#__PURE__*/createElement(Input, Object.assign({
2559
2714
  onChange: this.onNumberChange,
2560
2715
  placeholder: "",
2561
2716
  value: phone
2562
- }, inputProps)));
2717
+ }, inputProps, {
2718
+ testId: testIds.phoneId
2719
+ })));
2563
2720
  }
2564
2721
  }
2565
2722
 
@@ -2710,8 +2867,14 @@ const PopUp = props => {
2710
2867
  rejectButtonText = "No",
2711
2868
  children,
2712
2869
  approveButtonProps,
2713
- rejectButtonProps
2870
+ rejectButtonProps,
2871
+ testId
2714
2872
  } = props;
2873
+ const {
2874
+ closeButtonId,
2875
+ approveButtonId,
2876
+ rejectButtonId
2877
+ } = getTestIds(testId, id => getPopUpTestIds(id));
2715
2878
  return /*#__PURE__*/createElement(Modal, {
2716
2879
  visible: visible,
2717
2880
  modalClassName: flexCenter
@@ -2719,18 +2882,23 @@ const PopUp = props => {
2719
2882
  className: modalContainer$1
2720
2883
  }, onClose && /*#__PURE__*/createElement("i", {
2721
2884
  className: cx("pi", "pi-close", iconCloseClassName),
2722
- onClick: onClose
2885
+ onClick: onClose,
2886
+ "data-testid": closeButtonId
2723
2887
  }), children, (onReject || onApprove) && /*#__PURE__*/createElement("div", {
2724
2888
  className: buttonsContainer
2725
2889
  }, onReject && /*#__PURE__*/createElement(Button, Object.assign({
2726
2890
  size: "large",
2727
2891
  type: "secondary",
2728
2892
  onClick: onReject
2729
- }, rejectButtonProps), rejectButtonText), onApprove && /*#__PURE__*/createElement(Button, Object.assign({
2893
+ }, rejectButtonProps, {
2894
+ testId: rejectButtonId
2895
+ }), rejectButtonText), onApprove && /*#__PURE__*/createElement(Button, Object.assign({
2730
2896
  size: "large",
2731
2897
  type: "primary",
2732
2898
  onClick: onApprove
2733
- }, approveButtonProps), approveButtonText))));
2899
+ }, approveButtonProps, {
2900
+ testId: approveButtonId
2901
+ }), approveButtonText))));
2734
2902
  };
2735
2903
 
2736
2904
  const selectedTabStyle = /*#__PURE__*/css({
@@ -2779,7 +2947,7 @@ class Tabs extends PureComponent {
2779
2947
  const isSelected = this.state.selectedTab === tab;
2780
2948
  return /*#__PURE__*/createElement("span", {
2781
2949
  key: `${tab}-${i}`,
2782
- "data-test-id": `${tab.replace(/\d/g, "").replace("(", "").replace(")", "").trim()}`,
2950
+ "data-testid": `${tab.replace(/\d/g, "").replace("(", "").replace(")", "").trim()}`,
2783
2951
  className: cx(_className, isSelected && selectedTabStyle, isSelected && this.props.selectedTabClassName),
2784
2952
  onClick: () => {
2785
2953
  this.setState({
@@ -2945,20 +3113,26 @@ class RadioGroup extends PureComponent {
2945
3113
  selected,
2946
3114
  className,
2947
3115
  name,
2948
- disabled
3116
+ disabled,
3117
+ testId
2949
3118
  } = this.props;
2950
- const _children = Children.map(children, _radio => {
3119
+ const {
3120
+ optionId
3121
+ } = getTestIds(testId, getRadioGroupTestIds);
3122
+ const _children = Children.map(children, (_radio, i) => {
2951
3123
  const radio = _radio;
2952
3124
  return cloneElement(radio, {
2953
3125
  onChange: this.handleChange,
2954
3126
  checked: selected === radio.props.value,
2955
- disabled
3127
+ disabled,
3128
+ testId: optionId ? getOptionTestId(optionId, i) : undefined
2956
3129
  });
2957
3130
  });
2958
3131
  return /*#__PURE__*/createElement("div", {
2959
3132
  role: "radiogroup",
2960
3133
  "aria-label": name,
2961
- className: className
3134
+ className: className,
3135
+ "data-testid": testId
2962
3136
  }, _children);
2963
3137
  }
2964
3138
  }
@@ -3153,7 +3327,8 @@ class SecondaryInput extends PureComponent {
3153
3327
  message,
3154
3328
  readOnly,
3155
3329
  loading,
3156
- className
3330
+ className,
3331
+ testId
3157
3332
  } = this.props;
3158
3333
  const {
3159
3334
  isFocused
@@ -3183,7 +3358,9 @@ class SecondaryInput extends PureComponent {
3183
3358
  },
3184
3359
  onFocus: this.addFocus,
3185
3360
  onBlur: this.removeFocus
3186
- }, /*#__PURE__*/createElement("input", Object.assign({}, _inputProps, this.props.inputProps)), /*#__PURE__*/createElement("label", {
3361
+ }, /*#__PURE__*/createElement("input", Object.assign({}, _inputProps, this.props.inputProps, {
3362
+ "data-testid": testId
3363
+ })), /*#__PURE__*/createElement("label", {
3187
3364
  className: placeholderClassName
3188
3365
  }, placeholder, required && /*#__PURE__*/createElement("span", {
3189
3366
  style: {
@@ -3196,6 +3373,7 @@ class SecondaryInput extends PureComponent {
3196
3373
  scale: 0.4
3197
3374
  })), _message && /*#__PURE__*/createElement("div", {
3198
3375
  className: messageStyle$1,
3376
+ "data-testid": testId ? getMessageTestId(testId) : undefined,
3199
3377
  style: {
3200
3378
  color: getColor$1(errorMessage, successMessage)
3201
3379
  }
@@ -3808,13 +3986,15 @@ const Text = ({
3808
3986
  typography,
3809
3987
  color = colors.gray.darker,
3810
3988
  children,
3811
- className
3989
+ className,
3990
+ testId
3812
3991
  }) => {
3813
3992
  const _className = /*#__PURE__*/css({ ...typography,
3814
3993
  color
3815
3994
  }, "" );
3816
3995
  return /*#__PURE__*/React__default.createElement("span", {
3817
- className: cx(_className, className)
3996
+ className: cx(_className, className),
3997
+ "data-testid": testId
3818
3998
  }, children);
3819
3999
  };
3820
4000
 
@@ -3901,7 +4081,7 @@ const TimePicker = props => {
3901
4081
  toggleDropdown();
3902
4082
  },
3903
4083
  className: buttonStyle,
3904
- "data-test-id": "hour-label"
4084
+ "data-testid": "hour-label"
3905
4085
  }, /*#__PURE__*/createElement("span", {
3906
4086
  className: /*#__PURE__*/css( {
3907
4087
  name: "1czd1rs-TimePicker",
@@ -3944,7 +4124,7 @@ const TimePicker = props => {
3944
4124
  toggleDropdown();
3945
4125
  },
3946
4126
  className: buttonStyle,
3947
- "data-test-id": "minute-label"
4127
+ "data-testid": "minute-label"
3948
4128
  }, /*#__PURE__*/createElement("span", {
3949
4129
  className: /*#__PURE__*/css( {
3950
4130
  name: "1czd1rs-TimePicker",
@@ -4069,7 +4249,8 @@ function defaultSearchBox({
4069
4249
  errorMessage: props.errorMessage,
4070
4250
  loading: props.loading,
4071
4251
  required: props.required,
4072
- disabled: props.disabled
4252
+ disabled: props.disabled,
4253
+ testId: props.testId
4073
4254
  }));
4074
4255
  }
4075
4256
  class TypeAhead extends PureComponent {
@@ -4106,8 +4287,10 @@ class TypeAhead extends PureComponent {
4106
4287
  className,
4107
4288
  searchBox = defaultSearchBox,
4108
4289
  dropdownClassName,
4109
- children
4290
+ children,
4291
+ testId
4110
4292
  } = this.props;
4293
+ const testIds = getTestIds(testId, getTypeaheadTestIds);
4111
4294
  const {
4112
4295
  showSuggestions,
4113
4296
  value
@@ -4122,13 +4305,16 @@ class TypeAhead extends PureComponent {
4122
4305
  registerChange: this.registerChange,
4123
4306
  onFocus: this.onFocus,
4124
4307
  value
4125
- }, this.props), /*#__PURE__*/createElement(MountTransition, {
4308
+ }, { ...this.props,
4309
+ testId: testIds.searchBoxId
4310
+ }), /*#__PURE__*/createElement(MountTransition, {
4126
4311
  visible: showSuggestions
4127
4312
  }, transitionStyles => /*#__PURE__*/createElement(animated.div, {
4128
4313
  style: transitionStyles,
4129
4314
  className: cx(optionsWrapper$1, dropdownClassName)
4130
4315
  }, /*#__PURE__*/createElement(OptionGroupRadio, {
4131
- onChange: this.onSelect
4316
+ onChange: this.onSelect,
4317
+ testId: testIds.optionGroupId
4132
4318
  }, children))));
4133
4319
  }
4134
4320
  }
@@ -4189,8 +4375,20 @@ var index = /*#__PURE__*/Object.freeze({
4189
4375
  capitalize: capitalize,
4190
4376
  getShortenedNumber: getShortenedNumber,
4191
4377
  initGoogleAnalytics: initGoogleAnalytics,
4192
- isDesktop: isDesktop
4378
+ isDesktop: isDesktop,
4379
+ getTestIds: getTestIds,
4380
+ getOptionTestId: getOptionTestId,
4381
+ getRadioGroupTestIds: getRadioGroupTestIds,
4382
+ getOptionGroupTestIds: getOptionGroupTestIds,
4383
+ getOptionGroupRadioTestIds: getOptionGroupRadioTestIds,
4384
+ getOptionGroupCheckBoxTestIds: getOptionGroupCheckBoxTestIds,
4385
+ getPhoneNumberInputTestIds: getPhoneNumberInputTestIds,
4386
+ getMessageTestId: getMessageTestId,
4387
+ getSelectInputTestIds: getSelectInputTestIds,
4388
+ getTypeaheadTestIds: getTypeaheadTestIds,
4389
+ getCalendarTestIds: getCalendarTestIds,
4390
+ getPopUpTestIds: getPopUpTestIds
4193
4391
  });
4194
4392
 
4195
- export { BrowserBasedDateInput, Button, Calendar, Checkbox, CheckboxGroup, DateInput, DropDown, DropDownButton, Input, Loader, Logo, Message, Modal, NativeDateInput, Option, OptionGroup, OptionGroupCheckBox, OptionGroupRadio, OutsideClick, PhoneNumberInput, PopUp, PebblePopper as Popper, PresetCalendar, Radio, RadioGroup, Rating, Search, SecondaryInput, Select, SideBar, Slider, Stepper, Switch, TabSection, Tabs, Tag, Text, TimePicker, Toast, Tooltip, TypeAhead, UserAgentInfoContext, UserAgentInfoProvider, constants, mixins, styles, typography, index as utils };
4393
+ export { BrowserBasedDateInput, Button, Calendar, Checkbox, CheckboxGroup, DateInput, DropDown, DropDownButton, Input, Loader, Logo, Message, Modal, NativeDateInput, Option, OptionGroup, OptionGroupCheckBox, OptionGroupRadio, OutsideClick, PhoneNumberInput, PopUp, PebblePopper as Popper, PresetCalendar, Radio, RadioGroup, Rating, Search, SecondaryInput, Select, SideBar, Slider, Stepper, Switch, TabSection, Tabs, Tag, Text, TimePicker, Toast, Tooltip, TypeAhead, UserAgentInfoContext, UserAgentInfoProvider, constants, getCalendarTestIds, getMessageTestId, getOptionGroupCheckBoxTestIds, getOptionGroupRadioTestIds, getOptionGroupTestIds, getOptionTestId, getPhoneNumberInputTestIds, getPopUpTestIds, getRadioGroupTestIds, getSelectInputTestIds, getTestIds, getTypeaheadTestIds, mixins, styles, typography, index as utils };
4196
4394
  //# sourceMappingURL=pebble-web.es.js.map