@frak-labs/components 0.0.26-beta.21ffe110 → 0.0.26-beta.3ccd7cd8

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 (44) hide show
  1. package/cdn/Banner.8suUv8bz.js +64 -0
  2. package/cdn/ButtonShare.BQUz6qnD.js +1 -0
  3. package/cdn/ButtonWallet.BWuCPyeD.js +40 -0
  4. package/cdn/OpenInAppButton.Cth7PeZO.js +1 -0
  5. package/cdn/PostPurchase.unZJ0uRk.js +52 -0
  6. package/cdn/components.js +1 -1
  7. package/cdn/formatReward.DGzaZNpK.js +1 -0
  8. package/cdn/loader.css +0 -14
  9. package/cdn/loader.js +66 -1
  10. package/cdn/sprinkles.css.ts.vanilla.DqftZWaO.js +1175 -0
  11. package/cdn/useLightDomStyles.DvsTLyAM.js +1 -0
  12. package/cdn/usePlacement.B7jMsQvP.js +58 -0
  13. package/cdn/useReward.z3Xv9W3b.js +1 -0
  14. package/cdn/useShareModal.BMEdhsoV.js +1 -0
  15. package/dist/GiftIcon-ByLU2AzK.js +1317 -0
  16. package/dist/banner.d.ts +116 -0
  17. package/dist/banner.js +429 -0
  18. package/dist/buttonShare.d.ts +8 -6
  19. package/dist/buttonShare.js +61 -101
  20. package/dist/buttonWallet.d.ts +10 -2
  21. package/dist/buttonWallet.js +79 -38
  22. package/dist/formatReward-DglcX-Xj.js +33 -0
  23. package/dist/openInApp.d.ts +4 -2
  24. package/dist/openInApp.js +23 -27
  25. package/dist/postPurchase.d.ts +122 -0
  26. package/dist/postPurchase.js +1760 -0
  27. package/dist/useLightDomStyles-Cjpf0MnX.js +41 -0
  28. package/dist/usePlacement-LqYjZLX_.js +248 -0
  29. package/dist/useReward-Cup3DU1-.js +65 -0
  30. package/dist/useShareModal-Bmlk3eBJ.js +53 -0
  31. package/package.json +25 -15
  32. package/cdn/ButtonShare.Ba6yVLnc.js +0 -1
  33. package/cdn/ButtonWallet.B_iX5OJn.js +0 -1
  34. package/cdn/OpenInAppButton.Iawrumsu.js +0 -1
  35. package/cdn/Spinner.sJKLrGhX.js +0 -1
  36. package/cdn/initFrakSdk._ycDRGU2.js +0 -66
  37. package/cdn/useClientReady.Dyagl92v.js +0 -1
  38. package/dist/Spinner-ByXrz_8L.js +0 -36
  39. package/dist/Spinner-CHZD3tMn.css +0 -1
  40. package/dist/buttonShare.css +0 -1
  41. package/dist/buttonWallet.css +0 -1
  42. package/dist/openInApp.css +0 -1
  43. package/dist/useClientReady-0vKBG0-p.js +0 -197
  44. package/dist/useReward-DAkT-7wT.js +0 -48
