@drawbridge/components 0.1.47 → 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.js +1 -0
- package/dist/bridge/form-subdomain.mjs +2 -1
- 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/product-tile.js +9 -6
- package/dist/bridge/product-tile.mjs +9 -6
- package/dist/bridge/template-layout.js +237 -122
- package/dist/bridge/template-layout.mjs +237 -122
- package/dist/bridge/template-modal.js +28 -73
- package/dist/bridge/template-modal.mjs +29 -74
- package/dist/dashboard/buttons-subscription.js +1 -1
- package/dist/dashboard/buttons-subscription.mjs +1 -1
- package/dist/dashboard/campaign-form.js +7 -2
- package/dist/dashboard/campaign-form.mjs +7 -2
- 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.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-fields.js +11 -158
- package/dist/dashboard/input-fields.mjs +11 -158
- package/dist/dashboard/input-file.js +21 -4
- package/dist/dashboard/input-file.mjs +21 -4
- package/dist/dashboard/input-gallery.js +201 -0
- package/dist/dashboard/input-gallery.mjs +172 -0
- 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/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/order-sections.js +456 -6
- package/dist/dashboard/order-sections.mjs +453 -7
- package/dist/dashboard/provider-ui.js +9 -7
- package/dist/dashboard/provider-ui.mjs +9 -7
- 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/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/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 +74 -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/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/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.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-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/shipping-rates.d.ts +26 -0
- package/types/dashboard/template-buyer.d.ts +50 -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,110 @@
|
|
|
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
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@drawbridge/components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.48",
|
|
4
4
|
"exports": {
|
|
5
5
|
"./advertisement": {
|
|
6
6
|
"types": "./types/advertisement.d.ts",
|
|
@@ -12,6 +12,11 @@
|
|
|
12
12
|
"import": "./dist/bridge/advertisements.mjs",
|
|
13
13
|
"default": "./dist/bridge/advertisements.js"
|
|
14
14
|
},
|
|
15
|
+
"./bridge/cart-drawer": {
|
|
16
|
+
"types": "./types/bridge/cart-drawer.d.ts",
|
|
17
|
+
"import": "./dist/bridge/cart-drawer.mjs",
|
|
18
|
+
"default": "./dist/bridge/cart-drawer.js"
|
|
19
|
+
},
|
|
15
20
|
"./bridge/countdown": {
|
|
16
21
|
"types": "./types/bridge/countdown.d.ts",
|
|
17
22
|
"import": "./dist/bridge/countdown.mjs",
|
|
@@ -27,6 +32,11 @@
|
|
|
27
32
|
"import": "./dist/bridge/form-subdomain-agreement.mjs",
|
|
28
33
|
"default": "./dist/bridge/form-subdomain-agreement.js"
|
|
29
34
|
},
|
|
35
|
+
"./bridge/form-subdomain-checkout": {
|
|
36
|
+
"types": "./types/bridge/form-subdomain-checkout.d.ts",
|
|
37
|
+
"import": "./dist/bridge/form-subdomain-checkout.mjs",
|
|
38
|
+
"default": "./dist/bridge/form-subdomain-checkout.js"
|
|
39
|
+
},
|
|
30
40
|
"./bridge/form-subdomain-embed": {
|
|
31
41
|
"types": "./types/bridge/form-subdomain-embed.d.ts",
|
|
32
42
|
"import": "./dist/bridge/form-subdomain-embed.mjs",
|
|
@@ -72,6 +82,11 @@
|
|
|
72
82
|
"import": "./dist/bridge/lib/age-gate.mjs",
|
|
73
83
|
"default": "./dist/bridge/lib/age-gate.js"
|
|
74
84
|
},
|
|
85
|
+
"./bridge/lib/cart": {
|
|
86
|
+
"types": "./types/bridge/lib/cart.d.ts",
|
|
87
|
+
"import": "./dist/bridge/lib/cart.mjs",
|
|
88
|
+
"default": "./dist/bridge/lib/cart.js"
|
|
89
|
+
},
|
|
75
90
|
"./bridge/lib/checkout-kit": {
|
|
76
91
|
"types": "./types/bridge/lib/checkout-kit.d.ts",
|
|
77
92
|
"import": "./dist/bridge/lib/checkout-kit.mjs",
|
|
@@ -332,6 +347,11 @@
|
|
|
332
347
|
"import": "./dist/dashboard/dropdown.mjs",
|
|
333
348
|
"default": "./dist/dashboard/dropdown.js"
|
|
334
349
|
},
|
|
350
|
+
"./dashboard/embed-stripe": {
|
|
351
|
+
"types": "./types/dashboard/embed-stripe.d.ts",
|
|
352
|
+
"import": "./dist/dashboard/embed-stripe.mjs",
|
|
353
|
+
"default": "./dist/dashboard/embed-stripe.js"
|
|
354
|
+
},
|
|
335
355
|
"./dashboard/form-action": {
|
|
336
356
|
"types": "./types/dashboard/form-action.d.ts",
|
|
337
357
|
"import": "./dist/dashboard/form-action.mjs",
|
|
@@ -482,6 +502,11 @@
|
|
|
482
502
|
"import": "./dist/dashboard/form-organization-campaign-draw.mjs",
|
|
483
503
|
"default": "./dist/dashboard/form-organization-campaign-draw.js"
|
|
484
504
|
},
|
|
505
|
+
"./dashboard/form-organization-campaign-field-birthday": {
|
|
506
|
+
"types": "./types/dashboard/form-organization-campaign-field-birthday.d.ts",
|
|
507
|
+
"import": "./dist/dashboard/form-organization-campaign-field-birthday.mjs",
|
|
508
|
+
"default": "./dist/dashboard/form-organization-campaign-field-birthday.js"
|
|
509
|
+
},
|
|
485
510
|
"./dashboard/form-organization-campaign-field-email": {
|
|
486
511
|
"types": "./types/dashboard/form-organization-campaign-field-email.d.ts",
|
|
487
512
|
"import": "./dist/dashboard/form-organization-campaign-field-email.mjs",
|
|
@@ -507,6 +532,11 @@
|
|
|
507
532
|
"import": "./dist/dashboard/form-organization-campaign-field-phone.mjs",
|
|
508
533
|
"default": "./dist/dashboard/form-organization-campaign-field-phone.js"
|
|
509
534
|
},
|
|
535
|
+
"./dashboard/form-organization-campaign-field-rating": {
|
|
536
|
+
"types": "./types/dashboard/form-organization-campaign-field-rating.d.ts",
|
|
537
|
+
"import": "./dist/dashboard/form-organization-campaign-field-rating.mjs",
|
|
538
|
+
"default": "./dist/dashboard/form-organization-campaign-field-rating.js"
|
|
539
|
+
},
|
|
510
540
|
"./dashboard/form-organization-campaign-field-remove": {
|
|
511
541
|
"types": "./types/dashboard/form-organization-campaign-field-remove.d.ts",
|
|
512
542
|
"import": "./dist/dashboard/form-organization-campaign-field-remove.mjs",
|
|
@@ -662,6 +692,11 @@
|
|
|
662
692
|
"import": "./dist/dashboard/form-organization-member.mjs",
|
|
663
693
|
"default": "./dist/dashboard/form-organization-member.js"
|
|
664
694
|
},
|
|
695
|
+
"./dashboard/form-organization-product": {
|
|
696
|
+
"types": "./types/dashboard/form-organization-product.d.ts",
|
|
697
|
+
"import": "./dist/dashboard/form-organization-product.mjs",
|
|
698
|
+
"default": "./dist/dashboard/form-organization-product.js"
|
|
699
|
+
},
|
|
665
700
|
"./dashboard/form-organization-segment": {
|
|
666
701
|
"types": "./types/dashboard/form-organization-segment.d.ts",
|
|
667
702
|
"import": "./dist/dashboard/form-organization-segment.mjs",
|
|
@@ -777,6 +812,11 @@
|
|
|
777
812
|
"import": "./dist/dashboard/input-font.mjs",
|
|
778
813
|
"default": "./dist/dashboard/input-font.js"
|
|
779
814
|
},
|
|
815
|
+
"./dashboard/input-gallery": {
|
|
816
|
+
"types": "./types/dashboard/input-gallery.d.ts",
|
|
817
|
+
"import": "./dist/dashboard/input-gallery.mjs",
|
|
818
|
+
"default": "./dist/dashboard/input-gallery.js"
|
|
819
|
+
},
|
|
780
820
|
"./dashboard/input-group-ai": {
|
|
781
821
|
"types": "./types/dashboard/input-group-ai.d.ts",
|
|
782
822
|
"import": "./dist/dashboard/input-group-ai.mjs",
|
|
@@ -877,11 +917,21 @@
|
|
|
877
917
|
"import": "./dist/dashboard/lib/overage.mjs",
|
|
878
918
|
"default": "./dist/dashboard/lib/overage.js"
|
|
879
919
|
},
|
|
920
|
+
"./dashboard/lib/products": {
|
|
921
|
+
"types": "./types/dashboard/lib/products.d.ts",
|
|
922
|
+
"import": "./dist/dashboard/lib/products.mjs",
|
|
923
|
+
"default": "./dist/dashboard/lib/products.js"
|
|
924
|
+
},
|
|
880
925
|
"./dashboard/lib/rail": {
|
|
881
926
|
"types": "./types/dashboard/lib/rail.d.ts",
|
|
882
927
|
"import": "./dist/dashboard/lib/rail.mjs",
|
|
883
928
|
"default": "./dist/dashboard/lib/rail.js"
|
|
884
929
|
},
|
|
930
|
+
"./dashboard/lib/settings-paths": {
|
|
931
|
+
"types": "./types/dashboard/lib/settings-paths.d.ts",
|
|
932
|
+
"import": "./dist/dashboard/lib/settings-paths.mjs",
|
|
933
|
+
"default": "./dist/dashboard/lib/settings-paths.js"
|
|
934
|
+
},
|
|
885
935
|
"./dashboard/lib/sms": {
|
|
886
936
|
"types": "./types/dashboard/lib/sms.d.ts",
|
|
887
937
|
"import": "./dist/dashboard/lib/sms.mjs",
|
|
@@ -1002,6 +1052,11 @@
|
|
|
1002
1052
|
"import": "./dist/dashboard/recharts.mjs",
|
|
1003
1053
|
"default": "./dist/dashboard/recharts.js"
|
|
1004
1054
|
},
|
|
1055
|
+
"./dashboard/shipping-rates": {
|
|
1056
|
+
"types": "./types/dashboard/shipping-rates.d.ts",
|
|
1057
|
+
"import": "./dist/dashboard/shipping-rates.mjs",
|
|
1058
|
+
"default": "./dist/dashboard/shipping-rates.js"
|
|
1059
|
+
},
|
|
1005
1060
|
"./dashboard/steps": {
|
|
1006
1061
|
"types": "./types/dashboard/steps.d.ts",
|
|
1007
1062
|
"import": "./dist/dashboard/steps.mjs",
|
|
@@ -1027,6 +1082,11 @@
|
|
|
1027
1082
|
"import": "./dist/dashboard/table.mjs",
|
|
1028
1083
|
"default": "./dist/dashboard/table.js"
|
|
1029
1084
|
},
|
|
1085
|
+
"./dashboard/template-buyer": {
|
|
1086
|
+
"types": "./types/dashboard/template-buyer.d.ts",
|
|
1087
|
+
"import": "./dist/dashboard/template-buyer.mjs",
|
|
1088
|
+
"default": "./dist/dashboard/template-buyer.js"
|
|
1089
|
+
},
|
|
1030
1090
|
"./dashboard/template-dashboard": {
|
|
1031
1091
|
"types": "./types/dashboard/template-dashboard.d.ts",
|
|
1032
1092
|
"import": "./dist/dashboard/template-dashboard.mjs",
|
|
@@ -1777,6 +1837,11 @@
|
|
|
1777
1837
|
"import": "./dist/shared/loader.mjs",
|
|
1778
1838
|
"default": "./dist/shared/loader.js"
|
|
1779
1839
|
},
|
|
1840
|
+
"./shared/order-summary": {
|
|
1841
|
+
"types": "./types/shared/order-summary.d.ts",
|
|
1842
|
+
"import": "./dist/shared/order-summary.mjs",
|
|
1843
|
+
"default": "./dist/shared/order-summary.js"
|
|
1844
|
+
},
|
|
1780
1845
|
"./shared/overlay": {
|
|
1781
1846
|
"types": "./types/shared/overlay.d.ts",
|
|
1782
1847
|
"import": "./dist/shared/overlay.mjs",
|
|
@@ -1853,6 +1918,7 @@
|
|
|
1853
1918
|
"@hookform/resolvers": ">=3.1.1",
|
|
1854
1919
|
"@sentry/nextjs": ">=10.58.0",
|
|
1855
1920
|
"@shopify/checkout-kit": ">=4.0.0-alpha.4",
|
|
1921
|
+
"@stripe/connect-js": ">=3.5.0",
|
|
1856
1922
|
"@stripe/react-stripe-js": ">=3.9.0",
|
|
1857
1923
|
"@stripe/stripe-js": ">=3.3.0",
|
|
1858
1924
|
"@tanstack/react-query": ">=5.54.1",
|
|
@@ -1896,6 +1962,9 @@
|
|
|
1896
1962
|
"@shopify/checkout-kit": {
|
|
1897
1963
|
"optional": true
|
|
1898
1964
|
},
|
|
1965
|
+
"@stripe/connect-js": {
|
|
1966
|
+
"optional": true
|
|
1967
|
+
},
|
|
1899
1968
|
"@stripe/react-stripe-js": {
|
|
1900
1969
|
"optional": true
|
|
1901
1970
|
},
|
|
@@ -1964,7 +2033,7 @@
|
|
|
1964
2033
|
"@analytics/google-tag-manager": "0.5.5",
|
|
1965
2034
|
"@drawbridge/drawbridge-agents": "0.1.104",
|
|
1966
2035
|
"@drawbridge/drawbridge-telemetry": "0.0.19",
|
|
1967
|
-
"@drawbridge/drawbridge-utils": "0.0.
|
|
2036
|
+
"@drawbridge/drawbridge-utils": "0.0.240",
|
|
1968
2037
|
"@headlessui/react": "2.2.9",
|
|
1969
2038
|
"@hookform/resolvers": "3.1.1",
|
|
1970
2039
|
"@sentry/nextjs": "10.58.0",
|
|
@@ -1972,8 +2041,9 @@
|
|
|
1972
2041
|
"@storybook/addon-docs": "10.6.2",
|
|
1973
2042
|
"@storybook/addon-vitest": "10.6.2",
|
|
1974
2043
|
"@storybook/nextjs-vite": "10.6.2",
|
|
1975
|
-
"@stripe/
|
|
1976
|
-
"@stripe/stripe-js": "
|
|
2044
|
+
"@stripe/connect-js": "3.5.0",
|
|
2045
|
+
"@stripe/react-stripe-js": "7.0.1",
|
|
2046
|
+
"@stripe/stripe-js": "10.2.1",
|
|
1977
2047
|
"@tailwindcss/vite": "4.3.3",
|
|
1978
2048
|
"@tanstack/react-query": "5.54.1",
|
|
1979
2049
|
"@tanstack/react-query-devtools": "5.54.1",
|
|
@@ -0,0 +1,31 @@
|
|
|
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;
|
package/types/bridge/fields.d.ts
CHANGED
|
@@ -27,8 +27,20 @@ export interface FieldProps {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
// A Section asks nothing; a skill testing question is its question with a
|
|
30
|
-
// number input ( Pistachio ).
|
|
31
|
-
|
|
30
|
+
// number input ( Pistachio ). A Birthday field is Month, Day and Year, its
|
|
31
|
+
// answer "1990-05-14" ( Gelato ).
|
|
32
|
+
// Multiple choice ( radio ), Multi-select ( checkbox, answering the ticked
|
|
33
|
+
// options' text ) and Rating ( a number from 1 to attributes.max ).
|
|
34
|
+
export declare const components: Record<'birthday' | 'checkbox' | 'email' | 'name' | 'number' | 'phone' | 'radio' | 'rating' | 'section' | 'select' | 'skill' | 'text' | 'textarea', ComponentType<FieldProps>>;
|
|
35
|
+
|
|
36
|
+
// A Multi-select's ticked options after ticking or unticking `option`, in the
|
|
37
|
+
// field's own order.
|
|
38
|
+
export declare const tick: ( options: Array<{ option?: string }> | undefined, value: unknown, option: string ) => string[];
|
|
39
|
+
|
|
40
|
+
// The Birthday field's boxes into its answer, "1990-05-14" ( '' when all are
|
|
41
|
+
// blank ), and an answer back into the boxes.
|
|
42
|
+
export declare const birthdayValue: ( parts?: { day?: string; month?: string; year?: string } ) => string;
|
|
43
|
+
export declare const birthdayInputs: ( value?: string | null ) => { day: string; month: string; year: string };
|
|
32
44
|
|
|
33
45
|
// The label with " *" after it, unless attributes.required is false.
|
|
34
46
|
export declare const starred: ( field?: Field ) => string | undefined;
|
|
@@ -0,0 +1,20 @@
|
|
|
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;
|
|
@@ -7,6 +7,7 @@ export interface CartLine {
|
|
|
7
7
|
currency?: string;
|
|
8
8
|
id: string;
|
|
9
9
|
image?: string;
|
|
10
|
+
left?: number | null;
|
|
10
11
|
price?: number | string;
|
|
11
12
|
productTitle?: string;
|
|
12
13
|
quantity?: number;
|
|
@@ -27,11 +28,13 @@ export interface FormSubdomainProductProps {
|
|
|
27
28
|
|
|
28
29
|
export interface FormSubdomainCartProps {
|
|
29
30
|
button?: ReactNode;
|
|
30
|
-
cart?: { checkoutUrl?: string; lines?: CartLine[]; [ key: string ]: unknown };
|
|
31
|
-
//
|
|
32
|
-
|
|
31
|
+
cart?: { checkout?: 'shopify' | 'stripe'; checkoutUrl?: string | null; lines?: CartLine[]; [ key: string ]: unknown };
|
|
32
|
+
// The lines checkout cut back to what is left: each reads "Only [n] left".
|
|
33
|
+
cut?: string[];
|
|
33
34
|
onLineRemove?: ( id: string ) => unknown;
|
|
34
35
|
onLineUpdate?: ( id: string, quantity: number ) => unknown;
|
|
36
|
+
// A Recommended row opens its product over the cart.
|
|
37
|
+
onOpenProduct?: ( product: any ) => void;
|
|
35
38
|
onSuccess?: ( response: { result: unknown } ) => void;
|
|
36
39
|
style?: BrandStyle;
|
|
37
40
|
tracking?: Tracking;
|
|
@@ -39,3 +42,24 @@ export interface FormSubdomainCartProps {
|
|
|
39
42
|
|
|
40
43
|
export declare const FormSubdomainProduct: ComponentType<FormSubdomainProductProps>;
|
|
41
44
|
export declare const FormSubdomainCart: ComponentType<FormSubdomainCartProps>;
|
|
45
|
+
|
|
46
|
+
// One item as the cart draws it: a line or a recommended product.
|
|
47
|
+
export interface CartItemProps {
|
|
48
|
+
aside?: ReactNode;
|
|
49
|
+
children?: ReactNode;
|
|
50
|
+
currency?: string | null;
|
|
51
|
+
image?: string | null;
|
|
52
|
+
price?: number | string | null;
|
|
53
|
+
subtitle?: string | null;
|
|
54
|
+
title?: string | null;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export declare const CartItem: ComponentType<CartItemProps>;
|
|
58
|
+
|
|
59
|
+
export interface CartRecommendedProps {
|
|
60
|
+
items?: any[];
|
|
61
|
+
onOpen?: ( product: any ) => void;
|
|
62
|
+
style?: BrandStyle;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export declare const CartRecommended: ComponentType<CartRecommendedProps>;
|
|
@@ -9,3 +9,8 @@ export declare const ageFor: ( year: string | number | null | undefined, current
|
|
|
9
9
|
// Left as `any` — a yup schema is a chain object this package cannot type
|
|
10
10
|
// without the real 'yup' library's types (see ../../shared/lib/yup.d.ts).
|
|
11
11
|
export declare const ageGateSchema: ( values: { min?: number; max?: number } | null | undefined, currentYear?: number ) => any;
|
|
12
|
+
|
|
13
|
+
// @story fields/birthday
|
|
14
|
+
// The form's answers with the age step's date ( "5/14/1990" ) under the
|
|
15
|
+
// Birthday field's id as "1990-05-14", unless it is already answered.
|
|
16
|
+
export declare const ageBirthday: ( fields: { sections?: Array<{ fields?: Array<{ id?: string; slug?: string }> }> } | null | undefined, answers: Record<string, unknown> | undefined, birthday?: string ) => Record<string, unknown>;
|
|
@@ -0,0 +1,44 @@
|
|
|
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;
|
|
@@ -2,26 +2,18 @@
|
|
|
2
2
|
// the server, where both calls refuse or do nothing.
|
|
3
3
|
|
|
4
4
|
export interface CheckoutArgs {
|
|
5
|
-
advertisement?: string;
|
|
6
|
-
affiliate?: string | null;
|
|
7
|
-
campaign?: string;
|
|
8
5
|
checkoutUrl?: string;
|
|
9
|
-
lines?: { merchandiseId: string; quantity: number }[];
|
|
10
6
|
onClose?: () => void;
|
|
11
7
|
onComplete?: ( detail?: unknown ) => void;
|
|
12
8
|
onOpen?: () => void;
|
|
13
9
|
// Same-window fallback when no popup can open; defaults to window.location.assign.
|
|
14
10
|
onRedirect?: ( url: string ) => void;
|
|
15
|
-
organization?: string;
|
|
16
|
-
page?: string;
|
|
17
|
-
slug?: string;
|
|
18
|
-
subdomain?: string;
|
|
19
11
|
[ key: string ]: unknown;
|
|
20
12
|
}
|
|
21
13
|
|
|
22
14
|
// Preloads and registers the element; rejects on the server or if the package fails to load.
|
|
23
15
|
export declare const ensureCheckoutKit: () => Promise<void>;
|
|
24
16
|
|
|
25
|
-
//
|
|
26
|
-
//
|
|
17
|
+
// Opens the store's `checkoutUrl` in a popup, else redirects. Resolves to the
|
|
18
|
+
// checkout url, or null when there is none.
|
|
27
19
|
export declare const checkout: ( args: CheckoutArgs ) => Promise<string | null>;
|
|
@@ -3,6 +3,10 @@ import { Answer, AnswerField } from './answer-rows';
|
|
|
3
3
|
import { CardShortcutFile } from './card-shortcut';
|
|
4
4
|
|
|
5
5
|
export interface CardOrderLine {
|
|
6
|
+
// A digital line: how many times the buyer downloaded it.
|
|
7
|
+
downloads?: number;
|
|
8
|
+
// A digital line's file id; the line then reads its downloads.
|
|
9
|
+
file?: string | null;
|
|
6
10
|
// A form line's item file, or a store line's product image url.
|
|
7
11
|
image?: CardShortcutFile | string | null;
|
|
8
12
|
price?: number;
|
|
@@ -35,6 +39,8 @@ export interface CardOrderProps {
|
|
|
35
39
|
gross?: number;
|
|
36
40
|
lines?: CardOrderLine[];
|
|
37
41
|
net?: number;
|
|
42
|
+
// Resend download on each digital line; emails the buyer their links again.
|
|
43
|
+
onResend?: () => void;
|
|
38
44
|
provider?: CardOrderProvider;
|
|
39
45
|
purchasedAt?: string | number | Date;
|
|
40
46
|
// Fee rate in percent; not shown for a redemption.
|
|
@@ -0,0 +1,25 @@
|
|
|
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,14 +1,21 @@
|
|
|
1
1
|
import { ComponentType } from 'react';
|
|
2
2
|
|
|
3
3
|
export interface FormAdminProviderField {
|
|
4
|
-
|
|
4
|
+
// A select with `hook` is a picker over GET /admin/provider/:slug/hook/:hook
|
|
5
|
+
// that stores the picked item's bare id; a select with `options` is a list.
|
|
6
|
+
hook?: string;
|
|
7
|
+
input: 'text' | 'password' | 'email' | 'select' | 'switch' | string;
|
|
8
|
+
// A dotted path into the nested settings, e.g. 'plans.default.prices.starter'.
|
|
5
9
|
key: string;
|
|
6
10
|
label: string;
|
|
7
11
|
// A stored secret's recognisable mask, e.g. 'kls••••••••9f3a'.
|
|
8
12
|
mask?: string | null;
|
|
9
13
|
message?: string | null;
|
|
14
|
+
options?: { label: string; value: string }[];
|
|
10
15
|
redact?: boolean;
|
|
11
16
|
required?: boolean;
|
|
17
|
+
// false when the vendor cannot search.
|
|
18
|
+
search?: boolean;
|
|
12
19
|
// Whether a value is stored.
|
|
13
20
|
set?: boolean;
|
|
14
21
|
}
|
|
@@ -20,7 +27,7 @@ export interface FormAdminProviderProps {
|
|
|
20
27
|
enabled?: boolean;
|
|
21
28
|
fields?: FormAdminProviderField[];
|
|
22
29
|
live?: boolean;
|
|
23
|
-
//
|
|
30
|
+
// Nested like the stored object; plain fields only, a secret never comes back.
|
|
24
31
|
settings?: Record<string, unknown>;
|
|
25
32
|
slug?: string;
|
|
26
33
|
title?: string;
|
|
@@ -7,7 +7,8 @@ export interface FormFileUploadProps {
|
|
|
7
7
|
// Video ceiling in bytes; defaults to the shared cap the api enforces.
|
|
8
8
|
maximumUploadBytes?: number;
|
|
9
9
|
onSuccess: ( response: unknown ) => void;
|
|
10
|
-
// Which formats are accepted: 'all' | 'media' | 'image' | 'video' | 'application'
|
|
10
|
+
// Which formats are accepted: 'all' | 'media' | 'image' | 'video' | 'application',
|
|
11
|
+
// or 'digital': a product variant's private file, always through multipart.
|
|
11
12
|
type?: string;
|
|
12
13
|
}
|
|
13
14
|
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { ComponentType } from 'react';
|
|
2
2
|
|
|
3
3
|
export interface FormOrganizationCampaignAdvertisementsProps {
|
|
4
|
+
// The campaign's Products and checkout: 'stripe' names the tab Products and
|
|
5
|
+
// lists the products made in Drawbridge.
|
|
6
|
+
checkout?: 'shopify' | 'stripe' | null;
|
|
4
7
|
// The organization's commerce connection, for the Store tab.
|
|
5
8
|
commerce?: { slug?: string; title?: string } | null;
|
|
6
9
|
disabled?: boolean;
|
|
@@ -0,0 +1,31 @@
|
|
|
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;
|