@flamingo-stack/openframe-frontend-core 0.0.402 → 0.0.404-snapshot.20260711053526

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 (153) hide show
  1. package/dist/{chunk-NHFQ2LCC.js → chunk-3XCNFTFV.js} +3 -3
  2. package/dist/{chunk-F63VMX4S.js → chunk-5XZEY34X.js} +3 -3
  3. package/dist/{chunk-EDOLCPBS.cjs → chunk-6OQ7YOX5.cjs} +33 -33
  4. package/dist/{chunk-EDOLCPBS.cjs.map → chunk-6OQ7YOX5.cjs.map} +1 -1
  5. package/dist/{chunk-A4RDD2PS.cjs → chunk-ACJ4CM6H.cjs} +93 -93
  6. package/dist/{chunk-A4RDD2PS.cjs.map → chunk-ACJ4CM6H.cjs.map} +1 -1
  7. package/dist/{chunk-WM72XFOD.js → chunk-BK7QCB5J.js} +6 -6
  8. package/dist/{chunk-ONAWSVFK.cjs → chunk-BS6O4HLJ.cjs} +40 -40
  9. package/dist/{chunk-ONAWSVFK.cjs.map → chunk-BS6O4HLJ.cjs.map} +1 -1
  10. package/dist/{chunk-GA5AN24T.cjs → chunk-BX3R44MR.cjs} +2 -2
  11. package/dist/chunk-BX3R44MR.cjs.map +1 -0
  12. package/dist/{chunk-J4XR6YYZ.cjs → chunk-CCIBZ7TO.cjs} +10 -6
  13. package/dist/chunk-CCIBZ7TO.cjs.map +1 -0
  14. package/dist/{chunk-DYV47UA6.cjs → chunk-DHIYBC5Z.cjs} +32 -32
  15. package/dist/{chunk-DYV47UA6.cjs.map → chunk-DHIYBC5Z.cjs.map} +1 -1
  16. package/dist/{chunk-DH6HTYOV.js → chunk-E6YHDT3D.js} +6 -2
  17. package/dist/chunk-E6YHDT3D.js.map +1 -0
  18. package/dist/{chunk-CWLKGOU4.cjs → chunk-ELLTTMPE.cjs} +5 -5
  19. package/dist/{chunk-CWLKGOU4.cjs.map → chunk-ELLTTMPE.cjs.map} +1 -1
  20. package/dist/{chunk-6VAJDGZK.js → chunk-F3YLM5PO.js} +3 -3
  21. package/dist/{chunk-MEU2JEXL.cjs → chunk-FFYEDIAG.cjs} +511 -447
  22. package/dist/chunk-FFYEDIAG.cjs.map +1 -0
  23. package/dist/{chunk-D3HPV6YE.cjs → chunk-FOJRR647.cjs} +73 -73
  24. package/dist/{chunk-D3HPV6YE.cjs.map → chunk-FOJRR647.cjs.map} +1 -1
  25. package/dist/{chunk-6FIVVZO2.js → chunk-GT7AJXKH.js} +2 -2
  26. package/dist/{chunk-RZIFF62P.js → chunk-ICJRSNBM.js} +73 -9
  27. package/dist/chunk-ICJRSNBM.js.map +1 -0
  28. package/dist/{chunk-32K5CRL2.cjs → chunk-LREN3G7R.cjs} +12 -12
  29. package/dist/{chunk-32K5CRL2.cjs.map → chunk-LREN3G7R.cjs.map} +1 -1
  30. package/dist/{chunk-HU5HWEQ5.cjs → chunk-M6BGJVDY.cjs} +19 -19
  31. package/dist/{chunk-HU5HWEQ5.cjs.map → chunk-M6BGJVDY.cjs.map} +1 -1
  32. package/dist/{chunk-MTBFE3JF.js → chunk-PNJ5LMVK.js} +16 -2
  33. package/dist/chunk-PNJ5LMVK.js.map +1 -0
  34. package/dist/{chunk-VMJTNXOH.js → chunk-Q2KKEE6W.js} +6 -6
  35. package/dist/{chunk-Q3AO2QWK.cjs → chunk-QAFRLO5N.cjs} +18 -4
  36. package/dist/chunk-QAFRLO5N.cjs.map +1 -0
  37. package/dist/{chunk-O5QU5KAC.js → chunk-QYTGHN2T.js} +24 -21
  38. package/dist/chunk-QYTGHN2T.js.map +1 -0
  39. package/dist/{chunk-COGPHD7D.js → chunk-RC35ITSR.js} +6 -6
  40. package/dist/{chunk-3TCCW7B4.js → chunk-RIGB7LP7.js} +4 -4
  41. package/dist/{chunk-YPNI74ZP.js → chunk-UIAQXIA6.js} +5 -5
  42. package/dist/{chunk-LAFLYVZ4.js → chunk-UN2BJ7XW.js} +3 -3
  43. package/dist/{chunk-YIJOSOSA.cjs → chunk-V4MOB3AD.cjs} +12 -12
  44. package/dist/{chunk-YIJOSOSA.cjs.map → chunk-V4MOB3AD.cjs.map} +1 -1
  45. package/dist/{chunk-JXSWDXUA.cjs → chunk-VFWEFR3Q.cjs} +40 -40
  46. package/dist/{chunk-JXSWDXUA.cjs.map → chunk-VFWEFR3Q.cjs.map} +1 -1
  47. package/dist/{chunk-OPCGDJU7.cjs → chunk-WEZIVLCO.cjs} +37 -34
  48. package/dist/chunk-WEZIVLCO.cjs.map +1 -0
  49. package/dist/{chunk-HGKWTKW7.js → chunk-WJRPMULP.js} +2 -2
  50. package/dist/chunk-WJRPMULP.js.map +1 -0
  51. package/dist/components/announcement-bar.d.ts +27 -1
  52. package/dist/components/announcement-bar.d.ts.map +1 -1
  53. package/dist/components/case-studies/index.cjs +10 -10
  54. package/dist/components/case-studies/index.js +4 -4
  55. package/dist/components/chat/index.cjs +4 -4
  56. package/dist/components/chat/index.js +3 -3
  57. package/dist/components/contact/index.cjs +5 -5
  58. package/dist/components/contact/index.js +4 -4
  59. package/dist/components/docs/index.cjs +7 -7
  60. package/dist/components/docs/index.js +6 -6
  61. package/dist/components/embeds/index.cjs +5 -5
  62. package/dist/components/embeds/index.js +4 -4
  63. package/dist/components/faq/index.cjs +6 -6
  64. package/dist/components/faq/index.js +5 -5
  65. package/dist/components/faq-accordion.d.ts.map +1 -1
  66. package/dist/components/features/index.cjs +4 -4
  67. package/dist/components/features/index.js +3 -3
  68. package/dist/components/help-center-pages/index.cjs +23 -23
  69. package/dist/components/help-center-pages/index.js +14 -14
  70. package/dist/components/index.cjs +274 -299
  71. package/dist/components/index.cjs.map +1 -1
  72. package/dist/components/index.js +110 -135
  73. package/dist/components/index.js.map +1 -1
  74. package/dist/components/navigation/index.cjs +4 -4
  75. package/dist/components/navigation/index.js +3 -3
  76. package/dist/components/onboarding-guides/index.cjs +8 -8
  77. package/dist/components/onboarding-guides/index.js +7 -7
  78. package/dist/components/related-content/index.cjs +6 -6
  79. package/dist/components/related-content/index.js +5 -5
  80. package/dist/components/tickets/index.cjs +7 -7
  81. package/dist/components/tickets/index.js +6 -6
  82. package/dist/components/ui/file-manager/index.cjs +50 -50
  83. package/dist/components/ui/file-manager/index.js +1 -1
  84. package/dist/components/ui/index.cjs +4 -4
  85. package/dist/components/ui/index.js +3 -3
  86. package/dist/hooks/api-hooks.d.ts +0 -4
  87. package/dist/hooks/api-hooks.d.ts.map +1 -1
  88. package/dist/hooks/index.cjs +2 -2
  89. package/dist/hooks/index.js +1 -1
  90. package/dist/hooks/use-self-fetch.d.ts +7 -0
  91. package/dist/hooks/use-self-fetch.d.ts.map +1 -1
  92. package/dist/index.cjs +20 -4
  93. package/dist/index.cjs.map +1 -1
  94. package/dist/index.js +19 -3
  95. package/dist/types/announcement.cjs +5 -0
  96. package/dist/types/announcement.cjs.map +1 -1
  97. package/dist/types/announcement.d.ts +37 -7
  98. package/dist/types/announcement.d.ts.map +1 -1
  99. package/dist/types/announcement.js +5 -1
  100. package/dist/types/announcement.js.map +1 -1
  101. package/dist/types/index.cjs +5 -0
  102. package/dist/types/index.cjs.map +1 -1
  103. package/dist/types/index.js +5 -1
  104. package/dist/types/index.js.map +1 -1
  105. package/dist/utils/announcement-storage.d.ts +39 -7
  106. package/dist/utils/announcement-storage.d.ts.map +1 -1
  107. package/dist/utils/app-config.d.ts.map +1 -1
  108. package/dist/utils/color-analysis.d.ts +13 -0
  109. package/dist/utils/color-analysis.d.ts.map +1 -1
  110. package/dist/utils/index.cjs +58 -1
  111. package/dist/utils/index.cjs.map +1 -1
  112. package/dist/utils/index.d.ts +1 -0
  113. package/dist/utils/index.d.ts.map +1 -1
  114. package/dist/utils/index.js +52 -2
  115. package/dist/utils/index.js.map +1 -1
  116. package/package.json +1 -1
  117. package/src/components/.announcement-bar.md +32 -30
  118. package/src/components/announcement-bar.tsx +227 -182
  119. package/src/components/faq/faq-section.tsx +3 -3
  120. package/src/components/faq-accordion.tsx +17 -20
  121. package/src/components/features/video.tsx +26 -6
  122. package/src/components/ui/button/button.tsx +1 -1
  123. package/src/hooks/.api-hooks.md +1 -4
  124. package/src/hooks/api-hooks.ts +0 -7
  125. package/src/hooks/use-self-fetch.ts +29 -1
  126. package/src/stories/AnnouncementBar.stories.tsx +188 -152
  127. package/src/types/.announcement.md +2 -2
  128. package/src/types/announcement.ts +37 -7
  129. package/src/utils/.announcement-storage.md +19 -24
  130. package/src/utils/announcement-storage.ts +74 -28
  131. package/src/utils/app-config.ts +10 -1
  132. package/src/utils/color-analysis.ts +16 -1
  133. package/src/utils/index.ts +3 -0
  134. package/dist/chunk-DH6HTYOV.js.map +0 -1
  135. package/dist/chunk-GA5AN24T.cjs.map +0 -1
  136. package/dist/chunk-HGKWTKW7.js.map +0 -1
  137. package/dist/chunk-J4XR6YYZ.cjs.map +0 -1
  138. package/dist/chunk-MEU2JEXL.cjs.map +0 -1
  139. package/dist/chunk-MTBFE3JF.js.map +0 -1
  140. package/dist/chunk-O5QU5KAC.js.map +0 -1
  141. package/dist/chunk-OPCGDJU7.cjs.map +0 -1
  142. package/dist/chunk-Q3AO2QWK.cjs.map +0 -1
  143. package/dist/chunk-RZIFF62P.js.map +0 -1
  144. /package/dist/{chunk-NHFQ2LCC.js.map → chunk-3XCNFTFV.js.map} +0 -0
  145. /package/dist/{chunk-F63VMX4S.js.map → chunk-5XZEY34X.js.map} +0 -0
  146. /package/dist/{chunk-WM72XFOD.js.map → chunk-BK7QCB5J.js.map} +0 -0
  147. /package/dist/{chunk-6VAJDGZK.js.map → chunk-F3YLM5PO.js.map} +0 -0
  148. /package/dist/{chunk-6FIVVZO2.js.map → chunk-GT7AJXKH.js.map} +0 -0
  149. /package/dist/{chunk-VMJTNXOH.js.map → chunk-Q2KKEE6W.js.map} +0 -0
  150. /package/dist/{chunk-COGPHD7D.js.map → chunk-RC35ITSR.js.map} +0 -0
  151. /package/dist/{chunk-3TCCW7B4.js.map → chunk-RIGB7LP7.js.map} +0 -0
  152. /package/dist/{chunk-YPNI74ZP.js.map → chunk-UIAQXIA6.js.map} +0 -0
  153. /package/dist/{chunk-LAFLYVZ4.js.map → chunk-UN2BJ7XW.js.map} +0 -0
