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
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
type TestIdMap = Record<string, string | object>;
|
|
2
|
+
|
|
3
|
+
type BaseSelectIds = {
|
|
4
|
+
inputId: string;
|
|
5
|
+
optionGroupId: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
type OptionGroupCheckBoxIds = ReturnType<typeof getOptionGroupCheckBoxTestIds>;
|
|
9
|
+
|
|
10
|
+
type OptionGroupRadioIds = ReturnType<typeof getOptionGroupRadioTestIds>;
|
|
11
|
+
|
|
12
|
+
export function getTestIds<T extends TestIdMap>(
|
|
13
|
+
id: string | undefined,
|
|
14
|
+
builder: (_id: string) => Partial<T>
|
|
15
|
+
): Partial<T> {
|
|
16
|
+
return id ? builder(id) : {};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function getOptionTestId(id: string, index: number) {
|
|
20
|
+
return `${id}-${index}`;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function getRadioGroupTestIds(id: string) {
|
|
24
|
+
return {
|
|
25
|
+
optionId: `${id}-option`
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function getOptionGroupTestIds(id: string) {
|
|
30
|
+
return {
|
|
31
|
+
searchBoxId: `${id}-search`,
|
|
32
|
+
optionId: `${id}-option`,
|
|
33
|
+
selectVisibleId: `${id}-select-visible`,
|
|
34
|
+
clearVisibleId: `${id}-clear-visible`
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const getOptionGroupRadioTestIds = (id: string) =>
|
|
39
|
+
getOptionGroupTestIds(id);
|
|
40
|
+
|
|
41
|
+
export function getOptionGroupCheckBoxTestIds(id: string) {
|
|
42
|
+
return {
|
|
43
|
+
applyButtonId: `${id}-apply-btn`,
|
|
44
|
+
clearButtonId: `${id}-clear-btn`,
|
|
45
|
+
...getOptionGroupTestIds(id)
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function getPhoneNumberInputTestIds(id: string) {
|
|
50
|
+
return {
|
|
51
|
+
phoneId: `${id}-phone`,
|
|
52
|
+
countryId: `${id}-country`,
|
|
53
|
+
countryInputIds: getSelectInputTestIds(`${id}-country`)
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function getMessageTestId(id: string) {
|
|
58
|
+
return `${id}-message`;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function getSelectInputTestIds(
|
|
62
|
+
id: string,
|
|
63
|
+
multiSelect: true
|
|
64
|
+
): BaseSelectIds & OptionGroupCheckBoxIds;
|
|
65
|
+
|
|
66
|
+
export function getSelectInputTestIds(
|
|
67
|
+
id: string,
|
|
68
|
+
multiSelect?: false
|
|
69
|
+
): BaseSelectIds & OptionGroupRadioIds;
|
|
70
|
+
|
|
71
|
+
export function getSelectInputTestIds(
|
|
72
|
+
id: string,
|
|
73
|
+
multiSelect?: boolean
|
|
74
|
+
):
|
|
75
|
+
| (BaseSelectIds & OptionGroupCheckBoxIds)
|
|
76
|
+
| (BaseSelectIds & OptionGroupRadioIds);
|
|
77
|
+
|
|
78
|
+
export function getSelectInputTestIds(
|
|
79
|
+
id: string,
|
|
80
|
+
multiSelect: boolean = false
|
|
81
|
+
) {
|
|
82
|
+
const optionGroupId = `${id}-option-group`;
|
|
83
|
+
|
|
84
|
+
const baseIds = {
|
|
85
|
+
inputId: `${id}-input`,
|
|
86
|
+
optionGroupId
|
|
87
|
+
};
|
|
88
|
+
return {
|
|
89
|
+
...(multiSelect
|
|
90
|
+
? getOptionGroupCheckBoxTestIds(optionGroupId)
|
|
91
|
+
: getOptionGroupRadioTestIds(optionGroupId)),
|
|
92
|
+
...baseIds
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function getTypeaheadTestIds(id: string) {
|
|
97
|
+
const optionGroupId = `${id}-option-group`;
|
|
98
|
+
return {
|
|
99
|
+
optionGroupId,
|
|
100
|
+
...getOptionGroupRadioTestIds(optionGroupId)
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function getCalendarTestIds(id: string){
|
|
105
|
+
return {
|
|
106
|
+
leftIconId: `${id}-left-icon`,
|
|
107
|
+
rightIconId: `${id}-right-icon`,
|
|
108
|
+
applyButtonId: `${id}-apply-btn`,
|
|
109
|
+
clearButtonId: `${id}-clear-btn`
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export function getPopUpTestIds(id: string){
|
|
114
|
+
return {
|
|
115
|
+
closeButtonId: `${id}-close-btn`,
|
|
116
|
+
approveButtonId: `${id}-approve-btn`,
|
|
117
|
+
rejectButtonId: `${id}-reject-btn`
|
|
118
|
+
};
|
|
119
|
+
}
|
package/src/.DS_Store
DELETED
|
Binary file
|