@drawbridge/components 0.1.13 → 0.1.14

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 (236) 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 +538 -0
  13. package/dist/bridge/form-subdomain-missions.mjs +502 -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 +265 -0
  47. package/dist/dashboard/card-campaign-switch.mjs +231 -0
  48. package/dist/dashboard/card-order.js +28 -11
  49. package/dist/dashboard/card-order.mjs +28 -11
  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 +196 -0
  55. package/dist/dashboard/connection-workflows.mjs +162 -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-integration-age.js +6 -12
  81. package/dist/dashboard/form-organization-campaign-integration-age.mjs +6 -12
  82. package/dist/dashboard/form-organization-campaign-integration-enable.js +52 -24
  83. package/dist/dashboard/form-organization-campaign-integration-enable.mjs +54 -26
  84. package/dist/dashboard/form-organization-campaign-integration-geocode.js +6 -12
  85. package/dist/dashboard/form-organization-campaign-integration-geocode.mjs +6 -12
  86. package/dist/dashboard/form-organization-campaign-integration-gtm.js +6 -12
  87. package/dist/dashboard/form-organization-campaign-integration-gtm.mjs +6 -12
  88. package/dist/dashboard/form-organization-campaign-link.js +7 -1
  89. package/dist/dashboard/form-organization-campaign-link.mjs +7 -1
  90. package/dist/dashboard/form-organization-campaign-mission.js +291 -0
  91. package/dist/dashboard/form-organization-campaign-mission.mjs +258 -0
  92. package/dist/dashboard/form-organization-campaign-page-embed.js +13 -2
  93. package/dist/dashboard/form-organization-campaign-page-embed.mjs +12 -1
  94. package/dist/dashboard/form-organization-campaign-page.js +20 -11
  95. package/dist/dashboard/form-organization-campaign-page.mjs +20 -11
  96. package/dist/dashboard/form-organization-campaign-prize-edit.js +12 -1
  97. package/dist/dashboard/form-organization-campaign-prize-edit.mjs +12 -1
  98. package/dist/dashboard/form-organization-campaign-section.js +223 -0
  99. package/dist/dashboard/form-organization-campaign-section.mjs +194 -0
  100. package/dist/dashboard/form-organization-campaign.js +114 -469
  101. package/dist/dashboard/form-organization-campaign.mjs +113 -467
  102. package/dist/dashboard/form-organization-export.js +4 -7
  103. package/dist/dashboard/form-organization-export.mjs +4 -7
  104. package/dist/dashboard/form-organization-identity.js +46 -51
  105. package/dist/dashboard/form-organization-identity.mjs +46 -51
  106. package/dist/dashboard/form-organization-workflow.js +518 -686
  107. package/dist/dashboard/form-organization-workflow.mjs +517 -682
  108. package/dist/dashboard/form-organization.js +82 -110
  109. package/dist/dashboard/form-organization.mjs +81 -109
  110. package/dist/dashboard/form-otc.js +4 -5
  111. package/dist/dashboard/form-otc.mjs +4 -5
  112. package/dist/dashboard/form-payment-methods.js +20 -9
  113. package/dist/dashboard/form-payment-methods.mjs +20 -9
  114. package/dist/dashboard/form-stripe.js +30 -0
  115. package/dist/dashboard/form-stripe.mjs +26 -0
  116. package/dist/dashboard/input-array.js +4 -2
  117. package/dist/dashboard/input-array.mjs +4 -2
  118. package/dist/dashboard/input-combobox.js +7 -3
  119. package/dist/dashboard/input-combobox.mjs +7 -3
  120. package/dist/dashboard/input-date.js +7 -0
  121. package/dist/dashboard/input-date.mjs +7 -0
  122. package/dist/dashboard/input-fields.js +80 -20
  123. package/dist/dashboard/input-fields.mjs +80 -20
  124. package/dist/dashboard/input-file.js +21 -1
  125. package/dist/dashboard/input-file.mjs +21 -1
  126. package/dist/dashboard/input-font.js +10 -1
  127. package/dist/dashboard/input-font.mjs +10 -1
  128. package/dist/dashboard/lib/item-list.js +57 -0
  129. package/dist/dashboard/lib/item-list.mjs +33 -0
  130. package/dist/dashboard/lib/menu.js +50 -0
  131. package/dist/dashboard/lib/menu.mjs +26 -0
  132. package/dist/dashboard/locked.js +82 -0
  133. package/dist/dashboard/locked.mjs +53 -0
  134. package/dist/dashboard/menu.js +72 -19
  135. package/dist/dashboard/menu.mjs +72 -19
  136. package/dist/dashboard/note-ai.js +69 -0
  137. package/dist/dashboard/note-ai.mjs +36 -0
  138. package/dist/dashboard/preview.js +419 -0
  139. package/dist/dashboard/preview.mjs +384 -0
  140. package/dist/dashboard/steps.js +39 -13
  141. package/dist/dashboard/steps.mjs +37 -12
  142. package/dist/dashboard/table-contacts.js +136 -0
  143. package/dist/dashboard/table-contacts.mjs +103 -0
  144. package/dist/dashboard/template-not-found.js +4 -2
  145. package/dist/dashboard/template-not-found.mjs +4 -2
  146. package/dist/dashboard/template-socket.js +20 -7
  147. package/dist/dashboard/template-socket.mjs +20 -7
  148. package/dist/icons/desktop.js +46 -0
  149. package/dist/icons/desktop.mjs +27 -0
  150. package/dist/icons/phone.js +46 -0
  151. package/dist/icons/phone.mjs +27 -0
  152. package/dist/icons/puzzle-piece.js +46 -0
  153. package/dist/icons/puzzle-piece.mjs +27 -0
  154. package/dist/icons/tablet.js +46 -0
  155. package/dist/icons/tablet.mjs +27 -0
  156. package/dist/icons/users.js +46 -0
  157. package/dist/icons/users.mjs +27 -0
  158. package/dist/input-checkbox.js +1 -0
  159. package/dist/input-checkbox.mjs +1 -0
  160. package/dist/input-code.js +101 -0
  161. package/dist/input-code.mjs +78 -0
  162. package/dist/input-text.js +2 -1
  163. package/dist/input-text.mjs +2 -1
  164. package/dist/shared/input-checkbox-list.js +0 -1
  165. package/dist/shared/input-checkbox-list.mjs +0 -1
  166. package/dist/shared/input-switch.js +6 -1
  167. package/dist/shared/input-switch.mjs +6 -1
  168. package/dist/shared/lib/campaign.js +117 -0
  169. package/dist/shared/lib/campaign.mjs +91 -0
  170. package/dist/shared/lib/helpers.js +14 -2
  171. package/dist/shared/lib/helpers.mjs +13 -2
  172. package/package.json +133 -13
  173. package/types/bridge/form-subdomain-header.d.ts +2 -0
  174. package/types/bridge/form-subdomain-missions.d.ts +36 -0
  175. package/types/bridge/form-subdomain.d.ts +23 -1
  176. package/types/bridge/lib/entry.d.ts +26 -0
  177. package/types/bridge/lib/location.d.ts +13 -0
  178. package/types/bridge/lib/order.d.ts +30 -0
  179. package/types/bridge/lib/url.d.ts +19 -0
  180. package/types/bridge/template-modal.d.ts +1 -1
  181. package/types/bridge/template-preview.d.ts +10 -0
  182. package/types/bridge/template-subdomain-link.d.ts +2 -0
  183. package/types/dashboard/accordion.d.ts +2 -0
  184. package/types/dashboard/avatar.d.ts +18 -2
  185. package/types/dashboard/buttons-subscription.d.ts +22 -0
  186. package/types/dashboard/card-campaign-switch.d.ts +32 -0
  187. package/types/dashboard/card-order.d.ts +11 -0
  188. package/types/dashboard/card-section.d.ts +2 -0
  189. package/types/dashboard/connection-workflows.d.ts +33 -0
  190. package/types/dashboard/device.d.ts +12 -0
  191. package/types/dashboard/form-admin-campaign.d.ts +3 -2
  192. package/types/dashboard/form-ai.d.ts +2 -2
  193. package/types/dashboard/form-organization-campaign-agreement.d.ts +18 -12
  194. package/types/dashboard/form-organization-campaign-field-email.d.ts +1 -2
  195. package/types/dashboard/form-organization-campaign-field-list.d.ts +36 -0
  196. package/types/dashboard/form-organization-campaign-field-phone.d.ts +1 -2
  197. package/types/dashboard/form-organization-campaign-field-remove.d.ts +22 -0
  198. package/types/dashboard/form-organization-campaign-field-select.d.ts +2 -1
  199. package/types/dashboard/form-organization-campaign-field-textarea.d.ts +2 -1
  200. package/types/dashboard/form-organization-campaign-integration-age.d.ts +3 -3
  201. package/types/dashboard/form-organization-campaign-integration-enable.d.ts +3 -3
  202. package/types/dashboard/form-organization-campaign-mission.d.ts +40 -0
  203. package/types/dashboard/form-organization-campaign-section.d.ts +27 -0
  204. package/types/dashboard/form-organization-campaign.d.ts +27 -17
  205. package/types/dashboard/form-organization-identity.d.ts +2 -0
  206. package/types/dashboard/form-organization-workflow.d.ts +43 -47
  207. package/types/dashboard/form-organization.d.ts +7 -2
  208. package/types/dashboard/form-stripe.d.ts +3 -0
  209. package/types/dashboard/input-combobox.d.ts +2 -0
  210. package/types/dashboard/input-date.d.ts +2 -0
  211. package/types/dashboard/input-fields.d.ts +3 -2
  212. package/types/dashboard/input-file.d.ts +4 -0
  213. package/types/dashboard/lib/item-list.d.ts +14 -0
  214. package/types/dashboard/lib/menu.d.ts +17 -0
  215. package/types/dashboard/locked.d.ts +10 -0
  216. package/types/dashboard/menu.d.ts +10 -2
  217. package/types/dashboard/note-ai.d.ts +15 -0
  218. package/types/dashboard/preview.d.ts +33 -0
  219. package/types/dashboard/steps.d.ts +19 -4
  220. package/types/dashboard/table-cell-title.d.ts +2 -2
  221. package/types/dashboard/table-contacts.d.ts +2 -0
  222. package/types/icons/desktop.d.ts +5 -0
  223. package/types/icons/phone.d.ts +5 -0
  224. package/types/icons/puzzle-piece.d.ts +5 -0
  225. package/types/icons/tablet.d.ts +5 -0
  226. package/types/icons/users.d.ts +5 -0
  227. package/types/input-code.d.ts +23 -0
  228. package/types/shared/input-switch.d.ts +2 -0
  229. package/types/shared/lib/campaign.d.ts +35 -0
  230. package/types/shared/lib/helpers.d.ts +3 -0
  231. package/dist/dashboard/card-integration.js +0 -187
  232. package/dist/dashboard/card-integration.mjs +0 -158
  233. package/dist/dashboard/iframe.js +0 -159
  234. package/dist/dashboard/iframe.mjs +0 -130
  235. package/types/dashboard/card-integration.d.ts +0 -24
  236. package/types/dashboard/iframe.d.ts +0 -18
