@flamingo-stack/openframe-frontend-core 0.0.697 → 0.0.698-2527.7765.1

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 (218) hide show
  1. package/dist/{chunk-77XUG4Z4.js → chunk-2FCONMFQ.js} +10 -10
  2. package/dist/{chunk-F6U2H42L.cjs → chunk-2JRKNGJ4.cjs} +6 -1
  3. package/dist/chunk-2JRKNGJ4.cjs.map +1 -0
  4. package/dist/{chunk-N4G3C4B4.cjs → chunk-4WYMOK5O.cjs} +12 -12
  5. package/dist/{chunk-N4G3C4B4.cjs.map → chunk-4WYMOK5O.cjs.map} +1 -1
  6. package/dist/{chunk-NE4H4JJG.cjs → chunk-5EL4RXTH.cjs} +42 -42
  7. package/dist/{chunk-NE4H4JJG.cjs.map → chunk-5EL4RXTH.cjs.map} +1 -1
  8. package/dist/{chunk-6CDP6TGH.cjs → chunk-5TAHPP4S.cjs} +126 -27
  9. package/dist/chunk-5TAHPP4S.cjs.map +1 -0
  10. package/dist/{chunk-75CG72QX.cjs → chunk-66F4L6EW.cjs} +33 -33
  11. package/dist/{chunk-75CG72QX.cjs.map → chunk-66F4L6EW.cjs.map} +1 -1
  12. package/dist/{chunk-M3JA577H.js → chunk-6SN6IVLN.js} +3 -3
  13. package/dist/{chunk-QYFXRVH3.js → chunk-7XVYYJHT.js} +9 -9
  14. package/dist/{chunk-VSQVJHOS.js → chunk-AKVO7FP4.js} +2 -2
  15. package/dist/{chunk-LF4S37VU.js → chunk-AV7Z25I6.js} +5 -5
  16. package/dist/{chunk-RIDRAKQ5.cjs → chunk-AXH5TM5A.cjs} +15 -15
  17. package/dist/{chunk-RIDRAKQ5.cjs.map → chunk-AXH5TM5A.cjs.map} +1 -1
  18. package/dist/{chunk-KLDCI3KF.cjs → chunk-BBKYGX6S.cjs} +3 -3
  19. package/dist/{chunk-KLDCI3KF.cjs.map → chunk-BBKYGX6S.cjs.map} +1 -1
  20. package/dist/{chunk-J4MCVIXU.js → chunk-BNJBJTEK.js} +209 -110
  21. package/dist/chunk-BNJBJTEK.js.map +1 -0
  22. package/dist/{chunk-PYNHPMDB.js → chunk-BWUJUOI6.js} +5 -5
  23. package/dist/{chunk-LEGNIETR.cjs → chunk-CDLQ33TK.cjs} +5 -5
  24. package/dist/{chunk-LEGNIETR.cjs.map → chunk-CDLQ33TK.cjs.map} +1 -1
  25. package/dist/{chunk-LNOXNCEC.js → chunk-D3G6PGO5.js} +4 -4
  26. package/dist/{chunk-CVMWOUAX.cjs → chunk-DNSJ55MN.cjs} +48 -48
  27. package/dist/{chunk-CVMWOUAX.cjs.map → chunk-DNSJ55MN.cjs.map} +1 -1
  28. package/dist/{chunk-SG53SIJX.js → chunk-ERYNBP3I.js} +6 -6
  29. package/dist/{chunk-EWQZ4BXD.cjs → chunk-EYVR3SM4.cjs} +7 -7
  30. package/dist/{chunk-EWQZ4BXD.cjs.map → chunk-EYVR3SM4.cjs.map} +1 -1
  31. package/dist/{chunk-Z7A7FUWY.js → chunk-F4HUQV3I.js} +3 -3
  32. package/dist/{chunk-RQ3HFUKV.cjs → chunk-FEXS67IG.cjs} +8 -8
  33. package/dist/{chunk-RQ3HFUKV.cjs.map → chunk-FEXS67IG.cjs.map} +1 -1
  34. package/dist/{chunk-JBMFCHNT.js → chunk-HIYZHMNX.js} +2850 -2389
  35. package/dist/chunk-HIYZHMNX.js.map +1 -0
  36. package/dist/{chunk-3V7O7J4S.cjs → chunk-HMAXNSBZ.cjs} +28 -28
  37. package/dist/{chunk-3V7O7J4S.cjs.map → chunk-HMAXNSBZ.cjs.map} +1 -1
  38. package/dist/{chunk-JU6SBF3C.cjs → chunk-HT7SU5UN.cjs} +7 -7
  39. package/dist/{chunk-JU6SBF3C.cjs.map → chunk-HT7SU5UN.cjs.map} +1 -1
  40. package/dist/{chunk-Y2MDXJB4.js → chunk-JZCCRN3K.js} +2 -2
  41. package/dist/{chunk-WVDBRL2S.js → chunk-KSRNOGR7.js} +7 -7
  42. package/dist/{chunk-2FK7BZIM.cjs → chunk-LDQPA4PS.cjs} +18 -18
  43. package/dist/{chunk-2FK7BZIM.cjs.map → chunk-LDQPA4PS.cjs.map} +1 -1
  44. package/dist/{chunk-4HVWGYHI.js → chunk-LPLXCDNV.js} +6 -1
  45. package/dist/chunk-LPLXCDNV.js.map +1 -0
  46. package/dist/{chunk-QD4BVKAU.js → chunk-NIIR776F.js} +6 -6
  47. package/dist/{chunk-H6SSHFMD.js → chunk-OMP5KPDM.js} +6 -6
  48. package/dist/{chunk-J4VGVLQI.js → chunk-OPGUDB4U.js} +3 -3
  49. package/dist/{chunk-VE7HLTVQ.js → chunk-OX4IH3OJ.js} +2 -2
  50. package/dist/{chunk-GRBZC5N3.js → chunk-PELIFROQ.js} +2 -2
  51. package/dist/{chunk-T33ICOHD.cjs → chunk-R7BYRYBI.cjs} +29 -29
  52. package/dist/{chunk-T33ICOHD.cjs.map → chunk-R7BYRYBI.cjs.map} +1 -1
  53. package/dist/{chunk-7MM6EDNA.cjs → chunk-RNJUMB6Q.cjs} +55 -32
  54. package/dist/{chunk-7MM6EDNA.cjs.map → chunk-RNJUMB6Q.cjs.map} +1 -1
  55. package/dist/{chunk-5DBWXJBG.cjs → chunk-SLSHTLNT.cjs} +1462 -1001
  56. package/dist/chunk-SLSHTLNT.cjs.map +1 -0
  57. package/dist/{chunk-FZFEIXGB.cjs → chunk-TOS2OL6W.cjs} +98 -98
  58. package/dist/{chunk-FZFEIXGB.cjs.map → chunk-TOS2OL6W.cjs.map} +1 -1
  59. package/dist/{chunk-VCR3TW2H.cjs → chunk-TVMY3U3W.cjs} +8 -8
  60. package/dist/{chunk-VCR3TW2H.cjs.map → chunk-TVMY3U3W.cjs.map} +1 -1
  61. package/dist/{chunk-WADR7VIA.cjs → chunk-TWOY6ACV.cjs} +70 -70
  62. package/dist/{chunk-WADR7VIA.cjs.map → chunk-TWOY6ACV.cjs.map} +1 -1
  63. package/dist/{chunk-YCVDJX7Z.js → chunk-U5CUVGUQ.js} +4 -4
  64. package/dist/{chunk-3S56I5MX.js → chunk-U7J7G5J7.js} +3 -3
  65. package/dist/{chunk-XRW5VZKH.cjs → chunk-VCXNLUBP.cjs} +14 -14
  66. package/dist/{chunk-XRW5VZKH.cjs.map → chunk-VCXNLUBP.cjs.map} +1 -1
  67. package/dist/{chunk-5P2J7E5E.cjs → chunk-WC76QXUX.cjs} +3 -3
  68. package/dist/{chunk-5P2J7E5E.cjs.map → chunk-WC76QXUX.cjs.map} +1 -1
  69. package/dist/{chunk-OB3ZJ7GQ.js → chunk-XGB5EEFZ.js} +3 -3
  70. package/dist/{chunk-MFU3ALKM.cjs → chunk-YNAWEA3G.cjs} +232 -232
  71. package/dist/{chunk-MFU3ALKM.cjs.map → chunk-YNAWEA3G.cjs.map} +1 -1
  72. package/dist/{chunk-LZXZ3C6M.js → chunk-ZZ6VFA36.js} +32 -9
  73. package/dist/chunk-ZZ6VFA36.js.map +1 -0
  74. package/dist/components/announcement-bar.d.ts +1 -1
  75. package/dist/components/announcement-bar.d.ts.map +1 -1
  76. package/dist/components/calendar.cjs +4 -4
  77. package/dist/components/calendar.js +1 -1
  78. package/dist/components/case-studies/index.cjs +21 -21
  79. package/dist/components/case-studies/index.js +7 -7
  80. package/dist/components/chat/index.cjs +4 -4
  81. package/dist/components/chat/index.js +3 -3
  82. package/dist/components/contact/index.cjs +8 -8
  83. package/dist/components/contact/index.js +7 -7
  84. package/dist/components/docs/index.cjs +11 -11
  85. package/dist/components/docs/index.js +10 -10
  86. package/dist/components/embeds/index.cjs +8 -8
  87. package/dist/components/embeds/index.js +7 -7
  88. package/dist/components/faq/index.cjs +8 -8
  89. package/dist/components/faq/index.js +7 -7
  90. package/dist/components/features/conversation-card.d.ts +32 -0
  91. package/dist/components/features/conversation-card.d.ts.map +1 -0
  92. package/dist/components/features/index.cjs +9 -7
  93. package/dist/components/features/index.cjs.map +1 -1
  94. package/dist/components/features/index.d.ts +1 -0
  95. package/dist/components/features/index.d.ts.map +1 -1
  96. package/dist/components/features/index.js +8 -6
  97. package/dist/components/help-center-pages/index.cjs +101 -101
  98. package/dist/components/help-center-pages/index.js +20 -20
  99. package/dist/components/index.cjs +127 -109
  100. package/dist/components/index.cjs.map +1 -1
  101. package/dist/components/index.js +39 -21
  102. package/dist/components/index.js.map +1 -1
  103. package/dist/components/meeting-scheduler/index.cjs +59 -59
  104. package/dist/components/meeting-scheduler/index.js +8 -8
  105. package/dist/components/navigation/index.cjs +10 -10
  106. package/dist/components/navigation/index.js +9 -9
  107. package/dist/components/onboarding-guides/index.cjs +10 -10
  108. package/dist/components/onboarding-guides/index.js +9 -9
  109. package/dist/components/platform/ToolBadge.d.ts +17 -9
  110. package/dist/components/platform/ToolBadge.d.ts.map +1 -1
  111. package/dist/components/related-content/index.cjs +5 -5
  112. package/dist/components/related-content/index.js +4 -4
  113. package/dist/components/tickets/index.cjs +12 -12
  114. package/dist/components/tickets/index.js +11 -11
  115. package/dist/components/ui/app-window-frame.d.ts +20 -0
  116. package/dist/components/ui/app-window-frame.d.ts.map +1 -0
  117. package/dist/components/ui/button/button-styles.d.ts +1 -0
  118. package/dist/components/ui/button/button-styles.d.ts.map +1 -1
  119. package/dist/components/ui/button/button.d.ts +1 -1
  120. package/dist/components/ui/button/button.d.ts.map +1 -1
  121. package/dist/components/ui/feature-card.d.ts +5 -0
  122. package/dist/components/ui/feature-card.d.ts.map +1 -1
  123. package/dist/components/ui/feature-list.d.ts +12 -1
  124. package/dist/components/ui/feature-list.d.ts.map +1 -1
  125. package/dist/components/ui/file-manager/index.cjs +11 -11
  126. package/dist/components/ui/file-manager/index.js +1 -1
  127. package/dist/components/ui/incident-feed.d.ts +49 -0
  128. package/dist/components/ui/incident-feed.d.ts.map +1 -0
  129. package/dist/components/ui/index.cjs +21 -7
  130. package/dist/components/ui/index.cjs.map +1 -1
  131. package/dist/components/ui/index.d.ts +5 -0
  132. package/dist/components/ui/index.d.ts.map +1 -1
  133. package/dist/components/ui/index.js +20 -6
  134. package/dist/components/ui/page-actions.d.ts +1 -1
  135. package/dist/components/ui/page-actions.d.ts.map +1 -1
  136. package/dist/components/ui/phone-frame.d.ts +19 -0
  137. package/dist/components/ui/phone-frame.d.ts.map +1 -0
  138. package/dist/components/ui/snap-carousel.d.ts +27 -0
  139. package/dist/components/ui/snap-carousel.d.ts.map +1 -0
  140. package/dist/components/ui/sticky-action-bar.d.ts +29 -0
  141. package/dist/components/ui/sticky-action-bar.d.ts.map +1 -0
  142. package/dist/components/ui/tab-navigation.d.ts +14 -1
  143. package/dist/components/ui/tab-navigation.d.ts.map +1 -1
  144. package/dist/hooks/index.cjs +12 -2
  145. package/dist/hooks/index.cjs.map +1 -1
  146. package/dist/hooks/index.d.ts +1 -0
  147. package/dist/hooks/index.d.ts.map +1 -1
  148. package/dist/hooks/index.js +11 -1
  149. package/dist/hooks/ui/index.d.ts +2 -0
  150. package/dist/hooks/ui/index.d.ts.map +1 -1
  151. package/dist/hooks/ui/use-in-view.d.ts +20 -0
  152. package/dist/hooks/ui/use-in-view.d.ts.map +1 -0
  153. package/dist/hooks/ui/use-prefers-reduced-motion.d.ts +13 -0
  154. package/dist/hooks/ui/use-prefers-reduced-motion.d.ts.map +1 -0
  155. package/dist/hooks/use-scenario-player.d.ts +45 -0
  156. package/dist/hooks/use-scenario-player.d.ts.map +1 -0
  157. package/dist/index.cjs +38 -12
  158. package/dist/index.cjs.map +1 -1
  159. package/dist/index.js +36 -10
  160. package/dist/index.js.map +1 -1
  161. package/dist/types/announcement.cjs.map +1 -1
  162. package/dist/types/announcement.d.ts +21 -0
  163. package/dist/types/announcement.d.ts.map +1 -1
  164. package/dist/types/announcement.js.map +1 -1
  165. package/dist/types/index.cjs.map +1 -1
  166. package/dist/types/index.js.map +1 -1
  167. package/package.json +1 -1
  168. package/src/components/announcement-bar.tsx +7 -1
  169. package/src/components/features/conversation-card.tsx +93 -0
  170. package/src/components/features/index.ts +3 -0
  171. package/src/components/platform/ToolBadge.tsx +47 -13
  172. package/src/components/ui/__tests__/snap-carousel.test.tsx +116 -0
  173. package/src/components/ui/app-window-frame.tsx +41 -0
  174. package/src/components/ui/button/button-styles.ts +5 -0
  175. package/src/components/ui/button/button.tsx +1 -0
  176. package/src/components/ui/feature-card.tsx +16 -1
  177. package/src/components/ui/feature-list.tsx +57 -13
  178. package/src/components/ui/incident-feed.tsx +143 -0
  179. package/src/components/ui/index.ts +8 -0
  180. package/src/components/ui/page-actions.tsx +1 -1
  181. package/src/components/ui/phone-frame.tsx +38 -0
  182. package/src/components/ui/snap-carousel.tsx +186 -0
  183. package/src/components/ui/sticky-action-bar.tsx +81 -0
  184. package/src/components/ui/tab-navigation.tsx +63 -13
  185. package/src/hooks/__tests__/use-scenario-player.test.tsx +144 -0
  186. package/src/hooks/index.ts +3 -0
  187. package/src/hooks/ui/index.ts +2 -0
  188. package/src/hooks/ui/use-in-view.ts +63 -0
  189. package/src/hooks/ui/use-prefers-reduced-motion.ts +22 -0
  190. package/src/hooks/use-scenario-player.ts +102 -0
  191. package/src/stories/DemoStage.stories.tsx +241 -0
  192. package/src/types/announcement.ts +21 -0
  193. package/dist/chunk-4HVWGYHI.js.map +0 -1
  194. package/dist/chunk-5DBWXJBG.cjs.map +0 -1
  195. package/dist/chunk-6CDP6TGH.cjs.map +0 -1
  196. package/dist/chunk-F6U2H42L.cjs.map +0 -1
  197. package/dist/chunk-J4MCVIXU.js.map +0 -1
  198. package/dist/chunk-JBMFCHNT.js.map +0 -1
  199. package/dist/chunk-LZXZ3C6M.js.map +0 -1
  200. /package/dist/{chunk-77XUG4Z4.js.map → chunk-2FCONMFQ.js.map} +0 -0
  201. /package/dist/{chunk-M3JA577H.js.map → chunk-6SN6IVLN.js.map} +0 -0
  202. /package/dist/{chunk-QYFXRVH3.js.map → chunk-7XVYYJHT.js.map} +0 -0
  203. /package/dist/{chunk-VSQVJHOS.js.map → chunk-AKVO7FP4.js.map} +0 -0
  204. /package/dist/{chunk-LF4S37VU.js.map → chunk-AV7Z25I6.js.map} +0 -0
  205. /package/dist/{chunk-PYNHPMDB.js.map → chunk-BWUJUOI6.js.map} +0 -0
  206. /package/dist/{chunk-LNOXNCEC.js.map → chunk-D3G6PGO5.js.map} +0 -0
  207. /package/dist/{chunk-SG53SIJX.js.map → chunk-ERYNBP3I.js.map} +0 -0
  208. /package/dist/{chunk-Z7A7FUWY.js.map → chunk-F4HUQV3I.js.map} +0 -0
  209. /package/dist/{chunk-Y2MDXJB4.js.map → chunk-JZCCRN3K.js.map} +0 -0
  210. /package/dist/{chunk-WVDBRL2S.js.map → chunk-KSRNOGR7.js.map} +0 -0
  211. /package/dist/{chunk-QD4BVKAU.js.map → chunk-NIIR776F.js.map} +0 -0
  212. /package/dist/{chunk-H6SSHFMD.js.map → chunk-OMP5KPDM.js.map} +0 -0
  213. /package/dist/{chunk-J4VGVLQI.js.map → chunk-OPGUDB4U.js.map} +0 -0
  214. /package/dist/{chunk-VE7HLTVQ.js.map → chunk-OX4IH3OJ.js.map} +0 -0
  215. /package/dist/{chunk-GRBZC5N3.js.map → chunk-PELIFROQ.js.map} +0 -0
  216. /package/dist/{chunk-YCVDJX7Z.js.map → chunk-U5CUVGUQ.js.map} +0 -0
  217. /package/dist/{chunk-3S56I5MX.js.map → chunk-U7J7G5J7.js.map} +0 -0
  218. /package/dist/{chunk-OB3ZJ7GQ.js.map → chunk-XGB5EEFZ.js.map} +0 -0
