@flamingo-stack/openframe-frontend-core 0.0.389 → 0.0.390-snapshot.20260709094308

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 (99) hide show
  1. package/dist/{chunk-VXJBE5NX.cjs → chunk-2LHLX7GH.cjs} +59 -59
  2. package/dist/{chunk-VXJBE5NX.cjs.map → chunk-2LHLX7GH.cjs.map} +1 -1
  3. package/dist/{chunk-WIMXB5EU.js → chunk-3ML4WLFP.js} +4 -4
  4. package/dist/{chunk-7MKU2EB4.cjs → chunk-5SBJ77M7.cjs} +26 -26
  5. package/dist/{chunk-7MKU2EB4.cjs.map → chunk-5SBJ77M7.cjs.map} +1 -1
  6. package/dist/{chunk-BJPQJNSC.js → chunk-7W3B6ZGK.js} +4 -4
  7. package/dist/{chunk-2JCSORCJ.cjs → chunk-BIWPZS54.cjs} +26 -26
  8. package/dist/{chunk-2JCSORCJ.cjs.map → chunk-BIWPZS54.cjs.map} +1 -1
  9. package/dist/{chunk-ZFZAHLI4.cjs → chunk-C5BJFGOU.cjs} +7 -7
  10. package/dist/{chunk-ZFZAHLI4.cjs.map → chunk-C5BJFGOU.cjs.map} +1 -1
  11. package/dist/{chunk-3JQUNKWY.cjs → chunk-CLXHPRN2.cjs} +15 -15
  12. package/dist/{chunk-3JQUNKWY.cjs.map → chunk-CLXHPRN2.cjs.map} +1 -1
  13. package/dist/{chunk-KA4WXCN3.js → chunk-DRWFCYDM.js} +4 -4
  14. package/dist/{chunk-CQXHHVMR.js → chunk-DV5O2VU7.js} +2 -2
  15. package/dist/{chunk-TQZLC3BQ.cjs → chunk-DVDB5FJ7.cjs} +5 -5
  16. package/dist/{chunk-TQZLC3BQ.cjs.map → chunk-DVDB5FJ7.cjs.map} +1 -1
  17. package/dist/{chunk-EHTE3CTT.cjs → chunk-EI45U7WT.cjs} +37 -37
  18. package/dist/{chunk-EHTE3CTT.cjs.map → chunk-EI45U7WT.cjs.map} +1 -1
  19. package/dist/{chunk-LFLFQ422.js → chunk-HATQB5CS.js} +2 -2
  20. package/dist/{chunk-Q4YGG3CL.cjs → chunk-KC5MY4HW.cjs} +31 -31
  21. package/dist/{chunk-Q4YGG3CL.cjs.map → chunk-KC5MY4HW.cjs.map} +1 -1
  22. package/dist/{chunk-4OLIDOLO.js → chunk-LC3W676Z.js} +2 -2
  23. package/dist/{chunk-M6ODI2F5.js → chunk-N6LX6CYY.js} +2 -2
  24. package/dist/{chunk-JSFHTIKA.js → chunk-OKUDGO3Q.js} +2 -2
  25. package/dist/{chunk-OBKCQ7LA.cjs → chunk-RBFGCUWO.cjs} +62 -62
  26. package/dist/{chunk-OBKCQ7LA.cjs.map → chunk-RBFGCUWO.cjs.map} +1 -1
  27. package/dist/{chunk-XGOX5UQ2.js → chunk-SI6DI5HC.js} +4 -4
  28. package/dist/{chunk-MIEODAAV.cjs → chunk-TIJP7OPH.cjs} +9 -9
  29. package/dist/{chunk-MIEODAAV.cjs.map → chunk-TIJP7OPH.cjs.map} +1 -1
  30. package/dist/{chunk-GNB5ERZP.cjs → chunk-VFK5CZNU.cjs} +1025 -974
  31. package/dist/chunk-VFK5CZNU.cjs.map +1 -0
  32. package/dist/{chunk-IDWKP5H5.js → chunk-VIKH44M7.js} +1492 -1441
  33. package/dist/chunk-VIKH44M7.js.map +1 -0
  34. package/dist/{chunk-NULFIYK2.js → chunk-WL4YNYJN.js} +2 -2
  35. package/dist/{chunk-44Q3IXZM.js → chunk-Y6SVPXGD.js} +2 -2
  36. package/dist/{chunk-MPOP47ME.cjs → chunk-ZLMIJ3EN.cjs} +12 -12
  37. package/dist/{chunk-MPOP47ME.cjs.map → chunk-ZLMIJ3EN.cjs.map} +1 -1
  38. package/dist/components/case-studies/index.cjs +8 -8
  39. package/dist/components/case-studies/index.js +2 -2
  40. package/dist/components/chat/index.cjs +2 -2
  41. package/dist/components/chat/index.js +1 -1
  42. package/dist/components/contact/index.cjs +3 -3
  43. package/dist/components/contact/index.js +2 -2
  44. package/dist/components/docs/index.cjs +5 -5
  45. package/dist/components/docs/index.js +4 -4
  46. package/dist/components/embeds/index.cjs +3 -3
  47. package/dist/components/embeds/index.js +2 -2
  48. package/dist/components/faq/index.cjs +3 -3
  49. package/dist/components/faq/index.js +2 -2
  50. package/dist/components/features/auth/accept-invitation-form.d.ts +2 -2
  51. package/dist/components/features/auth/accept-invitation-form.d.ts.map +1 -1
  52. package/dist/components/features/index.cjs +2 -2
  53. package/dist/components/features/index.js +1 -1
  54. package/dist/components/features/notifications/notification-drawer.d.ts.map +1 -1
  55. package/dist/components/features/time-tracker/time-tracker-header-button.d.ts +5 -2
  56. package/dist/components/features/time-tracker/time-tracker-header-button.d.ts.map +1 -1
  57. package/dist/components/help-center-pages/index.cjs +20 -20
  58. package/dist/components/help-center-pages/index.js +11 -11
  59. package/dist/components/index.cjs +120 -120
  60. package/dist/components/index.js +9 -9
  61. package/dist/components/navigation/app-header.d.ts.map +1 -1
  62. package/dist/components/navigation/app-layout-context.d.ts +34 -0
  63. package/dist/components/navigation/app-layout-context.d.ts.map +1 -0
  64. package/dist/components/navigation/app-layout-drawer.d.ts.map +1 -1
  65. package/dist/components/navigation/app-layout.d.ts +2 -21
  66. package/dist/components/navigation/app-layout.d.ts.map +1 -1
  67. package/dist/components/navigation/index.cjs +2 -2
  68. package/dist/components/navigation/index.js +1 -1
  69. package/dist/components/onboarding-guides/index.cjs +5 -5
  70. package/dist/components/onboarding-guides/index.js +4 -4
  71. package/dist/components/related-content/index.cjs +3 -3
  72. package/dist/components/related-content/index.js +2 -2
  73. package/dist/components/tickets/index.cjs +5 -5
  74. package/dist/components/tickets/index.js +4 -4
  75. package/dist/components/ui/index.cjs +2 -2
  76. package/dist/components/ui/index.js +1 -1
  77. package/dist/index.cjs +2 -2
  78. package/dist/index.js +1 -1
  79. package/package.json +1 -1
  80. package/src/components/features/auth/accept-invitation-form.tsx +4 -4
  81. package/src/components/features/notifications/notification-drawer.tsx +72 -43
  82. package/src/components/features/time-tracker/time-tracker-header-button.tsx +46 -6
  83. package/src/components/navigation/app-header.tsx +13 -9
  84. package/src/components/navigation/app-layout-context.ts +46 -0
  85. package/src/components/navigation/app-layout-drawer.tsx +21 -11
  86. package/src/components/navigation/app-layout.tsx +17 -39
  87. package/dist/chunk-GNB5ERZP.cjs.map +0 -1
  88. package/dist/chunk-IDWKP5H5.js.map +0 -1
  89. /package/dist/{chunk-WIMXB5EU.js.map → chunk-3ML4WLFP.js.map} +0 -0
  90. /package/dist/{chunk-BJPQJNSC.js.map → chunk-7W3B6ZGK.js.map} +0 -0
  91. /package/dist/{chunk-KA4WXCN3.js.map → chunk-DRWFCYDM.js.map} +0 -0
  92. /package/dist/{chunk-CQXHHVMR.js.map → chunk-DV5O2VU7.js.map} +0 -0
  93. /package/dist/{chunk-LFLFQ422.js.map → chunk-HATQB5CS.js.map} +0 -0
  94. /package/dist/{chunk-4OLIDOLO.js.map → chunk-LC3W676Z.js.map} +0 -0
  95. /package/dist/{chunk-M6ODI2F5.js.map → chunk-N6LX6CYY.js.map} +0 -0
  96. /package/dist/{chunk-JSFHTIKA.js.map → chunk-OKUDGO3Q.js.map} +0 -0
  97. /package/dist/{chunk-XGOX5UQ2.js.map → chunk-SI6DI5HC.js.map} +0 -0
  98. /package/dist/{chunk-NULFIYK2.js.map → chunk-WL4YNYJN.js.map} +0 -0
  99. /package/dist/{chunk-44Q3IXZM.js.map → chunk-Y6SVPXGD.js.map} +0 -0
