@drawbridge/components 0.1.48 → 0.1.50

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 (125) hide show
  1. package/dist/bridge/fields.js +0 -278
  2. package/dist/bridge/fields.mjs +1 -276
  3. package/dist/bridge/form-subdomain-shop-modal.js +274 -234
  4. package/dist/bridge/form-subdomain-shop-modal.mjs +275 -233
  5. package/dist/bridge/form-subdomain.js +0 -7
  6. package/dist/bridge/form-subdomain.mjs +2 -9
  7. package/dist/bridge/lib/age-gate.js +0 -12
  8. package/dist/bridge/lib/age-gate.mjs +0 -11
  9. package/dist/bridge/lib/checkout-kit.js +32 -2
  10. package/dist/bridge/lib/checkout-kit.mjs +32 -2
  11. package/dist/bridge/lib/entry.js +3 -3
  12. package/dist/bridge/lib/entry.mjs +2 -2
  13. package/dist/bridge/product-tile.js +6 -9
  14. package/dist/bridge/product-tile.mjs +6 -9
  15. package/dist/bridge/template-layout.js +123 -238
  16. package/dist/bridge/template-layout.mjs +124 -239
  17. package/dist/bridge/template-modal.js +73 -28
  18. package/dist/bridge/template-modal.mjs +74 -29
  19. package/dist/dashboard/buttons-subscription.js +1 -1
  20. package/dist/dashboard/buttons-subscription.mjs +1 -1
  21. package/dist/dashboard/campaign-form.js +2 -7
  22. package/dist/dashboard/campaign-form.mjs +2 -7
  23. package/dist/dashboard/card-order.js +4 -22
  24. package/dist/dashboard/card-order.mjs +4 -22
  25. package/dist/dashboard/document-blocks.js +17 -4
  26. package/dist/dashboard/document-blocks.mjs +17 -4
  27. package/dist/dashboard/form-admin-provider.js +17 -71
  28. package/dist/dashboard/form-admin-provider.mjs +17 -71
  29. package/dist/dashboard/form-file-upload.js +2 -3
  30. package/dist/dashboard/form-file-upload.mjs +3 -4
  31. package/dist/dashboard/form-organization-campaign-advertisements.js +6 -47
  32. package/dist/dashboard/form-organization-campaign-advertisements.mjs +6 -47
  33. package/dist/dashboard/form-organization-campaign-agreement.js +121 -83
  34. package/dist/dashboard/form-organization-campaign-agreement.mjs +121 -83
  35. package/dist/dashboard/form-organization-campaign.js +0 -82
  36. package/dist/dashboard/form-organization-campaign.mjs +0 -81
  37. package/dist/dashboard/form-organization-connection.js +6 -48
  38. package/dist/dashboard/form-organization-connection.mjs +7 -48
  39. package/dist/dashboard/form-organization-workflow.js +1 -72
  40. package/dist/dashboard/form-organization-workflow.mjs +1 -69
  41. package/dist/dashboard/form-otc.js +5 -4
  42. package/dist/dashboard/form-otc.mjs +5 -4
  43. package/dist/dashboard/form-stripe.js +5 -12
  44. package/dist/dashboard/form-stripe.mjs +5 -12
  45. package/dist/dashboard/input-fields.js +158 -11
  46. package/dist/dashboard/input-fields.mjs +158 -11
  47. package/dist/dashboard/input-file.js +4 -21
  48. package/dist/dashboard/input-file.mjs +4 -21
  49. package/dist/dashboard/lib/connection-controls.js +2 -5
  50. package/dist/dashboard/lib/connection-controls.mjs +1 -3
  51. package/dist/dashboard/lib/form-page.js +1 -1
  52. package/dist/dashboard/lib/form-page.mjs +1 -1
  53. package/dist/dashboard/lib/uppy.js +1 -10
  54. package/dist/dashboard/lib/uppy.mjs +2 -11
  55. package/dist/dashboard/order-sections.js +6 -456
  56. package/dist/dashboard/order-sections.mjs +7 -453
  57. package/dist/dashboard/provider-ui.js +7 -9
  58. package/dist/dashboard/provider-ui.mjs +7 -9
  59. package/dist/dashboard/template-ui.js +12 -4
  60. package/dist/dashboard/template-ui.mjs +12 -4
  61. package/dist/input-checkbox.js +10 -28
  62. package/dist/input-checkbox.mjs +10 -28
  63. package/dist/product.js +24 -96
  64. package/dist/product.mjs +25 -97
  65. package/dist/shared/lib/helpers.js +6 -54
  66. package/dist/shared/lib/helpers.mjs +8 -53
  67. package/package.json +4 -74
  68. package/types/bridge/fields.d.ts +2 -14
  69. package/types/bridge/form-subdomain-shop-modal.d.ts +3 -27
  70. package/types/bridge/lib/age-gate.d.ts +0 -5
  71. package/types/bridge/lib/checkout-kit.d.ts +10 -2
  72. package/types/bridge/lib/entry.d.ts +3 -3
  73. package/types/dashboard/card-order.d.ts +0 -6
  74. package/types/dashboard/document-blocks.d.ts +3 -2
  75. package/types/dashboard/form-admin-provider.d.ts +2 -9
  76. package/types/dashboard/form-file-upload.d.ts +1 -2
  77. package/types/dashboard/form-organization-campaign-advertisements.d.ts +0 -3
  78. package/types/dashboard/form-organization-campaign-agreement.d.ts +5 -2
  79. package/types/dashboard/form-organization-campaign.d.ts +0 -3
  80. package/types/dashboard/form-organization-connection.d.ts +0 -11
  81. package/types/dashboard/form-otc.d.ts +1 -5
  82. package/types/dashboard/form-stripe.d.ts +2 -3
  83. package/types/dashboard/input-file.d.ts +0 -2
  84. package/types/dashboard/order-sections.d.ts +1 -24
  85. package/types/input-checkbox.d.ts +0 -2
  86. package/types/shared/lib/helpers.d.ts +0 -4
  87. package/dist/bridge/cart-drawer.js +0 -152
  88. package/dist/bridge/cart-drawer.mjs +0 -123
  89. package/dist/bridge/form-subdomain-checkout.js +0 -687
  90. package/dist/bridge/form-subdomain-checkout.mjs +0 -665
  91. package/dist/bridge/lib/cart.js +0 -79
  92. package/dist/bridge/lib/cart.mjs +0 -48
  93. package/dist/dashboard/embed-stripe.js +0 -145
  94. package/dist/dashboard/embed-stripe.mjs +0 -116
  95. package/dist/dashboard/form-organization-campaign-field-birthday.js +0 -193
  96. package/dist/dashboard/form-organization-campaign-field-birthday.mjs +0 -164
  97. package/dist/dashboard/form-organization-campaign-field-rating.js +0 -246
  98. package/dist/dashboard/form-organization-campaign-field-rating.mjs +0 -217
  99. package/dist/dashboard/form-organization-product.js +0 -1461
  100. package/dist/dashboard/form-organization-product.mjs +0 -1425
  101. package/dist/dashboard/input-gallery.js +0 -201
  102. package/dist/dashboard/input-gallery.mjs +0 -172
  103. package/dist/dashboard/lib/products.js +0 -169
  104. package/dist/dashboard/lib/products.mjs +0 -135
  105. package/dist/dashboard/lib/settings-paths.js +0 -35
  106. package/dist/dashboard/lib/settings-paths.mjs +0 -11
  107. package/dist/dashboard/shipping-rates.js +0 -404
  108. package/dist/dashboard/shipping-rates.mjs +0 -371
  109. package/dist/dashboard/template-buyer.js +0 -301
  110. package/dist/dashboard/template-buyer.mjs +0 -267
  111. package/dist/shared/order-summary.js +0 -139
  112. package/dist/shared/order-summary.mjs +0 -110
  113. package/types/bridge/cart-drawer.d.ts +0 -31
  114. package/types/bridge/form-subdomain-checkout.d.ts +0 -20
  115. package/types/bridge/lib/cart.d.ts +0 -44
  116. package/types/dashboard/embed-stripe.d.ts +0 -25
  117. package/types/dashboard/form-organization-campaign-field-birthday.d.ts +0 -31
  118. package/types/dashboard/form-organization-campaign-field-rating.d.ts +0 -33
  119. package/types/dashboard/form-organization-product.d.ts +0 -24
  120. package/types/dashboard/input-gallery.d.ts +0 -14
  121. package/types/dashboard/lib/products.d.ts +0 -14
  122. package/types/dashboard/lib/settings-paths.d.ts +0 -5
  123. package/types/dashboard/shipping-rates.d.ts +0 -26
  124. package/types/dashboard/template-buyer.d.ts +0 -50
  125. package/types/shared/order-summary.d.ts +0 -19
