@drawbridge/components 0.1.22 → 0.1.24
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/form-subdomain-embed.js +1 -0
- package/dist/bridge/form-subdomain-embed.mjs +1 -0
- package/dist/bridge/form-subdomain.js +5 -2
- package/dist/bridge/form-subdomain.mjs +5 -2
- package/dist/bridge/template-modal.js +1 -0
- package/dist/bridge/template-modal.mjs +1 -0
- package/dist/dashboard/buttons-subscription.js +8 -2
- package/dist/dashboard/buttons-subscription.mjs +8 -2
- package/dist/dashboard/form-organization-campaign.js +1 -1
- package/dist/dashboard/form-organization-campaign.mjs +1 -1
- package/dist/dashboard/form-organization-identity.js +3 -3
- package/dist/dashboard/form-organization-identity.mjs +3 -3
- package/dist/dashboard/form-organization-workflow.js +7 -5
- package/dist/dashboard/form-organization-workflow.mjs +7 -5
- package/dist/dashboard/form-organization.js +40 -3
- package/dist/dashboard/form-organization.mjs +40 -3
- package/package.json +2 -2
|
@@ -824,7 +824,7 @@ const FormSubdomainSection = ({
|
|
|
824
824
|
const lists = fields.filter((field) => (field == null ? void 0 : field.slug) === "list");
|
|
825
825
|
const prices = ((_a = section == null ? void 0 : section.settings) == null ? void 0 : _a.prices) !== false;
|
|
826
826
|
const currency = ((_b = section == null ? void 0 : section.settings) == null ? void 0 : _b.currency) || "usd";
|
|
827
|
-
const smsConsent = Boolean(last) && (Boolean((_d = (_c = values == null ? void 0 : values.agreements) == null ? void 0 : _c.sms) == null ? void 0 : _d.enabled) || slugs.includes("phone"));
|
|
827
|
+
const smsConsent = Boolean(last) && (values == null ? void 0 : values.sms) !== false && (Boolean((_d = (_c = values == null ? void 0 : values.agreements) == null ? void 0 : _c.sms) == null ? void 0 : _d.enabled) || slugs.includes("phone"));
|
|
828
828
|
const marketingConsent = Boolean(last) && Boolean((_f = (_e = values == null ? void 0 : values.agreements) == null ? void 0 : _e.marketing) == null ? void 0 : _f.enabled);
|
|
829
829
|
const termsConsent = Boolean(last) && Boolean((_h = (_g = values == null ? void 0 : values.agreements) == null ? void 0 : _g.terms) == null ? void 0 : _h.enabled);
|
|
830
830
|
const schema = (0, import_react.useMemo)(
|
|
@@ -1141,6 +1141,8 @@ const FormSubdomain = ({
|
|
|
1141
1141
|
},
|
|
1142
1142
|
params,
|
|
1143
1143
|
preview,
|
|
1144
|
+
// The share payload's `sms` : false while texts are off on the platform.
|
|
1145
|
+
sms,
|
|
1144
1146
|
step: start = 0,
|
|
1145
1147
|
style,
|
|
1146
1148
|
tracking
|
|
@@ -1289,7 +1291,8 @@ const FormSubdomain = ({
|
|
|
1289
1291
|
slugs,
|
|
1290
1292
|
style,
|
|
1291
1293
|
values: {
|
|
1292
|
-
agreements
|
|
1294
|
+
agreements,
|
|
1295
|
+
sms
|
|
1293
1296
|
}
|
|
1294
1297
|
}
|
|
1295
1298
|
},
|
|
@@ -790,7 +790,7 @@ const FormSubdomainSection = ({
|
|
|
790
790
|
const lists = fields.filter((field) => (field == null ? void 0 : field.slug) === "list");
|
|
791
791
|
const prices = ((_a = section == null ? void 0 : section.settings) == null ? void 0 : _a.prices) !== false;
|
|
792
792
|
const currency = ((_b = section == null ? void 0 : section.settings) == null ? void 0 : _b.currency) || "usd";
|
|
793
|
-
const smsConsent = Boolean(last) && (Boolean((_d = (_c = values == null ? void 0 : values.agreements) == null ? void 0 : _c.sms) == null ? void 0 : _d.enabled) || slugs.includes("phone"));
|
|
793
|
+
const smsConsent = Boolean(last) && (values == null ? void 0 : values.sms) !== false && (Boolean((_d = (_c = values == null ? void 0 : values.agreements) == null ? void 0 : _c.sms) == null ? void 0 : _d.enabled) || slugs.includes("phone"));
|
|
794
794
|
const marketingConsent = Boolean(last) && Boolean((_f = (_e = values == null ? void 0 : values.agreements) == null ? void 0 : _e.marketing) == null ? void 0 : _f.enabled);
|
|
795
795
|
const termsConsent = Boolean(last) && Boolean((_h = (_g = values == null ? void 0 : values.agreements) == null ? void 0 : _g.terms) == null ? void 0 : _h.enabled);
|
|
796
796
|
const schema = useMemo(
|
|
@@ -1107,6 +1107,8 @@ const FormSubdomain = ({
|
|
|
1107
1107
|
},
|
|
1108
1108
|
params,
|
|
1109
1109
|
preview,
|
|
1110
|
+
// The share payload's `sms` : false while texts are off on the platform.
|
|
1111
|
+
sms,
|
|
1110
1112
|
step: start = 0,
|
|
1111
1113
|
style,
|
|
1112
1114
|
tracking
|
|
@@ -1255,7 +1257,8 @@ const FormSubdomain = ({
|
|
|
1255
1257
|
slugs,
|
|
1256
1258
|
style,
|
|
1257
1259
|
values: {
|
|
1258
|
-
agreements
|
|
1260
|
+
agreements,
|
|
1261
|
+
sms
|
|
1259
1262
|
}
|
|
1260
1263
|
}
|
|
1261
1264
|
},
|
|
@@ -79,7 +79,7 @@ const SubscriptionBadge = ({
|
|
|
79
79
|
}
|
|
80
80
|
);
|
|
81
81
|
const useSubscriptionActions = (params) => {
|
|
82
|
-
var _a, _b;
|
|
82
|
+
var _a, _b, _c;
|
|
83
83
|
const queryClient = (0, import_react_query.useQueryClient)();
|
|
84
84
|
const query = (0, import_react_query.useQuery)({
|
|
85
85
|
enabled: false,
|
|
@@ -87,6 +87,7 @@ const useSubscriptionActions = (params) => {
|
|
|
87
87
|
});
|
|
88
88
|
const plan = (_a = query == null ? void 0 : query.data) == null ? void 0 : _a.plan;
|
|
89
89
|
const subscription = (_b = query == null ? void 0 : query.data) == null ? void 0 : _b.subscription;
|
|
90
|
+
const smsNumber = (((_c = query == null ? void 0 : query.data) == null ? void 0 : _c.identityItems) || []).find((row) => (row == null ? void 0 : row.type) === "sms");
|
|
90
91
|
const drawer = (0, import_hooks.useDrawer)({
|
|
91
92
|
queryClient
|
|
92
93
|
});
|
|
@@ -197,7 +198,12 @@ const useSubscriptionActions = (params) => {
|
|
|
197
198
|
},
|
|
198
199
|
children: [
|
|
199
200
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "Your subscription will cancel at the end of your current billing period. You'll keep all paid features until then." }),
|
|
200
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "After it cancels, your campaigns, pages, brands and prizes will be drafted, and your workflows will be paused. They won't be deleted, but you'll need to reactivate each one if you re-subscribe." })
|
|
201
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "After it cancels, your campaigns, pages, brands and prizes will be drafted, and your workflows will be paused. They won't be deleted, but you'll need to reactivate each one if you re-subscribe." }),
|
|
202
|
+
smsNumber && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { children: [
|
|
203
|
+
"Your SMS number, ",
|
|
204
|
+
smsNumber.number,
|
|
205
|
+
", is released when it cancels and may be assigned to someone else."
|
|
206
|
+
] })
|
|
201
207
|
]
|
|
202
208
|
}
|
|
203
209
|
),
|
|
@@ -44,7 +44,7 @@ const SubscriptionBadge = ({
|
|
|
44
44
|
}
|
|
45
45
|
);
|
|
46
46
|
const useSubscriptionActions = (params) => {
|
|
47
|
-
var _a, _b;
|
|
47
|
+
var _a, _b, _c;
|
|
48
48
|
const queryClient = useQueryClient();
|
|
49
49
|
const query = useQuery({
|
|
50
50
|
enabled: false,
|
|
@@ -52,6 +52,7 @@ const useSubscriptionActions = (params) => {
|
|
|
52
52
|
});
|
|
53
53
|
const plan = (_a = query == null ? void 0 : query.data) == null ? void 0 : _a.plan;
|
|
54
54
|
const subscription = (_b = query == null ? void 0 : query.data) == null ? void 0 : _b.subscription;
|
|
55
|
+
const smsNumber = (((_c = query == null ? void 0 : query.data) == null ? void 0 : _c.identityItems) || []).find((row) => (row == null ? void 0 : row.type) === "sms");
|
|
55
56
|
const drawer = useDrawer({
|
|
56
57
|
queryClient
|
|
57
58
|
});
|
|
@@ -162,7 +163,12 @@ const useSubscriptionActions = (params) => {
|
|
|
162
163
|
},
|
|
163
164
|
children: [
|
|
164
165
|
/* @__PURE__ */ jsx("p", { children: "Your subscription will cancel at the end of your current billing period. You'll keep all paid features until then." }),
|
|
165
|
-
/* @__PURE__ */ jsx("p", { children: "After it cancels, your campaigns, pages, brands and prizes will be drafted, and your workflows will be paused. They won't be deleted, but you'll need to reactivate each one if you re-subscribe." })
|
|
166
|
+
/* @__PURE__ */ jsx("p", { children: "After it cancels, your campaigns, pages, brands and prizes will be drafted, and your workflows will be paused. They won't be deleted, but you'll need to reactivate each one if you re-subscribe." }),
|
|
167
|
+
smsNumber && /* @__PURE__ */ jsxs("p", { children: [
|
|
168
|
+
"Your SMS number, ",
|
|
169
|
+
smsNumber.number,
|
|
170
|
+
", is released when it cancels and may be assigned to someone else."
|
|
171
|
+
] })
|
|
166
172
|
]
|
|
167
173
|
}
|
|
168
174
|
),
|
|
@@ -471,7 +471,7 @@ const FormOrganizationCampaignNotifications = ({
|
|
|
471
471
|
...{
|
|
472
472
|
className: "text-sm"
|
|
473
473
|
},
|
|
474
|
-
children: "This content is sent
|
|
474
|
+
children: "This content is sent to the winner of every draw, manual or automated."
|
|
475
475
|
}
|
|
476
476
|
),
|
|
477
477
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -434,7 +434,7 @@ const FormOrganizationCampaignNotifications = ({
|
|
|
434
434
|
...{
|
|
435
435
|
className: "text-sm"
|
|
436
436
|
},
|
|
437
|
-
children: "This content is sent
|
|
437
|
+
children: "This content is sent to the winner of every draw, manual or automated."
|
|
438
438
|
}
|
|
439
439
|
),
|
|
440
440
|
/* @__PURE__ */ jsx(
|
|
@@ -37,7 +37,6 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
37
37
|
var import_react = require("react");
|
|
38
38
|
var import_form = require("../shared/lib/form");
|
|
39
39
|
var import_yup = __toESM(require("../shared/lib/yup"));
|
|
40
|
-
var import_drawbridge_utils = require("@drawbridge/drawbridge-utils");
|
|
41
40
|
var import_domains = require("@drawbridge/drawbridge-utils/domains");
|
|
42
41
|
var import_fetch = require("@drawbridge/drawbridge-utils/fetch");
|
|
43
42
|
var import_list_resource = __toESM(require("./list-resource"));
|
|
@@ -284,8 +283,9 @@ const FormOrganizationIdentitySms = ({
|
|
|
284
283
|
import_card_task.default,
|
|
285
284
|
{
|
|
286
285
|
...{
|
|
287
|
-
|
|
288
|
-
|
|
286
|
+
// @story billing/number-charge
|
|
287
|
+
// The number is in the plan's price (Darren, 2026-11-10).
|
|
288
|
+
message: "Your plan includes this number. Texts you send bill as actions."
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
291
|
),
|
|
@@ -3,7 +3,6 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { Fragment, useState } from "react";
|
|
4
4
|
import { useForm, Controller } from "../shared/lib/form.mjs";
|
|
5
5
|
import yup, { resolver } from "../shared/lib/yup.mjs";
|
|
6
|
-
import { formatCurrency } from "@drawbridge/drawbridge-utils";
|
|
7
6
|
import { normalizeDomain } from "@drawbridge/drawbridge-utils/domains";
|
|
8
7
|
import { request } from "@drawbridge/drawbridge-utils/fetch";
|
|
9
8
|
import ListResource from "./list-resource.mjs";
|
|
@@ -250,8 +249,9 @@ const FormOrganizationIdentitySms = ({
|
|
|
250
249
|
CardTask,
|
|
251
250
|
{
|
|
252
251
|
...{
|
|
253
|
-
|
|
254
|
-
|
|
252
|
+
// @story billing/number-charge
|
|
253
|
+
// The number is in the plan's price (Darren, 2026-11-10).
|
|
254
|
+
message: "Your plan includes this number. Texts you send bill as actions."
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
257
|
),
|
|
@@ -213,8 +213,9 @@ const responseParts = ({ autoResponse, campaign, organization, settings }) => {
|
|
|
213
213
|
message: "Texts need an SMS number."
|
|
214
214
|
};
|
|
215
215
|
};
|
|
216
|
+
const texts = (autoResponse == null ? void 0 : autoResponse.texts) !== false;
|
|
216
217
|
const emailCan = Boolean(fields == null ? void 0 : fields.email);
|
|
217
|
-
const smsCan = Boolean(fields == null ? void 0 : fields.phone) && number === "verified";
|
|
218
|
+
const smsCan = texts && Boolean(fields == null ? void 0 : fields.phone) && number === "verified";
|
|
218
219
|
return {
|
|
219
220
|
can: emailCan || smsCan,
|
|
220
221
|
email: {
|
|
@@ -227,10 +228,11 @@ const responseParts = ({ autoResponse, campaign, organization, settings }) => {
|
|
|
227
228
|
}
|
|
228
229
|
},
|
|
229
230
|
sms: {
|
|
231
|
+
absent: !texts,
|
|
230
232
|
can: smsCan,
|
|
231
|
-
hidden: !(fields == null ? void 0 : fields.phone),
|
|
233
|
+
hidden: !texts || !(fields == null ? void 0 : fields.phone),
|
|
232
234
|
on: smsCan && ((_b = settings == null ? void 0 : settings.sms) == null ? void 0 : _b.enabled) === true,
|
|
233
|
-
task: (fields == null ? void 0 : fields.phone) ? numberTask() : {
|
|
235
|
+
task: !texts ? null : (fields == null ? void 0 : fields.phone) ? numberTask() : {
|
|
234
236
|
button: addField,
|
|
235
237
|
message: "Texts need a Phone field on the form."
|
|
236
238
|
}
|
|
@@ -590,7 +592,7 @@ const ResponseStepCard = ({
|
|
|
590
592
|
const [picked, setPicked] = (0, import_react.useState)("email");
|
|
591
593
|
const name = `steps.${index}`;
|
|
592
594
|
const parts = responseParts({ autoResponse, campaign, organization, settings });
|
|
593
|
-
const shown = parts.email.hidden ? "sms" : parts.sms.hidden ? "email" : picked;
|
|
595
|
+
const shown = parts.sms.absent ? "email" : parts.email.hidden ? "sms" : parts.sms.hidden ? "email" : picked;
|
|
594
596
|
const placeholders = autoResponse == null ? void 0 : autoResponse.placeholders;
|
|
595
597
|
const preview = useEmailPreview({
|
|
596
598
|
campaign,
|
|
@@ -712,7 +714,7 @@ const ResponseStepCard = ({
|
|
|
712
714
|
]
|
|
713
715
|
}
|
|
714
716
|
),
|
|
715
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
717
|
+
!parts.sms.absent && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
716
718
|
"div",
|
|
717
719
|
{
|
|
718
720
|
...{
|
|
@@ -161,8 +161,9 @@ const responseParts = ({ autoResponse, campaign, organization, settings }) => {
|
|
|
161
161
|
message: "Texts need an SMS number."
|
|
162
162
|
};
|
|
163
163
|
};
|
|
164
|
+
const texts = (autoResponse == null ? void 0 : autoResponse.texts) !== false;
|
|
164
165
|
const emailCan = Boolean(fields == null ? void 0 : fields.email);
|
|
165
|
-
const smsCan = Boolean(fields == null ? void 0 : fields.phone) && number === "verified";
|
|
166
|
+
const smsCan = texts && Boolean(fields == null ? void 0 : fields.phone) && number === "verified";
|
|
166
167
|
return {
|
|
167
168
|
can: emailCan || smsCan,
|
|
168
169
|
email: {
|
|
@@ -175,10 +176,11 @@ const responseParts = ({ autoResponse, campaign, organization, settings }) => {
|
|
|
175
176
|
}
|
|
176
177
|
},
|
|
177
178
|
sms: {
|
|
179
|
+
absent: !texts,
|
|
178
180
|
can: smsCan,
|
|
179
|
-
hidden: !(fields == null ? void 0 : fields.phone),
|
|
181
|
+
hidden: !texts || !(fields == null ? void 0 : fields.phone),
|
|
180
182
|
on: smsCan && ((_b = settings == null ? void 0 : settings.sms) == null ? void 0 : _b.enabled) === true,
|
|
181
|
-
task: (fields == null ? void 0 : fields.phone) ? numberTask() : {
|
|
183
|
+
task: !texts ? null : (fields == null ? void 0 : fields.phone) ? numberTask() : {
|
|
182
184
|
button: addField,
|
|
183
185
|
message: "Texts need a Phone field on the form."
|
|
184
186
|
}
|
|
@@ -538,7 +540,7 @@ const ResponseStepCard = ({
|
|
|
538
540
|
const [picked, setPicked] = useState("email");
|
|
539
541
|
const name = `steps.${index}`;
|
|
540
542
|
const parts = responseParts({ autoResponse, campaign, organization, settings });
|
|
541
|
-
const shown = parts.email.hidden ? "sms" : parts.sms.hidden ? "email" : picked;
|
|
543
|
+
const shown = parts.sms.absent ? "email" : parts.email.hidden ? "sms" : parts.sms.hidden ? "email" : picked;
|
|
542
544
|
const placeholders = autoResponse == null ? void 0 : autoResponse.placeholders;
|
|
543
545
|
const preview = useEmailPreview({
|
|
544
546
|
campaign,
|
|
@@ -660,7 +662,7 @@ const ResponseStepCard = ({
|
|
|
660
662
|
]
|
|
661
663
|
}
|
|
662
664
|
),
|
|
663
|
-
/* @__PURE__ */ jsxs(
|
|
665
|
+
!parts.sms.absent && /* @__PURE__ */ jsxs(
|
|
664
666
|
"div",
|
|
665
667
|
{
|
|
666
668
|
...{
|
|
@@ -45,6 +45,7 @@ var import_drawbridge_utils = require("@drawbridge/drawbridge-utils");
|
|
|
45
45
|
var import_form2 = __toESM(require("../shared/form"));
|
|
46
46
|
var import_fieldset = __toESM(require("../shared/fieldset"));
|
|
47
47
|
var import_input_group = __toESM(require("../input-group"));
|
|
48
|
+
var import_input_select = __toESM(require("../input-select"));
|
|
48
49
|
var import_input_text = __toESM(require("../input-text"));
|
|
49
50
|
var import_input_url = __toESM(require("../shared/input-url"));
|
|
50
51
|
var import_input_checkbox = __toESM(require("../input-checkbox"));
|
|
@@ -367,6 +368,39 @@ const business = {
|
|
|
367
368
|
message: "Your legal or trading name. We submit verifications under it.",
|
|
368
369
|
schema: import_yup.default.string().label("Legal business name").required().max(150)
|
|
369
370
|
},
|
|
371
|
+
// @story organizations/settings
|
|
372
|
+
// Carrier verification asks for both since 2026-11-10. `types` is utils
|
|
373
|
+
// business.js businessTypes, handed in by the dashboard so this package
|
|
374
|
+
// reads no list of its own.
|
|
375
|
+
registration: {
|
|
376
|
+
input: ({ onChange, value }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
377
|
+
import_input_text.default,
|
|
378
|
+
{
|
|
379
|
+
...{
|
|
380
|
+
onChange,
|
|
381
|
+
placeholder: "123456789",
|
|
382
|
+
value: value || ""
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
),
|
|
386
|
+
label: "Registration number",
|
|
387
|
+
message: "Your EIN in the US, or your Business Number in Canada.",
|
|
388
|
+
schema: import_yup.default.string().label("Registration number").trim().required().max(64)
|
|
389
|
+
},
|
|
390
|
+
type: {
|
|
391
|
+
input: ({ onChange, types = {}, value }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
392
|
+
import_input_select.default,
|
|
393
|
+
{
|
|
394
|
+
...{
|
|
395
|
+
onChange,
|
|
396
|
+
options: Object.entries(types).map(([option, label]) => ({ label, option })),
|
|
397
|
+
value: value || ""
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
),
|
|
401
|
+
label: "Business type",
|
|
402
|
+
schema: import_yup.default.string().label("Business type").required()
|
|
403
|
+
},
|
|
370
404
|
website: {
|
|
371
405
|
input: ({ onChange, value }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
372
406
|
import_input_url.default,
|
|
@@ -379,7 +413,8 @@ const business = {
|
|
|
379
413
|
}
|
|
380
414
|
),
|
|
381
415
|
label: "Website",
|
|
382
|
-
|
|
416
|
+
// Texts off ( `texts` false ): no SMS number to verify against it.
|
|
417
|
+
message: (texts) => texts === false ? "Your sending domain is its domain." : "We verify your SMS number against it. Your sending domain is its domain.",
|
|
383
418
|
schema: import_yup.default.string().label("Website").max(2048).matches(import_drawbridge_utils.regex.url, "Website must start with https").required().url()
|
|
384
419
|
}
|
|
385
420
|
};
|
|
@@ -388,6 +423,8 @@ const FormOrganizationBusinessField = ({
|
|
|
388
423
|
onError,
|
|
389
424
|
onSuccess,
|
|
390
425
|
owner,
|
|
426
|
+
texts,
|
|
427
|
+
types,
|
|
391
428
|
values
|
|
392
429
|
}) => {
|
|
393
430
|
var _a;
|
|
@@ -441,9 +478,9 @@ const FormOrganizationBusinessField = ({
|
|
|
441
478
|
{
|
|
442
479
|
...{
|
|
443
480
|
error: (_b = (_a2 = formState == null ? void 0 : formState.errors) == null ? void 0 : _a2[name]) == null ? void 0 : _b.message,
|
|
444
|
-
input: field.input({ onChange, value }),
|
|
481
|
+
input: field.input({ onChange, types, value }),
|
|
445
482
|
label: field.label,
|
|
446
|
-
message: field.message
|
|
483
|
+
message: typeof field.message === "function" ? field.message(texts) : field.message
|
|
447
484
|
}
|
|
448
485
|
}
|
|
449
486
|
);
|
|
@@ -8,6 +8,7 @@ import { regex } from "@drawbridge/drawbridge-utils";
|
|
|
8
8
|
import Form from "../shared/form.mjs";
|
|
9
9
|
import Fieldset from "../shared/fieldset.mjs";
|
|
10
10
|
import InputGroup from "../input-group.mjs";
|
|
11
|
+
import InputSelect from "../input-select.mjs";
|
|
11
12
|
import InputText from "../input-text.mjs";
|
|
12
13
|
import InputUrl from "../shared/input-url.mjs";
|
|
13
14
|
import InputCheckbox from "../input-checkbox.mjs";
|
|
@@ -330,6 +331,39 @@ const business = {
|
|
|
330
331
|
message: "Your legal or trading name. We submit verifications under it.",
|
|
331
332
|
schema: yup.string().label("Legal business name").required().max(150)
|
|
332
333
|
},
|
|
334
|
+
// @story organizations/settings
|
|
335
|
+
// Carrier verification asks for both since 2026-11-10. `types` is utils
|
|
336
|
+
// business.js businessTypes, handed in by the dashboard so this package
|
|
337
|
+
// reads no list of its own.
|
|
338
|
+
registration: {
|
|
339
|
+
input: ({ onChange, value }) => /* @__PURE__ */ jsx(
|
|
340
|
+
InputText,
|
|
341
|
+
{
|
|
342
|
+
...{
|
|
343
|
+
onChange,
|
|
344
|
+
placeholder: "123456789",
|
|
345
|
+
value: value || ""
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
),
|
|
349
|
+
label: "Registration number",
|
|
350
|
+
message: "Your EIN in the US, or your Business Number in Canada.",
|
|
351
|
+
schema: yup.string().label("Registration number").trim().required().max(64)
|
|
352
|
+
},
|
|
353
|
+
type: {
|
|
354
|
+
input: ({ onChange, types = {}, value }) => /* @__PURE__ */ jsx(
|
|
355
|
+
InputSelect,
|
|
356
|
+
{
|
|
357
|
+
...{
|
|
358
|
+
onChange,
|
|
359
|
+
options: Object.entries(types).map(([option, label]) => ({ label, option })),
|
|
360
|
+
value: value || ""
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
),
|
|
364
|
+
label: "Business type",
|
|
365
|
+
schema: yup.string().label("Business type").required()
|
|
366
|
+
},
|
|
333
367
|
website: {
|
|
334
368
|
input: ({ onChange, value }) => /* @__PURE__ */ jsx(
|
|
335
369
|
InputUrl,
|
|
@@ -342,7 +376,8 @@ const business = {
|
|
|
342
376
|
}
|
|
343
377
|
),
|
|
344
378
|
label: "Website",
|
|
345
|
-
|
|
379
|
+
// Texts off ( `texts` false ): no SMS number to verify against it.
|
|
380
|
+
message: (texts) => texts === false ? "Your sending domain is its domain." : "We verify your SMS number against it. Your sending domain is its domain.",
|
|
346
381
|
schema: yup.string().label("Website").max(2048).matches(regex.url, "Website must start with https").required().url()
|
|
347
382
|
}
|
|
348
383
|
};
|
|
@@ -351,6 +386,8 @@ const FormOrganizationBusinessField = ({
|
|
|
351
386
|
onError,
|
|
352
387
|
onSuccess,
|
|
353
388
|
owner,
|
|
389
|
+
texts,
|
|
390
|
+
types,
|
|
354
391
|
values
|
|
355
392
|
}) => {
|
|
356
393
|
var _a;
|
|
@@ -404,9 +441,9 @@ const FormOrganizationBusinessField = ({
|
|
|
404
441
|
{
|
|
405
442
|
...{
|
|
406
443
|
error: (_b = (_a2 = formState == null ? void 0 : formState.errors) == null ? void 0 : _a2[name]) == null ? void 0 : _b.message,
|
|
407
|
-
input: field.input({ onChange, value }),
|
|
444
|
+
input: field.input({ onChange, types, value }),
|
|
408
445
|
label: field.label,
|
|
409
|
-
message: field.message
|
|
446
|
+
message: typeof field.message === "function" ? field.message(texts) : field.message
|
|
410
447
|
}
|
|
411
448
|
}
|
|
412
449
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@drawbridge/components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.24",
|
|
4
4
|
"exports": {
|
|
5
5
|
"./advertisement": {
|
|
6
6
|
"types": "./types/advertisement.d.ts",
|
|
@@ -1783,7 +1783,7 @@
|
|
|
1783
1783
|
"@analytics/google-tag-manager": "0.5.5",
|
|
1784
1784
|
"@drawbridge/drawbridge-agents": "0.1.102",
|
|
1785
1785
|
"@drawbridge/drawbridge-telemetry": "0.0.19",
|
|
1786
|
-
"@drawbridge/drawbridge-utils": "0.0.
|
|
1786
|
+
"@drawbridge/drawbridge-utils": "0.0.232",
|
|
1787
1787
|
"@headlessui/react": "2.2.9",
|
|
1788
1788
|
"@hookform/resolvers": "3.1.1",
|
|
1789
1789
|
"@sentry/nextjs": "10.58.0",
|