@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.
Files changed (242) hide show
  1. package/components/styles.css +364 -2
  2. package/dist/advertisement.js +3 -1
  3. package/dist/advertisement.mjs +3 -1
  4. package/dist/bridge/advertisements.js +2 -0
  5. package/dist/bridge/advertisements.mjs +2 -0
  6. package/dist/bridge/countdown.js +2 -1
  7. package/dist/bridge/countdown.mjs +2 -1
  8. package/dist/bridge/form-subdomain-embed.js +18 -20
  9. package/dist/bridge/form-subdomain-embed.mjs +18 -20
  10. package/dist/bridge/form-subdomain-header.js +24 -1
  11. package/dist/bridge/form-subdomain-header.mjs +24 -1
  12. package/dist/bridge/form-subdomain-missions.js +577 -0
  13. package/dist/bridge/form-subdomain-missions.mjs +540 -0
  14. package/dist/bridge/form-subdomain.js +530 -220
  15. package/dist/bridge/form-subdomain.mjs +533 -222
  16. package/dist/bridge/lib/entry.js +59 -0
  17. package/dist/bridge/lib/entry.mjs +29 -0
  18. package/dist/bridge/lib/location.js +38 -0
  19. package/dist/bridge/lib/location.mjs +13 -0
  20. package/dist/bridge/lib/order.js +71 -0
  21. package/dist/bridge/lib/order.mjs +44 -0
  22. package/dist/bridge/lib/url.js +9 -0
  23. package/dist/bridge/lib/url.mjs +7 -0
  24. package/dist/bridge/share-button.js +5 -3
  25. package/dist/bridge/share-button.mjs +5 -3
  26. package/dist/bridge/subdomain-content.js +7 -6
  27. package/dist/bridge/subdomain-content.mjs +7 -6
  28. package/dist/bridge/template-layout.js +59 -21
  29. package/dist/bridge/template-layout.mjs +59 -21
  30. package/dist/bridge/template-modal.js +42 -76
  31. package/dist/bridge/template-modal.mjs +39 -73
  32. package/dist/bridge/template-preview.js +208 -0
  33. package/dist/bridge/template-preview.mjs +173 -0
  34. package/dist/bridge/template-subdomain-gallery.js +6 -2
  35. package/dist/bridge/template-subdomain-gallery.mjs +6 -2
  36. package/dist/bridge/template-subdomain-link.js +6 -1
  37. package/dist/bridge/template-subdomain-link.mjs +6 -1
  38. package/dist/bridge/template-subdomain.js +20 -15
  39. package/dist/bridge/template-subdomain.mjs +20 -15
  40. package/dist/dashboard/accordion.js +74 -39
  41. package/dist/dashboard/accordion.mjs +74 -39
  42. package/dist/dashboard/avatar.js +109 -3
  43. package/dist/dashboard/avatar.mjs +106 -4
  44. package/dist/dashboard/buttons-subscription.js +384 -0
  45. package/dist/dashboard/buttons-subscription.mjs +349 -0
  46. package/dist/dashboard/card-campaign-switch.js +277 -0
  47. package/dist/dashboard/card-campaign-switch.mjs +243 -0
  48. package/dist/dashboard/card-order.js +231 -29
  49. package/dist/dashboard/card-order.mjs +231 -29
  50. package/dist/dashboard/card-section.js +26 -2
  51. package/dist/dashboard/card-section.mjs +26 -2
  52. package/dist/dashboard/card-tile.js +6 -7
  53. package/dist/dashboard/card-tile.mjs +6 -7
  54. package/dist/dashboard/connection-workflows.js +205 -0
  55. package/dist/dashboard/connection-workflows.mjs +171 -0
  56. package/dist/dashboard/device.js +95 -0
  57. package/dist/dashboard/device.mjs +72 -0
  58. package/dist/dashboard/form-admin-campaign.js +19 -50
  59. package/dist/dashboard/form-admin-campaign.mjs +20 -51
  60. package/dist/dashboard/form-ai.js +9 -6
  61. package/dist/dashboard/form-ai.mjs +9 -6
  62. package/dist/dashboard/form-auth.js +35 -25
  63. package/dist/dashboard/form-auth.mjs +36 -26
  64. package/dist/dashboard/form-file.js +10 -1
  65. package/dist/dashboard/form-file.mjs +10 -1
  66. package/dist/dashboard/form-filters-analytics.js +14 -1
  67. package/dist/dashboard/form-filters-analytics.mjs +15 -2
  68. package/dist/dashboard/form-organization-campaign-advertisement.js +15 -1
  69. package/dist/dashboard/form-organization-campaign-advertisement.mjs +16 -2
  70. package/dist/dashboard/form-organization-campaign-agreement.js +215 -164
  71. package/dist/dashboard/form-organization-campaign-agreement.mjs +215 -164
  72. package/dist/dashboard/form-organization-campaign-field-email.js +0 -34
  73. package/dist/dashboard/form-organization-campaign-field-email.mjs +0 -34
  74. package/dist/dashboard/form-organization-campaign-field-list.js +466 -0
  75. package/dist/dashboard/form-organization-campaign-field-list.mjs +437 -0
  76. package/dist/dashboard/form-organization-campaign-field-phone.js +0 -34
  77. package/dist/dashboard/form-organization-campaign-field-phone.mjs +0 -34
  78. package/dist/dashboard/form-organization-campaign-field-remove.js +66 -0
  79. package/dist/dashboard/form-organization-campaign-field-remove.mjs +33 -0
  80. package/dist/dashboard/form-organization-campaign-field-select.js +51 -5
  81. package/dist/dashboard/form-organization-campaign-field-select.mjs +51 -5
  82. package/dist/dashboard/form-organization-campaign-field-textarea.js +46 -8
  83. package/dist/dashboard/form-organization-campaign-field-textarea.mjs +46 -8
  84. package/dist/dashboard/form-organization-campaign-integration-age.js +6 -12
  85. package/dist/dashboard/form-organization-campaign-integration-age.mjs +6 -12
  86. package/dist/dashboard/form-organization-campaign-integration-enable.js +52 -24
  87. package/dist/dashboard/form-organization-campaign-integration-enable.mjs +54 -26
  88. package/dist/dashboard/form-organization-campaign-integration-geocode.js +6 -12
  89. package/dist/dashboard/form-organization-campaign-integration-geocode.mjs +6 -12
  90. package/dist/dashboard/form-organization-campaign-integration-gtm.js +6 -12
  91. package/dist/dashboard/form-organization-campaign-integration-gtm.mjs +6 -12
  92. package/dist/dashboard/form-organization-campaign-link.js +7 -1
  93. package/dist/dashboard/form-organization-campaign-link.mjs +7 -1
  94. package/dist/dashboard/form-organization-campaign-mission.js +291 -0
  95. package/dist/dashboard/form-organization-campaign-mission.mjs +258 -0
  96. package/dist/dashboard/form-organization-campaign-page-embed.js +13 -2
  97. package/dist/dashboard/form-organization-campaign-page-embed.mjs +12 -1
  98. package/dist/dashboard/form-organization-campaign-page.js +20 -11
  99. package/dist/dashboard/form-organization-campaign-page.mjs +20 -11
  100. package/dist/dashboard/form-organization-campaign-prize-edit.js +12 -1
  101. package/dist/dashboard/form-organization-campaign-prize-edit.mjs +12 -1
  102. package/dist/dashboard/form-organization-campaign-section.js +243 -0
  103. package/dist/dashboard/form-organization-campaign-section.mjs +214 -0
  104. package/dist/dashboard/form-organization-campaign.js +114 -469
  105. package/dist/dashboard/form-organization-campaign.mjs +113 -467
  106. package/dist/dashboard/form-organization-export.js +4 -7
  107. package/dist/dashboard/form-organization-export.mjs +4 -7
  108. package/dist/dashboard/form-organization-identity.js +46 -51
  109. package/dist/dashboard/form-organization-identity.mjs +46 -51
  110. package/dist/dashboard/form-organization-workflow.js +708 -687
  111. package/dist/dashboard/form-organization-workflow.mjs +704 -683
  112. package/dist/dashboard/form-organization.js +82 -110
  113. package/dist/dashboard/form-organization.mjs +81 -109
  114. package/dist/dashboard/form-otc.js +4 -5
  115. package/dist/dashboard/form-otc.mjs +4 -5
  116. package/dist/dashboard/form-payment-methods.js +20 -9
  117. package/dist/dashboard/form-payment-methods.mjs +20 -9
  118. package/dist/dashboard/form-stripe.js +30 -0
  119. package/dist/dashboard/form-stripe.mjs +26 -0
  120. package/dist/dashboard/input-array.js +4 -2
  121. package/dist/dashboard/input-array.mjs +4 -2
  122. package/dist/dashboard/input-combobox.js +7 -3
  123. package/dist/dashboard/input-combobox.mjs +7 -3
  124. package/dist/dashboard/input-date.js +7 -0
  125. package/dist/dashboard/input-date.mjs +7 -0
  126. package/dist/dashboard/input-fields.js +80 -20
  127. package/dist/dashboard/input-fields.mjs +80 -20
  128. package/dist/dashboard/input-file.js +21 -1
  129. package/dist/dashboard/input-file.mjs +21 -1
  130. package/dist/dashboard/input-font.js +10 -1
  131. package/dist/dashboard/input-font.mjs +10 -1
  132. package/dist/dashboard/lib/item-list.js +57 -0
  133. package/dist/dashboard/lib/item-list.mjs +33 -0
  134. package/dist/dashboard/lib/menu.js +50 -0
  135. package/dist/dashboard/lib/menu.mjs +26 -0
  136. package/dist/dashboard/locked.js +82 -0
  137. package/dist/dashboard/locked.mjs +53 -0
  138. package/dist/dashboard/menu.js +72 -19
  139. package/dist/dashboard/menu.mjs +72 -19
  140. package/dist/dashboard/note-ai.js +69 -0
  141. package/dist/dashboard/note-ai.mjs +36 -0
  142. package/dist/dashboard/preview.js +419 -0
  143. package/dist/dashboard/preview.mjs +384 -0
  144. package/dist/dashboard/steps.js +39 -13
  145. package/dist/dashboard/steps.mjs +37 -12
  146. package/dist/dashboard/table-contacts.js +136 -0
  147. package/dist/dashboard/table-contacts.mjs +103 -0
  148. package/dist/dashboard/template-not-found.js +4 -2
  149. package/dist/dashboard/template-not-found.mjs +4 -2
  150. package/dist/dashboard/template-socket.js +20 -7
  151. package/dist/dashboard/template-socket.mjs +20 -7
  152. package/dist/icons/desktop.js +46 -0
  153. package/dist/icons/desktop.mjs +27 -0
  154. package/dist/icons/phone.js +46 -0
  155. package/dist/icons/phone.mjs +27 -0
  156. package/dist/icons/puzzle-piece.js +46 -0
  157. package/dist/icons/puzzle-piece.mjs +27 -0
  158. package/dist/icons/tablet.js +46 -0
  159. package/dist/icons/tablet.mjs +27 -0
  160. package/dist/icons/users.js +46 -0
  161. package/dist/icons/users.mjs +27 -0
  162. package/dist/input-checkbox.js +1 -0
  163. package/dist/input-checkbox.mjs +1 -0
  164. package/dist/input-code.js +83 -0
  165. package/dist/input-code.mjs +50 -0
  166. package/dist/input-text.js +2 -1
  167. package/dist/input-text.mjs +2 -1
  168. package/dist/shared/button.js +1 -1
  169. package/dist/shared/button.mjs +1 -1
  170. package/dist/shared/input-checkbox-list.js +0 -1
  171. package/dist/shared/input-checkbox-list.mjs +0 -1
  172. package/dist/shared/input-switch.js +6 -1
  173. package/dist/shared/input-switch.mjs +6 -1
  174. package/dist/shared/lib/campaign.js +123 -0
  175. package/dist/shared/lib/campaign.mjs +96 -0
  176. package/dist/shared/lib/helpers.js +14 -2
  177. package/dist/shared/lib/helpers.mjs +13 -2
  178. package/package.json +133 -13
  179. package/types/bridge/form-subdomain-header.d.ts +2 -0
  180. package/types/bridge/form-subdomain-missions.d.ts +38 -0
  181. package/types/bridge/form-subdomain.d.ts +23 -1
  182. package/types/bridge/lib/entry.d.ts +26 -0
  183. package/types/bridge/lib/location.d.ts +13 -0
  184. package/types/bridge/lib/order.d.ts +30 -0
  185. package/types/bridge/lib/url.d.ts +19 -0
  186. package/types/bridge/template-modal.d.ts +1 -1
  187. package/types/bridge/template-preview.d.ts +10 -0
  188. package/types/bridge/template-subdomain-link.d.ts +2 -0
  189. package/types/dashboard/accordion.d.ts +2 -0
  190. package/types/dashboard/avatar.d.ts +18 -2
  191. package/types/dashboard/buttons-subscription.d.ts +22 -0
  192. package/types/dashboard/card-campaign-switch.d.ts +32 -0
  193. package/types/dashboard/card-order.d.ts +25 -1
  194. package/types/dashboard/card-section.d.ts +2 -0
  195. package/types/dashboard/connection-workflows.d.ts +33 -0
  196. package/types/dashboard/device.d.ts +12 -0
  197. package/types/dashboard/form-admin-campaign.d.ts +3 -2
  198. package/types/dashboard/form-ai.d.ts +2 -2
  199. package/types/dashboard/form-organization-campaign-agreement.d.ts +18 -12
  200. package/types/dashboard/form-organization-campaign-field-email.d.ts +1 -2
  201. package/types/dashboard/form-organization-campaign-field-list.d.ts +36 -0
  202. package/types/dashboard/form-organization-campaign-field-phone.d.ts +1 -2
  203. package/types/dashboard/form-organization-campaign-field-remove.d.ts +22 -0
  204. package/types/dashboard/form-organization-campaign-field-select.d.ts +2 -1
  205. package/types/dashboard/form-organization-campaign-field-textarea.d.ts +2 -1
  206. package/types/dashboard/form-organization-campaign-integration-age.d.ts +3 -3
  207. package/types/dashboard/form-organization-campaign-integration-enable.d.ts +3 -3
  208. package/types/dashboard/form-organization-campaign-mission.d.ts +40 -0
  209. package/types/dashboard/form-organization-campaign-section.d.ts +29 -0
  210. package/types/dashboard/form-organization-campaign.d.ts +27 -17
  211. package/types/dashboard/form-organization-identity.d.ts +2 -0
  212. package/types/dashboard/form-organization-workflow.d.ts +56 -47
  213. package/types/dashboard/form-organization.d.ts +7 -2
  214. package/types/dashboard/form-stripe.d.ts +3 -0
  215. package/types/dashboard/input-combobox.d.ts +2 -0
  216. package/types/dashboard/input-date.d.ts +2 -0
  217. package/types/dashboard/input-fields.d.ts +3 -2
  218. package/types/dashboard/input-file.d.ts +4 -0
  219. package/types/dashboard/lib/item-list.d.ts +14 -0
  220. package/types/dashboard/lib/menu.d.ts +17 -0
  221. package/types/dashboard/locked.d.ts +10 -0
  222. package/types/dashboard/menu.d.ts +10 -2
  223. package/types/dashboard/note-ai.d.ts +15 -0
  224. package/types/dashboard/preview.d.ts +33 -0
  225. package/types/dashboard/steps.d.ts +19 -4
  226. package/types/dashboard/table-cell-title.d.ts +2 -2
  227. package/types/dashboard/table-contacts.d.ts +2 -0
  228. package/types/icons/desktop.d.ts +5 -0
  229. package/types/icons/phone.d.ts +5 -0
  230. package/types/icons/puzzle-piece.d.ts +5 -0
  231. package/types/icons/tablet.d.ts +5 -0
  232. package/types/icons/users.d.ts +5 -0
  233. package/types/input-code.d.ts +23 -0
  234. package/types/shared/input-switch.d.ts +2 -0
  235. package/types/shared/lib/campaign.d.ts +35 -0
  236. package/types/shared/lib/helpers.d.ts +3 -0
  237. package/dist/dashboard/card-integration.js +0 -187
  238. package/dist/dashboard/card-integration.mjs +0 -158
  239. package/dist/dashboard/iframe.js +0 -159
  240. package/dist/dashboard/iframe.mjs +0 -130
  241. package/types/dashboard/card-integration.d.ts +0 -24
  242. package/types/dashboard/iframe.d.ts +0 -18
