pebble-web 2.25.2-alpha.3 → 2.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/dist/components/typings/Button.d.ts +0 -1
  2. package/dist/components/typings/Calendar.d.ts +0 -1
  3. package/dist/components/typings/CheckboxGroup.d.ts +0 -1
  4. package/dist/components/typings/Control.d.ts +0 -1
  5. package/dist/components/typings/DateInput.d.ts +0 -1
  6. package/dist/components/typings/Dropdown.d.ts +0 -1
  7. package/dist/components/typings/Input.d.ts +0 -1
  8. package/dist/components/typings/Loader.d.ts +0 -1
  9. package/dist/components/typings/Message.d.ts +0 -1
  10. package/dist/components/typings/OptionGroup.d.ts +0 -1
  11. package/dist/components/typings/OptionGroupCheckBox.d.ts +0 -1
  12. package/dist/components/typings/OptionGroupRadio.d.ts +0 -1
  13. package/dist/components/typings/PhoneNumberInput.d.ts +0 -1
  14. package/dist/components/typings/PopUp.d.ts +0 -1
  15. package/dist/components/typings/RadioGroup.d.ts +0 -1
  16. package/dist/components/typings/Search.d.ts +0 -1
  17. package/dist/components/typings/SecondaryInput.d.ts +0 -1
  18. package/dist/components/typings/Select.d.ts +0 -1
  19. package/dist/components/typings/Text.d.ts +0 -1
  20. package/dist/components/typings/Typeahead.d.ts +0 -1
  21. package/dist/index.d.ts +0 -1
  22. package/dist/pebble-web.dev.js +164 -358
  23. package/dist/pebble-web.dev.js.map +1 -1
  24. package/dist/pebble-web.es.dev.js +70 -239
  25. package/dist/pebble-web.es.dev.js.map +1 -1
  26. package/dist/pebble-web.es.js +64 -233
  27. package/dist/pebble-web.es.js.map +1 -1
  28. package/dist/pebble-web.js +158 -352
  29. package/dist/pebble-web.js.map +1 -1
  30. package/dist/pebble-web.module.dev.js +165 -347
  31. package/dist/pebble-web.module.dev.js.map +1 -1
  32. package/dist/pebble-web.module.js +159 -341
  33. package/dist/pebble-web.module.js.map +1 -1
  34. package/dist/pebble-web.umd.dev.js +166 -360
  35. package/dist/pebble-web.umd.dev.js.map +1 -1
  36. package/dist/pebble-web.umd.js +160 -354
  37. package/dist/pebble-web.umd.js.map +1 -1
  38. package/dist/utils/index.d.ts +0 -1
  39. package/dist/utils/useragent/index.d.ts +1 -2
  40. package/package.json +3 -3
  41. package/src/components/Button.tsx +1 -3
  42. package/src/components/Calendar.tsx +4 -28
  43. package/src/components/CheckboxGroup.tsx +3 -13
  44. package/src/components/DateInput.tsx +1 -3
  45. package/src/components/DropDown.tsx +1 -3
  46. package/src/components/Input.tsx +3 -15
  47. package/src/components/Loader.tsx +1 -3
  48. package/src/components/Message.tsx +1 -3
  49. package/src/components/NativeDateInput.tsx +1 -2
  50. package/src/components/OptionGroupCheckBox.tsx +2 -14
  51. package/src/components/PhoneNumberInput.tsx +1 -7
  52. package/src/components/PopUp.tsx +1 -7
  53. package/src/components/RadioGroup.tsx +3 -20
  54. package/src/components/Search.tsx +1 -3
  55. package/src/components/SecondaryInput.tsx +2 -9
  56. package/src/components/Select.tsx +1 -13
  57. package/src/components/Tabs.tsx +1 -1
  58. package/src/components/Text.tsx +2 -7
  59. package/src/components/TimePicker.tsx +2 -2
  60. package/src/components/Toast.tsx +2 -2
  61. package/src/components/TypeAhead.tsx +3 -14
  62. package/src/components/__tests__/__snapshots__/optionGroup.test.tsx.snap +3 -0
  63. package/src/components/__tests__/__snapshots__/select.test.tsx.snap +0 -3
  64. package/src/components/__tests__/__snapshots__/timepicker.test.tsx.snap +18 -18
  65. package/src/components/__tests__/calendar.test.tsx +24 -6
  66. package/src/components/__tests__/checkboxGroup.test.tsx +8 -39
  67. package/src/components/__tests__/select.test.tsx +30 -19
  68. package/src/components/__tests__/timepicker.test.tsx +14 -4
  69. package/src/components/shared/Control.tsx +1 -3
  70. package/src/components/shared/OptionGroup.tsx +5 -23
  71. package/src/components/typings/Button.ts +0 -1
  72. package/src/components/typings/Calendar.ts +0 -1
  73. package/src/components/typings/CheckboxGroup.ts +0 -1
  74. package/src/components/typings/Control.ts +0 -1
  75. package/src/components/typings/DateInput.ts +0 -1
  76. package/src/components/typings/Dropdown.ts +0 -1
  77. package/src/components/typings/Input.ts +0 -1
  78. package/src/components/typings/Loader.ts +0 -1
  79. package/src/components/typings/Message.ts +0 -1
  80. package/src/components/typings/OptionGroup.ts +0 -1
  81. package/src/components/typings/OptionGroupCheckBox.ts +0 -1
  82. package/src/components/typings/OptionGroupRadio.ts +0 -1
  83. package/src/components/typings/PhoneNumberInput.ts +0 -1
  84. package/src/components/typings/PopUp.ts +0 -1
  85. package/src/components/typings/RadioGroup.ts +0 -1
  86. package/src/components/typings/Search.ts +0 -1
  87. package/src/components/typings/SecondaryInput.ts +0 -1
  88. package/src/components/typings/Select.ts +0 -1
  89. package/src/components/typings/Text.ts +0 -1
  90. package/src/components/typings/Typeahead.ts +0 -1
  91. package/src/index.ts +0 -1
  92. package/src/utils/index.ts +0 -1
  93. package/src/utils/useragent/index.tsx +1 -1
  94. package/dist/utils/testIds.d.ts +0 -65
  95. package/src/components/__tests__/__snapshots__/checkboxGroup.test.tsx.snap +0 -88
  96. package/src/utils/testIds.ts +0 -119
