fansunited-frontend-core 0.0.69 → 0.0.70
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/README.md +45 -0
- package/components/Consents/ConsentCta.d.ts +14 -0
- package/components/Consents/ConsentCta.d.ts.map +1 -0
- package/components/Consents/ConsentPanel.d.ts +22 -0
- package/components/Consents/ConsentPanel.d.ts.map +1 -0
- package/components/Consents/ConsentsList.d.ts +22 -0
- package/components/Consents/ConsentsList.d.ts.map +1 -0
- package/components/LeadCollection/OverlayLeadAfterCollection.d.ts +9 -3
- package/components/LeadCollection/OverlayLeadAfterCollection.d.ts.map +1 -1
- package/components/LeadCollection/SplitLeadAfterCollection.d.ts +7 -3
- package/components/LeadCollection/SplitLeadAfterCollection.d.ts.map +1 -1
- package/components/LeadCollection/StandardLeadAfterCollection.d.ts +9 -3
- package/components/LeadCollection/StandardLeadAfterCollection.d.ts.map +1 -1
- package/components/Leads/LeadForm.d.ts +2 -2
- package/components/Leads/LeadForm.d.ts.map +1 -1
- package/functions/buttonStyles.d.ts +28 -0
- package/functions/buttonStyles.d.ts.map +1 -0
- package/functions/consents.d.ts +23 -0
- package/functions/consents.d.ts.map +1 -0
- package/functions/functions.d.ts +3 -0
- package/functions/functions.d.ts.map +1 -1
- package/hooks/hooks.d.ts +2 -0
- package/hooks/hooks.d.ts.map +1 -1
- package/hooks/useConsents.d.ts +25 -0
- package/hooks/useConsents.d.ts.map +1 -0
- package/index.d.ts +4 -0
- package/index.d.ts.map +1 -1
- package/index.es.js +11224 -10457
- package/interfaces/interfaces.d.ts +50 -4
- package/interfaces/interfaces.d.ts.map +1 -1
- package/locales/bg.json.d.ts +25 -5
- package/locales/de.json.d.ts +25 -5
- package/locales/el.json.d.ts +25 -5
- package/locales/en.json.d.ts +25 -5
- package/locales/es.json.d.ts +25 -5
- package/locales/fr-be.json.d.ts +25 -5
- package/locales/fr.json.d.ts +25 -5
- package/locales/it.json.d.ts +25 -5
- package/locales/pl.json.d.ts +29 -5
- package/locales/pt-br.json.d.ts +25 -5
- package/locales/pt.json.d.ts +25 -5
- package/locales/ro.json.d.ts +27 -5
- package/locales/sk.json.d.ts +27 -5
- package/locales/sr.json.d.ts +27 -5
- package/package.json +1 -1
- package/components/Leads/ConsentsCheckboxes.d.ts +0 -14
- package/components/Leads/ConsentsCheckboxes.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -67,6 +67,12 @@ import {
|
|
|
67
67
|
LeadLabels,
|
|
68
68
|
FormLeadLabels,
|
|
69
69
|
|
|
70
|
+
// Consents
|
|
71
|
+
ConsentDef,
|
|
72
|
+
ConsentsConfig,
|
|
73
|
+
ConsentsLabels,
|
|
74
|
+
ConsentPosition,
|
|
75
|
+
|
|
70
76
|
// Content and Branding
|
|
71
77
|
ContentInfo,
|
|
72
78
|
CampaignInfo,
|
|
@@ -526,6 +532,45 @@ const consents: LeadConsent[] = [
|
|
|
526
532
|
/>
|
|
527
533
|
```
|
|
528
534
|
|
|
535
|
+
### Profile Consents
|
|
536
|
+
|
|
537
|
+
`ConsentDef` is the consent shape shared by `Predictor`, `TopX` and `ClassicQuizPlay`. `CollectLead`'s older `LeadConsent` (`id` / `label`) is still accepted everywhere consents are read.
|
|
538
|
+
|
|
539
|
+
```tsx
|
|
540
|
+
import { ConsentDef, ConsentsConfig } from "fansunited-frontend-core";
|
|
541
|
+
|
|
542
|
+
const items: ConsentDef[] = [
|
|
543
|
+
{
|
|
544
|
+
consentId: "terms",
|
|
545
|
+
// HTML and the {{privacyPolicyUrl}} / {{termsAndConditionsUrl}} tokens are supported.
|
|
546
|
+
// Tokens link to the entity's branding.urls.
|
|
547
|
+
body: "I accept the {{privacyPolicyUrl}} and the {{termsAndConditionsUrl}}",
|
|
548
|
+
required: true, // optional, defaults to false — blocks the gate's CTA
|
|
549
|
+
position: "before" // ClassicQuizPlay only: "before" (start screen) | "after" (before submit)
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
consentId: "marketing",
|
|
553
|
+
body: "Send me news and offers by email",
|
|
554
|
+
defaultChecked: true // optional, defaults to false
|
|
555
|
+
}
|
|
556
|
+
];
|
|
557
|
+
|
|
558
|
+
// Predictor / TopX take the array directly
|
|
559
|
+
<Predictor {...otherProps} consents={items} />;
|
|
560
|
+
|
|
561
|
+
// ClassicQuizPlay wraps it, so the surface copy travels with it
|
|
562
|
+
const consents: ConsentsConfig = {
|
|
563
|
+
items,
|
|
564
|
+
labels: {
|
|
565
|
+
title: "Before we save your score",
|
|
566
|
+
ctaLabel: "Continue",
|
|
567
|
+
requiredError: "Please accept the required consents to continue."
|
|
568
|
+
}
|
|
569
|
+
};
|
|
570
|
+
|
|
571
|
+
<ClassicQuizPlay {...otherProps} consents={consents} />;
|
|
572
|
+
```
|
|
573
|
+
|
|
529
574
|
### Theme Customization
|
|
530
575
|
|
|
531
576
|
```tsx
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
type ConsentCtaProps = {
|
|
4
|
+
onClick: () => void;
|
|
5
|
+
/** Widgets pass their own finish label; falls back to the shared "Continue". */
|
|
6
|
+
label?: string;
|
|
7
|
+
isSubmitting?: boolean;
|
|
8
|
+
primaryColor?: string;
|
|
9
|
+
/** Off for widgets whose own buttons carry no arrow, such as PollVote. */
|
|
10
|
+
showArrow?: boolean;
|
|
11
|
+
};
|
|
12
|
+
declare const ConsentCta: React.FC<ConsentCtaProps>;
|
|
13
|
+
export default ConsentCta;
|
|
14
|
+
//# sourceMappingURL=ConsentCta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConsentCta.d.ts","sourceRoot":"","sources":["../../../src/components/Consents/ConsentCta.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,KAAK,eAAe,GAAG;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,gFAAgF;IAChF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0EAA0E;IAC1E,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA+CzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BrandingUrlsModel } from 'fansunited-sdk-esm';
|
|
3
|
+
import { ConsentsSurface } from '../../interfaces/interfaces';
|
|
4
|
+
|
|
5
|
+
type ConsentPanelProps = {
|
|
6
|
+
consents: ConsentsSurface;
|
|
7
|
+
primaryColor?: string;
|
|
8
|
+
textColor?: string;
|
|
9
|
+
brandingUrls?: BrandingUrlsModel | null;
|
|
10
|
+
/** When set, a CTA is rendered under the checkboxes — the consent step's own gate. */
|
|
11
|
+
onSubmit?: () => void;
|
|
12
|
+
isSubmitting?: boolean;
|
|
13
|
+
/** Label for that CTA when the client has not set consents.labels.ctaLabel. */
|
|
14
|
+
ctaLabel?: string;
|
|
15
|
+
/** Off for widgets whose own buttons carry no arrow, such as PollVote. */
|
|
16
|
+
showArrow?: boolean;
|
|
17
|
+
/** "center" centres the title and description only — items stay flush left. */
|
|
18
|
+
align?: "start" | "center";
|
|
19
|
+
};
|
|
20
|
+
declare const ConsentPanel: React.FC<ConsentPanelProps>;
|
|
21
|
+
export default ConsentPanel;
|
|
22
|
+
//# sourceMappingURL=ConsentPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConsentPanel.d.ts","sourceRoot":"","sources":["../../../src/components/Consents/ConsentPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAMvD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAI9D,KAAK,iBAAiB,GAAG;IACvB,QAAQ,EAAE,eAAe,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACxC,sFAAsF;IACtF,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0EAA0E;IAC1E,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,+EAA+E;IAC/E,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;CAC5B,CAAC;AAEF,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAiG7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { FormBrandingUrls, FormLeadLabels } from '../../interfaces/interfaces';
|
|
3
|
+
import { ConsentInput } from '../../functions/consents';
|
|
4
|
+
|
|
5
|
+
export type ConsentsListProps = {
|
|
6
|
+
/** Accepts either public shape — ConsentDef or LeadConsent. */
|
|
7
|
+
consents: ConsentInput[];
|
|
8
|
+
checked: Record<string, boolean>;
|
|
9
|
+
onChange: (next: Record<string, boolean>) => void;
|
|
10
|
+
isDisabled?: boolean;
|
|
11
|
+
primaryColor?: string;
|
|
12
|
+
textColor?: string;
|
|
13
|
+
brandingUrls?: FormBrandingUrls;
|
|
14
|
+
labels?: FormLeadLabels;
|
|
15
|
+
/** Shown under the list once the user tried to continue with a required box unticked. */
|
|
16
|
+
requiredError?: string | null;
|
|
17
|
+
/** Matches the lead form, whose inputs are pinned to the light scheme. */
|
|
18
|
+
forceLightSurface?: boolean;
|
|
19
|
+
};
|
|
20
|
+
declare const ConsentsList: React.FC<ConsentsListProps>;
|
|
21
|
+
export default ConsentsList;
|
|
22
|
+
//# sourceMappingURL=ConsentsList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConsentsList.d.ts","sourceRoot":"","sources":["../../../src/components/Consents/ConsentsList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC/E,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAOhF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,+DAA+D;IAC/D,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IAClD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,yFAAyF;IACzF,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,0EAA0E;IAC1E,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA2M7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { LeadsOptions, SkeletonEntity } from '../../index';
|
|
3
3
|
import { FansUnitedSDKModel } from 'fansunited-sdk-esm';
|
|
4
|
-
import { RulesDisplay as RulesDisplayInterface } from '../../interfaces/interfaces';
|
|
4
|
+
import { ConsentDef, LeadConsent, RulesDisplay as RulesDisplayInterface } from '../../interfaces/interfaces';
|
|
5
5
|
|
|
6
6
|
export interface OverlayLeadAfterCollectionProps {
|
|
7
7
|
/** Entity (ClassicQuiz, MatchQuiz, Poll, PersonalityQuiz, EventGame) */
|
|
@@ -26,8 +26,14 @@ export interface OverlayLeadAfterCollectionProps {
|
|
|
26
26
|
primaryUrl?: string;
|
|
27
27
|
secondaryUrl?: string;
|
|
28
28
|
}>;
|
|
29
|
-
/** CollectLeadWrapper component from consumer package */
|
|
30
|
-
CollectLeadWrapper
|
|
29
|
+
/** CollectLeadWrapper component from consumer package. Not needed when `content` is set. */
|
|
30
|
+
CollectLeadWrapper?: React.ComponentType<any>;
|
|
31
|
+
/** Renders in the lead form's place — used by the consent step, which reuses this framing. */
|
|
32
|
+
content?: React.ReactNode;
|
|
33
|
+
/** Primary action for the footer row, where every other overlay screen puts its CTA. */
|
|
34
|
+
footerAction?: React.ReactNode;
|
|
35
|
+
/** Consents rendered inside the lead form. */
|
|
36
|
+
consents?: Array<LeadConsent | ConsentDef>;
|
|
31
37
|
/** Rules display configuration */
|
|
32
38
|
rulesDisplay?: RulesDisplayInterface;
|
|
33
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverlayLeadAfterCollection.d.ts","sourceRoot":"","sources":["../../../src/components/LeadCollection/OverlayLeadAfterCollection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAQL,YAAY,EACZ,cAAc,EACf,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,
|
|
1
|
+
{"version":3,"file":"OverlayLeadAfterCollection.d.ts","sourceRoot":"","sources":["../../../src/components/LeadCollection/OverlayLeadAfterCollection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAQL,YAAY,EACZ,cAAc,EACf,MAAM,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AAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { FansUnitedSDKModel } from 'fansunited-sdk-esm';
|
|
3
|
-
import { SkeletonEntity, LeadsOptions, RulesDisplay as RulesDisplayInterface } from '../../interfaces/interfaces';
|
|
3
|
+
import { ConsentDef, LeadConsent, SkeletonEntity, LeadsOptions, RulesDisplay as RulesDisplayInterface } from '../../interfaces/interfaces';
|
|
4
4
|
|
|
5
5
|
export interface SplitLeadAfterCollectionProps {
|
|
6
6
|
/** The entity (classicQuiz, matchQuiz, poll, personalityQuiz, eventGame) */
|
|
@@ -31,8 +31,12 @@ export interface SplitLeadAfterCollectionProps {
|
|
|
31
31
|
secondaryUrl?: string;
|
|
32
32
|
isCentered?: boolean;
|
|
33
33
|
}>;
|
|
34
|
-
/** CollectLeadWrapper component from the consumer package */
|
|
35
|
-
CollectLeadWrapper
|
|
34
|
+
/** CollectLeadWrapper component from the consumer package. Not needed when `content` is set. */
|
|
35
|
+
CollectLeadWrapper?: React.ComponentType<any>;
|
|
36
|
+
/** Renders in the lead form's place — used by the consent step, which reuses this framing. */
|
|
37
|
+
content?: React.ReactNode;
|
|
38
|
+
/** Consents rendered inside the lead form. */
|
|
39
|
+
consents?: Array<LeadConsent | ConsentDef>;
|
|
36
40
|
/** Rules display configuration */
|
|
37
41
|
rulesDisplay?: RulesDisplayInterface;
|
|
38
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SplitLeadAfterCollection.d.ts","sourceRoot":"","sources":["../../../src/components/LeadCollection/SplitLeadAfterCollection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAa1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EACL,cAAc,EACd,YAAY,EACZ,YAAY,IAAI,qBAAqB,EACtC,MAAM,6BAA6B,CAAC;AAIrC,MAAM,WAAW,6BAA6B;IAC5C,4EAA4E;IAC5E,MAAM,EAAE,cAAc,CAAC;IACvB,mEAAmE;IACnE,QAAQ,EAAE,MAAM,CAAC;IACjB,mBAAmB;IACnB,GAAG,EAAE,kBAAkB,CAAC;IACxB,0BAA0B;IAC1B,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,oCAAoC;IACpC,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,sCAAsC;IACtC,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,8DAA8D;IAC9D,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,oDAAoD;IACpD,QAAQ,EAAE,KAAK,CAAC,aAAa,CAAC;QAC5B,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;QACnC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;KAC3B,CAAC,CAAC;IACH,sDAAsD;IACtD,WAAW,EAAE,KAAK,CAAC,aAAa,CAAC;QAC/B,YAAY,EAAE,MAAM,CAAC;QACrB,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;QACrB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,UAAU,CAAC,EAAE,OAAO,CAAC;KACtB,CAAC,CAAC;IACH,
|
|
1
|
+
{"version":3,"file":"SplitLeadAfterCollection.d.ts","sourceRoot":"","sources":["../../../src/components/LeadCollection/SplitLeadAfterCollection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAa1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EACL,UAAU,EACV,WAAW,EACX,cAAc,EACd,YAAY,EACZ,YAAY,IAAI,qBAAqB,EACtC,MAAM,6BAA6B,CAAC;AAIrC,MAAM,WAAW,6BAA6B;IAC5C,4EAA4E;IAC5E,MAAM,EAAE,cAAc,CAAC;IACvB,mEAAmE;IACnE,QAAQ,EAAE,MAAM,CAAC;IACjB,m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, RulesDisplay as RulesDisplayInterface } from '../../interfaces/interfaces';
|
|
3
|
+
import { ConsentDef, LeadConsent, SkeletonEntity, LeadsOptions, RulesDisplay as RulesDisplayInterface } from '../../interfaces/interfaces';
|
|
4
4
|
|
|
5
5
|
export interface StandardLeadAfterCollectionProps {
|
|
6
6
|
/** The entity (classicQuiz, matchQuiz, poll, personalityQuiz, eventGame) */
|
|
@@ -32,8 +32,14 @@ export interface StandardLeadAfterCollectionProps {
|
|
|
32
32
|
primaryUrl?: string;
|
|
33
33
|
secondaryUrl?: string;
|
|
34
34
|
}>;
|
|
35
|
-
/** CollectLeadWrapper component from the consumer package */
|
|
36
|
-
CollectLeadWrapper
|
|
35
|
+
/** CollectLeadWrapper component from the consumer package. Not needed when `content` is set. */
|
|
36
|
+
CollectLeadWrapper?: React.ComponentType<any>;
|
|
37
|
+
/** Renders in the lead form's place — used by the consent step, which reuses this framing. */
|
|
38
|
+
content?: React.ReactNode;
|
|
39
|
+
/** Primary action for the footer row, where the playing screen puts its CTA. */
|
|
40
|
+
footerAction?: React.ReactNode;
|
|
41
|
+
/** Consents rendered inside the lead form. */
|
|
42
|
+
consents?: Array<LeadConsent | ConsentDef>;
|
|
37
43
|
/** Rules display configuration */
|
|
38
44
|
rulesDisplay?: RulesDisplayInterface;
|
|
39
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StandardLeadAfterCollection.d.ts","sourceRoot":"","sources":["../../../src/components/LeadCollection/StandardLeadAfterCollection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EACL,cAAc,EACd,YAAY,EACZ,YAAY,IAAI,qBAAqB,EACtC,MAAM,6BAA6B,CAAC;AAErC,MAAM,WAAW,gCAAgC;IAC/C,4EAA4E;IAC5E,MAAM,EAAE,cAAc,CAAC;IACvB,mEAAmE;IACnE,QAAQ,EAAE,MAAM,CAAC;IACjB,mBAAmB;IACnB,GAAG,EAAE,kBAAkB,CAAC;IACxB,0BAA0B;IAC1B,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,oCAAoC;IACpC,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,qCAAqC;IACrC,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACjC,sCAAsC;IACtC,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,8DAA8D;IAC9D,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,oDAAoD;IACpD,QAAQ,EAAE,KAAK,CAAC,aAAa,CAAC;QAC5B,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;QACnC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;KAC3B,CAAC,CAAC;IACH,sDAAsD;IACtD,WAAW,EAAE,KAAK,CAAC,aAAa,CAAC;QAC/B,YAAY,EAAE,MAAM,CAAC;QACrB,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;QACrB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC,CAAC;IACH,
|
|
1
|
+
{"version":3,"file":"StandardLeadAfterCollection.d.ts","sourceRoot":"","sources":["../../../src/components/LeadCollection/StandardLeadAfterCollection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EACL,UAAU,EACV,WAAW,EACX,cAAc,EACd,YAAY,EACZ,YAAY,IAAI,qBAAqB,EACtC,MAAM,6BAA6B,CAAC;AAErC,MAAM,WAAW,gCAAgC;IAC/C,4EAA4E;IAC5E,MAAM,EAAE,cAAc,CAAC;IACvB,mEAAmE;IACnE,QAAQ,EAAE,MAAM,CAAC;IACjB,mBAAmB;IACnB,GAAG,EAAE,kBAAkB,CAAC;IACx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
3
3
|
import { FansUnitedSDKModel } from 'fansunited-sdk-esm';
|
|
4
|
-
import { FormBrandingColors, FormBrandingUrls, FormLeadLabels, LeadConsent, LeadCustomField, OnSuccessCTADetails } from '../../interfaces/interfaces';
|
|
4
|
+
import { ConsentDef, FormBrandingColors, FormBrandingUrls, FormLeadLabels, LeadConsent, LeadCustomField, OnSuccessCTADetails } from '../../interfaces/interfaces';
|
|
5
5
|
|
|
6
6
|
interface LeadFormProps {
|
|
7
7
|
sdk: FansUnitedSDKModel;
|
|
@@ -14,7 +14,7 @@ interface LeadFormProps {
|
|
|
14
14
|
contentId?: string;
|
|
15
15
|
contentName?: string;
|
|
16
16
|
formCustomFields?: LeadCustomField[];
|
|
17
|
-
consents?: LeadConsent
|
|
17
|
+
consents?: Array<LeadConsent | ConsentDef>;
|
|
18
18
|
onSuccessCta?: OnSuccessCTADetails;
|
|
19
19
|
labels?: FormLeadLabels;
|
|
20
20
|
syncWithProfile?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LeadForm.d.ts","sourceRoot":"","sources":["../../../src/components/Leads/LeadForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"LeadForm.d.ts","sourceRoot":"","sources":["../../../src/components/Leads/LeadForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAmCxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,EACL,UAAU,EACV,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,eAAe,EACf,mBAAmB,EACpB,MAAM,6BAA6B,CAAC;AAuBrC,UAAU,aAAa;IACrB,GAAG,EAAE,kBAAkB,CAAC;IACxB,cAAc,CAAC,EAAE,kBAAkB,CAAC;IACpC,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,eAAe,EAAE,CAAC;IACrC,QAAQ,CAAC,EAAE,KAAK,CAAC,WAAW,GAAG,UAAU,CAAC,CAAC;IAC3C,YAAY,CAAC,EAAE,mBAAmB,CAAC;IACnC,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA6mBrC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Joy's `loading` flag also disables the button, so its disabled tokens take over — a dark
|
|
3
|
+
* background and a dark spinner. Applied only while busy, so a button that is genuinely
|
|
4
|
+
* disabled keeps its muted look. Leaves the spinner as the only visible content.
|
|
5
|
+
*/
|
|
6
|
+
export declare const busyButtonStyles: (primaryColor?: string, onPrimaryColor?: string) => {
|
|
7
|
+
"--variant-softDisabledBg": string | undefined;
|
|
8
|
+
"--variant-softDisabledColor": string | undefined;
|
|
9
|
+
"--variant-solidDisabledBg": string | undefined;
|
|
10
|
+
"--variant-solidDisabledColor": string | undefined;
|
|
11
|
+
animation: string;
|
|
12
|
+
"& .MuiButton-endDecorator, & .MuiButton-startDecorator": {
|
|
13
|
+
visibility: string;
|
|
14
|
+
};
|
|
15
|
+
"&.Mui-disabled": {
|
|
16
|
+
bgcolor: string | undefined;
|
|
17
|
+
opacity: number;
|
|
18
|
+
};
|
|
19
|
+
"& .MuiButton-loadingIndicatorCenter": {
|
|
20
|
+
color: string | undefined;
|
|
21
|
+
};
|
|
22
|
+
"& .MuiCircularProgress-root": {
|
|
23
|
+
"--CircularProgress-progressColor": string | undefined;
|
|
24
|
+
"--CircularProgress-trackColor": string;
|
|
25
|
+
color: string | undefined;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=buttonStyles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buttonStyles.d.ts","sourceRoot":"","sources":["../../src/functions/buttonStyles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,kBACZ,MAAM,mBACJ,MAAM;;;;;;;;;;;;;;;;;;;;;CA8BvB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ConsentEntityType, FansUnitedSDKModel } from 'fansunited-sdk-esm';
|
|
2
|
+
import { ConsentDef, FormLeadLabels, LeadConsent } from '../interfaces/interfaces';
|
|
3
|
+
|
|
4
|
+
/** Either public consent shape, normalized to the ConsentDef fields the UI works with. */
|
|
5
|
+
export type ConsentInput = ConsentDef | LeadConsent;
|
|
6
|
+
export interface ConsentEntity {
|
|
7
|
+
entityId?: string;
|
|
8
|
+
entityType?: ConsentEntityType;
|
|
9
|
+
}
|
|
10
|
+
export declare const normalizeConsents: (consents?: ConsentInput[] | null) => ConsentDef[];
|
|
11
|
+
/** A required consent is never pre-ticked — accepting it has to be the user's own action. */
|
|
12
|
+
export declare const initialConsentState: (consents: ConsentInput[]) => Record<string, boolean>;
|
|
13
|
+
export declare const areRequiredConsentsChecked: (consents: ConsentInput[], checked: Record<string, boolean>) => boolean;
|
|
14
|
+
export declare const getCheckedConsentIds: (checked: Record<string, boolean>) => string[];
|
|
15
|
+
/**
|
|
16
|
+
* Consent labels are stored as the text the user actually saw, so the URL tokens are
|
|
17
|
+
* replaced with their link labels rather than left as placeholders.
|
|
18
|
+
*/
|
|
19
|
+
export declare const buildConsentContentText: (body: string, labels?: FormLeadLabels) => string;
|
|
20
|
+
export declare const getAcceptedConsentIds: (sdk: FansUnitedSDKModel) => Promise<Set<string>>;
|
|
21
|
+
/** Never throws — a failed consent POST must not cost the user their participation. */
|
|
22
|
+
export declare const submitConsents: (sdk: FansUnitedSDKModel, consents: ConsentInput[], consentIds: string[], entity: ConsentEntity, labels?: FormLeadLabels) => Promise<void>;
|
|
23
|
+
//# sourceMappingURL=consents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consents.d.ts","sourceRoot":"","sources":["../../src/functions/consents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EACL,UAAU,EACV,cAAc,EACd,WAAW,EACZ,MAAM,0BAA0B,CAAC;AAElC,0FAA0F;AAC1F,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,WAAW,CAAC;AAEpD,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,iBAAiB,CAAC;CAChC;AAKD,eAAO,MAAM,iBAAiB,cACjB,YAAY,EAAE,GAAG,IAAI,KAC/B,UAAU,EAQZ,CAAC;AAEF,6FAA6F;AAC7F,eAAO,MAAM,mBAAmB,aACpB,YAAY,EAAE,KACvB,MAAM,CAAC,MAAM,EAAE,OAAO,CAQtB,CAAC;AAEJ,eAAO,MAAM,0BAA0B,aAC3B,YAAY,EAAE,WACf,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC/B,OAGgD,CAAC;AAEpD,eAAO,MAAM,oBAAoB,YACtB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC/B,MAAM,EAGa,CAAC;AAEvB;;;GAGG;AACH,eAAO,MAAM,uBAAuB,SAC5B,MAAM,WACH,cAAc,KACtB,MASE,CAAC;AAEN,eAAO,MAAM,qBAAqB,QAC3B,kBAAkB,KACtB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAUrB,CAAC;AAEF,uFAAuF;AACvF,eAAO,MAAM,cAAc,QACpB,kBAAkB,YACb,YAAY,EAAE,cACZ,MAAM,EAAE,UACZ,aAAa,WACZ,cAAc,KACtB,OAAO,CAAC,IAAI,CAoBd,CAAC"}
|
package/functions/functions.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export { useSpacingScale, getSpacing, isMobile, isExtraSmall, isTablet, isDesktop, useFontFamily, useCornerRadius, useColors, useBorderSize, useInternalTheme, useImageBackgroundGradient, isLarge, useCurrentThemeMode, } from './theme';
|
|
2
2
|
export { stripHtmlTags, hexToRgb, isAndroid, getDefaultCountryByCode, getDefaultCountryByLanguage, extractBrandingModelProperties, extractBrandingProperties, sanitizeBackgroundUrl, mapContentTypeToConsentEntityType, getBrandingClickUrl, getRelatedInfoPageId, isWithPrize, extractSdkError, extractSdkErrorMessage, } from './helpers';
|
|
3
|
+
export { normalizeConsents, initialConsentState, areRequiredConsentsChecked, getCheckedConsentIds, buildConsentContentText, getAcceptedConsentIds, submitConsents, } from './consents';
|
|
4
|
+
export type { ConsentInput, ConsentEntity } from './consents';
|
|
5
|
+
export { busyButtonStyles } from './buttonStyles';
|
|
3
6
|
export { initializeI18n } from './i18n';
|
|
4
7
|
export { fetchSearchTeamData, applyTeamOverride } from './searchTeamData';
|
|
5
8
|
export type { SearchTeamOverride } from './searchTeamData';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../src/functions/functions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,aAAa,EACb,eAAe,EACf,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,0BAA0B,EAC1B,OAAO,EACP,mBAAmB,GACpB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,aAAa,EACb,QAAQ,EACR,SAAS,EACT,uBAAuB,EACvB,2BAA2B,EAC3B,8BAA8B,EAC9B,yBAAyB,EACzB,qBAAqB,EACrB,iCAAiC,EACjC,mBAAmB,EACnB,oBAAoB,EACpB,WAAW,EACX,eAAe,EACf,sBAAsB,GACvB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1E,YAAY,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../src/functions/functions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,aAAa,EACb,eAAe,EACf,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,0BAA0B,EAC1B,OAAO,EACP,mBAAmB,GACpB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,aAAa,EACb,QAAQ,EACR,SAAS,EACT,uBAAuB,EACvB,2BAA2B,EAC3B,8BAA8B,EAC9B,yBAAyB,EACzB,qBAAqB,EACrB,iCAAiC,EACjC,mBAAmB,EACnB,oBAAoB,EACpB,WAAW,EACX,eAAe,EACf,sBAAsB,GACvB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,0BAA0B,EAC1B,oBAAoB,EACpB,uBAAuB,EACvB,qBAAqB,EACrB,cAAc,GACf,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1E,YAAY,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC"}
|
package/hooks/hooks.d.ts
CHANGED
|
@@ -5,5 +5,7 @@ export { useConstantContext } from './useConstantContext';
|
|
|
5
5
|
export { useImageVariant } from './useImageVariant';
|
|
6
6
|
export { useLeadForm } from './useLeadForm';
|
|
7
7
|
export { useInfoPage } from './useInfoPage';
|
|
8
|
+
export { useConsents } from './useConsents';
|
|
9
|
+
export type { UseConsentsParams, UseConsentsReturn } from './useConsents';
|
|
8
10
|
export type { UseLeadFormParams, UseLeadFormReturn, LeadFormData } from './useLeadForm';
|
|
9
11
|
//# sourceMappingURL=hooks.d.ts.map
|
package/hooks/hooks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/hooks/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/hooks/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC1E,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ConsentEntityType, FansUnitedSDKModel } from 'fansunited-sdk-esm';
|
|
2
|
+
import { ConsentDef, FormLeadLabels } from '../interfaces/interfaces';
|
|
3
|
+
import { ConsentInput } from '../functions/consents';
|
|
4
|
+
|
|
5
|
+
export interface UseConsentsParams {
|
|
6
|
+
sdk: FansUnitedSDKModel;
|
|
7
|
+
consents?: ConsentInput[];
|
|
8
|
+
/** Entity the consent record is attached to. */
|
|
9
|
+
entityId?: string;
|
|
10
|
+
entityType?: ConsentEntityType;
|
|
11
|
+
/** Used for the {{...Url}} link labels stored as the consent content. */
|
|
12
|
+
labels?: FormLeadLabels;
|
|
13
|
+
}
|
|
14
|
+
export interface UseConsentsReturn {
|
|
15
|
+
loading: boolean;
|
|
16
|
+
/** Configured consents the user has not accepted yet. */
|
|
17
|
+
pending: ConsentDef[];
|
|
18
|
+
checked: Record<string, boolean>;
|
|
19
|
+
setChecked: (next: Record<string, boolean>) => void;
|
|
20
|
+
allRequiredChecked: (group: ConsentDef[]) => boolean;
|
|
21
|
+
/** Submits the ticked consents of the given group. Never throws. */
|
|
22
|
+
submit: (group: ConsentDef[]) => Promise<void>;
|
|
23
|
+
}
|
|
24
|
+
export declare const useConsents: (params: UseConsentsParams) => UseConsentsReturn;
|
|
25
|
+
//# sourceMappingURL=useConsents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useConsents.d.ts","sourceRoot":"","sources":["../../src/hooks/useConsents.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAML,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,kBAAkB,CAAC;IACxB,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;IAC1B,gDAAgD;IAChD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,yEAAyE;IACzE,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,yDAAyD;IACzD,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACpD,kBAAkB,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,OAAO,CAAC;IACrD,oEAAoE;IACpE,MAAM,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAChD;AAED,eAAO,MAAM,WAAW,WAAY,iBAAiB,KAAG,iBAqEvD,CAAC"}
|
package/index.d.ts
CHANGED
|
@@ -13,6 +13,10 @@ export { default as AdditionalCTA } from './components/AdditionalCTA';
|
|
|
13
13
|
export { default as ShareCTA } from './components/ShareCTA';
|
|
14
14
|
export { default as Rules } from './components/Rules';
|
|
15
15
|
export { default as CollectLeadForm } from './components/Leads/CollectLeadForm';
|
|
16
|
+
export { default as ConsentsList } from './components/Consents/ConsentsList';
|
|
17
|
+
export type { ConsentsListProps } from './components/Consents/ConsentsList';
|
|
18
|
+
export { default as ConsentPanel } from './components/Consents/ConsentPanel';
|
|
19
|
+
export { default as ConsentCta } from './components/Consents/ConsentCta';
|
|
16
20
|
export { default as StandardSkeleton } from './components/Skeletons/Standard/StandardSkeleton';
|
|
17
21
|
export { default as SplitSkeleton } from './components/Skeletons/Split/SplitSkeleton';
|
|
18
22
|
export { default as OverlaySkeleton } from './components/Skeletons/Overlay/OverlaySkeleton';
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,OAAO,EAAE,MAAyB,CAAC;AAEhD,cAAc,uBAAuB,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,YAAY,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,gBAAgB,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