@flamingo-stack/openframe-frontend-core 0.0.219 → 0.0.220-snapshot.20260602172647

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 (146) hide show
  1. package/dist/{chunk-F3FO2ZZZ.cjs → chunk-4PBV66HQ.cjs} +7 -7
  2. package/dist/{chunk-F3FO2ZZZ.cjs.map → chunk-4PBV66HQ.cjs.map} +1 -1
  3. package/dist/{chunk-EDW2NVRV.js → chunk-4WZOFD46.js} +37 -37
  4. package/dist/{chunk-EDW2NVRV.js.map → chunk-4WZOFD46.js.map} +1 -1
  5. package/dist/{chunk-YX3YQNC4.cjs → chunk-73YDB6AT.cjs} +13 -13
  6. package/dist/{chunk-YX3YQNC4.cjs.map → chunk-73YDB6AT.cjs.map} +1 -1
  7. package/dist/{chunk-MPHDM2VZ.cjs → chunk-7TQNW2AM.cjs} +30 -30
  8. package/dist/{chunk-MPHDM2VZ.cjs.map → chunk-7TQNW2AM.cjs.map} +1 -1
  9. package/dist/{chunk-65CPJ4SX.cjs → chunk-C6ASEPZL.cjs} +30 -30
  10. package/dist/{chunk-65CPJ4SX.cjs.map → chunk-C6ASEPZL.cjs.map} +1 -1
  11. package/dist/{chunk-DRPECAXO.js → chunk-CPIX5AAR.js} +2 -2
  12. package/dist/{chunk-SRA2QYK6.js → chunk-E2AWBQEU.js} +4 -4
  13. package/dist/{chunk-SZXKKEUH.cjs → chunk-E6B4B7GM.cjs} +46 -30
  14. package/dist/chunk-E6B4B7GM.cjs.map +1 -0
  15. package/dist/{chunk-XG7DFRJL.js → chunk-FOOQFRJR.js} +3 -3
  16. package/dist/{chunk-A3PL6ZCF.js → chunk-IS4IZC7N.js} +6388 -5128
  17. package/dist/chunk-IS4IZC7N.js.map +1 -0
  18. package/dist/{chunk-ZGBXHK26.cjs → chunk-JMGSJHFP.cjs} +12 -12
  19. package/dist/{chunk-ZGBXHK26.cjs.map → chunk-JMGSJHFP.cjs.map} +1 -1
  20. package/dist/{chunk-SL3RGBPX.cjs → chunk-QNYH3WUU.cjs} +9 -9
  21. package/dist/{chunk-SL3RGBPX.cjs.map → chunk-QNYH3WUU.cjs.map} +1 -1
  22. package/dist/{chunk-24Q2WLIU.js → chunk-QYRV6MKX.js} +2 -2
  23. package/dist/{chunk-ZII7TNVA.js → chunk-SRCEVQYA.js} +3 -3
  24. package/dist/{chunk-Y3MXGCOW.js → chunk-YZDUOUMB.js} +46 -30
  25. package/dist/chunk-YZDUOUMB.js.map +1 -0
  26. package/dist/{chunk-7UZLRI7W.cjs → chunk-ZAGQXSAP.cjs} +3292 -2032
  27. package/dist/chunk-ZAGQXSAP.cjs.map +1 -0
  28. package/dist/components/chat/chat-archive-page.d.ts +25 -0
  29. package/dist/components/chat/chat-archive-page.d.ts.map +1 -0
  30. package/dist/components/chat/chat-composer.d.ts +29 -0
  31. package/dist/components/chat/chat-composer.d.ts.map +1 -0
  32. package/dist/components/chat/chat-header-icon-button.d.ts +14 -0
  33. package/dist/components/chat/chat-header-icon-button.d.ts.map +1 -0
  34. package/dist/components/chat/chat-panel-header.d.ts +32 -0
  35. package/dist/components/chat/chat-panel-header.d.ts.map +1 -0
  36. package/dist/components/chat/embeddable-chat.d.ts +18 -0
  37. package/dist/components/chat/embeddable-chat.d.ts.map +1 -1
  38. package/dist/components/chat/guide-mode-banner.d.ts +16 -0
  39. package/dist/components/chat/guide-mode-banner.d.ts.map +1 -0
  40. package/dist/components/chat/guide-welcome.d.ts +42 -0
  41. package/dist/components/chat/guide-welcome.d.ts.map +1 -0
  42. package/dist/components/chat/hooks/use-chat-dialog-manager.d.ts +58 -0
  43. package/dist/components/chat/hooks/use-chat-dialog-manager.d.ts.map +1 -0
  44. package/dist/components/chat/hooks/use-nats-chat-adapter.d.ts +26 -1
  45. package/dist/components/chat/hooks/use-nats-chat-adapter.d.ts.map +1 -1
  46. package/dist/components/chat/hooks/use-sse-chat-adapter.d.ts.map +1 -1
  47. package/dist/components/chat/hooks/use-unified-chat.d.ts.map +1 -1
  48. package/dist/components/chat/index.cjs +29 -5
  49. package/dist/components/chat/index.cjs.map +1 -1
  50. package/dist/components/chat/index.d.ts +9 -0
  51. package/dist/components/chat/index.d.ts.map +1 -1
  52. package/dist/components/chat/index.js +28 -4
  53. package/dist/components/chat/mingo-chat-history.d.ts +37 -0
  54. package/dist/components/chat/mingo-chat-history.d.ts.map +1 -0
  55. package/dist/components/chat/mingo-chat-modals.d.ts +50 -0
  56. package/dist/components/chat/mingo-chat-modals.d.ts.map +1 -0
  57. package/dist/components/chat/mingo-onboarding-card.d.ts.map +1 -1
  58. package/dist/components/chat/mingo-welcome.d.ts +78 -0
  59. package/dist/components/chat/mingo-welcome.d.ts.map +1 -0
  60. package/dist/components/chat/types/unified-chat-state.types.d.ts +6 -0
  61. package/dist/components/chat/types/unified-chat-state.types.d.ts.map +1 -1
  62. package/dist/components/contact/index.cjs +6 -6
  63. package/dist/components/contact/index.js +5 -5
  64. package/dist/components/features/index.cjs +5 -5
  65. package/dist/components/features/index.js +4 -4
  66. package/dist/components/icons-v2-generated/brand-logos/fleet-mdm-logo-grey-icon.d.ts.map +1 -1
  67. package/dist/components/icons-v2-generated/brand-logos/fleet-mdm-logo-icon.d.ts.map +1 -1
  68. package/dist/components/icons-v2-generated/index.cjs +2 -2
  69. package/dist/components/icons-v2-generated/index.js +1 -1
  70. package/dist/components/index.cjs +128 -104
  71. package/dist/components/index.cjs.map +1 -1
  72. package/dist/components/index.js +31 -7
  73. package/dist/components/index.js.map +1 -1
  74. package/dist/components/layout/page-heading.d.ts +7 -6
  75. package/dist/components/layout/page-heading.d.ts.map +1 -1
  76. package/dist/components/navigation/app-layout-drawer.d.ts.map +1 -1
  77. package/dist/components/navigation/header-mingo-button.d.ts +4 -2
  78. package/dist/components/navigation/header-mingo-button.d.ts.map +1 -1
  79. package/dist/components/navigation/index.cjs +5 -5
  80. package/dist/components/navigation/index.js +4 -4
  81. package/dist/components/onboarding-guides/index.cjs +28 -28
  82. package/dist/components/onboarding-guides/index.js +6 -6
  83. package/dist/components/tickets/index.cjs +88 -88
  84. package/dist/components/tickets/index.js +7 -7
  85. package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
  86. package/dist/components/ui/file-manager/index.cjs +50 -50
  87. package/dist/components/ui/file-manager/index.js +1 -1
  88. package/dist/components/ui/index.cjs +29 -5
  89. package/dist/components/ui/index.cjs.map +1 -1
  90. package/dist/components/ui/index.js +28 -4
  91. package/dist/components/ui/modal-v2.d.ts.map +1 -1
  92. package/dist/components/ui/more-actions-menu.d.ts +8 -1
  93. package/dist/components/ui/more-actions-menu.d.ts.map +1 -1
  94. package/dist/components/ui/portal-container.d.ts +21 -0
  95. package/dist/components/ui/portal-container.d.ts.map +1 -0
  96. package/dist/components/ui/tooltip.d.ts.map +1 -1
  97. package/dist/hooks/index.cjs +3 -3
  98. package/dist/hooks/index.js +2 -2
  99. package/dist/index.cjs +29 -5
  100. package/dist/index.cjs.map +1 -1
  101. package/dist/index.js +28 -4
  102. package/package.json +1 -1
  103. package/src/components/chat/chat-archive-page.tsx +93 -0
  104. package/src/components/chat/chat-composer.tsx +99 -0
  105. package/src/components/chat/chat-header-icon-button.tsx +36 -0
  106. package/src/components/chat/chat-panel-header.tsx +114 -0
  107. package/src/components/chat/embeddable-chat.tsx +388 -311
  108. package/src/components/chat/guide-mode-banner.tsx +75 -0
  109. package/src/components/chat/guide-welcome.tsx +199 -0
  110. package/src/components/chat/hooks/use-chat-dialog-manager.ts +227 -0
  111. package/src/components/chat/hooks/use-nats-chat-adapter.ts +85 -0
  112. package/src/components/chat/hooks/use-sse-chat-adapter.ts +8 -0
  113. package/src/components/chat/hooks/use-unified-chat.ts +12 -0
  114. package/src/components/chat/index.ts +9 -0
  115. package/src/components/chat/mingo-chat-history.tsx +308 -0
  116. package/src/components/chat/mingo-chat-modals.tsx +223 -0
  117. package/src/components/chat/mingo-onboarding-card.tsx +5 -8
  118. package/src/components/chat/mingo-welcome.tsx +396 -0
  119. package/src/components/chat/types/unified-chat-state.types.ts +8 -0
  120. package/src/components/icons-v2/brand-logos/fleet-mdm-logo-grey.svg +6 -6
  121. package/src/components/icons-v2/brand-logos/fleet-mdm-logo.svg +6 -6
  122. package/src/components/icons-v2-generated/brand-logos/fleet-mdm-logo-grey-icon.tsx +2 -22
  123. package/src/components/icons-v2-generated/brand-logos/fleet-mdm-logo-icon.tsx +22 -2
  124. package/src/components/layout/page-heading.tsx +13 -7
  125. package/src/components/navigation/app-header.tsx +12 -12
  126. package/src/components/navigation/app-layout-drawer.tsx +25 -15
  127. package/src/components/navigation/header-mingo-button.tsx +22 -7
  128. package/src/components/ui/dropdown-menu.tsx +9 -3
  129. package/src/components/ui/modal-v2.tsx +33 -3
  130. package/src/components/ui/more-actions-menu.tsx +15 -2
  131. package/src/components/ui/portal-container.tsx +28 -0
  132. package/src/components/ui/tooltip.tsx +9 -3
  133. package/src/stories/AppLayoutSidebar.stories.tsx +184 -0
  134. package/src/stories/EmbeddableChat.stories.tsx +114 -0
  135. package/src/stories/GuideWelcome.stories.tsx +124 -0
  136. package/src/stories/MingoChatModals.stories.tsx +82 -0
  137. package/src/stories/MingoWelcome.stories.tsx +119 -0
  138. package/dist/chunk-7UZLRI7W.cjs.map +0 -1
  139. package/dist/chunk-A3PL6ZCF.js.map +0 -1
  140. package/dist/chunk-SZXKKEUH.cjs.map +0 -1
  141. package/dist/chunk-Y3MXGCOW.js.map +0 -1
  142. /package/dist/{chunk-DRPECAXO.js.map → chunk-CPIX5AAR.js.map} +0 -0
  143. /package/dist/{chunk-SRA2QYK6.js.map → chunk-E2AWBQEU.js.map} +0 -0
  144. /package/dist/{chunk-XG7DFRJL.js.map → chunk-FOOQFRJR.js.map} +0 -0
  145. /package/dist/{chunk-24Q2WLIU.js.map → chunk-QYRV6MKX.js.map} +0 -0
  146. /package/dist/{chunk-ZII7TNVA.js.map → chunk-SRCEVQYA.js.map} +0 -0
@@ -6,11 +6,11 @@
6
6
 
7
7
 
8
8
 
9
- var _chunk7UZLRI7Wcjs = require('./chunk-7UZLRI7W.cjs');
9
+ var _chunkZAGQXSAPcjs = require('./chunk-ZAGQXSAP.cjs');
10
10
 
11
11
 
12
12
 
13
- var _chunkSZXKKEUHcjs = require('./chunk-SZXKKEUH.cjs');
13
+ var _chunkE6B4B7GMcjs = require('./chunk-E6B4B7GM.cjs');
14
14
 
15
15
 
16
16
 