@@ -18,7 +18,6 @@ export interface DateInputProps {
18
18
  onOutsideClick?: (isOpen: boolean) => void;
19
19
  controlled?: boolean;
20
20
  isOpen?: boolean;
21
- testId?: string;
22
21
  }
23
22
 
24
23
  export interface DateInputState {
@@ -25,7 +25,6 @@ export interface DropdownProps {
25
25
  modifiers?: Modifiers;
26
26
  controlled?: boolean;
27
27
  isOpen?: boolean;
28
- testId?: string;
29
28
  }
30
29
 
31
30
  export interface DropdownState {
@@ -20,7 +20,6 @@ export interface CommonInputProps {
20
20
  successMessage?: string;
21
21
  leftElement?: () => React.ReactNode;
22
22
  rightElement?: () => React.ReactNode;
23
- testId?: string;
24
23
  }
25
24
 
26
25
  export type InputType =
@@ -2,5 +2,4 @@ export interface LoaderProps {
2
2
  color?: string;
3
3
  className?: string;
4
4
  scale?: number;
5
- testId?: string;
6
5
  }
@@ -4,5 +4,4 @@ export interface AlertProps {
4
4
  intent: "error" | "success";
5
5
  className?: string;
6
6
  text: React.ReactChild;
7
- testId?: string;
8
7
  }
@@ -13,7 +13,6 @@ export interface CommonProps {
13
13
  selectVisible?: () => void;
14
14
  clearVisible?: () => void;
15
15
  };
16
- testId?: string;
17
16
  }
18
17
 
19
18
  export interface OptionGroupProps<OptionType> extends CommonProps {
@@ -13,5 +13,4 @@ export interface OptionGroupCheckBoxProps<OptionType> extends CommonProps {
13
13
  props: OptionGroupCheckBoxProps<OptionType>
14
14
  ) => void;
15
15
  onClear?: () => void;
16
- testId?: string;
17
16
  }
@@ -7,5 +7,4 @@ export interface OptionGroupRadio<OptionType> extends CommonProps {
7
7
  */
8
8
  selected?: OptionType;
9
9
  isSelected?: (value: OptionType) => boolean;
10
- testId?: string;
11
10
  }
@@ -19,5 +19,4 @@ export interface PhoneNumberInputProps<OptionType = string> {
19
19
  inputProps?: Omit<SimpleInputProps, "value" | "onChange" | "placeholder">;
20
20
  placeholder?: string;
21
21
  required?: boolean;
22
- testId?: string;
23
22
  }
@@ -9,5 +9,4 @@ export interface PopUpProps {
9
9
  rejectButtonText?: string | Element;
10
10
  approveButtonProps?: Omit<ButtonProps, "children" | "onClick">;
11
11
  rejectButtonProps?: Omit<ButtonProps, "children" | "onClick">;
12
- testId?: string;
13
12
  }
@@ -7,5 +7,4 @@ export interface RadioGroupProps<OptionType> {
7
7
  className?: string;
8
8
  name: string;
9
9
  disabled?: boolean;
10
- testId?: string;
11
10
  }
@@ -10,5 +10,4 @@ export interface SearchProps {
10
10
  clearable?: boolean;
11
11
  inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
12
12
  loading?: boolean;
13
- testId?: string;
14
13
  }
@@ -14,7 +14,6 @@ export interface SecondaryInputProps {
14
14
  message?: string;
15
15
  inputProps?: React.InputHTMLAttributes<HTMLInputElement> &
16
16
  React.RefAttributes<HTMLInputElement>;
17
- testId?: string;
18
17
  }
19
18
 
20
19
  export interface SecondaryInputState {
@@ -23,7 +23,6 @@ export interface CommonSelectProps<OptionType> {
23
23
  isSelected?: (value: OptionType) => boolean;
24
24
  placement?: Placement;
25
25
  modifiers?: Modifiers;
26
- testId?: string;
27
26
  }
28
27
 
29
28
  export interface SingleSelectProps<OptionType>
@@ -4,5 +4,4 @@ export interface TextProps {
4
4
  color?: string;
5
5
  className?: string;
6
6
  typography?: TypographyStyle;
7
- testId?: string;
8
7
  }
@@ -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
@@ -1,7 +1,6 @@
1
1
  export * from "./theme";
2
2
  export * from "./components";
3
3
  export * from "./utils/useragent";
4
- export * from "./utils/testIds";
5
4
 
6
5
  import * as utils from "./utils";
7
6
  import { colors } from "pebble-shared";
@@ -2,4 +2,3 @@ export * from "./strings/capitalize";
2
2
  export * from "./numbers/format";
3
3
  export * from "./analytics/ga";
4
4
  export * from "./dimensions";
5
- export * from "./testIds";
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
 
3
- interface UserAgentInfoProviderProps {
3
+ export interface UserAgentInfoProviderProps {
4
4
  userAgent: string;
5
5
  }
6
6
 
@@ -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
- `;
@@ -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
- }