@flamingo-stack/openframe-frontend-core 0.0.408 → 0.0.409-snapshot.20260711140256
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.
- package/dist/components/announcement-bar.d.ts.map +1 -1
- package/dist/components/index.cjs +11 -5
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +11 -5
- package/dist/components/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/announcement-bar.tsx +19 -11
package/package.json
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
isAnnouncementDismissed,
|
|
10
10
|
clearLegacyAnnouncementCache,
|
|
11
11
|
} from '../utils/announcement-storage';
|
|
12
|
+
import { ANNOUNCEMENT_CTA_DEFAULTS } from '../types/announcement';
|
|
12
13
|
import type { Announcement, AnnouncementBarProps, AnnouncementResponse } from '../types/announcement';
|
|
13
14
|
import { getAppType } from '../utils/app-config';
|
|
14
15
|
import { useEndpointsRuntime } from '../contexts/endpoints-runtime-context';
|
|
@@ -175,7 +176,7 @@ export function AnnouncementBar({
|
|
|
175
176
|
aria-label="Announcement"
|
|
176
177
|
aria-hidden={!expanded}
|
|
177
178
|
data-announcement-bar
|
|
178
|
-
className={`relative w-full
|
|
179
|
+
className={`relative w-full grid transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none ${previewMode ? '' : 'z-50'} ${className ?? ''}`}
|
|
179
180
|
style={{ gridTemplateRows: expanded ? '1fr' : '0fr' }}
|
|
180
181
|
>
|
|
181
182
|
{/*
|
|
@@ -225,19 +226,26 @@ export function AnnouncementBar({
|
|
|
225
226
|
)}
|
|
226
227
|
</p>
|
|
227
228
|
|
|
228
|
-
{/* CTA - the common Button
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
229
|
+
{/* CTA - the common Button carrying the ADMIN-CONFIGURED colors
|
|
230
|
+
(cta_button_background_color / cta_button_text_color are an
|
|
231
|
+
admin FEATURE, defaults from ANNOUNCEMENT_CTA_DEFAULTS —
|
|
232
|
+
announcement colors are data, not token surfaces). Inline
|
|
233
|
+
styles win over the variant's hover classes on every state,
|
|
234
|
+
so hover feedback is opacity (the bar's original treatment);
|
|
235
|
+
nothing can render dark-on-dark. Hidden on mobile, where the
|
|
236
|
+
whole bar is the tap target. */}
|
|
234
237
|
{hasCta && displayAnnouncement.cta_text && (
|
|
235
|
-
<div className="hidden md:flex flex-shrink-0 ml-
|
|
238
|
+
<div className="hidden md:flex flex-shrink-0 ml-2 md:ml-4">
|
|
236
239
|
<Button
|
|
237
240
|
onClick={handleCtaClick}
|
|
238
|
-
variant="
|
|
241
|
+
variant="outline"
|
|
239
242
|
size="small"
|
|
240
|
-
className=
|
|
243
|
+
className="transition-opacity hover:opacity-90"
|
|
244
|
+
style={{
|
|
245
|
+
backgroundColor: displayAnnouncement.cta_button_background_color || ANNOUNCEMENT_CTA_DEFAULTS.background,
|
|
246
|
+
color: displayAnnouncement.cta_button_text_color || ANNOUNCEMENT_CTA_DEFAULTS.text,
|
|
247
|
+
borderColor: displayAnnouncement.cta_button_background_color || ANNOUNCEMENT_CTA_DEFAULTS.background,
|
|
248
|
+
}}
|
|
241
249
|
tabIndex={expanded ? 0 : -1}
|
|
242
250
|
leftIcon={
|
|
243
251
|
displayAnnouncement.cta_show_icon && displayAnnouncement.cta_icon_name
|
|
@@ -261,7 +269,7 @@ export function AnnouncementBar({
|
|
|
261
269
|
(size="icon-sm": 32px target, >= the 24px WCAG 2.5.8 AA floor,
|
|
262
270
|
16px glyph) with the bar's quiet tint hover. Inert in
|
|
263
271
|
previewMode. */}
|
|
264
|
-
<div className="flex-shrink-0
|
|
272
|
+
<div className="flex-shrink-0 ml-1 md:ml-2 mr-2 md:mr-4">
|
|
265
273
|
<Button
|
|
266
274
|
onClick={(e) => {
|
|
267
275
|
e.stopPropagation(); // Prevent triggering the mobile CTA click
|