@queuezero/react 0.1.3
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 +214 -0
- package/dist/index.d.mts +283 -0
- package/dist/index.d.ts +283 -0
- package/dist/index.js +438 -0
- package/dist/index.mjs +403 -0
- package/package.json +47 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
InMemoryStorageAdapter: () => import_queuezero3.InMemoryStorageAdapter,
|
|
24
|
+
LocalStorageAdapter: () => import_queuezero3.LocalStorageAdapter,
|
|
25
|
+
QueueZeroClient: () => import_queuezero3.QueueZeroClient,
|
|
26
|
+
ReferralShare: () => ReferralShare,
|
|
27
|
+
WaitlistForm: () => WaitlistForm,
|
|
28
|
+
WaitlistProvider: () => WaitlistProvider,
|
|
29
|
+
WaitlistStatus: () => WaitlistStatus,
|
|
30
|
+
useWaitlist: () => useWaitlist,
|
|
31
|
+
useWaitlistContext: () => useWaitlistContext
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(index_exports);
|
|
34
|
+
|
|
35
|
+
// src/context.tsx
|
|
36
|
+
var import_react = require("react");
|
|
37
|
+
var import_queuezero = require("queuezero");
|
|
38
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
39
|
+
var WaitlistContext = (0, import_react.createContext)(null);
|
|
40
|
+
function WaitlistProvider({ campaign, config, children }) {
|
|
41
|
+
const stateManager = (0, import_react.useMemo)(() => {
|
|
42
|
+
const client = new import_queuezero.QueueZeroClient(campaign, config);
|
|
43
|
+
return new import_queuezero.QueueZeroStateManager(client);
|
|
44
|
+
}, [campaign, config?.apiUrl, config?.baseUrl]);
|
|
45
|
+
const [state, setState] = (0, import_react.useState)(stateManager.getState());
|
|
46
|
+
(0, import_react.useEffect)(() => {
|
|
47
|
+
return stateManager.subscribe((newState) => {
|
|
48
|
+
setState(newState);
|
|
49
|
+
});
|
|
50
|
+
}, [stateManager]);
|
|
51
|
+
const [publicConfig, setPublicConfig] = (0, import_react.useState)(null);
|
|
52
|
+
const [configLoading, setConfigLoading] = (0, import_react.useState)(true);
|
|
53
|
+
(0, import_react.useEffect)(() => {
|
|
54
|
+
let mounted = true;
|
|
55
|
+
const fetchConfig = async () => {
|
|
56
|
+
try {
|
|
57
|
+
const cfg = await stateManager.fetchPublicConfig();
|
|
58
|
+
if (mounted) setPublicConfig(cfg);
|
|
59
|
+
} catch (e) {
|
|
60
|
+
console.error("Failed to fetch config", e);
|
|
61
|
+
} finally {
|
|
62
|
+
if (mounted) setConfigLoading(false);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
fetchConfig();
|
|
66
|
+
return () => {
|
|
67
|
+
mounted = false;
|
|
68
|
+
};
|
|
69
|
+
}, [stateManager]);
|
|
70
|
+
(0, import_react.useEffect)(() => {
|
|
71
|
+
if (stateManager.getState().isJoined) {
|
|
72
|
+
stateManager.refresh();
|
|
73
|
+
}
|
|
74
|
+
}, [stateManager]);
|
|
75
|
+
const value = (0, import_react.useMemo)(
|
|
76
|
+
() => ({
|
|
77
|
+
loading: state.loading,
|
|
78
|
+
status: state.status,
|
|
79
|
+
error: state.error,
|
|
80
|
+
isJoined: state.isJoined,
|
|
81
|
+
campaign,
|
|
82
|
+
join: stateManager.join.bind(stateManager),
|
|
83
|
+
refresh: stateManager.refresh.bind(stateManager),
|
|
84
|
+
getReferralLink: stateManager.getReferralLink.bind(stateManager),
|
|
85
|
+
getReferralCode: stateManager.getReferralCode.bind(stateManager),
|
|
86
|
+
reset: stateManager.reset.bind(stateManager),
|
|
87
|
+
config: publicConfig,
|
|
88
|
+
configLoading
|
|
89
|
+
}),
|
|
90
|
+
[state, campaign, stateManager, publicConfig, configLoading]
|
|
91
|
+
);
|
|
92
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(WaitlistContext.Provider, { value, children });
|
|
93
|
+
}
|
|
94
|
+
function useWaitlistContext() {
|
|
95
|
+
const context = (0, import_react.useContext)(WaitlistContext);
|
|
96
|
+
if (!context) {
|
|
97
|
+
throw new Error("useWaitlistContext must be used within a WaitlistProvider");
|
|
98
|
+
}
|
|
99
|
+
return context;
|
|
100
|
+
}
|
|
101
|
+
function useWaitlist(campaign, config) {
|
|
102
|
+
const client = (0, import_react.useMemo)(() => {
|
|
103
|
+
return new import_queuezero.QueueZeroClient(campaign, config);
|
|
104
|
+
}, [campaign, config?.apiUrl, config?.baseUrl]);
|
|
105
|
+
const [loading, setLoading] = (0, import_react.useState)(false);
|
|
106
|
+
const [status, setStatus] = (0, import_react.useState)(null);
|
|
107
|
+
const [error, setError] = (0, import_react.useState)(null);
|
|
108
|
+
const [isJoined, setIsJoined] = (0, import_react.useState)(false);
|
|
109
|
+
(0, import_react.useEffect)(() => {
|
|
110
|
+
const joined = client.isJoined();
|
|
111
|
+
setIsJoined(joined);
|
|
112
|
+
if (joined) {
|
|
113
|
+
refresh();
|
|
114
|
+
}
|
|
115
|
+
}, [client]);
|
|
116
|
+
const join = (0, import_react.useCallback)(
|
|
117
|
+
async (email, metadata, referrerCode) => {
|
|
118
|
+
setLoading(true);
|
|
119
|
+
setError(null);
|
|
120
|
+
try {
|
|
121
|
+
const response = await client.joinWaitlist(email, metadata, referrerCode);
|
|
122
|
+
const userStatus = await client.getPosition();
|
|
123
|
+
setStatus(userStatus);
|
|
124
|
+
setIsJoined(true);
|
|
125
|
+
return response;
|
|
126
|
+
} catch (err) {
|
|
127
|
+
setError(err instanceof Error ? err : new Error("Unknown error"));
|
|
128
|
+
return null;
|
|
129
|
+
} finally {
|
|
130
|
+
setLoading(false);
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
[client]
|
|
134
|
+
);
|
|
135
|
+
const refresh = (0, import_react.useCallback)(async () => {
|
|
136
|
+
if (!client.isJoined()) return null;
|
|
137
|
+
setLoading(true);
|
|
138
|
+
setError(null);
|
|
139
|
+
try {
|
|
140
|
+
const userStatus = await client.getPosition();
|
|
141
|
+
setStatus(userStatus);
|
|
142
|
+
return userStatus;
|
|
143
|
+
} catch (err) {
|
|
144
|
+
setError(err instanceof Error ? err : new Error("Unknown error"));
|
|
145
|
+
return null;
|
|
146
|
+
} finally {
|
|
147
|
+
setLoading(false);
|
|
148
|
+
}
|
|
149
|
+
}, [client]);
|
|
150
|
+
const getReferralLink = (0, import_react.useCallback)(() => client.getReferralLink(), [client]);
|
|
151
|
+
const getReferralCode = (0, import_react.useCallback)(() => client.getReferralCode(), [client]);
|
|
152
|
+
const reset = (0, import_react.useCallback)(() => {
|
|
153
|
+
client.reset();
|
|
154
|
+
setStatus(null);
|
|
155
|
+
setError(null);
|
|
156
|
+
setIsJoined(false);
|
|
157
|
+
}, [client]);
|
|
158
|
+
return { loading, status, error, isJoined, campaign, join, refresh, getReferralLink, getReferralCode, reset };
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// src/WaitlistForm.tsx
|
|
162
|
+
var import_react2 = require("react");
|
|
163
|
+
var import_queuezero2 = require("queuezero");
|
|
164
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
165
|
+
function WaitlistForm({
|
|
166
|
+
onSuccess,
|
|
167
|
+
onError,
|
|
168
|
+
referrerCode,
|
|
169
|
+
metadata,
|
|
170
|
+
className = "",
|
|
171
|
+
placeholder = "Enter your email",
|
|
172
|
+
buttonText = "Join Waitlist",
|
|
173
|
+
loadingText = "Joining...",
|
|
174
|
+
showLabel = false,
|
|
175
|
+
labelText = "Email",
|
|
176
|
+
children
|
|
177
|
+
}) {
|
|
178
|
+
const { join, loading, error, isJoined, config, configLoading } = useWaitlistContext();
|
|
179
|
+
const [email, setEmail] = (0, import_react2.useState)("");
|
|
180
|
+
const [formData, setFormData] = (0, import_react2.useState)({});
|
|
181
|
+
const [localError, setLocalError] = (0, import_react2.useState)(null);
|
|
182
|
+
const controller = (0, import_react2.useMemo)(
|
|
183
|
+
() => new import_queuezero2.FormController(join, config?.formFields || [], referrerCode),
|
|
184
|
+
[join, config, referrerCode]
|
|
185
|
+
);
|
|
186
|
+
const handleSubmit = (0, import_react2.useCallback)(
|
|
187
|
+
async (e) => {
|
|
188
|
+
e?.preventDefault();
|
|
189
|
+
setLocalError(null);
|
|
190
|
+
try {
|
|
191
|
+
const result = await controller.submit(email, formData, metadata);
|
|
192
|
+
if (result) {
|
|
193
|
+
setEmail("");
|
|
194
|
+
setFormData({});
|
|
195
|
+
onSuccess?.(result);
|
|
196
|
+
} else if (error) {
|
|
197
|
+
onError?.(error);
|
|
198
|
+
}
|
|
199
|
+
} catch (err) {
|
|
200
|
+
const error2 = err instanceof Error ? err : new Error("Failed to join");
|
|
201
|
+
setLocalError(error2);
|
|
202
|
+
onError?.(error2);
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
[email, formData, controller, metadata, onSuccess, onError, error]
|
|
206
|
+
);
|
|
207
|
+
const displayError = localError || error;
|
|
208
|
+
if (isJoined) {
|
|
209
|
+
return null;
|
|
210
|
+
}
|
|
211
|
+
if (typeof children === "function") {
|
|
212
|
+
return children({
|
|
213
|
+
email,
|
|
214
|
+
setEmail,
|
|
215
|
+
submit: handleSubmit,
|
|
216
|
+
loading,
|
|
217
|
+
error: displayError
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("form", { onSubmit: handleSubmit, className: `qz-form ${className}`.trim(), children: [
|
|
221
|
+
showLabel && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { htmlFor: "qz-email", className: "qz-form-label", children: labelText }),
|
|
222
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "qz-form-row", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
223
|
+
"input",
|
|
224
|
+
{
|
|
225
|
+
id: "qz-email",
|
|
226
|
+
type: "email",
|
|
227
|
+
value: email,
|
|
228
|
+
onChange: (e) => setEmail(e.target.value),
|
|
229
|
+
placeholder,
|
|
230
|
+
disabled: loading,
|
|
231
|
+
required: true,
|
|
232
|
+
className: "qz-form-input",
|
|
233
|
+
"aria-label": !showLabel ? labelText : void 0
|
|
234
|
+
}
|
|
235
|
+
) }),
|
|
236
|
+
!configLoading && config?.formFields?.map((field) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "qz-form-row", children: [
|
|
237
|
+
showLabel && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { className: "qz-form-label", children: field.label }),
|
|
238
|
+
field.type === "select" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
239
|
+
"select",
|
|
240
|
+
{
|
|
241
|
+
value: formData[field.key] || "",
|
|
242
|
+
onChange: (e) => setFormData((prev) => ({ ...prev, [field.key]: e.target.value })),
|
|
243
|
+
disabled: loading,
|
|
244
|
+
required: field.required,
|
|
245
|
+
className: "qz-form-select",
|
|
246
|
+
children: [
|
|
247
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "", children: field.placeholder || `Select ${field.label}` }),
|
|
248
|
+
field.options?.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: opt, children: opt }, opt))
|
|
249
|
+
]
|
|
250
|
+
}
|
|
251
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
252
|
+
"input",
|
|
253
|
+
{
|
|
254
|
+
type: field.type === "number" ? "number" : "text",
|
|
255
|
+
value: formData[field.key] || "",
|
|
256
|
+
onChange: (e) => setFormData((prev) => ({ ...prev, [field.key]: e.target.value })),
|
|
257
|
+
placeholder: field.placeholder || field.label,
|
|
258
|
+
disabled: loading,
|
|
259
|
+
required: field.required,
|
|
260
|
+
className: "qz-form-input"
|
|
261
|
+
}
|
|
262
|
+
)
|
|
263
|
+
] }, field.key)),
|
|
264
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "qz-form-row", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "submit", disabled: loading, className: "qz-form-button", children: loading ? loadingText : buttonText }) }),
|
|
265
|
+
displayError && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "qz-form-error", role: "alert", children: displayError.message }),
|
|
266
|
+
children
|
|
267
|
+
] });
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// src/WaitlistStatus.tsx
|
|
271
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
272
|
+
function WaitlistStatus({
|
|
273
|
+
className = "",
|
|
274
|
+
showReferrals = true,
|
|
275
|
+
showScore = true,
|
|
276
|
+
positionLabel = "Position",
|
|
277
|
+
scoreLabel = "Score",
|
|
278
|
+
referralsLabel = "Referrals",
|
|
279
|
+
children
|
|
280
|
+
}) {
|
|
281
|
+
const { status, loading, isJoined } = useWaitlistContext();
|
|
282
|
+
if (!isJoined || !status) {
|
|
283
|
+
return null;
|
|
284
|
+
}
|
|
285
|
+
if (loading && !status) {
|
|
286
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: `qz-status qz-status-loading ${className}`.trim(), children: "Loading..." });
|
|
287
|
+
}
|
|
288
|
+
if (typeof children === "function") {
|
|
289
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children: children(status) });
|
|
290
|
+
}
|
|
291
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: `qz-status ${className}`.trim(), children: [
|
|
292
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "qz-status-item qz-status-position", children: [
|
|
293
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "qz-status-label", children: positionLabel }),
|
|
294
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "qz-status-value", children: [
|
|
295
|
+
"#",
|
|
296
|
+
status.position.toLocaleString()
|
|
297
|
+
] })
|
|
298
|
+
] }),
|
|
299
|
+
showScore && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "qz-status-item qz-status-score", children: [
|
|
300
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "qz-status-label", children: scoreLabel }),
|
|
301
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "qz-status-value", children: status.priorityScore.toLocaleString() })
|
|
302
|
+
] }),
|
|
303
|
+
showReferrals && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "qz-status-item qz-status-referrals", children: [
|
|
304
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "qz-status-label", children: referralsLabel }),
|
|
305
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "qz-status-value", children: status.referralCount.toLocaleString() })
|
|
306
|
+
] })
|
|
307
|
+
] });
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// src/ReferralShare.tsx
|
|
311
|
+
var import_react3 = require("react");
|
|
312
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
313
|
+
function ReferralShare({
|
|
314
|
+
className = "",
|
|
315
|
+
label = "Share your referral link:",
|
|
316
|
+
copyButtonText = "Copy",
|
|
317
|
+
copiedText = "Copied!",
|
|
318
|
+
onCopy,
|
|
319
|
+
shareMessage = "Join me on the waitlist!",
|
|
320
|
+
showSocialButtons,
|
|
321
|
+
children
|
|
322
|
+
}) {
|
|
323
|
+
const { getReferralLink, getReferralCode, isJoined, config } = useWaitlistContext();
|
|
324
|
+
const [copied, setCopied] = (0, import_react3.useState)(false);
|
|
325
|
+
const referralEnabled = config?.features?.referral_enabled ?? true;
|
|
326
|
+
const showSocial = showSocialButtons ?? config?.features?.social_share_buttons ?? false;
|
|
327
|
+
if (!referralEnabled) return null;
|
|
328
|
+
const link = getReferralLink();
|
|
329
|
+
const code = getReferralCode();
|
|
330
|
+
const handleCopy = (0, import_react3.useCallback)(async () => {
|
|
331
|
+
if (!link) return;
|
|
332
|
+
try {
|
|
333
|
+
await navigator.clipboard.writeText(link);
|
|
334
|
+
setCopied(true);
|
|
335
|
+
onCopy?.(link);
|
|
336
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
337
|
+
} catch (err) {
|
|
338
|
+
const textarea = document.createElement("textarea");
|
|
339
|
+
textarea.value = link;
|
|
340
|
+
textarea.style.position = "fixed";
|
|
341
|
+
textarea.style.opacity = "0";
|
|
342
|
+
document.body.appendChild(textarea);
|
|
343
|
+
textarea.select();
|
|
344
|
+
document.execCommand("copy");
|
|
345
|
+
document.body.removeChild(textarea);
|
|
346
|
+
setCopied(true);
|
|
347
|
+
onCopy?.(link);
|
|
348
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
349
|
+
}
|
|
350
|
+
}, [link, onCopy]);
|
|
351
|
+
const handleTwitterShare = (0, import_react3.useCallback)(() => {
|
|
352
|
+
if (!link) return;
|
|
353
|
+
const text = encodeURIComponent(`${shareMessage} ${link}`);
|
|
354
|
+
window.open(`https://twitter.com/intent/tweet?text=${text}`, "_blank", "noopener,noreferrer");
|
|
355
|
+
}, [link, shareMessage]);
|
|
356
|
+
const handleLinkedInShare = (0, import_react3.useCallback)(() => {
|
|
357
|
+
if (!link) return;
|
|
358
|
+
const url = encodeURIComponent(link);
|
|
359
|
+
window.open(`https://www.linkedin.com/sharing/share-offsite/?url=${url}`, "_blank", "noopener,noreferrer");
|
|
360
|
+
}, [link]);
|
|
361
|
+
const handleEmailShare = (0, import_react3.useCallback)(() => {
|
|
362
|
+
if (!link) return;
|
|
363
|
+
const subject = encodeURIComponent("Join me on the waitlist!");
|
|
364
|
+
const body = encodeURIComponent(`${shareMessage}
|
|
365
|
+
|
|
366
|
+
${link}`);
|
|
367
|
+
window.location.href = `mailto:?subject=${subject}&body=${body}`;
|
|
368
|
+
}, [link, shareMessage]);
|
|
369
|
+
if (!isJoined || !link || !code) {
|
|
370
|
+
return null;
|
|
371
|
+
}
|
|
372
|
+
if (typeof children === "function") {
|
|
373
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: children({ link, code, copy: handleCopy, copied }) });
|
|
374
|
+
}
|
|
375
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: `qz-share ${className}`.trim(), children: [
|
|
376
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "qz-share-label", children: label }),
|
|
377
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "qz-share-link-container", children: [
|
|
378
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
379
|
+
"input",
|
|
380
|
+
{
|
|
381
|
+
type: "text",
|
|
382
|
+
value: link,
|
|
383
|
+
readOnly: true,
|
|
384
|
+
className: "qz-share-input",
|
|
385
|
+
onClick: (e) => e.target.select()
|
|
386
|
+
}
|
|
387
|
+
),
|
|
388
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { onClick: handleCopy, className: "qz-share-copy-button", children: copied ? copiedText : copyButtonText })
|
|
389
|
+
] }),
|
|
390
|
+
showSocial && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "qz-share-social", children: [
|
|
391
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
392
|
+
"button",
|
|
393
|
+
{
|
|
394
|
+
onClick: handleTwitterShare,
|
|
395
|
+
className: "qz-share-social-button qz-share-twitter",
|
|
396
|
+
"aria-label": "Share on Twitter",
|
|
397
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("svg", { viewBox: "0 0 24 24", width: "20", height: "20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" }) })
|
|
398
|
+
}
|
|
399
|
+
),
|
|
400
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
401
|
+
"button",
|
|
402
|
+
{
|
|
403
|
+
onClick: handleLinkedInShare,
|
|
404
|
+
className: "qz-share-social-button qz-share-linkedin",
|
|
405
|
+
"aria-label": "Share on LinkedIn",
|
|
406
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("svg", { viewBox: "0 0 24 24", width: "20", height: "20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z" }) })
|
|
407
|
+
}
|
|
408
|
+
),
|
|
409
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
410
|
+
"button",
|
|
411
|
+
{
|
|
412
|
+
onClick: handleEmailShare,
|
|
413
|
+
className: "qz-share-social-button qz-share-email",
|
|
414
|
+
"aria-label": "Share via Email",
|
|
415
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("svg", { viewBox: "0 0 24 24", width: "20", height: "20", fill: "currentColor", children: [
|
|
416
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M1.5 8.67v8.58a3 3 0 003 3h15a3 3 0 003-3V8.67l-8.928 5.493a3 3 0 01-3.144 0L1.5 8.67z" }),
|
|
417
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M22.5 6.908V6.75a3 3 0 00-3-3h-15a3 3 0 00-3 3v.158l9.714 5.978a1.5 1.5 0 001.572 0L22.5 6.908z" })
|
|
418
|
+
] })
|
|
419
|
+
}
|
|
420
|
+
)
|
|
421
|
+
] })
|
|
422
|
+
] });
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
// src/index.ts
|
|
426
|
+
var import_queuezero3 = require("queuezero");
|
|
427
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
428
|
+
0 && (module.exports = {
|
|
429
|
+
InMemoryStorageAdapter,
|
|
430
|
+
LocalStorageAdapter,
|
|
431
|
+
QueueZeroClient,
|
|
432
|
+
ReferralShare,
|
|
433
|
+
WaitlistForm,
|
|
434
|
+
WaitlistProvider,
|
|
435
|
+
WaitlistStatus,
|
|
436
|
+
useWaitlist,
|
|
437
|
+
useWaitlistContext
|
|
438
|
+
});
|