@@ -0,0 +1,116 @@
1
+ import { InteractionTypeKey } from "@frak-labs/core-sdk";
2
+ import * as _$preact from "preact";
3
+
4
+ //#region src/components/Banner/types.d.ts
5
+ /**
6
+ * The props type for {@link Banner}.
7
+ * @inline
8
+ */
9
+ type BannerProps = {
10
+ /**
11
+ * Placement ID for backend-driven CSS customization.
12
+ */
13
+ placement?: string;
14
+ /**
15
+ * CSS class names passed through to the root element (Light DOM).
16
+ */
17
+ classname?: string;
18
+ /**
19
+ * Filter rewards by interaction type (e.g. "purchase", "referral").
20
+ * When omitted, the best reward across all interaction types is shown.
21
+ */
22
+ interaction?: InteractionTypeKey;
23
+ /**
24
+ * Override the referral banner title.
25
+ */
26
+ referralTitle?: string;
27
+ /**
28
+ * Override the referral banner description.
29
+ */
30
+ referralDescription?: string;
31
+ /**
32
+ * Override the referral banner CTA button text.
33
+ */
34
+ referralCta?: string;
35
+ /**
36
+ * Override the in-app browser banner title.
37
+ */
38
+ inappTitle?: string;
39
+ /**
40
+ * Override the in-app browser banner description.
41
+ */
42
+ inappDescription?: string;
43
+ /**
44
+ * Override the in-app browser banner CTA button text.
45
+ */
46
+ inappCta?: string;
47
+ /**
48
+ * When set, forces the banner to render in preview mode (e.g. in Shopify theme editor).
49
+ * Bypasses normal event/browser detection and shows static content.
50
+ */
51
+ preview?: string;
52
+ /**
53
+ * Which banner variant to preview: "referral" or "inapp".
54
+ * Only used when {@link preview} is set. Defaults to "referral".
55
+ */
56
+ previewMode?: "referral" | "inapp";
57
+ };
58
+ //#endregion
59
+ //#region src/components/Banner/Banner.d.ts
60
+ /**
61
+ * Auto-detecting notification banner component.
62
+ *
63
+ * Renders an inline banner on the merchant page with one of two distinct
64
+ * visual styles depending on the detected mode:
65
+ *
66
+ * - **Referral mode** (white): Shown after a successful referral link
67
+ * processing. Displays a gift icon, reward copy, and a "Got it" CTA.
68
+ * - **In-app browser mode** (dark transparent): Shown when the page is
69
+ * opened inside a social media in-app browser (Instagram, Facebook).
70
+ * Offers an inline link to redirect to the default browser plus a
71
+ * close button to dismiss.
72
+ *
73
+ * In-app browser mode takes priority over referral mode.
74
+ * Uses Light DOM + vanilla-extract styles from `@frak-labs/design-system`.
75
+ *
76
+ * @group components
77
+ *
78
+ * @example
79
+ * Basic usage (auto-detects mode):
80
+ * ```html
81
+ * <frak-banner></frak-banner>
82
+ * ```
83
+ *
84
+ * @example
85
+ * With a custom class:
86
+ * ```html
87
+ * <frak-banner classname="my-custom-banner"></frak-banner>
88
+ * ```
89
+ */
90
+ declare function Banner({
91
+ placement: placementId,
92
+ classname,
93
+ interaction,
94
+ referralTitle: propReferralTitle,
95
+ referralDescription: propReferralDescription,
96
+ referralCta: propReferralCta,
97
+ inappTitle: propInappTitle,
98
+ inappDescription: propInappDescription,
99
+ inappCta: propInappCta,
100
+ preview,
101
+ previewMode
102
+ }: BannerProps): _$preact.JSX.Element | null;
103
+ //#endregion
104
+ //#region src/components/Banner/index.d.ts
105
+ /**
106
+ * Custom element interface for `<frak-banner>`.
107
+ * Combines standard {@link HTMLElement} with {@link BannerProps}.
108
+ */
109
+ interface BannerElement extends HTMLElement, BannerProps {}
110
+ declare global {
111
+ interface HTMLElementTagNameMap {
112
+ "frak-banner": BannerElement;
113
+ }
114
+ }
115
+ //#endregion
116
+ export { Banner, BannerElement };
package/dist/banner.js ADDED
@@ -0,0 +1,429 @@
1
+ import { a as registerWebComponent, i as useClientReady, t as usePlacement } from "./usePlacement-LqYjZLX_.js";
2
+ import { t as useLightDomStyles } from "./useLightDomStyles-Cjpf0MnX.js";
3
+ import { t as useReward } from "./useReward-Cup3DU1-.js";
4
+ import { a as CloseCircleIcon, c as cssSource$5, i as ExternalLinkIcon, n as WarningIcon, o as cssSource$6, s as cssSource$4, t as GiftIcon } from "./GiftIcon-ByLU2AzK.js";
5
+ import { isInAppBrowser, redirectToExternalBrowser } from "@frak-labs/core-sdk";
6
+ import { REFERRAL_SUCCESS_EVENT, getMergeToken } from "@frak-labs/core-sdk/actions";
7
+ import { useCallback, useEffect, useMemo, useState } from "preact/hooks";
8
+ import { jsx, jsxs } from "preact/jsx-runtime";
9
+ //#region \0ve-inline:../../packages/design-system/src/styles/inAppBanner.css.ts.vanilla.js
10
+ const cssSource$3 = `@keyframes inAppBanner_fadeIn__1ibpiy70 {
11
+ from {
12
+ opacity: 0;
13
+ transform: translateY(-4px);
14
+ }
15
+ to {
16
+ opacity: 1;
17
+ transform: translateY(0);
18
+ }
19
+ }
20
+ .inAppBanner_container__1ibpiy71 {
21
+ position: fixed;
22
+ top: max(8px, env(safe-area-inset-top));
23
+ left: 16px;
24
+ right: 16px;
25
+ z-index: 1000;
26
+ display: flex;
27
+ flex-direction: column;
28
+ gap: 4px;
29
+ padding: 12px 16px;
30
+ padding-right: 32px;
31
+ border-radius: 12px;
32
+ background-color: #000000CC;
33
+ backdrop-filter: blur(12px);
34
+ -webkit-backdrop-filter: blur(12px);
35
+ color: #ffffff;
36
+ animation: inAppBanner_fadeIn__1ibpiy70 300ms ease-out;
37
+ }
38
+ .inAppBanner_header__1ibpiy72 {
39
+ display: flex;
40
+ align-items: center;
41
+ gap: 8px;
42
+ }
43
+ .inAppBanner_iconWrapper__1ibpiy73 {
44
+ flex-shrink: 0;
45
+ width: 20px;
46
+ height: 20px;
47
+ display: flex;
48
+ align-items: center;
49
+ justify-content: center;
50
+ color: #ffffff;
51
+ }
52
+ .inAppBanner_title__1ibpiy74 {
53
+ margin: 0;
54
+ padding: 0;
55
+ font-size: 16px;
56
+ font-weight: 500;
57
+ line-height: 26px;
58
+ color: var(--text-onAction__pbq4ak6);
59
+ }
60
+ .inAppBanner_body__1ibpiy75 {
61
+ display: flex;
62
+ flex-wrap: wrap;
63
+ align-items: baseline;
64
+ gap: 0 4px;
65
+ }
66
+ .inAppBanner_description__1ibpiy76 {
67
+ margin: 0;
68
+ padding: 0;
69
+ font-size: 14px;
70
+ color: var(--text-onAction__pbq4ak6);
71
+ line-height: 22px;
72
+ opacity: 0.96;
73
+ }
74
+ .inAppBanner_cta__1ibpiy77 {
75
+ all: unset;
76
+ display: inline-flex;
77
+ align-items: center;
78
+ gap: 4px;
79
+ color: #2BB2FF;
80
+ font-size: 14px;
81
+ font-weight: 600;
82
+ text-decoration: underline;
83
+ text-underline-offset: 2px;
84
+ cursor: pointer;
85
+ }
86
+ .inAppBanner_cta__1ibpiy77:focus-visible {
87
+ outline: 2px solid #2BB2FF;
88
+ outline-offset: 2px;
89
+ border-radius: 4px;
90
+ }
91
+ .inAppBanner_closeButton__1ibpiy78 {
92
+ all: unset;
93
+ position: absolute;
94
+ top: 8px;
95
+ right: 8px;
96
+ width: 28px;
97
+ height: 28px;
98
+ display: flex;
99
+ align-items: center;
100
+ justify-content: center;
101
+ border-radius: 9999px;
102
+ color: rgba(255, 255, 255, 0.6);
103
+ cursor: pointer;
104
+ }
105
+ .inAppBanner_closeButton__1ibpiy78:focus-visible {
106
+ outline: 2px solid #ffffff;
107
+ outline-offset: 2px;
108
+ }`;
109
+ //#endregion
110
+ //#region ../../packages/design-system/src/styles/inAppBanner.css.ts
111
+ var body = "inAppBanner_body__1ibpiy75";
112
+ var closeButton = "inAppBanner_closeButton__1ibpiy78";
113
+ var container = "inAppBanner_container__1ibpiy71";
114
+ var cta = "inAppBanner_cta__1ibpiy77";
115
+ var description = "inAppBanner_description__1ibpiy76";
116
+ var header = "inAppBanner_header__1ibpiy72";
117
+ var iconWrapper = "inAppBanner_iconWrapper__1ibpiy73";
118
+ var title = "inAppBanner_title__1ibpiy74";
119
+ cssSource$4 + cssSource$3;
120
+ //#endregion
121
+ //#region ../../packages/design-system/src/components/InAppBanner/index.tsx
122
+ function InAppBanner({ title: title$1, description: description$1, cta: cta$1, dismissLabel, onAction, onDismiss, className, classNames }) {
123
+ return /* @__PURE__ */ jsxs("div", {
124
+ className: `${container}${className ? ` ${className}` : ""}`,
125
+ role: "alert",
126
+ children: [
127
+ /* @__PURE__ */ jsxs("div", {
128
+ className: header,
129
+ children: [/* @__PURE__ */ jsx("span", {
130
+ className: `${iconWrapper}${classNames?.icon ? ` ${classNames.icon}` : ""}`,
131
+ children: /* @__PURE__ */ jsx(WarningIcon, {
132
+ width: 20,
133
+ height: 20
134
+ })
135
+ }), /* @__PURE__ */ jsx("p", {
136
+ className: `${title}${classNames?.title ? ` ${classNames.title}` : ""}`,
137
+ children: title$1
138
+ })]
139
+ }),
140
+ /* @__PURE__ */ jsxs("div", {
141
+ className: body,
142
+ children: [/* @__PURE__ */ jsx("p", {
143
+ className: `${description}${classNames?.description ? ` ${classNames.description}` : ""}`,
144
+ children: description$1
145
+ }), /* @__PURE__ */ jsxs("button", {
146
+ type: "button",
147
+ className: `${cta}${classNames?.cta ? ` ${classNames.cta}` : ""}`,
148
+ onClick: onAction,
149
+ children: [cta$1, /* @__PURE__ */ jsx(ExternalLinkIcon, {
150
+ width: 14,
151
+ height: 14
152
+ })]
153
+ })]
154
+ }),
155
+ /* @__PURE__ */ jsx("button", {
156
+ type: "button",
157
+ className: `${closeButton}${classNames?.close ? ` ${classNames.close}` : ""}`,
158
+ onClick: onDismiss,
159
+ "aria-label": dismissLabel,
160
+ children: /* @__PURE__ */ jsx(CloseCircleIcon, {
161
+ width: 16,
162
+ height: 16
163
+ })
164
+ })
165
+ ]
166
+ });
167
+ }
168
+ //#endregion
169
+ //#region \0ve-inline:src/components/Banner/Banner.css.ts.vanilla.js
170
+ const cssSource$1 = `@keyframes Banner_fadeIn__1gnumzi0 {
171
+ from {
172
+ opacity: 0;
173
+ transform: translateY(-4px);
174
+ }
175
+ to {
176
+ opacity: 1;
177
+ transform: translateY(0);
178
+ }
179
+ }
180
+ .Banner_rootBase__1gnumzi1 {
181
+ position: relative;
182
+ display: flex;
183
+ animation: Banner_fadeIn__1gnumzi0 300ms ease-out;
184
+ }
185
+ .Banner_iconSvg__1gnumzi2 {
186
+ width: 100%;
187
+ height: 100%;
188
+ }
189
+ .Banner_referral__1gnumzi3 {
190
+ flex-direction: row;
191
+ align-items: center;
192
+ gap: 16px;
193
+ padding: 16px;
194
+ background-color: #ffffff;
195
+ color: var(--text-primary__pbq4ak0);
196
+ }
197
+ .Banner_referralIconWrapper__1gnumzi4 {
198
+ flex-shrink: 0;
199
+ align-self: flex-start;
200
+ width: 40px;
201
+ height: 40px;
202
+ }
203
+ .Banner_referralBody__1gnumzi5 {
204
+ flex: 1;
205
+ min-width: 0;
206
+ }
207
+ .Banner_referralTitle__1gnumzi6 {
208
+ font-size: 16px;
209
+ font-weight: 600;
210
+ color: var(--text-primary__pbq4ak0);
211
+ line-height: 22px;
212
+ }
213
+ .Banner_referralDescription__1gnumzi7 {
214
+ margin-bottom: 8px;
215
+ font-size: 14px;
216
+ color: #979797;
217
+ line-height: 22px;
218
+ }
219
+ .Banner_referralCta__1gnumzi8 {
220
+ display: inline-block;
221
+ padding: 8px 16px;
222
+ border: 1px solid #000000;
223
+ border-radius: 9999px;
224
+ color: var(--text-primary__pbq4ak0);
225
+ font-size: 10px;
226
+ font-weight: 700;
227
+ line-height: 12px;
228
+ text-transform: uppercase;
229
+ }
230
+ .Banner_referralCta__1gnumzi8:focus-visible {
231
+ outline: 2px solid #000000;
232
+ outline-offset: 2px;
233
+ }`;
234
+ //#endregion
235
+ //#region src/components/Banner/Banner.css.ts
236
+ var iconSvg = "Banner_iconSvg__1gnumzi2";
237
+ var referral = "Banner_referral__1gnumzi3 reset_base__1831jhd0 Banner_rootBase__1gnumzi1";
238
+ var referralBody = "Banner_referralBody__1gnumzi5";
239
+ var referralCta = "Banner_referralCta__1gnumzi8 reset_element_button__1831jhd6 reset_fieldAppearance__1831jhd2 reset_focusRing__1831jhd1";
240
+ var referralDescription = "Banner_referralDescription__1gnumzi7 reset_base__1831jhd0";
241
+ var referralIconWrapper = "Banner_referralIconWrapper__1gnumzi4";
242
+ var referralTitle = "Banner_referralTitle__1gnumzi6 reset_base__1831jhd0";
243
+ const cssSource = cssSource$5 + cssSource$4 + cssSource$6 + cssSource$1;
244
+ //#endregion
245
+ //#region src/components/Banner/Banner.tsx
246
+ /**
247
+ * Auto-detecting notification banner component.
248
+ *
249
+ * Renders an inline banner on the merchant page with one of two distinct
250
+ * visual styles depending on the detected mode:
251
+ *
252
+ * - **Referral mode** (white): Shown after a successful referral link
253
+ * processing. Displays a gift icon, reward copy, and a "Got it" CTA.
254
+ * - **In-app browser mode** (dark transparent): Shown when the page is
255
+ * opened inside a social media in-app browser (Instagram, Facebook).
256
+ * Offers an inline link to redirect to the default browser plus a
257
+ * close button to dismiss.
258
+ *
259
+ * In-app browser mode takes priority over referral mode.
260
+ * Uses Light DOM + vanilla-extract styles from `@frak-labs/design-system`.
261
+ *
262
+ * @group components
263
+ *
264
+ * @example
265
+ * Basic usage (auto-detects mode):
266
+ * ```html
267
+ * <frak-banner></frak-banner>
268
+ * ```
269
+ *
270
+ * @example
271
+ * With a custom class:
272
+ * ```html
273
+ * <frak-banner classname="my-custom-banner"></frak-banner>
274
+ * ```
275
+ */
276
+ function Banner({ placement: placementId, classname = "", interaction, referralTitle: propReferralTitle, referralDescription: propReferralDescription, referralCta: propReferralCta, inappTitle: propInappTitle, inappDescription: propInappDescription, inappCta: propInappCta, preview, previewMode }) {
277
+ const isPreview = !!preview;
278
+ const resolvedPreviewMode = previewMode === "inapp" ? "inapp" : "referral";
279
+ const placement = usePlacement(placementId);
280
+ const { shouldRender, isHidden, isClientReady } = useClientReady();
281
+ useLightDomStyles("frak-banner", placementId, placement?.components?.banner?.css, cssSource);
282
+ const [dismissed, setDismissed] = useState(false);
283
+ const [mode, setMode] = useState(() => {
284
+ if (isPreview) return resolvedPreviewMode;
285
+ return isInAppBrowser ? "inapp" : null;
286
+ });
287
+ useEffect(() => {
288
+ if (isPreview) setMode(resolvedPreviewMode);
289
+ }, [isPreview, resolvedPreviewMode]);
290
+ const { reward } = useReward(mode === "referral" && isClientReady, interaction);
291
+ const [prefetchedMergeToken, setPrefetchedMergeToken] = useState(null);
292
+ useEffect(() => {
293
+ const client = window.FrakSetup?.client;
294
+ if (mode !== "inapp" || isPreview || !isClientReady || !client) return;
295
+ getMergeToken(client).then((token) => setPrefetchedMergeToken(token)).catch(() => {});
296
+ }, [
297
+ mode,
298
+ isPreview,
299
+ isClientReady
300
+ ]);
301
+ useEffect(() => {
302
+ if (isPreview || mode === "inapp") return;
303
+ const handler = () => setMode("referral");
304
+ window.addEventListener(REFERRAL_SUCCESS_EVENT, handler);
305
+ return () => window.removeEventListener(REFERRAL_SUCCESS_EVENT, handler);
306
+ }, [isPreview, mode]);
307
+ const handleAction = useCallback(async () => {
308
+ if (isPreview) return;
309
+ if (mode === "referral") {
310
+ setDismissed(true);
311
+ return;
312
+ }
313
+ let mergeToken = prefetchedMergeToken;
314
+ if (!mergeToken && window.FrakSetup?.client) try {
315
+ mergeToken = await getMergeToken(window.FrakSetup?.client);
316
+ } catch {}
317
+ let targetUrl = window.location.href;
318
+ if (mergeToken) {
319
+ const url = new URL(targetUrl);
320
+ url.searchParams.set("fmt", mergeToken);
321
+ targetUrl = url.toString();
322
+ }
323
+ redirectToExternalBrowser(targetUrl);
324
+ }, [
325
+ isPreview,
326
+ mode,
327
+ prefetchedMergeToken
328
+ ]);
329
+ const handleDismiss = useCallback(() => {
330
+ if (isPreview) return;
331
+ setDismissed(true);
332
+ }, [isPreview]);
333
+ const bannerConfig = placement?.components?.banner;
334
+ const texts = useMemo(() => {
335
+ if (mode === "referral") {
336
+ const defaultTitle = reward ? `Earn ${reward} on purchases on this site` : "You've been referred!";
337
+ return {
338
+ title: propReferralTitle ?? bannerConfig?.referralTitle ?? defaultTitle,
339
+ description: propReferralDescription ?? bannerConfig?.referralDescription ?? "Earn rewards after your purchase via the Frak partner app.",
340
+ cta: propReferralCta ?? bannerConfig?.referralCta ?? "Got it"
341
+ };
342
+ }
343
+ return {
344
+ title: propInappTitle ?? bannerConfig?.inappTitle ?? "Open in your browser",
345
+ description: propInappDescription ?? bannerConfig?.inappDescription ?? "For a better experience and to earn your rewards, open this page in your default browser.",
346
+ cta: propInappCta ?? bannerConfig?.inappCta ?? "Open browser"
347
+ };
348
+ }, [
349
+ mode,
350
+ reward,
351
+ bannerConfig,
352
+ propReferralTitle,
353
+ propReferralDescription,
354
+ propReferralCta,
355
+ propInappTitle,
356
+ propInappDescription,
357
+ propInappCta
358
+ ]);
359
+ if (!mode || !isPreview && (!shouldRender || isHidden || dismissed)) return null;
360
+ const bannerClass = [
361
+ referral,
362
+ "frak-banner",
363
+ `frak-banner--${mode}`,
364
+ classname
365
+ ].filter(Boolean).join(" ");
366
+ if (mode === "inapp") return /* @__PURE__ */ jsx(InAppBanner, {
367
+ title: texts.title,
368
+ description: texts.description,
369
+ cta: texts.cta,
370
+ dismissLabel: "Dismiss",
371
+ onAction: handleAction,
372
+ onDismiss: handleDismiss,
373
+ className: [
374
+ "frak-banner",
375
+ "frak-banner--inapp",
376
+ classname
377
+ ].filter(Boolean).join(" "),
378
+ classNames: {
379
+ icon: "frak-banner__icon",
380
+ title: "frak-banner__title",
381
+ description: "frak-banner__description",
382
+ cta: "frak-banner__cta",
383
+ close: "frak-banner__close"
384
+ }
385
+ });
386
+ return /* @__PURE__ */ jsxs("div", {
387
+ class: bannerClass,
388
+ role: "alert",
389
+ children: [/* @__PURE__ */ jsx("div", {
390
+ class: `${referralIconWrapper} frak-banner__icon`,
391
+ children: /* @__PURE__ */ jsx(GiftIcon, { class: iconSvg })
392
+ }), /* @__PURE__ */ jsxs("div", {
393
+ class: `${referralBody} frak-banner__text`,
394
+ children: [
395
+ /* @__PURE__ */ jsx("p", {
396
+ class: `${referralTitle} frak-banner__title`,
397
+ children: texts.title
398
+ }),
399
+ /* @__PURE__ */ jsx("p", {
400
+ class: `${referralDescription} frak-banner__description`,
401
+ children: texts.description
402
+ }),
403
+ /* @__PURE__ */ jsx("button", {
404
+ type: "button",
405
+ class: `${referralCta} frak-banner__cta`,
406
+ onClick: handleAction,
407
+ children: texts.cta
408
+ })
409
+ ]
410
+ })]
411
+ });
412
+ }
413
+ //#endregion
414
+ //#region src/components/Banner/index.ts
415
+ registerWebComponent(Banner, "frak-banner", [
416
+ "placement",
417
+ "classname",
418
+ "interaction",
419
+ "referralTitle",
420
+ "referralDescription",
421
+ "referralCta",
422
+ "inappTitle",
423
+ "inappDescription",
424
+ "inappCta",
425
+ "preview",
426
+ "previewMode"
427
+ ], { shadow: false });
428
+ //#endregion
429
+ export { Banner };
@@ -1,5 +1,5 @@
1
1
  import { InteractionTypeKey } from "@frak-labs/core-sdk";
