@drawbridge/components 0.1.23 → 0.1.25

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 (81) hide show
  1. package/dist/bridge/form-subdomain-embed.js +1 -0
  2. package/dist/bridge/form-subdomain-embed.mjs +1 -0
  3. package/dist/bridge/form-subdomain.js +5 -2
  4. package/dist/bridge/form-subdomain.mjs +5 -2
  5. package/dist/bridge/template-modal.js +2 -2
  6. package/dist/bridge/template-modal.mjs +2 -2
  7. package/dist/dashboard/buttons-subscription.js +27 -66
  8. package/dist/dashboard/buttons-subscription.mjs +27 -65
  9. package/dist/dashboard/card-payment-method.js +1 -1
  10. package/dist/dashboard/card-payment-method.mjs +1 -1
  11. package/dist/dashboard/card-section.js +2 -2
  12. package/dist/dashboard/card-section.mjs +2 -2
  13. package/dist/dashboard/card-setting.js +3 -4
  14. package/dist/dashboard/card-setting.mjs +3 -4
  15. package/dist/dashboard/card-task.js +4 -22
  16. package/dist/dashboard/card-task.mjs +4 -22
  17. package/dist/dashboard/card-tile.js +6 -6
  18. package/dist/dashboard/card-tile.mjs +6 -6
  19. package/dist/dashboard/drawer.js +2 -7
  20. package/dist/dashboard/drawer.mjs +3 -8
  21. package/dist/dashboard/form-organization-campaign-integration-gtm.js +6 -5
  22. package/dist/dashboard/form-organization-campaign-integration-gtm.mjs +6 -5
  23. package/dist/dashboard/form-organization-campaign.js +1 -1
  24. package/dist/dashboard/form-organization-campaign.mjs +1 -1
  25. package/dist/dashboard/form-organization-identity.js +3 -3
  26. package/dist/dashboard/form-organization-identity.mjs +3 -3
  27. package/dist/dashboard/form-organization-workflow.js +9 -7
  28. package/dist/dashboard/form-organization-workflow.mjs +9 -7
  29. package/dist/dashboard/form-organization.js +40 -3
  30. package/dist/dashboard/form-organization.mjs +40 -3
  31. package/dist/dashboard/guide.js +238 -0
  32. package/dist/dashboard/guide.mjs +209 -0
  33. package/dist/dashboard/input-combobox.js +2 -7
  34. package/dist/dashboard/input-combobox.mjs +2 -7
  35. package/dist/dashboard/list.js +1 -1
  36. package/dist/dashboard/list.mjs +1 -1
  37. package/dist/dashboard/menu.js +96 -188
  38. package/dist/dashboard/menu.mjs +97 -189
  39. package/dist/dashboard/modal.js +3 -9
  40. package/dist/dashboard/modal.mjs +4 -10
  41. package/dist/dashboard/notice.js +3 -5
  42. package/dist/dashboard/notice.mjs +3 -5
  43. package/dist/dashboard/table-cell-title.js +0 -2
  44. package/dist/dashboard/table-cell-title.mjs +0 -2
  45. package/dist/dashboard/table.js +20 -61
  46. package/dist/dashboard/table.mjs +20 -61
  47. package/dist/dashboard/template-dashboard.js +133 -35
  48. package/dist/dashboard/template-dashboard.mjs +134 -36
  49. package/dist/dashboard/template-socket.js +3 -19
  50. package/dist/dashboard/template-socket.mjs +3 -19
  51. package/dist/dashboard/template-ui.js +186 -150
  52. package/dist/dashboard/template-ui.mjs +187 -151
  53. package/dist/shared/lib/helpers.js +2 -9
  54. package/dist/shared/lib/helpers.mjs +2 -9
  55. package/dist/shared/overlay.js +3 -5
  56. package/dist/shared/overlay.mjs +3 -5
  57. package/package.json +13 -28
  58. package/types/dashboard/card-task.d.ts +1 -5
  59. package/types/dashboard/guide.d.ts +23 -0
  60. package/types/dashboard/table.d.ts +1 -3
  61. package/types/dashboard/template-dashboard.d.ts +1 -4
  62. package/types/dashboard/template-ui.d.ts +2 -2
  63. package/dist/dashboard/lib/escape.js +0 -48
  64. package/dist/dashboard/lib/escape.mjs +0 -25
  65. package/dist/dashboard/lib/rail.js +0 -75
  66. package/dist/dashboard/lib/rail.mjs +0 -46
  67. package/dist/dashboard/lib/throttle.js +0 -57
  68. package/dist/dashboard/lib/throttle.mjs +0 -34
  69. package/dist/dashboard/template-rail.js +0 -674
  70. package/dist/dashboard/template-rail.mjs +0 -640
  71. package/dist/icons/book-open.js +0 -46
  72. package/dist/icons/book-open.mjs +0 -27
  73. package/dist/icons/task.js +0 -46
  74. package/dist/icons/task.mjs +0 -27
  75. package/dist/shared/lib/motion.js +0 -27
  76. package/dist/shared/lib/motion.mjs +0 -4
  77. package/types/dashboard/lib/rail.d.ts +0 -32
  78. package/types/dashboard/lib/throttle.d.ts +0 -5
  79. package/types/dashboard/template-rail.d.ts +0 -36
  80. package/types/icons/book-open.d.ts +0 -5
  81. package/types/icons/task.d.ts +0 -5
