@flamingo-stack/openframe-frontend-core 0.0.239-snapshot.20260609201008 → 0.0.240

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 (115) hide show
  1. package/dist/{chunk-DV3YZWGN.cjs → chunk-3TDLFCCS.cjs} +33 -20
  2. package/dist/chunk-3TDLFCCS.cjs.map +1 -0
  3. package/dist/{chunk-ORJREQ2W.js → chunk-4XLJWX2N.js} +4 -4
  4. package/dist/{chunk-SZ3BBI6H.cjs → chunk-5JTDFOYB.cjs} +12 -12
  5. package/dist/{chunk-SZ3BBI6H.cjs.map → chunk-5JTDFOYB.cjs.map} +1 -1
  6. package/dist/{chunk-G6YZ7O27.js → chunk-7BWJF43J.js} +6 -6
  7. package/dist/{chunk-7LLS3TWN.js → chunk-B3NI3KT4.js} +5 -5
  8. package/dist/{chunk-MTROCWO4.cjs → chunk-CDLMGHSB.cjs} +7 -7
  9. package/dist/{chunk-MTROCWO4.cjs.map → chunk-CDLMGHSB.cjs.map} +1 -1
  10. package/dist/{chunk-APGMNHPY.js → chunk-MKVKVJQQ.js} +32 -19
  11. package/dist/chunk-MKVKVJQQ.js.map +1 -0
  12. package/dist/{chunk-5VU66BD2.cjs → chunk-NE2DYD6K.cjs} +494 -461
  13. package/dist/chunk-NE2DYD6K.cjs.map +1 -0
  14. package/dist/chunk-POZHDJSK.js +276 -0
  15. package/dist/chunk-POZHDJSK.js.map +1 -0
  16. package/dist/{chunk-FSS2MIEA.cjs → chunk-SGJBUL2Y.cjs} +20 -3
  17. package/dist/chunk-SGJBUL2Y.cjs.map +1 -0
  18. package/dist/{chunk-IJOJWBME.cjs → chunk-SI4LEFLR.cjs} +27 -27
  19. package/dist/{chunk-IJOJWBME.cjs.map → chunk-SI4LEFLR.cjs.map} +1 -1
  20. package/dist/chunk-TE6LSK2X.cjs +276 -0
  21. package/dist/chunk-TE6LSK2X.cjs.map +1 -0
  22. package/dist/{chunk-LJGBFD52.js → chunk-VAUI3CND.js} +18 -1
  23. package/dist/chunk-VAUI3CND.js.map +1 -0
  24. package/dist/{chunk-OB45JHDY.cjs → chunk-VFKQMAUF.cjs} +3 -3
  25. package/dist/{chunk-OB45JHDY.cjs.map → chunk-VFKQMAUF.cjs.map} +1 -1
  26. package/dist/{chunk-Y6463TD6.js → chunk-XWUA273B.js} +2 -2
  27. package/dist/{chunk-Y7DCQUNL.js → chunk-YH6KPNIH.js} +87 -54
  28. package/dist/chunk-YH6KPNIH.js.map +1 -0
  29. package/dist/{chunk-ELMYRGWG.cjs → chunk-YY6S4T67.cjs} +12 -12
  30. package/dist/{chunk-ELMYRGWG.cjs.map → chunk-YY6S4T67.cjs.map} +1 -1
  31. package/dist/{chunk-PN64LWNT.js → chunk-ZYPOIFBS.js} +8 -8
  32. package/dist/components/chat/hooks/use-chat-card-item.d.ts.map +1 -1
  33. package/dist/components/chat/index.cjs +6 -6
  34. package/dist/components/chat/index.js +5 -5
  35. package/dist/components/chat/types/entities/content-ref.d.ts +5 -20
  36. package/dist/components/chat/types/entities/content-ref.d.ts.map +1 -1
  37. package/dist/components/contact/index.cjs +7 -7
  38. package/dist/components/contact/index.js +6 -6
  39. package/dist/components/faq/faq-section.d.ts +7 -1
  40. package/dist/components/faq/faq-section.d.ts.map +1 -1
  41. package/dist/components/faq/index.cjs +3 -3
  42. package/dist/components/faq/index.js +2 -2
  43. package/dist/components/features/index.cjs +6 -6
  44. package/dist/components/features/index.js +5 -5
  45. package/dist/components/index.cjs +89 -85
  46. package/dist/components/index.cjs.map +1 -1
  47. package/dist/components/index.d.ts +1 -0
  48. package/dist/components/index.d.ts.map +1 -1
  49. package/dist/components/index.js +31 -27
  50. package/dist/components/index.js.map +1 -1
  51. package/dist/components/navigation/index.cjs +6 -6
  52. package/dist/components/navigation/index.js +5 -5
  53. package/dist/components/onboarding-guides/index.cjs +30 -30
  54. package/dist/components/onboarding-guides/index.cjs.map +1 -1
  55. package/dist/components/onboarding-guides/index.js +11 -11
  56. package/dist/components/related-content/index.cjs +26 -0
  57. package/dist/components/related-content/index.cjs.map +1 -0
  58. package/dist/components/related-content/index.d.ts +2 -0
  59. package/dist/components/related-content/index.d.ts.map +1 -0
  60. package/dist/components/related-content/index.js +26 -0
  61. package/dist/components/related-content/index.js.map +1 -0
  62. package/dist/components/related-content/related-content-section.d.ts +135 -0
  63. package/dist/components/related-content/related-content-section.d.ts.map +1 -0
  64. package/dist/components/tickets/index.cjs +73 -73
  65. package/dist/components/tickets/index.cjs.map +1 -1
  66. package/dist/components/tickets/index.js +15 -15
  67. package/dist/components/ui/index.cjs +11 -11
  68. package/dist/components/ui/index.cjs.map +1 -1
  69. package/dist/components/ui/index.js +13 -13
  70. package/dist/embed-shims/index.cjs +3 -3
  71. package/dist/embed-shims/index.cjs.map +1 -1
  72. package/dist/embed-shims/index.js +5 -5
  73. package/dist/index.cjs +25 -11
  74. package/dist/index.cjs.map +1 -1
  75. package/dist/index.js +53 -39
  76. package/dist/types/content-ref.d.ts +35 -0
  77. package/dist/types/content-ref.d.ts.map +1 -0
  78. package/dist/types/index.d.ts +1 -0
  79. package/dist/types/index.d.ts.map +1 -1
  80. package/dist/utils/content-ref-groups.d.ts +58 -0
  81. package/dist/utils/content-ref-groups.d.ts.map +1 -0
  82. package/dist/utils/extract-items.d.ts +18 -0
  83. package/dist/utils/extract-items.d.ts.map +1 -0
  84. package/dist/utils/index.cjs +77 -0
  85. package/dist/utils/index.cjs.map +1 -1
  86. package/dist/utils/index.d.ts +3 -0
  87. package/dist/utils/index.d.ts.map +1 -1
  88. package/dist/utils/index.js +71 -1
  89. package/dist/utils/index.js.map +1 -1
  90. package/dist/utils/suggestion-url.d.ts +26 -0
  91. package/dist/utils/suggestion-url.d.ts.map +1 -0
  92. package/package.json +7 -1
  93. package/src/components/chat/hooks/use-chat-card-item.ts +3 -38
  94. package/src/components/chat/types/entities/content-ref.ts +5 -21
  95. package/src/components/faq/faq-section.tsx +69 -24
  96. package/src/components/index.ts +1 -0
  97. package/src/components/related-content/index.ts +9 -0
  98. package/src/components/related-content/related-content-section.tsx +585 -0
  99. package/src/types/content-ref.ts +34 -0
  100. package/src/types/index.ts +1 -0
  101. package/src/utils/content-ref-groups.ts +89 -0
  102. package/src/utils/extract-items.ts +48 -0
  103. package/src/utils/index.ts +15 -0
  104. package/src/utils/suggestion-url.ts +39 -0
  105. package/dist/chunk-5VU66BD2.cjs.map +0 -1
  106. package/dist/chunk-APGMNHPY.js.map +0 -1
  107. package/dist/chunk-DV3YZWGN.cjs.map +0 -1
  108. package/dist/chunk-FSS2MIEA.cjs.map +0 -1
  109. package/dist/chunk-LJGBFD52.js.map +0 -1
  110. package/dist/chunk-Y7DCQUNL.js.map +0 -1
  111. /package/dist/{chunk-ORJREQ2W.js.map → chunk-4XLJWX2N.js.map} +0 -0
  112. /package/dist/{chunk-G6YZ7O27.js.map → chunk-7BWJF43J.js.map} +0 -0
  113. /package/dist/{chunk-7LLS3TWN.js.map → chunk-B3NI3KT4.js.map} +0 -0
  114. /package/dist/{chunk-Y6463TD6.js.map → chunk-XWUA273B.js.map} +0 -0
  115. /package/dist/{chunk-PN64LWNT.js.map → chunk-ZYPOIFBS.js.map} +0 -0