@@ -4,7 +4,7 @@ import "../chunk-GZ4C3XW6.js";
4
4
  import {
5
5
  GROUP_PAGE_SIZE,
6
6
  RelatedContentSection
7
- } from "../chunk-NHFQ2LCC.js";
7
+ } from "../chunk-3XCNFTFV.js";
8
8
  import {
9
9
  DeliveryLists,
10
10
  DeliveryTable,
@@ -21,7 +21,7 @@ import {
21
21
  useLegalDocs,
22
22
  usePaginationLoading,
23
23
  useRoadmapVoting
24
- } from "../chunk-VMJTNXOH.js";
24
+ } from "../chunk-Q2KKEE6W.js";
25
25
  import {
26
26
  AnnouncementBarSkeleton,
27
27
  ArticleLayoutSkeleton,
@@ -54,17 +54,17 @@ import {
54
54
  useDocNavigation,
55
55
  useDocumentTree,
56
56
  useScrollSpy
57
- } from "../chunk-YPNI74ZP.js";
57
+ } from "../chunk-UIAQXIA6.js";
58
58
  import {
59
59
  FileDownloadCard,
60
60
  GoogleSheetsViewer,
61
61
  PdfViewer
62
- } from "../chunk-LAFLYVZ4.js";
62
+ } from "../chunk-UN2BJ7XW.js";
63
63
  import {
64
64
  FaqAccordion,
65
65
  FaqDocumentPage,
66
66
  FaqSection
67
- } from "../chunk-O5QU5KAC.js";
67
+ } from "../chunk-QYTGHN2T.js";
68
68
  import {
69
69
  DeliveryRow,
70
70
  DevCardRowContent,
@@ -75,11 +75,11 @@ import {
75
75
  EmptyState,
76
76
  UnifiedPagination,
77
77
  init_unified_pagination
78
- } from "../chunk-6VAJDGZK.js";
78
+ } from "../chunk-F3YLM5PO.js";
79
79
  import {
80
80
  ArticleAuthorByline,
81
81
  DetailPageSkeleton
82
- } from "../chunk-6FIVVZO2.js";
82
+ } from "../chunk-GT7AJXKH.js";
83
83
  import {
84
84
  DocSearchBar,
85
85
  DocSearchResultRow,
@@ -87,8 +87,10 @@ import {
87
87
  mapDocSearchResults,
88
88
  resolveSearchResultAction,
89
89
  useDocSearch
90
- } from "../chunk-F63VMX4S.js";
91
- import "../chunk-MTBFE3JF.js";
90
+ } from "../chunk-5XZEY34X.js";
91
+ import {
92
+ useSelfFetch
93
+ } from "../chunk-PNJ5LMVK.js";
92
94
  import "../chunk-4XLJWX2N.js";
