@drawbridge/components 0.1.13 → 0.1.15
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/components/styles.css +364 -2
- package/dist/advertisement.js +3 -1
- package/dist/advertisement.mjs +3 -1
- package/dist/bridge/advertisements.js +2 -0
- package/dist/bridge/advertisements.mjs +2 -0
- package/dist/bridge/countdown.js +2 -1
- package/dist/bridge/countdown.mjs +2 -1
- package/dist/bridge/form-subdomain-embed.js +18 -20
- package/dist/bridge/form-subdomain-embed.mjs +18 -20
- package/dist/bridge/form-subdomain-header.js +24 -1
- package/dist/bridge/form-subdomain-header.mjs +24 -1
- package/dist/bridge/form-subdomain-missions.js +577 -0
- package/dist/bridge/form-subdomain-missions.mjs +540 -0
- package/dist/bridge/form-subdomain.js +530 -220
- package/dist/bridge/form-subdomain.mjs +533 -222
- package/dist/bridge/lib/entry.js +59 -0
- package/dist/bridge/lib/entry.mjs +29 -0
- package/dist/bridge/lib/location.js +38 -0
- package/dist/bridge/lib/location.mjs +13 -0
- package/dist/bridge/lib/order.js +71 -0
- package/dist/bridge/lib/order.mjs +44 -0
- package/dist/bridge/lib/url.js +9 -0
- package/dist/bridge/lib/url.mjs +7 -0
- package/dist/bridge/share-button.js +5 -3
- package/dist/bridge/share-button.mjs +5 -3
- package/dist/bridge/subdomain-content.js +7 -6
- package/dist/bridge/subdomain-content.mjs +7 -6
- package/dist/bridge/template-layout.js +59 -21
- package/dist/bridge/template-layout.mjs +59 -21
- package/dist/bridge/template-modal.js +42 -76
- package/dist/bridge/template-modal.mjs +39 -73
- package/dist/bridge/template-preview.js +208 -0
- package/dist/bridge/template-preview.mjs +173 -0
- package/dist/bridge/template-subdomain-gallery.js +6 -2
- package/dist/bridge/template-subdomain-gallery.mjs +6 -2
- package/dist/bridge/template-subdomain-link.js +6 -1
- package/dist/bridge/template-subdomain-link.mjs +6 -1
- package/dist/bridge/template-subdomain.js +20 -15
- package/dist/bridge/template-subdomain.mjs +20 -15
- package/dist/dashboard/accordion.js +74 -39
- package/dist/dashboard/accordion.mjs +74 -39
- package/dist/dashboard/avatar.js +109 -3
- package/dist/dashboard/avatar.mjs +106 -4
- package/dist/dashboard/buttons-subscription.js +384 -0
- package/dist/dashboard/buttons-subscription.mjs +349 -0
- package/dist/dashboard/card-campaign-switch.js +277 -0
- package/dist/dashboard/card-campaign-switch.mjs +243 -0
- package/dist/dashboard/card-order.js +231 -29
- package/dist/dashboard/card-order.mjs +231 -29
- package/dist/dashboard/card-section.js +26 -2
- package/dist/dashboard/card-section.mjs +26 -2
- package/dist/dashboard/card-tile.js +6 -7
- package/dist/dashboard/card-tile.mjs +6 -7
- package/dist/dashboard/connection-workflows.js +205 -0
- package/dist/dashboard/connection-workflows.mjs +171 -0
- package/dist/dashboard/device.js +95 -0
- package/dist/dashboard/device.mjs +72 -0
- package/dist/dashboard/form-admin-campaign.js +19 -50
- package/dist/dashboard/form-admin-campaign.mjs +20 -51
- package/dist/dashboard/form-ai.js +9 -6
- package/dist/dashboard/form-ai.mjs +9 -6
- package/dist/dashboard/form-auth.js +35 -25
- package/dist/dashboard/form-auth.mjs +36 -26
- package/dist/dashboard/form-file.js +10 -1
- package/dist/dashboard/form-file.mjs +10 -1
- package/dist/dashboard/form-filters-analytics.js +14 -1
- package/dist/dashboard/form-filters-analytics.mjs +15 -2
- package/dist/dashboard/form-organization-campaign-advertisement.js +15 -1
- package/dist/dashboard/form-organization-campaign-advertisement.mjs +16 -2
- package/dist/dashboard/form-organization-campaign-agreement.js +215 -164
- package/dist/dashboard/form-organization-campaign-agreement.mjs +215 -164
- package/dist/dashboard/form-organization-campaign-field-email.js +0 -34
- package/dist/dashboard/form-organization-campaign-field-email.mjs +0 -34
- package/dist/dashboard/form-organization-campaign-field-list.js +466 -0
- package/dist/dashboard/form-organization-campaign-field-list.mjs +437 -0
- package/dist/dashboard/form-organization-campaign-field-phone.js +0 -34
- package/dist/dashboard/form-organization-campaign-field-phone.mjs +0 -34
- package/dist/dashboard/form-organization-campaign-field-remove.js +66 -0
- package/dist/dashboard/form-organization-campaign-field-remove.mjs +33 -0
- package/dist/dashboard/form-organization-campaign-field-select.js +51 -5
- package/dist/dashboard/form-organization-campaign-field-select.mjs +51 -5
- package/dist/dashboard/form-organization-campaign-field-textarea.js +46 -8
- package/dist/dashboard/form-organization-campaign-field-textarea.mjs +46 -8
- package/dist/dashboard/form-organization-campaign-integration-age.js +6 -12
- package/dist/dashboard/form-organization-campaign-integration-age.mjs +6 -12
- package/dist/dashboard/form-organization-campaign-integration-enable.js +52 -24
- package/dist/dashboard/form-organization-campaign-integration-enable.mjs +54 -26
- package/dist/dashboard/form-organization-campaign-integration-geocode.js +6 -12
- package/dist/dashboard/form-organization-campaign-integration-geocode.mjs +6 -12
- package/dist/dashboard/form-organization-campaign-integration-gtm.js +6 -12
- package/dist/dashboard/form-organization-campaign-integration-gtm.mjs +6 -12
- package/dist/dashboard/form-organization-campaign-link.js +7 -1
- package/dist/dashboard/form-organization-campaign-link.mjs +7 -1
- package/dist/dashboard/form-organization-campaign-mission.js +291 -0
- package/dist/dashboard/form-organization-campaign-mission.mjs +258 -0
- package/dist/dashboard/form-organization-campaign-page-embed.js +13 -2
- package/dist/dashboard/form-organization-campaign-page-embed.mjs +12 -1
- package/dist/dashboard/form-organization-campaign-page.js +20 -11
- package/dist/dashboard/form-organization-campaign-page.mjs +20 -11
- package/dist/dashboard/form-organization-campaign-prize-edit.js +12 -1
- package/dist/dashboard/form-organization-campaign-prize-edit.mjs +12 -1
- package/dist/dashboard/form-organization-campaign-section.js +243 -0
- package/dist/dashboard/form-organization-campaign-section.mjs +214 -0
- package/dist/dashboard/form-organization-campaign.js +114 -469
- package/dist/dashboard/form-organization-campaign.mjs +113 -467
- package/dist/dashboard/form-organization-export.js +4 -7
- package/dist/dashboard/form-organization-export.mjs +4 -7
- package/dist/dashboard/form-organization-identity.js +46 -51
- package/dist/dashboard/form-organization-identity.mjs +46 -51
- package/dist/dashboard/form-organization-workflow.js +708 -687
- package/dist/dashboard/form-organization-workflow.mjs +704 -683
- package/dist/dashboard/form-organization.js +82 -110
- package/dist/dashboard/form-organization.mjs +81 -109
- package/dist/dashboard/form-otc.js +4 -5
- package/dist/dashboard/form-otc.mjs +4 -5
- package/dist/dashboard/form-payment-methods.js +20 -9
- package/dist/dashboard/form-payment-methods.mjs +20 -9
- package/dist/dashboard/form-stripe.js +30 -0
- package/dist/dashboard/form-stripe.mjs +26 -0
- package/dist/dashboard/input-array.js +4 -2
- package/dist/dashboard/input-array.mjs +4 -2
- package/dist/dashboard/input-combobox.js +7 -3
- package/dist/dashboard/input-combobox.mjs +7 -3
- package/dist/dashboard/input-date.js +7 -0
- package/dist/dashboard/input-date.mjs +7 -0
- package/dist/dashboard/input-fields.js +80 -20
- package/dist/dashboard/input-fields.mjs +80 -20
- package/dist/dashboard/input-file.js +21 -1
- package/dist/dashboard/input-file.mjs +21 -1
- package/dist/dashboard/input-font.js +10 -1
- package/dist/dashboard/input-font.mjs +10 -1
- package/dist/dashboard/lib/item-list.js +57 -0
- package/dist/dashboard/lib/item-list.mjs +33 -0
- package/dist/dashboard/lib/menu.js +50 -0
- package/dist/dashboard/lib/menu.mjs +26 -0
- package/dist/dashboard/locked.js +82 -0
- package/dist/dashboard/locked.mjs +53 -0
- package/dist/dashboard/menu.js +72 -19
- package/dist/dashboard/menu.mjs +72 -19
- package/dist/dashboard/note-ai.js +69 -0
- package/dist/dashboard/note-ai.mjs +36 -0
- package/dist/dashboard/preview.js +419 -0
- package/dist/dashboard/preview.mjs +384 -0
- package/dist/dashboard/steps.js +39 -13
- package/dist/dashboard/steps.mjs +37 -12
- package/dist/dashboard/table-contacts.js +136 -0
- package/dist/dashboard/table-contacts.mjs +103 -0
- package/dist/dashboard/template-not-found.js +4 -2
- package/dist/dashboard/template-not-found.mjs +4 -2
- package/dist/dashboard/template-socket.js +20 -7
- package/dist/dashboard/template-socket.mjs +20 -7
- package/dist/icons/desktop.js +46 -0
- package/dist/icons/desktop.mjs +27 -0
- package/dist/icons/phone.js +46 -0
- package/dist/icons/phone.mjs +27 -0
- package/dist/icons/puzzle-piece.js +46 -0
- package/dist/icons/puzzle-piece.mjs +27 -0
- package/dist/icons/tablet.js +46 -0
- package/dist/icons/tablet.mjs +27 -0
- package/dist/icons/users.js +46 -0
- package/dist/icons/users.mjs +27 -0
- package/dist/input-checkbox.js +1 -0
- package/dist/input-checkbox.mjs +1 -0
- package/dist/input-code.js +83 -0
- package/dist/input-code.mjs +50 -0
- package/dist/input-text.js +2 -1
- package/dist/input-text.mjs +2 -1
- package/dist/shared/button.js +1 -1
- package/dist/shared/button.mjs +1 -1
- package/dist/shared/input-checkbox-list.js +0 -1
- package/dist/shared/input-checkbox-list.mjs +0 -1
- package/dist/shared/input-switch.js +6 -1
- package/dist/shared/input-switch.mjs +6 -1
- package/dist/shared/lib/campaign.js +123 -0
- package/dist/shared/lib/campaign.mjs +96 -0
- package/dist/shared/lib/helpers.js +14 -2
- package/dist/shared/lib/helpers.mjs +13 -2
- package/package.json +133 -13
- package/types/bridge/form-subdomain-header.d.ts +2 -0
- package/types/bridge/form-subdomain-missions.d.ts +38 -0
- package/types/bridge/form-subdomain.d.ts +23 -1
- package/types/bridge/lib/entry.d.ts +26 -0
- package/types/bridge/lib/location.d.ts +13 -0
- package/types/bridge/lib/order.d.ts +30 -0
- package/types/bridge/lib/url.d.ts +19 -0
- package/types/bridge/template-modal.d.ts +1 -1
- package/types/bridge/template-preview.d.ts +10 -0
- package/types/bridge/template-subdomain-link.d.ts +2 -0
- package/types/dashboard/accordion.d.ts +2 -0
- package/types/dashboard/avatar.d.ts +18 -2
- package/types/dashboard/buttons-subscription.d.ts +22 -0
- package/types/dashboard/card-campaign-switch.d.ts +32 -0
- package/types/dashboard/card-order.d.ts +25 -1
- package/types/dashboard/card-section.d.ts +2 -0
- package/types/dashboard/connection-workflows.d.ts +33 -0
- package/types/dashboard/device.d.ts +12 -0
- package/types/dashboard/form-admin-campaign.d.ts +3 -2
- package/types/dashboard/form-ai.d.ts +2 -2
- package/types/dashboard/form-organization-campaign-agreement.d.ts +18 -12
- package/types/dashboard/form-organization-campaign-field-email.d.ts +1 -2
- package/types/dashboard/form-organization-campaign-field-list.d.ts +36 -0
- package/types/dashboard/form-organization-campaign-field-phone.d.ts +1 -2
- package/types/dashboard/form-organization-campaign-field-remove.d.ts +22 -0
- package/types/dashboard/form-organization-campaign-field-select.d.ts +2 -1
- package/types/dashboard/form-organization-campaign-field-textarea.d.ts +2 -1
- package/types/dashboard/form-organization-campaign-integration-age.d.ts +3 -3
- package/types/dashboard/form-organization-campaign-integration-enable.d.ts +3 -3
- package/types/dashboard/form-organization-campaign-mission.d.ts +40 -0
- package/types/dashboard/form-organization-campaign-section.d.ts +29 -0
- package/types/dashboard/form-organization-campaign.d.ts +27 -17
- package/types/dashboard/form-organization-identity.d.ts +2 -0
- package/types/dashboard/form-organization-workflow.d.ts +56 -47
- package/types/dashboard/form-organization.d.ts +7 -2
- package/types/dashboard/form-stripe.d.ts +3 -0
- package/types/dashboard/input-combobox.d.ts +2 -0
- package/types/dashboard/input-date.d.ts +2 -0
- package/types/dashboard/input-fields.d.ts +3 -2
- package/types/dashboard/input-file.d.ts +4 -0
- package/types/dashboard/lib/item-list.d.ts +14 -0
- package/types/dashboard/lib/menu.d.ts +17 -0
- package/types/dashboard/locked.d.ts +10 -0
- package/types/dashboard/menu.d.ts +10 -2
- package/types/dashboard/note-ai.d.ts +15 -0
- package/types/dashboard/preview.d.ts +33 -0
- package/types/dashboard/steps.d.ts +19 -4
- package/types/dashboard/table-cell-title.d.ts +2 -2
- package/types/dashboard/table-contacts.d.ts +2 -0
- package/types/icons/desktop.d.ts +5 -0
- package/types/icons/phone.d.ts +5 -0
- package/types/icons/puzzle-piece.d.ts +5 -0
- package/types/icons/tablet.d.ts +5 -0
- package/types/icons/users.d.ts +5 -0
- package/types/input-code.d.ts +23 -0
- package/types/shared/input-switch.d.ts +2 -0
- package/types/shared/lib/campaign.d.ts +35 -0
- package/types/shared/lib/helpers.d.ts +3 -0
- package/dist/dashboard/card-integration.js +0 -187
- package/dist/dashboard/card-integration.mjs +0 -158
- package/dist/dashboard/iframe.js +0 -159
- package/dist/dashboard/iframe.mjs +0 -130
- package/types/dashboard/card-integration.d.ts +0 -24
- package/types/dashboard/iframe.d.ts +0 -18
|
@@ -2,17 +2,228 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { formatCurrency, formatDateString, formatNumber } from "@drawbridge/drawbridge-utils";
|
|
3
3
|
import CardDataItem from "./card-data-item.mjs";
|
|
4
4
|
const className = "p-3 bg-white rounded shadow-[0_1px_3px_0_rgb(0_0_0/0.1),0_1px_2px_-1px_rgb(0_0_0/0.1)]";
|
|
5
|
+
const attributions = {
|
|
6
|
+
conversion: "A campaign link brought the buyer to checkout, so the conversion fee applies.",
|
|
7
|
+
redemption: "The buyer used one of your discount codes, so no fee applies."
|
|
8
|
+
};
|
|
9
|
+
const date = (value) => value ? formatDateString({
|
|
10
|
+
date: value,
|
|
11
|
+
options: {
|
|
12
|
+
day: "numeric",
|
|
13
|
+
month: "short",
|
|
14
|
+
year: "numeric"
|
|
15
|
+
}
|
|
16
|
+
}) : "\u2014";
|
|
17
|
+
const Item = ({ label, value }) => /* @__PURE__ */ jsx(
|
|
18
|
+
CardDataItem,
|
|
19
|
+
{
|
|
20
|
+
...{
|
|
21
|
+
className: ["flex flex-col min-w-0", className].join(" "),
|
|
22
|
+
classNameSlotLeft: "text-sm disabled",
|
|
23
|
+
classNameSlotRight: "w-full break-words",
|
|
24
|
+
label,
|
|
25
|
+
value: value || "\u2014"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
const FormOrder = ({ code, customer, gross, lines, note, pickup, purchasedAt }) => {
|
|
30
|
+
const priced = lines.some((line) => typeof (line == null ? void 0 : line.price) === "number");
|
|
31
|
+
return /* @__PURE__ */ jsxs(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
...{
|
|
35
|
+
className: "space-y-6"
|
|
36
|
+
},
|
|
37
|
+
children: [
|
|
38
|
+
/* @__PURE__ */ jsx("p", { children: "Placed on your entry form. No payment was taken." }),
|
|
39
|
+
/* @__PURE__ */ jsxs(
|
|
40
|
+
"div",
|
|
41
|
+
{
|
|
42
|
+
...{
|
|
43
|
+
className: "grid grid-cols-2 gap-6 sm:grid-cols-3"
|
|
44
|
+
},
|
|
45
|
+
children: [
|
|
46
|
+
/* @__PURE__ */ jsx(
|
|
47
|
+
Item,
|
|
48
|
+
{
|
|
49
|
+
...{
|
|
50
|
+
label: "Customer",
|
|
51
|
+
value: [customer == null ? void 0 : customer.firstName, customer == null ? void 0 : customer.lastName].filter(Boolean).join(" ")
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
),
|
|
55
|
+
/* @__PURE__ */ jsx(
|
|
56
|
+
Item,
|
|
57
|
+
{
|
|
58
|
+
...{
|
|
59
|
+
label: "Email",
|
|
60
|
+
value: customer == null ? void 0 : customer.email
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
),
|
|
64
|
+
/* @__PURE__ */ jsx(
|
|
65
|
+
Item,
|
|
66
|
+
{
|
|
67
|
+
...{
|
|
68
|
+
label: "Phone",
|
|
69
|
+
value: customer == null ? void 0 : customer.phone
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
/* @__PURE__ */ jsx(
|
|
74
|
+
Item,
|
|
75
|
+
{
|
|
76
|
+
...{
|
|
77
|
+
label: "Date",
|
|
78
|
+
value: date(purchasedAt)
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
),
|
|
82
|
+
/* @__PURE__ */ jsx(
|
|
83
|
+
Item,
|
|
84
|
+
{
|
|
85
|
+
...{
|
|
86
|
+
label: "Pickup",
|
|
87
|
+
value: pickup
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
),
|
|
91
|
+
/* @__PURE__ */ jsx(
|
|
92
|
+
Item,
|
|
93
|
+
{
|
|
94
|
+
...{
|
|
95
|
+
label: "Note",
|
|
96
|
+
value: note
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
),
|
|
100
|
+
priced && /* @__PURE__ */ jsx(
|
|
101
|
+
Item,
|
|
102
|
+
{
|
|
103
|
+
...{
|
|
104
|
+
label: "Estimated total",
|
|
105
|
+
value: formatCurrency({ code, value: gross })
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
)
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
),
|
|
112
|
+
lines.length > 0 && /* @__PURE__ */ jsxs(
|
|
113
|
+
"div",
|
|
114
|
+
{
|
|
115
|
+
...{
|
|
116
|
+
className: "space-y-2"
|
|
117
|
+
},
|
|
118
|
+
children: [
|
|
119
|
+
/* @__PURE__ */ jsx(
|
|
120
|
+
"p",
|
|
121
|
+
{
|
|
122
|
+
...{
|
|
123
|
+
className: "text-sm disabled"
|
|
124
|
+
},
|
|
125
|
+
children: "Items"
|
|
126
|
+
}
|
|
127
|
+
),
|
|
128
|
+
/* @__PURE__ */ jsx(
|
|
129
|
+
"div",
|
|
130
|
+
{
|
|
131
|
+
...{
|
|
132
|
+
className: "space-y-3"
|
|
133
|
+
},
|
|
134
|
+
children: lines.map(({ price, quantity = 0, title }, key) => /* @__PURE__ */ jsxs(
|
|
135
|
+
"div",
|
|
136
|
+
{
|
|
137
|
+
...{
|
|
138
|
+
className: ["space-y-3", className].join(" ")
|
|
139
|
+
},
|
|
140
|
+
children: [
|
|
141
|
+
/* @__PURE__ */ jsx("p", { children: title || "Untitled item" }),
|
|
142
|
+
/* @__PURE__ */ jsxs(
|
|
143
|
+
"div",
|
|
144
|
+
{
|
|
145
|
+
...{
|
|
146
|
+
className: "grid grid-cols-3 gap-6"
|
|
147
|
+
},
|
|
148
|
+
children: [
|
|
149
|
+
/* @__PURE__ */ jsx(
|
|
150
|
+
CardDataItem,
|
|
151
|
+
{
|
|
152
|
+
...{
|
|
153
|
+
className: "flex flex-col",
|
|
154
|
+
classNameSlotLeft: "text-sm disabled",
|
|
155
|
+
label: "Quantity",
|
|
156
|
+
value: formatNumber(quantity)
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
),
|
|
160
|
+
typeof price === "number" && /* @__PURE__ */ jsx(
|
|
161
|
+
CardDataItem,
|
|
162
|
+
{
|
|
163
|
+
...{
|
|
164
|
+
className: "flex flex-col",
|
|
165
|
+
classNameSlotLeft: "text-sm disabled",
|
|
166
|
+
label: "Price",
|
|
167
|
+
value: formatCurrency({ code, value: price })
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
),
|
|
171
|
+
typeof price === "number" && /* @__PURE__ */ jsx(
|
|
172
|
+
CardDataItem,
|
|
173
|
+
{
|
|
174
|
+
...{
|
|
175
|
+
className: "flex flex-col",
|
|
176
|
+
classNameSlotLeft: "text-sm disabled",
|
|
177
|
+
label: "Total",
|
|
178
|
+
value: formatCurrency({ code, value: price * quantity })
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
)
|
|
182
|
+
]
|
|
183
|
+
}
|
|
184
|
+
)
|
|
185
|
+
]
|
|
186
|
+
},
|
|
187
|
+
key
|
|
188
|
+
))
|
|
189
|
+
}
|
|
190
|
+
)
|
|
191
|
+
]
|
|
192
|
+
}
|
|
193
|
+
)
|
|
194
|
+
]
|
|
195
|
+
}
|
|
196
|
+
);
|
|
197
|
+
};
|
|
5
198
|
const CardOrder = ({
|
|
6
199
|
currency,
|
|
200
|
+
customer,
|
|
7
201
|
fee = 0,
|
|
8
202
|
gross = 0,
|
|
9
203
|
lines = [],
|
|
10
204
|
net = 0,
|
|
205
|
+
note,
|
|
206
|
+
pickup,
|
|
207
|
+
provider,
|
|
11
208
|
purchasedAt,
|
|
12
209
|
rate,
|
|
13
210
|
type
|
|
14
211
|
}) => {
|
|
15
212
|
const code = (currency || "usd").toUpperCase();
|
|
213
|
+
if (type === "form") return /* @__PURE__ */ jsx(
|
|
214
|
+
FormOrder,
|
|
215
|
+
{
|
|
216
|
+
...{
|
|
217
|
+
code,
|
|
218
|
+
customer,
|
|
219
|
+
gross,
|
|
220
|
+
lines,
|
|
221
|
+
note,
|
|
222
|
+
pickup,
|
|
223
|
+
purchasedAt
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
);
|
|
16
227
|
return /* @__PURE__ */ jsxs(
|
|
17
228
|
"div",
|
|
18
229
|
{
|
|
@@ -20,6 +231,7 @@ const CardOrder = ({
|
|
|
20
231
|
className: "space-y-6"
|
|
21
232
|
},
|
|
22
233
|
children: [
|
|
234
|
+
/* @__PURE__ */ jsx("p", { children: attributions[type] || attributions.conversion }),
|
|
23
235
|
/* @__PURE__ */ jsxs(
|
|
24
236
|
"div",
|
|
25
237
|
{
|
|
@@ -28,73 +240,63 @@ const CardOrder = ({
|
|
|
28
240
|
},
|
|
29
241
|
children: [
|
|
30
242
|
/* @__PURE__ */ jsx(
|
|
31
|
-
|
|
243
|
+
Item,
|
|
32
244
|
{
|
|
33
245
|
...{
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
label: "Date",
|
|
37
|
-
value: purchasedAt ? formatDateString({
|
|
38
|
-
date: purchasedAt,
|
|
39
|
-
options: {
|
|
40
|
-
day: "numeric",
|
|
41
|
-
month: "short",
|
|
42
|
-
year: "numeric"
|
|
43
|
-
}
|
|
44
|
-
}) : "\u2014"
|
|
246
|
+
label: "Order number",
|
|
247
|
+
value: provider == null ? void 0 : provider.name
|
|
45
248
|
}
|
|
46
249
|
}
|
|
47
250
|
),
|
|
48
251
|
/* @__PURE__ */ jsx(
|
|
49
|
-
|
|
252
|
+
Item,
|
|
50
253
|
{
|
|
51
254
|
...{
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
255
|
+
label: "Order ID",
|
|
256
|
+
value: provider == null ? void 0 : provider.id
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
),
|
|
260
|
+
/* @__PURE__ */ jsx(
|
|
261
|
+
Item,
|
|
262
|
+
{
|
|
263
|
+
...{
|
|
264
|
+
label: "Date",
|
|
265
|
+
value: date(purchasedAt)
|
|
56
266
|
}
|
|
57
267
|
}
|
|
58
268
|
),
|
|
59
269
|
/* @__PURE__ */ jsx(
|
|
60
|
-
|
|
270
|
+
Item,
|
|
61
271
|
{
|
|
62
272
|
...{
|
|
63
|
-
className: ["flex flex-col", className].join(" "),
|
|
64
|
-
classNameSlotLeft: "text-sm disabled",
|
|
65
273
|
label: "Currency",
|
|
66
274
|
value: code
|
|
67
275
|
}
|
|
68
276
|
}
|
|
69
277
|
),
|
|
70
278
|
/* @__PURE__ */ jsx(
|
|
71
|
-
|
|
279
|
+
Item,
|
|
72
280
|
{
|
|
73
281
|
...{
|
|
74
|
-
className: ["flex flex-col", className].join(" "),
|
|
75
|
-
classNameSlotLeft: "text-sm disabled",
|
|
76
282
|
label: "Gross",
|
|
77
283
|
value: formatCurrency({ code, value: gross })
|
|
78
284
|
}
|
|
79
285
|
}
|
|
80
286
|
),
|
|
81
287
|
/* @__PURE__ */ jsx(
|
|
82
|
-
|
|
288
|
+
Item,
|
|
83
289
|
{
|
|
84
290
|
...{
|
|
85
|
-
className: ["flex flex-col", className].join(" "),
|
|
86
|
-
classNameSlotLeft: "text-sm disabled",
|
|
87
291
|
label: "Net",
|
|
88
292
|
value: formatCurrency({ code, value: net })
|
|
89
293
|
}
|
|
90
294
|
}
|
|
91
295
|
),
|
|
92
296
|
/* @__PURE__ */ jsx(
|
|
93
|
-
|
|
297
|
+
Item,
|
|
94
298
|
{
|
|
95
299
|
...{
|
|
96
|
-
className: ["flex flex-col", className].join(" "),
|
|
97
|
-
classNameSlotLeft: "text-sm disabled",
|
|
98
300
|
label: "Fee",
|
|
99
301
|
// A redemption is charged no fee, so it shows no rate ( rateCell in table.js ).
|
|
100
302
|
value: formatCurrency({ code, value: fee }) + (type !== "redemption" && (rate || rate === 0) ? " (" + rate + "%)" : "")
|
|
@@ -21,15 +21,20 @@ __export(card_section_exports, {
|
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(card_section_exports);
|
|
23
23
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
24
|
+
var import_react = require("react");
|
|
24
25
|
const CardSection = ({
|
|
25
26
|
children,
|
|
26
27
|
className,
|
|
28
|
+
columns = 1,
|
|
27
29
|
cta,
|
|
28
30
|
title,
|
|
29
31
|
...rest
|
|
30
32
|
}) => {
|
|
31
33
|
const classes = [
|
|
32
|
-
"flex flex-col w-full bg-white rounded border border-gray
|
|
34
|
+
"flex flex-col w-full bg-white rounded border border-gray",
|
|
35
|
+
// In columns the card does not clip, so a column can stay in view as the
|
|
36
|
+
// page scrolls; and it never shrinks in the page's column.
|
|
37
|
+
columns > 1 ? "shrink-0" : "overflow-hidden"
|
|
33
38
|
];
|
|
34
39
|
const hasHeader = Boolean(title || cta);
|
|
35
40
|
if (className) {
|
|
@@ -72,7 +77,26 @@ const CardSection = ({
|
|
|
72
77
|
// overlay) anchors to the content area, not a distant ancestor.
|
|
73
78
|
className: "relative flex-1 min-h-0 p-6" + (hasHeader ? " pt-0" : "")
|
|
74
79
|
},
|
|
75
|
-
children
|
|
80
|
+
children: columns > 1 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
81
|
+
"div",
|
|
82
|
+
{
|
|
83
|
+
...{
|
|
84
|
+
className: "grid grid-cols-1 gap-6 items-start xl:grid-cols-2"
|
|
85
|
+
},
|
|
86
|
+
children: import_react.Children.toArray(children).map((child, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
87
|
+
"div",
|
|
88
|
+
{
|
|
89
|
+
...{
|
|
90
|
+
// The first column ( the form ) runs with the page; the others
|
|
91
|
+
// stay in view beside it while it scrolls.
|
|
92
|
+
className: "min-w-0" + (index ? " xl:sticky xl:top-6" : "")
|
|
93
|
+
},
|
|
94
|
+
children: child
|
|
95
|
+
},
|
|
96
|
+
index
|
|
97
|
+
))
|
|
98
|
+
}
|
|
99
|
+
) : children
|
|
76
100
|
}
|
|
77
101
|
)
|
|
78
102
|
]
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Children } from "react";
|
|
2
3
|
const CardSection = ({
|
|
3
4
|
children,
|
|
4
5
|
className,
|
|
6
|
+
columns = 1,
|
|
5
7
|
cta,
|
|
6
8
|
title,
|
|
7
9
|
...rest
|
|
8
10
|
}) => {
|
|
9
11
|
const classes = [
|
|
10
|
-
"flex flex-col w-full bg-white rounded border border-gray
|
|
12
|
+
"flex flex-col w-full bg-white rounded border border-gray",
|
|
13
|
+
// In columns the card does not clip, so a column can stay in view as the
|
|
14
|
+
// page scrolls; and it never shrinks in the page's column.
|
|
15
|
+
columns > 1 ? "shrink-0" : "overflow-hidden"
|
|
11
16
|
];
|
|
12
17
|
const hasHeader = Boolean(title || cta);
|
|
13
18
|
if (className) {
|
|
@@ -50,7 +55,26 @@ const CardSection = ({
|
|
|
50
55
|
// overlay) anchors to the content area, not a distant ancestor.
|
|
51
56
|
className: "relative flex-1 min-h-0 p-6" + (hasHeader ? " pt-0" : "")
|
|
52
57
|
},
|
|
53
|
-
children
|
|
58
|
+
children: columns > 1 ? /* @__PURE__ */ jsx(
|
|
59
|
+
"div",
|
|
60
|
+
{
|
|
61
|
+
...{
|
|
62
|
+
className: "grid grid-cols-1 gap-6 items-start xl:grid-cols-2"
|
|
63
|
+
},
|
|
64
|
+
children: Children.toArray(children).map((child, index) => /* @__PURE__ */ jsx(
|
|
65
|
+
"div",
|
|
66
|
+
{
|
|
67
|
+
...{
|
|
68
|
+
// The first column ( the form ) runs with the page; the others
|
|
69
|
+
// stay in view beside it while it scrolls.
|
|
70
|
+
className: "min-w-0" + (index ? " xl:sticky xl:top-6" : "")
|
|
71
|
+
},
|
|
72
|
+
children: child
|
|
73
|
+
},
|
|
74
|
+
index
|
|
75
|
+
))
|
|
76
|
+
}
|
|
77
|
+
) : children
|
|
54
78
|
}
|
|
55
79
|
)
|
|
56
80
|
]
|
|
@@ -42,6 +42,7 @@ var import_link = __toESM(require("./link"));
|
|
|
42
42
|
var import_button = __toESM(require("../shared/button"));
|
|
43
43
|
var import_drawbridge_utils = require("@drawbridge/drawbridge-utils");
|
|
44
44
|
var import_cdn = require("@drawbridge/drawbridge-utils/cdn");
|
|
45
|
+
var import_campaign = require("../shared/lib/campaign");
|
|
45
46
|
const classes = {
|
|
46
47
|
container: [
|
|
47
48
|
"group relative flex w-full h-full p-6 space-x-6 transition duration-200 ease-in xl:aspect-video 2xl:space-x-12"
|
|
@@ -388,13 +389,11 @@ const TileCampaign = ({
|
|
|
388
389
|
page,
|
|
389
390
|
updatedAt
|
|
390
391
|
}) => {
|
|
391
|
-
var _a, _b, _c, _d, _e, _f
|
|
392
|
+
var _a, _b, _c, _d, _e, _f;
|
|
392
393
|
const generating = ((_b = (_a = campaign == null ? void 0 : campaign.process) == null ? void 0 : _a.ai) == null ? void 0 : _b.status) === "pending";
|
|
393
|
-
const status = (campaign == null ? void 0 : campaign.status) || "drafted";
|
|
394
394
|
const touched = updatedAt || (campaign == null ? void 0 : campaign.updatedAt);
|
|
395
395
|
const description = [
|
|
396
|
-
(0,
|
|
397
|
-
(_c = campaign == null ? void 0 : campaign.type) == null ? void 0 : _c.key,
|
|
396
|
+
(0, import_campaign.leadCapture)(campaign),
|
|
398
397
|
tileDate(touched)
|
|
399
398
|
].filter(Boolean).join(" \xB7 ");
|
|
400
399
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -406,7 +405,7 @@ const TileCampaign = ({
|
|
|
406
405
|
generating,
|
|
407
406
|
image: tileImage(page),
|
|
408
407
|
manage: "/organizations/" + organization + "/campaigns/" + (campaign == null ? void 0 : campaign.id),
|
|
409
|
-
percentage: tilePercentage((
|
|
408
|
+
percentage: tilePercentage((_d = (_c = campaign == null ? void 0 : campaign.process) == null ? void 0 : _c.ai) == null ? void 0 : _d.progress),
|
|
410
409
|
// Same asset, same bg-contain-on-bg-green treatment CardTile's own
|
|
411
410
|
// default placeholder above already uses for the API's promo-tile
|
|
412
411
|
// icons — just pointed at drawbridge-api's public/images/. It stands
|
|
@@ -415,8 +414,8 @@ const TileCampaign = ({
|
|
|
415
414
|
// a gallery photo nor a preview image — that case dropped the image
|
|
416
415
|
// slot entirely and left the slide as text against white.
|
|
417
416
|
placeholder: process.env.NEXT_PUBLIC_API_URI + "/images/campaigns.png",
|
|
418
|
-
title: generating ? (
|
|
419
|
-
view: (
|
|
417
|
+
title: generating ? (_e = campaign == null ? void 0 : campaign.source) == null ? void 0 : _e.url : campaign == null ? void 0 : campaign.title,
|
|
418
|
+
view: (_f = page == null ? void 0 : page.share) == null ? void 0 : _f.url
|
|
420
419
|
}
|
|
421
420
|
}
|
|
422
421
|
);
|
|
@@ -8,6 +8,7 @@ import Link from "./link.mjs";
|
|
|
8
8
|
import Button from "../shared/button.mjs";
|
|
9
9
|
import { capitalize, formatDateString } from "@drawbridge/drawbridge-utils";
|
|
10
10
|
import { cdnSrc } from "@drawbridge/drawbridge-utils/cdn";
|
|
11
|
+
import { leadCapture } from "../shared/lib/campaign.mjs";
|
|
11
12
|
const classes = {
|
|
12
13
|
container: [
|
|
13
14
|
"group relative flex w-full h-full p-6 space-x-6 transition duration-200 ease-in xl:aspect-video 2xl:space-x-12"
|
|
@@ -354,13 +355,11 @@ const TileCampaign = ({
|
|
|
354
355
|
page,
|
|
355
356
|
updatedAt
|
|
356
357
|
}) => {
|
|
357
|
-
var _a, _b, _c, _d, _e, _f
|
|
358
|
+
var _a, _b, _c, _d, _e, _f;
|
|
358
359
|
const generating = ((_b = (_a = campaign == null ? void 0 : campaign.process) == null ? void 0 : _a.ai) == null ? void 0 : _b.status) === "pending";
|
|
359
|
-
const status = (campaign == null ? void 0 : campaign.status) || "drafted";
|
|
360
360
|
const touched = updatedAt || (campaign == null ? void 0 : campaign.updatedAt);
|
|
361
361
|
const description = [
|
|
362
|
-
|
|
363
|
-
(_c = campaign == null ? void 0 : campaign.type) == null ? void 0 : _c.key,
|
|
362
|
+
leadCapture(campaign),
|
|
364
363
|
tileDate(touched)
|
|
365
364
|
].filter(Boolean).join(" \xB7 ");
|
|
366
365
|
return /* @__PURE__ */ jsx(
|
|
@@ -372,7 +371,7 @@ const TileCampaign = ({
|
|
|
372
371
|
generating,
|
|
373
372
|
image: tileImage(page),
|
|
374
373
|
manage: "/organizations/" + organization + "/campaigns/" + (campaign == null ? void 0 : campaign.id),
|
|
375
|
-
percentage: tilePercentage((
|
|
374
|
+
percentage: tilePercentage((_d = (_c = campaign == null ? void 0 : campaign.process) == null ? void 0 : _c.ai) == null ? void 0 : _d.progress),
|
|
376
375
|
// Same asset, same bg-contain-on-bg-green treatment CardTile's own
|
|
377
376
|
// default placeholder above already uses for the API's promo-tile
|
|
378
377
|
// icons — just pointed at drawbridge-api's public/images/. It stands
|
|
@@ -381,8 +380,8 @@ const TileCampaign = ({
|
|
|
381
380
|
// a gallery photo nor a preview image — that case dropped the image
|
|
382
381
|
// slot entirely and left the slide as text against white.
|
|
383
382
|
placeholder: process.env.NEXT_PUBLIC_API_URI + "/images/campaigns.png",
|
|
384
|
-
title: generating ? (
|
|
385
|
-
view: (
|
|
383
|
+
title: generating ? (_e = campaign == null ? void 0 : campaign.source) == null ? void 0 : _e.url : campaign == null ? void 0 : campaign.title,
|
|
384
|
+
view: (_f = page == null ? void 0 : page.share) == null ? void 0 : _f.url
|
|
386
385
|
}
|
|
387
386
|
}
|
|
388
387
|
);
|