2
- import * as preact from "preact";
2
+ import * as _$preact from "preact";
3
3
 
4
4
  //#region src/components/ButtonShare/types.d.ts
5
5
  /**
@@ -7,6 +7,7 @@ import * as preact from "preact";
7
7
  * @inline
8
8
  */
9
9
  type ButtonShareProps = {
10
+ placement?: string;
10
11
  /**
11
12
  * Text to display on the button
12
13
  * - To specify where the reward should be displayed, use the placeholder `{REWARD}`, e.g. `Share and earn up to \{REWARD\}!`
@@ -31,10 +32,10 @@ type ButtonShareProps = {
31
32
  */
32
33
  targetInteraction?: InteractionTypeKey;
33
34
  /**
34
- * Do we display the wallet modal instead of the share modal?
35
- * @defaultValue `false`
35
+ * Which UI to open on click
36
+ * @defaultValue `"embedded-wallet"`
36
37
  */
37
- showWallet?: boolean;
38
+ clickAction?: "embedded-wallet" | "share-modal" | "sharing-page";
38
39
  };
39
40
  //#endregion
40
41
  //#region src/components/ButtonShare/ButtonShare.d.ts
@@ -80,13 +81,14 @@ type ButtonShareProps = {
80
81
  * @see {@link @frak-labs/core-sdk!actions.getMerchantInformation | `getMerchantInformation()`} for more info about the estimated reward fetching
81
82
  */
82
83
  declare function ButtonShare({
84
+ placement: placementId,
83
85
  text,
84
86
  classname,
85
87
  useReward: rawUseReward,
86
88
  noRewardText,
87
89
  targetInteraction,
88
- showWallet: rawShowWallet
89
- }: ButtonShareProps): preact.JSX.Element;
90
+ clickAction: rawClickAction
91
+ }: ButtonShareProps): _$preact.JSX.Element | null;
90
92
  //#endregion
91
93
  //#region src/components/ButtonShare/index.d.ts
92
94
  /**