ouisys-component-library 0.0.17 → 0.0.19

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.
@@ -0,0 +1,18 @@
1
+ import { I as ITracker } from './custom-types-8de85480.js';
2
+
3
+ interface IChainRedirectProps {
4
+ chainRedirectUrl: string;
5
+ tracker: ITracker;
6
+ isCsSafe: ({ window, msisdn, command }: {
7
+ window: Window;
8
+ msisdn: string;
9
+ command: 'cs';
10
+ }) => Promise<boolean>;
11
+ msisdn: string;
12
+ className?: string;
13
+ dataQaId?: string;
14
+ }
15
+
16
+ declare const ChainRedirect: ({ chainRedirectUrl, tracker, isCsSafe, msisdn, className, dataQaId }: IChainRedirectProps) => JSX.Element;
17
+
18
+ export { ChainRedirect };
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=t(e);exports.ChainRedirect=function(t){var n=t.chainRedirectUrl,a=t.tracker,r=t.isCsSafe,c=t.msisdn,d=t.className,o=t.dataQaId,s=void 0===o?"chain-redirect-":o;return e.useEffect((function(){"undefined"!=typeof window&&window.pac_analytics&&window.pac_analytics.visitor&&setTimeout((function(){r({window:window,msisdn:c,command:"cs"}).then((function(e){e&&(a.customEvent("Chain-Redirect","redirect","ChainFlow",{redirectUrl:n}),window.location.href=n)}))}),2e3)}),[]),i.default.createElement("div",{"data-qa-id":s,className:d},i.default.createElement("h3",null,"Redirecting..."))};
2
+ //# sourceMappingURL=chainRedirect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chainRedirect.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import e,{useEffect as i}from"react";var n=function(n){var t=n.chainRedirectUrl,a=n.tracker,c=n.isCsSafe,r=n.msisdn,d=n.className,o=n.dataQaId,s=void 0===o?"chain-redirect-":o;return i((function(){"undefined"!=typeof window&&window.pac_analytics&&window.pac_analytics.visitor&&setTimeout((function(){c({window:window,msisdn:r,command:"cs"}).then((function(e){e&&(a.customEvent("Chain-Redirect","redirect","ChainFlow",{redirectUrl:t}),window.location.href=t)}))}),2e3)}),[]),e.createElement("div",{"data-qa-id":s,className:d},e.createElement("h3",null,"Redirecting..."))};export{n as ChainRedirect};
2
+ //# sourceMappingURL=chainRedirect.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chainRedirect.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ declare type IOptInFlowName = 'Block' | 'Click to sms' | 'Hybrid Pin' | 'Msisdn to sms' | 'Not available' | 'Pin' | 'Redirect' | 'To be determined' | 'USSD' | '3G click';
2
+ declare type ITracker = {
3
+ advancedInFlow: (flow: string, action: string, args?: any) => void;
4
+ advancedInPreFlow: (label: string, args?: any) => void;
5
+ recedeInFlow: (flow: string, newState: string, args?: any) => void;
6
+ customEvent: (category: string, action: string, label: string, arg?: any) => void;
7
+ sendOptInFlowEvent: (optInFlowName: IOptInFlowName) => void;
8
+ };
9
+
10
+ export { ITracker as I };
package/build/index.d.ts CHANGED
@@ -1,14 +1,6 @@
1
+ import { I as ITracker } from './custom-types-8de85480.js';
1
2
  import * as React$1 from 'react';
2
3
 
3
- declare type IOptInFlowName = 'Block' | 'Click to sms' | 'Hybrid Pin' | 'Msisdn to sms' | 'Not available' | 'Pin' | 'Redirect' | 'To be determined' | 'USSD' | '3G click';
4
- declare type ITracker = {
5
- advancedInFlow: (flow: string, action: string, args?: any) => void;
6
- advancedInPreFlow: (label: string, args?: any) => void;
7
- recedeInFlow: (flow: string, newState: string, args?: any) => void;
8
- customEvent: (category: string, action: string, label: string, arg?: any) => void;
9
- sendOptInFlowEvent: (optInFlowName: IOptInFlowName) => void;
10
- };
11
-
12
4
  interface interfaceButton extends React.ButtonHTMLAttributes<HTMLButtonElement> {
13
5
  children: React.ReactNode;
14
6
  className?: string;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IChainRedirectProps } from './ChainRedirect.types';
3
+ declare const ChainRedirect: ({ chainRedirectUrl, tracker, isCsSafe, msisdn, className, dataQaId }: IChainRedirectProps) => JSX.Element;
4
+ export { ChainRedirect };
@@ -0,0 +1,42 @@
1
+ import { Story } from '@storybook/react';
2
+ import { IChainRedirectProps } from './ChainRedirect.types';
3
+ declare const _default: {
4
+ title: string;
5
+ component: string;
6
+ parameters: {
7
+ importObject: string;
8
+ importPath: string;
9
+ };
10
+ argTypes: {
11
+ window: {
12
+ control: {
13
+ type: string;
14
+ };
15
+ description: string;
16
+ };
17
+ msisdn: {
18
+ control: {
19
+ type: string;
20
+ };
21
+ description: string;
22
+ };
23
+ command: {
24
+ control: {
25
+ type: string;
26
+ };
27
+ description: string;
28
+ };
29
+ isCsSafe: {
30
+ name: string;
31
+ description: string;
32
+ };
33
+ dataQaId: {
34
+ control: {
35
+ type: string;
36
+ };
37
+ description: string;
38
+ };
39
+ };
40
+ };
41
+ export default _default;
42
+ export declare const Main: Story<IChainRedirectProps>;
@@ -0,0 +1,13 @@
1
+ import { ITracker } from '../custom-types';
2
+ export interface IChainRedirectProps {
3
+ chainRedirectUrl: string;
4
+ tracker: ITracker;
5
+ isCsSafe: ({ window, msisdn, command }: {
6
+ window: Window;
7
+ msisdn: string;
8
+ command: 'cs';
9
+ }) => Promise<boolean>;
10
+ msisdn: string;
11
+ className?: string;
12
+ dataQaId?: string;
13
+ }
@@ -0,0 +1,2 @@
1
+ import { ChainRedirect } from './ChainRedirect';
2
+ export { ChainRedirect };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ouisys-component-library",
3
- "version": "0.0.17",
3
+ "version": "0.0.19",
4
4
  "description": "Ouisys Components",
5
5
  "main": "build/index.js",
6
6
  "module": "build/index.es.js",