@flamingo-stack/openframe-frontend-core 0.0.475-snapshot.20260724134853 → 0.0.475
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/{chunk-KZMCU7VV.cjs → chunk-3W6A7LST.cjs} +11 -11
- package/dist/{chunk-KZMCU7VV.cjs.map → chunk-3W6A7LST.cjs.map} +1 -1
- package/dist/{chunk-MRBIBDHA.js → chunk-3WBREJMR.js} +4 -4
- package/dist/{chunk-LKLU2CQK.cjs → chunk-5ICXBR62.cjs} +62 -62
- package/dist/{chunk-LKLU2CQK.cjs.map → chunk-5ICXBR62.cjs.map} +1 -1
- package/dist/{chunk-2DBCYHR2.js → chunk-5IQXLG4H.js} +2 -2
- package/dist/{chunk-XIU3CWJU.cjs → chunk-5U7MG3CZ.cjs} +31 -31
- package/dist/{chunk-XIU3CWJU.cjs.map → chunk-5U7MG3CZ.cjs.map} +1 -1
- package/dist/{chunk-BLDESYTK.cjs → chunk-7CU7Y3ML.cjs} +26 -26
- package/dist/{chunk-BLDESYTK.cjs.map → chunk-7CU7Y3ML.cjs.map} +1 -1
- package/dist/{chunk-6HX7VHJB.js → chunk-A6O75SLQ.js} +2 -2
- package/dist/{chunk-STE3BZNL.cjs → chunk-AIUIIKH2.cjs} +15 -15
- package/dist/{chunk-STE3BZNL.cjs.map → chunk-AIUIIKH2.cjs.map} +1 -1
- package/dist/{chunk-EAQ7OR4F.js → chunk-BQPZQQPC.js} +19 -31
- package/dist/chunk-BQPZQQPC.js.map +1 -0
- package/dist/{chunk-A6LCWFMD.cjs → chunk-DEHW3LYM.cjs} +19 -31
- package/dist/chunk-DEHW3LYM.cjs.map +1 -0
- package/dist/{chunk-V7RX7TBT.cjs → chunk-DJAPOTAY.cjs} +59 -59
- package/dist/{chunk-V7RX7TBT.cjs.map → chunk-DJAPOTAY.cjs.map} +1 -1
- package/dist/{chunk-GPSRQWSQ.js → chunk-E42Y3ZAL.js} +2 -2
- package/dist/{chunk-O5N2L456.cjs → chunk-E4CNWKZ3.cjs} +7 -7
- package/dist/{chunk-O5N2L456.cjs.map → chunk-E4CNWKZ3.cjs.map} +1 -1
- package/dist/{chunk-TTDO3TQ2.cjs → chunk-HJV4VCEZ.cjs} +5 -5
- package/dist/{chunk-TTDO3TQ2.cjs.map → chunk-HJV4VCEZ.cjs.map} +1 -1
- package/dist/{chunk-ET7T7IW6.js → chunk-LM57R7B4.js} +2 -2
- package/dist/{chunk-BKIUYOWZ.js → chunk-NJGLBKCR.js} +4 -4
- package/dist/{chunk-LW5H6F2L.js → chunk-PQT3NIDA.js} +4 -4
- package/dist/{chunk-MNWFO65E.cjs → chunk-QM3DRG5I.cjs} +9 -9
- package/dist/{chunk-MNWFO65E.cjs.map → chunk-QM3DRG5I.cjs.map} +1 -1
- package/dist/{chunk-YCKRFXJV.js → chunk-R7JJ7PHN.js} +2 -2
- package/dist/{chunk-VOUXI6JT.js → chunk-S4VEPOX2.js} +2 -2
- package/dist/{chunk-SD443M2O.cjs → chunk-SZNK5Q4A.cjs} +37 -37
- package/dist/{chunk-SD443M2O.cjs.map → chunk-SZNK5Q4A.cjs.map} +1 -1
- package/dist/{chunk-VL2BNPJW.cjs → chunk-W5UZSGJY.cjs} +26 -26
- package/dist/{chunk-VL2BNPJW.cjs.map → chunk-W5UZSGJY.cjs.map} +1 -1
- package/dist/{chunk-K33RUATC.js → chunk-WEFPQFUO.js} +4 -4
- package/dist/{chunk-AE4ZR75U.js → chunk-YRZZ7HHJ.js} +2 -2
- package/dist/components/announcement-bar.d.ts +0 -15
- package/dist/components/announcement-bar.d.ts.map +1 -1
- package/dist/components/case-studies/index.cjs +8 -8
- package/dist/components/case-studies/index.js +2 -2
- package/dist/components/chat/index.cjs +2 -2
- package/dist/components/chat/index.js +1 -1
- package/dist/components/contact/index.cjs +3 -3
- package/dist/components/contact/index.js +2 -2
- package/dist/components/docs/index.cjs +5 -5
- package/dist/components/docs/index.js +4 -4
- package/dist/components/embeds/index.cjs +3 -3
- package/dist/components/embeds/index.js +2 -2
- package/dist/components/faq/index.cjs +3 -3
- package/dist/components/faq/index.js +2 -2
- package/dist/components/features/index.cjs +2 -2
- package/dist/components/features/index.js +1 -1
- package/dist/components/help-center-pages/index.cjs +20 -20
- package/dist/components/help-center-pages/index.js +11 -11
- package/dist/components/index.cjs +160 -155
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +39 -34
- package/dist/components/index.js.map +1 -1
- package/dist/components/navigation/index.cjs +2 -2
- package/dist/components/navigation/index.js +1 -1
- package/dist/components/onboarding-guides/index.cjs +5 -5
- package/dist/components/onboarding-guides/index.js +4 -4
- package/dist/components/related-content/index.cjs +3 -3
- package/dist/components/related-content/index.js +2 -2
- package/dist/components/tickets/index.cjs +5 -5
- package/dist/components/tickets/index.js +4 -4
- package/dist/components/ui/announcement-bar-view.d.ts +26 -47
- package/dist/components/ui/announcement-bar-view.d.ts.map +1 -1
- package/dist/components/ui/index.cjs +2 -2
- package/dist/components/ui/index.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/components/announcement-bar.tsx +40 -48
- package/src/components/ui/announcement-bar-view.tsx +42 -99
- package/dist/chunk-A6LCWFMD.cjs.map +0 -1
- package/dist/chunk-EAQ7OR4F.js.map +0 -1
- /package/dist/{chunk-MRBIBDHA.js.map → chunk-3WBREJMR.js.map} +0 -0
- /package/dist/{chunk-2DBCYHR2.js.map → chunk-5IQXLG4H.js.map} +0 -0
- /package/dist/{chunk-6HX7VHJB.js.map → chunk-A6O75SLQ.js.map} +0 -0
- /package/dist/{chunk-GPSRQWSQ.js.map → chunk-E42Y3ZAL.js.map} +0 -0
- /package/dist/{chunk-ET7T7IW6.js.map → chunk-LM57R7B4.js.map} +0 -0
- /package/dist/{chunk-BKIUYOWZ.js.map → chunk-NJGLBKCR.js.map} +0 -0
- /package/dist/{chunk-LW5H6F2L.js.map → chunk-PQT3NIDA.js.map} +0 -0
- /package/dist/{chunk-YCKRFXJV.js.map → chunk-R7JJ7PHN.js.map} +0 -0
- /package/dist/{chunk-VOUXI6JT.js.map → chunk-S4VEPOX2.js.map} +0 -0
- /package/dist/{chunk-K33RUATC.js.map → chunk-WEFPQFUO.js.map} +0 -0
- /package/dist/{chunk-AE4ZR75U.js.map → chunk-YRZZ7HHJ.js.map} +0 -0
|
@@ -3,142 +3,85 @@
|
|
|
3
3
|
import type { CSSProperties, ReactElement, ReactNode } from 'react';
|
|
4
4
|
import { cn } from '../../utils/cn';
|
|
5
5
|
|
|
6
|
-
/**
|
|
7
|
-
* Mirrors `screens.md` in tailwind.config.ts (800px), which is also where the
|
|
8
|
-
* ODS responsive tokens step up (ods-responsive-tokens.css). ONE breakpoint
|
|
9
|
-
* for the whole bar: the `md:` variants below and the `onContentClick` guard
|
|
10
|
-
* must never disagree (they did before — the guard read a stale 768px while
|
|
11
|
-
* the CSS switched at 800px).
|
|
12
|
-
*/
|
|
13
|
-
const MD_QUERY = '(min-width: 800px)';
|
|
14
|
-
|
|
15
6
|
export interface AnnouncementBarViewProps {
|
|
16
7
|
/**
|
|
17
8
|
* Leading slot — typically an icon, at content width before the title. Size
|
|
18
|
-
* it in the slot: the bar's icon
|
|
19
|
-
*
|
|
9
|
+
* it in the slot: the bar's icon is 16px below `md` (must not exceed the
|
|
10
|
+
* 20px title row, Figma 9418-52387) and 24px from `md` up.
|
|
20
11
|
*/
|
|
21
12
|
startAdornment?: ReactNode;
|
|
22
13
|
/**
|
|
23
|
-
* Bar message
|
|
24
|
-
*
|
|
25
|
-
*
|
|
14
|
+
* Bar message. A plain string gets the mockup's text treatment (`text-h4` =
|
|
15
|
+
* DM Sans 500, 14/20 below `md` and 18/24 from `md` up), wrapping below `md`
|
|
16
|
+
* and truncating to one line from `md` up. Pass a ReactElement to own the
|
|
17
|
+
* markup (e.g. bold title + inline description) — mirror that responsive
|
|
18
|
+
* wrap/truncate pair in your element.
|
|
26
19
|
*/
|
|
27
20
|
title?: string | ReactElement;
|
|
28
21
|
/**
|
|
29
|
-
* Primary CTA
|
|
30
|
-
*
|
|
31
|
-
*
|
|
22
|
+
* Primary CTA. From `md` up it sits inline at content width between the
|
|
23
|
+
* title and `endAdornment`; below `md` it moves to its own full-width row
|
|
24
|
+
* under the content (Figma 2862-8391) and the bar's height grows to fit.
|
|
32
25
|
*/
|
|
33
26
|
actionBlock?: ReactElement;
|
|
34
|
-
/** Trailing slot (e.g. a dismiss button)
|
|
27
|
+
/** Trailing slot (e.g. a dismiss button) — stays in the top/content row on every breakpoint. */
|
|
35
28
|
endAdornment?: ReactElement;
|
|
36
|
-
/**
|
|
37
|
-
* Below `md` only: fires when the content row is tapped, standing in for the
|
|
38
|
-
* `actionBlock` that is CSS-hidden at that width. No-op from `md` up, where
|
|
39
|
-
* the CTA is visible and owns the interaction.
|
|
40
|
-
*/
|
|
41
|
-
onContentClick?: () => void;
|
|
42
|
-
/** Extra classes for the padded content row (e.g. a cursor affordance). */
|
|
43
|
-
contentClassName?: string;
|
|
44
29
|
/** Surface styling (background, text color, theme scope) is the consumer's — pass it here. */
|
|
45
30
|
className?: string;
|
|
46
31
|
style?: CSSProperties;
|
|
47
32
|
}
|
|
48
33
|
|
|
49
34
|
/**
|
|
50
|
-
* ============================================================================
|
|
51
|
-
* DO NOT REDESIGN THIS BAR. THIS IS THE FINAL, OWNER-APPROVED DESIGN.
|
|
52
|
-
* ============================================================================
|
|
53
|
-
* The 44px single-line strip below is DELIBERATE and has already been
|
|
54
|
-
* regressed and reverted. Read this before you touch a single class:
|
|
55
|
-
*
|
|
56
|
-
* - #1542 (Michael Assraf) RESTORED this exact 44px / text-h6 / compact-CTA
|
|
57
|
-
* design after it drifted.
|
|
58
|
-
* - #1545 "redesigned" it into a 56px, text-h4, stacked-mobile bar.
|
|
59
|
-
* - #1551 REVERTED #1545's UI wholesale, back to THIS.
|
|
60
|
-
*
|
|
61
|
-
* Do NOT:
|
|
62
|
-
* - bump the height (min-h-11 / 44px), the text scale (text-h6), the icon
|
|
63
|
-
* size (20/24px), or the CTA size (compact),
|
|
64
|
-
* - re-introduce a stacked / multi-row / full-width-CTA mobile layout,
|
|
65
|
-
* - "match a new mockup", "improve", "modernize", or "clean up" any of it.
|
|
66
|
-
*
|
|
67
|
-
* This design is the source of truth. A Figma frame is NOT authorization to
|
|
68
|
-
* change it. If you genuinely believe it must change, get Michael's explicit
|
|
69
|
-
* written sign-off on the PR FIRST — otherwise your change WILL be reverted
|
|
70
|
-
* again, exactly like #1545 was. Touch it and you own the revert.
|
|
71
|
-
* ============================================================================
|
|
72
|
-
*
|
|
73
35
|
* Pure presentational announcement/notification bar. No data fetching,
|
|
74
36
|
* storage, or navigation — consumers own state and pass content through slots.
|
|
75
37
|
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
38
|
+
* Layout (Figma 9418-52494 desktop/tablet, 2862-8391 mobile):
|
|
39
|
+
* - `md` (800px) and up: ONE row inside a strip with a RESERVED 56px minimum
|
|
40
|
+
* height (`md:min-h-14`, the mockup's strip height) — held unconditionally,
|
|
41
|
+
* so toggling or removing the action never resizes the bar on
|
|
42
|
+
* desktop/tablet. Title truncates to one line.
|
|
43
|
+
* - Below `md`: the container stacks (`px` 16 / `py` 8 / gap 8). Top row =
|
|
44
|
+
* `startAdornment` + wrapping title + `endAdornment`; when an `actionBlock`
|
|
45
|
+
* is present it renders as a VISIBLE full-width button on its own second
|
|
46
|
+
* row and the bar's height adapts to content (76px with a single-line
|
|
47
|
+
* title and CTA per Figma 9418-52387: 8 + 20 + 8 + 32 + 8).
|
|
48
|
+
*
|
|
49
|
+
* The `actionBlock` element is mounted in both positions (inline `md`-up slot
|
|
50
|
+
* and the mobile full-width row); exactly one is `display:none` at any width,
|
|
51
|
+
* so keyboard/AT always reach exactly one control.
|
|
82
52
|
*/
|
|
83
53
|
export function AnnouncementBarView({
|
|
84
54
|
startAdornment,
|
|
85
55
|
title,
|
|
86
56
|
actionBlock,
|
|
87
57
|
endAdornment,
|
|
88
|
-
onContentClick,
|
|
89
|
-
contentClassName,
|
|
90
58
|
className,
|
|
91
59
|
style,
|
|
92
60
|
}: AnnouncementBarViewProps) {
|
|
93
|
-
const handleContentClick = onContentClick
|
|
94
|
-
? () => {
|
|
95
|
-
if (!window.matchMedia(MD_QUERY).matches) onContentClick();
|
|
96
|
-
}
|
|
97
|
-
: undefined;
|
|
98
|
-
|
|
99
61
|
return (
|
|
100
|
-
<div
|
|
101
|
-
{
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
62
|
+
<div
|
|
63
|
+
className={cn(
|
|
64
|
+
'flex w-full max-w-full flex-col gap-[var(--spacing-system-s)] px-[var(--spacing-system-l)] py-[var(--spacing-system-s)] md:min-h-14 md:flex-row md:items-center md:py-0',
|
|
65
|
+
className,
|
|
66
|
+
)}
|
|
67
|
+
style={style}
|
|
68
|
+
>
|
|
69
|
+
{/* Content row: leading icon + title (+ inline CTA from `md`) + trailing
|
|
70
|
+
slot. `items-start` below `md` keeps the adornments pinned to the
|
|
71
|
+
first text line when the title wraps; `md:items-center` re-centers
|
|
72
|
+
everything in the fixed strip. */}
|
|
73
|
+
<div className="flex w-full min-w-0 flex-1 items-start gap-[var(--spacing-system-s)] md:w-auto md:items-center">
|
|
110
74
|
{startAdornment && <div className="flex shrink-0 items-center">{startAdornment}</div>}
|
|
111
75
|
{typeof title === 'string' ? (
|
|
112
|
-
<p className="mb-0 min-w-0 max-w-full flex-1
|
|
76
|
+
<p className="mb-0 min-w-0 max-w-full flex-1 break-words text-h4 md:truncate">{title}</p>
|
|
113
77
|
) : (
|
|
114
78
|
title != null && <div className="min-w-0 max-w-full flex-1">{title}</div>
|
|
115
79
|
)}
|
|
116
|
-
{
|
|
117
|
-
|
|
118
|
-
it is only visually hidden there (`sr-only`) and reveals itself on
|
|
119
|
-
focus — the row stays the touch affordance while Tab still reaches
|
|
120
|
-
a real, labelled control. `md:` restores the normal inline CTA.
|
|
121
|
-
|
|
122
|
-
The wrapper stops click propagation: below `md` the CTA lives INSIDE
|
|
123
|
-
the content row (which owns `onContentClick`), so a keyboard/AT
|
|
124
|
-
activation of the revealed button would bubble up and fire the row
|
|
125
|
-
handler too — and both resolve to the same CTA action, opening two
|
|
126
|
-
tabs for `target="_blank"`. Stopping here keeps the row tap target
|
|
127
|
-
for empty space while making the button the sole handler when hit. */}
|
|
128
|
-
{actionBlock && (
|
|
129
|
-
<div
|
|
130
|
-
className="ml-[var(--spacing-system-m)] sr-only shrink-0 focus-within:not-sr-only md:not-sr-only md:flex"
|
|
131
|
-
onClick={(e) => e.stopPropagation()}
|
|
132
|
-
>
|
|
133
|
-
{actionBlock}
|
|
134
|
-
</div>
|
|
135
|
-
)}
|
|
80
|
+
{actionBlock && <div className="hidden shrink-0 md:flex">{actionBlock}</div>}
|
|
81
|
+
{endAdornment && <div className="flex shrink-0 items-center">{endAdornment}</div>}
|
|
136
82
|
</div>
|
|
137
|
-
{/*
|
|
138
|
-
|
|
139
|
-
{endAdornment && (
|
|
140
|
-
<div className="ml-[var(--spacing-system-xs)] mr-[var(--spacing-system-m)] shrink-0">{endAdornment}</div>
|
|
141
|
-
)}
|
|
83
|
+
{/* Mobile-only action row — the CTA stretched to the bar's full width. */}
|
|
84
|
+
{actionBlock && <div className="flex w-full md:hidden [&>*]:w-full">{actionBlock}</div>}
|
|
142
85
|
</div>
|
|
143
86
|
);
|
|
144
87
|
}
|