@@ -3,13 +3,17 @@ import {
3
3
  useSelfFetch
4
4
  } from "./chunk-L4LAAA5Q.js";
5
5
  import {
6
- ChevronButton
7
- } from "./chunk-LJGBFD52.js";
6
+ ChevronButton,
7
+ buildSuggestionUrl
8
+ } from "./chunk-VAUI3CND.js";
8
9
  import {
9
10
  cn,
10
11
  init_cn
11
12
  } from "./chunk-XTCBRQN2.js";
12
13
 
14
+ // src/components/faq/faq-section.tsx
15
+ import { useMemo } from "react";
16
+
13
17
  // src/components/faq-accordion.tsx
14
18
  import { useRef, useState, useEffect, useCallback } from "react";
15
19
  init_cn();
@@ -123,12 +127,8 @@ function buildFaqJsonLdFromFaqs(faqs, opts = {}) {
123
127
  // src/components/faq/faq-section.tsx
124
128
  import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
125
129
  var DEFAULT_HEADING_TEXT = "Frequently Asked Questions";
126
- function buildFaqsUrl(entityType, entityId) {
127
- if (!entityType || entityId === void 0 || entityId === null || entityId === "") {
128
- return "/api/faqs";
129
- }
130
- const qs = new URLSearchParams({ entityType, entityId: String(entityId) });
131
- return `/api/faqs?${qs.toString()}`;
130
+ function buildFaqsUrl(entityType, entityId, minResults, apiBaseUrl = "") {
131
+ return buildSuggestionUrl("/api/faqs", { apiBaseUrl, entityType, entityId, count: minResults });
132
132
  }
133
133
  function groupBySection(faqs) {
134
134
  const map = /* @__PURE__ */ new Map();
@@ -162,10 +162,15 @@ function FaqSection({
162
162
  heading,
163
163
  emitJsonLd = false,
164
164
  jsonLd,
165
- className
165
+ className,
166
+ minResults,
167
+ apiBaseUrl = ""
166
168
  }) {
167
- const url = buildFaqsUrl(entityType, entityId);
168
- const initialData = initialFaqs ? { faqs: initialFaqs } : void 0;
169
+ const url = buildFaqsUrl(entityType, entityId, minResults, apiBaseUrl);
170
+ const initialData = useMemo(
171
+ () => initialFaqs ? { faqs: initialFaqs } : void 0,
172
+ [initialFaqs]
173
+ );
169
174
  const { data, isLoading, error } = useSelfFetch(url, { initialData });
170
175
  const faqs = data?.faqs ?? [];
171
176
  const showHeading = heading !== null;
@@ -174,21 +179,29 @@ function FaqSection({
174
179
  if (error && !showHeading) {
175
180
  return null;
176
181
  }
182
+ if (!isLoading && !error && faqs.length === 0 && !showHeading) {
183
+ return null;
184
+ }
177
185
  if (isLoading && faqs.length === 0) {
186
+ if (!showHeading) {
187
+ return /* @__PURE__ */ jsx2("div", { className, children: /* @__PURE__ */ jsx2(FaqSkeleton, {}) });
188
+ }
178
189
  return /* @__PURE__ */ jsx2("main", { className: className ?? "bg-ods-bg", children: /* @__PURE__ */ jsx2("div", { className: "max-w-[1920px] px-6 md:px-20 py-6 md:py-10 mx-auto", children: /* @__PURE__ */ jsx2(FaqSkeleton, {}) }) });
179
190
  }
180
191
  if (error && faqs.length === 0) {
181
192
  return /* @__PURE__ */ jsx2("main", { className: className ?? "bg-ods-bg flex items-center justify-center py-20", children: /* @__PURE__ */ jsx2("p", { className: "text-ods-text-primary font-medium", children: "Failed to load FAQs. Please try again later." }) });
182
193
  }
183
194
  const schema = emitJsonLd ? buildFaqJsonLdFromFaqs(faqs, jsonLd) : null;
195
+ const groupNodes = groups.map(({ section, items }) => /* @__PURE__ */ jsxs2("div", { className: "space-y-4", children: [
196
+ section && /* @__PURE__ */ jsx2("h2", { className: "text-h2 tracking-[-0.04em] text-ods-text-primary mb-3 md:mb-4", children: section }),
197
+ /* @__PURE__ */ jsx2(FaqAccordion, { items })
198
+ ] }, section || "default"));
199
+ const body = showHeading ? /* @__PURE__ */ jsx2("main", { className: className ?? "bg-ods-bg", children: /* @__PURE__ */ jsxs2("div", { className: "max-w-[1920px] px-6 md:px-20 py-6 md:py-10 mx-auto space-y-10", children: [
200
+ headingNode,
201
+ groupNodes
202
+ ] }) }) : /* @__PURE__ */ jsx2("section", { className: className ?? "space-y-10", children: groupNodes });
184
203
  return /* @__PURE__ */ jsxs2(Fragment, { children: [
185
- /* @__PURE__ */ jsx2("main", { className: className ?? "bg-ods-bg", children: /* @__PURE__ */ jsxs2("div", { className: "max-w-[1920px] px-6 md:px-20 py-6 md:py-10 mx-auto space-y-10", children: [
186
- showHeading && headingNode,
187
- groups.map(({ section, items }) => /* @__PURE__ */ jsxs2("div", { className: "space-y-4", children: [
188
- section && /* @__PURE__ */ jsx2("h2", { className: "text-h2 tracking-[-0.04em] text-ods-text-primary mb-3 md:mb-4", children: section }),
189
- /* @__PURE__ */ jsx2(FaqAccordion, { items })
190
- ] }, section || "default"))
191
- ] }) }),
204
+ body,
192
205
  schema && /* @__PURE__ */ jsx2(
193
206
  "script",
194
207
  {
@@ -203,4 +216,4 @@ export {
203
216
  FaqAccordion,
204
217
  FaqSection
205
218
  };
206
- //# sourceMappingURL=chunk-APGMNHPY.js.map
219
+ //# sourceMappingURL=chunk-MKVKVJQQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/faq/faq-section.tsx","../src/components/faq-accordion.tsx","../src/components/faq/json-ld.ts"],"sourcesContent":["\"use client\"\n\nimport React, { useMemo } from 'react'\nimport type { Faq } from '../../types/faq'\nimport { FaqAccordion, type FaqItem } from '../faq-accordion'\nimport { useSelfFetch } from '../../hooks/use-self-fetch'\nimport { buildSuggestionUrl } from '../../utils/suggestion-url'\nimport { buildFaqJsonLdFromFaqs, type FaqSchemaOptions } from './json-ld'\n\nexport interface FaqSectionProps {\n /**\n * SSR hydrate. When provided, the hook skips the first client fetch (per\n * useSelfFetch contract). The consuming server page resolves FAQs then drills\n * them into this prop — the lib never re-fetches what the host already gated on.\n */\n initialFaqs?: Faq[]\n /** Both required together for entity-attached FAQs; partial → bare /api/faqs. */\n entityType?: string\n entityId?: number | string\n /**\n * Page heading. Pass null to render in embedded mode (no <h1>, error branch\n * suppresses any banner). React node so platforms can drill their local\n * <PageHeading> component without the lib referencing platform state.\n */\n heading?: React.ReactNode | null\n /** Inject FAQPage schema.org JSON-LD as a <script>. Off by default so embeds\n * don't emit duplicate schema. */\n emitJsonLd?: boolean\n /** Overrides for the JSON-LD's name/description/url. */\n jsonLd?: FaqSchemaOptions\n className?: string\n /** Maps to /api/faqs `?count=` (the 5-tier fill target). Absent → param\n * not sent (server default applies). */\n minResults?: number\n /** Fetch-URL prefix for third-party embeds / reverse proxies\n * ('' = same-origin relative). */\n apiBaseUrl?: string\n}\n\nconst DEFAULT_HEADING_TEXT = 'Frequently Asked Questions'\n\n/** URL composition shared with RelatedContentSection (`buildSuggestionUrl`)\n * — byte-identical to the historical `buildFaqsUrl` output when\n * `minResults`/`apiBaseUrl` are absent. */\nfunction buildFaqsUrl(\n entityType?: string,\n entityId?: number | string,\n minResults?: number,\n apiBaseUrl = '',\n): string {\n return buildSuggestionUrl('/api/faqs', { apiBaseUrl, entityType, entityId, count: minResults })\n}\n\nfunction groupBySection(faqs: Faq[]): Array<{ section: string | null; items: FaqItem[] }> {\n const map = new Map<string, FaqItem[]>()\n for (const faq of faqs) {\n const key = faq.section || ''\n let arr = map.get(key)\n if (!arr) {\n arr = []\n map.set(key, arr)\n }\n arr.push({ id: faq.id, question: faq.question, answer: faq.answer })\n }\n return Array.from(map.entries()).map(([section, items]) => ({\n section: section || null,\n items,\n }))\n}\n\nfunction FaqSkeleton() {\n return (\n <div className=\"space-y-8 animate-pulse\">\n <div className=\"h-12 md:h-14 w-2/3 rounded bg-ods-border\" />\n <div className=\"rounded-3xl border border-ods-border overflow-hidden bg-ods-card divide-y divide-ods-border w-full\">\n {Array.from({ length: 8 }).map((_, idx) => (\n <div key={idx} className=\"flex items-center justify-between px-6 md:px-8 py-6\">\n <div className=\"h-6 w-5/6 rounded bg-ods-border\" />\n <div className=\"h-10 w-10 rounded-md bg-ods-border\" />\n </div>\n ))}\n </div>\n </div>\n )\n}\n\ninterface FaqsResponse {\n faqs: Faq[]\n}\n\n/**\n * Generic, embeddable FAQ display surface.\n *\n * - Standalone /faqs page: pass `initialFaqs` from the server + `heading` +\n * `emitJsonLd` with `jsonLd` overrides for SEO.\n * - Per-entity embed: pass `entityType` + `entityId` (no `initialFaqs`); the\n * hook self-fetches and the public /api/faqs endpoint picks override-vs-fallback.\n *\n * CONTRACT: the consuming app MUST implement `GET /api/faqs`. Without it,\n * useSelfFetch reports `error:true` (logged once); in embedded mode (heading\n * === null) this component renders nothing so the host page isn't disfigured.\n */\nexport function FaqSection({\n initialFaqs,\n entityType,\n entityId,\n heading,\n emitJsonLd = false,\n jsonLd,\n className,\n minResults,\n apiBaseUrl = '',\n}: FaqSectionProps) {\n const url = buildFaqsUrl(entityType, entityId, minResults, apiBaseUrl)\n // Memoized — useSelfFetch re-syncs on [initialData]; a fresh per-render\n // wrapper object would setState-loop under re-rendering parents.\n const initialData = useMemo<FaqsResponse | undefined>(\n () => (initialFaqs ? { faqs: initialFaqs } : undefined),\n [initialFaqs],\n )\n const { data, isLoading, error } = useSelfFetch<FaqsResponse>(url, { initialData })\n\n const faqs = data?.faqs ?? []\n const showHeading = heading !== null\n const headingNode =\n heading === undefined\n ? <h1 className=\"text-h1 tracking-[-0.04em] text-ods-text-primary\">{DEFAULT_HEADING_TEXT}</h1>\n : heading\n\n const groups = groupBySection(faqs)\n\n // Embedded mode (no heading): degrade silently on error.\n if (error && !showHeading) {\n return null\n }\n\n // Embedded mode, zero FAQs after load: render nothing — an embedded host\n // page (blog/case-study detail) must not show an empty section shell.\n // The standalone /faqs page (heading set) keeps its existing behavior.\n if (!isLoading && !error && faqs.length === 0 && !showHeading) {\n return null\n }\n\n if (isLoading && faqs.length === 0) {\n // Embedded mode renders skeletons WITHOUT the standalone page shell —\n // a host detail page already provides <main> + gutters; nesting them\n // here would emit invalid markup and double padding.\n if (!showHeading) {\n return (\n <div className={className}>\n <FaqSkeleton />\n </div>\n )\n }\n return (\n <main className={className ?? 'bg-ods-bg'}>\n <div className=\"max-w-[1920px] px-6 md:px-20 py-6 md:py-10 mx-auto\">\n <FaqSkeleton />\n </div>\n </main>\n )\n }\n\n if (error && faqs.length === 0) {\n return (\n <main className={className ?? 'bg-ods-bg flex items-center justify-center py-20'}>\n <p className=\"text-ods-text-primary font-medium\">Failed to load FAQs. Please try again later.</p>\n </main>\n )\n }\n\n const schema = emitJsonLd ? buildFaqJsonLdFromFaqs(faqs, jsonLd) : null\n\n const groupNodes = groups.map(({ section, items }) => (\n <div key={section || 'default'} className=\"space-y-4\">\n {section && (\n <h2 className=\"text-h2 tracking-[-0.04em] text-ods-text-primary mb-3 md:mb-4\">\n {section}\n </h2>\n )}\n <FaqAccordion items={items} />\n </div>\n ))\n\n // Embedded mode (heading === null): no <main> page shell, no page gutters —\n // the host page owns layout. Standalone mode keeps the historical markup.\n const body = showHeading ? (\n <main className={className ?? 'bg-ods-bg'}>\n <div className=\"max-w-[1920px] px-6 md:px-20 py-6 md:py-10 mx-auto space-y-10\">\n {headingNode}\n {groupNodes}\n </div>\n </main>\n ) : (\n <section className={className ?? 'space-y-10'}>{groupNodes}</section>\n )\n\n return (\n <>\n {body}\n {schema && (\n <script\n type=\"application/ld+json\"\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{ __html: JSON.stringify(schema) }}\n />\n )}\n </>\n )\n}\n","\"use client\"\n\nimport React, { useRef, useState, useEffect, useCallback } from 'react'\nimport { ChevronButton } from './ui/chevron-button'\nimport { cn } from \"../utils/cn\"\n\nexport interface FaqItem {\n id: number | string\n question: string\n answer: string\n}\n\ninterface FaqAccordionProps {\n items: FaqItem[]\n defaultOpenIds?: (number | string)[]\n}\n\n// Utility to measure scrollHeight outside render cycle\nconst useMeasuredHeight = (isOpen: boolean) => {\n const ref = useRef<HTMLDivElement | null>(null)\n const [maxHeight, setMaxHeight] = useState<string>('0px')\n\n const measure = useCallback(() => {\n if (ref.current) {\n const height = ref.current.scrollHeight\n setMaxHeight(`${height}px`)\n }\n }, [])\n\n // Update height only when section is open\n useEffect(() => {\n if (isOpen) {\n measure()\n } else {\n setMaxHeight('0px')\n }\n }, [isOpen, measure])\n\n return { ref, maxHeight }\n}\n\nexport function FaqAccordion({ items, defaultOpenIds = [] }: FaqAccordionProps) {\n const [openSet, setOpenSet] = useState<Set<string | number>>(new Set(defaultOpenIds))\n\n const toggle = (id: string | number) => {\n setOpenSet(prev => {\n const next = new Set(prev)\n if (next.has(id)) next.delete(id)\n else next.add(id)\n return next\n })\n }\n\n return (\n <div className=\"rounded-3xl border border-ods-border divide-y divide-ods-border bg-ods-card overflow-hidden\">\n {items.map(item => {\n const isOpen = openSet.has(item.id)\n const { ref, maxHeight } = useMeasuredHeight(isOpen)\n\n return (\n <div\n key={item.id}\n className={cn('group transition-colors hover:bg-[#1E1E1E]', isOpen ? 'bg-ods-bg' : 'bg-transparent')}\n >\n {/* Header */}\n <div\n role=\"button\"\n tabIndex={0}\n onClick={() => toggle(item.id)}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n toggle(item.id);\n }\n }}\n aria-expanded={isOpen}\n className=\"flex w-full items-center justify-between px-6 md:px-8 py-6 text-left focus:outline-none transition-colors cursor-pointer\"\n >\n <h3>\n {item.question}\n </h3>\n <div className=\"flex-shrink-0\">\n <ChevronButton\n aria-label={isOpen ? 'Collapse question' : 'Expand question'}\n size=\"md\"\n isExpanded={isOpen}\n backgroundColor=\"transparent\"\n borderColor=\"#3A3A3A\"\n />\n </div>\n </div>\n {/* Content wrapper with max-height animation */}\n <div\n style={{ maxHeight, transition: 'max-height 0.35s ease-in-out, opacity 0.35s ease-in-out', opacity: isOpen ? 1 : 0 }}\n className=\"overflow-hidden group-hover:bg-[#1E1E1E]/30\"\n >\n <div ref={ref} className=\"px-6 md:px-8 pb-6 text-ods-text-primary text-h4\">\n {item.answer}\n </div>\n </div>\n </div>\n )\n })}\n </div>\n )\n} ","/**\n * Pure FAQ JSON-LD builder. No React, no client-only deps — safe to import from\n * Server Components via the `./components/faq` subpath export. (Do NOT import\n * through the root `./components` barrel — that barrel is `\"use client\"` and\n * dragging it into a Server Component would force the client graph into the\n * server.)\n *\n * The hub used to harcode `name`/`description` here for OpenMSP; in the lib we\n * accept overrides so every embedder can supply its own platform branding.\n */\nimport type { Faq } from '../../types/faq'\n\nexport interface FaqSchemaOptions {\n name?: string\n description?: string\n url?: string\n}\n\nconst DEFAULT_NAME = 'Frequently Asked Questions'\nconst DEFAULT_DESCRIPTION =\n 'Answers to common questions.'\n\nexport function baseFaqSchema(opts: FaqSchemaOptions = {}) {\n return {\n '@context': 'https://schema.org',\n '@type': 'FAQPage',\n name: opts.name ?? DEFAULT_NAME,\n description: opts.description ?? DEFAULT_DESCRIPTION,\n ...(opts.url ? { url: opts.url } : {}),\n } as const\n}\n\nexport function buildFaqJsonLdFromFaqs(faqs: Faq[], opts: FaqSchemaOptions = {}) {\n return {\n ...baseFaqSchema(opts),\n mainEntity: faqs.map((faq) => ({\n '@type': 'Question',\n name: faq.question,\n acceptedAnswer: {\n '@type': 'Answer',\n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