@flamingo-stack/openframe-frontend-core 0.0.397-snapshot.20260710042522 → 0.0.397
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-LHICE5MK.js → chunk-2OOZASQE.js} +2 -2
- package/dist/{chunk-5SGIFYSA.js → chunk-3E4BDAHJ.js} +2 -2
- package/dist/{chunk-WRS7OVIT.cjs → chunk-43C5ECNT.cjs} +37 -37
- package/dist/{chunk-WRS7OVIT.cjs.map → chunk-43C5ECNT.cjs.map} +1 -1
- package/dist/{chunk-QOMEGWOM.cjs → chunk-55SNCMFS.cjs} +31 -31
- package/dist/{chunk-QOMEGWOM.cjs.map → chunk-55SNCMFS.cjs.map} +1 -1
- package/dist/{chunk-YSI6FXZH.cjs → chunk-BB7TZ6KS.cjs} +59 -59
- package/dist/{chunk-YSI6FXZH.cjs.map → chunk-BB7TZ6KS.cjs.map} +1 -1
- package/dist/{chunk-NLYOIYUB.js → chunk-CK5UZLIN.js} +3174 -3302
- package/dist/chunk-CK5UZLIN.js.map +1 -0
- package/dist/{chunk-PKRHMZBN.js → chunk-D4F7ZLJG.js} +4 -4
- package/dist/{chunk-XFOSQQKD.cjs → chunk-DB6CUWTL.cjs} +26 -26
- package/dist/{chunk-XFOSQQKD.cjs.map → chunk-DB6CUWTL.cjs.map} +1 -1
- package/dist/{chunk-XQ35TKEM.cjs → chunk-HPQKX5IW.cjs} +15 -15
- package/dist/{chunk-XQ35TKEM.cjs.map → chunk-HPQKX5IW.cjs.map} +1 -1
- package/dist/{chunk-KOIH637Y.js → chunk-IVXOR2IA.js} +2 -2
- package/dist/{chunk-WX3MHQRH.js → chunk-J6TAK6HE.js} +4 -4
- package/dist/{chunk-3MMYFUWX.js → chunk-JNU3YPLP.js} +4 -4
- package/dist/{chunk-QCUHIPG3.js → chunk-K5FRWPWF.js} +2 -2
- package/dist/{chunk-MBWSBKSG.cjs → chunk-M6NPDNVB.cjs} +26 -26
- package/dist/{chunk-MBWSBKSG.cjs.map → chunk-M6NPDNVB.cjs.map} +1 -1
- package/dist/{chunk-BIQH2W35.cjs → chunk-OAENYOKC.cjs} +9 -9
- package/dist/{chunk-BIQH2W35.cjs.map → chunk-OAENYOKC.cjs.map} +1 -1
- package/dist/{chunk-I4D6KJLI.cjs → chunk-SBWTMJPQ.cjs} +5 -5
- package/dist/{chunk-I4D6KJLI.cjs.map → chunk-SBWTMJPQ.cjs.map} +1 -1
- package/dist/{chunk-5IZDYGPU.cjs → chunk-T5F54MN4.cjs} +12 -12
- package/dist/{chunk-5IZDYGPU.cjs.map → chunk-T5F54MN4.cjs.map} +1 -1
- package/dist/{chunk-WR74UUVM.js → chunk-TTHTO5H5.js} +4 -4
- package/dist/{chunk-D3EAVXAQ.js → chunk-VTR4QDL2.js} +2 -2
- package/dist/{chunk-JAO2PKOU.js → chunk-WCDM226S.js} +2 -2
- package/dist/{chunk-THE2AFUN.cjs → chunk-XNAYZHPK.cjs} +62 -62
- package/dist/{chunk-THE2AFUN.cjs.map → chunk-XNAYZHPK.cjs.map} +1 -1
- package/dist/{chunk-Y2QAEMGF.cjs → chunk-Z6PAD2UN.cjs} +7 -7
- package/dist/{chunk-Y2QAEMGF.cjs.map → chunk-Z6PAD2UN.cjs.map} +1 -1
- package/dist/{chunk-MH5U4ZMV.js → chunk-ZFK4HHRX.js} +2 -2
- package/dist/{chunk-PZIZOFPY.cjs → chunk-ZUKBC2ZX.cjs} +23 -151
- package/dist/chunk-ZUKBC2ZX.cjs.map +1 -0
- 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 -6
- package/dist/components/features/index.cjs.map +1 -1
- package/dist/components/features/index.d.ts +0 -1
- package/dist/components/features/index.d.ts.map +1 -1
- package/dist/components/features/index.js +1 -5
- package/dist/components/features/video-bites-strip.d.ts.map +1 -1
- package/dist/components/features/video.d.ts +0 -7
- package/dist/components/features/video.d.ts.map +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 +120 -126
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +9 -15
- package/dist/components/index.js.map +1 -1
- package/dist/components/media-carousel.d.ts.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/index.cjs +2 -4
- package/dist/components/ui/index.cjs.map +1 -1
- package/dist/components/ui/index.d.ts +0 -1
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +1 -3
- package/dist/components/ui/tab-navigation.d.ts +2 -6
- package/dist/components/ui/tab-navigation.d.ts.map +1 -1
- package/dist/index.cjs +2 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -7
- package/package.json +4 -4
- package/src/components/features/index.ts +0 -1
- package/src/components/features/video-bites-strip.tsx +15 -73
- package/src/components/features/video.tsx +7 -51
- package/src/components/media-carousel.tsx +4 -2
- package/src/components/ui/index.ts +0 -1
- package/src/components/ui/tab-navigation.tsx +14 -31
- package/src/styles/app-globals.css +0 -23
- package/dist/chunk-NLYOIYUB.js.map +0 -1
- package/dist/chunk-PZIZOFPY.cjs.map +0 -1
- package/dist/components/features/video-center-badge.d.ts +0 -36
- package/dist/components/features/video-center-badge.d.ts.map +0 -1
- package/dist/components/ui/crossfade-panels.d.ts +0 -52
- package/dist/components/ui/crossfade-panels.d.ts.map +0 -1
- package/src/components/features/video-center-badge.tsx +0 -76
- package/src/components/ui/crossfade-panels.tsx +0 -88
- /package/dist/{chunk-LHICE5MK.js.map → chunk-2OOZASQE.js.map} +0 -0
- /package/dist/{chunk-5SGIFYSA.js.map → chunk-3E4BDAHJ.js.map} +0 -0
- /package/dist/{chunk-PKRHMZBN.js.map → chunk-D4F7ZLJG.js.map} +0 -0
- /package/dist/{chunk-KOIH637Y.js.map → chunk-IVXOR2IA.js.map} +0 -0
- /package/dist/{chunk-WX3MHQRH.js.map → chunk-J6TAK6HE.js.map} +0 -0
- /package/dist/{chunk-3MMYFUWX.js.map → chunk-JNU3YPLP.js.map} +0 -0
- /package/dist/{chunk-QCUHIPG3.js.map → chunk-K5FRWPWF.js.map} +0 -0
- /package/dist/{chunk-WR74UUVM.js.map → chunk-TTHTO5H5.js.map} +0 -0
- /package/dist/{chunk-D3EAVXAQ.js.map → chunk-VTR4QDL2.js.map} +0 -0
- /package/dist/{chunk-JAO2PKOU.js.map → chunk-WCDM226S.js.map} +0 -0
- /package/dist/{chunk-MH5U4ZMV.js.map → chunk-ZFK4HHRX.js.map} +0 -0
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* THE center media glyphs — the single visual identity for every play/unmute
|
|
3
|
-
* affordance over video, across the whole project: a SOLID WHITE GLYPH
|
|
4
|
-
* (`text-ods-text-primary`), NO background disc, with a soft drop-shadow for
|
|
5
|
-
* legibility over arbitrary frames.
|
|
6
|
-
*
|
|
7
|
-
* Consumers:
|
|
8
|
-
* - <VideoBiteCard> resting/paused posters (md)
|
|
9
|
-
* - <YouTubeFacade> poster (lg)
|
|
10
|
-
* - <MediaCarousel> video thumbnails (sm)
|
|
11
|
-
* - <FilePlayer>'s unmute chip (VideoUnmuteGlyph, md)
|
|
12
|
-
* - MuxPlayer's native center pre-play button is stripped to the same bare
|
|
13
|
-
* white glyph via CSS (`mux-player::part(center play button)` in
|
|
14
|
-
* styles/app-globals.css) so full players match too.
|
|
15
|
-
*
|
|
16
|
-
* Glyph paths are media-chrome's own (filled triangle / filled volume-off) so
|
|
17
|
-
* the replica and the real player chrome stay pixel-consistent.
|
|
18
|
-
*/
|
|
19
|
-
import React from 'react';
|
|
20
|
-
export type VideoCenterBadgeSize = 'sm' | 'md' | 'lg';
|
|
21
|
-
export interface VideoPlayBadgeProps {
|
|
22
|
-
size?: VideoCenterBadgeSize;
|
|
23
|
-
className?: string;
|
|
24
|
-
}
|
|
25
|
-
/** Bare white play glyph (media-chrome's filled triangle). Decorative
|
|
26
|
-
* (`pointer-events-none`) — the host surface owns activation. */
|
|
27
|
-
export declare function VideoPlayBadge({ size, className }: VideoPlayBadgeProps): React.ReactElement;
|
|
28
|
-
export interface VideoUnmuteGlyphProps {
|
|
29
|
-
size?: VideoCenterBadgeSize;
|
|
30
|
-
className?: string;
|
|
31
|
-
}
|
|
32
|
-
/** Bare white muted-volume glyph (filled, material volume_off — the same
|
|
33
|
-
* family as media-chrome's mute icon). Rendered by FilePlayer's unmute
|
|
34
|
-
* button; exported here so play + unmute share one identity. */
|
|
35
|
-
export declare function VideoUnmuteGlyph({ size, className }: VideoUnmuteGlyphProps): React.ReactElement;
|
|
36
|
-
//# sourceMappingURL=video-center-badge.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"video-center-badge.d.ts","sourceRoot":"","sources":["../../../src/components/features/video-center-badge.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,MAAM,MAAM,oBAAoB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;AAWrD,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE,oBAAoB,CAAA;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;kEACkE;AAClE,wBAAgB,cAAc,CAAC,EAAE,IAAW,EAAE,SAAS,EAAE,EAAE,mBAAmB,GAAG,KAAK,CAAC,YAAY,CAWlG;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,EAAE,oBAAoB,CAAA;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;iEAEiE;AACjE,wBAAgB,gBAAgB,CAAC,EAAE,IAAW,EAAE,SAAS,EAAE,EAAE,qBAAqB,GAAG,KAAK,CAAC,YAAY,CAYtG"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* <CrossfadePanels> — THE keep-mounted tab-panel stack: every panel stays in
|
|
3
|
-
* the DOM, stacked in the SAME grid cell, and switching is an opacity
|
|
4
|
-
* crossfade. Use it under any tab control (TabNavigation, TabSelector, …)
|
|
5
|
-
* whenever panels are content surfaces where height stability and a soft
|
|
6
|
-
* switch matter (strips, media rails, dashboards-in-view).
|
|
7
|
-
*
|
|
8
|
-
* Invariants encoded HERE exactly once (so no consumer re-derives them):
|
|
9
|
-
* - HEIGHT LOCK: grid items in one cell size the row to max(panel heights) —
|
|
10
|
-
* switching never shifts the page (no CLS), and surrounding layout treats
|
|
11
|
-
* the stack as one constant-height block.
|
|
12
|
-
* - FADE-THEN-HIDE: `visibility` transitions alongside `opacity`; per the CSS
|
|
13
|
-
* transitions spec's special visibility interpolation the outgoing panel
|
|
14
|
-
* stays paintable until the fade completes, THEN becomes `hidden` — no
|
|
15
|
-
* pop-out, and the settled hidden panel is fully removed from paint.
|
|
16
|
-
* - DEAD WHILE HIDDEN: `inert` + `aria-hidden` + `pointer-events-none` on
|
|
17
|
-
* inactive panels — no tab-stops, no screen-reader content, no hover/click
|
|
18
|
-
* leaks from the invisible layer (WCAG aria-hidden-focus).
|
|
19
|
-
* - MOTION RESPECT: `prefers-reduced-motion` collapses the fade to an
|
|
20
|
-
* instant swap.
|
|
21
|
-
* - The ACTIVE panel takes `z-[1]` so the incoming layer composites on top
|
|
22
|
-
* during the crossfade regardless of DOM order.
|
|
23
|
-
*
|
|
24
|
-
* This deliberately complements (not replaces) <TabContent>, which MOUNTS one
|
|
25
|
-
* panel at a time — right for heavy admin surfaces that should unmount when
|
|
26
|
-
* hidden. CrossfadePanels is for surfaces whose panels are cheap enough to
|
|
27
|
-
* keep alive and whose switch must be seamless.
|
|
28
|
-
*
|
|
29
|
-
* NOTE for marquee/animated panel content: hidden panels stay mounted and
|
|
30
|
-
* their animations keep running unless the content self-pauses. CardsStrip
|
|
31
|
-
* panels are fine (its rAF gates on near-viewport + visibility), but a
|
|
32
|
-
* consumer embedding heavier always-on content should pause it via its own
|
|
33
|
-
* visibility signal.
|
|
34
|
-
*/
|
|
35
|
-
import React from 'react';
|
|
36
|
-
export interface CrossfadePanel {
|
|
37
|
-
id: string;
|
|
38
|
-
content: React.ReactNode;
|
|
39
|
-
}
|
|
40
|
-
export interface CrossfadePanelsProps {
|
|
41
|
-
/** Which panel is shown. Unknown id → all panels hidden (renders the
|
|
42
|
-
* stack's reserved height, nothing visible). */
|
|
43
|
-
activeId: string | undefined;
|
|
44
|
-
panels: ReadonlyArray<CrossfadePanel>;
|
|
45
|
-
/** Crossfade duration in ms. Default 300. */
|
|
46
|
-
durationMs?: number;
|
|
47
|
-
className?: string;
|
|
48
|
-
/** Extra classes for every panel wrapper (e.g. `min-w-0` is built in). */
|
|
49
|
-
panelClassName?: string;
|
|
50
|
-
}
|
|
51
|
-
export declare function CrossfadePanels({ activeId, panels, durationMs, className, panelClassName, }: CrossfadePanelsProps): React.JSX.Element | null;
|
|
52
|
-
//# sourceMappingURL=crossfade-panels.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"crossfade-panels.d.ts","sourceRoot":"","sources":["../../../src/components/ui/crossfade-panels.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,KAAK,CAAC,SAAS,CAAA;CACzB;AAED,MAAM,WAAW,oBAAoB;IACnC;qDACiD;IACjD,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B,MAAM,EAAE,aAAa,CAAC,cAAc,CAAC,CAAA;IACrC,6CAA6C;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,0EAA0E;IAC1E,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AAED,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,MAAM,EACN,UAAgB,EAChB,SAAS,EACT,cAAc,GACf,EAAE,oBAAoB,4BAwBtB"}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* THE center media glyphs — the single visual identity for every play/unmute
|
|
5
|
-
* affordance over video, across the whole project: a SOLID WHITE GLYPH
|
|
6
|
-
* (`text-ods-text-primary`), NO background disc, with a soft drop-shadow for
|
|
7
|
-
* legibility over arbitrary frames.
|
|
8
|
-
*
|
|
9
|
-
* Consumers:
|
|
10
|
-
* - <VideoBiteCard> resting/paused posters (md)
|
|
11
|
-
* - <YouTubeFacade> poster (lg)
|
|
12
|
-
* - <MediaCarousel> video thumbnails (sm)
|
|
13
|
-
* - <FilePlayer>'s unmute chip (VideoUnmuteGlyph, md)
|
|
14
|
-
* - MuxPlayer's native center pre-play button is stripped to the same bare
|
|
15
|
-
* white glyph via CSS (`mux-player::part(center play button)` in
|
|
16
|
-
* styles/app-globals.css) so full players match too.
|
|
17
|
-
*
|
|
18
|
-
* Glyph paths are media-chrome's own (filled triangle / filled volume-off) so
|
|
19
|
-
* the replica and the real player chrome stay pixel-consistent.
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
import React from 'react'
|
|
23
|
-
import { cn } from '../../utils/cn'
|
|
24
|
-
|
|
25
|
-
export type VideoCenterBadgeSize = 'sm' | 'md' | 'lg'
|
|
26
|
-
|
|
27
|
-
const SIZES: Record<VideoCenterBadgeSize, number> = {
|
|
28
|
-
sm: 20, // gallery thumbnails
|
|
29
|
-
md: 56, // strip cards + unmute chip
|
|
30
|
-
lg: 64, // hero facades
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/** Soft legibility shadow — NOT a background (per design: bare glyphs). */
|
|
34
|
-
const GLYPH_SHADOW = 'drop-shadow(0 1px 4px rgba(0,0,0,0.5))'
|
|
35
|
-
|
|
36
|
-
export interface VideoPlayBadgeProps {
|
|
37
|
-
size?: VideoCenterBadgeSize
|
|
38
|
-
className?: string
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/** Bare white play glyph (media-chrome's filled triangle). Decorative
|
|
42
|
-
* (`pointer-events-none`) — the host surface owns activation. */
|
|
43
|
-
export function VideoPlayBadge({ size = 'md', className }: VideoPlayBadgeProps): React.ReactElement {
|
|
44
|
-
return (
|
|
45
|
-
<div
|
|
46
|
-
className={cn('pointer-events-none flex items-center justify-center text-ods-text-primary transition-colors', className)}
|
|
47
|
-
style={{ filter: GLYPH_SHADOW }}
|
|
48
|
-
>
|
|
49
|
-
<svg aria-hidden viewBox="0 0 24 24" fill="currentColor" style={{ width: SIZES[size], height: SIZES[size] }}>
|
|
50
|
-
<path d="m6 21 15-9L6 3v18Z" />
|
|
51
|
-
</svg>
|
|
52
|
-
</div>
|
|
53
|
-
)
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export interface VideoUnmuteGlyphProps {
|
|
57
|
-
size?: VideoCenterBadgeSize
|
|
58
|
-
className?: string
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/** Bare white muted-volume glyph (filled, material volume_off — the same
|
|
62
|
-
* family as media-chrome's mute icon). Rendered by FilePlayer's unmute
|
|
63
|
-
* button; exported here so play + unmute share one identity. */
|
|
64
|
-
export function VideoUnmuteGlyph({ size = 'md', className }: VideoUnmuteGlyphProps): React.ReactElement {
|
|
65
|
-
return (
|
|
66
|
-
<svg
|
|
67
|
-
aria-hidden
|
|
68
|
-
viewBox="0 0 24 24"
|
|
69
|
-
fill="currentColor"
|
|
70
|
-
className={className}
|
|
71
|
-
style={{ width: SIZES[size], height: SIZES[size], filter: GLYPH_SHADOW }}
|
|
72
|
-
>
|
|
73
|
-
<path d="M16.5 12A4.5 4.5 0 0 0 14 7.97v2.21l2.45 2.45c.03-.2.05-.41.05-.63Zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51A8.796 8.796 0 0 0 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71ZM4.27 3 3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06a8.99 8.99 0 0 0 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3ZM12 4 9.91 6.09 12 8.18V4Z" />
|
|
74
|
-
</svg>
|
|
75
|
-
)
|
|
76
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* <CrossfadePanels> — THE keep-mounted tab-panel stack: every panel stays in
|
|
5
|
-
* the DOM, stacked in the SAME grid cell, and switching is an opacity
|
|
6
|
-
* crossfade. Use it under any tab control (TabNavigation, TabSelector, …)
|
|
7
|
-
* whenever panels are content surfaces where height stability and a soft
|
|
8
|
-
* switch matter (strips, media rails, dashboards-in-view).
|
|
9
|
-
*
|
|
10
|
-
* Invariants encoded HERE exactly once (so no consumer re-derives them):
|
|
11
|
-
* - HEIGHT LOCK: grid items in one cell size the row to max(panel heights) —
|
|
12
|
-
* switching never shifts the page (no CLS), and surrounding layout treats
|
|
13
|
-
* the stack as one constant-height block.
|
|
14
|
-
* - FADE-THEN-HIDE: `visibility` transitions alongside `opacity`; per the CSS
|
|
15
|
-
* transitions spec's special visibility interpolation the outgoing panel
|
|
16
|
-
* stays paintable until the fade completes, THEN becomes `hidden` — no
|
|
17
|
-
* pop-out, and the settled hidden panel is fully removed from paint.
|
|
18
|
-
* - DEAD WHILE HIDDEN: `inert` + `aria-hidden` + `pointer-events-none` on
|
|
19
|
-
* inactive panels — no tab-stops, no screen-reader content, no hover/click
|
|
20
|
-
* leaks from the invisible layer (WCAG aria-hidden-focus).
|
|
21
|
-
* - MOTION RESPECT: `prefers-reduced-motion` collapses the fade to an
|
|
22
|
-
* instant swap.
|
|
23
|
-
* - The ACTIVE panel takes `z-[1]` so the incoming layer composites on top
|
|
24
|
-
* during the crossfade regardless of DOM order.
|
|
25
|
-
*
|
|
26
|
-
* This deliberately complements (not replaces) <TabContent>, which MOUNTS one
|
|
27
|
-
* panel at a time — right for heavy admin surfaces that should unmount when
|
|
28
|
-
* hidden. CrossfadePanels is for surfaces whose panels are cheap enough to
|
|
29
|
-
* keep alive and whose switch must be seamless.
|
|
30
|
-
*
|
|
31
|
-
* NOTE for marquee/animated panel content: hidden panels stay mounted and
|
|
32
|
-
* their animations keep running unless the content self-pauses. CardsStrip
|
|
33
|
-
* panels are fine (its rAF gates on near-viewport + visibility), but a
|
|
34
|
-
* consumer embedding heavier always-on content should pause it via its own
|
|
35
|
-
* visibility signal.
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
|
-
import React from 'react'
|
|
39
|
-
import { cn } from '../../utils/cn'
|
|
40
|
-
|
|
41
|
-
export interface CrossfadePanel {
|
|
42
|
-
id: string
|
|
43
|
-
content: React.ReactNode
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export interface CrossfadePanelsProps {
|
|
47
|
-
/** Which panel is shown. Unknown id → all panels hidden (renders the
|
|
48
|
-
* stack's reserved height, nothing visible). */
|
|
49
|
-
activeId: string | undefined
|
|
50
|
-
panels: ReadonlyArray<CrossfadePanel>
|
|
51
|
-
/** Crossfade duration in ms. Default 300. */
|
|
52
|
-
durationMs?: number
|
|
53
|
-
className?: string
|
|
54
|
-
/** Extra classes for every panel wrapper (e.g. `min-w-0` is built in). */
|
|
55
|
-
panelClassName?: string
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export function CrossfadePanels({
|
|
59
|
-
activeId,
|
|
60
|
-
panels,
|
|
61
|
-
durationMs = 300,
|
|
62
|
-
className,
|
|
63
|
-
panelClassName,
|
|
64
|
-
}: CrossfadePanelsProps) {
|
|
65
|
-
if (panels.length === 0) return null
|
|
66
|
-
return (
|
|
67
|
-
<div className={cn('grid w-full', className)}>
|
|
68
|
-
{panels.map(p => {
|
|
69
|
-
const active = p.id === activeId
|
|
70
|
-
return (
|
|
71
|
-
<div
|
|
72
|
-
key={p.id}
|
|
73
|
-
className={cn(
|
|
74
|
-
'col-start-1 row-start-1 min-w-0 transition-[opacity,visibility] ease-out motion-reduce:transition-none',
|
|
75
|
-
active ? 'visible opacity-100 z-[1]' : 'invisible opacity-0 pointer-events-none',
|
|
76
|
-
panelClassName,
|
|
77
|
-
)}
|
|
78
|
-
style={{ transitionDuration: `${durationMs}ms` }}
|
|
79
|
-
aria-hidden={!active || undefined}
|
|
80
|
-
inert={!active || undefined}
|
|
81
|
-
>
|
|
82
|
-
{p.content}
|
|
83
|
-
</div>
|
|
84
|
-
)
|
|
85
|
-
})}
|
|
86
|
-
</div>
|
|
87
|
-
)
|
|
88
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|