@@ -1,267 +0,0 @@
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
- };
@@ -1,139 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
- var order_summary_exports = {};
29
- __export(order_summary_exports, {
30
- default: () => order_summary_default
31
- });
32
- module.exports = __toCommonJS(order_summary_exports);
33
- var import_jsx_runtime = require("react/jsx-runtime");
34
- var import_react = require("react");
35
- var import_image = __toESM(require("next/image"));
36
- const OrderSummary = ({
37
- lines = [],
38
- rows = []
39
- }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [
40
- lines.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
41
- "div",
42
- {
43
- ...{
44
- className: "space-y-3 pb-4"
45
- },
46
- children: lines.map((line) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
47
- "div",
48
- {
49
- ...{
50
- className: "flex items-center min-w-0 flex-1 gap-3"
51
- },
52
- children: [
53
- line.image && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
54
- "div",
55
- {
56
- ...{
57
- className: "relative w-14 h-14 rounded overflow-hidden shrink-0"
58
- },
59
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
60
- import_image.default,
61
- {
62
- ...{
63
- alt: line.name || "",
64
- className: "object-cover",
65
- fill: true,
66
- sizes: "56px",
67
- src: line.image,
68
- unoptimized: true
69
- }
70
- }
71
- )
72
- }
73
- ),
74
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
75
- "span",
76
- {
77
- ...{
78
- className: "flex flex-col gap-0.5 min-w-0 text-left"
79
- },
80
- children: [
81
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
82
- "span",
83
- {
84
- ...{
85
- className: "truncate text-sm font-medium leading-tight"
86
- },
87
- children: line.name
88
- }
89
- ),
90
- line.summary && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
91
- "span",
92
- {
93
- ...{
94
- className: "truncate text-xs opacity-60"
95
- },
96
- children: line.summary
97
- }
98
- ),
99
- line.note && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
100
- "span",
101
- {
102
- ...{
103
- className: "text-xs"
104
- },
105
- children: line.note
106
- }
107
- )
108
- ]
109
- }
110
- )
111
- ]
112
- },
113
- line.id
114
- ))
115
- }
116
- ),
117
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
118
- "div",
119
- {
120
- ...{
121
- className: "space-y-1.5"
122
- },
123
- children: rows.map(([label, value]) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
124
- "div",
125
- {
126
- ...{
127
- className: "flex items-center justify-between"
128
- },
129
- children: [
130
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: label }),
131
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: value ?? "\u2014" })
132
- ]
133
- },
134
- label
135
- ))
136
- }
137
- )
138
- ] });
139
- var order_summary_default = OrderSummary;
@@ -1,110 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { Fragment } from "react";
3
- import Image from "next/image";
4
- const OrderSummary = ({
5
- lines = [],
6
- rows = []
7
- }) => /* @__PURE__ */ jsxs(Fragment, { children: [
8
- lines.length > 0 && /* @__PURE__ */ jsx(
9
- "div",
10
- {
11
- ...{
12
- className: "space-y-3 pb-4"
13
- },
14
- children: lines.map((line) => /* @__PURE__ */ jsxs(
15
- "div",
16
- {
17
- ...{
18
- className: "flex items-center min-w-0 flex-1 gap-3"
19
- },
20
- children: [
21
- line.image && /* @__PURE__ */ jsx(
22
- "div",
23
- {
24
- ...{
25
- className: "relative w-14 h-14 rounded overflow-hidden shrink-0"
26
- },
27
- children: /* @__PURE__ */ jsx(
28
- Image,
29
- {
30
- ...{
31
- alt: line.name || "",
32
- className: "object-cover",
33
- fill: true,
34
- sizes: "56px",
35
- src: line.image,
36
- unoptimized: true
37
- }
38
- }
39
- )
40
- }
41
- ),
42
- /* @__PURE__ */ jsxs(
43
- "span",
44
- {
45
- ...{
46
- className: "flex flex-col gap-0.5 min-w-0 text-left"
47
- },
48
- children: [
49
- /* @__PURE__ */ jsx(
50
- "span",
51
- {
52
- ...{
53
- className: "truncate text-sm font-medium leading-tight"
54
- },
55
- children: line.name
56
- }
57
- ),
58
- line.summary && /* @__PURE__ */ jsx(
59
- "span",
60
- {
61
- ...{
62
- className: "truncate text-xs opacity-60"
63
- },
64
- children: line.summary
65
- }
66
- ),
67
- line.note && /* @__PURE__ */ jsx(
68
- "span",
69
- {
70
- ...{
71
- className: "text-xs"
72
- },
73
- children: line.note
74
- }
75
- )
76
- ]
77
- }
78
- )
79
- ]
80
- },
81
- line.id
82
- ))
83
- }
84
- ),
85
- /* @__PURE__ */ jsx(
86
- "div",
87
- {
88
- ...{
89
- className: "space-y-1.5"
90
- },
91
- children: rows.map(([label, value]) => /* @__PURE__ */ jsxs(
92
- "div",
93
- {
94
- ...{
95
- className: "flex items-center justify-between"
96
- },
97
- children: [
98
- /* @__PURE__ */ jsx("p", { children: label }),
99
- /* @__PURE__ */ jsx("p", { children: value ?? "\u2014" })
100
- ]
101
- },
102
- label
103
- ))
104
- }
105
- )
106
- ] });
107
- var order_summary_default = OrderSummary;
108
- export {
109
- order_summary_default as default
110
- };
@@ -1,31 +0,0 @@
1
- import type { FC, ReactNode } from 'react';
2
- import type { BrandStyle } from '../styles';
3
- import type { Cart } from './lib/cart';
4
-
5
- // The cart drawer on the right of a campaign page: the cart, or the on-page
6
- // checkout paying `pay`.
7
- export interface CartDrawerProps {
8
- button?: ReactNode;
9
- cart?: Cart | null;
10
- cut?: string[];
11
- fonts?: { body?: Record<string, unknown> };
12
- onBack?: () => void;
13
- onCart?: ( cart: Cart & { cut?: string[] } ) => void;
14
- onCheckout?: ( cart: Cart ) => void;
15
- onClose: () => void;
16
- onLineRemove?: ( id: string ) => unknown;
17
- onLineUpdate?: ( id: string, quantity: number ) => unknown;
18
- // A Recommended row opens its product over the drawer.
19
- onOpenProduct?: ( product: any ) => void;
20
- onPaid?: () => void;
21
- open: boolean;
22
- params?: { slug?: string; subdomain?: string; token?: string | null };
23
- pay?: Cart | null;
24
- preview?: boolean;
25
- style?: BrandStyle;
26
- tracking?: { track: ( event: unknown ) => void };
27
- }
28
-
29
- declare const CartDrawer: FC<CartDrawerProps>;
30
-
31
- export default CartDrawer;
@@ -1,20 +0,0 @@
1
- import type { FC, ReactNode } from 'react';
2
- import type { BrandStyle } from '../styles';
3
- import type { Cart } from './lib/cart';
4
-
5
- // The checkout for Drawbridge products, on Stripe's Checkout elements, for a
6
- // cart the api keeps. On a preview, Pay stays off.
7
- export interface FormSubdomainCheckoutProps {
8
- back: () => void;
9
- button?: ReactNode;
10
- cart: Cart;
11
- onCart?: ( cart: Cart & { cut?: string[] } ) => void;
12
- onPaid: () => void;
13
- params?: { slug?: string; subdomain?: string; token?: string | null };
14
- preview?: boolean;
15
- style?: BrandStyle;
16
- }
17
-
18
- declare const FormSubdomainCheckout: FC<FormSubdomainCheckoutProps>;
19
-
20
- export default FormSubdomainCheckout;
@@ -1,44 +0,0 @@
1
- // The page's cart as the browser keeps it: its id per campaign, for 30 days.
2
-
3
- export interface CartLine {
4
- availableForSale?: boolean;
5
- currency?: string | null;
6
- id: string;
7
- image?: string | null;
8
- left?: number | null;
9
- price?: number | string | null;
10
- productTitle?: string | null;
11
- quantity: number;
12
- variantId?: string;
13
- variantTitle?: string | null;
14
- }
15
-
16
- export interface Cart {
17
- checkout?: 'shopify' | 'stripe';
18
- checkoutUrl?: string | null;
19
- id: string;
20
- lines: CartLine[];
21
- // Up to 3 products the cart's items recommend, as the product panel opens them.
22
- recommended?: any[];
23
- }
24
-
25
- // A recommended product as its row draws it.
26
- export interface RecommendedRow {
27
- currency: string | null;
28
- id?: string;
29
- image: string | null;
30
- price: number | null;
31
- title: string;
32
- }
33
-
34
- export declare const cartKey: ( args: { campaign: string; subdomain: string } ) => string;
35
- export declare const cartAlive: ( made: number | string | null, now?: number ) => boolean;
36
- export declare const cartCount: ( cart?: Cart | null ) => number;
37
- export declare const withQuantity: ( cart: Cart | null, id: string, quantity: number ) => Cart | null;
38
- export declare const lineNote: ( line: CartLine, cut?: string[] ) => string | null;
39
- export declare const canCheckout: ( cart?: Cart | null ) => boolean;
40
-
41
- // What Continue sends to keep the buyer's email on the cart; null in a preview.
42
- export declare const continueRequest: ( options: { cartId?: string | null; email: string; params?: { slug?: string; subdomain?: string } | null; preview?: boolean } ) => { body: { cartId: string; email: string }; endpoint: string; method: 'PUT' } | null;
43
- export declare const productImage: ( product: any, size: string ) => string | null;
44
- export declare const recommendedRow: ( product: any ) => RecommendedRow;
@@ -1,25 +0,0 @@
1
- import { ComponentType } from 'react';
2
-
3
- // One of Stripe's Connect embedded components, drawn by Stripe. Loads Stripe's
4
- // Connect.js with the [ 'app' ] query's credentials.stripePublishableKey on first use and POSTs `endpoint`
5
- // for each Account Session secret ( the answer's result.clientSecret ).
6
- export interface EmbedStripeProps {
7
- // The section, by the name its Account Session takes: 'account_onboarding',
8
- // 'account_management', 'notification_banner', 'tax_settings',
9
- // 'tax_registrations', 'payment_details'.
10
- component: string;
11
- // The connection's session route: /organization/:organization/connection/:id/session.
12
- endpoint: string;
13
- // payment_details only: the person closed Stripe's overlay.
14
- onClose?: () => void;
15
- // account_onboarding only: the person left Stripe's setup.
16
- onExit?: () => void;
17
- // notification_banner only: how many notices Stripe shows, and how many need an answer.
18
- onNotificationsChange?: ( response: { actionRequired: number; total: number } ) => void;
19
- // payment_details only: the PaymentIntent the overlay opens on.
20
- payment?: string;
21
- }
22
-
23
- declare const EmbedStripe: ComponentType<EmbedStripeProps>;
24
-
25
- export default EmbedStripe;
@@ -1,31 +0,0 @@
1
- import { ComponentType } from 'react';
2
-
3
- // @story fields/birthday
4
- // What the Form page passes: the api's catalog entry (inputs, slug, type) plus
5
- // the route ids, and the saved field when editing. An input left out of
6
- // `inputs` renders disabled. A custom section's question only, never a prize's.
7
- export interface FormOrganizationCampaignFieldBirthdayValues {
8
- campaign: string;
9
- id?: string;
10
- inputs?: Array<'attributes' | 'label'>;
11
- organization: string;
12
- slug?: string;
13
- type?: 'additional';
14
- // The Required switch, on to start.
15
- attributes?: { required?: boolean };
16
- label?: string;
17
- // The custom section the question sits in.
18
- section?: string;
19
- [ key: string ]: unknown;
20
- }
21
-
22
- export interface FormOrganizationCampaignFieldBirthdayProps {
23
- disabled?: boolean;
24
- onError: ( error: Error ) => void;
25
- onSuccess: ( response: unknown ) => void;
26
- values: FormOrganizationCampaignFieldBirthdayValues;
27
- }
28
-
29
- declare const FormOrganizationCampaignFieldBirthday: ComponentType<FormOrganizationCampaignFieldBirthdayProps>;
30
-
31
- export default FormOrganizationCampaignFieldBirthday;