93
95
  import {
94
96
  ADMIN_APPROVAL_REQUEST_CONTEXT_TYPE,
@@ -722,6 +724,7 @@ import {
722
724
  buildNatsWsUrl,
723
725
  buildProductReleaseCardProps,
724
726
  chatChipClass,
727
+ clearLegacyAnnouncementCache,
725
728
  clickupTaskUrl,
726
729
  columnFromTicketStatus,
727
730
  computeHistoryPrepend,
@@ -733,6 +736,7 @@ import {
733
736
  defaultTableIdForDocumentType,
734
737
  deriveColumns,
735
738
  detectAspectRatio,
739
+ dismissAnnouncement,
736
740
  escapeMarkdownInline,
737
741
  executeNavigation,
738
742
  executeNavigationImperative,
@@ -784,6 +788,7 @@ import {
784
788
  handleChatNavClick,
785
789
  hideOnError,
786
790
  init_pagination,
791
+ isAnnouncementDismissed,
787
792
  isApprovalNotification,
788
793
  isControlChunk,
789
794
  isCrossOriginUrl,
@@ -804,6 +809,7 @@ import {
804
809
  parseChunkToAction,
805
810
  parseScrollAnchor,
806
811
  parseWireCommandOverride,
812
+ pickReadableTextColor,
807
813
  processHistoricalMessages,
808
814
  processHistoricalMessagesWithErrors,
809
815
  programItemToStripProfile,
@@ -873,7 +879,7 @@ import {
873
879
  useVideoOriginPreconnect,
874
880
  useVideoWarmup,
875
881
  usesCanonicalStatusStyle
876
- } from "../chunk-RZIFF62P.js";
882
+ } from "../chunk-ICJRSNBM.js";
877
883
  import {
878
884
  CommandApprovalToast,
879
885
  ToastCard,
@@ -892,7 +898,7 @@ import {
892
898
  showToast,
893
899
  useOnboardingState,
894
900
  useToast
895
- } from "../chunk-DH6HTYOV.js";
901
+ } from "../chunk-E6YHDT3D.js";
896
902
  import "../chunk-OYGFWWLQ.js";
897
903
  import {
898
904
  useChatRuntime,
@@ -938,7 +944,7 @@ import {
938
944
  SplitButton,
939
945
  buttonVariants,
940
946
  init_button2 as init_button
941
- } from "../chunk-HGKWTKW7.js";
947
+ } from "../chunk-WJRPMULP.js";
942
948
  import "../chunk-6U3IUD57.js";
943
949
  import {
944
950
  init_next_link,
@@ -1109,176 +1115,145 @@ import "../chunk-GGWZFCYS.js";
1109
1115
 
1110
1116
  // src/components/announcement-bar.tsx
1111
1117
  init_button();
1112
- import { useState, useEffect } from "react";
1118
+ import { useEffect, useMemo, useState } from "react";
1113
1119
  import { X } from "lucide-react";
1114
-
1115
- // src/utils/announcement-storage.ts
1116
- function getStoredAnnouncement(key) {
1117
- if (typeof window !== "undefined") {
1118
- try {
1119
- return JSON.parse(localStorage.getItem(key) || "null");
1120
- } catch {
1121
- return null;
1122
- }
1123
- }
1124
- return null;
1125
- }
1126
- function setStoredAnnouncement(key, value) {
1127
- if (typeof window !== "undefined") {
1128
- try {
1129
- localStorage.setItem(key, JSON.stringify(value));
1130
- } catch {
1131
- }
1132
- }
1133
- }
1134
- function clearStoredAnnouncement(key = "announcement") {
1135
- if (typeof window !== "undefined") {
1136
- try {
1137
- localStorage.removeItem(key);
1138
- } catch {
1139
- }
1140
- }
1141
- }
1142
-
1143
- // src/components/announcement-bar.tsx
1144
1120
  import { jsx, jsxs } from "react/jsx-runtime";
1145
- function AnnouncementBar() {
1146
- const [announcement, setAnnouncement] = useState(null);
1147
- const [isVisible, setIsVisible] = useState(false);
1121
+ function AnnouncementBar({
1122
+ initialAnnouncement,
1123
+ previewMode = false,
1124
+ className
1125
+ } = {}) {
1148
1126
  const platform = getAppType();
1149
1127
  const endpoints = useEndpointsRuntime();
1150
- const announcementsUrl = endpoints?.announcementsUrl;
1151
- const getDismissKey = (id) => `${platform}-announcement-${id}-dismissed`;
1152
- const getCacheKey = () => `${platform}-announcement-cache`;
1153
- const fetchActiveAnnouncement = async () => {
1154
- if (!announcementsUrl) return;
1155
- try {
1156
- const response = await fetch(announcementsUrl);
1157
- if (response.ok) {
1158
- const data = await response.json();
1159
- if (data.announcement) {
1160
- setAnnouncement(data.announcement);
1161
- setStoredAnnouncement(getCacheKey(), data.announcement);
1162
- const isDismissed = localStorage.getItem(getDismissKey(data.announcement.id));
1163
- setIsVisible(!isDismissed);
1164
- } else {
1165
- setAnnouncement(null);
1166
- setIsVisible(false);
1167
- clearStoredAnnouncement(getCacheKey());
1168
- }
1169
- } else {
1170
- console.error(`\u274C [${platform.toUpperCase()}] Error fetching announcement: ${response.status}`);
1171
- setAnnouncement(null);
1172
- setIsVisible(false);
1173
- clearStoredAnnouncement(getCacheKey());
1174
- }
1175
- } catch (error) {
1176
- console.error("Error fetching active announcement:", error);
1177
- setAnnouncement(null);
1178
- setIsVisible(false);
1179
- clearStoredAnnouncement(getCacheKey());
1180
- }
1181
- };
1128
+ const url = previewMode ? null : endpoints?.announcementsUrl ?? null;
1129
+ const initialData = useMemo(
1130
+ () => initialAnnouncement === void 0 ? void 0 : { announcement: initialAnnouncement },
1131
+ [initialAnnouncement]
1132
+ );
1133
+ const { data } = useSelfFetch(url, {
1134
+ initialData,
1135
+ revalidateOnVisibleAfterMs: 6e4
1136
+ });
1137
+ const announcement = data?.announcement ?? null;
1138
+ const [expandedState, setExpandedState] = useState(() => initialAnnouncement != null);
1139
+ const expanded = previewMode ? announcement != null : expandedState;
1182
1140
  useEffect(() => {
1183
- const cached = getStoredAnnouncement(getCacheKey());
1184
- if (cached) {
1185
- const isDismissed = localStorage.getItem(getDismissKey(cached.id));
1186
- setAnnouncement(cached);
1187
- setIsVisible(!isDismissed);
1141
+ if (previewMode) return;
1142
+ clearLegacyAnnouncementCache(platform);
1143
+ }, []);
1144
+ useEffect(() => {
1145
+ if (previewMode) return;
1146
+ if (!announcement) {
1147
+ setExpandedState(false);
1148
+ return;
1149
+ }
1150
+ if (isAnnouncementDismissed(platform, announcement.id)) {
1151
+ dismissAnnouncement(platform, announcement.id);
1152
+ setExpandedState(false);
1153
+ } else {
1154
+ setExpandedState(true);
1188
1155
  }
1189
- if (!announcementsUrl) return;
1190
- fetchActiveAnnouncement();
1191
- const interval = setInterval(fetchActiveAnnouncement, 3e5);
1192
- return () => clearInterval(interval);
1193
- }, [announcementsUrl]);
1156
+ }, [data]);
1194
1157
  const handleDismiss = () => {
1195
- if (!announcement) return;
1196
- localStorage.setItem(getDismissKey(announcement.id), "true");
1197
- setIsVisible(false);
1158
+ if (previewMode || !announcement) return;
1159
+ dismissAnnouncement(platform, announcement.id);
1160
+ setExpandedState(false);
1198
1161
  };
1199
1162
  const handleCtaClick = () => {
1200
- if (!announcement?.cta_url) return;
1201
- announcement.cta_target === "_blank" ? window.open(announcement.cta_url, "_blank", "noopener,noreferrer") : window.location.href = announcement.cta_url;
1202
- };
1203
- const renderIcon = () => {
1204
- if (!announcement) return null;
1205
- return /* @__PURE__ */ jsx(
1206
- EntityIcon,
1207
- {
1208
- icon: {
1209
- name: announcement.icon_name || "openframe-logo",
1210
- url: announcement.icon_url,
1211
- props: announcement.icon_props
1212
- },
1213
- size: 32,
1214
- className: "relative shrink-0 w-6 h-6 md:w-8 md:h-8"
1215
- }
1216
- );
1163
+ if (previewMode || !announcement?.cta_url) return;
1164
+ let safeUrl;
1165
+ try {
1166
+ const parsed = new URL(announcement.cta_url, window.location.origin);
1167
+ if (parsed.protocol !== "http:" && parsed.protocol !== "https:") return;
1168
+ safeUrl = parsed.href;
1169
+ } catch {
1170
+ return;
1171
+ }
1172
+ announcement.cta_target === "_blank" ? window.open(safeUrl, "_blank", "noopener,noreferrer") : window.location.href = safeUrl;
1217
1173
  };
1218
- if (!announcement || !isVisible) return null;
1174
+ if (!announcement) return null;
1175
+ const themeScope = pickReadableTextColor(announcement.background_color) === "dark" ? "theme-light" : "theme-dark";
1176
+ const barButtonClasses = "text-[color:var(--ods-system-greys-white)] hover:bg-[var(--ods-system-greys-black-hover)] active:bg-[var(--ods-system-greys-black-action)]";
1177
+ const hasCta = Boolean(announcement.cta_enabled && announcement.cta_url);
1219
1178
  return /* @__PURE__ */ jsx(
1220
1179
  "div",
1221
1180
  {
1222
- className: "relative w-full z-50",
1223
- style: { backgroundColor: announcement.background_color },
1181
+ role: "region",
1182
+ "aria-label": "Announcement",
1183
+ "aria-hidden": !expanded,
1224
1184
  "data-announcement-bar": true,
1225
- children: /* @__PURE__ */ jsxs("div", { className: "flex items-center w-full max-w-full", children: [
1185
+ className: `relative w-full z-50 grid transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none ${className ?? ""}`,
1186
+ style: { gridTemplateRows: expanded ? "1fr" : "0fr" },
1187
+ children: /* @__PURE__ */ jsx("div", { className: `min-h-0 overflow-hidden ${themeScope}`, style: { backgroundColor: announcement.background_color }, children: /* @__PURE__ */ jsxs("div", { className: "flex items-center w-full max-w-full min-h-11 text-[color:var(--ods-system-greys-white)]", children: [
1226
1188
  /* @__PURE__ */ jsxs(
1227
1189
  "div",
1228
1190
  {
1229
- className: `flex flex-row gap-2 md:gap-4 items-center pl-4 md:pl-6 py-1.5 md:py-2 flex-1 min-w-0 ${announcement.cta_enabled && announcement.cta_url ? "md:cursor-default cursor-pointer" : ""}`,
1191
+ className: `flex flex-row gap-2 md:gap-3 items-center pl-4 md:pl-6 py-1.5 flex-1 min-w-0 ${hasCta ? "md:cursor-default cursor-pointer" : ""}`,
1230
1192
  onClick: (e) => {
1231
- if (window.innerWidth < 768 && announcement.cta_enabled && announcement.cta_url) {
1193
+ if (window.innerWidth < 768 && hasCta) {
1232
1194
  e.preventDefault();
1233
1195
  handleCtaClick();
1234
1196
  }
1235
1197
  },
1236
1198
  children: [
1237
- renderIcon(),
1238
- /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0 max-w-full", children: [
1239
- /* @__PURE__ */ jsx("p", { className: "font-body font-bold text-[14px] md:text-[18px] leading-tight tracking-tight mb-0 text-[#1A1A1A] truncate", children: announcement.title }),
1240
- /* @__PURE__ */ jsx("p", { className: "font-body text-[12px] md:text-[18px] leading-tight hidden md:block text-[#1A1A1A] truncate", children: announcement.description })
1199
+ /* @__PURE__ */ jsx(
1200
+ EntityIcon,
1201
+ {
1202
+ icon: {
1203
+ name: announcement.icon_name || "openframe-logo",
1204
+ url: announcement.icon_url,
1205
+ props: announcement.icon_props
1206
+ },
1207
+ size: 24,
1208
+ className: "relative shrink-0 w-5 h-5 md:w-6 md:h-6"
1209
+ }
1210
+ ),
1211
+ /* @__PURE__ */ jsxs("p", { className: "font-body flex-1 min-w-0 max-w-full text-[13px] md:text-sm leading-snug truncate mb-0", children: [
1212
+ /* @__PURE__ */ jsx("span", { className: "font-semibold", children: announcement.title }),
1213
+ announcement.description && /* @__PURE__ */ jsxs("span", { className: "hidden sm:inline opacity-80", children: [
1214
+ " \xB7 ",
1215
+ announcement.description
1216
+ ] })
1241
1217
  ] }),
1242
- announcement.cta_enabled && announcement.cta_text && announcement.cta_url && /* @__PURE__ */ jsx("div", { className: "hidden md:flex flex-shrink-0 ml-1 md:ml-2", children: /* @__PURE__ */ jsx(
1218
+ hasCta && announcement.cta_text && /* @__PURE__ */ jsx("div", { className: "hidden md:flex flex-shrink-0 ml-1", children: /* @__PURE__ */ jsx(
1243
1219
  Button,
1244
1220
  {
1245
1221
  onClick: handleCtaClick,
1246
- variant: "outline",
1247
- size: "small-legacy",
1222
+ variant: "transparent",
1223
+ size: "small",
1224
+ className: barButtonClasses,
1225
+ tabIndex: expanded ? 0 : -1,
1248
1226
  leftIcon: announcement.cta_show_icon && announcement.cta_icon_name ? /* @__PURE__ */ jsx(
1249
1227
  EntityIcon,
1250
1228
  {
1251
1229
  icon: { name: announcement.cta_icon_name, props: announcement.cta_icon_props },
1252
- size: 16,
1253
- className: "w-3 h-3 md:w-4 md:h-4"
1230
+ size: 14,
1231
+ className: "w-3.5 h-3.5"
1254
1232
  }
1255
1233
  ) : void 0,
1256
- className: "transition-opacity hover:opacity-90 text-xs md:text-sm whitespace-nowrap",
1257
- style: {
1258
- backgroundColor: announcement.cta_button_background_color || void 0,
1259
- color: announcement.cta_button_text_color || void 0,
1260
- borderColor: announcement.cta_button_background_color || void 0
1261
- },
1262
1234
  children: announcement.cta_text
1263
1235
  }
1264
1236
  ) })
1265
1237
  ]
1266
1238
  }
1267
1239
  ),
1268
- /* @__PURE__ */ jsx(
1269
- "button",
1240
+ /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 mr-1 md:mr-3", children: /* @__PURE__ */ jsx(
1241
+ Button,
1270
1242
  {
1271
1243
  onClick: (e) => {
1272
1244
  e.stopPropagation();
1273
1245
  handleDismiss();
1274
1246
  },
1275
- className: "flex-shrink-0 w-8 h-8 md:w-10 md:h-10 flex items-center justify-center hover:bg-[#1A1A1A]/10 focus:outline-none focus:ring-2 focus:ring-[#1A1A1A] mr-2 md:mr-4",
1247
+ variant: "transparent",
1248
+ size: "icon-sm",
1249
+ className: barButtonClasses,
1276
1250
  "aria-label": "Dismiss announcement",
1277
1251
  type: "button",
1278
- children: /* @__PURE__ */ jsx(X, { className: "w-4 h-4 text-[#1A1A1A]", strokeWidth: 2 })
1252
+ tabIndex: expanded ? 0 : -1,
1253
+ children: /* @__PURE__ */ jsx(X, { strokeWidth: 2 })
1279
1254
  }
1280
- )
1281
- ] })
1255
+ ) })
1256
+ ] }) })
1282
1257
  }
1283
1258
  );
1284
1259
  }