@cleartrip/ct-design-spinner 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,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { ISpinnerProps } from './type';
3
3
  declare const Spinner: {
4
- ({ width, height, gradientColors }: ISpinnerProps): React.ReactElement;
4
+ ({ width, height, gradientColors, testID }: ISpinnerProps): React.ReactElement;
5
5
  displayName: string;
6
6
  };
7
7
  export default Spinner;
@@ -1 +1 @@
1
- {"version":3,"file":"Spinner.native.d.ts","sourceRoot":"","sources":["../packages/components/Spinner/src/Spinner.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAMhD,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAKvC,QAAA,MAAM,OAAO;wCAAiD,aAAa,GAAG,KAAK,CAAC,YAAY;;CA4D/F,CAAC;AAIF,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"Spinner.native.d.ts","sourceRoot":"","sources":["../packages/components/Spinner/src/Spinner.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAMhD,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAKvC,QAAA,MAAM,OAAO;gDAAyD,aAAa,GAAG,KAAK,CAAC,YAAY;;CAiEvG,CAAC;AAIF,eAAe,OAAO,CAAC"}
package/dist/type.d.ts CHANGED
@@ -2,6 +2,7 @@ export interface ISpinnerProps {
2
2
  width?: number;
3
3
  height?: number;
4
4
  gradientColors?: string[];
5
+ testID?: string;
5
6
  }
6
7
  export type SpinnerProps = ISpinnerProps;
7
8
  //# sourceMappingURL=type.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../packages/components/Spinner/src/type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAE5B,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAKD,MAAM,MAAM,YAAY,GAAG,aAAa,CAAC"}
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../packages/components/Spinner/src/type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAE5B,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAK1B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAKD,MAAM,MAAM,YAAY,GAAG,aAAa,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cleartrip/ct-design-spinner",
3
- "version": "5.26.0-SNAPSHOT-native-main.0",
3
+ "version": "5.26.0",
4
4
  "description": "Spinner migrated to ct-design-style-manager",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "./dist/ct-design-spinner.cjs.js",
@@ -25,9 +25,9 @@
25
25
  ],
26
26
  "dependencies": {
27
27
  "@emotion/css": "^11.11.2",
28
- "@cleartrip/ct-design-style-manager": "5.25.1-SNAPSHOT-native-main.0",
29
- "@cleartrip/ct-design-types": "5.26.0-SNAPSHOT-native-main.0",
30
- "@cleartrip/ct-design-theme": "5.26.0-SNAPSHOT-native-main.0"
28
+ "@cleartrip/ct-design-style-manager": "5.26.0",
29
+ "@cleartrip/ct-design-theme": "5.26.0",
30
+ "@cleartrip/ct-design-types": "5.26.0"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "react": ">=16.8.0",
@@ -9,7 +9,7 @@ import { ISpinnerProps } from './type';
9
9
  const STROKE_DASH_RATIO = 0.65;
10
10
  const DEFAULT_STROKE_WIDTH = 2;
11
11
 
12
- const Spinner = ({ width = 30, height = 30, gradientColors }: ISpinnerProps): React.ReactElement => {
12
+ const Spinner = ({ width = 30, height = 30, gradientColors, testID }: ISpinnerProps): React.ReactElement => {
13
13
  const rotation = useSharedValue(0);
14
14
  const gradientId = useId();
15
15
 
@@ -44,7 +44,7 @@ const Spinner = ({ width = 30, height = 30, gradientColors }: ISpinnerProps): Re
44
44
  const strokeUrl = `url(#${gradientId})`;
45
45
 
46
46
  return (
47
- <Animated.View style={animatedStyles}>
47
+ <Animated.View testID={testID ? `${testID}-Spinner` : undefined} style={animatedStyles}>
48
48
  <svg width={size} height={size} viewBox={`0 0 ${size} ${size}`} fill='none'>
49
49
  <defs>
50
50
  <linearGradient id={gradientId} x1='0%' y1='0%' x2='100%' y2='0%'>
@@ -68,7 +68,12 @@ const Spinner = ({ width = 30, height = 30, gradientColors }: ISpinnerProps): Re
68
68
  );
69
69
  }
70
70
 
71
- return <Animated.View style={[animatedStyles, spinnerStaticStyles.root, dynamicStyles.size]} />;
71
+ return (
72
+ <Animated.View
73
+ testID={testID ? `${testID}-Spinner` : undefined}
74
+ style={[animatedStyles, spinnerStaticStyles.root, dynamicStyles.size]}
75
+ />
76
+ );
72
77
  };
73
78
 
74
79
  Spinner.displayName = 'Spinner';
package/src/type.ts CHANGED
@@ -5,6 +5,11 @@ export interface ISpinnerProps {
5
5
  height?: number;
6
6
  /** Optional gradient colors — when provided, renders the SVG gradient spinner instead of the default border spinner. */
7
7
  gradientColors?: string[];
8
+ /**
9
+ * Identifier used to locate this component in end-to-end tests.
10
+ * Forwarded to the underlying animated view.
11
+ */
12
+ testID?: string;
8
13
  }
9
14
 
10
15
  /**