@@ -64,7 +64,7 @@ function UnifiedPagination({
64
64
  };
65
65
  if (totalPages <= 1) return null;
66
66
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
67
- _chunk7UZLRI7Wcjs.Pagination,
67
+ _chunkZAGQXSAPcjs.Pagination,
68
68
  {
69
69
  currentPage,
70
70
  totalPages,
@@ -77,12 +77,12 @@ var init_unified_pagination = _chunkVRHGVLSLcjs.__esm.call(void 0, {
77
77
  "use strict";
78
78
  "use client";
79
79
  _chunkG7UE6RKVcjs.init_next_navigation.call(void 0, );
80
- _chunk7UZLRI7Wcjs.init_pagination.call(void 0, );
80
+ _chunkZAGQXSAPcjs.init_pagination.call(void 0, );
81
81
  }
82
82
  });
83
83
 
84
84
  // src/components/empty-state.tsx
85
- _chunkSZXKKEUHcjs.init_button2.call(void 0, );
85
+ _chunkE6B4B7GMcjs.init_button2.call(void 0, );
86
86
  _chunkG7UE6RKVcjs.init_next_navigation.call(void 0, );
87
87
  var _lucidereact = require('lucide-react');
88
88
 
@@ -208,7 +208,7 @@ function EmptyState({
208
208
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h2", { className: "mb-2 md:mb-3 text-lg md:text-xl font-semibold font-['DM_Sans'] text-ods-text-primary tracking-[-0.02em]", children: displayTitle }),
209
209
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "mb-4 md:mb-8 max-w-md text-sm font-medium font-['DM_Sans'] text-ods-text-secondary leading-[1.43em]", children: displayDescription }),
210
210
  showCTA && smartCTA && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "w-full max-w-xs mb-3", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
211
- _chunkSZXKKEUHcjs.Button,
211
+ _chunkE6B4B7GMcjs.Button,
212
212
  {
213
213
  onClick: smartCTA.action,
214
214
  className: ctaVariant === "primary" ? "w-full bg-[#FFC008] text-black hover:bg-[#FFC008]/90 transition-all duration-150 font-['DM_Sans'] font-medium" : "w-full bg-transparent border border-ods-border text-ods-text-primary hover:border-[#FFC008] hover:text-ods-accent transition-all duration-150 font-['DM_Sans'] font-medium",
@@ -216,7 +216,7 @@ function EmptyState({
216
216
  }
217
217
  ) }),
218
218
  showBackButton && onGoBack && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "w-full max-w-xs", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