@@ -1,8 +1,14 @@
1
1
  'use client'
2
2
 
3
3
  import * as PopoverPrimitive from '@radix-ui/react-popover'
4
+ import { useEffect, useRef } from 'react'
4
5
  import { cn } from '../../../utils/cn'
5
6
  import { ClockHistoryIcon } from '../../icons-v2-generated/date-and-time/clock-history-icon'
7
+ import {
8
+ type AppLayoutDrawerHandle,
9
+ useAppLayoutDrawerContainer,
10
+ useAppLayoutDrawerCoordination,
11
+ } from '../../navigation/app-layout-context'
6
12
  import { HeaderButton } from '../../navigation/header-button'
7
13
  import { OVERLAY_BACKDROP_CLASS } from '../../ui/drawer'
8
14
  import { TimeTrackerPanel } from './time-tracker-panel'
@@ -19,8 +25,11 @@ export interface TimeTrackerHeaderButtonProps {
19
25
  * Header affordance for the time tracker. Renders nothing unless wrapped in a
20
26
  * `<TimeTrackerProvider>`. The trigger is the standard `HeaderButton`; when a
21
27
  * session is active it also shows the live elapsed time. The popup is a Radix
22
- * Popover anchored under the button (not a modal/drawer), backed by the same
23
- * dim overlay as the Drawer so all panels darken the page identically.
28
+ * Popover anchored under the button (not a modal/drawer). Inside AppLayout the
29
+ * dim backdrop covers only the main content area (header and sidebar stay
30
+ * interactive) and the popup joins the layout's panel coordination — opening
31
+ * it closes any open in-layout drawer and vice versa. Outside AppLayout it
32
+ * falls back to a viewport-wide backdrop.
24
33
  */
25
34
  export function TimeTrackerHeaderButton({ className, disabled }: TimeTrackerHeaderButtonProps) {
26
35
  const ctx = useOptionalTimeTracker()
@@ -29,10 +38,38 @@ export function TimeTrackerHeaderButton({ className, disabled }: TimeTrackerHead
29
38
  runningSince: ctx?.runningSince,
30
39
  accumulatedMs: ctx?.accumulatedMs,
31
40
  })
41
+ const layoutContainer = useAppLayoutDrawerContainer()
42
+ const coordination = useAppLayoutDrawerCoordination()
43
+
44
+ const isOpen = ctx?.isOpen ?? false
45
+ const isOpenRef = useRef(isOpen)
46
+ isOpenRef.current = isOpen
47
+ const closeRef = useRef(ctx?.close)
48
+ closeRef.current = ctx?.close
49
+ // Stable handle: the same object must be registered AND passed as `self`
50
+ // to notifyDrawerDidOpen so the coordinator can skip it when closing the
51
+ // other panels.
52
+ const selfHandleRef = useRef<AppLayoutDrawerHandle | null>(null)
53
+ if (!selfHandleRef.current) {
54
+ selfHandleRef.current = {
55
+ close: () => {
56
+ if (isOpenRef.current) closeRef.current?.()
57
+ },
58
+ }
59
+ }
60
+
61
+ useEffect(() => {
62
+ if (isOpen) coordination?.notifyDrawerDidOpen(selfHandleRef.current ?? undefined)
63
+ }, [isOpen, coordination])
64
+
65
+ useEffect(() => {
66
+ if (!selfHandleRef.current) return
67
+ return coordination?.registerDrawer(selfHandleRef.current)
68
+ }, [coordination])
32
69
 
33
70
  if (!ctx) return null
34
71
 
35
- const { isOpen, open, close, status } = ctx
72
+ const { open, close, status } = ctx
36
73
  const isPaused = status === 'paused'
37
74
  const isActive = status === 'tracking' || isPaused
38
75
 
@@ -72,13 +109,16 @@ export function TimeTrackerHeaderButton({ className, disabled }: TimeTrackerHead
72
109
  </PopoverPrimitive.Trigger>
73
110
  {/* Popovers have no built-in overlay — portal a dim backdrop behind the
74
111
  panel. Clicks land on it (outside Content), so Radix still closes the
75
- popover. Own Portal: Radix's Portal slots a single child. */}
76
- <PopoverPrimitive.Portal>
112
+ popover. Own Portal: Radix's Portal slots a single child. Inside
113
+ AppLayout the backdrop portals into the main-area container (absolute,
114
+ AppLayoutDrawer-overlay tier) so header/sidebar stay undimmed and
115
+ interactive; standalone it dims the whole viewport. */}
116
+ <PopoverPrimitive.Portal container={layoutContainer ?? undefined}>
77
117
  <div
78
118
  aria-hidden="true"
79
119
  data-state={isOpen ? 'open' : 'closed'}
80
120
  className={cn(
81
- 'fixed inset-0 z-[1299]',
121
+ layoutContainer ? 'absolute inset-0 z-[102]' : 'fixed inset-0 z-[1299]',
82
122
  OVERLAY_BACKDROP_CLASS,
83
123
  'data-[state=open]:animate-in data-[state=open]:fade-in-0',
84
124
  'data-[state=closed]:animate-out data-[state=closed]:fade-out-0',
@@ -251,16 +251,20 @@ function NotificationsHeaderButton({
251
251
  return (
252
252
  <HeaderButton
253
253
  icon={
254
- <div className="relative w-4 h-4 md:w-6 md:h-6">
255
- <BellIcon className="w-full h-full" />
256
- {hasUnread && (
257
- <span
258
- className="absolute top-0 right-0 bg-ods-warning rounded-full w-1.5 h-1.5 md:w-2 md:h-2"
259
- />
260
- )}
261
- </div>
254
+ isActive ? (
255
+ <XmarkIcon className="w-4 h-4 md:w-6 md:h-6" />
256
+ ) : (
257
+ <div className="relative w-4 h-4 md:w-6 md:h-6">
258
+ <BellIcon className="w-full h-full" />
259
+ {hasUnread && (
260
+ <span
261
+ className="absolute top-0 right-0 bg-ods-warning rounded-full w-1.5 h-1.5 md:w-2 md:h-2"
262
+ />
263
+ )}
264
+ </div>
265
+ )
262
266
  }
263
- aria-label="Notifications"
267
+ aria-label={isActive ? 'Close notifications' : 'Notifications'}
264
268
  onClick={onClick}
265
269
  isActive={isActive}
266
270
  disabled={disabled || !onClick}
@@ -0,0 +1,46 @@
1
+ 'use client'
2
+
3
+ import { createContext, useContext } from 'react'
4
+
5
+ /**
6
+ * Container element that wraps `<main>` and serves as the portal target for
7
+ * `AppLayoutDrawer`. Drawers rendered into this container sit on top of the
8
+ * main content area only — the sidebar and header remain visible and
9
+ * interactive. Null when AppLayout hasn't mounted (or when used outside of it).
10
+ *
11
+ * Lives in its own module (not app-layout.tsx) so in-layout panels
12
+ * (AppLayoutDrawer, NotificationDrawer, TimeTrackerHeaderButton) can consume
13
+ * these contexts without importing AppLayout itself — AppLayout renders those
14
+ * panels, so importing it back would create a module cycle.
15
+ */
16
+ export const AppLayoutDrawerContainerContext = createContext<HTMLElement | null>(null)
17
+
18
+ export function useAppLayoutDrawerContainer(): HTMLElement | null {
19
+ return useContext(AppLayoutDrawerContainerContext)
20
+ }
21
+
22
+ /**
23
+ * Coordination between AppLayout's in-layout panels (`AppLayoutDrawer`, the
24
+ * time-tracker popup) and the mobile burger menu. At most ONE of them may be
25
+ * open at a time — each dims the main area, so stacking them reads as broken:
26
+ * - a panel that opens calls `notifyDrawerDidOpen(self)` so the layout
27
+ * closes the burger menu AND every other registered panel;
28
+ * - each panel registers a close handle so opening the menu via the burger
29
+ * button (or another panel) closes it. Null outside of AppLayout.
30
+ */
31
+ export interface AppLayoutDrawerHandle {
32
+ close: () => void
33
+ }
34
+
35
+ export interface AppLayoutDrawerCoordination {
36
+ /** `self` is skipped when closing the other registered panels. */
37
+ notifyDrawerDidOpen: (self?: AppLayoutDrawerHandle) => void
38
+ /** Returns an unregister cleanup. */
39
+ registerDrawer: (handle: AppLayoutDrawerHandle) => () => void
40
+ }
41
+
42
+ export const AppLayoutDrawerCoordinationContext = createContext<AppLayoutDrawerCoordination | null>(null)
43
+
44
+ export function useAppLayoutDrawerCoordination(): AppLayoutDrawerCoordination | null {
45
+ return useContext(AppLayoutDrawerCoordinationContext)
46
+ }
@@ -14,7 +14,11 @@ import {
14
14
  OVERLAY_BACKDROP_CLASS,
15
15
  type DrawerSide,
16
16
  } from "../ui/drawer"
17
- import { useAppLayoutDrawerContainer, useAppLayoutDrawerCoordination } from "./app-layout"
17
+ import {
18
+ type AppLayoutDrawerHandle,
19
+ useAppLayoutDrawerContainer,
20
+ useAppLayoutDrawerCoordination,
21
+ } from "./app-layout-context"
18
22
 
19
23
  /**
20
24
  * AppLayoutDrawer is a Drawer variant that renders **inside** AppLayout's main
@@ -68,26 +72,32 @@ const AppLayoutDrawerRoot = ({
68
72
  [isControlled, onOpenChange],
69
73
  )
70
74
 
71
- // Coordinate with AppLayout's mobile burger menu (the drawer covers it):
72
- // opening the drawer closes the menu, and opening the menu closes the
73
- // drawer via the registered close handle. Refs keep the registration
74
- // effect independent of render-to-render identity changes.
75
+ // Coordinate with AppLayout's other in-layout panels and the mobile burger
76
+ // menu: opening this drawer closes them, and opening any of them closes
77
+ // this drawer via the registered close handle. Refs keep the handle
78
+ // identity stable across renders the same object must be registered AND
79
+ // passed as `self` so the coordinator can skip it when closing the rest.
75
80
  const coordination = useAppLayoutDrawerCoordination()
76
81
  const openRef = React.useRef(open)
77
82
  openRef.current = open
78
83
  const handleOpenChangeRef = React.useRef(handleOpenChange)
79
84
  handleOpenChangeRef.current = handleOpenChange
85
+ const selfHandleRef = React.useRef<AppLayoutDrawerHandle | null>(null)
86
+ if (!selfHandleRef.current) {
87
+ selfHandleRef.current = {
88
+ close: () => {
89
+ if (openRef.current) handleOpenChangeRef.current(false)
90
+ },
91
+ }
92
+ }
80
93
 
81
94
  React.useEffect(() => {
82
- if (open) coordination?.notifyDrawerDidOpen()
95
+ if (open) coordination?.notifyDrawerDidOpen(selfHandleRef.current ?? undefined)
83
96
  }, [open, coordination])
84
97
 
85
98
  React.useEffect(() => {
86
- return coordination?.registerDrawer({
87
- close: () => {
88
- if (openRef.current) handleOpenChangeRef.current(false)
89
- },
90
- })
99
+ if (!selfHandleRef.current) return
100
+ return coordination?.registerDrawer(selfHandleRef.current)
91
101
  }, [coordination])
92
102
 
93
103
  return (
@@ -1,50 +1,21 @@
1
1
  'use client'
2
2
 
3
- import { createContext, Suspense, useCallback, useContext, useMemo, useRef, useState } from 'react'
3
+ import { Suspense, useCallback, useMemo, useRef, useState } from 'react'
4
4
  import { NavigationSidebarConfig } from '../../types/navigation'
5
5
  import { cn } from '../../utils'
6
6
  import { NotificationDrawer } from '../features/notifications/notification-drawer'
7
7
  import { AppHeader, AppHeaderProps } from './app-header'
8
+ import {
9
+ AppLayoutDrawerContainerContext,
10
+ type AppLayoutDrawerCoordination,
11
+ AppLayoutDrawerCoordinationContext,
12
+ type AppLayoutDrawerHandle,
13
+ } from './app-layout-context'
8
14
  import { MobileBurgerMenu, MobileBurgerMenuProps } from './mobile-burger-menu'
9
15
  import { NavigationSidebar } from './navigation-sidebar'
10
16
 
11
- /**
12
- * Container element that wraps `<main>` and serves as the portal target for
13
- * `AppLayoutDrawer`. Drawers rendered into this container sit on top of the
14
- * main content area only — the sidebar and header remain visible and
15
- * interactive. Null when AppLayout hasn't mounted (or when used outside of it).
16
- */
17
- const AppLayoutDrawerContainerContext = createContext<HTMLElement | null>(null)
18
-
19
- export function useAppLayoutDrawerContainer(): HTMLElement | null {
20
- return useContext(AppLayoutDrawerContainerContext)
21
- }
22
-
23
- /**
24
- * Two-way coordination between AppLayout's mobile burger menu and in-layout
25
- * drawers (`AppLayoutDrawer`), which render above the menu (z-[103] vs
26
- * z-[101]) — the two must never be open at the same time:
27
- * - a drawer that opens calls `notifyDrawerDidOpen` so the layout closes
28
- * the menu (otherwise it would resurface once the drawer closes);
29
- * - each drawer registers a close handle so opening the menu via the
30
- * burger button closes any open drawer instead of hiding the menu
31
- * underneath it. Null outside of AppLayout.
32
- */
33
- export interface AppLayoutDrawerHandle {
34
- close: () => void
35
- }
36
-
37
- interface AppLayoutDrawerCoordination {
38
- notifyDrawerDidOpen: () => void
39
- /** Returns an unregister cleanup. */
40
- registerDrawer: (handle: AppLayoutDrawerHandle) => () => void
41
- }
42
-
43
- const AppLayoutDrawerCoordinationContext = createContext<AppLayoutDrawerCoordination | null>(null)
44
-
45
- export function useAppLayoutDrawerCoordination(): AppLayoutDrawerCoordination | null {
46
- return useContext(AppLayoutDrawerCoordinationContext)
47
- }
17
+ export { useAppLayoutDrawerContainer, useAppLayoutDrawerCoordination } from './app-layout-context'
18
+ export type { AppLayoutDrawerHandle } from './app-layout-context'
48
19
 
49
20
  export interface AppLayoutProps {
50
21
  children: React.ReactNode
@@ -113,7 +84,14 @@ export function AppLayout({
113
84
  }, [])
114
85
 
115
86
  const drawerCoordination = useMemo<AppLayoutDrawerCoordination>(() => ({
116
- notifyDrawerDidOpen: () => setMobileMenuOpen(false),
87
+ notifyDrawerDidOpen: (self) => {
88
+ setMobileMenuOpen(false)
89
+ // Only one in-layout panel may be open at a time — each dims the main
90
+ // area, so stacking them reads as broken.
91
+ for (const handle of drawerHandlesRef.current) {
92
+ if (handle !== self) handle.close()
93
+ }
94
+ },
117
95
  registerDrawer: (handle) => {
118
96
  drawerHandlesRef.current.add(handle)
119
97
  return () => drawerHandlesRef.current.delete(handle)