@@ -1,25 +1,25 @@
1
1
  "use client";
2
2
  import {
3
3
  ContactForm
4
- } from "./chunk-QD4BVKAU.js";
4
+ } from "./chunk-NIIR776F.js";
5
5
  import {
6
6
  DeliveryRow,
7
7
  DevCardRowContent,
8
8
  DevCardRowSkeletonList,
9
9
  DevSectionPage,
10
10
  ListEmptyState
11
- } from "./chunk-YCVDJX7Z.js";
11
+ } from "./chunk-U5CUVGUQ.js";
12
12
  import {
13
13
  EmptyState,
14
14
  UnifiedPagination
15
- } from "./chunk-M3JA577H.js";
15
+ } from "./chunk-6SN6IVLN.js";
16
16
  import {
17
17
  TICKET_MARK_READ_DEBOUNCE_MS,
18
18
  TICKET_TEXT_MAX_CHARS,
19
19
  TOAST_COPY,
20
20
  isOptimistic,
21
21
  useOptionalTicketLive
22
- } from "./chunk-Z7A7FUWY.js";
22
+ } from "./chunk-F4HUQV3I.js";
23
23
  import {
24
24
  AlertDialog,
25
25
  AlertDialogAction,
@@ -35,11 +35,11 @@ import {
35
35
  Textarea,
36
36
  TicketAttachmentsList,
37
37
  devSectionAnchorId
38
- } from "./chunk-JBMFCHNT.js";
38
+ } from "./chunk-HIYZHMNX.js";
39
39
  import {
40
40
  toast,
41
41
  useScrollToHash
42
- } from "./chunk-J4MCVIXU.js";
42
+ } from "./chunk-BNJBJTEK.js";
43
43
  import {
44
44
  PAGE_PARAM_LIMITS,
45
45
  pageCount,
@@ -55,7 +55,7 @@ import {
55
55
  formatRelativeTime,
56
56
  useChatAttachments,
57
57
  useChatIdentity
58
- } from "./chunk-OB3ZJ7GQ.js";
58
+ } from "./chunk-XGB5EEFZ.js";
59
59
  import {
60
60
  STICKY_HEADER_OFFSET_PX,
61
61
  scrollElementIntoView
@@ -71,7 +71,7 @@ import {
71
71
  SquareAvatar,
72
72
  StatusBadge,
73
73
  getStatusColorScheme
74
- } from "./chunk-Y2MDXJB4.js";
74
+ } from "./chunk-JZCCRN3K.js";
75
75
  import {
76
76
  embedAuthedFetch
77
77
  } from "./chunk-MOKB32FL.js";
@@ -86,7 +86,7 @@ import {
86
86
  } from "./chunk-RGI52IWK.js";
87
87
  import {
88
88
  Button
89
- } from "./chunk-4HVWGYHI.js";
89
+ } from "./chunk-LPLXCDNV.js";
90
90
 
91
91
  // src/components/tickets/ticket-center.tsx
92
92
  import { useQueryClient as useQueryClient2 } from "@tanstack/react-query";
@@ -1833,4 +1833,4 @@ export {
1833
1833
  HelpCenterCreateForm,
1834
1834
  HelpCenterList
1835
1835
  };