219
- _chunkSZXKKEUHcjs.Button,
219
+ _chunkE6B4B7GMcjs.Button,
220
220
  {
221
221
  onClick: onGoBack,
222
222
  variant: "outline",
@@ -249,9 +249,9 @@ function DeliveryRow({
249
249
  className
250
250
  }) {
251
251
  const taskType = item.taskType;
252
- const typeBadgeLabel = _chunk7UZLRI7Wcjs.TASK_TYPE_LABELS[taskType] || "TASK";
253
- const typeBadgeTextColor = _chunk7UZLRI7Wcjs.TASK_TYPE_TEXT_COLORS[taskType] || "";
254
- const statusBadgeScheme = _chunk7UZLRI7Wcjs.getStatusColorScheme.call(void 0, item.status);
252
+ const typeBadgeLabel = _chunkZAGQXSAPcjs.TASK_TYPE_LABELS[taskType] || "TASK";
253
+ const typeBadgeTextColor = _chunkZAGQXSAPcjs.TASK_TYPE_TEXT_COLORS[taskType] || "";
254
+ const statusBadgeScheme = _chunkZAGQXSAPcjs.getStatusColorScheme.call(void 0, item.status);
255
255
  const relativeTime = getRelativeTime(item.dateUpdated);
256
256
  const subtitle = `ACTIVE ${relativeTime}${item.listNames.length > 0 ? `, ${item.listNames.join(", ")}` : ""}, ${item.id}`;
257
257
  const inner = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col md:flex-row items-start justify-between gap-[12px] md:gap-[16px] w-full", children: [
@@ -263,7 +263,7 @@ function DeliveryRow({
263
263
  ] }),
264
264
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex-shrink-0 self-start flex flex-col gap-2", children: [
265
265
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
266
- _chunk7UZLRI7Wcjs.StatusBadge,
266
+ _chunkZAGQXSAPcjs.StatusBadge,
267
267
  {
268
268
  text: item.status.toUpperCase(),
269
269
  colorScheme: statusBadgeScheme,
@@ -272,7 +272,7 @@ function DeliveryRow({
272
272
  }
273
273
  ),
274
274
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
275
- _chunk7UZLRI7Wcjs.StatusBadge,
275
+ _chunkZAGQXSAPcjs.StatusBadge,
276
276
  {
277
277
  text: typeBadgeLabel,
278
278
  variant: "card",
@@ -299,4 +299,4 @@ function DeliveryRow({
299
299
 
300
300
 
301
301
  exports.EmptyState = EmptyState; exports.UnifiedPagination = UnifiedPagination; exports.unified_pagination_exports = unified_pagination_exports; exports.init_unified_pagination = init_unified_pagination; exports.DeliveryRow = DeliveryRow;
302
- //# sourceMappingURL=chunk-YX3YQNC4.cjs.map
302
+ //# sourceMappingURL=chunk-73YDB6AT.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-YX3YQNC4.cjs","../src/components/unified-pagination.tsx","../src/components/empty-state.tsx","../src/components/shared/delivery/delivery-row.tsx"],"names":["jsx","jsxs"],"mappings":"AAAA,qFAAY;AACZ;AACE;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;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AEE,oBAAA;AASA,oBAAA;AAKA,oBAAA;AAKY,IAAA;AAEP,MAAA;AAAA,MAAA;AACU,QAAA;AACE,QAAA;AAKV,QAAA;AAAS,MAAA;AAEd,IAAA;AAID,IAAA;AAEI,MAAA;AAAA,MAAA;AACU,QAAA;AACD,QAAA;AACE,QAAA;AAET,QAAA;AAAA,MAAA;AAEL,IAAA;AAEJ,EAAA;AAEJ;AFyBoB;AACA;AG1MpB;AAQA;AAgDUA;AA5CD;AACU,EAAA;AACJ,EAAA;AACK,EAAA;AACJ,EAAA;AACC,EAAA;AACC,EAAA;AACD,EAAA;AACD,EAAA;AACP,EAAA;AACT;AAgBgB;AACd,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACmB;AACF,EAAA;AACX,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACW,EAAA;AAGf,EAAA;AAEEC,oBAAAA;AAEI,MAAA;AAIF,sBAAA;AAKA,sBAAA;AAKA,sBAAA;AAKF,IAAA;AAGAA,oBAAAA;AACE,sBAAA;AAAC,QAAA;AAAA,QAAA;AACO,UAAA;AACN,UAAA;AACQ,UAAA;AACR,UAAA;AAAU,QAAA;AACZ,MAAA;AACA,sBAAA;AAAC,QAAA;AAAA,QAAA;AACO,UAAA;AACE,UAAA;AACR,UAAA;AAAyD,QAAA;AAC3D,MAAA;AACF,IAAA;AACF,EAAA;AAGgB,EAAA;AAChB,IAAA;AACQ,IAAA;AACR,IAAA;AACF,EAAA;AAEU,EAAA;AAQN,IAAA;AAIJ,EAAA;AAEO,EAAA;AACT;AHuJoB;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-YX3YQNC4.cjs","sourcesContent":[null,"\"use client\"\n\nimport { useRouter, useSearchParams, usePathname } from \"../embed-shims/next-navigation\"\nimport { Pagination } from \"./pagination\"\n\ninterface UnifiedPaginationProps {\n currentPage: number\n totalPages: number\n onPageChange?: (page: number) => void\n className?: string\n}\n\nexport function UnifiedPagination({ \n currentPage, \n totalPages, \n onPageChange,\n className = \"mt-8 flex justify-center w-full\"\n}: UnifiedPaginationProps) {\n const router = useRouter()\n const searchParams = useSearchParams()\n const pathname = usePathname()\n\n const handlePageChange = (page: number) => {\n // Preserve current scroll position\n const currentScrollY = window.scrollY\n \n // Call the callback to update local state (prevents reload)\n if (onPageChange) {\n onPageChange(page)\n }\n \n // Update URL for bookmarking without navigation\n const params = new URLSearchParams(searchParams.toString())\n params.set(\"page\", page.toString())\n \n // Update URL without navigation (for bookmarking support)\n const newUrl = `${pathname}?${params.toString()}`\n window.history.replaceState(null, '', newUrl)\n \n // Restore scroll position after a brief delay to allow content to render\n setTimeout(() => {\n window.scrollTo({\n top: currentScrollY,\n behavior: 'instant' // Instant to prevent any scroll animation\n })\n }, 0)\n }\n\n // Don't render pagination if there's only one page\n if (totalPages <= 1) return null\n\n return (\n <div className={className}>\n <Pagination\n currentPage={currentPage}\n totalPages={totalPages}\n onPageChange={handlePageChange}\n />\n </div>\n )\n} ","\"use client\";\n\nimport { Search, FileText, Package } from \"lucide-react\"\nimport { Button } from \"./ui/button\"\nimport { useRouter } from \"../embed-shims/next-navigation\"\n\nexport interface EmptyStateProps {\n type: 'vendors' | 'posts' | 'search' | 'generic'\n title?: string\n description?: string\n showBackButton?: boolean\n onGoBack?: () => void\n backButtonText?: string\n // New CTA properties\n showCTA?: boolean\n ctaText?: string\n onCtaClick?: () => void\n ctaVariant?: 'primary' | 'secondary'\n}\n\nexport function EmptyState({\n type,\n title,\n description,\n showBackButton = false,\n onGoBack,\n backButtonText = \"Go Back\",\n showCTA = true,\n ctaText,\n onCtaClick,\n ctaVariant = 'primary'\n}: EmptyStateProps) {\n const router = useRouter()\n\n // Default content based on type\n const getDefaultContent = () => {\n switch (type) {\n case 'vendors':\n return {\n icon: <Package className=\"w-full h-full\" />,\n title: \"No vendors found\",\n description: \"We couldn't find any vendors matching your criteria. Try adjusting your filters or search terms.\"\n }\n case 'posts':\n return {\n icon: <FileText className=\"w-full h-full\" />,\n title: \"No articles found\",\n description: \"We couldn't find any articles matching your criteria. Try different categories, tags, or search terms.\"\n }\n case 'search':\n return {\n icon: <Search className=\"w-full h-full\" />,\n title: \"No results found\",\n description: \"Your search didn't return any results. Try different keywords or browse our categories.\"\n }\n default:\n return {\n icon: <Search className=\"w-full h-full\" />,\n title: \"Nothing found\",\n description: \"We couldn't find what you're looking for. Try adjusting your search or filters.\"\n }\n }\n }\n\n // Smart CTA logic based on context\n const getSmartCTA = () => {\n // If custom CTA is provided, use it\n if (ctaText && onCtaClick) {\n return {\n text: ctaText,\n action: onCtaClick\n }\n }\n\n // Check if we're on the client side\n const isClient = typeof window !== 'undefined'\n const currentPath = isClient ? window.location.pathname : ''\n\n // Smart defaults based on type and context\n switch (type) {\n case 'search':\n return {\n text: \"Reset Filters\",\n action: () => {\n if (isClient) {\n // Try to reset search by clearing URL params and refreshing\n const url = new URL(window.location.href)\n url.search = ''\n router.push(url.pathname)\n }\n }\n }\n case 'posts':\n // If we're on blog/community pages, reset blog filters\n if (currentPath.includes('/blog')) {\n return {\n text: \"Reset Filters\",\n action: () => {\n if (isClient) {\n // Reset blog search and filters by clearing URL params\n const url = new URL(window.location.href)\n url.search = ''\n router.push(url.pathname)\n }\n }\n }\n } else if (currentPath.includes('/profile')) {\n return {\n text: \"Browse Vendors\",\n action: () => router.push('/vendors')\n }\n }\n return {\n text: \"View All Posts\",\n action: () => router.push('/blog')\n }\n case 'vendors':\n // If we're in profile or other pages, direct to main content\n if (currentPath.includes('/profile')) {\n return {\n text: \"Browse Vendors\",\n action: () => router.push('/vendors')\n }\n } else if (currentPath.includes('/vendors') || currentPath.includes('/margin-increase/compare')) {\n return {\n text: \"Reset Filters\",\n action: () => {\n if (isClient) {\n // Reset vendor search and filters by clearing URL params\n const url = new URL(window.location.href)\n url.search = ''\n router.push(url.pathname)\n }\n }\n }\n }\n return {\n text: \"Browse Vendors\",\n action: () => router.push('/vendors')\n }\n default:\n return {\n text: \"Browse Vendors\",\n action: () => router.push('/vendors')\n }\n }\n }\n\n const defaultContent = getDefaultContent()\n const displayTitle = title || defaultContent.title\n const displayDescription = description || defaultContent.description\n const smartCTA = getSmartCTA()\n\n return (\n <div className=\"flex flex-col items-center justify-center py-6 md:py-16 px-6 text-center\">\n {/* Icon */}\n <div className=\"mb-3 md:mb-6 flex items-center justify-center\">\n <div className=\"rounded-full bg-ods-card p-3 md:p-6 border border-ods-border\">\n <div className=\"w-8 h-8 md:w-16 md:h-16 text-ods-text-secondary flex items-center justify-center\">\n {defaultContent.icon}\n </div>\n </div>\n </div>\n\n {/* Title */}\n <h2 className=\"mb-2 md:mb-3 text-lg md:text-xl font-semibold font-['DM_Sans'] text-ods-text-primary tracking-[-0.02em]\">\n {displayTitle}\n </h2>\n\n {/* Description */}\n <p className=\"mb-4 md:mb-8 max-w-md text-sm font-medium font-['DM_Sans'] text-ods-text-secondary leading-[1.43em]\">\n {displayDescription}\n </p>\n\n {/* Smart CTA Button */}\n {showCTA && smartCTA && (\n <div className=\"w-full max-w-xs mb-3\">\n <Button\n onClick={smartCTA.action}\n className={ctaVariant === 'primary' \n ? \"w-full bg-[#FFC008] text-black hover:bg-[#FFC008]/90 transition-all duration-150 font-['DM_Sans'] font-medium\"\n : \"w-full bg-transparent border border-ods-border text-ods-text-primary hover:border-[#FFC008] hover:text-ods-accent transition-all duration-150 font-['DM_Sans'] font-medium\"\n }\n >\n {smartCTA.text}\n </Button>\n </div>\n )}\n\n {/* Optional Back Button */}\n {showBackButton && onGoBack && (\n <div className=\"w-full max-w-xs\">\n <Button\n onClick={onGoBack}\n variant=\"outline\"\n className=\"w-full transition-all duration-150 font-['DM_Sans'] font-medium\"\n >\n {backButtonText}\n </Button>\n </div>\n )}\n </div>\n )\n} ","'use client'\n\n/**\n * `<DeliveryRow />` — canonical single-row presentation for a ClickUp\n * delivery item.\n *\n * Single source of truth: both the `/bug-fixes-and-enhancements` page\n * (via `DeliveryTable`) AND the linked-delivery card on a HubSpot ticket\n * (via `TicketLinkedDeliveryCard`) compose this primitive. Visual parity\n * across those two surfaces is the design goal — the user reads the\n * card on their ticket and recognises it as a row from the public\n * delivery list.\n *\n * Behaviors:\n * - `href` set → outer element is an `<a>`, the whole row becomes\n * clickable (used by the linked-card surface to deep-link into\n * `/bug-fixes-and-enhancements?focus=<id>`).\n * - `id` set → outer element gets that DOM id so the consuming page\n * can `scrollIntoView` to it when the URL carries `?focus=<id>`.\n * - `highlighted` true → brief accent border + background pulse\n * (`animate-flash-focus` keyframe defined in `tailwind.config.ts`).\n * - `caption` set → small uppercase label rendered above the title\n * (\"LINKED DELIVERY\" on the ticket-side variant). Omitted on the\n * standard list rendering.\n */\n\nimport * as React from 'react'\nimport Link from '../../../embed-shims/next-link'\nimport { StatusBadge } from '../../ui/status-badge'\nimport { getStatusColorScheme } from '../../../utils'\nimport {\n type DeliveryItem,\n TASK_TYPE_LABELS,\n TASK_TYPE_TEXT_COLORS,\n} from '../../../types/delivery'\nimport { cn } from '../../../utils/cn'\n\n/** Same heuristic as DeliveryTable's local helper. Inlined so the row\n * primitive owns its complete rendering contract. */\nfunction getRelativeTime(timestamp: number): string {\n const now = Date.now()\n const diff = now - timestamp\n const days = Math.floor(diff / (1000 * 60 * 60 * 24))\n const weeks = Math.floor(days / 7)\n const months = Math.floor(days / 30)\n if (months > 0) return months === 1 ? 'last month' : `${months} months ago`\n if (weeks > 0) return weeks === 1 ? 'last week' : `${weeks} weeks ago`\n if (days > 0) return days === 1 ? 'yesterday' : `${days} days ago`\n return 'today'\n}\n\nexport interface DeliveryRowProps {\n item: DeliveryItem\n /** When set, the row becomes a clickable anchor. The ticket-side\n * linked-card composes this from `buildDevSectionUrl('delivery', id)`\n * which carries `?search=<id>` — the delivery list filters to that\n * exact task on landing (canonical deep-link mechanism, same one\n * the chat-inline delivery card uses). */\n href?: string\n /** Small uppercase caption rendered above the title. Used by the\n * linked-delivery card variant (\"LINKED DELIVERY\"). */\n caption?: string\n className?: string\n}\n\nexport function DeliveryRow({\n item,\n href,\n caption,\n className,\n}: DeliveryRowProps) {\n const taskType = item.taskType as keyof typeof TASK_TYPE_LABELS\n const typeBadgeLabel = TASK_TYPE_LABELS[taskType] || 'TASK'\n const typeBadgeTextColor = TASK_TYPE_TEXT_COLORS[taskType] || ''\n const statusBadgeScheme = getStatusColorScheme(item.status)\n const relativeTime = getRelativeTime(item.dateUpdated)\n const subtitle = `ACTIVE ${relativeTime}${item.listNames.length > 0 ? `, ${item.listNames.join(', ')}` : ''}, ${item.id}`\n\n const inner = (\n <div className=\"flex flex-col md:flex-row items-start justify-between gap-[12px] md:gap-[16px] w-full\">\n {/* Left: caption (optional) + title + subtitle + description */}\n <div className=\"flex-1 min-w-0 w-full md:w-auto flex flex-col gap-[12px] md:gap-[16px]\">\n {caption && (\n <p className=\"text-xs font-medium uppercase tracking-wider text-ods-text-secondary\">\n {caption}\n </p>\n )}\n <div className=\"min-h-[24px] md:min-h-[24px] flex items-center\">\n <h3 className=\"text-h3 text-ods-text-primary tracking-[-0.36px] flex-1 line-clamp-2 md:truncate break-words\">\n {item.title}\n </h3>\n </div>\n <div className=\"min-h-[20px] flex items-center\">\n <p className=\"text-h5 text-ods-text-secondary uppercase tracking-[-0.28px] truncate\">\n {subtitle}\n </p>\n </div>\n <div className=\"min-h-[72px] flex items-center\">\n <p className=\"text-h4 text-ods-text-secondary line-clamp-3 break-words\">\n {item.description || 'No description provided'}\n </p>\n </div>\n </div>\n\n {/* Right: status + task-type badges */}\n <div className=\"flex-shrink-0 self-start flex flex-col gap-2\">\n <StatusBadge\n text={item.status.toUpperCase()}\n colorScheme={statusBadgeScheme}\n variant=\"card\"\n className=\"border border-ods-border\"\n />\n <StatusBadge\n text={typeBadgeLabel}\n variant=\"card\"\n className={`border border-ods-border ${typeBadgeTextColor}`}\n />\n </div>\n </div>\n )\n\n const baseClass = cn(\n 'block p-[12px] md:p-[16px] no-underline text-inherit transition-colors duration-150',\n href && 'hover:bg-ods-bg-hover cursor-pointer',\n className,\n )\n\n if (href) {\n // `Link` is the env-aware embed-shim — delegates to `next/link` on\n // a Next.js host (soft RSC nav, back-button restores the previous\n // page's React state intact), falls back to a plain `<a>` on\n // non-Next embedders. A raw `<a href>` was hard-navigating +\n // losing TanStack-Query state on back, leaving /tickets stuck on\n // its skeleton.\n return (\n <Link href={href} className={baseClass} prefetch={false}>\n {inner}\n </Link>\n )\n }\n\n return <div className={baseClass}>{inner}</div>\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-73YDB6AT.cjs","../src/components/unified-pagination.tsx","../src/components/empty-state.tsx","../src/components/shared/delivery/delivery-row.tsx"],"names":["jsx","jsxs"],"mappings":"AAAA,qFAAY;AACZ;AACE;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACA;AChCA,IAAA,2BAAA,EAAA,CAAA,CAAA;AAAA,wCAAA,0BAAA,EAAA;AAAA,EAAA,iBAAA,EAAA,CAAA,EAAA,GAAA;AAAA,CAAA,CAAA;AAqDM,+CAAA;AAzCC,SAAS,iBAAA,CAAkB;AAAA,EAChC,WAAA;AAAA,EACA,UAAA;AAAA,EACA,YAAA;AAAA,EACA,UAAA,EAAY;AACd,CAAA,EAA2B;AACzB,EAAA,MAAM,OAAA,EAAS,yCAAA,CAAU;AACzB,EAAA,MAAM,aAAA,EAAe,+CAAA,CAAgB;AACrC,EAAA,MAAM,SAAA,EAAW,2CAAA,CAAY;AAE7B,EAAA,MAAM,iBAAA,EAAmB,CAAC,IAAA,EAAA,GAAiB;AAEzC,IAAA,MAAM,eAAA,EAAiB,MAAA,CAAO,OAAA;AAG9B,IAAA,GAAA,CAA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AA;AAEI,MAAA;AAIF,sBAAA;AAKA,sBAAA;AAKA,sBAAA;AAKF,IAAA;AAGAA,oBAAAA;AACE,sBAAA;AAAC,QAAA;AAAA,QAAA;AACO,UAAA;AACN,UAAA;AACQ,UAAA;AACR,UAAA;AAAU,QAAA;AACZ,MAAA;AACA,sBAAA;AAAC,QAAA;AAAA,QAAA;AACO,UAAA;AACE,UAAA;AACR,UAAA;AAAyD,QAAA;AAC3D,MAAA;AACF,IAAA;AACF,EAAA;AAGgB,EAAA;AAChB,IAAA;AACQ,IAAA;AACR,IAAA;AACF,EAAA;AAEU,EAAA;AAQN,IAAA;AAIJ,EAAA;AAEO,EAAA;AACT;AHuJoB;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-73YDB6AT.cjs","sourcesContent":[null,"\"use client\"\n\nimport { useRouter, useSearchParams, usePathname } from \"../embed-shims/next-navigation\"\nimport { Pagination } from \"./pagination\"\n\ninterface UnifiedPaginationProps {\n currentPage: number\n totalPages: number\n onPageChange?: (page: number) => void\n className?: string\n}\n\nexport function UnifiedPagination({ \n currentPage, \n totalPages, \n onPageChange,\n className = \"mt-8 flex justify-center w-full\"\n}: UnifiedPaginationProps) {\n const router = useRouter()\n const searchParams = useSearchParams()\n const pathname = usePathname()\n\n const handlePageChange = (page: number) => {\n // Preserve current scroll position\n const currentScrollY = window.scrollY\n \n // Call the callback to update local state (prevents reload)\n if (onPageChange) {\n onPageChange(page)\n }\n \n // Update URL for bookmarking without navigation\n const params = new URLSearchParams(searchParams.toString())\n params.set(\"page\", page.toString())\n \n // Update URL without navigation (for bookmarking support)\n const newUrl = `${pathname}?${params.toString()}`\n window.history.replaceState(null, '', newUrl)\n \n // Restore scroll position after a brief delay to allow content to render\n setTimeout(() => {\n window.scrollTo({\n top: currentScrollY,\n behavior: 'instant' // Instant to prevent any scroll animation\n })\n }, 0)\n }\n\n // Don't render pagination if there's only one page\n if (totalPages <= 1) return null\n\n return (\n <div className={className}>\n <Pagination\n currentPage={currentPage}\n totalPages={totalPages}\n onPageChange={handlePageChange}\n />\n </div>\n )\n} ","\"use client\";\n\nimport { Search, FileText, Package } from \"lucide-react\"\nimport { Button } from \"./ui/button\"\nimport { useRouter } from \"../embed-shims/next-navigation\"\n\nexport interface EmptyStateProps {\n type: 'vendors' | 'posts' | 'search' | 'generic'\n title?: string\n description?: string\n showBackButton?: boolean\n onGoBack?: () => void\n backButtonText?: string\n // New CTA properties\n showCTA?: boolean\n ctaText?: string\n onCtaClick?: () => void\n ctaVariant?: 'primary' | 'secondary'\n}\n\nexport function EmptyState({\n type,\n title,\n description,\n showBackButton = false,\n onGoBack,\n backButtonText = \"Go Back\",\n showCTA = true,\n ctaText,\n onCtaClick,\n ctaVariant = 'primary'\n}: EmptyStateProps) {\n const router = useRouter()\n\n // Default content based on type\n const getDefaultContent = () => {\n switch (type) {\n case 'vendors':\n return {\n icon: <Package className=\"w-full h-full\" />,\n title: \"No vendors found\",\n description: \"We couldn't find any vendors matching your criteria. Try adjusting your filters or search terms.\"\n }\n case 'posts':\n return {\n icon: <FileText className=\"w-full h-full\" />,\n title: \"No articles found\",\n description: \"We couldn't find any articles matching your criteria. Try different categories, tags, or search terms.\"\n }\n case 'search':\n return {\n icon: <Search className=\"w-full h-full\" />,\n title: \"No results found\",\n description: \"Your search didn't return any results. Try different keywords or browse our categories.\"\n }\n default:\n return {\n icon: <Search className=\"w-full h-full\" />,\n title: \"Nothing found\",\n description: \"We couldn't find what you're looking for. Try adjusting your search or filters.\"\n }\n }\n }\n\n // Smart CTA logic based on context\n const getSmartCTA = () => {\n // If custom CTA is provided, use it\n if (ctaText && onCtaClick) {\n return {\n text: ctaText,\n action: onCtaClick\n }\n }\n\n // Check if we're on the client side\n const isClient = typeof window !== 'undefined'\n const currentPath = isClient ? window.location.pathname : ''\n\n // Smart defaults based on type and context\n switch (type) {\n case 'search':\n return {\n text: \"Reset Filters\",\n action: () => {\n if (isClient) {\n // Try to reset search by clearing URL params and refreshing\n const url = new URL(window.location.href)\n url.search = ''\n router.push(url.pathname)\n }\n }\n }\n case 'posts':\n // If we're on blog/community pages, reset blog filters\n if (currentPath.includes('/blog')) {\n return {\n text: \"Reset Filters\",\n action: () => {\n if (isClient) {\n // Reset blog search and filters by clearing URL params\n const url = new URL(window.location.href)\n url.search = ''\n router.push(url.pathname)\n }\n }\n }\n } else if (currentPath.includes('/profile')) {\n return {\n text: \"Browse Vendors\",\n action: () => router.push('/vendors')\n }\n }\n return {\n text: \"View All Posts\",\n action: () => router.push('/blog')\n }\n case 'vendors':\n // If we're in profile or other pages, direct to main content\n if (currentPath.includes('/profile')) {\n return {\n text: \"Browse Vendors\",\n action: () => router.push('/vendors')\n }\n } else if (currentPath.includes('/vendors') || currentPath.includes('/margin-increase/compare')) {\n return {\n text: \"Reset Filters\",\n action: () => {\n if (isClient) {\n // Reset vendor search and filters by clearing URL params\n const url = new URL(window.location.href)\n url.search = ''\n router.push(url.pathname)\n }\n }\n }\n }\n return {\n text: \"Browse Vendors\",\n action: () => router.push('/vendors')\n }\n default:\n return {\n text: \"Browse Vendors\",\n action: () => router.push('/vendors')\n }\n }\n }\n\n const defaultContent = getDefaultContent()\n const displayTitle = title || defaultContent.title\n const displayDescription = description || defaultContent.description\n const smartCTA = getSmartCTA()\n\n return (\n <div className=\"flex flex-col items-center justify-center py-6 md:py-16 px-6 text-center\">\n {/* Icon */}\n <div className=\"mb-3 md:mb-6 flex items-center justify-center\">\n <div className=\"rounded-full bg-ods-card p-3 md:p-6 border border-ods-border\">\n <div className=\"w-8 h-8 md:w-16 md:h-16 text-ods-text-secondary flex items-center justify-center\">\n {defaultContent.icon}\n </div>\n </div>\n </div>\n\n {/* Title */}\n <h2 className=\"mb-2 md:mb-3 text-lg md:text-xl font-semibold font-['DM_Sans'] text-ods-text-primary tracking-[-0.02em]\">\n {displayTitle}\n </h2>\n\n {/* Description */}\n <p className=\"mb-4 md:mb-8 max-w-md text-sm font-medium font-['DM_Sans'] text-ods-text-secondary leading-[1.43em]\">\n {displayDescription}\n </p>\n\n {/* Smart CTA Button */}\n {showCTA && smartCTA && (\n <div className=\"w-full max-w-xs mb-3\">\n <Button\n onClick={smartCTA.action}\n className={ctaVariant === 'primary' \n ? \"w-full bg-[#FFC008] text-black hover:bg-[#FFC008]/90 transition-all duration-150 font-['DM_Sans'] font-medium\"\n : \"w-full bg-transparent border border-ods-border text-ods-text-primary hover:border-[#FFC008] hover:text-ods-accent transition-all duration-150 font-['DM_Sans'] font-medium\"\n }\n >\n {smartCTA.text}\n </Button>\n </div>\n )}\n\n {/* Optional Back Button */}\n {showBackButton && onGoBack && (\n <div className=\"w-full max-w-xs\">\n <Button\n onClick={onGoBack}\n variant=\"outline\"\n className=\"w-full transition-all duration-150 font-['DM_Sans'] font-medium\"\n >\n {backButtonText}\n </Button>\n </div>\n )}\n </div>\n )\n} ","'use client'\n\n/**\n * `<DeliveryRow />` — canonical single-row presentation for a ClickUp\n * delivery item.\n *\n * Single source of truth: both the `/bug-fixes-and-enhancements` page\n * (via `DeliveryTable`) AND the linked-delivery card on a HubSpot ticket\n * (via `TicketLinkedDeliveryCard`) compose this primitive. Visual parity\n * across those two surfaces is the design goal — the user reads the\n * card on their ticket and recognises it as a row from the public\n * delivery list.\n *\n * Behaviors:\n * - `href` set → outer element is an `<a>`, the whole row becomes\n * clickable (used by the linked-card surface to deep-link into\n * `/bug-fixes-and-enhancements?focus=<id>`).\n * - `id` set → outer element gets that DOM id so the consuming page\n * can `scrollIntoView` to it when the URL carries `?focus=<id>`.\n * - `highlighted` true → brief accent border + background pulse\n * (`animate-flash-focus` keyframe defined in `tailwind.config.ts`).\n * - `caption` set → small uppercase label rendered above the title\n * (\"LINKED DELIVERY\" on the ticket-side variant). Omitted on the\n * standard list rendering.\n */\n\nimport * as React from 'react'\nimport Link from '../../../embed-shims/next-link'\nimport { StatusBadge } from '../../ui/status-badge'\nimport { getStatusColorScheme } from '../../../utils'\nimport {\n type DeliveryItem,\n TASK_TYPE_LABELS,\n TASK_TYPE_TEXT_COLORS,\n} from '../../../types/delivery'\nimport { cn } from '../../../utils/cn'\n\n/** Same heuristic as DeliveryTable's local helper. Inlined so the row\n * primitive owns its complete rendering contract. */\nfunction getRelativeTime(timestamp: number): string {\n const now = Date.now()\n const diff = now - timestamp\n const days = Math.floor(diff / (1000 * 60 * 60 * 24))\n const weeks = Math.floor(days / 7)\n const months = Math.floor(days / 30)\n if (months > 0) return months === 1 ? 'last month' : `${months} months ago`\n if (weeks > 0) return weeks === 1 ? 'last week' : `${weeks} weeks ago`\n if (days > 0) return days === 1 ? 'yesterday' : `${days} days ago`\n return 'today'\n}\n\nexport interface DeliveryRowProps {\n item: DeliveryItem\n /** When set, the row becomes a clickable anchor. The ticket-side\n * linked-card composes this from `buildDevSectionUrl('delivery', id)`\n * which carries `?search=<id>` — the delivery list filters to that\n * exact task on landing (canonical deep-link mechanism, same one\n * the chat-inline delivery card uses). */\n href?: string\n /** Small uppercase caption rendered above the title. Used by the\n * linked-delivery card variant (\"LINKED DELIVERY\"). */\n caption?: string\n className?: string\n}\n\nexport function DeliveryRow({\n item,\n href,\n caption,\n className,\n}: DeliveryRowProps) {\n const taskType = item.taskType as keyof typeof TASK_TYPE_LABELS\n const typeBadgeLabel = TASK_TYPE_LABELS[taskType] || 'TASK'\n const typeBadgeTextColor = TASK_TYPE_TEXT_COLORS[taskType] || ''\n const statusBadgeScheme = getStatusColorScheme(item.status)\n const relativeTime = getRelativeTime(item.dateUpdated)\n const subtitle = `ACTIVE ${relativeTime}${item.listNames.length > 0 ? `, ${item.listNames.join(', ')}` : ''}, ${item.id}`\n\n const inner = (\n <div className=\"flex flex-col md:flex-row items-start justify-between gap-[12px] md:gap-[16px] w-full\">\n {/* Left: caption (optional) + title + subtitle + description */}\n <div className=\"flex-1 min-w-0 w-full md:w-auto flex flex-col gap-[12px] md:gap-[16px]\">\n {caption && (\n <p className=\"text-xs font-medium uppercase tracking-wider text-ods-text-secondary\">\n {caption}\n </p>\n )}\n <div className=\"min-h-[24px] md:min-h-[24px] flex items-center\">\n <h3 className=\"text-h3 text-ods-text-primary tracking-[-0.36px] flex-1 line-clamp-2 md:truncate break-words\">\n {item.title}\n </h3>\n </div>\n <div className=\"min-h-[20px] flex items-center\">\n <p className=\"text-h5 text-ods-text-secondary uppercase tracking-[-0.28px] truncate\">\n {subtitle}\n </p>\n </div>\n <div className=\"min-h-[72px] flex items-center\">\n <p className=\"text-h4 text-ods-text-secondary line-clamp-3 break-words\">\n {item.description || 'No description provided'}\n </p>\n </div>\n </div>\n\n {/* Right: status + task-type badges */}\n <div className=\"flex-shrink-0 self-start flex flex-col gap-2\">\n <StatusBadge\n text={item.status.toUpperCase()}\n colorScheme={statusBadgeScheme}\n variant=\"card\"\n className=\"border border-ods-border\"\n />\n <StatusBadge\n text={typeBadgeLabel}\n variant=\"card\"\n className={`border border-ods-border ${typeBadgeTextColor}`}\n />\n </div>\n </div>\n )\n\n const baseClass = cn(\n 'block p-[12px] md:p-[16px] no-underline text-inherit transition-colors duration-150',\n href && 'hover:bg-ods-bg-hover cursor-pointer',\n className,\n )\n\n if (href) {\n // `Link` is the env-aware embed-shim — delegates to `next/link` on\n // a Next.js host (soft RSC nav, back-button restores the previous\n // page's React state intact), falls back to a plain `<a>` on\n // non-Next embedders. A raw `<a href>` was hard-navigating +\n // losing TanStack-Query state on back, leaving /tickets stuck on\n // its skeleton.\n return (\n <Link href={href} className={baseClass} prefetch={false}>\n {inner}\n </Link>\n )\n }\n\n return <div className={baseClass}>{inner}</div>\n}\n"]}
@@ -10,14 +10,14 @@
10
10
 
11
11
 
12
12
 
13
- var _chunk7UZLRI7Wcjs = require('./chunk-7UZLRI7W.cjs');
13
+ var _chunkZAGQXSAPcjs = require('./chunk-ZAGQXSAP.cjs');
14
14
 
15
15
 
16
16
 
17
- var _chunkSZXKKEUHcjs = require('./chunk-SZXKKEUH.cjs');
17
+ var _chunkE6B4B7GMcjs = require('./chunk-E6B4B7GM.cjs');
18
18
 
19
19
 
20
- var _chunkSL3RGBPXcjs = require('./chunk-SL3RGBPX.cjs');
20
+ var _chunkQNYH3WUUcjs = require('./chunk-QNYH3WUU.cjs');
21
21
 
22
22
  // src/components/contact/contact-form.tsx
23
23
  var _react = require('react');
@@ -106,8 +106,8 @@ function ContactForm({
106
106
  successRedirectUrl = "/blog#community",
107
107
  successToastMessage = "Redirecting you to join our community..."
108
108
  } = {}) {
109
- const attachments = _chunk7UZLRI7Wcjs.useChatAttachments.call(void 0, );
110
- const builtInSubmission = _chunkSL3RGBPXcjs.useContactSubmission.call(void 0, {
109
+ const attachments = _chunkZAGQXSAPcjs.useChatAttachments.call(void 0, );
110
+ const builtInSubmission = _chunkQNYH3WUUcjs.useContactSubmission.call(void 0, {
111
111
  userId,
112
112
  successRedirectUrl,
113
113
  successToastMessage
@@ -189,12 +189,12 @@ function ContactForm({
189
189
  extraTopField,
190
190
  showNameEmailRow && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4 md:gap-6", children: [
191
191
  showName && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col", children: [
192
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7UZLRI7Wcjs.Label, { htmlFor: "name", children: [
192
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZAGQXSAPcjs.Label, { htmlFor: "name", children: [
193
193
  "Your Name",
194
194
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-ods-accent", children: "*" })
195
195
  ] }),
196
196
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
197
- _chunkSZXKKEUHcjs.Input,
197
+ _chunkE6B4B7GMcjs.Input,
198
198
  {
199
199
  id: "name",
200
200
  type: "text",
@@ -208,12 +208,12 @@ function ContactForm({
208
208
  errors.name && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { id: "name-error", className: "text-ods-error text-xs font-['DM_Sans'] mt-1", children: errors.name.message })
209
209
  ] }),
210
210
  showEmail && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col", children: [
211
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7UZLRI7Wcjs.Label, { htmlFor: "email", children: [
211
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZAGQXSAPcjs.Label, { htmlFor: "email", children: [
212
212
  "Email",
213
213
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-ods-accent", children: "*" })
214
214
  ] }),
215
215
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
216
- _chunkSZXKKEUHcjs.Input,
216
+ _chunkE6B4B7GMcjs.Input,
217
217
  {
218
218
  id: "email",
219
219
  type: "email",
@@ -229,46 +229,46 @@ function ContactForm({
229
229
  ] }),
230
230
  (showCompanySize || showReferralSource) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4 md:gap-6", children: [
231
231
  showCompanySize && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col", children: [
232
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7UZLRI7Wcjs.Label, { htmlFor: "companySize", children: "Company Size" }),
232
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZAGQXSAPcjs.Label, { htmlFor: "companySize", children: "Company Size" }),
233
233
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
234
234
  _reacthookform.Controller,
235
235
  {
236
236
  control,
237
237
  name: "companySize",
238
- render: ({ field }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7UZLRI7Wcjs.Select, { onValueChange: field.onChange, defaultValue: field.value, children: [
238
+ render: ({ field }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZAGQXSAPcjs.Select, { onValueChange: field.onChange, defaultValue: field.value, children: [
239
239
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
240
- _chunk7UZLRI7Wcjs.SelectTrigger,
240
+ _chunkZAGQXSAPcjs.SelectTrigger,
241
241
  {
242
242
  id: "companySize",
243
243
  "aria-label": "Company Size",
244
244
  className: "bg-ods-card border-ods-border text-ods-text-primary h-12 px-3",
245
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7UZLRI7Wcjs.SelectValue, { placeholder: "Select company size" })
245
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZAGQXSAPcjs.SelectValue, { placeholder: "Select company size" })
246
246
  }
247
247
  ),
248
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7UZLRI7Wcjs.SelectContent, { children: companySizeOptions.map((opt) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7UZLRI7Wcjs.SelectItem, { value: opt, children: opt }, opt)) })
248
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZAGQXSAPcjs.SelectContent, { children: companySizeOptions.map((opt) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZAGQXSAPcjs.SelectItem, { value: opt, children: opt }, opt)) })
249
249
  ] })
250
250
  }
251
251
  ),
252
252
  errors.companySize && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { id: "companySize-error", className: "text-ods-error text-xs font-['DM_Sans'] mt-1", children: errors.companySize.message })
253
253
  ] }),
254
254
  showReferralSource && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col", children: [
255
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7UZLRI7Wcjs.Label, { htmlFor: "referralSource", children: "How did you hear about us?" }),
255
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZAGQXSAPcjs.Label, { htmlFor: "referralSource", children: "How did you hear about us?" }),
256
256
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
257
257
  _reacthookform.Controller,
