@drawbridge/components 0.1.46 → 0.1.48
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/bridge/cart-drawer.js +152 -0
- package/dist/bridge/cart-drawer.mjs +123 -0
- package/dist/bridge/fields.js +278 -0
- package/dist/bridge/fields.mjs +276 -1
- package/dist/bridge/form-subdomain-checkout.js +687 -0
- package/dist/bridge/form-subdomain-checkout.mjs +665 -0
- package/dist/bridge/form-subdomain-shop-modal.js +234 -274
- package/dist/bridge/form-subdomain-shop-modal.mjs +233 -275
- package/dist/bridge/form-subdomain-shop.js +4 -1
- package/dist/bridge/form-subdomain-shop.mjs +4 -1
- package/dist/bridge/form-subdomain.js +24 -5
- package/dist/bridge/form-subdomain.mjs +25 -6
- package/dist/bridge/lib/age-gate.js +12 -0
- package/dist/bridge/lib/age-gate.mjs +11 -0
- package/dist/bridge/lib/cart.js +79 -0
- package/dist/bridge/lib/cart.mjs +48 -0
- package/dist/bridge/lib/checkout-kit.js +2 -32
- package/dist/bridge/lib/checkout-kit.mjs +2 -32
- package/dist/bridge/lib/entry.js +41 -0
- package/dist/bridge/lib/entry.mjs +40 -0
- package/dist/bridge/product-tile.js +13 -6
- package/dist/bridge/product-tile.mjs +13 -6
- package/dist/bridge/template-layout.js +263 -129
- package/dist/bridge/template-layout.mjs +264 -130
- package/dist/bridge/template-modal.js +39 -74
- package/dist/bridge/template-modal.mjs +40 -75
- package/dist/dashboard/avatar.js +2 -3
- package/dist/dashboard/avatar.mjs +2 -3
- package/dist/dashboard/buttons-subscription.js +1 -1
- package/dist/dashboard/buttons-subscription.mjs +1 -1
- package/dist/dashboard/campaign-form.js +179 -155
- package/dist/dashboard/campaign-form.mjs +179 -155
- package/dist/dashboard/campaign-share.js +347 -0
- package/dist/dashboard/campaign-share.mjs +314 -0
- package/dist/dashboard/card-affiliate.js +1 -1
- package/dist/dashboard/card-affiliate.mjs +1 -1
- package/dist/dashboard/card-campaign-switch.js +4 -1
- package/dist/dashboard/card-campaign-switch.mjs +4 -1
- package/dist/dashboard/card-order.js +22 -4
- package/dist/dashboard/card-order.mjs +22 -4
- package/dist/dashboard/embed-stripe.js +145 -0
- package/dist/dashboard/embed-stripe.mjs +116 -0
- package/dist/dashboard/form-admin-provider.js +71 -17
- package/dist/dashboard/form-admin-provider.mjs +71 -17
- package/dist/dashboard/form-file-upload.js +3 -2
- package/dist/dashboard/form-file-upload.mjs +4 -3
- package/dist/dashboard/form-organization-campaign-advertisements.js +47 -6
- package/dist/dashboard/form-organization-campaign-advertisements.mjs +47 -6
- package/dist/dashboard/form-organization-campaign-field-birthday.js +193 -0
- package/dist/dashboard/form-organization-campaign-field-birthday.mjs +164 -0
- package/dist/dashboard/form-organization-campaign-field-rating.js +246 -0
- package/dist/dashboard/form-organization-campaign-field-rating.mjs +217 -0
- package/dist/dashboard/form-organization-campaign-page.js +73 -39
- package/dist/dashboard/form-organization-campaign-page.mjs +73 -39
- package/dist/dashboard/form-organization-campaign.js +82 -0
- package/dist/dashboard/form-organization-campaign.mjs +81 -0
- package/dist/dashboard/form-organization-connection.js +48 -6
- package/dist/dashboard/form-organization-connection.mjs +48 -7
- package/dist/dashboard/form-organization-product.js +1461 -0
- package/dist/dashboard/form-organization-product.mjs +1425 -0
- package/dist/dashboard/form-organization-workflow.js +72 -1
- package/dist/dashboard/form-organization-workflow.mjs +69 -1
- package/dist/dashboard/form-otc.js +4 -5
- package/dist/dashboard/form-otc.mjs +4 -5
- package/dist/dashboard/form-stripe.js +12 -5
- package/dist/dashboard/form-stripe.mjs +12 -5
- package/dist/dashboard/input-combobox.js +6 -0
- package/dist/dashboard/input-combobox.mjs +6 -0
- package/dist/dashboard/input-fields.js +37 -161
- package/dist/dashboard/input-fields.mjs +37 -161
- package/dist/dashboard/input-file.js +21 -4
- package/dist/dashboard/input-file.mjs +21 -4
- package/dist/dashboard/input-font.js +2 -0
- package/dist/dashboard/input-font.mjs +2 -0
- package/dist/dashboard/input-gallery.js +201 -0
- package/dist/dashboard/input-gallery.mjs +172 -0
- package/dist/dashboard/input-group-ai.js +15 -3
- package/dist/dashboard/input-group-ai.mjs +15 -3
- package/dist/dashboard/lib/ab-tests.js +2 -2
- package/dist/dashboard/lib/ab-tests.mjs +2 -2
- package/dist/dashboard/lib/connection-controls.js +5 -2
- package/dist/dashboard/lib/connection-controls.mjs +3 -1
- package/dist/dashboard/lib/form-page.js +1 -1
- package/dist/dashboard/lib/form-page.mjs +1 -1
- package/dist/dashboard/lib/menu.js +19 -0
- package/dist/dashboard/lib/menu.mjs +18 -0
- package/dist/dashboard/lib/products.js +169 -0
- package/dist/dashboard/lib/products.mjs +135 -0
- package/dist/dashboard/lib/settings-paths.js +35 -0
- package/dist/dashboard/lib/settings-paths.mjs +11 -0
- package/dist/dashboard/lib/uppy.js +10 -1
- package/dist/dashboard/lib/uppy.mjs +11 -2
- package/dist/dashboard/menu.js +13 -2
- package/dist/dashboard/menu.mjs +13 -2
- package/dist/dashboard/order-sections.js +456 -6
- package/dist/dashboard/order-sections.mjs +453 -7
- package/dist/dashboard/preview.js +119 -52
- package/dist/dashboard/preview.mjs +119 -52
- package/dist/dashboard/provider-ui.js +9 -7
- package/dist/dashboard/provider-ui.mjs +9 -7
- package/dist/dashboard/recharts.js +10 -4
- package/dist/dashboard/recharts.mjs +10 -4
- package/dist/dashboard/shipping-rates.js +404 -0
- package/dist/dashboard/shipping-rates.mjs +371 -0
- package/dist/dashboard/template-buyer.js +301 -0
- package/dist/dashboard/template-buyer.mjs +267 -0
- package/dist/dashboard/template-dashboard.js +11 -1
- package/dist/dashboard/template-dashboard.mjs +11 -1
- package/dist/dashboard/template-design.js +209 -130
- package/dist/dashboard/template-design.mjs +210 -131
- package/dist/dashboard/template-ui.js +157 -55
- package/dist/dashboard/template-ui.mjs +158 -56
- package/dist/icons/flags.js +134 -0
- package/dist/icons/flags.mjs +115 -0
- package/dist/input-checkbox.js +28 -10
- package/dist/input-checkbox.mjs +28 -10
- package/dist/product.js +96 -24
- package/dist/product.mjs +97 -25
- package/dist/shared/carousel.js +14 -5
- package/dist/shared/carousel.mjs +14 -5
- package/dist/shared/lib/helpers.js +54 -6
- package/dist/shared/lib/helpers.mjs +53 -8
- package/dist/shared/order-summary.js +139 -0
- package/dist/shared/order-summary.mjs +110 -0
- package/package.json +84 -4
- package/types/bridge/cart-drawer.d.ts +31 -0
- package/types/bridge/fields.d.ts +14 -2
- package/types/bridge/form-subdomain-checkout.d.ts +20 -0
- package/types/bridge/form-subdomain-shop-modal.d.ts +27 -3
- package/types/bridge/form-subdomain.d.ts +13 -0
- package/types/bridge/lib/age-gate.d.ts +5 -0
- package/types/bridge/lib/cart.d.ts +44 -0
- package/types/bridge/lib/checkout-kit.d.ts +2 -10
- package/types/bridge/lib/entry.d.ts +5 -0
- package/types/bridge/product-tile.d.ts +2 -0
- package/types/dashboard/campaign-share.d.ts +16 -0
- package/types/dashboard/card-order.d.ts +6 -0
- package/types/dashboard/embed-stripe.d.ts +25 -0
- package/types/dashboard/form-admin-provider.d.ts +9 -2
- package/types/dashboard/form-file-upload.d.ts +2 -1
- package/types/dashboard/form-organization-campaign-advertisements.d.ts +3 -0
- package/types/dashboard/form-organization-campaign-field-birthday.d.ts +31 -0
- package/types/dashboard/form-organization-campaign-field-rating.d.ts +33 -0
- package/types/dashboard/form-organization-campaign-page.d.ts +8 -1
- package/types/dashboard/form-organization-campaign.d.ts +3 -0
- package/types/dashboard/form-organization-connection.d.ts +11 -0
- package/types/dashboard/form-organization-product.d.ts +24 -0
- package/types/dashboard/form-otc.d.ts +5 -1
- package/types/dashboard/form-stripe.d.ts +3 -2
- package/types/dashboard/input-combobox.d.ts +2 -0
- package/types/dashboard/input-file.d.ts +2 -0
- package/types/dashboard/input-gallery.d.ts +14 -0
- package/types/dashboard/lib/products.d.ts +14 -0
- package/types/dashboard/lib/settings-paths.d.ts +5 -0
- package/types/dashboard/order-sections.d.ts +24 -1
- package/types/dashboard/preview.d.ts +11 -3
- package/types/dashboard/shipping-rates.d.ts +26 -0
- package/types/dashboard/template-buyer.d.ts +50 -0
- package/types/icons/flags.d.ts +5 -0
- package/types/input-checkbox.d.ts +2 -0
- package/types/shared/lib/helpers.d.ts +4 -0
- package/types/shared/order-summary.d.ts +19 -0
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { formatCurrency, formatDateString } from "@drawbridge/drawbridge-utils";
|
|
4
|
+
import CardSection from "./card-section.mjs";
|
|
5
|
+
import CardShortcut from "./card-shortcut.mjs";
|
|
6
|
+
import Link from "./link.mjs";
|
|
7
|
+
import Loader from "../shared/loader.mjs";
|
|
8
|
+
import Badge from "../shared/badge.mjs";
|
|
9
|
+
import Button from "../shared/button.mjs";
|
|
10
|
+
import LogoMark from "../icons/logo-mark.mjs";
|
|
11
|
+
const TemplateBuyer = ({
|
|
12
|
+
children,
|
|
13
|
+
home,
|
|
14
|
+
isLoading = false
|
|
15
|
+
}) => /* @__PURE__ */ jsx(
|
|
16
|
+
"div",
|
|
17
|
+
{
|
|
18
|
+
...{
|
|
19
|
+
className: "fixed h-full w-full bg-gray-light scroll-smooth overflow-y-auto hide-scrollbar"
|
|
20
|
+
},
|
|
21
|
+
children: isLoading ? /* @__PURE__ */ jsx(Loader, {}) : /* @__PURE__ */ jsx(
|
|
22
|
+
"div",
|
|
23
|
+
{
|
|
24
|
+
...{
|
|
25
|
+
className: "flex min-h-full items-center justify-center px-4 py-32"
|
|
26
|
+
},
|
|
27
|
+
children: /* @__PURE__ */ jsxs(
|
|
28
|
+
"div",
|
|
29
|
+
{
|
|
30
|
+
...{
|
|
31
|
+
className: "space-y-6 mx-auto w-full max-w-[440px]"
|
|
32
|
+
},
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ jsx(
|
|
35
|
+
"div",
|
|
36
|
+
{
|
|
37
|
+
...{
|
|
38
|
+
className: "flex justify-center"
|
|
39
|
+
},
|
|
40
|
+
children: /* @__PURE__ */ jsx(
|
|
41
|
+
Button,
|
|
42
|
+
{
|
|
43
|
+
...{
|
|
44
|
+
"aria-label": "Drawbridge",
|
|
45
|
+
element: Link,
|
|
46
|
+
href: home || "/",
|
|
47
|
+
inline: true,
|
|
48
|
+
variant: "link"
|
|
49
|
+
},
|
|
50
|
+
children: /* @__PURE__ */ jsx(
|
|
51
|
+
"span",
|
|
52
|
+
{
|
|
53
|
+
...{
|
|
54
|
+
className: "flex items-center justify-center w-12 h-12 bg-green-dark rounded-sm"
|
|
55
|
+
},
|
|
56
|
+
children: /* @__PURE__ */ jsx(
|
|
57
|
+
LogoMark,
|
|
58
|
+
{
|
|
59
|
+
...{
|
|
60
|
+
className: "w-6 h-6 text-black"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
)
|
|
68
|
+
}
|
|
69
|
+
),
|
|
70
|
+
/* @__PURE__ */ jsx(CardSection, { children })
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
const BuyerOrder = ({
|
|
79
|
+
downloading = null,
|
|
80
|
+
onDownload,
|
|
81
|
+
order
|
|
82
|
+
}) => {
|
|
83
|
+
const code = ((order == null ? void 0 : order.currency) || "usd").toUpperCase();
|
|
84
|
+
const money = (value) => formatCurrency({ code, value: value || 0 });
|
|
85
|
+
const refunded = (order == null ? void 0 : order.payment) === "refunded";
|
|
86
|
+
const date = (order == null ? void 0 : order.purchasedAt) && formatDateString({
|
|
87
|
+
date: order.purchasedAt,
|
|
88
|
+
options: {
|
|
89
|
+
day: "numeric",
|
|
90
|
+
month: "short",
|
|
91
|
+
year: "numeric"
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
return /* @__PURE__ */ jsxs(
|
|
95
|
+
"div",
|
|
96
|
+
{
|
|
97
|
+
...{
|
|
98
|
+
className: "space-y-6"
|
|
99
|
+
},
|
|
100
|
+
children: [
|
|
101
|
+
/* @__PURE__ */ jsxs(
|
|
102
|
+
"div",
|
|
103
|
+
{
|
|
104
|
+
...{
|
|
105
|
+
className: "space-y-1 text-center"
|
|
106
|
+
},
|
|
107
|
+
children: [
|
|
108
|
+
/* @__PURE__ */ jsx(
|
|
109
|
+
"h1",
|
|
110
|
+
{
|
|
111
|
+
...{
|
|
112
|
+
className: "text-xl"
|
|
113
|
+
},
|
|
114
|
+
children: (order == null ? void 0 : order.number) ? "Order " + order.number : "Your order"
|
|
115
|
+
}
|
|
116
|
+
),
|
|
117
|
+
/* @__PURE__ */ jsx(
|
|
118
|
+
"p",
|
|
119
|
+
{
|
|
120
|
+
...{
|
|
121
|
+
className: "text-sm text-gray-dark"
|
|
122
|
+
},
|
|
123
|
+
children: [order == null ? void 0 : order.organization, date].filter(Boolean).join(" \xB7 ")
|
|
124
|
+
}
|
|
125
|
+
)
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
),
|
|
129
|
+
/* @__PURE__ */ jsx(
|
|
130
|
+
"div",
|
|
131
|
+
{
|
|
132
|
+
...{
|
|
133
|
+
className: "space-y-3"
|
|
134
|
+
},
|
|
135
|
+
children: ((order == null ? void 0 : order.lines) || []).map((line) => /* @__PURE__ */ jsx(
|
|
136
|
+
CardShortcut,
|
|
137
|
+
{
|
|
138
|
+
...{
|
|
139
|
+
...line.digital && {
|
|
140
|
+
controls: refunded ? /* @__PURE__ */ jsx(
|
|
141
|
+
Badge,
|
|
142
|
+
{
|
|
143
|
+
...{
|
|
144
|
+
size: "small"
|
|
145
|
+
},
|
|
146
|
+
children: "Refunded"
|
|
147
|
+
}
|
|
148
|
+
) : /* @__PURE__ */ jsx(
|
|
149
|
+
Button,
|
|
150
|
+
{
|
|
151
|
+
...{
|
|
152
|
+
disabled: downloading !== null,
|
|
153
|
+
loading: downloading === line.index,
|
|
154
|
+
onClick: () => onDownload(line.index),
|
|
155
|
+
size: "small"
|
|
156
|
+
},
|
|
157
|
+
children: "Download"
|
|
158
|
+
}
|
|
159
|
+
)
|
|
160
|
+
},
|
|
161
|
+
description: [line.variantTitle, (line.quantity || 1) + " \xD7 " + money(line.price)].filter(Boolean).join(" \xB7 "),
|
|
162
|
+
title: line.title || "Item"
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
line.index
|
|
166
|
+
))
|
|
167
|
+
}
|
|
168
|
+
),
|
|
169
|
+
(order == null ? void 0 : order.amounts) && /* @__PURE__ */ jsxs(
|
|
170
|
+
"div",
|
|
171
|
+
{
|
|
172
|
+
...{
|
|
173
|
+
className: "flex justify-between text-sm"
|
|
174
|
+
},
|
|
175
|
+
children: [
|
|
176
|
+
/* @__PURE__ */ jsx("span", { children: "Total" }),
|
|
177
|
+
/* @__PURE__ */ jsx("span", { children: money(order.amounts.total) })
|
|
178
|
+
]
|
|
179
|
+
}
|
|
180
|
+
)
|
|
181
|
+
]
|
|
182
|
+
}
|
|
183
|
+
);
|
|
184
|
+
};
|
|
185
|
+
const outcomes = {
|
|
186
|
+
expired: {
|
|
187
|
+
message: "Download links work for one day. Sign in to your order page to get a new one.",
|
|
188
|
+
title: "This link has expired"
|
|
189
|
+
},
|
|
190
|
+
failed: {
|
|
191
|
+
message: "Check your connection and try again.",
|
|
192
|
+
title: "We couldn't start your download"
|
|
193
|
+
},
|
|
194
|
+
refunded: {
|
|
195
|
+
message: "This order was refunded, so its downloads have stopped.",
|
|
196
|
+
title: "Downloads have stopped"
|
|
197
|
+
},
|
|
198
|
+
starting: {
|
|
199
|
+
message: "If it doesn't start, try again.",
|
|
200
|
+
title: "Your download is starting"
|
|
201
|
+
},
|
|
202
|
+
unavailable: {
|
|
203
|
+
message: "This download isn't available.",
|
|
204
|
+
title: "Nothing to download"
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
const BuyerDownload = ({
|
|
208
|
+
href,
|
|
209
|
+
onRetry,
|
|
210
|
+
status = "starting"
|
|
211
|
+
}) => {
|
|
212
|
+
const outcome = outcomes[status] || outcomes.unavailable;
|
|
213
|
+
return /* @__PURE__ */ jsxs(
|
|
214
|
+
"div",
|
|
215
|
+
{
|
|
216
|
+
...{
|
|
217
|
+
className: "space-y-6 text-center"
|
|
218
|
+
},
|
|
219
|
+
children: [
|
|
220
|
+
/* @__PURE__ */ jsx(
|
|
221
|
+
"h1",
|
|
222
|
+
{
|
|
223
|
+
...{
|
|
224
|
+
className: "text-xl"
|
|
225
|
+
},
|
|
226
|
+
children: outcome.title
|
|
227
|
+
}
|
|
228
|
+
),
|
|
229
|
+
/* @__PURE__ */ jsx(
|
|
230
|
+
"p",
|
|
231
|
+
{
|
|
232
|
+
...{
|
|
233
|
+
className: "text-gray-dark"
|
|
234
|
+
},
|
|
235
|
+
children: outcome.message
|
|
236
|
+
}
|
|
237
|
+
),
|
|
238
|
+
["failed", "starting"].includes(status) && onRetry && /* @__PURE__ */ jsx(
|
|
239
|
+
Button,
|
|
240
|
+
{
|
|
241
|
+
...{
|
|
242
|
+
onClick: onRetry,
|
|
243
|
+
variant: "secondary"
|
|
244
|
+
},
|
|
245
|
+
children: "Try again"
|
|
246
|
+
}
|
|
247
|
+
),
|
|
248
|
+
["expired", "refunded", "unavailable"].includes(status) && href && /* @__PURE__ */ jsx(
|
|
249
|
+
Button,
|
|
250
|
+
{
|
|
251
|
+
...{
|
|
252
|
+
element: Link,
|
|
253
|
+
href
|
|
254
|
+
},
|
|
255
|
+
children: "View my order"
|
|
256
|
+
}
|
|
257
|
+
)
|
|
258
|
+
]
|
|
259
|
+
}
|
|
260
|
+
);
|
|
261
|
+
};
|
|
262
|
+
var template_buyer_default = TemplateBuyer;
|
|
263
|
+
export {
|
|
264
|
+
BuyerDownload,
|
|
265
|
+
BuyerOrder,
|
|
266
|
+
template_buyer_default as default
|
|
267
|
+
};
|
|
@@ -349,7 +349,17 @@ const TemplateDashboardError = ({
|
|
|
349
349
|
className: "w-full max-w-lg space-y-3"
|
|
350
350
|
},
|
|
351
351
|
children: [
|
|
352
|
-
title &&
|
|
352
|
+
title && // Impeccable audit, 2026-11-21: the page's own title is its h1, so
|
|
353
|
+
// the empty state's is an h2, drawn at the same size.
|
|
354
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
355
|
+
"h2",
|
|
356
|
+
{
|
|
357
|
+
...{
|
|
358
|
+
className: "text-2xl leading-tight"
|
|
359
|
+
},
|
|
360
|
+
children: title
|
|
361
|
+
}
|
|
362
|
+
),
|
|
353
363
|
(error == null ? void 0 : error.message) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: error.message })
|
|
354
364
|
]
|
|
355
365
|
}
|
|
@@ -311,7 +311,17 @@ const TemplateDashboardError = ({
|
|
|
311
311
|
className: "w-full max-w-lg space-y-3"
|
|
312
312
|
},
|
|
313
313
|
children: [
|
|
314
|
-
title &&
|
|
314
|
+
title && // Impeccable audit, 2026-11-21: the page's own title is its h1, so
|
|
315
|
+
// the empty state's is an h2, drawn at the same size.
|
|
316
|
+
/* @__PURE__ */ jsx(
|
|
317
|
+
"h2",
|
|
318
|
+
{
|
|
319
|
+
...{
|
|
320
|
+
className: "text-2xl leading-tight"
|
|
321
|
+
},
|
|
322
|
+
children: title
|
|
323
|
+
}
|
|
324
|
+
),
|
|
315
325
|
(error == null ? void 0 : error.message) && /* @__PURE__ */ jsx("p", { children: error.message })
|
|
316
326
|
]
|
|
317
327
|
}
|