pebble-web 2.25.2-alpha.3 → 2.25.2
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 +0 -1
- package/dist/components/typings/Calendar.d.ts +0 -1
- package/dist/components/typings/CheckboxGroup.d.ts +0 -1
- package/dist/components/typings/Control.d.ts +0 -1
- package/dist/components/typings/DateInput.d.ts +0 -1
- package/dist/components/typings/Dropdown.d.ts +0 -1
- package/dist/components/typings/Input.d.ts +0 -1
- package/dist/components/typings/Loader.d.ts +0 -1
- package/dist/components/typings/Message.d.ts +0 -1
- package/dist/components/typings/OptionGroup.d.ts +0 -1
- package/dist/components/typings/OptionGroupCheckBox.d.ts +0 -1
- package/dist/components/typings/OptionGroupRadio.d.ts +0 -1
- package/dist/components/typings/PhoneNumberInput.d.ts +0 -1
- package/dist/components/typings/PopUp.d.ts +0 -1
- package/dist/components/typings/RadioGroup.d.ts +0 -1
- package/dist/components/typings/Search.d.ts +0 -1
- package/dist/components/typings/SecondaryInput.d.ts +0 -1
- package/dist/components/typings/Select.d.ts +0 -1
- package/dist/components/typings/Text.d.ts +0 -1
- package/dist/components/typings/Typeahead.d.ts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/pebble-web.dev.js +164 -358
- package/dist/pebble-web.dev.js.map +1 -1
- package/dist/pebble-web.es.dev.js +70 -239
- package/dist/pebble-web.es.dev.js.map +1 -1
- package/dist/pebble-web.es.js +64 -233
- package/dist/pebble-web.es.js.map +1 -1
- package/dist/pebble-web.js +158 -352
- package/dist/pebble-web.js.map +1 -1
- package/dist/pebble-web.module.dev.js +165 -347
- package/dist/pebble-web.module.dev.js.map +1 -1
- package/dist/pebble-web.module.js +159 -341
- package/dist/pebble-web.module.js.map +1 -1
- package/dist/pebble-web.umd.dev.js +164 -358
- package/dist/pebble-web.umd.dev.js.map +1 -1
- package/dist/pebble-web.umd.js +158 -352
- package/dist/pebble-web.umd.js.map +1 -1
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/useragent/index.d.ts +1 -2
- package/package.json +1 -2
- package/src/components/Button.tsx +1 -3
- package/src/components/Calendar.tsx +4 -28
- package/src/components/CheckboxGroup.tsx +3 -13
- package/src/components/DateInput.tsx +1 -3
- package/src/components/DropDown.tsx +1 -3
- package/src/components/Input.tsx +3 -15
- package/src/components/Loader.tsx +1 -3
- package/src/components/Message.tsx +1 -3
- package/src/components/NativeDateInput.tsx +1 -2
- package/src/components/OptionGroupCheckBox.tsx +2 -14
- package/src/components/PhoneNumberInput.tsx +1 -7
- package/src/components/PopUp.tsx +1 -7
- package/src/components/RadioGroup.tsx +3 -20
- package/src/components/Search.tsx +1 -3
- package/src/components/SecondaryInput.tsx +2 -9
- package/src/components/Select.tsx +1 -13
- package/src/components/Tabs.tsx +1 -1
- package/src/components/Text.tsx +2 -7
- package/src/components/TimePicker.tsx +2 -2
- package/src/components/Toast.tsx +2 -2
- package/src/components/TypeAhead.tsx +3 -14
- package/src/components/__tests__/__snapshots__/optionGroup.test.tsx.snap +3 -0
- package/src/components/__tests__/__snapshots__/select.test.tsx.snap +0 -3
- package/src/components/__tests__/__snapshots__/timepicker.test.tsx.snap +18 -18
- package/src/components/__tests__/calendar.test.tsx +24 -6
- package/src/components/__tests__/checkboxGroup.test.tsx +8 -39
- package/src/components/__tests__/select.test.tsx +30 -19
- package/src/components/__tests__/timepicker.test.tsx +14 -4
- package/src/components/shared/Control.tsx +1 -3
- package/src/components/shared/OptionGroup.tsx +5 -23
- package/src/components/typings/Button.ts +0 -1
- package/src/components/typings/Calendar.ts +0 -1
- package/src/components/typings/CheckboxGroup.ts +0 -1
- package/src/components/typings/Control.ts +0 -1
- package/src/components/typings/DateInput.ts +0 -1
- package/src/components/typings/Dropdown.ts +0 -1
- package/src/components/typings/Input.ts +0 -1
- package/src/components/typings/Loader.ts +0 -1
- package/src/components/typings/Message.ts +0 -1
- package/src/components/typings/OptionGroup.ts +0 -1
- package/src/components/typings/OptionGroupCheckBox.ts +0 -1
- package/src/components/typings/OptionGroupRadio.ts +0 -1
- package/src/components/typings/PhoneNumberInput.ts +0 -1
- package/src/components/typings/PopUp.ts +0 -1
- package/src/components/typings/RadioGroup.ts +0 -1
- package/src/components/typings/Search.ts +0 -1
- package/src/components/typings/SecondaryInput.ts +0 -1
- package/src/components/typings/Select.ts +0 -1
- package/src/components/typings/Text.ts +0 -1
- package/src/components/typings/Typeahead.ts +0 -1
- package/src/index.ts +0 -1
- package/src/utils/index.ts +0 -1
- package/src/utils/useragent/index.tsx +1 -1
- package/dist/utils/testIds.d.ts +0 -65
- package/src/components/__tests__/__snapshots__/checkboxGroup.test.tsx.snap +0 -88
- package/src/utils/testIds.ts +0 -119
|
@@ -34,7 +34,6 @@ export interface TypeaheadProps<OptionType> {
|
|
|
34
34
|
valueExtractor: (value: OptionType) => string;
|
|
35
35
|
onClear?: () => void;
|
|
36
36
|
inputProps?: Omit<SimpleInputProps, "onChange" | "value" | "placeholder">;
|
|
37
|
-
testId?: string;
|
|
38
37
|
}
|
|
39
38
|
|
|
40
39
|
export interface TypeaheadState {
|
package/src/index.ts
CHANGED
package/src/utils/index.ts
CHANGED
package/dist/utils/testIds.d.ts
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
declare type TestIdMap = Record<string, string | object>;
|
|
2
|
-
declare type BaseSelectIds = {
|
|
3
|
-
inputId: string;
|
|
4
|
-
optionGroupId: string;
|
|
5
|
-
};
|
|
6
|
-
declare type OptionGroupCheckBoxIds = ReturnType<typeof getOptionGroupCheckBoxTestIds>;
|
|
7
|
-
declare type OptionGroupRadioIds = ReturnType<typeof getOptionGroupRadioTestIds>;
|
|
8
|
-
export declare function getTestIds<T extends TestIdMap>(id: string | undefined, builder: (_id: string) => Partial<T>): Partial<T>;
|
|
9
|
-
export declare function getOptionTestId(id: string, index: number): string;
|
|
10
|
-
export declare function getRadioGroupTestIds(id: string): {
|
|
11
|
-
optionId: string;
|
|
12
|
-
};
|
|
13
|
-
export declare function getOptionGroupTestIds(id: string): {
|
|
14
|
-
searchBoxId: string;
|
|
15
|
-
optionId: string;
|
|
16
|
-
selectVisibleId: string;
|
|
17
|
-
clearVisibleId: string;
|
|
18
|
-
};
|
|
19
|
-
export declare const getOptionGroupRadioTestIds: (id: string) => {
|
|
20
|
-
searchBoxId: string;
|
|
21
|
-
optionId: string;
|
|
22
|
-
selectVisibleId: string;
|
|
23
|
-
clearVisibleId: string;
|
|
24
|
-
};
|
|
25
|
-
export declare function getOptionGroupCheckBoxTestIds(id: string): {
|
|
26
|
-
searchBoxId: string;
|
|
27
|
-
optionId: string;
|
|
28
|
-
selectVisibleId: string;
|
|
29
|
-
clearVisibleId: string;
|
|
30
|
-
applyButtonId: string;
|
|
31
|
-
clearButtonId: string;
|
|
32
|
-
};
|
|
33
|
-
export declare function getPhoneNumberInputTestIds(id: string): {
|
|
34
|
-
phoneId: string;
|
|
35
|
-
countryId: string;
|
|
36
|
-
countryInputIds: BaseSelectIds & {
|
|
37
|
-
searchBoxId: string;
|
|
38
|
-
optionId: string;
|
|
39
|
-
selectVisibleId: string;
|
|
40
|
-
clearVisibleId: string;
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
export declare function getMessageTestId(id: string): string;
|
|
44
|
-
export declare function getSelectInputTestIds(id: string, multiSelect: true): BaseSelectIds & OptionGroupCheckBoxIds;
|
|
45
|
-
export declare function getSelectInputTestIds(id: string, multiSelect?: false): BaseSelectIds & OptionGroupRadioIds;
|
|
46
|
-
export declare function getSelectInputTestIds(id: string, multiSelect?: boolean): (BaseSelectIds & OptionGroupCheckBoxIds) | (BaseSelectIds & OptionGroupRadioIds);
|
|
47
|
-
export declare function getTypeaheadTestIds(id: string): {
|
|
48
|
-
searchBoxId: string;
|
|
49
|
-
optionId: string;
|
|
50
|
-
selectVisibleId: string;
|
|
51
|
-
clearVisibleId: string;
|
|
52
|
-
optionGroupId: string;
|
|
53
|
-
};
|
|
54
|
-
export declare function getCalendarTestIds(id: string): {
|
|
55
|
-
leftIconId: string;
|
|
56
|
-
rightIconId: string;
|
|
57
|
-
applyButtonId: string;
|
|
58
|
-
clearButtonId: string;
|
|
59
|
-
};
|
|
60
|
-
export declare function getPopUpTestIds(id: string): {
|
|
61
|
-
closeButtonId: string;
|
|
62
|
-
approveButtonId: string;
|
|
63
|
-
rejectButtonId: string;
|
|
64
|
-
};
|
|
65
|
-
export {};
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`CheckboxGroup snapshot 1`] = `
|
|
4
|
-
.emotion-0 {
|
|
5
|
-
margin-right: 10px;
|
|
6
|
-
font-size: 16px;
|
|
7
|
-
padding-top: 2px;
|
|
8
|
-
height: 18px;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.emotion-1 {
|
|
12
|
-
cursor: pointer;
|
|
13
|
-
display: -webkit-box;
|
|
14
|
-
display: -webkit-flex;
|
|
15
|
-
display: -ms-flexbox;
|
|
16
|
-
display: flex;
|
|
17
|
-
outline: none;
|
|
18
|
-
padding: 10px 0;
|
|
19
|
-
position: relative;
|
|
20
|
-
-webkit-align-items: center;
|
|
21
|
-
-webkit-box-align: center;
|
|
22
|
-
-ms-flex-align: center;
|
|
23
|
-
align-items: center;
|
|
24
|
-
font-weight: 400;
|
|
25
|
-
color: #101721;
|
|
26
|
-
font-size: 14px;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.emotion-1[data-disabled='true'] {
|
|
30
|
-
cursor: not-allowed;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.emotion-1[data-disabled='true'] .i {
|
|
34
|
-
color: #E0E0E0;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
<div
|
|
38
|
-
aria-label="test"
|
|
39
|
-
role="checkboxgroup"
|
|
40
|
-
>
|
|
41
|
-
<div
|
|
42
|
-
aria-checked={false}
|
|
43
|
-
className="emotion-1"
|
|
44
|
-
data-testid="checkbox-group-0"
|
|
45
|
-
onClick={[Function]}
|
|
46
|
-
role="checkbox"
|
|
47
|
-
tabIndex={-1}
|
|
48
|
-
>
|
|
49
|
-
<div
|
|
50
|
-
className="emotion-0"
|
|
51
|
-
>
|
|
52
|
-
<i
|
|
53
|
-
className="pi pi-checkbox-unselected"
|
|
54
|
-
style={
|
|
55
|
-
Object {
|
|
56
|
-
"color": "#E0E0E0",
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
/>
|
|
60
|
-
</div>
|
|
61
|
-
|
|
62
|
-
I am a checkbox
|
|
63
|
-
</div>
|
|
64
|
-
<div
|
|
65
|
-
aria-checked={true}
|
|
66
|
-
className="emotion-1"
|
|
67
|
-
data-testid="checkbox-group-1"
|
|
68
|
-
onClick={[Function]}
|
|
69
|
-
role="checkbox"
|
|
70
|
-
tabIndex={0}
|
|
71
|
-
>
|
|
72
|
-
<div
|
|
73
|
-
className="emotion-0"
|
|
74
|
-
>
|
|
75
|
-
<i
|
|
76
|
-
className="pi pi-checkbox-selected"
|
|
77
|
-
style={
|
|
78
|
-
Object {
|
|
79
|
-
"color": "#6161FF",
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
/>
|
|
83
|
-
</div>
|
|
84
|
-
|
|
85
|
-
I am a checkbox
|
|
86
|
-
</div>
|
|
87
|
-
</div>
|
|
88
|
-
`;
|
package/src/utils/testIds.ts
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
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
|
-
}
|