258
258
  {
259
259
  control,
260
260
  name: "referralSource",
261
- render: ({ field }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7UZLRI7Wcjs.Select, { onValueChange: field.onChange, defaultValue: field.value, children: [
261
+ render: ({ field }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZAGQXSAPcjs.Select, { onValueChange: field.onChange, defaultValue: field.value, children: [
262
262
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
263
- _chunk7UZLRI7Wcjs.SelectTrigger,
263
+ _chunkZAGQXSAPcjs.SelectTrigger,
264
264
  {
265
265
  id: "referralSource",
266
266
  "aria-label": "Referral Source",
267
267
  className: "bg-ods-card border-ods-border text-ods-text-primary h-12 px-3",
268
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7UZLRI7Wcjs.SelectValue, { placeholder: "Select an option" })
268
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZAGQXSAPcjs.SelectValue, { placeholder: "Select an option" })
269
269
  }
270
270
  ),
271
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7UZLRI7Wcjs.SelectContent, { children: referralSourceOptions.map((opt) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7UZLRI7Wcjs.SelectItem, { value: opt, children: opt }, opt)) })
271
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZAGQXSAPcjs.SelectContent, { children: referralSourceOptions.map((opt) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZAGQXSAPcjs.SelectItem, { value: opt, children: opt }, opt)) })
272
272
  ] })