1836
- //# sourceMappingURL=chunk-77XUG4Z4.js.map
1836
+ //# sourceMappingURL=chunk-2FCONMFQ.js.map
@@ -18,6 +18,10 @@ var buttonSurfaceClasses = {
18
18
  transparent: "bg-transparent text-ods-text-primary hover:bg-ods-bg-hover active:bg-ods-bg-active disabled:bg-transparent disabled:text-ods-text-disabled aria-disabled:bg-transparent aria-disabled:text-ods-text-disabled",
19
19
  destructive: "bg-ods-error text-ods-text-on-accent hover:bg-ods-error-hover active:bg-ods-error-active disabled:bg-ods-disabled aria-disabled:bg-ods-disabled",
20
20
  warning: "bg-ods-warning text-ods-text-on-accent hover:bg-ods-warning-hover active:bg-ods-warning-active disabled:bg-ods-disabled aria-disabled:bg-ods-disabled",
21
+ // The page's colours swapped: light on a dark theme, dark on a light one. A
22
+ // strong action that must NOT be the accent, for a surface that already
23
+ // holds the one accent call to action (an "Approve" inside a product demo).
24
+ inverted: "bg-ods-text-primary text-ods-bg hover:bg-ods-text-secondary active:bg-ods-text-secondary disabled:bg-ods-disabled aria-disabled:bg-ods-disabled",
21
25
  // A self-contained glyph (play badge, unmute glyph) that already carries its
22
26
  // own scrim: no button surface at all, in any state. Distinct from
23
27
  // `transparent`, whose hover/active fills would paint a rectangle behind the
@@ -69,6 +73,7 @@ var buttonVariants = _classvarianceauthority.cva.call(void 0,
69
73
  transparent: buttonSurfaceClasses.transparent,
70
74
  destructive: buttonSurfaceClasses.destructive,
71
75
  warning: buttonSurfaceClasses.warning,
76
+ inverted: buttonSurfaceClasses.inverted,
72
77
  glyph: buttonSurfaceClasses.glyph,
73
78
  overlay: buttonSurfaceClasses.overlay,
74
79
  link: buttonSurfaceClasses.link
@@ -576,4 +581,4 @@ SplitButton.displayName = "SplitButton";
576
581
 
577
582
 
578
583
  exports.buttonVariants = buttonVariants; exports.Button = Button; exports.SplitButton = SplitButton;
579
- //# sourceMappingURL=chunk-F6U2H42L.cjs.map
584
+ //# sourceMappingURL=chunk-2JRKNGJ4.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-2JRKNGJ4.cjs","../src/components/ui/button/button.tsx","../src/components/ui/button/button-styles.ts","../src/components/ui/button/split-button.tsx"],"names":["cva","jsx","jsxs"],"mappings":"AAAA,yRAAY;AACZ;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACNA,iDAAqB;AACrB,kEAAuC;AACvC,4EAAkB;ADQlB;AACA;AERO,IAAM,qBAAA,EAAuB;AAAA,EAClC,MAAA,EACE,oJAAA;AAAA,EACF,OAAA,EACE,qMAAA;AAAA,EACF,WAAA,EACE,8MAAA;AAAA,EACF,WAAA,EACE,iJAAA;AAAA,EACF,OAAA,EACE,uJAAA;AAAA;AAAA;AAAA;AAAA,EAIF,QAAA,EACE,iJAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMF,KAAA,EACE,2MAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMF,IAAA,EAAM,iQAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKN,OAAA,EACE;AACJ,CAAA;AAEO,IAAM,qBAAA,EACX,mJAAA;AAWK,IAAM,sBAAA,EAAwB,uDAAA;AAW9B,IAAM,qBAAA,EAAuB;AAAA,EAClC,OAAA,EAAS,qBAAA;AAAA,EACT,KAAA,EAAO;AACT,CAAA;AAGO,IAAM,yBAAA,EAA2B;AAAA,EACtC,MAAA,EAAQ,0BAAA;AAAA,EACR,OAAA,EAAS,mBAAA;AAAA,EACT,WAAA,EAAa,mBAAA;AAAA,EACb,WAAA,EAAa,yBAAA;AAAA,EACb,OAAA,EAAS;AACX,CAAA;AFtBA;AACA;ACmME,+CAAA;AA5OF,IAAM,eAAA,EAAiB,yCAAA;AAAA,EACrB;AAAA,IACE,kFAAA;AAAA,IACA,8BAAA;AAAA,IACA,gCAAA;AAAA,IACA,8EAAA;AAAA,IACA,8BAAA;AAAA,IACA;AAAA,EACF,CAAA;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA,QACP,MAAA,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F,EAAA;AAENC,IAAAA;AAAC,MAAA;AAAA,MAAA;AACC,QAAA;AACA,QAAA;AACkC,QAAA;AACU,QAAA;AACjB,QAAA;AACD,QAAA;AACd,QAAA;AAC4C,QAAA;AACxD,QAAA;AAEC,QAAA;AAAA,MAAA;AACH,IAAA;AAEJ,EAAA;AAIK,EAAA;AAGP;AAGE;AACY,EAAA;AACH,EAAA;AACK,EAAA;AACZ,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACc,EAAA;AACd,EAAA;AAGF;AACkC,EAAA;AAGhCC,EAAAA;AAAC,IAAA;AAAA,IAAA;AACC,MAAA;AACK,MAAA;AACO,MAAA;AAC+D,MAAA;AAE3E,MAAA;AAAAA,wBAAAA;AAAC,UAAA;AAAA,UAAA;AACC,YAAA;AACA,YAAA;AACK,YAAA;AACL,YAAA;AACA,YAAA;AACA,YAAA;AACA,YAAA;AACA,YAAA;AACsB,YAAA;AAChB,YAAA;AACN,YAAA;AACA,YAAA;AAEC,YAAA;AAAiE,cAAA;AAClD,8BAAA;AACoD,cAAA;AAAA,YAAA;AAAA,UAAA;AACtE,QAAA;AACAD,wBAAAA;AAAC,UAAA;AAAA,UAAA;AACC,YAAA;AACA,YAAA;AACK,YAAA;AACL,YAAA;AACiB,YAAA;AACQ,YAAA;AACJ,YAAA;AACD,YAAA;AACa,YAAA;AACC,YAAA;AAE0B,YAAA;AAAA,UAAA;AAC9D,QAAA;AAAA,MAAA;AAAA,IAAA;AACF,EAAA;AAEH;AACyB;AHqU8F;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-2JRKNGJ4.cjs","sourcesContent":[null,"'use client';\n\nimport { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport React from 'react';\nimport Link from '../../../embed-shims/next-link';\nimport { cn } from '../../../utils/cn';\nimport {\n buttonSurfaceClasses,\n outlineBorderClasses,\n splitDividerColorClasses,\n splitGlyphSizeBySize,\n} from './button-styles';\n\n// Default layout: centered single content area, padding/gap on the button itself.\nconst buttonVariants = cva(\n [\n 'relative inline-flex items-center justify-center gap-[var(--spacing-system-xsf)]',\n 'whitespace-nowrap rounded-md',\n 'transition-colors duration-200',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ods-focus',\n 'disabled:pointer-events-none',\n '[&_svg]:pointer-events-none [&_svg]:h-5 [&_svg]:w-5 [&_svg]:shrink-0',\n ],\n {\n variants: {\n variant: {\n accent: buttonSurfaceClasses.accent,\n outline: cn(buttonSurfaceClasses.outline, outlineBorderClasses),\n transparent: buttonSurfaceClasses.transparent,\n destructive: buttonSurfaceClasses.destructive,\n warning: buttonSurfaceClasses.warning,\n inverted: buttonSurfaceClasses.inverted,\n glyph: buttonSurfaceClasses.glyph,\n overlay: buttonSurfaceClasses.overlay,\n link: buttonSurfaceClasses.link,\n },\n size: {\n default: 'h-11 px-[var(--spacing-system-m)] py-[var(--spacing-system-sf)] text-h3 md:h-12',\n small: 'h-6 p-[var(--spacing-system-xs)] text-h5 md:h-8',\n // The CHILD is the affordance (a badge, a chip, a thumbnail): the button\n // contributes the hit target, the focus ring and the keyboard/ARIA\n // semantics, and NO box of its own. Without this, call sites reached for\n // a `className=\"h-auto p-0\"` override to cancel the default box.\n wrap: 'h-auto p-0',\n 'small-legacy': 'h-10 px-[var(--spacing-system-m)] py-[var(--spacing-system-xs)] text-[14px] font-bold', // Temporary alias for \"small\" — deprecated; grep size=\"small-legacy\" (lib + hub) and migrate the remaining consumers before removal\n // 24px pill for slim strips (announcement/promo bars, inline banner\n // actions — Primer banner / Polaris banner / Vercel-bar convention).\n // The label matches the strip's MESSAGE type ramp exactly (DM Sans\n // regular, 13px -> md:14px, snug leading — the announcement bar's\n // subtitle styling): in-strip CTAs must never read louder than the\n // message beside them, so this deliberately uses neither the\n // mono-uppercase control style of \"small\" nor a heavier weight.\n // Pinned h-6 across breakpoints (24px = the WCAG 2.5.8 target-size\n // floor) with horizontal-dominant padding and a 14px glyph.\n compact: 'h-6 px-[var(--spacing-system-sf)] py-0 font-normal text-h6 [&_svg]:h-3.5 [&_svg]:w-3.5',\n icon: 'h-11 w-11 p-[var(--spacing-system-sf)] md:h-12 md:w-12 [&_svg]:h-4 [&_svg]:w-4 md:[&_svg]:h-6 md:[&_svg]:w-6',\n // Quiet 32px icon target with a 16px glyph, fixed across breakpoints\n // (Carbon ghost sm / Primer medium / shadcn icon-sm all pin 32px;\n // ≥ the 24px WCAG 2.5.8 target floor). For icon actions that read as\n // metadata rather than CTAs — author-page social rows, share rows.\n // Pair with variant=\"transparent\" for the ghost treatment.\n 'icon-sm': 'h-8 w-8 p-[var(--spacing-system-xxs)] [&_svg]:h-4 [&_svg]:w-4',\n // 20px inline glyph for affordances that sit INSIDE a line of text —\n // an info hint beside a badge, a copy glyph after an id. `icon-sm`'s\n // 32px target is correct for a metadata row but visually swamps a\n // 10px badge or a 14px label, so hosts were reaching for className\n // overrides to shrink it. Below the WCAG 2.5.8 target floor on purpose:\n // this is only for glyphs whose information is ALSO available another\n // way (tooltip content mirrored into an aria-describedby node), never\n // for a sole means of performing an action.\n 'icon-inline': 'h-5 min-h-0 w-5 min-w-0 shrink-0 p-0 [&_svg]:h-3.5 [&_svg]:w-3.5',\n // Bare 56px media glyph (play / unmute over video). A size variant so\n // hosts stop re-implementing a <button> to escape the 20px svg cap.\n 'icon-glyph': 'h-14 w-14 p-0 [&_svg]:h-14 [&_svg]:w-14',\n },\n // Label typography axis (Figma 133-740). `bold` is the classic h3-bold\n // label; `regular` swaps the DEFAULT size's label to the h4 step\n // (DM Sans 500, neutral tracking) — added for navigation buttons.\n // `small` keeps its mono-uppercase h5 label on both fonts per the spec.\n font: {\n bold: '',\n regular: '',\n },\n fullWidth: {\n true: 'w-full',\n false: '',\n },\n noPaddingX: {\n true: 'px-0',\n false: '',\n },\n },\n compoundVariants: [\n { size: 'small', class: '[&_svg]:h-4 [&_svg]:w-4' },\n // Comes after the size classes, so cn()'s tailwind-merge resolves the\n // ods-typography group in favour of text-h4.\n { size: 'default', font: 'regular', class: 'text-h4' },\n ],\n defaultVariants: {\n variant: 'accent',\n size: 'default',\n font: 'bold',\n fullWidth: false,\n noPaddingX: false,\n },\n },\n);\n\n// Split layout (used when `splitIcon` is provided): outer button has no padding;\n// inner slots own padding/gap so the divider can span full button height.\nconst splitShellVariants = cva(\n [\n 'group relative inline-flex items-stretch overflow-hidden whitespace-nowrap rounded-md',\n 'transition-colors duration-200',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ods-focus',\n 'disabled:pointer-events-none',\n ],\n {\n variants: {\n variant: {\n accent: buttonSurfaceClasses.accent,\n outline: cn(buttonSurfaceClasses.outline, outlineBorderClasses),\n transparent: buttonSurfaceClasses.transparent,\n destructive: buttonSurfaceClasses.destructive,\n warning: buttonSurfaceClasses.warning,\n },\n size: {\n default: 'h-12',\n small: 'h-6 text-h5 md:h-8',\n },\n // Same label-typography axis as the normal layout — `regular` swaps the\n // default size's h3-bold label for the h4 (DM Sans 500) step.\n font: { bold: '', regular: '' },\n fullWidth: { true: 'w-full', false: '' },\n },\n compoundVariants: [\n { size: 'default', font: 'bold', class: 'text-h3' },\n { size: 'default', font: 'regular', class: 'text-h4' },\n ],\n defaultVariants: { variant: 'accent', size: 'default', font: 'bold', fullWidth: false },\n },\n);\n\nconst splitSlotVariants = cva(\n // Glyph size lives per-size, not in the base: cva concatenates base + variant\n // without tailwind-merge, so a base `[&_svg]:h-5` and a variant `[&_svg]:h-4`\n // would both ship and the winner would come down to stylesheet order.\n ['inline-flex items-center justify-center', '[&_svg]:shrink-0'],\n {\n variants: {\n slot: {\n main: 'gap-[var(--spacing-system-xsf)]',\n icon: 'border-l',\n },\n size: splitGlyphSizeBySize,\n variant: { accent: '', outline: '', transparent: '', destructive: '', warning: '' },\n fullWidth: { true: '', false: '' },\n },\n compoundVariants: [\n { slot: 'main', size: 'default', class: 'px-[var(--spacing-system-m)] py-[var(--spacing-system-sf)]' },\n { slot: 'main', size: 'small', class: 'px-[var(--spacing-system-xs)]' },\n // `fullWidth` stretches the SHELL, not its children, so without this the main\n // half stays content-sized and the icon half floats mid-button with dead space\n // after it instead of sitting flush against the trailing edge. Keyed on\n // `fullWidth` to match `SplitButton`, which grows its main half on exactly the\n // same condition (`grow={fullWidth}`) — the two split layouts render side by\n // side in the same rows and must not disagree. Callers that stretch the shell\n // some other way (a `flex-1` className, a grid cell) keep the old behaviour.\n { slot: 'main', fullWidth: true, class: 'flex-1' },\n { slot: 'icon', size: 'default', class: 'w-10' },\n { slot: 'icon', size: 'small', class: 'w-6 md:w-8' },\n {\n slot: 'icon',\n variant: 'accent',\n class: cn(\n splitDividerColorClasses.accent,\n 'group-disabled:border-ods-disabled group-aria-disabled:border-ods-disabled',\n ),\n },\n { slot: 'icon', variant: 'outline', class: splitDividerColorClasses.outline },\n { slot: 'icon', variant: 'transparent', class: splitDividerColorClasses.transparent },\n {\n slot: 'icon',\n variant: 'destructive',\n class: cn(\n splitDividerColorClasses.destructive,\n 'group-disabled:border-ods-disabled group-aria-disabled:border-ods-disabled',\n ),\n },\n {\n slot: 'icon',\n variant: 'warning',\n class: cn(\n splitDividerColorClasses.warning,\n 'group-disabled:border-ods-disabled group-aria-disabled:border-ods-disabled',\n ),\n },\n ],\n defaultVariants: { slot: 'main', size: 'default', variant: 'accent', fullWidth: false },\n },\n);\n\n/** @deprecated Use `size=\"small\"` instead. Temporary alias kept for backward compatibility; will be removed in the future. */\ntype DeprecatedButtonSize = 'small-legacy';\n\ntype ButtonSize =\n Exclude<VariantProps<typeof buttonVariants>['size'], 'small-legacy' | null | undefined> | DeprecatedButtonSize;\n\ninterface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>, Omit<VariantProps<typeof buttonVariants>, 'size'> {\n asChild?: boolean;\n href?: string;\n openInNewTab?: boolean;\n prefetch?: boolean;\n /**\n * Pre-resolved anchor bundle (from `useNavLink({ href, targetPlatform })`).\n * When set, renders the Button as `<Link>` with `href` / `target` / `rel`\n * / `onClick` spread from this object. Lets callers thread the unified\n * nav decision directly without `<Button asChild><a {...linkProps}/>`\n * gymnastics. Wins over the separate `href` / `openInNewTab` props.\n */\n /**\n * Render a plain `<a href download>` instead of a Next `<Link>`.\n * A download is a RESOURCE fetch, not a route change: `<Link>` would try to\n * prefetch/route it. Only meaningful together with `href`.\n */\n download?: boolean | string;\n linkProps?: {\n href: string;\n target?: '_blank';\n /** `noopener` alone keeps the Referer for a new-tab link to one of our own\n * platforms (cross-domain analytics attribution); `noreferrer` is for\n * third-party destinations. */\n rel?: 'noopener' | 'noopener noreferrer';\n onClick?: React.MouseEventHandler<HTMLAnchorElement>;\n } | null;\n leftIcon?: React.ReactNode;\n rightIcon?: React.ReactNode;\n /**\n * Renders a vertical divider and trailing icon area inside the button.\n * The whole button stays a single click target — the icon is decorative\n * (`aria-hidden`). For two independent click targets, use `<SplitButton>`.\n * Only honored when `size` is `\"default\"` or `\"small\"`.\n */\n splitIcon?: React.ReactNode;\n loading?: boolean;\n size?: ButtonSize;\n}\n\nconst Spinner = () => (\n <svg className=\"animate-spin\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <circle className=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" strokeWidth=\"4\" />\n <path\n className=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n />\n </svg>\n);\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(function ButtonImpl(\n {\n className,\n variant,\n size,\n font,\n fullWidth,\n noPaddingX,\n asChild,\n href,\n openInNewTab,\n prefetch,\n linkProps,\n download,\n leftIcon,\n rightIcon,\n splitIcon,\n loading,\n children,\n disabled,\n onClick,\n ...props\n },\n ref,\n) {\n const isDisabled = disabled || loading;\n\n // splitIcon is only supported for default/small sizes. With other sizes\n // (icon, small-legacy) we silently fall back to the normal layout.\n const useSplitLayout = !!splitIcon && (size === 'default' || size === 'small' || size === undefined);\n\n if (useSplitLayout) {\n const safeSize = size ?? 'default';\n const safeVariant = (variant ?? 'accent') as 'accent' | 'outline' | 'transparent' | 'destructive' | 'warning';\n const shellClasses = cn(splitShellVariants({ variant: safeVariant, size: safeSize, font, fullWidth }), className);\n const mainSlotClass = splitSlotVariants({ slot: 'main', size: safeSize, variant: safeVariant, fullWidth });\n const iconSlotClass = splitSlotVariants({ slot: 'icon', size: safeSize, variant: safeVariant });\n\n const splitContent = (\n <>\n <span className={cn('contents', loading && 'invisible')}>\n <span className={mainSlotClass}>\n {leftIcon && <span className=\"inline-flex items-center\">{leftIcon}</span>}\n {children}\n {rightIcon && <span className=\"inline-flex items-center\">{rightIcon}</span>}\n </span>\n <span aria-hidden=\"true\" className={iconSlotClass}>\n {splitIcon}\n </span>\n </span>\n {loading && (\n // Carries the glyph scale itself: this overlay is a SIBLING of the slots, so\n // it inherits neither their `[&_svg]` sizing nor a shell base rule (the shell\n // deliberately has none — see `splitSlotVariants`). Without it the spinner\n // renders unconstrained and fills the button. Reads the same per-size ramp the\n // slots do, so it matches the glyphs it covers at both breakpoints.\n <span\n className={cn(\n 'absolute inset-0 inline-flex items-center justify-center text-ods-text-primary',\n splitGlyphSizeBySize[safeSize],\n )}\n >\n <Spinner />\n </span>\n )}\n </>\n );\n\n // A download is a resource fetch, not a route change: same `Link` as every\n // other anchor branch (so a host that registered `next/link` keeps ONE\n // anchor implementation), with prefetch off — there is no route to warm,\n // and prefetching would fetch the file itself. Checked BEFORE the\n // linkProps/href resolution.\n if (download && href) {\n return (\n <Link\n href={href}\n download={download}\n prefetch={false}\n className={cn(shellClasses, isDisabled && 'pointer-events-none')}\n aria-label={props['aria-label']}\n >\n {splitContent}\n </Link>\n );\n }\n\n // `linkProps` (the pre-resolved bundle from `useNavLink({ href, targetPlatform })`)\n // wins over the legacy `href` + `openInNewTab` props so callers can thread\n // the unified nav decision directly. Either path produces the same `<Link>`.\n const splitAnchor =\n linkProps ??\n (href\n ? {\n href,\n target: openInNewTab ? ('_blank' as const) : undefined,\n rel: openInNewTab ? ('noopener noreferrer' as const) : undefined,\n onClick: onClick as unknown as React.MouseEventHandler<HTMLAnchorElement> | undefined,\n }\n : null);\n if (splitAnchor) {\n return (\n <Link\n href={splitAnchor.href}\n prefetch={prefetch}\n target={splitAnchor.target}\n rel={splitAnchor.rel}\n // The Link branches don't spread {...props} (button attrs don't\n // belong on an anchor), but the accessible name MUST survive —\n // icon-only link buttons have no text content.\n aria-label={props['aria-label']}\n aria-disabled={isDisabled || undefined}\n tabIndex={isDisabled ? -1 : undefined}\n className={cn(shellClasses, isDisabled && 'pointer-events-none')}\n onClick={splitAnchor.onClick}\n >\n {splitContent}\n </Link>\n );\n }\n\n return (\n <button ref={ref} className={shellClasses} disabled={isDisabled} onClick={onClick} {...props}>\n {splitContent}\n </button>\n );\n }\n\n const classes = cn(buttonVariants({ variant, size, font, fullWidth, noPaddingX }), className);\n\n // asChild: consumer fully controls the rendered element; we just stamp our classes.\n if (asChild) {\n return (\n <Slot ref={ref} className={classes} {...props}>\n {children}\n </Slot>\n );\n }\n\n // Real content stays in layout (preserving width) but goes invisible while loading.\n // The spinner is absolutely positioned so it never shifts the button's size.\n const content = (\n <>\n <span className={cn('contents', loading && 'invisible')}>\n {leftIcon && <span className=\"inline-flex items-center\">{leftIcon}</span>}\n {children}\n {rightIcon && <span className=\"inline-flex items-center\">{rightIcon}</span>}\n </span>\n {loading && (\n <span className=\"absolute inset-0 inline-flex items-center justify-center text-ods-text-primary\">\n <Spinner />\n </span>\n )}\n </>\n );\n\n // Same download short-circuit as the splitIcon branch.\n if (download && href) {\n return (\n <Link\n href={href}\n download={download}\n prefetch={false}\n className={cn(classes, isDisabled && 'pointer-events-none')}\n aria-label={props['aria-label']}\n >\n {content}\n </Link>\n );\n }\n\n // Same `linkProps`-wins-over-href resolution as the splitIcon branch.\n const anchor =\n linkProps ??\n (href\n ? {\n href,\n target: openInNewTab ? ('_blank' as const) : undefined,\n rel: openInNewTab ? ('noopener noreferrer' as const) : undefined,\n onClick: onClick as unknown as React.MouseEventHandler<HTMLAnchorElement> | undefined,\n }\n : null);\n if (anchor) {\n return (\n <Link\n href={anchor.href}\n prefetch={prefetch}\n target={anchor.target}\n rel={anchor.rel}\n // See the splitAnchor branch — keep the accessible name on the\n // anchor render (icon-only link buttons have no text content).\n aria-label={props['aria-label']}\n aria-disabled={isDisabled || undefined}\n tabIndex={isDisabled ? -1 : undefined}\n className={cn(classes, isDisabled && 'pointer-events-none')}\n onClick={anchor.onClick}\n >\n {content}\n </Link>\n );\n }\n\n return (\n <button ref={ref} className={classes} disabled={isDisabled} onClick={onClick} {...props}>\n {content}\n </button>\n );\n});\nButton.displayName = 'Button';\n\nexport { Button, buttonVariants, type ButtonProps };\n","// Shared style atoms for `Button` and `SplitButton`. Extracted to keep a single\n// source of truth for surface colors, outline borders, and split-divider colors.\n\n// Each variant pairs `disabled:` (real `<button disabled>`) with `aria-disabled:`\n// (used for `<Link aria-disabled>` since anchors don't support `:disabled`).\nexport const buttonSurfaceClasses = {\n accent:\n 'bg-ods-accent text-ods-text-on-accent hover:bg-ods-accent-hover active:bg-ods-accent-active disabled:bg-ods-disabled aria-disabled:bg-ods-disabled',\n outline:\n 'bg-ods-card text-ods-text-primary hover:bg-ods-bg-hover active:bg-ods-bg-active disabled:bg-ods-card disabled:text-ods-text-disabled aria-disabled:bg-ods-card aria-disabled:text-ods-text-disabled',\n transparent:\n 'bg-transparent text-ods-text-primary hover:bg-ods-bg-hover active:bg-ods-bg-active disabled:bg-transparent disabled:text-ods-text-disabled aria-disabled:bg-transparent aria-disabled:text-ods-text-disabled',\n destructive:\n 'bg-ods-error text-ods-text-on-accent hover:bg-ods-error-hover active:bg-ods-error-active disabled:bg-ods-disabled aria-disabled:bg-ods-disabled',\n warning:\n 'bg-ods-warning text-ods-text-on-accent hover:bg-ods-warning-hover active:bg-ods-warning-active disabled:bg-ods-disabled aria-disabled:bg-ods-disabled',\n // The page's colours swapped: light on a dark theme, dark on a light one. A\n // strong action that must NOT be the accent, for a surface that already\n // holds the one accent call to action (an \"Approve\" inside a product demo).\n inverted:\n 'bg-ods-text-primary text-ods-bg hover:bg-ods-text-secondary active:bg-ods-text-secondary disabled:bg-ods-disabled aria-disabled:bg-ods-disabled',\n // A self-contained glyph (play badge, unmute glyph) that already carries its\n // own scrim: no button surface at all, in any state. Distinct from\n // `transparent`, whose hover/active fills would paint a rectangle behind the\n // glyph — which is why call sites were undoing them with\n // `hover:bg-transparent active:bg-transparent`.\n glyph:\n 'bg-transparent text-ods-text-primary hover:bg-transparent active:bg-transparent disabled:bg-transparent disabled:text-ods-text-disabled aria-disabled:bg-transparent aria-disabled:text-ods-text-disabled',\n // A quiet inline text action (a \"Show all\" / \"Show less\" disclosure, a\n // secondary \"Clear\" beside a field): secondary text that takes the accent on\n // hover, and no surface in any state. Promoted to a variant because the\n // disclosure toggle was a primitive <button> restating these classes. Pair\n // with size=\"compact\" and noPaddingX so the label aligns with the text above.\n link: 'bg-transparent text-ods-text-secondary hover:bg-transparent hover:text-ods-accent active:bg-transparent active:text-ods-accent-active disabled:bg-transparent disabled:text-ods-text-disabled aria-disabled:bg-transparent aria-disabled:text-ods-text-disabled',\n // Chrome that sits ON media (video cards, image lightboxes): a scrim disc so\n // the glyph stays legible over an arbitrary frame. Promoted to a variant\n // because the walkthrough card, its theater and the bite cards were each\n // stacking the same classes at the call site.\n overlay:\n 'rounded-full bg-ods-overlay text-ods-text-primary backdrop-blur-sm hover:text-ods-accent active:text-ods-accent-active disabled:text-ods-text-disabled aria-disabled:text-ods-text-disabled',\n} as const;\n\nexport const outlineBorderClasses =\n 'border border-ods-border hover:border-ods-border-hover active:border-ods-border-active disabled:border-ods-border aria-disabled:border-ods-border';\n\n// Glyph scale for the split-layout button family: 16px below md, 24px from md.\n//\n// Shared because the same page-header action renders through EITHER of the two\n// split layouts depending on its shape — `SplitButton` for two click targets, and\n// `Button` + `splitIcon` for one with a decorative trailing glyph — and the two sit\n// side by side in the same row. They used to disagree: `SplitButton` carried this\n// responsive scale while the `Button` split slots re-declared a flat 20px, so a\n// \"submenu\" action's icons rendered 4px smaller than its neighbour's on desktop.\n// `Button`'s own flat `[&_svg]:h-5` stays as it is for ordinary (non-split) buttons.\nexport const splitGlyphSizeClasses = '[&_svg]:h-4 [&_svg]:w-4 md:[&_svg]:h-6 md:[&_svg]:w-6';\n\n// Per-size glyph scale for `Button`'s split slots AND the loading overlay that\n// covers them, so those two read from ONE place — the overlay sits outside both\n// slots and inherits neither their sizing nor a shell base rule, so without this it\n// would have to restate a number, which is the divergence described above.\n//\n// Scoped to `Button` on purpose: `SplitButton` keeps its own `small` ramp\n// (12px → 16px, vs the flat 16px here) and only shares the `default` step through\n// `splitGlyphSizeClasses`. Aligning `small` too is a visible design change, so it is\n// not folded in here silently.\nexport const splitGlyphSizeBySize = {\n default: splitGlyphSizeClasses,\n small: '[&_svg]:h-4 [&_svg]:w-4',\n} as const;\n\n// Color of the vertical seam between the main and icon halves (split layouts).\nexport const splitDividerColorClasses = {\n accent: 'border-ods-accent-active',\n outline: 'border-ods-border',\n transparent: 'border-ods-border',\n destructive: 'border-ods-error-active',\n warning: 'border-ods-warning-active',\n} as const;\n\nexport type ButtonSurfaceVariant = keyof typeof buttonSurfaceClasses;\n","'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport React from 'react';\nimport Link from '../../../embed-shims/next-link';\nimport { cn } from '../../../utils/cn';\nimport { buttonSurfaceClasses, splitDividerColorClasses, splitGlyphSizeClasses } from './button-styles';\n\n// Two independent interactive halves: each a `<button>` or `<a>`. The seam is\n// a 1px border on the left edge of the icon half, colored per variant. For a\n// single-target variant (decorative trailing icon), use `<Button splitIcon>`.\n\nconst splitHalfBase = [\n 'relative inline-flex items-center justify-center gap-[var(--spacing-system-xsf)]',\n 'whitespace-nowrap transition-colors duration-200',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ods-focus focus-visible:z-10',\n 'disabled:pointer-events-none',\n '[&_svg]:pointer-events-none [&_svg]:shrink-0',\n];\n\nconst splitHalfVariants = cva(splitHalfBase, {\n variants: {\n variant: {\n accent: buttonSurfaceClasses.accent,\n outline: buttonSurfaceClasses.outline, // Outline border lives in compoundVariants so we can omit the seam edge.\n transparent: buttonSurfaceClasses.transparent,\n destructive: buttonSurfaceClasses.destructive,\n warning: buttonSurfaceClasses.warning,\n },\n size: {\n default: `h-10 px-[var(--spacing-system-m)] py-[var(--spacing-system-sf)] text-h3 md:h-12 ${splitGlyphSizeClasses}`,\n small: 'h-6 px-[var(--spacing-system-xs)] text-h5 md:h-8 [&_svg]:h-3 [&_svg]:w-3 md:[&_svg]:h-4 md:[&_svg]:w-4',\n },\n side: { main: '', icon: '' },\n soloOnMobile: { true: '', false: '' },\n },\n compoundVariants: [\n // Rounded corners + per-variant seam. The icon-side's left border is the divider.\n { variant: 'accent', side: 'main', class: 'rounded-l-md' },\n {\n variant: 'accent',\n side: 'icon',\n class: cn(\n 'rounded-r-md border-l',\n splitDividerColorClasses.accent,\n 'disabled:border-ods-disabled aria-disabled:border-ods-disabled',\n ),\n },\n { variant: 'destructive', side: 'main', class: 'rounded-l-md' },\n {\n variant: 'destructive',\n side: 'icon',\n class: cn(\n 'rounded-r-md border-l',\n splitDividerColorClasses.destructive,\n 'disabled:border-ods-disabled aria-disabled:border-ods-disabled',\n ),\n },\n { variant: 'warning', side: 'main', class: 'rounded-l-md' },\n {\n variant: 'warning',\n side: 'icon',\n class: cn(\n 'rounded-r-md border-l',\n splitDividerColorClasses.warning,\n 'disabled:border-ods-disabled aria-disabled:border-ods-disabled',\n ),\n },\n { variant: 'outline', side: 'main', class: 'rounded-l-md border-y border-l border-ods-border' },\n { variant: 'outline', side: 'icon', class: 'rounded-r-md border border-ods-border' },\n { variant: 'transparent', side: 'main', class: 'rounded-md' },\n { variant: 'transparent', side: 'icon', class: cn('rounded-md', splitDividerColorClasses.transparent) },\n\n // Icon half: per Figma, narrower than main height (default: 40×48; small: 32×32).\n { side: 'icon', size: 'default', class: 'w-10 px-0' },\n { side: 'icon', size: 'small', class: 'w-6 px-0 md:w-8' },\n\n { side: 'icon', soloOnMobile: true, class: 'max-md:hidden' },\n { side: 'main', soloOnMobile: true, class: 'max-md:rounded-r-md' },\n { variant: 'outline', side: 'main', soloOnMobile: true, class: 'max-md:border-r' },\n ],\n defaultVariants: { variant: 'accent', size: 'default', side: 'main', soloOnMobile: false },\n});\n\ntype SplitButtonVariant = NonNullable<VariantProps<typeof splitHalfVariants>['variant']>;\ntype SplitButtonSize = NonNullable<VariantProps<typeof splitHalfVariants>['size']>;\n\ninterface SplitButtonIconAction {\n icon: React.ReactNode;\n /** The icon half is interactive but has no visible text — needs an accessible name. */\n 'aria-label': string;\n onClick?: React.MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>;\n href?: string;\n /**\n * Opens `href` with `target=\"_blank\"`. Also marks the half as a new-tab\n * affordance, which hides it below `md` (set it for `onClick` handlers that\n * open a new tab/window themselves).\n */\n openInNewTab?: boolean;\n prefetch?: boolean;\n disabled?: boolean;\n}\n\ninterface SplitButtonProps {\n variant?: SplitButtonVariant;\n size?: SplitButtonSize;\n fullWidth?: boolean;\n className?: string;\n\n children: React.ReactNode;\n onClick?: React.MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>;\n href?: string;\n openInNewTab?: boolean;\n prefetch?: boolean;\n leftIcon?: React.ReactNode;\n rightIcon?: React.ReactNode;\n /** Disables both halves. Equivalent to `mainDisabled && iconAction.disabled`. */\n disabled?: boolean;\n /** Disables only the main half. Combine with `iconAction.disabled` for finer control. */\n mainDisabled?: boolean;\n type?: 'button' | 'submit' | 'reset';\n 'aria-label'?: string;\n groupAriaLabel?: string;\n\n iconAction: SplitButtonIconAction;\n}\n\ninterface HalfOptions {\n variant: SplitButtonVariant;\n size: SplitButtonSize;\n side: 'main' | 'icon';\n soloOnMobile?: boolean;\n href?: string;\n openInNewTab?: boolean;\n prefetch?: boolean;\n onClick?: React.MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>;\n disabled?: boolean;\n /** Stretch this half to fill the group's free space (the icon half stays fixed-width). */\n grow?: boolean;\n type?: 'button' | 'submit' | 'reset';\n ariaLabel?: string;\n children: React.ReactNode;\n}\n\nfunction Half({\n variant,\n size,\n side,\n soloOnMobile,\n href,\n openInNewTab,\n prefetch,\n onClick,\n disabled,\n grow,\n type = 'button',\n ariaLabel,\n children,\n}: HalfOptions) {\n const classes = cn(splitHalfVariants({ variant, size, side, soloOnMobile }), grow && 'flex-1');\n\n if (href) {\n return (\n <Link\n href={href}\n prefetch={prefetch}\n target={openInNewTab ? '_blank' : undefined}\n rel={openInNewTab ? 'noopener noreferrer' : undefined}\n aria-disabled={disabled || undefined}\n tabIndex={disabled ? -1 : undefined}\n aria-label={ariaLabel}\n className={cn(classes, disabled && 'pointer-events-none')}\n onClick={onClick}\n >\n {children}\n </Link>\n );\n }\n\n return (\n <button type={type} className={classes} disabled={disabled} aria-label={ariaLabel} onClick={onClick}>\n {children}\n </button>\n );\n}\n\nconst SplitButton = React.forwardRef<HTMLDivElement, SplitButtonProps>(function SplitButtonImpl(\n {\n variant = 'accent',\n size = 'default',\n fullWidth = false,\n className,\n children,\n onClick,\n href,\n openInNewTab,\n prefetch,\n leftIcon,\n rightIcon,\n disabled,\n mainDisabled,\n type,\n iconAction,\n 'aria-label': ariaLabel,\n groupAriaLabel,\n },\n ref,\n) {\n const soloOnMobile = !!iconAction.openInNewTab;\n\n return (\n <div\n ref={ref}\n role=\"group\"\n aria-label={groupAriaLabel}\n className={cn('inline-flex items-stretch', fullWidth && 'w-full', className)}\n >\n <Half\n variant={variant}\n size={size}\n side=\"main\"\n soloOnMobile={soloOnMobile}\n href={href}\n openInNewTab={openInNewTab}\n prefetch={prefetch}\n onClick={onClick}\n disabled={disabled || mainDisabled}\n grow={fullWidth}\n type={type}\n ariaLabel={ariaLabel}\n >\n {leftIcon && <span className=\"inline-flex items-center\">{leftIcon}</span>}\n <span>{children}</span>\n {rightIcon && <span className=\"inline-flex items-center\">{rightIcon}</span>}\n </Half>\n <Half\n variant={variant}\n size={size}\n side=\"icon\"\n soloOnMobile={soloOnMobile}\n href={iconAction.href}\n openInNewTab={iconAction.openInNewTab}\n prefetch={iconAction.prefetch}\n onClick={iconAction.onClick}\n disabled={disabled || iconAction.disabled}\n ariaLabel={iconAction['aria-label']}\n >\n <span className=\"inline-flex items-center\">{iconAction.icon}</span>\n </Half>\n </div>\n );\n});\nSplitButton.displayName = 'SplitButton';\n\nexport { SplitButton, type SplitButtonProps, type SplitButtonIconAction };\n"]}
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
2
2
 
3
3
 
4
- var _chunk5DBWXJBGcjs = require('./chunk-5DBWXJBG.cjs');
4
+ var _chunkSLSHTLNTcjs = require('./chunk-SLSHTLNT.cjs');
5
5
 
6
6
 
7
7
  var _chunkNPPI32SOcjs = require('./chunk-NPPI32SO.cjs');
@@ -12,7 +12,7 @@ var _chunkNPPI32SOcjs = require('./chunk-NPPI32SO.cjs');
12
12
 
13
13
 
14
14
 
15
- var _chunkMFU3ALKMcjs = require('./chunk-MFU3ALKM.cjs');
15
+ var _chunkYNAWEA3Gcjs = require('./chunk-YNAWEA3G.cjs');
16
16
 
17
17
 
18
18
  var _chunkDMUUWHIIcjs = require('./chunk-DMUUWHII.cjs');
@@ -21,7 +21,7 @@ var _chunkDMUUWHIIcjs = require('./chunk-DMUUWHII.cjs');
21
21
  var _chunkSADRZ4YIcjs = require('./chunk-SADRZ4YI.cjs');
22
22
 
23
23
 
24
- var _chunkVCR3TW2Hcjs = require('./chunk-VCR3TW2H.cjs');
24
+ var _chunkTVMY3U3Wcjs = require('./chunk-TVMY3U3W.cjs');
25
25
 
26
26
 
27
27
  var _chunkU2YLMFJKcjs = require('./chunk-U2YLMFJK.cjs');
@@ -39,7 +39,7 @@ var _jsxruntime = require('react/jsx-runtime');
39
39
  function DocSearchResultRow({ result, isHighlighted }) {
40
40
  const docType = _optionalChain([result, 'access', _ => _.metadata, 'optionalAccess', _2 => _2.documentType]) || void 0;
41
41
  const sourceRepo = _optionalChain([result, 'access', _3 => _3.metadata, 'optionalAccess', _4 => _4.sourceRepo]) || void 0;
42
- const { Icon: SourceIcon, label: iconLabel } = _chunkMFU3ALKMcjs.resolveSourceIcon.call(void 0, {
42
+ const { Icon: SourceIcon, label: iconLabel } = _chunkYNAWEA3Gcjs.resolveSourceIcon.call(void 0, {
43
43
  sourceRepo,
44
44
  documentType: docType
45
45
  });
@@ -69,7 +69,7 @@ function DocSearchBar({
69
69
  renderResult
70
70
  }) {
71
71
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
72
- _chunk5DBWXJBGcjs.SearchInput,
72
+ _chunkSLSHTLNTcjs.SearchInput,
73
73
  {
74
74
  placeholder,
75
75
  value: query,
@@ -119,7 +119,7 @@ function mapDocSearchResults(docs) {
119
119
  results.push({
120
120
  id: `group-${entry.repo}`,
121
121
  // Same table label and count as the chat's grouped chip: one owner each.
122
- title: `${_chunkMFU3ALKMcjs.getSourceLabel.call(void 0, entry.repo)} ${_chunkMFU3ALKMcjs.recordCountLabel.call(void 0, rows.length)}`,
122
+ title: `${_chunkYNAWEA3Gcjs.getSourceLabel.call(void 0, entry.repo)} ${_chunkYNAWEA3Gcjs.recordCountLabel.call(void 0, rows.length)}`,
123
123
  path: rows[0].path,
124
124
  type: "file",
125
125
  metadata: {
@@ -182,7 +182,7 @@ function resolveSearchResultAction(result, source, runtimeMode, composeContentUr
182
182
  if (composed && !isAbsoluteHref(href)) {
183
183
  return { kind: "navigate-same-tab", href };
184
184
  }
185
- const isNewTab = _chunkVCR3TW2Hcjs.decideNewTab.call(void 0, {
185
+ const isNewTab = _chunkTVMY3U3Wcjs.decideNewTab.call(void 0, {
186
186
  href,
187
187
  targetPlatform: composed ? composed.targetPlatform : targetPlatform,
188
188
  surface: "useUnifiedNav",
@@ -311,27 +311,27 @@ function useDocSearch(config) {
311
311
  case "navigate-same-tab": {
312
312
  if (wantsNewTab) {
313
313
  setKeepOpen(true);
314
- window.open(action.href, "_blank", _chunkMFU3ALKMcjs.NEW_TAB_FEATURES);
314
+ window.open(action.href, "_blank", _chunkYNAWEA3Gcjs.NEW_TAB_FEATURES);
315
315
  return;
316
316
  }
317
317
  setKeepOpen(false);
318
318
  const path = baseRoute && action.href.startsWith(`${baseRoute}/`) ? action.href.slice(baseRoute.length + 1) : null;
319
319
  if (path && _optionalChain([onInPageSwap, 'optionalCall', _16 => _16(path)])) return;
320
- router.push(_chunkMFU3ALKMcjs.stripSameOriginToPath.call(void 0, action.href));
320
+ router.push(_chunkYNAWEA3Gcjs.stripSameOriginToPath.call(void 0, action.href));
321
321
  return;
322
322
  }
323
323
  case "navigate-new-tab":
324
324
  setKeepOpen(true);
325
325
  if (_optionalChain([runtime, 'optionalAccess', _17 => _17.navigation, 'access', _18 => _18.mode]) === "embed") {
326
326
  const targetPlatform = _nullishCoalesce(_optionalChain([result, 'access', _19 => _19.metadata, 'optionalAccess', _20 => _20.targetPlatform]), () => ( null));
327
- _chunkMFU3ALKMcjs.resolveExternalNavigation.call(void 0, {
327
+ _chunkYNAWEA3Gcjs.resolveExternalNavigation.call(void 0, {
328
328
  href: action.href,
329
329
  targetPlatform,
330
330
  runtime
331
331
  }).open();
332
332
  return;
333
333
  }
334
- window.open(action.href, "_blank", _chunkMFU3ALKMcjs.NEW_TAB_FEATURES);
334
+ window.open(action.href, "_blank", _chunkYNAWEA3Gcjs.NEW_TAB_FEATURES);
335
335
  return;
336
336
  case "ask-ai":
337
337
  setKeepOpen(false);
@@ -370,4 +370,4 @@ function useDocSearch(config) {
370
370
 
371
371
 
372
372
  exports.formatRelativePath = formatRelativePath; exports.DocSearchResultRow = DocSearchResultRow; exports.DocSearchBar = DocSearchBar; exports.mapDocSearchResults = mapDocSearchResults; exports.resolveSearchResultAction = resolveSearchResultAction; exports.useDocSearch = useDocSearch;
373
- //# sourceMappingURL=chunk-N4G3C4B4.cjs.map
373
+ //# sourceMappingURL=chunk-4WYMOK5O.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-N4G3C4B4.cjs","../src/components/shared/doc-search/format-relative-path.ts","../src/components/shared/doc-search/doc-search-result-row.tsx","../src/components/shared/doc-search/doc-search-bar.tsx","../src/components/shared/doc-search/map-doc-search-results.ts","../src/components/shared/doc-search/resolve-search-result-action.ts","../src/components/shared/doc-search/use-doc-search.ts"],"names":["jsx"],"mappings":"AAAA,6rBAAY;AACZ;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACpBO,SAAS,kBAAA,CAAmB,QAAA,EAA0B;AAC3D,EAAA,GAAA,CAAI,CAAC,QAAA,EAAU,OAAO,EAAA;AACtB,EAAA,MAAM,SAAA,EAAW,QAAA,CAAS,OAAA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/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-N4G3C4B4.cjs","sourcesContent":[null,"/**\n * Format a full document path as a breadcrumb trail.\n * Shows parent folders only (excludes the last segment / filename).\n *\n * @example\n * formatRelativePath('openframe-oss-tenant/architecture/api-controllers.md')\n * // → 'Openframe oss tenant / Architecture'\n */\nexport function formatRelativePath(fullPath: string): string {\n if (!fullPath) return '';\n const segments = fullPath.replace(/\\.md$/, '').split('/');\n // Show only parent path (exclude the filename itself since the title already shows it)\n const parentSegments = segments.length > 1 ? segments.slice(0, -1) : segments;\n return parentSegments.map(seg => seg.charAt(0).toUpperCase() + seg.slice(1).replace(/-/g, ' ')).join(' / ');\n}\n","'use client';\n\n/**\n * Single row in the `<SearchInput>` dropdown — the standard layout\n * used by every doc-search-backed surface (company-hub data-room\n * search bar, onboarding-guide catalog search, …). Single source of\n * truth for the row appearance so search dropdowns are visually\n * identical everywhere.\n *\n * Resolves the source icon via the same `resolveSourceIcon()`\n * registry the inline chat-card refs use, so a row pointing at e.g.\n * an onboarding-guide surfaces the SAME `<GraduationCap>` glyph the\n * chat card surfaces — no cross-surface drift.\n */\n\nimport { resolveSourceIcon } from '../../chat/utils/source-row-cta';\nimport { formatRelativePath } from './format-relative-path';\n\n/**\n * Minimal result shape this row renders. Compatible with any\n * doc-search hook whose result type exposes `{ title?, path?,\n * metadata? }`. The two hub consumers (onboarding-guide catalog,\n * data-room sidebar) both satisfy this shape via their\n * `useDocSearch` hook result.\n */\nexport interface DocSearchResultRowEntry {\n title?: string;\n path?: string;\n metadata?: Record<string, unknown>;\n}\n\nexport interface DocSearchResultRowProps {\n result: DocSearchResultRowEntry;\n isHighlighted: boolean;\n}\n\nexport function DocSearchResultRow({ result, isHighlighted }: DocSearchResultRowProps) {\n const docType = (result.metadata?.documentType as string) || undefined;\n const sourceRepo = (result.metadata?.sourceRepo as string) || undefined;\n const { Icon: SourceIcon, label: iconLabel } = resolveSourceIcon({\n sourceRepo,\n documentType: docType,\n });\n const isGroup = result.metadata?.isGroup as boolean | undefined;\n\n return (\n <div className=\"flex w-full min-w-0 items-center gap-3\">\n <span className=\"flex-shrink-0 text-ods-text-secondary\" title={iconLabel}>\n <SourceIcon className=\"size-4\" />\n </span>\n <div className=\"min-w-0 flex-1\">\n <div className={`truncate text-h6 ${isHighlighted ? 'text-ods-accent' : 'text-ods-text-primary'}`}>\n {result.title || result.path}\n </div>\n {!isGroup && result.path?.includes('/') && (\n <div className=\"mt-0.5 truncate text-ods-text-secondary text-h6\">{formatRelativePath(result.path)}</div>\n )}\n </div>\n </div>\n );\n}\n","'use client';\n\n/**\n * `<DocSearchBar>` — the canonical RAG-search dropdown surface.\n *\n * Mounted by every doc-search consumer (data-room sidebar, onboarding-\n * guide catalog, and any future surface that needs typeahead against\n * `/api/docs/search`). Wraps `<SearchInput>` with the lib's standard\n * `<DocSearchResultRow>` so the dropdown looks identical everywhere.\n *\n * ## Why a presentation component, not a \"search bar that owns its\n * own hook\"\n *\n * The data-fetching hook (`useDocSearch`) lives hub-side because it\n * depends on hub-only context (`useDocNavigation`, the rag-table-\n * config registry, the hub's `decideNewTab` helper). Moving the hook\n * would cascade ~5 more file migrations into the lib.\n *\n * Instead, the hook stays hub-side and callers pass its result into\n * this component as plain props. Both consumers shrink to ~5 lines.\n */\n\nimport type { ReactNode } from 'react';\nimport { SearchInput, type SearchResult } from '../../ui/search-input';\nimport { DocSearchResultRow } from './doc-search-result-row';\n\nexport interface DocSearchBarProps {\n placeholder: string;\n query: string;\n onQueryChange: (value: string) => void;\n /** Hook-fetched results. Reuses the lib's `<SearchInput>` `SearchResult`\n * shape directly so callers don't translate. */\n results: SearchResult[];\n isLoading: boolean;\n /** Result selection handler. Mirrors `<SearchInput>` — the second\n * `modifiers` argument is preserved so cmd-click / shift-click on\n * a result row still forces new-tab behavior. Hub `useDocSearch`\n * reads these to short-circuit to `window.open()`. */\n onResultSelect: (\n result: SearchResult,\n modifiers?: {\n metaKey?: boolean;\n ctrlKey?: boolean;\n shiftKey?: boolean;\n altKey?: boolean;\n button?: number;\n },\n ) => void;\n /** Lets the caller's hook force the dropdown open after a recent\n * internal action (e.g. result navigation). `undefined` falls back\n * to `<SearchInput>`'s built-in focus/hover heuristics. */\n showDropdown?: boolean;\n /** Defaults to 2 — matches the existing data-room and onboarding-\n * guide consumers. Override only if a surface needs different\n * typeahead semantics. */\n minQueryLength?: number;\n /** Defaults to 0 — both existing consumers debounce inside the\n * hook, not the input. */\n debounceMs?: number;\n className?: string;\n /** Optional row-renderer override. Defaults to the lib's standard\n * `<DocSearchResultRow>` (source icon + title + path breadcrumb).\n * Override only when a surface needs custom row chrome. */\n renderResult?: (result: SearchResult, isHighlighted: boolean) => ReactNode;\n}\n\nexport function DocSearchBar({\n placeholder,\n query,\n onQueryChange,\n results,\n isLoading,\n onResultSelect,\n showDropdown,\n minQueryLength = 2,\n debounceMs = 0,\n className = 'w-full',\n renderResult,\n}: DocSearchBarProps) {\n return (\n <SearchInput\n placeholder={placeholder}\n value={query}\n onChange={onQueryChange}\n results={results}\n isLoading={isLoading}\n onResultSelect={onResultSelect}\n showDropdown={showDropdown || undefined}\n debounceMs={debounceMs}\n minQueryLength={minQueryLength}\n className={className}\n renderResult={\n renderResult ??\n ((result, isHighlighted) => <DocSearchResultRow result={result} isHighlighted={isHighlighted} />)\n }\n />\n );\n}\n","/**\n * Map RAG `/api/docs/search` wire results into the `<DocSearchBar>`\n * dropdown's row shape, collapsing entity-table rows into grouped\n * results so the dropdown lists ONE \"Cap Table (12 records)\" row\n * instead of 12 individual rows.\n *\n * Pure transform — no telemetry, no navigation, no React deps. Lifted\n * from the hub's `hooks/use-docs.ts:mapDocSearchResults` (the hub's\n * `traceCompose` call was hub-only telemetry and is intentionally\n * dropped — callers that want logging can wrap this helper).\n */\n\nimport { recordCountLabel } from '../../../utils/source-grouping';\nimport { getSourceLabel } from '../../../utils/source-icons';\nimport type { SearchResult } from '../../ui/search-input';\nimport type { DocSearchResult } from './types';\n\n/** Source repos that should be collapsed into grouped results in the search bar.\n * A SEARCH rule, deliberately narrower than the chat strip's `groupsByTable`:\n * a search result is a destination, so only rows that share one are folded.\n * Only financial tables (all rows link to the same admin page).\n * Content tables (blog, webinar, podcast, etc.) stay individual since each has a unique URL. */\nconst SEARCH_GROUP_REPOS = new Set([\n 'financial-cap-table',\n 'financial-kpis',\n 'financial-pnl',\n 'financial-balance-sheet',\n 'financial-cash-flow',\n]);\n\nexport function mapDocSearchResults(docs: DocSearchResult[]): SearchResult[] {\n const entityGroups = new Map<string, DocSearchResult[]>();\n // Track insertion order — groups appear where the FIRST row of that\n // repo appeared in the response.\n const order: Array<{ type: 'entity'; repo: string } | { type: 'doc'; doc: DocSearchResult }> = [];\n const seenRepos = new Set<string>();\n\n for (const doc of docs) {\n if (doc.sourceRepo && SEARCH_GROUP_REPOS.has(doc.sourceRepo)) {\n const group = entityGroups.get(doc.sourceRepo) || [];\n group.push(doc);\n entityGroups.set(doc.sourceRepo, group);\n if (!seenRepos.has(doc.sourceRepo)) {\n seenRepos.add(doc.sourceRepo);\n order.push({ type: 'entity', repo: doc.sourceRepo });\n }\n } else {\n order.push({ type: 'doc', doc });\n }\n }\n\n const results: SearchResult[] = [];\n for (const entry of order) {\n if (entry.type === 'entity') {\n // An 'entity' entry is only pushed AFTER its group lands in the map, so\n // a miss is unreachable — but dropping one group beats throwing away the\n // whole search dropdown if that ever stops holding.\n const rows = entityGroups.get(entry.repo);\n if (!rows || rows.length === 0) continue;\n results.push({\n id: `group-${entry.repo}`,\n // Same table label and count as the chat's grouped chip: one owner each.\n title: `${getSourceLabel(entry.repo)} ${recordCountLabel(rows.length)}`,\n path: rows[0].path,\n type: 'file',\n metadata: {\n documentType: rows[0].documentType,\n externalUrl: rows[0].externalUrl,\n sourceRepo: entry.repo,\n id: rows[0].entityId,\n isGroup: true,\n items: rows.map(r => ({\n name: r.name,\n externalUrl: r.externalUrl,\n id: r.entityId,\n sourceRepo: r.sourceRepo,\n documentType: r.documentType,\n })),\n },\n });\n } else {\n const doc = entry.doc;\n const isNonMarkdown = doc.documentType && doc.documentType !== 'markdown';\n results.push({\n id: doc.path,\n title: doc.name,\n description: isNonMarkdown ? doc.name : doc.snippet,\n path: doc.path,\n type: doc.type,\n metadata: {\n matchType: doc.matchType,\n ...(doc.documentType ? { documentType: doc.documentType } : {}),\n ...(doc.externalUrl ? { externalUrl: doc.externalUrl } : {}),\n ...(doc.targetPlatform != null ? { targetPlatform: doc.targetPlatform } : {}),\n ...(doc.sourceRepo ? { sourceRepo: doc.sourceRepo } : {}),\n ...(doc.entityId ? { id: doc.entityId } : {}),\n },\n });\n }\n }\n\n return results;\n}\n","/**\n * Resolve what should happen when the user picks a search result.\n * Returns one of five typed actions so the caller is a single switch.\n *\n * Resolution order:\n * 1. `externalUrl` present → resolve the href through the host's\n * `composeContentUrl` seam (when wired), then use `decideNewTab` to\n * choose same-tab vs new-tab against the resolved `targetPlatform`.\n * 2. Row has `id` + `sourceRepo` + `documentType` → synth an Ask-AI\n * action (entity drill-in via primary key, no URL).\n * 3. Row has only `path` → legacy navigation fallback.\n * 4. Nothing actionable → noop.\n *\n * Lifted from the hub's `hooks/use-docs.ts:resolveSearchResultAction`.\n * Pure — no React, no telemetry.\n */\n\nimport type { ComposeContentUrl } from '../../../utils/content-href';\nimport type { ChatRef } from '../../chat/chat-ref.types';\nimport { decideNewTab } from '../../chat/utils/decide-new-tab';\nimport type { SearchResult } from '../../ui/search-input';\n\n/** True for `https://…` and protocol-relative `//…`. A composed href that is\n * NOT absolute is an in-app route the host claimed via `hostedTypes` /\n * `overrides`. */\nfunction isAbsoluteHref(href: string): boolean {\n return /^(?:[a-z][a-z0-9+.-]*:)?\\/\\//i.test(href);\n}\n\nexport type SearchResultAction =\n | { kind: 'navigate-same-tab'; href: string }\n | { kind: 'navigate-new-tab'; href: string }\n | { kind: 'ask-ai'; detail: { source: string; ref: ChatRef } }\n | { kind: 'route'; path: string }\n | { kind: 'noop' };\n\nexport function resolveSearchResultAction(\n result: SearchResult,\n source: string,\n runtimeMode?: 'host' | 'embed',\n /** The host's unified content-href seam (`runtime.composeContentUrl`).\n * When wired, an entity row's RAG `externalUrl` is re-resolved through it,\n * so a type the host serves in-app (`hostedTypes`) or deep-links itself\n * (`overrides`) lands on the SAME href the catalog cards and chat cards\n * use. Omitted → the legacy verbatim-`externalUrl` behavior. */\n composeContentUrl?: ComposeContentUrl,\n): SearchResultAction {\n const meta = result.metadata ?? {};\n const externalUrl = meta.externalUrl as string | undefined;\n const rowId = meta.id as string | undefined;\n const sourceRepo = meta.sourceRepo as string | undefined;\n const documentType = meta.documentType as string | undefined;\n if (externalUrl) {\n const targetPlatform = meta.targetPlatform as string | null | undefined;\n // Unified content-href seam — the same call `resolveSourceRowCTA` makes\n // for chat rows. Hosted types relativize the slug out of `externalUrl`;\n // everything else comes back verbatim, so an unwired host (or a row with\n // no `documentType`) keeps today's behavior byte-for-byte.\n const composed =\n composeContentUrl && documentType\n ? composeContentUrl({\n type: documentType,\n identifier: rowId ?? '',\n externalUrl,\n targetPlatform: targetPlatform ?? null,\n })\n : null;\n const href = composed?.href || externalUrl;\n // A RELATIVE composed href means the host claimed this row as in-app.\n // Short-circuit BEFORE `decideNewTab`: in embed mode that helper forces\n // new-tab unconditionally, which would fire `window.open()` on a path\n // that only resolves inside this app.\n if (composed && !isAbsoluteHref(href)) {\n return { kind: 'navigate-same-tab', href };\n }\n // Same pure helper `useNavLink` and `useUnifiedNav` call — single\n // decision rule across cards, chips, and autocomplete rows. Thread\n // the caller's `source` as `currentSource` so the platform-vs-\n // platform comparison matches the hub's pre-migration behavior.\n const isNewTab = decideNewTab({\n href,\n targetPlatform: composed ? composed.targetPlatform : targetPlatform,\n surface: 'useUnifiedNav',\n runtimeMode,\n currentSource: source,\n });\n return isNewTab ? { kind: 'navigate-new-tab', href } : { kind: 'navigate-same-tab', href };\n }\n if (rowId && sourceRepo && documentType) {\n return {\n kind: 'ask-ai',\n detail: {\n source,\n ref: { type: documentType, id: rowId, title: result.title, url: null },\n },\n };\n }\n if (result.path) {\n return { kind: 'route', path: result.path };\n }\n return { kind: 'noop' };\n}\n","'use client';\n\n/**\n * `useDocSearch` — debounced RAG-search hook against `/api/docs/search`.\n *\n * Pure fetch + navigation glue. Embedders can mount this directly\n * (any host with a reverse-proxy that exposes `/api/docs/search` will\n * work). Hub callers wire it into the lib `<DocSearchBar>` for the\n * canonical typeahead dropdown.\n *\n * ## What moved from hub to lib\n *\n * Lifted from `multi-platform-hub/hooks/use-docs.ts:useDocSearch`. Two\n * hub-only concerns are now optional injection points instead of\n * direct imports:\n *\n * - `useDocNavigation()` (hub's in-page doc-tree swap) → optional\n * `onInPageSwap?: (path: string) => boolean` config callback. When\n * present and returns true, the hook treats a same-origin result\n * click as \"handled in-page\"; when absent or returns false, the\n * hook falls back to `onNavigate(path)` (`router.push` on hub,\n * `window.location.assign` on bare embedders).\n * - `traceCompose` (hub-only telemetry) → dropped. The lib has no\n * equivalent runtime-context yet; bring it back when there is one.\n *\n * Everything else (debounce, `useChatRuntime` for embed-mode short-\n * circuit, embed-shim router, the action-resolver + result-mapper) is\n * now lib-resident.\n *\n * ## Result hrefs go through the content-href seam\n *\n * A row's href is NOT the RAG `externalUrl` verbatim any more: when the\n * host wires `runtime.composeContentUrl` (or passes `composeContentUrl`\n * here), the row is re-resolved through it — the SAME seam the catalog\n * cards and the chat entity cards use. So a host that serves onboarding\n * guides at `/help-center/onboarding-guides/<slug>` gets that path from\n * the dropdown too, instead of bouncing the user to the canonical hub\n * URL. Unwired hosts keep the verbatim-`externalUrl` behavior.\n */\n\nimport { useState, useEffect, useCallback } from 'react';\nimport { useChatRuntime } from '../../../contexts/chat-runtime-context';\nimport { useRouter } from '../../../embed-shims';\nimport { useDebounce } from '../../../hooks/ui/use-debounce';\nimport type { ComposeContentUrl } from '../../../utils/content-href';\nimport { contentFetch } from '../../../utils/embed-content-fetch';\nimport {\n resolveExternalNavigation,\n stripSameOriginToPath,\n NEW_TAB_FEATURES,\n} from '../../chat/utils/chat-nav-resolution';\nimport type { SearchResult } from '../../ui/search-input';\nimport { mapDocSearchResults } from './map-doc-search-results';\nimport { resolveSearchResultAction } from './resolve-search-result-action';\nimport type { DocSearchResult } from './types';\n\nexport interface UseDocSearchConfig {\n /** Discriminator passed to `/api/docs/search?source=` (e.g.\n * `'openframe'`). Embedders set it to whatever discriminator their\n * reverse-proxy expects. */\n source: string;\n /** Base route prefix this search lives under (e.g. `'/onboarding-guides'`).\n * When a result's href starts with `${baseRoute}/`, the hook\n * attempts the optional in-page swap path before falling through\n * to a full nav. */\n baseRoute: string;\n /** Imperative navigation fallback. Called when no override\n * (in-page swap, new-tab) applies. Hub callers pass\n * `(path) => router.push(path)`; embedders pass an equivalent. */\n onNavigate: (path: string) => void;\n /** Optional `RagTableConfig.id` list to narrow the search to specific\n * tables (e.g. `['onboarding-guides']`). Forwarded to\n * `/api/docs/search?tableIds=…` which intersects with the source's\n * standing set. */\n tableIds?: string[];\n /** Optional in-page swap callback. When the result's href is under\n * `baseRoute` AND this callback returns true, the hook treats the\n * click as handled in-page (no router push). Hub's\n * `<DocumentationSection>` wires this to\n * `useDocNavigation().navigate(path)`. */\n onInPageSwap?: (path: string) => boolean;\n /** Optional endpoint override. Defaults to `'/api/docs/search'`\n * (the hub's reverse-proxy route). Embedders with a different\n * path can override. */\n searchEndpoint?: string;\n /** Optional content-href seam override. Same fall-back chain as\n * `searchEndpoint`: prop → `runtime.composeContentUrl` → none. Wired,\n * it makes a result row honor the host's `hostedTypes` / `overrides`\n * instead of navigating to the RAG's canonical hub URL — so a row\n * lands where the catalog card for the same entity lands. */\n composeContentUrl?: ComposeContentUrl;\n}\n\n/** One shared empty array, so \"no matches\" keeps a stable identity. */\nconst NO_RESULTS: SearchResult[] = [];\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null;\n}\n\n/** `Array.isArray` narrows `unknown` to `any[]`; this keeps the elements `unknown`. */\nfunction isUnknownArray(value: unknown): value is readonly unknown[] {\n return Array.isArray(value);\n}\n\nfunction readString(source: Record<string, unknown>, key: string): string | undefined {\n const value = source[key];\n return typeof value === 'string' ? value : undefined;\n}\n\n/**\n * Decode `/api/docs/search`'s `{ success, data }` envelope.\n *\n * `Response.json()` is typed `any`, so the rows used to reach\n * `mapDocSearchResults` through an `as DocSearchResult[]` that asserted a\n * shape nothing had checked. `path` and `name` are the two that bite: the\n * mapper uses `path` as the row's React `id` and `name` as its title, so a row\n * missing either renders as a blank, key-colliding entry in the dropdown.\n * Such rows are dropped; the rest of the result set still lists.\n *\n * Returns null when the envelope itself is not a successful result set.\n */\nfunction toDocSearchResults(payload: unknown): DocSearchResult[] | null {\n if (!isRecord(payload) || !payload.success || !isUnknownArray(payload.data)) return null;\n\n const rows: DocSearchResult[] = [];\n for (const entry of payload.data) {\n if (!isRecord(entry)) continue;\n const path = readString(entry, 'path');\n const name = readString(entry, 'name');\n const type = entry.type;\n if (path === undefined || name === undefined) continue;\n\n const targetPlatform = entry.targetPlatform;\n rows.push({\n path,\n name,\n type: type === 'folder' ? 'folder' : 'file',\n snippet: readString(entry, 'snippet') ?? '',\n matchType: entry.matchType === 'title' ? 'title' : 'content',\n documentType: readString(entry, 'documentType'),\n externalUrl: readString(entry, 'externalUrl'),\n targetPlatform: typeof targetPlatform === 'string' ? targetPlatform : null,\n sourceRepo: readString(entry, 'sourceRepo'),\n entityId: readString(entry, 'entityId'),\n });\n }\n return rows;\n}\n\nexport function useDocSearch(config: UseDocSearchConfig) {\n const { source, baseRoute, onNavigate, tableIds, onInPageSwap, searchEndpoint, composeContentUrl } = config;\n const tableIdsKey = tableIds && tableIds.length > 0 ? tableIds.join(',') : '';\n\n const router = useRouter();\n // Optional chat-runtime read — when present and mode='embed' the\n // search-result row click short-circuits to a new-tab open against\n // the absolutized URL. Null/host preserves today's behavior.\n // Also used as the proxy-prefix fallback for `searchEndpoint`, matching\n // how tickets resolves `findTicketUrl`.\n const runtime = useChatRuntime();\n const resolvedSearchEndpoint = searchEndpoint ?? runtime?.endpoints.docsSearchUrl ?? '/api/docs/search';\n // Content-href seam, same prop → runtime → none chain. Threading it into\n // `resolveSearchResultAction` is what makes the dropdown obey the host's\n // route map; without it the row navigates to the RAG's canonical hub URL\n // even when the host serves that content in-app under a different path.\n const resolvedComposeContentUrl = composeContentUrl ?? runtime?.composeContentUrl;\n\n const [query, setQuery] = useState('');\n const [results, setResults] = useState<SearchResult[]>(NO_RESULTS);\n const [isFetching, setIsFetching] = useState(false);\n const debouncedQuery = useDebounce(query, 300);\n\n // Falling below the two-character floor empties the dropdown. Adjusted while\n // rendering (React's documented pattern for a reset the render already has\n // the answer to) rather than from an effect, which committed one more frame\n // of the previous matches under a query that no longer searches for them.\n const searchable = debouncedQuery.trim().length >= 2;\n const [wasSearchable, setWasSearchable] = useState(searchable);\n if (wasSearchable !== searchable) {\n setWasSearchable(searchable);\n if (!searchable) {\n setResults(NO_RESULTS);\n setIsFetching(false);\n }\n }\n\n useEffect(() => {\n if (!searchable) return undefined;\n\n let cancelled = false;\n\n async function fetchResults() {\n setIsFetching(true);\n try {\n const params = new URLSearchParams({\n q: debouncedQuery,\n source,\n limit: '10',\n });\n if (tableIdsKey) params.set('tableIds', tableIdsKey);\n\n const response = await contentFetch(`${resolvedSearchEndpoint}?${params.toString()}`);\n if (!response.ok) {\n throw new Error(`Search request failed: ${response.status}`);\n }\n\n const json: unknown = await response.json();\n\n if (!cancelled) {\n // An envelope that is not a successful result set now clears the\n // dropdown instead of leaving it untouched. Previously a 200 that\n // carried `success: false` (or a non-array `data`) fell through\n // every branch, so the PREVIOUS query's matches stayed on screen\n // under the new query — the throw path already reset them.\n const rows = toDocSearchResults(json);\n setResults(rows ? mapDocSearchResults(rows) : NO_RESULTS);\n }\n } catch (error) {\n console.error('Doc search error:', error);\n if (!cancelled) {\n setResults(NO_RESULTS);\n }\n } finally {\n if (!cancelled) {\n setIsFetching(false);\n }\n }\n }\n\n // Never rejects — try/catch/finally, every write gated on `cancelled`.\n void fetchResults();\n\n return () => {\n cancelled = true;\n };\n }, [debouncedQuery, searchable, source, tableIdsKey, resolvedSearchEndpoint]);\n\n // Derived loading state — single source of truth for \"should the\n // dropdown show 'Loading...' instead of 'No results found'\":\n const isLoading = query.trim().length >= 2 && (query !== debouncedQuery || isFetching);\n\n // Track whether dropdown should stay open (external link opened in new tab).\n const [keepOpen, setKeepOpen] = useState(false);\n\n const handleResultSelect = useCallback(\n (\n result: SearchResult,\n modifiers?: {\n metaKey?: boolean;\n ctrlKey?: boolean;\n shiftKey?: boolean;\n altKey?: boolean;\n button?: number;\n },\n ) => {\n const action = resolveSearchResultAction(result, source, runtime?.navigation.mode, resolvedComposeContentUrl);\n // Modifier / non-primary mouse click → force new tab regardless of\n // same-tab/new-tab decision. The dropdown row is a `<div>`, not an\n // `<a target=\"_blank\">`, so the browser doesn't background-tab\n // natively on cmd-click. Honor it explicitly here for parity with\n // the anchor-based surfaces (cards, chips, related-content). Plain\n // Enter from the keyboard passes `modifiers === undefined`.\n const wantsNewTab =\n modifiers &&\n (modifiers.metaKey ||\n modifiers.ctrlKey ||\n modifiers.shiftKey ||\n modifiers.altKey ||\n (typeof modifiers.button === 'number' && modifiers.button !== 0));\n switch (action.kind) {\n case 'navigate-same-tab': {\n if (wantsNewTab) {\n setKeepOpen(true);\n window.open(action.href, '_blank', NEW_TAB_FEATURES);\n return;\n }\n // Same-origin click:\n // 1. If the href is under the current doc-tree's baseRoute AND\n // an `onInPageSwap` callback is wired AND returns true →\n // consider in-page swap handled.\n // 2. Otherwise → embed-shim `router.push()` (soft RSC nav on\n // Next.js hosts, window.location.assign on bare hosts).\n setKeepOpen(false);\n const path =\n baseRoute && action.href.startsWith(`${baseRoute}/`) ? action.href.slice(baseRoute.length + 1) : null;\n if (path && onInPageSwap?.(path)) return;\n router.push(stripSameOriginToPath(action.href));\n return;\n }\n case 'navigate-new-tab':\n // Cross-origin (e.g. clicking a flamingo.run release from\n // product-hub) — open in a new tab. Keep dropdown open so the\n // user can pick another result without re-searching.\n setKeepOpen(true);\n // Embed-mode short-circuit — the row was clicked while the panel is\n // hosted inside an embedding app, so absolutize against the\n // embedder-supplied content origin and honor its `openExternal`\n // override. Not the only path an embed host takes: a composed\n // RELATIVE href resolves to `navigate-same-tab` above and never\n // reaches `decideNewTab`, which is what lets an embedder keep its\n // own in-app routes in-app.\n if (runtime?.navigation.mode === 'embed') {\n const targetPlatform = (result.metadata?.targetPlatform as string | null | undefined) ?? null;\n resolveExternalNavigation({\n href: action.href,\n targetPlatform,\n runtime,\n }).open();\n return;\n }\n window.open(action.href, '_blank', NEW_TAB_FEATURES);\n return;\n case 'ask-ai':\n // Row is searchable-but-not-openable (cap_table positions,\n // financial-kpi snapshots, anything backed by\n // `resolveUrl: () => null`). Dispatch a CustomEvent that\n // GlobalAskAI listens for — opens chat + drills via\n // `entityIdFilter` (primary-key only, same as inline-card Ask).\n setKeepOpen(false);\n window.dispatchEvent(new CustomEvent('ask-ai:open-with-ref', { detail: action.detail }));\n return;\n case 'route':\n // Final fallback: legacy navigation by path. Hits when a row\n // has neither URL nor pk metadata — a mapper/API regression.\n setKeepOpen(false);\n onNavigate(action.path);\n return;\n case 'noop':\n return;\n }\n },\n [onNavigate, source, baseRoute, router, onInPageSwap, runtime, resolvedComposeContentUrl],\n );\n\n // Reset keepOpen when query changes. Adjusted while rendering, not from an\n // effect: the dropdown's open state is read from this in the same render the\n // keystroke produced, so an effect held it pinned open for one extra frame.\n const [keepOpenForQuery, setKeepOpenForQuery] = useState(query);\n if (keepOpenForQuery !== query) {\n setKeepOpenForQuery(query);\n setKeepOpen(false);\n }\n\n return {\n query,\n setQuery,\n results,\n isLoading,\n handleResultSelect,\n keepDropdownOpen: keepOpen,\n };\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-4WYMOK5O.cjs","../src/components/shared/doc-search/format-relative-path.ts","../src/components/shared/doc-search/doc-search-result-row.tsx","../src/components/shared/doc-search/doc-search-bar.tsx","../src/components/shared/doc-search/map-doc-search-results.ts","../src/components/shared/doc-search/resolve-search-result-action.ts","../src/components/shared/doc-search/use-doc-search.ts"],"names":["jsx"],"mappings":"AAAA,6rBAAY;AACZ;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACpBO,SAAS,kBAAA,CAAmB,QAAA,EAA0B;AAC3D,EAAA,GAAA,CAAI,CAAC,QAAA,EAAU,OAAO,EAAA;AACtB,EAAA,MAAM,SAAA,EAAW,QAAA,CAAS,OAAA,CAAQ,OAAA,EAAS,EAAE,CAAA,CAAE,KAAA,CAAM,GAAG,CAAA;AAExD,EAAA,MAAM,eAAA,EAAiB,QAAA,CAAS,OAAA,EAAS,EAAA,EAAI,QAAA,CAAS,KAAA,CAAM,CAAA,EAAG,CAAA,CAAE,EAAA,EAAI,QAAA;AACrE,EAAA,OAAO,cAAA,CAAe,GAAA,CAAI,CAAA,GAAA,EAAA,GAAO,GAAA,CAAI,MAAA,CAAO,CAAC,CAAA,CAAE,WAAA,CAAY,EAAA,EAAI,GAAA,CAAI,KAAA,CAAM,CAAC,CAAA,CAAE,OAAA,CAAQ,IAAA,EAAM,GAAG,CAAC,CAAA,CAAE,IAAA,CAAK,KAAK,CAAA;AAC5G;ADqBA;AACA;AEYQ,+CAAA;AAZD,SAAS,kBAAA,CAAmB,EAAE,MAAA,EAAQ,cAAc,CAAA,EAA4B;AACrF,EAAA,MAAM,QAAA,kBAAW,MAAA,mBAAO,QAAA,6BAAU,eAAA,GAA2B,KAAA,CAAA;AAC7D,EAAA,MAAM,WAAA,kBAAc,MAAA,qBAAO,QAAA,6BAAU,aAAA,GAAyB,KAAA,CAAA;AAC9D,EAAA,MAAM,EAAE,IAAA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AAA;AACiD,YAAA;AAC/D,YAAA;AACX,cAAA;AACb,cAAA;AACA,cAAA;AACM,YAAA;AACR,YAAA;AACF,UAAA;AACmD,UAAA;AACnD,UAAA;AACG,QAAA;AAMc,UAAA;AACsE,UAAA;AACvF,UAAA;AACG,QAAA;AAGc,UAAA;AACK,UAAA;AACtB,UAAA;AACG,QAAA;AACH,UAAA;AACJ,MAAA;AACF,IAAA;AACwF,IAAA;AAC1F,EAAA;AAK8D,EAAA;AAC9B,EAAA;AACL,IAAA;AACR,IAAA;AACnB,EAAA;AAEO,EAAA;AACL,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACkB,IAAA;AACpB,EAAA;AACF;ANW8H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-4WYMOK5O.cjs","sourcesContent":[null,"/**\n * Format a full document path as a breadcrumb trail.\n * Shows parent folders only (excludes the last segment / filename).\n *\n * @example\n * formatRelativePath('openframe-oss-tenant/architecture/api-controllers.md')\n * // → 'Openframe oss tenant / Architecture'\n */\nexport function formatRelativePath(fullPath: string): string {\n if (!fullPath) return '';\n const segments = fullPath.replace(/\\.md$/, '').split('/');\n // Show only parent path (exclude the filename itself since the title already shows it)\n const parentSegments = segments.length > 1 ? segments.slice(0, -1) : segments;\n return parentSegments.map(seg => seg.charAt(0).toUpperCase() + seg.slice(1).replace(/-/g, ' ')).join(' / ');\n}\n","'use client';\n\n/**\n * Single row in the `<SearchInput>` dropdown — the standard layout\n * used by every doc-search-backed surface (company-hub data-room\n * search bar, onboarding-guide catalog search, …). Single source of\n * truth for the row appearance so search dropdowns are visually\n * identical everywhere.\n *\n * Resolves the source icon via the same `resolveSourceIcon()`\n * registry the inline chat-card refs use, so a row pointing at e.g.\n * an onboarding-guide surfaces the SAME `<GraduationCap>` glyph the\n * chat card surfaces — no cross-surface drift.\n */\n\nimport { resolveSourceIcon } from '../../chat/utils/source-row-cta';\nimport { formatRelativePath } from './format-relative-path';\n\n/**\n * Minimal result shape this row renders. Compatible with any\n * doc-search hook whose result type exposes `{ title?, path?,\n * metadata? }`. The two hub consumers (onboarding-guide catalog,\n * data-room sidebar) both satisfy this shape via their\n * `useDocSearch` hook result.\n */\nexport interface DocSearchResultRowEntry {\n title?: string;\n path?: string;\n metadata?: Record<string, unknown>;\n}\n\nexport interface DocSearchResultRowProps {\n result: DocSearchResultRowEntry;\n isHighlighted: boolean;\n}\n\nexport function DocSearchResultRow({ result, isHighlighted }: DocSearchResultRowProps) {\n const docType = (result.metadata?.documentType as string) || undefined;\n const sourceRepo = (result.metadata?.sourceRepo as string) || undefined;\n const { Icon: SourceIcon, label: iconLabel } = resolveSourceIcon({\n sourceRepo,\n documentType: docType,\n });\n const isGroup = result.metadata?.isGroup as boolean | undefined;\n\n return (\n <div className=\"flex w-full min-w-0 items-center gap-3\">\n <span className=\"flex-shrink-0 text-ods-text-secondary\" title={iconLabel}>\n <SourceIcon className=\"size-4\" />\n </span>\n <div className=\"min-w-0 flex-1\">\n <div className={`truncate text-h6 ${isHighlighted ? 'text-ods-accent' : 'text-ods-text-primary'}`}>\n {result.title || result.path}\n </div>\n {!isGroup && result.path?.includes('/') && (\n <div className=\"mt-0.5 truncate text-ods-text-secondary text-h6\">{formatRelativePath(result.path)}</div>\n )}\n </div>\n </div>\n );\n}\n","'use client';\n\n/**\n * `<DocSearchBar>` — the canonical RAG-search dropdown surface.\n *\n * Mounted by every doc-search consumer (data-room sidebar, onboarding-\n * guide catalog, and any future surface that needs typeahead against\n * `/api/docs/search`). Wraps `<SearchInput>` with the lib's standard\n * `<DocSearchResultRow>` so the dropdown looks identical everywhere.\n *\n * ## Why a presentation component, not a \"search bar that owns its\n * own hook\"\n *\n * The data-fetching hook (`useDocSearch`) lives hub-side because it\n * depends on hub-only context (`useDocNavigation`, the rag-table-\n * config registry, the hub's `decideNewTab` helper). Moving the hook\n * would cascade ~5 more file migrations into the lib.\n *\n * Instead, the hook stays hub-side and callers pass its result into\n * this component as plain props. Both consumers shrink to ~5 lines.\n */\n\nimport type { ReactNode } from 'react';\nimport { SearchInput, type SearchResult } from '../../ui/search-input';\nimport { DocSearchResultRow } from './doc-search-result-row';\n\nexport interface DocSearchBarProps {\n placeholder: string;\n query: string;\n onQueryChange: (value: string) => void;\n /** Hook-fetched results. Reuses the lib's `<SearchInput>` `SearchResult`\n * shape directly so callers don't translate. */\n results: SearchResult[];\n isLoading: boolean;\n /** Result selection handler. Mirrors `<SearchInput>` — the second\n * `modifiers` argument is preserved so cmd-click / shift-click on\n * a result row still forces new-tab behavior. Hub `useDocSearch`\n * reads these to short-circuit to `window.open()`. */\n onResultSelect: (\n result: SearchResult,\n modifiers?: {\n metaKey?: boolean;\n ctrlKey?: boolean;\n shiftKey?: boolean;\n altKey?: boolean;\n button?: number;\n },\n ) => void;\n /** Lets the caller's hook force the dropdown open after a recent\n * internal action (e.g. result navigation). `undefined` falls back\n * to `<SearchInput>`'s built-in focus/hover heuristics. */\n showDropdown?: boolean;\n /** Defaults to 2 — matches the existing data-room and onboarding-\n * guide consumers. Override only if a surface needs different\n * typeahead semantics. */\n minQueryLength?: number;\n /** Defaults to 0 — both existing consumers debounce inside the\n * hook, not the input. */\n debounceMs?: number;\n className?: string;\n /** Optional row-renderer override. Defaults to the lib's standard\n * `<DocSearchResultRow>` (source icon + title + path breadcrumb).\n * Override only when a surface needs custom row chrome. */\n renderResult?: (result: SearchResult, isHighlighted: boolean) => ReactNode;\n}\n\nexport function DocSearchBar({\n placeholder,\n query,\n onQueryChange,\n results,\n isLoading,\n onResultSelect,\n showDropdown,\n minQueryLength = 2,\n debounceMs = 0,\n className = 'w-full',\n renderResult,\n}: DocSearchBarProps) {\n return (\n <SearchInput\n placeholder={placeholder}\n value={query}\n onChange={onQueryChange}\n results={results}\n isLoading={isLoading}\n onResultSelect={onResultSelect}\n showDropdown={showDropdown || undefined}\n debounceMs={debounceMs}\n minQueryLength={minQueryLength}\n className={className}\n renderResult={\n renderResult ??\n ((result, isHighlighted) => <DocSearchResultRow result={result} isHighlighted={isHighlighted} />)\n }\n />\n );\n}\n","/**\n * Map RAG `/api/docs/search` wire results into the `<DocSearchBar>`\n * dropdown's row shape, collapsing entity-table rows into grouped\n * results so the dropdown lists ONE \"Cap Table (12 records)\" row\n * instead of 12 individual rows.\n *\n * Pure transform — no telemetry, no navigation, no React deps. Lifted\n * from the hub's `hooks/use-docs.ts:mapDocSearchResults` (the hub's\n * `traceCompose` call was hub-only telemetry and is intentionally\n * dropped — callers that want logging can wrap this helper).\n */\n\nimport { recordCountLabel } from '../../../utils/source-grouping';\nimport { getSourceLabel } from '../../../utils/source-icons';\nimport type { SearchResult } from '../../ui/search-input';\nimport type { DocSearchResult } from './types';\n\n/** Source repos that should be collapsed into grouped results in the search bar.\n * A SEARCH rule, deliberately narrower than the chat strip's `groupsByTable`:\n * a search result is a destination, so only rows that share one are folded.\n * Only financial tables (all rows link to the same admin page).\n * Content tables (blog, webinar, podcast, etc.) stay individual since each has a unique URL. */\nconst SEARCH_GROUP_REPOS = new Set([\n 'financial-cap-table',\n 'financial-kpis',\n 'financial-pnl',\n 'financial-balance-sheet',\n 'financial-cash-flow',\n]);\n\nexport function mapDocSearchResults(docs: DocSearchResult[]): SearchResult[] {\n const entityGroups = new Map<string, DocSearchResult[]>();\n // Track insertion order — groups appear where the FIRST row of that\n // repo appeared in the response.\n const order: Array<{ type: 'entity'; repo: string } | { type: 'doc'; doc: DocSearchResult }> = [];\n const seenRepos = new Set<string>();\n\n for (const doc of docs) {\n if (doc.sourceRepo && SEARCH_GROUP_REPOS.has(doc.sourceRepo)) {\n const group = entityGroups.get(doc.sourceRepo) || [];\n group.push(doc);\n entityGroups.set(doc.sourceRepo, group);\n if (!seenRepos.has(doc.sourceRepo)) {\n seenRepos.add(doc.sourceRepo);\n order.push({ type: 'entity', repo: doc.sourceRepo });\n }\n } else {\n order.push({ type: 'doc', doc });\n }\n }\n\n const results: SearchResult[] = [];\n for (const entry of order) {\n if (entry.type === 'entity') {\n // An 'entity' entry is only pushed AFTER its group lands in the map, so\n // a miss is unreachable — but dropping one group beats throwing away the\n // whole search dropdown if that ever stops holding.\n const rows = entityGroups.get(entry.repo);\n if (!rows || rows.length === 0) continue;\n results.push({\n id: `group-${entry.repo}`,\n // Same table label and count as the chat's grouped chip: one owner each.\n title: `${getSourceLabel(entry.repo)} ${recordCountLabel(rows.length)}`,\n path: rows[0].path,\n type: 'file',\n metadata: {\n documentType: rows[0].documentType,\n externalUrl: rows[0].externalUrl,\n sourceRepo: entry.repo,\n id: rows[0].entityId,\n isGroup: true,\n items: rows.map(r => ({\n name: r.name,\n externalUrl: r.externalUrl,\n id: r.entityId,\n sourceRepo: r.sourceRepo,\n documentType: r.documentType,\n })),\n },\n });\n } else {\n const doc = entry.doc;\n const isNonMarkdown = doc.documentType && doc.documentType !== 'markdown';\n results.push({\n id: doc.path,\n title: doc.name,\n description: isNonMarkdown ? doc.name : doc.snippet,\n path: doc.path,\n type: doc.type,\n metadata: {\n matchType: doc.matchType,\n ...(doc.documentType ? { documentType: doc.documentType } : {}),\n ...(doc.externalUrl ? { externalUrl: doc.externalUrl } : {}),\n ...(doc.targetPlatform != null ? { targetPlatform: doc.targetPlatform } : {}),\n ...(doc.sourceRepo ? { sourceRepo: doc.sourceRepo } : {}),\n ...(doc.entityId ? { id: doc.entityId } : {}),\n },\n });\n }\n }\n\n return results;\n}\n","/**\n * Resolve what should happen when the user picks a search result.\n * Returns one of five typed actions so the caller is a single switch.\n *\n * Resolution order:\n * 1. `externalUrl` present → resolve the href through the host's\n * `composeContentUrl` seam (when wired), then use `decideNewTab` to\n * choose same-tab vs new-tab against the resolved `targetPlatform`.\n * 2. Row has `id` + `sourceRepo` + `documentType` → synth an Ask-AI\n * action (entity drill-in via primary key, no URL).\n * 3. Row has only `path` → legacy navigation fallback.\n * 4. Nothing actionable → noop.\n *\n * Lifted from the hub's `hooks/use-docs.ts:resolveSearchResultAction`.\n * Pure — no React, no telemetry.\n */\n\nimport type { ComposeContentUrl } from '../../../utils/content-href';\nimport type { ChatRef } from '../../chat/chat-ref.types';\nimport { decideNewTab } from '../../chat/utils/decide-new-tab';\nimport type { SearchResult } from '../../ui/search-input';\n\n/** True for `https://…` and protocol-relative `//…`. A composed href that is\n * NOT absolute is an in-app route the host claimed via `hostedTypes` /\n * `overrides`. */\nfunction isAbsoluteHref(href: string): boolean {\n return /^(?:[a-z][a-z0-9+.-]*:)?\\/\\//i.test(href);\n}\n\nexport type SearchResultAction =\n | { kind: 'navigate-same-tab'; href: string }\n | { kind: 'navigate-new-tab'; href: string }\n | { kind: 'ask-ai'; detail: { source: string; ref: ChatRef } }\n | { kind: 'route'; path: string }\n | { kind: 'noop' };\n\nexport function resolveSearchResultAction(\n result: SearchResult,\n source: string,\n runtimeMode?: 'host' | 'embed',\n /** The host's unified content-href seam (`runtime.composeContentUrl`).\n * When wired, an entity row's RAG `externalUrl` is re-resolved through it,\n * so a type the host serves in-app (`hostedTypes`) or deep-links itself\n * (`overrides`) lands on the SAME href the catalog cards and chat cards\n * use. Omitted → the legacy verbatim-`externalUrl` behavior. */\n composeContentUrl?: ComposeContentUrl,\n): SearchResultAction {\n const meta = result.metadata ?? {};\n const externalUrl = meta.externalUrl as string | undefined;\n const rowId = meta.id as string | undefined;\n const sourceRepo = meta.sourceRepo as string | undefined;\n const documentType = meta.documentType as string | undefined;\n if (externalUrl) {\n const targetPlatform = meta.targetPlatform as string | null | undefined;\n // Unified content-href seam — the same call `resolveSourceRowCTA` makes\n // for chat rows. Hosted types relativize the slug out of `externalUrl`;\n // everything else comes back verbatim, so an unwired host (or a row with\n // no `documentType`) keeps today's behavior byte-for-byte.\n const composed =\n composeContentUrl && documentType\n ? composeContentUrl({\n type: documentType,\n identifier: rowId ?? '',\n externalUrl,\n targetPlatform: targetPlatform ?? null,\n })\n : null;\n const href = composed?.href || externalUrl;\n // A RELATIVE composed href means the host claimed this row as in-app.\n // Short-circuit BEFORE `decideNewTab`: in embed mode that helper forces\n // new-tab unconditionally, which would fire `window.open()` on a path\n // that only resolves inside this app.\n if (composed && !isAbsoluteHref(href)) {\n return { kind: 'navigate-same-tab', href };\n }\n // Same pure helper `useNavLink` and `useUnifiedNav` call — single\n // decision rule across cards, chips, and autocomplete rows. Thread\n // the caller's `source` as `currentSource` so the platform-vs-\n // platform comparison matches the hub's pre-migration behavior.\n const isNewTab = decideNewTab({\n href,\n targetPlatform: composed ? composed.targetPlatform : targetPlatform,\n surface: 'useUnifiedNav',\n runtimeMode,\n currentSource: source,\n });\n return isNewTab ? { kind: 'navigate-new-tab', href } : { kind: 'navigate-same-tab', href };\n }\n if (rowId && sourceRepo && documentType) {\n return {\n kind: 'ask-ai',\n detail: {\n source,\n ref: { type: documentType, id: rowId, title: result.title, url: null },\n },\n };\n }\n if (result.path) {\n return { kind: 'route', path: result.path };\n }\n return { kind: 'noop' };\n}\n","'use client';\n\n/**\n * `useDocSearch` — debounced RAG-search hook against `/api/docs/search`.\n *\n * Pure fetch + navigation glue. Embedders can mount this directly\n * (any host with a reverse-proxy that exposes `/api/docs/search` will\n * work). Hub callers wire it into the lib `<DocSearchBar>` for the\n * canonical typeahead dropdown.\n *\n * ## What moved from hub to lib\n *\n * Lifted from `multi-platform-hub/hooks/use-docs.ts:useDocSearch`. Two\n * hub-only concerns are now optional injection points instead of\n * direct imports:\n *\n * - `useDocNavigation()` (hub's in-page doc-tree swap) → optional\n * `onInPageSwap?: (path: string) => boolean` config callback. When\n * present and returns true, the hook treats a same-origin result\n * click as \"handled in-page\"; when absent or returns false, the\n * hook falls back to `onNavigate(path)` (`router.push` on hub,\n * `window.location.assign` on bare embedders).\n * - `traceCompose` (hub-only telemetry) → dropped. The lib has no\n * equivalent runtime-context yet; bring it back when there is one.\n *\n * Everything else (debounce, `useChatRuntime` for embed-mode short-\n * circuit, embed-shim router, the action-resolver + result-mapper) is\n * now lib-resident.\n *\n * ## Result hrefs go through the content-href seam\n *\n * A row's href is NOT the RAG `externalUrl` verbatim any more: when the\n * host wires `runtime.composeContentUrl` (or passes `composeContentUrl`\n * here), the row is re-resolved through it — the SAME seam the catalog\n * cards and the chat entity cards use. So a host that serves onboarding\n * guides at `/help-center/onboarding-guides/<slug>` gets that path from\n * the dropdown too, instead of bouncing the user to the canonical hub\n * URL. Unwired hosts keep the verbatim-`externalUrl` behavior.\n */\n\nimport { useState, useEffect, useCallback } from 'react';\nimport { useChatRuntime } from '../../../contexts/chat-runtime-context';\nimport { useRouter } from '../../../embed-shims';\nimport { useDebounce } from '../../../hooks/ui/use-debounce';\nimport type { ComposeContentUrl } from '../../../utils/content-href';\nimport { contentFetch } from '../../../utils/embed-content-fetch';\nimport {\n resolveExternalNavigation,\n stripSameOriginToPath,\n NEW_TAB_FEATURES,\n} from '../../chat/utils/chat-nav-resolution';\nimport type { SearchResult } from '../../ui/search-input';\nimport { mapDocSearchResults } from './map-doc-search-results';\nimport { resolveSearchResultAction } from './resolve-search-result-action';\nimport type { DocSearchResult } from './types';\n\nexport interface UseDocSearchConfig {\n /** Discriminator passed to `/api/docs/search?source=` (e.g.\n * `'openframe'`). Embedders set it to whatever discriminator their\n * reverse-proxy expects. */\n source: string;\n /** Base route prefix this search lives under (e.g. `'/onboarding-guides'`).\n * When a result's href starts with `${baseRoute}/`, the hook\n * attempts the optional in-page swap path before falling through\n * to a full nav. */\n baseRoute: string;\n /** Imperative navigation fallback. Called when no override\n * (in-page swap, new-tab) applies. Hub callers pass\n * `(path) => router.push(path)`; embedders pass an equivalent. */\n onNavigate: (path: string) => void;\n /** Optional `RagTableConfig.id` list to narrow the search to specific\n * tables (e.g. `['onboarding-guides']`). Forwarded to\n * `/api/docs/search?tableIds=…` which intersects with the source's\n * standing set. */\n tableIds?: string[];\n /** Optional in-page swap callback. When the result's href is under\n * `baseRoute` AND this callback returns true, the hook treats the\n * click as handled in-page (no router push). Hub's\n * `<DocumentationSection>` wires this to\n * `useDocNavigation().navigate(path)`. */\n onInPageSwap?: (path: string) => boolean;\n /** Optional endpoint override. Defaults to `'/api/docs/search'`\n * (the hub's reverse-proxy route). Embedders with a different\n * path can override. */\n searchEndpoint?: string;\n /** Optional content-href seam override. Same fall-back chain as\n * `searchEndpoint`: prop → `runtime.composeContentUrl` → none. Wired,\n * it makes a result row honor the host's `hostedTypes` / `overrides`\n * instead of navigating to the RAG's canonical hub URL — so a row\n * lands where the catalog card for the same entity lands. */\n composeContentUrl?: ComposeContentUrl;\n}\n\n/** One shared empty array, so \"no matches\" keeps a stable identity. */\nconst NO_RESULTS: SearchResult[] = [];\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null;\n}\n\n/** `Array.isArray` narrows `unknown` to `any[]`; this keeps the elements `unknown`. */\nfunction isUnknownArray(value: unknown): value is readonly unknown[] {\n return Array.isArray(value);\n}\n\nfunction readString(source: Record<string, unknown>, key: string): string | undefined {\n const value = source[key];\n return typeof value === 'string' ? value : undefined;\n}\n\n/**\n * Decode `/api/docs/search`'s `{ success, data }` envelope.\n *\n * `Response.json()` is typed `any`, so the rows used to reach\n * `mapDocSearchResults` through an `as DocSearchResult[]` that asserted a\n * shape nothing had checked. `path` and `name` are the two that bite: the\n * mapper uses `path` as the row's React `id` and `name` as its title, so a row\n * missing either renders as a blank, key-colliding entry in the dropdown.\n * Such rows are dropped; the rest of the result set still lists.\n *\n * Returns null when the envelope itself is not a successful result set.\n */\nfunction toDocSearchResults(payload: unknown): DocSearchResult[] | null {\n if (!isRecord(payload) || !payload.success || !isUnknownArray(payload.data)) return null;\n\n const rows: DocSearchResult[] = [];\n for (const entry of payload.data) {\n if (!isRecord(entry)) continue;\n const path = readString(entry, 'path');\n const name = readString(entry, 'name');\n const type = entry.type;\n if (path === undefined || name === undefined) continue;\n\n const targetPlatform = entry.targetPlatform;\n rows.push({\n path,\n name,\n type: type === 'folder' ? 'folder' : 'file',\n snippet: readString(entry, 'snippet') ?? '',\n matchType: entry.matchType === 'title' ? 'title' : 'content',\n documentType: readString(entry, 'documentType'),\n externalUrl: readString(entry, 'externalUrl'),\n targetPlatform: typeof targetPlatform === 'string' ? targetPlatform : null,\n sourceRepo: readString(entry, 'sourceRepo'),\n entityId: readString(entry, 'entityId'),\n });\n }\n return rows;\n}\n\nexport function useDocSearch(config: UseDocSearchConfig) {\n const { source, baseRoute, onNavigate, tableIds, onInPageSwap, searchEndpoint, composeContentUrl } = config;\n const tableIdsKey = tableIds && tableIds.length > 0 ? tableIds.join(',') : '';\n\n const router = useRouter();\n // Optional chat-runtime read — when present and mode='embed' the\n // search-result row click short-circuits to a new-tab open against\n // the absolutized URL. Null/host preserves today's behavior.\n // Also used as the proxy-prefix fallback for `searchEndpoint`, matching\n // how tickets resolves `findTicketUrl`.\n const runtime = useChatRuntime();\n const resolvedSearchEndpoint = searchEndpoint ?? runtime?.endpoints.docsSearchUrl ?? '/api/docs/search';\n // Content-href seam, same prop → runtime → none chain. Threading it into\n // `resolveSearchResultAction` is what makes the dropdown obey the host's\n // route map; without it the row navigates to the RAG's canonical hub URL\n // even when the host serves that content in-app under a different path.\n const resolvedComposeContentUrl = composeContentUrl ?? runtime?.composeContentUrl;\n\n const [query, setQuery] = useState('');\n const [results, setResults] = useState<SearchResult[]>(NO_RESULTS);\n const [isFetching, setIsFetching] = useState(false);\n const debouncedQuery = useDebounce(query, 300);\n\n // Falling below the two-character floor empties the dropdown. Adjusted while\n // rendering (React's documented pattern for a reset the render already has\n // the answer to) rather than from an effect, which committed one more frame\n // of the previous matches under a query that no longer searches for them.\n const searchable = debouncedQuery.trim().length >= 2;\n const [wasSearchable, setWasSearchable] = useState(searchable);\n if (wasSearchable !== searchable) {\n setWasSearchable(searchable);\n if (!searchable) {\n setResults(NO_RESULTS);\n setIsFetching(false);\n }\n }\n\n useEffect(() => {\n if (!searchable) return undefined;\n\n let cancelled = false;\n\n async function fetchResults() {\n setIsFetching(true);\n try {\n const params = new URLSearchParams({\n q: debouncedQuery,\n source,\n limit: '10',\n });\n if (tableIdsKey) params.set('tableIds', tableIdsKey);\n\n const response = await contentFetch(`${resolvedSearchEndpoint}?${params.toString()}`);\n if (!response.ok) {\n throw new Error(`Search request failed: ${response.status}`);\n }\n\n const json: unknown = await response.json();\n\n if (!cancelled) {\n // An envelope that is not a successful result set now clears the\n // dropdown instead of leaving it untouched. Previously a 200 that\n // carried `success: false` (or a non-array `data`) fell through\n // every branch, so the PREVIOUS query's matches stayed on screen\n // under the new query — the throw path already reset them.\n const rows = toDocSearchResults(json);\n setResults(rows ? mapDocSearchResults(rows) : NO_RESULTS);\n }\n } catch (error) {\n console.error('Doc search error:', error);\n if (!cancelled) {\n setResults(NO_RESULTS);\n }\n } finally {\n if (!cancelled) {\n setIsFetching(false);\n }\n }\n }\n\n // Never rejects — try/catch/finally, every write gated on `cancelled`.\n void fetchResults();\n\n return () => {\n cancelled = true;\n };\n }, [debouncedQuery, searchable, source, tableIdsKey, resolvedSearchEndpoint]);\n\n // Derived loading state — single source of truth for \"should the\n // dropdown show 'Loading...' instead of 'No results found'\":\n const isLoading = query.trim().length >= 2 && (query !== debouncedQuery || isFetching);\n\n // Track whether dropdown should stay open (external link opened in new tab).\n const [keepOpen, setKeepOpen] = useState(false);\n\n const handleResultSelect = useCallback(\n (\n result: SearchResult,\n modifiers?: {\n metaKey?: boolean;\n ctrlKey?: boolean;\n shiftKey?: boolean;\n altKey?: boolean;\n button?: number;\n },\n ) => {\n const action = resolveSearchResultAction(result, source, runtime?.navigation.mode, resolvedComposeContentUrl);\n // Modifier / non-primary mouse click → force new tab regardless of\n // same-tab/new-tab decision. The dropdown row is a `<div>`, not an\n // `<a target=\"_blank\">`, so the browser doesn't background-tab\n // natively on cmd-click. Honor it explicitly here for parity with\n // the anchor-based surfaces (cards, chips, related-content). Plain\n // Enter from the keyboard passes `modifiers === undefined`.\n const wantsNewTab =\n modifiers &&\n (modifiers.metaKey ||\n modifiers.ctrlKey ||\n modifiers.shiftKey ||\n modifiers.altKey ||\n (typeof modifiers.button === 'number' && modifiers.button !== 0));\n switch (action.kind) {\n case 'navigate-same-tab': {\n if (wantsNewTab) {\n setKeepOpen(true);\n window.open(action.href, '_blank', NEW_TAB_FEATURES);\n return;\n }\n // Same-origin click:\n // 1. If the href is under the current doc-tree's baseRoute AND\n // an `onInPageSwap` callback is wired AND returns true →\n // consider in-page swap handled.\n // 2. Otherwise → embed-shim `router.push()` (soft RSC nav on\n // Next.js hosts, window.location.assign on bare hosts).\n setKeepOpen(false);\n const path =\n baseRoute && action.href.startsWith(`${baseRoute}/`) ? action.href.slice(baseRoute.length + 1) : null;\n if (path && onInPageSwap?.(path)) return;\n router.push(stripSameOriginToPath(action.href));\n return;\n }\n case 'navigate-new-tab':\n // Cross-origin (e.g. clicking a flamingo.run release from\n // product-hub) — open in a new tab. Keep dropdown open so the\n // user can pick another result without re-searching.\n setKeepOpen(true);\n // Embed-mode short-circuit — the row was clicked while the panel is\n // hosted inside an embedding app, so absolutize against the\n // embedder-supplied content origin and honor its `openExternal`\n // override. Not the only path an embed host takes: a composed\n // RELATIVE href resolves to `navigate-same-tab` above and never\n // reaches `decideNewTab`, which is what lets an embedder keep its\n // own in-app routes in-app.\n if (runtime?.navigation.mode === 'embed') {\n const targetPlatform = (result.metadata?.targetPlatform as string | null | undefined) ?? null;\n resolveExternalNavigation({\n href: action.href,\n targetPlatform,\n runtime,\n }).open();\n return;\n }\n window.open(action.href, '_blank', NEW_TAB_FEATURES);\n return;\n case 'ask-ai':\n // Row is searchable-but-not-openable (cap_table positions,\n // financial-kpi snapshots, anything backed by\n // `resolveUrl: () => null`). Dispatch a CustomEvent that\n // GlobalAskAI listens for — opens chat + drills via\n // `entityIdFilter` (primary-key only, same as inline-card Ask).\n setKeepOpen(false);\n window.dispatchEvent(new CustomEvent('ask-ai:open-with-ref', { detail: action.detail }));\n return;\n case 'route':\n // Final fallback: legacy navigation by path. Hits when a row\n // has neither URL nor pk metadata — a mapper/API regression.\n setKeepOpen(false);\n onNavigate(action.path);\n return;\n case 'noop':\n return;\n }\n },\n [onNavigate, source, baseRoute, router, onInPageSwap, runtime, resolvedComposeContentUrl],\n );\n\n // Reset keepOpen when query changes. Adjusted while rendering, not from an\n // effect: the dropdown's open state is read from this in the same render the\n // keystroke produced, so an effect held it pinned open for one extra frame.\n const [keepOpenForQuery, setKeepOpenForQuery] = useState(query);\n if (keepOpenForQuery !== query) {\n setKeepOpenForQuery(query);\n setKeepOpen(false);\n }\n\n return {\n query,\n setQuery,\n results,\n isLoading,\n handleResultSelect,\n keepDropdownOpen: keepOpen,\n };\n}\n"]}