@cleartrip/ct-design-dropdown 5.26.0-SNAPSHOT-native-main.0 → 5.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.
@@ -1 +1 @@
1
- {"version":3,"file":"Dropdown.native.d.ts","sourceRoot":"","sources":["../packages/components/Dropdown/src/Dropdown.native.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,aAAa,EAAQ,MAAM,QAAQ,CAAC;AAsD7C,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAqLrC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"Dropdown.native.d.ts","sourceRoot":"","sources":["../packages/components/Dropdown/src/Dropdown.native.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,aAAa,EAAQ,MAAM,QAAQ,CAAC;AAsD7C,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA2LrC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
package/dist/type.d.ts CHANGED
@@ -24,5 +24,6 @@ export interface DropdownProps {
24
24
  dropDownItemContainer?: Styles[];
25
25
  dropDownItemTextContainer?: TypographyStyleConfigProps;
26
26
  };
27
+ testID?: string;
27
28
  }
28
29
  //# sourceMappingURL=type.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../packages/components/Dropdown/src/type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAE7E,MAAM,WAAW,IAAI;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,I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C;IACnB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;CAClE;AAED,MAAM,WAAW,aAAa;IAI5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAKhB,aAAa,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAKjC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAK9B,WAAW,CAAC,EAAE,MAAM,CAAC;IAKrB,QAAQ,EAAE,IAAI,EAAE,CAAC;IAKjB,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAKlD,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAK/D,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAKhC,WAAW,CAAC,EAAE;QAEZ,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;QAEhC,wBAAwB,CAAC,EAAE,SAAS,EAAE,CAAC;QAEvC,yBAAyB,CAAC,EAAE,MAAM,EAAE,CAAC;QAErC,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;QAEjC,yBAAyB,CAAC,EAAE,0BAA0B,CAAC;KACxD,CAAC;IAOF,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cleartrip/ct-design-dropdown",
3
- "version": "5.26.0-SNAPSHOT-native-main.0",
3
+ "version": "5.26.0",
4
4
  "description": "Dropdown Component",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "./dist/ct-design-dropdown.cjs.js",
@@ -24,12 +24,12 @@
24
24
  "src"
25
25
  ],
26
26
  "dependencies": {
27
- "@cleartrip/ct-design-theme": "5.26.0-SNAPSHOT-native-main.0",
28
- "@cleartrip/ct-design-types": "5.26.0-SNAPSHOT-native-main.0",
29
- "@cleartrip/ct-design-container": "5.26.0-SNAPSHOT-native-main.0",
30
- "@cleartrip/ct-design-typography": "5.26.0-SNAPSHOT-native-main.0",
31
- "@cleartrip/ct-design-icons": "60.0.0-SNAPSHOT-native-main.0",
32
- "@cleartrip/ct-design-style-manager": "5.25.1-SNAPSHOT-native-main.0"
27
+ "@cleartrip/ct-design-theme": "5.26.0",
28
+ "@cleartrip/ct-design-container": "5.26.0",
29
+ "@cleartrip/ct-design-typography": "5.26.0",
30
+ "@cleartrip/ct-design-types": "5.26.0",
31
+ "@cleartrip/ct-design-icons": "60.0.0",
32
+ "@cleartrip/ct-design-style-manager": "5.26.0"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "react": ">=16.8.0",
@@ -70,6 +70,7 @@ const Dropdown: React.FC<DropdownProps> = ({
70
70
  onItemSelect,
71
71
  renderItem,
72
72
  showDropDownListOnTop = true,
73
+ testID,
73
74
  }) => {
74
75
  const {
75
76
  placeHolderContainer = [],
@@ -174,6 +175,7 @@ const Dropdown: React.FC<DropdownProps> = ({
174
175
  return (
175
176
  <Pressable
176
177
  key={`${item.value}-${index}`}
178
+ testID={testID ? `${testID}-option-${item.value}` : undefined}
177
179
  onLayout={(event: LayoutChangeEvent) => {
178
180
  const layout = event.nativeEvent.layout;
179
181
  itemsRef.current[index] = layout.y;
@@ -205,7 +207,7 @@ const Dropdown: React.FC<DropdownProps> = ({
205
207
  );
206
208
 
207
209
  return (
208
- <Container styleConfig={{ root: [staticStyle.rootContainer] }}>
210
+ <Container testID={testID ? `${testID}-Dropdown` : undefined} styleConfig={{ root: [staticStyle.rootContainer] }}>
209
211
  <Modal visible={focus} transparent animationType='none' onRequestClose={() => setFocus(false)}>
210
212
  <Pressable style={staticStyle.modalBackground} onPress={() => setFocus(false)}>
211
213
  <View
@@ -223,7 +225,11 @@ const Dropdown: React.FC<DropdownProps> = ({
223
225
  </Pressable>
224
226
  </Modal>
225
227
 
226
- <Pressable onPress={toggleDropDown} style={[dynamicStyles.placeHolderContainer, ...placeHolderContainer]}>
228
+ <Pressable
229
+ testID={testID ? `${testID}-trigger` : undefined}
230
+ onPress={toggleDropDown}
231
+ style={[dynamicStyles.placeHolderContainer, ...placeHolderContainer]}
232
+ >
227
233
  <Container styleConfig={{ root: [dynamicStyles.placeHolderTextContainer] }}>
228
234
  <Typography
229
235
  color={dropDownValue.length > 0 ? TypographyColor.PRIMARY : TypographyColor.DISABLED}
package/src/type.ts CHANGED
@@ -67,4 +67,11 @@ export interface DropdownProps {
67
67
  /** Styles for the dropdown item text. */
68
68
  dropDownItemTextContainer?: TypographyStyleConfigProps;
69
69
  };
70
+
71
+ /**
72
+ * Identifier used to locate this component in end-to-end tests.
73
+ * Forwarded to the root view; the trigger is exposed as `${testID}-trigger`
74
+ * and each option as `${testID}-option-${value}`.
75
+ */
76
+ testID?: string;
70
77
  }