273
273
  }
274
274
  ),
@@ -276,7 +276,7 @@ function ContactForm({
276
276
  ] })
277
277
  ] }),
278
278
  showHelpCategory && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col", children: [
279
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7UZLRI7Wcjs.Label, { htmlFor: "helpCategory", children: [
279
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZAGQXSAPcjs.Label, { htmlFor: "helpCategory", children: [
280
280
  "Choose your main interest",
281
281
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-ods-accent", children: "*" })
282
282
  ] }),
@@ -285,29 +285,29 @@ function ContactForm({
285
285
  {
286
286
  control,
287
287
  name: "helpCategory",
288
- render: ({ field }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7UZLRI7Wcjs.Select, { onValueChange: field.onChange, defaultValue: field.value, children: [
288
+ render: ({ field }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZAGQXSAPcjs.Select, { onValueChange: field.onChange, defaultValue: field.value, children: [
289
289
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
290
- _chunk7UZLRI7Wcjs.SelectTrigger,
290
+ _chunkZAGQXSAPcjs.SelectTrigger,
291
291
  {
292
292
  id: "helpCategory",
293
293
  "aria-label": "Help Category",
294
294
  className: "bg-ods-card border-ods-border text-ods-text-primary h-12 px-3",
295
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7UZLRI7Wcjs.SelectValue, { placeholder: "Choose your main interest" })
295
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZAGQXSAPcjs.SelectValue, { placeholder: "Choose your main interest" })
296
296
  }
297
297
  ),
298
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7UZLRI7Wcjs.SelectContent, { children: helpCategoryOptions.map((opt) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7UZLRI7Wcjs.SelectItem, { value: opt, children: opt }, opt)) })
298
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZAGQXSAPcjs.SelectContent, { children: helpCategoryOptions.map((opt) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZAGQXSAPcjs.SelectItem, { value: opt, children: opt }, opt)) })
299
299
  ] })
300
300
  }
301
301
  ),
302
302
  errors.helpCategory && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { id: "helpCategory-error", className: "text-ods-error text-xs font-['DM_Sans'] mt-1", children: errors.helpCategory.message })
303
303
  ] }),
304
304
  showMessage && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col flex-grow", children: [