@@ -8,11 +8,13 @@ import Trash from "../icons/trash.mjs";
8
8
  import Button from "../shared/button.mjs";
9
9
  const InputFile = ({
10
10
  button = {},
11
+ description,
11
12
  disabled,
12
13
  endpoint,
13
14
  filters,
14
15
  nullable = true,
15
16
  onChange,
17
+ onDescription,
16
18
  organization,
17
19
  type,
18
20
  value
@@ -48,7 +50,25 @@ const InputFile = ({
48
50
  }
49
51
  }
50
52
  ),
51
- /* @__PURE__ */ jsx(
53
+ onDescription ? (
54
+ // @story pages/build
55
+ // This slot's own Description, empty until typed, the file's name
56
+ // as its placeholder. The parent form's Save sends it.
57
+ /* @__PURE__ */ jsx(
58
+ "input",
59
+ {
60
+ ...{
61
+ "aria-label": "Description",
62
+ className: "p-0 w-full border-0 text-black placeholder:text-gray-dark/60 focus:outline-hidden focus:ring-0 focus:border-inherit",
63
+ disabled,
64
+ maxLength: 150,
65
+ onChange: (event) => onDescription(event.target.value),
66
+ placeholder: value == null ? void 0 : value.filename,
67
+ value: description || ""
68
+ }
69
+ }
70
+ )
71
+ ) : /* @__PURE__ */ jsx(
52
72
  "input",
53
73
  {
54
74
  ...{
@@ -310,7 +310,16 @@ const FontPickerModal = ({
310
310
  className: "flex-1 min-w-0"
311
311
  },
312
312
  children: [
313
- filtered.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_empty.default, { children: "No fonts found" }),
313
+ filtered.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
314
+ import_empty.default,
315
+ {
316
+ ...{
317
+ // The picker's modal is white: the grey box.
318
+ variant: "secondary"
319
+ },
320
+ children: "No fonts found"
321
+ }
322
+ ),
314
323
  filtered.map(({ value: family }, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
315
324
  FontItem,
316
325
  {
@@ -278,7 +278,16 @@ const FontPickerModal = ({
278
278
  className: "flex-1 min-w-0"
279
279
  },
280
280
  children: [
281
- filtered.length === 0 && /* @__PURE__ */ jsx(Empty, { children: "No fonts found" }),
281
+ filtered.length === 0 && /* @__PURE__ */ jsx(
282
+ Empty,
283
+ {
284
+ ...{
285
+ // The picker's modal is white: the grey box.
286
+ variant: "secondary"
287
+ },
288
+ children: "No fonts found"
289
+ }
290
+ ),
282
291
  filtered.map(({ value: family }, index) => /* @__PURE__ */ jsx(
283
292
  FontItem,
284
293
  {
@@ -0,0 +1,57 @@
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 item_list_exports = {};
19
+ __export(item_list_exports, {
20
+ itemSummary: () => itemSummary,
21
+ itemsBody: () => itemsBody
22
+ });
23
+ module.exports = __toCommonJS(item_list_exports);
24
+ var import_drawbridge_utils = require("@drawbridge/drawbridge-utils");
25
+ var import_fields_validate = require("@drawbridge/drawbridge-utils/fields-validate");
26
+ const itemSummary = (item = {}, prices, currency) => {
27
+ var _a;
28
+ return [
29
+ prices && typeof (item == null ? void 0 : item.price) === "number" && (0, import_drawbridge_utils.formatCurrency)({
30
+ code: currency.toUpperCase(),
31
+ display: "parts",
32
+ value: item.price
33
+ }),
34
+ ((_a = item == null ? void 0 : item.attributes) == null ? void 0 : _a.max) && import_fields_validate.errors.limit(item.attributes.max)
35
+ ].filter(Boolean).join(" \xB7 ");
36
+ };
37
+ const itemsBody = (items = []) => items.map((item) => {
38
+ var _a, _b;
39
+ return {
40
+ attributes: {
41
+ max: ((_a = item == null ? void 0 : item.attributes) == null ? void 0 : _a.max) ?? null
42
+ },
43
+ description: (item == null ? void 0 : item.description) || null,
44
+ ...(item == null ? void 0 : item.id) && {
45
+ id: item.id
46
+ },
47
+ // Resolved to the file on every read; an unresolved id is kept as it is.
48
+ image: (typeof (item == null ? void 0 : item.image) === "string" ? item.image : (_b = item == null ? void 0 : item.image) == null ? void 0 : _b.id) || null,
49
+ name: item == null ? void 0 : item.name,
50
+ price: (item == null ? void 0 : item.price) ?? null
51
+ };
52
+ });
53
+ // Annotate the CommonJS export names for ESM import in node:
54
+ 0 && (module.exports = {
55
+ itemSummary,
56
+ itemsBody
57
+ });
@@ -0,0 +1,33 @@
1
+ import { formatCurrency } from "@drawbridge/drawbridge-utils";
2
+ import { errors } from "@drawbridge/drawbridge-utils/fields-validate";
3
+ const itemSummary = (item = {}, prices, currency) => {
4
+ var _a;
5
+ return [
6
+ prices && typeof (item == null ? void 0 : item.price) === "number" && formatCurrency({
7
+ code: currency.toUpperCase(),
8
+ display: "parts",
9
+ value: item.price
10
+ }),
11
+ ((_a = item == null ? void 0 : item.attributes) == null ? void 0 : _a.max) && errors.limit(item.attributes.max)
12
+ ].filter(Boolean).join(" \xB7 ");
13
+ };
14
+ const itemsBody = (items = []) => items.map((item) => {
15
+ var _a, _b;
16
+ return {
17
+ attributes: {
18
+ max: ((_a = item == null ? void 0 : item.attributes) == null ? void 0 : _a.max) ?? null
19
+ },
20
+ description: (item == null ? void 0 : item.description) || null,
21
+ ...(item == null ? void 0 : item.id) && {
22
+ id: item.id
23
+ },
24
+ // Resolved to the file on every read; an unresolved id is kept as it is.
25
+ image: (typeof (item == null ? void 0 : item.image) === "string" ? item.image : (_b = item == null ? void 0 : item.image) == null ? void 0 : _b.id) || null,
26
+ name: item == null ? void 0 : item.name,
27
+ price: (item == null ? void 0 : item.price) ?? null
28
+ };
29
+ });
30
+ export {
31
+ itemSummary,
32
+ itemsBody
33
+ };
@@ -0,0 +1,50 @@
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 menu_exports = {};
19
+ __export(menu_exports, {
20
+ isActive: () => isActive,
21
+ menuRow: () => menuRow
22
+ });
23
+ module.exports = __toCommonJS(menu_exports);
24
+ const isActive = (item, path = "") => {
25
+ if (!(item == null ? void 0 : item.href)) return false;
26
+ if (item.exact) return path === item.href;
27
+ return path === item.href || path.startsWith(item.href + "/");
28
+ };
29
+ const menuRow = (row = {}, path = "") => {
30
+ const children = (row.children || []).map((child) => ({
31
+ ...child,
32
+ active: isActive(child, path)
33
+ }));
34
+ const inside = children.some((child) => child.active);
35
+ const active = isActive(row, path);
36
+ const open = active || inside;
37
+ return {
38
+ ...row,
39
+ active,
40
+ children,
41
+ error: Boolean(row.error) || !open && children.some((child) => child.error),
42
+ highlighted: active && !inside,
43
+ open
44
+ };
45
+ };
46
+ // Annotate the CommonJS export names for ESM import in node:
47
+ 0 && (module.exports = {
48
+ isActive,
49
+ menuRow
50
+ });
@@ -0,0 +1,26 @@
1
+ const isActive = (item, path = "") => {
2
+ if (!(item == null ? void 0 : item.href)) return false;
3
+ if (item.exact) return path === item.href;
4
+ return path === item.href || path.startsWith(item.href + "/");
5
+ };
6
+ const menuRow = (row = {}, path = "") => {
7
+ const children = (row.children || []).map((child) => ({
8
+ ...child,
9
+ active: isActive(child, path)
10
+ }));
11
+ const inside = children.some((child) => child.active);
12
+ const active = isActive(row, path);
13
+ const open = active || inside;
14
+ return {
15
+ ...row,
16
+ active,
17
+ children,
18
+ error: Boolean(row.error) || !open && children.some((child) => child.error),
19
+ highlighted: active && !inside,
20
+ open
21
+ };
22
+ };
23
+ export {
24
+ isActive,
25
+ menuRow
26
+ };
@@ -0,0 +1,82 @@
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 locked_exports = {};
30
+ __export(locked_exports, {
31
+ default: () => locked_default
32
+ });
33
+ module.exports = __toCommonJS(locked_exports);
34
+ var import_jsx_runtime = require("react/jsx-runtime");
35
+ var import_react = require("react");
36
+ var import_button = __toESM(require("../shared/button"));
37
+ var import_tooltip = __toESM(require("../shared/tooltip"));
38
+ var import_lock = __toESM(require("../icons/lock"));
39
+ const Locked = ({ locked }) => {
40
+ const [open, setOpen] = (0, import_react.useState)(false);
41
+ if (!locked) return null;
42
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
43
+ import_tooltip.default,
44
+ {
45
+ ...{
46
+ content: locked,
47
+ open
48
+ },
49
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
50
+ "span",
51
+ {
52
+ ...{
53
+ "aria-label": locked,
54
+ className: "inline-flex rounded [&_button]:pointer-events-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-black",
55
+ onBlur: () => setOpen(false),
56
+ onClick: () => setOpen(true),
57
+ onFocus: () => setOpen(true),
58
+ onMouseEnter: () => setOpen(true),
59
+ onMouseLeave: () => setOpen(false),
60
+ role: "img",
61
+ tabIndex: 0
62
+ },
63
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
64
+ import_button.default,
65
+ {
66
+ ...{
67
+ "aria-hidden": true,
68
+ disabled: true,
69
+ icon: import_lock.default,
70
+ inline: true,
71
+ size: "small",
72
+ tabIndex: -1,
73
+ variant: "secondary"
74
+ }
75
+ }
76
+ )
77
+ }
78
+ )
79
+ }
80
+ );
81
+ };
82
+ var locked_default = Locked;
@@ -0,0 +1,53 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { useState } from "react";
4
+ import Button from "../shared/button.mjs";
5
+ import Tooltip from "../shared/tooltip.mjs";
6
+ import LockIcon from "../icons/lock.mjs";
7
+ const Locked = ({ locked }) => {
8
+ const [open, setOpen] = useState(false);
9
+ if (!locked) return null;
10
+ return /* @__PURE__ */ jsx(
11
+ Tooltip,
12
+ {
13
+ ...{
14
+ content: locked,
15
+ open
16
+ },
17
+ children: /* @__PURE__ */ jsx(
18
+ "span",
19
+ {
20
+ ...{
21
+ "aria-label": locked,
22
+ className: "inline-flex rounded [&_button]:pointer-events-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-black",
23
+ onBlur: () => setOpen(false),
24
+ onClick: () => setOpen(true),
25
+ onFocus: () => setOpen(true),
26
+ onMouseEnter: () => setOpen(true),
27
+ onMouseLeave: () => setOpen(false),
28
+ role: "img",
29
+ tabIndex: 0
30
+ },
31
+ children: /* @__PURE__ */ jsx(
32
+ Button,
33
+ {
34
+ ...{
35
+ "aria-hidden": true,
36
+ disabled: true,
37
+ icon: LockIcon,
38
+ inline: true,
39
+ size: "small",
40
+ tabIndex: -1,
41
+ variant: "secondary"
42
+ }
43
+ }
44
+ )
45
+ }
46
+ )
47
+ }
48
+ );
49
+ };
50
+ var locked_default = Locked;
51
+ export {
52
+ locked_default as default
53
+ };
@@ -58,43 +58,91 @@ var import_provider_resource = __toESM(require("./provider-resource"));
58
58
  var import_wrapper_ai = __toESM(require("./wrapper-ai"));
59
59
  var import_button = __toESM(require("../shared/button"));
60
60
  var import_external = __toESM(require("../icons/external"));
61
+ var import_chart = __toESM(require("../icons/chart"));
62
+ var import_document = __toESM(require("../icons/document"));
63
+ var import_flag = __toESM(require("../icons/flag"));
64
+ var import_home = __toESM(require("../icons/home"));
65
+ var import_link2 = __toESM(require("../icons/link"));
66
+ var import_puzzle_piece = __toESM(require("../icons/puzzle-piece"));
67
+ var import_queue = __toESM(require("../icons/queue"));
68
+ var import_share = __toESM(require("../icons/share"));
69
+ var import_star = __toESM(require("../icons/star"));
70
+ var import_users = __toESM(require("../icons/users"));
71
+ var import_menu = require("./lib/menu");
72
+ const icons = {
73
+ chart: import_chart.default,
74
+ document: import_document.default,
75
+ flag: import_flag.default,
76
+ home: import_home.default,
77
+ link: import_link2.default,
78
+ // Connections (Darren, Dulce Local walk, 2026-10-29).
79
+ "puzzle-piece": import_puzzle_piece.default,
80
+ queue: import_queue.default,
81
+ share: import_share.default,
82
+ star: import_star.default,
83
+ users: import_users.default
84
+ };
61
85
  const MenuItem = ({
62
86
  active,
63
87
  badge,
64
88
  child,
65
- children,
89
+ children = [],
66
90
  disabled,
67
91
  element: Element = import_link.default,
68
92
  error,
93
+ highlighted = active,
94
+ icon,
69
95
  locked,
70
96
  onClick = () => {
71
97
  },
98
+ open = active,
72
99
  title,
73
100
  ...rest
74
101
  }) => {
75
- const hasChildren = (children == null ? void 0 : children.length) > 0;
76
- const isActive = active || hasChildren && children.some((c) => c.active);
102
+ const Icon = icons[icon];
77
103
  const classes = {
78
104
  row: [
79
- "flex items-center justify-between transform duration-300 text-left py-1 px-2 rounded",
80
- child ? "w-auto ml-3" : "w-full",
81
- isActive ? child ? "" : "bg-gray-dark" : "hover:bg-gray-dark/50",
105
+ "flex items-center justify-between w-full transform duration-300 text-left py-1 rounded",
106
+ // A page under a row lines up with the row's name, past its icon.
107
+ child ? "pl-9 pr-2" : "px-2",
108
+ highlighted ? "bg-gray-dark" : "hover:bg-gray-dark/50",
82
109
  // A Button fades itself from its own disabled prop.
83
110
  disabled && Element !== "button" && "disabled"
84
111
  ],
85
112
  text: [
86
- "flex items-center space-x-2 w-full",
87
- isActive ? child ? "text-white/50" : "text-white" : "text-white"
113
+ "flex items-center gap-2 w-full min-w-0",
114
+ child && !highlighted ? "text-white/60" : "text-white",
115
+ // The open row stays bold while a page under it is highlighted.
116
+ open && "font-medium"
88
117
  ]
89
118
  };
90
119
  const content = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [
91
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
120
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
92
121
  "span",
93
122
  {
94
123
  ...{
95
124
  className: classes.text.filter(Boolean).join(" ")
96
125
  },
97
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: title })
126
+ children: [
127
+ Icon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
128
+ Icon,
129
+ {
130
+ ...{
131
+ "aria-hidden": true,
132
+ className: "w-5 h-5 shrink-0"
133
+ }
134
+ }
135
+ ),
136
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
137
+ "span",
138
+ {
139
+ ...{
140
+ className: "truncate"
141
+ },
142
+ children: title
143
+ }
144
+ )
145
+ ]
98
146
  }
99
147
  ),
100
148
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
@@ -167,21 +215,22 @@ const MenuItem = ({
167
215
  children: content
168
216
  }
169
217
  ),
170
- hasChildren && isActive && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
218
+ open && children.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
171
219
  "div",
172
220
  {
173
221
  ...{
174
- className: "mb-4"
222
+ className: "mt-0.5 mb-2"
175
223
  },
176
- children: children.map((props, key) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
224
+ children: children.map(({ key: childKey, exact, ...props }, key) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
177
225
  MenuItem,
178
226
  {
179
227
  ...{
180
228
  ...props,
181
- child: true
229
+ child: true,
230
+ onClick
182
231
  }
183
232
  },
184
- key
233
+ childKey || key
185
234
  ))
186
235
  }
187
236
  )
@@ -219,17 +268,21 @@ const Menu = ({
219
268
  children: group.title
220
269
  }
221
270
  ),
222
- group.items.map(({ key: itemKey, exact, ...item }, index) => {
223
- const active = !item.href ? false : exact ? path === item.href : path === item.href || path.startsWith(item.href + "/");
271
+ group.items.map((item, index) => {
272
+ const { key: itemKey, exact, ...row } = (0, import_menu.menuRow)(item, path);
224
273
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
225
274
  MenuItem,
226
275
  {
227
276
  ...{
228
- ...item,
277
+ ...row,
278
+ // An item with no href is not a destination, and MenuItem
279
+ // defaults its element to Link — which hands next/link an
280
+ // undefined href, and formatUrl then destructures `auth` off
281
+ // undefined and takes the WHOLE PAGE down. A menu row that
282
+ // forgot its href should be an inert row, not a white screen.
229
283
  ...!item.href && {
230
284
  element: "div"
231
285
  },
232
- active,
233
286
  onClick
234
287
  }
235
288
  },