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.
- package/dist/components/typings/Button.d.ts +1 -0
- package/dist/components/typings/Calendar.d.ts +1 -0
- package/dist/components/typings/CheckboxGroup.d.ts +1 -0
- package/dist/components/typings/Control.d.ts +1 -0
- package/dist/components/typings/DateInput.d.ts +1 -0
- package/dist/components/typings/Dropdown.d.ts +1 -0
- package/dist/components/typings/Input.d.ts +1 -0
- package/dist/components/typings/Loader.d.ts +1 -0
- package/dist/components/typings/Message.d.ts +1 -0
- package/dist/components/typings/OptionGroup.d.ts +1 -0
- package/dist/components/typings/OptionGroupCheckBox.d.ts +1 -0
- package/dist/components/typings/OptionGroupRadio.d.ts +1 -0
- package/dist/components/typings/PhoneNumberInput.d.ts +1 -0
- package/dist/components/typings/PopUp.d.ts +1 -0
- package/dist/components/typings/RadioGroup.d.ts +1 -0
- package/dist/components/typings/Search.d.ts +1 -0
- package/dist/components/typings/SecondaryInput.d.ts +1 -0
- package/dist/components/typings/Select.d.ts +1 -0
- package/dist/components/typings/Text.d.ts +1 -0
- package/dist/components/typings/Typeahead.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/pebble-web.dev.js +401 -179
- package/dist/pebble-web.dev.js.map +1 -1
- package/dist/pebble-web.es.dev.js +283 -85
- package/dist/pebble-web.es.dev.js.map +1 -1
- package/dist/pebble-web.es.js +277 -79
- package/dist/pebble-web.es.js.map +1 -1
- package/dist/pebble-web.js +395 -173
- package/dist/pebble-web.js.map +1 -1
- package/dist/pebble-web.module.dev.js +390 -180
- package/dist/pebble-web.module.dev.js.map +1 -1
- package/dist/pebble-web.module.js +384 -174
- package/dist/pebble-web.module.js.map +1 -1
- package/dist/pebble-web.umd.dev.js +409 -181
- package/dist/pebble-web.umd.dev.js.map +1 -1
- package/dist/pebble-web.umd.js +403 -175
- package/dist/pebble-web.umd.js.map +1 -1
- package/dist/utils/animation.d.ts +2 -19
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/testIds.d.ts +65 -0
- package/dist/utils/useragent/index.d.ts +1 -2
- package/package.json +3 -4
- package/src/components/Button.tsx +3 -1
- package/src/components/Calendar.tsx +28 -4
- package/src/components/CheckboxGroup.tsx +13 -3
- package/src/components/DateInput.tsx +3 -1
- package/src/components/DropDown.tsx +3 -1
- package/src/components/Input.tsx +15 -3
- package/src/components/Loader.tsx +3 -1
- package/src/components/Logo.tsx +22 -15
- package/src/components/Message.tsx +3 -1
- package/src/components/NativeDateInput.tsx +2 -1
- package/src/components/OptionGroupCheckBox.tsx +14 -2
- package/src/components/PhoneNumberInput.tsx +7 -1
- package/src/components/PopUp.tsx +7 -1
- package/src/components/RadioGroup.tsx +24 -4
- package/src/components/Search.tsx +3 -1
- package/src/components/SecondaryInput.tsx +9 -2
- package/src/components/Select.tsx +13 -1
- package/src/components/Tabs.tsx +1 -1
- package/src/components/Text.tsx +7 -2
- package/src/components/TimePicker.tsx +2 -2
- package/src/components/Toast.tsx +2 -2
- package/src/components/TypeAhead.tsx +14 -3
- package/src/components/__tests__/__snapshots__/checkboxGroup.test.tsx.snap +88 -0
- package/src/components/__tests__/__snapshots__/logo.test.tsx.snap +55 -12
- package/src/components/__tests__/__snapshots__/optionGroup.test.tsx.snap +0 -3
- package/src/components/__tests__/__snapshots__/select.test.tsx.snap +3 -0
- package/src/components/__tests__/__snapshots__/timepicker.test.tsx.snap +18 -18
- package/src/components/__tests__/calendar.test.tsx +6 -24
- package/src/components/__tests__/checkboxGroup.test.tsx +39 -8
- package/src/components/__tests__/select.test.tsx +19 -30
- package/src/components/__tests__/timepicker.test.tsx +4 -14
- package/src/components/shared/Control.tsx +3 -1
- package/src/components/shared/MountTransition.tsx +7 -3
- package/src/components/shared/OptionGroup.tsx +23 -5
- package/src/components/typings/Button.ts +1 -0
- package/src/components/typings/Calendar.ts +1 -0
- package/src/components/typings/CheckboxGroup.ts +1 -0
- package/src/components/typings/Control.ts +1 -0
- package/src/components/typings/DateInput.ts +1 -0
- package/src/components/typings/Dropdown.ts +1 -0
- package/src/components/typings/Input.ts +1 -0
- package/src/components/typings/Loader.ts +1 -0
- package/src/components/typings/Message.ts +1 -0
- package/src/components/typings/OptionGroup.ts +1 -0
- package/src/components/typings/OptionGroupCheckBox.ts +1 -0
- package/src/components/typings/OptionGroupRadio.ts +1 -0
- package/src/components/typings/PhoneNumberInput.ts +1 -0
- package/src/components/typings/PopUp.ts +1 -0
- package/src/components/typings/RadioGroup.ts +1 -0
- package/src/components/typings/Search.ts +1 -0
- package/src/components/typings/SecondaryInput.ts +1 -0
- package/src/components/typings/Select.ts +1 -0
- package/src/components/typings/Text.ts +1 -0
- package/src/components/typings/Typeahead.ts +1 -0
- package/src/index.ts +1 -0
- package/src/utils/animation.ts +3 -3
- package/src/utils/index.ts +1 -0
- package/src/utils/testIds.ts +119 -0
- package/src/utils/useragent/index.tsx +1 -1
- package/src/.DS_Store +0 -0
package/dist/pebble-web.es.js
CHANGED
|
@@ -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
|
|
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
|
|
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
|
-
|
|
1656
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1556
1657
|
height: height,
|
|
1557
|
-
viewBox: "0 0
|
|
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
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
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
|
-
|
|
1573
|
-
|
|
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
|
|
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-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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-
|
|
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
|
|
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
|
|
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-
|
|
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-
|
|
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
|
|
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
|