@@ -0,0 +1,46 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var tablet_exports = {};
19
+ __export(tablet_exports, {
20
+ default: () => tablet_default
21
+ });
22
+ module.exports = __toCommonJS(tablet_exports);
23
+ var import_jsx_runtime = require("react/jsx-runtime");
24
+ const Tablet = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
25
+ "svg",
26
+ {
27
+ ...{
28
+ fill: "none",
29
+ stroke: "currentColor",
30
+ strokeWidth: 1.5,
31
+ viewBox: "0 0 24 24",
32
+ ...props
33
+ },
34
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
35
+ "path",
36
+ {
37
+ ...{
38
+ d: "M6.75 2.25h10.5A2.25 2.25 0 0 1 19.5 4.5v15a2.25 2.25 0 0 1-2.25 2.25H6.75A2.25 2.25 0 0 1 4.5 19.5v-15a2.25 2.25 0 0 1 2.25-2.25ZM10.5 18.75h3",
39
+ strokeLinecap: "round",
40
+ strokeLinejoin: "round"
41
+ }
42
+ }
43
+ )
44
+ }
45
+ );
46
+ var tablet_default = Tablet;
@@ -0,0 +1,27 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ const Tablet = (props) => /* @__PURE__ */ jsx(
3
+ "svg",
4
+ {
5
+ ...{
6
+ fill: "none",
7
+ stroke: "currentColor",
8
+ strokeWidth: 1.5,
9
+ viewBox: "0 0 24 24",
10
+ ...props
11
+ },
12
+ children: /* @__PURE__ */ jsx(
13
+ "path",
14
+ {
15
+ ...{
16
+ d: "M6.75 2.25h10.5A2.25 2.25 0 0 1 19.5 4.5v15a2.25 2.25 0 0 1-2.25 2.25H6.75A2.25 2.25 0 0 1 4.5 19.5v-15a2.25 2.25 0 0 1 2.25-2.25ZM10.5 18.75h3",
17
+ strokeLinecap: "round",
18
+ strokeLinejoin: "round"
19
+ }
20
+ }
21
+ )
22
+ }
23
+ );
24
+ var tablet_default = Tablet;
25
+ export {
26
+ tablet_default as default
27
+ };
@@ -0,0 +1,46 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var users_exports = {};
19
+ __export(users_exports, {
20
+ default: () => users_default
21
+ });
22
+ module.exports = __toCommonJS(users_exports);
23
+ var import_jsx_runtime = require("react/jsx-runtime");
24
+ const Users = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
25
+ "svg",
26
+ {
27
+ ...{
28
+ fill: "none",
29
+ stroke: "currentColor",
30
+ strokeWidth: 1.5,
31
+ viewBox: "0 0 24 24",
32
+ ...props
33
+ },
34
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
35
+ "path",
36
+ {
37
+ ...{
38
+ d: "M15 19.128a9.38 9.38 0 0 0 2.625.372 9.337 9.337 0 0 0 4.121-.952 4.125 4.125 0 0 0-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 0 1 8.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0 1 11.964-3.07M12 6.375a3.375 3.375 0 1 1-6.75 0 3.375 3.375 0 0 1 6.75 0Zm8.25 2.25a2.625 2.625 0 1 1-5.25 0 2.625 2.625 0 0 1 5.25 0Z",
39
+ strokeLinecap: "round",
40
+ strokeLinejoin: "round"
41
+ }
42
+ }
43
+ )
44
+ }
45
+ );
46
+ var users_default = Users;
@@ -0,0 +1,27 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ const Users = (props) => /* @__PURE__ */ jsx(
3
+ "svg",
4
+ {
5
+ ...{
6
+ fill: "none",
7
+ stroke: "currentColor",
8
+ strokeWidth: 1.5,
9
+ viewBox: "0 0 24 24",
10
+ ...props
11
+ },
12
+ children: /* @__PURE__ */ jsx(
13
+ "path",
14
+ {
15
+ ...{
16
+ d: "M15 19.128a9.38 9.38 0 0 0 2.625.372 9.337 9.337 0 0 0 4.121-.952 4.125 4.125 0 0 0-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 0 1 8.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0 1 11.964-3.07M12 6.375a3.375 3.375 0 1 1-6.75 0 3.375 3.375 0 0 1 6.75 0Zm8.25 2.25a2.625 2.625 0 1 1-5.25 0 2.625 2.625 0 0 1 5.25 0Z",
17
+ strokeLinecap: "round",
18
+ strokeLinejoin: "round"
19
+ }
20
+ }
21
+ )
22
+ }
23
+ );
24
+ var users_default = Users;
25
+ export {
26
+ users_default as default
27
+ };
@@ -64,6 +64,7 @@ const InputCheckbox = ({
64
64
  "aria-labelledby": labelId,
65
65
  inline: true,
66
66
  onClick: () => onChange(value ? false : true),
67
+ role: "checkbox",
67
68
  variant: "link",
68
69
  ...rest
69
70
  },
@@ -32,6 +32,7 @@ const InputCheckbox = ({
32
32
  "aria-labelledby": labelId,
33
33
  inline: true,
34
34
  onClick: () => onChange(value ? false : true),
35
+ role: "checkbox",
35
36
  variant: "link",
36
37
  ...rest
37
38
  },
@@ -0,0 +1,83 @@
1
+ "use client";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var input_code_exports = {};
30
+ __export(input_code_exports, {
31
+ codeDigits: () => codeDigits,
32
+ default: () => input_code_default
33
+ });
34
+ module.exports = __toCommonJS(input_code_exports);
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var import_input_text = __toESM(require("./input-text"));
37
+ const codeDigits = (value, length = 6) => String(value ?? "").replace(/\D/g, "").slice(0, length);
38
+ const InputCode = ({
39
+ autoFocus,
40
+ disabled,
41
+ id,
42
+ length = 6,
43
+ name,
44
+ onChange,
45
+ onComplete,
46
+ style,
47
+ value
48
+ }) => {
49
+ const digits = codeDigits(value, length);
50
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
51
+ import_input_text.default,
52
+ {
53
+ ...{
54
+ // An `id` means a <label htmlFor> names it ( InputGroup's ); only a
55
+ // bare field names itself.
56
+ ...!id && {
57
+ "aria-label": "Verification code"
58
+ },
59
+ autoComplete: "one-time-code",
60
+ autoFocus,
61
+ disabled,
62
+ id,
63
+ inputMode: "numeric",
64
+ maxLength: length,
65
+ name,
66
+ onChange: (text) => {
67
+ const next = codeDigits(text, length);
68
+ onChange == null ? void 0 : onChange(next);
69
+ if (next.length === length && next !== digits) onComplete == null ? void 0 : onComplete(next);
70
+ },
71
+ pattern: "[0-9]*",
72
+ style,
73
+ type: "text",
74
+ value: digits
75
+ }
76
+ }
77
+ );
78
+ };
79
+ var input_code_default = InputCode;
80
+ // Annotate the CommonJS export names for ESM import in node:
81
+ 0 && (module.exports = {
82
+ codeDigits
83
+ });
@@ -0,0 +1,50 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import InputText from "./input-text.mjs";
4
+ const codeDigits = (value, length = 6) => String(value ?? "").replace(/\D/g, "").slice(0, length);
5
+ const InputCode = ({
6
+ autoFocus,
7
+ disabled,
8
+ id,
9
+ length = 6,
10
+ name,
11
+ onChange,
12
+ onComplete,
13
+ style,
14
+ value
15
+ }) => {
16
+ const digits = codeDigits(value, length);
17
+ return /* @__PURE__ */ jsx(
18
+ InputText,
19
+ {
20
+ ...{
21
+ // An `id` means a <label htmlFor> names it ( InputGroup's ); only a
22
+ // bare field names itself.
23
+ ...!id && {
24
+ "aria-label": "Verification code"
25
+ },
26
+ autoComplete: "one-time-code",
27
+ autoFocus,
28
+ disabled,
29
+ id,
30
+ inputMode: "numeric",
31
+ maxLength: length,
32
+ name,
33
+ onChange: (text) => {
34
+ const next = codeDigits(text, length);
35
+ onChange == null ? void 0 : onChange(next);
36
+ if (next.length === length && next !== digits) onComplete == null ? void 0 : onComplete(next);
37
+ },
38
+ pattern: "[0-9]*",
39
+ style,
40
+ type: "text",
41
+ value: digits
42
+ }
43
+ }
44
+ );
45
+ };
46
+ var input_code_default = InputCode;
47
+ export {
48
+ codeDigits,
49
+ input_code_default as default
50
+ };
@@ -31,6 +31,7 @@ const InputText = ({
31
31
  ...rest
32
32
  }) => {
33
33
  const classes = ["input"];
34
+ const { backgroundColor, ...unbranded } = (0, import_styles.inputStyle)(style);
34
35
  if (className) {
35
36
  classes.push(className);
36
37
  }
@@ -42,7 +43,7 @@ const InputText = ({
42
43
  ...rest,
43
44
  className: classes.join(" "),
44
45
  onChange: ({ target }) => onChange(target.value),
45
- style: (0, import_styles.inputStyle)(style),
46
+ style: rest.readOnly && !style ? unbranded : { backgroundColor, ...unbranded },
46
47
  value
47
48
  }
48
49
  }
@@ -9,6 +9,7 @@ const InputText = ({
9
9
  ...rest
10
10
  }) => {
11
11
  const classes = ["input"];
12
+ const { backgroundColor, ...unbranded } = inputStyle(style);
12
13
  if (className) {
13
14
  classes.push(className);
14
15
  }
@@ -20,7 +21,7 @@ const InputText = ({
20
21
  ...rest,
21
22
  className: classes.join(" "),
22
23
  onChange: ({ target }) => onChange(target.value),
23
- style: inputStyle(style),
24
+ style: rest.readOnly && !style ? unbranded : { backgroundColor, ...unbranded },
24
25
  value
25
26
  }
26
27
  }
@@ -68,7 +68,7 @@ const Button = (0, import_react.forwardRef)(({
68
68
  if (size === "small") classes.push("small");
69
69
  if (Icon && !labelled) classes.push("icon");
70
70
  const text = typeof children === "string" || typeof children === "number";
71
- if (inline) classes.push(variant !== "link" || style ? "w-fit" : text && !Icon ? "inline" : "inline-flex w-fit");
71
+ if (inline) classes.push(variant !== "link" || style ? "w-fit" : text && !Icon ? "inline w-fit" : "inline-flex w-fit");
72
72
  if (justify === "start") classes.push("justify-start");
73
73
  if (justify === "end") classes.push("justify-end");
74
74
  if (justify === "between" && Icon && labelled) classes.push("justify-between");
@@ -36,7 +36,7 @@ const Button = forwardRef(({
36
36
  if (size === "small") classes.push("small");
37
37
  if (Icon && !labelled) classes.push("icon");
38
38
  const text = typeof children === "string" || typeof children === "number";
39
- if (inline) classes.push(variant !== "link" || style ? "w-fit" : text && !Icon ? "inline" : "inline-flex w-fit");
39
+ if (inline) classes.push(variant !== "link" || style ? "w-fit" : text && !Icon ? "inline w-fit" : "inline-flex w-fit");
40
40
  if (justify === "start") classes.push("justify-start");
41
41
  if (justify === "end") classes.push("justify-end");
42
42
  if (justify === "between" && Icon && labelled) classes.push("justify-between");
@@ -73,7 +73,6 @@ const InputCheckboxList = ({
73
73
  label,
74
74
  labelId: id + key,
75
75
  onChange: onCheck,
76
- role: "checkbox",
77
76
  style,
78
77
  value: checked
79
78
  }
@@ -41,7 +41,6 @@ const InputCheckboxList = ({
41
41
  label,
42
42
  labelId: id + key,
43
43
  onChange: onCheck,
44
- role: "checkbox",
45
44
  style,
46
45
  value: checked
47
46
  }
@@ -35,6 +35,7 @@ var import_react = require("@headlessui/react");
35
35
  var import_button = __toESM(require("./button"));
36
36
  var import_styles = require("../styles");
37
37
  const InputSwitch = ({
38
+ "aria-label": ariaLabel,
38
39
  disabled,
39
40
  helper,
40
41
  onChange,
@@ -56,7 +57,9 @@ const InputSwitch = ({
56
57
  ],
57
58
  track: [
58
59
  "flex items-center shrink-0 rounded-full border transition ease-in-out duration-200",
59
- value ? "bg-black border-black" : "border-gray",
60
+ // Off keeps a black outline, as inputs have, so it reads on gray too
61
+ // (Darren, Dulce Local walk, 2026-10-29).
62
+ value ? "bg-black border-black" : "border-black",
60
63
  small ? "h-7 w-11" : "h-10 w-16"
61
64
  ]
62
65
  };
@@ -68,6 +71,8 @@ const InputSwitch = ({
68
71
  import_react.Switch,
69
72
  {
70
73
  ...{
74
+ // A switch with no text beside it ( a page header's ) names itself.
75
+ ...ariaLabel && { "aria-label": ariaLabel },
71
76
  as: import_button.default,
72
77
  checked: value,
73
78
  disabled,
@@ -3,6 +3,7 @@ import { Switch } from "@headlessui/react";
3
3
  import Button from "./button.mjs";
4
4
  import { buttonStyle, inputStyle, textStyle } from "../styles.mjs";
5
5
  const InputSwitch = ({
6
+ "aria-label": ariaLabel,
6
7
  disabled,
7
8
  helper,
8
9
  onChange,
@@ -24,7 +25,9 @@ const InputSwitch = ({
24
25
  ],
25
26
  track: [
26
27
  "flex items-center shrink-0 rounded-full border transition ease-in-out duration-200",
27
- value ? "bg-black border-black" : "border-gray",
28
+ // Off keeps a black outline, as inputs have, so it reads on gray too
29
+ // (Darren, Dulce Local walk, 2026-10-29).
30
+ value ? "bg-black border-black" : "border-black",
28
31
  small ? "h-7 w-11" : "h-10 w-16"
29
32
  ]
30
33
  };
@@ -36,6 +39,8 @@ const InputSwitch = ({
36
39
  Switch,
37
40
  {
38
41
  ...{
42
+ // A switch with no text beside it ( a page header's ) names itself.
43
+ ...ariaLabel && { "aria-label": ariaLabel },
39
44
  as: Button,
40
45
  checked: value,
41
46
  disabled,
@@ -0,0 +1,123 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var campaign_exports = {};
19
+ __export(campaign_exports, {
20
+ awardingCard: () => awardingCard,
21
+ campaignSwitch: () => campaignSwitch,
22
+ campaignSwitches: () => campaignSwitches,
23
+ leadCapture: () => leadCapture,
24
+ switchLock: () => switchLock
25
+ });
26
+ module.exports = __toCommonJS(campaign_exports);
27
+ const campaignSwitches = (current, key, on) => {
28
+ const next = {
29
+ form: Boolean(current == null ? void 0 : current.form),
30
+ giveaway: Boolean(current == null ? void 0 : current.giveaway),
31
+ [key]: Boolean(on)
32
+ };
33
+ if (key === "giveaway" && next.giveaway) next.form = true;
34
+ if (key === "form" && !next.form) next.giveaway = false;
35
+ return next;
36
+ };
37
+ const campaignSwitch = (campaign, key, on) => {
38
+ var _a, _b;
39
+ const form = Boolean((_a = campaign == null ? void 0 : campaign.form) == null ? void 0 : _a.enabled);
40
+ const giveaway = Boolean((_b = campaign == null ? void 0 : campaign.giveaway) == null ? void 0 : _b.enabled);
41
+ const copy = {
42
+ form: on ? [
43
+ "Turn on the form?",
44
+ "Your pages show the entry form again and new leads are collected."
45
+ ] : [
46
+ "Turn off the form?",
47
+ "Your pages stop showing the entry form. Leads, fields and settings are kept." + (giveaway ? " The giveaway turns off too, because entries come from the form." : "")
48
+ ],
49
+ giveaway: on ? [
50
+ "Turn on the giveaway?",
51
+ // @story campaigns/giveaway-module
52
+ // The giveaway wins over an order form ( the api's `ordering` ), and
53
+ // says so (Darren, 2026-11-03).
54
+ "Entries are awarded while a range in your schedule is running." + (form ? "" : " The form turns on too, because entries come from the form.") + ((campaign == null ? void 0 : campaign.ordering) ? " Giveaways can't run with an order form, so the form stops taking orders. Your order and its fields are kept." : "")
55
+ ] : [
56
+ "Turn off the giveaway?",
57
+ "Entries stop being awarded. Prizes, schedule, missions and draws are kept, and come back when you turn it on."
58
+ ]
59
+ }[key];
60
+ return {
61
+ body: {
62
+ [key]: {
63
+ enabled: Boolean(on)
64
+ }
65
+ },
66
+ message: copy[1],
67
+ title: copy[0]
68
+ };
69
+ };
70
+ const switchLock = (campaign, key, disabled) => disabled ? "You need Manage on Campaigns to change this" : null;
71
+ const leadCapture = (campaign) => {
72
+ var _a, _b;
73
+ if (!((_a = campaign == null ? void 0 : campaign.form) == null ? void 0 : _a.enabled)) return "Off";
74
+ return ((_b = campaign == null ? void 0 : campaign.giveaway) == null ? void 0 : _b.enabled) ? "Form and Giveaway" : "Form";
75
+ };
76
+ const reasons = {
77
+ "No range is running": {
78
+ giveaway: ["No range is running", "Add a range to your schedule to start awarding entries"],
79
+ overview: "No range is running, so no entries are awarded"
80
+ },
81
+ "No prizes are published": {
82
+ giveaway: ["No prizes are published", "Publish a prize to start awarding entries"],
83
+ overview: "No prizes are published"
84
+ },
85
+ "No mission is on": {
86
+ giveaway: ["No mission is on", "Turn on a mission to start awarding entries"],
87
+ overview: "No mission is on"
88
+ }
89
+ };
90
+ const awardingCard = (campaign, page = "overview") => {
91
+ var _a, _b;
92
+ if (!((_a = campaign == null ? void 0 : campaign.giveaway) == null ? void 0 : _a.enabled)) return null;
93
+ const running = (((_b = campaign == null ? void 0 : campaign.range) == null ? void 0 : _b.title) || "Current range") + " is running";
94
+ if (campaign == null ? void 0 : campaign.awarding) {
95
+ return page === "giveaway" ? {
96
+ message: running,
97
+ title: "Schedule",
98
+ type: "success"
99
+ } : {
100
+ message: running,
101
+ title: "Awarding entries now",
102
+ type: "success"
103
+ };
104
+ }
105
+ const first = ((campaign == null ? void 0 : campaign.awardingErrors) || []).map((error) => reasons[error == null ? void 0 : error.message]).find(Boolean) || reasons["No range is running"];
106
+ return page === "giveaway" ? {
107
+ message: first.giveaway[1],
108
+ title: first.giveaway[0],
109
+ type: "warning"
110
+ } : {
111
+ message: first.overview,
112
+ title: "Not awarding entries",
113
+ type: "warning"
114
+ };
115
+ };
116
+ // Annotate the CommonJS export names for ESM import in node:
117
+ 0 && (module.exports = {
118
+ awardingCard,
119
+ campaignSwitch,
120
+ campaignSwitches,
121
+ leadCapture,
122
+ switchLock
123
+ });
@@ -0,0 +1,96 @@
1
+ const campaignSwitches = (current, key, on) => {
2
+ const next = {
3
+ form: Boolean(current == null ? void 0 : current.form),
4
+ giveaway: Boolean(current == null ? void 0 : current.giveaway),
5
+ [key]: Boolean(on)
6
+ };
7
+ if (key === "giveaway" && next.giveaway) next.form = true;
8
+ if (key === "form" && !next.form) next.giveaway = false;
9
+ return next;
10
+ };
11
+ const campaignSwitch = (campaign, key, on) => {
12
+ var _a, _b;
13
+ const form = Boolean((_a = campaign == null ? void 0 : campaign.form) == null ? void 0 : _a.enabled);
14
+ const giveaway = Boolean((_b = campaign == null ? void 0 : campaign.giveaway) == null ? void 0 : _b.enabled);
15
+ const copy = {
16
+ form: on ? [
17
+ "Turn on the form?",
18
+ "Your pages show the entry form again and new leads are collected."
19
+ ] : [
20
+ "Turn off the form?",
21
+ "Your pages stop showing the entry form. Leads, fields and settings are kept." + (giveaway ? " The giveaway turns off too, because entries come from the form." : "")
22
+ ],
23
+ giveaway: on ? [
24
+ "Turn on the giveaway?",
25
+ // @story campaigns/giveaway-module
26
+ // The giveaway wins over an order form ( the api's `ordering` ), and
27
+ // says so (Darren, 2026-11-03).
28
+ "Entries are awarded while a range in your schedule is running." + (form ? "" : " The form turns on too, because entries come from the form.") + ((campaign == null ? void 0 : campaign.ordering) ? " Giveaways can't run with an order form, so the form stops taking orders. Your order and its fields are kept." : "")
29
+ ] : [
30
+ "Turn off the giveaway?",
31
+ "Entries stop being awarded. Prizes, schedule, missions and draws are kept, and come back when you turn it on."
32
+ ]
33
+ }[key];
34
+ return {
35
+ body: {
36
+ [key]: {
37
+ enabled: Boolean(on)
38
+ }
39
+ },
40
+ message: copy[1],
41
+ title: copy[0]
42
+ };
43
+ };
44
+ const switchLock = (campaign, key, disabled) => disabled ? "You need Manage on Campaigns to change this" : null;
45
+ const leadCapture = (campaign) => {
46
+ var _a, _b;
47
+ if (!((_a = campaign == null ? void 0 : campaign.form) == null ? void 0 : _a.enabled)) return "Off";
48
+ return ((_b = campaign == null ? void 0 : campaign.giveaway) == null ? void 0 : _b.enabled) ? "Form and Giveaway" : "Form";
49
+ };
50
+ const reasons = {
51
+ "No range is running": {
52
+ giveaway: ["No range is running", "Add a range to your schedule to start awarding entries"],
53
+ overview: "No range is running, so no entries are awarded"
54
+ },
55
+ "No prizes are published": {
56
+ giveaway: ["No prizes are published", "Publish a prize to start awarding entries"],
57
+ overview: "No prizes are published"
58
+ },
59
+ "No mission is on": {
60
+ giveaway: ["No mission is on", "Turn on a mission to start awarding entries"],
61
+ overview: "No mission is on"
62
+ }
63
+ };
64
+ const awardingCard = (campaign, page = "overview") => {
65
+ var _a, _b;
66
+ if (!((_a = campaign == null ? void 0 : campaign.giveaway) == null ? void 0 : _a.enabled)) return null;
67
+ const running = (((_b = campaign == null ? void 0 : campaign.range) == null ? void 0 : _b.title) || "Current range") + " is running";
68
+ if (campaign == null ? void 0 : campaign.awarding) {
69
+ return page === "giveaway" ? {
70
+ message: running,
71
+ title: "Schedule",
72
+ type: "success"
73
+ } : {
74
+ message: running,
75
+ title: "Awarding entries now",
76
+ type: "success"
77
+ };
78
+ }
79
+ const first = ((campaign == null ? void 0 : campaign.awardingErrors) || []).map((error) => reasons[error == null ? void 0 : error.message]).find(Boolean) || reasons["No range is running"];
80
+ return page === "giveaway" ? {
81
+ message: first.giveaway[1],
82
+ title: first.giveaway[0],
83
+ type: "warning"
84
+ } : {
85
+ message: first.overview,
86
+ title: "Not awarding entries",
87
+ type: "warning"
88
+ };
89
+ };
90
+ export {
91
+ awardingCard,
92
+ campaignSwitch,
93
+ campaignSwitches,
94
+ leadCapture,
95
+ switchLock
96
+ };