@@ -45,14 +45,14 @@ var import_cdn = require("@drawbridge/drawbridge-utils/cdn");
45
45
  var import_campaign = require("../shared/lib/campaign");
46
46
  const classes = {
47
47
  container: [
48
- "group relative flex w-full h-full p-6 space-x-6 transition duration-200 ease-in @[976px]:aspect-video @[1180px]:space-x-12"
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"
49
49
  ],
50
50
  button: [
51
51
  "text-sm flex items-center space-x-2 md:text-base"
52
52
  ],
53
53
  content: [
54
54
  "relative z-10 flex flex-col justify-center",
55
- "space-y-1 w-full h-full @[976px]:space-y-3",
55
+ "space-y-1 w-full h-full xl:space-y-3",
56
56
  "items-start text-left"
57
57
  ],
58
58
  description: [
@@ -69,11 +69,11 @@ const classes = {
69
69
  "block w-full h-full bg-cover bg-center bg-no-repeat shrink-0 rounded"
70
70
  ],
71
71
  outer: [
72
- "aspect-square @[976px]:aspect-[2/3] shrink-0"
72
+ "aspect-square xl:aspect-[2/3] shrink-0"
73
73
  ]
74
74
  },
75
75
  title: [
76
- "text-lg @[976px]:text-2xl"
76
+ "text-lg xl:text-2xl"
77
77
  ],
78
78
  wrapper: [
79
79
  "flex-[0_0_100%]"
@@ -413,7 +413,7 @@ const TileCampaign = ({
413
413
  // generating, and for a finished campaign whose page carries neither
414
414
  // a gallery photo nor a preview image — that case dropped the image
415
415
  // slot entirely and left the slide as text against white.
416
- placeholder: process.env.NEXT_PUBLIC_API_URI + "/images/campaigns.svg",
416
+ placeholder: process.env.NEXT_PUBLIC_API_URI + "/images/campaigns.png",
417
417
  title: generating ? (_e = campaign == null ? void 0 : campaign.source) == null ? void 0 : _e.url : campaign == null ? void 0 : campaign.title,
418
418
  view: (_f = page == null ? void 0 : page.share) == null ? void 0 : _f.url
419
419
  }
@@ -442,7 +442,7 @@ const TilePage = ({
442
442
  image: tileImage(page),
443
443
  manage: "/organizations/" + organization + "/campaigns/" + campaign + "/pages/" + (page == null ? void 0 : page.id),
444
444
  percentage: tilePercentage((_d = (_c = page == null ? void 0 : page.process) == null ? void 0 : _c.ai) == null ? void 0 : _d.progress),
445
- placeholder: process.env.NEXT_PUBLIC_API_URI + "/images/pages.svg",
445
+ placeholder: process.env.NEXT_PUBLIC_API_URI + "/images/pages.png",
446
446
  // A generating page has no title of its own yet — the pages list
447
447
  // falls back to the scraped url the same way.
448
448
  title: generating ? (_e = page == null ? void 0 : page.source) == null ? void 0 : _e.url : page == null ? void 0 : page.title,
@@ -11,14 +11,14 @@ import { cdnSrc } from "@drawbridge/drawbridge-utils/cdn";
11
11
  import { leadCapture } from "../shared/lib/campaign.mjs";
12
12
  const classes = {
13
13
  container: [
14
- "group relative flex w-full h-full p-6 space-x-6 transition duration-200 ease-in @[976px]:aspect-video @[1180px]:space-x-12"
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"
15
15
  ],
16
16
  button: [
17
17
  "text-sm flex items-center space-x-2 md:text-base"
18
18
  ],
19
19
  content: [
20
20
  "relative z-10 flex flex-col justify-center",
21
- "space-y-1 w-full h-full @[976px]:space-y-3",
21
+ "space-y-1 w-full h-full xl:space-y-3",
22
22
  "items-start text-left"
23
23
  ],
24
24
  description: [
@@ -35,11 +35,11 @@ const classes = {
35
35
  "block w-full h-full bg-cover bg-center bg-no-repeat shrink-0 rounded"
36
36
  ],
37
37
  outer: [
38
- "aspect-square @[976px]:aspect-[2/3] shrink-0"
38
+ "aspect-square xl:aspect-[2/3] shrink-0"
39
39
  ]
40
40
  },
41
41
  title: [
42
- "text-lg @[976px]:text-2xl"
42
+ "text-lg xl:text-2xl"
43
43
  ],
44
44
  wrapper: [
45
45
  "flex-[0_0_100%]"
@@ -379,7 +379,7 @@ const TileCampaign = ({
379
379
  // generating, and for a finished campaign whose page carries neither
380
380
  // a gallery photo nor a preview image — that case dropped the image
381
381
  // slot entirely and left the slide as text against white.
382
- placeholder: process.env.NEXT_PUBLIC_API_URI + "/images/campaigns.svg",
382
+ placeholder: process.env.NEXT_PUBLIC_API_URI + "/images/campaigns.png",
383
383
  title: generating ? (_e = campaign == null ? void 0 : campaign.source) == null ? void 0 : _e.url : campaign == null ? void 0 : campaign.title,
384
384
  view: (_f = page == null ? void 0 : page.share) == null ? void 0 : _f.url
385
385
  }
@@ -408,7 +408,7 @@ const TilePage = ({
408
408
  image: tileImage(page),
409
409
  manage: "/organizations/" + organization + "/campaigns/" + campaign + "/pages/" + (page == null ? void 0 : page.id),
410
410
  percentage: tilePercentage((_d = (_c = page == null ? void 0 : page.process) == null ? void 0 : _c.ai) == null ? void 0 : _d.progress),
411
- placeholder: process.env.NEXT_PUBLIC_API_URI + "/images/pages.svg",
411
+ placeholder: process.env.NEXT_PUBLIC_API_URI + "/images/pages.png",
412
412
  // A generating page has no title of its own yet — the pages list
413
413
  // falls back to the scraped url the same way.
414
414
  title: generating ? (_e = page == null ? void 0 : page.source) == null ? void 0 : _e.url : page == null ? void 0 : page.title,
@@ -33,8 +33,6 @@ module.exports = __toCommonJS(drawer_exports);
33
33
  var import_jsx_runtime = require("react/jsx-runtime");
34
34
  var import_react = require("react");
35
35
  var import_react2 = require("@headlessui/react");
36
- var import_escape = require("./lib/escape");
37
- var import_motion = require("../shared/lib/motion");
38
36
  var import_times = __toESM(require("../icons/times"));
39
37
  var import_button = __toESM(require("../shared/button"));
40
38
  var import_form = require("../shared/lib/form");
@@ -48,8 +46,6 @@ const Drawer = ({
48
46
  overlay = true,
49
47
  title
50
48
  }) => {
51
- const close = (0, import_react.useRef)(null);
52
- (0, import_escape.useEscape)(active, close);
53
49
  const classes = {
54
50
  drawer: [
55
51
  className,
@@ -58,9 +54,9 @@ const Drawer = ({
58
54
  // Enter slides in immediately (no delay): the panel used to wait
59
55
  // 300ms at translate-x-full, so a reopen before the previous leave
60
56
  // finished re-entered stuck off-screen for that delay. Leave stays
61
- // immediate; the overlay lingers 100ms so the panel slides out
57
+ // immediate; the overlay lingers 300ms so the panel slides out
62
58
  // first on close.
63
- import_motion.motion,
59
+ "transition duration-200 ease-in",
64
60
  "data-[closed]:translate-x-full"
65
61
  ],
66
62
  header: [
@@ -107,7 +103,6 @@ const Drawer = ({
107
103
  "data-guard": "drawer",
108
104
  inline: true,
109
105
  onClick: onClose,
110
- ref: close,
111
106
  variant: "link"
112
107
  },
113
108
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -1,8 +1,6 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { Fragment, useRef } from "react";
2
+ import { Fragment } from "react";
3
3
  import { Transition } from "@headlessui/react";
4
- import { useEscape } from "./lib/escape.mjs";
5
- import { motion } from "../shared/lib/motion.mjs";
6
4
  import Times from "../icons/times.mjs";
7
5
  import Button from "../shared/button.mjs";
8
6
  import { FormScope } from "../shared/lib/form.mjs";
@@ -16,8 +14,6 @@ const Drawer = ({
16
14
  overlay = true,
17
15
  title
18
16
  }) => {
19
- const close = useRef(null);
20
- useEscape(active, close);
21
17
  const classes = {
22
18
  drawer: [
23
19
  className,
@@ -26,9 +22,9 @@ const Drawer = ({
26
22
  // Enter slides in immediately (no delay): the panel used to wait
27
23
  // 300ms at translate-x-full, so a reopen before the previous leave
28
24
  // finished re-entered stuck off-screen for that delay. Leave stays
29
- // immediate; the overlay lingers 100ms so the panel slides out
25
+ // immediate; the overlay lingers 300ms so the panel slides out
30
26
  // first on close.
31
- motion,
27
+ "transition duration-200 ease-in",
32
28
  "data-[closed]:translate-x-full"
33
29
  ],
34
30
  header: [
@@ -75,7 +71,6 @@ const Drawer = ({
75
71
  "data-guard": "drawer",
76
72
  inline: true,
77
73
  onClick: onClose,
78
- ref: close,
79
74
  variant: "link"
80
75
  },
81
76
  children: /* @__PURE__ */ jsx(
@@ -48,15 +48,16 @@ const FormOrganizationCampaignIntegrationGtm = ({
48
48
  }) => {
49
49
  const { control, handleSubmit, formState } = (0, import_form.useForm)({
50
50
  defaultValues: values,
51
+ // @story integrations/gtm
52
+ // The container is needed only to run: off saves with it blank. On,
53
+ // or with anything typed, every rule applies. The api checks the same.
51
54
  resolver: (0, import_yup.resolver)(
52
- import_yup.default.object({
55
+ import_yup.default.lazy(({ enabled, settings }) => import_yup.default.object({
53
56
  enabled: import_yup.default.boolean(),
54
- // Container ID is required whether or not the integration is
55
- // enabled — a disabled-and-empty GTM integration is just noise.
56
57
  settings: import_yup.default.object({
57
- containerId: import_yup.default.string().label("Container ID").required().min(10).max(20).matches(/^\S*$/, "Container ID must not contain spaces").prefix("GTM", 3)
58
+ containerId: !enabled && !(settings == null ? void 0 : settings.containerId) ? import_yup.default.string().label("Container ID") : import_yup.default.string().label("Container ID").required().min(10).max(20).matches(/^\S*$/, "Container ID must not contain spaces").prefix("GTM", 3)
58
59
  })
59
- })
60
+ }))
60
61
  )
61
62
  });
62
63
  const onSubmit = async ({
@@ -16,15 +16,16 @@ const FormOrganizationCampaignIntegrationGtm = ({
16
16
  }) => {
17
17
  const { control, handleSubmit, formState } = useForm({
18
18
  defaultValues: values,
19
+ // @story integrations/gtm
20
+ // The container is needed only to run: off saves with it blank. On,
21
+ // or with anything typed, every rule applies. The api checks the same.
19
22
  resolver: resolver(
20
- yup.object({
23
+ yup.lazy(({ enabled, settings }) => yup.object({
21
24
  enabled: yup.boolean(),
22
- // Container ID is required whether or not the integration is
23
- // enabled — a disabled-and-empty GTM integration is just noise.
24
25
  settings: yup.object({
25
- containerId: yup.string().label("Container ID").required().min(10).max(20).matches(/^\S*$/, "Container ID must not contain spaces").prefix("GTM", 3)
26
+ containerId: !enabled && !(settings == null ? void 0 : settings.containerId) ? yup.string().label("Container ID") : yup.string().label("Container ID").required().min(10).max(20).matches(/^\S*$/, "Container ID must not contain spaces").prefix("GTM", 3)
26
27
  })
27
- })
28
+ }))
28
29
  )
29
30
  });
30
31
  const onSubmit = async ({
@@ -471,7 +471,7 @@ const FormOrganizationCampaignNotifications = ({
471
471
  ...{
472
472
  className: "text-sm"
473
473
  },
474
- children: "This content is sent for both email and sms messages to draw selection for manual and automated draws."
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 for both email and sms messages to draw selection for manual and automated draws."
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
- message: (selected.priceMonthly ? (0, import_drawbridge_utils.formatCurrency)({ value: selected.priceMonthly }) + " per month, added" : "A monthly charge is added") + " to your subscription while you hold this number \u2014 carriers bill for a dedicated number whether or not it sends, so it is a line item rather than an action. SMS messages bill separately as actions. Release the number any time from Settings to stop the charge.",
288
- type: "warning"
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
- message: (selected.priceMonthly ? formatCurrency({ value: selected.priceMonthly }) + " per month, added" : "A monthly charge is added") + " to your subscription while you hold this number \u2014 carriers bill for a dedicated number whether or not it sends, so it is a line item rather than an action. SMS messages bill separately as actions. Release the number any time from Settings to stop the charge.",
254
- type: "warning"
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
  ),
@@ -87,9 +87,9 @@ const messageSteps = [...emailSteps, "step.sms.send"];
87
87
  const renderedSteps = [...emailSteps, ...teamSteps];
88
88
  const RESPONSE = "step.response.send";
89
89
  const firstEntryOnly = ({ campaign, event, type }) => {
90
- var _a;
90
+ var _a, _b;
91
91
  if (event !== "lead.insert" || !type || emailSteps.includes(type) || type === RESPONSE) return false;
92
- if (type === "step.sms.send") return ((_a = campaign == null ? void 0 : campaign.form) == null ? void 0 : _a.submissionLeadPrimaryKey) !== "phone";
92
+ if (type === "step.sms.send") return (((_a = campaign == null ? void 0 : campaign.form) == null ? void 0 : _a.submissionLeadPrimaryKey) ?? ((_b = campaign == null ? void 0 : campaign.settings) == null ? void 0 : _b.submissionLeadPrimaryKey)) !== "phone";
93
93
  return true;
94
94
  };
95
95
  const stepPrefills = {
@@ -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
  ...{
@@ -35,9 +35,9 @@ const messageSteps = [...emailSteps, "step.sms.send"];
35
35
  const renderedSteps = [...emailSteps, ...teamSteps];
36
36
  const RESPONSE = "step.response.send";
37
37
  const firstEntryOnly = ({ campaign, event, type }) => {
38
- var _a;
38
+ var _a, _b;
39
39
  if (event !== "lead.insert" || !type || emailSteps.includes(type) || type === RESPONSE) return false;
40
- if (type === "step.sms.send") return ((_a = campaign == null ? void 0 : campaign.form) == null ? void 0 : _a.submissionLeadPrimaryKey) !== "phone";
40
+ if (type === "step.sms.send") return (((_a = campaign == null ? void 0 : campaign.form) == null ? void 0 : _a.submissionLeadPrimaryKey) ?? ((_b = campaign == null ? void 0 : campaign.settings) == null ? void 0 : _b.submissionLeadPrimaryKey)) !== "phone";
41
41
  return true;
42
42
  };
43
43
  const stepPrefills = {
@@ -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
- message: "We verify your SMS number against it. Your sending domain is its domain.",
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
- message: "We verify your SMS number against it. Your sending domain is its domain.",
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
  );