@c1m-public/dash-site-kit 0.12.0 → 0.13.1
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/dist/models/legal.js
CHANGED
|
@@ -2,6 +2,11 @@ import { FIRST_TOUCH_COOKIE, FIRST_TOUCH_MAX_AGE_SECONDS } from "./attribution.j
|
|
|
2
2
|
function operatorOf(facts) {
|
|
3
3
|
return facts.operator?.trim() || facts.siteName;
|
|
4
4
|
}
|
|
5
|
+
/** "SimpleVan" or "SimpleVan, run by SimpleVan Ltd," when the operator differs. */
|
|
6
|
+
function runBy(facts) {
|
|
7
|
+
const operator = operatorOf(facts);
|
|
8
|
+
return operator === facts.siteName ? facts.siteName : `${facts.siteName}, run by ${operator},`;
|
|
9
|
+
}
|
|
5
10
|
function contactLine(facts) {
|
|
6
11
|
return facts.contactHref ? `through our contact page (${facts.contactHref})` : "using the contact details on this site";
|
|
7
12
|
}
|
|
@@ -12,7 +17,6 @@ const firstTouchDays = Math.round(FIRST_TOUCH_MAX_AGE_SECONDS / 86_400);
|
|
|
12
17
|
* details before relying on it.
|
|
13
18
|
*/
|
|
14
19
|
export function privacyNotice(facts) {
|
|
15
|
-
const operator = operatorOf(facts);
|
|
16
20
|
const collected = [
|
|
17
21
|
"Requests you send us: your name, email address, phone number and the details you enter about the job.",
|
|
18
22
|
"An email address when you ask for a link to your existing requests.",
|
|
@@ -23,9 +27,9 @@ export function privacyNotice(facts) {
|
|
|
23
27
|
return {
|
|
24
28
|
title: "Privacy notice",
|
|
25
29
|
updated: facts.updated,
|
|
26
|
-
summary: `How ${
|
|
30
|
+
summary: `How ${facts.siteName} collects and uses your personal information.`,
|
|
27
31
|
sections: [
|
|
28
|
-
{ heading: "Who we are", paragraphs: [`${facts
|
|
32
|
+
{ heading: "Who we are", paragraphs: [`${runBy(facts)} is responsible for the personal information described here. The site runs on the SaaSDash platform, which stores and processes that information on our behalf.`] },
|
|
29
33
|
{ heading: "What we collect", bullets: collected },
|
|
30
34
|
{
|
|
31
35
|
heading: "How we use it",
|
|
@@ -63,13 +67,12 @@ export function cookieNotice(facts) {
|
|
|
63
67
|
}
|
|
64
68
|
/** Terms of use for a Dash site. */
|
|
65
69
|
export function termsOfUse(facts) {
|
|
66
|
-
const operator = operatorOf(facts);
|
|
67
70
|
return {
|
|
68
71
|
title: "Terms of use",
|
|
69
72
|
updated: facts.updated,
|
|
70
73
|
summary: `The terms for using ${facts.siteName}.`,
|
|
71
74
|
sections: [
|
|
72
|
-
{ heading: "About these terms", paragraphs: [`These terms apply when you use ${facts.
|
|
75
|
+
{ heading: "About these terms", paragraphs: [`These terms apply when you use ${runBy(facts).replace(/,$/, "")}. By using the site you accept them.`] },
|
|
73
76
|
...(facts.sharesWithProviders ? [{ heading: "Providers", paragraphs: ["Providers listed on the site are independent businesses. Any job you agree with a provider is a contract between you and that provider, who is responsible for the service, its price and its insurance. We help you find and contact providers but do not carry out the work."] }] : []),
|
|
74
77
|
{ heading: "Using the site", bullets: ["Give accurate information when you send a request.", "Do not misuse the site, interfere with it or try to access it without permission.", "Do not submit other people's details without their agreement."] },
|
|
75
78
|
{ heading: "Information on the site", paragraphs: ["We keep the site accurate but cannot guarantee every listing, price or guide is complete or current."] },
|
|
@@ -13,9 +13,11 @@ export declare function DashLandingPage({ siteName, content, cta }: {
|
|
|
13
13
|
cta: ReactNode;
|
|
14
14
|
}): import("react").JSX.Element;
|
|
15
15
|
/** The landing page with the waitlist form as its call to action. */
|
|
16
|
-
export declare function DashWaitlistLanding({ siteName, content, form, submit, }: {
|
|
16
|
+
export declare function DashWaitlistLanding({ siteName, content, form, privacyHref, submit, }: {
|
|
17
17
|
siteName: string;
|
|
18
18
|
content: LandingContent;
|
|
19
19
|
form: DashWaitlistFormSettings;
|
|
20
|
+
/** The site's privacy notice, linked from the form. */
|
|
21
|
+
privacyHref?: string;
|
|
20
22
|
submit: (input: DashWaitlistSubmission) => Promise<DashWaitlistReceipt>;
|
|
21
23
|
}): import("react").JSX.Element;
|
package/dist/ui/landing-page.js
CHANGED
|
@@ -13,6 +13,6 @@ export function DashLandingPage({ siteName, content, cta }) {
|
|
|
13
13
|
return (_jsxs("main", { children: [_jsx("section", { className: "border-b border-border bg-subtle", children: _jsxs(Container, { className: "grid items-center gap-12 py-14 lg:grid-cols-[minmax(0,1fr)_minmax(20rem,26rem)] lg:py-24", children: [_jsxs("div", { className: "max-w-2xl", children: [_jsx(Eyebrow, { children: content.eyebrow ?? siteName }), _jsx("h1", { className: "mt-5 text-balance text-4xl font-semibold tracking-[-0.05em] text-ink sm:text-6xl", children: content.headline }), _jsx("p", { className: "mt-6 text-pretty text-lg leading-8 text-muted", children: content.subheadline }), content.highlights?.length ? (_jsx("ul", { className: "mt-8 space-y-3", children: content.highlights.map((point) => (_jsxs("li", { className: "flex gap-3 text-base text-ink", children: [_jsx("span", { "aria-hidden": "true", className: "mt-1 inline-flex size-5 shrink-0 items-center justify-center rounded-full bg-accent text-xs font-bold text-accent-foreground", children: "\u2713" }), _jsx("span", { children: point })] }, point))) })) : null] }), _jsxs("div", { id: CTA_ID, className: "scroll-mt-24 rounded-3xl border border-border bg-white p-6 shadow-sm sm:p-8", children: [_jsx("h2", { className: "text-xl font-semibold text-ink", children: content.cta.title }), _jsx("div", { className: "mt-5", children: cta }), content.cta.note ? _jsx("p", { className: "mt-4 text-xs leading-5 text-muted", children: content.cta.note }) : null] })] }) }), steps ? (_jsx("section", { className: "border-b border-border py-16 sm:py-20", children: _jsxs(Container, { children: [_jsx(SectionHeading, { eyebrow: steps.eyebrow, title: steps.title, description: steps.description }), _jsx("ol", { className: "mt-10 grid gap-6 sm:grid-cols-2 lg:grid-cols-4", children: steps.items.map((step, index) => (_jsxs("li", { className: "rounded-2xl border border-border p-6", children: [_jsxs("span", { className: "text-sm font-semibold text-accent-text", children: ["Step ", index + 1] }), _jsx("h3", { className: "mt-2 text-lg font-semibold text-ink", children: step.title }), _jsx("p", { className: "mt-2 text-sm leading-6 text-muted", children: step.description })] }, step.title))) })] }) })) : null, benefits ? (_jsx("section", { className: "border-b border-border bg-subtle py-16 sm:py-20", children: _jsxs(Container, { children: [_jsx(SectionHeading, { eyebrow: benefits.eyebrow, title: benefits.title, description: benefits.description }), _jsx("div", { className: "mt-10 grid gap-6 sm:grid-cols-2 lg:grid-cols-3", children: benefits.items.map((benefit) => (_jsxs("div", { className: "rounded-2xl border border-border bg-white p-6", children: [_jsx("h3", { className: "text-lg font-semibold text-ink", children: benefit.title }), _jsx("p", { className: "mt-2 text-sm leading-6 text-muted", children: benefit.description })] }, benefit.title))) })] }) })) : null, audiences ? (_jsx("section", { className: "border-b border-border py-16 sm:py-20", children: _jsxs(Container, { children: [_jsx(SectionHeading, { eyebrow: audiences.eyebrow, title: audiences.title, description: audiences.description }), _jsx("div", { className: "mt-10 grid gap-6 lg:grid-cols-2", children: audiences.items.map((audience) => (_jsxs("div", { className: "rounded-3xl border border-border p-8", children: [audience.eyebrow ? _jsx(Eyebrow, { children: audience.eyebrow }) : null, _jsx("h3", { className: "mt-3 text-2xl font-semibold tracking-tight text-ink", children: audience.title }), _jsx("p", { className: "mt-3 text-base leading-7 text-muted", children: audience.description }), audience.points?.length ? (_jsx("ul", { className: "mt-5 space-y-2 text-sm text-ink", children: audience.points.map((point) => _jsxs("li", { children: ["\u2022 ", point] }, point)) })) : null] }, audience.title))) })] }) })) : null, faqs ? (_jsx("section", { className: "border-b border-border py-16 sm:py-20", children: _jsxs(Container, { className: "max-w-3xl", children: [_jsx(SectionHeading, { eyebrow: faqs.eyebrow, title: faqs.title, description: faqs.description }), _jsx("div", { className: "mt-8 divide-y divide-border border-y border-border", children: faqs.items.map((faq) => (_jsxs("details", { className: "group py-5", children: [_jsx("summary", { className: "cursor-pointer list-none text-base font-semibold text-ink", children: faq.question }), _jsx("p", { className: "mt-3 text-sm leading-6 text-muted", children: faq.answer })] }, faq.question))) })] }) })) : null, closing ? (_jsx("section", { className: "py-16 sm:py-24", children: _jsxs(Container, { className: "max-w-3xl text-center", children: [_jsx("h2", { className: "text-balance text-3xl font-semibold tracking-[-0.035em] text-ink sm:text-4xl", children: closing.headline }), closing.description ? _jsx("p", { className: "mt-4 text-lg leading-8 text-muted", children: closing.description }) : null, _jsx("div", { className: "mt-8", children: _jsx(ButtonLink, { href: `#${CTA_ID}`, children: closing.action }) })] }) })) : null] }));
|
|
14
14
|
}
|
|
15
15
|
/** The landing page with the waitlist form as its call to action. */
|
|
16
|
-
export function DashWaitlistLanding({ siteName, content, form, submit, }) {
|
|
17
|
-
return (_jsx(DashLandingPage, { siteName: siteName, content: content, cta: _jsx(DashWaitlistForm, { acceptingEntries: form.acceptingEntries, collectMarketingConsent: form.collectMarketingConsent, placement: "page", submit: submit }) }));
|
|
16
|
+
export function DashWaitlistLanding({ siteName, content, form, privacyHref, submit, }) {
|
|
17
|
+
return (_jsx(DashLandingPage, { siteName: siteName, content: content, cta: _jsx(DashWaitlistForm, { acceptingEntries: form.acceptingEntries, collectMarketingConsent: form.collectMarketingConsent, placement: "page", privacyHref: privacyHref, submit: submit }) }));
|
|
18
18
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { DashWaitlistReceipt, DashWaitlistSubmission } from "../models/waitlist.js";
|
|
2
|
-
export declare function DashWaitlistForm({ acceptingEntries, collectMarketingConsent, placement, submit, }: {
|
|
2
|
+
export declare function DashWaitlistForm({ acceptingEntries, collectMarketingConsent, placement, privacyHref, submit, }: {
|
|
3
3
|
acceptingEntries: boolean;
|
|
4
4
|
collectMarketingConsent: boolean;
|
|
5
5
|
/** Recorded as the signup's source. */
|
|
6
6
|
placement?: "page" | "block";
|
|
7
|
+
/** The site's privacy notice, linked beside the submit button. */
|
|
8
|
+
privacyHref?: string;
|
|
7
9
|
submit: (input: DashWaitlistSubmission) => Promise<DashWaitlistReceipt>;
|
|
8
10
|
}): import("react").JSX.Element;
|
package/dist/ui/waitlist-form.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useEffect, useId, useState } from "react";
|
|
4
|
-
export function DashWaitlistForm({ acceptingEntries, collectMarketingConsent, placement = "page", submit, }) {
|
|
4
|
+
export function DashWaitlistForm({ acceptingEntries, collectMarketingConsent, placement = "page", privacyHref, submit, }) {
|
|
5
5
|
const id = useId();
|
|
6
6
|
const [ready, setReady] = useState(false);
|
|
7
7
|
const [pending, setPending] = useState(false);
|
|
@@ -37,5 +37,5 @@ export function DashWaitlistForm({ acceptingEntries, collectMarketingConsent, pl
|
|
|
37
37
|
return _jsx("p", { role: "status", children: "Thanks. Check your inbox to confirm your place." });
|
|
38
38
|
if (!acceptingEntries)
|
|
39
39
|
return _jsx("p", { role: "status", children: "The waitlist is currently closed." });
|
|
40
|
-
return (_jsxs("form", { className: "space-y-4", onSubmit: onSubmit, children: [_jsxs("label", { className: "block space-y-1.5", htmlFor: `${id}-name`, children: [_jsx("span", { className: "text-sm font-medium text-ink", children: "Name (optional)" }), _jsx("input", { className: "min-h-11 w-full rounded-xl border border-border bg-white px-3 py-2 text-ink", disabled: !ready || pending, id: `${id}-name`, maxLength: 255, name: "name", autoComplete: "name" })] }), _jsxs("label", { className: "block space-y-1.5", htmlFor: `${id}-email`, children: [_jsx("span", { className: "text-sm font-medium text-ink", children: "Email" }), _jsx("input", { className: "min-h-11 w-full rounded-xl border border-border bg-white px-3 py-2 text-ink", disabled: !ready || pending, id: `${id}-email`, maxLength: 254, name: "email", type: "email", autoComplete: "email", required: true })] }), collectMarketingConsent ? (_jsxs("label", { className: "flex items-start gap-2 text-sm leading-6 text-muted", children: [_jsx("input", { className: "mt-1", disabled: !ready || pending, name: "marketing_opt_in", type: "checkbox" }), _jsx("span", { children: "I would also like to receive marketing emails. I can unsubscribe later." })] })) : null, error ? _jsx("p", { className: "text-sm text-red-700", role: "alert", children: error }) : null, _jsx("button", { className: "min-h-11 rounded-full bg-accent px-5 py-2.5 text-sm font-semibold text-accent-foreground disabled:opacity-60", disabled: !ready || pending, type: "submit", children: pending ? "Joining…" : "Join the waitlist" })] }));
|
|
40
|
+
return (_jsxs("form", { className: "space-y-4", onSubmit: onSubmit, children: [_jsxs("label", { className: "block space-y-1.5", htmlFor: `${id}-name`, children: [_jsx("span", { className: "text-sm font-medium text-ink", children: "Name (optional)" }), _jsx("input", { className: "min-h-11 w-full rounded-xl border border-border bg-white px-3 py-2 text-ink", disabled: !ready || pending, id: `${id}-name`, maxLength: 255, name: "name", autoComplete: "name" })] }), _jsxs("label", { className: "block space-y-1.5", htmlFor: `${id}-email`, children: [_jsx("span", { className: "text-sm font-medium text-ink", children: "Email" }), _jsx("input", { className: "min-h-11 w-full rounded-xl border border-border bg-white px-3 py-2 text-ink", disabled: !ready || pending, id: `${id}-email`, maxLength: 254, name: "email", type: "email", autoComplete: "email", required: true })] }), collectMarketingConsent ? (_jsxs("label", { className: "flex items-start gap-2 text-sm leading-6 text-muted", children: [_jsx("input", { className: "mt-1", disabled: !ready || pending, name: "marketing_opt_in", type: "checkbox" }), _jsx("span", { children: "I would also like to receive marketing emails. I can unsubscribe later." })] })) : null, error ? _jsx("p", { className: "text-sm text-red-700", role: "alert", children: error }) : null, _jsx("button", { className: "min-h-11 rounded-full bg-accent px-5 py-2.5 text-sm font-semibold text-accent-foreground disabled:opacity-60", disabled: !ready || pending, type: "submit", children: pending ? "Joining…" : "Join the waitlist" }), privacyHref ? (_jsxs("p", { className: "text-xs leading-5 text-muted", children: ["We use your details to manage your place on the waitlist, as described in our", " ", _jsx("a", { className: "underline underline-offset-2 hover:text-ink", href: privacyHref, children: "privacy notice" }), "."] })) : null] }));
|
|
41
41
|
}
|
|
@@ -3,11 +3,13 @@ import type { DashWaitlistForm as DashWaitlistFormSettings, DashWaitlistReceipt,
|
|
|
3
3
|
* The gate's page: a centred signup with the site's own name. Server
|
|
4
4
|
* component; `submit` is the site's Server Action.
|
|
5
5
|
*/
|
|
6
|
-
export declare function DashWaitlistPage({ siteName, headline, description, form, submit, }: {
|
|
6
|
+
export declare function DashWaitlistPage({ siteName, headline, description, form, privacyHref, submit, }: {
|
|
7
7
|
siteName: string;
|
|
8
8
|
headline?: string;
|
|
9
9
|
description?: string;
|
|
10
10
|
form: DashWaitlistFormSettings;
|
|
11
|
+
/** The site's privacy notice, linked from the form. */
|
|
12
|
+
privacyHref?: string;
|
|
11
13
|
submit: (input: DashWaitlistSubmission) => Promise<DashWaitlistReceipt>;
|
|
12
14
|
}): import("react").JSX.Element;
|
|
13
15
|
/**
|
package/dist/ui/waitlist-page.js
CHANGED
|
@@ -5,8 +5,8 @@ import { DashWaitlistForm } from "./waitlist-form.js";
|
|
|
5
5
|
* The gate's page: a centred signup with the site's own name. Server
|
|
6
6
|
* component; `submit` is the site's Server Action.
|
|
7
7
|
*/
|
|
8
|
-
export function DashWaitlistPage({ siteName, headline = "Join the waitlist", description = "We are getting ready. Leave your email and we will let you know when we open.", form, submit, }) {
|
|
9
|
-
return (_jsx("main", { className: "flex min-h-screen items-center py-16", children: _jsxs(Container, { className: "max-w-md space-y-6", children: [_jsx(Eyebrow, { children: siteName }), _jsx("h1", { className: "text-3xl font-semibold tracking-tight text-ink", children: headline }), _jsx("p", { className: "text-base leading-7 text-muted", children: description }), _jsx(DashWaitlistForm, { acceptingEntries: form.acceptingEntries, collectMarketingConsent: form.collectMarketingConsent, placement: "page", submit: submit })] }) }));
|
|
8
|
+
export function DashWaitlistPage({ siteName, headline = "Join the waitlist", description = "We are getting ready. Leave your email and we will let you know when we open.", form, privacyHref, submit, }) {
|
|
9
|
+
return (_jsx("main", { className: "flex min-h-screen items-center py-16", children: _jsxs(Container, { className: "max-w-md space-y-6", children: [_jsx(Eyebrow, { children: siteName }), _jsx("h1", { className: "text-3xl font-semibold tracking-tight text-ink", children: headline }), _jsx("p", { className: "text-base leading-7 text-muted", children: description }), _jsx(DashWaitlistForm, { acceptingEntries: form.acceptingEntries, collectMarketingConsent: form.collectMarketingConsent, placement: "page", privacyHref: privacyHref, submit: submit })] }) }));
|
|
10
10
|
}
|
|
11
11
|
const LINK_COPY = {
|
|
12
12
|
verify: {
|