305
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7UZLRI7Wcjs.Label, { htmlFor: "message", children: [
305
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZAGQXSAPcjs.Label, { htmlFor: "message", children: [
306
306
  "Your Message",
307
307
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-ods-accent", children: "*" })
308
308
  ] }),
309
309
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
310
- _chunk7UZLRI7Wcjs.Textarea,
310
+ _chunkZAGQXSAPcjs.Textarea,
311
311
  {
312
312
  id: "message",
313
313
  ...register("message"),
@@ -321,7 +321,7 @@ function ContactForm({
321
321
  ] }),
322
322
  attachmentsEnabled && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-2", children: [
323
323
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
324
- _chunk7UZLRI7Wcjs.ChatAttachmentChipStrip,
324
+ _chunkZAGQXSAPcjs.ChatAttachmentChipStrip,
325
325
  {
326
326
  attachments: attachments.attachments,
327
327
  onRemove: attachments.removeAttachment,
@@ -330,7 +330,7 @@ function ContactForm({
330
330
  ),
331
331
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
332
332
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
333
- _chunk7UZLRI7Wcjs.ChatAttachmentAddButton,
333
+ _chunkZAGQXSAPcjs.ChatAttachmentAddButton,
334
334
  {
335
335
  attachmentsEnabled: true,
336
336
  attachmentsCount: attachments.attachments.length,
@@ -344,7 +344,7 @@ function ContactForm({
344
344
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col md:flex-row gap-4 md:gap-6 items-center justify-end w-full pt-2 mt-auto", children: [
345
345
  footerText && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "font-['DM_Sans'] text-ods-text-secondary text-xs md:text-sm leading-relaxed text-center md:text-left", children: footerText }),
346
346
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
347
- _chunkSZXKKEUHcjs.Button,
347
+ _chunkE6B4B7GMcjs.Button,
348
348
  {
349
349
  type: "submit",
350
350
  loading: isSubmitting,
@@ -366,4 +366,4 @@ function ContactForm({
366
366
 
367
367
 
368
368
  exports.ContactForm = ContactForm;
369
- //# sourceMappingURL=chunk-MPHDM2VZ.cjs.map
369
+ //# sourceMappingURL=chunk-7TQNW2AM.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-MPHDM2VZ.cjs","../src/components/contact/contact-form.tsx","../src/schemas/contact-schema.ts"],"names":[],"mappings":"AAAA,6rBAAY;AACZ;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACEA,8BAAyC;AACzC,gDAAoC;AACpC,8CAA4B;ADA5B;AACA;AE1BA,2BAAkB;AAKX,IAAM,mBAAA,EAAqB;AAAA,EAChC,MAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA;AACF,CAAA;AAEO,IAAM,sBAAA,EAAwB;AAAA,EACnC,QAAA;AAAA,EACA,UAAA;AAAA,EACA,WAAA;AAAA,EACA,QAAA;AAAA,EACA,oBAAA;AAAA,EACA;AACF,CAAA;AAKO,IAAM,2BAAA,EAA6B;AAAA,EACxC,0BAAA;AAAA,EACA,uBAAA;AAAA,EACA,oBAAA;AAAA,EACA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BAAA;AAIf,gCAAA;AAAC,kBAAA;AAAA,kBAAA;AACM,oBAAA;AACI,oBAAA;AAI4B,oBAAA;AAE5B,oBAAA;AACqC,oBAAA;AAEZ,oBAAA;AAAA,kBAAA;AACpC,gBAAA;AACF,cAAA;AAAA,YAAA;AAAA,UAAA;AACF,QAAA;AAAA,MAAA;AAAA,IAAA;AACF,EAAA;AAEJ;ADvJ0J;AACA;AACA;AACA","file":"/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-MPHDM2VZ.cjs","sourcesContent":[null,"'use client'\n\n/**\n * `<ContactForm />` — the canonical contact form used by every public\n * surface (TMCG join, case-study pitch, generic /contact, Help Center\n * ticket creation, etc.).\n *\n * Self-contained inside the lib — host-specific values (user id for\n * tracking, platform-specific contact reasons, reddit-click attribution\n * id) flow IN via props. The hub passes them via a thin\n * `<ContactForm>` wrapper that resolves them from `useAuth` /\n * `getAppConfig` / `getStoredRedditClickId`. Other embedders pass\n * whatever they have (or omit).\n *\n * Field-hide + custom-submit + extra-top-field knobs let one form\n * serve both contact and ticket-creation flows without forking:\n * - Contact page: rendered with all fields visible, built-in submit\n * flow to `/api/contact` via `useContactSubmission`.\n * - Ticket page: hides name/email/companySize/referralSource/\n * helpCategory; supplies `extraTopField` (a Subject input) +\n * `onCustomSubmit` wired to `useTicketActions.submitTicket`.\n */\n\nimport { useState, type ReactNode } from 'react'\nimport { useForm, Controller } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport {\n ContactSchema,\n type ContactFormData,\n companySizeOptions,\n referralSourceOptions,\n defaultHelpCategoryOptions,\n} from '../../schemas/contact-schema'\nimport {\n Button,\n type ButtonProps,\n Input,\n Textarea,\n Select,\n SelectTrigger,\n SelectValue,\n SelectContent,\n SelectItem,\n Label,\n} from '../ui'\nimport { useContactSubmission } from '../../hooks/use-contact-submission'\nimport {\n ChatAttachmentAddButton,\n ChatAttachmentChipStrip,\n} from '../chat/chat-attachment-bar'\nimport { useChatAttachments } from '../chat/hooks/use-chat-attachments'\nimport type { ChatAttachment } from '../chat/utils/chat-attachment-markdown'\n\n/**\n * Fields the caller can suppress. Six values — every primary form\n * field plus `name` and `email` (newly hideable so ticket-creation\n * surfaces can hide them; they still need to validate, so the caller\n * MUST supply pre-filled values via `defaultValues` when hiding them).\n */\nexport type ContactFormHideableField =\n | 'name'\n | 'email'\n | 'companySize'\n | 'referralSource'\n | 'helpCategory'\n | 'message'\n\nexport interface ContactFormProps {\n /** Host-side user id passed to `useContactSubmission` for attribution.\n * Hub wrapper passes `useAuth().user?.id`; lib's Help Center surface\n * passes `useChatIdentity().user?.id`. Omit for anon flows. */\n userId?: string\n /** Platform-specific help-category dropdown options. Hub wrapper\n * passes `getAppConfig().contact.contactReasons`. Defaults to the\n * lib's `defaultHelpCategoryOptions`. */\n helpCategoryOptions?: readonly string[]\n /** Reddit click attribution id. Caller resolves from wherever they\n * stash it (hub: sessionStorage via `getStoredRedditClickId`). When\n * set, it's spread into the submission payload. */\n rdtCid?: string\n /** Called after a successful submit so the caller can clear their\n * attribution storage (hub wrapper calls `clearStoredRedditClickId`).\n * Fires for BOTH the built-in and custom submit paths. */\n onSubmitSuccess?: () => void\n\n prefilledReason?: string\n prefilledMessage?: string\n hideFields?: ContactFormHideableField[]\n /** Authoritative pre-fill for any field the caller hides. Merged\n * into react-hook-form's `defaultValues` AFTER the legacy\n * `prefilledReason` / `prefilledMessage` props (caller-supplied\n * wins). REQUIRED when hiding `name` / `email` / `helpCategory` —\n * those fields are still validated by Zod even when not rendered. */\n defaultValues?: Partial<ContactFormData>\n /** Optional custom submit handler. When provided, the form bypasses\n * the built-in `useContactSubmission` flow (no /api/contact call,\n * no success-redirect, no built-in toast) — the caller owns the\n * entire side-effect chain. Reset + `onSubmitSuccess` still fire\n * on a successful await.\n *\n * Receives the schema-validated form payload PLUS the ready\n * attachments array (empty when `attachmentsEnabled === false` or\n * the user hasn't picked any). Caller forwards `attachments` to\n * whichever sink owns the upload (e.g. `actions.submitTicket`'s\n * `attachments` field for HubSpot Note engagements). */\n onCustomSubmit?: (data: ContactFormData, attachments: ChatAttachment[]) => Promise<void>\n /** Turn on the attachments bar (file `+` button + chip strip) using\n * the same lib primitives the chat composer uses\n * (`<ChatAttachmentAddButton>` + `<ChatAttachmentChipStrip>` +\n * `useChatAttachments`). When `false` (the default), the form\n * doesn't render the bar AND the attachments array passed to\n * `onCustomSubmit` is always empty. */\n attachmentsEnabled?: boolean\n /** Render slot for an EXTRA field at the very top of the form,\n * ABOVE the name/email row. Use this for ticket surfaces that need\n * a Subject input — the field is NOT part of `ContactSchema`, so\n * the caller manages its own state + validation and reads the\n * value back inside `onCustomSubmit`. */\n extraTopField?: ReactNode\n\n title?: string\n subtitle?: string\n footerText?: string\n noBorder?: boolean\n noPadding?: boolean\n buttonVariant?: ButtonProps['variant']\n buttonClassName?: string\n /** Submit-button label. Defaults to \"Send Message\". Override for\n * ticket surfaces (e.g. \"Open ticket\"). */\n submitLabel?: string\n /** Success-state submit-button label (shown briefly after submit on\n * the built-in flow). Defaults to \"Message Sent!\". Has no effect\n * when `onCustomSubmit` is provided — the caller owns success UX. */\n submitSuccessLabel?: string\n successRedirectUrl?: string\n successToastMessage?: string\n}\n\nexport function ContactForm({\n userId,\n helpCategoryOptions = defaultHelpCategoryOptions,\n rdtCid,\n onSubmitSuccess,\n prefilledReason,\n prefilledMessage,\n hideFields = [],\n defaultValues: defaultValuesProp,\n onCustomSubmit,\n extraTopField,\n attachmentsEnabled = false,\n title = 'Hit Us Up',\n subtitle,\n footerText = 'We typically respond within 24 hours. We respect your privacy – no spam, ever.',\n noBorder = false,\n noPadding = false,\n buttonVariant = 'accent',\n buttonClassName = '',\n submitLabel = 'Send Message',\n submitSuccessLabel = 'Message Sent!',\n successRedirectUrl = '/blog#community',\n successToastMessage = 'Redirecting you to join our community...',\n}: ContactFormProps = {}) {\n // Attachments staging — same hook the chat composer + ticket\n // detail-drawer composer use. Files upload to Supabase as soon as\n // the user picks them; `readyAttachments` is the wire-shape array\n // ready for the next submit. `hasInflightUploads` disables Send\n // until every upload settles.\n const attachments = useChatAttachments()\n // Built-in contact-API flow. Hook is called unconditionally (rules\n // of hooks); we just don't dispatch its `submit` when the caller\n // passes `onCustomSubmit`. The hook owns its own toast + redirect\n // chain so bypassing it cleanly hands all side-effects to the caller.\n const builtInSubmission = useContactSubmission({\n userId,\n successRedirectUrl,\n successToastMessage,\n })\n // Independent in-flight tracker for the custom path — we can't reuse\n // `builtInSubmission.isSubmitting` because that hook never sees a\n // request when `onCustomSubmit` is active.\n const [customSubmitting, setCustomSubmitting] = useState(false)\n\n const isSubmitting = onCustomSubmit ? customSubmitting : builtInSubmission.isSubmitting\n // `isSuccess` only ever fires on the built-in path; custom callers\n // own their own UX (no \"Message Sent!\" button-label flicker).\n const isSuccess = onCustomSubmit ? false : builtInSubmission.isSuccess\n\n const {\n register,\n handleSubmit,\n control,\n formState: { errors },\n reset,\n } = useForm<ContactFormData>({\n resolver: zodResolver(ContactSchema),\n defaultValues: {\n ...(prefilledReason && { helpCategory: prefilledReason }),\n ...(prefilledMessage && { message: prefilledMessage }),\n // Caller-supplied defaults win over the legacy `prefilled*` props\n // (they're the authoritative seed for hidden fields).\n ...defaultValuesProp,\n },\n })\n\n const handleFormSubmit = async (data: ContactFormData) => {\n if (isSubmitting) return\n if (attachmentsEnabled && attachments.hasInflightUploads) return\n try {\n const payload = { ...data, ...(rdtCid && { rdt_cid: rdtCid }) }\n const readyAttachments = attachmentsEnabled ? attachments.readyAttachments : []\n if (onCustomSubmit) {\n setCustomSubmitting(true)\n try {\n await onCustomSubmit(payload, readyAttachments)\n } finally {\n setCustomSubmitting(false)\n }\n } else {\n await builtInSubmission.submit(payload)\n }\n onSubmitSuccess?.()\n reset()\n if (attachmentsEnabled) attachments.clear()\n } catch {\n // Error toast is owned by the active flow:\n // - built-in: `useContactSubmission` toasts inside `submit()`.\n // - custom: the caller toasts inside `onCustomSubmit`.\n // Either way we swallow here so a thrown error doesn't crash the\n // form tree (react-hook-form's onSubmit handler rejects upward).\n }\n }\n\n const showName = !hideFields.includes('name')\n const showEmail = !hideFields.includes('email')\n const showNameEmailRow = showName || showEmail\n const showCompanySize = !hideFields.includes('companySize')\n const showReferralSource = !hideFields.includes('referralSource')\n const showHelpCategory = !hideFields.includes('helpCategory')\n const showMessage = !hideFields.includes('message')\n\n return (\n <div\n className={`h-full flex flex-col ${!noBorder ? 'border border-ods-border rounded-2xl md:rounded-3xl' : ''} ${!noPadding ? 'p-6 md:p-8 lg:p-10' : ''}`}\n >\n {(title || subtitle) && (\n <div className=\"mb-6 md:mb-8\">\n {title && (\n <h2 className=\"text-h2 tracking-[-0.04em] text-ods-text-primary mb-3 md:mb-4\">\n {title}\n </h2>\n )}\n {subtitle && (\n <p className=\"font-['DM_Sans'] font-medium text-[16px] md:text-[18px] leading-[24px] text-ods-text-primary\">\n {subtitle}\n </p>\n )}\n </div>\n )}\n\n <form\n onSubmit={handleSubmit(handleFormSubmit, (validationErrors) => {\n // When validation fails on a HIDDEN field (e.g. ticket form\n // hides name/email/helpCategory and seeds them via\n // `defaultValues`), there's no visible error UI for the user\n // — the submit button just appears dead. Log so the broken\n // defaultValues wiring is at least discoverable in DevTools.\n // eslint-disable-next-line no-console\n console.warn(\n '[ContactForm] submit blocked by validation:',\n Object.fromEntries(\n Object.entries(validationErrors).map(([k, v]) => [k, v?.message ?? v]),\n ),\n )\n })}\n className=\"flex flex-col flex-grow space-y-4 md:space-y-6\"\n >\n {/* Hidden inputs for fields that are required by `ContactSchema`\n but suppressed from the visible UI via `hideFields`. Without\n these, `register('name')` never runs, react-hook-form skips\n the field at submit time, and Zod's required-string check\n fails silently — the user clicks Submit and NOTHING visible\n happens (no error, no network call). The caller-supplied\n `defaultValues` seed the values; the hidden inputs just tell\n RHF to include them in the submit payload. */}\n {!showName && <input type=\"hidden\" {...register('name')} />}\n {!showEmail && <input type=\"hidden\" {...register('email')} />}\n {!showHelpCategory && <input type=\"hidden\" {...register('helpCategory')} />}\n {!showMessage && <input type=\"hidden\" {...register('message')} />}\n\n {/* Extra top field (e.g. Subject for ticket forms). Rendered\n outside the schema-driven layout so the caller fully owns\n label / placeholder / state. */}\n {extraTopField}\n\n {showNameEmailRow && (\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4 md:gap-6\">\n {showName && (\n <div className=\"flex flex-col\">\n <Label htmlFor=\"name\">\n Your Name<span className=\"text-ods-accent\">*</span>\n </Label>\n <Input\n id=\"name\"\n type=\"text\"\n {...register('name')}\n placeholder=\"Jane Doe\"\n aria-invalid={!!errors.name}\n aria-describedby=\"name-error\"\n className=\"bg-ods-card border-ods-border text-ods-text-primary placeholder-ods-text-secondary px-3 h-12\"\n />\n {errors.name && (\n <span id=\"name-error\" className=\"text-ods-error text-xs font-['DM_Sans'] mt-1\">\n {errors.name.message}\n </span>\n )}\n </div>\n )}\n {showEmail && (\n <div className=\"flex flex-col\">\n <Label htmlFor=\"email\">\n Email<span className=\"text-ods-accent\">*</span>\n </Label>\n <Input\n id=\"email\"\n type=\"email\"\n {...register('email')}\n placeholder=\"jane@company.com\"\n aria-invalid={!!errors.email}\n aria-describedby=\"email-error\"\n className=\"bg-ods-card border-ods-border text-ods-text-primary placeholder-ods-text-secondary px-3 h-12\"\n />\n {errors.email && (\n <span id=\"email-error\" className=\"text-ods-error text-xs font-['DM_Sans'] mt-1\">\n {errors.email.message}\n </span>\n )}\n </div>\n )}\n </div>\n )}\n\n {(showCompanySize || showReferralSource) && (\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4 md:gap-6\">\n {showCompanySize && (\n <div className=\"flex flex-col\">\n <Label htmlFor=\"companySize\">Company Size</Label>\n <Controller\n control={control}\n name=\"companySize\"\n render={({ field }) => (\n <Select onValueChange={field.onChange} defaultValue={field.value}>\n <SelectTrigger\n id=\"companySize\"\n aria-label=\"Company Size\"\n className=\"bg-ods-card border-ods-border text-ods-text-primary h-12 px-3\"\n >\n <SelectValue placeholder=\"Select company size\" />\n </SelectTrigger>\n <SelectContent>\n {companySizeOptions.map((opt) => (\n <SelectItem key={opt} value={opt}>\n {opt}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n )}\n />\n {errors.companySize && (\n <span id=\"companySize-error\" className=\"text-ods-error text-xs font-['DM_Sans'] mt-1\">\n {errors.companySize.message}\n </span>\n )}\n </div>\n )}\n {showReferralSource && (\n <div className=\"flex flex-col\">\n <Label htmlFor=\"referralSource\">How did you hear about us?</Label>\n <Controller\n control={control}\n name=\"referralSource\"\n render={({ field }) => (\n <Select onValueChange={field.onChange} defaultValue={field.value}>\n <SelectTrigger\n id=\"referralSource\"\n aria-label=\"Referral Source\"\n className=\"bg-ods-card border-ods-border text-ods-text-primary h-12 px-3\"\n >\n <SelectValue placeholder=\"Select an option\" />\n </SelectTrigger>\n <SelectContent>\n {referralSourceOptions.map((opt) => (\n <SelectItem key={opt} value={opt}>\n {opt}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n )}\n />\n {errors.referralSource && (\n <span id=\"referralSource-error\" className=\"text-ods-error text-xs font-['DM_Sans'] mt-1\">\n {errors.referralSource.message}\n </span>\n )}\n </div>\n )}\n </div>\n )}\n\n {showHelpCategory && (\n <div className=\"flex flex-col\">\n <Label htmlFor=\"helpCategory\">\n Choose your main interest<span className=\"text-ods-accent\">*</span>\n </Label>\n <Controller\n control={control}\n name=\"helpCategory\"\n render={({ field }) => (\n <Select onValueChange={field.onChange} defaultValue={field.value}>\n <SelectTrigger\n id=\"helpCategory\"\n aria-label=\"Help Category\"\n className=\"bg-ods-card border-ods-border text-ods-text-primary h-12 px-3\"\n >\n <SelectValue placeholder=\"Choose your main interest\" />\n </SelectTrigger>\n <SelectContent>\n {helpCategoryOptions.map((opt) => (\n <SelectItem key={opt} value={opt}>\n {opt}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n )}\n />\n {errors.helpCategory && (\n <span id=\"helpCategory-error\" className=\"text-ods-error text-xs font-['DM_Sans'] mt-1\">\n {errors.helpCategory.message}\n </span>\n )}\n </div>\n )}\n\n {showMessage && (\n <div className=\"flex flex-col flex-grow\">\n <Label htmlFor=\"message\">\n Your Message<span className=\"text-ods-accent\">*</span>\n </Label>\n <Textarea\n id=\"message\"\n {...register('message')}\n placeholder=\"Share your current challenges or questions about open-source alternatives...\"\n aria-invalid={!!errors.message}\n aria-describedby=\"message-error\"\n className=\"bg-ods-card border-ods-border text-ods-text-primary placeholder-ods-text-secondary h-full flex-grow\"\n />\n {errors.message && (\n <span id=\"message-error\" className=\"text-ods-error text-xs font-['DM_Sans'] mt-1\">\n {errors.message.message}\n </span>\n )}\n </div>\n )}\n\n {/* Attachments — only renders when `attachmentsEnabled` is on.\n Uses the SAME chip strip + add button + staging hook the\n chat composer and ticket-drawer composer use, so the visual\n chip styling + upload-progress UX are identical everywhere\n attachments appear. */}\n {attachmentsEnabled && (\n <div className=\"flex flex-col gap-2\">\n <ChatAttachmentChipStrip\n attachments={attachments.attachments}\n onRemove={attachments.removeAttachment}\n disabled={isSubmitting}\n />\n <div className=\"flex items-center gap-2\">\n <ChatAttachmentAddButton\n attachmentsEnabled\n attachmentsCount={attachments.attachments.length}\n onAddFiles={attachments.addFiles}\n disabled={isSubmitting}\n />\n <span className=\"text-xs text-ods-text-secondary\">\n Attach files (optional)\n </span>\n </div>\n </div>\n )}\n\n <div className=\"flex flex-col md:flex-row gap-4 md:gap-6 items-center justify-end w-full pt-2 mt-auto\">\n {footerText && (\n <p className=\"font-['DM_Sans'] text-ods-text-secondary text-xs md:text-sm leading-relaxed text-center md:text-left\">\n {footerText}\n </p>\n )}\n <Button\n type=\"submit\"\n loading={isSubmitting}\n disabled={\n isSubmitting ||\n isSuccess ||\n (attachmentsEnabled && attachments.hasInflightUploads)\n }\n variant={buttonVariant}\n className={`w-full md:w-auto ${buttonClassName}`}\n >\n {isSuccess ? submitSuccessLabel : submitLabel}\n </Button>\n </div>\n </form>\n </div>\n )\n}\n","import { z } from 'zod';\n\n// Dropdown option constants — re-exported by `<ContactForm>` consumers\n// that want to surface their own custom Select widgets keyed on the\n// same allowed-value set.\nexport const companySizeOptions = [\n '1-10',\n '11-50',\n '51-200',\n '201-500',\n '501-1000',\n '1001+',\n] as const;\n\nexport const referralSourceOptions = [\n 'Google',\n 'LinkedIn',\n 'Twitter/X',\n 'Reddit',\n 'Friend / Colleague',\n 'Other',\n] as const;\n\n// Default fallback options — used when the embedder doesn't supply\n// platform-specific help-category options via the `helpCategoryOptions`\n// prop on `<ContactForm>`.\nexport const defaultHelpCategoryOptions = [\n 'Open-Source Alternatives',\n 'Vendor Cost Reduction',\n 'MSP Best Practices',\n 'Partnerships',\n 'Press',\n 'Other',\n] as const;\n\n// Reusable LinkedIn URL validator — the single source of truth. Every\n// public form schema, every admin update schema, every HubSpot push\n// validator MUST reference this so validation rules cannot drift\n// across boundaries.\n//\n// Host validation parses the URL and checks the hostname suffix so an\n// adversarial input like `https://evil.com/linkedin.com/x` is rejected\n// (substring match would have accepted it — CodeQL alert\n// \"Incomplete URL substring sanitization\").\nexport const LinkedInUrlSchema = z\n .string()\n .url({ message: 'Please enter a valid LinkedIn URL' })\n .refine(\n (url) => {\n try {\n const host = new URL(url).hostname.toLowerCase()\n return host === 'linkedin.com' || host.endsWith('.linkedin.com')\n } catch {\n return false\n }\n },\n {\n message: 'Please enter a valid LinkedIn profile URL',\n },\n )\n .optional()\n .or(z.literal(''));\n\n/**\n * Base schema — fields shared by every contact-style form (main contact\n * form, TMCG join, data-room request, case-study pitch, etc.). Any\n * field that exists on a form but NOT on this schema is silently\n * stripped by `safeParse` — that's exactly the bug the LinkedIn field\n * hit historically.\n */\nexport const ContactBaseSchema = z.object({\n name: z\n .string()\n .min(2, { message: 'Name must be at least 2 characters' })\n .max(255, { message: 'Name is too long' }),\n email: z\n .string()\n .email({ message: 'Please enter a valid email address' })\n .max(255),\n linkedin_url: LinkedInUrlSchema,\n helpCategory: z\n .string()\n .min(1, { message: 'Please select what we can help you with' })\n .max(255, { message: 'Help category is too long' }),\n message: z\n .string()\n .min(10, { message: 'Message must be at least 10 characters' })\n .max(5000, { message: 'Message is too long (5,000 character limit)' }),\n rdt_cid: z.string().optional(),\n});\n\n// Public POST /api/contact validator — base + dropdown fields used by\n// the generic contact form. Other form-specific schemas extend\n// `ContactBaseSchema`.\nexport const ContactSchema = ContactBaseSchema.extend({\n companySize: z\n .string()\n .optional()\n .refine((val) => !val || companySizeOptions.includes(val as (typeof companySizeOptions)[number]), {\n message: 'Please select a valid company size',\n }),\n referralSource: z\n .string()\n .optional()\n .refine((val) => !val || referralSourceOptions.includes(val as (typeof referralSourceOptions)[number]), {\n message: 'Please select a valid referral source',\n }),\n});\n\nexport type ContactFormData = z.infer<typeof ContactSchema>;\n\nexport interface ContactApiResponse {\n success: boolean;\n error?: string;\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-7TQNW2AM.cjs","../src/components/contact/contact-form.tsx","../src/schemas/contact-schema.ts"],"names":[],"mappings":"AAAA,6rBAAY;AACZ;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACEA,8BAAyC;AACzC,gDAAoC;AACpC,8CAA4B;ADA5B;AACA;AE1BA,2BAAkB;AAKX,IAAM,mBAAA,EAAqB;AAAA,EAChC,MAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA;AACF,CAAA;AAEO,IAAM,sBAAA,EAAwB;AAAA,EACnC,QAAA;AAAA,EACA,UAAA;AAAA,EACA,WAAA;AAAA,EACA,QAAA;AAAA,EACA,oBAAA;AAAA,EACA;AACF,CAAA;AAKO,IAAM,2BAAA,EAA6B;AAAA,EACxC,0BAAA;AAAA,EACA,uBAAA;AAAA,EACA,oBAAA;AAAA,EACA,cAAA;AAAA,EACA,O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AAAC,kBAAA;AAAA,kBAAA;AACM,oBAAA;AACI,oBAAA;AAI4B,oBAAA;AAE5B,oBAAA;AACqC,oBAAA;AAEZ,oBAAA;AAAA,kBAAA;AACpC,gBAAA;AACF,cAAA;AAAA,YAAA;AAAA,UAAA;AACF,QAAA;AAAA,MAAA;AAAA,IAAA;AACF,EAAA;AAEJ;ADvJ0J;AACA;AACA;AACA","file":"/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-7TQNW2AM.cjs","sourcesContent":[null,"'use client'\n\n/**\n * `<ContactForm />` — the canonical contact form used by every public\n * surface (TMCG join, case-study pitch, generic /contact, Help Center\n * ticket creation, etc.).\n *\n * Self-contained inside the lib — host-specific values (user id for\n * tracking, platform-specific contact reasons, reddit-click attribution\n * id) flow IN via props. The hub passes them via a thin\n * `<ContactForm>` wrapper that resolves them from `useAuth` /\n * `getAppConfig` / `getStoredRedditClickId`. Other embedders pass\n * whatever they have (or omit).\n *\n * Field-hide + custom-submit + extra-top-field knobs let one form\n * serve both contact and ticket-creation flows without forking:\n * - Contact page: rendered with all fields visible, built-in submit\n * flow to `/api/contact` via `useContactSubmission`.\n * - Ticket page: hides name/email/companySize/referralSource/\n * helpCategory; supplies `extraTopField` (a Subject input) +\n * `onCustomSubmit` wired to `useTicketActions.submitTicket`.\n */\n\nimport { useState, type ReactNode } from 'react'\nimport { useForm, Controller } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport {\n ContactSchema,\n type ContactFormData,\n companySizeOptions,\n referralSourceOptions,\n defaultHelpCategoryOptions,\n} from '../../schemas/contact-schema'\nimport {\n Button,\n type ButtonProps,\n Input,\n Textarea,\n Select,\n SelectTrigger,\n SelectValue,\n SelectContent,\n SelectItem,\n Label,\n} from '../ui'\nimport { useContactSubmission } from '../../hooks/use-contact-submission'\nimport {\n ChatAttachmentAddButton,\n ChatAttachmentChipStrip,\n} from '../chat/chat-attachment-bar'\nimport { useChatAttachments } from '../chat/hooks/use-chat-attachments'\nimport type { ChatAttachment } from '../chat/utils/chat-attachment-markdown'\n\n/**\n * Fields the caller can suppress. Six values — every primary form\n * field plus `name` and `email` (newly hideable so ticket-creation\n * surfaces can hide them; they still need to validate, so the caller\n * MUST supply pre-filled values via `defaultValues` when hiding them).\n */\nexport type ContactFormHideableField =\n | 'name'\n | 'email'\n | 'companySize'\n | 'referralSource'\n | 'helpCategory'\n | 'message'\n\nexport interface ContactFormProps {\n /** Host-side user id passed to `useContactSubmission` for attribution.\n * Hub wrapper passes `useAuth().user?.id`; lib's Help Center surface\n * passes `useChatIdentity().user?.id`. Omit for anon flows. */\n userId?: string\n /** Platform-specific help-category dropdown options. Hub wrapper\n * passes `getAppConfig().contact.contactReasons`. Defaults to the\n * lib's `defaultHelpCategoryOptions`. */\n helpCategoryOptions?: readonly string[]\n /** Reddit click attribution id. Caller resolves from wherever they\n * stash it (hub: sessionStorage via `getStoredRedditClickId`). When\n * set, it's spread into the submission payload. */\n rdtCid?: string\n /** Called after a successful submit so the caller can clear their\n * attribution storage (hub wrapper calls `clearStoredRedditClickId`).\n * Fires for BOTH the built-in and custom submit paths. */\n onSubmitSuccess?: () => void\n\n prefilledReason?: string\n prefilledMessage?: string\n hideFields?: ContactFormHideableField[]\n /** Authoritative pre-fill for any field the caller hides. Merged\n * into react-hook-form's `defaultValues` AFTER the legacy\n * `prefilledReason` / `prefilledMessage` props (caller-supplied\n * wins). REQUIRED when hiding `name` / `email` / `helpCategory` —\n * those fields are still validated by Zod even when not rendered. */\n defaultValues?: Partial<ContactFormData>\n /** Optional custom submit handler. When provided, the form bypasses\n * the built-in `useContactSubmission` flow (no /api/contact call,\n * no success-redirect, no built-in toast) — the caller owns the\n * entire side-effect chain. Reset + `onSubmitSuccess` still fire\n * on a successful await.\n *\n * Receives the schema-validated form payload PLUS the ready\n * attachments array (empty when `attachmentsEnabled === false` or\n * the user hasn't picked any). Caller forwards `attachments` to\n * whichever sink owns the upload (e.g. `actions.submitTicket`'s\n * `attachments` field for HubSpot Note engagements). */\n onCustomSubmit?: (data: ContactFormData, attachments: ChatAttachment[]) => Promise<void>\n /** Turn on the attachments bar (file `+` button + chip strip) using\n * the same lib primitives the chat composer uses\n * (`<ChatAttachmentAddButton>` + `<ChatAttachmentChipStrip>` +\n * `useChatAttachments`). When `false` (the default), the form\n * doesn't render the bar AND the attachments array passed to\n * `onCustomSubmit` is always empty. */\n attachmentsEnabled?: boolean\n /** Render slot for an EXTRA field at the very top of the form,\n * ABOVE the name/email row. Use this for ticket surfaces that need\n * a Subject input — the field is NOT part of `ContactSchema`, so\n * the caller manages its own state + validation and reads the\n * value back inside `onCustomSubmit`. */\n extraTopField?: ReactNode\n\n title?: string\n subtitle?: string\n footerText?: string\n noBorder?: boolean\n noPadding?: boolean\n buttonVariant?: ButtonProps['variant']\n buttonClassName?: string\n /** Submit-button label. Defaults to \"Send Message\". Override for\n * ticket surfaces (e.g. \"Open ticket\"). */\n submitLabel?: string\n /** Success-state submit-button label (shown briefly after submit on\n * the built-in flow). Defaults to \"Message Sent!\". Has no effect\n * when `onCustomSubmit` is provided — the caller owns success UX. */\n submitSuccessLabel?: string\n successRedirectUrl?: string\n successToastMessage?: string\n}\n\nexport function ContactForm({\n userId,\n helpCategoryOptions = defaultHelpCategoryOptions,\n rdtCid,\n onSubmitSuccess,\n prefilledReason,\n prefilledMessage,\n hideFields = [],\n defaultValues: defaultValuesProp,\n onCustomSubmit,\n extraTopField,\n attachmentsEnabled = false,\n title = 'Hit Us Up',\n subtitle,\n footerText = 'We typically respond within 24 hours. We respect your privacy – no spam, ever.',\n noBorder = false,\n noPadding = false,\n buttonVariant = 'accent',\n buttonClassName = '',\n submitLabel = 'Send Message',\n submitSuccessLabel = 'Message Sent!',\n successRedirectUrl = '/blog#community',\n successToastMessage = 'Redirecting you to join our community...',\n}: ContactFormProps = {}) {\n // Attachments staging — same hook the chat composer + ticket\n // detail-drawer composer use. Files upload to Supabase as soon as\n // the user picks them; `readyAttachments` is the wire-shape array\n // ready for the next submit. `hasInflightUploads` disables Send\n // until every upload settles.\n const attachments = useChatAttachments()\n // Built-in contact-API flow. Hook is called unconditionally (rules\n // of hooks); we just don't dispatch its `submit` when the caller\n // passes `onCustomSubmit`. The hook owns its own toast + redirect\n // chain so bypassing it cleanly hands all side-effects to the caller.\n const builtInSubmission = useContactSubmission({\n userId,\n successRedirectUrl,\n successToastMessage,\n })\n // Independent in-flight tracker for the custom path — we can't reuse\n // `builtInSubmission.isSubmitting` because that hook never sees a\n // request when `onCustomSubmit` is active.\n const [customSubmitting, setCustomSubmitting] = useState(false)\n\n const isSubmitting = onCustomSubmit ? customSubmitting : builtInSubmission.isSubmitting\n // `isSuccess` only ever fires on the built-in path; custom callers\n // own their own UX (no \"Message Sent!\" button-label flicker).\n const isSuccess = onCustomSubmit ? false : builtInSubmission.isSuccess\n\n const {\n register,\n handleSubmit,\n control,\n formState: { errors },\n reset,\n } = useForm<ContactFormData>({\n resolver: zodResolver(ContactSchema),\n defaultValues: {\n ...(prefilledReason && { helpCategory: prefilledReason }),\n ...(prefilledMessage && { message: prefilledMessage }),\n // Caller-supplied defaults win over the legacy `prefilled*` props\n // (they're the authoritative seed for hidden fields).\n ...defaultValuesProp,\n },\n })\n\n const handleFormSubmit = async (data: ContactFormData) => {\n if (isSubmitting) return\n if (attachmentsEnabled && attachments.hasInflightUploads) return\n try {\n const payload = { ...data, ...(rdtCid && { rdt_cid: rdtCid }) }\n const readyAttachments = attachmentsEnabled ? attachments.readyAttachments : []\n if (onCustomSubmit) {\n setCustomSubmitting(true)\n try {\n await onCustomSubmit(payload, readyAttachments)\n } finally {\n setCustomSubmitting(false)\n }\n } else {\n await builtInSubmission.submit(payload)\n }\n onSubmitSuccess?.()\n reset()\n if (attachmentsEnabled) attachments.clear()\n } catch {\n // Error toast is owned by the active flow:\n // - built-in: `useContactSubmission` toasts inside `submit()`.\n // - custom: the caller toasts inside `onCustomSubmit`.\n // Either way we swallow here so a thrown error doesn't crash the\n // form tree (react-hook-form's onSubmit handler rejects upward).\n }\n }\n\n const showName = !hideFields.includes('name')\n const showEmail = !hideFields.includes('email')\n const showNameEmailRow = showName || showEmail\n const showCompanySize = !hideFields.includes('companySize')\n const showReferralSource = !hideFields.includes('referralSource')\n const showHelpCategory = !hideFields.includes('helpCategory')\n const showMessage = !hideFields.includes('message')\n\n return (\n <div\n className={`h-full flex flex-col ${!noBorder ? 'border border-ods-border rounded-2xl md:rounded-3xl' : ''} ${!noPadding ? 'p-6 md:p-8 lg:p-10' : ''}`}\n >\n {(title || subtitle) && (\n <div className=\"mb-6 md:mb-8\">\n {title && (\n <h2 className=\"text-h2 tracking-[-0.04em] text-ods-text-primary mb-3 md:mb-4\">\n {title}\n </h2>\n )}\n {subtitle && (\n <p className=\"font-['DM_Sans'] font-medium text-[16px] md:text-[18px] leading-[24px] text-ods-text-primary\">\n {subtitle}\n </p>\n )}\n </div>\n )}\n\n <form\n onSubmit={handleSubmit(handleFormSubmit, (validationErrors) => {\n // When validation fails on a HIDDEN field (e.g. ticket form\n // hides name/email/helpCategory and seeds them via\n // `defaultValues`), there's no visible error UI for the user\n // — the submit button just appears dead. Log so the broken\n // defaultValues wiring is at least discoverable in DevTools.\n // eslint-disable-next-line no-console\n console.warn(\n '[ContactForm] submit blocked by validation:',\n Object.fromEntries(\n Object.entries(validationErrors).map(([k, v]) => [k, v?.message ?? v]),\n ),\n )\n })}\n className=\"flex flex-col flex-grow space-y-4 md:space-y-6\"\n >\n {/* Hidden inputs for fields that are required by `ContactSchema`\n but suppressed from the visible UI via `hideFields`. Without\n these, `register('name')` never runs, react-hook-form skips\n the field at submit time, and Zod's required-string check\n fails silently — the user clicks Submit and NOTHING visible\n happens (no error, no network call). The caller-supplied\n `defaultValues` seed the values; the hidden inputs just tell\n RHF to include them in the submit payload. */}\n {!showName && <input type=\"hidden\" {...register('name')} />}\n {!showEmail && <input type=\"hidden\" {...register('email')} />}\n {!showHelpCategory && <input type=\"hidden\" {...register('helpCategory')} />}\n {!showMessage && <input type=\"hidden\" {...register('message')} />}\n\n {/* Extra top field (e.g. Subject for ticket forms). Rendered\n outside the schema-driven layout so the caller fully owns\n label / placeholder / state. */}\n {extraTopField}\n\n {showNameEmailRow && (\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4 md:gap-6\">\n {showName && (\n <div className=\"flex flex-col\">\n <Label htmlFor=\"name\">\n Your Name<span className=\"text-ods-accent\">*</span>\n </Label>\n <Input\n id=\"name\"\n type=\"text\"\n {...register('name')}\n placeholder=\"Jane Doe\"\n aria-invalid={!!errors.name}\n aria-describedby=\"name-error\"\n className=\"bg-ods-card border-ods-border text-ods-text-primary placeholder-ods-text-secondary px-3 h-12\"\n />\n {errors.name && (\n <span id=\"name-error\" className=\"text-ods-error text-xs font-['DM_Sans'] mt-1\">\n {errors.name.message}\n </span>\n )}\n </div>\n )}\n {showEmail && (\n <div className=\"flex flex-col\">\n <Label htmlFor=\"email\">\n Email<span className=\"text-ods-accent\">*</span>\n </Label>\n <Input\n id=\"email\"\n type=\"email\"\n {...register('email')}\n placeholder=\"jane@company.com\"\n aria-invalid={!!errors.email}\n aria-describedby=\"email-error\"\n className=\"bg-ods-card border-ods-border text-ods-text-primary placeholder-ods-text-secondary px-3 h-12\"\n />\n {errors.email && (\n <span id=\"email-error\" className=\"text-ods-error text-xs font-['DM_Sans'] mt-1\">\n {errors.email.message}\n </span>\n )}\n </div>\n )}\n </div>\n )}\n\n {(showCompanySize || showReferralSource) && (\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4 md:gap-6\">\n {showCompanySize && (\n <div className=\"flex flex-col\">\n <Label htmlFor=\"companySize\">Company Size</Label>\n <Controller\n control={control}\n name=\"companySize\"\n render={({ field }) => (\n <Select onValueChange={field.onChange} defaultValue={field.value}>\n <SelectTrigger\n id=\"companySize\"\n aria-label=\"Company Size\"\n className=\"bg-ods-card border-ods-border text-ods-text-primary h-12 px-3\"\n >\n <SelectValue placeholder=\"Select company size\" />\n </SelectTrigger>\n <SelectContent>\n {companySizeOptions.map((opt) => (\n <SelectItem key={opt} value={opt}>\n {opt}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n )}\n />\n {errors.companySize && (\n <span id=\"companySize-error\" className=\"text-ods-error text-xs font-['DM_Sans'] mt-1\">\n {errors.companySize.message}\n </span>\n )}\n </div>\n )}\n {showReferralSource && (\n <div className=\"flex flex-col\">\n <Label htmlFor=\"referralSource\">How did you hear about us?</Label>\n <Controller\n control={control}\n name=\"referralSource\"\n render={({ field }) => (\n <Select onValueChange={field.onChange} defaultValue={field.value}>\n <SelectTrigger\n id=\"referralSource\"\n aria-label=\"Referral Source\"\n className=\"bg-ods-card border-ods-border text-ods-text-primary h-12 px-3\"\n >\n <SelectValue placeholder=\"Select an option\" />\n </SelectTrigger>\n <SelectContent>\n {referralSourceOptions.map((opt) => (\n <SelectItem key={opt} value={opt}>\n {opt}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n )}\n />\n {errors.referralSource && (\n <span id=\"referralSource-error\" className=\"text-ods-error text-xs font-['DM_Sans'] mt-1\">\n {errors.referralSource.message}\n </span>\n )}\n </div>\n )}\n </div>\n )}\n\n {showHelpCategory && (\n <div className=\"flex flex-col\">\n <Label htmlFor=\"helpCategory\">\n Choose your main interest<span className=\"text-ods-accent\">*</span>\n </Label>\n <Controller\n control={control}\n name=\"helpCategory\"\n render={({ field }) => (\n <Select onValueChange={field.onChange} defaultValue={field.value}>\n <SelectTrigger\n id=\"helpCategory\"\n aria-label=\"Help Category\"\n className=\"bg-ods-card border-ods-border text-ods-text-primary h-12 px-3\"\n >\n <SelectValue placeholder=\"Choose your main interest\" />\n </SelectTrigger>\n <SelectContent>\n {helpCategoryOptions.map((opt) => (\n <SelectItem key={opt} value={opt}>\n {opt}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n )}\n />\n {errors.helpCategory && (\n <span id=\"helpCategory-error\" className=\"text-ods-error text-xs font-['DM_Sans'] mt-1\">\n {errors.helpCategory.message}\n </span>\n )}\n </div>\n )}\n\n {showMessage && (\n <div className=\"flex flex-col flex-grow\">\n <Label htmlFor=\"message\">\n Your Message<span className=\"text-ods-accent\">*</span>\n </Label>\n <Textarea\n id=\"message\"\n {...register('message')}\n placeholder=\"Share your current challenges or questions about open-source alternatives...\"\n aria-invalid={!!errors.message}\n aria-describedby=\"message-error\"\n className=\"bg-ods-card border-ods-border text-ods-text-primary placeholder-ods-text-secondary h-full flex-grow\"\n />\n {errors.message && (\n <span id=\"message-error\" className=\"text-ods-error text-xs font-['DM_Sans'] mt-1\">\n {errors.message.message}\n </span>\n )}\n </div>\n )}\n\n {/* Attachments — only renders when `attachmentsEnabled` is on.\n Uses the SAME chip strip + add button + staging hook the\n chat composer and ticket-drawer composer use, so the visual\n chip styling + upload-progress UX are identical everywhere\n attachments appear. */}\n {attachmentsEnabled && (\n <div className=\"flex flex-col gap-2\">\n <ChatAttachmentChipStrip\n attachments={attachments.attachments}\n onRemove={attachments.removeAttachment}\n disabled={isSubmitting}\n />\n <div className=\"flex items-center gap-2\">\n <ChatAttachmentAddButton\n attachmentsEnabled\n attachmentsCount={attachments.attachments.length}\n onAddFiles={attachments.addFiles}\n disabled={isSubmitting}\n />\n <span className=\"text-xs text-ods-text-secondary\">\n Attach files (optional)\n </span>\n </div>\n </div>\n )}\n\n <div className=\"flex flex-col md:flex-row gap-4 md:gap-6 items-center justify-end w-full pt-2 mt-auto\">\n {footerText && (\n <p className=\"font-['DM_Sans'] text-ods-text-secondary text-xs md:text-sm leading-relaxed text-center md:text-left\">\n {footerText}\n </p>\n )}\n <Button\n type=\"submit\"\n loading={isSubmitting}\n disabled={\n isSubmitting ||\n isSuccess ||\n (attachmentsEnabled && attachments.hasInflightUploads)\n }\n variant={buttonVariant}\n className={`w-full md:w-auto ${buttonClassName}`}\n >\n {isSuccess ? submitSuccessLabel : submitLabel}\n </Button>\n </div>\n </form>\n </div>\n )\n}\n","import { z } from 'zod';\n\n// Dropdown option constants — re-exported by `<ContactForm>` consumers\n// that want to surface their own custom Select widgets keyed on the\n// same allowed-value set.\nexport const companySizeOptions = [\n '1-10',\n '11-50',\n '51-200',\n '201-500',\n '501-1000',\n '1001+',\n] as const;\n\nexport const referralSourceOptions = [\n 'Google',\n 'LinkedIn',\n 'Twitter/X',\n 'Reddit',\n 'Friend / Colleague',\n 'Other',\n] as const;\n\n// Default fallback options — used when the embedder doesn't supply\n// platform-specific help-category options via the `helpCategoryOptions`\n// prop on `<ContactForm>`.\nexport const defaultHelpCategoryOptions = [\n 'Open-Source Alternatives',\n 'Vendor Cost Reduction',\n 'MSP Best Practices',\n 'Partnerships',\n 'Press',\n 'Other',\n] as const;\n\n// Reusable LinkedIn URL validator — the single source of truth. Every\n// public form schema, every admin update schema, every HubSpot push\n// validator MUST reference this so validation rules cannot drift\n// across boundaries.\n//\n// Host validation parses the URL and checks the hostname suffix so an\n// adversarial input like `https://evil.com/linkedin.com/x` is rejected\n// (substring match would have accepted it — CodeQL alert\n// \"Incomplete URL substring sanitization\").\nexport const LinkedInUrlSchema = z\n .string()\n .url({ message: 'Please enter a valid LinkedIn URL' })\n .refine(\n (url) => {\n try {\n const host = new URL(url).hostname.toLowerCase()\n return host === 'linkedin.com' || host.endsWith('.linkedin.com')\n } catch {\n return false\n }\n },\n {\n message: 'Please enter a valid LinkedIn profile URL',\n },\n )\n .optional()\n .or(z.literal(''));\n\n/**\n * Base schema — fields shared by every contact-style form (main contact\n * form, TMCG join, data-room request, case-study pitch, etc.). Any\n * field that exists on a form but NOT on this schema is silently\n * stripped by `safeParse` — that's exactly the bug the LinkedIn field\n * hit historically.\n */\nexport const ContactBaseSchema = z.object({\n name: z\n .string()\n .min(2, { message: 'Name must be at least 2 characters' })\n .max(255, { message: 'Name is too long' }),\n email: z\n .string()\n .email({ message: 'Please enter a valid email address' })\n .max(255),\n linkedin_url: LinkedInUrlSchema,\n helpCategory: z\n .string()\n .min(1, { message: 'Please select what we can help you with' })\n .max(255, { message: 'Help category is too long' }),\n message: z\n .string()\n .min(10, { message: 'Message must be at least 10 characters' })\n .max(5000, { message: 'Message is too long (5,000 character limit)' }),\n rdt_cid: z.string().optional(),\n});\n\n// Public POST /api/contact validator — base + dropdown fields used by\n// the generic contact form. Other form-specific schemas extend\n// `ContactBaseSchema`.\nexport const ContactSchema = ContactBaseSchema.extend({\n companySize: z\n .string()\n .optional()\n .refine((val) => !val || companySizeOptions.includes(val as (typeof companySizeOptions)[number]), {\n message: 'Please select a valid company size',\n }),\n referralSource: z\n .string()\n .optional()\n .refine((val) => !val || referralSourceOptions.includes(val as (typeof referralSourceOptions)[number]), {\n message: 'Please select a valid referral source',\n }),\n});\n\nexport type ContactFormData = z.infer<typeof ContactSchema>;\n\nexport interface ContactApiResponse {\n success: boolean;\n error?: string;\n}\n"]}